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->_dimsPerLength[1]], this->_overlap[this->_dimsPerLength[2]]};
84 if (not this->_spaciallyForward) {
85 overLapps23 = {0ul, 0ul};
88 for (
size_t offset = 0; offset < 2; offset++) {
91 for (
size_t slice = offset; slice < numSlices; slice += 2) {
92 array<unsigned long, 3> myStartArray{0, 0, 0};
93 for (
size_t i = 0; i < slice; ++i) {
94 myStartArray[this->_dimsPerLength[0]] += this->_sliceThickness[i];
97 const auto lastLayer = myStartArray[this->_dimsPerLength[0]] + this->_sliceThickness[slice];
98 for (
unsigned long dimSlice = myStartArray[this->_dimsPerLength[0]]; dimSlice < lastLayer; ++dimSlice) {
99 for (
unsigned long dimMedium = 0;
100 dimMedium < this->_cellsPerDimension[this->_dimsPerLength[1]] - overLapps23[0]; ++dimMedium) {
101 for (
unsigned long dimShort = 0;
102 dimShort < this->_cellsPerDimension[this->_dimsPerLength[2]] - overLapps23[1]; ++dimShort) {
103 array<unsigned long, 3> idArray = {};
104 idArray[this->_dimsPerLength[0]] = dimSlice;
105 idArray[this->_dimsPerLength[1]] = dimMedium;
106 idArray[this->_dimsPerLength[2]] = dimShort;
107 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
std::array< int, 3 > _dimsPerLength
Store ids of dimensions ordered by number of cells per dimensions.
Definition: SlicedBasedTraversal.h:147
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
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