|
| ClusterTower () |
| Dummy constructor.
|
|
| ClusterTower (size_t clusterSize) |
| Constructor.
|
|
CellType | getParticleCellTypeAsEnum () override |
| Get the ParticleCell type as an ParticleCellTypeEnum.
|
|
void | clear () override |
| Clears all particles from the tower and resets it to be ready for new particles.
|
|
size_t | generateClusters () |
| Generates the clusters for the particles in this cluster tower.
|
|
void | setDummyValues (double dummyStartX, double dummyDistZ) |
| Replaces the copies of the last particle made in generateClusters() with dummies.
|
|
void | setDummyParticlesToLastActualParticle () |
| More or less inverse operation of setDummyValues().
|
|
template<class Functor > |
void | loadSoA (Functor *functor) |
| Loads the particles into the SoA stored in this tower and generates the SoAView for each cluster.
|
|
template<class Functor > |
void | extractSoA (Functor *functor) |
| Extracts the SoA into the particles/clusters.
|
|
std::vector< Particle_T > && | collectAllActualParticles () |
| Returns a rvalue reference to a std::vector containing all particles of this tower that are not dummies.
|
|
std::vector< Particle_T > | collectOutOfBoundsParticles (const std::array< double, 3 > &boxMin, const std::array< double, 3 > &boxMax) |
| Collect all particles that should not be in this tower based on their current position.
|
|
size_t | getNumTailDummyParticles () const |
| Returns the number of dummy particles in the tower that were inserted in the tower to fill the last cluster.
|
|
size_t | size () const override |
| Get the number of all particles stored in this tower (owned, halo and dummy).
|
|
unsigned long | getNumActualParticles () const |
| Get the number of all particles saved in the tower without tailing dummies that are used to fill up clusters (owned + halo + dummies excluding tailing dummies).
|
|
size_t | getNumClusters () const |
| Returns the number of clusters in the tower.
|
|
auto & | getClusters () |
| Returns a reference to the std::vector holding the clusters of this container.
|
|
const std::vector< autopas::internal::Cluster< Particle_T > >::iterator & | getFirstOwnedCluster () const |
| Returns an iterator to the first cluster that contains at least one owned particle.
|
|
size_t | getFirstOwnedClusterIndex () const |
| Returns the index of the first cluster that contains at least one owned particle.
|
|
const std::vector< autopas::internal::Cluster< Particle_T > >::iterator & | getFirstTailHaloCluster () const |
| Returns an iterator to the first particle after the owned clusters, that contains no owned particles anymore.
|
|
size_t | getFirstTailHaloClusterIndex () const |
| Returns the index of the first particle after the owned clusters, that contains no owned particles anymore.
|
|
auto & | getCluster (size_t index) |
| Returns the cluster at position index.
|
|
auto & | getCluster (size_t index) const |
| Returns the cluster at position index.
|
|
bool | isEmpty () const override |
| Check if the cell is empty.
|
|
void | deleteDummyParticles () override |
| Deletes all dummy particles in this cell.
|
|
void | deleteByIndex (size_t index) override |
| Deletes the index-th particle.
|
|
void | setCellLength (std::array< double, 3 > &) override |
| Set the side lengths of this cell.
|
|
std::array< double, 3 > | getCellLength () const override |
| Get the side lengths of this cell.
|
|
void | setClusterSize (size_t clusterSize) |
| Set cluster size.
|
|
size_t | getClusterSize () const |
| Get cluster size.
|
|
void | setParticleDeletionObserver (internal::ParticleDeletedObserver *observer) |
| Set the ParticleDeletionObserver, which is called, when a particle is deleted.
|
|
StorageType & | particleVector () |
| Get reference to internal particle vector.
|
|
Public Member Functions inherited from autopas::FullParticleCell< Particle_T > |
| FullParticleCell () |
| Constructs a new FullParticleCell.
|
|
| FullParticleCell (const std::array< double, 3 > &cellLength) |
| Constructs a new FullParticleCell with the given cell side length.
|
|
void | addParticle (const Particle_T &p) override |
| Adds a Particle to the cell.
|
|
CellIterator< StorageType, true > | begin () |
| Get an iterator to the start of a ParticleCell.
|
|
CellIterator< StorageType, false > | begin () const |
| Get an iterator to the start of a ParticleCell.
|
|
CellIterator< StorageType, true > | end () |
| Get an iterator to the end of a ParticleCell.
|
|
CellIterator< StorageType, false > | end () const |
| Get an iterator to the end of a ParticleCell.
|
|
template<typename Lambda > |
void | forEach (Lambda forEachLambda) |
| Executes code for every particle in this cell as defined by lambda function.
|
|
template<typename Lambda > |
void | forEach (Lambda forEachLambda, IteratorBehavior behavior) |
| Executes code for every particle in this cell as defined by lambda function.
|
|
template<typename Lambda > |
void | forEach (Lambda forEachLambda, const std::array< double, 3 > &lowerCorner, const std::array< double, 3 > &higherCorner, IteratorBehavior behavior) |
| Executes code for every particle in this cell as defined by lambda function.
|
|
template<typename Lambda , typename A > |
void | reduce (Lambda reduceLambda, A &result) |
| Reduce properties of particles as defined by a lambda function.
|
|
template<typename Lambda , typename A > |
void | reduce (Lambda reduceLambda, A &result, IteratorBehavior behavior) |
| Reduce properties of particles as defined by a lambda function.
|
|
template<typename Lambda , typename A > |
void | reduce (Lambda reduceLambda, A &result, const std::array< double, 3 > &lowerCorner, const std::array< double, 3 > &higherCorner, IteratorBehavior behavior) |
| Reduce properties of particles as defined by a lambda function.
|
|
size_t | size () const override |
| Get the number of all particles stored in this cell (owned, halo and dummy).
|
|
size_t | getNumberOfParticles (IteratorBehavior behavior) const override |
| Get the number of particles with respect to the specified IteratorBehavior.
|
|
Particle_T & | operator[] (size_t n) |
| Returns a reference to the element at position n in the cell.
|
|
const Particle_T & | operator[] (size_t n) const |
| Returns a const reference to the element at position n in the cell.
|
|
Particle_T & | at (size_t index) |
| Returns the particle at position index.
|
|
CellType | getParticleCellTypeAsEnum () override |
| Get the ParticleCell type as an ParticleCellTypeEnum.
|
|
const Particle_T & | at (size_t index) const |
| Returns the const particle at position index.
|
|
bool | isEmpty () const override |
| Check if the cell is empty.
|
|
void | clear () override |
| Deletes all particles in this cell.
|
|
void | deleteDummyParticles () override |
| Deletes all dummy particles in this cell.
|
|
void | deleteByIndex (size_t index) override |
| Deletes the index-th particle.
|
|
void | setCellLength (std::array< double, 3 > &cellLength) override |
| Set the side lengths of this cell.
|
|
std::array< double, 3 > | getCellLength () const override |
| Get the side lengths of this cell.
|
|
void | resize (size_t n, const Particle_T &toInsert) |
| Resizes the container so that it contains n elements.
|
|
void | sortByDim (const size_t dim) |
| Sort the particles in the cell by a dimension.
|
|
void | reserve (size_t n) |
| Requests that the vector capacity be at least enough to contain n elements.
|
|
Public Member Functions inherited from autopas::ParticleCell< Particle_T > |
virtual | ~ParticleCell ()=default |
| Default destructor.
|
|
| ParticleCell ()=default |
| Default default constructor.
|
|
| ParticleCell (ParticleCell &&other) noexcept=default |
| Default move constructor.
|
|
| ParticleCell (const ParticleCell &other) |
| Copy constructor that creates a new default constructed lock for the new cell.
|
|
virtual void | addParticle (const Particle_T &p)=0 |
| Adds a Particle to the cell.
|
|
virtual size_t | size () const =0 |
| Get the number of all particles stored in this cell (owned, halo and dummy).
|
|
virtual size_t | getNumberOfParticles (IteratorBehavior behavior=IteratorBehavior::owned) const =0 |
| Get the number of particles with respect to the specified IteratorBehavior.
|
|
virtual bool | isEmpty () const =0 |
| Check if the cell is empty.
|
|
virtual void | clear ()=0 |
| Deletes all particles in this cell.
|
|
virtual void | deleteDummyParticles ()=0 |
| Deletes all dummy particles in this cell.
|
|
virtual CellType | getParticleCellTypeAsEnum ()=0 |
| Get the ParticleCell type as an ParticleCellTypeEnum.
|
|
virtual void | deleteByIndex (size_t index)=0 |
| Deletes the index-th particle.
|
|
virtual void | setCellLength (std::array< double, 3 > &cellLength)=0 |
| Set the side lengths of this cell.
|
|
virtual std::array< double, 3 > | getCellLength () const =0 |
| Get the side lengths of this cell.
|
|
OwnershipState | getPossibleParticleOwnerships () const |
| Get the type of particles contained in this cell.
|
|
void | setPossibleParticleOwnerships (OwnershipState state) |
| Set the type of particles contained in this cell.
|
|
AutoPasLock & | getCellLock () const |
| Get a reference to the lock object for exclusive access to this cell.
|
|
template<class Particle_T>
class autopas::internal::ClusterTower< Particle_T >
This class represents one tower for clusters in the VerletClusterLists container.
A ClusterTower contains multiple clusters that are stacked on top (z-direction) of each other. It saves all particles in a FullParticleCell, provides methods to generate and work on the clusters contained, and handles the generation of dummy particles to make sure that each cluster is full.
Only the last cluster of the ClusterTower is filled up with dummy particles, since all others are guaranteed to already be full.
To use this container:
- Use addParticle() to add all particles you want.
- Then call generateClusters(). This copies the last particle as often as it is necessary to fill up the last cluster. (maximum clusterSize-1 times).
- Generate your neighbor lists somehow.
- Call setDummyValues() to replace the copies of the last particle made in generateClusters() with dummies.
If you want to add more particles after calling generateClusters(), definitely make sure to call clear() before calling addParticle() again, since doing otherwise will mess up the dummy particles and actual particles will likely get lost.
- Template Parameters
-