warp.fem.Trimesh2D#
- class warp.fem.Trimesh2D(
- tri_vertex_indices,
- positions,
- build_bvh=False,
- temporary_store=None,
2D Triangular mesh geometry
- Parameters:
tri_vertex_indices (array)
positions (array)
build_bvh (bool)
temporary_store (TemporaryStore | None)
- __init__(
- tri_vertex_indices,
- positions,
- build_bvh=False,
- temporary_store=None,
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.lookupoperator 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
devicefrom scratch.bvh_id(device)Return the BVH identifier for the given device, or
0if 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
SideIndexArgStructure containing arguments to be passed to device functions for indexing sides.
baseReturn the base geometry from which this geometry derives its topology.
boundary_side_indexcell_boundscell_bvh_idcell_closest_pointcell_deformation_gradientcell_dimensionManifold dimension of the geometry cells
cell_lookupDevice function for looking up the closest cell to a position.
cell_measure_ratiocell_positioncoords_typeWarp vector type for element coordinates matching this geometry's scalar precision.
dimensionDimension of the embedding space.
edge_tri_indicesTriangle indices for each edge.
edge_vertex_indicesVertex indices for each edge.
nameName of the geometry, including scalar type suffix for non-default precision.
sample_typeWarp struct type for samples matching this geometry's scalar precision.
scalar_typeside_closest_pointside_deformation_gradientside_from_cell_coordsside_inner_cell_coordsside_inner_cell_indexside_outer_cell_coordsside_outer_cell_indexside_positionCellArgStructure containing arguments to be passed to device functions evaluating cell-related quantities.
SideArgStructure containing arguments to be passed to device functions evaluating side-related quantities.