20template <
class Particle_T>
 
   45          _verletListsAoS(verletListsAoS),
 
   46          _interactionLengthSquared(interactionLength * interactionLength) {}
 
   48    std::string 
getName()
 override { 
return "VerletListGeneratorFunctor"; }
 
   54          "VLCAllCellsGeneratorFunctor::allowsNewton3() is not implemented, because it should not be called.");
 
   60          "VLCAllCellsGeneratorFunctor::allowsNonNewton3() is not implemented, because it should not be called.");
 
   64    void AoSFunctor(Particle_T &i, Particle_T &j, 
bool )
 override {
 
   65      using namespace autopas::utils::ArrayMath::literals;
 
   67      if (i.isDummy() or j.isDummy()) {
 
   70      auto dist = i.getR() - j.getR();
 
   73      if (distsquare < _interactionLengthSquared) {
 
   80        _verletListsAoS.at(&i).push_back(&j);
 
   91      if (soa.
size() == 0) 
return;
 
   93      auto **
const __restrict ptrptr = soa.template begin<Particle_T::AttributeNames::ptr>();
 
   94      const double *
const __restrict xptr = soa.template begin<Particle_T::AttributeNames::posX>();
 
   95      const double *
const __restrict yptr = soa.template begin<Particle_T::AttributeNames::posY>();
 
   96      const double *
const __restrict zptr = soa.template begin<Particle_T::AttributeNames::posZ>();
 
   98      size_t numPart = soa.
size();
 
   99      for (
unsigned int i = 0; i < numPart; ++i) {
 
  100        auto ¤tList = _verletListsAoS.at(ptrptr[i]);
 
  102        for (
unsigned int j = i + 1; j < numPart; ++j) {
 
  103          const double drx = xptr[i] - xptr[j];
 
  104          const double dry = yptr[i] - yptr[j];
 
  105          const double drz = zptr[i] - zptr[j];
 
  107          const double drx2 = drx * drx;
 
  108          const double dry2 = dry * dry;
 
  109          const double drz2 = drz * drz;
 
  111          const double dr2 = drx2 + dry2 + drz2;
 
  113          if (dr2 < _interactionLengthSquared) {
 
  114            currentList.push_back(ptrptr[j]);
 
  117              _verletListsAoS.at(ptrptr[j]).push_back(ptrptr[i]);
 
  131      if (soa1.
size() == 0 || soa2.
size() == 0) 
return;
 
  133      auto **
const __restrict ptr1ptr = soa1.template begin<Particle_T::AttributeNames::ptr>();
 
  134      const double *
const __restrict x1ptr = soa1.template begin<Particle_T::AttributeNames::posX>();
 
  135      const double *
const __restrict y1ptr = soa1.template begin<Particle_T::AttributeNames::posY>();
 
  136      const double *
const __restrict z1ptr = soa1.template begin<Particle_T::AttributeNames::posZ>();
 
  138      auto **
const __restrict ptr2ptr = soa2.template begin<Particle_T::AttributeNames::ptr>();
 
  139      const double *
const __restrict x2ptr = soa2.template begin<Particle_T::AttributeNames::posX>();
 
  140      const double *
const __restrict y2ptr = soa2.template begin<Particle_T::AttributeNames::posY>();
 
  141      const double *
const __restrict z2ptr = soa2.template begin<Particle_T::AttributeNames::posZ>();
 
  143      size_t numPart1 = soa1.
size();
 
  144      for (
unsigned int i = 0; i < numPart1; ++i) {
 
  145        auto ¤tList = _verletListsAoS.at(ptr1ptr[i]);
 
  147        size_t numPart2 = soa2.
size();
 
  149        for (
unsigned int j = 0; j < numPart2; ++j) {
 
  150          const double drx = x1ptr[i] - x2ptr[j];
 
  151          const double dry = y1ptr[i] - y2ptr[j];
 
  152          const double drz = z1ptr[i] - z2ptr[j];
 
  154          const double drx2 = drx * drx;
 
  155          const double dry2 = dry * dry;
 
  156          const double drz2 = drz * drz;
 
  158          const double dr2 = drx2 + dry2 + drz2;
 
  160          if (dr2 < _interactionLengthSquared) {
 
  161            currentList.push_back(ptr2ptr[j]);
 
  170    constexpr static std::array<typename Particle_T::AttributeNames, 4> 
getNeededAttr() {
 
  171      return std::array<typename Particle_T::AttributeNames, 4>{
 
  172          Particle_T::AttributeNames::ptr, Particle_T::AttributeNames::posX, Particle_T::AttributeNames::posY,
 
  173          Particle_T::AttributeNames::posZ};
 
  179    constexpr static std::array<typename Particle_T::AttributeNames, 0> 
getComputedAttr() {
 
  180      return std::array<typename Particle_T::AttributeNames, 0>{};
 
  185    double _interactionLengthSquared;
 
  210          _verletListsAoS(verletListsAoS),
 
  211          _cutoffsquared(cutoff * cutoff),
 
  214    std::string 
getName()
 override { 
return "VerletListValidityCheckerFunctor"; }
 
  220          "VLCAllCellsGeneratorFunctor::allowsNewton3() is not implemented, because it should not be called.");
 
  226          "VLCAllCellsGeneratorFunctor::allowsNonNewton3() is not implemented, because it should not be called.");
 
  230    void AoSFunctor(Particle_T &i, Particle_T &j, 
bool newton3)
 override {
 
  231      using namespace autopas::utils::ArrayMath::literals;
 
  233      auto dist = i.getR() - j.getR();
 
  235      if (distsquare < _cutoffsquared) {
 
  237        auto found = std::find(_verletListsAoS[&i].begin(), _verletListsAoS[&i].end(), &j);
 
  238        if (found == _verletListsAoS[&i].end()) {
 
  254    double _cutoffsquared;
 
  257    std::atomic<bool> _valid;
 
PairwiseFunctor class.
Definition: PairwiseFunctor.h:31
 
View on a fixed part of a SoA between a start index and an end index.
Definition: SoAView.h:23
 
size_t size() const
Returns the number of particles in the view.
Definition: SoAView.h:83
 
This functor can generate verlet lists using the typical pairwise traversal.
Definition: VerletListHelpers.h:31
 
typename Particle_T::SoAArraysType SoAArraysType
Structure of the SoAs defined by the particle.
Definition: VerletListHelpers.h:36
 
void AoSFunctor(Particle_T &i, Particle_T &j, bool) override
PairwiseFunctor for arrays of structures (AoS).
Definition: VerletListHelpers.h:64
 
static constexpr std::array< typename Particle_T::AttributeNames, 4 > getNeededAttr()
Get attributes needed for computation.
Definition: VerletListHelpers.h:170
 
void SoAFunctorPair(SoAView< SoAArraysType > soa1, SoAView< SoAArraysType > soa2, bool) override
SoAFunctor for the verlet list generation.
Definition: VerletListHelpers.h:130
 
bool allowsNewton3() override
Specifies whether the functor is capable of Newton3-like functors.
Definition: VerletListHelpers.h:52
 
static constexpr std::array< typename Particle_T::AttributeNames, 0 > getComputedAttr()
Get attributes computed by this functor.
Definition: VerletListHelpers.h:179
 
std::string getName() override
Returns name of functor.
Definition: VerletListHelpers.h:48
 
void SoAFunctorSingle(SoAView< SoAArraysType > soa, bool newton3) override
SoAFunctor for verlet list generation.
Definition: VerletListHelpers.h:90
 
bool isRelevantForTuning() override
Specifies whether the functor should be considered for the auto-tuning process.
Definition: VerletListHelpers.h:50
 
bool allowsNonNewton3() override
Specifies whether the functor is capable of non-Newton3-like functors.
Definition: VerletListHelpers.h:58
 
VerletListGeneratorFunctor(NeighborListAoSType &verletListsAoS, double interactionLength)
Constructor.
Definition: VerletListHelpers.h:43
 
This functor checks the validity of neighborhood lists.
Definition: VerletListHelpers.h:196
 
typename Particle_T::SoAArraysType SoAArraysType
Structure of the SoAs defined by the particle.
Definition: VerletListHelpers.h:201
 
void AoSFunctor(Particle_T &i, Particle_T &j, bool newton3) override
PairwiseFunctor for arrays of structures (AoS).
Definition: VerletListHelpers.h:230
 
std::string getName() override
Returns name of functor.
Definition: VerletListHelpers.h:214
 
bool allowsNonNewton3() override
Specifies whether the functor is capable of non-Newton3-like functors.
Definition: VerletListHelpers.h:224
 
bool neighborlistsAreValid()
Returns whether the neighbour list are valid.
Definition: VerletListHelpers.h:250
 
VerletListValidityCheckerFunctor(NeighborListAoSType &verletListsAoS, double cutoff)
Constructor.
Definition: VerletListHelpers.h:208
 
bool allowsNewton3() override
Specifies whether the functor is capable of Newton3-like functors.
Definition: VerletListHelpers.h:218
 
bool isRelevantForTuning() override
Specifies whether the functor should be considered for the auto-tuning process.
Definition: VerletListHelpers.h:216
 
Class of helpers for the VerletLists class.
Definition: VerletListHelpers.h:21
 
std::unordered_map< Particle_T *, std::vector< Particle_T * > > NeighborListAoSType
Neighbor list AoS style.
Definition: VerletListHelpers.h:26
 
static void exception(const Exception e)
Handle an exception derived by std::exception.
Definition: ExceptionHandler.h:63
 
constexpr T dot(const std::array< T, SIZE > &a, const std::array< T, SIZE > &b)
Generates the dot product of two arrays.
Definition: ArrayMath.h:233
 
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32