AutoPas  3.0.0
Loading...
Searching...
No Matches
StaticCellSelector.h
Go to the documentation of this file.
1
7#pragma once
8
12
13namespace autopas::utils {
14
35template <typename ParticleType, typename F>
36decltype(auto) withStaticCellType(autopas::CellType cellType, F &&func) {
37 switch (cellType) {
39 [[fallthrough]];
41 [[fallthrough]];
43 [[fallthrough]];
45 // todo c++20: return func.template operator()<autopas::FullParticleCell<ParticleType>>();
48 // todo c++20: return func.template operator()<autopas::ReferenceParticleCell<ParticleType>>();
50 }
52 "Trying to use a traversal of of a Celltype not specified in TravelComparison::computeInteractions. "
53 "CelltypeEnum: {}",
54 cellType);
55 return decltype(func(autopas::FullParticleCell<ParticleType>()))();
56}
57} // namespace autopas::utils
This class handles the storage of particles in their full form.
Definition: FullParticleCell.h:26
This class handles the storage of particles in their full form.
Definition: ReferenceParticleCell.h:24
static void exception(const Exception e)
Handle an exception derived by std::exception.
Definition: ExceptionHandler.h:63
In this namespace some helper classes and functions can be found used inside of AutoPas.
Definition: namespaces.h:44
decltype(auto) withStaticCellType(autopas::CellType cellType, F &&func)
Executes the passed function body with the static cell type defined by cellType.
Definition: StaticCellSelector.h:36
CellType
The ParticleCell Type as an Enum.
Definition: ParticleCell.h:19
@ ClusterTower
ClusterTower : Tower for the 2D tower structure of VerletClusterLists.
@ FullParticleCell
FullParticleCell : Default cell type for almost everything.
@ ReferenceParticleCell
ReferenceParticleCell : Cell holding only references instead of actual particle objects.
@ SortedCellView
SortedCellView : Holds pointers to particles sorted by their position projected along a vector.
@ IsNoCell
Currently unused.