10 #ifdef MOOSE_MFEM_ENABLED 22 "Copies the DoFs of a 2D Nedelec H(curl) MFEM Variable " 23 "into a Raviart-Thomas H(div) MFEM Variable. In 2D ONLY this represents a 90 degree rotation " 24 "because the RT basis is the rotated ND basis.");
25 MFEMExecutedObject::addRequiredDependencyParam<VariableName>(
26 params,
"source",
"Name of H(curl) conforming ND variable to copy.");
27 params.addParam<mfem::real_t>(
30 "Optional scale factor. Negative values can be used to flip the sign of the rotation.");
37 _nd_source_var_name(getParam<VariableName>(
"source")),
38 _nd_source_var(*getMFEMProblem().getGridFunction(_nd_source_var_name)),
39 _scale_factor(getParam<mfem::real_t>(
"scale_factor"))
41 const mfem::ParFiniteElementSpace * source_fes =
_nd_source_var.ParFESpace();
42 const mfem::ParFiniteElementSpace * target_fes =
_result_var.ParFESpace();
44 mooseAssert(source_fes,
"The source variable has no valid ParFiniteElementSpace.");
45 mooseAssert(target_fes,
"The target variable has no valid ParFiniteElementSpace.");
47 const mfem::FiniteElementCollection * source_fec = source_fes->FEColl();
48 const mfem::FiniteElementCollection * target_fec = target_fes->FEColl();
50 if (!dynamic_cast<const mfem::ND_FECollection *>(source_fec))
52 "The source variable must use an MFEM H(curl) Nedelec space. " 53 "Detected FE collection: ",
56 if (!dynamic_cast<const mfem::RT_FECollection *>(target_fec))
57 mooseError(
"The target variable must use an MFEM H(div) Raviart-Thomas space. " 58 "Detected FE collection: ",
62 if (source_fes->GetMesh()->Dimension() != 2 || target_fes->GetMesh()->Dimension() != 2)
63 mooseError(
"MFEMNDtoRTAux is only valid in 2D.");
67 "The source ND variable and target RT variable must have the same local DoF size. " registerMooseObject("MooseApp", MFEMNDtoRTAux)
void execute() override
Perform the main work for this object.
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 ...
MFEMNDtoRTAux(const InputParameters ¶meters)
mfem::ParGridFunction & _result_var
Reference to result gridfunction.
Class to construct an auxiliary solver used to update a real auxvariable.
static InputParameters validParams()
static InputParameters validParams()
const mfem::real_t _scale_factor
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...
const mfem::ParGridFunction & _nd_source_var