Dune Core Modules (2.4.1)

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
7
12namespace Dune {
13
14
15 // External forward declarations
16 template< class Grid >
17 struct HostGridAccess;
18
19
28 template<class GridImp>
30 {
31
32 friend class IdentityGridLeafIntersectionIterator<GridImp>;
33
34 friend struct HostGridAccess< typename remove_const< GridImp >::type >;
35
36 enum {dim=GridImp::dimension};
37
38 enum {dimworld=GridImp::dimensionworld};
39
40 // The type used to store coordinates
41 typedef typename GridImp::ctype ctype;
42
43 typedef typename GridImp::HostGridType::LeafGridView::Intersection HostLeafIntersection;
44
45 public:
46
47 typedef typename GridImp::template Codim<0>::EntityPointer EntityPointer;
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
106
108 int boundaryId () const {
109 return hostIntersection_.boundaryId();
110 }
111
113 size_t boundarySegmentIndex() const {
114 return hostIntersection_.boundarySegmentIndex();
115 }
116
118 bool conforming () const {
119 return hostIntersection_.conforming();
120 }
121
124 return hostIntersection_.type();
125 }
126
127
132 LocalGeometry geometryInInside () const
133 {
134 return LocalGeometry( hostIntersection_.geometryInInside() );
135 }
136
139 LocalGeometry geometryInOutside () const
140 {
141 return LocalGeometry( hostIntersection_.geometryInOutside() );
142 }
143
146 Geometry geometry () const
147 {
148 return Geometry( hostIntersection_.geometry() );
149 }
150
151
153 int indexInInside () const {
154 return hostIntersection_.indexInInside();
155 }
156
157
159 int indexInOutside () const {
160 return hostIntersection_.indexInOutside();
161 }
162
163
166 return hostIntersection_.outerNormal(local);
167 }
168
171 return hostIntersection_.integrationOuterNormal(local);
172 }
173
176 return hostIntersection_.unitOuterNormal(local);
177 }
178
179
180 private:
181 //**********************************************************
182 // private methods
183 //**********************************************************
184
185 const GridImp* identityGrid_;
186
187 HostLeafIntersection hostIntersection_;
188 };
189
190
191
192
194 template<class GridImp>
196 {
197
198 friend class IdentityGridLevelIntersectionIterator<GridImp>;
199
200 friend struct HostGridAccess< typename remove_const< GridImp >::type >;
201
202 enum {dim=GridImp::dimension};
203
204 enum {dimworld=GridImp::dimensionworld};
205
206 // The type used to store coordinates
207 typedef typename GridImp::ctype ctype;
208
209 typedef typename GridImp::HostGridType::LevelGridView::Intersection HostLevelIntersection;
210
211 public:
212
213 typedef typename GridImp::template Codim<0>::EntityPointer EntityPointer;
214 typedef typename GridImp::template Codim<1>::Geometry Geometry;
215 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
216 typedef typename GridImp::template Codim<0>::Entity Entity;
218
220 {}
221
222 IdentityGridLevelIntersection(const GridImp* identityGrid,
223 const HostLevelIntersection& hostIntersection)
224 : identityGrid_(identityGrid)
225 , hostIntersection_(hostIntersection)
226 {}
227
228 IdentityGridLevelIntersection(const GridImp* identityGrid,
229 HostLevelIntersection&& hostIntersection)
230 : identityGrid_(identityGrid)
231 , hostIntersection_(std::move(hostIntersection))
232 {}
233
234 bool equals(const IdentityGridLevelIntersection& other) const
235 {
236 return hostIntersection_ == other.hostIntersection_;
237 }
238
241 Entity inside() const {
242 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.inside());
243 }
244
245
248 Entity outside() const {
249 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.outside());
250 }
251
252
255 bool boundary () const {
256 return hostIntersection_.boundary();
257 }
258
265 return hostIntersection_.centerUnitOuterNormal();
266 }
267
269 bool neighbor () const {
270 return hostIntersection_.neighbor();
271 }
272
273
275 int boundaryId () const {
276 return hostIntersection_.boundaryId();
277 }
278
280 size_t boundarySegmentIndex() const {
281 return hostIntersection_.boundarySegmentIndex();
282 }
283
285 bool conforming () const {
286 return hostIntersection_.conforming();
287 }
288
291 return hostIntersection_.type();
292 }
293
294
299 LocalGeometry geometryInInside () const
300 {
301 return LocalGeometry( hostIntersection_.geometryInInside() );
302 }
303
306 LocalGeometry geometryInOutside () const
307 {
308 return LocalGeometry( hostIntersection_.geometryInOutside() );
309 }
310
313 Geometry geometry () const
314 {
315 return Geometry( hostIntersection_.geometry() );
316 }
317
318
320 int indexInInside () const {
321 return hostIntersection_.indexInInside();
322 }
323
324
326 int indexInOutside () const {
327 return hostIntersection_.indexInOutside();
328 }
329
330
333 return hostIntersection_.outerNormal(local);
334 }
335
338 return hostIntersection_.integrationOuterNormal(local);
339 }
340
343 return hostIntersection_.unitOuterNormal(local);
344 }
345
346 private:
347
348 const GridImp* identityGrid_;
349
350 HostLevelIntersection hostIntersection_;
351
352 };
353
354
355} // namespace Dune
356
357#endif
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:25
Specialization for codim-0-entities.
Definition: identitygridentity.hh:211
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:30
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:146
Entity outside() const
Definition: identitygridintersections.hh:82
LocalGeometry geometryInOutside() const
Definition: identitygridintersections.hh:139
int boundaryId() const
return information about the Boundary
Definition: identitygridintersections.hh:108
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:123
LocalGeometry geometryInInside() const
Definition: identitygridintersections.hh:132
bool conforming() const
Return true if this is a conforming intersection.
Definition: identitygridintersections.hh:118
size_t boundarySegmentIndex() const
return the boundary segment index
Definition: identitygridintersections.hh:113
FieldVector< ctype, GridImp::dimensionworld > outerNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
return outer normal
Definition: identitygridintersections.hh:165
int indexInOutside() const
local number of codim 1 entity in neighbor where intersection is contained
Definition: identitygridintersections.hh:159
FieldVector< ctype, GridImp::dimensionworld > integrationOuterNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
return outer normal multiplied by the integration element
Definition: identitygridintersections.hh:170
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:175
int indexInInside() const
local number of codim 1 entity in self where intersection is contained in
Definition: identitygridintersections.hh:153
Definition: identitygridintersectioniterator.hh:82
Definition: identitygridintersections.hh:196
Geometry geometry() const
Definition: identitygridintersections.hh:313
bool neighbor() const
return true if across the edge an neighbor on this level exists
Definition: identitygridintersections.hh:269
NormalVector centerUnitOuterNormal() const
Return unit outer normal (length == 1)
Definition: identitygridintersections.hh:264
bool conforming() const
Return true if this is a conforming intersection.
Definition: identitygridintersections.hh:285
int indexInInside() const
local number of codim 1 entity in self where intersection is contained in
Definition: identitygridintersections.hh:320
FieldVector< ctype, dimworld > outerNormal(const FieldVector< ctype, dim-1 > &local) const
return outer normal
Definition: identitygridintersections.hh:332
bool boundary() const
return true if intersection is with boundary.
Definition: identitygridintersections.hh:255
FieldVector< ctype, dimworld > integrationOuterNormal(const FieldVector< ctype, dim-1 > &local) const
return outer normal multiplied by the integration element
Definition: identitygridintersections.hh:337
LocalGeometry geometryInOutside() const
Definition: identitygridintersections.hh:306
LocalGeometry geometryInInside() const
Definition: identitygridintersections.hh:299
int indexInOutside() const
local number of codim 1 entity in neighbor where intersection is contained
Definition: identitygridintersections.hh:326
FieldVector< ctype, dimworld > unitOuterNormal(const FieldVector< ctype, dim-1 > &local) const
return unit outer normal
Definition: identitygridintersections.hh:342
size_t boundarySegmentIndex() const
return the boundary segment index
Definition: identitygridintersections.hh:280
Entity outside() const
Definition: identitygridintersections.hh:248
int boundaryId() const
return information about the Boundary
Definition: identitygridintersections.hh:275
Entity inside() const
Definition: identitygridintersections.hh:241
GeometryType type() const
Geometry type of an intersection.
Definition: identitygridintersections.hh:290
The IdentityGridLeafIterator class.
Dune namespace.
Definition: alignment.hh:10
Static tag representing a codimension.
Definition: dimension.hh:22
provides access to host grid objects from GeometryGrid
Definition: identitygrid.hh:37
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)