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:

torch.Tensor

name

Name of the block, also used for the solver block.

Type:

str

patches

Patch of each boundary face.

Type:

FacePatches

__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 i is old axis axes[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 index along an axis.

translate(offset)

Moved by offset.

Attributes

cells

Number of cells per axis, (nx, ny[, nz]).

n_cells

Total number of cells.

name

ndims

Number of spatial dimensions.

coords

patches