10 #ifdef MOOSE_MFEM_ENABLED 22 params.
addRequiredParam<VariableName>(
"first_source_vec",
"Vector MFEMVariable U");
23 params.
addRequiredParam<VariableName>(
"second_source_vec",
"Vector MFEMVariable V");
25 "scale_factor", 1.0,
"Constant multiplier applied to the dot product");
31 _u_var_name(getParam<VariableName>(
"first_source_vec")),
32 _v_var_name(getParam<VariableName>(
"second_source_vec")),
33 _u_var(*getMFEMProblem().getProblemData().gridfunctions.Get(_u_var_name)),
34 _v_var(*getMFEMProblem().getProblemData().gridfunctions.Get(_v_var_name)),
35 _scale_factor(getParam<
mfem::real_t>(
"scale_factor")),
38 _dot_uv(_u_coef, _v_coef),
39 _scale_c(_scale_factor),
40 _final_coef(_scale_c, _dot_uv)
43 mfem::ParFiniteElementSpace * fes =
_result_var.ParFESpace();
44 if (!dynamic_cast<const mfem::L2_FECollection *>(fes->FEColl()))
45 paramError(
"variable",
"The target variable must use L2_FECollection.");
48 if (fes->GetTrueVSize() != fes->GetVSize())
49 mooseError(
"MFEMDotProductAux currently supports only L2 spaces with interior DOFs (no " 50 "shared/constrained DOFs).");
61 #endif // MOOSE_MFEM_ENABLED 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 ...
void execute() override
Execute method.
mfem::ParGridFunction & _result_var
Reference to result gridfunction.
registerMooseObject("MooseApp", MFEMDotProductAux)
Class to construct an auxiliary solver used to update an auxvariable.
static InputParameters validParams()
MFEMDotProductAux(const InputParameters ¶meters)
mfem::ProductCoefficient _final_coef
Final coefficient that applies the scale factor to the inner product.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
static InputParameters validParams()