1#ifndef DUNE_FEM_CACHINGPOINTLIST_HH
2#define DUNE_FEM_CACHINGPOINTLIST_HH
5#include <dune/common/math.hh>
32 inline bool twisted ()
const {
return false; }
49 DUNE_THROW( NotImplemented,
50 "CachingInterface :: cachingPoint must be overloaded!" );
60 DUNE_THROW( NotImplemented,
61 "CachingInterface :: interpolationPoint must be overloaded!" );
72 DUNE_THROW( NotImplemented,
73 "CachingInterface :: isInterpolationQuadrature must be overloaded!" );
102 template<
class Gr
idPartImp,
int codim,
class IntegrationTraits >
108 template<
class Gr
idPartImp,
class IntegrationTraits >
118 static const int codimension = Base::codimension;
133 typename IntegrationTraits::IntegrationPointListType::Traits > :: value;
141 using Base::localPoint;
147 :
Base( geometry, quadKey )
163 return localPoint( i );
169 return quadraturePoint;
175 return quadraturePoint;
183 return (pointSetId >= 0) ? (nop() == numShapeFunctions) :
false;
190 template<
typename Gr
idPartImp,
class IntegrationTraits >
203 static const int dimension = Base::dimension;
204 static const int codimension = Base::codimension;
230 static const int quadPointSetId =
236 static const int pointSetId = (quadPointSetId > 0) ? quadPointSetId :
249 using Base::localFaceIndex;
250 using Base::elementGeometry;
268 :
Base( getPointList( intersection, quadKey, side ) ),
269 twist_( getTwist( gridPart, intersection, side ) ),
270 mapper_(
CacheProviderType::getMapper( quadImp(), elementGeometry(), localFaceIndex(), twist_) ),
271 points_(
PointProviderType::getPoints( quadImp().ipList().id(), elementGeometry() ) )
287 return points_[ cachingPoint( i ) ];
294 inline int twistId ()
const {
return twist_ + 4; }
299 assert( quadraturePoint < (
size_t)nop() );
300 return mapper_.first[ quadraturePoint ];
306 assert( quadraturePoint < mapper_.second.size() );
307 return mapper_.second[ quadraturePoint ];
315 return (pointSetId < 0) ? false :
316 quadImp().ipList().isFaceInterpolationQuadrature( numShapeFunctions );
323 const auto& mapper = mapper_.first;
325 assert( i < (
size_t)nop() );
327 assert( mapper[ i ] >= 0 );
328 int faceIndex = localFaceIndex();
329 unsigned int point = mapper[ i ] - faceIndex * mapper.size();
330 assert( point < nop() );
338 const typename Base :: Side side )
343 return Base( TwistUtilityType::elementGeometry( intersection,
true ),
344 intersection.indexInInside(), key );
346 case Base :: OUTSIDE:
347 return Base( TwistUtilityType::elementGeometry( intersection,
false ),
348 intersection.indexInOutside(), key );
351 DUNE_THROW( InvalidStateException,
"ElementIntegrationPointList: side must either be INSIDE or OUTSIDE." );
357 const typename Base :: Side side )
362 return TwistUtilityType::twistInSelf( gridPart.grid(), intersection );
364 case Base :: OUTSIDE:
365 return TwistUtilityType::twistInNeighbor( gridPart.grid(), intersection );
368 DUNE_THROW( InvalidStateException,
"ElementIntegrationPointList: side must either be INSIDE or OUTSIDE." );
374 const MapperPairType &mapper_;
375 const PointVectorType &points_;
Definition: bindguard.hh:11
detail::SelectPointSetId< Quadrature, -Dune::QuadratureType::size > SelectQuadraturePointSetId
Definition: quadrature.hh:541
Definition: cacheprovider.hh:157
std::pair< MapperType, MapperType > MapperPairType
Definition: pointmapper.hh:59
std::vector< PointType > PointVectorType
Definition: pointmapper.hh:57
Definition: pointprovider.hh:24
interface a cachable quadrature has to implement
Definition: cachingpointlist.hh:23
size_t interpolationPoint(const size_t quadraturePoint) const
map quadrature points to interpolation points
Definition: cachingpointlist.hh:58
CachingInterface()
Definition: cachingpointlist.hh:26
bool isInterpolationQuadrature(const size_t numShapeFunctions) const
check if quadrature is interpolation quadrature
Definition: cachingpointlist.hh:70
size_t cachingPoint(const size_t quadraturePoint) const
map quadrature points to caching points
Definition: cachingpointlist.hh:47
int twistId() const
returns the twistId, i.e. [0,...,7]
Definition: cachingpointlist.hh:35
bool twisted() const
returns true if cachingPoint is not the identity mapping
Definition: cachingpointlist.hh:32
integration point list supporting base function caching
Definition: cachingpointlist.hh:103
Definition: cachingpointlist.hh:112
const CoordinateType & point(const size_t i) const
obtain coordinates of i-th integration point
Definition: cachingpointlist.hh:161
QuadraturePointWrapper< This > QuadraturePointWrapperType
the type of the quadrature point
Definition: cachingpointlist.hh:127
size_t cachingPoint(const size_t quadraturePoint) const
map quadrature points to caching points
Definition: cachingpointlist.hh:167
size_t interpolationPoint(const size_t quadraturePoint) const
map quadrature points to interpolation points
Definition: cachingpointlist.hh:173
Base::GridPartType GridPartType
Definition: cachingpointlist.hh:117
bool isInterpolationQuadrature(const size_t numShapeFunctions) const
check if quadrature is interpolation quadrature
Definition: cachingpointlist.hh:179
Base::CoordinateType CoordinateType
The type of the coordinates in the codim-0 reference element.
Definition: cachingpointlist.hh:121
IteratorType end() const noexcept
Definition: cachingpointlist.hh:158
IteratorType begin() const noexcept
Definition: cachingpointlist.hh:157
QuadraturePointIterator< This > IteratorType
type of iterator
Definition: cachingpointlist.hh:129
CachingPointList(const GeometryType &geometry, const QuadratureKeyType &quadKey)
Definition: cachingpointlist.hh:146
Base::QuadratureKeyType QuadratureKeyType
type of quadrature identifier on user side (default is the order of quadrature)
Definition: cachingpointlist.hh:124
constructor
Definition: cachingpointlist.hh:194
const CoordinateType & point(const size_t i) const
obtain coordinates of i-th integration point
Definition: cachingpointlist.hh:285
IteratorType begin() const noexcept
Definition: cachingpointlist.hh:280
PointProvider< RealType, dimension, codimension > PointProviderType
Definition: cachingpointlist.hh:244
QuadraturePointIterator< This > IteratorType
type of iterator
Definition: cachingpointlist.hh:218
GridPartImp GridPartType
type of the grid partition
Definition: cachingpointlist.hh:200
Base::CoordinateType CoordinateType
Type of coordinates in codim-0 reference element.
Definition: cachingpointlist.hh:207
IteratorType end() const noexcept
Definition: cachingpointlist.hh:281
Base getPointList(const IntersectionType &intersection, const QuadratureKeyType &key, const typename Base ::Side side)
Definition: cachingpointlist.hh:336
Base::RealType RealType
Definition: cachingpointlist.hh:202
ElementIntegrationPointList< GridPartType, codimension, IntegrationTraits > NonConformingQuadratureType
type of quadrature used for non-conforming intersections
Definition: cachingpointlist.hh:222
Base::QuadratureKeyType QuadratureKeyType
type of quadrature identifier on user side (default is the order of quadrature)
Definition: cachingpointlist.hh:210
IntersectionIteratorType IntersectionIterator
Definition: cachingpointlist.hh:227
QuadraturePointWrapper< This > QuadraturePointWrapperType
Definition: cachingpointlist.hh:216
CacheProvider< GridPartType, codimension > CacheProviderType
Definition: cachingpointlist.hh:243
IntersectionIteratorType::Intersection IntersectionType
Definition: cachingpointlist.hh:214
CachingTraits< RealType, dimension >::PointVectorType PointVectorType
Definition: cachingpointlist.hh:241
CachingPointList(const GridPartType &gridPart, const IntersectionType &intersection, const QuadratureKeyType &quadKey, const typename Base ::Side side)
constructor
Definition: cachingpointlist.hh:265
bool isInterpolationQuadrature(const size_t numShapeFunctions) const
check if quadrature is interpolation quadrature
Definition: cachingpointlist.hh:311
int getTwist(const GridPartType &gridPart, const IntersectionType &intersection, const typename Base ::Side side)
Definition: cachingpointlist.hh:355
int twistId() const
returns the twistId, i.e. [0,...,7]
Definition: cachingpointlist.hh:294
CachingTraits< RealType, dimension >::MapperPairType MapperPairType
Definition: cachingpointlist.hh:240
bool twisted() const
returns true if cachingPoint is not the identity mapping
Definition: cachingpointlist.hh:291
size_t cachingPoint(const size_t quadraturePoint) const
map quadrature points to caching points
Definition: cachingpointlist.hh:297
size_t localCachingPoint(const size_t i) const
Definition: cachingpointlist.hh:321
size_t interpolationPoint(const size_t quadraturePoint) const
map quadrature points to interpolation points
Definition: cachingpointlist.hh:304
GridPartType::IntersectionIteratorType IntersectionIteratorType
Type of the intersection iterator.
Definition: cachingpointlist.hh:213
GridPartType::TwistUtilityType TwistUtilityType
Definition: cachingpointlist.hh:226
integration point list on the codim-0 reference element
Definition: elementpointlist.hh:49
ElementPointListBase.
Definition: elementpointlistbase.hh:189
IntegrationTraits::CoordinateType CoordinateType
Definition: elementpointlistbase.hh:211
IntegrationPointListType::QuadratureKeyType QuadratureKeyType
Definition: elementpointlistbase.hh:214
GridPartType::ctype RealType
coordinate type
Definition: elementpointlistbase.hh:203
Definition: elementpointlistbase.hh:23
GridPartImp GridPartType
type of the grid partition
Definition: elementpointlistbase.hh:28
IntegrationPointListType::QuadratureKeyType QuadratureKeyType
Definition: elementpointlistbase.hh:48
IntegrationTraits::CoordinateType CoordinateType
Definition: elementpointlistbase.hh:45
wrapper for a (Quadrature,int) pair
Definition: quadrature.hh:43
iterator over quadrature points
Definition: quadrature.hh:106