dune-geometry  2.2.1
geometrytraits.hh
Go to the documentation of this file.
1 #ifndef DUNE_GEOMETRY_GENERICGEOMETRY_GEOMETRYTRAITS_HH
2 #define DUNE_GEOMETRY_GENERICGEOMETRY_GEOMETRYTRAITS_HH
3 
4 #include "../type.hh"
5 #include "matrixhelper.hh"
6 #include "cornermapping.hh"
7 
8 namespace Dune
9 {
10  namespace GenericGeometry
11  {
12 
13  // DuneCoordTraits
14  // ---------------
15 
16  template< class ct >
18  {
19  typedef ct ctype;
20 
21  template< int dim >
22  struct Vector
23  {
24  typedef FieldVector< ctype, dim > type;
25  };
26 
27  template< int rows, int cols >
28  struct Matrix
29  {
30  typedef FieldMatrix< ctype, rows, cols > type;
31  };
32 
33  // This limit is, e.g., used in the termination criterion of the Newton
34  // scheme within the generic implementation of the method local
35  static const ctype epsilon ()
36  {
37  return 1e-6;
38  }
39  };
40 
41 
42 
43  // MappingTraits
44  // -------------
49  template< class CT, unsigned int dim, unsigned int dimW >
50  struct MappingTraits
51  {
52  typedef CT CoordTraits;
53 
54  static const unsigned int dimension = dim;
55  static const unsigned int dimWorld = dimW;
56 
57  typedef typename CoordTraits :: ctype FieldType;
58  typedef typename CoordTraits :: template Vector< dimension > :: type LocalCoordinate;
59  typedef typename CoordTraits :: template Vector< dimWorld > :: type GlobalCoordinate;
60 
61  typedef typename CoordTraits :: template Matrix< dimWorld, dimension > :: type
63  typedef typename CoordTraits :: template Matrix< dimension, dimWorld > :: type
65 
67 
68  template< unsigned int codim >
69  struct Codim
70  {
73  };
74  };
75 
76 
77 
82  {
87  };
88 
89 
90 
91  // DefaultGeometryTraits
92  // ---------------------
93 
111  template< class ctype, int dimG, int dimW, bool alwaysAffine = false >
113  {
116 
118  static const int dimGrid = dimG;
120  static const int dimWorld = dimW;
121 
141  static const bool hybrid = true;
142 
154  template< class Topology >
155  struct Mapping
156  {
159  };
160 
172  struct Caching
173  {
177  };
178 
184  struct UserData {};
185  };
186 
187 
188 
241  template< class Grid >
243 
244  template< class Grid >
245  struct GlobalGeometryTraits< const Grid >
246  : public GlobalGeometryTraits< Grid >
247  {};
248 
249 
250 
303  template< class Grid >
305 
306  template< class Grid >
307  struct LocalGeometryTraits< const Grid >
308  : public LocalGeometryTraits< Grid >
309  {};
310  }
311 
312 }
313 
314 #endif // #ifndef DUNE_GEOMETRY_GENERICGEOMETRY_GEOMETRYTRAITS_HH