morphogen 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- morphogen/__init__.py +60 -0
- morphogen/__main__.py +7 -0
- morphogen/_platform.py +55 -0
- morphogen/_public.py +153 -0
- morphogen/_utils.py +80 -0
- morphogen/_version.py +1 -0
- morphogen/analysis/__init__.py +174 -0
- morphogen/analysis/anisotropy.py +135 -0
- morphogen/analysis/basic.py +38 -0
- morphogen/analysis/cells.py +54 -0
- morphogen/analysis/connectivity.py +156 -0
- morphogen/analysis/correlation.py +195 -0
- morphogen/analysis/covariance.py +80 -0
- morphogen/analysis/fractal.py +54 -0
- morphogen/analysis/measures.py +188 -0
- morphogen/analysis/morphology.py +265 -0
- morphogen/analysis/particles.py +160 -0
- morphogen/analysis/percolation.py +2034 -0
- morphogen/analysis/power_laws.py +143 -0
- morphogen/analysis/random_sets.py +351 -0
- morphogen/analysis/stereology.py +289 -0
- morphogen/analysis/surface.py +107 -0
- morphogen/analysis/topology.py +92 -0
- morphogen/automata/__init__.py +74 -0
- morphogen/automata/engine.py +211 -0
- morphogen/automata/growth.py +686 -0
- morphogen/automata/lattice.py +143 -0
- morphogen/automata/reaction.py +255 -0
- morphogen/automata/rules.py +353 -0
- morphogen/automata/tilings.py +1715 -0
- morphogen/cli.py +3526 -0
- morphogen/config.py +2167 -0
- morphogen/contact/__init__.py +113 -0
- morphogen/contact/experiments.py +368 -0
- morphogen/contact/hertz.py +104 -0
- morphogen/contact/kernels.py +827 -0
- morphogen/contact/periodic.py +278 -0
- morphogen/contact/problem.py +578 -0
- morphogen/contact/surfaces.py +310 -0
- morphogen/coupling/__init__.py +43 -0
- morphogen/coupling/ageing.py +143 -0
- morphogen/coupling/diffusion.py +226 -0
- morphogen/coupling/fenicsx.py +484 -0
- morphogen/coupling/oxidation.py +447 -0
- morphogen/coupling/plates.py +247 -0
- morphogen/design/__init__.py +51 -0
- morphogen/design/csp.py +616 -0
- morphogen/design/frames.py +277 -0
- morphogen/design/search.py +287 -0
- morphogen/design/tiles.py +336 -0
- morphogen/distributions.py +312 -0
- morphogen/domain.py +203 -0
- morphogen/dynamics/__init__.py +179 -0
- morphogen/dynamics/model.py +638 -0
- morphogen/dynamics/openradioss.py +643 -0
- morphogen/dynamics/results.py +515 -0
- morphogen/fracture/__init__.py +170 -0
- morphogen/fracture/bulk.py +349 -0
- morphogen/fracture/cohesive.py +1614 -0
- morphogen/fracture/ductile.py +557 -0
- morphogen/fracture/lefm.py +1168 -0
- morphogen/fracture/mixed.py +1178 -0
- morphogen/fracture/periodic.py +733 -0
- morphogen/fracture/phasefield.py +714 -0
- morphogen/fracture/phasefield_finite.py +368 -0
- morphogen/fracture/surface.py +572 -0
- morphogen/fracture/toughness.py +566 -0
- morphogen/gpu.py +108 -0
- morphogen/gui/__init__.py +8 -0
- morphogen/gui/api.py +1927 -0
- morphogen/gui/desktop.py +387 -0
- morphogen/gui/icon.png +0 -0
- morphogen/gui/index.html +1909 -0
- morphogen/gui/server.py +229 -0
- morphogen/gui/tools/__init__.py +629 -0
- morphogen/gui/tools/compare.py +149 -0
- morphogen/gui/tools/contact.py +391 -0
- morphogen/gui/tools/couplings.py +1085 -0
- morphogen/gui/tools/crackfront.py +245 -0
- morphogen/gui/tools/design.py +224 -0
- morphogen/gui/tools/dynamics.py +824 -0
- morphogen/gui/tools/fracture.py +2586 -0
- morphogen/gui/tools/interop.py +1654 -0
- morphogen/gui/tools/learning.py +595 -0
- morphogen/gui/tools/mechanics.py +3881 -0
- morphogen/gui/tools/nonlocal_damage.py +1321 -0
- morphogen/gui/tools/phasefield.py +215 -0
- morphogen/gui/tools/physics.py +597 -0
- morphogen/gui/tools/stability.py +1756 -0
- morphogen/gui/tools/statistics.py +1408 -0
- morphogen/gui/viewer.js +1100 -0
- morphogen/homogenization/__init__.py +210 -0
- morphogen/homogenization/acoustics.py +566 -0
- morphogen/homogenization/amg.py +1005 -0
- morphogen/homogenization/apparent.py +1046 -0
- morphogen/homogenization/behaviours.cu +2285 -0
- morphogen/homogenization/behaviours.py +944 -0
- morphogen/homogenization/beremin.py +263 -0
- morphogen/homogenization/bifurcation.py +1085 -0
- morphogen/homogenization/bloch.py +507 -0
- morphogen/homogenization/bounds.py +226 -0
- morphogen/homogenization/core.py +458 -0
- morphogen/homogenization/coupled.py +1135 -0
- morphogen/homogenization/crystal.py +2967 -0
- morphogen/homogenization/dilatation.py +454 -0
- morphogen/homogenization/elements.py +157 -0
- morphogen/homogenization/fatigue.py +768 -0
- morphogen/homogenization/fe.py +1739 -0
- morphogen/homogenization/fenicsx.py +307 -0
- morphogen/homogenization/fft.py +499 -0
- morphogen/homogenization/fft_nonlinear.py +391 -0
- morphogen/homogenization/finite.py +613 -0
- morphogen/homogenization/flow.py +361 -0
- morphogen/homogenization/frames.py +1125 -0
- morphogen/homogenization/gpu.py +1241 -0
- morphogen/homogenization/harmonic.py +427 -0
- morphogen/homogenization/identification.py +579 -0
- morphogen/homogenization/kernels.py +760 -0
- morphogen/homogenization/laws.py +2061 -0
- morphogen/homogenization/materials.py +1080 -0
- morphogen/homogenization/mfront.py +589 -0
- morphogen/homogenization/networks.py +880 -0
- morphogen/homogenization/nonlinear.py +2612 -0
- morphogen/homogenization/ntfa.py +577 -0
- morphogen/homogenization/paths.py +476 -0
- morphogen/homogenization/photonic.py +467 -0
- morphogen/homogenization/poroelastic.py +212 -0
- morphogen/homogenization/porous.py +1120 -0
- morphogen/homogenization/postprocess.py +290 -0
- morphogen/homogenization/solvers.py +1140 -0
- morphogen/homogenization/tensors.py +240 -0
- morphogen/homogenization/voxel_fe.py +457 -0
- morphogen/homogenization/xfem.py +1016 -0
- morphogen/homogenization/zmat.py +1258 -0
- morphogen/iga/__init__.py +48 -0
- morphogen/iga/analysis.py +508 -0
- morphogen/iga/basis.py +214 -0
- morphogen/iga/geometry.py +501 -0
- morphogen/iga/homogenization.py +219 -0
- morphogen/iga/optimization.py +700 -0
- morphogen/iga/shapes.py +331 -0
- morphogen/image.py +128 -0
- morphogen/io/__init__.py +246 -0
- morphogen/io/amitex.py +741 -0
- morphogen/io/ebsd.py +881 -0
- morphogen/io/export.py +196 -0
- morphogen/io/geometry.py +158 -0
- morphogen/io/medit.py +147 -0
- morphogen/io/meshes.py +844 -0
- morphogen/io/metaimage.py +97 -0
- morphogen/io/mfront.py +1104 -0
- morphogen/io/native.py +57 -0
- morphogen/io/radioss.py +764 -0
- morphogen/io/solvers.py +371 -0
- morphogen/io/tables.py +278 -0
- morphogen/io/tiff.py +66 -0
- morphogen/io/vtk.py +701 -0
- morphogen/io/xdmf.py +200 -0
- morphogen/kernels/__init__.py +5 -0
- morphogen/kernels/annealing.py +192 -0
- morphogen/kernels/cells.py +69 -0
- morphogen/kernels/collective.py +87 -0
- morphogen/kernels/force_biased.py +595 -0
- morphogen/kernels/implicit.py +145 -0
- morphogen/kernels/leaves.py +132 -0
- morphogen/kernels/packing.py +304 -0
- morphogen/kernels/raster.py +279 -0
- morphogen/kernels/rsa.py +371 -0
- morphogen/kernels/union.py +135 -0
- morphogen/kernels/watershed.py +190 -0
- morphogen/laser/__init__.py +234 -0
- morphogen/laser/architectures.py +375 -0
- morphogen/laser/bending.py +216 -0
- morphogen/laser/cells.py +1694 -0
- morphogen/laser/design.py +940 -0
- morphogen/laser/figures.py +227 -0
- morphogen/laser/heat.py +804 -0
- morphogen/laser/materials.py +691 -0
- morphogen/laser/mechanics.py +1670 -0
- morphogen/laser/metallurgy.py +615 -0
- morphogen/laser/patterns.py +828 -0
- morphogen/laser/periodic.py +392 -0
- morphogen/laser/process.py +362 -0
- morphogen/laser/run.py +534 -0
- morphogen/laser/solid.py +216 -0
- morphogen/laser/specimen.py +200 -0
- morphogen/laser/structures.py +708 -0
- morphogen/learning/__init__.py +81 -0
- morphogen/learning/behaviour.py +398 -0
- morphogen/learning/data.py +328 -0
- morphogen/learning/learned.cpp +668 -0
- morphogen/learning/logarithmic.py +202 -0
- morphogen/learning/mfront.py +409 -0
- morphogen/learning/networks.py +767 -0
- morphogen/learning/run.py +212 -0
- morphogen/learning/standard.py +814 -0
- morphogen/learning/training.py +235 -0
- morphogen/mesh/__init__.py +29 -0
- morphogen/mesh/conforming.py +1423 -0
- morphogen/mesh/curved.py +600 -0
- morphogen/mesh/exact.py +1717 -0
- morphogen/mesh/octree.py +350 -0
- morphogen/mesh/polycrystal.py +1041 -0
- morphogen/mesh/polyhedra.py +677 -0
- morphogen/mesh/regularize.py +570 -0
- morphogen/mesh/surface.py +97 -0
- morphogen/mesh/tetra.py +512 -0
- morphogen/mesh/voxel.py +124 -0
- morphogen/micromorphic/__init__.py +31 -0
- morphogen/micromorphic/damage.py +359 -0
- morphogen/micromorphic/ductile.py +534 -0
- morphogen/micromorphic/finite.py +220 -0
- morphogen/micromorphic/microfoam.py +787 -0
- morphogen/micromorphic/space.py +341 -0
- morphogen/models/__init__.py +195 -0
- morphogen/models/affine.py +384 -0
- morphogen/models/automata.py +592 -0
- morphogen/models/base.py +500 -0
- morphogen/models/boolean.py +310 -0
- morphogen/models/bouligand.py +331 -0
- morphogen/models/branching.py +241 -0
- morphogen/models/combination.py +430 -0
- morphogen/models/deadleaves.py +766 -0
- morphogen/models/design.py +289 -0
- morphogen/models/ebsd.py +206 -0
- morphogen/models/fibers.py +1476 -0
- morphogen/models/foam.py +594 -0
- morphogen/models/gaussian.py +314 -0
- morphogen/models/growth.py +459 -0
- morphogen/models/hardcore.py +317 -0
- morphogen/models/hierarchical.py +269 -0
- morphogen/models/honeycomb.py +749 -0
- morphogen/models/implicit.py +177 -0
- morphogen/models/laminate.py +470 -0
- morphogen/models/lattice.py +351 -0
- morphogen/models/lattice_field.py +345 -0
- morphogen/models/levelset_foam.py +563 -0
- morphogen/models/nacre.py +411 -0
- morphogen/models/nested.py +924 -0
- morphogen/models/osteons.py +374 -0
- morphogen/models/pieces.py +167 -0
- morphogen/models/planar.py +126 -0
- morphogen/models/reconstruction.py +203 -0
- morphogen/models/scale_rich.py +1409 -0
- morphogen/models/scale_rich_3d.py +1616 -0
- morphogen/models/tessellation.py +735 -0
- morphogen/models/tiling_field.py +302 -0
- morphogen/models/tpms.py +197 -0
- morphogen/models/transparent.py +406 -0
- morphogen/models/union.py +141 -0
- morphogen/optimization/__init__.py +43 -0
- morphogen/optimization/cell.py +295 -0
- morphogen/optimization/filters.py +115 -0
- morphogen/optimization/mma.py +226 -0
- morphogen/optimization/run.py +219 -0
- morphogen/optimization/topology.py +632 -0
- morphogen/orientations.py +568 -0
- morphogen/parallel.py +599 -0
- morphogen/pipeline.py +978 -0
- morphogen/primitives.py +188 -0
- morphogen/results.py +564 -0
- morphogen/rve/__init__.py +73 -0
- morphogen/rve/report.py +627 -0
- morphogen/rve/scaling.py +363 -0
- morphogen/rve/study.py +1054 -0
- morphogen/rve/windows.py +345 -0
- morphogen/seeding.py +51 -0
- morphogen/settings.py +118 -0
- morphogen/stopping.py +48 -0
- morphogen/symmetry.py +384 -0
- morphogen/templates/activator_inhibitor.yaml +22 -0
- morphogen/templates/aggregation.yaml +23 -0
- morphogen/templates/boolean_cylinders.yaml +20 -0
- morphogen/templates/boolean_spheres.yaml +22 -0
- morphogen/templates/bouligand.yaml +28 -0
- morphogen/templates/cellular_automaton.yaml +25 -0
- morphogen/templates/coated_spheres.yaml +26 -0
- morphogen/templates/contact_fibers.yaml +27 -0
- morphogen/templates/cox_nanocomposite.yaml +22 -0
- morphogen/templates/cross_linked_fibers.yaml +26 -0
- morphogen/templates/curved_arcs.yaml +28 -0
- morphogen/templates/curved_fibers.yaml +24 -0
- morphogen/templates/dead_leaves.yaml +22 -0
- morphogen/templates/delaunay_network.yaml +22 -0
- morphogen/templates/dense_packing.yaml +22 -0
- morphogen/templates/diffusion.yaml +33 -0
- morphogen/templates/ebsd.yaml +34 -0
- morphogen/templates/ebsd_map.ctf +3087 -0
- morphogen/templates/fracture_composite.yaml +42 -0
- morphogen/templates/fracture_rubber.yaml +47 -0
- morphogen/templates/gaussian_excursion.yaml +17 -0
- morphogen/templates/graded_lattice.yaml +24 -0
- morphogen/templates/hardcore_fibers.yaml +22 -0
- morphogen/templates/hardcore_spheres.yaml +22 -0
- morphogen/templates/hierarchical_lattice.yaml +22 -0
- morphogen/templates/homogenization_acoustic_foam.yaml +36 -0
- morphogen/templates/homogenization_beremin.yaml +50 -0
- morphogen/templates/homogenization_cleavage.yaml +51 -0
- morphogen/templates/homogenization_cleavage_band.yaml +55 -0
- morphogen/templates/homogenization_contact.yaml +43 -0
- morphogen/templates/homogenization_crack_closure.yaml +49 -0
- morphogen/templates/homogenization_crystal_plasticity.yaml +50 -0
- morphogen/templates/homogenization_crystal_plasticity_fft.yaml +52 -0
- morphogen/templates/homogenization_crystallization.yaml +30 -0
- morphogen/templates/homogenization_debonding.yaml +43 -0
- morphogen/templates/homogenization_detwinning.yaml +58 -0
- morphogen/templates/homogenization_ductile_damage.yaml +47 -0
- morphogen/templates/homogenization_fatigue.yaml +40 -0
- morphogen/templates/homogenization_grain_fracture.yaml +56 -0
- morphogen/templates/homogenization_gyroid.yaml +30 -0
- morphogen/templates/homogenization_intergranular.yaml +43 -0
- morphogen/templates/homogenization_interphase.yaml +42 -0
- morphogen/templates/homogenization_mixed_loading.yaml +33 -0
- morphogen/templates/homogenization_ntfa.yaml +56 -0
- morphogen/templates/homogenization_piezoelectric.yaml +27 -0
- morphogen/templates/homogenization_polycrystal.yaml +30 -0
- morphogen/templates/homogenization_polycrystal_inclusions.yaml +30 -0
- morphogen/templates/homogenization_poroelastic.yaml +26 -0
- morphogen/templates/homogenization_rubber.yaml +40 -0
- morphogen/templates/homogenization_slip_cleavage.yaml +50 -0
- morphogen/templates/homogenization_spheres.yaml +31 -0
- morphogen/templates/homogenization_transport.yaml +29 -0
- morphogen/templates/homogenization_twinning.yaml +54 -0
- morphogen/templates/homogenization_viscoelastic.yaml +34 -0
- morphogen/templates/homogenization_viscoplastic.yaml +42 -0
- morphogen/templates/homogenization_voronoi.yaml +26 -0
- morphogen/templates/homogenization_xfem.yaml +23 -0
- morphogen/templates/hyperuniform_cells.yaml +24 -0
- morphogen/templates/laguerre.yaml +18 -0
- morphogen/templates/laser_bending.yaml +35 -0
- morphogen/templates/laser_cells.yaml +38 -0
- morphogen/templates/laser_corrugated.yaml +36 -0
- morphogen/templates/level_set_foam.yaml +29 -0
- morphogen/templates/menger_sponge.yaml +17 -0
- morphogen/templates/nacre.yaml +25 -0
- morphogen/templates/nucleation_growth.yaml +25 -0
- morphogen/templates/optimize_auxetic.yaml +29 -0
- morphogen/templates/optimize_auxetic_3d.yaml +27 -0
- morphogen/templates/optimize_bulk.yaml +23 -0
- morphogen/templates/optimize_conductivity.yaml +20 -0
- morphogen/templates/osteons.yaml +28 -0
- morphogen/templates/penetrable_spheres.yaml +21 -0
- morphogen/templates/poisson_fibers.yaml +21 -0
- morphogen/templates/random_laminate.yaml +26 -0
- morphogen/templates/random_lattice.yaml +27 -0
- morphogen/templates/random_walk_fibers.yaml +26 -0
- morphogen/templates/reaction_diffusion.yaml +22 -0
- morphogen/templates/reconstruction.yaml +22 -0
- morphogen/templates/rve_cellular_automaton.yaml +23 -0
- morphogen/templates/rve_crystal_plasticity_fft.yaml +51 -0
- morphogen/templates/rve_multiphysics.yaml +43 -0
- morphogen/templates/rve_poisson_fibers.yaml +22 -0
- morphogen/templates/rve_poisson_fibers_fe.yaml +33 -0
- morphogen/templates/rve_voronoi_windows.yaml +20 -0
- morphogen/templates/scale_rich_network.yaml +29 -0
- morphogen/templates/scale_rich_plates.yaml +30 -0
- morphogen/templates/sequential_dead_leaves.yaml +25 -0
- morphogen/templates/strut_lattice.yaml +21 -0
- morphogen/templates/tile_assembly.yaml +28 -0
- morphogen/templates/tpms.yaml +19 -0
- morphogen/templates/trabecular_bone.yaml +29 -0
- morphogen/templates/transparent_dead_leaves.yaml +23 -0
- morphogen/templates/vascular_tree.yaml +23 -0
- morphogen/templates/voronoi.yaml +20 -0
- morphogen/templates/wood.yaml +34 -0
- morphogen/templates/workflow.yaml +56 -0
- morphogen/texture.py +665 -0
- morphogen/theory.py +162 -0
- morphogen/viz/__init__.py +12 -0
- morphogen/viz/export.py +244 -0
- morphogen/viz/figures.py +707 -0
- morphogen/viz/png.py +148 -0
- morphogen/viz/sections.py +696 -0
- morphogen/viz/surfaces.py +1352 -0
- morphogen/viz/video.py +904 -0
- morphogen/viz/workflow.py +488 -0
- morphogen-1.0.0.dist-info/METADATA +2316 -0
- morphogen-1.0.0.dist-info/RECORD +381 -0
- morphogen-1.0.0.dist-info/WHEEL +4 -0
- morphogen-1.0.0.dist-info/entry_points.txt +5 -0
- morphogen-1.0.0.dist-info/licenses/LICENSE +674 -0
morphogen/symmetry.py
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
"""Finite symmetry groups of periodic cells and their real irreducible representations,
|
|
2
|
+
for the equivariant bifurcation analysis of architectured materials (Azulay &
|
|
3
|
+
Combescure 2024).
|
|
4
|
+
|
|
5
|
+
A symmetry ``g = (R, t)`` maps a point ``x`` to ``R (x - c) + c + t`` modulo the lattice
|
|
6
|
+
of the cell (``c`` the centre of the point operations): the point operations of a
|
|
7
|
+
primitive cell combined with its translations inside a supercell of ``n1 x n2`` (``x
|
|
8
|
+
n3``) primitive cells, a group ``G = P ⋉ (Z_n1 x Z_n2)``, generated by closure from its
|
|
9
|
+
generators and known by its multiplication table.
|
|
10
|
+
|
|
11
|
+
The real irreducible representations come from the regular representation, without
|
|
12
|
+
tables (GAP): a random symmetric operator averaged over the group, ``S = Σ_g R(g) A
|
|
13
|
+
R(g)^T``, commutes with the group, so that its eigenspaces are, generically, irreducible
|
|
14
|
+
subspaces; their characters ``χ(g) = tr(Q^T R(g) Q)`` tell them apart, and each irrep is
|
|
15
|
+
kept with its orthogonal matrices ``D(g) = Q^T R(g) Q``. Its isotypic projector on any
|
|
16
|
+
orthogonal representation ``T`` is ``P = d / (|G| <χ, χ>) Σ_g χ(g) T(g)`` (``<χ, χ>`` = 1, 2
|
|
17
|
+
or 4 for irreps of real, complex or quaternionic type).
|
|
18
|
+
|
|
19
|
+
The equivariant branching lemma (Vanderbauwhede 1980): an isotropy subgroup ``H`` of an
|
|
20
|
+
irrep with a one-dimensional fixed-point subspace, ``dim Fix(H) = (1/|H|) Σ_h tr D(h) =
|
|
21
|
+
1``, carries a branch of bifurcated solutions of symmetry ``H``. The fixed-point
|
|
22
|
+
subspaces of the subgroups are the intersections of those of the elements; each line
|
|
23
|
+
among them is the fixed-point subspace of its stabilizer, an axial isotropy subgroup;
|
|
24
|
+
conjugate subgroups (``g H g^-1``) give the same pattern turned or shifted, a class.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
from __future__ import annotations
|
|
28
|
+
|
|
29
|
+
from dataclasses import dataclass, field
|
|
30
|
+
|
|
31
|
+
import numpy as np
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _canonical(t: np.ndarray, lattice: np.ndarray, inverse: np.ndarray, tol: float) -> np.ndarray:
|
|
35
|
+
"""A translation reduced modulo the lattice (fractional coordinates in ``[0, 1)``)."""
|
|
36
|
+
frac = inverse @ t
|
|
37
|
+
frac = frac - np.floor(frac + tol)
|
|
38
|
+
frac[np.abs(frac - 1.0) < tol] = 0.0
|
|
39
|
+
return lattice @ frac
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@dataclass
|
|
43
|
+
class Group:
|
|
44
|
+
"""A finite group of isometries ``(R, t)`` of a periodic cell (lattice vectors in the
|
|
45
|
+
columns of ``lattice``, point operations about ``centre``), with its multiplication
|
|
46
|
+
table (``table[a, b]`` is the element ``a b``: first ``b``, then ``a``) and inverses."""
|
|
47
|
+
|
|
48
|
+
rotations: np.ndarray
|
|
49
|
+
translations: np.ndarray
|
|
50
|
+
lattice: np.ndarray
|
|
51
|
+
centre: np.ndarray
|
|
52
|
+
table: np.ndarray
|
|
53
|
+
inverse: np.ndarray
|
|
54
|
+
_irreps: list | None = field(default=None, repr=False, compare=False)
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def order(self) -> int:
|
|
58
|
+
return len(self.rotations)
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def generate(cls, generators, lattice, centre=None, tol: float = 1e-8) -> Group:
|
|
62
|
+
"""The group generated by ``generators`` (pairs ``(R, t)``), closed modulo the
|
|
63
|
+
lattice (its vectors in the columns)."""
|
|
64
|
+
lattice = np.atleast_2d(np.asarray(lattice, dtype=float))
|
|
65
|
+
dim = lattice.shape[0]
|
|
66
|
+
inv = np.linalg.inv(lattice)
|
|
67
|
+
centre = np.zeros(dim) if centre is None else np.asarray(centre, dtype=float)
|
|
68
|
+
|
|
69
|
+
def keys(r, t):
|
|
70
|
+
"""Integer keys of elements (rounded rotations, fractional translations in
|
|
71
|
+
[0, 1)) and their translations reduced modulo the lattice."""
|
|
72
|
+
frac = t @ inv.T
|
|
73
|
+
frac = frac - np.floor(frac + tol)
|
|
74
|
+
frac[np.abs(frac - 1.0) < tol] = 0.0
|
|
75
|
+
kr = np.round(r.reshape(len(r), -1) * 1e6).astype(np.int64)
|
|
76
|
+
kt = np.round(frac * 1e6).astype(np.int64) % 1000000
|
|
77
|
+
return np.hstack([kr, kt]), frac @ lattice.T
|
|
78
|
+
|
|
79
|
+
gr = np.array([np.asarray(r, dtype=float) for r, _ in generators]).reshape(-1, dim, dim)
|
|
80
|
+
gt = np.array([np.asarray(t, dtype=float) for _, t in generators]).reshape(-1, dim)
|
|
81
|
+
k0, t0 = keys(np.eye(dim)[None], np.zeros((1, dim)))
|
|
82
|
+
index = {k0[0].tobytes(): 0}
|
|
83
|
+
rotations, translations = [np.eye(dim)], [t0[0]]
|
|
84
|
+
frontier_r, frontier_t = np.eye(dim)[None], t0
|
|
85
|
+
while len(frontier_r): # products g h of the generators and the newest elements
|
|
86
|
+
r = np.einsum("gij,hjk->ghik", gr, frontier_r).reshape(-1, dim, dim)
|
|
87
|
+
t = (np.einsum("gij,hj->ghi", gr, frontier_t) + gt[:, None, :]).reshape(-1, dim)
|
|
88
|
+
k, t = keys(r, t)
|
|
89
|
+
fresh = []
|
|
90
|
+
for i, row in enumerate(k):
|
|
91
|
+
b = row.tobytes()
|
|
92
|
+
if b not in index:
|
|
93
|
+
index[b] = len(rotations)
|
|
94
|
+
rotations.append(r[i])
|
|
95
|
+
translations.append(t[i])
|
|
96
|
+
fresh.append(i)
|
|
97
|
+
frontier_r, frontier_t = r[fresh], t[fresh]
|
|
98
|
+
if len(rotations) > 20000:
|
|
99
|
+
raise ValueError("Group.generate: the group is not finite (or too large)")
|
|
100
|
+
rotations, translations = np.array(rotations), np.array(translations)
|
|
101
|
+
n = len(rotations)
|
|
102
|
+
r = np.einsum("aij,bjk->abik", rotations, rotations).reshape(-1, dim, dim)
|
|
103
|
+
t = (np.einsum("aij,bj->abi", rotations, translations) + translations[:, None, :]).reshape(
|
|
104
|
+
-1, dim
|
|
105
|
+
)
|
|
106
|
+
k, _ = keys(r, t)
|
|
107
|
+
table = np.array([index[row.tobytes()] for row in k], dtype=np.int64).reshape(n, n)
|
|
108
|
+
inverse = np.argmax(table == 0, axis=1)
|
|
109
|
+
return cls(rotations, translations, lattice, centre, table, inverse)
|
|
110
|
+
|
|
111
|
+
def subgroup(self, keep) -> Group:
|
|
112
|
+
"""The subgroup of the elements ``keep`` (indices or a mask, closed under products),
|
|
113
|
+
as a group of its own."""
|
|
114
|
+
keep = np.flatnonzero(keep) if np.asarray(keep).dtype == bool else np.asarray(keep)
|
|
115
|
+
position = np.full(self.order, -1)
|
|
116
|
+
position[keep] = np.arange(len(keep))
|
|
117
|
+
table = position[self.table[np.ix_(keep, keep)]]
|
|
118
|
+
if np.any(table < 0):
|
|
119
|
+
raise ValueError("subgroup: the elements are not closed under products")
|
|
120
|
+
inverse = position[self.inverse[keep]]
|
|
121
|
+
return Group(
|
|
122
|
+
self.rotations[keep], self.translations[keep], self.lattice, self.centre, table, inverse
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
def stabilizer_of(self, tensor, tol: float = 1e-9) -> np.ndarray:
|
|
126
|
+
"""Mask of the elements whose point operation leaves a second-order ``tensor``
|
|
127
|
+
invariant (``R E R^T = E``): the symmetry of a macroscopic loading."""
|
|
128
|
+
e = np.asarray(tensor, dtype=float)
|
|
129
|
+
scale = max(float(np.abs(e).max()), 1e-300)
|
|
130
|
+
return np.array([np.abs(r @ e @ r.T - e).max() <= tol * scale for r in self.rotations])
|
|
131
|
+
|
|
132
|
+
def action(self, points, tol: float = 1e-6) -> np.ndarray:
|
|
133
|
+
"""``perm[g, i]``: the point that ``g`` maps point ``i`` to (points mapped onto
|
|
134
|
+
themselves modulo the lattice; an error otherwise)."""
|
|
135
|
+
from scipy.spatial import cKDTree
|
|
136
|
+
|
|
137
|
+
x = np.atleast_2d(np.asarray(points, dtype=float))
|
|
138
|
+
inv = np.linalg.inv(self.lattice)
|
|
139
|
+
|
|
140
|
+
def unit(y): # fractional coordinates in [0, 1)
|
|
141
|
+
frac = y @ inv.T
|
|
142
|
+
frac = frac - np.floor(frac)
|
|
143
|
+
return np.where(frac >= 1.0, 0.0, frac)
|
|
144
|
+
|
|
145
|
+
tree = cKDTree(unit(x), boxsize=1.0)
|
|
146
|
+
perm = np.empty((self.order, len(x)), dtype=np.int64)
|
|
147
|
+
for g in range(self.order):
|
|
148
|
+
y = (x - self.centre) @ self.rotations[g].T + self.centre + self.translations[g]
|
|
149
|
+
dist, idx = tree.query(unit(y))
|
|
150
|
+
if np.any(dist > tol):
|
|
151
|
+
raise ValueError("action: the points are not invariant under the group")
|
|
152
|
+
perm[g] = idx
|
|
153
|
+
return perm
|
|
154
|
+
|
|
155
|
+
def conjugate(self, members) -> list[frozenset]:
|
|
156
|
+
"""The distinct conjugates ``g H g^-1`` of a subgroup (a set of element indices)."""
|
|
157
|
+
h = np.fromiter(members, dtype=np.int64)
|
|
158
|
+
out = {
|
|
159
|
+
frozenset(self.table[self.table[g, h], self.inverse[g]].tolist())
|
|
160
|
+
for g in range(self.order)
|
|
161
|
+
}
|
|
162
|
+
return sorted(out, key=sorted)
|
|
163
|
+
|
|
164
|
+
def irreps(self, seed: int = 0) -> list[Irrep]:
|
|
165
|
+
"""The real irreducible representations, the trivial one first, then by dimension."""
|
|
166
|
+
if self._irreps is None:
|
|
167
|
+
self._irreps = _real_irreps(self, seed)
|
|
168
|
+
return self._irreps
|
|
169
|
+
|
|
170
|
+
def describe(self, members) -> dict:
|
|
171
|
+
"""Order, point operations (rotations and mirrors) and translations of a subgroup."""
|
|
172
|
+
h = np.fromiter(members, dtype=np.int64)
|
|
173
|
+
points = {tuple(np.round(self.rotations[g].ravel(), 6)) for g in h}
|
|
174
|
+
dim = self.rotations.shape[1]
|
|
175
|
+
dets = [np.linalg.det(np.reshape(p, (dim, dim))) for p in points]
|
|
176
|
+
pure = [g for g in h if np.allclose(self.rotations[g], np.eye(dim))]
|
|
177
|
+
mirrors = int(sum(d < 0 for d in dets))
|
|
178
|
+
rotations = len(points) - mirrors
|
|
179
|
+
if dim == 2:
|
|
180
|
+
name = f"D{rotations}" if mirrors else f"C{rotations}"
|
|
181
|
+
else:
|
|
182
|
+
name = schoenflies([np.reshape(q, (3, 3)) for q in points])
|
|
183
|
+
return {
|
|
184
|
+
"order": len(h),
|
|
185
|
+
"point_group": name,
|
|
186
|
+
"point_order": len(points),
|
|
187
|
+
"mirrors": mirrors,
|
|
188
|
+
"translations": len(pure),
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def _rotation_group(rotations) -> tuple[str, int]:
|
|
193
|
+
"""The type of a finite group of proper rotations: ``C<n>``, ``D<n>``, ``T``, ``O``,
|
|
194
|
+
``I``, and its order."""
|
|
195
|
+
m = len(rotations)
|
|
196
|
+
orders = []
|
|
197
|
+
for r in rotations:
|
|
198
|
+
angle = np.degrees(np.arccos(np.clip((np.trace(r) - 1.0) / 2.0, -1.0, 1.0)))
|
|
199
|
+
orders.append(round(360.0 / angle) if angle > 1e-6 else 1)
|
|
200
|
+
if m == 12 and max(orders) == 3 and orders.count(3) == 8:
|
|
201
|
+
return "T", m
|
|
202
|
+
if m == 24 and max(orders) == 4 and orders.count(3) == 8:
|
|
203
|
+
return "O", m
|
|
204
|
+
if m == 60:
|
|
205
|
+
return "I", m
|
|
206
|
+
top = max(orders)
|
|
207
|
+
return (f"C{m}", m) if top == m else (f"D{m // 2}", m)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def schoenflies(operations) -> str:
|
|
211
|
+
"""The Schoenflies symbol of a finite group of 3 x 3 orthogonal matrices (the point
|
|
212
|
+
operations of a crystal: ``C1``, ``Ci``, ``Cs``, ``C4v``, ``D4h``, ``Td``, ``Oh``...)."""
|
|
213
|
+
ops = [np.asarray(r, dtype=float) for r in operations]
|
|
214
|
+
proper = [r for r in ops if np.linalg.det(r) > 0]
|
|
215
|
+
kind, _ = _rotation_group(proper)
|
|
216
|
+
if len(proper) == len(ops):
|
|
217
|
+
return kind
|
|
218
|
+
if any(np.allclose(r, -np.eye(3)) for r in ops): # G = P x Ci
|
|
219
|
+
n = int(kind[1:]) if kind[0] in "CD" else 0
|
|
220
|
+
if kind == "C1":
|
|
221
|
+
return "Ci"
|
|
222
|
+
if kind[0] == "C":
|
|
223
|
+
return f"S{2 * n}" if n % 2 else f"C{n}h"
|
|
224
|
+
if kind[0] == "D":
|
|
225
|
+
return f"D{n}d" if n % 2 else f"D{n}h"
|
|
226
|
+
return kind + "h"
|
|
227
|
+
# no inversion: the rotation group isomorphic to G (-g for the improper g)
|
|
228
|
+
twin, _ = _rotation_group([r if np.linalg.det(r) > 0 else -r for r in ops])
|
|
229
|
+
if kind == "C1":
|
|
230
|
+
return "Cs"
|
|
231
|
+
if kind == "T":
|
|
232
|
+
return "Td"
|
|
233
|
+
n = int(kind[1:])
|
|
234
|
+
if kind[0] == "C":
|
|
235
|
+
if twin[0] == "D":
|
|
236
|
+
return f"C{n}v"
|
|
237
|
+
return f"S{2 * n}" if n % 2 == 0 else f"C{n}h"
|
|
238
|
+
return f"D{n}d" if twin == f"D{2 * n}" and n % 2 == 0 else f"D{n}h"
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
@dataclass
|
|
242
|
+
class Irrep:
|
|
243
|
+
"""A real irreducible representation: its dimension, character, orthogonal matrices
|
|
244
|
+
``D(g)`` and type (``<χ, χ>``: 1 real, 2 complex, 4 quaternionic)."""
|
|
245
|
+
|
|
246
|
+
dim: int
|
|
247
|
+
character: np.ndarray
|
|
248
|
+
matrices: np.ndarray
|
|
249
|
+
kind: int
|
|
250
|
+
|
|
251
|
+
def projector_weights(self) -> np.ndarray:
|
|
252
|
+
"""``w(g)`` of the isotypic projector ``P = Σ_g w(g) T(g)`` of any representation."""
|
|
253
|
+
n = len(self.character)
|
|
254
|
+
return self.dim / (n * self.kind) * self.character
|
|
255
|
+
|
|
256
|
+
def fixed_dimension(self, members) -> float:
|
|
257
|
+
"""``dim Fix(H)`` by the trace formula."""
|
|
258
|
+
h = np.fromiter(members, dtype=np.int64)
|
|
259
|
+
return float(np.trace(self.matrices[h], axis1=1, axis2=2).mean())
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
def _real_irreps(group: Group, seed: int) -> list[Irrep]:
|
|
263
|
+
n = group.order
|
|
264
|
+
rng = np.random.default_rng(seed)
|
|
265
|
+
a = rng.normal(size=(n, n))
|
|
266
|
+
a = a + a.T
|
|
267
|
+
# regular representation: R(g) e_h = e_{gh}; S = Σ_g R(g) A R(g)^T
|
|
268
|
+
s = np.zeros((n, n))
|
|
269
|
+
for g in range(n):
|
|
270
|
+
p = group.table[g] # h -> g h
|
|
271
|
+
s[np.ix_(p, p)] += a
|
|
272
|
+
values, vectors = np.linalg.eigh(s)
|
|
273
|
+
scale = max(float(np.abs(values).max()), 1.0)
|
|
274
|
+
breaks = np.flatnonzero(np.diff(values) > 1e-7 * scale) + 1
|
|
275
|
+
found: list[Irrep] = []
|
|
276
|
+
for block in np.split(np.arange(n), breaks):
|
|
277
|
+
q = vectors[:, block]
|
|
278
|
+
d = np.empty((n, len(block), len(block)))
|
|
279
|
+
for g in range(n):
|
|
280
|
+
moved = np.empty_like(q)
|
|
281
|
+
moved[group.table[g]] = q # (R(g) q)[g h] = q[h]
|
|
282
|
+
d[g] = q.T @ moved
|
|
283
|
+
chi = np.trace(d, axis1=1, axis2=2)
|
|
284
|
+
if any(np.allclose(chi, other.character, atol=1e-6) for other in found):
|
|
285
|
+
continue
|
|
286
|
+
kind = round(float(np.mean(chi**2)))
|
|
287
|
+
found.append(Irrep(len(block), chi, d, kind))
|
|
288
|
+
trivial = [i for i, r in enumerate(found) if r.dim == 1 and np.allclose(r.character, 1.0)]
|
|
289
|
+
others = [i for i in range(len(found)) if i not in trivial]
|
|
290
|
+
order = trivial + sorted(others, key=lambda i: (found[i].dim, -found[i].character.sum()))
|
|
291
|
+
return [found[i] for i in order]
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
def _null(m: np.ndarray, tol: float = 1e-8) -> np.ndarray:
|
|
295
|
+
"""Orthonormal basis of the null space of ``m``."""
|
|
296
|
+
if m.size == 0:
|
|
297
|
+
return np.eye(m.shape[1])
|
|
298
|
+
_, s, vt = np.linalg.svd(m)
|
|
299
|
+
rank = int(np.sum(s > tol * max(1.0, float(s.max()) if s.size else 1.0)))
|
|
300
|
+
return vt[rank:].T
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
def _key(basis: np.ndarray) -> bytes:
|
|
304
|
+
p = basis @ basis.T
|
|
305
|
+
return np.round(p, 6).tobytes()
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
@dataclass
|
|
309
|
+
class AxialClass:
|
|
310
|
+
"""A class of conjugate axial isotropy subgroups of an irrep: the subgroups (sets of
|
|
311
|
+
element indices; the first is the representative), the fixed vector of the first in
|
|
312
|
+
the irrep and its description."""
|
|
313
|
+
|
|
314
|
+
subgroups: list[frozenset]
|
|
315
|
+
vector: np.ndarray
|
|
316
|
+
description: dict
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
def axial_subgroups(group: Group, irrep: Irrep) -> list[AxialClass]:
|
|
320
|
+
"""The classes of isotropy subgroups of ``irrep`` with one-dimensional fixed-point
|
|
321
|
+
subspaces (the equivariant branching lemma), the largest first."""
|
|
322
|
+
d = irrep.dim
|
|
323
|
+
_, sv, vt = np.linalg.svd(irrep.matrices - np.eye(d))
|
|
324
|
+
fixed = {}
|
|
325
|
+
for g in range(group.order):
|
|
326
|
+
rank = int(np.sum(sv[g] > 1e-8))
|
|
327
|
+
if rank < d:
|
|
328
|
+
basis = vt[g, rank:].T
|
|
329
|
+
fixed.setdefault(_key(basis), basis)
|
|
330
|
+
projectors = np.array([b @ b.T for b in fixed.values()])
|
|
331
|
+
lattice = dict(fixed)
|
|
332
|
+
frontier = [b for b in fixed.values() if b.shape[1] > 1]
|
|
333
|
+
while frontier: # intersections with the fixed spaces of the elements
|
|
334
|
+
new = []
|
|
335
|
+
for u in frontier:
|
|
336
|
+
k = u.shape[1]
|
|
337
|
+
_, s_u, v_u = np.linalg.svd(u[None] - projectors @ u) # (I - P_w) u for all w
|
|
338
|
+
ranks = np.sum(s_u > 1e-8, axis=1)
|
|
339
|
+
for w in np.flatnonzero((ranks > 0) & (ranks < k)):
|
|
340
|
+
basis = u @ v_u[w, ranks[w] :].T
|
|
341
|
+
key = _key(basis)
|
|
342
|
+
if key not in lattice:
|
|
343
|
+
lattice[key] = basis
|
|
344
|
+
if basis.shape[1] > 1:
|
|
345
|
+
new.append(basis)
|
|
346
|
+
frontier = new
|
|
347
|
+
subgroups = {}
|
|
348
|
+
for basis in lattice.values():
|
|
349
|
+
if basis.shape[1] != 1:
|
|
350
|
+
continue
|
|
351
|
+
v = basis[:, 0]
|
|
352
|
+
moved = np.einsum("gij,j->gi", irrep.matrices, v)
|
|
353
|
+
members = frozenset(np.flatnonzero(np.abs(moved - v).max(axis=1) < 1e-7).tolist())
|
|
354
|
+
if abs(irrep.fixed_dimension(members) - 1.0) < 1e-6:
|
|
355
|
+
subgroups.setdefault(members, v)
|
|
356
|
+
classes, seen = [], set()
|
|
357
|
+
for members in sorted(subgroups, key=lambda m: (-len(m), sorted(m))):
|
|
358
|
+
if members in seen:
|
|
359
|
+
continue
|
|
360
|
+
conj = [c for c in group.conjugate(members) if c in subgroups]
|
|
361
|
+
seen.update(conj)
|
|
362
|
+
ordered = [members] + [c for c in conj if c != members]
|
|
363
|
+
classes.append(AxialClass(ordered, subgroups[members], group.describe(members)))
|
|
364
|
+
return classes
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
def representation(group: Group, perm: np.ndarray, blocks) -> list:
|
|
368
|
+
"""The sparse matrices ``T(g)`` of the action of the group on nodal vectors: point
|
|
369
|
+
``i`` carried to ``perm[g, i]`` and its values transformed by ``blocks[g]`` (k x k)."""
|
|
370
|
+
import scipy.sparse as sp
|
|
371
|
+
|
|
372
|
+
n = perm.shape[1]
|
|
373
|
+
out = []
|
|
374
|
+
for g in range(group.order):
|
|
375
|
+
b = np.asarray(blocks[g], dtype=float)
|
|
376
|
+
k = b.shape[0]
|
|
377
|
+
rows = (k * perm[g])[:, None, None] + np.arange(k)[None, :, None]
|
|
378
|
+
cols = (k * np.arange(n))[:, None, None] + np.arange(k)[None, None, :]
|
|
379
|
+
rows, cols = np.broadcast_arrays(rows, cols)
|
|
380
|
+
vals = np.broadcast_to(b, (n, k, k))
|
|
381
|
+
mat = sp.csr_matrix((vals.ravel(), (rows.ravel(), cols.ravel())), shape=(k * n, k * n))
|
|
382
|
+
mat.eliminate_zeros()
|
|
383
|
+
out.append(mat)
|
|
384
|
+
return out
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Turing-like patterns of Young's (1984) activator-inhibitor cellular automaton: each cell
|
|
2
|
+
# weighs the active cells of a near ball against those of a surrounding shell. The
|
|
3
|
+
# inhibition radius sets the wavelength (about 1.5 to 2 times its value); a volume
|
|
4
|
+
# fraction turns the threshold into a rank rule (the most activated cells win).
|
|
5
|
+
model:
|
|
6
|
+
type: activator_inhibitor
|
|
7
|
+
activation_radius: 0.5
|
|
8
|
+
inhibition_radius: 1.25
|
|
9
|
+
volume_fraction: 0.35
|
|
10
|
+
steps: 20
|
|
11
|
+
cell_size: 0.125 # a lattice of 64^3 cells
|
|
12
|
+
domain:
|
|
13
|
+
size: 8.0
|
|
14
|
+
periodic: true
|
|
15
|
+
seed: 1984
|
|
16
|
+
voxels:
|
|
17
|
+
shape: 64
|
|
18
|
+
outputs:
|
|
19
|
+
directory: out/activator_inhibitor
|
|
20
|
+
name: turing
|
|
21
|
+
image: [vti]
|
|
22
|
+
analysis: [volume_fraction, specific_surface, connectivity]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Diffusion-limited aggregation (Witten and Sander 1981): random walkers stick to clusters
|
|
2
|
+
# grown from seeds, which become fractal (dimension about 2.5 in 3D). Eden growth gives
|
|
3
|
+
# compact clusters and ballistic aggregation dense porous ones; geometry: deposit grows
|
|
4
|
+
# films from the face z = 0 of a non-periodic domain. A sticking probability below 1
|
|
5
|
+
# gives denser, reaction-limited aggregates.
|
|
6
|
+
model:
|
|
7
|
+
type: aggregation
|
|
8
|
+
process: dla # dla, eden or ballistic
|
|
9
|
+
geometry: cluster
|
|
10
|
+
n_seeds: 20
|
|
11
|
+
volume_fraction: 0.08
|
|
12
|
+
domain:
|
|
13
|
+
size: 64.0
|
|
14
|
+
periodic: true
|
|
15
|
+
seed: 1981
|
|
16
|
+
voxels:
|
|
17
|
+
shape: 64
|
|
18
|
+
outputs:
|
|
19
|
+
directory: out/aggregation
|
|
20
|
+
name: dla
|
|
21
|
+
image: [vti]
|
|
22
|
+
labels: [vti] # cluster of each particle
|
|
23
|
+
analysis: [volume_fraction, specific_surface, connectivity]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Boolean model of finite fibres (cylinders or spherocylinders).
|
|
2
|
+
model:
|
|
3
|
+
type: boolean_cylinders
|
|
4
|
+
radius: 0.5
|
|
5
|
+
length: 8.0
|
|
6
|
+
orientation: isotropic # or {type: aligned, direction: [0, 0, 1]} / {type: planar, normal: [0, 0, 1]}
|
|
7
|
+
caps: flat # flat | round
|
|
8
|
+
volume_fraction: 0.15
|
|
9
|
+
domain:
|
|
10
|
+
size: 30.0
|
|
11
|
+
periodic: true
|
|
12
|
+
seed: 1
|
|
13
|
+
voxels:
|
|
14
|
+
voxel_size: 0.15
|
|
15
|
+
outputs:
|
|
16
|
+
directory: out/boolean_cylinders
|
|
17
|
+
name: fibres
|
|
18
|
+
geometry: [json]
|
|
19
|
+
image: [vti]
|
|
20
|
+
analysis: [volume_fraction, specific_surface, connectivity]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Boolean model of spheres: porous or granular medium with overlapping grains.
|
|
2
|
+
model:
|
|
3
|
+
type: boolean_spheres
|
|
4
|
+
radius: 1.0 # or {type: lognormal, mean: 1.0, std: 0.2}
|
|
5
|
+
volume_fraction: 0.3 # of the union of spheres (or give `intensity`)
|
|
6
|
+
domain:
|
|
7
|
+
size: 20.0 # cube edge (or [Lx, Ly, Lz])
|
|
8
|
+
periodic: true
|
|
9
|
+
unit: um
|
|
10
|
+
seed: 1
|
|
11
|
+
realizations: 2
|
|
12
|
+
voxels:
|
|
13
|
+
voxel_size: 0.2
|
|
14
|
+
outputs:
|
|
15
|
+
directory: out/boolean_spheres
|
|
16
|
+
name: spheres
|
|
17
|
+
geometry: [json, csv] # json | csv | geo
|
|
18
|
+
image: [vti] # vti | vtk | mhd | npz | npy | tif
|
|
19
|
+
mesh:
|
|
20
|
+
formats: [inp] # inp | msh | vtu (others through meshio)
|
|
21
|
+
phases: [0, 1]
|
|
22
|
+
analysis: [volume_fraction, specific_surface, connectivity]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Bouligand (twisted plywood) structure of the dactyl club of the mantis shrimp or of
|
|
2
|
+
# fish scales: layers of parallel fibres, each turned by 15 degrees from the one below.
|
|
3
|
+
# Twelve layers make a half-turn: the periodic box holds one. The moduli along x and y
|
|
4
|
+
# are equal; the directions of the fibres, taken among the families periodic in the box
|
|
5
|
+
# (here within 1.4 degrees), leave the in-plane shear modulus a few percent off
|
|
6
|
+
# isotropy, less in larger boxes.
|
|
7
|
+
model:
|
|
8
|
+
type: bouligand
|
|
9
|
+
fiber_radius: 0.03
|
|
10
|
+
fiber_spacing: 0.08
|
|
11
|
+
layer_thickness: 0.08333333 # 12 layers in the box
|
|
12
|
+
pitch_angle: 15.0
|
|
13
|
+
start_angle: 0.0
|
|
14
|
+
domain:
|
|
15
|
+
size: 1.0
|
|
16
|
+
periodic: true
|
|
17
|
+
voxels:
|
|
18
|
+
shape: 128
|
|
19
|
+
homogenization:
|
|
20
|
+
method: fft
|
|
21
|
+
materials:
|
|
22
|
+
0: {young: 2.0, poisson: 0.4} # protein matrix
|
|
23
|
+
1: {young: 40.0, poisson: 0.3} # mineralized chitin fibres
|
|
24
|
+
properties: [stiffness]
|
|
25
|
+
outputs:
|
|
26
|
+
directory: out/bouligand
|
|
27
|
+
name: plywood
|
|
28
|
+
analysis: [volume_fraction]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Bicontinuous two-phase structure coarsened by a cellular automaton: Vichniac's twisted
|
|
2
|
+
# majority rule ("anneal") moves the interfaces of random noise by their mean curvature,
|
|
3
|
+
# like the annealing of a binary alloy. Other rules: majority, conserved (coarsening at
|
|
4
|
+
# constant volume fraction), clouds (cave-like structures) or any B.../S... rule.
|
|
5
|
+
model:
|
|
6
|
+
type: cellular_automaton
|
|
7
|
+
rule: anneal
|
|
8
|
+
neighbourhood: moore # von_neumann, moore, edges or euclidean
|
|
9
|
+
steps: 40
|
|
10
|
+
initial_fraction: 0.5
|
|
11
|
+
cell_size: 0.25 # a lattice of 64^3 cells
|
|
12
|
+
smoothing: 0.75 # rounded interfaces at other resolutions and in meshes
|
|
13
|
+
domain:
|
|
14
|
+
size: 16.0
|
|
15
|
+
periodic: true
|
|
16
|
+
seed: 1984
|
|
17
|
+
voxels:
|
|
18
|
+
shape: 64 # one voxel per cell: the lattice itself
|
|
19
|
+
outputs:
|
|
20
|
+
directory: out/cellular_automaton
|
|
21
|
+
name: anneal
|
|
22
|
+
geometry: [json] # exact lattice: re-voxelize or mesh it later
|
|
23
|
+
image: [vti]
|
|
24
|
+
level_set: [vti]
|
|
25
|
+
analysis: [volume_fraction, specific_surface, connectivity]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Spheres with an interphase: a coating of constant thickness around non-overlapping
|
|
2
|
+
# spheres (exact for unions of spheres and segments), three phases whose effective
|
|
3
|
+
# stiffness is computed by FFT. With side: inside, the spheres become hollow shells
|
|
4
|
+
# (core_phase 0), or core-shell particles (core_phase 3).
|
|
5
|
+
model:
|
|
6
|
+
type: coating
|
|
7
|
+
model: {type: hardcore_spheres, radius: 0.1, volume_fraction: 0.25}
|
|
8
|
+
thickness: 0.02
|
|
9
|
+
side: outside # outside: a coating; inside: a shell
|
|
10
|
+
domain:
|
|
11
|
+
size: 1.0
|
|
12
|
+
periodic: true
|
|
13
|
+
seed: 5
|
|
14
|
+
voxels:
|
|
15
|
+
shape: 96
|
|
16
|
+
homogenization:
|
|
17
|
+
method: fft
|
|
18
|
+
materials:
|
|
19
|
+
0: {young: 3.0, poisson: 0.35} # matrix
|
|
20
|
+
1: {young: 70.0, poisson: 0.22} # spheres
|
|
21
|
+
2: {young: 10.0, poisson: 0.3} # interphase
|
|
22
|
+
properties: [stiffness]
|
|
23
|
+
outputs:
|
|
24
|
+
directory: out/coated_spheres
|
|
25
|
+
name: coated
|
|
26
|
+
analysis: [phase_fractions]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Bending fibres drawn into contact (Keilmann, Redenbach & Willot 2026): the random walks
|
|
2
|
+
# of Altendorf & Jeulin packed without overlap, then the pairs of fibres closer than the
|
|
3
|
+
# interaction distance (here half a radius, the paper's 1 voxel for a radius of 2) drawn
|
|
4
|
+
# together by contact forces against the springs of the fibres. The summary gives the
|
|
5
|
+
# contacts per fibre before and after the contact packing; the theory, Toll's estimate.
|
|
6
|
+
model:
|
|
7
|
+
type: random_walk_fibers
|
|
8
|
+
radius: 0.5
|
|
9
|
+
length: 10.0 # contour length: aspect ratio L / 2r = 10
|
|
10
|
+
orientation: isotropic
|
|
11
|
+
kappa1: 10.0
|
|
12
|
+
kappa2: 100.0
|
|
13
|
+
step: 1.0 # segments of a radius (the paper's balls: 0.5)
|
|
14
|
+
volume_fraction: 0.2
|
|
15
|
+
interaction_distance: 0.25
|
|
16
|
+
domain:
|
|
17
|
+
size: 20.0
|
|
18
|
+
periodic: true
|
|
19
|
+
seed: 2026
|
|
20
|
+
voxels:
|
|
21
|
+
voxel_size: 0.1
|
|
22
|
+
outputs:
|
|
23
|
+
directory: out/contact_fibers
|
|
24
|
+
name: fibres
|
|
25
|
+
geometry: [json]
|
|
26
|
+
image: [vti]
|
|
27
|
+
analysis: [volume_fraction, specific_surface, connectivity]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Nanocomposite: small particles clustered in aggregates, a Cox Boolean model of
|
|
2
|
+
# spheres whose germs fall in the phase 1 of a Boolean model of large spheres (carbon
|
|
3
|
+
# black or silica in elastomers: Jean, Jeulin et al. 2011). Non-overlapping particles
|
|
4
|
+
# (hardcore); the aggregates around them may form a phase of their own (bound rubber).
|
|
5
|
+
model:
|
|
6
|
+
type: cox_spheres
|
|
7
|
+
aggregates: {type: boolean_spheres, radius: 0.1, volume_fraction: 0.25}
|
|
8
|
+
radius: 0.012
|
|
9
|
+
local_fraction: 0.35 # fraction of the aggregates taken by the particles
|
|
10
|
+
hardcore: true
|
|
11
|
+
aggregate_phase: 2 # omit for two phases (particles in a matrix)
|
|
12
|
+
domain:
|
|
13
|
+
size: 1.0
|
|
14
|
+
periodic: true
|
|
15
|
+
seed: 11
|
|
16
|
+
voxels:
|
|
17
|
+
shape: 192
|
|
18
|
+
outputs:
|
|
19
|
+
directory: out/cox_nanocomposite
|
|
20
|
+
name: nanocomposite
|
|
21
|
+
geometry: [json, csv] # csv: centres and radii of the particles
|
|
22
|
+
analysis: [phase_fractions, specific_surface]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Entangled cross-linked fibres (Mezeix et al. 2009; Chatti et al. 2018, 2020): carbon
|
|
2
|
+
# fibres of 7 um at 8.5 %, long enough to cross the volume element (infinite fibres on
|
|
3
|
+
# Poisson lines: the domain must be non-periodic), gathered about the plane normal to the
|
|
4
|
+
# axis of compression by moulding (their Gaussian girdle, sigma = 0.4 rad), half their
|
|
5
|
+
# contacts bonded by epoxy cross-links (phase 2). Contacts 42 um apart along the fibres
|
|
6
|
+
# on average (39 um if isotropic; d / 2f = 41 um at small fractions), cross-links 84 um.
|
|
7
|
+
model:
|
|
8
|
+
type: cross_linked_fibers
|
|
9
|
+
radius: 3.5
|
|
10
|
+
orientation: {type: girdle, sigma: 0.4, axis: [0, 0, 1]}
|
|
11
|
+
volume_fraction: 0.085
|
|
12
|
+
bonded_fraction: 0.5
|
|
13
|
+
link_radius: 5.0
|
|
14
|
+
domain:
|
|
15
|
+
size: 200.0
|
|
16
|
+
periodic: false
|
|
17
|
+
unit: um
|
|
18
|
+
seed: 2018
|
|
19
|
+
voxels:
|
|
20
|
+
voxel_size: 1.0
|
|
21
|
+
outputs:
|
|
22
|
+
directory: out/cross_linked_fibers
|
|
23
|
+
name: fibres
|
|
24
|
+
geometry: [json]
|
|
25
|
+
image: [vti]
|
|
26
|
+
analysis: [volume_fraction, specific_surface, connectivity]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Curved fibres as in NASA's PuMA: circular arcs whose radii of curvature are uniform
|
|
2
|
+
# between 15 and 30, here without overlap (random sequential addition, no two fibres
|
|
3
|
+
# closer than min_gap), lying in planes close to xy as in fibrous preforms. Other shapes:
|
|
4
|
+
# shape: worm_like (persistent random walk, persistence) or helix (crimp: helix_radius,
|
|
5
|
+
# helix_pitch); overlap: true gives the Boolean model.
|
|
6
|
+
model:
|
|
7
|
+
type: curved_fibers
|
|
8
|
+
shape: arc
|
|
9
|
+
radius: 0.5
|
|
10
|
+
length: 16.0 # contour length
|
|
11
|
+
segments: 12
|
|
12
|
+
curvature_radius: {type: uniform, low: 15.0, high: 30.0}
|
|
13
|
+
orientation: {type: planar, normal: [0, 0, 1]} # the tangents at the middles of the arcs
|
|
14
|
+
overlap: false
|
|
15
|
+
min_gap: 0.1
|
|
16
|
+
volume_fraction: 0.1
|
|
17
|
+
domain:
|
|
18
|
+
size: 40.0
|
|
19
|
+
periodic: true
|
|
20
|
+
seed: 7
|
|
21
|
+
voxels:
|
|
22
|
+
voxel_size: 0.25
|
|
23
|
+
outputs:
|
|
24
|
+
directory: out/curved_arcs
|
|
25
|
+
name: fibres
|
|
26
|
+
geometry: [json]
|
|
27
|
+
image: [vti]
|
|
28
|
+
analysis: [volume_fraction, specific_surface, connectivity, minkowski]
|