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

Base class for Verlet lists which use an underlying linked cells container. More...

#include <VerletListsLinkedBase.h>

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

Public Member Functions

 VerletListsLinkedBase (const std::array< double, 3 > &boxMin, const std::array< double, 3 > &boxMax, const double cutoff, const double skin, const unsigned int rebuildFrequency, const std::set< TraversalOption > &applicableTraversals, const double cellSizeFactor)
 Constructor of the VerletListsLinkedBase class.
 
CellType getParticleCellTypeEnum () const override
 Get the ParticleCell type as an Enum.
 
void setStepsSinceLastRebuild (size_t stepsSinceLastRebuild) override
 Set the number of time-steps since last neighbor list rebuild.
 
void reserve (size_t numParticles, size_t numParticlesHaloEstimate) override
 Reserve memory for a given number of particles in the container and logic layers.
 
void addParticleImpl (const Particle_T &p) override
 Adds a particle to the container.
 
void addHaloParticleImpl (const Particle_T &haloParticle) override
 Adds a particle to the container that lies in the halo region of the container.
 
size_t size () const override
 Get the total number of particles saved in the container (owned + halo + dummy).
 
size_t getNumberOfParticles (IteratorBehavior behavior) const override
 Get the number of particles with respect to the specified IteratorBehavior.
 
void deleteHaloParticles () override
 Deletes all halo particles.
 
void deleteAllParticles () override
 Deletes all particles.
 
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 override
 Fetch the pointer to a particle, identified via a cell and particle index.
 
std::tuple< const Particle_T *, size_t, size_t > getParticle (size_t cellIndex, size_t particleIndex, IteratorBehavior iteratorBehavior) const override
 Fetch the pointer to a particle, identified via a cell and particle index.
 
template<bool regionIter>
std::tuple< const Particle_T *, size_t, size_t > getParticleImpl (size_t cellIndex, size_t particleIndex, IteratorBehavior iteratorBehavior, const std::array< double, 3 > &boxMin, const std::array< double, 3 > &boxMax) const
 Container specific implementation for getParticle.
 
bool deleteParticle (Particle_T &particle) override
 Deletes the given particle as long as this does not compromise the validity of the container.
 
bool deleteParticle (size_t cellIndex, size_t particleIndex) override
 Deletes the particle at the given index positions as long as this does not compromise the validity of the container.
 
std::vector< Particle_T > updateContainer (bool keepNeighborListsValid) override
 Updates the container.
 
bool updateHaloParticle (const Particle_T &haloParticle) override
 Searches the provided halo particle and updates the found particle.
 
ContainerIterator< Particle_T, true, false > begin (IteratorBehavior behavior=IteratorBehavior::ownedOrHalo, typename ContainerIterator< Particle_T, true, false >::ParticleVecType *additionalVectors=nullptr) override
 Iterate over all particles using for(auto iter = container.begin(); iter.isValid(); ++iter) .
 
ContainerIterator< Particle_T, false, false > begin (IteratorBehavior behavior=IteratorBehavior::ownedOrHalo, typename ContainerIterator< Particle_T, false, false >::ParticleVecType *additionalVectors=nullptr) const override
 Iterate over all particles using for(auto iter = container.begin(); iter.isValid(); ++iter) .
 
template<typename Lambda >
void forEach (Lambda forEachLambda, IteratorBehavior behavior)
 Execute code on all particles in this container 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.
 
ContainerIterator< Particle_T, true, true > getRegionIterator (const std::array< double, 3 > &lowerCorner, const std::array< double, 3 > &higherCorner, IteratorBehavior behavior, typename ContainerIterator< Particle_T, true, true >::ParticleVecType *additionalVectors=nullptr) override
 Iterate over all particles in a specified region for(auto iter = container.getRegionIterator(lowCorner, highCorner);iter.isValid();++iter) .
 
ContainerIterator< Particle_T, false, true > getRegionIterator (const std::array< double, 3 > &lowerCorner, const std::array< double, 3 > &higherCorner, IteratorBehavior behavior, typename ContainerIterator< Particle_T, false, true >::ParticleVecType *additionalVectors=nullptr) const override
 Iterate over all particles in a specified region for(auto iter = container.getRegionIterator(lowCorner, highCorner);iter.isValid();++iter) .
 
template<typename Lambda >
void forEachInRegion (Lambda forEachLambda, const std::array< double, 3 > &lowerCorner, const std::array< double, 3 > &higherCorner, IteratorBehavior behavior)
 Execute code on all particles in this container in a certain region as defined by a lambda function.
 
template<typename Lambda , typename A >
void reduceInRegion (Lambda reduceLambda, A &result, const std::array< double, 3 > &lowerCorner, const std::array< double, 3 > &higherCorner, IteratorBehavior behavior)
 Execute code on all particles in this container in a certain region as defined by a lambda function.
 
const std::array< std::size_t, 3 > & getCellsPerDimension () const
 Get the dimension of the used cellblock including the haloboxes.
 
TraversalSelectorInfo getTraversalSelectorInfo () const override
 Generates a traversal selector info for this container.
 
const std::array< double, 3 > & getBoxMax () const final
 Get the upper corner of the container without halo.
 
const std::array< double, 3 > & getBoxMin () const final
 Get the lower corner of the container without halo.
 
double getCutoff () const final
 Return the cutoff of the container.
 
void setCutoff (double cutoff) final
 Set the cutoff of the container.
 
double getVerletSkin () const final
 Return the verletSkin of the container verletSkin.
 
double getInteractionLength () const final
 Return the interaction length (cutoff+skin) of the container.
 
- Public Member Functions inherited from autopas::ParticleContainerInterface< Particle_T >
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 Attributes

LinkedCells< Particle_T > _linkedCells
 internal linked cells storage, handles Particle storage and used to build verlet lists
 
std::atomic< bool > _neighborListIsValid {false}
 specifies if the neighbor list is currently valid
 
bool _verletBuiltNewton3 {false}
 specifies if the current verlet list was built for newton3
 
- Protected Attributes inherited from autopas::ParticleContainerInterface< Particle_T >
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.
 

Additional Inherited Members

- Public Types inherited from autopas::ParticleContainerInterface< Particle_T >
using ParticleType = Particle_T
 Type of the Particle.
 
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.
 

Detailed Description

template<class Particle_T>
class autopas::VerletListsLinkedBase< Particle_T >

Base class for Verlet lists which use an underlying linked cells container.

Implementation have to use a constant cutoff radius of the interaction. Cells are created using a cell size of at least cutoff + skin radius.

Template Parameters
Particle_T
LinkedParticleCellsParticleCells used by the linked cells container

Constructor & Destructor Documentation

◆ VerletListsLinkedBase()

template<class Particle_T >
autopas::VerletListsLinkedBase< Particle_T >::VerletListsLinkedBase ( const std::array< double, 3 > &  boxMin,
const std::array< double, 3 > &  boxMax,
const double  cutoff,
const double  skin,
const unsigned int  rebuildFrequency,
const std::set< TraversalOption > &  applicableTraversals,
const double  cellSizeFactor 
)
inline

Constructor of the VerletListsLinkedBase class.

The neighbor lists are build using a search radius of cutoff + skin.LinkedParticleCell::ParticleType *rebuildFrequency

Parameters
boxMinthe lower corner of the domain
boxMaxthe upper corner of the domain
cutoffthe cutoff radius of the interaction
skinthe skin radius
rebuildFrequencythe rebuild frequency.
applicableTraversalsall applicable traversals
cellSizeFactorcell size factor relative to cutoff. Verlet lists are only implemented for values >= 1.0 (smaller values are set to 1.0).

Member Function Documentation

◆ addHaloParticleImpl()

template<class Particle_T >
void autopas::VerletListsLinkedBase< Particle_T >::addHaloParticleImpl ( const Particle_T &  haloParticle)
inlineoverridevirtual

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!
This function invalidates the neighbor lists.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ addParticleImpl()

template<class Particle_T >
void autopas::VerletListsLinkedBase< Particle_T >::addParticleImpl ( const Particle_T &  p)
inlineoverridevirtual

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!
This function invalidates the neighbor lists.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ begin() [1/2]

template<class Particle_T >
ContainerIterator< Particle_T, false, false > autopas::VerletListsLinkedBase< Particle_T >::begin ( IteratorBehavior  behavior = IteratorBehavior::ownedOrHalo,
typename ContainerIterator< Particle_T, false, false >::ParticleVecType *  additionalVectors = nullptr 
) const
inlineoverridevirtual

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.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ begin() [2/2]

template<class Particle_T >
ContainerIterator< Particle_T, true, false > autopas::VerletListsLinkedBase< Particle_T >::begin ( IteratorBehavior  behavior = IteratorBehavior::ownedOrHalo,
typename ContainerIterator< Particle_T, true, false >::ParticleVecType *  additionalVectors = nullptr 
)
inlineoverridevirtual

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.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ deleteAllParticles()

template<class Particle_T >
void autopas::VerletListsLinkedBase< Particle_T >::deleteAllParticles ( )
inlineoverridevirtual

Deletes all particles.

Note
This function invalidates the neighbor lists.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ deleteHaloParticles()

template<class Particle_T >
void autopas::VerletListsLinkedBase< Particle_T >::deleteHaloParticles ( )
inlineoverridevirtual

Deletes all halo particles.

Note
This function invalidates the neighbor lists.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ deleteParticle() [1/2]

template<class Particle_T >
bool autopas::VerletListsLinkedBase< Particle_T >::deleteParticle ( Particle_T &  particle)
inlineoverridevirtual

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.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ deleteParticle() [2/2]

template<class Particle_T >
bool autopas::VerletListsLinkedBase< Particle_T >::deleteParticle ( size_t  cellIndex,
size_t  particleIndex 
)
inlineoverridevirtual

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.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ forEach()

template<class Particle_T >
template<typename Lambda >
void autopas::VerletListsLinkedBase< Particle_T >::forEach ( Lambda  forEachLambda,
IteratorBehavior  behavior 
)
inline

Execute code on all particles in this container as defined by a lambda function.

Template Parameters
Lambda(Particle_T &p) -> void
Parameters
forEachLambdacode to be executed on all particles
behavior
See also
IteratorBehavior

◆ forEachInRegion()

template<class Particle_T >
template<typename Lambda >
void autopas::VerletListsLinkedBase< Particle_T >::forEachInRegion ( Lambda  forEachLambda,
const std::array< double, 3 > &  lowerCorner,
const std::array< double, 3 > &  higherCorner,
IteratorBehavior  behavior 
)
inline

Execute code on all particles in this container in a certain region as defined by a lambda function.

Template Parameters
Lambda(Particle_T &p) -> void
Parameters
forEachLambdacode to be executed on all particles
lowerCornerlower corner of bounding box
higherCornerhigher corner of bounding box
behavior
See also
IteratorBehavior

◆ getBoxMax()

template<class Particle_T >
const std::array< double, 3 > & autopas::VerletListsLinkedBase< Particle_T >::getBoxMax ( ) const
inlinefinalvirtual

Get the upper corner of the container without halo.

Returns
Upper corner of the container.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ getBoxMin()

template<class Particle_T >
const std::array< double, 3 > & autopas::VerletListsLinkedBase< Particle_T >::getBoxMin ( ) const
inlinefinalvirtual

Get the lower corner of the container without halo.

Returns
Lower corner of the container.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ getCellsPerDimension()

template<class Particle_T >
const std::array< std::size_t, 3 > & autopas::VerletListsLinkedBase< Particle_T >::getCellsPerDimension ( ) const
inline

Get the dimension of the used cellblock including the haloboxes.

Returns
the dimensions of the used cellblock

◆ getCutoff()

template<class Particle_T >
double autopas::VerletListsLinkedBase< Particle_T >::getCutoff ( ) const
inlinefinalvirtual

Return the cutoff of the container.

Returns
Cutoff radius.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ getInteractionLength()

template<class Particle_T >
double autopas::VerletListsLinkedBase< Particle_T >::getInteractionLength ( ) const
inlinefinalvirtual

Return the interaction length (cutoff+skin) of the container.

Returns
interaction length

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ getNumberOfParticles()

template<class Particle_T >
size_t autopas::VerletListsLinkedBase< Particle_T >::getNumberOfParticles ( IteratorBehavior  behavior) const
inlineoverridevirtual

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.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ getParticle() [1/2]

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

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.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ getParticle() [2/2]

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

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.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ getParticleCellTypeEnum()

template<class Particle_T >
CellType autopas::VerletListsLinkedBase< Particle_T >::getParticleCellTypeEnum ( ) const
inlineoverridevirtual

Get the ParticleCell type as an Enum.

Returns
The Cell type as an Enum

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ getParticleImpl()

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

Container specific implementation for getParticle.

See ParticleContainerInterface::getParticle().

Template Parameters
regionIter
Parameters
cellIndex
particleIndex
iteratorBehavior
boxMin
boxMax
Returns
tuple<ParticlePointer, CellIndex, ParticleIndex>

◆ getRegionIterator() [1/2]

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

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.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ getRegionIterator() [2/2]

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

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.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ getTraversalSelectorInfo()

template<class Particle_T >
TraversalSelectorInfo autopas::VerletListsLinkedBase< Particle_T >::getTraversalSelectorInfo ( ) const
inlineoverridevirtual

Generates a traversal selector info for this container.

Returns
Traversal selector info for this container.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ getVerletSkin()

template<class Particle_T >
double autopas::VerletListsLinkedBase< Particle_T >::getVerletSkin ( ) const
inlinefinalvirtual

Return the verletSkin of the container verletSkin.

Returns
verletSkin

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ reduce()

template<class Particle_T >
template<typename Lambda , typename A >
void autopas::VerletListsLinkedBase< Particle_T >::reduce ( Lambda  reduceLambda,
A &  result,
IteratorBehavior  behavior 
)
inline

Reduce properties of particles as defined by a lambda function.

Template Parameters
Lambda(Particle_T p, A initialValue) -> void
Atype of particle attribute to be reduced
Parameters
reduceLambdacode to reduce properties of particles
resultreference to result of type A
behavior
See also
IteratorBehavior default:
IteratorBehavior::ownedOrHalo

◆ reduceInRegion()

template<class Particle_T >
template<typename Lambda , typename A >
void autopas::VerletListsLinkedBase< Particle_T >::reduceInRegion ( Lambda  reduceLambda,
A &  result,
const std::array< double, 3 > &  lowerCorner,
const std::array< double, 3 > &  higherCorner,
IteratorBehavior  behavior 
)
inline

Execute code on all particles in this container in a certain region as defined by a lambda function.

Template Parameters
Lambda(Particle_T &p, A &result) -> void
Atype of reduction Value
Parameters
reduceLambdacode to be executed on all particles
resultreference to starting and final value for reduction
lowerCornerlower corner of bounding box
higherCornerhigher corner of bounding box
behavior
See also
IteratorBehavior

◆ reserve()

template<class Particle_T >
void autopas::VerletListsLinkedBase< Particle_T >::reserve ( size_t  numParticles,
size_t  numParticlesHaloEstimate 
)
inlineoverridevirtual

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.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ setCutoff()

template<class Particle_T >
void autopas::VerletListsLinkedBase< Particle_T >::setCutoff ( double  cutoff)
inlinefinalvirtual

Set the cutoff of the container.

Parameters
cutoff

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ setStepsSinceLastRebuild()

template<class Particle_T >
void autopas::VerletListsLinkedBase< Particle_T >::setStepsSinceLastRebuild ( size_t  stepsSinceLastRebuild)
inlineoverridevirtual

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

Parameters
stepsSinceLastRebuildsteps since last neighbor list rebuild

Reimplemented from autopas::ParticleContainerInterface< Particle_T >.

◆ size()

template<class Particle_T >
size_t autopas::VerletListsLinkedBase< Particle_T >::size ( ) const
inlineoverridevirtual

Get the total number of particles saved in the container (owned + halo + dummy).

Returns
Number of particles saved in the container (owned + halo + dummy).

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ updateContainer()

template<class Particle_T >
std::vector< Particle_T > autopas::VerletListsLinkedBase< Particle_T >::updateContainer ( bool  keepNeighborListsValid)
inlineoverridevirtual

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.
Note
This function invalidates the neighbor lists.

Implements autopas::ParticleContainerInterface< Particle_T >.

◆ updateHaloParticle()

template<class Particle_T >
bool autopas::VerletListsLinkedBase< Particle_T >::updateHaloParticle ( const Particle_T &  haloParticle)
inlineoverridevirtual

Searches the provided halo particle and updates the found particle.

Searches for the provided particle within the halo cells of the container and overwrites the found particle with the provided particle.

Parameters
haloParticle
Returns
true if a particle was found and updated, false if it was not found.

Implements autopas::ParticleContainerInterface< Particle_T >.


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