1#ifndef TATOOINE_DETAIL_AUTONOMOUS_PARTICLE_SPLIT_BEHAVIOR_H
2#define TATOOINE_DETAIL_AUTONOMOUS_PARTICLE_SPLIT_BEHAVIOR_H
12template <
floating_po
int Real, std::
size_t NumDimensions>
16template <
floating_po
int Real>
18 static auto constexpr one = Real(1);
19 static auto constexpr half = one / Real(2);
20 static auto constexpr third = one / Real(3);
21 static auto constexpr quarter = one / Real(4);
22 static auto constexpr sixth = one / Real(6);
23 static auto constexpr three_quarters = 3 * quarter;
24 static auto constexpr two_thirds = 2 * third;
25 static auto constexpr three_sixths = 3 * sixth;
26 static auto constexpr sqrt2 = gcem::sqrt<Real>(2);
27 static auto constexpr sqrt5 = gcem::sqrt<Real>(5);
32 static auto constexpr split_cond = sqrt2;
33 static constexpr auto radii =
34 std::array{
vec_t{1 / sqrt2, 1 / sqrt2 / sqrt2},
35 vec_t{1 / sqrt2, 1 / sqrt2 / sqrt2}};
36 static constexpr auto offsets =
37 std::array{
vec_t{0, sqrt2 / 2 / sqrt2},
vec_t{0, -sqrt2 / 2 / sqrt2}};
42 static auto constexpr split_cond = Real(2);
43 static constexpr auto radii = std::array{
45 static constexpr auto offsets = std::array{
50 struct three_in_square_splits {
51 static auto constexpr split_cond = Real(3);
52 static constexpr auto radii =
54 static constexpr auto offsets =
60 static auto constexpr r1 = one + sqrt5;
61 static auto constexpr r2 = one;
62 static auto constexpr r3 = one / (one + sqrt5);
63 static auto constexpr x3 = r1 - r3;
64 static auto constexpr r4 =
65 half * sqrt5 - one / (one + sqrt5);
66 static auto constexpr x4 =
67 one + half * sqrt5 - one / (one + sqrt5);
69 static auto constexpr split_cond = r1;
70 static auto constexpr radii = std::array{
74 static auto constexpr offsets = std::array{
81 struct three_and_four_splits {
82 static auto constexpr r01 = Real(2);
83 static auto constexpr r02 = Real(1);
85 static auto constexpr x1 = Real(0);
86 static auto constexpr y1 = Real(0);
87 static auto constexpr r1 = Real(1);
89 static auto constexpr x2 = 3 * half;
90 static auto constexpr y2 = Real(0);
91 static auto constexpr r2 = half;
93 static auto constexpr x4 = Real(1.077350269);
94 static auto constexpr y4 = Real(0.5977169814);
95 static auto constexpr r4 = Real(0.2320508081);
97 static auto constexpr split_cond = r01 / r02;
99 static auto constexpr radii = std::array{
104 static auto constexpr offsets = std::array{
107 vec_t{-y4, -x4 / r01},
112 struct seven_splits {
113 static auto constexpr rr = Real(4.493959210);
114 static auto constexpr rr1 = Real(0.9009688678);
115 static auto constexpr rr2 = Real(0.6234898004);
117 static auto constexpr split_cond = rr;
119 static auto constexpr radii = std::array{
121 vec_t{(1 / rr), (1 / rr) / rr},
122 vec_t{(1 / rr), (1 / rr) / rr},
123 vec_t{rr1, rr1 / rr},
124 vec_t{rr1, rr1 / rr},
125 vec_t{rr2, rr2 / rr},
126 vec_t{rr2, rr2 / rr},
128 static auto constexpr offsets = std::array{
130 vec_t{0, (1 + 2 * rr1 + 2 * rr2 + (1 / rr)) / rr},
131 vec_t{0, (-1 - 2 * rr1 - 2 * rr2 - (1 / rr)) / rr},
132 vec_t{0, (1 + rr1) / rr},
133 vec_t{0, (-1 - rr1) / rr},
134 vec_t{0, (1 + 2 * rr1 + rr2) / rr},
135 vec_t{0, (-1 - 2 * rr1 - rr2) / rr},
157template <
floating_po
int Real>
159 static auto constexpr half = 1 / Real(2);
160 static auto constexpr quarter = 1 / Real(4);
161 static auto constexpr three_quarters = 3 * quarter;
163 struct three_splits {
164 static auto constexpr split_cond = Real(2);
165 static constexpr auto radii =
166 std::array{
vec_t{half, half, quarter},
vec_t{1, 1, half},
167 vec_t{half, half, quarter}};
168 static constexpr auto offsets =
169 std::array{
vec_t{0, 0, -three_quarters},
vec_t{0, 0, 0},
170 vec_t{0, 0, three_quarters}};
Definition: post_triangulation.h:10
Definition: split_behavior.h:13