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
53# define DEAL_II_PARTICLE_INDEX_MPI_TYPE MPI_UINT64_T
70# ifdef DEAL_II_WITH_MPI
75# define DEAL_II_PARTICLE_INDEX_MPI_TYPE MPI_UNSIGNED
104 template <
int dim,
int spacedim = dim>
221 const std::vector<double>::size_type data_index =
232 "Invalid property handle. This can happen if the "
233 "handle was duplicated and then one copy was deallocated "
234 "before trying to access the properties."));
302 std::vector<types::particle_index>
ids;
325 template <
int dim,
int spacedim>
329 const std::vector<double>::size_type data_index =
330 (handle != invalid_handle) ? handle : 0;
338 Assert(data_index <= locations.size() - 1,
339 ExcMessage(
"Invalid location handle. This can happen if the "
340 "handle was duplicated and then one copy was deallocated "
341 "before trying to access the properties."));
343 return locations[data_index];
348 template <
int dim,
int spacedim>
352 const std::vector<double>::size_type data_index =
353 (handle != invalid_handle) ? handle : 0;
361 Assert(data_index <= locations.size() - 1,
362 ExcMessage(
"Invalid location handle. This can happen if the "
363 "handle was duplicated and then one copy was deallocated "
364 "before trying to access the properties."));
366 return locations[data_index];
371 template <
int dim,
int spacedim>
376 const std::vector<double>::size_type data_index =
377 (handle != invalid_handle) ? handle : 0;
385 Assert(data_index <= locations.size() - 1,
386 ExcMessage(
"Invalid location handle. This can happen if the "
387 "handle was duplicated and then one copy was deallocated "
388 "before trying to access the properties."));
390 locations[data_index] = new_location;
395 template <
int dim,
int spacedim>
399 const std::vector<double>::size_type data_index =
400 (handle != invalid_handle) ? handle : 0;
408 Assert(data_index <= reference_locations.size() - 1,
409 ExcMessage(
"Invalid location handle. This can happen if the "
410 "handle was duplicated and then one copy was deallocated "
411 "before trying to access the properties."));
413 return reference_locations[data_index];
418 template <
int dim,
int spacedim>
424 const std::vector<double>::size_type data_index =
425 (handle != invalid_handle) ? handle : 0;
433 Assert(data_index <= reference_locations.size() - 1,
434 ExcMessage(
"Invalid location handle. This can happen if the "
435 "handle was duplicated and then one copy was deallocated "
436 "before trying to access the properties."));
438 reference_locations[data_index] = new_reference_location;
443 template <
int dim,
int spacedim>
447 const std::vector<double>::size_type data_index =
448 (handle != invalid_handle) ? handle : 0;
456 Assert(data_index <= ids.size() - 1,
457 ExcMessage(
"Invalid location handle. This can happen if the "
458 "handle was duplicated and then one copy was deallocated "
459 "before trying to access the properties."));
461 return ids[data_index];
466 template <
int dim,
int spacedim>
471 const std::vector<double>::size_type data_index =
472 (handle != invalid_handle) ? handle : 0;
480 Assert(data_index <= ids.size() - 1,
481 ExcMessage(
"Invalid location handle. This can happen if the "
482 "handle was duplicated and then one copy was deallocated "
483 "before trying to access the properties."));
485 ids[data_index] = new_id;
496 template <
int dim,
int spacedim>
500 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