morphogen.design.frames

Periodic pin-jointed frameworks: strut lattices with defects, and their rigidity.

A framework is a set of nodes in a periodic box and of bars joining pairs of nodes, the second end possibly in a neighbouring copy of the box (shift). Lattices are built from the unit cells of morphogen.models.lattice; defects are struts removed at random (dilution) and nodes displaced at random (perturbation).

Rigidity (Maxwell 1864, Calladine 1978, Pellegrino and Calladine 1986; periodic frameworks: Guest and Hutchinson 2003). The compatibility matrix A maps periodic node displacements to bar extensions, and B maps a macroscopic strain E to the extensions n . E L it imposes on the bars. Then

  • mechanisms (periodic displacement modes extending no bar, rigid translations excluded): m = 3 j - 3 - rank(A);

  • states of self-stress (bar tensions in equilibrium without load): s = b - rank(A), so that m - s = 3 j - 3 - b (Maxwell-Calladine);

  • floppy macroscopic strains (accommodated by some displacement without extending any bar): 6 - rank([A B]) + rank(A).

A lattice whose macroscopic strains all stretch bars is stretching-dominated: its stiffness scales with the relative density, against its square for bending-dominated lattices (Deshpande, Ashby and Fleck 2001). Maxwell’s count requires a mean coordination of at least 6 in 3D for large frameworks.

class morphogen.design.frames.Framework(nodes: ndarray, bars: ndarray, shifts: ndarray, box: ndarray)[source]

Bases: object

Nodes in a periodic box and bars from nodes[p] to nodes[q] + shift * box.

classmethod lattice(cell: str, n_cells=1, cell_size: float = 1.0) → Framework[source]

The periodic lattice of n_cells unit cells (cubic, bcc, fcc, octet, kelvin, diamond or pyrochlore: morphogen.models.lattice.CELLS).

property n_nodes: int
property n_bars: int
degrees() → ndarray[source]
coordination() → float[source]

Mean number of bars per node, Z = 2 b / j.

vectors() → ndarray[source]

Bar vectors (b, 3).

components() → ndarray[source]

Connected component of every node (through the periodic boundaries).

with_bars(keep) → Framework[source]

The framework with the selected bars only (same nodes).

without_isolated_nodes() → Framework[source]
pruned(min_degree: int = 2) → Framework[source]

Remove, repeatedly, the bars at nodes of fewer than min_degree bars.

largest_component() → Framework[source]
diluted(rng: Generator, *, coordination: float | None = None, fraction: float | None = None, min_degree: int = 3) → Framework[source]

Struts removed at random.

With coordination: until the mean coordination reaches the target, never below min_degree bars at a node (the target may not be reached). With fraction: that fraction of the bars, then dangling bars are pruned. The largest connected component is kept.

perturbed(rng: Generator, amplitude: float) → Framework[source]

Nodes displaced uniformly in balls of radius amplitude.

segments(radius: float, origin=(0.0, 0.0, 0.0)) → Segments[source]

Struts as round-capped cylinders (periodic images are added when needed).

compatibility() → tuple[ndarray, ndarray][source]

Dense matrices A (b, 3 j) and B (b, 6) (strains 11, 22, 33, 23, 13, 12, shear components counted twice).

rigidity(tol: float = 1e-09) → dict[source]

Mechanisms, states of self-stress and floppy macroscopic strains (SVD ranks).

to_dict() → dict[source]