dune-fem 2.8.0
Loading...
Searching...
No Matches
pointprovider.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_POINTPROVIDER_HH
2#define DUNE_FEM_POINTPROVIDER_HH
3
4//- System includes
5#include <vector>
6#include <map>
7
8//- Dune includes
9#include <dune/common/math.hh>
10
12
13//- Local includes
14#include "pointmapper.hh"
15
16namespace Dune
17{
18
19 namespace Fem
20 {
21
22 template< class ct, int dim, int codim >
24 {
25 static_assert( (codim >= 0) && (codim <= 1),
26 "PointProvider exists only for codimension 0 and 1." );
27 };
28
29 template <class ct, int dim>
30 class PointProvider<ct, dim, 0>
31 {
33
35
36 public:
40
41 public:
42 inline
43 static void registerQuadrature(const QuadratureType& quad);
44
45 inline
46 static const GlobalPointVectorType& getPoints(const size_t id,
47 const GeometryType& elementGeo);
48
49 private:
50 typedef std::map<const QuadratureKeyType, GlobalPointVectorType> PointContainerType;
51 typedef typename PointContainerType::iterator PointIteratorType;
52
53 // points container holding quadrature points
54 PointContainerType points_;
55
56 static PointContainerType& points()
57 {
58 return instance().points_;
59 }
60
61 static ThisType& instance()
62 {
64 }
65 };
66
67 // * Add elemGeo later
68 template <class ct, int dim>
69 class PointProvider<ct, dim, 1>
70 {
72
73 enum { codim = 1 };
74 typedef CachingTraits<ct, dim-codim> Traits;
75
76 public:
82 typedef FieldVector<ct, dim> GlobalPointType;
83 typedef std::vector<GlobalPointType> GlobalPointVectorType;
85 typedef std::pair< MapperVectorType, MapperVectorType > MapperVectorPairType;
86
87 public:
88 inline
89 static const MapperVectorPairType& getMappers(const QuadratureType& quad,
90 const GeometryType& elementGeo);
91 // Access for non-symmetric quadratures
92 inline
93 static const MapperVectorPairType& getMappers(const QuadratureType& quad,
94 const LocalPointVectorType& pts,
95 const GeometryType& elementGeo);
96 inline
97 static const GlobalPointVectorType& getPoints(const size_t id,
98 const GeometryType& elementGeo);
99
100 private:
101 typedef std::map<const QuadratureKeyType, GlobalPointVectorType> PointContainerType;
102 typedef std::map<const QuadratureKeyType, MapperVectorPairType > MapperContainerType;
103
104 typedef typename PointContainerType::iterator PointIteratorType;
105 typedef typename MapperContainerType::iterator MapperIteratorType;
106
107 private:
108 inline
109 static MapperIteratorType addEntry(const QuadratureType& quad,
110 const LocalPointVectorType& pts,
111 GeometryType elementGeo);
112
113 private:
114 // points container holding quadrature points
115 PointContainerType points_;
116 // mapper container holding mapping info
117 MapperContainerType mappers_;
118
119 static PointContainerType& points() { return instance().points_; }
120 static MapperContainerType& mappers() { return instance().mappers_; }
121
122 static ThisType& instance()
123 {
124 return Singleton< ThisType > :: instance();
125 }
126 };
127
128 } // namespace Fem
129
130} // namespace Dune
131
132#include "pointprovider.cc"
133
134#endif // #ifndef DUNE_FEM_POINTPROVIDER_HH
Definition: bindguard.hh:11
Definition: pointmapper.hh:18
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
Definition: pointprovider.hh:24
Definition: pointprovider.hh:31
Traits::PointVectorType GlobalPointVectorType
Definition: pointprovider.hh:38
Traits::QuadratureType QuadratureType
Definition: pointprovider.hh:37
Traits::QuadratureKeyType QuadratureKeyType
Definition: pointprovider.hh:39
Definition: pointprovider.hh:70
std::pair< MapperVectorType, MapperVectorType > MapperVectorPairType
Definition: pointprovider.hh:85
FieldVector< ct, dim > GlobalPointType
Definition: pointprovider.hh:82
Traits::QuadratureKeyType QuadratureKeyType
Definition: pointprovider.hh:84
Traits::PointType LocalPointType
Definition: pointprovider.hh:78
Traits::QuadratureType QuadratureType
Definition: pointprovider.hh:77
Traits::MapperType MapperType
Definition: pointprovider.hh:80
Traits::PointVectorType LocalPointVectorType
Definition: pointprovider.hh:79
Traits::MapperVectorType MapperVectorType
Definition: pointprovider.hh:81
std::vector< GlobalPointType > GlobalPointVectorType
Definition: pointprovider.hh:83
return singleton instance of given Object type.
Definition: singleton.hh:88