added num_mesh_cells property to StructuredMesh

This commit is contained in:
RemDelaporteMathurin 2022-07-01 09:42:35 +00:00
parent 0b0265cb59
commit 9c892f04db

View file

@ -193,6 +193,10 @@ class StructuredMesh(MeshBase):
s1 = (slice(1, None),)*ndim + (slice(None),)
return (vertices[s0] + vertices[s1]) / 2
@property
def num_mesh_cells(self):
return np.prod(self.dimension)
def write_data_to_vtk(self, points, filename, datasets, volume_normalization=True):
"""Creates a VTK object of the mesh
@ -1547,6 +1551,7 @@ class UnstructuredMesh(MeshBase):
"been loaded from a statepoint file.")
return len(self._centroids)
@centroids.setter
def centroids(self, centroids):
cv.check_type("Unstructured mesh centroids", centroids,