warp.fem.ExplicitGeometryPartition#
- class warp.fem.ExplicitGeometryPartition(
- geometry,
- cell_mask,
- max_cell_count=-1,
- max_side_count=-1,
- temporary_store=None,
Geometry partition defined by an explicit cell selection mask.
Creates a partition where the included cells are specified by a binary mask array. This provides fine-grained control over which cells belong to the partition.
See also
- Parameters:
geometry (Geometry)
cell_mask (wp.array(dtype=int))
max_cell_count (int)
max_side_count (int)
temporary_store (TemporaryStore | None)
- __init__(
- geometry,
- cell_mask,
- max_cell_count=-1,
- max_side_count=-1,
- temporary_store=None,
Create a geometry partition from an active cell mask.
- Parameters:
geometry (Geometry) – The geometry to partition.
cell_mask (array(ndim=1, dtype=int32)) – Warp array of length
geometry.cell_count()indicating which cells are selected. Values must be1(selected) or0(not selected).max_cell_count (int) – If positive, limits the number of cells to avoid device/host synchronization.
max_side_count (int) – If positive, limits the number of sides to avoid device/host synchronization.
temporary_store (TemporaryStore | None) – Optional temporary storage for intermediate arrays.
Methods
__init__(geometry, cell_mask[, ...])Create a geometry partition from an active cell mask.
boundary_side_count()Return the number of boundary sides in the partition.
cell_arg_value(device)Return the number of cells in the partition.
compute_side_indices_from_cells(...[, ...])Compute partition, boundary, and frontier side indices from a cell mask.
fill_cell_arg(args, device)Fill the arguments to be passed to cell-related device functions.
fill_side_arg(args, device)Fill the arguments to be passed to side-related device functions.
frontier_side_count()Return the number of frontier sides in the partition.
rebuild(cell_mask[, temporary_store])Rebuild the geometry partition from a new active cell mask.
side_arg_value(device)side_count()Return the number of sides in the partition.
Attributes
SideArgArgument structure for side-related device functions.
boundary_side_indexfrontier_side_indexnameName of the geometry partition.
side_indexside_to_cell_arggeometryUnderlying geometry.
- rebuild(cell_mask, temporary_store=None)[source]#
Rebuild the geometry partition from a new active cell mask.
- Parameters:
geometry – the geometry to partition
cell_mask (array(ndim=1, dtype=int32)) – warp array of length
geometry.cell_count()indicating which cells are selected. Array values must be either1(selected) or0(not selected).max_cell_count – if positive, will be used to limit the number of cells to avoid device/host synchronization
max_side_count – if positive, will be used to limit the number of sides to avoid device/host synchronization
temporary_store (TemporaryStore | None)
- CellArg = <warp._src.codegen.Struct object>#
- fill_cell_arg(args, device)[source]#
Fill the arguments to be passed to cell-related device functions.
- Parameters:
args (CellArg)