1#ifndef DUNE_FEM_POINTPROVIDER_HH
2#define DUNE_FEM_POINTPROVIDER_HH
7#include <unordered_map>
12#include <dune/fem/storage/singleton.hh>
15#include "pointmapper.hh"
23 template<
class ct,
int dim,
int codim >
26 static_assert( (codim >= 0) && (codim <= 1),
27 "PointProvider exists only for codimension 0 and 1." );
30 template <
class ct,
int dim>
31 class PointProvider<ct, dim, 0>
33 typedef PointProvider<ct, dim, 0> ThisType;
35 typedef CachingTraits<ct, dim> Traits;
38 typedef typename Traits::QuadratureType QuadratureType;
39 typedef typename Traits::PointVectorType GlobalPointVectorType;
40 typedef typename Traits::QuadratureKeyType QuadratureKeyType;
44 static void registerQuadrature(
const QuadratureType& quad);
47 static const GlobalPointVectorType& getPoints(
const size_t id,
48 const GeometryType& elementGeo);
51 typedef std::unordered_map<QuadratureKeyType, GlobalPointVectorType> PointContainerType;
52 typedef typename PointContainerType::iterator PointIteratorType;
55 PointContainerType points_;
57 static PointContainerType& points()
59 return instance().points_;
62 static ThisType& instance()
69 template <
class ct,
int dim>
70 class PointProvider<ct, dim, 1>
72 typedef PointProvider<ct, dim, 1> ThisType;
75 typedef CachingTraits<ct, dim-codim> Traits;
78 typedef typename Traits::QuadratureType QuadratureType;
79 typedef typename Traits::PointType LocalPointType;
80 typedef typename Traits::PointVectorType LocalPointVectorType;
81 typedef typename Traits::MapperType MapperType;
82 typedef typename Traits::MapperVectorType MapperVectorType;
83 typedef FieldVector<ct, dim> GlobalPointType;
84 typedef std::vector<GlobalPointType> GlobalPointVectorType;
85 typedef typename Traits::QuadratureKeyType QuadratureKeyType;
86 typedef std::pair< MapperVectorType, MapperVectorType > MapperVectorPairType;
90 static const MapperVectorPairType& getMappers(
const QuadratureType& quad,
91 const GeometryType& elementGeo);
94 static const MapperVectorPairType& getMappers(
const QuadratureType& quad,
95 const LocalPointVectorType& pts,
96 const GeometryType& elementGeo);
98 static const GlobalPointVectorType& getPoints(
const size_t id,
99 const GeometryType& elementGeo);
102 typedef std::map<const QuadratureKeyType, GlobalPointVectorType> PointContainerType;
103 typedef std::map<const QuadratureKeyType, MapperVectorPairType > MapperContainerType;
105 typedef typename PointContainerType::iterator PointIteratorType;
106 typedef typename MapperContainerType::iterator MapperIteratorType;
110 static MapperIteratorType addEntry(
const QuadratureType& quad,
111 const LocalPointVectorType& pts,
112 GeometryType elementGeo);
116 PointContainerType points_;
118 MapperContainerType mappers_;
120 static PointContainerType& points() {
return instance().points_; }
121 static MapperContainerType& mappers() {
return instance().mappers_; }
123 static ThisType& instance()
133#include "pointprovider.cc"
static DUNE_EXPORT Object & instance(Args &&... args)
return singleton instance of given Object type.
Definition: singleton.hh:123
Some useful basic math stuff.
Dune namespace.
Definition: alignedallocator.hh:13