dune-fem  2.4.1-rc
cachingquadrature.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_CACHINGQUADRATURE_HH
2 #define DUNE_FEM_CACHINGQUADRATURE_HH
3 
4 //- Dune includes
5 #include <dune/common/math.hh>
6 
7 //- Local includes
8 #include "elementquadrature.hh"
10 #include "caching/pointmapper.hh"
11 #include "caching/cacheprovider.hh"
12 
13 #include "cachingpointlist.hh"
14 
15 namespace Dune
16 {
17  namespace Fem
18  {
19 
40  template< typename GridPartImp, int codim >
42 
43 
44 
46  template< typename GridPart >
47  class CachingQuadrature< GridPart, 0 >
48  : public CachingPointList< GridPart, 0, ElementQuadratureTraits< GridPart, 0 > >
49  {
50  public:
52  typedef GridPart GridPartType;
53 
55  enum { codimension = 0 };
56 
57  private:
59 
62  BaseType;
63 
64  public:
66  enum { dimension = BaseType::dimension };
67 
69  typedef typename BaseType :: RealType RealType;
71  typedef typename BaseType :: CoordinateType CoordinateType;
72 
73  // for compatibility
74  typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
75 
76  protected:
77  using BaseType :: quadImp;
78 
79  public:
86  CachingQuadrature( const EntityType &entity,
87  int order )
88  : BaseType( entity.type(), order )
89  {}
90 
97  CachingQuadrature( const GeometryType &type,
98  int order )
99  : BaseType( type, order )
100  {}
101 
106  CachingQuadrature( const ThisType &org )
107  : BaseType( org )
108  {}
109 
111  const RealType &weight ( size_t i ) const
112  {
113  return quadImp().weight( i );
114  }
115  };
116 
117 
118 
120  template< typename GridPartImp >
121  class CachingQuadrature< GridPartImp, 1 >
122  : public CachingPointList
123  < GridPartImp, 1, ElementQuadratureTraits< GridPartImp, 1 > >
124  {
125  public:
127  typedef GridPartImp GridPartType;
128 
130  enum { codimension = 1 };
131 
132  private:
134 
137  BaseType;
138 
139  protected:
140  using BaseType :: quadImp;
141 
142  public:
144  enum { dimension = BaseType::dimension };
145 
147  typedef typename BaseType::RealType RealType;
148 
151  typedef typename BaseType::CoordinateType CoordinateType;
152 
154  typedef typename BaseType :: IntersectionIteratorType IntersectionIteratorType;
155  typedef typename IntersectionIteratorType :: Intersection IntersectionType;
156 
159 
160  public:
173  CachingQuadrature( const GridPartType &gridPart,
174  const IntersectionType &intersection,
175  int order,
176  typename BaseType::Side side )
177  : BaseType( gridPart, intersection, order, side )
178  {}
179 
184  CachingQuadrature( const ThisType& org )
185  : BaseType( org )
186  {}
187 
189  const RealType &weight( size_t i ) const
190  {
191  return quadImp().weight(i);
192  }
193  };
194 
195  } //namespace Fem
196 
197 } //namespace Dune
198 
199 #endif // #ifndef DUNE_FEM_CACHINGQUADRATURE_HH
CachingQuadrature(const ThisType &org)
copy constructor
Definition: cachingquadrature.hh:184
integration point list supporting base function caching
Definition: cachingpointlist.hh:74
GridPartImp GridPartType
type of the grid partition
Definition: cachingquadrature.hh:127
const RealType & weight(size_t i) const
obtain weight of i-th integration point
Definition: cachingquadrature.hh:111
BaseType::IntersectionIteratorType IntersectionIteratorType
Type of the intersection iterator.
Definition: cachingquadrature.hh:154
IntersectionIteratorType::Intersection IntersectionType
Definition: cachingquadrature.hh:155
quadrature class supporting base function caching
Definition: cachingquadrature.hh:41
GridPartType::template Codim< 0 >::EntityType EntityType
Definition: cachingquadrature.hh:74
GridPart GridPartType
type of grid partition
Definition: cachingquadrature.hh:52
CachingQuadrature(const GridPartType &gridPart, const IntersectionType &intersection, int order, typename BaseType::Side side)
constructor
Definition: cachingquadrature.hh:173
Definition: coordinate.hh:4
BaseType::CoordinateType CoordinateType
Definition: cachingquadrature.hh:151
quadrature on the codim-0 reference element
Definition: elementquadrature.hh:47
CachingQuadrature(const GeometryType &type, int order)
constructor
Definition: cachingquadrature.hh:97
const RealType & weight(size_t i) const
Definition: cachingquadrature.hh:189
BaseType::RealType RealType
Just another name for double...
Definition: cachingquadrature.hh:69
CachingQuadrature(const EntityType &entity, int order)
constructor
Definition: cachingquadrature.hh:86
CachingQuadrature(const ThisType &org)
copy constructor
Definition: cachingquadrature.hh:106
Definition: elementquadrature.hh:52
ElementQuadrature< GridPartImp, codimension > NonConformingQuadratureType
type of quadrature used for non-conforming intersections
Definition: cachingquadrature.hh:158
BaseType::CoordinateType CoordinateType
The type of the coordinates in the codim-0 reference element.
Definition: cachingquadrature.hh:71
BaseType::RealType RealType
A double... or whatever your grid wants.
Definition: cachingquadrature.hh:147