Dune Core Modules (2.5.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
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 std::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<1>::Geometry Geometry;
214 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
215 typedef typename GridImp::template Codim<0>::Entity Entity;
217
219 {}
220
221 IdentityGridLevelIntersection(const GridImp* identityGrid,
222 const HostLevelIntersection& hostIntersection)
223 : identityGrid_(identityGrid)
224 , hostIntersection_(hostIntersection)
225 {}
226
227 IdentityGridLevelIntersection(const GridImp* identityGrid,
228 HostLevelIntersection&& hostIntersection)
229 : identityGrid_(identityGrid)
230 , hostIntersection_(std::move(hostIntersection))
231 {}
232
233 bool equals(const IdentityGridLevelIntersection& other) const
234 {
235 return hostIntersection_ == other.hostIntersection_;
236 }
237
240 Entity inside() const {
241 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.inside());
242 }
243
244
247 Entity outside() const {
248 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.outside());
249 }
250
251
254 bool boundary () const {
255 return hostIntersection_.boundary();
256 }
257
264 return hostIntersection_.centerUnitOuterNormal();
265 }
266
268 bool neighbor () const {
269 return hostIntersection_.neighbor();
270 }
271
272
274 int boundaryId () const {
275 return hostIntersection_.boundaryId();
276 }
277
279 size_t boundarySegmentIndex() const {
280 return hostIntersection_.boundarySegmentIndex();
281 }
282
284 bool conforming () const {
285 return hostIntersection_.conforming();
286 }
287
290 return hostIntersection_.type();
291 }
292
293
298 LocalGeometry geometryInInside () const
299 {
300 return LocalGeometry( hostIntersection_.geometryInInside() );
301 }
302
305 LocalGeometry geometryInOutside () const
306 {
307 return LocalGeometry( hostIntersection_.geometryInOutside() );
308 }
309
312 Geometry geometry () const
313 {
314 return Geometry( hostIntersection_.geometry() );
315 }
316
317
319 int indexInInside () const {
320 return hostIntersection_.indexInInside();
321 }
322
323
325 int indexInOutside () const {
326 return hostIntersection_.indexInOutside();
327 }
328
329
332 return hostIntersection_.outerNormal(local);
333 }
334
337 return hostIntersection_.integrationOuterNormal(local);
338 }
339
342 return hostIntersection_.unitOuterNormal(local);
343 }
344
345 private:
346
347 const GridImp* identityGrid_;
348
349 HostLevelIntersection hostIntersection_;
350
351 };
352
353
354} // namespace Dune
355
356#endif
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:268
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: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: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:312
bool neighbor() const
return true if across the edge an neighbor on this level exists
Definition: identitygridintersections.hh:268
NormalVector centerUnitOuterNormal() const
Return unit outer normal (length == 1)
Definition: identitygridintersections.hh:263
bool conforming() const
Return true if this is a conforming intersection.
Definition: identitygridintersections.hh:284
int indexInInside() const
local number of codim 1 entity in self where intersection is contained in
Definition: identitygridintersections.hh:319
FieldVector< ctype, dimworld > outerNormal(const FieldVector< ctype, dim-1 > &local) const
return outer normal
Definition: identitygridintersections.hh:331
bool boundary() const
return true if intersection is with boundary.
Definition: identitygridintersections.hh:254
FieldVector< ctype, dimworld > integrationOuterNormal(const FieldVector< ctype, dim-1 > &local) const
return outer normal multiplied by the integration element
Definition: identitygridintersections.hh:336
LocalGeometry geometryInOutside() const
Definition: identitygridintersections.hh:305
LocalGeometry geometryInInside() const
Definition: identitygridintersections.hh:298
int indexInOutside() const
local number of codim 1 entity in neighbor where intersection is contained
Definition: identitygridintersections.hh:325
FieldVector< ctype, dimworld > unitOuterNormal(const FieldVector< ctype, dim-1 > &local) const
return unit outer normal
Definition: identitygridintersections.hh:341
size_t boundarySegmentIndex() const
return the boundary segment index
Definition: identitygridintersections.hh:279
Entity outside() const
Definition: identitygridintersections.hh:247
int boundaryId() const
return information about the Boundary
Definition: identitygridintersections.hh:274
Entity inside() const
Definition: identitygridintersections.hh:240
GeometryType type() const
Geometry type of an intersection.
Definition: identitygridintersections.hh:289
The IdentityGridEntity class.
The IdentityGridLeafIterator class.
Dune namespace.
Definition: alignment.hh:11
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 23, 23:29, 2024)