phipict.meshing.MeshBlock
- class phipict.meshing.MeshBlock(coords: Tensor, name: str = 'block', patches: FacePatches = <factory>)[source]
A structured block of a mesh.
- coords
Vertices
[dims, (nz + 1,) ny + 1, nx + 1], float64 on the CPU.- Type:
- patches
Patch of each boundary face.
- Type:
- __init__(coords: Tensor, name: str = 'block', patches: FacePatches = <factory>) None
Methods
__init__(coords, name, patches)cell_centers()Cell centres, the mean of each cell's corner vertices.
concat(other, axis[, tol])One block of this and
other, joined along an axis.extend(face, length, cells[, grading])Grown beyond a face by extrapolating its outermost grid lines.
extrude(z_range, cells[, grading, z_patches])A 3D block from a 2D block, extruded along z.
face_coords(face)Vertices of a face.
flip(axis)With the vertex order along a logical axis reversed.
from_coords(coords[, name, patches])A block from a vertex tensor, e.g. one of
phipict.grid.shapes.mirror(axis[, at])Mirrored at the plane
axis = at.permute(axes)With the logical axes reordered: new axis
iis old axisaxes[i].rotate(angle[, axis, center, degrees])Rotated about
center(default: the origin).scale(factor[, center])Scaled about
center(default: the origin), per axis if a sequence.split(axis, index)Two blocks cut at vertex
indexalong an axis.translate(offset)Moved by
offset.Attributes
cellsNumber of cells per axis,
(nx, ny[, nz]).n_cellsTotal number of cells.
ndimsNumber of spatial dimensions.