Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
particle_accessor.h
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 #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 
37  template <int dim, int spacedim = dim>
39  {
40  public:
54  void
55  write_data(void *&data) const;
56 
63  void
64  set_location(const Point<spacedim> &new_location);
65 
71  const Point<spacedim> &
72  get_location() const;
73 
80  void
81  set_reference_location(const Point<dim> &new_reference_location);
82 
86  const Point<dim> &
87  get_reference_location() const;
88 
93  get_id() const;
94 
102  void
103  set_property_pool(PropertyPool &property_pool);
104 
109  bool
110  has_properties() const;
111 
118  void
119  set_properties(const std::vector<double> &new_properties);
120 
126  const ArrayView<double>
127  get_properties();
128 
135  get_properties() const;
136 
142  std::size_t
143  serialized_size_in_bytes() const;
144 
153  const Triangulation<dim, spacedim> &triangulation) const;
154 
158  template <class Archive>
159  void
160  serialize(Archive &ar, const unsigned int version);
161 
165  void
166  next();
167 
171  void
172  prev();
173 
177  bool
178  operator!=(const ParticleAccessor<dim, spacedim> &other) const;
179 
183  bool
184  operator==(const ParticleAccessor<dim, spacedim> &other) const;
185 
186  protected:
191 
198  const std::multimap<internal::LevelInd, Particle<dim, spacedim>> &map,
199  const typename std::multimap<internal::LevelInd,
200  Particle<dim, spacedim>>::iterator
201  &particle);
202 
203  private:
208  std::multimap<internal::LevelInd, Particle<dim, spacedim>> *map;
209 
214  typename std::multimap<internal::LevelInd,
216 
221  template <int, int>
222  friend class ParticleIterator;
223  template <int, int>
224  friend class ParticleHandler;
225  };
226 
227 
228 
229  template <int dim, int spacedim>
230  template <class Archive>
231  void
233  const unsigned int version)
234  {
235  return particle->second.serialize(ar, version);
236  }
237 
238 
239 } // namespace Particles
240 
241 DEAL_II_NAMESPACE_CLOSE
242 
243 #endif
std::multimap< internal::LevelInd, Particle< dim, spacedim > > * map
std::multimap< internal::LevelInd, Particle< dim, spacedim > >::iterator particle
const Point< spacedim > & get_location() const
void set_property_pool(PropertyPool &property_pool)
void set_reference_location(const Point< dim > &new_reference_location)
const ArrayView< double > get_properties()
Triangulation< dim, spacedim >::cell_iterator get_surrounding_cell(const Triangulation< dim, spacedim > &triangulation) const
void serialize(Archive &ar, const unsigned int version)
unsigned int particle_index
Definition: particle.h:64
const Point< dim > & get_reference_location() const
types::particle_index get_id() const
void write_data(void *&data) const
void set_location(const Point< spacedim > &new_location)
void set_properties(const std::vector< double > &new_properties)
std::size_t serialized_size_in_bytes() const
bool operator==(const ParticleAccessor< dim, spacedim > &other) const
bool operator!=(const ParticleAccessor< dim, spacedim > &other) const