pyopensn.mesh.ExtruderMeshGenerator
- class pyopensn.mesh.ExtruderMeshGenerator
Extruded mesh generator.
Wrapper of
opensn::ExtruderMeshGenerator.- Execute(self: pyopensn.mesh.MeshGenerator) pyopensn.mesh.Mesh
Build the mesh and partition it over the ranks.
Collective: every rank must call it. Rank 0 partitions the mesh. A
pyopensn.mesh.DistributedMeshGeneratororpyopensn.mesh.SplitFileMeshGeneratoralso builds the mesh on rank 0 only.- Raises:
RuntimeError – On every rank, when partitioning the mesh fails on rank 0, or when a
pyopensn.mesh.DistributedMeshGeneratororpyopensn.mesh.SplitFileMeshGeneratorfails to build or write the mesh on rank 0, for example because the mesh is folded or has an inverted cell. Other generators build the mesh on every rank, and a build error is raised on each rank where it occurs.
- __init__(self: pyopensn.mesh.ExtruderMeshGenerator, **kwargs) None
Construct an extruded mesh generator.
Extrude 2D geometry using extrusion layers. Each layer is specified by either:
nandzto compute the z-levels automatically.nandhto compute the h-levels automatically.
The list of layers can be specified with a mixture of both ways.
- Parameters:
scale (float, default=1.0) – Uniform scale to apply to the mesh after reading.
inputs (List[pyopensn.mesh.MeshGenerator], default=[]) – A list of MeshGenerator objects.
partitioner (pyopensn.mesh.GraphPartitioner, default=None) – Handle to a GraphPartitioner object to use for parallel partitioning. This will default to PETScGraphPartitioner with a “parmetis” setting.
replicated_mesh (bool, default=False) – Flag, when set, makes the mesh appear in full fidelity on each process.
layers (List[Dict]) –
- List of layers. Each layer is a dictionary with entries:
- n: int, default=1
Number of sub-layers in this layer.
- h: float, default=1.0
Layer height. Cannot be specified if
zis specified.
- z: float, default=0.0
Z-coordinate at the top of the layer. Cannot be specified if
his specified.
top_boundary_name (str, default='ZMAX') – The name to associate with the top boundary.
bottom_boundary_name (str, default='ZMIN') – The name to associate with the bottom boundary.
Examples
>>> emg = ExtruderMeshGenerator( ... layers=[{"n": 1, "z": 2}, {"n": 2, "h": 0.5}] ... )