Loading [MathJax]/extensions/MathMenu.js

DUNE MultiDomainGrid (unstable)

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