What
uw.function.evaluate takes non-dimensional coordinates (while returning SI values — the input/output asymmetry of #771). Feeding it SI coordinates therefore puts almost every point outside the mesh domain — and instead of raising, it returns plausible numbers.
Measured on the notch benchmark (domain [-2,2]×[-1,0] non-dim, coordinates in metres span ±60000):
truth (mat.data): frac strong = 0.7358
evaluate(mat.sym) at SI coords: frac strong = 0.0010 <- silent garbage
evaluate(mat.sym) at coords_nd: frac strong = 0.7358, max err 1.9e-18
The few points whose SI coordinates happen to land inside the small non-dim domain (near the origin) return real values, which makes the output look like a field rather than an error.
Why it matters
The silent return is what turns a units slip into wrong science rather than a crash. In one working session it produced, before being caught: a wrong material-geometry figure, a wrong seed-pressure panel, and two rounds of quantitative claims about viscosity-floor clamping (documented, then retracted) — all internally consistent-looking. A ValueError: 1965 of 1968 query points lie outside the mesh bounding box at the first call would have cost thirty seconds instead.
Suggested fix
At entry, compare the query points against the mesh bounding box (cheap, already known). If more than a small tolerance of points fall outside, raise with a message that names the two ranges — which makes the SI-vs-non-dim mistake self-diagnosing:
evaluate: 1965/1968 query points lie outside the mesh domain
(mesh x: [-2.0, 2.0], query x: [-60000, 60000]).
Coordinates must be NON-DIMENSIONAL (variable.coords_nd, not .coords);
values are returned in SI (#771).
Legitimate slightly-out-of-domain queries (boundary roundoff) pass a tolerance; wholesale mismatch cannot.
Related: #771 (evaluate returns SI values). The two conventions together — non-dim in, SI out — are exactly the trap; whichever way #771 resolves, the off-domain silence is worth closing independently.
What
uw.function.evaluatetakes non-dimensional coordinates (while returning SI values — the input/output asymmetry of #771). Feeding it SI coordinates therefore puts almost every point outside the mesh domain — and instead of raising, it returns plausible numbers.Measured on the notch benchmark (domain [-2,2]×[-1,0] non-dim, coordinates in metres span ±60000):
The few points whose SI coordinates happen to land inside the small non-dim domain (near the origin) return real values, which makes the output look like a field rather than an error.
Why it matters
The silent return is what turns a units slip into wrong science rather than a crash. In one working session it produced, before being caught: a wrong material-geometry figure, a wrong seed-pressure panel, and two rounds of quantitative claims about viscosity-floor clamping (documented, then retracted) — all internally consistent-looking. A
ValueError: 1965 of 1968 query points lie outside the mesh bounding boxat the first call would have cost thirty seconds instead.Suggested fix
At entry, compare the query points against the mesh bounding box (cheap, already known). If more than a small tolerance of points fall outside, raise with a message that names the two ranges — which makes the SI-vs-non-dim mistake self-diagnosing:
Legitimate slightly-out-of-domain queries (boundary roundoff) pass a tolerance; wholesale mismatch cannot.
Related: #771 (evaluate returns SI values). The two conventions together — non-dim in, SI out — are exactly the trap; whichever way #771 resolves, the off-domain silence is worth closing independently.