dune-grid  2.6-git
geometryreference.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_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH
4 #define DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH
5 
10 #include <dune/common/typetraits.hh>
11 
12 #include <dune/geometry/type.hh>
13 
15 
16 namespace Dune
17 {
18 
19  // GeometryReference
20  // -----------------
21 
22  template< class Implementation >
24  {
26 
27  public:
28  static const int mydimension = Implementation::mydimension;
29  static const int coorddimension = Implementation::coorddimension;
30 
31  typedef typename Implementation::ctype ctype;
32 
33  typedef typename Implementation::LocalCoordinate LocalCoordinate;
34  typedef typename Implementation::GlobalCoordinate GlobalCoordinate;
35 
36  typedef typename Implementation::JacobianInverseTransposed JacobianInverseTransposed;
37  typedef typename Implementation::JacobianTransposed JacobianTransposed;
38 
39  explicit GeometryReference ( const Implementation &impl )
40  : impl_( &impl )
41  {}
42 
43  GeometryType type () const { return impl().type(); }
44 
45  bool affine() const { return impl().affine(); }
46 
47  int corners () const { return impl().corners(); }
48  GlobalCoordinate corner ( int i ) const { return impl().corner( i ); }
49  GlobalCoordinate center () const { return impl().center(); }
50 
51  GlobalCoordinate global ( const LocalCoordinate &local ) const
52  {
53  return impl().global( local );
54  }
55 
56  LocalCoordinate local ( const GlobalCoordinate &global ) const
57  {
58  return impl().local( global );
59  }
60 
61  ctype integrationElement ( const LocalCoordinate &local ) const
62  {
63  return impl().integrationElement( local );
64  }
65 
66  ctype volume () const { return impl().volume(); }
67 
68  JacobianTransposed jacobianTransposed ( const LocalCoordinate &local ) const
69  {
70  return impl().jacobianTransposed( local );
71  }
72 
73  JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate &local ) const
74  {
75  return impl().jacobianInverseTransposed( local );
76  }
77 
78  const Implementation &impl () const { return *impl_; }
79 
80  private:
81  const Implementation *impl_;
82  };
83 
84 
85  // LocalGeometryReference
86  // -----------------------
87 
88  template< int mydim, int cdim, class Grid >
90  : public GeometryReference< typename std::remove_const< Grid >::type::Traits::template Codim< std::remove_const< Grid >::type::dimension - mydim >::LocalGeometryImpl >
91  {
92  typedef typename std::remove_const< Grid >::type::Traits::template Codim< std::remove_const< Grid >::type::dimension - mydim >::LocalGeometryImpl Implementation;
93 
94  public:
95  LocalGeometryReference ( const Implementation &impl )
96  : GeometryReference< Implementation >( impl )
97  {}
98  };
99 
100 
101 
102  // Definitions of GeometryReference
103  // --------------------------------
104 
105  template< class Implementation >
107 
108  template< class Implementation >
110 
111 } // namespace Dune
112 
113 #endif // #ifndef DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH
Implementation::JacobianTransposed JacobianTransposed
Definition: geometryreference.hh:37
Definition: geometryreference.hh:89
Implementation::GlobalCoordinate GlobalCoordinate
Definition: geometryreference.hh:34
static const int coorddimension
Definition: geometryreference.hh:29
GeometryType type() const
Definition: geometryreference.hh:43
ctype volume() const
Definition: geometryreference.hh:66
GlobalCoordinate global(const LocalCoordinate &local) const
Definition: geometryreference.hh:51
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
Definition: geometryreference.hh:73
GeometryReference(const Implementation &impl)
Definition: geometryreference.hh:39
Definition: geometryreference.hh:23
Wrapper and interface classes for element geometries.
Implementation::ctype ctype
Definition: geometryreference.hh:31
ctype integrationElement(const LocalCoordinate &local) const
Definition: geometryreference.hh:61
int corners() const
Definition: geometryreference.hh:47
GeometryType
Type representing VTK&#39;s entity geometry types.
Definition: common.hh:178
Implementation::JacobianInverseTransposed JacobianInverseTransposed
Definition: geometryreference.hh:36
GlobalCoordinate corner(int i) const
Definition: geometryreference.hh:48
bool affine() const
Definition: geometryreference.hh:45
LocalCoordinate local(const GlobalCoordinate &global) const
Definition: geometryreference.hh:56
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
Definition: geometryreference.hh:68
GlobalCoordinate center() const
Definition: geometryreference.hh:49
static const int mydimension
Definition: geometryreference.hh:28
const Implementation & impl() const
Definition: geometryreference.hh:78
LocalGeometryReference(const Implementation &impl)
Definition: geometryreference.hh:95
Implementation::LocalCoordinate LocalCoordinate
Definition: geometryreference.hh:33
Include standard header files.
Definition: agrid.hh:58