DUNE PDELab (2.8)

geometrywrapper.hh
1// -*- tab-width: 4; indent-tabs-mode: nil -*-
2#ifndef DUNE_PDELAB_COMMON_GEOMETRYWRAPPER_HH
3#define DUNE_PDELAB_COMMON_GEOMETRYWRAPPER_HH
4
6
7namespace Dune {
8 namespace PDELab {
9
11
14 template<typename E>
16 {
17 public:
19 typedef typename E::Geometry Geometry;
21 typedef E Entity;
22
24 ElementGeometry (const E& e_)
25 : e(e_)
26 {}
27
30 {
31 return e.geometry();
32 }
33
35 const Entity& entity () const
36 {
37 return e;
38 }
39
41 const Entity& hostEntity () const
42 {
43 return e;
44 }
45
46 private:
47 const E& e;
48 };
49
50
52
55 template<typename I>
57 {
58 private:
59 const I& i;
60 const unsigned int index;
61 public:
63 typedef typename I::Geometry Geometry;
65 typedef typename I::LocalGeometry LocalGeometry;
67 typedef typename I::Entity Entity;
69 typedef typename Geometry::ctype ctype;
70
72 enum { mydimension=I::mydimension };
73
75 enum { coorddimension=Geometry::coorddimension };
76
78 IntersectionGeometry (const I& i_, unsigned int index_)
79 : i(i_), index(index_)
80 {}
81
84 {
85 return 0;
86 }
87
90 {
91 const bool is_boundary = i.boundary();
92 return 0 - int(is_boundary);
93 }
94
96 bool boundary () const
97 {
98 return i.boundary();
99 }
100
102 bool neighbor () const
103 {
104 return i.neighbor();
105 }
106
115 {
116 return i.geometryInInside();
117 }
118
127 {
128 return i.geometryInOutside();
129 }
130
137 {
138 return i.geometry();
139 }
140
142 int indexInInside () const
143 {
144 return i.indexInInside ();
145 }
146
148 int indexInOutside () const
149 {
150 return i.indexInOutside ();
151 }
152
158 {
159 return i.outerNormal(local);
160 }
161
169 {
170 return i.integrationOuterNormal(local);
171 }
172
179 {
180 return i.unitOuterNormal(local);
181 }
182
189 {
190 return i.centerUnitOuterNormal();
191 }
192
197 {
198 return i.inside();
199 }
200
205 {
206 DUNE_THROW(Dune::Exception,"This should never be called.");
207 return i.inside();
208 }
209
217 {
218 return i.outside();
219 }
220
222 const I& intersection () const
223 {
224 return i;
225 }
226
227 unsigned int intersectionIndex() const
228 {
229 return index;
230 }
231 };
232
233 }
234}
235
236#endif // DUNE_PDELAB_COMMON_GEOMETRYWRAPPER_HH
Base class for Dune-Exceptions.
Definition: exceptions.hh:94
@ coorddimension
Definition: geometry.hh:92
GridImp::ctype ctype
define type used for coordinates in grid module
Definition: geometry.hh:95
Wrap element.
Definition: geometrywrapper.hh:16
const Entity & hostEntity() const
Definition: geometrywrapper.hh:41
Geometry geometry() const
Definition: geometrywrapper.hh:29
E Entity
Definition: geometrywrapper.hh:21
ElementGeometry(const E &e_)
Definition: geometrywrapper.hh:24
E::Geometry Geometry
Definition: geometrywrapper.hh:19
const Entity & entity() const
Definition: geometrywrapper.hh:35
Wrap intersection.
Definition: geometrywrapper.hh:57
bool neighbor() const
return true if intersection is shared with another element.
Definition: geometrywrapper.hh:102
Entity outside() const
return Entity on the outside of this intersection. That is the neighboring Entity.
Definition: geometrywrapper.hh:216
LocalGeometry geometryInInside() const
geometrical information about this intersection in local coordinates of the inside() entity.
Definition: geometrywrapper.hh:114
bool boundary() const
return true if intersection is with interior or exterior boundary (see the cases above)
Definition: geometrywrapper.hh:96
IntersectionGeometry(const I &i_, unsigned int index_)
Definition: geometrywrapper.hh:78
int outsideDomainIndex() const
Definition: geometrywrapper.hh:89
Entity inside() const
return Entity on the inside of this intersection. That is the Entity where we started this.
Definition: geometrywrapper.hh:196
int indexInOutside() const
Local number of codim 1 entity in outside() Entity where intersection is contained in.
Definition: geometrywrapper.hh:148
Dune::FieldVector< ctype, coorddimension > centerUnitOuterNormal() const
Return unit outer normal (length == 1)
Definition: geometrywrapper.hh:188
Geometry::ctype ctype
Definition: geometrywrapper.hh:69
const I & intersection() const
Definition: geometrywrapper.hh:222
Dune::FieldVector< ctype, coorddimension > integrationOuterNormal(const Dune::FieldVector< ctype, mydimension > &local) const
return outer normal scaled with the integration element
Definition: geometrywrapper.hh:168
I::Geometry Geometry
Definition: geometrywrapper.hh:63
Geometry geometry() const
geometrical information about this intersection in global coordinates.
Definition: geometrywrapper.hh:136
int insideDomainIndex() const
Definition: geometrywrapper.hh:83
Entity insideHostEntity() const
return Entity on the inside of this intersection. That is the Entity where we started this.
Definition: geometrywrapper.hh:204
Dune::FieldVector< ctype, coorddimension > outerNormal(const Dune::FieldVector< ctype, mydimension > &local) const
Return an outer normal (length not necessarily 1)
Definition: geometrywrapper.hh:157
int indexInInside() const
Local number of codim 1 entity in the inside() Entity where intersection is contained in.
Definition: geometrywrapper.hh:142
Dune::FieldVector< ctype, coorddimension > unitOuterNormal(const Dune::FieldVector< ctype, mydimension > &local) const
Return unit outer normal (length == 1)
Definition: geometrywrapper.hh:178
I::Entity Entity
Definition: geometrywrapper.hh:67
I::LocalGeometry LocalGeometry
Definition: geometrywrapper.hh:65
LocalGeometry geometryInOutside() const
geometrical information about this intersection in local coordinates of the outside() entity.
Definition: geometrywrapper.hh:126
Implements a vector constructed from a given type representing a field and a compile-time given size.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
Dune namespace.
Definition: alignedallocator.hh:11
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)