Dune Core Modules (2.9.1)

identitygridintersections.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4// vi: set et ts=4 sw=2 sts=2:
5#ifndef DUNE_IDENTITYGRID_INTERSECTIONS_HH
6#define DUNE_IDENTITYGRID_INTERSECTIONS_HH
7
10
15namespace Dune {
16
17
18 // External forward declarations
19 template< class Grid >
20 struct HostGridAccess;
21
22
31 template<class GridImp>
33 {
34
35 friend class IdentityGridLeafIntersectionIterator<GridImp>;
36
37 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
38
39 constexpr static int dim = GridImp::dimension;
40
41 constexpr static int dimworld = GridImp::dimensionworld;
42
43 // The type used to store coordinates
44 typedef typename GridImp::ctype ctype;
45
46 typedef typename GridImp::HostGridType::LeafGridView::Intersection HostLeafIntersection;
47
48 public:
49
50 typedef typename GridImp::template Codim<1>::Geometry Geometry;
51 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
52 typedef typename GridImp::template Codim<0>::Entity Entity;
53 typedef FieldVector<ctype, dimworld> NormalVector;
54
56 {}
57
58 IdentityGridLeafIntersection(const GridImp* identityGrid,
59 const HostLeafIntersection& hostIntersection)
60 : identityGrid_(identityGrid)
61 , hostIntersection_(hostIntersection)
62 {}
63
64 IdentityGridLeafIntersection(const GridImp* identityGrid,
65 HostLeafIntersection&& hostIntersection)
66 : identityGrid_(identityGrid)
67 , hostIntersection_(std::move(hostIntersection))
68 {}
69
70 bool equals(const IdentityGridLeafIntersection& other) const
71 {
72 return hostIntersection_ == other.hostIntersection_;
73 }
74
77 Entity inside() const {
78 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.inside());
79 }
80
81
84 Entity outside() const {
85 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.outside());
86 }
87
88
90 bool boundary () const {
91 return hostIntersection_.boundary();
92 }
93
100 return hostIntersection_.centerUnitOuterNormal();
101 }
102
104 bool neighbor () const {
105 return hostIntersection_.neighbor();
106 }
107
109 size_t boundarySegmentIndex() const {
110 return hostIntersection_.boundarySegmentIndex();
111 }
112
114 bool conforming () const {
115 return hostIntersection_.conforming();
116 }
117
120 return hostIntersection_.type();
121 }
122
123
128 LocalGeometry geometryInInside () const
129 {
130 return LocalGeometry( hostIntersection_.geometryInInside() );
131 }
132
135 LocalGeometry geometryInOutside () const
136 {
137 return LocalGeometry( hostIntersection_.geometryInOutside() );
138 }
139
142 Geometry geometry () const
143 {
144 return Geometry( hostIntersection_.geometry() );
145 }
146
147
149 int indexInInside () const {
150 return hostIntersection_.indexInInside();
151 }
152
153
155 int indexInOutside () const {
156 return hostIntersection_.indexInOutside();
157 }
158
159
162 return hostIntersection_.outerNormal(local);
163 }
164
167 return hostIntersection_.integrationOuterNormal(local);
168 }
169
172 return hostIntersection_.unitOuterNormal(local);
173 }
174
175
176 private:
177 //**********************************************************
178 // private methods
179 //**********************************************************
180
181 const GridImp* identityGrid_;
182
183 HostLeafIntersection hostIntersection_;
184 };
185
186
187
188
190 template<class GridImp>
192 {
193
194 friend class IdentityGridLevelIntersectionIterator<GridImp>;
195
196 friend struct HostGridAccess< typename std::remove_const< GridImp >::type >;
197
198 constexpr static int dim = GridImp::dimension;
199
200 constexpr static int dimworld = GridImp::dimensionworld;
201
202 // The type used to store coordinates
203 typedef typename GridImp::ctype ctype;
204
205 typedef typename GridImp::HostGridType::LevelGridView::Intersection HostLevelIntersection;
206
207 public:
208
209 typedef typename GridImp::template Codim<1>::Geometry Geometry;
210 typedef typename GridImp::template Codim<1>::LocalGeometry LocalGeometry;
211 typedef typename GridImp::template Codim<0>::Entity Entity;
212 typedef FieldVector<ctype, dimworld> NormalVector;
213
215 {}
216
217 IdentityGridLevelIntersection(const GridImp* identityGrid,
218 const HostLevelIntersection& hostIntersection)
219 : identityGrid_(identityGrid)
220 , hostIntersection_(hostIntersection)
221 {}
222
223 IdentityGridLevelIntersection(const GridImp* identityGrid,
224 HostLevelIntersection&& hostIntersection)
225 : identityGrid_(identityGrid)
226 , hostIntersection_(std::move(hostIntersection))
227 {}
228
229 bool equals(const IdentityGridLevelIntersection& other) const
230 {
231 return hostIntersection_ == other.hostIntersection_;
232 }
233
236 Entity inside() const {
237 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.inside());
238 }
239
240
243 Entity outside() const {
244 return IdentityGridEntity<0,dim,GridImp>(identityGrid_,hostIntersection_.outside());
245 }
246
247
250 bool boundary () const {
251 return hostIntersection_.boundary();
252 }
253
260 return hostIntersection_.centerUnitOuterNormal();
261 }
262
264 bool neighbor () const {
265 return hostIntersection_.neighbor();
266 }
267
269 size_t boundarySegmentIndex() const {
270 return hostIntersection_.boundarySegmentIndex();
271 }
272
274 bool conforming () const {
275 return hostIntersection_.conforming();
276 }
277
280 return hostIntersection_.type();
281 }
282
283
288 LocalGeometry geometryInInside () const
289 {
290 return LocalGeometry( hostIntersection_.geometryInInside() );
291 }
292
295 LocalGeometry geometryInOutside () const
296 {
297 return LocalGeometry( hostIntersection_.geometryInOutside() );
298 }
299
302 Geometry geometry () const
303 {
304 return Geometry( hostIntersection_.geometry() );
305 }
306
307
309 int indexInInside () const {
310 return hostIntersection_.indexInInside();
311 }
312
313
315 int indexInOutside () const {
316 return hostIntersection_.indexInOutside();
317 }
318
319
322 return hostIntersection_.outerNormal(local);
323 }
324
327 return hostIntersection_.integrationOuterNormal(local);
328 }
329
332 return hostIntersection_.unitOuterNormal(local);
333 }
334
335 private:
336
337 const GridImp* identityGrid_;
338
339 HostLevelIntersection hostIntersection_;
340
341 };
342
343
344} // namespace Dune
345
346#endif
vector space out of a tensor product of fields.
Definition: fvector.hh:95
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:126
Specialization for codim-0-entities.
Definition: identitygridentity.hh:205
Iterator over all element neighborsMesh entities of codimension 0 ("elements") allow to visit all nei...
Definition: identitygridintersectioniterator.hh:29
An intersection with a leaf neighbor elementMesh entities of codimension 0 ("elements") allow to visi...
Definition: identitygridintersections.hh:33
Entity inside() const
Definition: identitygridintersections.hh:77
NormalVector centerUnitOuterNormal() const
Return unit outer normal (length == 1)
Definition: identitygridintersections.hh:99
Geometry geometry() const
Definition: identitygridintersections.hh:142
Entity outside() const
Definition: identitygridintersections.hh:84
LocalGeometry geometryInOutside() const
Definition: identitygridintersections.hh:135
bool boundary() const
return true if intersection is with boundary.
Definition: identitygridintersections.hh:90
GeometryType type() const
Geometry type of an intersection.
Definition: identitygridintersections.hh:119
LocalGeometry geometryInInside() const
Definition: identitygridintersections.hh:128
bool conforming() const
Return true if this is a conforming intersection.
Definition: identitygridintersections.hh:114
size_t boundarySegmentIndex() const
return the boundary segment index
Definition: identitygridintersections.hh:109
FieldVector< ctype, GridImp::dimensionworld > outerNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
return outer normal
Definition: identitygridintersections.hh:161
int indexInOutside() const
local number of codim 1 entity in neighbor where intersection is contained
Definition: identitygridintersections.hh:155
FieldVector< ctype, GridImp::dimensionworld > integrationOuterNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
return outer normal multiplied by the integration element
Definition: identitygridintersections.hh:166
bool neighbor() const
return true if across the edge an neighbor on this level exists
Definition: identitygridintersections.hh:104
FieldVector< ctype, GridImp::dimensionworld > unitOuterNormal(const FieldVector< ctype, GridImp::dimension-1 > &local) const
return unit outer normal
Definition: identitygridintersections.hh:171
int indexInInside() const
local number of codim 1 entity in self where intersection is contained in
Definition: identitygridintersections.hh:149
Definition: identitygridintersectioniterator.hh:84
Definition: identitygridintersections.hh:192
Geometry geometry() const
Definition: identitygridintersections.hh:302
bool neighbor() const
return true if across the edge an neighbor on this level exists
Definition: identitygridintersections.hh:264
NormalVector centerUnitOuterNormal() const
Return unit outer normal (length == 1)
Definition: identitygridintersections.hh:259
bool conforming() const
Return true if this is a conforming intersection.
Definition: identitygridintersections.hh:274
int indexInInside() const
local number of codim 1 entity in self where intersection is contained in
Definition: identitygridintersections.hh:309
FieldVector< ctype, dimworld > outerNormal(const FieldVector< ctype, dim-1 > &local) const
return outer normal
Definition: identitygridintersections.hh:321
bool boundary() const
return true if intersection is with boundary.
Definition: identitygridintersections.hh:250
FieldVector< ctype, dimworld > integrationOuterNormal(const FieldVector< ctype, dim-1 > &local) const
return outer normal multiplied by the integration element
Definition: identitygridintersections.hh:326
LocalGeometry geometryInOutside() const
Definition: identitygridintersections.hh:295
LocalGeometry geometryInInside() const
Definition: identitygridintersections.hh:288
int indexInOutside() const
local number of codim 1 entity in neighbor where intersection is contained
Definition: identitygridintersections.hh:315
FieldVector< ctype, dimworld > unitOuterNormal(const FieldVector< ctype, dim-1 > &local) const
return unit outer normal
Definition: identitygridintersections.hh:331
size_t boundarySegmentIndex() const
return the boundary segment index
Definition: identitygridintersections.hh:269
Entity outside() const
Definition: identitygridintersections.hh:243
Entity inside() const
Definition: identitygridintersections.hh:236
GeometryType type() const
Geometry type of an intersection.
Definition: identitygridintersections.hh:279
The IdentityGridEntity class.
The IdentityGridLeafIterator class.
Dune namespace.
Definition: alignedallocator.hh:13
STL namespace.
Static tag representing a codimension.
Definition: dimension.hh:24
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 (Nov 21, 23:30, 2024)