10#ifdef MOOSE_MFEM_ENABLED
21 params.
addParam<
double>(
"mesh_boundary_tolerance",
23 "Distance from point to mesh boundary below which the point is "
24 "considered to be on the boundary rather than outside the mesh.");
29 const std::vector<Point> & points,
32 _query_points(points),
34 _finder(this->comm().get()),
35 _points(
Moose::MFEM::libMeshPointsToMFEMVector(
36 points, _mesh.SpaceDimension(),
mfem::Ordering::byVDIM))
39 mooseError(
"MFEMSamplerBase does not yet support problems with displacement.");
41 _finder.SetDistanceToleranceForPointsFoundOnBoundary(getParam<double>(
"mesh_boundary_tolerance"));
47 for (
const auto i : make_range(
_mesh.SpaceDimension()))
49 auto & declared = this->
declareVector(
"x_" + std::to_string(i));
50 declared.resize(points.size());
58 const auto & point_codes =
_finder.GetCode();
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.
const std::vector< Point > _query_points
Original query points used for point-location diagnostics.
void initialSetup() override
Checks that all query points were found and prepares coordinate output.
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.
Vector postprocessor for MFEM results.
static InputParameters validParams()
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.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...