67 template <
class ParticleCell_T,
class Functor_T>
68 static std::unique_ptr<TraversalInterface>
generateTraversal(TraversalOption traversalType, Functor_T &functor,
70 DataLayoutOption dataLayout,
bool useNewton3);
83 template <
class ParticleCell_T,
class PairwiseFunctor_T>
85 PairwiseFunctor_T &pairwiseFunctor,
87 DataLayoutOption dataLayout,
bool useNewton3);
100 template <
class ParticleCell_T,
class TriwiseFunctor_T>
102 TriwiseFunctor_T &triwiseFunctor,
104 DataLayoutOption dataLayout,
bool useNewton3);
115 template <
class Particle_T,
class Functor_T>
121template <
class ParticleCell_T,
class PairwiseFunctor_T>
123 TraversalOption traversalType, PairwiseFunctor_T &pairwiseFunctor,
const TraversalSelectorInfo &traversalInfo,
124 DataLayoutOption dataLayout,
bool useNewton3) {
125 std::unique_ptr<TraversalInterface> traversal;
126 switch (traversalType) {
128 case TraversalOption::ds_sequential: {
129 traversal = std::make_unique<DSSequentialTraversal<ParticleCell_T, PairwiseFunctor_T>>(
133 dataLayout, useNewton3);
137 case TraversalOption::lc_sliced: {
138 traversal = std::make_unique<LCSlicedTraversal<ParticleCell_T, PairwiseFunctor_T>>(
140 dataLayout, useNewton3);
143 case TraversalOption::lc_sliced_c02: {
144 traversal = std::make_unique<LCSlicedC02Traversal<ParticleCell_T, PairwiseFunctor_T>>(
146 dataLayout, useNewton3);
149 case TraversalOption::lc_sliced_balanced: {
150 traversal = std::make_unique<LCSlicedBalancedTraversal<ParticleCell_T, PairwiseFunctor_T>>(
152 dataLayout, useNewton3);
155 case TraversalOption::lc_c01: {
156 traversal = std::make_unique<LCC01Traversal<ParticleCell_T, PairwiseFunctor_T, false>>(
158 dataLayout, useNewton3);
161 case TraversalOption::lc_c01_combined_SoA: {
162 traversal = std::make_unique<LCC01Traversal<ParticleCell_T, PairwiseFunctor_T, true>>(
164 dataLayout, useNewton3);
167 case TraversalOption::lc_c04_combined_SoA: {
168 traversal = std::make_unique<LCC04CombinedSoATraversal<ParticleCell_T, PairwiseFunctor_T>>(
170 dataLayout, useNewton3);
173 case TraversalOption::lc_c04: {
174 traversal = std::make_unique<LCC04Traversal<ParticleCell_T, PairwiseFunctor_T>>(
176 dataLayout, useNewton3);
179 case TraversalOption::lc_c04_HCP: {
180 traversal = std::make_unique<LCC04HCPTraversal<ParticleCell_T, PairwiseFunctor_T>>(
182 dataLayout, useNewton3);
185 case TraversalOption::lc_c08: {
186 traversal = std::make_unique<LCC08Traversal<ParticleCell_T, PairwiseFunctor_T>>(
188 dataLayout, useNewton3);
191 case TraversalOption::lc_c18: {
192 traversal = std::make_unique<LCC18Traversal<ParticleCell_T, PairwiseFunctor_T>>(
194 dataLayout, useNewton3);
198 case TraversalOption::vl_list_iteration: {
199 traversal = std::make_unique<VLListIterationTraversal<ParticleCell_T, PairwiseFunctor_T>>(pairwiseFunctor,
200 dataLayout, useNewton3);
203 case TraversalOption::vl_list_iteration_c27: {
204 traversal = std::make_unique<VLListIterationC27Traversal<ParticleCell_T, PairwiseFunctor_T>>(
205 pairwiseFunctor, dataLayout, useNewton3, traversalInfo.
cellsPerDim);
209 case TraversalOption::vvl_as_built: {
210 traversal = std::make_unique<
212 pairwiseFunctor, dataLayout, useNewton3);
216 case TraversalOption::vlc_sliced: {
220 dataLayout, useNewton3, ContainerOption::verletListsCells);
223 case TraversalOption::vlc_sliced_c02: {
228 dataLayout, useNewton3, ContainerOption::verletListsCells);
231 case TraversalOption::vlc_sliced_balanced: {
236 dataLayout, useNewton3, ContainerOption::verletListsCells);
239 case TraversalOption::vlc_c01: {
240 traversal = std::make_unique<
VLCC01Traversal<ParticleCell_T, PairwiseFunctor_T,
243 dataLayout, useNewton3, ContainerOption::verletListsCells);
246 case TraversalOption::vlc_c18: {
247 traversal = std::make_unique<
VLCC18Traversal<ParticleCell_T, PairwiseFunctor_T,
250 dataLayout, useNewton3, ContainerOption::verletListsCells);
253 case TraversalOption::vlc_c08: {
254 traversal = std::make_unique<
VLCC08Traversal<ParticleCell_T, PairwiseFunctor_T,
257 dataLayout, useNewton3);
261 case TraversalOption::vcl_cluster_iteration: {
262 traversal = std::make_unique<VCLClusterIterationTraversal<ParticleCell_T, PairwiseFunctor_T>>(
263 pairwiseFunctor, traversalInfo.
clusterSize, dataLayout, useNewton3);
266 case TraversalOption::vcl_c01_balanced: {
267 traversal = std::make_unique<VCLC01BalancedTraversal<typename ParticleCell_T::ParticleType, PairwiseFunctor_T>>(
268 pairwiseFunctor, traversalInfo.
clusterSize, dataLayout, useNewton3);
271 case TraversalOption::vcl_sliced: {
272 traversal = std::make_unique<VCLSlicedTraversal<ParticleCell_T, PairwiseFunctor_T>>(
274 traversalInfo.
clusterSize, dataLayout, useNewton3);
277 case TraversalOption::vcl_sliced_c02: {
278 traversal = std::make_unique<VCLSlicedC02Traversal<ParticleCell_T, PairwiseFunctor_T>>(
280 traversalInfo.
clusterSize, dataLayout, useNewton3);
283 case TraversalOption::vcl_sliced_balanced: {
284 traversal = std::make_unique<VCLSlicedBalancedTraversal<ParticleCell_T, PairwiseFunctor_T>>(
286 traversalInfo.
clusterSize, dataLayout, useNewton3);
289 case TraversalOption::vcl_c06: {
290 traversal = std::make_unique<VCLC06Traversal<ParticleCell_T, PairwiseFunctor_T>>(
291 pairwiseFunctor, traversalInfo.
clusterSize, dataLayout, useNewton3);
295 case TraversalOption::vlp_sliced: {
299 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
302 case TraversalOption::vlp_sliced_c02: {
307 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
310 case TraversalOption::vlp_sliced_balanced: {
315 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
318 case TraversalOption::vlp_c01: {
319 traversal = std::make_unique<
VLCC01Traversal<ParticleCell_T, PairwiseFunctor_T,
322 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
325 case TraversalOption::vlp_c18: {
326 traversal = std::make_unique<
VLCC18Traversal<ParticleCell_T, PairwiseFunctor_T,
329 dataLayout, useNewton3, ContainerOption::pairwiseVerletLists);
332 case TraversalOption::vlp_c08: {
333 traversal = std::make_unique<VLCCellPairC08Traversal<ParticleCell_T, PairwiseFunctor_T>>(
335 dataLayout, useNewton3);
339 case TraversalOption::ot_c18: {
340 using ParticleType =
typename ParticleCell_T::ParticleType;
341 traversal = std::make_unique<OTC18Traversal<ParticleType, PairwiseFunctor_T>>(
346 case TraversalOption::ot_c01: {
347 using ParticleType =
typename ParticleCell_T::ParticleType;
348 traversal = std::make_unique<OTC01Traversal<ParticleType, PairwiseFunctor_T>>(
354 traversalType.to_string());
359 if (not traversal->isApplicableToDomain()) {
363 return std::move(traversal);
366template <
class ParticleCell_T,
class TriwiseFunctor_T>
368 TraversalOption traversalType, TriwiseFunctor_T &triwiseFunctor,
const TraversalSelectorInfo &traversalInfo,
369 DataLayoutOption dataLayout,
bool useNewton3) {
370 std::unique_ptr<TraversalInterface> traversal;
371 switch (traversalType) {
373 case TraversalOption::ds_sequential: {
374 traversal = std::make_unique<DSSequentialTraversal<ParticleCell_T, TriwiseFunctor_T>>(
378 dataLayout, useNewton3);
382 case TraversalOption::lc_c01: {
383 traversal = std::make_unique<
LCC01Traversal<ParticleCell_T, TriwiseFunctor_T,
false>>(
385 dataLayout, useNewton3);
388 case TraversalOption::lc_c08: {
389 traversal = std::make_unique<LCC08Traversal<ParticleCell_T, TriwiseFunctor_T>>(
391 dataLayout, useNewton3);
394 case TraversalOption::lc_c04: {
395 traversal = std::make_unique<LCC04Traversal<ParticleCell_T, TriwiseFunctor_T>>(
397 dataLayout, useNewton3);
400 case TraversalOption::lc_sliced: {
401 traversal = std::make_unique<LCSlicedTraversal<ParticleCell_T, TriwiseFunctor_T>>(
403 dataLayout, useNewton3);
406 case TraversalOption::lc_sliced_c02: {
407 traversal = std::make_unique<LCSlicedC02Traversal<ParticleCell_T, TriwiseFunctor_T>>(
409 dataLayout, useNewton3);
414 traversalType.to_string());
419 if (not traversal->isApplicableToDomain()) {
423 return std::move(traversal);
426template <
class ParticleCell_T,
class Functor_T>
430 DataLayoutOption dataLayout,
bool useNewton3) {
432 return generatePairwiseTraversal<ParticleCell_T, Functor_T>(traversalType, functor, traversalInfo, dataLayout,
435 return generateTriwiseTraversal<ParticleCell_T, Functor_T>(traversalType, functor, traversalInfo, dataLayout,
439 "TraversalSelector::generateTraversal(): No Traversals exist for the given Functor: {}", functor.getName());
443template <
class Particle_T,
class Functor_T>
447 case ContainerOption::Value::linkedCellsReferences:
448 return TraversalSelector::generateTraversal<ReferenceParticleCell<Particle_T>, Functor_T>(
451 return TraversalSelector::generateTraversal<FullParticleCell<Particle_T>, Functor_T>(
Class containing multiple options that form an algorithm configuration for the pairwise iteration.
Definition: Configuration.h:30
TraversalOption traversal
Traversal option.
Definition: Configuration.h:151
DataLayoutOption dataLayout
Data Layout option.
Definition: Configuration.h:163
ContainerOption container
Container option.
Definition: Configuration.h:147
Newton3Option newton3
Newton 3 option.
Definition: Configuration.h:167
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:54
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:122
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:367
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:444
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:427
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:64
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:34