13#ifndef dealii_particles_property_pool_h
14#define dealii_particles_property_pool_h
28#ifdef DEAL_II_WITH_64BIT_INDICES
42# ifdef DEAL_II_WITH_MPI
51# define DEAL_II_PARTICLE_INDEX_MPI_TYPE MPI_UINT64_T
68# ifdef DEAL_II_WITH_MPI
73# define DEAL_II_PARTICLE_INDEX_MPI_TYPE MPI_UNSIGNED
102 template <
int dim,
int spacedim = dim>
219 const std::vector<double>::size_type data_index =
230 "Invalid property handle. This can happen if the "
231 "handle was duplicated and then one copy was deallocated "
232 "before trying to access the properties."));
300 std::vector<types::particle_index>
ids;
323 template <
int dim,
int spacedim>
327 const std::vector<double>::size_type data_index =
328 (handle != invalid_handle) ? handle : 0;
336 Assert(data_index <= locations.size() - 1,
337 ExcMessage(
"Invalid location handle. This can happen if the "
338 "handle was duplicated and then one copy was deallocated "
339 "before trying to access the properties."));
341 return locations[data_index];
346 template <
int dim,
int spacedim>
350 const std::vector<double>::size_type data_index =
351 (handle != invalid_handle) ? handle : 0;
359 Assert(data_index <= locations.size() - 1,
360 ExcMessage(
"Invalid location handle. This can happen if the "
361 "handle was duplicated and then one copy was deallocated "
362 "before trying to access the properties."));
364 return locations[data_index];
369 template <
int dim,
int spacedim>
374 const std::vector<double>::size_type data_index =
375 (handle != invalid_handle) ? handle : 0;
383 Assert(data_index <= locations.size() - 1,
384 ExcMessage(
"Invalid location handle. This can happen if the "
385 "handle was duplicated and then one copy was deallocated "
386 "before trying to access the properties."));
388 locations[data_index] = new_location;
393 template <
int dim,
int spacedim>
397 const std::vector<double>::size_type data_index =
398 (handle != invalid_handle) ? handle : 0;
406 Assert(data_index <= reference_locations.size() - 1,
407 ExcMessage(
"Invalid location handle. This can happen if the "
408 "handle was duplicated and then one copy was deallocated "
409 "before trying to access the properties."));
411 return reference_locations[data_index];
416 template <
int dim,
int spacedim>
422 const std::vector<double>::size_type data_index =
423 (handle != invalid_handle) ? handle : 0;
431 Assert(data_index <= reference_locations.size() - 1,
432 ExcMessage(
"Invalid location handle. This can happen if the "
433 "handle was duplicated and then one copy was deallocated "
434 "before trying to access the properties."));
436 reference_locations[data_index] = new_reference_location;
441 template <
int dim,
int spacedim>
445 const std::vector<double>::size_type data_index =
446 (handle != invalid_handle) ? handle : 0;
454 Assert(data_index <= ids.size() - 1,
455 ExcMessage(
"Invalid location handle. This can happen if the "
456 "handle was duplicated and then one copy was deallocated "
457 "before trying to access the properties."));
459 return ids[data_index];
464 template <
int dim,
int spacedim>
469 const std::vector<double>::size_type data_index =
470 (handle != invalid_handle) ? handle : 0;
478 Assert(data_index <= ids.size() - 1,
479 ExcMessage(
"Invalid location handle. This can happen if the "
480 "handle was duplicated and then one copy was deallocated "
481 "before trying to access the properties."));
483 ids[data_index] = new_id;
494 template <
int dim,
int spacedim>
498 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