1 #ifndef DUNE_FEM_CACHEPROVIDER_HH
2 #define DUNE_FEM_CACHEPROVIDER_HH
8 #include <dune/common/math.hh>
9 #include <dune/common/visibility.hh>
24 template <
class ct,
int dim,
bool hasTwists>
32 template <
class ct,
int dim>
45 for (MapperIteratorType it = mappers_.begin();
46 it != mappers_.end(); ++it) {
47 it->resize(maxTwist + Traits::twistOffset_);
52 mappers_(other.mappers_)
57 int faceIndex,
int faceTwist)
59 assert(twistMapper.size() == faceMapper.size());
62 mappers_[faceIndex][faceTwist + Traits::twistOffset_];
63 mapper.resize(twistMapper.size());
65 for (
size_t i = 0; i < mapper.size(); ++i) {
66 mapper[i] = faceMapper[twistMapper[i]];
73 assert( faceTwist + Traits::twistOffset_ >= 0 );
74 return mappers_[faceIndex][faceTwist + Traits::twistOffset_];
78 typedef std::vector<std::vector<MapperType> > MapperContainerType;
79 typedef typename MapperContainerType::iterator MapperIteratorType;
82 MapperContainerType mappers_;
90 template <
class ct,
int dim>
101 : mappers_( numFaces )
105 : mappers_( other.mappers_ )
110 assert( (faceIndex >= 0) && (faceIndex < (
int)mappers_.size()) );
111 mappers_[ faceIndex ] = mapper;
117 if( faceIndex >= (
int)mappers_.size() )
118 std::cerr <<
"Error: faceIndex = " << faceIndex <<
" >= " << mappers_.size() <<
" = mappers_.size()" << std::endl;
120 assert( (faceIndex >= 0) && (faceIndex < (
int)mappers_.size()) );
121 return mappers_[ faceIndex ];
125 typedef typename std::vector<MapperType> MapperContainerType;
128 MapperContainerType mappers_;
135 template<
class Gr
idPart,
int codim >
138 template <
class Gr
idPart>
143 enum { dim = GridPart::dimension };
144 typedef typename GridPart::ctype ct;
151 template <
class QuadratureImpl>
158 template <
class Gr
idPart>
162 enum { dim = GridPart::dimension };
163 typedef typename GridPart::ctype ct;
174 template <
class QuadratureImpl>
176 GeometryType elementGeometry,
186 MapperIteratorType it = mappers_.find( key );
188 if( it == mappers_.end() )
190 std::integral_constant< bool, hasTwists > i2t;
194 return it->second.getMapper(faceIndex, faceTwist);
198 typedef CacheStorage< ct, dim-codim, hasTwists> CacheStorageType;
200 typedef typename Traits::MapperVectorType MapperVectorType;
201 typedef std::map<const QuadratureKeyType, CacheStorageType> MapperContainerType;
202 typedef typename MapperContainerType::iterator MapperIteratorType;
205 static MapperIteratorType
206 createMapper (
const QuadratureType &quad, GeometryType elementGeometry, std::integral_constant< bool, true > );
208 static MapperIteratorType
209 createMapper (
const QuadratureType &quad, GeometryType elementGeometry, std::integral_constant< bool, false > );
212 DUNE_EXPORT
static MapperContainerType mappers_;
Definition: bindguard.hh:11
specialize with 'true' if the grid part is cartesian (default=false)
Definition: gridpart/common/capabilities.hh:40
Storage class for mappers.
Definition: cacheprovider.hh:25
void addMapper(const MapperType &faceMapper, const MapperType &twistMapper, int faceIndex, int faceTwist)
Definition: cacheprovider.hh:55
CacheStorage(const CacheStorage &other)
Definition: cacheprovider.hh:51
Traits::MapperType MapperType
Definition: cacheprovider.hh:39
CacheStorage(int numFaces, int maxTwist)
Definition: cacheprovider.hh:42
const MapperType & getMapper(int faceIndex, int faceTwist) const
Definition: cacheprovider.hh:71
const MapperType & getMapper(int faceIndex, int faceTwist) const
Definition: cacheprovider.hh:114
void addMapper(const MapperType &mapper, int faceIndex)
Definition: cacheprovider.hh:108
Traits::MapperType MapperType
Definition: cacheprovider.hh:97
CacheStorage(const CacheStorage &other)
Definition: cacheprovider.hh:104
CacheStorage(int numFaces)
Definition: cacheprovider.hh:100
Definition: cacheprovider.hh:136
static void registerQuadrature(const QuadratureImpl &quad)
Definition: cacheprovider.hh:152
Traits::QuadratureType QuadratureType
Definition: cacheprovider.hh:148
Traits::QuadratureType QuadratureType
Definition: cacheprovider.hh:169
Traits::QuadratureKeyType QuadratureKeyType
Definition: cacheprovider.hh:171
static const MapperType & getMapper(const QuadratureImpl &quadImpl, GeometryType elementGeometry, int faceIndex, int faceTwist)
Definition: cacheprovider.hh:175
Traits::MapperType MapperType
Definition: cacheprovider.hh:170
Definition: pointmapper.hh:18
Definition: pointmapper.hh:52
std::vector< size_t > MapperType
Definition: pointmapper.hh:58
Definition: pointprovider.hh:23
size_t id() const
obtain the identifier of the integration point list
Definition: quadratureimp.hh:117