AutoPas  3.0.0
Loading...
Searching...
No Matches
LCSlicedBalancedTraversal.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <algorithm>
11
16
17namespace autopas {
18
32template <class ParticleCell, class PairwiseFunctor>
33class LCSlicedBalancedTraversal : public SlicedBalancedBasedTraversal<ParticleCell, PairwiseFunctor>,
35 public:
46 explicit LCSlicedBalancedTraversal(const std::array<unsigned long, 3> &dims, PairwiseFunctor &pairwiseFunctor,
47 double interactionLength, const std::array<double, 3> &cellLength,
48 DataLayoutOption dataLayout, bool useNewton3)
49 : SlicedBalancedBasedTraversal<ParticleCell, PairwiseFunctor>(dims, pairwiseFunctor, interactionLength,
50 cellLength, dataLayout, useNewton3, true),
51 _cellHandler(pairwiseFunctor, this->_cellsPerDimension, interactionLength, cellLength, this->_overlap,
52 dataLayout, useNewton3) {}
53
54 void traverseParticles() override;
55
56 [[nodiscard]] TraversalOption getTraversalType() const override { return TraversalOption::lc_sliced_balanced; }
57
61 void setAoSSortingThresholds(const SortingThresholdInfoInterface &aosSortingThreshold) override {
62 _cellHandler.setAoSSortingThresholds(aosSortingThreshold);
63 }
64
68 void setSoASortingThresholds(const SortingThresholdInfoInterface &soaSortingThreshold) override {
69 _cellHandler.setSoASortingThresholds(soaSortingThreshold);
70 }
71
72 private:
74};
75
76template <class ParticleCell, class PairwiseFunctor>
78 auto &cells = *(this->_cells);
79 this->slicedTraversal([&](unsigned long x, unsigned long y, unsigned long z) {
80 auto id = utils::ThreeDimensionalMapping::threeToOneD(x, y, z, this->_cellsPerDimension);
81 _cellHandler.processBaseCell(cells, id);
82 });
83}
84
85} // namespace autopas
std::array< unsigned long, 3 > _cellsPerDimension
The dimensions of the cellblock.
Definition: CellTraversal.h:70
This class provides the base for traversals using the c08 base step.
Definition: LCC08CellHandler.h:28
void setAoSSortingThresholds(const SortingThresholdInfoInterface &aosSortingThreshold)
Set the aos-sorting-threshold for traversals that use the CellFunctor.
Definition: LCC08CellHandler.h:88
void setSoASortingThresholds(const SortingThresholdInfoInterface &soaSortingThreshold)
Set the SoA sorting-threshold for traversals that use the CellFunctor.
Definition: LCC08CellHandler.h:95
This class provides the balanced sliced traversal.
Definition: LCSlicedBalancedTraversal.h:34
void traverseParticles() override
Traverse the particles by pairs, triplets etc.
Definition: LCSlicedBalancedTraversal.h:77
void setAoSSortingThresholds(const SortingThresholdInfoInterface &aosSortingThreshold) override
Set the aos-sorting-threshold for traversals that use the CellFunctor.
Definition: LCSlicedBalancedTraversal.h:61
TraversalOption getTraversalType() const override
Return a enum representing the name of the traversal class.
Definition: LCSlicedBalancedTraversal.h:56
LCSlicedBalancedTraversal(const std::array< unsigned long, 3 > &dims, PairwiseFunctor &pairwiseFunctor, double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3)
Constructor of the balanced sliced traversal.
Definition: LCSlicedBalancedTraversal.h:46
void setSoASortingThresholds(const SortingThresholdInfoInterface &soaSortingThreshold) override
Set the SoA sorting-threshold for traversals that use the CellFunctor.
Definition: LCSlicedBalancedTraversal.h:68
Interface for traversals used by the LinkedCell class.
Definition: LCTraversalInterface.h:18
PairwiseFunctor class.
Definition: PairwiseFunctor.h:66
Class for Cells of Particles.
Definition: ParticleCell.h:49
This class provides a load balanced version of the base sliced traversal.
Definition: SlicedBalancedBasedTraversal.h:30
std::array< unsigned long, 3 > _overlap
Overlap of interacting cells.
Definition: SlicedBasedTraversal.h:155
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
Polymorphic base for sorting-threshold storage.
Definition: SortingThresholdInfoInterface.h:18