Description
Map a supplied storage slot to a periodic interior source index.
Numerical physics calculations depend on discretization, index conventions, boundary conditions and model units. A local force kick is only part of an integration method, a stencil residual is not a solved field, and a one-sided power weight is not a spectral-density normalization. Floating-point resolution also limits grid and coordinate representations.
Map a supplied storage slot to a periodic interior source index.
When to use this tool
Use Periodic Ghost Cell Index when you already have storageIndex, interiorCellCount, ghostLayers and need to map a supplied storage slot to a periodic interior source index.
How to use the tool and how it works
- Enter storageIndex, interiorCellCount, ghostLayers. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read interiorSourceIndex, ghostCell. Inspect ghostCell before interpreting the associated values.
Require safe whole positive interior count, ghost layers within the safe total-size bound and storageIndex within the total array length. Subtract ghostLayers, wrap modulo interior count, and flag indices outside the interior interval.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| storageIndex | Storage Index | Required. Safe integer; minimum 0. |
| interiorCellCount | Interior Cell Count | Required. Safe integer; minimum 1. |
| ghostLayers | Ghost Layers | Required. Safe integer; minimum 0; maximum 4503599627370495. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| interiorSourceIndex | Zero-based index relative to the interior region, not the full storage array. | Required. Safe integer. |
| ghostCell | Ghost Cell | Required. Boolean. |
{
"input": {
"storageIndex": 0,
"interiorCellCount": 4,
"ghostLayers": 1
},
"output": {
"interiorSourceIndex": 3,
"ghostCell": true
}
} Limitations and assumptions
- Returned index is zero-based within the interior, not a shifted storage index. No grid data, copying, boundary physics or valid simulation is checked.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use the complete discretized model, integration algorithm and boundary treatment. Assess convergence, conservation and stability with the full calculation; individual residuals, CFL components, relaxation terms and index mappings do not establish numerical accuracy or physical validity.
References
Similar or alternative tools
- Computational Particle Image Wrap Count
Wrap a supplied coordinate into a periodic box and return its image index.
- Grid Node Cell Center Offset
Calculate nominal cell-center and node coordinates from a supplied uniform grid.