28template <
class Particle_T,
class PairwiseFunctor>
46 DataLayoutOption dataLayout,
bool useNewton3)
51 _cellFunctor(pairwiseFunctor, cutoff , dataLayout,
53 _dataLayoutConverter(pairwiseFunctor, dataLayout) {}
55 [[nodiscard]] TraversalOption
getTraversalType()
const override {
return TraversalOption::ot_c18; }
66 for (
int i = 0; i < leaves.size(); ++i) {
67 leaves[i]->setID(startID + i);
92 using namespace autopas::utils::ArrayMath::literals;
94 auto *haloWrapper = this->
getHalo();
99 _cellFunctor.processCell(*leaf);
102 auto uniqueNeighboringLeaves = leaf->getNeighborLeaves();
104 if (leaf->getID() < neighborLeaf->getID()) {
106 _cellFunctor.processCellPair(*leaf, *neighborLeaf);
113 auto haloNeighbors = haloWrapper->getLeavesInRange(min, max);
116 if (leaf->getID() < neighborLeaf->getID()) {
117 _cellFunctor.processCellPair(*leaf, *neighborLeaf);
126 void setSortingThreshold(
size_t sortingThreshold)
override { _cellFunctor.setSortingThreshold(sortingThreshold); }
A cell pair traversal.
Definition: CellTraversal.h:23
This traversal is capable of iterating over particles stored in the Octree data structure.
Definition: OTC18Traversal.h:30
OctreeLeafNode< Particle_T > ParticleCell
A shortcut to specify the type of the actual iterated cell.
Definition: OTC18Traversal.h:35
void traverseParticles() override
Traverse the particles by pairs, triplets etc.
Definition: OTC18Traversal.h:91
TraversalOption getTraversalType() const override
Return a enum representing the name of the traversal class.
Definition: OTC18Traversal.h:55
OTC18Traversal(PairwiseFunctor *pairwiseFunctor, double cutoff, double interactionLength, DataLayoutOption dataLayout, bool useNewton3)
Constructor for the Octree traversal.
Definition: OTC18Traversal.h:45
void endTraversal() override
Finalizes the traversal.
Definition: OTC18Traversal.h:81
static void assignIDs(std::vector< OctreeLeafNode< Particle_T > * > &leaves, int startID=0)
Assign an integer ID to every leaf.
Definition: OTC18Traversal.h:65
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: OTC18Traversal.h:126
void initTraversal() override
Initializes the traversal.
Definition: OTC18Traversal.h:71
bool isApplicable() const override
Checks if the traversal is applicable to the current state of the domain.
Definition: OTC18Traversal.h:57
This interface exists to provide a row interface for octree to add its cells.
Definition: OTTraversalInterface.h:22
std::vector< OctreeLeafNode< ParticleType > * > _ownedLeaves
A list of all leaves in the owned octree.
Definition: OTTraversalInterface.h:103
OctreeNodeWrapper< ParticleType > * getOwned()
Get the octree cell that contains the owned octree.
Definition: OTTraversalInterface.h:85
std::vector< OctreeLeafNode< ParticleType > * > _haloLeaves
A list of all leaves in the halo octree.
Definition: OTTraversalInterface.h:108
double _interactionLength
The interaction length is used for finding neighbors.
Definition: OTTraversalInterface.h:113
void loadBuffers(utils::DataLayoutConverter< PairwiseFunctor > &dataLayoutConverter, OctreeNodeWrapper< ParticleType > *wrapper, std::vector< OctreeLeafNode< ParticleType > * > &leaves)
Gather all leaves and load the SoA/AoS buffers.
Definition: OTTraversalInterface.h:54
OctreeNodeWrapper< ParticleType > * getHalo()
Get the octree cell that contains the halo octree.
Definition: OTTraversalInterface.h:92
void unloadBuffers(utils::DataLayoutConverter< PairwiseFunctor > &dataLayoutConverter, std::vector< OctreeLeafNode< ParticleType > * > &leaves)
Unload the SoA/AoS buffers and clear the gathered leaves list.
Definition: OTTraversalInterface.h:70
An octree leaf node.
Definition: OctreeLeafNode.h:27
This class wraps the functionality provided by the octree leaves and inner nodes in a structure that ...
Definition: OctreeNodeWrapper.h:37
PairwiseFunctor class.
Definition: PairwiseFunctor.h:31
bool _useNewton3
If this traversal makes use of newton3.
Definition: TraversalInterface.h:80
A cell functor.
Definition: CellFunctor.h:25
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