Skip to content

shore check

Validate the cell Jacobians of a structured .geo file layer by layer.

Reports the minimum Jacobian per layer in a table and exits with code 1 if any layer contains an inverted cell.

Synopsis

shore check [OPTIONS] INPUT

Arguments

ArgumentDescription
INPUTPath to a .geo file

Options

OptionDefaultDescription
--warn-threshold FLOAT1e-6Layers with jmin below this value are flagged as warnings even if positive
--helpShow this help and exit

Output

Clean grid

┌────────────────────────────────────────────────┐
│ Jacobian check — sphere.geo                    │
├───────┬────────────┬────────┤
│ Layer │ jmin       │ Status │
├───────┼────────────┼────────┤
│     1 │ 3.4112e-04 │ ok     │
│     2 │ 3.6889e-04 │ ok     │
│   ... │        ... │ ok     │
│    29 │ 8.2341e-03 │ ok     │
└───────┴────────────┴────────┘
✓ All Jacobians positive.

Grid with near-inversion warning

│    14 │ 3.2100e-07 │ warn   │

Grid with inverted cells

│     7 │ -1.2300e-04 │ INVERTED │
✗ Inverted cells detected.

Exit codes

CodeMeaning
0All Jacobians positive (warnings are non-fatal)
1File not found or at least one layer has jmin ≤ 0

The exit code makes shore check composable in shell pipelines:

bash
shore mesh body.stl && shore check body.geo && xall_gpu body.geo

Jacobian definition

The Jacobian for each cell is the scalar triple product:

Ji,j=(e2×e1)e3

where e1, e2, e3 are the three edge vectors of the cell (j-tangent, i-tangent, wall-normal). The reported jmin per layer is the minimum over all (i,j) cells in that layer interval.

See Hyperbolic marching — Jacobian check for the full derivation.

Examples

Validate after generation:

bash
shore mesh sphere.stl -o sphere.geo
shore check sphere.geo

Use a stricter warning threshold:

bash
shore check sphere.geo --warn-threshold 1e-4

In a CI/CD script:

bash
#!/bin/bash
set -e
shore mesh "$INPUT" -o "$OUTPUT"
shore check "$OUTPUT"
echo "Grid $OUTPUT validated."

See also

Released under the MIT License.