10 #ifdef MOOSE_MFEM_ENABLED 20 MooseEnum ordering(
"NODES VDIM",
"VDIM",
false);
21 params.
addParam<
MooseEnum>(
"ordering", ordering,
"Ordering style to use for vector DoFs.");
22 params.
addParam<
int>(
"vdim", 1,
"The number of degrees of freedom per basis function.");
23 params.
addParam<std::string>(
"submesh",
24 "Submesh to define the FESpace on. Leave blank to use base mesh.");
32 parameters.isParamValid(
"submesh")
33 ? getMFEMProblem().getProblemData().submeshes.GetRef(getParam<
std::string>(
"submesh"))
34 : const_cast<mfem::ParMesh &>(getMFEMProblem().
mesh().getMFEMParMesh()))
41 auto name = fec_name.c_str();
43 if (!strncmp(
name,
"RT_R1D", 6))
45 _fec = std::make_shared<mfem::RT_R1D_FECollection>(atoi(
name + 11), atoi(
name + 7));
47 else if (!strncmp(
name,
"RT_R2D", 6))
49 _fec = std::make_shared<mfem::RT_R2D_FECollection>(atoi(
name + 11), atoi(
name + 7));
51 else if (!strncmp(
name,
"ND_R1D", 6))
53 _fec = std::make_shared<mfem::ND_R1D_FECollection>(atoi(
name + 11), atoi(
name + 7));
55 else if (!strncmp(
name,
"ND_R2D", 6))
57 _fec = std::make_shared<mfem::ND_R2D_FECollection>(atoi(
name + 11), atoi(
name + 7));
61 _fec = std::shared_ptr<mfem::FiniteElementCollection>(mfem::FiniteElementCollection::New(
name));
69 if (!strcmp(basis_name.c_str(),
"GaussLegendre"))
70 return mfem::BasisType::GaussLegendre;
71 else if (!strcmp(basis_name.c_str(),
"GaussLobatto"))
72 return mfem::BasisType::GaussLobatto;
73 else if (!strcmp(basis_name.c_str(),
"Positive"))
74 return mfem::BasisType::Positive;
75 else if (!strcmp(basis_name.c_str(),
"OpenUniform"))
76 return mfem::BasisType::OpenUniform;
77 else if (!strcmp(basis_name.c_str(),
"ClosedUniform"))
78 return mfem::BasisType::ClosedUniform;
79 else if (!strcmp(basis_name.c_str(),
"OpenHalfUniform"))
80 return mfem::BasisType::OpenHalfUniform;
81 else if (!strcmp(basis_name.c_str(),
"Serendipity"))
82 return mfem::BasisType::Serendipity;
83 else if (!strcmp(basis_name.c_str(),
"ClosedGL"))
84 return mfem::BasisType::ClosedGL;
85 else if (!strcmp(basis_name.c_str(),
"IntegratedGLL"))
86 return mfem::BasisType::IntegratedGLL;
87 else if (!strcmp(basis_name.c_str(),
"NumBasisTypes"))
88 return mfem::BasisType::NumBasisTypes;
90 mooseError(
"Unknown basis type: ", basis_name);
void buildFEC(const std::string &fec_name) const
Constructs the fec from the fec name.
static InputParameters validParams()
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
const int _ordering
Type of ordering of the vector dofs when _vdim > 1.
MFEMFESpace(const InputParameters ¶meters)
virtual const std::string & name() const
Get the name of the class.
int getBasis(const std::string &basis_name) const
Get the quadrature basis enum associated with the given name.
This class adds a getMFEMProblem method.
std::shared_ptr< mfem::FiniteElementCollection > getFEC() const
Returns a shared pointer to the constructed fec.
static InputParameters validParams()
std::shared_ptr< mfem::FiniteElementCollection > _fec
Stores the constructed fecollection.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
mfem::ParMesh & _pmesh
Mesh FESpace is defined with respect to.
std::shared_ptr< mfem::ParFiniteElementSpace > _fespace
Stores the constructed fespace.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
void buildFESpace(const int vdim) const
Constructs the fespace.