dune-fem  2.4.1-rc
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 
11 namespace 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>
52  struct CachingTraits {
57  typedef std::vector<PointType> PointVectorType;
58  typedef std::vector<size_t> MapperType;
59  typedef std::vector<MapperType> MapperVectorType;
60 
62 
63  // minimal twist is -4 for hexahedrons
64  // so we add 4 to start from zero
65  enum { twistOffset_ = 4 };
66 
67  };
68 
69  } // namespace Fem
70 
71 } // namespace Dune
72 
73 #endif // #ifndef DUNE_FEM_POINTMAPPER_HH
bool operator==(const QuadratureKey &other) const
Definition: pointmapper.hh:30
std::vector< size_t > MapperType
Definition: pointmapper.hh:58
FieldVector< FieldType, dim > CoordinateType
type of local coordinates
Definition: quadratureimp.hh:43
static unsigned int topologyId(const GeometryType &type)
Definition: pointmapper.hh:41
IntegrationPointListImp< ct, dim > QuadratureType
type of integration point list implementation, fix type here
Definition: pointmapper.hh:54
Definition: pointmapper.hh:52
Definition: pointmapper.hh:17
QuadratureKey(const GeometryType &geoType, const size_t id)
Definition: pointmapper.hh:19
Definition: coordinate.hh:4
bool operator<(const QuadratureKey &other) const
Definition: pointmapper.hh:25
QuadratureKey QuadratureKeyType
Definition: pointmapper.hh:61
const size_t id_
Definition: pointmapper.hh:46
QuadratureType::CoordinateType PointType
extracted types from integration point list
Definition: pointmapper.hh:56
friend std::ostream & operator<<(std::ostream &out, const QuadratureKey &key)
Definition: pointmapper.hh:35
std::vector< PointType > PointVectorType
Definition: pointmapper.hh:57
std::vector< MapperType > MapperVectorType
Definition: pointmapper.hh:59