Defining a Mesh#
Mesh Blocks#
A mesh in rmsh consists of several blocks, which are described by MeshBlock.
These define the boundaries of the blocks and optionally a label, by which the block specific
information can be obtained.
- class rmsh.MeshBlock(label: str, boundaries: Mapping[BoundaryId, BoundaryCurve | BoundaryBlock])[source]#
Basic building block of the mesh, which describes a structured mesh block.
Boundaries of the block can be either prescribed curves, or instead a “soft” boundary, where the only information specified is that it should connect to another block. Such “soft” boundaries allow for a potentially smoother transition between different blocks.
When blocks share a boundary, the only requirement is that the boundary that is shared between them has such a number of nodes that the opposite boundary matches it.
- Parameters:
label (str) – Label by which this block will be referred to in the mesh, as well as by other blocks which have a block boundary to this block.
boundaries (Mapping of BoundaryId to BoundaryCurve or BoundaryBlock) – Dictionary containing the boundaries with their respective IDs. All four might be specified, or only a few.
- label#
Label by which this block will be referred to in the mesh, as well as by other blocks which have a block boundary to this block.
- Type:
- boundaries#
Dictionary of boundaries, which has entries for the boundaries of the block. For a block to be complete, all four boundaries must be specified.
- Type:
dict[BoundaryId, BoundaryCurve|BoundaryBlock|None]
Block Boundaries#
As mentioned before, a boundary can be defined either as a curve using BoundaryCurve
or it can be “soft” and connected to some other block using BoundaryBlock. Regardless
of which boundary type is chosen, the boundary they connect to is indicated by a value from
a BoundaryId enum.
- class rmsh.BoundaryId(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Enum used to identify sides of the mesh in terms of topology.
- Valid values are:
BoundaryNorth
BoundaryEast
BoundaryWest
BoundarySouth
- class rmsh.BoundaryCurve(x: ndarray[tuple[int, ...], dtype[float64]], y: ndarray[tuple[int, ...], dtype[float64]])[source]#
Defines values of points along the boundary of a mesh block.
- Parameters:
x (ndarray[float64]) – Values of X coordinate along the boundary.
y (ndarray[float64]) – Values of Y coordinate along the boundary.
- class rmsh.BoundaryBlock(target: str, target_id: BoundaryId, n: int = 0)[source]#
Defines a connection to a mesh block with the label target.
- Parameters:
target (str) – Label of the block which is designated as the target.
target_id (BoundaryId) – ID of the boundary of target to which this boundary will connect to.
n (int = 0) – The number of points along this boundary, may be left as 0 if the value can be inferred from other boundaries this one has to match to.