From 65c2ebe4b57a62286298e3cdfd91d5ba601fcfb8 Mon Sep 17 00:00:00 2001 From: Elizabeth Date: Mon, 30 Oct 2023 10:08:50 -0600 Subject: [PATCH] Fix to unittest. --- tests/geo/test_strainopt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/geo/test_strainopt.py b/tests/geo/test_strainopt.py index 87069508e..4735c1b29 100644 --- a/tests/geo/test_strainopt.py +++ b/tests/geo/test_strainopt.py @@ -91,6 +91,7 @@ def subtest_binormal_curvature(self, order, centroid): J.x = dofs - eps*h f2 = J.J() errf = np.abs((f1-f2)/(2*eps) - df) + assert errf < 0.3 * errf_old errf_old = errf else: # Binormal curvature vanishes in Frenet frame @@ -115,7 +116,7 @@ def subtest_torsion(self, order, centroid): else: framedcurve = FramedCurveFrenet(c, rotation) - J = LPTorsionalStrainPenalty(framedcurve, width=1e-3, p=2, threshold=1e-4) + J = LPTorsionalStrainPenalty(framedcurve, width=1e-3, p=2, threshold=1e-8) dofs = J.x @@ -131,5 +132,6 @@ def subtest_torsion(self, order, centroid): J.x = dofs - eps*h f2 = J.J() errf = np.abs((f1-f2)/(2*eps) - df) + assert errf < 0.3 * errf_old errf_old = errf