From 5e17b75ba2a92c774c6747f7beb35ff21ac27b7b Mon Sep 17 00:00:00 2001 From: "G. D. McBain" Date: Wed, 2 Feb 2022 16:53:02 +1100 Subject: [PATCH] test_oriented_saveload --- tests/test_basis.py | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/tests/test_basis.py b/tests/test_basis.py index 14f47ce1d..04e5b9689 100644 --- a/tests/test_basis.py +++ b/tests/test_basis.py @@ -600,19 +600,14 @@ def test_oriented_gauss_integral(m, e): ) -## TODO preserve orientation in save/load cycle -# def test_oriented_saveload(): - -# m = MeshTri().refined(4) -# m = m.with_boundaries({ -# 'mid': m.facets_around([5]), -# }) -# assert len(m.boundaries['mid'].ori) == 3 - -# # cycle to meshio and check that orientation is preserved -# M = from_meshio(to_meshio(m)) - -# assert_almost_equal( -# m.boundaries['mid'].ori, -# M.boundaries['mid'].ori, -# ) +def test_oriented_saveload(): + + m = MeshTri().refined(4) + m = m.with_boundaries({"mid": m.facets_around([5]),}) + assert len(m.boundaries["mid"].ori) == 3 + + M = from_meshio(to_meshio(m)) + + assert_almost_equal( + m.boundaries["mid"].ori, M.boundaries["mid"].ori, + )