Reference documentation for deal.II version 9.1.0-pre
particle_accessor.h
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 #ifndef dealii_particles_particle_accessor_h
17 #define dealii_particles_particle_accessor_h
18 
19 #include <deal.II/base/array_view.h>
20 
21 #include <deal.II/grid/tria.h>
22 
23 #include <deal.II/particles/particle.h>
24 
25 DEAL_II_NAMESPACE_OPEN
26 
27 namespace Particles
28 {
29  template <int, int>
31  template <int, int>
33 
34  template <int dim, int spacedim = dim>
35  class ParticleAccessor
36  {
37  public:
51  void
52  write_data(void *&data) const;
53 
60  void
61  set_location(const Point<spacedim> &new_location);
62 
68  const Point<spacedim> &
69  get_location() const;
70 
77  void
78  set_reference_location(const Point<dim> &new_reference_location);
79 
83  const Point<dim> &
84  get_reference_location() const;
85 
90  get_id() const;
91 
99  void
100  set_property_pool(PropertyPool &property_pool);
101 
106  bool
107  has_properties() const;
108 
115  void
116  set_properties(const std::vector<double> &new_properties);
117 
123  const ArrayView<double>
124  get_properties();
125 
132  get_properties() const;
133 
139  std::size_t
140  serialized_size_in_bytes() const;
141 
149  get_surrounding_cell(
150  const Triangulation<dim, spacedim> &triangulation) const;
151 
155  template <class Archive>
156  void
157  serialize(Archive &ar, const unsigned int version);
158 
162  void
163  next();
164 
168  void
169  prev();
170 
174  bool
175  operator!=(const ParticleAccessor<dim, spacedim> &other) const;
176 
180  bool
181  operator==(const ParticleAccessor<dim, spacedim> &other) const;
182 
183  protected:
187  ParticleAccessor();
188 
194  ParticleAccessor(
195  const std::multimap<internal::LevelInd, Particle<dim, spacedim>> &map,
196  const typename std::multimap<internal::LevelInd,
197  Particle<dim, spacedim>>::iterator
198  &particle);
199 
200  private:
205  std::multimap<internal::LevelInd, Particle<dim, spacedim>> *map;
206 
211  typename std::multimap<internal::LevelInd,
212  Particle<dim, spacedim>>::iterator particle;
213 
218  template <int, int>
219  friend class ParticleIterator;
220  template <int, int>
221  friend class ParticleHandler;
222  };
223 } // namespace Particles
224 
225 DEAL_II_NAMESPACE_CLOSE
226 
227 #endif
unsigned long long int particle_index
Definition: particle.h:43