Skip to content

Commit 1568717

Browse files
committed
Raise EmptyMeshPlottingError in Plotter.plot_contour when mesh is empty
1 parent 3058ac6 commit 1568717

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ansys/dpf/core/plotter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,8 @@ def plot_contour(
892892
mesh = meshed_region
893893
else:
894894
mesh = self._mesh
895+
if mesh.elements.n_elements == 0 and mesh.nodes.n_nodes == 0 and mesh.faces.n_faces == 0:
896+
raise dpf_errors.EmptyMeshPlottingError
895897

896898
# get mesh scoping
897899
location = None

0 commit comments

Comments
 (0)