Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
particle_iterator.cc
Go to the documentation of this file.
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 
17 
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>
58  const ParticleAccessor<dim, spacedim> *ParticleIterator<dim, 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 
131 
133 
134 #include "particle_iterator.inst"
135 
Particles::ParticleIterator::ParticleIterator
ParticleIterator()=default
operator++
SynchronousIterators< Iterators > operator++(SynchronousIterators< Iterators > &a)
Definition: synchronous_iterator.h:248
Particles::ParticleAccessor
Definition: particle_accessor.h:43
Particles
Definition: data_out.h:27
Particles::ParticleIterator
Definition: particle_iterator.h:39
Particles::ParticleIterator::operator--
ParticleIterator operator--(int)
Definition: particle_iterator.cc:120
Particles::Particle
Definition: particle.h:146
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
Particles::ParticleIterator::operator==
bool operator==(const ParticleIterator< dim, spacedim > &) const
Definition: particle_iterator.cc:79
Particles::ParticleIterator::operator++
ParticleIterator & operator++()
Definition: particle_iterator.cc:88
Particles::ParticleIterator::operator!=
bool operator!=(const ParticleIterator< dim, spacedim > &) const
Definition: particle_iterator.cc:69
Particles::internal::LevelInd
std::pair< int, int > LevelInd
Definition: particle.h:92
particle_iterator.h
Particles::ParticleIterator::operator--
ParticleIterator & operator--()
Definition: particle_iterator.cc:110
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
Particles::ParticleIterator::accessor
ParticleAccessor< dim, spacedim > accessor
Definition: particle_iterator.h:140
Particles::ParticleIterator::operator->
const ParticleAccessor< dim, spacedim > * operator->() const
Definition: particle_iterator.cc:41
Particles::ParticleIterator::operator*
const ParticleAccessor< dim, spacedim > & operator*() const
Definition: particle_iterator.cc:33
operator*
std::enable_if< std::is_floating_point< T >::value &&std::is_floating_point< U >::value, typename ProductType< std::complex< T >, std::complex< U > >::type >::type operator*(const std::complex< T > &left, const std::complex< U > &right)
Definition: complex_overloads.h:43