dune-fem  2.6-git
cachingquadrature.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_CACHINGQUADRATURE_HH
2 #define DUNE_FEM_CACHINGQUADRATURE_HH
3 
4 //- Local includes
5 #include "elementquadrature.hh"
7 #include "caching/pointmapper.hh"
9 
10 #include "cachingpointlist.hh"
11 
12 namespace Dune
13 {
14  namespace Fem
15  {
16 
37  template< typename GridPartImp, int codim >
39 
40 
41 
43  template< typename GridPart >
44  class CachingQuadrature< GridPart, 0 >
45  : public CachingPointList< GridPart, 0, ElementQuadratureTraits< GridPart, 0 > >
46  {
47  public:
49  typedef GridPart GridPartType;
50 
52  static constexpr auto codimension = 0;
53 
54  private:
56 
59 
60  public:
62  static constexpr auto dimension = BaseType::dimension;
63 
65  typedef typename BaseType :: RealType RealType;
67  typedef typename BaseType :: CoordinateType CoordinateType;
68 
73 
74  // for compatibility
75  typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
76 
77  protected:
78  using BaseType :: quadImp;
79 
80  public:
81  using BaseType::nop;
82 
89  CachingQuadrature( const EntityType &entity, int order )
90  : BaseType( entity.type(), order )
91  {}
92 
99  CachingQuadrature( const GeometryType &type, int order )
100  : BaseType( type, order )
101  {}
102 
108  : BaseType( org )
109  {}
110 
111  QuadraturePointWrapperType operator[] ( std::size_t i ) const
112  {
113  return QuadraturePointWrapperType( *this, i );
114  }
115 
116  IteratorType begin () const noexcept { return IteratorType( *this, 0 ); }
117  IteratorType end () const noexcept { return IteratorType( *this, nop() ); }
118 
120  const RealType &weight ( std::size_t i ) const
121  {
122  return quadImp().weight( i );
123  }
124  };
125 
126 
127 
129  template< typename GridPartImp >
130  class CachingQuadrature< GridPartImp, 1 >
131  : public CachingPointList
132  < GridPartImp, 1, ElementQuadratureTraits< GridPartImp, 1 > >
133  {
134  public:
136  typedef GridPartImp GridPartType;
137 
139  static constexpr auto codimension = 1;
140 
141  private:
143 
146 
147  protected:
148  using BaseType :: quadImp;
149 
150  public:
152  static constexpr auto dimension = BaseType::dimension;
153 
155  typedef typename BaseType::RealType RealType;
156 
158  typedef typename BaseType::CoordinateType CoordinateType;
159 
164 
166  typedef typename BaseType :: IntersectionIteratorType IntersectionIteratorType;
167  typedef typename IntersectionIteratorType :: Intersection IntersectionType;
168 
171 
172  using BaseType::nop;
173 
186  CachingQuadrature( const GridPartType &gridPart, const IntersectionType &intersection,
187  int order, typename BaseType::Side side )
188  : BaseType( gridPart, intersection, order, side )
189  {}
190 
196  : BaseType( org )
197  {}
198 
199  QuadraturePointWrapperType operator[] ( std::size_t i ) const
200  {
201  return QuadraturePointWrapperType( *this, i );
202  }
203 
204  IteratorType begin () const noexcept { return IteratorType( *this, 0 ); }
205  IteratorType end () const noexcept { return IteratorType( *this, nop() ); }
206 
208  const RealType &weight( std::size_t i ) const
209  {
210  return quadImp().weight(i);
211  }
212  };
213 
214  } //namespace Fem
215 
216 } //namespace Dune
217 
218 #endif // #ifndef DUNE_FEM_CACHINGQUADRATURE_HH
Definition: bindguard.hh:11
integration point list supporting base function caching
Definition: cachingpointlist.hh:74
quadrature class supporting base function caching
Definition: cachingquadrature.hh:38
IteratorType end() const noexcept
Definition: cachingquadrature.hh:117
CachingQuadrature(const GeometryType &type, int order)
constructor
Definition: cachingquadrature.hh:99
BaseType ::CoordinateType CoordinateType
type of the coordinates in the codim-0 reference element
Definition: cachingquadrature.hh:67
GridPartType::template Codim< 0 >::EntityType EntityType
Definition: cachingquadrature.hh:75
GridPart GridPartType
type of grid partition
Definition: cachingquadrature.hh:49
CachingQuadrature(const EntityType &entity, int order)
constructor
Definition: cachingquadrature.hh:89
QuadraturePointIterator< ThisType > IteratorType
type of iterator
Definition: cachingquadrature.hh:72
BaseType ::RealType RealType
just another name for double
Definition: cachingquadrature.hh:65
QuadraturePointWrapper< ThisType > QuadraturePointWrapperType
type of the quadrature point
Definition: cachingquadrature.hh:70
const RealType & weight(std::size_t i) const
obtain weight of i-th integration point
Definition: cachingquadrature.hh:120
CachingQuadrature(const ThisType &org)
copy constructor
Definition: cachingquadrature.hh:107
IteratorType begin() const noexcept
Definition: cachingquadrature.hh:116
CachingQuadrature(const GridPartType &gridPart, const IntersectionType &intersection, int order, typename BaseType::Side side)
constructor
Definition: cachingquadrature.hh:186
BaseType::CoordinateType CoordinateType
the coordinates of the quadrature points in the codim-0 reference element
Definition: cachingquadrature.hh:158
IntersectionIteratorType ::Intersection IntersectionType
Definition: cachingquadrature.hh:167
QuadraturePointWrapper< ThisType > QuadraturePointWrapperType
type of the quadrature point
Definition: cachingquadrature.hh:161
const RealType & weight(std::size_t i) const
Definition: cachingquadrature.hh:208
IteratorType begin() const noexcept
Definition: cachingquadrature.hh:204
CachingQuadrature(const ThisType &org)
copy constructor
Definition: cachingquadrature.hh:195
BaseType::RealType RealType
just another name for double
Definition: cachingquadrature.hh:155
GridPartImp GridPartType
type of the grid partition
Definition: cachingquadrature.hh:136
BaseType ::IntersectionIteratorType IntersectionIteratorType
type of the intersection iterator
Definition: cachingquadrature.hh:166
QuadraturePointIterator< ThisType > IteratorType
type of iterator
Definition: cachingquadrature.hh:163
IteratorType end() const noexcept
Definition: cachingquadrature.hh:205
ElementQuadrature< GridPartImp, codimension > NonConformingQuadratureType
type of quadrature used for non-conforming intersections
Definition: cachingquadrature.hh:170
quadrature on the codim-0 reference element
Definition: elementquadrature.hh:47
Definition: elementquadrature.hh:53
wrapper for a (Quadrature,int) pair
Definition: quadrature/quadrature.hh:41
iterator over quadrature points
Definition: quadrature/quadrature.hh:108