10#ifdef MOOSE_MFEM_ENABLED
16#include "mfem/fem/fespace.hpp"
27 _real_interp_vals(_var_names.size()),
28 _imag_interp_vals(_var_names.size())
39 std::vector<std::reference_wrapper<VectorPostprocessorValue>> declared_real_vals;
40 std::vector<std::reference_wrapper<VectorPostprocessorValue>> declared_imag_vals;
41 const auto val_dim = var.VectorDim();
42 for (
const auto i : make_range(val_dim))
44 auto & real_declared = this->
declareVector(var_name +
"_real_" + std::to_string(i));
45 real_declared.resize(points.size());
46 declared_real_vals.push_back(real_declared);
48 auto & imag_declared = this->
declareVector(var_name +
"_imag_" + std::to_string(i));
49 imag_declared.resize(points.size());
50 declared_imag_vals.push_back(imag_declared);
60 return _vars[i_var].get().FESpace()->FEColl()->GetContType();
66 for (
size_t i_var : index_range(
_vars))
76 for (
size_t i_var : index_range(
_vars))
81 const auto val_dims =
_vars[i_var].get().VectorDim();
83 const auto val_fespace_ordering =
_vars[i_var].get().FESpace()->GetOrdering();
84 for (
const auto i_dim : make_range(val_dims))
85 for (
const auto i_point : make_range(num_points))
std::vector< mfem::Vector > _real_interp_vals
Values interpolated from the real part of the grid function.
std::vector< std::reference_wrapper< const mfem::ParComplexGridFunction > > _vars
Complex grid function being sampled.
std::vector< std::vector< std::reference_wrapper< VectorPostprocessorValue > > > _declared_real_vals
VectorPostprocessor output columns for the real components.
MFEMComplexVariableValueSamplerBase(const InputParameters ¶meters, const std::vector< Point > &points)
void execute() override
Interpolate the real and imaginary parts of the complex variable.
std::vector< std::vector< std::reference_wrapper< VectorPostprocessorValue > > > _declared_imag_vals
VectorPostprocessor output columns for the imaginary components.
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.
void finalize() override
Copies interpolated values into the VPP vectors.
std::vector< mfem::Vector > _imag_interp_vals
Values interpolated from the imaginary part of the grid function.
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
std::shared_ptr< mfem::ParComplexGridFunction > getComplexGridFunction(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.
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.