morphogen.automata.growth¶
Lattice growth processes: nucleation and growth, grain growth and aggregation.
- Nucleation and growth
Nuclei appear at random cells, all at once (site saturation) or at a constant rate in the untransformed volume (continuous nucleation), and grow at a constant velocity until they impinge on each other (Johnson-Mehl-Avrami-Kolmogorov kinetics). The automaton is event-driven: each cell is transformed by the first grain reaching it, and grains are propagated from cell to neighbouring cell (26 neighbours) with the position of their nucleus, so that arrival times are exact distances in the growth metric (spheres, or cubes and octahedra oriented by the crystal orientation of each grain), without the anisotropy of lattice distances. Grains are star-shaped with respect to their nucleus, which makes the propagation exact up to the resolution of the lattice. Nuclei falling in transformed cells are discarded (phantom nuclei).
- Grain growth
Monte Carlo Potts model (Anderson, Srolovitz and Grest 1984): a cell takes the label of a random neighbour if this does not increase the number of unlike neighbours (or with the Boltzmann probability at temperature T > 0). Grain boundaries move with their mean curvature: the mean grain size grows as the square root of time (parabolic growth). Cells are swept by independent sublattices in parallel, with counter-based random numbers (results do not depend on the number of threads).
- Aggregation
Particles join a growing aggregate: clusters grown from seeds, or deposits on a substrate (the face z = 0; y = 0 in 2D). Diffusion-limited aggregation (random walkers, Witten and Sander 1981) gives fractal clusters of dimension about 2.5 in 3D and 1.71 in 2D; Eden growth (random perimeter cells) compact clusters with rough surfaces; ballistic aggregation (straight trajectories) dense porous aggregates.
- morphogen.automata.growth.GROWTH_SHAPES = ('sphere', 'cube', 'octahedron')¶
Growth metrics of nucleation and growth.
- morphogen.automata.growth.AGGREGATION_PROCESSES = ('dla', 'eden', 'ballistic')¶
Aggregation processes and geometries.
- morphogen.automata.growth.shape_volume_coefficient(shape: str, dims: int = 3) float[source]¶
Volume (area in 2D) of the growth shape of radius 1:
V(r) = c r^d.
- morphogen.automata.growth.grow_grains(shape, cell_size, nuclei, times, *, growth_rate: float = 1.0, growth_shape: str = 'sphere', rotations=None, periodic: bool = True, dims: int = 3)[source]¶
Transformation of a lattice by grains growing from nuclei.
- Parameters:
shape – Lattice
(nx, ny, nz)(nz = 1in 2D) and edge(s) of its cells.cell_size – Lattice
(nx, ny, nz)(nz = 1in 2D) and edge(s) of its cells.nuclei – Cell indices
(n, 3)of the nuclei and their nucleation times.times – Cell indices
(n, 3)of the nuclei and their nucleation times.growth_rate – Radius gained by a grain per unit time (half-edge of cubes, half-diagonal of octahedra).
growth_shape –
sphere(isotropic growth),cubeoroctahedron(faceted growth).rotations – Optional rotation matrices
(n, 3, 3)(crystal = g @ sample) orienting the faceted shapes.
- Returns:
(labels, arrival, real): the index of the nucleus of the grain of each cell (int32), the time at which each cell is transformed (inf if never), and whether each nucleus formed a grain (False for phantom nuclei, which fell in transformed cells).- Return type:
tuple
- morphogen.automata.growth.potts_coarsening(labels, steps: int, *, temperature: float = 0.5, seed: int = 0, dims: int = 3, callback=None) ndarray[source]¶
Normal grain growth of a periodic label image by
stepsMonte Carlo sweeps of the Potts model (Moore neighbourhood: 26 neighbours in 3D, 8 in 2D).temperatureis in units of the energy of a pair of unlike neighbours; small positive values (about 0.5) avoid the pinning of boundaries by the lattice.callback(step, labels)is called after every sweep.
- morphogen.automata.growth.aggregate(shape, rng: Generator, *, process: str = 'dla', geometry: str = 'cluster', n_seeds: int = 1, n_particles: int | None = None, sticking: float = 1.0, dims: int = 3)[source]¶
Grow an aggregate on a lattice.
- Parameters:
shape – Lattice
(nx, ny, nz)(nz = 1in 2D). Clusters live on a periodic lattice; deposits on a lattice periodic along the substrate (the face z = 0, or y = 0 in 2D).process –
dla(random walkers),eden(random perimeter cells) orballistic(straight trajectories: random directions for clusters, normal to the substrate for deposits).geometry –
cluster: growth fromn_seedsrandom cells (one seed: the centre of the lattice, walkers launched from a sphere around the cluster);deposit: growth from the substrate.n_particles – Number of particles to add (default for deposits: until the deposit reaches the opposite face).
sticking – Probability that a particle in contact with the aggregate sticks to it (dla, ballistic): lower values give denser aggregates.
- Returns:
occupied (numpy.ndarray) – The aggregate (uint8).
owner (numpy.ndarray) – The index of the seed or substrate tree of each particle (int32, -1 elsewhere).
order (numpy.ndarray) – The order of arrival of each particle (int32: 0 for seeds, -1 elsewhere).