AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
autopas::ParticleContainerInterface< Particle_T > Class Template Referenceabstract

The ParticleContainerInterface class provides a basic interface for all Containers within AutoPas. More...

#include <ParticleContainerInterface.h>

Inheritance diagram for autopas::ParticleContainerInterface< Particle_T >:
Inheritance graph
[legend]

Public Types

using ParticleType = Particle_T
 Type of the Particle.
 

Public Member Functions

virtual CellType getParticleCellTypeEnum () const =0
 Get the ParticleCell type as an Enum.
 
 ParticleContainerInterface (double skin)
 Constructor.
 
virtual ~ParticleContainerInterface ()=default
 Destructor of ParticleContainerInterface.
 
 ParticleContainerInterface (const ParticleContainerInterface &obj)=delete
 Delete the copy constructor to prevent unwanted copies.
 
ParticleContainerInterfaceoperator= (const ParticleContainerInterface &other)=delete
 Delete the copy assignment operator to prevent unwanted copies.
 
virtual ContainerOption getContainerType () const =0
 Get the ContainerType.
 
virtual void reserve (size_t numParticles, size_t numParticlesHaloEstimate)=0
 Reserve memory for a given number of particles in the container and logic layers.
 
template<bool checkInBox = true>
void addParticle (const Particle_T &p)
 Adds a particle to the container.
 
template<bool checkInBox = true>
void addHaloParticle (const Particle_T &haloParticle)
 Adds a particle to the container that lies in the halo region of the container.
 
virtual bool updateHaloParticle (const Particle_T &haloParticle)=0
 Update a halo particle of the container with the given haloParticle.
 
virtual void rebuildNeighborLists (TraversalInterface *traversal)=0
 Rebuilds the neighbor lists for the next traversals.
 
virtual void deleteHaloParticles ()=0
 Deletes all halo particles.
 
virtual void deleteAllParticles ()=0
 Deletes all particles.
 
virtual size_t getNumberOfParticles (IteratorBehavior behavior=IteratorBehavior::owned) const =0
 Get the number of particles with respect to the specified IteratorBehavior.
 
virtual size_t size () const =0
 Get the total number of particles saved in the container (owned + halo + dummy).
 
virtual ContainerIterator< ParticleType, true, false > begin (IteratorBehavior behavior=autopas::IteratorBehavior::ownedOrHalo, typename ContainerIterator< ParticleType, true, false >::ParticleVecType *additionalVectors=nullptr)=0
 Iterate over all particles using for(auto iter = container.begin(); iter.isValid(); ++iter) .
 
virtual ContainerIterator< ParticleType, false, false > begin (IteratorBehavior behavior=autopas::IteratorBehavior::ownedOrHalo, typename ContainerIterator< ParticleType, false, false >::ParticleVecType *additionalVectors=nullptr) const =0
 Iterate over all particles using for(auto iter = container.begin(); iter.isValid(); ++iter) .
 
virtual ContainerIterator< ParticleType, false, false > cbegin (IteratorBehavior behavior=autopas::IteratorBehavior::ownedOrHalo, typename ContainerIterator< ParticleType, false, false >::ParticleVecType *additionalVectors=nullptr) const final
 Iterate over all particles using for(auto iter = container.begin(); iter.isValid(); ++iter) .
 
virtual ContainerIterator< ParticleType, true, true > getRegionIterator (const std::array< double, 3 > &lowerCorner, const std::array< double, 3 > &higherCorner, IteratorBehavior behavior, typename ContainerIterator< ParticleType, true, true >::ParticleVecType *additionalVectors=nullptr)=0
 Iterate over all particles in a specified region for(auto iter = container.getRegionIterator(lowCorner, highCorner);iter.isValid();++iter) .
 
virtual ContainerIterator< ParticleType, false, true > getRegionIterator (const std::array< double, 3 > &lowerCorner, const std::array< double, 3 > &higherCorner, IteratorBehavior behavior, typename ContainerIterator< ParticleType, false, true >::ParticleVecType *additionalVectors=nullptr) const =0
 Iterate over all particles in a specified region for(auto iter = container.getRegionIterator(lowCorner, highCorner);iter.isValid();++iter) .
 
constexpr bool end () const
 Dummy to make range-based for loops work.
 
virtual void computeInteractions (TraversalInterface *traversal)=0
 Iterates over all particle multiples (e.g.
 
virtual const std::array< double, 3 > & getBoxMax () const =0
 Get the upper corner of the container without halo.
 
virtual const std::array< double, 3 > & getBoxMin () const =0
 Get the lower corner of the container without halo.
 
virtual double getCutoff () const =0
 Return the cutoff of the container.
 
virtual void setCutoff (double cutoff)=0
 Set the cutoff of the container.
 
virtual double getVerletSkin () const =0
 Return the verletSkin of the container verletSkin.
 
virtual size_t getStepsSinceLastRebuild () const
 Return the number of time-steps since last neighbor list rebuild.
 
virtual void setStepsSinceLastRebuild (size_t stepsSinceLastRebuild)
 Set the number of time-steps since last neighbor list rebuild.
 
virtual double getInteractionLength () const =0
 Return the interaction length (cutoff+skin) of the container.
 
virtual std::vector< ParticleTypeupdateContainer (bool keepNeighborListsValid)=0
 Updates the container.
 
virtual TraversalSelectorInfo getTraversalSelectorInfo () const =0
 Generates a traversal selector info for this container.
 
std::set< TraversalOption > getAllTraversals (const InteractionTypeOption interactionType) const
 Generates a list of all traversals that are theoretically applicable to this container.
 
virtual std::tuple< const Particle_T *, size_t, size_t > getParticle (size_t cellIndex, size_t particleIndex, IteratorBehavior iteratorBehavior) const =0
 Fetch the pointer to a particle, identified via a cell and particle index.
 
virtual std::tuple< const Particle_T *, size_t, size_t > getParticle (size_t cellIndex, size_t particleIndex, IteratorBehavior iteratorBehavior, const std::array< double, 3 > &boxMin, const std::array< double, 3 > &boxMax) const =0
 Fetch the pointer to a particle, identified via a cell and particle index.
 
std::tuple< Particle_T *, size_t, size_t > getParticle (size_t cellIndex, size_t particleIndex, IteratorBehavior iteratorBehavior, const std::array< double, 3 > &boxMin, const std::array< double, 3 > &boxMax)
 Fetch the pointer to a particle, identified via a cell and particle index.
 
std::tuple< Particle_T *, size_t, size_t > getParticle (size_t cellIndex, size_t particleIndex, IteratorBehavior iteratorBehavior)
 Fetch the pointer to a particle, identified via a cell and particle index.
 
virtual bool deleteParticle (Particle_T &particle)=0
 Deletes the given particle as long as this does not compromise the validity of the container.
 
virtual bool deleteParticle (size_t cellIndex, size_t particleIndex)=0
 Deletes the particle at the given index positions as long as this does not compromise the validity of the container.
 

Protected Member Functions

virtual void addParticleImpl (const Particle_T &p)=0
 Adds a particle to the container.
 
virtual void addHaloParticleImpl (const Particle_T &haloParticle)=0
 Adds a particle to the container that lies in the halo region of the container.
 

Protected Attributes

size_t _stepsSinceLastRebuild {0}
 Stores the number of time-steps since last neighbor list rebuild.
 
double _skin
 Skin distance a particle is allowed to move in one time-step.
 

Detailed Description

template<class Particle_T>
class autopas::ParticleContainerInterface< Particle_T >

The ParticleContainerInterface class provides a basic interface for all Containers within AutoPas.

It defines method interfaces for addition and deletion of particles, accessing general container properties and creating iterators.

Template Parameters
Particle_TClass for particle.

Constructor & Destructor Documentation

◆ ParticleContainerInterface() [1/2]

template<class Particle_T >
autopas::ParticleContainerInterface< Particle_T >::ParticleContainerInterface ( double  skin)
inline

Constructor.

Parameters
skinSkin distance a particle is allowed to move.

◆ ParticleContainerInterface() [2/2]

template<class Particle_T >
autopas::ParticleContainerInterface< Particle_T >::ParticleContainerInterface ( const ParticleContainerInterface< Particle_T > &  obj)
delete

Delete the copy constructor to prevent unwanted copies.

No particle container should ever be copied.

Parameters
obj

Member Function Documentation

◆ addHaloParticle()

template<class Particle_T >
template<bool checkInBox = true>
void autopas::ParticleContainerInterface< Particle_T >::addHaloParticle ( const Particle_T &  haloParticle)
inline

Adds a particle to the container that lies in the halo region of the container.

Parameters
haloParticleParticle to be added.
Template Parameters
checkInBoxSpecifies whether a boundary check should be performed. Only disable this if the check has already been performed.
Todo:
do we want a check of the particle not being too far away in here as well?

◆ addHaloParticleImpl()

template<class Particle_T >
virtual void autopas::ParticleContainerInterface< Particle_T >::addHaloParticleImpl ( const Particle_T &  haloParticle)
protectedpure virtual

Adds a particle to the container that lies in the halo region of the container.

This is an unsafe version of addParticle() and does not perform a boundary check.

Parameters
haloParticleParticle to be added. This particle is already checked to be outside of the bounding box.
Note
Only call this function if the position of the particle is guaranteed to be outside of the bounding box!

Implemented in autopas::VerletClusterLists< Particle_T >, autopas::VerletListsLinkedBase< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, and autopas::LinkedCellsReferences< Particle_T >.

◆ addParticle()

template<class Particle_T >
template<bool checkInBox = true>
void autopas::ParticleContainerInterface< Particle_T >::addParticle ( const Particle_T &  p)
inline

Adds a particle to the container.

Template Parameters
checkInBoxSpecifies whether a boundary check should be performed. Only disable this if the check has already been performed.
Parameters
pThe particle to be added.

◆ addParticleImpl()

template<class Particle_T >
virtual void autopas::ParticleContainerInterface< Particle_T >::addParticleImpl ( const Particle_T &  p)
protectedpure virtual

Adds a particle to the container.

This is an unsafe version of addParticle() and does not perform a boundary check.

Parameters
pThe particle to be added. This particle is already checked to be inside of the bounding box.
Note
Only call this function if the position of the particle is guaranteed to be inside of the bounding box!

Implemented in autopas::VerletClusterLists< Particle_T >, autopas::VerletListsLinkedBase< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, and autopas::LinkedCellsReferences< Particle_T >.

◆ begin() [1/2]

template<class Particle_T >
virtual ContainerIterator< ParticleType, false, false > autopas::ParticleContainerInterface< Particle_T >::begin ( IteratorBehavior  behavior = autopas::IteratorBehavior::ownedOrHalo,
typename ContainerIterator< ParticleType, false, false >::ParticleVecType *  additionalVectors = nullptr 
) const
pure virtual

Iterate over all particles using for(auto iter = container.begin(); iter.isValid(); ++iter) .

Note
The default argument for behavior is necessary to enable range based for loops.
Parameters
behaviorBehavior of the iterator, see IteratorBehavior.
additionalVectorsVectors that should be included besides the container.
Returns
Iterator to the first particle.
Note
const version

Implemented in autopas::Octree< Particle_T >, autopas::VerletClusterLists< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, autopas::LinkedCellsReferences< Particle_T >, and autopas::VerletListsLinkedBase< Particle_T >.

◆ begin() [2/2]

template<class Particle_T >
virtual ContainerIterator< ParticleType, true, false > autopas::ParticleContainerInterface< Particle_T >::begin ( IteratorBehavior  behavior = autopas::IteratorBehavior::ownedOrHalo,
typename ContainerIterator< ParticleType, true, false >::ParticleVecType *  additionalVectors = nullptr 
)
pure virtual

Iterate over all particles using for(auto iter = container.begin(); iter.isValid(); ++iter) .

Note
The default argument for behavior is necessary to enable range based for loops.
Parameters
behaviorBehavior of the iterator, see IteratorBehavior.
additionalVectorsVectors that should be included besides the container.
Returns
Iterator to the first particle.

Implemented in autopas::Octree< Particle_T >, autopas::VerletClusterLists< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, autopas::LinkedCellsReferences< Particle_T >, and autopas::VerletListsLinkedBase< Particle_T >.

◆ cbegin()

template<class Particle_T >
virtual ContainerIterator< ParticleType, false, false > autopas::ParticleContainerInterface< Particle_T >::cbegin ( IteratorBehavior  behavior = autopas::IteratorBehavior::ownedOrHalo,
typename ContainerIterator< ParticleType, false, false >::ParticleVecType *  additionalVectors = nullptr 
) const
inlinefinalvirtual

Iterate over all particles using for(auto iter = container.begin(); iter.isValid(); ++iter) .

Note
The default argument for behavior is necessary to enable range based for loops.
Parameters
behaviorBehavior of the iterator, see IteratorBehavior.
additionalVectorsVectors that should be included besides the container.
Returns
Iterator to the first particle.
Note
cbegin will guarantee to return a const_iterator.

◆ computeInteractions()

template<class Particle_T >
virtual void autopas::ParticleContainerInterface< Particle_T >::computeInteractions ( TraversalInterface traversal)
pure virtual

◆ deleteAllParticles()

template<class Particle_T >
virtual void autopas::ParticleContainerInterface< Particle_T >::deleteAllParticles ( )
pure virtual

◆ deleteHaloParticles()

template<class Particle_T >
virtual void autopas::ParticleContainerInterface< Particle_T >::deleteHaloParticles ( )
pure virtual

◆ deleteParticle() [1/2]

template<class Particle_T >
virtual bool autopas::ParticleContainerInterface< Particle_T >::deleteParticle ( Particle_T &  particle)
pure virtual

Deletes the given particle as long as this does not compromise the validity of the container.

If this is not possible the particle is just marked as deleted.

Note
This function might be implemented via swap-delete and is thus not completely thread safe.
Parameters
particleReference to the particle that is to be deleted.
Returns
True if the given pointer still points to a new particle.

Implemented in autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCellsReferences< Particle_T >, autopas::Octree< Particle_T >, autopas::VerletClusterLists< Particle_T >, autopas::VerletListsLinkedBase< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, and autopas::VerletClusterLists< ParticleCell::ParticleType >.

◆ deleteParticle() [2/2]

template<class Particle_T >
virtual bool autopas::ParticleContainerInterface< Particle_T >::deleteParticle ( size_t  cellIndex,
size_t  particleIndex 
)
pure virtual

Deletes the particle at the given index positions as long as this does not compromise the validity of the container.

If this is not possible the particle is just marked as deleted. If the positions do not exist the behavior is undefined.

Parameters
cellIndex
particleIndex
Returns
True if the given indices still point to a new particle.

Implemented in autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, autopas::LinkedCellsReferences< Particle_T >, autopas::Octree< Particle_T >, autopas::VerletClusterLists< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, and autopas::VerletListsLinkedBase< Particle_T >.

◆ end()

template<class Particle_T >
constexpr bool autopas::ParticleContainerInterface< Particle_T >::end ( ) const
inlineconstexpr

Dummy to make range-based for loops work.

Range-Based for loops use the incremented begin() expression and compare it against the end() expression. ContainerIterator implements ContainerIterator::operator==() that accepts a bool as right hand side argument, which is triggered by this end() function. This operator then proceeds to check the validity of the iterator itself.

Returns
false

◆ getAllTraversals()

template<class Particle_T >
std::set< TraversalOption > autopas::ParticleContainerInterface< Particle_T >::getAllTraversals ( const InteractionTypeOption  interactionType) const
inline

Generates a list of all traversals that are theoretically applicable to this container.

Traversals might still be not applicable for other reasons so call traversal.isApplicable to be safe!

Parameters
interactionTypeinteraction type for which to get all traversals
Returns
Vector of traversal options.

◆ getBoxMax()

template<class Particle_T >
virtual const std::array< double, 3 > & autopas::ParticleContainerInterface< Particle_T >::getBoxMax ( ) const
pure virtual

◆ getBoxMin()

template<class Particle_T >
virtual const std::array< double, 3 > & autopas::ParticleContainerInterface< Particle_T >::getBoxMin ( ) const
pure virtual

◆ getContainerType()

template<class Particle_T >
virtual ContainerOption autopas::ParticleContainerInterface< Particle_T >::getContainerType ( ) const
pure virtual

◆ getCutoff()

template<class Particle_T >
virtual double autopas::ParticleContainerInterface< Particle_T >::getCutoff ( ) const
pure virtual

◆ getInteractionLength()

template<class Particle_T >
virtual double autopas::ParticleContainerInterface< Particle_T >::getInteractionLength ( ) const
pure virtual

◆ getNumberOfParticles()

template<class Particle_T >
virtual size_t autopas::ParticleContainerInterface< Particle_T >::getNumberOfParticles ( IteratorBehavior  behavior = IteratorBehavior::owned) const
pure virtual

Get the number of particles with respect to the specified IteratorBehavior.

Warning
: Since this function counts the number of the respective particles in the internal particle storage, this is in O(n) + lock is required. Only use it when it is absolutely necessary to have the exact number of different particle types like owned or halo. If it is enough to have the whole number of particles (owned + halo + dummy), the function size() can be used.
Parameters
behaviorBehavior of the iterator, see IteratorBehavior.
Returns
The number of particles with respect to the specified IteratorBehavior.

Implemented in autopas::CellBasedParticleContainer< ParticleCell >, autopas::CellBasedParticleContainer< FullParticleCell< Particle_T > >, autopas::CellBasedParticleContainer< ReferenceParticleCell< Particle_T > >, autopas::CellBasedParticleContainer< OctreeNodeWrapper< Particle_T > >, autopas::CellBasedParticleContainer< FullParticleCell< ParticleCell::ParticleType > >, autopas::Octree< Particle_T >, autopas::VerletClusterLists< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, and autopas::VerletListsLinkedBase< Particle_T >.

◆ getParticle() [1/4]

template<class Particle_T >
std::tuple< Particle_T *, size_t, size_t > autopas::ParticleContainerInterface< Particle_T >::getParticle ( size_t  cellIndex,
size_t  particleIndex,
IteratorBehavior  iteratorBehavior 
)
inline

Fetch the pointer to a particle, identified via a cell and particle index.

These indices are only meaningful in the context of the current container at its current state. The same indices might (and probably will) yield different particles for different container types or might not even exist. The only guarantee is that the indices {0,0} yield the first particle in the container that satisfies the iterator requirements.

Note
This function should handle any offsets if used in a parallel iterator.
Parameters
cellIndexIndex of the cell the particle is located in.
particleIndexParticle index within the cell.
iteratorBehaviorWhich ownership states should be considered for the next particle.
Returns
Pointer to the particle and its indices. tuple<Particle_T*, cellIndex, particleIndex> If a index pair is given that does not exist but is also not beyond the last cell, the next fitting particle shall be returned. Example: If [4,2] does not exist, [5,1] shall be returned (or whatever is the next particle that fulfills the iterator requirements). If there is no next fitting particle {nullptr, 0, 0} is returned.
Note
non-const non-region iter version

◆ getParticle() [2/4]

template<class Particle_T >
virtual std::tuple< const Particle_T *, size_t, size_t > autopas::ParticleContainerInterface< Particle_T >::getParticle ( size_t  cellIndex,
size_t  particleIndex,
IteratorBehavior  iteratorBehavior 
) const
pure virtual

Fetch the pointer to a particle, identified via a cell and particle index.

These indices are only meaningful in the context of the current container at its current state. The same indices might (and probably will) yield different particles for different container types or might not even exist. The only guarantee is that the indices {0,0} yield the first particle in the container that satisfies the iterator requirements.

Note
This function should handle any offsets if used in a parallel iterator.
Parameters
cellIndexIndex of the cell the particle is located in.
particleIndexParticle index within the cell.
iteratorBehaviorWhich ownership states should be considered for the next particle.
Returns
Pointer to the particle and its indices. tuple<Particle_T*, cellIndex, particleIndex> If a index pair is given that does not exist but is also not beyond the last cell, the next fitting particle shall be returned. Example: If [4,2] does not exist, [5,1] shall be returned (or whatever is the next particle that fulfills the iterator requirements). If there is no next fitting particle {nullptr, 0, 0} is returned.

Implemented in autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, autopas::LinkedCellsReferences< Particle_T >, autopas::Octree< Particle_T >, autopas::VerletClusterLists< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, and autopas::VerletListsLinkedBase< Particle_T >.

◆ getParticle() [3/4]

template<class Particle_T >
std::tuple< Particle_T *, size_t, size_t > autopas::ParticleContainerInterface< Particle_T >::getParticle ( size_t  cellIndex,
size_t  particleIndex,
IteratorBehavior  iteratorBehavior,
const std::array< double, 3 > &  boxMin,
const std::array< double, 3 > &  boxMax 
)
inline

Fetch the pointer to a particle, identified via a cell and particle index.

These indices are only meaningful in the context of the current container at its current state. The same indices might (and probably will) yield different particles for different container types or might not even exist. The only guarantee is that the indices {0,0} yield the first particle in the container that satisfies the iterator requirements.

Note
This function should handle any offsets if used in a parallel iterator.
Parameters
cellIndexIndex of the cell the particle is located in.
particleIndexParticle index within the cell.
iteratorBehaviorWhich ownership states should be considered for the next particle.
Returns
Pointer to the particle and its indices. tuple<Particle_T*, cellIndex, particleIndex> If a index pair is given that does not exist but is also not beyond the last cell, the next fitting particle shall be returned. Example: If [4,2] does not exist, [5,1] shall be returned (or whatever is the next particle that fulfills the iterator requirements). If there is no next fitting particle {nullptr, 0, 0} is returned.
Parameters
boxMinstart of region in which the next particle should be. The coordinates are expected to be within the domain.
boxMaxend of region in which the next particle should be. The coordinates are expected to be within the domain.
Note
non-const region iter version

◆ getParticle() [4/4]

template<class Particle_T >
virtual std::tuple< const Particle_T *, size_t, size_t > autopas::ParticleContainerInterface< Particle_T >::getParticle ( size_t  cellIndex,
size_t  particleIndex,
IteratorBehavior  iteratorBehavior,
const std::array< double, 3 > &  boxMin,
const std::array< double, 3 > &  boxMax 
) const
pure virtual

Fetch the pointer to a particle, identified via a cell and particle index.

These indices are only meaningful in the context of the current container at its current state. The same indices might (and probably will) yield different particles for different container types or might not even exist. The only guarantee is that the indices {0,0} yield the first particle in the container that satisfies the iterator requirements.

Note
This function should handle any offsets if used in a parallel iterator.
Parameters
cellIndexIndex of the cell the particle is located in.
particleIndexParticle index within the cell.
iteratorBehaviorWhich ownership states should be considered for the next particle.
Returns
Pointer to the particle and its indices. tuple<Particle_T*, cellIndex, particleIndex> If a index pair is given that does not exist but is also not beyond the last cell, the next fitting particle shall be returned. Example: If [4,2] does not exist, [5,1] shall be returned (or whatever is the next particle that fulfills the iterator requirements). If there is no next fitting particle {nullptr, 0, 0} is returned.
Parameters
boxMinstart of region in which the next particle should be. The coordinates are expected to be within the domain.
boxMaxend of region in which the next particle should be. The coordinates are expected to be within the domain.

Implemented in autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, autopas::LinkedCellsReferences< Particle_T >, autopas::Octree< Particle_T >, autopas::VerletClusterLists< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, and autopas::VerletListsLinkedBase< Particle_T >.

◆ getParticleCellTypeEnum()

template<class Particle_T >
virtual CellType autopas::ParticleContainerInterface< Particle_T >::getParticleCellTypeEnum ( ) const
pure virtual

◆ getRegionIterator() [1/2]

template<class Particle_T >
virtual ContainerIterator< ParticleType, false, true > autopas::ParticleContainerInterface< Particle_T >::getRegionIterator ( const std::array< double, 3 > &  lowerCorner,
const std::array< double, 3 > &  higherCorner,
IteratorBehavior  behavior,
typename ContainerIterator< ParticleType, false, true >::ParticleVecType *  additionalVectors = nullptr 
) const
pure virtual

Iterate over all particles in a specified region for(auto iter = container.getRegionIterator(lowCorner, highCorner);iter.isValid();++iter) .

Parameters
lowerCornerLower corner of the region
higherCornerHigher corner of the region
behaviorThe behavior of the iterator (shall it iterate over halo particles as well?).
additionalVectorsVectors that should be included besides the container.
Returns
Iterator to iterate over all particles in a specific region.
Note
const version

Implemented in autopas::Octree< Particle_T >, autopas::VerletClusterLists< Particle_T >, autopas::VerletListsLinkedBase< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, and autopas::LinkedCellsReferences< Particle_T >.

◆ getRegionIterator() [2/2]

template<class Particle_T >
virtual ContainerIterator< ParticleType, true, true > autopas::ParticleContainerInterface< Particle_T >::getRegionIterator ( const std::array< double, 3 > &  lowerCorner,
const std::array< double, 3 > &  higherCorner,
IteratorBehavior  behavior,
typename ContainerIterator< ParticleType, true, true >::ParticleVecType *  additionalVectors = nullptr 
)
pure virtual

Iterate over all particles in a specified region for(auto iter = container.getRegionIterator(lowCorner, highCorner);iter.isValid();++iter) .

Parameters
lowerCornerLower corner of the region
higherCornerHigher corner of the region
behaviorThe behavior of the iterator (shall it iterate over halo particles as well?).
additionalVectorsVectors that should be included besides the container.
Returns
Iterator to iterate over all particles in a specific region.

Implemented in autopas::Octree< Particle_T >, autopas::VerletClusterLists< Particle_T >, autopas::VerletListsLinkedBase< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, and autopas::LinkedCellsReferences< Particle_T >.

◆ getStepsSinceLastRebuild()

template<class Particle_T >
virtual size_t autopas::ParticleContainerInterface< Particle_T >::getStepsSinceLastRebuild ( ) const
inlinevirtual

Return the number of time-steps since last neighbor list rebuild.

Note
: The value has to be set by setStepsSinceLastRebuild() from outside the container. Otherwise this will always return 0
Returns
steps since last rebuild

◆ getTraversalSelectorInfo()

template<class Particle_T >
virtual TraversalSelectorInfo autopas::ParticleContainerInterface< Particle_T >::getTraversalSelectorInfo ( ) const
pure virtual

◆ getVerletSkin()

template<class Particle_T >
virtual double autopas::ParticleContainerInterface< Particle_T >::getVerletSkin ( ) const
pure virtual

◆ operator=()

template<class Particle_T >
ParticleContainerInterface & autopas::ParticleContainerInterface< Particle_T >::operator= ( const ParticleContainerInterface< Particle_T > &  other)
delete

Delete the copy assignment operator to prevent unwanted copies.

No particle container should ever be copied.

Parameters
other
Returns

◆ rebuildNeighborLists()

template<class Particle_T >
virtual void autopas::ParticleContainerInterface< Particle_T >::rebuildNeighborLists ( TraversalInterface traversal)
pure virtual

◆ reserve()

template<class Particle_T >
virtual void autopas::ParticleContainerInterface< Particle_T >::reserve ( size_t  numParticles,
size_t  numParticlesHaloEstimate 
)
pure virtual

Reserve memory for a given number of particles in the container and logic layers.

This function assumes a uniform distribution of particles throughout the domain. For example, this means that in a LinkedCells Container in each cell vector.reserve(numParticles/numCells) is called.

Note
This functions will create an estimate for the number of halo particles.
Parameters
numParticlesNo buffer factor is applied. It is probably wise to slightly over-reserve to account for imbalance or particle movement.
numParticlesHaloEstimateEstimate for the number of halo particles. Reserves space in the container data structure.

Implemented in autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, autopas::LinkedCellsReferences< Particle_T >, autopas::Octree< Particle_T >, autopas::VerletClusterLists< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, and autopas::VerletListsLinkedBase< Particle_T >.

◆ setCutoff()

template<class Particle_T >
virtual void autopas::ParticleContainerInterface< Particle_T >::setCutoff ( double  cutoff)
pure virtual

◆ setStepsSinceLastRebuild()

template<class Particle_T >
virtual void autopas::ParticleContainerInterface< Particle_T >::setStepsSinceLastRebuild ( size_t  stepsSinceLastRebuild)
inlinevirtual

Set the number of time-steps since last neighbor list rebuild.

Parameters
stepsSinceLastRebuildsteps since last neighbor list rebuild

Reimplemented in autopas::VerletListsLinkedBase< Particle_T >.

◆ size()

template<class Particle_T >
virtual size_t autopas::ParticleContainerInterface< Particle_T >::size ( ) const
pure virtual

◆ updateContainer()

template<class Particle_T >
virtual std::vector< ParticleType > autopas::ParticleContainerInterface< Particle_T >::updateContainer ( bool  keepNeighborListsValid)
pure virtual

Updates the container.

This deletes halo particles, resorts particles into appropriate cells and might remove particles from the container, if necessary.

Parameters
keepNeighborListsValidDefines whether the neighbor lists have to be kept valid.
Returns
A vector of invalid particles that do not belong into the container.

Implemented in autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, autopas::LinkedCellsReferences< Particle_T >, autopas::VerletClusterLists< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, autopas::VerletListsLinkedBase< Particle_T >, and autopas::Octree< Particle_T >.

◆ updateHaloParticle()

template<class Particle_T >
virtual bool autopas::ParticleContainerInterface< Particle_T >::updateHaloParticle ( const Particle_T &  haloParticle)
pure virtual

Update a halo particle of the container with the given haloParticle.

Parameters
haloParticleParticle to be updated.
Returns
Returns true if the particle was updated, false if no particle could be found.

Implemented in autopas::VerletClusterLists< Particle_T >, autopas::VerletListsLinkedBase< Particle_T >, autopas::VerletClusterLists< ParticleCell::ParticleType >, autopas::DirectSum< Particle_T >, autopas::LinkedCells< Particle_T >, autopas::LinkedCells< ParticleCell::ParticleType >, and autopas::LinkedCellsReferences< Particle_T >.

Member Data Documentation

◆ _stepsSinceLastRebuild

template<class Particle_T >
size_t autopas::ParticleContainerInterface< Particle_T >::_stepsSinceLastRebuild {0}
protected

Stores the number of time-steps since last neighbor list rebuild.

Note
: The value has to be set by setStepsSinceLastRebuild() from outside the container. Otherwise this will always be 0

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