dune-fem  2.4.1-rc
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 
11 //- Local includes
12 #include "pointmapper.hh"
13 
14 namespace Dune
15 {
16 
17  namespace Fem
18  {
19 
20  template< class ct, int dim, int codim >
22  {
23  static_assert( (codim >= 0) && (codim <= 1),
24  "PointProvider exists only for codimension 0 and 1." );
25  };
26 
27  template <class ct, int dim>
28  class PointProvider<ct, dim, 0>
29  {
31 
32  public:
36 
37  public:
38  inline
39  static void registerQuadrature(const QuadratureType& quad);
40 
41  inline
42  static const GlobalPointVectorType& getPoints(const size_t id,
43  const GeometryType& elementGeo);
44 
45  private:
46  typedef std::map<const QuadratureKeyType, GlobalPointVectorType> PointContainerType;
47  typedef typename PointContainerType::iterator PointIteratorType;
48 
49  private:
50  static PointContainerType points_;
51  };
52 
53  // * Add elemGeo later
54  template <class ct, int dim>
55  class PointProvider<ct, dim, 1>
56  {
57  enum { codim = 1 };
58  typedef CachingTraits<ct, dim-codim> Traits;
59 
60  public:
64  typedef typename Traits::MapperType MapperType;
66  typedef FieldVector<ct, dim> GlobalPointType;
67  typedef std::vector<GlobalPointType> GlobalPointVectorType;
69 
70  public:
71  inline
72  static const MapperVectorType& getMappers(const QuadratureType& quad,
73  const GeometryType& elementGeo);
74  // Access for non-symmetric quadratures
75  inline
76  static const MapperVectorType& getMappers(const QuadratureType& quad,
77  const LocalPointVectorType& pts,
78  const GeometryType& elementGeo);
79  inline
80  static const GlobalPointVectorType& getPoints(const size_t id,
81  const GeometryType& elementGeo);
82 
83  private:
84  typedef std::map<const QuadratureKeyType, GlobalPointVectorType> PointContainerType;
85  typedef std::map<const QuadratureKeyType, MapperVectorType> MapperContainerType;
86  typedef typename PointContainerType::iterator PointIteratorType;
87  typedef typename MapperContainerType::iterator MapperIteratorType;
88 
89  private:
90  inline
91  static MapperIteratorType addEntry(const QuadratureType& quad,
92  const LocalPointVectorType& pts,
93  GeometryType elementGeo);
94 
95  private:
96  static PointContainerType points_;
97  static MapperContainerType mappers_;
98  };
99 
100  } // namespace Fem
101 
102 } // namespace Dune
103 
104 #include "pointprovider.cc"
105 
106 #endif // #ifndef DUNE_FEM_POINTPROVIDER_HH
Traits::QuadratureType QuadratureType
Definition: pointprovider.hh:33
std::vector< GlobalPointType > GlobalPointVectorType
Definition: pointprovider.hh:67
std::vector< size_t > MapperType
Definition: pointmapper.hh:58
Traits::QuadratureKeyType QuadratureKeyType
Definition: pointprovider.hh:35
Traits::MapperVectorType MapperVectorType
Definition: pointprovider.hh:65
Definition: pointmapper.hh:52
Traits::MapperType MapperType
Definition: pointprovider.hh:64
Definition: pointmapper.hh:17
Traits::QuadratureKeyType QuadratureKeyType
Definition: pointprovider.hh:68
Definition: coordinate.hh:4
Traits::PointVectorType GlobalPointVectorType
Definition: pointprovider.hh:34
QuadratureType::CoordinateType PointType
extracted types from integration point list
Definition: pointmapper.hh:56
FieldVector< ct, dim > GlobalPointType
Definition: pointprovider.hh:66
std::vector< PointType > PointVectorType
Definition: pointmapper.hh:57
Traits::PointType LocalPointType
Definition: pointprovider.hh:62
Traits::QuadratureType QuadratureType
Definition: pointprovider.hh:61
Definition: pointprovider.hh:21
std::vector< MapperType > MapperVectorType
Definition: pointmapper.hh:59
Traits::PointVectorType LocalPointVectorType
Definition: pointprovider.hh:63