Dune Core Modules (2.10.0)

yaspgridintersectioniterator.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_GRID_YASPGRIDINTERSECTIONITERATOR_HH
6#define DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH
7
15namespace Dune {
16
20 template<class GridImp>
22 {
23 constexpr static int dim = GridImp::dimension;
24 public:
25 // types used from grids
28
30 void increment()
31 {
32 intersection_.impl()._count += (intersection_.impl()._count < 2*dim);
33 }
34
36 bool equals (const YaspIntersectionIterator& other) const
37 {
38 return intersection_ == other.intersection_;
39 }
40
42 const Intersection & dereference() const
43 {
44 intersection_.impl().update();
45 return intersection_;
46 }
47
49 {}
50
52 YaspIntersectionIterator (const YaspEntity<0,dim,GridImp>& myself, bool toend)
53 : intersection_(IntersectionImp(myself, toend))
54 {}
55
58 : intersection_(other.intersection_)
59 {}
60
63 {
64 intersection_ = other.intersection_;
65 return *this;
66 }
67
68 private:
69 // The intersection this iterator points to
70 mutable Intersection intersection_;
71 };
72
73} // namespace Dune
74
75#endif // DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: intersection.hh:164
Implementation & impl()
access to the underlying implementation
Definition: intersection.hh:178
YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities.
Definition: yaspgridintersectioniterator.hh:22
const Intersection & dereference() const
dereferencing
Definition: yaspgridintersectioniterator.hh:42
YaspIntersectionIterator(const YaspIntersectionIterator &other)
copy constructor
Definition: yaspgridintersectioniterator.hh:57
void increment()
increment
Definition: yaspgridintersectioniterator.hh:30
YaspIntersectionIterator & operator=(const YaspIntersectionIterator &other)
assignment
Definition: yaspgridintersectioniterator.hh:62
YaspIntersectionIterator(const YaspEntity< 0, dim, GridImp > &myself, bool toend)
make intersection iterator from entity
Definition: yaspgridintersectioniterator.hh:52
bool equals(const YaspIntersectionIterator &other) const
equality
Definition: yaspgridintersectioniterator.hh:36
YaspIntersection provides data about intersection with neighboring codim 0 entities.
Definition: yaspgridintersection.hh:22
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 27, 23:30, 2024)