warp.fem.Trimesh3D#

class warp.fem.Trimesh3D(
tri_vertex_indices,
positions,
build_bvh=False,
temporary_store=None,
)[source]#

3D Triangular mesh geometry

Parameters:
__init__(
tri_vertex_indices,
positions,
build_bvh=False,
temporary_store=None,
)[source]#

Construct a D-dimensional triangular mesh.

Parameters:
  • tri_vertex_indices (array) – warp array of shape (num_tris, 3) containing vertex indices for each tri

  • positions (array) – warp array of shape (num_vertices, D) containing the position of each vertex

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

  • build_bvh (bool) – Whether to also build the triangle BVH, which is necessary for the global fem.lookup operator to function without initial guess

Methods

__init__(tri_vertex_indices, positions[, ...])

Construct a D-dimensional triangular mesh.

boundary_side_count()

Number of boundary sides in the mesh.

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 mesh.

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.

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-index device functions.

make_filtered_cell_lookup([filter_func])

Create a filtered cell lookup function.

reference_cell()

Reference element for mesh cells.

reference_side()

Reference element for mesh sides.

side_arg_value(device)

side_count()

Number of sides in the mesh.

side_index_arg_value(device)

side_inner_inverse_deformation_gradient(...)

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_inverse_deformation_gradient(...)

Device function returning the matrix right-transforming a gradient w.r.t.

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)

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 mesh.

Attributes

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_bounds

cell_bvh_id

cell_closest_point

cell_deformation_gradient

cell_dimension

Manifold dimension of the geometry cells

cell_lookup

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

cell_measure_ratio

cell_position

coords_type

Warp vector type for element coordinates matching this geometry's scalar precision.

dimension

Dimension of the embedding space.

edge_tri_indices

Triangle indices for each edge.

edge_vertex_indices

Vertex indices for each edge.

name

Name of the geometry, including scalar type suffix for non-default precision.

sample_type

Warp struct type for samples matching this geometry's scalar precision.

scalar_type

side_closest_point

side_deformation_gradient

side_from_cell_coords

side_inner_cell_coords

side_inner_cell_index

side_outer_cell_coords

side_outer_cell_index

side_position

CellArg

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

SideArg

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