LifeV
ReferenceElement.cpp
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 Base class for ReferenceFE and GeometricMap
30 
31  @author Jean-Frederic Gerbeau
32  @date 00-04-2002
33 
34  @contributor Samuel Quinodoz <samuel.quinodoz@epfl.ch>
35  @mantainer Samuel Quinodoz <samuel.quinodoz@epfl.ch>
36  */
37 
38 #include <lifev/core/fem/ReferenceElement.hpp>
39 
40 namespace LifeV
41 {
42 
43 // ===================================================
44 // Constructors & Destructor
45 // ===================================================
46 
47 ReferenceElement::ReferenceElement ( std::string name, ReferenceShapes shape, UInt nbDof, UInt nbLocalCoor, UInt feDim,
48  const function_Type* phi, const function_Type* dPhi, const function_Type* d2Phi,
49  const function_Type* divPhi, const Real* refCoor ) :
50  M_phi ( phi ),
51  M_dPhi ( dPhi ),
52  M_d2Phi ( d2Phi ),
53  M_divPhi ( divPhi),
54  M_refCoor ( refCoor ),
55 
56  M_name ( name ),
57  M_shape ( shape ),
58  M_nbDof ( nbDof ),
59  M_nbLocalCoor ( nbLocalCoor ),
60  M_feDim ( feDim )
61 {
62 }
63 
65 {
66 }
67 
68 // ===================================================
69 // Methods
70 // ===================================================
71 
74 {
75  std::vector<GeoVector> coordinates (M_nbDof, GeoVector (3) );
76  for (UInt i (0); i < M_nbDof; ++i)
77  {
78  coordinates[i][0] = M_refCoor[3 * i];
79  coordinates[i][1] = M_refCoor[3 * i + 1];
80  coordinates[i][2] = M_refCoor[3 * i + 2];
81  }
82  return coordinates;
83 }
84 
85 
86 } // Namespace LifeV
const function_Type * M_phi
pointer on the basis functions
const function_Type * M_d2Phi
pointer on the second derivatives of the basis functions
ReferenceElement - The basis class for the geometric mapping and the reference finite elements...
std::vector< GeoVector > refCoor() const
return the coordinates of the reference element
void updateInverseJacobian(const UInt &iQuadPt)
const ReferenceShapes M_shape
geometrical shape of the element
const UInt M_nbLocalCoor
Number of local coordinates.
const std::string M_name
name of the reference element
virtual ~ReferenceElement()
Destructor.
const UInt M_nbDof
Total number of degrees of freedom.
const function_Type * M_dPhi
pointer on the derivatives of the basis functions
const UInt M_feDim
Number of dimension of the FE (1 for scalar FE, more for vectorial FE)
double Real
Generic real data.
Definition: LifeV.hpp:175
const function_Type * M_divPhi
pointer on the divergence of the basis functions
ReferenceElement(std::string name, ReferenceShapes shape, UInt nbDof, UInt nbLocalCoor, UInt feDim, const function_Type *phi, const function_Type *dPhi, const function_Type *d2Phi, const function_Type *divPhi, const Real *refCoor)
Full constructor.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
const Real * M_refCoor
reference coordinates. Order: xistd::placeholders::_1,etA_1,zetA_1,xistd::placeholders::_2,etA_2,zetA_2,...