1#ifndef DUNE_FEM_TWISTPROVIDER_HH
2#define DUNE_FEM_TWISTPROVIDER_HH
12#include <dune/geometry/referenceelements.hh>
29 template <
class ct,
int dim>
31 template <
class ct,
int dim>
32 class TwistMapperCreator;
33 template <
class ct,
int dim>
52 template <
class ct,
int dim>
90 MapperVectorType mappers_;
107 template <
class ct,
int dim>
124 typedef std::vector< const TwistStorageType* > MapperContainerType;
125 typedef typename MapperContainerType::iterator IteratorType;
129 class MapperContainer
132 MapperContainerType mappers_;
142 IteratorType endit = mappers_.end();
143 for(IteratorType it = mappers_.begin(); it != endit; ++it)
151 static MapperContainerType& instance()
153 return Singleton< MapperContainer > :: instance().mappers_;
164 template <
class ct,
int dim>
194 template <
class ct,
int dim>
217 return helper_->minTwist();
222 return helper_->maxTwist();
236 static const ct eps_;
246 template <
class ct,
int dim>
262 const auto &refElement = Dune::ReferenceElements< ct, dim >::cube();
264 assert( twist == 0 );
266 mat[ 0 ] = refElement.position( 0, dim );
278 template <
class ct,
int dim>
294 const auto &refElement = Dune::ReferenceElements< ct, dim >::cube();
296 assert( (twist == 0) || (twist == 1) );
298 mat[ twist ] = refElement.position( 0, dim );
299 mat[ 1-twist ] = refElement.position( 1, dim );
311 template <
class ct,
int dim>
327 typedef Dune::Fem::FaceTopologyMapping<tetra> FaceTopo;
329 const auto &refElement = Dune::ReferenceElements< ct, dim >::simplex();
331 MatrixType mat( ct( 0 ) );
332 for (
int idx = 0; idx < dim+1; ++idx)
333 mat[idx] = refElement.position( FaceTopo::twistedDuneIndex(idx, twist), dim);
345 template <
class ct,
int dim>
361 typedef Dune::Fem::FaceTopologyMapping<hexa> FaceTopo;
363 const auto &refElement = Dune::ReferenceElements< ct, dim >::cube();
365 MatrixType mat( ct( 0 ) );
366 for (
int idx = 0; idx < dim+1; ++idx)
367 mat[idx] = refElement.position( FaceTopo::twistedDuneIndex(idx, twist), dim);
Definition: bindguard.hh:11
Definition: pointmapper.hh:52
std::vector< MapperType > MapperVectorType
Definition: pointmapper.hh:60
QuadratureType::CoordinateType PointType
extracted types from integration point list
Definition: pointmapper.hh:56
std::vector< size_t > MapperType
Definition: pointmapper.hh:58
std::vector< PointType > PointVectorType
Definition: pointmapper.hh:57
Access point for PointMapper objects with twist information PointMapper objects get created once and ...
Definition: twistprovider.hh:109
Traits::QuadratureType QuadratureType
Generic quadrature type.
Definition: twistprovider.hh:113
TwistMapperCreator< ct, dim >::TwistStorageType TwistStorageType
Definition: twistprovider.hh:117
static const TwistStorageType & getTwistStorage(const QuadratureType &quad)
Delivers the PointMapper object for quadrature quad and twist twist.
Definition: twistprovider.cc:47
Helper class for TwistProvider which takes care of the creation process.
Definition: twistprovider.hh:196
~TwistMapperCreator()
Destructor.
Definition: twistprovider.cc:98
int maxTwist() const
Largest possible twist + 1 for the quadrature's geometry.
Definition: twistprovider.hh:221
const TwistStorageType * createStorage() const
Create the actual mapper for a given twist.
Definition: twistprovider.cc:105
FieldVector< ct, dim+1 > CoordinateType
Definition: twistprovider.hh:202
Traits::MapperType MapperType
Definition: twistprovider.hh:201
int minTwist() const
Lowest possible twist for the quadrature's geometry.
Definition: twistprovider.hh:216
Traits::QuadratureType QuadratureType
Definition: twistprovider.hh:199
TwistStorage< ct, dim > TwistStorageType
Definition: twistprovider.hh:203
Traits::PointType PointType
Definition: twistprovider.hh:200
Identifies quadrature points on faces with twists For a given quadrature type and a face with a given...
Definition: twistprovider.hh:54
Traits::PointVectorType PointVectorType
Definition: twistprovider.hh:58
Traits::MapperType MapperType
Definition: twistprovider.hh:59
void addMapper(const MapperType &mapper, int twist)
Add a new mapper for a given twist.
Definition: twistprovider.cc:16
int maxTwist() const
Maximal twist + 1.
Definition: twistprovider.hh:84
const MapperType & getMapper(int twist) const
Access to a mapper.
Definition: twistprovider.cc:33
size_t addPoint(const PointType &points)
Add a point (in the case of asymmetric quadratures)
Definition: twistprovider.cc:23
const PointVectorType & getPoints() const
Definition: twistprovider.cc:40
int minTwist() const
Minimal twist.
Definition: twistprovider.hh:81
Traits::PointType PointType
Definition: twistprovider.hh:57
This class factors out all geometry dependent stuff in a strategy class.
Definition: twistprovider.hh:166
int maxTwist() const
Definition: twistprovider.hh:181
TwistMapperStrategy(int minTwist, int maxTwist)
Definition: twistprovider.hh:170
virtual ~TwistMapperStrategy()=default
virtual desctructor because of virtual functions
virtual MatrixType buildTransformationMatrix(int twist) const =0
int minTwist() const
Definition: twistprovider.hh:180
FieldMatrix< ct, dim+1, dim > MatrixType
Definition: twistprovider.hh:167
Definition: twistprovider.hh:249
PointTwistMapperStrategy(GeometryType geo)
Definition: twistprovider.hh:254
virtual MatrixType buildTransformationMatrix(int twist) const
Definition: twistprovider.hh:260
Definition: twistprovider.hh:281
MatrixType buildTransformationMatrix(int twist) const override
Definition: twistprovider.hh:292
LineTwistMapperStrategy(GeometryType geo)
Definition: twistprovider.hh:286
Definition: twistprovider.hh:314
virtual MatrixType buildTransformationMatrix(int twist) const override
Definition: twistprovider.hh:325
TriangleTwistMapperStrategy(GeometryType geo)
Definition: twistprovider.hh:319
Definition: twistprovider.hh:348
QuadrilateralTwistMapperStrategy(GeometryType geo)
Definition: twistprovider.hh:353
MatrixType buildTransformationMatrix(int twist) const override
Definition: twistprovider.hh:359
return singleton instance of given Object type.
Definition: singleton.hh:88