Skip to content
Projects

carafe.spatial.regions

Regions of the plane, marked on the cells of a grid (tensor or patches).

A PlasmaRegion is where the plasma is (the driver and the expansion region, say): the union of its shapes minus the excluded ones. The spatial models set the plasma to zero outside it; a fluid model (Fluid2D) will take its cells as unknowns and its edges as walls. Shapes are anything with contains_points (simgeometry shapes), as everywhere in carafe.spatial.

Classes

NameDescription
PlasmaRegionThe cells of a plasma: the union of shapes minus the union of excluded.

PlasmaRegionclassdataclass#

class PlasmaRegion(shapes: Sequence[Any], excluded: Sequence[Any] = ())

The cells of a plasma: the union of shapes minus the union of excluded.

Attributes

NameTypeDescription
shapesSequence[Any]Shapes whose union is the region (e.g. the driver and the expansion region as two rectangles, a T in r–z).
excludedSequence[Any]Shapes cut out of it (e.g. an internal structure).

excludedattributeclass attributeinstance attribute#

excluded: Sequence[Any] = ()

shapesattributeinstance attribute#

shapes: Sequence[Any]

maskmethod#

def mask(grid: CellGrid | PatchGrid) -> np.ndarray

The cells whose centre is in the region, shape grid.shape.

wall_facesmethod#

def wall_faces(grid: CellGrid | PatchGrid) -> np.ndarray

The region’s cells that have a neighbour outside it (or the domain edge).

The cells next to a wall, where a fluid model applies its wall conditions; the axis of an r–z domain and periodic seams are not walls.