Reference documentation for deal.II version Git d199cacc3e 2019-07-18 17:13:56 -0400
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
particle_iterator.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2017 - 2019 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_particles_particle_iterator_h
17 #define dealii_particles_particle_iterator_h
18 
19 #include <deal.II/base/config.h>
20 
21 #include <deal.II/particles/particle_accessor.h>
22 
23 DEAL_II_NAMESPACE_OPEN
24 
25 namespace Particles
26 {
27  template <int, int>
28  class ParticleHandler;
29 
35  template <int dim, int spacedim = dim>
36  class ParticleIterator
37  {
38  public:
42  ParticleIterator() = default;
43 
49  const std::multimap<internal::LevelInd, Particle<dim, spacedim>> &map,
50  const typename std::multimap<internal::LevelInd,
51  Particle<dim, spacedim>>::iterator
52  &particle);
53 
58  const ParticleAccessor<dim, spacedim> &operator*() const;
59 
63  ParticleAccessor<dim, spacedim> &operator*();
64 
71  const ParticleAccessor<dim, spacedim> *operator->() const;
72 
76  ParticleAccessor<dim, spacedim> *operator->();
77 
81  bool
82  operator==(const ParticleIterator<dim, spacedim> &) const;
83 
87  bool
88  operator!=(const ParticleIterator<dim, spacedim> &) const;
89 
96  operator++();
97 
104  operator++(int);
105 
112  operator--();
113 
120  operator--(int);
121 
127  using iterator_category = std::bidirectional_iterator_tag;
128  using value_type = ParticleAccessor<dim, spacedim>;
129  using difference_type = std::ptrdiff_t;
130  using pointer = ParticleAccessor<dim, spacedim> *;
131  using reference = ParticleAccessor<dim, spacedim> &;
132 
133  private:
138  };
139 } // namespace Particles
140 
141 DEAL_II_NAMESPACE_CLOSE
142 
143 #endif
ParticleIterator & operator--()
std::bidirectional_iterator_tag iterator_category
ParticleIterator & operator++()
bool operator==(const ParticleIterator< dim, spacedim > &) const
ParticleAccessor< dim, spacedim > accessor
const ParticleAccessor< dim, spacedim > & operator*() const
const ParticleAccessor< dim, spacedim > * operator->() const
bool operator!=(const ParticleIterator< dim, spacedim > &) const