12 #ifndef MFEM_TEMPLATE_FINITE_ELEMENTS
13 #define MFEM_TEMPLATE_FINITE_ELEMENTS
15 #include "../config/tconfig.hpp"
23 template <
typename real_t>
33 for (
int ip = 0; ip < nip; ip++)
36 for (
int id = 0;
id < dof;
id++)
38 int orig_id = dof_map ? (*dof_map)[id] : id;
39 B[ip+nip*id] = shape(orig_id);
44 template <
typename real_t>
55 for (
int ip = 0; ip < nip; ip++)
58 for (
int id = 0;
id < dof;
id++)
60 int orig_id = dof_map ? (*dof_map)[id] : id;
61 for (
int d = 0; d <
dim; d++)
63 G[ip+nip*(d+dim*id)] = dshape(orig_id, d);
69 template <
typename real_t>
79 template <Geometry::Type G,
int P>
87 static const int dim = 1;
88 static const int degree = P;
89 static const int dofs = P+1;
91 static const bool tensor_prod =
true;
92 static const int dofs_1d = P+1;
118 MFEM_ABORT(
"invalid basis type!");
131 MFEM_ASSERT(h1_fec,
"invalid FiniteElementCollection");
136 template <
typename real_t>
141 template <
typename real_t>
155 static const int degree = P;
156 static const int dofs = ((P + 1)*(P + 2))/2;
158 static const bool tensor_prod =
false;
179 MFEM_ABORT(
"invalid basis type!");
192 MFEM_ASSERT(h1_fec,
"invalid FiniteElementCollection");
197 template <
typename real_t>
211 static const int degree = P;
212 static const int dofs = (P+1)*(P+1);
214 static const bool tensor_prod =
true;
215 static const int dofs_1d = P+1;
243 MFEM_ABORT(
"invalid basis type!");
256 MFEM_ASSERT(h1_fec,
"invalid FiniteElementCollection");
261 template <
typename real_t>
266 template <
typename real_t>
280 static const int degree = P;
281 static const int dofs = ((P + 1)*(P + 2)*(P + 3))/6;
283 static const bool tensor_prod =
false;
304 MFEM_ABORT(
"invalid basis type!");
317 MFEM_ASSERT(h1_fec,
"invalid FiniteElementCollection");
322 template <
typename real_t>
336 static const int degree = P;
337 static const int dofs = (P+1)*(P+1)*(P+1);
339 static const bool tensor_prod =
true;
340 static const int dofs_1d = P+1;
369 MFEM_ABORT(
"invalid basis type!");
382 MFEM_ASSERT(h1_fec,
"invalid FiniteElementCollection");
387 template <
typename real_t>
392 template <
typename real_t>
403 template <
Geometry::Type G,
int P,
typename L2_FE_type,
typename L2Pos_FE_type,
434 my_fe =
new L2Pos_FE_type(P);
438 MFEM_ABORT(
"invalid basis type");
449 MFEM_ASSERT(l2_fec,
"invalid FiniteElementCollection");
456 template <
typename real_t>
461 template <
typename real_t>
470 template <Geometry::Type G,
int P>
477 Geometry::SEGMENT,P,L2_SegmentElement,L2Pos_SegmentElement,P+1,true>
494 L2Pos_TriangleElement,((P+1)*(P+2))/2,false>
511 L2Pos_QuadrilateralElement,(P+1)*(P+1),true>
528 L2Pos_TetrahedronElement,((P+1)*(P+2)*(P+3))/6,false>
545 L2Pos_HexahedronElement,(P+1)*(P+1)*(P+1),true>
560 #endif // MFEM_TEMPLATE_FINITE_ELEMENTS
const Array< int > * GetDofMap() const
void Init(const parameter_type type_)
int GetNPoints() const
Returns the number of the points in the integration rule.
Abstract class for Finite Elements.
const Array< int > * my_dof_map
const FiniteElement * my_fe_1d
const Array< int > & GetDofMap() const
int GetDim() const
Returns the space dimension for the finite element.
L2_FiniteElement(const parameter_type type_=L2_FECollection::GaussLegendre)
const FiniteElement * my_fe
Class for integration rule.
L2_FiniteElement(const FiniteElementCollection &fec)
static const Geometry::Type geom
L2_FECollection::BasisType parameter_type
L2_FiniteElement_base< Geometry::SEGMENT, P, L2_SegmentElement, L2Pos_SegmentElement, P+1, true > base_class
const Array< int > * GetDofMap() const
L2_FiniteElement(const FiniteElementCollection &fec)
L2_FiniteElement(const FiniteElementCollection &fec)
H1_FECollection::BasisType parameter_type
H1_FiniteElement(const parameter_type type_=H1_FECollection::GaussLobatto)
void Init(const parameter_type type_)
H1_FiniteElement(const FiniteElementCollection &fec)
const Array< int > * my_dof_map
Data type dense matrix using column-major storage.
void CalcShapeMatrix(const FiniteElement &fe, const IntegrationRule &ir, real_t *B, const Array< int > *dof_map=NULL)
const Array< int > * GetDofMap() const
BasisType GetBasisType() const
const Array< int > & GetDofMap() const
L2_FiniteElement(const parameter_type type_=L2_FECollection::GaussLegendre)
H1_FECollection::BasisType parameter_type
H1_FECollection::BasisType parameter_type
H1_FiniteElement(const FiniteElementCollection &fec)
const Array< int > * my_dof_map
const Array< int > * GetDofMap() const
void CalcShapes(const IntegrationRule &ir, real_t *B, real_t *G) const
const FiniteElement * my_fe
L2_FiniteElement(const parameter_type type_=L2_FECollection::GaussLegendre)
base_class::parameter_type parameter_type
L2_FiniteElement(const FiniteElementCollection &fec)
L2_FiniteElement(const parameter_type type_=L2_FECollection::GaussLegendre)
H1_FECollection::BasisType parameter_type
void Init(const parameter_type type_)
L2_FiniteElement_base(const FiniteElementCollection &fec)
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
const FiniteElement * my_fe_1d
const Array< int > & GetDofMap() const
void CalcGradTensor(const FiniteElement &fe, const IntegrationRule &ir, real_t *G, const Array< int > *dof_map=NULL)
H1_FiniteElement(const FiniteElementCollection &fec)
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const =0
static const bool tensor_prod
L2_FiniteElement_base< Geometry::TETRAHEDRON, P, L2_TetrahedronElement, L2Pos_TetrahedronElement,((P+1)*(P+2)*(P+3))/6, false > base_class
H1_FiniteElement(const parameter_type type_=H1_FECollection::GaussLobatto)
base_class::parameter_type parameter_type
H1_FiniteElement(const parameter_type type_=H1_FECollection::GaussLobatto)
base_class::parameter_type parameter_type
const FiniteElement * my_fe
base_class::parameter_type parameter_type
const Array< int > & GetDofMap() const
void CalcShapes(const IntegrationRule &ir, real_t *B, real_t *G) const
void Init(const parameter_type type_)
const Array< int > & GetDofMap() const
L2_FiniteElement_base(const parameter_type type)
void CalcShapes(const IntegrationRule &ir, real_t *B, real_t *Grad) const
int GetDof() const
Returns the degrees of freedom in the FE space.
H1_FiniteElement(const parameter_type type_=H1_FECollection::GaussLobatto)
void CalcShapes(const IntegrationRule &ir, real_t *B, real_t *G) const
H1_FiniteElement(const parameter_type type_=H1_FECollection::GaussLobatto)
H1_FECollection::BasisType parameter_type
void CalcShapes(const IntegrationRule &ir, real_t *B, real_t *G) const
H1_FiniteElement(const FiniteElementCollection &fec)
void Calc1DShapes(const IntegrationRule &ir, real_t *B, real_t *G) const
H1_FiniteElement(const FiniteElementCollection &fec)
void Calc1DShapes(const IntegrationRule &ir, real_t *B, real_t *G) const
BasisType GetBasisType() const
void Calc1DShapes(const IntegrationRule &ir, real_t *B, real_t *G) const
const FiniteElement * my_fe_1d
const FiniteElement * my_fe
L2_FiniteElement(const parameter_type type_=L2_FECollection::GaussLegendre)
Arbitrary order H1-conforming (continuous) finite elements.
base_class::parameter_type parameter_type
void CalcShapes(const IntegrationRule &ir, real_t *B, real_t *G) const
void Init(const parameter_type type_)
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const =0
L2_FiniteElement_base< Geometry::SQUARE, P, L2_QuadrilateralElement, L2Pos_QuadrilateralElement,(P+1)*(P+1), true > base_class
void CalcShapes(const FiniteElement &fe, const IntegrationRule &ir, real_t *B, real_t *G, const Array< int > *dof_map)
void Calc1DShapes(const IntegrationRule &ir, real_t *B, real_t *Grad) const
const Array< int > * GetDofMap() const
void Init(const parameter_type type_)
L2_FiniteElement(const FiniteElementCollection &fec)
const Array< int > * GetDofMap() const
const Array< int > & GetDofMap() const
Arbitrary order "L2-conforming" discontinuous finite elements.