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_accessor.h
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 
16 #ifndef dealii_particles_particle_accessor_h
17 #define dealii_particles_particle_accessor_h
18 
19 #include <deal.II/base/config.h>
20 
22 
23 #include <deal.II/grid/tria.h>
24 
26 
28 
29 namespace Particles
30 {
31  // Forward declarations
32 #ifndef DOXYGEN
33  template <int, int>
34  class ParticleIterator;
35  template <int, int>
36  class ParticleHandler;
37 #endif
38 
42  template <int dim, int spacedim = dim>
44  {
45  public:
59  void
60  write_data(void *&data) const;
61 
68  void
69  set_location(const Point<spacedim> &new_location);
70 
76  const Point<spacedim> &
77  get_location() const;
78 
85  void
86  set_reference_location(const Point<dim> &new_reference_location);
87 
91  const Point<dim> &
92  get_reference_location() const;
93 
98  get_id() const;
99 
107  void
108  set_property_pool(PropertyPool &property_pool);
109 
114  bool
115  has_properties() const;
116 
123  void
124  set_properties(const std::vector<double> &new_properties);
125 
131  const ArrayView<double>
132  get_properties();
133 
140  get_properties() const;
141 
147  std::size_t
148  serialized_size_in_bytes() const;
149 
159 
163  template <class Archive>
164  void
165  serialize(Archive &ar, const unsigned int version);
166 
170  void
171  next();
172 
176  void
177  prev();
178 
182  bool
183  operator!=(const ParticleAccessor<dim, spacedim> &other) const;
184 
188  bool
189  operator==(const ParticleAccessor<dim, spacedim> &other) const;
190 
191  protected:
196 
203  const std::multimap<internal::LevelInd, Particle<dim, spacedim>> &map,
204  const typename std::multimap<internal::LevelInd,
205  Particle<dim, spacedim>>::iterator
206  &particle);
207 
208  private:
213  std::multimap<internal::LevelInd, Particle<dim, spacedim>> *map;
214 
219  typename std::multimap<internal::LevelInd,
221 
222  // Make ParticleIterator a friend to allow it constructing
223  // ParticleAccessors.
224  template <int, int>
225  friend class ParticleIterator;
226  template <int, int>
227  friend class ParticleHandler;
228  };
229 
230 
231 
232  template <int dim, int spacedim>
233  template <class Archive>
234  void
236  const unsigned int version)
237  {
238  return particle->second.serialize(ar, version);
239  }
240 
241 
242 } // namespace Particles
243 
245 
246 #endif
array_view.h
Particles::ParticleAccessor::get_surrounding_cell
Triangulation< dim, spacedim >::cell_iterator get_surrounding_cell(const Triangulation< dim, spacedim > &triangulation) const
Definition: particle_accessor.cc:158
Particles::ParticleAccessor::operator!=
bool operator!=(const ParticleAccessor< dim, spacedim > &other) const
Definition: particle_accessor.cc:215
Particles::ParticleAccessor
Definition: particle_accessor.h:43
Triangulation
Definition: tria.h:1109
tria.h
ArrayView
Definition: array_view.h:77
Particles::ParticleAccessor::get_id
types::particle_index get_id() const
Definition: particle_accessor.cc:100
Particles::ParticleAccessor::has_properties
bool has_properties() const
Definition: particle_accessor.cc:123
Particles::ParticleAccessor::get_location
const Point< spacedim > & get_location() const
Definition: particle_accessor.cc:66
Particles::ParticleAccessor::get_reference_location
const Point< dim > & get_reference_location() const
Definition: particle_accessor.cc:89
Particles::PropertyPool
Definition: property_pool.h:43
Particles
Definition: data_out.h:27
Particles::ParticleIterator
Definition: particle_iterator.h:39
Particles::ParticleAccessor::write_data
void write_data(void *&data) const
Definition: particle_accessor.cc:44
Particles::ParticleAccessor::set_reference_location
void set_reference_location(const Point< dim > &new_reference_location)
Definition: particle_accessor.cc:77
Particles::ParticleAccessor::set_property_pool
void set_property_pool(PropertyPool &property_pool)
Definition: particle_accessor.cc:111
Particles::ParticleAccessor::next
void next()
Definition: particle_accessor.cc:194
Particles::Particle
Definition: particle.h:146
Particles::ParticleAccessor::set_location
void set_location(const Point< spacedim > &new_location)
Definition: particle_accessor.cc:55
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
Particles::ParticleAccessor::ParticleAccessor
ParticleAccessor()
Definition: particle_accessor.cc:23
Particles::ParticleAccessor::prev
void prev()
Definition: particle_accessor.cc:204
Particles::ParticleAccessor::set_properties
void set_properties(const std::vector< double > &new_properties)
Definition: particle_accessor.cc:134
Particles::ParticleAccessor::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: particle_accessor.h:235
unsigned int
particle.h
Particles::internal::LevelInd
std::pair< int, int > LevelInd
Definition: particle.h:92
Particles::ParticleAccessor::serialized_size_in_bytes
std::size_t serialized_size_in_bytes() const
Definition: particle_accessor.cc:183
Particles::ParticleAccessor::operator==
bool operator==(const ParticleAccessor< dim, spacedim > &other) const
Definition: particle_accessor.cc:225
Particles::ParticleHandler
Definition: data_out.h:30
Particles::ParticleAccessor::map
std::multimap< internal::LevelInd, Particle< dim, spacedim > > * map
Definition: particle_accessor.h:213
Point< spacedim >
config.h
triangulation
const typename ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
Definition: p4est_wrappers.cc:69
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
Particles::ParticleAccessor::particle
std::multimap< internal::LevelInd, Particle< dim, spacedim > >::iterator particle
Definition: particle_accessor.h:220
TriaIterator
Definition: tria_iterator.h:578
Particles::ParticleAccessor::get_properties
const ArrayView< double > get_properties()
Definition: particle_accessor.cc:147