ASPECT
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
aspect::Particle::ParticleAccessor< dim, spacedim > Class Template Reference

Public Member Functions

void write_data (void *&data) const
 
void set_location (const Point< spacedim > &new_location)
 
const Point< spacedim > & get_location () const
 
void set_reference_location (const Point< dim > &new_reference_location)
 
const Point< dim > & get_reference_location () const
 
types::particle_index get_id () const
 
void set_property_pool (PropertyPool &property_pool)
 
bool has_properties () const
 
void set_properties (const std::vector< double > &new_properties)
 
const ArrayView< double > get_properties ()
 
const ArrayView< const double > get_properties () const
 
std::size_t serialized_size_in_bytes () const
 
parallel::distributed::Triangulation< dim, spacedim >::cell_iterator get_surrounding_cell (const parallel::distributed::Triangulation< dim, spacedim > &triangulation) const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
void next ()
 
void prev ()
 
bool operator!= (const ParticleAccessor< dim, spacedim > &other) const
 
bool operator== (const ParticleAccessor< dim, spacedim > &other) const
 

Protected Member Functions

 ParticleAccessor ()
 
 ParticleAccessor (const std::multimap< Particles::internal::LevelInd, Particle< dim, spacedim > > &map, const typename std::multimap< Particles::internal::LevelInd, Particle< dim, spacedim > >::iterator &particle)
 

Private Attributes

std::multimap< Particles::internal::LevelInd, Particle< dim, spacedim > > * map
 
std::multimap< Particles::internal::LevelInd, Particle< dim, spacedim > >::iterator particle
 

Friends

template<int , int >
class ParticleIterator
 
template<int , int >
class ParticleHandler
 

Detailed Description

template<int dim, int spacedim = dim>
class aspect::Particle::ParticleAccessor< dim, spacedim >

Definition at line 42 of file particle_accessor.h.

Constructor & Destructor Documentation

§ ParticleAccessor() [1/2]

template<int dim, int spacedim = dim>
aspect::Particle::ParticleAccessor< dim, spacedim >::ParticleAccessor ( )
protected

Construct an invalid accessor. Such an object is not usable.

§ ParticleAccessor() [2/2]

template<int dim, int spacedim = dim>
aspect::Particle::ParticleAccessor< dim, spacedim >::ParticleAccessor ( const std::multimap< Particles::internal::LevelInd, Particle< dim, spacedim > > &  map,
const typename std::multimap< Particles::internal::LevelInd, Particle< dim, spacedim > >::iterator &  particle 
)
protected

Construct an accessor from a reference to a map and an iterator to the map. This constructor is protected so that it can only be accessed by friend classes.

Member Function Documentation

§ write_data()

template<int dim, int spacedim = dim>
void aspect::Particle::ParticleAccessor< dim, spacedim >::write_data ( void *&  data) const

Write particle data into a data array. The array is expected to be large enough to take the data, and the void pointer should point to the first element in which the data should be written. This function is meant for serializing all particle properties and afterwards de-serializing the properties by calling the appropriate constructor Particle(void *&data, PropertyPool *property_pool = nullptr);

Parameters
[in,out]dataThe memory location to write particle data into. This pointer points to the begin of the memory, in which the data will be written and it will be advanced by the serialized size of this particle.

§ set_location()

template<int dim, int spacedim = dim>
void aspect::Particle::ParticleAccessor< dim, spacedim >::set_location ( const Point< spacedim > &  new_location)

Set the location of this particle. Note that this does not check whether this is a valid location in the simulation domain.

Parameters
[in]new_locationThe new location for this particle.

§ get_location()

template<int dim, int spacedim = dim>
const Point<spacedim>& aspect::Particle::ParticleAccessor< dim, spacedim >::get_location ( ) const

Get the location of this particle.

Returns
The location of this particle.

§ set_reference_location()

template<int dim, int spacedim = dim>
void aspect::Particle::ParticleAccessor< dim, spacedim >::set_reference_location ( const Point< dim > &  new_reference_location)

Set the reference location of this particle.

Parameters
[in]new_reference_locationThe new reference location for this particle.

§ get_reference_location()

template<int dim, int spacedim = dim>
const Point<dim>& aspect::Particle::ParticleAccessor< dim, spacedim >::get_reference_location ( ) const

Return the reference location of this particle in its current cell.

§ get_id()

template<int dim, int spacedim = dim>
types::particle_index aspect::Particle::ParticleAccessor< dim, spacedim >::get_id ( ) const

Return the ID number of this particle.

§ set_property_pool()

template<int dim, int spacedim = dim>
void aspect::Particle::ParticleAccessor< dim, spacedim >::set_property_pool ( PropertyPool property_pool)

Tell the particle where to store its properties (even if it does not own properties). Usually this is only done once per particle, but since the particle generator does not know about the properties we want to do it not at construction time. Another use for this function is after particle transfer to a new process.

§ has_properties()

template<int dim, int spacedim = dim>
bool aspect::Particle::ParticleAccessor< dim, spacedim >::has_properties ( ) const

Returns whether this particle has a valid property pool and a valid handle to properties.

§ set_properties()

template<int dim, int spacedim = dim>
void aspect::Particle::ParticleAccessor< dim, spacedim >::set_properties ( const std::vector< double > &  new_properties)

Set the properties of this particle.

Parameters
[in]new_propertiesA vector containing the new properties for this particle.

§ get_properties() [1/2]

template<int dim, int spacedim = dim>
const ArrayView<double> aspect::Particle::ParticleAccessor< dim, spacedim >::get_properties ( )

Get write-access to properties of this particle.

Returns
An ArrayView of the properties of this particle.

§ get_properties() [2/2]

template<int dim, int spacedim = dim>
const ArrayView<const double> aspect::Particle::ParticleAccessor< dim, spacedim >::get_properties ( ) const

Get read-access to properties of this particle.

Returns
An ArrayView of the properties of this particle.

§ serialized_size_in_bytes()

template<int dim, int spacedim = dim>
std::size_t aspect::Particle::ParticleAccessor< dim, spacedim >::serialized_size_in_bytes ( ) const

Returns the size in bytes this particle occupies if all of its data is serialized (i.e. the number of bytes that is written by the write_data function of this class).

§ get_surrounding_cell()

template<int dim, int spacedim = dim>
parallel::distributed::Triangulation<dim,spacedim>::cell_iterator aspect::Particle::ParticleAccessor< dim, spacedim >::get_surrounding_cell ( const parallel::distributed::Triangulation< dim, spacedim > &  triangulation) const

Get a cell iterator to the cell surrounding the current particle. As particles are organized in the structure of a triangulation, but the triangulation itself is not stored in the particle this operation requires a reference to the triangulation.

§ serialize()

template<int dim, int spacedim = dim>
template<class Archive >
void aspect::Particle::ParticleAccessor< dim, spacedim >::serialize ( Archive &  ar,
const unsigned int  version 
)

Serialize the contents of this class.

§ next()

template<int dim, int spacedim = dim>
void aspect::Particle::ParticleAccessor< dim, spacedim >::next ( )

Advance the ParticleAccessor to the next particle.

§ prev()

template<int dim, int spacedim = dim>
void aspect::Particle::ParticleAccessor< dim, spacedim >::prev ( )

Move the ParticleAccessor to the previous particle.

§ operator!=()

template<int dim, int spacedim = dim>
bool aspect::Particle::ParticleAccessor< dim, spacedim >::operator!= ( const ParticleAccessor< dim, spacedim > &  other) const

Inequality operator.

§ operator==()

template<int dim, int spacedim = dim>
bool aspect::Particle::ParticleAccessor< dim, spacedim >::operator== ( const ParticleAccessor< dim, spacedim > &  other) const

Equality operator.

Friends And Related Function Documentation

§ ParticleIterator

template<int dim, int spacedim = dim>
template<int , int >
friend class ParticleIterator
friend

Make ParticleIterator a friend to allow it constructing ParticleAccessors.

Definition at line 214 of file particle_accessor.h.

§ ParticleHandler

template<int dim, int spacedim = dim>
template<int , int >
friend class ParticleHandler
friend

Definition at line 215 of file particle_accessor.h.

Member Data Documentation

§ map

template<int dim, int spacedim = dim>
std::multimap<Particles::internal::LevelInd, Particle<dim,spacedim> >* aspect::Particle::ParticleAccessor< dim, spacedim >::map
private

A pointer to the container that stores the particles. Obviously, this accessor is invalidated if the container changes.

Definition at line 203 of file particle_accessor.h.

§ particle

template<int dim, int spacedim = dim>
std::multimap<Particles::internal::LevelInd, Particle<dim,spacedim> >::iterator aspect::Particle::ParticleAccessor< dim, spacedim >::particle
private

An iterator into the container of particles. Obviously, this accessor is invalidated if the container changes.

Definition at line 209 of file particle_accessor.h.


The documentation for this class was generated from the following file: