Skip to content

shore.quality ​

Structured-grid quality metrics (roadmap phase 4).

All functions take one block's node array (ni, nj, nk, 3) and follow the marcher's orientation convention: a valid cell has a positive Jacobian (e_i x e_j) . e_k with k pointing away from the wall.

  • scaled_jacobian: per cell, the minimum over its 8 corners of det[e_i, e_j, e_k] / (|e_i| |e_j| |e_k|) with the edges leaving that corner (the Verdict / CUBIT definition). 1 for a rectangular cell, the cosine of the shear angle for a sheared one, <= 0 for a folded corner.
  • k_orthogonality_deg: per node of layer k, the angle between the k-segment to layer k + 1 and the layer's normal t_i x t_j (central-difference tangents). 0 is orthogonal; > 90 means the segment points back through the layer.
  • k_angle_deg: the same angle against given directions (e.g. the body's surface normals), unbiased at block-edge nodes.
  • k_spacing / k_growth: k-segment lengths and their ratios.
  • aspect_ratio: per cell, longest over shortest of its 12 edges.
  • summary: the extremes of all of these for a list of blocks.

scaled_jacobian function ​

python
scaled_jacobian(nodes: np.ndarray) -> np.ndarray

source

Minimum corner scaled Jacobian per cell, shape (ni-1, nj-1, nk-1).

k_orthogonality_deg function ​

python
k_orthogonality_deg(nodes: np.ndarray, k: int = 0) -> np.ndarray

source

Angle (deg) between the k-segment k -> k+1 and layer k's normal, (ni, nj).

k_angle_deg function ​

python
k_angle_deg(nodes: np.ndarray, directions: np.ndarray, k: int = 0) -> np.ndarray

source

Angle (deg) between the k-segment k -> k+1 and given directions (ni, nj, 3).

With the body's outward surface normals at layer 0 this is the wall orthogonality against the true surface: unlike k_orthogonality_deg it is not biased at block-edge nodes, where a one-sided layer normal is not the surface normal across the seam.

k_spacing function ​

python
k_spacing(nodes: np.ndarray) -> np.ndarray

source

Length of every k-segment, shape (ni, nj, nk-1).

k_growth function ​

python
k_growth(nodes: np.ndarray) -> np.ndarray

source

Ratio of consecutive k-segment lengths, shape (ni, nj, nk-2).

aspect_ratio function ​

python
aspect_ratio(nodes: np.ndarray) -> np.ndarray

source

Longest over shortest of each cell's 12 edges, shape (ni-1, nj-1, nk-1).

summary function ​

python
summary(blocks: Iterable[Any]) -> dict[str, float]

source

Extremes over blocks (objects with .nodes, or node arrays).

Released under the MIT License.