warp.fem.Hexmesh#
- class warp.fem.Hexmesh(
- hex_vertex_indices,
- positions,
- assume_parallelepiped_cells=False,
- build_bvh=False,
- temporary_store=None,
- cell_env=None,
- env_count=None,
Hexahedral mesh geometry.
- Parameters:
- __init__(
- hex_vertex_indices,
- positions,
- assume_parallelepiped_cells=False,
- build_bvh=False,
- temporary_store=None,
- cell_env=None,
- env_count=None,
Construct a hexahedral mesh.
- Parameters:
hex_vertex_indices (array) – warp array of shape (num_hexes, 8) containing vertex indices for each hex following standard ordering (bottom face vertices in counter-clockwise order, then similarly for upper face)
positions (array) – warp array of shape (num_vertices, 3) containing 3d position for each vertex
assume_parallelepiped – If true, assume that all cells are parallelepipeds (cheaper position/gradient evaluations)
build_bvh (bool) – Whether to also build the hex BVH, which is necessary for the global
fem.lookupoperatortemporary_store (TemporaryStore | None) – shared pool from which to allocate temporary arrays
cell_env (array | None) – Optional per-cell environment indices. If provided,
env_countmust also be provided.env_count (int | None) – Number of environments represented by
cell_env.
Methods
__init__(hex_vertex_indices, positions[, ...])Construct a hexahedral mesh.
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_bvh_groups(device)Return optional per-cell BVH group indices on
device.Number of cells in the mesh.
cell_deformation_gradient(args, s)Device function returning the transpose of the gradient of world position with respect to reference cell
cell_env_arg_value(device)Return per-cell environment indices for geometry argument structs.
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
Number of edges in the mesh.
environment_count()Number of topologically independent environments represented by this geometry.
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 element for mesh cells.
Reference element for mesh sides.
side_arg_value(device)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.Number of vertices in the mesh.
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_envOptional per-cell environment indices.
cell_lookupDevice function for looking up the closest cell to a position.
cell_measure_ratiocompute_cell_bvh_groupscoords_typeWarp vector type for element coordinates matching this geometry's scalar precision.
Dimension of the embedding space.
Hex indices for each face.
Vertex indices for each face.
Edge indices for each hex element.
nameName of the geometry, including environment and scalar type suffixes.
sample_typeWarp struct type for samples matching this geometry's scalar precision.
- CellArg: Struct = <warp._src.codegen.Struct object>#
Structure containing arguments to be passed to device functions evaluating cell-related quantities.
- 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.
- fill_cell_arg(args, device)[source]#
Fill the arguments to be passed to cell-related device functions.
- fill_side_arg(args, device)[source]#
Fill the arguments to be passed to side-related device functions.
- fill_side_index_arg(args, device)[source]#
Fill the arguments to be passed to side-index device functions.
- Parameters:
args (SideIndexArg)
- boundary_side_index = <Function Hexmesh__boundary_side_index(args: warp._src.fem.geometry.hexmesh.Hexmesh.SideIndexArg, boundary_side_index: int)>#
- Parameters:
args (SideIndexArg)
boundary_side_index (int)
- side_position = <Function Hexmesh__side_position(args: Any, s: Any)>#
- side_deformation_gradient = <Function Hexmesh__side_deformation_gradient(args: Any, s: Any)>#
- side_inner_cell_index = <Function Hexmesh__side_inner_cell_index(arg: Any, side_index: int)>#
- side_outer_cell_index = <Function Hexmesh__side_outer_cell_index(arg: Any, side_index: int)>#
- cell_environment_index = <Function Hexmesh__cell_environment_index(args: Any, cell_index: int)>#
- side_environment_index = <Function Hexmesh__side_environment_index(args: Any, side_index: int)>#
- face_to_hex_coords = <Function Hexmesh__face_to_hex_coords(local_face_index: int, face_orientation: int, side_coords: Any)>#
- side_inner_cell_coords = <Function Hexmesh__side_inner_cell_coords(args: Any, side_index: int, side_coords: Any)>#
- side_outer_cell_coords = <Function Hexmesh__side_outer_cell_coords(args: Any, side_index: int, side_coords: Any)>#
- side_from_cell_coords = <Function Hexmesh__side_from_cell_coords(args: Any, side_index: int, hex_index: int, hex_coords: Any)>#