Skip to content

evaluate() is off by up to 4e-5 for a field the P2 space holds exactly, at points near a node #799

Description

@lmoresi

Symptom

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.

Reproduction

~/+Simulations/forward_nodes/strand_scan.py (serial: python strand_scan.py).

Underworld development team with AI support from Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions