Template Function pcms::CreateUniformGridBinaryField(Omega_h::Mesh&, const UniformGrid<Dim>&)

Function Documentation

template<unsigned Dim>
std::pair<std::shared_ptr<const UniformGridFieldLayout<Dim>>, Field<Real>> pcms::CreateUniformGridBinaryField(Omega_h::Mesh &mesh, const UniformGrid<Dim> &grid)

Create a binary (inside/outside) mask field on a uniform grid.

Each DOF in the returned order-1 (vertex-centered) field is set to 1.0 if the vertex lies inside the mesh and 0.0 otherwise. A single point search pass over the grid vertices is performed; no intermediate source field is required.

Template Parameters:

Dim – Spatial dimension (2 or 3).

Parameters:
  • mesh – The Omega_h mesh defining the domain.

  • grid – Uniform grid whose vertices are tested.

Returns:

Pair of (layout, field) with binary mask values.