AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
autopas::C18BasedTraversal< ParticleCell, Functor > Class Template Reference

This class provides the base for traversals using the c18 base step. More...

#include <C18BasedTraversal.h>

Inheritance diagram for autopas::C18BasedTraversal< ParticleCell, Functor >:
Inheritance graph
[legend]
Collaboration diagram for autopas::C18BasedTraversal< ParticleCell, Functor >:
Collaboration graph
[legend]

Public Member Functions

 C18BasedTraversal (const std::array< unsigned long, 3 > &dims, Functor *functor, const double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3)
 Constructor of the lc_c18 traversal.
 
- Public Member Functions inherited from autopas::ColorBasedTraversal< ParticleCell, Functor, collapseDepth >
void initTraversal () override
 load Data Layouts required for this Traversal if cells have been set through setCellsToTraverse().
 
void endTraversal () override
 write Data to AoS if cells have been set through setCellsToTraverse().
 
- Public Member Functions inherited from autopas::CellTraversal< ParticleCell >
 CellTraversal (const std::array< unsigned long, 3 > &dims)
 Constructor of CellTraversal.
 
virtual ~CellTraversal ()=default
 Destructor of CellTraversal.
 
virtual void setCellsToTraverse (std::vector< ParticleCell > &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::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.
 

Protected Member Functions

template<bool allCells, typename LoopBody >
void c18Traversal (LoopBody &&loopBody)
 The main traversal of the C18Traversal.
 
- Protected Member Functions inherited from autopas::ColorBasedTraversal< ParticleCell, Functor, collapseDepth >
 ColorBasedTraversal (const std::array< unsigned long, 3 > &dims, Functor *functor, const double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3)
 Constructor of the ColorBasedTraversal.
 
 ~ColorBasedTraversal () override=default
 Destructor of ColorBasedTraversal.
 
template<typename LoopBody >
void colorTraversal (LoopBody &&loopBody, const std::array< unsigned long, 3 > &end, const std::array< unsigned long, 3 > &stride, const std::array< unsigned long, 3 > &offset={0ul, 0ul, 0ul})
 The main traversal of the ColorBasedTraversal.
 
virtual void notifyColorChange (unsigned long newColor)
 This method is called when the color during the traversal has changed.
 

Additional Inherited Members

- Protected Attributes inherited from autopas::ColorBasedTraversal< ParticleCell, Functor, collapseDepth >
const double _interactionLength
 Interaction length (cutoff + skin).
 
const std::array< double, 3 > _cellLength
 cell length in CellBlock3D.
 
std::array< unsigned long, 3 > _overlap
 overlap of interacting cells.
 
- Protected Attributes inherited from autopas::CellTraversal< ParticleCell >
std::array< unsigned long, 3 > _cellsPerDimension
 The dimensions of the cellblock.
 
std::vector< ParticleCell > * _cells
 The cells to traverse.
 
- 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 ParticleCell, class Functor>
class autopas::C18BasedTraversal< ParticleCell, Functor >

This class provides the base for traversals using the c18 base step.

The traversal is defined in the function c18Traversal and uses 18 colors, such that interactions between the base cell and all adjacent cells with greater ID are safe, even when using newton3 optimizations.

Template Parameters
ParticleCellthe type of cells
FunctorThe functor that defines the interaction of two particles.

Constructor & Destructor Documentation

◆ C18BasedTraversal()

template<class ParticleCell , class Functor >
autopas::C18BasedTraversal< ParticleCell, Functor >::C18BasedTraversal ( const std::array< unsigned long, 3 > &  dims,
Functor functor,
const double  interactionLength,
const std::array< double, 3 > &  cellLength,
DataLayoutOption  dataLayout,
bool  useNewton3 
)
inlineexplicit

Constructor of the lc_c18 traversal.

Parameters
dimsThe dimensions of the cellblock, i.e. the number of cells in x, y and z direction.
functorThe functor that defines the interaction between particles.
interactionLengthInteraction length (cutoff + skin).
cellLengthcell length.
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

◆ c18Traversal()

template<class ParticleCell , class Functor >
template<bool allCells, typename LoopBody >
void autopas::C18BasedTraversal< ParticleCell, Functor >::c18Traversal ( LoopBody &&  loopBody)
inlineprotected

The main traversal of the C18Traversal.

This provides the structure of the loops and its parallelization.

Template Parameters
LoopBody
Parameters
loopBodyThe body of the loop as a function. Normally a lambda function, that takes as as parameters (x,y,z). If you need additional input from outside, please use captures (by reference).
Template Parameters
allCellsDefines whether or not to iterate over all cells with the loop body given as argument. By default (allCells=false) it will not iterate over all cells and instead skip the last few cells, because they will be covered by the base step. If you plan to use the default base step of the traversal on this function, use allCells=false, if you plan to just iterate over all cells, e.g., to iterate over verlet lists saved within the cells, use allCells=true. For the c18 step if allCells is false, iteration will not occur over the last layer of cells (for overlap=1) (in x, y and z direction).

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