PolyDEAL
 
Loading...
Searching...
No Matches
agglomeration_iterator.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) XXXX - YYYY by the polyDEAL authors
5//
6// This file is part of the polyDEAL library.
7//
8// Detailed license information governing the source code
9// can be found in LICENSE.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef agglomeration_iterator_h
14#define agglomeration_iterator_h
15
16
18
19
25template <int dim, int spacedim = dim>
27{
28public:
31
37
45
52 const CellId &cell_id,
54
60 operator*() const;
61
66 operator*();
67
75 operator->() const;
76
81 operator->();
82
86 bool
88
92 bool
94
101 operator++();
102
109 operator++(int);
110
117 operator--();
118
125 operator--(int);
126
131 state() const;
132
137 master_cell() const;
138
144 using iterator_category = std::bidirectional_iterator_tag;
146 using difference_type = std::ptrdiff_t;
149
150private:
155};
156
157
158
159// ------------------------------ inline functions -------------------------
160
161template <int dim, int spacedim>
165
166
167
168template <int dim, int spacedim>
171 &master_cell,
173 : accessor(master_cell, handler)
174{}
175
176template <int dim, int spacedim>
179 &master_cell,
180 const CellId &cell_id,
182 : accessor(master_cell, cell_id, handler)
183{}
184
185
186
187template <int dim, int spacedim>
190{
191 return accessor;
192}
193
194
195
196template <int dim, int spacedim>
202
203
204
205template <int dim, int spacedim>
208{
209 return accessor;
210}
211
212
213
214template <int dim, int spacedim>
217{
218 return &(this->operator*());
219}
220
221
222
223template <int dim, int spacedim>
224inline bool
226 const AgglomerationIterator<dim, spacedim> &other) const
227{
228 return accessor != other.accessor;
229}
230
231
232
233template <int dim, int spacedim>
234inline bool
236 const AgglomerationIterator<dim, spacedim> &other) const
237{
238 return accessor == other.accessor;
239}
240
241
242
243template <int dim, int spacedim>
246{
247 accessor.next();
248 return *this;
249}
250
251
252
253template <int dim, int spacedim>
256{
257 AgglomerationIterator tmp(*this);
258 operator++();
259
260 return tmp;
261}
262
263
264
265template <int dim, int spacedim>
268{
269 accessor.prev();
270 return *this;
271}
272
273
274
275template <int dim, int spacedim>
278{
279 AgglomerationIterator tmp(*this);
280 operator--();
281
282 return tmp;
283}
284
285
286
287template <int dim, int spacedim>
290{
291 return accessor.master_cell.state();
292}
293
294
295
296template <int dim, int spacedim>
299{
300 return accessor.master_cell;
301}
302
303
304
305#endif
std::vector< typename Triangulation< dim, spacedim >::active_cell_iterator > AgglomerationContainer
IteratorState::IteratorStates state() const
const Triangulation< dim, spacedim >::active_cell_iterator & master_cell() const
bool operator!=(const AgglomerationIterator< dim, spacedim > &) const
std::bidirectional_iterator_tag iterator_category
AgglomerationAccessor< dim, spacedim > accessor
AgglomerationIterator & operator++()
const AgglomerationAccessor< dim, spacedim > & operator*() const
AgglomerationIterator & operator--()
typename AgglomerationAccessor< dim, spacedim >::AgglomerationContainer AgglomerationContainer
bool operator==(const AgglomerationIterator< dim, spacedim > &) const
const AgglomerationAccessor< dim, spacedim > * operator->() const
std::enable_if_t< std::is_floating_point_v< T > &&std::is_floating_point_v< U >, typename ProductType< std::complex< T >, std::complex< U > >::type > operator*(const std::complex< T > &left, const std::complex< U > &right)
SynchronousIterators< Iterators > operator++(SynchronousIterators< Iterators > &a)