morphogen.domain¶
Simulation domains (boxes) and the voxel grids that discretize them.
Conventions used throughout morphoGen:
a domain is the axis-aligned box
[origin, origin + size);a voxel grid of shape
(nx, ny, nz)splits the domain into equal voxels, voxel(i, j, k)being centred atorigin + (i + 1/2, j + 1/2, k + 1/2) * spacing;arrays are indexed
[i, j, k]along(x, y, z); file writers convert to the x-fastest order used by VTK, MetaImage and FFT codes.
- class morphogen.domain.Domain(size: tuple[float, float, float], origin: tuple[float, float, float] = (0.0, 0.0, 0.0), periodic: bool = True, unit: str = '')[source]¶
Bases:
objectAxis-aligned box in which microstructures are generated.
- Parameters:
size (tuple[float, float, float]) – Edge lengths (a single value for a cube), in the length unit of the study.
origin (tuple[float, float, float]) – Lower corner of the box.
periodic (bool) – If true the box is a torus: grains, fibres and cells wrap around the faces so that the sample tiles space (periodic boundary conditions, FFT solvers). If false the sample is an unbiased window cut from the infinite random medium.
unit (str) – Name of the length unit (metadata only, e.g.
"um").
- classmethod cube(length: float, *, periodic: bool = True, origin=(0.0, 0.0, 0.0), unit: str = '')[source]¶
Cubic domain of edge
length.
- property lower: ndarray¶
- property upper: ndarray¶
- property center: ndarray¶
- property lengths: ndarray¶
- property volume: float¶
- property surface_area: float¶
- property diagonal: float¶