Dune Core Modules (2.6.0)

identitygridintersections.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_IDENTITYGRID_INTERSECTIONS_HH
4#define DUNE_IDENTITYGRID_INTERSECTIONS_HH
5
8
13namespace Dune {
14
15
16 // External forward declarations
17 template< class Grid >
18 struct HostGridAccess;
19
20
29 template<class GridImp>
31 {
32
33 friend class IdentityGridLeafIntersectionIterator<GridImp>;
34
35 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
36
37 enum {dim=GridImp::dimension};
38
39 enum {dimworld=GridImp::dimensionworld};
40
41 // The type used to store coordinates
42 typedef typename GridImp::ctype ctype;
43
44 typedef typename GridImp::HostGridType::LeafGridView::Intersection HostLeafIntersection;
45
46 public:
47
48 typedef typename GridImp::template Codim<1>::Geometry Geometry;
49 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
50 typedef typename GridImp::template Codim<0>::Entity Entity;
52
54 {}
55
56 IdentityGridLeafIntersection(const GridImp* identityGrid,
57 const HostLeafIntersection& hostIntersection)
58 : identityGrid_(identityGrid)
59 , hostIntersection_(hostIntersection)
60 {}
61
62 IdentityGridLeafIntersection(const GridImp* identityGrid,
63 HostLeafIntersection&& hostIntersection)
64 : identityGrid_(identityGrid)
65 , hostIntersection_(std::move(hostIntersection))
66 {}
67
68 bool equals(const IdentityGridLeafIntersection& other) const
69 {
70 return hostIntersection_ == other.hostIntersection_;
71 }
72
75 Entity inside() const {
76 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.inside());
77 }
78
79
82 Entity outside() const {
83 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.outside());
84 }
85
86
88 bool boundary () const {
89 return hostIntersection_.boundary();
90 }
91
98 return hostIntersection_.centerUnitOuterNormal();
99 }
100
102 bool neighbor () const {
103 return hostIntersection_.neighbor();
104 }
105
107 size_t boundarySegmentIndex() const {
108 return hostIntersection_.boundarySegmentIndex();
109 }
110
112 bool conforming () const {
113 return hostIntersection_.conforming();
114 }
115
118 return hostIntersection_.type();
119 }
120
121
126 LocalGeometry geometryInInside () const
127 {
128 return LocalGeometry( hostIntersection_.geometryInInside() );
129 }
130
133 LocalGeometry geometryInOutside () const
134 {
135 return LocalGeometry( hostIntersection_.geometryInOutside() );
136 }
137
140 Geometry geometry () const
141 {
142 return Geometry( hostIntersection_.geometry() );
143 }
144
145
147 int indexInInside () const {
148 return hostIntersection_.indexInInside();
149 }
150
151
153 int indexInOutside () const {
154 return hostIntersection_.indexInOutside();
155 }
156
157
160 return hostIntersection_.outerNormal(local);
161 }
162
165 return hostIntersection_.integrationOuterNormal(local);
166 }
167
170 return hostIntersection_.unitOuterNormal(local);
171 }
172
173
174 private:
175 //**********************************************************
176 // private methods
177 //**********************************************************
178
179 const GridImp* identityGrid_;
180
181 HostLeafIntersection hostIntersection_;
182 };
183
184
185
186
188 template<class GridImp>
190 {
191
192 friend class IdentityGridLevelIntersectionIterator<GridImp>;
193
194 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
195
196 enum {dim=GridImp::dimension};
197
198 enum {dimworld=GridImp::dimensionworld};
199
200 // The type used to store coordinates
201 typedef typename GridImp::ctype ctype;
202
203 typedef typename GridImp::HostGridType::LevelGridView::Intersection HostLevelIntersection;
204
205 public:
206
207 typedef typename GridImp::template Codim<1>::Geometry Geometry;
208 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
209 typedef typename GridImp::template Codim<0>::Entity Entity;
211
213 {}
214
215 IdentityGridLevelIntersection(const GridImp* identityGrid,
216 const HostLevelIntersection& hostIntersection)
217 : identityGrid_(identityGrid)
218 , hostIntersection_(hostIntersection)
219 {}
220
221 IdentityGridLevelIntersection(const GridImp* identityGrid,
222 HostLevelIntersection&& hostIntersection)
223 : identityGrid_(identityGrid)
224 , hostIntersection_(std::move(hostIntersection))
225 {}
226
227 bool equals(const IdentityGridLevelIntersection& other) const
228 {
229 return hostIntersection_ == other.hostIntersection_;
230 }
231
234 Entity inside() const {
235 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.inside());
236 }
237
238
241 Entity outside() const {
242 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.outside());
243 }
244
245
248 bool boundary () const {
249 return hostIntersection_.boundary();
250 }
251
258 return hostIntersection_.centerUnitOuterNormal();
259 }
260
262 bool neighbor () const {
263 return hostIntersection_.neighbor();
264 }
265
267 size_t boundarySegmentIndex() const {
268 return hostIntersection_.boundarySegmentIndex();
269 }
270
272 bool conforming () const {
273 return hostIntersection_.conforming();
274 }
275
278 return hostIntersection_.type();
279 }
280
281
286 LocalGeometry geometryInInside () const
287 {
288 return LocalGeometry( hostIntersection_.geometryInInside() );
289 }
290
293 LocalGeometry geometryInOutside () const
294 {
295 return LocalGeometry( hostIntersection_.geometryInOutside() );
296 }
297
300 Geometry geometry () const
301 {
302 return Geometry( hostIntersection_.geometry() );
303 }
304
305
307 int indexInInside () const {
308 return hostIntersection_.indexInInside();
309 }
310
311
313 int indexInOutside () const {
314 return hostIntersection_.indexInOutside();
315 }
316
317
320 return hostIntersection_.outerNormal(local);
321 }
322
325 return hostIntersection_.integrationOuterNormal(local);
326 }
327
330 return hostIntersection_.unitOuterNormal(local);
331 }
332
333 private:
334
335 const GridImp* identityGrid_;
336
337 HostLevelIntersection hostIntersection_;
338
339 };
340
341
342} // namespace Dune
343
344#endif
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:277
Specialization for codim-0-entities.
Definition: identitygridentity.hh:203
Iterator over all element neighborsMesh entities of codimension 0 ("elements") allow to visit all nei...
Definition: identitygridintersectioniterator.hh:27
An intersection with a leaf neighbor elementMesh entities of codimension 0 ("elements") allow to visi...
Definition: identitygridintersections.hh:31
Entity inside() const
Definition: identitygridintersections.hh:75
NormalVector centerUnitOuterNormal() const
Return unit outer normal (length == 1)
Definition: identitygridintersections.hh:97
Geometry geometry() const
Definition: identitygridintersections.hh:140
Entity outside() const
Definition: identitygridintersections.hh:82
LocalGeometry geometryInOutside() const
Definition: identitygridintersections.hh:133
bool boundary() const
return true if intersection is with boundary.
Definition: identitygridintersections.hh:88
GeometryType type() const
Geometry type of an intersection.
Definition: identitygridintersections.hh:117
LocalGeometry geometryInInside() const
Definition: identitygridintersections.hh:126
bool conforming() const
Return true if this is a conforming intersection.
Definition: identitygridintersections.hh:112
size_t boundarySegmentIndex() const
return the boundary segment index
Definition: identitygridintersections.hh:107
FieldVector< ctype, GridImp::dimensionworld > outerNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
return outer normal
Definition: identitygridintersections.hh:159
int indexInOutside() const
local number of codim 1 entity in neighbor where intersection is contained
Definition: identitygridintersections.hh:153
FieldVector< ctype, GridImp::dimensionworld > integrationOuterNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
return outer normal multiplied by the integration element
Definition: identitygridintersections.hh:164
bool neighbor() const
return true if across the edge an neighbor on this level exists
Definition: identitygridintersections.hh:102
FieldVector< ctype, GridImp::dimensionworld > unitOuterNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
return unit outer normal
Definition: identitygridintersections.hh:169
int indexInInside() const
local number of codim 1 entity in self where intersection is contained in
Definition: identitygridintersections.hh:147
Definition: identitygridintersectioniterator.hh:82
Definition: identitygridintersections.hh:190
Geometry geometry() const
Definition: identitygridintersections.hh:300
bool neighbor() const
return true if across the edge an neighbor on this level exists
Definition: identitygridintersections.hh:262
NormalVector centerUnitOuterNormal() const
Return unit outer normal (length == 1)
Definition: identitygridintersections.hh:257
bool conforming() const
Return true if this is a conforming intersection.
Definition: identitygridintersections.hh:272
int indexInInside() const
local number of codim 1 entity in self where intersection is contained in
Definition: identitygridintersections.hh:307
FieldVector< ctype, dimworld > outerNormal(const FieldVector< ctype, dim-1 > &local) const
return outer normal
Definition: identitygridintersections.hh:319
bool boundary() const
return true if intersection is with boundary.
Definition: identitygridintersections.hh:248
FieldVector< ctype, dimworld > integrationOuterNormal(const FieldVector< ctype, dim-1 > &local) const
return outer normal multiplied by the integration element
Definition: identitygridintersections.hh:324
LocalGeometry geometryInOutside() const
Definition: identitygridintersections.hh:293
LocalGeometry geometryInInside() const
Definition: identitygridintersections.hh:286
int indexInOutside() const
local number of codim 1 entity in neighbor where intersection is contained
Definition: identitygridintersections.hh:313
FieldVector< ctype, dimworld > unitOuterNormal(const FieldVector< ctype, dim-1 > &local) const
return unit outer normal
Definition: identitygridintersections.hh:329
size_t boundarySegmentIndex() const
return the boundary segment index
Definition: identitygridintersections.hh:267
Entity outside() const
Definition: identitygridintersections.hh:241
Entity inside() const
Definition: identitygridintersections.hh:234
GeometryType type() const
Geometry type of an intersection.
Definition: identitygridintersections.hh:277
The IdentityGridEntity class.
The IdentityGridLeafIterator class.
Dune namespace.
Definition: alignedallocator.hh:10
STL namespace.
Static tag representing a codimension.
Definition: dimension.hh:22
provides access to host grid objects from GeometryGrid
Definition: identitygrid.hh:36
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)