10#ifdef MOOSE_MFEM_ENABLED
20 params.
addClassDescription(
"Base class for MFEM objects that update auxiliary variables outside "
21 "of the main solve step.");
23 "The name of the variable that this object applies to");
29 _result_var_name(getParam<AuxVariableName>(
"variable")),
30 _result_var(*getMFEMProblem().getComplexGridFunction(_result_var_name))
34std::optional<std::string>
42 const mfem::ParComplexGridFunction & b,
43 const std::complex<mfem::real_t>
scale)
48 if (a.ParFESpace() != b.ParFESpace())
49 mooseError(
"MFEMComplexAuxKernel::complexAdd: ParFESpaces of input variables do not match.");
51 a.real().Add(
scale.real(), b.real());
52 a.real().Add(-
scale.imag(), b.imag());
53 a.imag().Add(
scale.imag(), b.real());
54 a.imag().Add(
scale.real(), b.imag());
59 const std::complex<mfem::real_t>
scale)
63 mfem::ParComplexGridFunction b(a.ParFESpace());
64 static_cast<mfem::Vector &
>(b) = a;
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
MFEMComplexAuxKernel(const InputParameters ¶meters)
virtual std::optional< std::string > suppliedVariableName() const override
Return the variable name supplied by this object, or std::nullopt if none.
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 AuxVariableName _result_var_name
Name of complex auxvariable to store the result of the auxkernel in.
void complexScale(mfem::ParComplexGridFunction &a, const std::complex< mfem::real_t > scale={1.0, 0.0})
Method to scale a complex variable by a complex constant.
static InputParameters validParams()
Base class for MFEM objects that participate in execution ordering but are not UserObjects.
static InputParameters validParams()
Declare the common parameters used by MFEM executed objects.