Initializations
Initializations is a namespace of static functions that populate the initial PhaseField (and optionally the composition, orientations, or velocity state) at the start of a simulation. The functions cover the common setups — single grain, rectangular slabs, spheres, cylinders, Voronoi tessellations, multi-grain tessellations, and file-driven imports. They are code-driven: there is no @Initializations block, users compose a main() that calls the relevant setup functions.
Key Classes and Concepts
All helpers live under openphase::Initializations:: and are static. Grouping by geometry family:
Single-feature placement
| Function | Purpose |
|---|---|
Single(Phase, PhaseIndex, …) | Fill the domain with one phase. |
Sphere(Phase, PhaseIndex, …) | Place a single sphere of PhaseIndex. |
SphereInGrain(Phase, …) | Place a sphere inside an existing grain. |
Ellipsoid(Phase, PhaseIndex, …) | Place a single ellipsoid. |
Cylinder(Phase, PhaseIndex, …) | Place a cylinder. |
Rectangular(Phase, PhaseIndex, …) | Place a rectangular block. |
Layer(Phase, PhaseIndex, …) | Place an axis-aligned layer/slab. |
SectionalPlane(Phase, PhaseIndex, …) | Cut the domain with an oriented plane. |
Multi-grain setups
| Function | Purpose |
|---|---|
VoronoiTessellation(Phase, BC, N, GrainsPhase) | N-grain Voronoi tessellation of the specified phase. |
QuasiRandomNuclei(Phase, …) | Place N quasi-randomly distributed nuclei. |
QuasiRandomSpheres(Phase, …) | Non-overlapping spheres at quasi-random positions. |
RandomNuclei(Phase, Settings, …) | Random-seed nuclei distribution. |
Fractional(Phase, …) | Two-phase system with specified volume fractions. |
ThreeFractionals(Phase, …) | Three-phase volume-fraction layout. |
TwoWalls / TwoDifferentWalls | Boundary walls between phases. |
TripleJunction(Phase, PhaseIndex, …) | Seed a triple-junction geometry. |
Young3 / Young4 / Young4Periodic | Young's-angle test geometries. |
ThermalGrooving(Phase, …) | Classic thermal-grooving benchmark geometry. |
FillGrainWithSpheres(Phase, …) | Fill an existing grain with spheres. |
FillRectangularWithSpheres(…) | Pack spheres into a rectangular volume. |
RectangularGreenBody(…) | Green-body (sintering) starting microstructure. |
File-driven imports
| Function | Purpose |
|---|---|
Read(Phase, FileName, …) | Read a binary phase-field state. |
ReadCSV(Phase, BC, …) | Read from a CSV microstructure description. |
TwoDimEBSD(filename, columns, …) | Import a 2D EBSD map. |
TwoDimEBSDWithOrientations(…) | EBSD import including orientations. |
Usage
Input
None. Initializations consumes only its code-level arguments and the already-initialised Settings and optionally BoundaryConditions.
Output
None. The functions mutate the target storage (typically PhaseField) in place.
Example
From the grain-growth walkthrough on Phase Field:
int number_of_grains = 200;
size_t GrainsPhase = 0;
Initializations::VoronoiTessellation(Phi, BC, number_of_grains, GrainsPhase);
Initializations::RandomOrientations(Phi);Dependencies
- PhaseField — the primary target storage.
- Settings — supplies phase/component metadata.
- BoundaryConditions — applied by the tessellation functions after assignment.
- Orientations — populated by EBSD and orientation-aware initialisers.