Reference documentation for deal.II version 9.0.0
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 at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_particles_particle_accessor_h
17 #define dealii_particles_particle_accessor_h
18 
19 #include <deal.II/particles/particle.h>
20 #include <deal.II/base/array_view.h>
21 #include <deal.II/grid/tria.h>
22 
23 DEAL_II_NAMESPACE_OPEN
24 
25 namespace Particles
26 {
27  template <int, int> class ParticleIterator;
28  template <int, int> class ParticleHandler;
29 
30  template<int dim, int spacedim=dim>
31  class ParticleAccessor
32  {
33  public:
47  void
48  write_data(void *&data) const;
49 
56  void
57  set_location (const Point<spacedim> &new_location);
58 
64  const Point<spacedim> &
65  get_location () const;
66 
73  void
74  set_reference_location (const Point<dim> &new_reference_location);
75 
79  const Point<dim> &
80  get_reference_location () const;
81 
86  get_id () const;
87 
95  void
96  set_property_pool(PropertyPool &property_pool);
97 
102  bool
103  has_properties () const;
104 
111  void
112  set_properties (const std::vector<double> &new_properties);
113 
119  const ArrayView<double>
120  get_properties ();
121 
128  get_properties () const;
129 
135  std::size_t
136  serialized_size_in_bytes() const;
137 
145  get_surrounding_cell (const Triangulation<dim,spacedim> &triangulation) const;
146 
150  template <class Archive>
151  void serialize (Archive &ar, const unsigned int version);
152 
156  void next ();
157 
161  void prev ();
162 
166  bool operator != (const ParticleAccessor<dim,spacedim> &other) const;
167 
171  bool operator == (const ParticleAccessor<dim,spacedim> &other) const;
172 
173  protected:
177  ParticleAccessor ();
178 
184  ParticleAccessor (const std::multimap<internal::LevelInd, Particle<dim,spacedim> > &map,
185  const typename std::multimap<internal::LevelInd, Particle<dim,spacedim> >::iterator &particle);
186 
187  private:
192  std::multimap<internal::LevelInd, Particle<dim,spacedim> > *map;
193 
198  typename std::multimap<internal::LevelInd, Particle<dim,spacedim> >::iterator particle;
199 
203  template <int, int> friend class ParticleIterator;
204  template <int, int> friend class ParticleHandler;
205 
206  };
207 }
208 
209 DEAL_II_NAMESPACE_CLOSE
210 
211 #endif
unsigned int particle_index
Definition: particle.h:64