10 #ifdef MOOSE_MFEM_ENABLED 22 "Calculates the sum of an arbitrary number of variables sharing an FE space, each " 23 "optionally scaled by a real constant, and stores the result in an auxiliary variable.");
24 MFEMExecutedObject::addRequiredDependencyParam<std::vector<VariableName>>(
25 params,
"source_variables",
"The names of the MFEM variables to sum");
26 params.addParam<std::vector<mfem::real_t>>(
27 "scale_factors",
"The factors to scale each MFEM variable by during summation");
33 _var_names(getParam<
std::vector<VariableName>>(
"source_variables")),
34 _scale_factors(parameters.isParamValid(
"scale_factors")
35 ? getParam<
std::vector<mfem::real_t>>(
"scale_factors")
36 :
std::vector<mfem::real_t>(_var_names.size(), 1.0))
40 "Number of MFEM variables to sum over is different from the number of provided " 51 " being summed has a different FESpace from ",
std::shared_ptr< mfem::ParGridFunction > getGridFunction(const std::string &name)
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
const std::vector< VariableName > & _var_names
const AuxVariableName _result_var_name
Name of auxvariable to store the result of the auxkernel in.
registerMooseObject("MooseApp", MFEMSumAux)
MFEMSumAux(const InputParameters ¶meters)
virtual void execute() override
Perform the main work for this object.
mfem::ParGridFunction & _result_var
Reference to result gridfunction.
std::vector< const mfem::ParGridFunction * > _summed_vars
Pointers to input variable gridfunctions.
Class to construct an auxiliary solver used to update a real auxvariable.
static InputParameters validParams()
const std::vector< mfem::real_t > _scale_factors
static InputParameters validParams()
auto index_range(const T &sizable)