Reference documentation for deal.II version 9.0.0
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 at
12 // the top level of the deal.II distribution.
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>
23  ParticleIterator<dim,spacedim>::ParticleIterator (const std::multimap<internal::LevelInd, Particle<dim,spacedim> > &map,
24  const typename std::multimap<internal::LevelInd, Particle<dim,spacedim> >::iterator &particle)
25  :
26  accessor (map, particle)
27  {}
28 
29 
30 
31  template <int dim, int spacedim>
32  ParticleAccessor<dim,spacedim> &
34  {
35  return accessor;
36  }
37 
38 
39 
40  template <int dim, int spacedim>
41  ParticleAccessor<dim,spacedim> *
43  {
44  return &(this->operator* ());
45  }
46 
47 
48 
49  template <int dim, int spacedim>
50  const ParticleAccessor<dim,spacedim> &
52  {
53  return accessor;
54  }
55 
56 
57 
58  template <int dim, int spacedim>
59  const ParticleAccessor<dim,spacedim> *
61  {
62  return &(this->operator* ());
63  }
64 
65 
66  template <int dim, int spacedim>
69  {
70  accessor = other.accessor;
71  return *this;
72  }
73 
74 
75 
76  template <int dim, int spacedim>
77  bool
79  {
80  return accessor != other.accessor;
81  }
82 
83 
84 
85  template <int dim, int spacedim>
86  bool
88  {
89  return accessor == other.accessor;
90  }
91 
92 
93 
94  template <int dim, int spacedim>
97  {
98  accessor.next();
99  return *this;
100  }
101 
102 
103 
104  template <int dim, int spacedim>
107  {
108  ParticleIterator tmp(*this);
109  operator++ ();
110 
111  return tmp;
112  }
113 
114 
115 
116  template <int dim, int spacedim>
119  {
120  accessor.prev();
121  return *this;
122  }
123 
124 
125 
126  template <int dim, int spacedim>
129  {
130  ParticleIterator tmp(*this);
131  operator-- ();
132 
133  return tmp;
134  }
135 }
136 
137 
138 DEAL_II_NAMESPACE_CLOSE
139 
140 DEAL_II_NAMESPACE_OPEN
141 
142 #include "particle_iterator.inst"
143 
144 DEAL_II_NAMESPACE_CLOSE
ParticleIterator & operator=(const ParticleIterator &)
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
const ParticleAccessor< dim, spacedim > & operator*() const
const ParticleAccessor< dim, spacedim > * operator->() const
bool operator!=(const ParticleIterator< dim, spacedim > &) const
ParticleAccessor< dim, spacedim > accessor