28template <
class Particle_T,
class PairwiseFunctor>
46 DataLayoutOption dataLayout,
bool useNewton3)
49 _cellFunctor(pairwiseFunctor, cutoff , dataLayout,
51 _dataLayoutConverter(pairwiseFunctor, dataLayout) {}
53 [[nodiscard]] TraversalOption
getTraversalType()
const override {
return TraversalOption::ot_c01; }
74 using namespace autopas::utils::ArrayMath::literals;
76 auto *haloWrapper = this->
getHalo();
87 _cellFunctor.processCell(*leaf);
92 _cellFunctor.processCellPair(*leaf, *neighborLeaf);
98 auto haloNeighbors = haloWrapper->getLeavesInRange(min, max);
101 _cellFunctor.processCellPair(*leaf, *neighborLeaf);
109 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: OTC01Traversal.h:30
void traverseParticles() override
Traverse the particles by pairs, triplets etc.
Definition: OTC01Traversal.h:73
void initTraversal() override
Initializes the traversal.
Definition: OTC01Traversal.h:57
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: OTC01Traversal.h:109
TraversalOption getTraversalType() const override
Return a enum representing the name of the traversal class.
Definition: OTC01Traversal.h:53
void endTraversal() override
Finalizes the traversal.
Definition: OTC01Traversal.h:63
bool isApplicable() const override
Checks if the traversal is applicable to the current state of the domain.
Definition: OTC01Traversal.h:55
OTC01Traversal(PairwiseFunctor *pairwiseFunctor, double cutoff, double interactionLength, DataLayoutOption dataLayout, bool useNewton3)
Constructor for the Octree traversal.
Definition: OTC01Traversal.h:45
OctreeLeafNode< Particle_T > ParticleCell
A shortcut to specify the type of the actual iterated cell.
Definition: OTC01Traversal.h:35
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
static void octreeToJSON(OctreeNodeInterface< Particle_T > *owned, OctreeNodeInterface< Particle_T > *halo, std::vector< OctreeLeafNode< Particle_T > * > &ownedLeaves, std::vector< OctreeLeafNode< Particle_T > * > &haloLeaves)
Log the octree to JSON files understandable by https://github.com/AutoPas/OctreeVisualization.
Definition: OctreeLogger.h:310
const std::array< double, 3 > & getBoxMax() const
Get the maximum coordinate of the enclosing box.
Definition: OctreeNodeInterface.h:370
const std::array< double, 3 > & getBoxMin() const
Get the minimum coordinate of the enclosing box.
Definition: OctreeNodeInterface.h:364
std::vector< OctreeLeafNode< Particle_T > * > getNeighborLeaves(const octree::Any direction)
This function combines all required functions when traversing down a subtree of the octree and findin...
Definition: OctreeNodeInterface.h:316
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