Programming tasks to Scientific Computing I
quadratureShellFE.h
Go to the documentation of this file.
1 #ifndef __QUADRATURESHELLFE_H
2 #define __QUADRATURESHELLFE_H
3 
4 namespace shellFE {
5 
6 
8 // CenterQuadrature
9 // template <typename RealType>
10 // class CenterQuadrature {
11 // public:
12 // enum { numQuadPoints = 1 };
13 //
14 // inline const DomVecType& getRefCoord ( int ) const {
15 // static const DomVecType c ( 1. / 3., 1. / 3. );
16 // return c;
17 // }
18 //
19 // inline RealType getWeight ( int ) const {
20 // return 1.;
21 // }
22 // };
23 //
24 // // TriQuadrature
25 // template <typename RealType>
26 // class TriQuadrature {
27 // public:
28 // enum { numQuadPoints = 3 };
29 //
30 // inline const DomVecType& getRefCoord ( int quadpoint ) const {
31 // static const DomVecType c[3] = {
32 // DomVecType ( 1. / 6., 1. / 6. ),
33 // DomVecType ( 1. / 6., 2. / 3. ),
34 // DomVecType ( 2. / 3., 1. / 6. )
35 // };
36 // return c[quadpoint];
37 // }
38 //
39 // inline RealType getWeight ( int ) const {
40 // return 1. / 3.;
41 // }
42 // };
43 //
44 
45 template <typename RealType, typename DomVecType>
47 public:
48  enum { numQuadPoints = 1};
49 
50  inline const DomVecType& getRefCoord ( int quadpoint ) const {
51  static const DomVecType c[1] = { DomVecType ( 1./3., 1./3. ) };
52  return c[quadpoint];
53  }
54 
55  inline RealType getWeight ( int ) const {
56  return 1.;
57  }
58 };
59 
60 // EdgeQuadrature
61 template <typename RealType, typename DomVecType>
63 public:
64  enum { numQuadPoints = 3 };
65 
66  inline const DomVecType& getRefCoord ( int quadpoint ) const {
67  static const DomVecType c[3] = { DomVecType ( 1./2., 1./2. ),
68  DomVecType ( 0., 1./2. ),
69  DomVecType ( 1./2., 0. )
70  };
71  return c[quadpoint];
72  }
73 
74  inline RealType getWeight ( int ) const {
75  return 1./3.;
76  }
77 };
78 
79 }
80 
81 #endif
const DomVecType & getRefCoord(int quadpoint) const
Different quadrature types for triangular meshes.
RealType getWeight(int) const
const DomVecType & getRefCoord(int quadpoint) const
double RealType
Definition: ex2.cpp:21