11#include <unordered_map>
61template <
class ParticleCell>
74 template <
class Functor>
77 DataLayoutOption dataLayout,
bool useNewton3);
89 template <
class PairwiseFunctor>
93 DataLayoutOption dataLayout,
bool useNewton3);
105 template <
class TriwiseFunctor>
109 DataLayoutOption dataLayout,
bool useNewton3);
112template <
class ParticleCell>
113template <
class PairwiseFunctor>
116 DataLayoutOption dataLayout,
bool useNewton3) {
117 switch (traversalType) {
119 case TraversalOption::ds_sequential: {
120 return std::make_unique<DSSequentialTraversal<ParticleCell, PairwiseFunctor>>(
124 dataLayout, useNewton3);
127 case TraversalOption::lc_sliced: {
128 return std::make_unique<LCSlicedTraversal<ParticleCell, PairwiseFunctor>>(
130 dataLayout, useNewton3);
132 case TraversalOption::lc_sliced_c02: {
133 return std::make_unique<LCSlicedC02Traversal<ParticleCell, PairwiseFunctor>>(
135 dataLayout, useNewton3);
137 case TraversalOption::lc_sliced_balanced: {
138 return std::make_unique<LCSlicedBalancedTraversal<ParticleCell, PairwiseFunctor>>(
140 dataLayout, useNewton3);
142 case TraversalOption::lc_c01: {
143 return std::make_unique<LCC01Traversal<ParticleCell, PairwiseFunctor, false>>(
145 dataLayout, useNewton3);
147 case TraversalOption::lc_c01_combined_SoA: {
148 return std::make_unique<LCC01Traversal<ParticleCell, PairwiseFunctor, true>>(
150 dataLayout, useNewton3);
152 case TraversalOption::lc_c04_combined_SoA: {
153 return std::make_unique<LCC04CombinedSoATraversal<ParticleCell, PairwiseFunctor>>(
155 dataLayout, useNewton3);
157 case TraversalOption::lc_c04: {
158 return std::make_unique<LCC04Traversal<ParticleCell, PairwiseFunctor>>(
160 dataLayout, useNewton3);
162 case TraversalOption::lc_c04_HCP: {
163 return std::make_unique<LCC04HCPTraversal<ParticleCell, PairwiseFunctor>>(
165 dataLayout, useNewton3);
167 case TraversalOption::lc_c08: {
168 return std::make_unique<LCC08Traversal<ParticleCell, PairwiseFunctor>>(
170 dataLayout, useNewton3);
172 case TraversalOption::lc_c18: {
173 return std::make_unique<LCC18Traversal<ParticleCell, PairwiseFunctor>>(
175 dataLayout, useNewton3);
178 case TraversalOption::vl_list_iteration: {
179 return std::make_unique<VLListIterationTraversal<ParticleCell, PairwiseFunctor>>(&pairwiseFunctor, dataLayout,
183 case TraversalOption::vvl_as_built: {
184 return std::make_unique<VVLAsBuildTraversal<ParticleCell, typename ParticleCell::ParticleType, PairwiseFunctor>>(
185 &pairwiseFunctor, dataLayout, useNewton3);
188 case TraversalOption::vlc_sliced: {
192 dataLayout, useNewton3, ContainerOption::verletListsCells);
194 case TraversalOption::vlc_sliced_c02: {
198 dataLayout, useNewton3, ContainerOption::verletListsCells);
200 case TraversalOption::vlc_sliced_balanced: {
204 dataLayout, useNewton3, ContainerOption::verletListsCells);
206 case TraversalOption::vlc_c01: {
207 return std::make_unique<
210 dataLayout, useNewton3, ContainerOption::verletListsCells);
212 case TraversalOption::vlc_c18: {
213 return std::make_unique<
216 dataLayout, useNewton3, ContainerOption::verletListsCells);
218 case TraversalOption::vlc_c08: {
219 return std::make_unique<
222 dataLayout, useNewton3);
225 case TraversalOption::vcl_cluster_iteration: {
226 return std::make_unique<VCLClusterIterationTraversal<ParticleCell, PairwiseFunctor>>(
227 &pairwiseFunctor, traversalInfo.
clusterSize, dataLayout, useNewton3);
229 case TraversalOption::vcl_c01_balanced: {
230 return std::make_unique<VCLC01BalancedTraversal<typename ParticleCell::ParticleType, PairwiseFunctor>>(
231 &pairwiseFunctor, traversalInfo.
clusterSize, dataLayout, useNewton3);
233 case TraversalOption::vcl_sliced: {
234 return std::make_unique<VCLSlicedTraversal<ParticleCell, PairwiseFunctor>>(
236 traversalInfo.
clusterSize, dataLayout, useNewton3);
238 case TraversalOption::vcl_sliced_c02: {
239 return std::make_unique<VCLSlicedC02Traversal<ParticleCell, PairwiseFunctor>>(
241 traversalInfo.
clusterSize, dataLayout, useNewton3);
243 case TraversalOption::vcl_sliced_balanced: {
244 return std::make_unique<VCLSlicedBalancedTraversal<ParticleCell, PairwiseFunctor>>(
246 traversalInfo.
clusterSize, dataLayout, useNewton3);
248 case TraversalOption::vcl_c06: {
249 return std::make_unique<VCLC06Traversal<ParticleCell, PairwiseFunctor>>(
250 &pairwiseFunctor, traversalInfo.
clusterSize, dataLayout, useNewton3);
253 case TraversalOption::vlp_sliced: {
257 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
259 case TraversalOption::vlp_sliced_c02: {
263 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
265 case TraversalOption::vlp_sliced_balanced: {
269 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
271 case TraversalOption::vlp_c01: {
272 return std::make_unique<
275 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
277 case TraversalOption::vlp_c18: {
278 return std::make_unique<
281 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
283 case TraversalOption::vlp_c08: {
284 return std::make_unique<VLCCellPairC08Traversal<ParticleCell, PairwiseFunctor>>(
286 dataLayout, useNewton3);
289 case TraversalOption::ot_c18: {
291 return std::make_unique<OTC18Traversal<ParticleType, PairwiseFunctor>>(
295 case TraversalOption::ot_c01: {
297 return std::make_unique<OTC01Traversal<ParticleType, PairwiseFunctor>>(
302 traversalType.to_string());
308template <
class ParticleCell>
309template <
class TriwiseFunctor>
312 DataLayoutOption dataLayout,
bool useNewton3) {
313 switch (traversalType) {
315 case TraversalOption::ds_sequential: {
316 return std::make_unique<DSSequentialTraversal<ParticleCell, TriwiseFunctor>>(
320 dataLayout, useNewton3);
323 case TraversalOption::lc_c01: {
326 dataLayout, useNewton3);
330 traversalType.to_string());
336template <
class ParticleCell>
337template <
class Functor>
340 DataLayoutOption dataLayout,
bool useNewton3) {
343 generatePairwiseTraversal<Functor>(traversalType, functor, traversalInfo, dataLayout, useNewton3);
344 return std::unique_ptr<TraversalInterface>(
dynamic_cast<TraversalInterface *
>(pairTraversal.release()));
347 generateTriwiseTraversal<Functor>(traversalType, functor, traversalInfo, dataLayout, useNewton3);
348 return std::unique_ptr<TraversalInterface>(
dynamic_cast<TraversalInterface *
>(triTraversal.release()));
351 "TraversalSelector::generateTraversal(): No Traversals exist for the given Functor: {}", functor.
getName());
Functor base class.
Definition: Functor.h:40
virtual std::string getName()=0
Returns name of functor.
This class provides the c01 traversal and the c01 traversal with combined SoA buffers.
Definition: LCC01Traversal.h:82
PairwiseFunctor class.
Definition: PairwiseFunctor.h:31
Class for Cells of Particles.
Definition: ParticleCell.h:51
Particle_T ParticleType
The particle type for this cell.
Definition: ParticleCell.h:56
This interface serves as a common parent class for all traversals.
Definition: TraversalInterface.h:18
Info for traversals of a specific container.
Definition: TraversalSelectorInfo.h:14
const std::array< double, 3 > cellLength
cell length
Definition: TraversalSelectorInfo.h:49
const unsigned int clusterSize
This specifies the size of verlet clusters.
Definition: TraversalSelectorInfo.h:54
const std::array< unsigned long, 3 > cellsPerDim
Number of cells in the domain per dimension.
Definition: TraversalSelectorInfo.h:39
const double interactionLength
Interaction length.
Definition: TraversalSelectorInfo.h:44
TraversalSelector is used for the construction of the list in the applyBuildFunctor method.
Definition: TraversalSelector.h:62
static std::unique_ptr< TraversalInterface > generateTraversal(TraversalOption traversalType, Functor &functor, const TraversalSelectorInfo &traversalInfo, DataLayoutOption dataLayout, bool useNewton3)
Generates a given Traversal for the given properties.
Definition: TraversalSelector.h:338
static std::unique_ptr< TraversalInterface > generateTriwiseTraversal(TraversalOption traversalType, TriwiseFunctor &triwiseFunctor, const TraversalSelectorInfo &traversalInfo, DataLayoutOption dataLayout, bool useNewton3)
Generates a given triwise Traversal for the given properties.
Definition: TraversalSelector.h:310
static std::unique_ptr< TraversalInterface > generatePairwiseTraversal(TraversalOption traversalType, PairwiseFunctor &pairwiseFunctor, const TraversalSelectorInfo &traversalInfo, DataLayoutOption dataLayout, bool useNewton3)
Generates a given pairwise Traversal for the given properties.
Definition: TraversalSelector.h:114
TriwiseFunctor class.
Definition: TriwiseFunctor.h:28
Neighbor list to be used with VerletListsCells container.
Definition: VLCAllCellsNeighborList.h:37
This class provides the c01 traversal.
Definition: VLCC01Traversal.h:27
This class provides the vlc_c08 traversal.
Definition: VLCC08Traversal.h:32
This class provides the lc_c18 traversal.
Definition: VLCC18Traversal.h:29
Neighbor list to be used with VerletListsCells container.
Definition: VLCCellPairNeighborList.h:30
This class provides the balanced sliced traversal.
Definition: VLCSlicedBalancedTraversal.h:36
This class provides the colored sliced traversal.
Definition: VLCSlicedC02Traversal.h:34
This class provides the (locked) sliced traversal.
Definition: VLCSlicedTraversal.h:39
static void exception(const Exception e)
Handle an exception derived by std::exception.
Definition: ExceptionHandler.h:63
decltype(isTriwiseFunctorImpl(std::declval< FunctorT >())) isTriwiseFunctor
Check whether a Functor Type is inheriting from TriwiseFunctor.
Definition: checkFunctorType.h:56
decltype(isPairwiseFunctorImpl(std::declval< FunctorT >())) isPairwiseFunctor
Check whether a Functor Type is inheriting from PairwiseFunctor.
Definition: checkFunctorType.h:49
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32