dune-grid 2.9.0
geometrygrid/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_GEOGRID_INTERSECTIONITERATOR_HH
6#define DUNE_GEOGRID_INTERSECTIONITERATOR_HH
7
9
10namespace Dune
11{
12
13 namespace GeoGrid
14 {
15
16 // IntersectionIterator
17 // --------------------
18
19 template< class Grid, class HostIntersectionIterator >
21 {
22 typedef typename std::remove_const< Grid >::type::Traits Traits;
23
25
26 typedef typename Traits::template Codim< 0 >::Geometry ElementGeometry;
27 typedef typename Traits::template Codim< 0 >::GeometryImpl ElementGeometryImpl;
28
29 public:
31
33 {}
34
35 template< class Entity >
37 const HostIntersectionIterator &hostIterator )
38 : hostIterator_( hostIterator )
39 , insideGeo_( inside.geometry().impl() )
40 {}
41
43 : hostIterator_( other.hostIterator_ )
44 , insideGeo_( other.insideGeo_ )
45 {}
46
48 : hostIterator_( std::move( other.hostIterator_ ) )
49 , insideGeo_( std::move( other.insideGeo_ ) )
50 {}
51
53 {
54 hostIterator_ = other.hostIterator_;
55 insideGeo_ = other.insideGeo_;
56 return *this;
57 }
58
60 {
61 hostIterator_ = std::move( other.hostIterator_ );
62 insideGeo_ = std::move( other.insideGeo_ );
63 return *this;
64 }
65
66 bool equals ( const IntersectionIterator &other ) const
67 {
68 return (hostIterator_ == other.hostIterator_);
69 }
70
71 void increment ()
72 {
73 ++hostIterator_;
74 }
75
77 {
78 return IntersectionImpl( *hostIterator_, insideGeo_ );
79 }
80
81 private:
82
83 HostIntersectionIterator hostIterator_;
84 ElementGeometryImpl insideGeo_;
85
86 };
87
88 } // namespace GeoGrid
89
90} // namespace Dune
91
92#endif // #ifndef DUNE_GEOGRID_INTERSECTIONITERATOR_HH
STL namespace.
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
DUNE-conform implementation of the entity.
Definition: geometrygrid/entity.hh:694
Definition: geometrygrid/intersectioniterator.hh:21
IntersectionIterator(const IntersectionIterator &other)
Definition: geometrygrid/intersectioniterator.hh:42
IntersectionIterator(const Entity &inside, const HostIntersectionIterator &hostIterator)
Definition: geometrygrid/intersectioniterator.hh:36
Intersection dereference() const
Definition: geometrygrid/intersectioniterator.hh:76
bool equals(const IntersectionIterator &other) const
Definition: geometrygrid/intersectioniterator.hh:66
IntersectionIterator & operator=(const IntersectionIterator &other)
Definition: geometrygrid/intersectioniterator.hh:52
Dune::Intersection< Grid, IntersectionImpl > Intersection
Definition: geometrygrid/intersectioniterator.hh:30
void increment()
Definition: geometrygrid/intersectioniterator.hh:71
IntersectionIterator()
Definition: geometrygrid/intersectioniterator.hh:32
IntersectionIterator(IntersectionIterator &&other)
Definition: geometrygrid/intersectioniterator.hh:47
Definition: geometrygrid/intersection.hh:22