This class handles the storage of particles in their full form. More...
#include <FullParticleCell.h>
Public Types | |
using | SoAArraysType = typename Particle_T::SoAArraysType |
The structure of the SoAs is defined by the particle. | |
using | StorageType = std::vector< Particle_T > |
Type that holds or refers to the actual particles. | |
![]() | |
using | ParticleType = Particle_T |
The particle type for this cell. | |
Public Member Functions | |
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. | |
![]() | |
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. | |
Public Attributes | |
StorageType | _particles {} |
Storage of the molecules of the cell. | |
SoA< SoAArraysType > | _particleSoABuffer {} |
SoA buffer of this cell. | |
Additional Inherited Members | |
![]() | |
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. | |
This class handles the storage of particles in their full form.
Particle_T |
|
inlineexplicit |
Constructs a new FullParticleCell with the given cell side length.
cellLength | cell side length |
|
inlineoverridevirtual |
Adds a Particle to the cell.
p | the particle to be added |
Implements autopas::ParticleCell< Particle_T >.
|
inline |
Returns the particle at position index.
Needed by SingleCellIterator.
index | the position of the particle to return. |
|
inline |
Returns the const particle at position index.
Needed by SingleCellIterator.
index | the position of the particle to return. |
|
inline |
Get an iterator to the start of a ParticleCell.
normal use: for(auto iter = cell.begin(); iter.isValid; ++iter){...}
|
inline |
Get an iterator to the start of a ParticleCell.
normal use: for(auto iter = cell.begin(); iter.isValid; ++iter){...}
|
inlineoverridevirtual |
Deletes all particles in this cell.
Implements autopas::ParticleCell< Particle_T >.
Reimplemented in autopas::internal::ClusterTower< Particle_T >.
|
inlineoverridevirtual |
Deletes the index-th particle.
index | the index of the particle that shall be deleted |
Implements autopas::ParticleCell< Particle_T >.
Reimplemented in autopas::internal::ClusterTower< Particle_T >.
|
inlineoverridevirtual |
Deletes all dummy particles in this cell.
Implements autopas::ParticleCell< Particle_T >.
Reimplemented in autopas::internal::ClusterTower< Particle_T >.
|
inline |
Get an iterator to the end of a ParticleCell.
normal use: for(auto &p : cell){...}
|
inline |
Get an iterator to the end of a ParticleCell.
normal use: for(auto &p : cell){...}
|
inline |
Executes code for every particle in this cell as defined by lambda function.
Lambda | (Particle_T &p) -> void |
forEachLambda | code to be executed on particles |
|
inline |
Executes code for every particle in this cell as defined by lambda function.
Lambda | (Particle_T &p) -> void |
forEachLambda | code to be executed on particles |
lowerCorner | lower corner of bounding box |
higherCorner | higher corner of bounding box |
behavior | ownerships of particles that should be in-/excluded |
|
inline |
Executes code for every particle in this cell as defined by lambda function.
Lambda | (Particle_T &p) -> void |
forEachLambda | code to be executed on particles |
behavior | ownerships of particles that should be in-/excluded |
|
inlineoverridevirtual |
Get the side lengths of this cell.
Implements autopas::ParticleCell< Particle_T >.
Reimplemented in autopas::internal::ClusterTower< Particle_T >.
|
inlineoverridevirtual |
Get the number of particles with respect to the specified IteratorBehavior.
behavior | Behavior of the iterator, see IteratorBehavior. |
Implements autopas::ParticleCell< Particle_T >.
Reimplemented in autopas::OctreeLeafNode< Particle_T >.
|
inlineoverridevirtual |
Get the ParticleCell type as an ParticleCellTypeEnum.
Implements autopas::ParticleCell< Particle_T >.
Reimplemented in autopas::internal::ClusterTower< Particle_T >.
|
inlineoverridevirtual |
Check if the cell is empty.
Implements autopas::ParticleCell< Particle_T >.
Reimplemented in autopas::internal::ClusterTower< Particle_T >.
|
inline |
Returns a reference to the element at position n in the cell.
n | Position of an element in the container |
|
inline |
Returns a const reference to the element at position n in the cell.
n | Position of an element in the container |
|
inline |
Reduce properties of particles as defined by a lambda function.
Lambda | (Particle_T p, A initialValue) -> void |
A | type of particle attribute to be reduced |
reduceLambda | code to reduce properties of particles |
result | reference to result of type A |
|
inline |
Reduce properties of particles as defined by a lambda function.
Lambda | (Particle_T p, A initialValue) -> void |
A | type of particle attribute to be reduced |
reduceLambda | code to reduce properties of particles |
result | reference to result of type A |
lowerCorner | lower corner of bounding box |
higherCorner | higher corner of bounding box |
behavior | ownerships of particles that should be in-/excluded |
|
inline |
Reduce properties of particles as defined by a lambda function.
Lambda | (Particle_T p, A initialValue) -> void |
A | type of particle attribute to be reduced |
reduceLambda | code to reduce properties of particles |
result | reference to result of type A |
behavior | ownerships of particles that should be in-/excluded |
|
inline |
Requests that the vector capacity be at least enough to contain n elements.
n | Minimum capacity for the vector. |
|
inline |
Resizes the container so that it contains n elements.
n | New container size |
toInsert | Particle to insert. This is needed to allow for non-default-constructible particles. |
|
inlineoverridevirtual |
Set the side lengths of this cell.
cellLength | cell side length |
Implements autopas::ParticleCell< Particle_T >.
Reimplemented in autopas::internal::ClusterTower< Particle_T >.
|
inlineoverridevirtual |
Get the number of all particles stored in this cell (owned, halo and dummy).
Implements autopas::ParticleCell< Particle_T >.
Reimplemented in autopas::OctreeLeafNode< Particle_T >, and autopas::internal::ClusterTower< Particle_T >.
|
inline |
Sort the particles in the cell by a dimension.
dim | dimension to sort |