AutoPas  3.0.0
Loading...
Searching...
No Matches
StaticContainerSelector.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <memory>
10
13#include "autopas/containers/linkedCells/LinkedCellsReferences.h"
19
20namespace autopas {
32template <typename Particle_T, typename FunctionType>
34 FunctionType &&function) {
35 switch (container.getContainerType()) {
36 case ContainerOption::directSum:
37 return function(dynamic_cast<autopas::DirectSum<Particle_T> &>(container));
38 case ContainerOption::linkedCells:
39 return function(dynamic_cast<autopas::LinkedCells<Particle_T> &>(container));
40 case ContainerOption::linkedCellsReferences:
41 return function(dynamic_cast<autopas::LinkedCellsReferences<Particle_T> &>(container));
42 case ContainerOption::verletLists:
43 return function(dynamic_cast<autopas::VerletLists<Particle_T> &>(container));
44 case ContainerOption::verletListsCells:
45 return function(
47 case ContainerOption::verletClusterLists:
48 return function(dynamic_cast<autopas::VerletClusterLists<Particle_T> &>(container));
49 case ContainerOption::pairwiseVerletLists:
50 return function(
52 case ContainerOption::varVerletListsAsBuild:
53 return function(
55 case ContainerOption::octree:
56 return function(dynamic_cast<autopas::Octree<Particle_T> &>(container));
57 }
58 autopas::utils::ExceptionHandler::exception("Unknown type of container in StaticContainerSelector.h. Type: {}",
59 container.getContainerType());
60}
61
62} // namespace autopas
This class stores all owned particles in a single cell.
Definition: DirectSum.h:46
LinkedCells class.
Definition: LinkedCellsReferences.h:39
LinkedCells class.
Definition: LinkedCells.h:40
The octree is a CellBasedParticleContainer that consists internally of two octrees.
Definition: Octree.h:41
The ParticleContainerInterface class provides a basic interface for all Containers within AutoPas.
Definition: ParticleContainerInterface.h:37
virtual ContainerOption getContainerType() const =0
Get the ContainerType.
Variable Verlet Lists container with different neighbor lists.
Definition: VarVerletLists.h:20
Particles are divided into clusters.
Definition: VerletClusterLists.h:56
Linked Cells with Verlet Lists container.
Definition: VerletListsCells.h:36
Verlet Lists container.
Definition: VerletLists.h:32
static void exception(const Exception e)
Handle an exception derived by std::exception.
Definition: ExceptionHandler.h:63
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32
decltype(auto) withStaticContainerType(autopas::ParticleContainerInterface< Particle_T > &container, FunctionType &&function)
Will execute the passed function body with the static container type of container.
Definition: StaticContainerSelector.h:33