warp.fem.Nanogrid#

class warp.fem.Nanogrid(grid, temporary_store=None)[source]#

Sparse grid geometry.

Parameters:
__init__(grid, temporary_store=None)[source]#

Construct a sparse grid geometry from an in-memory NanoVDB volume.

Parameters:
  • grid (Volume) – The NanoVDB volume. Any type is accepted, but for indexing efficiency an index grid is recommended. If grid is an "on" index grid, cells will be created for active voxels only, otherwise cells will be created for all leaf voxels.

  • temporary_store (TemporaryStore | None) – shared pool from which to allocate temporary arrays

Methods

__init__(grid[, temporary_store])

Construct a sparse grid geometry from an in-memory NanoVDB volume.

boundary_side_count()

Number of boundary sides in the grid.

build_bvh([device])

Rebuild the geometry's Bounding Volume Hierarchy (BVH) for device from scratch.

bvh_id(device)

Return the BVH identifier for the given device, or 0 if unavailable.

cell_arg_value(device)

cell_count()

Number of cells in the grid.

edge_count()

Number of edges in the grid.

fill_cell_arg(arg, device)

Fill the arguments to be passed to cell-related device functions.

fill_side_arg(arg, device)

Fill the arguments to be passed to side-related device functions.

fill_side_index_arg(arg, device)

Fill the arguments to be passed to side-index device functions.

make_filtered_cell_lookup([filter_func])

Create a filtered cell lookup function.

reference_cell()

Reference element for grid cells.

reference_side()

Reference element for grid sides.

side_arg_value(device)

side_count()

Number of sides in the grid.

side_index_arg_value(device)

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.

vertex_count()

Number of vertices in the grid.

Attributes

CellArg

Structure containing arguments to be passed to device functions evaluating cell-related quantities.

FACE_AXIS_MASK

FACE_INNER_OFFSET_BIT

FACE_OUTER_OFFSET_BIT

GRID_AXIS_FLAG

SideArg

Structure containing arguments to be passed to device functions evaluating side-related quantities.

SideIndexArg

Structure containing arguments to be passed to device functions for indexing sides.

base

Return the base geometry from which this geometry derives its topology.

boundary_side_index

cell_closest_point

cell_coordinates

cell_deformation_gradient

cell_dimension

Manifold dimension of the geometry cells

cell_grid

NanoVDB volume storing cell voxels.

cell_inverse_deformation_gradient

cell_lookup

Device function for looking up the closest cell to a position.

cell_measure

cell_measure_ratio

cell_normal

cell_position

dimension

edge_grid

NanoVDB volume storing edge voxels.

face_grid

NanoVDB volume storing face voxels.

name

Name of the geometry.

side_closest_point

side_coordinates

side_deformation_gradient

side_from_cell_coords

side_inner_cell_coords

side_inner_cell_index

side_inner_inverse_deformation_gradient

side_measure

side_measure_ratio

side_normal

side_outer_cell_coords

side_outer_cell_index

side_outer_inverse_deformation_gradient

side_position

side_to_cell_arg

transform

Transform matrix mapping index to world space.

vertex_grid

NanoVDB volume storing vertex voxels.

property edge_grid: Volume[source]#

NanoVDB volume storing edge voxels.

edge_count()[source]#

Number of edges in the grid.

CellArg: Struct = <warp._src.codegen.Struct object>#

Structure containing arguments to be passed to device functions evaluating cell-related quantities.

fill_cell_arg(arg, device)[source]#

Fill the arguments to be passed to cell-related device functions.

cell_position = <Function Nanogrid__cell_position(args: warp._src.fem.geometry.nanogrid.NanogridCellArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (NanogridCellArg)

  • s (Sample)

cell_deformation_gradient = <Function Nanogrid__cell_deformation_gradient(args: warp._src.fem.geometry.nanogrid.NanogridCellArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (NanogridCellArg)

  • s (Sample)

cell_inverse_deformation_gradient = <Function Nanogrid__cell_inverse_deformation_gradient(args: warp._src.fem.geometry.nanogrid.NanogridCellArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (NanogridCellArg)

  • s (Sample)

supports_cell_lookup(device)[source]#

Return whether cell lookups are supported on the given device.

cell_coordinates = <Function Nanogrid__cell_coordinates(args: warp._src.fem.geometry.nanogrid.NanogridCellArg, cell_index: int, pos: vec3f)>#
Parameters:
  • args (NanogridCellArg)

  • cell_index (int)

  • pos (vec3f)

cell_closest_point = <Function Nanogrid__cell_closest_point(args: warp._src.fem.geometry.nanogrid.NanogridCellArg, cell_index: int, pos: vec3f)>#
Parameters:
  • args (NanogridCellArg)

  • cell_index (int)

  • pos (vec3f)

cell_measure = <Function Nanogrid__cell_measure(args: warp._src.fem.geometry.nanogrid.NanogridCellArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (NanogridCellArg)

  • s (Sample)

cell_normal = <Function Nanogrid__cell_normal(args: warp._src.fem.geometry.nanogrid.NanogridCellArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (NanogridCellArg)

  • s (Sample)

SideArg: Struct = <warp._src.codegen.Struct object>#

Structure containing arguments to be passed to device functions evaluating side-related quantities.

fill_side_arg(arg, device)[source]#

Fill the arguments to be passed to side-related device functions.

Parameters:

arg (NanogridSideArg)

side_position = <Function Nanogrid__side_position(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (NanogridSideArg)

  • s (Sample)

side_deformation_gradient = <Function Nanogrid__side_deformation_gradient(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (NanogridSideArg)

  • s (Sample)

side_inner_inverse_deformation_gradient = <Function Nanogrid__side_inner_inverse_deformation_gradient(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (NanogridSideArg)

  • s (Sample)

side_outer_inverse_deformation_gradient = <Function Nanogrid__side_outer_inverse_deformation_gradient(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (NanogridSideArg)

  • s (Sample)

side_measure = <Function Nanogrid__side_measure(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (NanogridSideArg)

  • s (Sample)

side_measure_ratio = <Function Nanogrid__side_measure_ratio(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (NanogridSideArg)

  • s (Sample)

side_normal = <Function Nanogrid__side_normal(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (NanogridSideArg)

  • s (Sample)

side_inner_cell_index = <Function Nanogrid__side_inner_cell_index(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, side_index: int)>#
Parameters:
  • args (NanogridSideArg)

  • side_index (int)

side_outer_cell_index = <Function Nanogrid__side_outer_cell_index(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, side_index: int)>#
Parameters:
  • args (NanogridSideArg)

  • side_index (int)

side_inner_cell_coords = <Function Nanogrid__side_inner_cell_coords(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, side_index: int, side_coords: vec3f)>#
Parameters:
  • args (NanogridSideArg)

  • side_index (int)

  • side_coords (vec3f)

side_outer_cell_coords = <Function Nanogrid__side_outer_cell_coords(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, side_index: int, side_coords: vec3f)>#
Parameters:
  • args (NanogridSideArg)

  • side_index (int)

  • side_coords (vec3f)

side_from_cell_coords = <Function Nanogrid__side_from_cell_coords(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, side_index: int, element_index: int, element_coords: vec3f)>#
Parameters:
  • args (NanogridSideArg)

  • side_index (int)

  • element_index (int)

  • element_coords (vec3f)

side_to_cell_arg = <Function Nanogrid__side_to_cell_arg(side_arg: warp._src.fem.geometry.nanogrid.NanogridSideArg)>#
Parameters:

side_arg (NanogridSideArg)

side_coordinates = <Function Nanogrid__side_coordinates(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, side_index: int, pos: vec3f)>#
Parameters:
  • args (NanogridSideArg)

  • side_index (int)

  • pos (vec3f)

side_closest_point = <Function Nanogrid__side_closest_point(args: warp._src.fem.geometry.nanogrid.NanogridSideArg, side_index: int, pos: vec3f)>#
Parameters:
  • args (NanogridSideArg)

  • side_index (int)

  • pos (vec3f)