CellBlock
Represent a homogeneous block of cells within a mesh.
This container ties a meshio cell type string to a connectivity array so downstream conversions can assemble meshio or PyVista objects without extra bookkeeping. It keeps the data minimal and relies on runtime validation to ensure consistency with meshio conventions.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Annotated[str, Is[lambda x: x in topological_dimension]]
|
meshio cell type identifier for the block. |
connectivity |
NDArray[integer]
|
Cell connectivity array for the block. |
Notes
This is a lightweight container that relies on runtime type checks for validation rather than additional internal logic.
Source code in sources/src/ansh/mesh.py
__eq__(other)
¶
Equate cell blocks.
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in sources/src/ansh/mesh.py
__init__(type, connectivity)
¶
Initialize the cell block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Annotated[str, Is[lambda x: x in topological_dimension]]
|
meshio cell type string for the block. |
required |
connectivity
|
NDArray[integer]
|
connectivity array of point indices where each row represents a cell. |
required |
Notes
The connectivity array is stored as-is, hence there are no checks on the shape of the array corresponding to the cell type. The integers in the connectivity array reference the rows in the mesh point array.
Source code in sources/src/ansh/mesh.py
__repr__()
¶
Return the canonical representation.
Returns:
| Type | Description |
|---|---|
str
|
String representation used by interactive displays. |
__str__()
¶
Return a concise string representation.
Returns:
| Type | Description |
|---|---|
str
|
String describing the cell type and number of cells. |