AutoPas  3.0.0
Loading...
Searching...
No Matches
TraversalInterface.h
Go to the documentation of this file.
1
7#pragma once
8
12
13namespace autopas {
14
19 public:
23 virtual ~TraversalInterface() = default;
24
30 TraversalInterface(DataLayoutOption dataLayout, bool useNewton3) : _dataLayout(dataLayout), _useNewton3(useNewton3) {}
31
36 [[nodiscard]] virtual TraversalOption getTraversalType() const = 0;
37
44 [[nodiscard]] virtual bool isApplicableToDomain() const = 0;
45
49 virtual void initTraversal() = 0;
50
54 virtual void traverseParticles() = 0;
55
59 virtual void endTraversal() = 0;
60
65 [[nodiscard]] bool getUseNewton3() const { return _useNewton3; }
66
71 [[nodiscard]] DataLayoutOption getDataLayout() const { return _dataLayout; }
72
73 protected:
77 DataLayoutOption _dataLayout;
78
83};
84} // namespace autopas
This interface serves as a common parent class for all traversals.
Definition: TraversalInterface.h:18
virtual void endTraversal()=0
Finalizes the traversal.
virtual bool isApplicableToDomain() const =0
Checks if the traversal is applicable to the current state of the domain.
virtual TraversalOption getTraversalType() const =0
Return a enum representing the name of the traversal class.
DataLayoutOption _dataLayout
The datalayout used by this traversal.
Definition: TraversalInterface.h:77
virtual ~TraversalInterface()=default
Destructor of TraversalInterface.
virtual void traverseParticles()=0
Traverse the particles by pairs, triplets etc.
virtual void initTraversal()=0
Initializes the traversal.
TraversalInterface(DataLayoutOption dataLayout, bool useNewton3)
Constructor of the TraversalInterface.
Definition: TraversalInterface.h:30
bool _useNewton3
If this traversal makes use of newton3.
Definition: TraversalInterface.h:82
DataLayoutOption getDataLayout() const
Return the data layout option.
Definition: TraversalInterface.h:71
bool getUseNewton3() const
Return whether the traversal uses newton 3.
Definition: TraversalInterface.h:65
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:34