DUNE-FEM (unstable)

cachingquadrature.hh
1#ifndef DUNE_FEM_CACHINGQUADRATURE_HH
2#define DUNE_FEM_CACHINGQUADRATURE_HH
3
4//- Local includes
5#include "elementquadrature.hh"
6#include "caching/twistutility.hh"
7#include "caching/pointmapper.hh"
8#include "caching/cacheprovider.hh"
9
10#include "cachingpointlist.hh"
11
12namespace Dune
13{
14 namespace Fem
15 {
16
40 template< typename GridPartImp, int codim, template <class, int> class QuadratureTraits = DefaultQuadratureTraits >
42
43
44
46 template< typename GridPart, template <class, int> class QuadratureTraits >
47 class CachingQuadrature< GridPart, 0, QuadratureTraits >
48 : public CachingPointList< GridPart, 0, ElementQuadratureTraits< GridPart, 0, QuadratureTraits > >
49 {
50 public:
52 typedef GridPart GridPartType;
53
55 static constexpr auto codimension = 0;
56
57 private:
58 typedef ElementQuadratureTraits< GridPartType, codimension, QuadratureTraits > IntegrationTraits;
59
62
63 public:
65 static constexpr auto dimension = BaseType::dimension;
66
68 typedef typename BaseType :: RealType RealType;
70 typedef typename BaseType :: CoordinateType CoordinateType;
71
73 typedef typename BaseType::QuadratureKeyType QuadratureKeyType;
74
79
80 // for compatibility
81 typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
82
83 protected:
84 using BaseType :: quadImp;
85
86 public:
87 using BaseType::nop;
88
95 CachingQuadrature( const EntityType &entity, const QuadratureKeyType& quadKey )
96 : BaseType( entity.type(), quadKey )
97 {}
98
105 CachingQuadrature( const GeometryType &type, const QuadratureKeyType& quadKey )
106 : BaseType( type, quadKey )
107 {}
108
114 : BaseType( org )
115 {}
116
117 QuadraturePointWrapperType operator[] ( std::size_t i ) const
118 {
119 return QuadraturePointWrapperType( *this, i );
120 }
121
122 IteratorType begin () const noexcept { return IteratorType( *this, 0 ); }
123 IteratorType end () const noexcept { return IteratorType( *this, nop() ); }
124
126 const RealType &weight ( std::size_t i ) const
127 {
128 return quadImp().weight( i );
129 }
130 };
131
132
133
135 template< typename GridPartImp, template <class, int> class QuadratureTraits >
136 class CachingQuadrature< GridPartImp, 1, QuadratureTraits >
137 : public CachingPointList
138 < GridPartImp, 1, ElementQuadratureTraits< GridPartImp, 1, QuadratureTraits > >
139 {
140 public:
142 typedef GridPartImp GridPartType;
143
145 static constexpr auto codimension = 1;
146
147 private:
148 typedef ElementQuadratureTraits< GridPartType, codimension, QuadratureTraits > IntegrationTraits;
149
152
153 protected:
154 using BaseType :: quadImp;
155
156 public:
158 static constexpr auto dimension = BaseType::dimension;
159
161 typedef typename BaseType::RealType RealType;
162
164 typedef typename BaseType::CoordinateType CoordinateType;
165
167 typedef typename BaseType::QuadratureKeyType QuadratureKeyType;
168
173
175 typedef typename BaseType :: IntersectionIteratorType IntersectionIteratorType;
176 typedef typename IntersectionIteratorType :: Intersection IntersectionType;
177
180
181 using BaseType::nop;
182
195 CachingQuadrature( const GridPartType &gridPart, const IntersectionType &intersection,
196 const QuadratureKeyType& quadKey, typename BaseType::Side side )
197 : BaseType( gridPart, intersection, quadKey, side )
198 {}
199
205 : BaseType( org )
206 {}
207
208 QuadraturePointWrapperType operator[] ( std::size_t i ) const
209 {
210 return QuadraturePointWrapperType( *this, i );
211 }
212
213 IteratorType begin () const noexcept { return IteratorType( *this, 0 ); }
214 IteratorType end () const noexcept { return IteratorType( *this, nop() ); }
215
217 const RealType &weight( std::size_t i ) const
218 {
219 return quadImp().weight(i);
220 }
221 };
222
223 template<class GridPart, class Entity>
224 static inline auto cachingQuadrature(const GridPart& gridPart, const Entity& entity, unsigned quadOrder)
225 {
227 return Quadrature(entity, quadOrder);
228 }
229 } //namespace Fem
230
231} //namespace Dune
232
233#endif // #ifndef DUNE_FEM_CACHINGQUADRATURE_HH
Wrapper class for entities.
Definition: entity.hh:66
integration point list supporting base function caching
Definition: cachingpointlist.hh:103
BaseType::QuadratureKeyType QuadratureKeyType
type of quadrature identifier on user side (default is the order of quadrature)
Definition: cachingquadrature.hh:167
GridPartImp GridPartType
type of the grid partition
Definition: cachingquadrature.hh:142
CachingQuadrature(const GridPartType &gridPart, const IntersectionType &intersection, const QuadratureKeyType &quadKey, typename BaseType::Side side)
constructor
Definition: cachingquadrature.hh:195
const RealType & weight(std::size_t i) const
Definition: cachingquadrature.hh:217
BaseType::CoordinateType CoordinateType
the coordinates of the quadrature points in the codim-0 reference element
Definition: cachingquadrature.hh:164
BaseType::IntersectionIteratorType IntersectionIteratorType
type of the intersection iterator
Definition: cachingquadrature.hh:175
BaseType::RealType RealType
just another name for double
Definition: cachingquadrature.hh:161
QuadraturePointIterator< ThisType > IteratorType
type of iterator
Definition: cachingquadrature.hh:172
ElementQuadrature< GridPartImp, codimension > NonConformingQuadratureType
type of quadrature used for non-conforming intersections
Definition: cachingquadrature.hh:179
CachingQuadrature(const ThisType &org)
copy constructor
Definition: cachingquadrature.hh:204
QuadraturePointWrapper< ThisType > QuadraturePointWrapperType
type of the quadrature point
Definition: cachingquadrature.hh:170
QuadraturePointWrapper< ThisType > QuadraturePointWrapperType
type of the quadrature point
Definition: cachingquadrature.hh:76
BaseType::RealType RealType
just another name for double
Definition: cachingquadrature.hh:68
CachingQuadrature(const GeometryType &type, const QuadratureKeyType &quadKey)
constructor
Definition: cachingquadrature.hh:105
CachingQuadrature(const ThisType &org)
copy constructor
Definition: cachingquadrature.hh:113
QuadraturePointIterator< ThisType > IteratorType
type of iterator
Definition: cachingquadrature.hh:78
GridPart GridPartType
type of grid partition
Definition: cachingquadrature.hh:52
const RealType & weight(std::size_t i) const
Definition: cachingquadrature.hh:126
BaseType::QuadratureKeyType QuadratureKeyType
type of quadrature identifier on user side (default is the order of quadrature)
Definition: cachingquadrature.hh:73
BaseType::CoordinateType CoordinateType
type of the coordinates in the codim-0 reference element
Definition: cachingquadrature.hh:70
CachingQuadrature(const EntityType &entity, const QuadratureKeyType &quadKey)
constructor
Definition: cachingquadrature.hh:95
quadrature class supporting base function caching
Definition: cachingquadrature.hh:41
quadrature on the codim-0 reference element
Definition: elementquadrature.hh:58
iterator over quadrature points
Definition: quadrature.hh:103
wrapper for a (Quadrature,int) pair
Definition: quadrature.hh:42
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
Dune namespace.
Definition: alignedallocator.hh:13
Static tag representing a codimension.
Definition: dimension.hh:24
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)