How the schemes reconstruct a field
Particles store samples, not a continuous field. A reconstruction decides what the field looks like between those samples, which derivatives to assign to it, and what each side of a particle interaction should see. This guide compares the production schemes in warpSPHCore, starting with the ordinary SPH sum.
The figures below come from the production CPU APIs in float64, using the Wendland2 kernel and deterministic irregular particle clouds. They illustrate capabilities and failure modes, not performance or a universal ranking. The API and numerical contracts cover shapes, differentiation, conditioning and supported configurations in more detail.
Three different questions
For particle samples , distinguish:
- A value at a location: what is ? SPH interpolation and MLS value evaluation answer this question.
- A derivative at a particle: what is ? SPH gradient formulas, gradient renormalization and polynomial derivatives answer this question.
- Two states at an interface: what does particle predict there, and what does particle predict there? Polynomial patches and TENO/WENO supply and for a downstream flux or Riemann solver.
Those answers need not coincide. A local polynomial can preserve the stored center value while changing its slope. A corrected gradient can improve a derivative without changing the interpolated value. Two accurate one-sided states can intentionally disagree at a discontinuity.
| Scheme in this repo | What changes relative to an ordinary SPH sum? | What it directly supplies |
|---|---|---|
| Plain SPH | Uses volume-weighted kernel contributions | A smoothed value; separate SPH derivative operators |
| Normalized SPH / Shepard comparison | Divides the value sum by its weight sum | A constant-reproducing value where that sum is nonzero |
| CRK | Solves local moment constraints for corrected kernel weights | Constant/linear-reproducing values and a corrected kernel gradient on resolved stencils |
| Gradient renormalization | Corrects the response of a gradient operator to linear fields | A corrected derivative; no new field-value reconstruction |
MLS/RKPM, PolyFit(constant=True) | Fits a polynomial including its constant coefficient | A fitted value, diffuse derivatives and an evaluable local patch |
LABFM, PolyFit(constant=False) | Fits differences from the stored center value | An anchored local patch and diffuse derivatives |
| MLS-TENO | Selects a central polynomial or blends directional candidates using smoothness | Two nonlinear interface states |
| MLS-WENO | Continuously weights central/directional difference fits using smoothness | Two nonlinear interface states |
Here “standard SPH” means the uncorrected WarpOperation.Interpolate value
sum, together with explicitly named SPH gradient variants when discussing
derivatives. It does not mean every conservative SPH discretization or every
limiter used in a larger fluid solver.
1. Standard SPH: add overlapping kernel contributions
With reference volumes , the ordinary value sum at query is
Think of every sample contributing a kernel-shaped bump, scaled by its value and volume. Adding the bumps gives a continuous estimate as the query moves. It usually smooths sharp changes. It need not pass through the stored samples.
A normalized continuum kernel does not automatically make a finite, irregular particle sum normalized. Define its discrete moments using :
For a linear field , the sum gives . Constant reproduction needs ; linear reproduction additionally needs . Missing support at a boundary, irregular spacing and the volume estimates can disturb these identities.
Read the figure: all methods use the same 25 particle locations, the same
support radius , and the same reference apparent volumes from
computeCRKFactors(reference_cloud). Queries span , including the
boundary outside the outermost samples. Gather and Scatter are equivalent
here because every support is equal. The plain sum loses normalization near
the ends and has smaller interior quadrature errors. Curves overlap where
methods reproduce the same field.
Maximum absolute errors across the plotted queries make the overlapping curves easier to compare:
| Field | SPH sum | Normalized SPH | CRK | MLS degree 2 |
|---|---|---|---|---|
| Constant | ||||
| Linear | ||||
| Quadratic |
These magnitudes belong to this deliberately truncated, irregular example; they are not error bounds for the schemes.
The normalized comparison uses
It restores constants, but a one-sided neighborhood still has a nonzero first
moment, so linear fields remain biased. In the figure this is computed from
two production Interpolate calls, one on the field and one on ones. It is
not an automatic normalization option on warpOperation. A zero
denominator would require an explicit caller policy.
2. CRK: enforce the missing discrete moments
CRK changes the kernel weights themselves. Using the code's opposite offset convention , it constructs
so that, on a resolved augmented moment system,
The coefficients compensate for asymmetry instead of assuming neighbors balance. This explains why CRK reproduces the constant and linear examples even at the boundary. The quadratic example retains a small curvature error: these constraints do not enforce quadratic reproduction.
CRK is closely related to a degree-one MLS value fit: with the same weights,
support and a nonsingular moment matrix, the MLS equivalent shape functions
enforce these same linear reproduction constraints. The production APIs are
still different. CRK constructs corrected kernel factors and their spatial
derivatives; PolyFit constructs polynomial coefficients and reads local
polynomial derivatives.
The weights can become negative. Reproduction does not imply a bounded or
positive reconstruction. Degenerate geometry cannot supply missing spatial
directions; CRK uses its documented finite fallback instead. Construction and
consumption must use matching volumes, support rules and interaction filters.
In particular, computeCRKFactors uses apparent volumes, which need not equal
the caller's original volumes. See CRK.
3. Gradient renormalization: correct slopes, not values
The SPH Difference gradient is