50template <
class Particle_T>
90 [[nodiscard]]
virtual size_t size()
const = 0;
101 [[nodiscard]]
virtual size_t getNumberOfParticles(IteratorBehavior behavior = IteratorBehavior::owned)
const = 0;
107 [[nodiscard]]
virtual bool isEmpty()
const = 0;
163 std::lock_guard<AutoPasLock> guard(this->
_cellLock);
166 "ParticleCell::setPossibleParticleOwnerships() can not set OwnershipState of a cell after "
AutoPasLock for the sequential case.
Definition: WrapOpenMP.h:155
This class handles the storage of particles in their full form.
Definition: FullParticleCell.h:26
Class for Cells of Particles.
Definition: ParticleCell.h:51
ParticleCell(ParticleCell &&other) noexcept=default
Default move constructor.
virtual void clear()=0
Deletes all particles in this cell.
virtual size_t size() const =0
Get the number of all particles stored in this cell (owned, halo and dummy).
virtual bool isEmpty() const =0
Check if the cell is empty.
virtual ~ParticleCell()=default
Default destructor.
ParticleCell()=default
Default default constructor.
void setPossibleParticleOwnerships(OwnershipState state)
Set the type of particles contained in this cell.
Definition: ParticleCell.h:162
OwnershipState _ownershipState
The particles which can be contained in this cell are determined by the OwnershipState.
Definition: ParticleCell.h:189
virtual void deleteByIndex(size_t index)=0
Deletes the index-th particle.
virtual void deleteDummyParticles()=0
Deletes all dummy particles in this cell.
virtual void addParticle(const Particle_T &p)=0
Adds a Particle to the cell.
OwnershipState getPossibleParticleOwnerships() const
Get the type of particles contained in this cell.
Definition: ParticleCell.h:151
virtual CellType getParticleCellTypeAsEnum()=0
Get the ParticleCell type as an ParticleCellTypeEnum.
virtual std::array< double, 3 > getCellLength() const =0
Get the side lengths of this cell.
virtual void setCellLength(std::array< double, 3 > &cellLength)=0
Set the side lengths of this cell.
ParticleCell(const ParticleCell &other)
Copy constructor that creates a new default constructed lock for the new cell.
Definition: ParticleCell.h:78
AutoPasLock _cellLock
Lock object for exclusive access to this cell.
Definition: ParticleCell.h:184
bool _ownershipStateDefined
Flag that is set to true once OwnershipState has been set to avoid resetting the OwnershipState.
Definition: ParticleCell.h:193
virtual size_t getNumberOfParticles(IteratorBehavior behavior=IteratorBehavior::owned) const =0
Get the number of particles with respect to the specified IteratorBehavior.
AutoPasLock & getCellLock() const
Get a reference to the lock object for exclusive access to this cell.
Definition: ParticleCell.h:177
Particle_T ParticleType
The particle type for this cell.
Definition: ParticleCell.h:56
This class handles the storage of particles in their full form.
Definition: ReferenceParticleCell.h:24
This class defines a sorted view on a given ParticleCell.
Definition: SortedCellView.h:28
static void exception(const Exception e)
Handle an exception derived by std::exception.
Definition: ExceptionHandler.h:63
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32
CellType
The ParticleCell Type as an Enum.
Definition: ParticleCell.h:19
@ ClusterTower
ClusterTower : Tower for the 2D tower structure of VerletClusterLists.
@ IsNoCell
Currently unused.
OwnershipState
Enum that specifies the state of ownership.
Definition: OwnershipState.h:19
@ halo
Halo state, a particle with this state is an actual particle, but not owned by the current AutoPas ob...
@ owned
Owned state, a particle with this state is an actual particle and owned by the current AutoPas object...