AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
autopas::OTC01Traversal< Particle_T, PairwiseFunctor > Class Template Reference

This traversal is capable of iterating over particles stored in the Octree data structure. More...

#include <OTC01Traversal.h>

Inheritance diagram for autopas::OTC01Traversal< Particle_T, PairwiseFunctor >:
Inheritance graph
[legend]
Collaboration diagram for autopas::OTC01Traversal< Particle_T, PairwiseFunctor >:
Collaboration graph
[legend]

Public Types

using ParticleCell = OctreeLeafNode< Particle_T >
 A shortcut to specify the type of the actual iterated cell.
 

Public Member Functions

 OTC01Traversal (PairwiseFunctor *pairwiseFunctor, double cutoff, double interactionLength, DataLayoutOption dataLayout, bool useNewton3)
 Constructor for the Octree traversal.
 
TraversalOption getTraversalType () const override
 Return a enum representing the name of the traversal class.
 
bool isApplicable () const override
 Checks if the traversal is applicable to the current state of the domain.
 
void initTraversal () override
 Initializes the traversal.
 
void endTraversal () override
 Finalizes the traversal.
 
void traverseParticles () override
 Traverse the particles by pairs, triplets etc.
 
void setSortingThreshold (size_t sortingThreshold) override
 Set the sorting-threshold for traversals that use the CellFunctor If the sum of the number of particles in two cells is greater or equal to that value, the CellFunctor creates a sorted view of the particles to avoid unnecessary distance checks.
 
- Public Member Functions inherited from autopas::CellTraversal< OctreeLeafNode< Particle_T > >
 CellTraversal (const std::array< unsigned long, 3 > &dims)
 Constructor of CellTraversal.
 
virtual ~CellTraversal ()=default
 Destructor of CellTraversal.
 
virtual void setCellsToTraverse (std::vector< OctreeLeafNode< Particle_T > > &cells)
 Sets the cells to iterate over.
 
virtual void setSortingThreshold (size_t sortingThreshold)=0
 Set the sorting-threshold for traversals that use the CellFunctor If the sum of the number of particles in two cells is greater or equal to that value, the CellFunctor creates a sorted view of the particles to avoid unnecessary distance checks.
 
- Public Member Functions inherited from autopas::OTTraversalInterface< OctreeNodeWrapper< Particle_T > >
 OTTraversalInterface (double interactionLength, DataLayoutOption dataLayout, bool useNewton3)
 Create a new traversal interface, which provides functionality that is required by all octree traversals.
 
void setCells (std::vector< OctreeNodeWrapper< ParticleType > > *cells)
 Notify the traversal about the cells that it is able to traverse.
 
- Public Member Functions inherited from autopas::TraversalInterface
virtual ~TraversalInterface ()=default
 Destructor of TraversalInterface.
 
 TraversalInterface (DataLayoutOption dataLayout, bool useNewton3)
 Constructor of the TraversalInterface.
 
virtual TraversalOption getTraversalType () const =0
 Return a enum representing the name of the traversal class.
 
virtual bool isApplicable () const =0
 Checks if the traversal is applicable to the current state of the domain.
 
virtual void initTraversal ()=0
 Initializes the traversal.
 
virtual void traverseParticles ()=0
 Traverse the particles by pairs, triplets etc.
 
virtual void endTraversal ()=0
 Finalizes the traversal.
 
bool getUseNewton3 () const
 Return whether the traversal uses newton 3.
 
DataLayoutOption getDataLayout () const
 Return the data layout option.
 

Additional Inherited Members

- Protected Member Functions inherited from autopas::OTTraversalInterface< OctreeNodeWrapper< Particle_T > >
void loadBuffers (utils::DataLayoutConverter< PairwiseFunctor > &dataLayoutConverter, OctreeNodeWrapper< ParticleType > *wrapper, std::vector< OctreeLeafNode< ParticleType > * > &leaves)
 Gather all leaves and load the SoA/AoS buffers.
 
void unloadBuffers (utils::DataLayoutConverter< PairwiseFunctor > &dataLayoutConverter, std::vector< OctreeLeafNode< ParticleType > * > &leaves)
 Unload the SoA/AoS buffers and clear the gathered leaves list.
 
OctreeNodeWrapper< ParticleType > * getOwned ()
 Get the octree cell that contains the owned octree.
 
OctreeNodeWrapper< ParticleType > * getHalo ()
 Get the octree cell that contains the halo octree.
 
- Protected Attributes inherited from autopas::CellTraversal< OctreeLeafNode< Particle_T > >
std::array< unsigned long, 3 > _cellsPerDimension
 The dimensions of the cellblock.
 
std::vector< OctreeLeafNode< Particle_T > > * _cells
 The cells to traverse.
 
- Protected Attributes inherited from autopas::OTTraversalInterface< OctreeNodeWrapper< Particle_T > >
std::vector< OctreeNodeWrapper< ParticleType > > * _cells
 A list containing two cells.
 
std::vector< OctreeLeafNode< ParticleType > * > _ownedLeaves
 A list of all leaves in the owned octree.
 
std::vector< OctreeLeafNode< ParticleType > * > _haloLeaves
 A list of all leaves in the halo octree.
 
double _interactionLength
 The interaction length is used for finding neighbors.
 
- Protected Attributes inherited from autopas::TraversalInterface
DataLayoutOption _dataLayout
 The datalayout used by this traversal.
 
bool _useNewton3
 If this traversal makes use of newton3.
 

Detailed Description

template<class Particle_T, class PairwiseFunctor>
class autopas::OTC01Traversal< Particle_T, PairwiseFunctor >

This traversal is capable of iterating over particles stored in the Octree data structure.

Template Parameters
Particle_T
PairwiseFunctor

Constructor & Destructor Documentation

◆ OTC01Traversal()

template<class Particle_T , class PairwiseFunctor >
autopas::OTC01Traversal< Particle_T, PairwiseFunctor >::OTC01Traversal ( PairwiseFunctor pairwiseFunctor,
double  cutoff,
double  interactionLength,
DataLayoutOption  dataLayout,
bool  useNewton3 
)
inlineexplicit

Constructor for the Octree traversal.

Parameters
pairwiseFunctorThe functor that defines the interaction of two particles.
cutoffcutoff (this is enough for the octree traversal, please don't use the interaction length here.)
interactionLengthThe minimum distance at which a force is considered nonzero, cutoff+skin.
dataLayoutThe data layout with which this traversal should be initialized.
useNewton3Parameter to specify whether the traversal makes use of newton3 or not.

Member Function Documentation

◆ endTraversal()

template<class Particle_T , class PairwiseFunctor >
void autopas::OTC01Traversal< Particle_T, PairwiseFunctor >::endTraversal ( )
inlineoverridevirtual

Finalizes the traversal.

Should be called after traverse().

Implements autopas::TraversalInterface.

◆ getTraversalType()

template<class Particle_T , class PairwiseFunctor >
TraversalOption autopas::OTC01Traversal< Particle_T, PairwiseFunctor >::getTraversalType ( ) const
inlineoverridevirtual

Return a enum representing the name of the traversal class.

Returns
Enum representing traversal.

Implements autopas::TraversalInterface.

◆ initTraversal()

template<class Particle_T , class PairwiseFunctor >
void autopas::OTC01Traversal< Particle_T, PairwiseFunctor >::initTraversal ( )
inlineoverridevirtual

Initializes the traversal.

Should be called before traverse().

Implements autopas::TraversalInterface.

◆ isApplicable()

template<class Particle_T , class PairwiseFunctor >
bool autopas::OTC01Traversal< Particle_T, PairwiseFunctor >::isApplicable ( ) const
inlineoverridevirtual

Checks if the traversal is applicable to the current state of the domain.

Returns
true iff the traversal can be applied.

Implements autopas::TraversalInterface.

◆ setSortingThreshold()

template<class Particle_T , class PairwiseFunctor >
void autopas::OTC01Traversal< Particle_T, PairwiseFunctor >::setSortingThreshold ( size_t  sortingThreshold)
inlineoverridevirtual

Set the sorting-threshold for traversals that use the CellFunctor If the sum of the number of particles in two cells is greater or equal to that value, the CellFunctor creates a sorted view of the particles to avoid unnecessary distance checks.

Parameters
sortingThresholdSum of the number of particles in two cells from which sorting should be enabled

Implements autopas::CellTraversal< OctreeLeafNode< Particle_T > >.

◆ traverseParticles()

template<class Particle_T , class PairwiseFunctor >
void autopas::OTC01Traversal< Particle_T, PairwiseFunctor >::traverseParticles ( )
inlineoverridevirtual

Traverse the particles by pairs, triplets etc.

as determined by the Functor type.

Note
This function expects a vector of exactly two cells. First cell is the main region, second is halo.

Implements autopas::TraversalInterface.


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