dune-multidomaingrid 2.8
Loading...
Searching...
No Matches
subdomaingrid/geometry.hh
Go to the documentation of this file.
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>
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
85 jacobianTransposed(const LocalCoords& local) const {
86 return _hostGeometry.jacobianTransposed(local);
87 }
88
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
Definition: multidomaingrid.hh:8
Definition: subdomaingrid/entity.hh:157
Definition: subdomaingrid/entity.hh:79
Definition: subdomaingrid/geometry.hh:14
const JacobianTransposed jacobianTransposed(const LocalCoords &local) const
Definition: subdomaingrid/geometry.hh:85
ctype volume() const
Definition: subdomaingrid/geometry.hh:76
static const int dimension
Definition: subdomaingrid/geometry.hh:28
GlobalCoords center() const
Definition: subdomaingrid/geometry.hh:80
GridImp::ctype ctype
Definition: subdomaingrid/geometry.hh:27
GlobalCoords global(const LocalCoords &local) const
Definition: subdomaingrid/geometry.hh:60
GlobalCoords corner(int i) const
Definition: subdomaingrid/geometry.hh:56
const JacobianInverseTransposed jacobianInverseTransposed(const LocalCoords &local) const
Definition: subdomaingrid/geometry.hh:90
HostGeometry::JacobianTransposed JacobianTransposed
Definition: subdomaingrid/geometry.hh:42
int corners() const
Definition: subdomaingrid/geometry.hh:48
HostGeometry::JacobianInverseTransposed JacobianInverseTransposed
Definition: subdomaingrid/geometry.hh:41
ctype integrationElement(const LocalCoords &local) const
Definition: subdomaingrid/geometry.hh:72
static const int mydimension
Definition: subdomaingrid/geometry.hh:30
static const int dimensionworld
Definition: subdomaingrid/geometry.hh:29
bool affine() const
Definition: subdomaingrid/geometry.hh:52
bool checkInside(const LocalCoords &local) const
Definition: subdomaingrid/geometry.hh:68
static const int coorddimension
Definition: subdomaingrid/geometry.hh:31
GeometryType type() const
Definition: subdomaingrid/geometry.hh:44
LocalCoords local(const GlobalCoords &global) const
Definition: subdomaingrid/geometry.hh:64
Definition: subdomaingrid/intersection.hh:19