Loading [MathJax]/extensions/tex2jax.js

DUNE MultiDomainGrid (2.8)

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 FieldVector<ctype,coorddimension> GlobalCoords;
36 typedef FieldVector<ctype,mydimension> LocalCoords;
37 typedef typename GridImp::HostGrid::Traits::template Codim<dimension-mydim>::Geometry HostGeometry; //TODO: fix this
38
39public:
40
41 typedef typename HostGeometry::JacobianInverseTransposed JacobianInverseTransposed;
42 typedef typename HostGeometry::JacobianTransposed JacobianTransposed;
43
44 GeometryType type() const {
45 return _hostGeometry.type();
46 }
47
48 int corners() const {
49 return _hostGeometry.corners();
50 }
51
52 bool affine() const {
53 return _hostGeometry.affine();
54 }
55
56 GlobalCoords corner(int i) const {
57 return _hostGeometry.corner(i);
58 }
59
60 GlobalCoords global(const LocalCoords& local) const {
61 return _hostGeometry.global(local);
62 }
63
64 LocalCoords local(const GlobalCoords& global) const {
65 return _hostGeometry.local(global);
66 }
67
68 bool checkInside(const LocalCoords& local) const {
69 return _hostGeometry.checkInside(local);
70 }
71
72 ctype integrationElement(const LocalCoords& local) const {
73 return _hostGeometry.integrationElement(local);
74 }
75
76 ctype volume() const {
77 return _hostGeometry.volume();
78 }
79
80 GlobalCoords center() const {
81 return _hostGeometry.center();
82 }
83
84 const JacobianTransposed
85 jacobianTransposed(const LocalCoords& local) const {
86 return _hostGeometry.jacobianTransposed(local);
87 }
88
89 const JacobianInverseTransposed
90 jacobianInverseTransposed(const LocalCoords& local) const {
91 return _hostGeometry.jacobianInverseTransposed(local);
92 }
93
94private:
95
96 const HostGeometry _hostGeometry;
97
98 GeometryWrapper(const HostGeometry& hostGeometry)
99 : _hostGeometry(hostGeometry)
100 {}
101
102};
103
104} // namespace subdomain
105
106} // namespace mdgrid
107
108
109} // namespace Dune
110
111#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 16, 22:50, 2025)