dune-fem  2.4.1-rc
mapper.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_PADAPTIVE_MAPPER_HH
2 #define DUNE_FEM_SPACE_PADAPTIVE_MAPPER_HH
3 
4 #include <dune/common/exceptions.hh>
5 
6 #include <dune/geometry/type.hh>
7 #include <dune/geometry/typeindex.hh>
8 
9 #include <dune/grid/utility/persistentcontainer.hh>
10 
12 #include <dune/fem/misc/metaprogramming.hh>
19 
20 
21 namespace Dune
22 {
23 
24  namespace Fem
25  {
26 
27  // Internal forward declaration
28  // ----------------------------
29  template< class GridPart, int polOrder >
31 
32 
33 
34  // PAdaptiveLagrangeMapperTraits
35  // -----------------------------
36 
37  template< class GridPart, int polOrder >
39  {
40  typedef GridPart GridPartType;
41 
42  static const int polynomialOrder = polOrder;
43  // if this is set to true the mapper behaves like a DG mapper
44  static const bool discontinuousMapper = false;
45 
46  typedef typename GridPartType::template Codim< 0 >::EntityType ElementType;
48 
52 
53  typedef std::vector< BaseSetLocalKeyStorageType > CompiledLocalKeyVectorType ;
54 
55  typedef int SizeType ;
56  typedef int GlobalKeyType ;
57  };
58 
59 
60 
61  // First Order Lagrange Mapper
62  // ---------------------------
63 
64 #if 0
65  template< class GridPart >
66  class PAdaptiveLagrangeMapper< GridPart, 1 >
67  : public CodimensionMapper< GridPart, GridPart::GridType::dimension >
68  {
71 
72  public:
74  typedef typename BaseType::GridPartType GridPartType;
75 
77  typedef typename BaseType::ElementType ElementType;
78 
80  typedef typename GridPartType::GridType GridType;
81 
83  typedef typename GridType::ctype FieldType;
84 
86  static const int dimension = GridType::dimension;
87 
89  static const int polynomialOrder = 1;
90 
91  // my traits class
93 
94  typedef typename Traits :: CompiledLocalKeyVectorType CompiledLocalKeyVectorType;
95 
96  public:
98  PAdaptiveLagrangeMapper ( const GridPartType &gridPart, CompiledLocalKeyVectorType& )
99  : BaseType( gridPart )
100  {}
101 
102  bool fixedDataSize ( const int codim ) const
103  {
104  return true;
105  }
106 
107  int polynomOrder( const ElementType& entity ) const
108  {
109  return 1;
110  }
111 
112  void setPolynomOrder( const ElementType& entity, const int polOrd )
113  {
114  }
115 
116  void adapt() {}
117  };
118 #endif
119 
120 
121  // Higher Order Lagrange Mapper
122  // ----------------------------
123 
124  template< class GridPart, int polOrder >
126  : public GenericAdaptiveDofMapper< PAdaptiveLagrangeMapperTraits< GridPart, polOrder > >
127  {
128  public:
129  // my traits class
131 
132  private:
135 
136  public:
139 
142 
143  public:
145  PAdaptiveLagrangeMapper ( const GridPartType &gridPart,
146  CompiledLocalKeyVectorType &compiledLocalKeys )
147  : BaseType( gridPart, compiledLocalKeys )
148  {
149  }
150 
152  PAdaptiveLagrangeMapper ( const ThisType& other,
153  CompiledLocalKeyVectorType &compiledLocalKeys )
154  : BaseType( other, compiledLocalKeys )
155  {}
156  };
157 
158  template< class GridPart, int polOrder >
160 
161  template< class GridPart, int polOrder >
163  : public PAdaptiveLagrangeMapperTraits< GridPart, polOrder >
164  {
165  // this is a mapper for DG
166  static const bool discontinuousMapper = true ;
167 
168  typedef typename GridPart::template Codim< 0 >::EntityType ElementType;
170  typedef int SizeType ;
171  typedef int GlobalKeyType ;
172  };
173 
174 
175  // Higher Order Adaptive DG Mapper
176  // -------------------------------
177 
178  template< class GridPart, int polOrder >
179  class PAdaptiveDGMapper
180  : public GenericAdaptiveDofMapper< PAdaptiveDGMapperTraits< GridPart, polOrder > >
181  {
182  public:
183  // my traits class
185 
186  private:
189 
190  public:
192  typedef typename Traits::GridPartType GridPartType;
193 
195  typedef typename Traits :: CompiledLocalKeyVectorType CompiledLocalKeyVectorType;
196 
197  public:
199  PAdaptiveDGMapper ( const GridPartType &gridPart,
200  CompiledLocalKeyVectorType &compiledLocalKeys )
201  : BaseType( gridPart, compiledLocalKeys )
202  {}
203 
205  PAdaptiveDGMapper ( const ThisType& other,
206  CompiledLocalKeyVectorType &compiledLocalKeys )
207  : BaseType( other, compiledLocalKeys )
208  {}
209  };
210 
211  } // namespace Fem
212 
213 } // namespace Dune
214 
215 #endif // #ifndef DUNE_FEM_SPACE_PADAPTIVE_MAPPER_HH
PAdaptiveDGMapperTraits< GridPart, polOrder > Traits
Definition: mapper.hh:184
PAdaptiveDGMapper(const ThisType &other, CompiledLocalKeyVectorType &compiledLocalKeys)
sort of copy constructor
Definition: mapper.hh:205
PAdaptiveLagrangeMapper(const GridPartType &gridPart, CompiledLocalKeyVectorType &compiledLocalKeys)
constructor
Definition: mapper.hh:145
std::vector< BaseSetLocalKeyStorageType > CompiledLocalKeyVectorType
Definition: mapper.hh:53
int SizeType
Definition: mapper.hh:170
Traits::GridPartType GridPartType
type of the grid part
Definition: mapper.hh:138
Traits::CompiledLocalKeyVectorType CompiledLocalKeyVectorType
type of compiled local keys vector
Definition: mapper.hh:195
Definition: genericadaptivedofmapper.hh:29
PAdaptiveDGMapper(const GridPartType &gridPart, CompiledLocalKeyVectorType &compiledLocalKeys)
constructor
Definition: mapper.hh:199
int GlobalKeyType
Definition: mapper.hh:171
Definition: mapper.hh:30
mapper allocating one DoF per subentity of a given codimension
Definition: codimensionmapper.hh:28
Definition: mapper.hh:162
GridPart GridPartType
Definition: mapper.hh:40
PAdaptiveLagrangeMapperTraits< GridPart, polOrder > Traits
Definition: mapper.hh:130
Definition: coordinate.hh:4
GridPartType::template Codim< 0 >::EntityType ElementType
Definition: mapper.hh:46
BaseSetLocalKeyStorage< CompiledLocalKeyType > BaseSetLocalKeyStorageType
Definition: mapper.hh:51
LagrangePointSet< GridPartType, polynomialOrder > CompiledLocalKeyType
type of the compiled local key
Definition: mapper.hh:50
Traits::GridPartType GridPartType
type of the grid part
Definition: mapper.hh:192
static const int polynomialOrder
Definition: mapper.hh:42
Definition: mapper.hh:159
GridPart::template Codim< 0 >::EntityType ElementType
Definition: mapper.hh:168
int SizeType
Definition: mapper.hh:55
Traits::CompiledLocalKeyVectorType CompiledLocalKeyVectorType
type of compiled local keys vector
Definition: mapper.hh:141
PAdaptiveDGMapper< GridPart, polOrder > DofMapperType
Definition: mapper.hh:169
PAdaptiveLagrangeMapper< GridPartType, polynomialOrder > DofMapperType
Definition: mapper.hh:47
static const bool discontinuousMapper
Definition: mapper.hh:44
PAdaptiveLagrangeMapper(const ThisType &other, CompiledLocalKeyVectorType &compiledLocalKeys)
sort of copy constructor
Definition: mapper.hh:152
int GlobalKeyType
Definition: mapper.hh:56
Definition: lagrangepoints.hh:461
storage class for base function set pointer and compiled local key pointers
Definition: basesetlocalkeystorage.hh:27