From eba2913f3d44561d425ce5e0d9eef1aa0416f8ce Mon Sep 17 00:00:00 2001 From: "[6~" Date: Sun, 17 May 2020 15:25:50 -0500 Subject: [PATCH] Fix curve closedness check in make_curve_mesh --- meshmode/mesh/generation.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/meshmode/mesh/generation.py b/meshmode/mesh/generation.py index be14cfb9..8e5288bb 100644 --- a/meshmode/mesh/generation.py +++ b/meshmode/mesh/generation.py @@ -275,9 +275,10 @@ def make_curve_mesh(curve_f, element_boundaries, order, assert vertices.shape[1] == np.max(vertex_indices) + 1 if closed: - assert la.norm( - curve_f(element_boundaries[0]) - - curve_f(element_boundaries[-1])) < 1.0e-14 + start_end_par = np.array([0, 1], dtype=np.float64) + start_end_curve = curve_f(start_end_par) + + assert la.norm(start_end_curve[:, 0] - start_end_curve[:, 1]) < 1.0e-12 el_lengths = np.diff(element_boundaries) el_starts = element_boundaries[:-1] -- GitLab