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
42 [[nodiscard]] virtual bool isApplicable() const = 0;
43
47 virtual void initTraversal() = 0;
48
52 virtual void traverseParticles() = 0;
53
57 virtual void endTraversal() = 0;
58
63 [[nodiscard]] bool getUseNewton3() const { return _useNewton3; }
64
69 [[nodiscard]] DataLayoutOption getDataLayout() const { return _dataLayout; }
70
71 protected:
75 DataLayoutOption _dataLayout;
76
81};
82} // 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 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:75
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:80
virtual bool isApplicable() const =0
Checks if the traversal is applicable to the current state of the domain.
DataLayoutOption getDataLayout() const
Return the data layout option.
Definition: TraversalInterface.h:69
bool getUseNewton3() const
Return whether the traversal uses newton 3.
Definition: TraversalInterface.h:63
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32