Reference documentation for deal.II version 9.1.0-pre
particle_iterator.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2017 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 #include <deal.II/particles/particle_iterator.h>
17 
18 DEAL_II_NAMESPACE_OPEN
19 
20 namespace Particles
21 {
22  template <int dim, int spacedim>
24  const std::multimap<internal::LevelInd, Particle<dim, spacedim>> &map,
25  const typename std::multimap<internal::LevelInd,
26  Particle<dim, spacedim>>::iterator & particle)
27  : accessor(map, particle)
28  {}
29 
30 
31 
32  template <int dim, int spacedim>
33  ParticleAccessor<dim, spacedim> &ParticleIterator<dim, spacedim>::operator*()
34  {
35  return accessor;
36  }
37 
38 
39 
40  template <int dim, int spacedim>
41  ParticleAccessor<dim, spacedim> *ParticleIterator<dim, spacedim>::operator->()
42  {
43  return &(this->operator*());
44  }
45 
46 
47 
48  template <int dim, int spacedim>
49  const ParticleAccessor<dim, spacedim> &ParticleIterator<dim, spacedim>::
50  operator*() const
51  {
52  return accessor;
53  }
54 
55 
56 
57  template <int dim, int spacedim>
58  const ParticleAccessor<dim, spacedim> *ParticleIterator<dim, spacedim>::
59  operator->() const
60  {
61  return &(this->operator*());
62  }
63 
64 
65  template <int dim, int spacedim>
68  {
69  accessor = other.accessor;
70  return *this;
71  }
72 
73 
74 
75  template <int dim, int spacedim>
76  bool
79  {
80  return accessor != other.accessor;
81  }
82 
83 
84 
85  template <int dim, int spacedim>
86  bool
89  {
90  return accessor == other.accessor;
91  }
92 
93 
94 
95  template <int dim, int spacedim>
98  {
99  accessor.next();
100  return *this;
101  }
102 
103 
104 
105  template <int dim, int spacedim>
108  {
109  ParticleIterator tmp(*this);
110  operator++();
111 
112  return tmp;
113  }
114 
115 
116 
117  template <int dim, int spacedim>
120  {
121  accessor.prev();
122  return *this;
123  }
124 
125 
126 
127  template <int dim, int spacedim>
130  {
131  ParticleIterator tmp(*this);
132  operator--();
133 
134  return tmp;
135  }
136 } // namespace Particles
137 
138 
139 DEAL_II_NAMESPACE_CLOSE
140 
141 DEAL_II_NAMESPACE_OPEN
142 
143 #include "particle_iterator.inst"
144 
145 DEAL_II_NAMESPACE_CLOSE
ParticleIterator & operator=(const ParticleIterator &)
ParticleIterator & operator--()
const ParticleAccessor< dim, spacedim > * operator->() const
const ParticleAccessor< dim, spacedim > & operator*() const
ParticleIterator & operator++()
ParticleIterator operator++(int)
bool operator!=(const ParticleIterator< dim, spacedim > &) const
bool operator==(const ParticleIterator< dim, spacedim > &) const
ParticleAccessor< dim, spacedim > accessor