dune-grid  2.9.0
albertagrid/intersectioniterator.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_ALBERTA_INTERSECTIONITERATOR_HH
6 #define DUNE_ALBERTA_INTERSECTIONITERATOR_HH
7 
9 
11 
17 #if HAVE_ALBERTA
18 
19 namespace Dune
20 {
21 
22  // AlbertaGridLeafIntersectionIterator
23  // -----------------------------------
24 
25  template< class GridImp >
27  {
29 
30  public:
32 
33  static const int dimension = Intersection::Entity::dimension;
34 
35  struct Begin {};
36  struct End {};
37 
38  private:
40 
41  public:
43  {}
44 
45  template< class EntityImp >
46  AlbertaGridLeafIntersectionIterator ( const EntityImp &entity, Begin )
47  : intersection_( IntersectionImp( entity, 0 ) )
48  {}
49 
50  template< class EntityImp >
51  AlbertaGridLeafIntersectionIterator ( const EntityImp &entity, End )
52  : intersection_( IntersectionImp( entity, dimension+1 ) )
53  {}
54 
56  : intersection_( other.intersection_.impl() )
57  {}
58 
59  This &operator= ( const This &other )
60  {
61  intersection_.impl() = other.intersection_.impl();
62  return *this;
63  }
64 
65  const Intersection &dereference () const
66  {
67  return intersection_;
68  }
69 
70  bool equals ( const This &other ) const
71  {
72  return (intersection_.impl() == other.intersection_.impl());
73  }
74 
75  void increment ()
76  {
77  intersection_.impl().next();
78  }
79 
80  private:
81  Intersection intersection_;
82  };
83 
84 }
85 
86 #endif // #if HAVE_ALBERTA
87 
88 #endif // #ifndef DUNE_ALBERTA_INTERSECTIONITERATOR_HH
Include standard header files.
Definition: agrid.hh:60
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: common/intersection.hh:164
Implementation & impl()
access to the underlying implementation
Definition: common/intersection.hh:178
Definition: albertagrid/intersection.hh:105
void next()
Definition: intersection.cc:356
Definition: albertagrid/intersectioniterator.hh:27
AlbertaGridLeafIntersectionIterator(const EntityImp &entity, Begin)
Definition: albertagrid/intersectioniterator.hh:46
AlbertaGridLeafIntersectionIterator()
Definition: albertagrid/intersectioniterator.hh:42
Dune::Intersection< GridImp, AlbertaGridLeafIntersection< GridImp > > Intersection
Definition: albertagrid/intersectioniterator.hh:31
This & operator=(const This &other)
Definition: albertagrid/intersectioniterator.hh:59
AlbertaGridLeafIntersectionIterator(const EntityImp &entity, End)
Definition: albertagrid/intersectioniterator.hh:51
static const int dimension
Definition: albertagrid/intersectioniterator.hh:33
AlbertaGridLeafIntersectionIterator(const This &other)
Definition: albertagrid/intersectioniterator.hh:55
bool equals(const This &other) const
Definition: albertagrid/intersectioniterator.hh:70
void increment()
Definition: albertagrid/intersectioniterator.hh:75
const Intersection & dereference() const
Definition: albertagrid/intersectioniterator.hh:65
Definition: albertagrid/intersectioniterator.hh:35
Definition: albertagrid/intersectioniterator.hh:36