morphogen.homogenization.paths

Loading paths: macroscopic loadings that vary in time, and the responses to them.

A path gives, at increasing times, the value of each macroscopic component, prescribed as a strain or as a stress (the other one is then an unknown, solved for), and the change of temperature; values vary linearly in time between them. The first time is the natural state: zero strain, stress and change of temperature. Uniaxial tension at a strain rate, creep under a stress, relaxation, cycles or thermal histories are paths.

class morphogen.homogenization.paths.LoadingPath(times: tuple[float, ...], values: tuple[tuple[float, ...], ...], controls: tuple[bool, ...], temperature: tuple[float, ...] = (), increments: tuple[int, ...] = ())[source]

Bases: object

History of a macroscopic loading of elasticity.

At the times (increasing; the first one is the natural state), values gives the six Voigt components (11, 22, 33, 23, 31, 12; engineering shear strains), prescribed as strains where controls is true and as stresses elsewhere, and temperature the change of temperature. Each segment between two times is divided into increments steps (the solver divides a step further when it does not converge).

classmethod from_spec(spec) → LoadingPath[source]

Path of a configuration mapping: times, increments (one per segment, or one for all), strain and stress (component -> values at the times, or one value reached at the end of the first segment and held; the first value, zero, may be omitted) and temperature (likewise). Components not given are free: zero stress. {"times": [0, 10], "strain": {"11": 0.02}} is a uniaxial tension at the strain rate 0.002.

classmethod parse(text: str) → LoadingPath[source]

Path of a compact text: t=0,10,20 n=10 E11=0,0.02,0 S12=0 dT=0,50,50: the times t, the increments n (one, or one per segment), strain E and stress S components and the change of temperature dT at the times (or one value reached at the end of the first segment and held); the components not given are free (zero stress).

classmethod uniaxial(axis: int, *, times, strain=None, stress=None, increments=10, temperature=None) → LoadingPath[source]

Tension (compression) along axis: its strain (or stress) at the times, the other stress components zero.

property strain_controlled: ndarray
property duration: float
at(t: float) → tuple[ndarray, float][source]

Values of the components and change of temperature at the time t.

schedule() → ndarray[source]

Times at the end of the planned steps.

to_dict() → dict[source]
class morphogen.homogenization.paths.PathResult(name: str, bc: str, path: LoadingPath, times: ndarray, strain: ndarray, stress: ndarray, temperature: ndarray, plastic: ndarray, phases: dict = <factory>, iterations: ndarray = <factory>, info: dict = <factory>, fields: dict = <factory>, support: object | None = None, kinematics: str = 'small', cauchy: ndarray | None = None, log_strain: ndarray | None = None, porosity: ndarray | None = None, series: dict = <factory>, scalars: dict = <factory>, orientation: ndarray | None = None)[source]

Bases: object

Macroscopic response of a volume element (or of a material point) along a path.

times (n), strain and stress (n x 6, Voigt; engineering shear strains), temperature and plastic (the mean cumulated plastic strain of the material) at each converged step, the first one the natural state; phases: for each phase, its mean stress, strain and plastic strain at each step; iterations: Newton iterations of each step; fields: element fields at some times (time -> name -> array) on support.

In finite strains (kinematics="finite"), strain holds the components 11, 22, 33, 23, 13, 12 of the upper triangular macroscopic displacement gradient F - I (nominal strains and simple shears) and stress those of the mean first Piola-Kirchhoff stress (nominal stresses); cauchy holds the Cauchy (true) stress and log_strain the logarithmic (true) strain, and each phase its mean cauchy stress. With porous plastic materials, porosity holds the mean porosity of their points at each step, and each porous phase its mean porosity.

series: the other curves that a solver records at each step (name -> values: the area in contact of the walls of a cell that close, ContactCell), columns of rows() and quantities of value() as the others.

orientation: for a material point that is a crystal, in finite strains or where its twins turn it, the Bunge angles (degrees) of its lattice at each step (n x 3; the columns phi1, Phi and phi2 of rows()). The lattices of the crystals of a volume element are in its fields (orientation): texture().

scalars: dict

final values (components()) and quantities of value()

Type:

other scalar results of the path, by name (the fatigue of its cycle)

property n_steps: int
property finite: bool
rows() → list[dict][source]

The curves, one row per step: time, E11 ... E12, S11 ... S12, in finite strains the logarithmic strains LE11 ... and the Cauchy stresses TS11 ..., the change of temperature, the mean cumulated plastic strain (and porosity f), the mean stress (and Cauchy stress) and plastic strain (and porosity) of each phase, and the other curves recorded (series).

driven() → int[source]

The component of the loading: that whose prescribed strain varies most along the path (of its prescribed stresses, without a prescribed strain).

texture(time: float | None = None)[source]

The lattices of the crystals at a time of the path (the nearest of those of its fields; the last one by default): their orientations (Bunge angles in degrees, m x 3) and their volumes (m), for the pole figures of morphogen.texture. The crystals are the elements of a mesh or the voxels of an image whose fields have an orientation (crystals in finite strains, or whose twins turn their lattices; the paths run with fields), or the material point of orientation.

strength(component: int | None = None, upto: int | None = None) → float[source]

The largest stress (in absolute value) reached along the path, up to the step upto, of a component: by default that of the loading (driven()). The strength of a volume element that softens (damage, fracture), its flow stress otherwise.

work(upto: int | None = None) → float[source]

The work of the macroscopic stress per unit volume along the path, int Sigma : dE (trapezoids over the steps; nominal stresses and strains in finite strains), up to the step upto: the energy stored and dissipated; at the end of a path that breaks the volume element, its work of fracture.

value(name: str, time: float | None = None) → float[source]

Value of a quantity of the curves (a column of rows(): E11, S11, TS11, p, S11_1…) at the end of the path, or at time: the end of one of its steps; or strength and work, the largest stress of the loading and the work done up to there (strength(), work()).

components() → dict[str, float][source]

Final values: E11 ... E12, S11 ... S12 (in finite strains also LE11 ... and TS11 ...), the mean cumulated plastic strain p and the other curves recorded (series).

row() → dict[source]

Summary record (long format): final values and solver data.

class morphogen.homogenization.paths.PathQuantity(path: str, quantity: str, time: float | None = None, bc: str | None = None)[source]

Bases: object

A quantity of the curves of a loading path, for the statistics of RVE studies: a column of PathResult.rows() (S11, TS11, p, S11_1…) at the end of the path, or at time, the end of one of its steps (the flow stress at a given strain, say), under every boundary condition, or under bc only.

Written <path>.<quantity> or <path>.<quantity>@<time>: tension.S11@5 is S11 of the path tension at the time 5; .<bc> follows for one boundary condition (tension.S11@5.periodic).

property name: str

Name of the series of the quantity (without the boundary condition).

property key: str
of(result: PathResult) → float[source]

The quantity in a response to the path.