12 #ifndef MFEM_FE_COLLECTION
13 #define MFEM_FE_COLLECTION
15 #include "../config/config.hpp"
29 template <Geometry::Type geom>
30 static inline void GetNVE(
int &nv,
int &ne);
32 template <Geometry::Type geom,
typename v_t>
33 static inline void GetEdge(
int &nv, v_t &v,
int &ne,
int &e,
int &eo,
37 typename v_t,
typename e_t,
typename eo_t>
38 static inline void GetFace(
int &nv, v_t &v,
int &ne, e_t &e, eo_t &eo,
53 virtual const char *
Name()
const {
return "Undefined"; }
101 {
return H1_dof[GeomType]; }
152 {
return L2_Elements[GeomType]; }
155 if (L2_Elements[GeomType])
157 return L2_Elements[GeomType]->
GetDof();
163 virtual const char *
Name()
const {
return d_name; }
168 return Tr_Elements[GeomType];
190 void InitFaces(
const int p,
const int dim,
const int map_type,
208 {
return RT_dof[GeomType]; }
257 {
return ND_dof[GeomType]; }
291 mutable char name[16];
303 QuadrilateralFE->
Reset();
304 ParallelepipedFE->
Reset();
323 virtual const char *
Name()
const {
return name; }
353 virtual const char *
Name()
const {
return "Linear"; }
379 virtual const char *
Name()
const {
return "Quadratic"; }
400 virtual const char *
Name()
const {
return "QuadraticPos"; }
417 : ParallelepipedFE(3), WedgeFE(3,
BasisType::ClosedUniform) { }
427 virtual const char *
Name()
const {
return "Cubic"; }
448 virtual const char *
Name()
const {
return "CrouzeixRaviart"; }
471 virtual const char *
Name()
const {
return "LinearNonConf3D"; }
494 virtual const char *
Name()
const {
return "RT0_2D"; }
516 virtual const char *
Name()
const {
return "RT1_2D"; }
538 virtual const char *
Name()
const {
return "RT2_2D"; }
559 virtual const char *
Name()
const {
return "Const2D"; }
581 virtual const char *
Name()
const {
return "LinearDiscont2D"; }
603 virtual const char *
Name()
const {
return "GaussLinearDiscont2D"; }
618 virtual const char *
Name()
const {
return "P1OnQuad"; }
640 virtual const char *
Name()
const {
return "QuadraticDiscont2D"; }
657 virtual const char *
Name()
const {
return "QuadraticPosDiscont2D"; }
679 virtual const char *
Name()
const {
return "GaussQuadraticDiscont2D"; }
701 virtual const char *
Name()
const {
return "CubicDiscont2D"; }
724 virtual const char *
Name()
const {
return "Const3D"; }
746 virtual const char *
Name()
const {
return "LinearDiscont3D"; }
768 virtual const char *
Name()
const {
return "QuadraticDiscont3D"; }
793 virtual const char *
Name()
const {
return "RefinedLinear"; }
815 virtual const char *
Name()
const {
return "ND1_3D"; }
838 virtual const char *
Name()
const {
return "RT0_3D"; }
860 virtual const char *
Name()
const {
return "RT1_3D"; }
876 {
return (GeomType == _GeomType) ? Local_Element : NULL; }
878 {
return (GeomType == _GeomType) ? Local_Element->
GetDof() : 0; }
882 virtual const char *
Name()
const {
return d_name; }
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Abstract class for Finite Elements.
int GetOrder() const
Get the order of the NURBS collection: either a positive number, when using fixed order...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Arbitrary order non-uniform rational B-splines (NURBS) finite elements.
virtual const char * Name() const
virtual const char * Name() const
virtual const char * Name() const
H1_Trace_FECollection(const int p, const int dim, const int btype=BasisType::GaussLobatto)
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Version of QuadraticDiscont2DFECollection with dofs in the Gaussian points.
int RT_dof[Geometry::NumGeom]
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
FiniteElement * ND_Elements[Geometry::NumGeom]
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Linear 1D element with nodes 1/3 and 2/3 (trace of RT1)
Quadratic 1D element with nodes the Gaussian points in [0,1] (trace of RT2)
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const char * Name() const
For scalar fields; preserves volume integrals.
virtual FiniteElementCollection * GetTraceCollection() const
virtual const char * Name() const
GaussQuadraticDiscont2DFECollection()
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual ~NURBSFECollection()
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
RT_FECollection(const int p, const int dim, const int map_type, const bool signs, const int ob_type=BasisType::GaussLegendre)
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const char * Name() const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
FiniteElementCollection * GetTraceCollection() const
virtual const char * Name() const
QuadraticDiscont3DFECollection()
virtual ~L2_FECollection()
LinearNonConf3DFECollection()
virtual const char * Name() const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
RefinedLinearFECollection()
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const =0
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Piecewise-(bi)linear continuous finite elements.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Class for quadratic FE on triangle.
Class for quadratic FE on interval.
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const char * Name() const
FiniteElementCollection * GetTraceCollection() const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
void InitFaces(const int p, const int dim, const int map_type, const bool signs)
FiniteElementCollection * GetTraceCollection() const
virtual const char * Name() const
DG_Interface_FECollection(const int p, const int dim, const int map_type=FiniteElement::VALUE, const int ob_type=BasisType::GaussLegendre)
int HasFaceDofs(Geometry::Type GeomType) const
virtual const char * Name() const
virtual const char * Name() const
Finite element collection on a macro-element.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Class for refined bi-linear FE on quadrilateral.
Possible basis types. Note that not all elements can use all BasisType(s).
QuadraticPosDiscont2DFECollection()
NURBSFECollection(int Order=VariableOrder)
The parameter Order must be either a positive number, for fixed order, or VariableOrder (default)...
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const =0
virtual const char * Name() const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual ~RT_FECollection()
L2_FECollection(const int p, const int dim, const int btype=BasisType::GaussLegendre, const int map_type=FiniteElement::VALUE)
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Piecewise-(bi)cubic continuous finite elements.
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const char * Name() const
const int * GetDofMap(Geometry::Type GeomType) const
Get the Cartesian to local H1 dof map.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Class for bilinear FE on quad with nodes at the 4 Gaussian points.
Class for refined linear FE on interval.
int H1_dof[Geometry::NumGeom]
Class for refined linear FE on triangle.
Class for refined linear FE on tetrahedron.
static void GetFace(int &nv, v_t &v, int &ne, e_t &e, eo_t &eo, int &nf, int &f, Geometry::Type &fg, int &fo, const int face_info)
FiniteElement * RT_Elements[Geometry::NumGeom]
virtual int DofForGeometry(Geometry::Type GeomType) const
Class for constant FE on triangle.
virtual int DofForGeometry(Geometry::Type _GeomType) const
static void GetNVE(int &nv, int &ne)
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
H1_FECollection(const int p, const int dim=3, const int btype=BasisType::GaussLobatto)
ND_Trace_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
ND_FECollection(const int p, const int dim, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Class for refined trilinear FE on a hexahedron.
Discontinuous collection defined locally by a given finite element.
CubicDiscont2DFECollection()
Version of QuadraticDiscont2DFECollection with positive basis functions.
virtual ~ND_FECollection()
Class for quadratic FE on tetrahedron.
QuadraticDiscont2DFECollection()
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
void SubDofOrder(Geometry::Type Geom, int SDim, int Info, Array< int > &dofs) const
Get the local dofs for a given sub-manifold.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual int DofForGeometry(Geometry::Type GeomType) const
Version of QuadraticFECollection with positive basis functions.
virtual ~Local_FECollection()
virtual const char * Name() const
virtual const FiniteElement * TraceFiniteElementForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual ~H1_FECollection()
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
LinearDiscont3DFECollection()
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Class for linear FE on tetrahedron.
Class for linear FE on interval.
Crouzeix-Raviart finite element on quadrilateral.
Class for linear FE on triangle.
LinearDiscont2DFECollection()
Class for quadratic FE on triangle with nodes at the "Gaussian" points.
virtual const char * Name() const
virtual const char * Name() const
FiniteElementCollection * GetTraceCollection() const
virtual int DofForGeometry(Geometry::Type GeomType) const
FiniteElement * H1_Elements[Geometry::NumGeom]
Piecewise-linear nonconforming finite elements in 3D.
Crouzeix-Raviart nonconforming elements in 2D.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
L2_FECollection DG_FECollection
Declare an alternative name for L2_FECollection = DG_FECollection.
H1Pos_FECollection(const int p, const int dim=3)
virtual int DofForGeometry(Geometry::Type GeomType) const
static void GetEdge(int &nv, v_t &v, int &ne, int &e, int &eo, const int edge_info)
virtual const FiniteElement * TraceFiniteElementForGeometry(Geometry::Type GeomType) const
virtual const char * Name() const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const =0
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const char * Name() const
virtual const char * Name() const
void SetOrder(int Order) const
Set the order and the name, based on the given Order: either a positive number for fixed order...
virtual const char * Name() const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const char * Name() const
int GetDof() const
Returns the number of degrees of freedom in the finite element.
Class for bi-quadratic FE on quadrilateral.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Class for tri-linear FE on cube.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type _GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const char * Name() const
Class for bilinear FE on quadrilateral.
virtual int DofForGeometry(Geometry::Type GeomType) const
Version of LinearDiscont2DFECollection with dofs in the Gaussian points.
virtual const char * Name() const
static FiniteElementCollection * New(const char *name)
Factory method: return a newly allocated FiniteElementCollection according to the given name...
Class for linear FE on triangle with nodes at the 3 "Gaussian" points.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const char * Name() const
GaussLinearDiscont2DFECollection()
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
Bi-quadratic element on quad with nodes at the 9 Gaussian points.
virtual const char * Name() const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const char * Name() const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
RT_Trace_FECollection(const int p, const int dim, const int map_type=FiniteElement::INTEGRAL, const int ob_type=BasisType::GaussLegendre)
QuadraticPosFECollection()
Tensor products of 1D FEs (only degree 2 is functional)
virtual int DofForGeometry(Geometry::Type GeomType) const
Piecewise-(bi)quadratic continuous finite elements.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order H(curl)-conforming Nedelec finite elements.
Class for cubic FE on tetrahedron.
virtual int DofForGeometry(Geometry::Type GeomType) const
For scalar fields; preserves point values.
virtual const char * Name() const
Arbitrary order H1-conforming (continuous) finite elements.
virtual const char * Name() const
virtual const char * Name() const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
CrouzeixRaviartFECollection()
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Local_FECollection(const char *fe_name)
virtual int DofForGeometry(Geometry::Type GeomType) const
virtual const char * Name() const
Linear (P1) finite elements on quadrilaterals.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
virtual ~FiniteElementCollection()
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
int ND_dof[Geometry::NumGeom]
Crouzeix-Raviart finite element on triangle.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const
Arbitrary order "L2-conforming" discontinuous finite elements.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const