29template <
class ParticleCell,
class Functor>
45 const double interactionLength,
const std::array<double, 3> &cellLength,
46 DataLayoutOption dataLayout,
bool useNewton3,
bool spaciallyForward)
51 _interactionLength(interactionLength),
52 _cellLength(cellLength),
56 _dataLayoutConverter(functor, dataLayout) {
67 return maxNumSlices > 0;
79 if (numSlices < 1)
return;
84 auto remSlices = std::min(rest, numSlices);
85 for (
size_t i = 0; i < remSlices; ++i) {
87 rest -= rest / (remSlices - i);
110 auto &cells = *(this->
_cells);
113 for (
size_t i = 0; i < cells.size(); ++i) {
114 _dataLayoutConverter.storeDataLayout(cells[i]);
124 void init(
const std::array<unsigned long, 3> &dims);
131 auto &cells = *(this->
_cells);
134 for (
size_t i = 0; i < cells.size(); ++i) {
135 _dataLayoutConverter.loadDataLayout(cells[i]);
168 double _interactionLength;
173 std::array<double, 3> _cellLength;
181template <
class ParticleCell,
class Functor>
183 for (
unsigned int d = 0; d < 3; d++) {
184 _overlap[d] = std::ceil(_interactionLength / _cellLength[d]);
185 if (not _spaciallyForward) {
192 auto minMaxElem = std::minmax_element(this->_cellsPerDimension.begin(), this->_cellsPerDimension.end());
193 _dimsPerLength[0] = (int)std::distance(this->_cellsPerDimension.begin(), minMaxElem.second);
194 _dimsPerLength[2] = (int)std::distance(this->_cellsPerDimension.begin(), minMaxElem.first);
195 _dimsPerLength[1] = 3 - (_dimsPerLength[0] + _dimsPerLength[2]);
197 _overlapLongestAxis = _overlap[_dimsPerLength[0]];
#define AUTOPAS_OPENMP(args)
Empty macro to throw away any arguments.
Definition: WrapOpenMP.h:126
A cell pair traversal.
Definition: CellTraversal.h:23
std::vector< ParticleCell > * _cells
The cells to traverse.
Definition: CellTraversal.h:60
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
void initTraversal() override
Load Data Layouts and sets up slice thicknesses.
Definition: SlicedBasedTraversal.h:98
std::array< unsigned long, 3 > _overlap
Overlap of interacting cells.
Definition: SlicedBasedTraversal.h:142
std::array< int, 3 > _dimsPerLength
Store ids of dimensions ordered by number of cells per dimensions.
Definition: SlicedBasedTraversal.h:147
std::vector< unsigned long > _sliceThickness
The number of cells per slice in the dimension that was sliced.
Definition: SlicedBasedTraversal.h:157
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
bool _spaciallyForward
Whether the base step only covers neigboring cells tha are spacially forward (for example c08).
Definition: SlicedBasedTraversal.h:162
unsigned long _overlapLongestAxis
Overlap of interacting cells along the longest axis.
Definition: SlicedBasedTraversal.h:152
bool isApplicable() const override
Checks if the traversal is applicable to the current state of the domain.
Definition: SlicedBasedTraversal.h:64
void endTraversal() override
Write Data to AoS if cells have been set through setCellsToTraverse().
Definition: SlicedBasedTraversal.h:108
void init(const std::array< unsigned long, 3 > &dims)
Resets the cell structure of the traversal.
Definition: SlicedBasedTraversal.h:182
SlicedBasedTraversal(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 sliced traversal.
Definition: SlicedBasedTraversal.h:44
This interface serves as a common parent class for all traversals.
Definition: TraversalInterface.h:18
This converts cells to the target data Layout using the given functor.
Definition: DataLayoutConverter.h:19
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32