Closed drew-parsons closed 4 years ago
Phew, that's a tough one. I just tried it on two different machines and couldn't reproduce the failure either. I'd suggest relaxing the test tolerance to 1.0e-1 (or whatever is needed) until we found the issue.
I was able to reproduce this on my own machine now; probably some update caused this. I've now relaxed the test tolerances quite a bit, hopefully that'll also satisfy the debian builds.
Finally I've had to use these tolerances
--- a/test/test_translation.py
+++ b/test/test_translation.py
@@ -7,7 +7,7 @@
X, cells = dmsh.generate(geo, 0.1, show=show)
ref_norms = [1.7525e03, 5.5677441324948013e01, 3.0]
- assert_norm_equality(X.flatten(), ref_norms, 1.0e-10)
+ assert_norm_equality(X.flatten(), ref_norms, 1.0e-5)
if __name__ == "__main__":
--- a/test/test_halfspace.py
+++ b/test/test_halfspace.py
@@ -14,7 +14,7 @@
X, cells = dmsh.generate(geo, 0.1, show=show)
ref_norms = [1.6445971629723411e02, 1.0032823867864321e01, 9.9962000746451751e-01]
- assert_norm_equality(X.flatten(), ref_norms, 1.0e-10)
+ assert_norm_equality(X.flatten(), ref_norms, 1.0e-7)
return X, cells
--- a/test/test_refinement_point_line.py
+++ b/test/test_refinement_point_line.py
@@ -14,7 +14,7 @@
X, cells = dmsh.generate(geo, edge_size, show=show, tol=1.0e-10)
ref_norms = [3.8844963377954718e02, 1.5689926870601147e01, 1.0000000000000000e00]
- assert_norm_equality(X.flatten(), ref_norms, 1.0e-3)
+ assert_norm_equality(X.flatten(), ref_norms, 2.0e-3)
return X, cells
--- a/test/test_square_hole_refined.py
+++ b/test/test_square_hole_refined.py
@@ -14,7 +14,7 @@
)
ref_norms = [2.48e02, 1.200e01, 1.0]
- assert_norm_equality(X.flatten(), ref_norms, 1.0e-3)
+ assert_norm_equality(X.flatten(), ref_norms, 4.0e-3)
return X, cells
test_refinement_point_line.py and test_square_hole_refined.py needed to be relaxed for arm64, ppc64el, but the other 2 affected amd64.
Feel free to PR those, I'll merge it if it makes things easier for you.
Not sure if this is the same problem, but creating an ellipse generates spurious points on the periphery. Windows 10, python 3.8.3, Anaconda.
import dmsh
geo = dmsh.Ellipse([0.0, 0.0], 2.0, 1.0)
edge_size=0.2
X, cells = dmsh.generate(geo, edge_size, tol=1.0e-10) # does not help
dmsh.helpers.show(X, cells, geo)
@griff10000 It's not the same issue.
Debian CI tests for dmsh are failing norm_equality assertions, see https://ci.debian.net/packages/p/python-dmsh/unstable/amd64/
e.g.
It looks like it's not as simple as just relaxing the tolerance from 1e-12. The amount of deviation is larger than 1%, too large to be just an issue of machine precision.
Unfortunately I can't reproduce the error on my own computer, where the tests pass fine, so difficult to debug.