dune-geometry  2.2.0
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 >
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 
78  // If not affine only volume is cached (based on intElCompute)
79  // otherwise all quantities can be cached using:
80  // ComputeOnDemand: assign if method called using barycenter
81  // PreCompute: assign in constructor using barycenter
83  {
88  };
89 
90 
91 
92  // DefaultGeometryTraits
93  // ---------------------
94 
112  template< class ctype, int dimG, int dimW, bool alwaysAffine = false >
114  {
117 
119  static const int dimGrid = dimG;
121  static const int dimWorld = dimW;
122 
142  static const bool hybrid = true;
143 
155  template< class Topology >
156  struct Mapping
157  {
160  };
161 
173  struct Caching
174  {
178  };
179 
185  struct UserData {};
186  };
187 
188 
189 
242  template< class Grid >
243  struct GlobalGeometryTraits;
244 
245  template< class Grid >
246  struct GlobalGeometryTraits< const Grid >
247  : public GlobalGeometryTraits< Grid >
248  {};
249 
250 
251 
304  template< class Grid >
305  struct LocalGeometryTraits;
306 
307  template< class Grid >
308  struct LocalGeometryTraits< const Grid >
309  : public LocalGeometryTraits< Grid >
310  {};
311  }
312 
313 }
314 
315 #endif // #ifndef DUNE_GEOMETRY_GENERICGEOMETRY_GEOMETRYTRAITS_HH