-
Notifications
You must be signed in to change notification settings - Fork 569
Open
Description
Description
Sometimes it is helpful to know how many elements are in a Mesh
. Right now there is no easy way to do this.
I proposed implementing __len__
for all Mesh
classes (e.g., SphericalMesh
). This is the function called by len()
.
Alternatives
The current workaround that I have seen is:
mesh = openmc.SphericalMesh(...)
mesh_size = len(list(mesh.indices))
Compatibility
This would not change any existing behavior. There is the question of if this should return the number of elements, or the number of "edges".
Metadata
Metadata
Assignees
Labels
No labels