28template <
class ParticleCell,
class Functor>
43 _cellFunctor(functor, cutoff , dataLayout,
45 _dataLayoutConverter(functor, dataLayout) {}
47 [[nodiscard]] TraversalOption
getTraversalType()
const override {
return TraversalOption::ds_sequential; }
52 auto &cells = *(this->
_cells);
53 for (
auto &cell : cells) {
54 _dataLayoutConverter.loadDataLayout(cell);
59 auto &cells = *(this->
_cells);
60 for (
auto &cell : cells) {
61 _dataLayoutConverter.storeDataLayout(cell);
75 _cellFunctor.setAoSSortingThreshold(aosSortingThreshold);
81 _cellFunctor.setSoASortingThreshold(soaSortingThreshold);
86 using CellFunctorType = std::conditional_t<decltype(utils::isPairwiseFunctor<Functor>())::value,
93 CellFunctorType _cellFunctor;
101template <
class ParticleCell,
class Functor>
103 using namespace autopas::utils::ArrayMath::literals;
106 auto &cells = *(this->_cells);
109 _cellFunctor.processCell(cells[0]);
111 constexpr std::array<std::array<double, 3>, 7> haloDirections{
112 {{0., 0., 0.}, {-1., 0., 0.}, {1., 0., 0.}, {0., -1., 0.}, {0., 1., 0.}, {0., 0., -1.}, {0., 0., 1.}}};
115 for (
int i = 1; i < cells.size(); i++) {
116 _cellFunctor.processCellPair(cells[0], cells[i], std::array<double, 3>(haloDirections[i]));
121 for (
int i = 1; i < cells.size(); i++) {
122 for (
int j = i + 1; j < cells.size(); j++) {
124 _cellFunctor.processCellTriple(cells[0], cells[i], cells[j], haloDirections[i]);
A cell pair traversal.
Definition: CellTraversal.h:23
std::vector< ParticleCell > * _cells
The cells to traverse.
Definition: CellTraversal.h:68
This sum defines the traversal typically used by the DirectSum container.
Definition: DSSequentialTraversal.h:31
void traverseParticles() override
Traverse the particles by pairs, triplets etc.
Definition: DSSequentialTraversal.h:102
bool isApplicableToDomain() const override
Checks if the traversal is applicable to the current state of the domain.
Definition: DSSequentialTraversal.h:49
void endTraversal() override
Finalizes the traversal.
Definition: DSSequentialTraversal.h:58
void setSoASortingThreshold(size_t soaSortingThreshold) override
Set the SoA sorting-threshold for traversals that use the CellFunctor.
Definition: DSSequentialTraversal.h:80
TraversalOption getTraversalType() const override
Return a enum representing the name of the traversal class.
Definition: DSSequentialTraversal.h:47
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: DSSequentialTraversal.h:74
void initTraversal() override
Initializes the traversal.
Definition: DSSequentialTraversal.h:51
DSSequentialTraversal(Functor &functor, double cutoff, DataLayoutOption dataLayout, bool useNewton3)
Constructor for the DirectSum traversal.
Definition: DSSequentialTraversal.h:40
Interface for traversals used by the DirectSum container.
Definition: DSTraversalInterface.h:18
Functor base class.
Definition: Functor.h:41
Class for Cells of Particles.
Definition: ParticleCell.h:49
This interface serves as a common parent class for all traversals.
Definition: TraversalInterface.h:18
A cell functor.
Definition: CellFunctor3B.h:24
A cell functor.
Definition: CellFunctor.h:29
This converts cells to the target data Layout using the given functor.
Definition: DataLayoutConverter.h:19
decltype(isTriwiseFunctorImpl(std::declval< FunctorT >())) isTriwiseFunctor
Check whether a Functor Type is inheriting from TriwiseFunctor.
Definition: checkFunctorType.h:56
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:34