LifeV
QuadraturePoint.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 Implementation of the quadPoint class, usefull for the quadrature rules.
30 
31  @author Jean-Frederic Gerbeau
32  Samuel Quinodoz <samuel.quinodoz@epfl.ch>
33  @date 18-05-2010
34 
35  @contributor Samuel Quinodoz <samuel.quinodoz@epfl.ch>
36  @mantainer Samuel Quinodoz <samuel.quinodoz@epfl.ch>
37  */
38 
39 #include <lifev/core/fem/QuadraturePoint.hpp>
40 
41 namespace LifeV
42 {
43 
44 // ===================================================
45 // Constructors & Destructor
46 // ===================================================
47 
49  : M_weight ( 0 ),
50  M_coor ( 3 )
51 {
52  M_coor[ 0 ] = 0;
53  M_coor[ 1 ] = 0;
54  M_coor[ 2 ] = 0;
55 }
56 
58  : M_weight ( weight ),
59  M_coor ( 3 )
60 {
61  M_coor[ 0 ] = x;
62  M_coor[ 1 ] = y;
63  M_coor[ 2 ] = z;
64 }
65 
67  : M_weight ( weight ),
68  M_coor ( 3 )
69 {
70  M_coor[ 0 ] = x;
71  M_coor[ 1 ] = y;
72  M_coor[ 2 ] = 0.;
73 }
74 
76  : M_weight ( weight ),
77  M_coor ( 3 )
78 {
79  M_coor[ 0 ] = x;
80  M_coor[ 1 ] = 0.;
81  M_coor[ 2 ] = 0.;
82 }
83 
84 QuadraturePoint::QuadraturePoint (const GeoVector& coor, const Real& weight)
85  : M_weight (weight),
86  M_coor (coor)
87 {}
88 
89 QuadraturePoint::QuadraturePoint (const GeoVector& coor, const Real& weight, const UInt& spaceDim)
90  : M_weight (weight),
91  M_coor (spaceDim)
92 {
93  for (UInt i (0); (i < spaceDim) && (i < coor.size() ); ++i)
94  {
95  M_coor[i] = coor[i];
96  }
97 
98  // Add zeros if necessary
99  for (UInt i (coor.size() ); i < spaceDim ; ++i)
100  {
101  M_coor[i] = 0.0;
102  }
103 }
104 
106  : M_weight (qp.M_weight),
107  M_coor (qp.M_coor.size() )
108 {
109  M_coor = qp.M_coor;
110 }
111 
113  : M_weight (qp.M_weight),
114  M_coor (spaceDim)
115 {
116  for (UInt i (0); (i < spaceDim) && (i < qp.M_coor.size() ); ++i)
117  {
118  M_coor[i] = qp.M_coor[i];
119  }
120 
121  // Add zeros if necessary
122  for (UInt i (qp.M_coor.size() ); i < spaceDim ; ++i)
123  {
124  M_coor[i] = 0.0;
125  }
126 }
127 
128 } // Namespace LifeV
QuadraturePoint(Real x, Real weight)
Full constructor for 1D.
QuadraturePoint(Real x, Real y, Real weight)
Full constructor for 2D.
QuadraturePoint(const GeoVector &coor, const Real &weight, const UInt &spaceDim)
Multidimension constructor with specified dimension.
QuadraturePoint()
Empty constructor (all zero data).
boost::numeric::ublas::vector< Real > GeoVector
void updateInverseJacobian(const UInt &iQuadPt)
QuadraturePoint - Simple container for a point of a quadrature rule.
QuadraturePoint(Real x, Real y, Real z, Real weight)
Full constructor for 3D.
QuadraturePoint(const QuadraturePoint &qp)
Simple copy constructor.
double Real
Generic real data.
Definition: LifeV.hpp:175
QuadraturePoint(const GeoVector &coor, const Real &weight)
Full multidimension constructor.
QuadraturePoint(const QuadraturePoint &qp, const UInt spaceDim)
Import from another dimension.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191