warp.fem.Hexmesh#

class warp.fem.Hexmesh(
hex_vertex_indices,
positions,
assume_parallelepiped_cells=False,
build_bvh=False,
temporary_store=None,
)[source]#

Hexahedral mesh geometry

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

Constructs 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.lookup operator

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

Methods

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

Constructs a hexahedral mesh.

boundary_side_count()

build_bvh([device])

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

bvh_id(device)

cell_arg_value(device)

cell_count()

cell_deformation_gradient(args, s)

Device function returning the transpose of the gradient of world position with respect to reference cell

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

edge_count()

fill_cell_arg(args, device)

fill_side_arg(args, device)

fill_side_index_arg(args, device)

make_filtered_cell_lookup([filter_func])

reference_cell()

reference_side()

side_arg_value(device)

side_count()

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.

supports_cell_lookup(device)

update_bvh([device])

Refits the geometry's BVH if it exists on device, or builds it from scratch otherwise.

vertex_count()

Attributes

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

SideIndexArg

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

base

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

boundary_side_index

cell_bounds

cell_bvh_id

cell_dimension

Manifold dimension of the geometry cells

cell_lookup

cell_measure_ratio

dimension

face_hex_indices

face_to_hex_coords

face_vertex_indices

hex_edge_indices

name

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

side_to_cell_arg

dimension: int = 3#
cell_count()[source]#
vertex_count()[source]#
side_count()[source]#
edge_count()[source]#
boundary_side_count()[source]#
reference_cell()[source]#
Return type:

Element

reference_side()[source]#
Return type:

Element

property hex_edge_indices: array[source]#
property face_hex_indices: array[source]#
property face_vertex_indices: array[source]#
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]#
Parameters:

args (HexmeshCellArg)

fill_side_index_arg(args, device)[source]#
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)

fill_side_arg(args, device)[source]#
Parameters:

args (HexmeshSideArg)

side_position = <Function Hexmesh__side_position(args: warp._src.fem.geometry.hexmesh.HexmeshSideArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (HexmeshSideArg)

  • s (Sample)

side_deformation_gradient = <Function Hexmesh__side_deformation_gradient(args: warp._src.fem.geometry.hexmesh.HexmeshSideArg, s: warp._src.fem.types.Sample)>#
Parameters:
  • args (HexmeshSideArg)

  • s (Sample)

side_inner_cell_index = <Function Hexmesh__side_inner_cell_index(arg: warp._src.fem.geometry.hexmesh.HexmeshSideArg, side_index: int)>#
Parameters:
  • arg (HexmeshSideArg)

  • side_index (int)

side_outer_cell_index = <Function Hexmesh__side_outer_cell_index(arg: warp._src.fem.geometry.hexmesh.HexmeshSideArg, side_index: int)>#
Parameters:
  • arg (HexmeshSideArg)

  • side_index (int)

face_to_hex_coords = <Function Hexmesh__face_to_hex_coords(local_face_index: int, face_orientation: int, side_coords: vec3f)>#
Parameters:
  • local_face_index (int)

  • face_orientation (int)

  • side_coords (vec3f)

side_inner_cell_coords = <Function Hexmesh__side_inner_cell_coords(args: warp._src.fem.geometry.hexmesh.HexmeshSideArg, side_index: int, side_coords: vec3f)>#
Parameters:
  • args (HexmeshSideArg)

  • side_index (int)

  • side_coords (vec3f)

side_outer_cell_coords = <Function Hexmesh__side_outer_cell_coords(args: warp._src.fem.geometry.hexmesh.HexmeshSideArg, side_index: int, side_coords: vec3f)>#
Parameters:
  • args (HexmeshSideArg)

  • side_index (int)

  • side_coords (vec3f)

side_from_cell_coords = <Function Hexmesh__side_from_cell_coords(args: warp._src.fem.geometry.hexmesh.HexmeshSideArg, side_index: int, hex_index: int, hex_coords: vec3f)>#
Parameters:
  • args (HexmeshSideArg)

  • side_index (int)

  • hex_index (int)

  • hex_coords (vec3f)

side_to_cell_arg = <Function Hexmesh__side_to_cell_arg(side_arg: warp._src.fem.geometry.hexmesh.HexmeshSideArg)>#
Parameters:

side_arg (HexmeshSideArg)

cell_bvh_id = <Function Hexmesh__cell_bvh_id(cell_arg: warp._src.fem.geometry.hexmesh.HexmeshCellArg)>#
Parameters:

cell_arg (HexmeshCellArg)

cell_bounds = <Function Hexmesh__cell_bounds(cell_arg: warp._src.fem.geometry.hexmesh.HexmeshCellArg, cell_index: int)>#
Parameters:
  • cell_arg (HexmeshCellArg)

  • cell_index (int)