https://mooseframework.inl.gov
MFEMGenericFESpace.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #ifdef MOOSE_MFEM_ENABLED
11 
12 #include "MFEMGenericFESpace.h"
13 #include "MFEMProblem.h"
14 
16 
19 {
21  params.addClassDescription("Class for creating arbitrary MFEM finite element spaces. It requires "
22  "the user to have some knowledge of how MFEM works.");
23  params.addRequiredParam<std::string>("fec_name",
24  "The name of the finite element collection to use for this "
25  "space. See MFEM documentation for details.");
26  params.addParam<int>("vdim", 1, "The number of degrees of freedom per basis function.");
27  return params;
28 }
29 
31  : MFEMFESpace(parameters),
32  _fec_name(parameters.get<std::string>("fec_name")),
33  _vdim(parameters.get<int>("vdim"))
34 {
35 }
36 
37 std::string
39 {
40  return _fec_name;
41 }
42 
43 int
45 {
46  return _vdim;
47 }
48 
49 bool
51 {
52  return !isVector();
53 }
54 
55 bool
57 {
58  std::string fec = getFECName();
59  if (!strncmp(fec.c_str(), "RT", 2) || !strncmp(fec.c_str(), "ND", 2))
60  return true;
61  // FIXME: This assumes ALL other possible FEC types be scalar. Is that correct?
62  return getVDim() > 1;
63 }
64 
65 #endif
registerMooseObject("MooseApp", MFEMGenericFESpace)
virtual bool isVector() const override
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const std::string _fec_name
The name of the finite element collection.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
Constructs and stores an mfem::ParFiniteElementSpace object.
const int _vdim
The number of degrees of freedom per basis function.
static InputParameters validParams()
Definition: MFEMFESpace.C:16
MFEMGenericFESpace(const InputParameters &parameters)
Constructs and stores an mfem::ParFiniteElementSpace object.
Definition: MFEMFESpace.h:22
virtual std::string getFECName() const override
Get the name of the desired FECollection.
static InputParameters validParams()
virtual bool isScalar() const override
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
void ErrorVector unsigned int
const Elem & get(const ElemType type_in)
virtual int getVDim() const override
Get the number of degrees of freedom per basis function needed in this finite element space...