shore.mesh.seams
Point-matched seams between block faces (ADR 0035, 0036).
The face graph names one partner per face, but a face may be shared with several smaller faces: CH's body.k_hi with its three channel blocks, whose k_lo faces all name body.k_hi. Every connected pair of faces is taken once here, and the smaller face is located inside the larger one by its nodes, which gives each seam its exact index ranges on both sides.
Indices follow the CGNS SIDS: 1-based, ranges ``[[imin, jmin, kmin], [imax, jmax, kmax]], and a TransformTwithIndex2 = T.(Index1 - Begin1)
- Begin2
(entryais+-(b + 1): indexa`` of this block runs along indexbof the donor, reversed when negative).
Seam class
class Seam(NamedTuple)One side of a point-matched seam: face of this block over rng, onto donor's donor_face over donor_rng (begin = the image of rng's begin), with transform.
wire_by_corners function
wire_by_corners(
blocks: list[HexBlock],
faces: tuple[str, ...] = ('i_lo', 'i_hi', 'j_lo', 'j_hi', 'k_lo', 'k_hi'),
) -> NoneMake the faces two blocks share SHARED, with their axis maps.
Two of the faces are shared when their four corner nodes are the same points, bit for bit (blocks built from shared rows). The axis map follows from where each corner lands on the partner face, as premesh does for a blocking. Used by the tip caps (ADR 0059) and the H-grid tube (ADR 0060).
seams function
seams(
blocks: list[HexBlock],
tol: float,
*,
only: Collection[tuple[str, str]] | None = None,
bcs: Collection[FaceBC] = CONNECTED,
) -> dict[str, list[Seam]]Per block label, its seams; every connected pair of faces once on each side.
tol is the largest node distance accepted (absolute). With only, just the pairs with a side in it ((label, face)) are located; bcs are the face BCs taken as connections.
Raises
ParameterError— A face connected to a block outside blocks, or a pair whose nodes do not coincide.
shared_faces function
shared_faces(blocks: list[HexBlock]) -> set[tuple[str, str]](label, face) of the faces with more than one partner.
A face is shared with several faces when more than one face names it as partner, or when a face naming it is not its own partner.
transform_vector function
transform_vector(
face: str,
partner: str,
along: tuple[tuple[str, bool], tuple[str, bool]],
) -> tuple[int, int, int]Transform of a face connection from its AxisMap.
Along the faces this is the AxisMap; across them a step into this block is a step out of the donor.
inverse_transform function
inverse_transform(t: tuple[int, int, int]) -> tuple[int, int, int]affine function
affine(
t: tuple[int, int, int],
origin: np.ndarray,
image: np.ndarray,
index: np.ndarray,
) -> np.ndarrayT (index - origin) + image.
point_range function
point_range(block: HexBlock, face: str) -> np.ndarray1-based [[imin, jmin, kmin], [imax, jmax, kmax]] of face.
face_size function
face_size(block: HexBlock, face: str) -> intAliases class
Aliases(blocks: list[HexBlock], tol: float)Nodes that are one point across SHARED / DIRICHLET seams (ADR 0040).
Built topologies share most such nodes as numpy views, so writing one writes all; DIRICHLET seams and blocks read back from saved grids (ADR 0033) hold copies. After an in-place operation, sync gives every group the value of its last member the operation changed (block order), as views would; groups it did not change, or changed alike, are left as they are.
Aliases.sync method
sync(changed: list[np.ndarray]) -> NoneGive each group the value of its last member that changed marks.
changed holds one boolean (ni, nj, nk) mask per block.