warp.fem.utils.grid_to_hexes#

warp.fem.utils.grid_to_hexes(Nx, Ny, Nz)[source]#

Constructs a hexahedral mesh topology from a dense 3D grid

The resulting hexes will be indexed following usual convention assuming that z is the fastest moving index direction (counter-clockwise bottom vertices, then counter-clockwise top vertices)

Parameters:
  • Nx (int) – Resolution of the grid along x dimension

  • Ny (int) – Resolution of the grid along y dimension

  • Nz (int) – Resolution of the grid along z dimension

Returns:

Array of shape (Nx * Ny * Nz, 8) containing vertex indices for each hexahedron