morphogen.coupling.fenicsx

Diffusion and swelling of tetrahedral meshes with FEniCSx (dolfinx): moisture or a solvent enters a sample through its exposed faces, and the sample swells and bends as it does (Mou, Dirrenberger & Le Duigou 2025 model pine cone scales and 4D-printed hygromorphs this way with FEniCS).

The activity u of the species is continuous across interfaces, each phase holds c = S u and lets it through with the permeability D S (as in morphogen.coupling.diffusion): S du/dt = div(D S grad u), Lagrange elements of the order of the mesh, the exposed faces held at the activity (a number or a function of time), the other faces impermeable, implicit Euler steps. At each output time the sample, free of tractions, deforms elastically under the swelling strains beta c I (small strains; isotropic phases), held only by 3-2-1 supports at three corners: its displacement field, and the curvature of a strip fitted to the deflection of its mid-plane (strip_curvature()). FEniCSx runs on Linux (or WSL).

class morphogen.coupling.fenicsx.SwellingResult(times: ndarray, uptake: ndarray, saturation: float, concentration: list, displacement: list, mesh: TetMesh)[source]

Bases: object

At the output times: the mean concentration over the meshed volume (uptake; saturation at the activity of the last time), the concentration of the nodes (that of the phase of an element around each node, S u) and their displacement (morphoGen’s order of the nodes).

property relative_uptake: ndarray
morphogen.coupling.fenicsx.swelling(mesh: TetMesh, phases: dict, times, *, exposed=('z-',), activity: float | Callable[[float], float] = 1.0, initial: float = 0.0, steps: int = 20, kinematics: str = 'small') → SwellingResult[source]

Diffusion into mesh from its exposed faces and the free swelling of the sample at the output times. phases: phase -> mapping with diffusivity, solubility (default 1), swelling (the strain per unit concentration, default 0), young and poisson. Each output interval takes steps implicit Euler steps (the first one geometrically growing, for the sqrt(t) start). kinematics: "small" (linear elasticity under the swelling strains) or "finite" (large rotations and strains: F = F_e F_s with the swelling stretch F_s = (1 + beta c) I, Saint Venant-Kirchhoff’s law of F_e per unit volume of the swollen state, so that P = (1 + beta c) F S_e; Newton’s method, each output reached by continuation of the concentration field, halved when it fails).

morphogen.coupling.fenicsx.strip_curvature(mesh: TetMesh, displacement, *, axis: int = 0, normal: int = 2) → float[source]

Curvature of a strip along axis bending in the plane of normal: minus the second derivative of the deflection of the nodes of its mid-plane (least squares, w = -k x^2 / 2 + a x + b + c y), so that it is positive when the strip bends towards its lower face (-normal), as timoshenko_curvature() and Multilayer.

morphogen.coupling.fenicsx.arc_curvature(mesh: TetMesh, displacement, *, axis: int = 0, normal: int = 2) → float[source]

Curvature of a strip that bends into an arc (large rotations): the circle fitted (least squares, Kasa) to the deformed nodes of its mid-plane in the plane of axis and normal; positive when the strip bends towards its lower face.

class morphogen.coupling.fenicsx.OxidationResult(times: ndarray, tracer: list, stress: list, displacement: list, mesh: TetMesh)[source]

Bases: object

At the times: the oxidation tracer (amide concentration, mol/l) of each element, their stresses (Voigt order 11 22 33 23 31 12) and the displacement of the nodes.

morphogen.coupling.fenicsx.oxidation_stresses(mesh: TetMesh, law, times, *, oxidation=None, exposed=('z-', 'z+'), poisson: float = 0.37, nodes: int = 81) → OxidationResult[source]

Stresses of a sample oxidized through its exposed faces (Ernault et al. 2019): the amide profile of the diffusion-limited oxidation (ClosedLoopOxidation, default: their DGEBA/IPDA at 110 °C) at the depth of each element below the nearest exposed face, Young’s modulus and the shrinkage (expansion, a strain) of law (PropertyLaw of the amide concentration), and the linear elastic response of the free sample (3-2-1 supports) to these eigenstrains (Poisson’s ratio poisson, 0.37 as theirs).