diff --git a/firedrake/mesh.py b/firedrake/mesh.py index 7d16686477..7f1e6ba503 100644 --- a/firedrake/mesh.py +++ b/firedrake/mesh.py @@ -1964,6 +1964,14 @@ def VertexOnlyMesh(mesh, vertexcoords, missing_points_behaviour=None): Meshes created from a coordinates `firedrake.Function` and immersed manifold meshes are not yet supported. + + .. note:: + + This should also only be used for meshes which have not had their + coordinates field modified as, at present, this does not update the + coordinates field of the underlying DMPlex. Such meshes may cause + unexpected behavioir or hangs when running in parallel. + """ import firedrake.functionspace as functionspace diff --git a/tests/vertexonly/test_interpolation_from_parent.py b/tests/vertexonly/test_interpolation_from_parent.py index 6fc96de41a..fa7cafeb90 100644 --- a/tests/vertexonly/test_interpolation_from_parent.py +++ b/tests/vertexonly/test_interpolation_from_parent.py @@ -16,7 +16,8 @@ "cube", "tetrahedron", pytest.param("immersedsphere", marks=pytest.mark.xfail(reason="immersed parent meshes not supported")), - pytest.param("periodicrectangle", marks=pytest.mark.xfail(reason="meshes made from coordinate fields are not supported"))], + pytest.param("periodicrectangle", marks=pytest.mark.xfail(reason="meshes made from coordinate fields are not supported")), + pytest.param("shiftedmesh", marks=pytest.mark.skip(reason="meshes with modified coordinate fields are not supported"))], ids=lambda x: f"{x}-mesh") def parentmesh(request): if request.param == "interval": @@ -35,6 +36,10 @@ def parentmesh(request): return UnitIcosahedralSphereMesh() elif request.param == "periodicrectangle": return PeriodicRectangleMesh(3, 3, 1, 1) + elif request.param == "shiftedmesh": + m = UnitSquareMesh(1, 1) + m.coordinates.dat.data[:] -= 0.5 + return m @pytest.fixture(params=[0, 1, 100], ids=lambda x: f"{x}-coords") diff --git a/tests/vertexonly/test_swarm.py b/tests/vertexonly/test_swarm.py index 3ee6b617a4..38f8d1387b 100644 --- a/tests/vertexonly/test_swarm.py +++ b/tests/vertexonly/test_swarm.py @@ -42,7 +42,8 @@ def cell_midpoints(m): "cube", "tetrahedron", pytest.param("immersedsphere", marks=pytest.mark.skip(reason="immersed parent meshes not supported and will segfault PETSc when creating the DMSwarm")), - pytest.param("periodicrectangle", marks=pytest.mark.skip(reason="periodic meshes do not work properly with swarm creation"))]) + pytest.param("periodicrectangle", marks=pytest.mark.skip(reason="meshes made from coordinate fields are not supported")), + pytest.param("shiftedmesh", marks=pytest.mark.skip(reason="meshes with modified coordinate fields are not supported"))]) def parentmesh(request): if request.param == "interval": return UnitIntervalMesh(1) @@ -58,6 +59,10 @@ def parentmesh(request): return UnitIcosahedralSphereMesh() elif request.param == "periodicrectangle": return PeriodicRectangleMesh(3, 3, 1, 1) + elif request.param == "shiftedmesh": + m = UnitSquareMesh(1, 1) + m.coordinates.dat.data[:] -= 0.5 + return m # pic swarm tests diff --git a/tests/vertexonly/test_vertex_only_fs.py b/tests/vertexonly/test_vertex_only_fs.py index 6fc14b3f75..557827fb2c 100644 --- a/tests/vertexonly/test_vertex_only_fs.py +++ b/tests/vertexonly/test_vertex_only_fs.py @@ -12,7 +12,8 @@ "cube", "tetrahedron", pytest.param("immersedsphere", marks=pytest.mark.xfail(reason="immersed parent meshes not supported")), - pytest.param("periodicrectangle", marks=pytest.mark.xfail(reason="meshes made from coordinate fields are not supported"))]) + pytest.param("periodicrectangle", marks=pytest.mark.xfail(reason="meshes made from coordinate fields are not supported")), + pytest.param("shiftedmesh", marks=pytest.mark.skip(reason="meshes with modified coordinate fields are not supported"))]) def parentmesh(request): if request.param == "interval": return UnitIntervalMesh(1) @@ -28,6 +29,10 @@ def parentmesh(request): return UnitIcosahedralSphereMesh() elif request.param == "periodicrectangle": return PeriodicRectangleMesh(3, 3, 1, 1) + elif request.param == "shiftedmesh": + m = UnitSquareMesh(1, 1) + m.coordinates.dat.data[:] -= 0.5 + return m @pytest.fixture(params=[0, 1, 100], ids=lambda x: f"{x}-coords") diff --git a/tests/vertexonly/test_vertex_only_mesh_generation.py b/tests/vertexonly/test_vertex_only_mesh_generation.py index 605866f5c7..372da0dd7a 100644 --- a/tests/vertexonly/test_vertex_only_mesh_generation.py +++ b/tests/vertexonly/test_vertex_only_mesh_generation.py @@ -42,7 +42,8 @@ def cell_midpoints(m): "cube", "tetrahedron", pytest.param("immersedsphere", marks=pytest.mark.xfail(reason="immersed parent meshes not supported")), - pytest.param("periodicrectangle", marks=pytest.mark.xfail(reason="meshes made from coordinate fields are not supported"))]) + pytest.param("periodicrectangle", marks=pytest.mark.xfail(reason="meshes made from coordinate fields are not supported")), + pytest.param("shiftedmesh", marks=pytest.mark.skip(reason="meshes with modified coordinate fields are not supported"))]) def parentmesh(request): if request.param == "interval": return UnitIntervalMesh(1) @@ -58,6 +59,10 @@ def parentmesh(request): return UnitIcosahedralSphereMesh() elif request.param == "periodicrectangle": return PeriodicRectangleMesh(3, 3, 1, 1) + elif request.param == "shiftedmesh": + m = UnitSquareMesh(1, 1) + m.coordinates.dat.data[:] -= 0.5 + return m @pytest.fixture(params=[0, 1, 100], ids=lambda x: f"{x}-coords")