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

This functor generates lists of particles within interactionLength of each other, which could be used within user simulators to replace their neighbor identification/contact detection/cutoff check passes, although they should consider the warning below. More...

#include <NeighborIdentificationFunctor.h>

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

Public Member Functions

 NeighborIdentificationFunctor (NeighborListAoSType &neighborListsAoS, double interactionLength, bool gatherNewton3Lists)
 Constructor.
 
std::string getName () override
 Returns name of functor.
 
- Public Member Functions inherited from autopas::InteractionListGeneratorFunctor< Particle_T, false >
 InteractionListGeneratorFunctor (NeighborListAoSType &neighborListsAoS, double interactionLength, bool gatherNewton3Lists)
 Constructor.
 
std::string getName () override
 
void initializeNeighborList (ParticleIterator_T particlesBegin)
 Initializes the neighbor list map for the given range of particles: clears any previous contents and inserts an empty neighbor list for every particle.
 
bool isRelevantForTuning () override
 Whether particle is relevant for tuning.
 
bool allowsNewton3 () override
 Whether InteractionListGeneratorFunctor allows Newton3.
 
bool allowsNonNewton3 () override
 Whether InteractionListGeneratorFunctor allows non-newton3.
 
void AoSFunctor (Particle_T &i, Particle_T &j, bool newton3) override
 AoSFunctor for interaction list generation.
 
void SoAFunctorSingle (SoAView< SoAArraysType > soa, bool) override
 SoAFunctor for verlet list generation.
 
void SoAFunctorPair (SoAView< SoAArraysType > soa1, SoAView< SoAArraysType > soa2, bool newton3) override
 SoAFunctor for the verlet list generation.
 
void SoAFunctorVerlet (SoAView< SoAArraysType > soa, const size_t indexFirst, const std::vector< size_t, AlignedAllocator< size_t > > &verletList, bool newton3) override
 SoAFunctorVerlet for interaction list generation.
 
- Public Member Functions inherited from autopas::PairwiseFunctor< Particle_T, InteractionListGeneratorFunctor< Particle_T, isInternal > >
 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)
 
virtual void SoAFunctorPairSorted (SoAView< SoAArraysType > soa1, SoAView< SoAArraysType > soa2, const SoASortingData &sortingData, bool newton3)
 SoAFunctorPair on pre-sorted, pre-packed SoA views.
 
bool isVecPatternAllowed (const VectorizationPatternOption::Value vecPattern) override
 Specifies whether the functor is capable of using the specified Vectorization Pattern in the SoA functor.
 
- Public Member Functions inherited from autopas::Functor< Particle_T, CRTP_T >
 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 isVecPatternAllowed (const VectorizationPatternOption::Value vecPattern)=0
 Specifies whether the functor is capable of using the specified Vectorization Pattern in the SoA functor.
 
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 void setVecPattern (const VectorizationPatternOption::Value vecPattern)
 Setter for the vectorization pattern to be used.
 
virtual size_t getNumFLOPs () const
 Get the number of FLOPs.
 
virtual double getHitRate () const
 Get the hit rate.
 

Additional Inherited Members

- Public Types inherited from autopas::InteractionListGeneratorFunctor< Particle_T, false >
using SoAArraysType = Particle_T::SoAArraysType
 Structure of the SoAs defined by the particle.
 
using NeighborListAoSType = std::unordered_map< Particle_T *, std::vector< Particle_T * > >
 Neighbor list AoS style.
 
- Public Types inherited from autopas::PairwiseFunctor< Particle_T, InteractionListGeneratorFunctor< Particle_T, isInternal > >
using SoAArraysType = typename Particle_T::SoAArraysType
 Structure of the SoAs defined by the particle.
 
- Public Types inherited from autopas::Functor< Particle_T, CRTP_T >
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.
 
- Static Public Member Functions inherited from autopas::InteractionListGeneratorFunctor< Particle_T, false >
static constexpr std::array< typename Particle_T::AttributeNames, 5 > getNeededAttr ()
 Get attributes needed for computation.
 
static constexpr std::array< typename Particle_T::AttributeNames, 5 > 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.
 
- Static Public Member Functions inherited from autopas::Functor< Particle_T, CRTP_T >
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.
 
- Static Public Attributes inherited from autopas::Functor< Particle_T, CRTP_T >
static constexpr bool supportsSoASorting = false
 Whether this functor supports the SortedSoAView optimization path (SoAFunctorPairSorted).
 

Detailed Description

template<class Particle_T>
class autopas::NeighborIdentificationFunctor< Particle_T >

This functor generates lists of particles within interactionLength of each other, which could be used within user simulators to replace their neighbor identification/contact detection/cutoff check passes, although they should consider the warning below.

In some fields this can be called "cutoff checking" or "broad-phase contact detection" but we will refer to this in this file as neighbor identification.

Warning
To take fully advantage of AutoPas, we recommend, instead of using this functor and apply forces externally to AutoPas, using a functor which integrates neighbor identification and force calculation in one call over using this functor (see LJFunctor.h as an example). We provide this functor primarily for codes which already perform separate neighbor identification and force calculation passes, to easily experience some benefit of AutoPas with minimal code refactors.

After applying AutoPas's computeInteractions function with this functor, a std::unordered_map<Particle_T *, std::vector<Particle_T *>> is filled, mapping from each particle pointer to a vector of pointers to all particles within interactionLength of the first.

Template Parameters
Particle_TThe type of Particle class used.

Constructor & Destructor Documentation

◆ NeighborIdentificationFunctor()

template<class Particle_T >
autopas::NeighborIdentificationFunctor< Particle_T >::NeighborIdentificationFunctor ( NeighborListAoSType neighborListsAoS,
double  interactionLength,
bool  gatherNewton3Lists 
)
inline

Constructor.

Parameters
neighborListsAoSReference to the neighbor list map. When used with AutoPas::computeInteractions, the map will be overridden.
interactionLengthThe distance between particles within which particle pairs get added to the neighbor lists.
gatherNewton3ListsIf false, for a particle pair i, j that are neighbors, both particle j will be in particle i's list and particle i will be in particle j's list. If true, for a particle pair i, j that are neighbors, either particle j will be in particle i's list or particle i will be in particle j's list. The latter can be used more easily to reduce calculations by applying forces to both particles in the pair, but care should be taken to avoid race conditions. If true, we make no guarantee which of particle i or j will be in the other's list. If true, this functor will only allow functor calls with newton3 enabled.

Member Function Documentation

◆ getName()

template<class Particle_T >
std::string autopas::NeighborIdentificationFunctor< Particle_T >::getName ( )
inlineoverridevirtual

Returns name of functor.

Intended for use with the iteration logger, to differentiate between calls to computeInteractions using different functors in the logs.

Returns
name of functor.

Implements autopas::Functor< Particle_T, CRTP_T >.


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