Template Function pcms::CreateUniformGridFromMesh(Omega_h::Mesh&, const std::array<LO, dim>&)

Function Documentation

template<unsigned dim = 2>
UniformGrid<dim> pcms::CreateUniformGridFromMesh(Omega_h::Mesh &mesh, const std::array<LO, dim> &divisions)

Create a uniform grid layout from an Omega_h mesh as a bounding box.

This function computes the bounding box of the given mesh and creates a uniform Cartesian grid that covers the entire mesh domain. The grid cells are uniformly distributed across each dimension.

Template Parameters:

dim – Spatial dimension of the mesh (2 or 3)

Parameters:
  • mesh – The Omega_h mesh to create the grid from

  • divisions – Array specifying the number of cells in each dimension

Returns:

UniformGrid<dim> A uniform grid covering the mesh bounding box