Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
particle_iterator.cc
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 #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>
34  {
35  return accessor;
36  }
37 
38 
39 
40  template <int dim, int spacedim>
42  {
43  return &(this->operator*());
44  }
45 
46 
47 
48  template <int dim, int spacedim>
50  operator*() const
51  {
52  return accessor;
53  }
54 
55 
56 
57  template <int dim, int spacedim>
59  operator->() const
60  {
61  return &(this->operator*());
62  }
63 
64 
65 
66  template <int dim, int spacedim>
67  bool
70  {
71  return accessor != other.accessor;
72  }
73 
74 
75 
76  template <int dim, int spacedim>
77  bool
80  {
81  return accessor == other.accessor;
82  }
83 
84 
85 
86  template <int dim, int spacedim>
89  {
90  accessor.next();
91  return *this;
92  }
93 
94 
95 
96  template <int dim, int spacedim>
99  {
100  ParticleIterator tmp(*this);
101  operator++();
102 
103  return tmp;
104  }
105 
106 
107 
108  template <int dim, int spacedim>
111  {
112  accessor.prev();
113  return *this;
114  }
115 
116 
117 
118  template <int dim, int spacedim>
121  {
122  ParticleIterator tmp(*this);
123  operator--();
124 
125  return tmp;
126  }
127 } // namespace Particles
128 
129 
130 DEAL_II_NAMESPACE_CLOSE
131 
132 DEAL_II_NAMESPACE_OPEN
133 
134 #include "particle_iterator.inst"
135 
136 DEAL_II_NAMESPACE_CLOSE
ParticleIterator & operator--()
SymmetricTensor< rank_, dim, Number > operator*(const SymmetricTensor< rank_, dim, Number > &t, const Number &factor)
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