10#ifdef MOOSE_MFEM_ENABLED
18#include "mfem/fem/fespace.hpp"
27 const std::vector<Point> & points)
39 std::vector<std::reference_wrapper<VectorPostprocessorValue>> declared_vals;
40 const auto val_dim = var.VectorDim();
41 for (
const auto i : make_range(val_dim))
43 auto & declared = this->
declareVector(var_name +
"_" + std::to_string(i));
44 declared.resize(points.size());
45 declared_vals.push_back(declared);
54 return _vars[i_var].get().FESpace()->FEColl()->GetContType();
60 for (
size_t i_var : index_range(
_vars))
67 for (
size_t i_var : index_range(
_vars))
71 const auto val_dims =
_vars[i_var].get().VectorDim();
73 const auto val_fespace_ordering =
_vars[i_var].get().FESpace()->GetOrdering();
74 for (
const auto i_dim : make_range(val_dims))
75 for (
const auto i_point : make_range(num_points))
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
std::shared_ptr< mfem::ParGridFunction > getGridFunction(const std::string &name)
mfem::FindPointsGSLIB _finder
GSLIB point finder used to locate and interpolate the query points.
std::vector< std::reference_wrapper< VectorPostprocessorValue > > _declared_points
Declared VPP output vectors for spatial coordinates ("x_0", "x_1", ...).
Base class for sampling real or complex MFEM variables at points.
static InputParameters validParams()
const std::vector< VariableName > _var_names
Names of the variables being sampled.
void execute() override
Interpolate the real variable at all query points.
static InputParameters validParams()
int getFESpaceContinuityType(size_t i_var) const override
Return the continuity type of the i-th sampled variable's finite element collection.
MFEMVariableValueSamplerBase(const InputParameters ¶meters, const std::vector< Point > &points)
std::vector< mfem::Vector > _interp_vals
Values interpolated from the grid function.
void finalize() override
Copies interpolated values into the VPP vectors.
std::vector< std::vector< std::reference_wrapper< VectorPostprocessorValue > > > _declared_vals
VectorPostprocessor output columns for the variable components.
std::vector< std::reference_wrapper< const mfem::GridFunction > > _vars
Grid function being sampled.
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.