Skip to content

shore.mesh.block ​

Block ABC and HexBlock: structured grid block classes.

Block class ​

python
class Block(ABC)

source

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: int

source

Block.n_edges property ​

python
n_edges: int

source

Block.n_faces property ​

python
n_faces: int

source

Block.faces method ​

python
faces() -> list[Face]

source

Block.edges method ​

python
edges() -> list[Edge]

source

Block.vertices method ​

python
vertices() -> list[Vertex]

source

Block.wall_face method ​

python
wall_face() -> Face

source

The k=0 body-wall face.

Block.outer_face method ​

python
outer_face() -> Face

source

The k=nk-1 outer boundary face.

Block.face method ​

python
face(name: FaceName) -> Face

source

Look up a face by canonical name.

Block.edge method ​

python
edge(name: EdgeName) -> Edge

source

Look 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 different Spacing1D instance.

HexBlock.n_vertices property ​

python
n_vertices: int

source

HexBlock.n_edges property ​

python
n_edges: int

source

HexBlock.n_faces property ​

python
n_faces: int

source

HexBlock.faces method ​

python
faces() -> list[Face]

source

HexBlock.edges method ​

python
edges() -> list[Edge]

source

HexBlock.vertices method ​

python
vertices() -> list[Vertex]

source

HexBlock.wall_face method ​

python
wall_face() -> Face

source

HexBlock.outer_face method ​

python
outer_face() -> Face

source

HexBlock.periodic property ​

python
periodic: tuple[bool, bool]

source

Released under the MIT License.