AutoPas  3.0.0
Loading...
Searching...
No Matches
SortingThresholdInfo2B.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <cstddef>
10
14
15namespace autopas {
16
58
64 explicit SortingThresholdInfo2B(size_t uniformThreshold)
65 : noN3FaceThresholdBidirectional(uniformThreshold),
66 noN3FaceThresholdUnidirectional(uniformThreshold),
67 noN3EdgeThresholdBidirectional(uniformThreshold),
68 noN3EdgeThresholdUnidirectional(uniformThreshold),
69 noN3CornerThresholdBidirectional(uniformThreshold),
70 noN3CornerThresholdUnidirectional(uniformThreshold),
71 n3FaceThreshold(uniformThreshold),
72 n3EdgeThreshold(uniformThreshold),
73 n3CornerThreshold(uniformThreshold) {}
74
102
113 size_t getThresholdByConfig(bool newton3, std::array<double, 3> sortingDirection, bool bidirectional) const {
114 const SortingDirectionOption cellDirection = SortingDirectionOption::fromRawArray(sortingDirection);
115 if (newton3) {
116 if (cellDirection == SortingDirectionOption::corner) {
117 return n3CornerThreshold;
118 }
119 if (cellDirection == SortingDirectionOption::edge) {
120 return n3EdgeThreshold;
121 }
122 return n3FaceThreshold;
123 } else if (bidirectional) {
124 if (cellDirection == SortingDirectionOption::corner) {
126 }
127 if (cellDirection == SortingDirectionOption::edge) {
129 }
131 } else {
132 if (cellDirection == SortingDirectionOption::corner) {
134 }
135 if (cellDirection == SortingDirectionOption::edge) {
137 }
139 }
140 }
151 void setThresholdByOption(Newton3Option n3, SortingDirectionOption cellDirection, bool bidirectional, size_t value) {
152 if (n3 == Newton3Option::enabled) {
153 switch (cellDirection) {
154 case SortingDirectionOption::corner:
155 n3CornerThreshold = value;
156 break;
157 case SortingDirectionOption::edge:
158 n3EdgeThreshold = value;
159 break;
160 case SortingDirectionOption::face:
161 n3FaceThreshold = value;
162 break;
163 }
164 } else if (bidirectional) {
165 switch (cellDirection) {
166 case SortingDirectionOption::corner:
168 break;
169 case SortingDirectionOption::edge:
171 break;
172 case SortingDirectionOption::face:
174 break;
175 }
176 } else {
177 switch (cellDirection) {
178 case SortingDirectionOption::corner:
180 break;
181 case SortingDirectionOption::edge:
183 break;
184 case SortingDirectionOption::face:
186 break;
187 }
188 }
189 }
190};
191
192} // namespace autopas
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:34
Per-Newton3-state, per-SortingDirectionOption pair-sorting thresholds for a 2-body CellFunctor.
Definition: SortingThresholdInfo2B.h:21
void setThresholdByOption(Newton3Option n3, SortingDirectionOption cellDirection, bool bidirectional, size_t value)
Setter to set struct values by configuration, represented by options.
Definition: SortingThresholdInfo2B.h:151
size_t n3FaceThreshold
Threshold for config {n3: on, cellDirection: Face}.
Definition: SortingThresholdInfo2B.h:49
size_t getThresholdByConfig(bool newton3, std::array< double, 3 > sortingDirection, bool bidirectional) const
Getter to automatically get the correct threshold based on current newton3/CellDirection/bidirectiona...
Definition: SortingThresholdInfo2B.h:113
size_t noN3CornerThresholdBidirectional
Threshold for config {n3: off, cellDirection: Corner, bidirectional: true}.
Definition: SortingThresholdInfo2B.h:41
size_t n3EdgeThreshold
Threshold for config {n3: on, cellDirection: Edge}.
Definition: SortingThresholdInfo2B.h:53
size_t n3CornerThreshold
Threshold for config {n3: on, cellDirection: Corner}.
Definition: SortingThresholdInfo2B.h:57
size_t noN3FaceThresholdBidirectional
Threshold for config {n3: off, cellDirection: Face, bidirectional: true}.
Definition: SortingThresholdInfo2B.h:25
size_t noN3EdgeThresholdUnidirectional
Threshold for config {n3: off, cellDirection: Edge, bidirectional: false}.
Definition: SortingThresholdInfo2B.h:37
SortingThresholdInfo2B(size_t uniformThreshold)
Constructor setting every Newton3-state / SortingDirectionOption / bidirectional combination to the s...
Definition: SortingThresholdInfo2B.h:64
SortingThresholdInfo2B(size_t noN3FaceThresholdBidirectional, size_t noN3FaceThresholdUnidirectional, size_t noN3EdgeThresholdBidirectional, size_t noN3EdgeThresholdUnidirectional, size_t noN3CornerThresholdBidirectional, size_t noN3CornerThresholdUnidirectional, size_t n3FaceThreshold, size_t n3EdgeThreshold, size_t n3CornerThreshold)
Constructor to set each per Newton3/CellDirection/bidirectional combination value explicitly.
Definition: SortingThresholdInfo2B.h:89
size_t noN3FaceThresholdUnidirectional
Threshold for config {n3: off, cellDirection: Face, bidirectional: false}.
Definition: SortingThresholdInfo2B.h:29
size_t noN3CornerThresholdUnidirectional
Threshold for config {n3: off, cellDirection: Corner, bidirectional: false}.
Definition: SortingThresholdInfo2B.h:45
size_t noN3EdgeThresholdBidirectional
Threshold for config {n3: off, cellDirection: Edge, bidirectional: true}.
Definition: SortingThresholdInfo2B.h:33
Polymorphic base for sorting-threshold storage.
Definition: SortingThresholdInfoInterface.h:18