dune-fem 2.8-git
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
34 public:
38
39 public:
40 inline
41 static void registerQuadrature(const QuadratureType& quad);
42
43 inline
44 static const GlobalPointVectorType& getPoints(const size_t id,
45 const GeometryType& elementGeo);
46
47 private:
48 typedef std::map<const QuadratureKeyType, GlobalPointVectorType> PointContainerType;
49 typedef typename PointContainerType::iterator PointIteratorType;
50
51 private:
52 static PointContainerType& points()
53 {
55 }
56 };
57
58 // * Add elemGeo later
59 template <class ct, int dim>
60 class PointProvider<ct, dim, 1>
61 {
62 enum { codim = 1 };
63 typedef CachingTraits<ct, dim-codim> Traits;
64
65 public:
71 typedef FieldVector<ct, dim> GlobalPointType;
72 typedef std::vector<GlobalPointType> GlobalPointVectorType;
74 typedef std::pair< MapperVectorType, MapperVectorType > MapperVectorPairType;
75
76 public:
77 inline
78 static const MapperVectorPairType& getMappers(const QuadratureType& quad,
79 const GeometryType& elementGeo);
80 // Access for non-symmetric quadratures
81 inline
82 static const MapperVectorPairType& getMappers(const QuadratureType& quad,
83 const LocalPointVectorType& pts,
84 const GeometryType& elementGeo);
85 inline
86 static const GlobalPointVectorType& getPoints(const size_t id,
87 const GeometryType& elementGeo);
88
89 private:
90 typedef std::map<const QuadratureKeyType, GlobalPointVectorType> PointContainerType;
91 typedef std::map<const QuadratureKeyType, MapperVectorPairType > MapperContainerType;
92
93 typedef typename PointContainerType::iterator PointIteratorType;
94 typedef typename MapperContainerType::iterator MapperIteratorType;
95
96 private:
97 inline
98 static MapperIteratorType addEntry(const QuadratureType& quad,
99 const LocalPointVectorType& pts,
100 GeometryType elementGeo);
101
102 private:
103 static PointContainerType& points()
104 {
106 }
107
108 static MapperContainerType& mappers()
109 {
111 }
112 };
113
114 } // namespace Fem
115
116} // namespace Dune
117
118#include "pointprovider.cc"
119
120#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
Traits::PointVectorType GlobalPointVectorType
Definition: pointprovider.hh:36
Traits::QuadratureType QuadratureType
Definition: pointprovider.hh:35
Traits::QuadratureKeyType QuadratureKeyType
Definition: pointprovider.hh:37
std::pair< MapperVectorType, MapperVectorType > MapperVectorPairType
Definition: pointprovider.hh:74
FieldVector< ct, dim > GlobalPointType
Definition: pointprovider.hh:71
Traits::QuadratureKeyType QuadratureKeyType
Definition: pointprovider.hh:73
Traits::PointType LocalPointType
Definition: pointprovider.hh:67
Traits::QuadratureType QuadratureType
Definition: pointprovider.hh:66
Traits::MapperType MapperType
Definition: pointprovider.hh:69
Traits::PointVectorType LocalPointVectorType
Definition: pointprovider.hh:68
Traits::MapperVectorType MapperVectorType
Definition: pointprovider.hh:70
std::vector< GlobalPointType > GlobalPointVectorType
Definition: pointprovider.hh:72
static Object & instance(Args &&... args)
return singleton instance of given Object type.
Definition: singleton.hh:101