AutoPas  3.0.0
Loading...
Searching...
No Matches
LCC08Traversal.h
Go to the documentation of this file.
1
7#pragma once
8
9#include "LCC08CellHandler.h"
13
14namespace autopas {
15
27template <class ParticleCell_T, class Functor_T>
28class LCC08Traversal : public C08BasedTraversal<ParticleCell_T, Functor_T>, public LCTraversalInterface {
29 public:
40 explicit LCC08Traversal(const std::array<unsigned long, 3> &dims, Functor_T &functor, double interactionLength,
41 const std::array<double, 3> &cellLength, DataLayoutOption dataLayout, bool useNewton3)
42 : C08BasedTraversal<ParticleCell_T, Functor_T>(dims, functor, interactionLength, cellLength, dataLayout,
43 useNewton3),
44 _cellHandler(functor, this->_cellsPerDimension, interactionLength, cellLength, this->_overlap, dataLayout,
45 useNewton3) {}
46
50 void traverseParticles() override;
51
55 [[nodiscard]] TraversalOption getTraversalType() const override { return TraversalOption::lc_c08; }
56
61 [[nodiscard]] bool isApplicableToDomain() const override { return true; }
62
66 void setSortingThreshold(size_t sortingThreshold) override { _cellHandler.setSortingThreshold(sortingThreshold); }
67
68 private:
70};
71
72template <class ParticleCell_T, class Functor_T>
74 auto &cells = *(this->_cells);
75 this->c08Traversal([&](unsigned long x, unsigned long y, unsigned long z) {
76 unsigned long baseIndex = utils::ThreeDimensionalMapping::threeToOneD(x, y, z, this->_cellsPerDimension);
77 _cellHandler.processBaseCell(cells, baseIndex);
78 });
79}
80
81} // namespace autopas
This class provides the base for traversals using the c08 base step.
Definition: C08BasedTraversal.h:24
std::array< unsigned long, 3 > _cellsPerDimension
The dimensions of the cellblock.
Definition: CellTraversal.h:55
std::array< unsigned long, 3 > _overlap
overlap of interacting cells.
Definition: ColorBasedTraversal.h:121
This class provides the base for traversals using the c08 base step.
Definition: LCC08CellHandler.h:27
This class provides the lc_c08 traversal.
Definition: LCC08Traversal.h:28
void setSortingThreshold(size_t sortingThreshold) override
Set the sorting-threshold for traversals that use the CellFunctor If the sum of the number of particl...
Definition: LCC08Traversal.h:66
bool isApplicableToDomain() const override
LC C08 is always applicable to the domain.
Definition: LCC08Traversal.h:61
void traverseParticles() override
Traverse the particles by pairs, triplets etc.
Definition: LCC08Traversal.h:73
TraversalOption getTraversalType() const override
Return a enum representing the name of the traversal class.
Definition: LCC08Traversal.h:55
LCC08Traversal(const std::array< unsigned long, 3 > &dims, Functor_T &functor, double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3)
Constructor of the lc_c08 traversal.
Definition: LCC08Traversal.h:40
Interface for traversals used by the LinkedCell class.
Definition: LCTraversalInterface.h:18
constexpr T threeToOneD(T x, T y, T z, const std::array< T, 3 > &dims)
Convert a 3d index to a 1d index.
Definition: ThreeDimensionalMapping.h:29
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:34