LifeV
QuadratureRuleBoundary.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 A short description of the file content
30 
31  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
32  @date 21 Feb 2012
33  */
34 
35 #ifndef QUADRATURERULEBOUNDARY_H
36 #define QUADRATURERULEBOUNDARY_H 1
37 
38 #include <lifev/core/LifeV.hpp>
39 #include <lifev/core/fem/QuadratureRule.hpp>
40 
41 #include <vector>
42 
43 namespace LifeV
44 {
45 
46 //! QuadratureRuleBoundary - Short description of the class
47 /*!
48  @author Samuel Quinodoz
49  @see Reference to papers (if available)
50  */
52 {
53 public:
54 
56 
58  {
59  for (UInt i (0); i < QRBD.M_quadrature.size(); ++i)
60  {
61  M_quadratures.push_back (QRBD.M_quadratures[i]);
62  }
63  }
64 
66 
67  QuadratureRule qr (const UInt i) const
68  {
69  return M_quadratures[i];
70  }
71 
72  void setQR (const UInt i, QuadratureRule myQR)
73  {
74  while (M_quadratures.size() <= i)
75  {
76  M_quadratures.push_back (QuadratureRule() );
77  }
78 
79  M_quadratures[i] = myQR;
80  }
81 
82 private:
83 
84  // Store the possible quadrature rules
85  std::vector<QuadratureRule> M_quadratures
86 
87 };
88 
89 
92 {
94 
95  QRBD.setQR (0, myQR);
96 
97  QuadratureRule F1;
98  for (UInt i (0); i < myQR.nbQuadPt(); ++i)
99  {
100  Real x0 (myQR.quadPointCoor (i, 0) );
101  Real y0 (myQR.quadPointCoor (i, 1) );
102 
103  Real x (x0);
104  Real y (0);
105  Real z (y0);
106 
108  }
109  QRBD.setQR (1, F1);
110 
111  QuadratureRule F2;
112  for (UInt i (0); i < myQR.nbQuadPt(); ++i)
113  {
114  Real x0 (myQR.quadPointCoor (i, 0) );
115  Real y0 (myQR.quadPointCoor (i, 1) );
116 
117  Real x (x0);
118  Real y (y0);
119  Real z (1 - x0 - y0);
120 
121  F2.addPoint (QuadraturePoint (x, y, z, myQR.weight (i) *std::sqrt (3) / (2.0 * sqrt (2) ) ) );
122  }
123  QRBD.setQR (2, F2);
124 
125  QuadratureRule F3;
126  for (UInt i (0); i < myQR.nbQuadPt(); ++i)
127  {
128  Real x0 (myQR.quadPointCoor (i, 0) );
129  Real y0 (myQR.quadPointCoor (i, 1) );
130 
131  Real x (0);
132  Real y (y0);
133  Real z (x0);
134 
136  }
137  QRBD.setQR (3, F3);
138 
139  return QRBD;
140 }
141 
142 
143 } // Namespace LifeV
144 
145 #endif /* QUADRATURERULEBOUNDARY_H */
const Real & weight(const UInt &ig) const
weight(ig) is the ig-th quadrature weight
void addPoint(const QuadraturePoint &qp)
Method to add a point to an existing quadrature rule.
void updateInverseJacobian(const UInt &iQuadPt)
QuadratureRule qr(const UInt i) const
QuadratureRuleBoundary(const QuadratureRuleBoundary &QRBD)
void setQR(const UInt i, QuadratureRule myQR)
QuadratureRuleBoundary createTetraBDQR(const QuadratureRule &myQR)
QuadratureRuleBoundary - Short description of the class.
QuadraturePoint - Simple container for a point of a quadrature rule.
QuadraturePoint(Real x, Real y, Real z, Real weight)
Full constructor for 3D.
double Real
Generic real data.
Definition: LifeV.hpp:175
QuadratureRule - The basis class for storing and accessing quadrature rules.
const UInt & nbQuadPt() const
Getter for the number of quadrature points.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
const Real & quadPointCoor(const UInt &ig, const UInt &icoor) const
quadPointCoor(ig,icoor) is the coordinate icoor of the quadrature point ig