AutoPas  3.0.0
Loading...
Searching...
No Matches
SortingDirectionOption.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <algorithm>
10#include <array>
11#include <set>
12
14
15namespace autopas {
16inline namespace options {
21class SortingDirectionOption : public Option<SortingDirectionOption> {
22 public:
27 enum Value : size_t {
31 corner = 0,
35 edge = 1,
39 face = 2
40 };
41
46
51 constexpr SortingDirectionOption(Value option) : _value(option) {}
52
57 constexpr operator Value() const { return _value; }
58
63 static std::set<SortingDirectionOption> getDiscouragedOptions() { return {}; }
64
69 static std::map<SortingDirectionOption, std::string> getOptionNames() {
70 return {
74 };
75 };
76
82 static SortingDirectionOption fromRawArray(const std::array<double, 3> &sortingDirection) {
83 return static_cast<Value>(std::ranges::count(sortingDirection, 0.0));
84 }
85
86 private:
87 Value _value{Value(-1)};
88};
89} // namespace options
90} // namespace autopas
Base class for autopas options.
Definition: Option.h:26
Class representing the classification of a normalized cell-pair sortingDirection by the number of its...
Definition: SortingDirectionOption.h:21
static std::set< SortingDirectionOption > getDiscouragedOptions()
Set of options that are very unlikely to be interesting.
Definition: SortingDirectionOption.h:63
SortingDirectionOption()=default
Constructor.
constexpr SortingDirectionOption(Value option)
Constructor from value.
Definition: SortingDirectionOption.h:51
static std::map< SortingDirectionOption, std::string > getOptionNames()
Provides a way to iterate over the possible choices of SortingDirectionOption.
Definition: SortingDirectionOption.h:69
Value
Possible choices for the direction-type classification, indexed by the number of zero components in t...
Definition: SortingDirectionOption.h:27
@ corner
All three components of sortingDirection are non-zero.
Definition: SortingDirectionOption.h:31
@ face
Exactly two components of sortingDirection are zero.
Definition: SortingDirectionOption.h:39
@ edge
Exactly one component of sortingDirection is zero.
Definition: SortingDirectionOption.h:35
static SortingDirectionOption fromRawArray(const std::array< double, 3 > &sortingDirection)
Classifies a normalized sortingDirection by its number of zero components.
Definition: SortingDirectionOption.h:82
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:34