morphogen.models.hardcore¶
Hard-core (non-overlapping) spheres: random sequential addition, dense packings grown by the Lubachevsky–Stillinger algorithm, and penetrable spheres with impenetrable cores (the cherry-pit model of Torquato).
- morphogen.models.hardcore.METHODS = ('rsa', 'lubachevsky_stillinger')¶
Methods of the hard-core spheres.
- morphogen.models.hardcore.largest_first(radii, box, gap: float, rng, max_attempts: int) ndarray[source]¶
Positions (in
[0, box), in the order ofradii) of non-overlapping spheres placed by random sequential addition, the largest first: drawn late among polydisperse spheres, a large one may find no room left (radii uniform between 0.8 and 1.2 and 0.05 apart jam from a fraction of 0.31 in the order of their draw; the largest first, they still fill 0.41).
- morphogen.models.hardcore.grown_packing(radii, box, rng, *, growth_rate: float = 0.01, max_events=None)[source]¶
Positions (in
[0, box)) of non-overlapping spheres of the given radii in a periodic box, grown by the Lubachevsky–Stillinger algorithm (morphogen.kernels.packing): from the positions of a random sequential addition of the spheres shrunk to a packing fraction of at most 0.25, the largest first (drawn late, a large sphere may find no room left), with Gaussian velocities of the mean radius per unit time, the radii growing atgrowth_ratetimes themselves per unit time. RaisesRuntimeErrorwhen the packing jams before the spheres reach their radii (aftermax_events, 20000 per sphere by default).
- class morphogen.models.hardcore.HardcoreSpheres(radius: Distribution = Constant(value=1.0), volume_fraction: float | None = None, number: int | None = None, min_gap: float = 0.0, max_attempts: int | None = None, method: str = 'rsa', growth_rate: float = 0.01, *, anisotropy: Anisotropy | None = None)[source]¶
Bases:
ModelNon-overlapping spheres, by random sequential addition (RSA) or grown into dense packings by the Lubachevsky–Stillinger algorithm.
RSA adds the spheres one at a time at uniformly random positions, the largest first, a trial being rejected when the sphere would come closer than
min_gapto an existing one: the process jams near a volume fraction of 0.38 for equal spheres. The Lubachevsky–Stillinger algorithm grows the spheres of a hard-sphere fluid (an event-driven molecular dynamics) until they reach their radii (plus half the gap): fast growths jam equal spheres near 0.64 (the maximally random jammed state), slow ones let them order.Generation always takes place in a periodic box; for non-periodic domains the box is enlarged by two grain diameters and cropped, which avoids wall effects.
- phases: ClassVar[dict[int, str]] = {0: 'matrix', 1: 'spheres'}¶
Meaning of the phase indices of the voxel images.
- count_label: ClassVar[str] = 'spheres'¶
Objects counted by
expected_count()(fibres, spheres, cells…).
- generate(domain: Domain, seed: int | SeedSequence | Generator | None = None) PrimitiveUnion[source]¶
One realization of the model in
domain.
- class morphogen.models.hardcore.PenetrableSpheres(radius: Distribution = Constant(value=1.0), impenetrability: float = 0.5, reduced_density: float | None = None, number: int | None = None, method: str = 'rsa', growth_rate: float = 0.01, max_attempts: int | None = None, *, anisotropy: Anisotropy | None = None)[source]¶
Bases:
ModelPenetrable spheres with impenetrable cores: the cherry-pit model of Torquato (1984), or penetrable-concentric-shell model.
Each sphere of radius
Rhas a core of radiusλRthat no other core overlaps: the cores are placed by random sequential addition, the largest first (or grown into dense packings by the Lubachevsky–Stillinger algorithm), and the shells interpenetrate.λ = 0gives fully penetrable spheres (independent uniform centres),λ = 1hard spheres; phase 1 is the union of the spheres, whose fraction lies between1 - e^{-η}andηfor the reduced densityη(the number of spheres per unit volume times their mean volume).- phases: ClassVar[dict[int, str]] = {0: 'matrix', 1: 'spheres'}¶
Meaning of the phase indices of the voxel images.
- count_label: ClassVar[str] = 'spheres'¶
Objects counted by
expected_count()(fibres, spheres, cells…).
- generate(domain: Domain, seed: int | SeedSequence | Generator | None = None) PrimitiveUnion[source]¶
One realization of the model in
domain.
- expected_count(domain: Domain) float | None[source]¶
Mean number of objects of the model in
domain(None when undefined).Used to express RVE sizes as numbers of fibres, grains or cells (Dirrenberger et al. 2014, Table 10).
- theory(domain: Domain | None = None) dict[str, float][source]¶
The reduced density, the fraction of the cores (
λ^3 η), and the fraction and specific surface of the union in the two limits:1 - e^{-η}and its surface3 η E[R^2] / E[R^3] e^{-η}for fully penetrable spheres (large boxes),ηand3 η E[R^2] / E[R^3]for hard spheres.