AutoPas  3.0.0
Loading...
Searching...
No Matches
LCSlicedC02Traversal.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <algorithm>
11
17
18namespace autopas {
19
30template <class ParticleCell_T, class Functor_T>
31class LCSlicedC02Traversal : public SlicedC02BasedTraversal<ParticleCell_T, Functor_T>, public LCTraversalInterface {
32 public:
43 explicit LCSlicedC02Traversal(const std::array<unsigned long, 3> &dims, Functor_T &functor, double interactionLength,
44 const std::array<double, 3> &cellLength, DataLayoutOption dataLayout, bool useNewton3)
45 : SlicedC02BasedTraversal<ParticleCell_T, Functor_T>(dims, functor, interactionLength, cellLength, dataLayout,
46 useNewton3, true),
47 _cellHandler(functor, this->_cellsPerDimension, interactionLength, cellLength, this->_overlap, dataLayout,
48 useNewton3) {}
49
50 void traverseParticles() override;
51
52 [[nodiscard]] TraversalOption getTraversalType() const override { return TraversalOption::lc_sliced_c02; }
53
57 void setAoSSortingThreshold(size_t aosSortingThreshold) override {
58 _cellHandler.setAoSSortingThreshold(aosSortingThreshold);
59 }
63 void setSoASortingThreshold(size_t soaSortingThreshold) override {
64 _cellHandler.setSoASortingThreshold(soaSortingThreshold);
65 }
66
67 private:
69};
70
71template <class ParticleCell_T, class Functor_T>
73 auto &cells = *(this->_cells);
74 this->cSlicedTraversal([&](unsigned long x, unsigned long y, unsigned long z) {
75 auto id = utils::ThreeDimensionalMapping::threeToOneD(x, y, z, this->_cellsPerDimension);
76 _cellHandler.processBaseCell(cells, id);
77 });
78}
79
80} // namespace autopas
std::array< unsigned long, 3 > _cellsPerDimension
The dimensions of the cellblock.
Definition: CellTraversal.h:63
This class provides the base for traversals using the c08 base step.
Definition: LCC08CellHandler.h:27
This class provides the colored sliced traversal.
Definition: LCSlicedC02Traversal.h:31
void setAoSSortingThreshold(size_t aosSortingThreshold) override
Set the aos-sorting-threshold for traversals that use the CellFunctor If the sum of the number of par...
Definition: LCSlicedC02Traversal.h:57
void setSoASortingThreshold(size_t soaSortingThreshold) override
Set the SoA sorting-threshold for traversals that use the CellFunctor.
Definition: LCSlicedC02Traversal.h:63
TraversalOption getTraversalType() const override
Return a enum representing the name of the traversal class.
Definition: LCSlicedC02Traversal.h:52
void traverseParticles() override
Traverse the particles by pairs, triplets etc.
Definition: LCSlicedC02Traversal.h:72
LCSlicedC02Traversal(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 colored sliced traversal.
Definition: LCSlicedC02Traversal.h:43
Interface for traversals used by the LinkedCell class.
Definition: LCTraversalInterface.h:18
std::array< unsigned long, 3 > _overlap
Overlap of interacting cells.
Definition: SlicedBasedTraversal.h:155
This class provides the colored sliced traversal.
Definition: SlicedC02BasedTraversal.h:33
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