morphogen.homogenization.xfem

Extended finite elements for homogenization: the interfaces of a morphology cut the elements of a regular grid instead of being meshed or drawn as stairs of voxels.

A two-phase morphology is given by its level set phi at the nodes of a regular grid of the periodic box (LevelSetSample; negative in the phase 1). The grid is cut into six linear tetrahedra per cell, in which the level set is interpolated linearly: the interface is a plane within each element. Following Moës, Cloirec, Cartraud & Remacle (2003), the displacement (or the potential of a transport problem) is enriched where an interface between two materials cuts the elements:

u(x) = sum_i N_i(x) u_i + sum_(j enriched) N_j(x) psi(x) a_j,
psi(x) = sum_i N_i(x) |phi_i| - |sum_i N_i(x) phi_i|,

the ridge function psi continuous, with a kink on the interface (the jump of the normal strain that the continuity of the tractions asks for) and zero in the elements that the interface does not cut: no blending elements. The elements cut are integrated on the sub-tetrahedra of their two sides, each with its material (four Gauss points each: the stiffness is integrated exactly). Where one side is a void or an inert phase, the elements are not enriched and only their solid part is integrated (Sukumar et al. 2001); the nodes without any solid around them are left out.

The discretization keeps the convergence of conforming meshes without a mesher: a plane interface of any orientation is represented exactly (laminates oblique to the grid are solved to round-off, where voxels draw stairs), and curved interfaces to second order in the size of the elements. The level set is moved away from the nodes it passes too close to (snap, a fraction of the edge of the cells), which bounds the conditioning.

The problems are those of the periodic element (XFEMElasticProblem, XFEMThermalProblem; the thermal one for every transport phenomenon): the unknowns are the periodic fluctuations, standard and enriched, on the torus of the grid; homogenize() takes a LevelSetSample as it takes a mesh or an image. Loading paths with the nonlinear behaviours of the phases are followed on the same discretization, in small or finite strains (NonlinearXFEMProblem): the integration points of the cut elements are those of their sub-tetrahedra, each with the behaviour of its side; in finite strains the formulation is the total Lagrangian one of the finite elements, the level set cutting the reference configuration. Linear tetrahedra lock under isochoric plastic flow: for plasticity prefer conforming quadratic meshes or the voxels of the FFT solver (B-bar); damage, viscoelasticity and compressible behaviours do not suffer from it.

class morphogen.homogenization.xfem.LevelSetSample(values: ndarray, lower: tuple = (0.0, 0.0, 0.0), upper: tuple = (1.0, 1.0, 1.0), inside: int = 1, outside: int = 0)[source]

Bases: object

A two-phase morphology on the nodes of a regular grid of a periodic box: values (nx x ny x nz), its level set at the nodes lower + (i, j, k) h (negative in the phase inside, positive in the phase outside; the node of index n along an axis is that of index 0, one period further).

classmethod of(micro, shape=None, *, spacing: float | None = None) → LevelSetSample[source]

The sample of a periodic microstructure with a level set (a model realization, an ImplicitBody): shape cells along the longest edge of its box (or a shape per axis), or cells of edge spacing.

property shape: tuple[int, int, int]
phase_fractions(snap: float = 0.001) → dict[int, float][source]

The volume fractions of the two phases: those of the elements and of the parts of the elements that the interface cuts (the geometry that the problems solve).

property spacing: ndarray
property volume: float
morphogen.homogenization.xfem.subtetrahedra(x: ndarray, phi: ndarray)[source]

The tetrahedra of corners x (m x 4 x 3) cut by the zero of the linear interpolant of their nodal values phi (m x 4, none zero, of both signs): the corners of their sub-tetrahedra (m x 6 x 4 x 3) and the sign of phi in each (m x 6; 0 for the two unused ones of an element cut with one node alone on its side, which has a tetrahedron and a prism of three).

class morphogen.homogenization.xfem.XFEMElasticProblem(sample: LevelSetSample, materials: dict[int, Material], bc: str = 'periodic', *, solver: str = 'auto', tol: float = 1e-08, maxiter: int | None = None, snap: float = 0.001, physics: str | None = None)[source]

Bases: _XFEMProblem

Periodic linear (thermo-)elasticity of a LevelSetSample by extended finite elements (see the module).

class morphogen.homogenization.xfem.XFEMThermalProblem(sample: LevelSetSample, materials: dict[int, Material], bc: str = 'periodic', *, solver: str = 'auto', tol: float = 1e-08, maxiter: int | None = None, snap: float = 0.001, physics: str | None = None)[source]

Bases: _XFEMProblem

Periodic steady conduction of a LevelSetSample by extended finite elements, or with physics any other transport phenomenon of a scalar potential (TRANSPORT).

class morphogen.homogenization.xfem.NonlinearXFEMProblem(sample: LevelSetSample, materials: dict[int, Material], bc: str = 'periodic', *, solver: str = 'auto', tol: float = 1e-08, maxiter: int | None = None, snap: float = 0.001, newton_tol: float = 1e-06, max_newton: int = 25, max_cuts: int = 10, kinematics: str = 'small', tangent: str = 'auto')[source]

Bases: _PathSolver, _XFEMProblem

Loading paths of a LevelSetSample with the nonlinear behaviours of its phases, by extended finite elements in small or finite strains (kinematics; see the module and NonlinearFEProblem for the options of the iterations): run() follows a LoadingPath. The linear problems of the sample are those of XFEMElasticProblem.