warp.fem.Grid2D#
- class warp.fem.Grid2D(res, bounds_lo=None, bounds_hi=None)[source]#
Two-dimensional regular grid geometry.
Methods
__init__(res[, bounds_lo, bounds_hi])Construct a dense 2D grid.
Number of boundary sides in the grid.
build_bvh([device])Rebuild the geometry's Bounding Volume Hierarchy (BVH) for
devicefrom scratch.bvh_id(device)Return the BVH identifier for the given device, or
0if unavailable.cell_arg_value(device)Number of cells in the grid.
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])Create a filtered cell lookup function.
Reference element for grid cells.
Reference element for grid sides.
side_arg_value(device)Number of sides in the grid.
side_index_arg_value(device)Value of the arguments to be passed to side-index device functions.
supports_cell_lookup(device)Return whether cell lookups are supported on the given device.
update_bvh([device])Refit the geometry's BVH if it exists on
device, or build it from scratch otherwise.Number of vertices in the grid.
Attributes
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.
baseReturn the base geometry from which this geometry derives its topology.
cell_dimensionManifold dimension of the geometry cells
cell_lookupDevice function for looking up the closest cell to a position.
cell_measure_ratioSize of a cell along each axis.
Extent of the grid along each axis.
nameName of the geometry.
Lower bound of the grid in world coordinates.
Grid resolution along each axis.
Index strides for flattening 2D indices.
- ALT_AXIS = 0#
- LONG_AXIS = 1#
- property strides#
Index strides for flattening 2D indices.
- CellArg: Struct = <warp._src.codegen.Struct object>#
Structure containing arguments to be passed to device functions evaluating cell-related quantities.
- cell_index = <Function Grid2D__cell_index(res: vec2i, cell: vec2i)>#
- get_cell = <Function Grid2D__get_cell(res: vec2i, cell_index: int)>#
- Side = <warp._src.codegen.Struct object>#
- SideArg: Struct = <warp._src.codegen.Struct object>#
Structure containing arguments to be passed to device functions evaluating side-related quantities.
- SideIndexArg: Struct = <warp._src.codegen.Struct object>#
Structure containing arguments to be passed to device functions for indexing sides.
- is_flipped = <Function Grid2D__is_flipped(side: warp._src.fem.geometry.grid_2d.Grid2D.Side)>#
- Parameters:
side (Side)
- side_index = <Function Grid2D__side_index(arg: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, side: warp._src.fem.geometry.grid_2d.Grid2D.Side)>#
- Parameters:
arg (SideArg)
side (Side)
- get_side = <Function Grid2D__get_side(arg: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, side_index: int)>#
- Parameters:
arg (SideArg)
side_index (int)
- fill_cell_arg(args, device)[source]#
Fill the arguments to be passed to cell-related device functions.
- Parameters:
args (Grid2DCellArg)
- cell_position = <Function Grid2D__cell_position(args: warp._src.fem.geometry.grid_2d.Grid2DCellArg, s: warp._src.fem.types.Sample)>#
- Parameters:
args (Grid2DCellArg)
s (Sample)
- cell_deformation_gradient = <Function Grid2D__cell_deformation_gradient(args: warp._src.fem.geometry.grid_2d.Grid2DCellArg, s: warp._src.fem.types.Sample)>#
- Parameters:
args (Grid2DCellArg)
s (Sample)
- cell_inverse_deformation_gradient = <Function Grid2D__cell_inverse_deformation_gradient(args: warp._src.fem.geometry.grid_2d.Grid2DCellArg, s: warp._src.fem.types.Sample)>#
- Parameters:
args (Grid2DCellArg)
s (Sample)
- cell_coordinates = <Function Grid2D__cell_coordinates(args: warp._src.fem.geometry.grid_2d.Grid2DCellArg, cell_index: int, pos: vec2f)>#
- cell_closest_point = <Function Grid2D__cell_closest_point(args: warp._src.fem.geometry.grid_2d.Grid2DCellArg, cell_index: int, pos: vec2f)>#
- supports_cell_lookup(device)[source]#
Return whether cell lookups are supported on the given device.
- make_filtered_cell_lookup(filter_func=None)[source]#
Create a filtered cell lookup function.
- Parameters:
filter_func (Function) – Optional device predicate to filter candidate cells.
- cell_measure = <Function Grid2D__cell_measure(args: warp._src.fem.geometry.grid_2d.Grid2DCellArg, s: warp._src.fem.types.Sample)>#
- Parameters:
args (Grid2DCellArg)
s (Sample)
- cell_normal = <Function Grid2D__cell_normal(args: warp._src.fem.geometry.grid_2d.Grid2DCellArg, s: warp._src.fem.types.Sample)>#
- Parameters:
args (Grid2DCellArg)
s (Sample)
- side_index_arg_value(device)[source]#
Value of the arguments to be passed to side-index device functions.
- Return type:
SideArg
- boundary_side_index = <Function Grid2D__boundary_side_index(args: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, boundary_side_index: int)>#
- Parameters:
args (SideArg)
boundary_side_index (int)
- side_position = <Function Grid2D__side_position(args: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, s: warp._src.fem.types.Sample)>#
- Parameters:
args (SideArg)
s (Sample)
- side_deformation_gradient = <Function Grid2D__side_deformation_gradient(args: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, s: warp._src.fem.types.Sample)>#
- Parameters:
args (SideArg)
s (Sample)
- side_inner_inverse_deformation_gradient = <Function Grid2D__side_inner_inverse_deformation_gradient(args: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, s: warp._src.fem.types.Sample)>#
- Parameters:
args (SideArg)
s (Sample)
- side_outer_inverse_deformation_gradient = <Function Grid2D__side_outer_inverse_deformation_gradient(args: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, s: warp._src.fem.types.Sample)>#
- Parameters:
args (SideArg)
s (Sample)
- side_measure = <Function Grid2D__side_measure(args: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, s: warp._src.fem.types.Sample)>#
- Parameters:
args (SideArg)
s (Sample)
- side_measure_ratio = <Function Grid2D__side_measure_ratio(args: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, s: warp._src.fem.types.Sample)>#
- Parameters:
args (SideArg)
s (Sample)
- side_normal = <Function Grid2D__side_normal(args: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, s: warp._src.fem.types.Sample)>#
- Parameters:
args (SideArg)
s (Sample)
- side_inner_cell_index = <Function Grid2D__side_inner_cell_index(arg: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, side_index: int)>#
- Parameters:
arg (SideArg)
side_index (int)
- side_outer_cell_index = <Function Grid2D__side_outer_cell_index(arg: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, side_index: int)>#
- Parameters:
arg (SideArg)
side_index (int)
- side_inner_cell_coords = <Function Grid2D__side_inner_cell_coords(args: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, side_index: int, side_coords: vec3f)>#
- side_outer_cell_coords = <Function Grid2D__side_outer_cell_coords(args: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, side_index: int, side_coords: vec3f)>#
- side_from_cell_coords = <Function Grid2D__side_from_cell_coords(args: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, side_index: int, element_index: int, element_coords: vec3f)>#
- side_to_cell_arg = <Function Grid2D__side_to_cell_arg(side_arg: warp._src.fem.geometry.grid_2d.Grid2D.SideArg)>#
- Parameters:
side_arg (SideArg)
- side_coordinates = <Function Grid2D__side_coordinates(args: warp._src.fem.geometry.grid_2d.Grid2D.SideArg, side_index: int, pos: vec2f)>#