AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ParticleVector< Particle_T > Class Template Reference

ParticleVector class. More...

#include <ParticleVector.h>

Public Member Functions

bool isDirty ()
 Returns the dirty flag, indicating whether Particles exist in the vector that are not stored in a cell yet.
 
void markAsClean ()
 Marks the ParticleVector as clean.
 
void clearAllParticles ()
 Remove all particles from the container and mark it as dirty.
 
void clearHaloParticles ()
 Remove all halo particles from the container and mark it as dirty.
 
void deleteDummyParticles ()
 Remove all dummy particles from the container and mark it as dirty.
 
void push_back (const Particle_T &particle)
 Add a Particle to the data structure.
 
int totalSize ()
 Get the number of Particles in the data structure.
 
int dirtySize ()
 Get the number of dirty Particles in the data structure.
 
bool needsRebuild ()
 Indicates, whether References already stored in cells need to be updated.
 
size_t getDirtyIndex ()
 Get the index of the first Particle that is not referenced by a cell yet.
 
std::vector< Particle_T > & getParticleStorage ()
 Get the vector that stores the Particles.
 
template<typename Lambda >
void forEach (Lambda forEachLambda)
 Iterate over all particles and execute lambda function on them.
 
template<typename Lambda , typename A >
void reduce (Lambda reduceLambda, A &result)
 Iterate over all particles and execute lambda function on them.
 

Detailed Description

template<class Particle_T>
class ParticleVector< Particle_T >

ParticleVector class.

This class uses a std::vector to store particles, which cells refer to by their index in this vector. It also keeps track of which particles are not referenced by a cell yet, and whether all references are no longer valid, which happens when particles are removed. Adding particles keeps all indices valid.

Template Parameters
Particle_Tof the Particle that is being stored

Member Function Documentation

◆ dirtySize()

template<class Particle_T >
int ParticleVector< Particle_T >::dirtySize ( )
inline

Get the number of dirty Particles in the data structure.

Returns
Number of dirty Particles

◆ forEach()

template<class Particle_T >
template<typename Lambda >
void ParticleVector< Particle_T >::forEach ( Lambda  forEachLambda)
inline

Iterate over all particles and execute lambda function on them.

Parameters
forEachLambdalambda function that defines how to modify particles

◆ getDirtyIndex()

template<class Particle_T >
size_t ParticleVector< Particle_T >::getDirtyIndex ( )
inline

Get the index of the first Particle that is not referenced by a cell yet.

Returns
Index of the first dirty Particle

◆ getParticleStorage()

template<class Particle_T >
std::vector< Particle_T > & ParticleVector< Particle_T >::getParticleStorage ( )
inline

Get the vector that stores the Particles.

Cells refer to Particles by their index in this vector.

Returns
Reference to the vector storing the Particles

◆ isDirty()

template<class Particle_T >
bool ParticleVector< Particle_T >::isDirty ( )
inline

Returns the dirty flag, indicating whether Particles exist in the vector that are not stored in a cell yet.

Returns
True if dirty, false otherwise

◆ markAsClean()

template<class Particle_T >
void ParticleVector< Particle_T >::markAsClean ( )
inline

Marks the ParticleVector as clean.

Should be called after updating the references of dirty particles.

◆ needsRebuild()

template<class Particle_T >
bool ParticleVector< Particle_T >::needsRebuild ( )
inline

Indicates, whether References already stored in cells need to be updated.

Returns
Boolean indicating the above

◆ push_back()

template<class Particle_T >
void ParticleVector< Particle_T >::push_back ( const Particle_T &  particle)
inline

Add a Particle to the data structure.

Parameters
particleA reference to the particle to be stored

◆ reduce()

template<class Particle_T >
template<typename Lambda , typename A >
void ParticleVector< Particle_T >::reduce ( Lambda  reduceLambda,
A &  result 
)
inline

Iterate over all particles and execute lambda function on them.

Parameters
reduceLambdalambda function that defines how to modify particles
resultreference to variable where result will be stored after operation

◆ totalSize()

template<class Particle_T >
int ParticleVector< Particle_T >::totalSize ( )
inline

Get the number of Particles in the data structure.

Returns
Total number of Particles

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