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);
74 void setSortingThreshold(
size_t sortingThreshold)
override { _cellFunctor.setSortingThreshold(sortingThreshold); }
78 using CellFunctorType = std::conditional_t<decltype(utils::isPairwiseFunctor<Functor>())::value,
85 CellFunctorType _cellFunctor;
93template <
class ParticleCell,
class Functor>
95 using namespace autopas::utils::ArrayMath::literals;
98 auto &cells = *(this->_cells);
101 _cellFunctor.processCell(cells[0]);
103 constexpr std::array<std::array<double, 3>, 7> haloDirections{
104 {{0., 0., 0.}, {-1., 0., 0.}, {1., 0., 0.}, {0., -1., 0.}, {0., 1., 0.}, {0., 0., -1.}, {0., 0., 1.}}};
107 for (
int i = 1; i < cells.size(); i++) {
108 _cellFunctor.processCellPair(cells[0], cells[i], std::array<double, 3>(haloDirections[i]));
113 for (
int i = 1; i < cells.size(); i++) {
114 for (
int j = i + 1; j < cells.size(); j++) {
116 _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:60
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:94
void setSortingThreshold(size_t sortingThreshold) override
Set the sorting-threshold for traversals that use the CellFunctor If the sum of the number of particl...
Definition: DSSequentialTraversal.h:74
bool isApplicable() const override
Checks if the traversal is applicable to the current state of the domain.
Definition: DSSequentialTraversal.h:49
DSSequentialTraversal(Functor *functor, double cutoff, DataLayoutOption dataLayout, bool useNewton3)
Constructor for the DirectSum traversal.
Definition: DSSequentialTraversal.h:40
void endTraversal() override
Finalizes the traversal.
Definition: DSSequentialTraversal.h:58
TraversalOption getTraversalType() const override
Return a enum representing the name of the traversal class.
Definition: DSSequentialTraversal.h:47
void initTraversal() override
Initializes the traversal.
Definition: DSSequentialTraversal.h:51
Interface for traversals used by the DirectSum container.
Definition: DSTraversalInterface.h:18
Functor base class.
Definition: Functor.h:40
Class for Cells of Particles.
Definition: ParticleCell.h:51
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:25
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:32