DUNE MultiDomainGrid (2.10)

localgeometry.hh
1#ifndef DUNE_MULTIDOMAINGRID_LOCALGEOMETRY_HH
2#define DUNE_MULTIDOMAINGRID_LOCALGEOMETRY_HH
3
4#include <dune/grid/common/geometry.hh>
5
6namespace Dune {
7
8namespace mdgrid {
9
10
11template<int mydim, int coorddim, typename GridImp>
12class LocalGeometryWrapper
13{
14
15 template<int,int,typename>
16 friend class EntityWrapper;
17
18 template<typename,typename>
19 friend class IntersectionWrapper;
20
21 template<typename,typename,typename,typename>
22 friend class SubDomainInterface;
23
24public:
25
26 typedef typename GridImp::ctype ctype;
27 static const int dimension = GridImp::dimension;
28 static const int dimensionworld = GridImp::dimensionworld;
29 static const int mydimension = mydim;
30 static const int coorddimension = coorddim;
31
32private:
33
34 typedef typename GridImp::HostGrid::Traits::template Codim<dimension-mydim>::LocalGeometry HostLocalGeometry; //TODO: fix this
35
36public:
37
38 typedef typename HostLocalGeometry::GlobalCoordinate GlobalCoordinate;
39 typedef typename HostLocalGeometry::LocalCoordinate LocalCoordinate;
40 typedef typename HostLocalGeometry::Volume Volume;
41 typedef typename HostLocalGeometry::JacobianInverseTransposed JacobianInverseTransposed;
42 typedef typename HostLocalGeometry::JacobianTransposed JacobianTransposed;
43 typedef typename HostLocalGeometry::JacobianInverse JacobianInverse;
44 typedef typename HostLocalGeometry::Jacobian Jacobian;
45
46 GeometryType type() const {
47 return _wrappedLocalGeometry.type();
48 }
49
50 int corners() const {
51 return _wrappedLocalGeometry.corners();
52 }
53
54 bool affine() const {
55 return _wrappedLocalGeometry.affine();
56 }
57
58 GlobalCoordinate corner(int i) const {
59 return _wrappedLocalGeometry.corner(i);
60 }
61
62 GlobalCoordinate global(const LocalCoordinate& local) const {
63 return _wrappedLocalGeometry.global(local);
64 }
65
66 LocalCoordinate local(const GlobalCoordinate& global) const {
67 return _wrappedLocalGeometry.local(global);
68 }
69
70 bool checkInside(const LocalCoordinate& local) const {
71 return _wrappedLocalGeometry.checkInside(local);
72 }
73
74 Volume integrationElement(const LocalCoordinate& local) const {
75 return _wrappedLocalGeometry.integrationElement(local);
76 }
77
78 Volume volume() const {
79 return _wrappedLocalGeometry.volume();
80 }
81
82 GlobalCoordinate center() const {
83 return _wrappedLocalGeometry.center();
84 }
85
86 JacobianTransposed jacobianTransposed(const LocalCoordinate& local) const {
87 return _wrappedLocalGeometry.jacobianTransposed(local);
88 }
89
90 JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate& local) const {
91 return _wrappedLocalGeometry.jacobianInverseTransposed(local);
92 }
93
94 Jacobian jacobian(const LocalCoordinate& local) const
95 {
96 return _wrappedLocalGeometry.jacobian(local);
97 }
98
99 JacobianInverse jacobianInverse(const LocalCoordinate& local) const
100 {
101 return _wrappedLocalGeometry.jacobianInverse(local);
102 }
103
104private:
105
106 const HostLocalGeometry _wrappedLocalGeometry;
107
108 LocalGeometryWrapper(const HostLocalGeometry& wrappedLocalGeometry)
109 : _wrappedLocalGeometry(wrappedLocalGeometry)
110 {}
111
112
113};
114
115} // namespace mdgrid
116
117} // namespace Dune
118
119#endif // DUNE_MULTIDOMAINGRID_LOCALGEOMETRY_HH
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Apr 3, 22:46, 2025)