upsp.processing.grids
¶
- class StructGrid[source]¶
Bases:
object
Manage plot3d-style structured grid and write formatted to file
- sz¶
sizes of each grid [3xN]
- Type
- x¶
x-position [N]
- Type
- y¶
y-position [N]
- Type
array_like,
- z¶
z-position [N]
- Type
array_like,
- zones¶
vertices ordered by zones [N]
- Type
- load_grid(grid_file)[source]¶
Read a formatted p3d file
- Parameters
grid_file (
str
) – formatted plot3d file
- class UnstructGrid[source]¶
Bases:
object
Manages triangulated unstructured grid
- tris¶
node ids in each triangle [3,T]
- Type
- comps¶
component id for each node [N]
- Type
- x¶
x-position of each node [N]
- Type
- y¶
y-position of each node [N]
- Type
- z¶
z-position of each node [N]
- Type
- extract_comp(comp)[source]¶
Extract a sub-grid containing just the component of interest
- Parameters
comp (
int
) – component id- Returns
g (
UnstructGrid
) – New unstructured grid with just the selected componentn2n (
list
) – mapping of old nodes to new nodes
- get_area(t)[source]¶
Return the area of a triangle
:raises RuntimeError :
The triangle index is invalid
: