warp.fem.Geometry#
- class warp.fem.Geometry[source]#
Interface class for discrete geometries
A geometry is composed of cells and sides. Sides may be boundary or interior (between cells).
- __init__()#
Methods
__init__()Number of boundary sides (sides with a single neighbour cell) in the geometry
boundary_side_index(args, boundary_side_index)Device function returning the side index corresponding to a boundary side
build_bvh([device])Rebuilds the geometry's Bounding Volume Hierarchy (BVH) for device from scratch.
bvh_id(device)cell_arg_value(device)Number of cells in the geometry
cell_deformation_gradient(args, s)Device function returning the transpose of the gradient of world position with respect to reference cell
cell_inverse_deformation_gradient(args, s)Device function returning the matrix right-transforming a gradient w.r.t.
cell_measure(args, s)Device function returning the measure determinant (e.g. volume, area) at a given point.
cell_normal(args, s)Device function returning the element normal at a sample point.
cell_position(args, s)Device function returning the world position of a cell sample point
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
fill_side_index_arg(args, device)Fill the arguments to be passed to side-related device functions
make_filtered_cell_lookup([filter_func])Prototypical element for a cell
Prototypical element for a side
side_arg_value(device)Number of sides in the geometry
side_deformation_gradient(args, s)Device function returning the gradient of world position with respect to reference side
side_from_cell_coords(args, side_index, ...)Device function converting coordinates on a cell to coordinates on a side, or
OUTSIDEside_index_arg_value(device)side_inner_cell_coords(args, side_index, ...)Device function returning the coordinates of a point on a side in the inner cell
side_inner_cell_index(args, side_index)Device function returning the inner cell index for a given side
Device function returning the matrix right-transforming a gradient w.r.t.
side_measure(args, s)Device function returning the measure determinant (e.g. volume, area) at a given point.
side_measure_ratio(args, s)Device function returning the ratio of the measure of a side to that of its neighbour cells
side_normal(args, s)Device function returning the element normal at a sample point
side_outer_cell_coords(args, side_index, ...)Device function returning the coordinates of a point on a side in the outer cell
side_outer_cell_index(args, side_index)Device function returning the outer cell index for a given side
Device function returning the matrix right-transforming a gradient w.r.t.
side_position(args, s)Device function returning the side position at a sample point
side_to_cell_arg(side_arg)Device function converting a side-related argument value to a cell-related argument value, for promoting trace samples to the full space
supports_cell_lookup(device)update_bvh([device])Refits the geometry's BVH if it exists on device, or builds it from scratch otherwise.
Attributes
Returns the base geometry from which this geometry derives its topology.
Manifold dimension of the geometry cells
Structure containing arguments to be passed to device functions evaluating cell-related quantities
Structure containing arguments to be passed to device functions evaluating side-related quantities
Structure containing arguments to be passed to device functions for indexing sides
- boundary_side_count()[source]#
Number of boundary sides (sides with a single neighbour cell) in the geometry
- property base: Geometry[source]#
Returns the base geometry from which this geometry derives its topology. Usually self
- CellArg: Struct#
Structure containing arguments to be passed to device functions evaluating cell-related quantities
- SideArg: Struct#
Structure containing arguments to be passed to device functions evaluating side-related quantities
- SideIndexArg: Struct#
Structure containing arguments to be passed to device functions for indexing sides
- fill_cell_arg(args, device)[source]#
Fill the arguments to be passed to cell-related device functions
- Parameters:
args (Geometry.CellArg)
- static cell_position(args, s)[source]#
Device function returning the world position of a cell sample point
- Parameters:
args (Geometry.CellArg)
s (Sample)
- static cell_deformation_gradient(args, s)[source]#
Device function returning the transpose of the gradient of world position with respect to reference cell
- Parameters:
args (Geometry.CellArg)
s (Sample)
- static cell_inverse_deformation_gradient(args, s)[source]#
Device function returning the matrix right-transforming a gradient w.r.t. cell space to a gradient w.r.t. world space (i.e. the inverse deformation gradient)
- Parameters:
args (Geometry.CellArg)
s (Sample)
- static cell_measure(args, s)[source]#
Device function returning the measure determinant (e.g. volume, area) at a given point
- Parameters:
args (Geometry.CellArg)
s (Sample)
- cell_measure_ratio = <Function Geometry__cell_measure_ratio(args: typing.Any, s: warp._src.fem.types.Sample)>#
- Parameters:
args (Any)
s (Sample)
- static cell_normal(args, s)[source]#
Device function returning the element normal at a sample point.
For elements with the same dimension as the embedding space, this will be zero.
- Parameters:
args (Geometry.CellArg)
s (Sample)
- fill_side_arg(args, device)[source]#
Fill the arguments to be passed to side-related device functions
- Parameters:
args (Geometry.SideArg)
- fill_side_index_arg(args, device)[source]#
Fill the arguments to be passed to side-related device functions
- Parameters:
args (Geometry.SideIndexArg)
- static boundary_side_index(args, boundary_side_index)[source]#
Device function returning the side index corresponding to a boundary side
- Parameters:
args (Geometry.SideIndexArg)
boundary_side_index (int)
- static side_position(args, s)[source]#
Device function returning the side position at a sample point
- Parameters:
args (Geometry.SideArg)
s (Sample)
- static side_deformation_gradient(args, s)[source]#
Device function returning the gradient of world position with respect to reference side
- Parameters:
args (Geometry.SideArg)
s (Sample)
- static side_inner_inverse_deformation_gradient(
- args,
- side_index,
- coords,
Device function returning the matrix right-transforming a gradient w.r.t. inner cell space to a gradient w.r.t. world space (i.e. the inverse deformation gradient)
- static side_outer_inverse_deformation_gradient(
- args,
- side_index,
- coords,
Device function returning the matrix right-transforming a gradient w.r.t. outer cell space to a gradient w.r.t. world space (i.e. the inverse deformation gradient)
- static side_measure(args, s)[source]#
Device function returning the measure determinant (e.g. volume, area) at a given point
- Parameters:
args (Geometry.SideArg)
s (Sample)
- static side_measure_ratio(args, s)[source]#
Device function returning the ratio of the measure of a side to that of its neighbour cells
- Parameters:
args (Geometry.SideArg)
s (Sample)
- static side_normal(args, s)[source]#
Device function returning the element normal at a sample point
- Parameters:
args (Geometry.SideArg)
s (Sample)
- static side_inner_cell_index(args, side_index)[source]#
Device function returning the inner cell index for a given side
- Parameters:
args (Geometry.SideArg)
side_index (int)
- static side_outer_cell_index(args, side_index)[source]#
Device function returning the outer cell index for a given side
- Parameters:
args (Geometry.SideArg)
side_index (int)
- static side_inner_cell_coords(args, side_index, side_coords)[source]#
Device function returning the coordinates of a point on a side in the inner cell
- static side_outer_cell_coords(args, side_index, side_coords)[source]#
Device function returning the coordinates of a point on a side in the outer cell
- static side_from_cell_coords(
- args,
- side_index,
- element_index,
- element_coords,
Device function converting coordinates on a cell to coordinates on a side, or
OUTSIDE
- static side_to_cell_arg(side_arg)[source]#
Device function converting a side-related argument value to a cell-related argument value, for promoting trace samples to the full space
- Parameters:
side_arg (Geometry.SideArg)
- update_bvh(device=None)[source]#
Refits the geometry’s BVH if it exists on device, or builds it from scratch otherwise.
Refitting the BVH is cheaper than rebuilding it from scratch, and is generally preferred when the geometry positions are modified without significant changes to the topology.
See also:
Geometry.build_bvh().
- build_bvh(device=None)[source]#
Rebuilds the geometry’s Bounding Volume Hierarchy (BVH) for device from scratch.
Many geometries rely on a BVH for the
lookup()andpartition_lookup()operators to be functional.If building a BVH is not supported for this geometry, a
TypeErroris raised.See also:
Geometry.update_bvh().