morphogen.homogenization.materials

Materials of the phases: linear (thermo-)elasticity and the transport phenomena of one scalar potential (heat conduction, electrical conduction, dielectric and magnetic polarization, diffusion), isotropic or anisotropic (crystals), and voids.

Every transport phenomenon is a flux proportional to the gradient of a potential, flux = -K grad(potential) without sources (TRANSPORT): Fourier’s law (q = -k grad T, the conductivity), Ohm’s law (j = -sigma grad V, the electrical_conductivity), electrostatics (D = -eps grad V, the permittivity), magnetostatics without currents (B = -mu grad psi, the permeability) and Fick’s law (J = -D grad c, the diffusivity). They share their solvers, their boundary conditions and their bounds; a phase whose coefficient is zero is inert for that physics (an insulator), as a void is for all.

Thermal expansion makes the stress sigma = D (eps - alpha dT) for a change of temperature dT from the stress-free state; a crystal’s expansion tensor turns with it.

An isotropic elastic material may also yield: von Mises elasto-(visco)plasticity with isotropic and kinematic hardening (Plasticity, for the loading paths of morphogen.homogenization.nonlinear), or porous elasto-(visco)plasticity (Gurson-Tvergaard-Needleman, Rousselier, the elliptic criterion of compaction: PorousPlasticity); the linear properties use its elasticity. A crystal may slip on its slip systems: the crystal plasticity of Méric and Cailletaud ( CrystalPlasticity), which turns with the orientation of each grain.

Elasticity matrices use the Voigt order (11, 22, 33, 23, 31, 12) with engineering shear strains, so that sigma = D eps (morphogen.homogenization.elements). The matrices of a crystal are given in its own axes; a crystal orientation (Bunge Euler angles (phi1, Phi, phi2) in degrees, morphogen.orientations) turns them into the axes of the sample: C_ijkl = g_pi g_qj g_rk g_sl C'_pqrs with crystal = g @ sample.

morphogen.homogenization.materials.TRANSPORT = {'dielectric': 'permittivity', 'diffusion': 'diffusivity', 'electrical': 'electrical_conductivity', 'magnetic': 'permeability', 'thermal': 'conductivity'}

the name of each physics and the parameter of Material that holds its K (thermal: the conductivity, or the tensor conductivities of a crystal)

Type:

The transport phenomena of one scalar potential, flux = -K grad(potential)

morphogen.homogenization.materials.TRANSPORT_LAWS = {'dielectric': ('electric potential', 'electric displacement', 'D = -eps grad V'), 'diffusion': ('concentration', 'mass flux', "Fick's law J = -D grad c"), 'electrical': ('electric potential', 'current density', "Ohm's law j = -sigma grad V"), 'magnetic': ('magnetic scalar potential', 'magnetic induction', 'B = -mu grad psi'), 'thermal': ('temperature', 'heat flux', "Fourier's law q = -k grad T")}

The potential, the flux and the law of each transport phenomenon (for the messages and the documentation)

morphogen.homogenization.materials.PHYSICS = ('elastic', 'thermal', 'electrical', 'dielectric', 'magnetic', 'diffusion')

elasticity and the transport phenomena

Type:

The physics of the linear problems

morphogen.homogenization.materials.transport_physics(physics: str) → bool[source]

Whether physics is a transport phenomenon of TRANSPORT (a scalar potential), not elasticity; an unknown name is an error.

morphogen.homogenization.materials.voigt_to_tensor4(d) → ndarray[source]

Fourth-order tensor(s) C_ijkl of Voigt matrices (…, 6, 6).

morphogen.homogenization.materials.tensor4_to_voigt(c) → ndarray[source]

Voigt matrices (…, 6, 6) of fourth-order tensors with the minor symmetries.

morphogen.homogenization.materials.rotate_stiffness(d, euler) → ndarray[source]

Elasticity matrix of a crystal (crystal axes) in the sample axes, for one orientation (shape (6, 6)) or several (shape (n, 6, 6)).

morphogen.homogenization.materials.rotate_conductivity(k, euler) → ndarray[source]

Conductivity tensor of a crystal in the sample axes (g^T K g).

morphogen.homogenization.materials.isotropic_matrix(lam: float, mu: float) → ndarray[source]

Elasticity matrix (6 x 6) of an isotropic material.

morphogen.homogenization.materials.voigt_average(d) → tuple[float, float][source]

Bulk and shear moduli of the Voigt average over uniform orientations.

morphogen.homogenization.materials.reuss_average(d) → tuple[float, float][source]

Bulk and shear moduli of the Reuss average over uniform orientations.

morphogen.homogenization.materials.lame(young: float, poisson: float) → tuple[float, float][source]

Lame coefficients (lambda, mu) from Young’s modulus and Poisson’s ratio.

morphogen.homogenization.materials.bulk_shear(young: float, poisson: float) → tuple[float, float][source]

Bulk and shear moduli (k, mu) from Young’s modulus and Poisson’s ratio.

morphogen.homogenization.materials.young_poisson(bulk: float, shear: float) → tuple[float, float][source]

Young’s modulus and Poisson’s ratio from the bulk and shear moduli.

class morphogen.homogenization.materials.Material(young: float | None = None, poisson: float | None = None, conductivity: float | None = None, void: bool = False, stiffness: tuple | None = None, conductivities: tuple | None = None, symmetry: str = 'isotropic', expansion: float | tuple | None = None, density: float | None = None, plasticity: Plasticity | None = None, crystal_plasticity: CrystalPlasticity | None = None, mfront: object | None = None, porous_plasticity: PorousPlasticity | None = None, learned: object | None = None, electrical_conductivity: float | tuple | None = None, permittivity: float | tuple | None = None, permeability: float | tuple | None = None, diffusivity: float | tuple | None = None, refractive_index: complex | tuple | None = None, coupling: object | None = None, viscoelasticity: object | None = None, hyperelasticity: object | None = None, damage: object | None = None, swelling: float | tuple | None = None)[source]

Bases: object

Linear material of a phase, or a void.

Isotropic materials: young and poisson define the elastic behaviour, conductivity the thermal one; a material may define either or both. Crystals: stiffness, the 6 x 6 elasticity matrix in the axes of the crystal (see cubic(), hexagonal(), anisotropic()), and conductivities, the 3 x 3 conductivity tensor in the same axes (or conductivity when it is isotropic). expansion is the thermal expansion: one coefficient, or (crystals) principal values or a 3 x 3 tensor in the axes of the crystal. In a polycrystal, each grain turns them by its orientation. swelling is likewise the strain of a unit content of a species the phase absorbs (moisture, a solvent, lithium: the hygroscopic or chemical expansion), for the effective swelling of morphogen.homogenization.poroelastic. density (optional) gives the effective density and specific properties. The other transport phenomena (TRANSPORT) each have their coefficient: electrical_conductivity (Ohm), permittivity (dielectrics), permeability (magnetostatics) and diffusivity (Fick), one value or, in the axes of the crystal, three principal values or a 3 x 3 tensor; zero makes the phase inert for that physics (an insulator in a conducting composite), as a void is for all. refractive_index: the complex refractive index n + i k of the phase at optical frequencies (a number, a pair (n, k), or one pair per wavelength), for the effective index of morphogen.homogenization.harmonic. coupling holds the coefficients of the strong couplings between these physics (Coupling: piezoelectric, piezomagnetic, magnetoelectric, Seebeck and pyroelectric coefficients; a mapping of them), for the coupled problems of morphogen.homogenization.coupled. viscoelasticity (a generalized Maxwell model), hyperelasticity (a strain energy, in finite strains) and damage (the isotropic damage of quasi-brittle solids, Mazars’ law of concrete) give an isotropic material one of the behaviours of morphogen.homogenization.laws along loading paths (a viscoelasticity and a hyperelasticity together: finite viscoelasticity; a damage of Lemaitre or of Kachanov goes with a plasticity, whose effective stress it degrades). plasticity (isotropic materials) makes it yield along loading paths, porous_plasticity (isotropic materials) makes it a porous plastic material, crystal_plasticity makes it slip on the systems of its lattice, mfront gives it an MFront behaviour along them (MFrontBehaviour; its elastic parameters remain those of the linear problems and of the reference media) and learned a law learned from data (LearnedBehaviour; likewise). A void carries neither stress nor flux.

classmethod cubic(c11: float, c12: float, c44: float, *, conductivity: float | None = None, expansion: float | None = None)[source]

Cubic crystal (stiffness constants in its axes); its conductivity and thermal expansion are isotropic.

classmethod hexagonal(c11: float, c12: float, c13: float, c33: float, c44: float, *, conductivity=None, expansion=None)[source]

Hexagonal (transversely isotropic) crystal, axis c along the third crystal axis; conductivity and expansion: one value, or (basal plane, axis c).

classmethod anisotropic(stiffness=None, *, conductivity=None, expansion=None)[source]

Crystal of any symmetry: 6 x 6 elasticity matrix (Voigt order 11, 22, 33, 23, 31, 12, engineering shear strains), conductivity and thermal expansion (one value, three principal values along the crystal axes, or a 3 x 3 tensor), in the axes of the crystal.

property elastic: bool
property thermal: bool
has(physics: str) → bool[source]

Whether the material has the parameters of physics (PHYSICS): elastic ones, or the coefficient of a transport phenomenon.

inert(physics: str) → bool[source]

Whether the material carries nothing for physics: a void, or a phase whose transport coefficient is zero (an insulator), left out of that problem as a pore.

property isotropic: bool
property plastic: bool

Whether the material yields (von Mises; nonlinear loading paths).

property crystal_plastic: bool

Whether the material slips on its slip systems (crystal plasticity).

property porous: bool

Whether the material is porous plastic (Gurson, Rousselier, elliptic).

property analytic: bool

Whether the material has a behaviour of morphogen.homogenization.laws (viscoelasticity, hyperelasticity, damage).

property nonlinear: bool

Whether the behaviour of the material is nonlinear (loading paths).

property expands: bool

Whether the material has a (nonzero) thermal expansion.

oriented(physics: str) → bool[source]

Whether the behaviour for physics depends on the orientation (a learned law runs in the axes of its material, unless it is not oriented).

expansion_tensor(euler=None) → ndarray[source]

Thermal expansion tensor (3 x 3, zero without expansion) in the axes of the sample: for the orientation euler (shape (3,) or (n, 3)), or of the crystal.

property lame: tuple[float, float]
property bulk: float

Bulk modulus (isotropic), or of the Voigt average of a crystal.

property shear: float

Shear modulus (isotropic), or of the Voigt average of a crystal.

moduli(average: str = 'voigt') → tuple[float, float][source]

Bulk and shear moduli: exact for isotropic materials; for crystals, the "voigt", "reuss" or "hill" average over uniform orientations.

mean_conductivity(average: str = 'voigt', physics: str = 'thermal') → float[source]

Conductivity (isotropic), or the arithmetic ("voigt") or harmonic ("reuss") mean of the principal conductivities of a crystal; likewise the coefficient of another transport physics (TRANSPORT).

matrix(physics: str, euler=None) → ndarray[source]

Elasticity matrix (6 x 6), or conductivity tensor (3 x 3; that of any transport physics of TRANSPORT) in the axes of the sample: for the orientation euler (Bunge angles in degrees; shape (3,) or (n, 3) for n orientations), or in the axes of the crystal.

to_config()[source]
classmethod from_config(spec) → Material[source]

"void", or a mapping with young/poisson or bulk/shear (isotropic), or cubic: [c11, c12, c44], hexagonal: [c11, c12, c13, c33, c44] or stiffness: 6 x 6 (crystals); and/or conductivity (one value, three principal values or a 3 x 3 tensor, in the axes of the crystal); and expansion, the thermal expansion (likewise), swelling, the strain of a unit content of an absorbed species (likewise), density, plasticity (from_config()), porous_plasticity ( from_config()), crystal_plasticity (from_config()), mfront (from_config()) and learned (the file of a learned model, from_config()); or zmat, a material file of Z-mat (its path, or a mapping file, behaviour, name, native, porosity: zmat_material()), with a conductivity and a density.

morphogen.homogenization.materials.any_oriented(materials: dict[int, Material]) → bool[source]

Whether some material depends on the orientation of its grain (anisotropic elasticity, conductivity or expansion, or slip systems): the grains and their orientations are then needed.

morphogen.homogenization.materials.materials_from_config(spec) → dict[int, Material][source]

Phase -> material mapping from a configuration mapping (keys may be strings).

class morphogen.homogenization.materials.MaterialTable(mat: ndarray, stat: ndarray, matrices: ndarray, phases: tuple[int, ...], isotropic: bool, eigen: ndarray | None = None, rotations: ndarray | None = None)[source]

Bases: object

Material of every element (voxel or tetrahedron) of a sample, for one physics.

mat[e] indexes matrices (-1 for voids): elasticity matrices (n, 6, 6) or conductivity tensors (n, 3, 3) in the axes of the sample; one per phase, or one per grain for the oriented phases of a polycrystal. stat[e] indexes phases. eigen (elasticity) holds the thermal strain of each material for a unit change of temperature (Voigt order, engineering shears), rotations the orientation of each material (crystal = g @ sample; the identity for the materials of the phases that are not oriented).

property active: ndarray
morphogen.homogenization.materials.material_table(phase, materials: dict[int, Material], physics: str, *, grains=None, orientations=None) → MaterialTable[source]

Materials of the elements of phases phase for physics (PHYSICS: ‘elastic’, or a transport phenomenon such as ‘thermal’ or ‘electrical’). Crystals are turned by the orientation of their grain (grains: grain of each element, orientations: Bunge angles of each grain); without them, their axes are those of the sample. The phases inert for the physics (voids, insulators: Material.inert()) have no material (mat -1).