Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pyvista data interface #2384

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/dolfinx/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def _(V: fem.FunctionSpace, entities=None):
discontinuous) only.

"""
if not (V.ufl_element().family() in ['Discontinuous Lagrange', "Lagrange", "DQ", "Q"]):
if not (V.ufl_element().family() in ['Discontinuous Lagrange', "Lagrange", "DQ", "Q", "DP", "P"]):
raise RuntimeError("Can only create meshes from continuous or discontinuous Lagrange spaces")

degree = V.ufl_element().degree()
Expand Down
9 changes: 9 additions & 0 deletions python/test/unit/io/test_vtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from dolfinx.io import VTKFile
from dolfinx.mesh import (CellType, create_mesh, create_unit_cube,
create_unit_interval, create_unit_square)
from dolfinx.plot import create_vtk_mesh


from mpi4py import MPI

Expand Down Expand Up @@ -216,3 +218,10 @@ def test_save_3d_tensor(tempdir):
filename = Path(tempdir, "u.pvd")
with VTKFile(mesh.comm, filename, "w") as vtk:
vtk.write_function(u, 0.)


def test_vtk_mesh():
comm = MPI.COMM_WORLD
mesh = create_unit_square(comm, 2 * comm.size, 2 * comm.size)
V = FunctionSpace(mesh, ("Lagrange", 1))
create_vtk_mesh(V)