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"
22
23namespace autopas {
34template <typename Particle_T, typename FunctionType>
35decltype(auto) withStaticContainerType(ParticleContainerInterface<Particle_T> &container, FunctionType &&function) {
36 switch (container.getContainerType()) {
37 case ContainerOption::directSum:
38 return function(dynamic_cast<DirectSum<Particle_T> &>(container));
39 case ContainerOption::linkedCells:
40 return function(dynamic_cast<LinkedCells<Particle_T> &>(container));
41 case ContainerOption::linkedCellsReferences:
42 return function(dynamic_cast<LinkedCellsReferences<Particle_T> &>(container));
43 case ContainerOption::verletLists:
44 return function(dynamic_cast<VerletLists<Particle_T> &>(container));
45 case ContainerOption::verletListsCells:
46 return function(dynamic_cast<VerletListsCells<Particle_T, VLCAllCellsNeighborList<Particle_T>> &>(container));
47 case ContainerOption::verletClusterLists:
48 return function(dynamic_cast<VerletClusterLists<Particle_T> &>(container));
49 case ContainerOption::pairwiseVerletLists:
50 return function(dynamic_cast<VerletListsCells<Particle_T, VLCCellPairNeighborList<Particle_T>> &>(container));
51 case ContainerOption::varVerletListsAsBuild:
52 return function(dynamic_cast<VarVerletLists<Particle_T, VerletNeighborListAsBuild<Particle_T>> &>(container));
53 case ContainerOption::octree:
54 return function(dynamic_cast<Octree<Particle_T> &>(container));
55 }
56 utils::ExceptionHandler::exception("Unknown type of container in StaticContainerSelector.h. Type: {}",
57 container.getContainerType());
58}
59
60} // 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:32
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(ParticleContainerInterface< Particle_T > &container, FunctionType &&function)
Will execute the passed function body with the static container type of container.
Definition: StaticContainerSelector.h:35