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.setAoSSortingThresholds(aosSortingThreshold);
82 _cellFunctor.setSoASortingThresholds(soaSortingThreshold);
87 using CellFunctorType = std::conditional_t<decltype(utils::isPairwiseFunctor<Functor>())::value,
94 CellFunctorType _cellFunctor;
102template <
class ParticleCell,
class Functor>
104 using namespace autopas::utils::ArrayMath::literals;
107 auto &cells = *(this->_cells);
110 _cellFunctor.processCell(cells[0]);
112 constexpr std::array<std::array<double, 3>, 7> haloDirections{
113 {{0., 0., 0.}, {-1., 0., 0.}, {1., 0., 0.}, {0., -1., 0.}, {0., 1., 0.}, {0., 0., -1.}, {0., 0., 1.}}};
116 for (
int i = 1; i < cells.size(); i++) {
117 _cellFunctor.processCellPair(cells[0], cells[i], std::array<double, 3>(haloDirections[i]));
122 for (
int i = 1; i < cells.size(); i++) {
123 for (
int j = i + 1; j < cells.size(); j++) {
125 _cellFunctor.processCellTriple(cells[0], cells[i], cells[j], haloDirections[i]);
A cell pair traversal.
Definition: CellTraversal.h:25
std::vector< ParticleCell > * _cells
The cells to traverse.
Definition: CellTraversal.h:75
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:103
void setAoSSortingThresholds(const SortingThresholdInfoInterface &aosSortingThreshold) override
Set the aos-sorting-threshold for traversals that use the CellFunctor.
Definition: DSSequentialTraversal.h:74
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
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
void setSoASortingThresholds(const SortingThresholdInfoInterface &soaSortingThreshold) override
Set the SoA sorting-threshold for traversals that use the CellFunctor.
Definition: DSSequentialTraversal.h:81
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:25
A cell functor.
Definition: CellFunctor.h:32
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
Polymorphic base for sorting-threshold storage.
Definition: SortingThresholdInfoInterface.h:18