16#ifndef dealii_particles_particle_h
17#define dealii_particles_particle_h
27#include <boost/serialization/array.hpp>
95 template <
int dim,
int spacedim = dim>
404 template <
class Archive>
417 template <
class Archive>
433 template <
class Archive>
465 template <
int dim,
int spacedim>
466 template <
class Archive>
470 unsigned int n_properties = 0;
481 if (n_properties > 0)
485 properties.
size() == n_properties,
487 "This particle was serialized with " +
488 std::to_string(n_properties) +
489 " properties, but the new property handler provides space for " +
490 std::to_string(properties.
size()) +
491 " properties. Deserializing a particle only works for matching property sizes."));
493 ar &boost::serialization::make_array(properties.
data(), n_properties);
499 template <
int dim,
int spacedim>
500 template <
class Archive>
504 unsigned int n_properties = 0;
505 if ((property_pool !=
nullptr) &&
507 n_properties = get_properties().
size();
515 if (n_properties > 0)
516 ar &boost::serialization::make_array(get_properties().data(),
522 template <
int dim,
int spacedim>
526 property_pool->set_location(property_pool_handle,
new_loc);
531 template <
int dim,
int spacedim>
535 return property_pool->get_location(property_pool_handle);
540 template <
int dim,
int spacedim>
544 property_pool->set_reference_location(property_pool_handle,
new_loc);
549 template <
int dim,
int spacedim>
553 return property_pool->get_reference_location(property_pool_handle);
558 template <
int dim,
int spacedim>
562 return property_pool->get_id(property_pool_handle);
567 template <
int dim,
int spacedim>
571 property_pool->set_id(property_pool_handle,
new_id);
576 template <
int dim,
int spacedim>
599 if ( has_properties())
610 property_pool->deregister_particle(property_pool_handle);
626 template <
int dim,
int spacedim>
630 if (has_properties() ==
false)
633 return property_pool->get_properties(property_pool_handle);
638 template <
int dim,
int spacedim>
647 Assert((property_pool_handle !=
650 return (property_pool->n_properties_per_slot() > 0);
671 template <
int dim,
int spacedim>
682 const ::Particles::Particle<dim, spacedim> &
particle)
const
const_iterator cend() const
const_iterator cbegin() const
value_type * data() const noexcept
PropertyPool< dim, spacedim > * property_pool
void set_property_pool(PropertyPool< dim, spacedim > &property_pool)
const Point< dim > & get_reference_location() const
const Point< spacedim > & get_location() const
bool has_properties() const
static PropertyPool< dim, spacedim > global_property_pool
void set_reference_location(const Point< dim > &new_reference_location)
std::size_t serialized_size_in_bytes() const
void save(Archive &ar, const unsigned int version) const
Particle< dim, spacedim > & operator=(const Particle< dim, spacedim > &particle)
const ArrayView< double > get_properties()
void set_properties(const ArrayView< const double > &new_properties)
const void * read_particle_data_from_memory(const void *data)
void * write_particle_data_to_memory(void *data) const
types::particle_index get_id() const
PropertyPool< dim, spacedim >::Handle property_pool_handle
void load(Archive &ar, const unsigned int version)
void set_id(const types::particle_index &new_id)
void serialize(Archive &archive, const unsigned int version)
void set_location(const Point< spacedim > &new_location)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
std::pair< int, int > LevelInd
result_type operator()(const ::Particles::Particle< dim, spacedim > &particle) const