Class for Cells of Particles. More...
#include <ParticleCell.h>


Public Types | |
| using | ParticleType = Particle_T |
| The particle type for this cell. | |
Public Member Functions | |
| 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. | |
Protected Attributes | |
| AutoPasLock | _cellLock {} |
| Lock object for exclusive access to this cell. | |
| OwnershipState | _ownershipState {autopas::OwnershipState::owned | autopas::OwnershipState::halo} |
| The particles which can be contained in this cell are determined by the OwnershipState. | |
| bool | _ownershipStateDefined {false} |
| Flag that is set to true once OwnershipState has been set to avoid resetting the OwnershipState. | |
Class for Cells of Particles.
The class handles to storage particles and provides an interface to add the particles
| Particle_T | the type of particles to be stored in the cells |
| using autopas::ParticleCell< Particle_T >::ParticleType = Particle_T |
The particle type for this cell.
Used to refer to the Particle_T typename for an instantiation of ParticleCell.
|
defaultnoexcept |
Default move constructor.
| other |
|
inline |
Copy constructor that creates a new default constructed lock for the new cell.
| other |
|
pure virtual |
Adds a Particle to the cell.
| p | the particle to be added |
Implemented in autopas::FullParticleCell< Particle_T >, autopas::ReferenceParticleCell< Particle_T >, autopas::OctreeNodeWrapper< Particle_T >, and autopas::SortedCellView< ParticleCellType >.
|
pure virtual |
Deletes all particles in this cell.
Implemented in autopas::FullParticleCell< Particle_T >, autopas::ReferenceParticleCell< Particle_T >, autopas::SortedCellView< ParticleCellType >, autopas::OctreeNodeWrapper< Particle_T >, and autopas::internal::ClusterTower< Particle_T >.
|
pure virtual |
Deletes the index-th particle.
| index | the index of the particle that shall be deleted |
Implemented in autopas::FullParticleCell< Particle_T >, autopas::ReferenceParticleCell< Particle_T >, autopas::SortedCellView< ParticleCellType >, autopas::OctreeNodeWrapper< Particle_T >, and autopas::internal::ClusterTower< Particle_T >.
|
pure virtual |
Deletes all dummy particles in this cell.
Implemented in autopas::FullParticleCell< Particle_T >, autopas::ReferenceParticleCell< Particle_T >, autopas::SortedCellView< ParticleCellType >, autopas::OctreeNodeWrapper< Particle_T >, and autopas::internal::ClusterTower< Particle_T >.
|
pure virtual |
Get the side lengths of this cell.
Implemented in autopas::FullParticleCell< Particle_T >, autopas::ReferenceParticleCell< Particle_T >, autopas::SortedCellView< ParticleCellType >, autopas::OctreeNodeWrapper< Particle_T >, and autopas::internal::ClusterTower< Particle_T >.
|
inline |
Get a reference to the lock object for exclusive access to this cell.
|
pure virtual |
Get the number of particles with respect to the specified IteratorBehavior.
| behavior | Behavior of the iterator, see IteratorBehavior. |
Implemented in autopas::FullParticleCell< Particle_T >, autopas::ReferenceParticleCell< Particle_T >, autopas::SortedCellView< ParticleCellType >, autopas::OctreeLeafNode< Particle_T >, and autopas::OctreeNodeWrapper< Particle_T >.
|
pure virtual |
Get the ParticleCell type as an ParticleCellTypeEnum.
Implemented in autopas::FullParticleCell< Particle_T >, autopas::ReferenceParticleCell< Particle_T >, autopas::SortedCellView< ParticleCellType >, autopas::OctreeNodeWrapper< Particle_T >, and autopas::internal::ClusterTower< Particle_T >.
|
inline |
Get the type of particles contained in this cell.
Possible values: dummy: this cell is empty owned: this cell can ONLY contain owned particles halo: this cell can ONLY contain halo particles ownedOrHalo: this cell can contain owned or halo particles
|
pure virtual |
Check if the cell is empty.
Implemented in autopas::FullParticleCell< Particle_T >, autopas::ReferenceParticleCell< Particle_T >, autopas::SortedCellView< ParticleCellType >, autopas::OctreeNodeWrapper< Particle_T >, and autopas::internal::ClusterTower< Particle_T >.
|
pure virtual |
Set the side lengths of this cell.
| cellLength | cell side length |
Implemented in autopas::internal::ClusterTower< Particle_T >, autopas::FullParticleCell< Particle_T >, autopas::ReferenceParticleCell< Particle_T >, autopas::SortedCellView< ParticleCellType >, and autopas::OctreeNodeWrapper< Particle_T >.
|
inline |
Set the type of particles contained in this cell.
Possible values: dummy: this cell is empty owned: this cell can ONLY contain owned particles halo: this cell can ONLY contain halo particles ownedOrHalo: this cell can contain owned or halo particles
| state | type of particles inside this cell |
|
pure virtual |
Get the number of all particles stored in this cell (owned, halo and dummy).
Implemented in autopas::FullParticleCell< Particle_T >, autopas::ReferenceParticleCell< Particle_T >, autopas::SortedCellView< ParticleCellType >, autopas::OctreeLeafNode< Particle_T >, autopas::OctreeNodeWrapper< Particle_T >, and autopas::internal::ClusterTower< Particle_T >.
|
mutableprotected |
Lock object for exclusive access to this cell.
This lock has to be mutable since it is set in getNumberOfParticles() const.