1 #ifdef MOOSE_MFEM_ENABLED 16 "The finite element space this variable is defined on.");
18 params.addClassDescription(
19 "Class for adding complex MFEM variables to the problem (`mfem::ParComplexGridFunction`s).");
20 params.registerBase(
"MooseVariableBase");
21 params.registerSystemAttributeName(
"MooseVariableBase");
28 _fespace(getMFEMProblem().getMFEMObject<
MFEMFESpace>(
"MFEMFESpace",
29 getParam<MFEMFESpaceName>(
"fespace"))),
30 _cmplx_gridfunction(buildComplexGridFunction())
35 const std::shared_ptr<mfem::ParComplexGridFunction>
45 const int cont_type = mfem_fespace.
getFEC()->GetContType();
53 if (cont_type == mfem::FiniteElementCollection::CONTINUOUS)
58 name() +
"_real_grad_mag",
63 name() +
"_imag_grad_mag",
80 if (cont_type == mfem::FiniteElementCollection::TANGENTIAL ||
81 cont_type == mfem::FiniteElementCollection::CONTINUOUS)
86 name() +
"_real_curl_mag",
91 name() +
"_imag_curl_mag",
95 if (cont_type == mfem::FiniteElementCollection::NORMAL ||
96 cont_type == mfem::FiniteElementCollection::CONTINUOUS)
static InputParameters validParams()
Thin base for MFEM objects backed directly by MooseObject instead of UserObject.
Constructs and stores an mfem::ParComplexGridFunction object.
std::shared_ptr< mfem::ParComplexGridFunction > getComplexGridFunction() const
Returns a shared pointer to the constructed gridfunction.
static InputParameters validParams()
MFEMComplexVariable(const InputParameters ¶meters)
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
const MFEMFESpace & getFESpace() const
Returns a reference to the fespace used by the gridfunction.
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", MFEMComplexVariable)
const std::shared_ptr< mfem::ParComplexGridFunction > _cmplx_gridfunction
Stores the constructed gridfunction.
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.
virtual bool isScalar() const =0
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...
const std::shared_ptr< mfem::ParComplexGridFunction > buildComplexGridFunction()
Constructs the gridfunction.
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 ...
Constructs and stores an mfem::ParFiniteElementSpace object.
const MFEMFESpace & _fespace
static InputParameters validParams()
Declare the common parameters required by MFEM MooseObject-backed classes.
std::shared_ptr< mfem::ParFiniteElementSpace > getFESpace() const
Returns a shared pointer to the constructed fespace.
void declareCoefficients()
Scalar coefficient that evaluates the magnitude of a vector coefficient.