Skip to content

Main content

Periodic Ghost Cell Index

Map one allocated periodic ghost-cell storage position to its zero-based interior source cell, with explicit ghost layers on both ends.

Loading tool…

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

  1. Enter storageIndex, interiorCellCount, ghostLayers. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
storageIndexStorage IndexRequired. Safe integer; minimum 0.
interiorCellCountInterior Cell CountRequired. Safe integer; minimum 1.
ghostLayersGhost LayersRequired. Safe integer; minimum 0; maximum 4503599627370495.
Output fieldInterpretationReturned shape
interiorSourceIndexZero-based index relative to the interior region, not the full storage array.Required. Safe integer.
ghostCellGhost CellRequired. Boolean.
json
{
  "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

  1. Calculation and input contract: computational-physics/periodic-ghost-cell-index — tool.io

Similar or alternative tools