10 #ifdef MOOSE_MFEM_ENABLED 22 MooseEnum ordering(
"NODES VDIM",
"VDIM",
false);
23 ordering.
addDocumentation(
"NODES",
"Point/node index varies fastest: x0 x1 ... y0 y1 ...");
25 "Spatial-component index varies fastest: x0 y0 z0 x1 y1 z1 ...");
27 "point_ordering", ordering,
"Ordering style to use for point vector DoFs.");
28 params.
addParam<
double>(
"mesh_boundary_tolerance",
30 "Distance from point to mesh boundary below which the point is " 31 "considered to be on the boundary rather than outside the mesh.");
36 const std::vector<Point> & points,
39 _query_points(points),
41 _finder(this->comm().
get()),
42 _points_ordering(getParam<
MooseEnum>(
"point_ordering") ==
"NODES" ?
mfem::Ordering::byNODES
43 :
mfem::Ordering::byVDIM),
48 mooseError(
"MFEMSamplerBase does not yet support problems with displacement.");
50 _finder.SetDistanceToleranceForPointsFoundOnBoundary(getParam<double>(
"mesh_boundary_tolerance"));
56 const auto mesh_dim =
_mesh.SpaceDimension();
59 auto & declared = this->
declareVector(
"x_" + std::to_string(i));
60 declared.resize(points.size());
68 const auto & point_codes =
_finder.GetCode();
79 const auto mesh_dim =
_mesh.SpaceDimension();
82 for (
const auto i_point :
make_range(num_points))
89 #endif // MOOSE_MFEM_ENABLED mfem::Ordering::Type _points_ordering
Ordering used to store the point coordinates in the MFEM vector.
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
virtual void finalizeValues()=0
Copies interpolated values into the subclass VPP vectors.
static InputParameters validParams()
MFEMSamplerBase(const InputParameters ¶meters, const std::vector< Point > &points, mfem::ParMesh &mesh)
mfem::Vector libMeshPointsToMFEMVector(const std::vector< libMesh::Point > &points, const unsigned int num_dims, const mfem::Ordering::Type ordering)
Convert a vector of libMesh::Point objects to an mfem::Vector containing all points, given an ordering.
void finalize() override
Outputs coordinates then delegates value output to finalizeValues().
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
void initialSetup() override
Checks that all query points were found.
std::string typeAndName() const
Get the class's combined type and name; useful in error handling.
VectorPostprocessorValue & declareVector(const std::string &vector_name)
Register a new vector to fill up.
std::size_t MFEMIndex(const std::size_t i_dim, const std::size_t i_point, const std::size_t num_dims, const std::size_t num_points, const mfem::Ordering::Type ordering)
Convert an index of a vector of libMesh::Points to an MFEM vector index, given an MFEM ordering...
mfem::ParMesh & _mesh
MFEM mesh on which the sampled quantity is defined.
std::vector< std::reference_wrapper< VectorPostprocessorValue > > _declared_points
Declared VPP output vectors for spatial coordinates ("x_0", "x_1", ...).
mfem::FindPointsGSLIB _finder
GSLIB point finder used to locate and interpolate the query points.
PointLocationCode
Classification returned by GSLIB for a query point's location.
void addDocumentation(const std::string &name, const std::string &doc)
Add an item documentation string.
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
static InputParameters validParams()
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
mfem::Vector _points
MFEM vector containing the query-point coordinates.
const std::vector< Point > _query_points
Original query points used for point-location diagnostics.
auto index_range(const T &sizable)
const Elem & get(const ElemType type_in)