10 #ifdef MOOSE_MFEM_ENABLED 22 "Calculates the sum of an arbitrary number of complex variables sharing an FE space, each " 23 "optionally scaled by a complex constant, and stores the result in an auxiliary complex " 25 MFEMExecutedObject::addRequiredDependencyParam<std::vector<VariableName>>(
26 params,
"source_variables",
"The names of the MFEM complex variables to sum");
27 params.addParam<std::vector<mfem::real_t>>(
29 "The real parts of the factors to scale each MFEM variable by during summation");
30 params.addParam<std::vector<mfem::real_t>>(
32 "The imaginary parts of the factors to scale each MFEM variable by during summation");
39 _var_names(getParam<
std::vector<VariableName>>(
"source_variables")),
40 _scale_factors_real(parameters.isParamValid(
"scale_factors_real")
41 ? getParam<
std::vector<mfem::real_t>>(
"scale_factors_real")
42 :
std::vector<mfem::real_t>(_var_names.size(), 1.0)),
43 _scale_factors_imag(parameters.isParamValid(
"scale_factors_imag")
44 ? getParam<
std::vector<mfem::real_t>>(
"scale_factors_imag")
45 :
std::vector<mfem::real_t>(_var_names.size(), 0.0))
49 "Number of MFEM variables to sum over is different from the number of provided " 50 "real scale factors.");
53 "Number of MFEM variables to sum over is different from the number of provided " 54 "imaginary scale factors.");
58 const mfem::ParComplexGridFunction * gf =
66 " being summed has a different FESpace from ",
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< mfem::real_t > _scale_factors_imag
static InputParameters validParams()
MFEMComplexSumAux(const InputParameters ¶meters)
std::vector< const mfem::ParComplexGridFunction * > _summed_vars
Pointers to input variable gridfunctions.
std::shared_ptr< mfem::ParComplexGridFunction > getComplexGridFunction(const std::string &name)
mfem::ParComplexGridFunction & _result_var
Reference to result complex gridfunction.
const std::vector< mfem::real_t > _scale_factors_real
void complexAdd(mfem::ParComplexGridFunction &a, const mfem::ParComplexGridFunction &b, const std::complex< mfem::real_t > scale={1.0, 0.0})
Method to add a scaled complex variable to another complex variable.
const std::vector< VariableName > & _var_names
static InputParameters validParams()
auto index_range(const T &sizable)
const AuxVariableName _result_var_name
Name of complex auxvariable to store the result of the auxkernel in.
Class to construct an auxiliary solver used to update a complex auxvariable.
virtual void execute() override
Perform the main work for this object.
registerMooseObject("MooseApp", MFEMComplexSumAux)