Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update stokes demo tolerance #2964

Merged
merged 6 commits into from
Jan 5, 2024
Merged

Update stokes demo tolerance #2964

merged 6 commits into from
Jan 5, 2024

Conversation

IgorBaratta
Copy link
Member

Currently the tolerance is too tight, and even small changes in the kernel (for assembling a matrix or vector) could cause the demo to fail.

The current values for norm_u_1, norm_u_0 are:
Max absolute difference: 1.52587891e-05
Max relative difference: 8.73011621e-07

@garth-wells garth-wells added the testing Test system issues label Jan 5, 2024
@garth-wells
Copy link
Member

What's the difference between np.allclose and np.testing.assert_allclose?

@IgorBaratta
Copy link
Member Author

What's the difference between np.allclose and np.testing.assert_allclose?

In np.testing.assert_allclose conflicting values are appended to the error message.
Eg:
https://github.com/FEniCS/dolfinx/actions/runs/7422791174/job/20198838085#step:22:128

@IgorBaratta
Copy link
Member Author

Example of error message with np.testing:

AssertionError: 
Not equal to tolerance rtol=1e-15, atol=0

Mismatched elements: 1 / 1 (100%)
Max absolute difference: 7.8864737e-09
Max relative difference: 4.51213336e-10
 x: array(17.47837)
 y: array(17.47837)

whereas with assert isclose we get:

Traceback (most recent call last):
  File "/~/dolfinx/python/demo/demo_stokes.py", line 541, in <module>
    assert np.isclose(norm_u_1, norm_u_0, rtol=1e-15)
AssertionError

@garth-wells garth-wells added this pull request to the merge queue Jan 5, 2024
Merged via the queue into main with commit 5915652 Jan 5, 2024
19 checks passed
@garth-wells garth-wells deleted the igor/stokes-tol branch January 5, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Test system issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants