Grid Parameters
GridParameters holds the discretisation of the simulation domain: the number of grid points along each axis, the grid spacing GridParameters directly; it is read as part of the @GridParameters block owned by Settings, and all consumer modules reach its state through Settings.Grid.
Key Classes and Concepts
GridParameters: member ofSettings. Fields includeNx,Ny,Nz,dx,Bcells,iWidth,Resolution, and — with MPI — the cartesian-grid sizes.
Usage
Input
Defined in the @GridParameters block of the input file. Appears in every OpenPhase .opi input.
text
@GridParameters
$Nx System size in X (grid points) : 128
$Ny System size in Y (grid points) : 128
$Nz System size in Z (grid points) : 1
$dx Grid spacing (physical length) : 1.0e-6
$Bcells Number of boundary (halo) cells : 1
$IWidth Interface width (grid points) : 5.0
$Resolution Grid resolution mode : SINGLE
# MPI-only (optional; ignored in serial builds) {#mpi-only-optional-ignored-in-serial-builds}
$MPI3D Use 3D cartesian domain decomposition : No
$Ncx Processes along X : 1
$Ncy Processes along Y : 1
$Ncz Processes along Z : 1| Token | Variable | Type | Default |
|---|---|---|---|
$Nx / $Ny / $Nz | Nx / Ny / Nz | int | — |
$dx | dx | double | — |
$Bcells | Bcells | int | 1 |
$IWidth / $InterfaceWidth | iWidth | double | — |
$Resolution | Resolution | string | SINGLE |
$MPI3D | MPI_3D_DECOMPOSITION | bool | false |
$Ncx / $Ncy / $Ncz | MPI_CART_SIZE[0..2] | int | 1 |
Output
GridParameters does not write output files. Downstream VTK and raw output embeds the grid metadata automatically through the VTK pipeline.
Example
GridParameters is always read through Settings:
cpp
Settings OPSettings;
OPSettings.ReadInput(InputFile); // also reads @GridParameters
// OPSettings.Grid.Nx, OPSettings.Grid.dx, OPSettings.Grid.iWidth, …Dependencies
- Settings — owner of the block.
- BoundaryConditions — uses the grid dimensions when wrapping halo cells.
- Every storage-backed module (PhaseField, Composition, Temperature, …) allocates according to
GridParameters.