AutoPas  3.0.0
Loading...
Searching...
No Matches
VLTraversalInterface.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <unordered_map>
10
12
13namespace autopas {
14
21template <class LinkedParticleCell>
23 using ParticleType = LinkedParticleCell::ParticleType;
24
25 public:
29 virtual ~VLTraversalInterface() = default;
30
38 virtual void setCellsAndNeighborLists(std::vector<LinkedParticleCell> &cells,
40 const std::unordered_map<const ParticleType *, size_t> &particleToIndex,
41 const std::vector<ParticleType *> &indexToParticle) {
42 _cells = &cells;
43 _neighborList = &neighborList;
44 _particleToIndex = &particleToIndex;
45 _indexToParticle = &indexToParticle;
46 }
47
48 protected:
52 std::vector<LinkedParticleCell> *_cells = nullptr;
53
58
63 const std::unordered_map<const ParticleType *, size_t> *_particleToIndex = nullptr;
64
69 const std::vector<ParticleType *> *_indexToParticle = nullptr;
70};
71
72} // namespace autopas
This class provides the Traversal Interface for the verlet lists container.
Definition: VLTraversalInterface.h:22
const std::unordered_map< const ParticleType *, size_t > * _particleToIndex
Map from particle pointers to their dense SoA index.
Definition: VLTraversalInterface.h:63
const std::vector< ParticleType * > * _indexToParticle
Vector mapping SoA indices to particle pointers.
Definition: VLTraversalInterface.h:69
std::vector< LinkedParticleCell > * _cells
The cells of the underlying linked cells container of the verlet lists container.
Definition: VLTraversalInterface.h:52
virtual ~VLTraversalInterface()=default
Destructor.
VerletListHelpers< ParticleType >::NeighborListCRS * _neighborList
The flat CRS neighbor list.
Definition: VLTraversalInterface.h:57
virtual void setCellsAndNeighborLists(std::vector< LinkedParticleCell > &cells, VerletListHelpers< ParticleType >::NeighborListCRS &neighborList, const std::unordered_map< const ParticleType *, size_t > &particleToIndex, const std::vector< ParticleType * > &indexToParticle)
Sets the information the traversal needs for the iteration.
Definition: VLTraversalInterface.h:38
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:34
Flat Compressed-Row-Storage (CRS) neighbor list.
Definition: VerletListHelpers.h:32