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
31template <class ParticleCell, class PairwiseFunctor>
32class LCSlicedC02Traversal : public SlicedC02BasedTraversal<ParticleCell, PairwiseFunctor>,
34 public:
45 explicit LCSlicedC02Traversal(const std::array<unsigned long, 3> &dims, PairwiseFunctor *pairwiseFunctor,
46 double interactionLength, const std::array<double, 3> &cellLength,
47 DataLayoutOption dataLayout, bool useNewton3)
48 : SlicedC02BasedTraversal<ParticleCell, PairwiseFunctor>(dims, pairwiseFunctor, interactionLength, cellLength,
49 dataLayout, useNewton3, true),
50 _cellHandler(pairwiseFunctor, this->_cellsPerDimension, interactionLength, cellLength, this->_overlap,
51 dataLayout, useNewton3) {}
52
53 void traverseParticles() override;
54
55 [[nodiscard]] TraversalOption getTraversalType() const override { return TraversalOption::lc_sliced_c02; }
56
60 void setSortingThreshold(size_t sortingThreshold) override { _cellHandler.setSortingThreshold(sortingThreshold); }
61
62 private:
64};
65
66template <class ParticleCell, class PairwiseFunctor>
68 auto &cells = *(this->_cells);
69 this->cSlicedTraversal([&](unsigned long x, unsigned long y, unsigned long z) {
70 auto id = utils::ThreeDimensionalMapping::threeToOneD(x, y, z, this->_cellsPerDimension);
71 _cellHandler.processBaseCell(cells, id);
72 });
73}
74
75} // namespace autopas
std::array< unsigned long, 3 > _cellsPerDimension
The dimensions of the cellblock.
Definition: CellTraversal.h:55
This class provides the base for traversals using the c08 base step.
Definition: LCC08CellHandler.h:28
This class provides the colored sliced traversal.
Definition: LCSlicedC02Traversal.h:33
LCSlicedC02Traversal(const std::array< unsigned long, 3 > &dims, PairwiseFunctor *pairwiseFunctor, double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3)
Constructor of the colored sliced traversal.
Definition: LCSlicedC02Traversal.h:45
void traverseParticles() override
Traverse the particles by pairs, triplets etc.
Definition: LCSlicedC02Traversal.h:67
TraversalOption getTraversalType() const override
Return a enum representing the name of the traversal class.
Definition: LCSlicedC02Traversal.h:55
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: LCSlicedC02Traversal.h:60
Interface for traversals used by the LinkedCell class.
Definition: LCTraversalInterface.h:18
PairwiseFunctor class.
Definition: PairwiseFunctor.h:31
Class for Cells of Particles.
Definition: ParticleCell.h:51
std::array< unsigned long, 3 > _overlap
Overlap of interacting cells.
Definition: SlicedBasedTraversal.h:142
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:32