dune-fem 2.8.0
Loading...
Searching...
No Matches
pointmapper.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_POINTMAPPER_HH
2#define DUNE_FEM_POINTMAPPER_HH
3
4//- system includes
5#include <vector>
6
7//- Dune includes
8#include <dune/common/version.hh>
10
11namespace Dune
12{
13
14 namespace Fem
15 {
16
18 {
19 QuadratureKey ( const GeometryType &geoType, const size_t id )
20 : id_( ((topologyId( geoType ) >> 1) << 16) + id )
21 {
22 assert( id < (1 << 16) );
23 }
24
25 bool operator< ( const QuadratureKey &other ) const
26 {
27 return (id_ < other.id_);
28 }
29
30 bool operator== ( const QuadratureKey &other ) const
31 {
32 return (id_ == other.id_);
33 }
34
35 friend std::ostream &operator<< ( std::ostream &out, const QuadratureKey &key )
36 {
37 return out << "(topologyId " << ((key.id_ >> 16) << 1) << ", quadId " << (key.id_ & ((1u << 16)-1)) << ")";
38 }
39
40 protected:
41 static unsigned int topologyId ( const GeometryType &type )
42 {
43 return type.id();
44 }
45
46 const size_t id_;
47 };
48
49
50
51 template <class ct, int dim>
57 typedef std::vector<PointType> PointVectorType;
58 typedef std::vector<size_t> MapperType;
59 typedef std::pair< MapperType, MapperType > MapperPairType;
60 typedef std::vector<MapperType> MapperVectorType;
61
63
64 // minimal twist is -4 for hexahedrons
65 // so we add 4 to start from zero
66 enum { twistOffset_ = 4 };
67
68 };
69
70 } // namespace Fem
71
72} // namespace Dune
73
74#endif // #ifndef DUNE_FEM_POINTMAPPER_HH
Definition: bindguard.hh:11
Definition: pointmapper.hh:18
QuadratureKey(const GeometryType &geoType, const size_t id)
Definition: pointmapper.hh:19
static unsigned int topologyId(const GeometryType &type)
Definition: pointmapper.hh:41
friend std::ostream & operator<<(std::ostream &out, const QuadratureKey &key)
Definition: pointmapper.hh:35
bool operator<(const QuadratureKey &other) const
Definition: pointmapper.hh:25
const size_t id_
Definition: pointmapper.hh:46
bool operator==(const QuadratureKey &other) const
Definition: pointmapper.hh:30
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::pair< MapperType, MapperType > MapperPairType
Definition: pointmapper.hh:59
IntegrationPointListImp< ct, dim > QuadratureType
type of integration point list implementation, fix type here
Definition: pointmapper.hh:54
std::vector< size_t > MapperType
Definition: pointmapper.hh:58
@ twistOffset_
Definition: pointmapper.hh:66
QuadratureKey QuadratureKeyType
Definition: pointmapper.hh:62
std::vector< PointType > PointVectorType
Definition: pointmapper.hh:57
Generic implementation of an IntegrationPointList.
Definition: quadratureimp.hh:33
FieldVector< FieldType, dim > CoordinateType
type of local coordinates
Definition: quadratureimp.hh:46