12 #ifndef MFEM_FE_COLLECTION
13 #define MFEM_FE_COLLECTION
15 #include "../config/config.hpp"
39 MFEM_VERIFY(0 <= b_type && b_type < 6,
"unknown BasisType: " << b_type);
57 static const char *
Name(
int b_type)
59 static const char *name[] =
61 "Gauss-Legendre",
"Gauss-Lobatto",
"Positive (Bernstein)",
62 "Open uniform",
"Closed uniform",
"Open half uniform"
64 return name[
Check(b_type)];
69 static const char ident[] = {
'g',
'G',
'P',
'u',
'U',
'o' };
70 return ident[
Check(b_type)];
84 MFEM_ABORT(
"unknown BasisType identifier");
96 template <Geometry::Type geom>
97 static inline void GetNVE(
int &nv,
int &ne);
99 template <Geometry::Type geom,
typename v_t>
100 static inline void GetEdge(
int &nv, v_t &v,
int &ne,
int &e,
int &eo,
101 const int edge_info);
104 typename v_t,
typename e_t,
typename eo_t>
105 static inline void GetFace(
int &nv, v_t &v,
int &ne, e_t &e, eo_t &eo,
106 int &nf,
int &f,
int &fg,
int &fo,
107 const int face_info);
117 virtual const char *
Name()
const {
return "Undefined"; }
163 {
return H1_dof[GeomType]; }
170 const int *
GetDofMap(
int GeomType)
const;
212 {
return L2_Elements[GeomType]; }
215 if (L2_Elements[GeomType])
217 return L2_Elements[GeomType]->
GetDof();
222 virtual const char *
Name()
const {
return d_name; }
227 return Tr_Elements[GeomType];
249 void InitFaces(
const int p,
const int dim,
const int map_type,
266 {
return RT_dof[GeomType]; }
313 {
return ND_dof[GeomType]; }
342 void Allocate(
int Order);
356 QuadrilateralFE->
Reset();
357 ParallelepipedFE->
Reset();
367 virtual const char *
Name()
const {
return name; }
395 virtual const char *
Name()
const {
return "Linear"; }
419 virtual const char *
Name()
const {
return "Quadratic"; }
439 virtual const char *
Name()
const {
return "QuadraticPos"; }
463 virtual const char *
Name()
const {
return "Cubic"; }
483 virtual const char *
Name()
const {
return "CrouzeixRaviart"; }
505 virtual const char *
Name()
const {
return "LinearNonConf3D"; }
527 virtual const char *
Name()
const {
return "RT0_2D"; }
548 virtual const char *
Name()
const {
return "RT1_2D"; }
569 virtual const char *
Name()
const {
return "RT2_2D"; }
589 virtual const char *
Name()
const {
return "Const2D"; }
610 virtual const char *
Name()
const {
return "LinearDiscont2D"; }
631 virtual const char *
Name()
const {
return "GaussLinearDiscont2D"; }
645 virtual const char *
Name()
const {
return "P1OnQuad"; }
666 virtual const char *
Name()
const {
return "QuadraticDiscont2D"; }
682 virtual const char *
Name()
const {
return "QuadraticPosDiscont2D"; }
703 virtual const char *
Name()
const {
return "GaussQuadraticDiscont2D"; }
724 virtual const char *
Name()
const {
return "CubicDiscont2D"; }
745 virtual const char *
Name()
const {
return "Const3D"; }
766 virtual const char *
Name()
const {
return "LinearDiscont3D"; }
787 virtual const char *
Name()
const {
return "QuadraticDiscont3D"; }
811 virtual const char *
Name()
const {
return "RefinedLinear"; }
832 virtual const char *
Name()
const {
return "ND1_3D"; }
854 virtual const char *
Name()
const {
return "RT0_3D"; }
875 virtual const char *
Name()
const {
return "RT1_3D"; }
890 {
return (GeomType == _GeomType) ? Local_Element : NULL; }
892 {
return (GeomType == _GeomType) ? Local_Element->
GetDof() : 0; }
895 virtual const char *
Name()
const {
return d_name; }
Abstract class for Finite Elements.
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
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
Version of QuadraticDiscont2DFECollection with dofs in the Gaussian points.
int RT_dof[Geometry::NumGeom]
FiniteElement * ND_Elements[Geometry::NumGeom]
virtual int * DofOrderForOrientation(int GeomType, int Or) const
void UpdateOrder(int Order)
Change the order of the collection.
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 char * Name() const
static int Check(int b_type)
If the input does not represents a valid BasisType, abort with an error; otherwise return the input...
virtual FiniteElementCollection * GetTraceCollection() const
virtual const char * Name() const
GaussQuadraticDiscont2DFECollection()
void SubDofOrder(int Geom, int SDim, int Info, Array< int > &dofs) const
Get the local dofs for a given sub-manifold.
RT_FECollection(const int p, const int dim, const int map_type, const bool signs, const int ob_type=BasisType::GaussLegendre)
virtual int DofForGeometry(int GeomType) const
virtual const char * Name() const
FiniteElementCollection * GetTraceCollection() const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual const char * Name() const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
QuadraticDiscont3DFECollection()
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
H1_FECollection(const int p, const int dim=3, const int type=BasisType::GaussLobatto)
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual ~L2_FECollection()
LinearNonConf3DFECollection()
virtual const char * Name() const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
RefinedLinearFECollection()
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
int GetOrder() const
Returns the order of the finite element.
Piecewise-(bi)linear continuous finite elements.
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
Class for quadratic FE on triangle.
virtual int * DofOrderForOrientation(int GeomType, int Or) const
Class for quadratic FE on interval.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
static int GetQuadrature1D(int b_type)
Get the corresponding Quadrature1D constant, when that makes sense; otherwise return Quadrature1D::In...
virtual int DofForGeometry(int GeomType) const
virtual const char * Name() const
FiniteElementCollection * GetTraceCollection() const
virtual int DofForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int DofForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
void InitFaces(const int p, const int dim, const int map_type, const bool signs)
H1_Trace_FECollection(const int p, const int dim, const int type=BasisType::GaussLobatto)
FiniteElementCollection * GetTraceCollection() const
virtual const char * Name() const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
DG_Interface_FECollection(const int p, const int dim, const int map_type=FiniteElement::VALUE, const int ob_type=BasisType::GaussLegendre)
virtual const char * Name() const
static const char * Name(int b_type)
Check and convert a BasisType constant to a string identifier.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual const char * Name() const
virtual int DofForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
static int GetType(char b_ident)
Convert char basis identifier to a BasisType constant.
Finite element collection on a macro-element.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
Class for refined bi-linear FE on quadrilateral.
Possible basis types. Note that not all elements can use all BasisType(s).
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
QuadraticPosDiscont2DFECollection()
virtual const char * Name() const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual ~RT_FECollection()
virtual int DofForGeometry(int _GeomType) const
virtual int DofForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
Piecewise-(bi)cubic continuous finite elements.
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual const char * Name() const
Class for bilinear FE on quad with nodes at the 4 Gaussian points.
Class for refined linear FE on interval.
virtual int DofForGeometry(int GeomType) const
int H1_dof[Geometry::NumGeom]
Class for refined linear FE on triangle.
Class for refined linear FE on tetrahedron.
FiniteElement * RT_Elements[Geometry::NumGeom]
Class for constant FE on triangle.
static void GetNVE(int &nv, int &ne)
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int DofForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int DofForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
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.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
CubicDiscont2DFECollection()
Version of QuadraticDiscont2DFECollection with positive basis functions.
virtual ~ND_FECollection()
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
Class for quadratic FE on tetrahedron.
virtual int * DofOrderForOrientation(int GeomType, int Or) const
QuadraticDiscont2DFECollection()
For scalar fields; preserves point values.
const int * GetDofMap(int GeomType) const
Get the Cartesian to local H1 dof map.
Nodes: x_i = (i+1/2)/n, i=0,...,n-1.
virtual int DofForGeometry(int GeomType) const
For scalar fields; preserves volume integrals.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
Version of QuadraticFECollection with positive basis functions.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual ~Local_FECollection()
virtual const char * Name() const
virtual int DofForGeometry(int GeomType) const
virtual ~H1_FECollection()
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
LinearDiscont3DFECollection()
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()
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
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
FiniteElement * H1_Elements[Geometry::NumGeom]
Piecewise-linear nonconforming finite elements in 3D.
virtual int * DofOrderForOrientation(int GeomType, int Or) const
Crouzeix-Raviart nonconforming elements in 2D.
NURBSFECollection(int Order)
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
L2_FECollection DG_FECollection
virtual int * DofOrderForOrientation(int GeomType, int Or) const
H1Pos_FECollection(const int p, const int dim=3)
virtual int DofForGeometry(int GeomType) const
static void GetEdge(int &nv, v_t &v, int &ne, int &e, int &eo, const int edge_info)
virtual int DofForGeometry(int GeomType) const
virtual const char * Name() const
virtual int DofForGeometry(int GeomType) const
virtual const char * Name() const
virtual const char * Name() const
virtual const FiniteElement * TraceFiniteElementForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
virtual const char * Name() const
virtual int * DofOrderForOrientation(int GeomType, int Or) 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.
Class for tri-linear FE on cube.
Nodes: x_i = i/(n-1), i=0,...,n-1.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
Nodes: x_i = (i+1)/(n+1), i=0,...,n-1.
virtual int DofForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual const char * Name() const
Class for bilinear FE on quadrilateral.
virtual int DofForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
Version of LinearDiscont2DFECollection with dofs in the Gaussian points.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const =0
virtual const char * Name() const
static FiniteElementCollection * New(const char *name)
Factory method: return a newly allocated FiniteElementCollection according to the given name...
virtual const FiniteElement * TraceFiniteElementForGeometry(int GeomType) const
Class for linear FE on triangle with nodes at the 3 "Gaussian" points.
static char GetChar(int b_type)
Check and convert a BasisType constant to a char basis identifier.
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual int DofForGeometry(int GeomType) const
virtual const char * Name() const
GaussLinearDiscont2DFECollection()
virtual int DofForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
Bi-quadratic element on quad with nodes at the 9 Gaussian points.
virtual const char * Name() const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int DofForGeometry(int GeomType) const
virtual const char * Name() 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)
Piecewise-(bi)quadratic continuous finite elements.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
aka "open half" Newton-Cotes
int HasFaceDofs(int GeomType) const
Arbitrary order H(curl)-conforming Nedelec finite elements.
Class for cubic FE on tetrahedron.
static void GetFace(int &nv, v_t &v, int &ne, e_t &e, eo_t &eo, int &nf, int &f, int &fg, int &fo, const int face_info)
virtual const char * Name() const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int * DofOrderForOrientation(int GeomType, int Or) const
L2_FECollection(const int p, const int dim, const int type=BasisType::GaussLegendre, const int map_type=FiniteElement::VALUE)
Arbitrary order H1-conforming (continuous) finite elements.
virtual const char * Name() const
virtual const char * Name() const
virtual const FiniteElement * FiniteElementForGeometry(int _GeomType) const
CrouzeixRaviartFECollection()
virtual int DofForGeometry(int GeomType) const =0
virtual int * DofOrderForOrientation(int GeomType, int Or) const
virtual int DofForGeometry(int GeomType) const
Local_FECollection(const char *fe_name)
virtual int DofForGeometry(int GeomType) const
virtual const char * Name() const
virtual int DofForGeometry(int GeomType) const
Linear (P1) finite elements on quadrilaterals.
virtual int DofForGeometry(int GeomType) const
virtual ~FiniteElementCollection()
virtual ~NURBSFECollection()
int ND_dof[Geometry::NumGeom]
virtual int DofForGeometry(int GeomType) const
Crouzeix-Raviart finite element on triangle.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const =0
Arbitrary order "L2-conforming" discontinuous finite elements.
virtual const FiniteElement * FiniteElementForGeometry(int GeomType) const