29template <
class ParticleCell,
class PairwiseFunctor>
43 const double interactionLength,
const std::array<double, 3> &cellLength,
44 DataLayoutOption dataLayout,
bool useNewton3)
46 dataLayout, useNewton3),
48 dataLayout, useNewton3),
49 _end(utils::ArrayMath::subScalar(utils::ArrayUtils::static_cast_copy_array<long>(this->
_cellsPerDimension),
54 [[nodiscard]] TraversalOption
getTraversalType()
const override {
return TraversalOption::lc_c04_HCP; }
59 const double minLength = *std::min_element(this->
_cellLength.cbegin(), this->_cellLength.cend());
78 void traverseSingleColor(std::vector<ParticleCell> &cells,
int color);
80 void processBasePack6(std::vector<ParticleCell> &cells,
const std::array<long, 3> &base3DIndex);
84 const std::array<long, 3> _end;
87template <
class ParticleCell,
class PairwiseFunctor>
88void LCC04HCPTraversal<ParticleCell, PairwiseFunctor>::processBasePack6(std::vector<ParticleCell> &cells,
89 const std::array<long, 3> &base3DIndex) {
91 std::array<long, 3> index{};
92 const std::array<long, 3> signedDims = utils::ArrayUtils::static_cast_copy_array<long>(this->_cellsPerDimension);
95 for (
long z = 0; z < 3; ++z) {
96 for (
long x = 0; x < 2; ++x) {
97 index[0] = base3DIndex[0] + x;
98 index[1] = base3DIndex[1];
99 index[2] = base3DIndex[2] + z;
102 for (
int d = 0; d < 3; ++d) {
104 isIn &= (index[d] >= 0l) and (index[d] <= (_end[d] - this->_overlap[d]));
109 const unsigned long ulIndex =
threeToOneD(index, signedDims);
110 _cellHandler.processBaseCell(cells, ulIndex);
116template <
class ParticleCell,
class PairwiseFunctor>
118 auto &cells = *(this->_cells);
120 for (
int color = 0; color < 4; ++color) {
121 traverseSingleColor(cells, color);
139template <
class ParticleCell,
class PairwiseFunctor>
143 std::array<long, 3> startOfThisColor{};
150 startOfThisColor = {0l, 0l, 0l};
153 startOfThisColor = {-4l, 0l, 1l};
156 startOfThisColor = {-4l, 0l, -2l};
159 startOfThisColor = {-2l, 0l, -1l};
166 const long startX = startOfThisColor[0], endX = _end[0];
167 const long startY = startOfThisColor[1], endY = _end[1];
168 const long startZ = startOfThisColor[2], endZ = _end[2];
172 for (
long z = startZ; z < endZ; z += 4) {
173 for (
long y = startY; y < endY; y++) {
176 for (
long x = startX; x < (endX + 4); x += 6) {
186 switch ((z - startZ) % 12 / 4) {
199 if ((y - startY) % 2 != 0) {
202 processBasePack6(cells, {x_index, y, z});
#define AUTOPAS_OPENMP(args)
Empty macro to throw away any arguments.
Definition: WrapOpenMP.h:126
This class provides the base for traversals using the c08 base step.
Definition: C08BasedTraversal.h:24
std::array< unsigned long, 3 > _cellsPerDimension
The dimensions of the cellblock.
Definition: CellTraversal.h:63
const double _interactionLength
Interaction length (cutoff + skin).
Definition: ColorBasedTraversal.h:111
std::array< unsigned long, 3 > _overlap
overlap of interacting cells.
Definition: ColorBasedTraversal.h:121
const std::array< double, 3 > _cellLength
cell length in CellBlock3D.
Definition: ColorBasedTraversal.h:116
This class provides the c04 hcp traversal.
Definition: LCC04HCPTraversal.h:30
LCC04HCPTraversal(const std::array< unsigned long, 3 > &dims, PairwiseFunctor &pairwiseFunctor, const double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3)
Constructor of c04hcp.
Definition: LCC04HCPTraversal.h:42
void setAoSSortingThreshold(size_t aosSortingThreshold) override
Set the aos-sorting-threshold for traversals that use the CellFunctor If the sum of the number of par...
Definition: LCC04HCPTraversal.h:67
void traverseParticles() override
Traverse the particles by pairs, triplets etc.
Definition: LCC04HCPTraversal.h:117
TraversalOption getTraversalType() const override
Return a enum representing the name of the traversal class.
Definition: LCC04HCPTraversal.h:54
bool isApplicableToDomain() const override
Checks if the traversal is applicable to the current state of the domain.
Definition: LCC04HCPTraversal.h:56
void setSoASortingThreshold(size_t soaSortingThreshold) override
Set the SoA sorting-threshold for traversals that use the CellFunctor.
Definition: LCC04HCPTraversal.h:73
This class provides the base for traversals using the c08 base step.
Definition: LCC08CellHandler.h:27
void setAoSSortingThreshold(size_t aosSortingThreshold)
Set the aos-sorting-threshold for traversals that use the CellFunctor If the sum of the number of par...
Definition: LCC08CellHandler.h:87
void setSoASortingThreshold(size_t soaSortingThreshold)
Set the SoA sorting-threshold for traversals that use the CellFunctor.
Definition: LCC08CellHandler.h:91
Interface for traversals used by the LinkedCell class.
Definition: LCTraversalInterface.h:18
PairwiseFunctor class.
Definition: PairwiseFunctor.h:45
Class for Cells of Particles.
Definition: ParticleCell.h:49
static void exception(const Exception e)
Handle an exception derived by std::exception.
Definition: ExceptionHandler.h:64
constexpr T threeToOneD(T x, T y, T z, const std::array< T, 3 > &dims)
Convert a 3d index to a 1d index.
Definition: ThreeDimensionalMapping.h:29
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:34