salvus.mesh.mesh_block.mesh_block_collection
Salvus’ mesh block collection class.
Classes
MeshBlockCollection
MeshBlockCollectionclass MeshBlockCollection(builtins.object):
def __init__(
self,
mesh_blocks: Optional[
Sequence[salvus.mesh.mesh_block.mesh_block.MeshBlock],
salvus.mesh.mesh_block.mesh_block.MeshBlock,
] = None,
):
...A simple collection of a list of mesh block objects.
Parameters
mesh_blocksOptional[Sequence[salvus.mesh.mesh_block.mesh_block.MeshBlock], salvus.mesh.mesh_block.mesh_block.MeshBlock] — The mesh blocks making up the collection.
Attributes
ndim int
ndim intDimensionality of the mesh grid collection.
nodes_per_element int
nodes_per_element intDimension dependent number of nodes per linear element.
number_of_elements int
number_of_elements intTotal number of elements in all child mesh grids.
number_of_points int
number_of_points intTotal number of grid points in all child mesh grids.
Methods
add_mask()
add_mask()def add_mask(self, criterion: Callable) -> None:
...Add a mask to each of child mesh grids.
Parameters
criterionCallable — callback function with the signature criterion(x, y) for 2D and criterion(x, y, z) for 3D which returns an array of bool, True for those elements that should be masked out.
Returns None
get_unstructured_mesh()
get_unstructured_mesh()def get_unstructured_mesh(
self, scale: float = 1.0
) -> salvus.mesh.unstructured_mesh.UnstructuredMesh:
...Convert the list of mesh grids to an unstructured mesh object.
Parameters
scalefloat — The scale of the mesh.
Returns salvus.mesh.unstructured_mesh.UnstructuredMesh
plot()
plot()def plot(self, show: bool = True) -> Optional[matplotlib.figure.Figure]:
...Plot the mesh grid collection.
Parameters
showbool — Show the figure.
Returns Optional[matplotlib.figure.Figure]