AutoPas  3.0.0
Loading...
Searching...
No Matches
InteractionTypeOption.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <set>
10
12
13namespace autopas {
14inline namespace options {
18class InteractionTypeOption : public Option<InteractionTypeOption> {
19 public:
23 using Value_t = unsigned int;
24
28 enum Value : Value_t {
32 pairwise = 0b0001,
36 triwise = 0b0010,
40 all = 0b0011,
41 };
42
43 // sanity check
44 // combined values should be equivalent to InteractionTypeOption::all.
45 static_assert((pairwise | triwise) == all, "InteractionTypeOptions are defined with non matching values!");
46
51
56 constexpr InteractionTypeOption(Value option) : _value(option) {}
57
64 constexpr InteractionTypeOption(Value_t option) : _value(static_cast<InteractionTypeOption::Value>(option)) {}
65
70 constexpr operator Value() const { return _value; }
71
77 static std::set<InteractionTypeOption> getDiscouragedOptions() { return {Value::all}; }
78
83 static std::map<InteractionTypeOption, std::string> getOptionNames() {
84 return {
88 };
89 };
90
91 private:
92 Value _value{Value(-1)};
93};
94} // namespace options
95} // namespace autopas
Class representing the interaction type choices.
Definition: InteractionTypeOption.h:18
constexpr InteractionTypeOption(Value_t option)
Constructor from number value.
Definition: InteractionTypeOption.h:64
static std::set< InteractionTypeOption > getDiscouragedOptions()
Set of options that are very unlikely to be interesting.
Definition: InteractionTypeOption.h:77
unsigned int Value_t
Type used for the internal enum.
Definition: InteractionTypeOption.h:23
static std::map< InteractionTypeOption, std::string > getOptionNames()
Provides a way to iterate over the possible choices of InteractionTypeOption.
Definition: InteractionTypeOption.h:83
Value
Possible choices for the interaction type.
Definition: InteractionTypeOption.h:28
@ all
All interaction types.
Definition: InteractionTypeOption.h:40
@ triwise
Triwise interactions.
Definition: InteractionTypeOption.h:36
@ pairwise
Pairwise interactions.
Definition: InteractionTypeOption.h:32
InteractionTypeOption()=default
Constructor.
constexpr InteractionTypeOption(Value option)
Constructor from value.
Definition: InteractionTypeOption.h:56
Base class for autopas options.
Definition: Option.h:25
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32