66 template <
class ParticleCell_T,
class Functor_T>
67 static std::unique_ptr<TraversalInterface>
generateTraversal(TraversalOption traversalType, Functor_T &functor,
69 DataLayoutOption dataLayout,
bool useNewton3);
82 template <
class ParticleCell_T,
class PairwiseFunctor_T>
84 PairwiseFunctor_T &pairwiseFunctor,
86 DataLayoutOption dataLayout,
bool useNewton3);
99 template <
class ParticleCell_T,
class TriwiseFunctor_T>
101 TriwiseFunctor_T &triwiseFunctor,
103 DataLayoutOption dataLayout,
bool useNewton3);
114 template <
class Particle_T,
class Functor_T>
120template <
class ParticleCell_T,
class PairwiseFunctor_T>
122 TraversalOption traversalType, PairwiseFunctor_T &pairwiseFunctor,
const TraversalSelectorInfo &traversalInfo,
123 DataLayoutOption dataLayout,
bool useNewton3) {
124 std::unique_ptr<TraversalInterface> traversal;
125 switch (traversalType) {
127 case TraversalOption::ds_sequential: {
128 traversal = std::make_unique<DSSequentialTraversal<ParticleCell_T, PairwiseFunctor_T>>(
132 dataLayout, useNewton3);
136 case TraversalOption::lc_sliced: {
137 traversal = std::make_unique<LCSlicedTraversal<ParticleCell_T, PairwiseFunctor_T>>(
139 dataLayout, useNewton3);
142 case TraversalOption::lc_sliced_c02: {
143 traversal = std::make_unique<LCSlicedC02Traversal<ParticleCell_T, PairwiseFunctor_T>>(
145 dataLayout, useNewton3);
148 case TraversalOption::lc_sliced_balanced: {
149 traversal = std::make_unique<LCSlicedBalancedTraversal<ParticleCell_T, PairwiseFunctor_T>>(
151 dataLayout, useNewton3);
154 case TraversalOption::lc_c01: {
155 traversal = std::make_unique<LCC01Traversal<ParticleCell_T, PairwiseFunctor_T, false>>(
157 dataLayout, useNewton3);
160 case TraversalOption::lc_c01_combined_SoA: {
161 traversal = std::make_unique<LCC01Traversal<ParticleCell_T, PairwiseFunctor_T, true>>(
163 dataLayout, useNewton3);
166 case TraversalOption::lc_c04_combined_SoA: {
167 traversal = std::make_unique<LCC04CombinedSoATraversal<ParticleCell_T, PairwiseFunctor_T>>(
169 dataLayout, useNewton3);
172 case TraversalOption::lc_c04: {
173 traversal = std::make_unique<LCC04Traversal<ParticleCell_T, PairwiseFunctor_T>>(
175 dataLayout, useNewton3);
178 case TraversalOption::lc_c04_HCP: {
179 traversal = std::make_unique<LCC04HCPTraversal<ParticleCell_T, PairwiseFunctor_T>>(
181 dataLayout, useNewton3);
184 case TraversalOption::lc_c08: {
185 traversal = std::make_unique<LCC08Traversal<ParticleCell_T, PairwiseFunctor_T>>(
187 dataLayout, useNewton3);
190 case TraversalOption::lc_c18: {
191 traversal = std::make_unique<LCC18Traversal<ParticleCell_T, PairwiseFunctor_T>>(
193 dataLayout, useNewton3);
197 case TraversalOption::vl_list_iteration: {
198 traversal = std::make_unique<VLListIterationTraversal<ParticleCell_T, PairwiseFunctor_T>>(&pairwiseFunctor,
199 dataLayout, useNewton3);
203 case TraversalOption::vvl_as_built: {
204 traversal = std::make_unique<
206 &pairwiseFunctor, dataLayout, useNewton3);
210 case TraversalOption::vlc_sliced: {
214 dataLayout, useNewton3, ContainerOption::verletListsCells);
217 case TraversalOption::vlc_sliced_c02: {
222 dataLayout, useNewton3, ContainerOption::verletListsCells);
225 case TraversalOption::vlc_sliced_balanced: {
230 dataLayout, useNewton3, ContainerOption::verletListsCells);
233 case TraversalOption::vlc_c01: {
234 traversal = std::make_unique<
VLCC01Traversal<ParticleCell_T, PairwiseFunctor_T,
237 dataLayout, useNewton3, ContainerOption::verletListsCells);
240 case TraversalOption::vlc_c18: {
241 traversal = std::make_unique<
VLCC18Traversal<ParticleCell_T, PairwiseFunctor_T,
244 dataLayout, useNewton3, ContainerOption::verletListsCells);
247 case TraversalOption::vlc_c08: {
248 traversal = std::make_unique<
VLCC08Traversal<ParticleCell_T, PairwiseFunctor_T,
251 dataLayout, useNewton3);
255 case TraversalOption::vcl_cluster_iteration: {
256 traversal = std::make_unique<VCLClusterIterationTraversal<ParticleCell_T, PairwiseFunctor_T>>(
257 &pairwiseFunctor, traversalInfo.
clusterSize, dataLayout, useNewton3);
260 case TraversalOption::vcl_c01_balanced: {
261 traversal = std::make_unique<VCLC01BalancedTraversal<typename ParticleCell_T::ParticleType, PairwiseFunctor_T>>(
262 &pairwiseFunctor, traversalInfo.
clusterSize, dataLayout, useNewton3);
265 case TraversalOption::vcl_sliced: {
266 traversal = std::make_unique<VCLSlicedTraversal<ParticleCell_T, PairwiseFunctor_T>>(
268 traversalInfo.
clusterSize, dataLayout, useNewton3);
271 case TraversalOption::vcl_sliced_c02: {
272 traversal = std::make_unique<VCLSlicedC02Traversal<ParticleCell_T, PairwiseFunctor_T>>(
274 traversalInfo.
clusterSize, dataLayout, useNewton3);
277 case TraversalOption::vcl_sliced_balanced: {
278 traversal = std::make_unique<VCLSlicedBalancedTraversal<ParticleCell_T, PairwiseFunctor_T>>(
280 traversalInfo.
clusterSize, dataLayout, useNewton3);
283 case TraversalOption::vcl_c06: {
284 traversal = std::make_unique<VCLC06Traversal<ParticleCell_T, PairwiseFunctor_T>>(
285 &pairwiseFunctor, traversalInfo.
clusterSize, dataLayout, useNewton3);
289 case TraversalOption::vlp_sliced: {
293 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
296 case TraversalOption::vlp_sliced_c02: {
301 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
304 case TraversalOption::vlp_sliced_balanced: {
309 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
312 case TraversalOption::vlp_c01: {
313 traversal = std::make_unique<
VLCC01Traversal<ParticleCell_T, PairwiseFunctor_T,
316 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
319 case TraversalOption::vlp_c18: {
320 traversal = std::make_unique<
VLCC18Traversal<ParticleCell_T, PairwiseFunctor_T,
323 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
326 case TraversalOption::vlp_c08: {
327 traversal = std::make_unique<VLCCellPairC08Traversal<ParticleCell_T, PairwiseFunctor_T>>(
329 dataLayout, useNewton3);
333 case TraversalOption::ot_c18: {
334 using ParticleType =
typename ParticleCell_T::ParticleType;
335 traversal = std::make_unique<OTC18Traversal<ParticleType, PairwiseFunctor_T>>(
340 case TraversalOption::ot_c01: {
341 using ParticleType =
typename ParticleCell_T::ParticleType;
342 traversal = std::make_unique<OTC01Traversal<ParticleType, PairwiseFunctor_T>>(
348 traversalType.to_string());
353 if (not traversal->isApplicable()) {
357 return std::move(traversal);
360template <
class ParticleCell_T,
class TriwiseFunctor_T>
362 TraversalOption traversalType, TriwiseFunctor_T &triwiseFunctor,
const TraversalSelectorInfo &traversalInfo,
363 DataLayoutOption dataLayout,
bool useNewton3) {
364 std::unique_ptr<TraversalInterface> traversal;
365 switch (traversalType) {
367 case TraversalOption::ds_sequential: {
368 traversal = std::make_unique<DSSequentialTraversal<ParticleCell_T, TriwiseFunctor_T>>(
372 dataLayout, useNewton3);
376 case TraversalOption::lc_c01: {
377 traversal = std::make_unique<
LCC01Traversal<ParticleCell_T, TriwiseFunctor_T,
false>>(
379 dataLayout, useNewton3);
384 traversalType.to_string());
389 if (not traversal->isApplicable()) {
393 return std::move(traversal);
396template <
class ParticleCell_T,
class Functor_T>
400 DataLayoutOption dataLayout,
bool useNewton3) {
402 return generatePairwiseTraversal<ParticleCell_T, Functor_T>(traversalType, functor, traversalInfo, dataLayout,
405 return generateTriwiseTraversal<ParticleCell_T, Functor_T>(traversalType, functor, traversalInfo, dataLayout,
409 "TraversalSelector::generateTraversal(): No Traversals exist for the given Functor: {}", functor.getName());
413template <
class Particle_T,
class Functor_T>
417 case ContainerOption::Value::linkedCellsReferences:
418 return TraversalSelector::generateTraversal<ReferenceParticleCell<Particle_T>, Functor_T>(
421 return TraversalSelector::generateTraversal<FullParticleCell<Particle_T>, Functor_T>(
Class containing multiple options that form an algorithm configuration for the pairwise iteration.
Definition: Configuration.h:24
TraversalOption traversal
Traversal option.
Definition: Configuration.h:122
DataLayoutOption dataLayout
Data Layout option.
Definition: Configuration.h:130
ContainerOption container
Container option.
Definition: Configuration.h:118
Newton3Option newton3
Newton 3 option.
Definition: Configuration.h:134
This class provides the c01 traversal and the c01 traversal with combined SoA buffers.
Definition: LCC01Traversal.h:82
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
Selector for a container traversal.
Definition: TraversalSelector.h:53
static std::unique_ptr< TraversalInterface > generatePairwiseTraversal(TraversalOption traversalType, PairwiseFunctor_T &pairwiseFunctor, const TraversalSelectorInfo &traversalInfo, DataLayoutOption dataLayout, bool useNewton3)
Generates a given pairwise Traversal for the given properties.
Definition: TraversalSelector.h:121
static std::unique_ptr< TraversalInterface > generateTriwiseTraversal(TraversalOption traversalType, TriwiseFunctor_T &triwiseFunctor, const TraversalSelectorInfo &traversalInfo, DataLayoutOption dataLayout, bool useNewton3)
Generates a given triwise Traversal for the given properties.
Definition: TraversalSelector.h:361
static std::unique_ptr< TraversalInterface > generateTraversalFromConfig(const Configuration &config, Functor_T &functor, const TraversalSelectorInfo &traversalInfo)
Generates a traversal from the given configuration.
Definition: TraversalSelector.h:414
static std::unique_ptr< TraversalInterface > generateTraversal(TraversalOption traversalType, Functor_T &functor, const TraversalSelectorInfo &traversalInfo, DataLayoutOption dataLayout, bool useNewton3)
Generates a given Traversal for the given properties.
Definition: TraversalSelector.h:397
Neighbor list to be used with VerletListsCells container.
Definition: VLCAllCellsNeighborList.h:27
This class provides the c01 traversal.
Definition: VLCC01Traversal.h:26
This class provides the vlc_c08 traversal.
Definition: VLCC08Traversal.h:29
This class provides the lc_c18 traversal.
Definition: VLCC18Traversal.h:29
Neighbor list to be used with VerletListsCells container.
Definition: VLCCellPairNeighborList.h:23
This class provides the balanced sliced traversal.
Definition: VLCSlicedBalancedTraversal.h:34
This class provides the colored sliced traversal.
Definition: VLCSlicedC02Traversal.h:32
This class provides the (locked) sliced traversal.
Definition: VLCSlicedTraversal.h:38
Traversal for VarVerletLists with VerletNeighborListAsBuild as neighbor list.
Definition: VVLAsBuildTraversal.h:25
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