AutoPas  3.0.0
Loading...
Searching...
No Matches
LCC04CombinedSoATraversal.h
Go to the documentation of this file.
1
7#pragma once
8
13
14namespace autopas {
15
25template <class ParticleCell, class PairwiseFunctor>
26class LCC04CombinedSoATraversal : public C04BasedTraversal<ParticleCell, PairwiseFunctor, 2>,
28 public:
39 explicit LCC04CombinedSoATraversal(const std::array<unsigned long, 3> &dims, PairwiseFunctor *pairwiseFunctor,
40 const double interactionLength, const std::array<double, 3> &cellLength,
41 DataLayoutOption dataLayout, bool useNewton3)
42 : C04BasedTraversal<ParticleCell, PairwiseFunctor, 2>(dims, pairwiseFunctor, interactionLength, cellLength,
43 dataLayout, useNewton3),
44 _cellHandler(pairwiseFunctor, this->_cellsPerDimension, interactionLength, cellLength, dataLayout, useNewton3,
45 this->_overlap) {}
46
47 void traverseParticles() override;
48
49 [[nodiscard]] TraversalOption getTraversalType() const override { return TraversalOption::lc_c04_combined_SoA; }
50
58 [[nodiscard]] bool isApplicable() const override {
59 return this->_dataLayout == DataLayoutOption::soa and
60 (this->_overlap[0] == 1 and this->_overlap[1] == 1 and this->_overlap[2] == 1);
61 }
62
67 void setSortingThreshold(size_t sortingThreshold) override {}
68
69 private:
71};
72
73template <class ParticleCell, class PairwiseFunctor>
75 _cellHandler.resizeBuffers();
76 auto &cells = *(this->_cells);
77 this->c04Traversal(
78 [&](unsigned long x, unsigned long y, unsigned long z) { _cellHandler.processBaseCell(cells, x, y, z); });
79}
80
81} // namespace autopas
This class provides the base for traversals using the c04 base step.
Definition: C04BasedTraversal.h:26
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 c04 traversal.
Definition: LCC04CombinedSoATraversal.h:27
bool isApplicable() const override
lc_c04_combined_SoA traversals are only usable with dataLayout SoA.
Definition: LCC04CombinedSoATraversal.h:58
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: LCC04CombinedSoATraversal.h:67
TraversalOption getTraversalType() const override
Return a enum representing the name of the traversal class.
Definition: LCC04CombinedSoATraversal.h:49
void traverseParticles() override
Traverse the particles by pairs, triplets etc.
Definition: LCC04CombinedSoATraversal.h:74
LCC04CombinedSoATraversal(const std::array< unsigned long, 3 > &dims, PairwiseFunctor *pairwiseFunctor, const double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3)
Constructor of the c04 traversal.
Definition: LCC04CombinedSoATraversal.h:39
This class provides the base for traversals using the c08 base step, but rather use 4 instead of 8 co...
Definition: LCC04SoACellHandler.h:31
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
DataLayoutOption _dataLayout
The datalayout used by this traversal.
Definition: TraversalInterface.h:75
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32