dune-geometry  2.3beta2
geometrytraits.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_GEOMETRY_GENERICGEOMETRY_GEOMETRYTRAITS_HH
4 #define DUNE_GEOMETRY_GENERICGEOMETRY_GEOMETRYTRAITS_HH
5 
6 #include "../type.hh"
7 #include "matrixhelper.hh"
8 #include "cornermapping.hh"
9 
10 namespace Dune
11 {
12  namespace GenericGeometry
13  {
14 
15  // DuneCoordTraits
16  // ---------------
17 
18  template< class ct >
20  {
21  typedef ct ctype;
22 
23  template< int dim >
24  struct Vector
25  {
26  typedef FieldVector< ctype, dim > type;
27  };
28 
29  template< int rows, int cols >
30  struct Matrix
31  {
32  typedef FieldMatrix< ctype, rows, cols > type;
33  };
34 
35  // This limit is, e.g., used in the termination criterion of the Newton
36  // scheme within the generic implementation of the method local
37  static const ctype epsilon ()
38  {
39  return 1e-6;
40  }
41  };
42 
43 
44 
45  // MappingTraits
46  // -------------
51  template< class CT, unsigned int dim, unsigned int dimW >
53  {
54  typedef CT CoordTraits;
55 
56  static const unsigned int dimension = dim;
57  static const unsigned int dimWorld = dimW;
58 
59  typedef typename CoordTraits :: ctype FieldType;
60  typedef typename CoordTraits :: template Vector< dimension > :: type LocalCoordinate;
61  typedef typename CoordTraits :: template Vector< dimWorld > :: type GlobalCoordinate;
62 
63  typedef typename CoordTraits :: template Matrix< dimWorld, dimension > :: type
65  typedef typename CoordTraits :: template Matrix< dimension, dimWorld > :: type
67 
69  };
70 
71 
72 
77  {
82  };
83 
84 
85 
86  // DefaultGeometryTraits
87  // ---------------------
88 
112  template< class ctype, int dimG, int dimW, bool alwaysAffine = false >
114  {
117 
119  static const int dimWorld = dimW;
120 
139  template< int dim >
141  {
142  static const bool v = false;
143  static const unsigned int topologyId = ~0u;
144  };
145 
157  template< class Topology >
158  struct Mapping
159  {
162  };
163 
175  struct Caching
176  {
180  };
181 
187  struct UserData {};
188  };
189 
190 
191 
243  template< class Grid >
244  struct GlobalGeometryTraits;
245 
246  template< class Grid >
247  struct GlobalGeometryTraits< const Grid >
248  : public GlobalGeometryTraits< Grid >
249  {};
250 
251 
252 
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