LifeV
ReferenceFEScalar.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief Reference finite element for scalar lagrangian FEs.
30 
31  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
32  @date 10-05-2010
33 
34  @contributor
35  @mantainer Samuel Quinodoz <samuel.quinodoz@epfl.ch>
36  */
37 
38 
39 #ifndef REFFESCALAR_H
40 #define REFFESCALAR_H 1
41 
42 
43 #include <lifev/core/fem/ReferenceFE.hpp>
44 
45 namespace LifeV
46 {
47 
48 //! refFEScalar - Short description of the class
49 /*!
50 
51  */
53  : public ReferenceFE
54 {
55 public:
56 
57  //! @name Public Types
58  //@{
59 
60  typedef ReferenceFE::function_Type function_Type;
62 
63  //@}
64 
65 
66  //! @name Constructor & Destructor
67  //@{
68 
69  //! Constructor of a reference Lagrangian finite element.
70  /*!
71  Constructor of a reference finite element. The arguments are:
72  @param name the name of the f.e.
73  @param type the type of the f.e. (FE_P1_2D,... see the #define at the
74  begining of refFE.h)
75  @param shape the geometry belongs to enum ReferenceShapes {NONE, POINT,
76  LINE, TRIANGLE, QUAD, HEXA, PRISM, TETRA}; (see ElementShapes.h)
77  @param nbDofPerVertex the number of degrees of freedom per vertex
78  @param nbDofPerEdge the number of degrees of freedom per edge
79  @param nbDofPerFace the number of degrees of freedom per face
80  @param nbDofPerVolume the number of degrees of freedom per volume
81  @param nbDof the total number of d.o.f ( = nbDofPerVertex * nb vertex +
82  nbDofPerEdge * nb edges + etc...)
83  @param nbLocalCoor number of local coordinates
84  @param phi the static array containing the basis functions (defined in
85  refEle.h)
86  @param dPhi the static array containing the derivatives of the basis
87  functions (defined in refEle.h)
88  @param d2Phi the static array containing the second derivatives of the
89  basis functions (defined in refEle.h)
90  @param refCoor the static array containing the coordinates of the nodes on
91  the reference element (defined in refEle.h)
92  @param patternType in most of cases STANDARD_PATTERN, except for elements
93  like P1isoP2 (to define a new pattern, add a new #define in refFE.h and
94  code it in refFE.cc following the example of P1ISOP2_TRIA_PATTERN)
95  @param bdRefFE a pointer on the associated reference finite element on the boundary
96  */
97  ReferenceFEScalar ( std::string name,
98  FE_TYPE type,
99  ReferenceShapes shape,
100  Int nbDofPerVertex,
101  Int nbDofPerEdge,
102  Int nbDofPerFace,
103  Int nbDofPerVolume,
104  Int nbDof,
105  Int nbLocalCoor,
106  const function_Type* phi,
107  const function_Type* dPhi,
108  const function_Type* d2Phi,
109  const Real* refCoor,
110  DofPatternType patternType,
111  const ReferenceFE* bdRefFE,
112  const ValuesToValuesFunction_Type nodalToFE);
113 
115 
116  //@}
117 
118 
119  //! @name Methods
120  //@{
121 
123  {
124  ASSERT ( nodalValues.size() == nbDof() , "Number of nodal values does not match with the number of degrees of freedom");
125  return M_nodalToFEValues (nodalValues);
126  }
127 
128  //@}
129 
130 private:
131 
132  const ValuesToValuesFunction_Type M_nodalToFEValues;
133 
134 };
135 
136 //--------------------------------------------------
137 
138 extern const ReferenceFEScalar feSegP0;
139 extern const ReferenceFEScalar feSegP1;
140 extern const ReferenceFEScalar feSegP2;
141 
142 extern const ReferenceFEScalar feTriaP0;
143 extern const ReferenceFEScalar feTriaP1;
144 extern const ReferenceFEScalar feTriaP1bubble;
145 extern const ReferenceFEScalar feTriaP2;
146 
147 extern const ReferenceFEScalar feQuadQ0;
148 extern const ReferenceFEScalar feQuadQ1;
149 extern const ReferenceFEScalar feQuadQ2;
150 
151 extern const ReferenceFEScalar feTetraP0;
152 extern const ReferenceFEScalar feTetraP1;
154 extern const ReferenceFEScalar feTetraP2;
155 extern const ReferenceFEScalar feTetraP2tilde;
156 
157 extern const ReferenceFEScalar feHexaQ0;
158 extern const ReferenceFEScalar feHexaQ1;
159 
160 } // Namespace LifeV
161 
162 #endif /* REFFESCALAR_H */
ReferenceFEScalar(std::string name, FE_TYPE type, ReferenceShapes shape, Int nbDofPerVertex, Int nbDofPerEdge, Int nbDofPerFace, Int nbDofPerVolume, Int nbDof, Int nbLocalCoor, const function_Type *phi, const function_Type *dPhi, const function_Type *d2Phi, const Real *refCoor, DofPatternType patternType, const ReferenceFE *bdRefFE, const ValuesToValuesFunction_Type nodalToFE)
Constructor of a reference Lagrangian finite element.
const ReferenceFEScalar feHexaQ0("Lagrange Q0 on a hexaedra", FE_Q0_3D, HEXA, 0, 0, 0, 1, 1, 3, fct_Q0_3D, derfct_Q0_3D, der2fct_Q0_3D, refcoor_Q0_3D, STANDARD_PATTERN, &feQuadQ0, &lagrangianTransform)
const ReferenceFEScalar feSegP0("Lagrange P0 on a segment", FE_P0_1D, LINE, 0, 1, 0, 0, 1, 1, fct_P0_1D, derfct_P0_1D, der2fct_P0_1D, refcoor_P0_1D, STANDARD_PATTERN, &fePointP0, &lagrangianTransform)
const ReferenceFEScalar feTetraP2("Lagrange P2 on a tetraedra", FE_P2_3D, TETRA, 1, 1, 0, 0, 10, 3, fct_P2_3D, derfct_P2_3D, der2fct_P2_3D, refcoor_P2_3D, STANDARD_PATTERN, &feTriaP2, &lagrangianTransform)
const ReferenceFEScalar feTriaP1("Lagrange P1 on a triangle", FE_P1_2D, TRIANGLE, 1, 0, 0, 0, 3, 2, fct_P1_2D, derfct_P1_2D, der2fct_P1_2D, refcoor_P1_2D, STANDARD_PATTERN, &feSegP1, &lagrangianTransform)
DofPatternType
Local pattern type.
int32_type Int
Generic integer data.
Definition: LifeV.hpp:188
void updateInverseJacobian(const UInt &iQuadPt)
std::vector< Real >(* ValuesToValuesFunction_Type)(const std::vector< Real > &)
const ReferenceFEScalar feTetraP0("Lagrange P0 on a tetraedra", FE_P0_3D, TETRA, 0, 0, 0, 1, 1, 3, fct_P0_3D, derfct_P0_3D, der2fct_P0_3D, refcoor_P0_3D, STANDARD_PATTERN, &feTriaP0, &lagrangianTransform)
std::vector< Real > nodalToFEValues(const std::vector< Real > &nodalValues) const
Method for transforming nodal values into FE values.
const ReferenceFEScalar feTriaP0("Lagrange P0 on a triangle", FE_P0_2D, TRIANGLE, 0, 0, 1, 0, 1, 2, fct_P0_2D, derfct_P0_2D, der2fct_P0_2D, refcoor_P0_2D, STANDARD_PATTERN, &feSegP0, &lagrangianTransform)
const ReferenceFEScalar feTetraP1bubble("Lagrange P1bubble on a tetraedra", FE_P1bubble_3D, TETRA, 1, 0, 0, 1, 5, 3, fct_P1bubble_3D, derfct_P1bubble_3D, der2fct_P1bubble_3D, refcoor_P1bubble_3D, STANDARD_PATTERN, &feTriaP1, &P1Bubble3DTransform)
const ReferenceFEScalar feSegP1("Lagrange P1 on a segment", FE_P1_1D, LINE, 1, 0, 0, 0, 2, 1, fct_P1_1D, derfct_P1_1D, der2fct_P1_1D, refcoor_P1_1D, STANDARD_PATTERN, &fePointP0, &lagrangianTransform)
#define ASSERT(X, A)
Definition: LifeAssert.hpp:90
const ReferenceFEScalar feSegP2("Lagrange P2 on a segment", FE_P2_1D, LINE, 1, 1, 0, 0, 3, 1, fct_P2_1D, derfct_P2_1D, der2fct_P2_1D, refcoor_P2_1D, STANDARD_PATTERN, &fePointP0, &lagrangianTransform)
const ReferenceFEScalar feTriaP2("Lagrange P2 on a triangle", FE_P2_2D, TRIANGLE, 1, 1, 0, 0, 6, 2, fct_P2_2D, derfct_P2_2D, der2fct_P2_2D, refcoor_P2_2D, STANDARD_PATTERN, &feSegP2, &lagrangianTransform)
const ValuesToValuesFunction_Type M_nodalToFEValues
double Real
Generic real data.
Definition: LifeV.hpp:175
const ReferenceFEScalar feTetraP1("Lagrange P1 on a tetraedra", FE_P1_3D, TETRA, 1, 0, 0, 0, 4, 3, fct_P1_3D, derfct_P1_3D, der2fct_P1_3D, refcoor_P1_3D, STANDARD_PATTERN, &feTriaP1, &lagrangianTransform)
The class for a reference Lagrangian finite element.
const ReferenceFEScalar feQuadQ2("Lagrange Q2 on a quadrangle", FE_Q2_2D, QUAD, 1, 1, 1, 0, 9, 2, fct_Q2_2D, derfct_Q2_2D, der2fct_Q2_2D, refcoor_Q2_2D, STANDARD_PATTERN, &feSegP2, &lagrangianTransform)
const ReferenceFEScalar feQuadQ0("Lagrange Q0 on a quadrangle", FE_Q0_2D, QUAD, 0, 0, 1, 0, 1, 2, fct_Q0_2D, derfct_Q0_2D, der2fct_Q0_2D, refcoor_Q0_2D, STANDARD_PATTERN, &feSegP0, &lagrangianTransform)
const ReferenceFEScalar feHexaQ1("Lagrange Q1 on a hexaedra", FE_Q1_3D, HEXA, 1, 0, 0, 0, 8, 3, fct_Q1_3D, derfct_Q1_3D, der2fct_Q1_3D, refcoor_Q1_3D, STANDARD_PATTERN, &feQuadQ1, &lagrangianTransform)
const ReferenceFEScalar feTetraP2tilde("Lagrange P2tilde on a tetraedra", FE_P2tilde_3D, TETRA, 1, 1, 0, 1, 11, 3, fct_P2tilde_3D, derfct_P2tilde_3D, der2fct_P2tilde_3D, refcoor_P2tilde_3D, STANDARD_PATTERN, &feTriaP2, &lagrangianTransform)
const ReferenceFEScalar feQuadQ1("Lagrange Q1 on a quadrangle", FE_Q1_2D, QUAD, 1, 0, 0, 0, 4, 2, fct_Q1_2D, derfct_Q1_2D, der2fct_Q1_2D, refcoor_Q1_2D, STANDARD_PATTERN, &feSegP1, &lagrangianTransform)
const ReferenceFEScalar feTriaP1bubble("P1bubble on a triangle", FE_P1bubble_2D, TRIANGLE, 1, 0, 1, 0, 4, 2, fct_P1bubble_2D, derfct_P1bubble_2D, der2fct_P1bubble_2D, refcoor_P1bubble_2D, STANDARD_PATTERN, &feSegP1, &P1Bubble2DTransform)