Dune Core Modules (unstable)

identitygridintersectioniterator.hh
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright © 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_INTERSECTIONITERATOR_HH
6 #define DUNE_IDENTITYGRID_INTERSECTIONITERATOR_HH
7 
9 #include "identitygridentity.hh"
10 
11 #include <dune/grid/common/intersection.hh>
12 
17 namespace Dune {
18 
27  template<class GridImp>
29  {
30 
31  constexpr static int dim = GridImp::dimension;
32 
33  constexpr static int dimworld = GridImp::dimensionworld;
34 
35  // The type used to store coordinates
36  typedef typename GridImp::ctype ctype;
37 
38  typedef typename GridImp::HostGridType::LeafGridView::IntersectionIterator HostLeafIntersectionIterator;
39 
40  public:
41 
43 
45  {}
46 
47  IdentityGridLeafIntersectionIterator(const GridImp* identityGrid,
48  const HostLeafIntersectionIterator& hostIterator)
49  : identityGrid_(identityGrid)
50  , hostIterator_(hostIterator)
51  {}
52 
54  bool equals(const IdentityGridLeafIntersectionIterator& other) const {
55  return hostIterator_ == other.hostIterator_;
56  }
57 
58 
60  void increment() {
61  ++hostIterator_;
62  }
63 
66  return IdentityGridLeafIntersection<GridImp>(identityGrid_,*hostIterator_);
67  }
68 
69  private:
70  //**********************************************************
71  // private data
72  //**********************************************************
73 
74  const GridImp* identityGrid_ = nullptr;
75  HostLeafIntersectionIterator hostIterator_ = {};
76  };
77 
78 
79 
80 
82  template<class GridImp>
84  {
85  constexpr static int dim = GridImp::dimension;
86 
87  constexpr static int dimworld = GridImp::dimensionworld;
88 
89  // The type used to store coordinates
90  typedef typename GridImp::ctype ctype;
91 
92  typedef typename GridImp::HostGridType::LevelGridView::IntersectionIterator HostLevelIntersectionIterator;
93 
94  public:
95 
97 
99  {}
100 
101  IdentityGridLevelIntersectionIterator(const GridImp* identityGrid,
102  const HostLevelIntersectionIterator& hostIterator)
103  : identityGrid_(identityGrid)
104  , hostIterator_(hostIterator)
105  {}
106 
109  return hostIterator_ == other.hostIterator_;
110  }
111 
112 
114  void increment() {
115  ++hostIterator_;
116  }
117 
120  return IdentityGridLevelIntersection<GridImp>(identityGrid_,*hostIterator_);
121  }
122 
123  private:
124 
125 
126  const GridImp* identityGrid_ = nullptr;
127  HostLevelIntersectionIterator hostIterator_ = {};
128 
129  };
130 
131 
132 } // namespace Dune
133 
134 #endif
Iterator over all element neighborsMesh entities of codimension 0 ("elements") allow to visit all nei...
Definition: identitygridintersectioniterator.hh:29
bool equals(const IdentityGridLeafIntersectionIterator &other) const
equality
Definition: identitygridintersectioniterator.hh:54
void increment()
prefix increment
Definition: identitygridintersectioniterator.hh:60
Intersection dereference() const
dereferencing
Definition: identitygridintersectioniterator.hh:65
An intersection with a leaf neighbor elementMesh entities of codimension 0 ("elements") allow to visi...
Definition: identitygridintersections.hh:33
Definition: identitygridintersectioniterator.hh:84
bool equals(const IdentityGridLevelIntersectionIterator< GridImp > &other) const
equality
Definition: identitygridintersectioniterator.hh:108
void increment()
prefix increment
Definition: identitygridintersectioniterator.hh:114
Intersection dereference() const
dereferencing
Definition: identitygridintersectioniterator.hh:119
Definition: identitygridintersections.hh:192
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: intersection.hh:164
concept IntersectionIterator
Model of an intersection iterator.
Definition: intersectioniterator.hh:21
The IdentityGridEntity class.
The IdentityGridLeafIntersection and IdentityGridLevelIntersection classes.
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 27, 22:29, 2024)