shore.mesh.block
Block ABC and HexBlock: structured grid block classes.
Block class
python
class Block(ABC)Abstract base for a structured multi-dimensional node block.
Subclasses define the concrete topology (number of vertices, edges, faces) and provide named accessors. The only shared state is nodes (the coordinate array) and label.
Block.n_vertices property
python
n_vertices: intBlock.n_edges property
python
n_edges: intBlock.n_faces property
python
n_faces: intBlock.faces method
python
faces() -> list[Face]Block.edges method
python
edges() -> list[Edge]Block.vertices method
python
vertices() -> list[Vertex]Block.wall_face method
python
wall_face() -> FaceThe k=0 body-wall face.
Block.outer_face method
python
outer_face() -> FaceThe k=nk-1 outer boundary face.
Block.face method
python
face(name: FaceName) -> FaceLook up a face by canonical name.
Block.edge method
python
edge(name: EdgeName) -> EdgeLook up an edge by canonical name.
HexBlock class
python
HexBlock(
label: str,
nodes: np.ndarray,
periodic_i: bool = False,
periodic_j: bool = True,
spacing_i: Spacing1D | None = None,
spacing_j: Spacing1D | None = None,
spacing_k: Spacing1D | None = None,
)Bases: Block
source
Structured hexahedral block: (ni, nj, nk, 3) node array.
Topology
- 8 vertices at the 8 corners.
- 12 edges: 4 along each axis direction.
- 6 faces: i_lo, i_hi, j_lo, j_hi, k_lo (wall), k_hi (outer).
The nodes array is owned externally (e.g. a slice of a topology's ring allocation) so that adjacent blocks can share numpy views.
Parameters
label— Human-readable block identifier (e.g.'sub0','cap_north').nodes— Coordinate array, shape(ni, nj, nk, 3). May be a view.periodic_i, periodic_j— Periodicity flags forwarded to marching and smoothing.spacing_i, spacing_j, spacing_k— Default spacing laws for the three axis directions. Individual edges may override by carrying a differentSpacing1Dinstance.
HexBlock.n_vertices property
python
n_vertices: intHexBlock.n_edges property
python
n_edges: intHexBlock.n_faces property
python
n_faces: intHexBlock.faces method
python
faces() -> list[Face]HexBlock.edges method
python
edges() -> list[Edge]HexBlock.vertices method
python
vertices() -> list[Vertex]HexBlock.wall_face method
python
wall_face() -> FaceHexBlock.outer_face method
python
outer_face() -> FaceHexBlock.periodic property
python
periodic: tuple[bool, bool]