10 #ifdef MOOSE_MFEM_ENABLED 25 "The finite element space this variable is defined on.");
28 params.addClassDescription(
29 "Class for adding MFEM variables to the problem (`mfem::ParGridFunction`s).");
30 params.registerBase(
"MooseVariableBase");
31 params.registerSystemAttributeName(
"MooseVariableBase");
32 params.addParam<VariableName>(
34 "Optional name to assign to the time derivative of the variable in transient problems.");
40 _fespace(getMFEMProblem().getMFEMObject<
MFEMFESpace>(
"MFEMFESpace",
41 getParam<MFEMFESpaceName>(
"fespace"))),
42 _gridfunction(buildGridFunction()),
43 _time_derivative_name(
44 isParamValid(
"time_derivative")
45 ? getParam<VariableName>(
"time_derivative")
47 getMFEMProblem().getProblemData().time_derivative_map.createTimeDerivativeName(
53 const std::shared_ptr<mfem::ParGridFunction>
64 const int cont_type = mfem_fespace.
getFEC()->GetContType();
70 if (cont_type == mfem::FiniteElementCollection::CONTINUOUS)
86 if (cont_type == mfem::FiniteElementCollection::TANGENTIAL ||
87 cont_type == mfem::FiniteElementCollection::CONTINUOUS)
96 if (cont_type == mfem::FiniteElementCollection::NORMAL ||
97 cont_type == mfem::FiniteElementCollection::CONTINUOUS)
static InputParameters validParams()
std::string name(const ElemQuality q)
Thin base for MFEM objects backed directly by MooseObject instead of UserObject.
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
const MFEMFESpace & _fespace
mfem::VectorCoefficient & getVectorCoefficient(const std::string &name)
Return a vector coefficient with the given name or, if that doesn't exists, try interpreting the name...
registerMooseObject("MooseApp", MFEMVariable)
const std::shared_ptr< mfem::ParGridFunction > _gridfunction
Stores the constructed gridfunction.
Constructs and stores an mfem::ParGridFunction object.
MFEMVariable(const InputParameters ¶meters)
std::shared_ptr< mfem::FiniteElementCollection > getFEC() const
Returns a shared pointer to the constructed fec.
const std::string & name() const
Get the name of the class.
mfem::Coefficient & declareScalar(const std::string &name, const std::string &existing_or_literal)
Declare an alias to an existing scalar coefficient or, if it does not exist, try interpreting the nam...
mfem::VectorCoefficient & declareVector(const std::string &name, const std::string &existing_or_literal)
Declare an alias to an existing vector coefficientor or, if it does not exist, try interpreting the n...
Moose::MFEM::CoefficientManager & getCoefficients()
Method to get the PropertyManager object for storing material properties and converting them to MFEM ...
const std::shared_ptr< mfem::ParGridFunction > buildGridFunction()
Constructs the gridfunction.
const MFEMFESpace & getFESpace() const
Returns a reference to the fespace used by the gridfunction.
std::shared_ptr< mfem::ParGridFunction > getGridFunction() const
Returns a shared pointer to the constructed gridfunction.
Constructs and stores an mfem::ParFiniteElementSpace object.
static InputParameters validParams()
Declare the common parameters required by MFEM MooseObject-backed classes.
static InputParameters validParams()
std::shared_ptr< mfem::ParFiniteElementSpace > getFESpace() const
Returns a shared pointer to the constructed fespace.
void declareCoefficients()
Declare default coefficients associated with this gridfunction.
Scalar coefficient that evaluates the magnitude of a vector coefficient.