Skip to content

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

FunctionPurpose
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

FunctionPurpose
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 / TwoDifferentWallsBoundary walls between phases.
TripleJunction(Phase, PhaseIndex, …)Seed a triple-junction geometry.
Young3 / Young4 / Young4PeriodicYoung'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

FunctionPurpose
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:

cpp
int number_of_grains = 200;
size_t GrainsPhase   = 0;
Initializations::VoronoiTessellation(Phi, BC, number_of_grains, GrainsPhase);
Initializations::RandomOrientations(Phi);

Dependencies

Released under the GNU GPLv3 License.