10 #ifdef MOOSE_MFEM_ENABLED 22 "Calculates the sum of two variables sharing an FE space, each optionally scaled by a real " 23 "constant, and stores the result in a third.");
25 "The names of MFEM variables to sum over");
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 " 44 const mfem::ParGridFunction * gf =
52 " being summed has a different FESpace from ",
MFEMProblemData & getProblemData()
Method to get the current MFEMProblemData object storing the current data specifying the FE 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
Execute method.
mfem::ParGridFunction & _result_var
Reference to result gridfunction.
T * Get(const std::string &field_name) const
Returns a non-owning pointer to the field. This is guaranteed to return a non-null pointer...
std::vector< const mfem::ParGridFunction * > _summed_vars
Pointers to input variable gridfunctions.
Class to construct an auxiliary solver used to update an auxvariable.
static InputParameters validParams()
const std::vector< mfem::real_t > _scale_factors
MFEMProblem & getMFEMProblem()
Returns a reference to the MFEMProblem instance.
static InputParameters validParams()
Moose::MFEM::GridFunctions gridfunctions
auto index_range(const T &sizable)