Dune Core Modules (unstable)

yaspgridleveliterator.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_YASPGRIDLEVELITERATOR_HH
6#define DUNE_GRID_YASPGRIDLEVELITERATOR_HH
7
12namespace Dune {
13
14
17 template<int codim, PartitionIteratorType pitype, class GridImp>
19 {
21 constexpr static int dim = GridImp::dimension;
23 constexpr static int dimworld = GridImp::dimensionworld;
24 typedef typename GridImp::ctype ctype;
25 public:
26 typedef typename GridImp::template Codim<codim>::Entity Entity;
27 typedef typename GridImp::YGridLevelIterator YGLI;
28 typedef typename GridImp::YGrid::Iterator I;
29
32 {}
33
35 YaspLevelIterator (const YGLI & g, const I& it)
36 : _entity(YaspEntity<codim, dim, GridImp>(g,it))
37 {}
38
40 void increment()
41 {
42 ++(_entity.impl()._it);
43 }
44
46 bool equals (const YaspLevelIterator& rhs) const
47 {
48 return (_entity == rhs._entity);
49 }
50
52 const Entity& dereference() const
53 {
54 return _entity;
55 }
56
57 protected:
58 Entity _entity;
59 };
60
61}
62
63#endif // DUNE_GRID_YASPGRIDLEVELITERATOR_HH
Iterates over entities of one grid level.
Definition: yaspgridleveliterator.hh:19
Entity _entity
entity
Definition: yaspgridleveliterator.hh:58
void increment()
increment
Definition: yaspgridleveliterator.hh:40
YaspLevelIterator(const YGLI &g, const I &it)
constructor
Definition: yaspgridleveliterator.hh:35
bool equals(const YaspLevelIterator &rhs) const
equality
Definition: yaspgridleveliterator.hh:46
YaspLevelIterator()
default constructor
Definition: yaspgridleveliterator.hh:31
const Entity & dereference() const
dereferencing
Definition: yaspgridleveliterator.hh:52
Dune namespace.
Definition: alignedallocator.hh:13
Static tag representing a codimension.
Definition: dimension.hh:24
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)