|
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\}}\)
Go to the documentation of this file.
16 #ifndef dealii_particles_particle_handler_h
17 #define dealii_particles_particle_handler_h
38 #include <boost/range/iterator_range.hpp>
39 #include <boost/serialization/map.hpp>
59 template <
int dim,
int spacedim = dim>
88 const unsigned int n_properties = 0);
103 const unsigned int n_properties = 0);
287 std::map<unsigned int, IndexSet>
291 & global_bounding_boxes,
292 const std::vector<std::vector<double>> &properties = {});
339 template <
class VectorType>
340 typename std::enable_if<
341 std::is_convertible<VectorType *, Function<spacedim> *>
::value ==
344 const bool displace_particles =
true);
370 const bool displace_particles =
true);
395 const bool displace_particles =
true);
426 template <
class VectorType>
429 const bool add_to_output_vector =
false);
450 const bool add_to_output_vector =
false);
603 template <
class Archive>
605 serialize(Archive &ar,
const unsigned int version);
625 std::multimap<internal::LevelInd, Particle<dim, spacedim>>
particles;
719 #ifdef DEAL_II_WITH_MPI
751 &new_cells_for_particles = std::map<
775 const boost::iterator_range<std::vector<char>::const_iterator>
786 template <
int dim,
int spacedim>
787 template <
class Archive>
796 &global_number_of_particles &global_max_particles_per_cell
797 & next_free_particle_index;
802 template <
int dim,
int spacedim>
803 template <
class VectorType>
804 typename std::enable_if<
805 std::is_convertible<VectorType *, Function<spacedim> *>
::value ==
809 const bool displace_particles)
812 get_next_free_particle_index() * spacedim);
813 for (
auto &p : *
this)
815 auto new_point(displace_particles ? p.get_location() :
817 const auto id = p.get_id();
818 for (
unsigned int i = 0; i < spacedim; ++i)
819 new_point[i] += input_vector[
id * spacedim + i];
820 p.set_location(new_point);
822 sort_particles_into_subdomains_and_cells();
827 template <
int dim,
int spacedim>
828 template <
class VectorType>
832 const bool add_to_output_vector)
835 get_next_free_particle_index() * spacedim);
836 for (
const auto &p : *
this)
838 auto point = p.get_location();
839 const auto id = p.get_id();
840 if (add_to_output_vector)
841 for (
unsigned int i = 0; i < spacedim; ++i)
842 output_vector[
id * spacedim + i] +=
point[i];
844 for (
unsigned int i = 0; i < spacedim; ++i)
845 output_vector[
id * spacedim + i] =
point[i];
847 if (add_to_output_vector)
std::function< std::size_t()> size_callback
particle_iterator_range particles_in_cell(const typename Triangulation< dim, spacedim >::active_cell_iterator &cell)
void register_store_callback_function()
std::enable_if< std::is_convertible< VectorType *, Function< spacedim > * >::value==false >::type set_particle_positions(const VectorType &input_vector, const bool displace_particles=true)
std::function< void *(const particle_iterator &, void *)> store_callback
unsigned int n_properties_per_particle() const
types::particle_index global_number_of_particles
void insert_particles(const std::multimap< typename Triangulation< dim, spacedim >::active_cell_iterator, Particle< dim, spacedim >> &particles)
particle_iterator begin_ghost() const
types::particle_index get_next_free_particle_index() const
ParticleIterator< dim, spacedim > particle_iterator
std::unique_ptr< PropertyPool > property_pool
boost::iterator_range< particle_iterator > particle_iterator_range
void serialize(Archive &ar, const unsigned int version)
void send_recv_particles(const std::map< types::subdomain_id, std::vector< particle_iterator >> &particles_to_send, std::multimap< internal::LevelInd, Particle< dim, spacedim >> &received_particles, const std::map< types::subdomain_id, std::vector< typename Triangulation< dim, spacedim >::active_cell_iterator >> &new_cells_for_particles=std::map< types::subdomain_id, std::vector< typename Triangulation< dim, spacedim >::active_cell_iterator >>())
std::multimap< internal::LevelInd, Particle< dim, spacedim > > particles
void load_particles(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const typename Triangulation< dim, spacedim >::CellStatus status, const boost::iterator_range< std::vector< char >::const_iterator > &data_range)
std::unique_ptr< GridTools::Cache< dim, spacedim > > triangulation_cache
std::map< unsigned int, IndexSet > insert_global_particles(const std::vector< Point< spacedim >> &positions, const std::vector< std::vector< BoundingBox< spacedim >>> &global_bounding_boxes, const std::vector< std::vector< double >> &properties={})
void register_additional_store_load_functions(const std::function< std::size_t()> &size_callback, const std::function< void *(const particle_iterator &, void *)> &store_callback, const std::function< const void *(const particle_iterator &, const void *)> &load_callback)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
PropertyPool & get_property_pool() const
particle_iterator end_ghost() const
Abstract base class for mapping classes.
unsigned int n_particles_in_cell(const typename Triangulation< dim, spacedim >::active_cell_iterator &cell) const
SmartPointer< const Mapping< dim, spacedim >, ParticleHandler< dim, spacedim > > mapping
#define DEAL_II_NAMESPACE_OPEN
void get_particle_positions(VectorType &output_vector, const bool add_to_output_vector=false)
types::particle_index n_global_particles() const
void sort_particles_into_subdomains_and_cells()
#define AssertDimension(dim1, dim2)
types::particle_index next_free_particle_index
particle_iterator end() const
types::particle_index n_locally_owned_particles() const
std::vector< char > store_particles(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const typename Triangulation< dim, spacedim >::CellStatus status) const
void remove_particle(const particle_iterator &particle)
std::multimap< internal::LevelInd, Particle< dim, spacedim > > ghost_particles
IndexSet locally_relevant_ids() const
particle_iterator insert_particle(const Particle< dim, spacedim > &particle, const typename Triangulation< dim, spacedim >::active_cell_iterator &cell)
std::pair< int, int > LevelInd
SmartPointer< const Triangulation< dim, spacedim >, ParticleHandler< dim, spacedim > > triangulation
void update_cached_numbers()
virtual ~ParticleHandler() override=default
std::function< const void *(const particle_iterator &, const void *)> load_callback
types::particle_index n_global_max_particles_per_cell() const
void register_load_callback_function(const bool serialization)
#define DEAL_II_NAMESPACE_CLOSE
unsigned int global_max_particles_per_cell
particle_iterator begin() const
void exchange_ghost_particles()
void initialize(const Triangulation< dim, spacedim > &tria, const Mapping< dim, spacedim > &mapping, const unsigned int n_properties=0)