From 7d690adf3c0a21e47cbb3b5c7f792281c03ab571 Mon Sep 17 00:00:00 2001 From: Antonio Cervone Date: Sun, 24 Oct 2021 15:57:26 +0200 Subject: [PATCH 1/2] check that physical tags can be written and read back again --- tests/built_in/test_physical.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/built_in/test_physical.py b/tests/built_in/test_physical.py index b9d68f67..31ab7925 100644 --- a/tests/built_in/test_physical.py +++ b/tests/built_in/test_physical.py @@ -1,4 +1,5 @@ import pygmsh +import meshio def test(lcar=0.5): @@ -14,8 +15,11 @@ def test(lcar=0.5): geom.add_physical(poly.lines[0], label="line") mesh = geom.generate_mesh() + assert len(mesh.cell_sets) == 5 return mesh if __name__ == "__main__": test().write("physical.vtu") + read_mesh = meshio.read("physical.vtu") + assert len(read_mesh.cell_sets) == 5 From b1075a7feea845126bb47639bdfc9481e551001c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 24 Oct 2021 14:27:45 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/built_in/test_physical.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/built_in/test_physical.py b/tests/built_in/test_physical.py index 31ab7925..8c6d4e18 100644 --- a/tests/built_in/test_physical.py +++ b/tests/built_in/test_physical.py @@ -1,6 +1,7 @@ -import pygmsh import meshio +import pygmsh + def test(lcar=0.5): with pygmsh.geo.Geometry() as geom: