Skip to content
Projects

Grid

The equations of simgeometry.grid, declared on the code that implements them and checked by the tests.

Grid

classsource

Represent grid coordinates for a bounded simulation domain.

nodes
xi=l+i h,i=0,…,N−1x_i = l + i\,h, \qquad i = 0, \dots, N - 1
spacing
h=u−lN−1  (bounded axis),h=u−lN  (periodic axis)h = \frac{u - l}{N - 1} \;\text{(bounded axis)}, \qquad h = \frac{u - l}{N} \;\text{(periodic axis)}
cell
i=⌊x−lh⌋for l≤x<ui = \left\lfloor \frac{x - l}{h} \right\rfloor \quad \text{for } l \le x < u
Assumes
  • uniform nodes per axis, in C order; on a bounded axis the first and last node sit on the bounds, on a periodic axis the last node is one spacing before uu
  • outside the half-open box get_cell_indices returns an empty tuple
  • ghost points only widen the local node count to Nlocal+2gN_\mathrm{local} + 2g; the halo exchange is mpiarray's