PairwiseFunctor class. More...
#include <PairwiseFunctor.h>
Public Types | |
using | SoAArraysType = typename Particle_T::SoAArraysType |
Structure of the SoAs defined by the particle. | |
![]() | |
using | SoAArraysType = typename Particle_T::SoAArraysType |
Structure of the SoAs defined by the particle. | |
using | Functor_T = CRTP_T |
Make the Implementation type template publicly available. | |
Public Member Functions | |
PairwiseFunctor (double cutoff) | |
Constructor. | |
virtual void | AoSFunctor (Particle_T &i, Particle_T &j, bool newton3) |
PairwiseFunctor for arrays of structures (AoS). | |
virtual void | SoAFunctorSingle (SoAView< SoAArraysType > soa, bool newton3) |
PairwiseFunctor for structure of arrays (SoA) | |
virtual void | SoAFunctorVerlet (SoAView< SoAArraysType > soa, const size_t indexFirst, const std::vector< size_t, AlignedAllocator< size_t > > &neighborList, bool newton3) |
PairwiseFunctor for structure of arrays (SoA) for neighbor lists. | |
virtual void | SoAFunctorPair (SoAView< SoAArraysType > soa1, SoAView< SoAArraysType > soa2, bool newton3) |
PairwiseFunctor for structure of arrays (SoA) | |
![]() | |
Functor (double cutoff) | |
Constructor. | |
virtual void | initTraversal () |
This function is called at the start of each traversal. | |
virtual void | endTraversal (bool newton3) |
This function is called at the end of each traversal. | |
template<class ParticleCell > | |
void | SoALoader (ParticleCell &cell, SoA< SoAArraysType > &soa, size_t offset, bool skipSoAResize) |
Copies the AoS data of the given cell in the given soa. | |
template<typename ParticleCell > | |
void | SoAExtractor (ParticleCell &cell, SoA< SoAArraysType > &soa, size_t offset) |
Copies the data stored in the soa back into the cell. | |
virtual bool | allowsNewton3 ()=0 |
Specifies whether the functor is capable of Newton3-like functors. | |
virtual bool | allowsNonNewton3 ()=0 |
Specifies whether the functor is capable of non-Newton3-like functors. | |
virtual bool | isRelevantForTuning ()=0 |
Specifies whether the functor should be considered for the auto-tuning process. | |
virtual std::string | getName ()=0 |
Returns name of functor. | |
double | getCutoff () const |
Getter for the functor's cutoff. | |
virtual size_t | getNumFLOPs () const |
Get the number of FLOPs. | |
virtual double | getHitRate () const |
Get the hit rate. | |
Additional Inherited Members | |
![]() | |
static constexpr std::array< typename Particle_T::AttributeNames, 0 > | getNeededAttr () |
Get attributes needed for computation. | |
static constexpr std::array< typename Particle_T::AttributeNames, 0 > | getNeededAttr (std::false_type) |
Get attributes needed for computation without N3 optimization. | |
static constexpr std::array< typename Particle_T::AttributeNames, 0 > | getComputedAttr () |
Get attributes computed by this functor. | |
PairwiseFunctor class.
This class describes the pairwise interactions between particles.
Functor base class.
Both an array of structure (AoS) and a structure of array (SoA) are supported to be used with functors. Newton3: A functor does not have to implement both a newton3 and a non-newton3 version. Instead you can specify, which version you use by overriding allowsNonNewton3 resp. allowsNewton3
Particle_T | the type of Particle |
CRTP_T | the actual type of the functor |
Particle_T | the type of Particle |
CRTP_T | the actual type of the functor |
|
inlineexplicit |
Constructor.
cutoff |
|
inlinevirtual |
PairwiseFunctor for arrays of structures (AoS).
This functor should calculate the forces or any other pair-wise interaction between two particles. This should include a cutoff check if needed!
i | Particle i |
j | Particle j |
newton3 | defines whether or whether not to use newton 3 |
Reimplemented in mdLib::LJFunctor< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, mdLib::LJFunctorAVX< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, mdLib::LJFunctorSVE< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, autopas::internal::AsBuildPairGeneratorFunctor< Particle_T, callCheckInstead >, autopas::VerletListHelpers< Particle_T >::VerletListValidityCheckerFunctor, autopas::VLCAllCellsGeneratorFunctor< Particle_T, TraversalOptionEnum >, autopas::VLCCellPairGeneratorFunctor< Particle_T >, EmptyPairwiseFunctor< Particle_T >, sphLib::SPHCalcDensityFunctor< Particle_T >, sphLib::SPHCalcHydroForceFunctor< Particle_T >, autopas::VerletListHelpers< Particle_T >::VerletListGeneratorFunctor, and mdLib::LJMultisiteFunctor< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >.
|
inlinevirtual |
PairwiseFunctor for structure of arrays (SoA)
This functor should calculate the forces or any other pair-wise interaction between all particles of soa1 and soa2. This should include a cutoff check if needed!
soa1 | First structure of arrays. |
soa2 | Second structure of arrays. |
newton3 | defines whether or whether not to use newton 3 |
Reimplemented in sphLib::SPHCalcDensityFunctor< Particle_T >, sphLib::SPHCalcHydroForceFunctor< Particle_T >, mdLib::LJFunctor< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, mdLib::LJFunctorAVX< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, mdLib::LJFunctorSVE< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, mdLib::LJMultisiteFunctor< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, EmptyPairwiseFunctor< Particle_T >, autopas::internal::AsBuildPairGeneratorFunctor< Particle_T, callCheckInstead >, autopas::VerletListHelpers< Particle_T >::VerletListGeneratorFunctor, autopas::VLCAllCellsGeneratorFunctor< Particle_T, TraversalOptionEnum >, and autopas::VLCCellPairGeneratorFunctor< Particle_T >.
|
inlinevirtual |
PairwiseFunctor for structure of arrays (SoA)
This functor should calculate the forces or any other pair-wise interaction between all particles in an soa. This should include a cutoff check if needed!
soa | Structure of arrays |
newton3 | defines whether or whether not to use newton 3 |
Reimplemented in mdLib::LJFunctor< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, mdLib::LJFunctorAVX< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, mdLib::LJFunctorSVE< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, mdLib::LJMultisiteFunctor< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, sphLib::SPHCalcDensityFunctor< Particle_T >, sphLib::SPHCalcHydroForceFunctor< Particle_T >, EmptyPairwiseFunctor< Particle_T >, autopas::internal::AsBuildPairGeneratorFunctor< Particle_T, callCheckInstead >, autopas::VerletListHelpers< Particle_T >::VerletListGeneratorFunctor, autopas::VLCAllCellsGeneratorFunctor< Particle_T, TraversalOptionEnum >, and autopas::VLCCellPairGeneratorFunctor< Particle_T >.
|
inlinevirtual |
PairwiseFunctor for structure of arrays (SoA) for neighbor lists.
This functor should calculate the forces or any other pair-wise interaction between the particle in the SoA with index indexFirst and all particles with indices in the neighborList. This should include a cutoff check if needed!
soa | Structure of arrays |
indexFirst | The index of the first particle for each interaction |
neighborList | The list of neighbors |
newton3 | defines whether or whether not to use newton 3 |
Reimplemented in mdLib::LJFunctor< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, mdLib::LJFunctorAVX< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, mdLib::LJFunctorSVE< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, mdLib::LJMultisiteFunctor< Particle_T, applyShift, useMixing, useNewton3, calculateGlobals, countFLOPs, relevantForTuning >, sphLib::SPHCalcDensityFunctor< Particle_T >, sphLib::SPHCalcHydroForceFunctor< Particle_T >, and EmptyPairwiseFunctor< Particle_T >.