10#ifdef MOOSE_MFEM_ENABLED
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").getEnum<
mfem::Ordering::Type>()),
44 Moose::MFEM::libMeshPointsToMFEMVector(points, _mesh.SpaceDimension(), _points_ordering))
47 mooseError(
"MFEMSamplerBase does not yet support problems with displacement.");
49 _finder.SetDistanceToleranceForPointsFoundOnBoundary(getParam<double>(
"mesh_boundary_tolerance"));
55 const auto mesh_dim =
_mesh.SpaceDimension();
56 for (
const auto i : make_range(mesh_dim))
58 auto & declared = this->
declareVector(
"x_" + std::to_string(i));
59 declared.resize(points.size());
67 const auto & point_codes =
_finder.GetCode();
78 const auto mesh_dim =
_mesh.SpaceDimension();
81 for (
const auto i_point : make_range(num_points))
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
mfem::FindPointsGSLIB _finder
GSLIB point finder used to locate and interpolate the query points.
static InputParameters validParams()
mfem::ParMesh & _mesh
MFEM mesh on which the sampled quantity is defined.
PointLocationCode
Classification returned by GSLIB for a query point's location.
void finalize() override
Outputs coordinates then delegates value output to finalizeValues().
const std::vector< Point > _query_points
Original query points used for point-location diagnostics.
virtual void finalizeValues()=0
Copies interpolated values into the subclass VPP vectors.
void initialSetup() override
Checks that all query points were found.
mfem::Ordering::Type _points_ordering
Ordering used to store the point coordinates in the MFEM vector.
MFEMSamplerBase(const InputParameters ¶meters, const std::vector< Point > &points, mfem::ParMesh &mesh)
std::vector< std::reference_wrapper< VectorPostprocessorValue > > _declared_points
Declared VPP output vectors for spatial coordinates ("x_0", "x_1", ...).
mfem::Vector _points
MFEM vector containing the query-point coordinates.
static InputParameters validParams()
std::string typeAndName() const
Get the class's combined type and name; useful in error handling.
void addDocumentation(const std::string &name, const std::string &doc)
Add an item documentation string.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
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.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...