Seam-aware normals
Every block computes the marching normals from its own grid. At a block seam (a row or column of nodes shared by two blocks) a one-sided difference on each side gives two different tangents, hence two different normals for the same node. The difference repeats at every layer and shows on the outer layer as a step in cell size along every seam.
Seam-aware normals remove it: on an edge with a partner block, the boundary tangent is a centred difference against a ghost row taken from the partner. Both blocks then compute the same normal at the shared node and move it the same way.
One-sided differences
The j_hi column of sub-block j_lo column of sub-block
- sub
uses the backward difference layer[:, -1] - layer[:, -2]; - sub
uses the forward difference layer[:, 1] - layer[:, 0].
The two tangents differ in length and, on a curved wall, in direction. Averaging the shared column after each step makes the positions agree, but the directions each block marches in still disagree, and the disagreement accumulates.
Centred differences against ghost rows
_compute_normals(layer, periodic, ghost_rows) takes an optional dict with one row per face:
ghost_rows = {
"j_lo": ..., # (ni, 3): the partner's row next to the shared column
"j_hi": ...,
"i_lo": ..., # (nj, 3)
"i_hi": ...,
}For a face with a ghost row, the tangent at the boundary node is
Where the ghost rows come from
- Sub–sub seams (j): the
j_highost row of subis column 1 of sub , one in from the shared column, and symmetrically. - Cap–equator seams (i): the cap and the sub-blocks are rotated and partly reversed relative to each other (the
_overwrite_cap_boundariesmapping)._sub_ghost_rows(q, ...)returns, for each sub-block, the cap row that lines up with its pole row after that mapping;_cap_ghost_rows(pole, ...)does the inverse for the caps (the sub-blocks' second row from the pole).
All ghost rows of a layer are taken from one snapshot of the six blocks at layer k, so no block reads a neighbour that has already been advanced.
The other topologies use the same mechanism: the O-grid wraps its periodic j-direction, the C-grid passes ghost rows across the upper-TE and lower-TE columns (_march_cgrid_three), and the hybrid wraps reuse the cubed-sphere and C-grid marchers.
Measured effect
On a unit icosphere (subdivision 4), cubed sphere ni=60, nj=60, nk=20, ds=0.02, growth=1.1, the ratio of the first j-cells on the two sides of each sub–sub seam,
stays close to 1 and the deviation decreases outward:
| Layer k | max over seams and i of |
|---|---|
| 0 | 0.0164 |
| 5 | 0.0067 |
| 10 | 0.0033 |
| 15 | 0.0015 |
| 19 | 0.0008 |
The k = 0 value is the wall grid's own mismatch; marching with centred seam tangents damps it instead of growing it.


Cap corners
At a cap corner three block edges meet (two cap edges and one equator meridian). The per-j C1 pin gives them one first cell at k = 0; the seam-aware normals on both sides of the cap–equator seam carry that agreement to the outer layers, and the Dirichlet overwrite of the cap edges keeps the seam nodes identical at every layer.
See also
- Marching: where the normals are used
- k=0 construction: the C1 seam pin at the wall
- Seams kept closed by edits: the related rule for in-place grid edits
shore.topology.sphere_cap:_march_one_layer/_march_cap_layer