16#ifndef dealii_particles_property_pool_h
17#define dealii_particles_property_pool_h
31#ifdef DEAL_II_WITH_64BIT_INDICES
45# ifdef DEAL_II_WITH_MPI
50# define DEAL_II_PARTICLE_INDEX_MPI_TYPE MPI_UINT64_T
67# ifdef DEAL_II_WITH_MPI
72# define DEAL_II_PARTICLE_INDEX_MPI_TYPE MPI_UNSIGNED
101 template <
int dim,
int spacedim = dim>
206 reserve(
const std::size_t size);
239 std::vector<types::particle_index>
ids;
262 template <
int dim,
int spacedim>
267 (handle != invalid_handle) ? handle : 0;
275 Assert(data_index <= locations.size() - 1,
276 ExcMessage(
"Invalid location handle. This can happen if the "
277 "handle was duplicated and then one copy was deallocated "
278 "before trying to access the properties."));
280 return locations[data_index];
285 template <
int dim,
int spacedim>
291 (handle != invalid_handle) ? handle : 0;
299 Assert(data_index <= locations.size() - 1,
300 ExcMessage(
"Invalid location handle. This can happen if the "
301 "handle was duplicated and then one copy was deallocated "
302 "before trying to access the properties."));
304 locations[data_index] = new_location;
309 template <
int dim,
int spacedim>
314 (handle != invalid_handle) ? handle : 0;
322 Assert(data_index <= reference_locations.size() - 1,
323 ExcMessage(
"Invalid location handle. This can happen if the "
324 "handle was duplicated and then one copy was deallocated "
325 "before trying to access the properties."));
327 return reference_locations[data_index];
332 template <
int dim,
int spacedim>
339 (handle != invalid_handle) ? handle : 0;
347 Assert(data_index <= reference_locations.size() - 1,
348 ExcMessage(
"Invalid location handle. This can happen if the "
349 "handle was duplicated and then one copy was deallocated "
350 "before trying to access the properties."));
352 reference_locations[data_index] = new_reference_location;
357 template <
int dim,
int spacedim>
362 (handle != invalid_handle) ? handle : 0;
370 Assert(data_index <= ids.size() - 1,
371 ExcMessage(
"Invalid location handle. This can happen if the "
372 "handle was duplicated and then one copy was deallocated "
373 "before trying to access the properties."));
375 return ids[data_index];
380 template <
int dim,
int spacedim>
386 (handle != invalid_handle) ? handle : 0;
394 Assert(data_index <= ids.size() - 1,
395 ExcMessage(
"Invalid location handle. This can happen if the "
396 "handle was duplicated and then one copy was deallocated "
397 "before trying to access the properties."));
399 ids[data_index] = new_id;
404 template <
int dim,
int spacedim>
409 (handle != invalid_handle) ? handle * n_properties : 0;
417 Assert(data_index <= properties.size() - n_properties,
418 ExcMessage(
"Invalid property handle. This can happen if the "
419 "handle was duplicated and then one copy was deallocated "
420 "before trying to access the properties."));
const Point< spacedim > & get_location(const Handle handle) const
std::vector< Point< dim > > reference_locations
unsigned int n_properties_per_slot() const
ArrayView< double > get_properties(const Handle handle)
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
PropertyPool(const unsigned int n_properties_per_slot)
std::vector< Point< spacedim > > locations
std::vector< types::particle_index > ids
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)
types::global_dof_index size_type
unsigned int particle_index