You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
evaluate() is off by up to 4e-5 for a field the P2 space holds exactly, at points near a node #799
A P2 field set to x^2 + 3xy - y (which P2 represents exactly) is evaluated with uw.function.evaluate (serial) at every P2 node moved a fixed distance in a random direction, six directions per node, on UnstructuredSimplexBox(cellSize=0.1):
offset
points
max error
points off by more than 1e-10
1.5e-3
11838
2.7e-5
20
3e-3
11838
3.9e-5
13
6e-3
11838
3.8e-5
4
1e-2
11838
1.0e-5
2
2e-2
11838
1.7e-5
3
Any cell's polynomial gives the exact value, so a correct evaluation is exact to round-off wherever the point is located; a few points take a different value. The same points are off in parallel (global_evaluate, np 4) by the same amounts, so this is the serial evaluation, not the parallel routing. Candidate: the face-slab locator (_EVAL_FACE_TOL = 1e-2) and the reference-coordinate clamp, or the exterior (rbf) path taking points it should not.
Probe-pass verdict from H3 (a review session, on a 96-thread Linux workstation: single system image; Intel Xeon Gold 6240R, AVX-512; MPICH): fixed by PR #1117, still live on development. It is #1115 under another name: the face-tolerance locator gives a point near a face to the neighbouring cell, and the reference-coordinate clamp then moves it onto the shared face. #1117 gives the cell that contains the point priority.
The probe, serial, is this issue's case with the points kept inside the box:
# #799: P2 field x^2+3xy-y on UnstructuredSimplexBox(cellSize=0.1); every P2 node moved a fixed distance, 6 random directionsimportnumpyasnp, underworld3asuwmesh=uw.meshing.UnstructuredSimplexBox(minCoords=(0., 0.), maxCoords=(1., 1.), cellSize=0.1)
T=uw.discretisation.MeshVariable("T", mesh, 1, degree=2)
f=lambdaX: X[:, 0]**2+3*X[:, 0]*X[:, 1] -X[:, 1]
X=np.asarray(T.coords); T.array[:, 0, 0] =f(X)
rng=np.random.default_rng(0)
foroffin (1.5e-3, 3e-3, 6e-3, 1e-2, 2e-2):
P=np.repeat(X, 6, axis=0); d=rng.normal(size=P.shape); d/=np.linalg.norm(d, axis=1)[:, None]
P=P+off*d; P=P[(P.min(1) >0) & (P.max(1) <1)]
e=np.abs(np.asarray(uw.function.evaluate(T.sym[0], P)).ravel() -f(P))
print(f"offset {off:.1e}: {len(P)} points, max error {e.max():.1e}, off by >1e-10: {(e>1e-10).sum()}")
offset
development 01dec8d: max error (points off by > 1e-10)
Fixed in development by PR #1117 (merge commit 116fc45): evaluate and global_evaluate now take the cell that contains a point before admitting a neighbour within the face tolerance, so fields the element represents exactly are exact near edges, faces and vertices (the review measured 3.6e-15 where the previous development gave 4.9e-5; test_0511 fails on the previous code). This is the interim fix; a rework of the point locator (a face-crossing walk with an exact containment test, which also removes the remaining absolute tolerances and the 50-candidate cap of #1123) is planned. The issue stays open until development is released to main.
Underworld development team with AI support from Claude Code
Activity
lmoresi commentedon Nov 13, 2026
Probe-pass verdict from H3 (a review session, on a 96-thread Linux workstation: single system image; Intel Xeon Gold 6240R, AVX-512; MPICH): fixed by PR #1117, still live on development. It is #1115 under another name: the face-tolerance locator gives a point near a face to the neighbouring cell, and the reference-coordinate clamp then moves it onto the shared face. #1117 gives the cell that contains the point priority.
The probe, serial, is this issue's case with the points kept inside the box:
Labelled
fixed-in-PR; it becomesfixed-in-developmentwhen #1117 merges.Underworld development team with AI support from Claude Code
lmoresi commentedon Nov 13, 2026
Fixed in
developmentby PR #1117 (merge commit 116fc45):evaluateandglobal_evaluatenow take the cell that contains a point before admitting a neighbour within the face tolerance, so fields the element represents exactly are exact near edges, faces and vertices (the review measured 3.6e-15 where the previousdevelopmentgave 4.9e-5; test_0511 fails on the previous code). This is the interim fix; a rework of the point locator (a face-crossing walk with an exact containment test, which also removes the remaining absolute tolerances and the 50-candidate cap of #1123) is planned. The issue stays open untildevelopmentis released tomain.Underworld development team with AI support from Claude Code
Generated by Claude Code