dune-geometry  2.2.0
mockgeometry.hh
Go to the documentation of this file.
1 // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=8 sw=2 sts=2:
3 
4 #ifndef DUNE_GEOMETRY_MOCKGEOMETRY_HH
5 #define DUNE_GEOMETRY_MOCKGEOMETRY_HH
6 
7 #include <cstddef>
8 
9 #include <dune/common/fmatrix.hh>
10 #include <dune/geometry/type.hh>
13 
14 namespace Dune {
15 
17 
31  template<class ctype, std::size_t mydim, std::size_t coorddim>
32  class MockGeometry :
34  mydim, GenericGeometry::DefaultGeometryTraits<ctype, coorddim, coorddim>
35  >
36  {
38  Traits;
40 
41  // Hide members of BasicGeometry that are not part of Dune::Geometry
42  using typename Base::JacobianInverseTransposed;
43 
44  public:
46  typedef FieldMatrix<ctype, coorddim, mydim> Jacobian;
48  typedef FieldMatrix<ctype, mydim, coorddim> JacobianTransposed;
49 
53  template<class CoordVector>
54  MockGeometry(const GeometryType &type, const CoordVector &coords) :
55  Base(type, coords)
56  { }
58  template<int fatherdim>
60  int i) :
61  Base(static_cast<const GenericGeometry::BasicGeometry<
62  fatherdim,
63  GenericGeometry::DefaultGeometryTraits<ctype, coorddim, coorddim>
64  > &>(father),
65  i)
66  { }
67 
70  (const typename Base::LocalCoordinate &local) const
71  { return Base::jacobianTransposed(local); }
74  (const typename Base::LocalCoordinate &local) const
75  { return Base::jacobianInverseTransposed(local); }
76  };
77 
78 } // namespace Dune
79 
80 #endif // DUNE_GEOMETRY_MOCKGEOMETRY_HH