10#ifdef MOOSE_MFEM_ENABLED
21 params.
addClassDescription(
"Projects $s \\vec u \\cdot \\vec v$ onto a scalar MFEM auxvariable");
22 params.
addRequiredParam<MFEMVectorCoefficientName>(
"first_source_vec",
"Vector coefficient");
23 params.
addRequiredParam<MFEMVectorCoefficientName>(
"second_source_vec",
"Vector coefficient");
24 params.
addParam<MFEMScalarCoefficientName>(
25 "coefficient",
"1.",
"Name of scalar coefficient s to scale the inner product by");
31 _inner(getVectorCoefficient(
"first_source_vec"), getVectorCoefficient(
"second_source_vec")),
32 _scaled_inner(getScalarCoefficient(
"coefficient"), _inner)
35 mfem::ParFiniteElementSpace * fes =
_result_var.ParFESpace();
38 if (!
dynamic_cast<const mfem::L2_FECollection *
>(fes->FEColl()) || fes->GetVDim() != 1)
39 mooseError(
"MFEMInnerProductAux requires the target variable to be scalar L2.");
42 if (fes->GetTrueVSize() != fes->GetVSize())
43 mooseError(
"MFEMInnerProductAux currently supports only L2 spaces with interior DOFs "
44 "(no shared/constrained DOFs).");
registerMooseObject("MooseApp", MFEMInnerProductAux)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Class to construct an auxiliary solver used to update a real auxvariable.
static InputParameters validParams()
mfem::ParGridFunction & _result_var
Reference to result gridfunction.
Project onto a scalar MFEM auxvariable.
static InputParameters validParams()
MFEMInnerProductAux(const InputParameters ¶meters)
void execute() override
Perform the main work for this object.
mfem::ProductCoefficient _scaled_inner
Final coefficient that applies a scaling factor to the inner product.