32template <
class ParticleCell,
class Functor>
40 const double interactionLength,
const std::array<double, 3> &cellLength,
41 DataLayoutOption dataLayout,
bool useNewton3,
bool spaciallyForward)
43 useNewton3, spaciallyForward) {}
52 template <
typename LoopBody>
74template <
class ParticleCell,
class Functor>
75template <
typename LoopBody>
79 auto numSlices = this->_sliceThickness.size();
82 std::array<size_t, 2> overLapps23{this->_overlap[this->_dimsSortedByLength[1]],
83 this->_overlap[this->_dimsSortedByLength[2]]};
85 if (not this->_spaciallyForward) {
86 overLapps23 = {0ul, 0ul};
89 for (
size_t offset = 0; offset < 2; offset++) {
92 for (
size_t slice = offset; slice < numSlices; slice += 2) {
93 array<unsigned long, 3> myStartArray{0, 0, 0};
94 for (
size_t i = 0; i < slice; ++i) {
95 myStartArray[this->_dimsSortedByLength[0]] += this->_sliceThickness[i];
98 const auto lastLayer = myStartArray[this->_dimsSortedByLength[0]] + this->_sliceThickness[slice];
99 for (
unsigned long dimSlice = myStartArray[this->_dimsSortedByLength[0]]; dimSlice < lastLayer; ++dimSlice) {
100 for (
unsigned long dimMedium = 0;
101 dimMedium < this->_cellsPerDimension[this->_dimsSortedByLength[1]] - overLapps23[0]; ++dimMedium) {
102 for (
unsigned long dimShort = 0;
103 dimShort < this->_cellsPerDimension[this->_dimsSortedByLength[2]] - overLapps23[1]; ++dimShort) {
104 array<unsigned long, 3> idArray = {};
105 idArray[this->_dimsSortedByLength[0]] = dimSlice;
106 idArray[this->_dimsSortedByLength[1]] = dimMedium;
107 idArray[this->_dimsSortedByLength[2]] = dimShort;
108 loopBody(idArray[0], idArray[1], idArray[2]);
#define AUTOPAS_OPENMP(args)
Empty macro to throw away any arguments.
Definition: WrapOpenMP.h:126
std::array< unsigned long, 3 > _cellsPerDimension
The dimensions of the cellblock.
Definition: CellTraversal.h:55
Functor base class.
Definition: Functor.h:40
Class for Cells of Particles.
Definition: ParticleCell.h:51
This class provides base for locked- and colored sliced traversals.
Definition: SlicedBasedTraversal.h:30
virtual void loadDataLayout()
Load Data Layouts required for this Traversal if cells have been set through setCellsToTraverse().
Definition: SlicedBasedTraversal.h:129
virtual void initSliceThickness(unsigned long minSliceThickness)
Sets up the slice thicknesses to create as many slices as possible while respecting minSliceThickness...
Definition: SlicedBasedTraversal.h:74
unsigned long _overlapLongestAxis
Overlap of interacting cells along the longest axis.
Definition: SlicedBasedTraversal.h:152
std::array< int, 3 > _dimsSortedByLength
Store ids of dimensions (0, 1, 2 = x, y, z) sorted by in decreasing order of number of cells in that ...
Definition: SlicedBasedTraversal.h:147
This class provides the colored sliced traversal.
Definition: SlicedC02BasedTraversal.h:33
bool isApplicable() const override
Checks if the traversal is applicable to the current state of the domain.
Definition: SlicedC02BasedTraversal.h:59
void initTraversal() override
Load Data Layouts and sets up slice thicknesses.
Definition: SlicedC02BasedTraversal.h:66
void cSlicedTraversal(LoopBody &&loopBody)
The main traversal of the colored sliced traversal.
Definition: SlicedC02BasedTraversal.h:76
SlicedC02BasedTraversal(const std::array< unsigned long, 3 > &dims, Functor *functor, const double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3, bool spaciallyForward)
Constructor of the colored sliced traversal.
Definition: SlicedC02BasedTraversal.h:39
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32