15#ifndef dealii_particles_property_pool_h
16#define dealii_particles_property_pool_h
30#ifdef DEAL_II_WITH_64BIT_INDICES
44# ifdef DEAL_II_WITH_MPI
49# define DEAL_II_PARTICLE_INDEX_MPI_TYPE MPI_UINT64_T
66# ifdef DEAL_II_WITH_MPI
71# define DEAL_II_PARTICLE_INDEX_MPI_TYPE MPI_UNSIGNED
100 template <
int dim,
int spacedim = dim>
217 const std::vector<double>::size_type data_index =
228 "Invalid property handle. This can happen if the "
229 "handle was duplicated and then one copy was deallocated "
230 "before trying to access the properties."));
298 std::vector<types::particle_index>
ids;
321 template <
int dim,
int spacedim>
325 const std::vector<double>::size_type data_index =
326 (handle != invalid_handle) ? handle : 0;
334 Assert(data_index <= locations.size() - 1,
335 ExcMessage(
"Invalid location handle. This can happen if the "
336 "handle was duplicated and then one copy was deallocated "
337 "before trying to access the properties."));
339 return locations[data_index];
344 template <
int dim,
int spacedim>
348 const std::vector<double>::size_type data_index =
349 (handle != invalid_handle) ? handle : 0;
357 Assert(data_index <= locations.size() - 1,
358 ExcMessage(
"Invalid location handle. This can happen if the "
359 "handle was duplicated and then one copy was deallocated "
360 "before trying to access the properties."));
362 return locations[data_index];
367 template <
int dim,
int spacedim>
372 const std::vector<double>::size_type data_index =
373 (handle != invalid_handle) ? handle : 0;
381 Assert(data_index <= locations.size() - 1,
382 ExcMessage(
"Invalid location handle. This can happen if the "
383 "handle was duplicated and then one copy was deallocated "
384 "before trying to access the properties."));
386 locations[data_index] = new_location;
391 template <
int dim,
int spacedim>
395 const std::vector<double>::size_type data_index =
396 (handle != invalid_handle) ? handle : 0;
404 Assert(data_index <= reference_locations.size() - 1,
405 ExcMessage(
"Invalid location handle. This can happen if the "
406 "handle was duplicated and then one copy was deallocated "
407 "before trying to access the properties."));
409 return reference_locations[data_index];
414 template <
int dim,
int spacedim>
420 const std::vector<double>::size_type data_index =
421 (handle != invalid_handle) ? handle : 0;
429 Assert(data_index <= reference_locations.size() - 1,
430 ExcMessage(
"Invalid location handle. This can happen if the "
431 "handle was duplicated and then one copy was deallocated "
432 "before trying to access the properties."));
434 reference_locations[data_index] = new_reference_location;
439 template <
int dim,
int spacedim>
443 const std::vector<double>::size_type data_index =
444 (handle != invalid_handle) ? handle : 0;
452 Assert(data_index <= ids.size() - 1,
453 ExcMessage(
"Invalid location handle. This can happen if the "
454 "handle was duplicated and then one copy was deallocated "
455 "before trying to access the properties."));
457 return ids[data_index];
462 template <
int dim,
int spacedim>
467 const std::vector<double>::size_type data_index =
468 (handle != invalid_handle) ? handle : 0;
476 Assert(data_index <= ids.size() - 1,
477 ExcMessage(
"Invalid location handle. This can happen if the "
478 "handle was duplicated and then one copy was deallocated "
479 "before trying to access the properties."));
481 ids[data_index] = new_id;
492 template <
int dim,
int spacedim>
496 return locations.size();
const Point< spacedim > & get_location(const Handle handle) const
std::vector< Point< dim > > reference_locations
unsigned int n_properties_per_slot() const
unsigned int n_registered_slots() const
unsigned int n_slots() const
const unsigned int n_properties
void deregister_particle(Handle &handle)
void set_id(const Handle handle, const types::particle_index &new_id)
types::particle_index get_id(const Handle handle) const
void set_reference_location(const Handle handle, const Point< dim > &new_reference_location)
void reserve(const std::size_t size)
void set_location(const Handle handle, const Point< spacedim > &new_location)
const Point< dim > & get_reference_location(const Handle handle) const
void sort_memory_slots(const std::vector< Handle > &handles_to_sort)
Point< spacedim > & get_location(const Handle handle)
std::vector< Point< spacedim > > locations
std::vector< types::particle_index > ids
ArrayView< double, ::MemorySpace::Host > get_properties(const Handle handle)
static const Handle invalid_handle
Handle register_particle()
std::vector< Handle > currently_available_handles
std::vector< double > properties
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)
unsigned int particle_index