AutoPas  3.0.0
Loading...
Searching...
No Matches
C01BasedTraversal.h
Go to the documentation of this file.
1
7#pragma once
8
11
12namespace autopas {
13
24template <class ParticleCell, class Functor, int collapseDepth = 3>
25class C01BasedTraversal : public ColorBasedTraversal<ParticleCell, Functor, collapseDepth> {
26 public:
37 explicit C01BasedTraversal(const std::array<unsigned long, 3> &dims, Functor *functor, double interactionLength,
38 const std::array<double, 3> &cellLength, DataLayoutOption dataLayout, bool useNewton3)
39 : ColorBasedTraversal<ParticleCell, Functor, collapseDepth>(dims, functor, interactionLength, cellLength,
40 dataLayout, useNewton3) {}
41
42 protected:
50 template <typename LoopBody>
51 inline void c01Traversal(LoopBody &&loopBody);
52};
53
54template <class ParticleCell, class Functor, int collapseDepth>
55template <typename LoopBody>
57 using namespace autopas::utils::ArrayMath::literals;
58
59 const auto offset = this->_overlap;
60 const auto end = this->_cellsPerDimension - this->_overlap;
61 this->colorTraversal(std::forward<LoopBody>(loopBody), end, {1ul, 1ul, 1ul}, offset);
62}
63} // namespace autopas
This class provides the base for traversals using the c01 base step.
Definition: C01BasedTraversal.h:25
C01BasedTraversal(const std::array< unsigned long, 3 > &dims, Functor *functor, double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3)
Constructor of the c01 traversal.
Definition: C01BasedTraversal.h:37
void c01Traversal(LoopBody &&loopBody)
The main traversal of the C01Traversal.
Definition: C01BasedTraversal.h:56
This class provides the base for traversals using base steps based on cell coloring.
Definition: ColorBasedTraversal.h:27
Functor base class.
Definition: Functor.h:40
Class for Cells of Particles.
Definition: ParticleCell.h:51
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32