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

This class represents a cluster in the VerletClusterLists container. More...

#include <Cluster.h>

Public Member Functions

 Cluster (Particle_T *firstParticle, size_t clusterSize)
 Constructs a cluster starting from firstParticle and going on for clusterSize particles.
 
Particle_T & operator[] (size_t index)
 Returns the particle at position index in the cluster.
 
const Particle_T & operator[] (size_t index) const
 Returns the particle at position index in the cluster.
 
bool empty () const
 Indicates if the cluster contains any non-dummy particles.
 
std::tuple< double, double, bool > getZMinMax () const
 Get Minimum and Maximum of the particles in z-direction.
 
auto getSoAView ()
 Returns the SoAView for this cluster.
 
void setSoAView (const SoAView< typename Particle_T::SoAArraysType > &view)
 Set the SoAView for this cluster.
 
void setNeighborList (std::vector< Cluster< Particle_T > * > *neighborList)
 Set the internal neighbor list pointer to an allocated, but not necessarily complete, existing list.
 
std::vector< Cluster< Particle_T > * > * getNeighbors ()
 Returns the reference to the neighbor list for this cluster.
 
void addNeighbor (Cluster< Particle_T > &neighbor)
 Adds the given cluster to the neighbor list of this cluster.
 
void clearNeighbors ()
 Remove all neighbors.
 
void reset (Particle_T *firstParticle)
 
std::tuple< std::array< double, 3 >, std::array< double, 3 > > getBoundingBox () const
 Get the bounding box of this cluster.
 

Detailed Description

template<class Particle_T>
class autopas::internal::Cluster< Particle_T >

This class represents a cluster in the VerletClusterLists container.

It contains a pointer to the particles for AoS, a SoAView for SoA, and the neighbor list for this cluster.

Template Parameters
Particle_TThe type of the particles this cluster consists of.
clusterSizeThe number of particles in the cluster.

Constructor & Destructor Documentation

◆ Cluster()

template<class Particle_T >
autopas::internal::Cluster< Particle_T >::Cluster ( Particle_T *  firstParticle,
size_t  clusterSize 
)
inlineexplicit

Constructs a cluster starting from firstParticle and going on for clusterSize particles.

Caller is responsible that there are enough particles after this particle in memory.

Parameters
firstParticleA pointer to the first particle of the cluster.
clusterSizeNumber of particles in the cluster.

Member Function Documentation

◆ addNeighbor()

template<class Particle_T >
void autopas::internal::Cluster< Particle_T >::addNeighbor ( Cluster< Particle_T > &  neighbor)
inline

Adds the given cluster to the neighbor list of this cluster.

Parameters
neighborThe cluster to add as neighbor.

◆ empty()

template<class Particle_T >
bool autopas::internal::Cluster< Particle_T >::empty ( ) const
inline

Indicates if the cluster contains any non-dummy particles.

Returns
True if only dummy particles are present in the cluster.

◆ getBoundingBox()

template<class Particle_T >
std::tuple< std::array< double, 3 >, std::array< double, 3 > > autopas::internal::Cluster< Particle_T >::getBoundingBox ( ) const
inline

Get the bounding box of this cluster.

Returns
tuple<lowerCorner, upperCorner>

◆ getNeighbors()

template<class Particle_T >
std::vector< Cluster< Particle_T > * > * autopas::internal::Cluster< Particle_T >::getNeighbors ( )
inline

Returns the reference to the neighbor list for this cluster.

Returns
reference to the neighbor list.

◆ getSoAView()

template<class Particle_T >
auto autopas::internal::Cluster< Particle_T >::getSoAView ( )
inline

Returns the SoAView for this cluster.

Returns
the SoAView for this cluster.

◆ getZMinMax()

template<class Particle_T >
std::tuple< double, double, bool > autopas::internal::Cluster< Particle_T >::getZMinMax ( ) const
inline

Get Minimum and Maximum of the particles in z-direction.

Note
This assumes that the particles are sorted along the z-direction!
Returns
Tuple of minimum and maximum in z-direction and bool indicating whether this cluster contains at least one proper particle.

◆ operator[]() [1/2]

template<class Particle_T >
Particle_T & autopas::internal::Cluster< Particle_T >::operator[] ( size_t  index)
inline

Returns the particle at position index in the cluster.

No index checking is performed!

Parameters
indexThe index of the particle to return.
Returns
the particle at position index in the cluster.

◆ operator[]() [2/2]

template<class Particle_T >
const Particle_T & autopas::internal::Cluster< Particle_T >::operator[] ( size_t  index) const
inline

Returns the particle at position index in the cluster.

No index checking is performed!

Parameters
indexThe index of the particle to return.
Returns
the particle at position index in the cluster.

◆ reset()

template<class Particle_T >
void autopas::internal::Cluster< Particle_T >::reset ( Particle_T *  firstParticle)
inline
Parameters
firstParticle

◆ setNeighborList()

template<class Particle_T >
void autopas::internal::Cluster< Particle_T >::setNeighborList ( std::vector< Cluster< Particle_T > * > *  neighborList)
inline

Set the internal neighbor list pointer to an allocated, but not necessarily complete, existing list.

Parameters
neighborListAllocated neighbor list.

◆ setSoAView()

template<class Particle_T >
void autopas::internal::Cluster< Particle_T >::setSoAView ( const SoAView< typename Particle_T::SoAArraysType > &  view)
inline

Set the SoAView for this cluster.

Parameters
viewthe new SoAView for this cluster.

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