Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
sphkernels.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
18
19//%Impl status : Good
20
23#include "shambackends/math.hpp"
25#include <array>
26
27namespace shammath::details {
28
29 template<class Tscal>
31 public:
32 inline static constexpr Tscal Rkern = 2;
34 inline static constexpr Tscal hfactd = 1.2;
35
37 inline static constexpr Tscal norm_1d = 2. / 3.;
39 inline static constexpr Tscal norm_2d = 10. / (7. * shambase::constants::pi<Tscal>);
41 inline static constexpr Tscal norm_3d = 1 / shambase::constants::pi<Tscal>;
42
43 inline static Tscal f(Tscal q) {
44
45 Tscal t1 = 2 - q;
46 Tscal t2 = 1 - q;
47
48 t1 = t1 * t1 * t1;
49 t2 = t2 * t2 * t2;
50
51 constexpr Tscal div1_4 = (1. / 4.);
52 t1 *= div1_4;
53 t2 *= -1;
54
55 if (q < 1) {
56 return t1 + t2;
57 } else if (q < 2) {
58 return t1;
59 } else
60 return 0;
61 }
62
63 inline static Tscal df(Tscal q) {
64
65 constexpr Tscal div9_4 = (9. / 4.);
66 constexpr Tscal div3_4 = (3. / 4.);
67
68 if (q < 1) {
69 return -3 * q + div9_4 * q * q;
70 } else if (q < 2) {
71 return -3 + 3 * q - div3_4 * q * q;
72 } else
73 return 0;
74 }
75
76 inline static Tscal ddf(Tscal q) {
77 if (q < 1) {
78 return (9.0 / 2.0) * q - 3;
79 } else if (q < 2) {
80 return 3 - (3.0 / 2.0) * q;
81 } else
82 return 0;
83 }
84
85 inline static Tscal phi_tilde_3d(Tscal q) {
86 Tscal t1 = sham::pow_constexpr<2>(q);
87 Tscal t2 = sham::pow_constexpr<3>(q);
88 Tscal t3 = sham::pow_constexpr<4>(q);
89 Tscal t4 = sham::pow_constexpr<5>(q);
90 Tscal t5 = sham::pow_constexpr<6>(q);
91 if (q < 1) {
92 return (1.0 / 30.0) * shambase::constants::pi<Tscal>
93 * (t1 * (3 * t2 - 9 * t1 + 20) - 42);
94 } else if (q < 2) {
95 return (1.0 / 30.0) * shambase::constants::pi<Tscal>
96 * (-t5 + 9 * t4 - 30 * t3 + 40 * t2 - 48 * q + 2) / q;
97 } else
98 return -shambase::constants::pi<Tscal> / q;
99 }
100
101 inline static Tscal phi_tilde_3d_prime(Tscal q) {
102 Tscal t1 = sham::pow_constexpr<2>(q);
103 Tscal t2 = sham::pow_constexpr<3>(q);
104 Tscal t3 = sham::pow_constexpr<4>(q);
105 Tscal t4 = sham::pow_constexpr<5>(q);
106 Tscal t5 = sham::pow_constexpr<6>(q);
107 if (q < 1) {
108 return (1.0 / 30.0) * shambase::constants::pi<Tscal>
109 * (t1 * (9 * t1 - 18 * q) + 2 * q * (3 * t2 - 9 * t1 + 20));
110 } else if (q < 2) {
111 return (1.0 / 30.0) * shambase::constants::pi<Tscal>
112 * (-6 * t4 + 45 * t3 - 120 * t2 + 120 * t1 - 48) / q
113 - (1.0 / 30.0) * shambase::constants::pi<Tscal>
114 * (-t5 + 9 * t4 - 30 * t3 + 40 * t2 - 48 * q + 2) / t1;
115 } else
116 return shambase::constants::pi<Tscal> / t1;
117 }
118 };
119
120 template<class Tscal>
122 public:
123 inline static constexpr Tscal Rkern = 5. / 2.;
125 inline static constexpr Tscal hfactd = 1.2;
126
128 inline static constexpr Tscal norm_1d = 1. / 24.;
130 inline static constexpr Tscal norm_2d = 96. / (1199 * shambase::constants::pi<Tscal>);
132 inline static constexpr Tscal norm_3d = 1 / (20 * shambase::constants::pi<Tscal>);
133
134 inline static Tscal f(Tscal q) {
135
136 constexpr Tscal div5_2 = (5. / 2.);
137 constexpr Tscal div3_2 = (3. / 2.);
138 constexpr Tscal div1_2 = (1. / 2.);
139
140 Tscal t1 = div5_2 - q;
141 Tscal t2 = div3_2 - q;
142 Tscal t3 = div1_2 - q;
143
144 Tscal t1_2 = t1 * t1;
145 Tscal t2_2 = t2 * t2;
146 Tscal t3_2 = t3 * t3;
147
148 t1 = t1_2 * t1_2;
149 t2 = t2_2 * t2_2;
150 t3 = t3_2 * t3_2;
151
152 t1 *= 1;
153 t2 *= -5;
154 t3 *= 10;
155
156 if (q < div1_2) {
157 return t1 + t2 + t3;
158 } else if (q < div3_2) {
159 return t1 + t2;
160 } else if (q < div5_2) {
161 return t1;
162 } else
163 return 0;
164 }
165
166 inline static Tscal df(Tscal q) {
167
168 constexpr Tscal div5_2 = (5. / 2.);
169 constexpr Tscal div3_2 = (3. / 2.);
170 constexpr Tscal div1_2 = (1. / 2.);
171
172 Tscal t1 = div5_2 - q;
173 Tscal t2 = div3_2 - q;
174 Tscal t3 = div1_2 - q;
175
176 Tscal t1_2 = t1 * t1;
177 Tscal t2_2 = t2 * t2;
178 Tscal t3_2 = t3 * t3;
179
180 t1 = t1 * t1_2;
181 t2 = t2 * t2_2;
182 t3 = t3 * t3_2;
183
184 t1 *= (1) * (-4);
185 t2 *= (-5) * (-4);
186 t3 *= (10) * (-4);
187
188 if (q < div1_2) {
189 return t1 + t2 + t3;
190 } else if (q < div3_2) {
191 return t1 + t2;
192 } else if (q < div5_2) {
193 return t1;
194 } else
195 return 0;
196 }
197
198 inline static Tscal ddf(Tscal q) {
199 Tscal t1 = sham::pow_constexpr<2>(1.0 / 2.0 - q);
200 Tscal t2 = sham::pow_constexpr<2>(3.0 / 2.0 - q);
201 Tscal t3 = sham::pow_constexpr<2>(5.0 / 2.0 - q);
202 if (q < 1.0 / 2.0) {
203 return 120 * t1 - 60 * t2 + 12 * t3;
204 } else if (q < 3.0 / 2.0) {
205 return -60 * t2 + 12 * t3;
206 } else if (q < 5.0 / 2.0) {
207 return 12 * t3;
208 } else
209 return 0;
210 }
211
212 inline static Tscal phi_tilde_3d(Tscal q) {
213 Tscal t1 = sham::pow_constexpr<2>(q);
214 Tscal t2 = sham::pow_constexpr<3>(q);
215 Tscal t3 = sham::pow_constexpr<4>(q);
216 Tscal t4 = sham::pow_constexpr<5>(q);
217 Tscal t5 = sham::pow_constexpr<6>(q);
218 Tscal t6 = sham::pow_constexpr<7>(q);
219 if (q < 1.0 / 2.0) {
220 return (1.0 / 336.0) * shambase::constants::pi<Tscal>
221 * (192 * t5 - 1008 * t3 + 3220 * t1 - 8393);
222 } else if (q < 3.0 / 2.0) {
223 return (1.0 / 336.0) * shambase::constants::pi<Tscal>
224 * (-128 * t6 + 896 * t5 - 2016 * t4 + 560 * t3 + 3080 * t2 - 8386 * q - 1)
225 / q;
226 } else if (q < 5.0 / 2.0) {
227 return (1.0 / 672.0) * shambase::constants::pi<Tscal>
228 * (64 * t6 - 896 * t5 + 5040 * t4 - 14000 * t3 + 17500 * t2 - 21875 * q
229 + 2185)
230 / q;
231 } else
232 return -20 * shambase::constants::pi<Tscal> / q;
233 }
234
235 inline static Tscal phi_tilde_3d_prime(Tscal q) {
236 Tscal t1 = sham::pow_constexpr<2>(q);
237 Tscal t2 = sham::pow_constexpr<3>(q);
238 Tscal t3 = sham::pow_constexpr<4>(q);
239 Tscal t4 = sham::pow_constexpr<5>(q);
240 Tscal t5 = sham::pow_constexpr<6>(q);
241 Tscal t6 = sham::pow_constexpr<7>(q);
242 if (q < 1.0 / 2.0) {
243 return (1.0 / 336.0) * shambase::constants::pi<Tscal>
244 * (1152 * t4 - 4032 * t2 + 6440 * q);
245 } else if (q < 3.0 / 2.0) {
246 return (1.0 / 336.0) * shambase::constants::pi<Tscal>
247 * (-896 * t5 + 5376 * t4 - 10080 * t3 + 2240 * t2 + 9240 * t1 - 8386) / q
248 - (1.0 / 336.0) * shambase::constants::pi<Tscal>
249 * (-128 * t6 + 896 * t5 - 2016 * t4 + 560 * t3 + 3080 * t2 - 8386 * q
250 - 1)
251 / t1;
252 } else if (q < 5.0 / 2.0) {
253 return (1.0 / 672.0) * shambase::constants::pi<Tscal>
254 * (448 * t5 - 5376 * t4 + 25200 * t3 - 56000 * t2 + 52500 * t1 - 21875)
255 / q
256 - (1.0 / 672.0) * shambase::constants::pi<Tscal>
257 * (64 * t6 - 896 * t5 + 5040 * t4 - 14000 * t3 + 17500 * t2 - 21875 * q
258 + 2185)
259 / t1;
260 } else
261 return 20 * shambase::constants::pi<Tscal> / t1;
262 }
263 };
264
265 template<class Tscal>
267 public:
268 inline static constexpr Tscal Rkern = 3;
270 inline static constexpr Tscal hfactd = 1.0;
271
273 inline static constexpr Tscal norm_1d = 1. / 120.;
275 inline static constexpr Tscal norm_2d = 7. / (478 * shambase::constants::pi<Tscal>);
277 inline static constexpr Tscal norm_3d = 1 / (120 * shambase::constants::pi<Tscal>);
278
279 inline static Tscal f(Tscal q) {
280
281 Tscal t1 = 3 - q;
282 Tscal t2 = 2 - q;
283 Tscal t3 = 1 - q;
284
285 Tscal t1_2 = t1 * t1;
286 Tscal t2_2 = t2 * t2;
287 Tscal t3_2 = t3 * t3;
288
289 t1 = t1 * t1_2 * t1_2;
290 t2 = t2 * t2_2 * t2_2;
291 t3 = t3 * t3_2 * t3_2;
292
293 t1 *= 1;
294 t2 *= -6;
295 t3 *= 15;
296
297 if (q < 1.) {
298 return t1 + t2 + t3;
299 } else if (q < 2.) {
300 return t1 + t2;
301 } else if (q < 3.) {
302 return t1;
303 } else
304 return 0;
305 }
306
307 inline static Tscal df(Tscal q) {
308
309 Tscal t1 = 3 - q;
310 Tscal t2 = 2 - q;
311 Tscal t3 = 1 - q;
312
313 Tscal t1_2 = t1 * t1;
314 Tscal t2_2 = t2 * t2;
315 Tscal t3_2 = t3 * t3;
316
317 t1 = t1_2 * t1_2;
318 t2 = t2_2 * t2_2;
319 t3 = t3_2 * t3_2;
320
321 t1 *= (1) * (-5);
322 t2 *= (-6) * (-5);
323 t3 *= (15) * (-5);
324
325 if (q < 1.) {
326 return t1 + t2 + t3;
327 } else if (q < 2.) {
328 return t1 + t2;
329 } else if (q < 3.) {
330 return t1;
331 } else
332 return 0;
333 }
334
335 inline static Tscal ddf(Tscal q) {
336 Tscal t1 = sham::pow_constexpr<3>(1 - q);
337 Tscal t2 = sham::pow_constexpr<3>(2 - q);
338 Tscal t3 = sham::pow_constexpr<3>(3 - q);
339 if (q < 1) {
340 return 300 * t1 - 120 * t2 + 20 * t3;
341 } else if (q < 2) {
342 return -120 * t2 + 20 * t3;
343 } else if (q < 3) {
344 return 20 * t3;
345 } else
346 return 0;
347 }
348
349 inline static Tscal phi_tilde_3d(Tscal q) {
350 Tscal t1 = sham::pow_constexpr<2>(q);
351 Tscal t2 = sham::pow_constexpr<3>(q);
352 Tscal t3 = sham::pow_constexpr<4>(q);
353 Tscal t4 = sham::pow_constexpr<5>(q);
354 Tscal t5 = sham::pow_constexpr<6>(q);
355 Tscal t6 = sham::pow_constexpr<7>(q);
356 Tscal t7 = sham::pow_constexpr<8>(q);
357 if (q < 1) {
358 return (1.0 / 7.0) * shambase::constants::pi<Tscal>
359 * (-5 * t6 + 20 * t5 - 84 * t3 + 308 * t1 - 956);
360 } else if (q < 2) {
361 return (1.0 / 14.0) * shambase::constants::pi<Tscal>
362 * (5 * t7 - 60 * t6 + 280 * t5 - 588 * t4 + 350 * t3 + 476 * t2 - 1892 * q
363 - 5)
364 / q;
365 } else if (q < 3) {
366 return (1.0 / 14.0) * shambase::constants::pi<Tscal>
367 * (-t7 + 20 * t6 - 168 * t5 + 756 * t4 - 1890 * t3 + 2268 * t2 - 2916 * q
368 + 507)
369 / q;
370 } else
371 return -120 * shambase::constants::pi<Tscal> / q;
372 }
373
374 inline static Tscal phi_tilde_3d_prime(Tscal q) {
375 Tscal t1 = sham::pow_constexpr<2>(q);
376 Tscal t2 = sham::pow_constexpr<3>(q);
377 Tscal t3 = sham::pow_constexpr<4>(q);
378 Tscal t4 = sham::pow_constexpr<5>(q);
379 Tscal t5 = sham::pow_constexpr<6>(q);
380 Tscal t6 = sham::pow_constexpr<7>(q);
381 Tscal t7 = sham::pow_constexpr<8>(q);
382 if (q < 1) {
383 return (1.0 / 7.0) * shambase::constants::pi<Tscal>
384 * (-35 * t5 + 120 * t4 - 336 * t2 + 616 * q);
385 } else if (q < 2) {
386 return (1.0 / 14.0) * shambase::constants::pi<Tscal>
387 * (40 * t6 - 420 * t5 + 1680 * t4 - 2940 * t3 + 1400 * t2 + 1428 * t1
388 - 1892)
389 / q
390 - (1.0 / 14.0) * shambase::constants::pi<Tscal>
391 * (5 * t7 - 60 * t6 + 280 * t5 - 588 * t4 + 350 * t3 + 476 * t2
392 - 1892 * q - 5)
393 / t1;
394 } else if (q < 3) {
395 return (1.0 / 14.0) * shambase::constants::pi<Tscal>
396 * (-8 * t6 + 140 * t5 - 1008 * t4 + 3780 * t3 - 7560 * t2 + 6804 * t1
397 - 2916)
398 / q
399 - (1.0 / 14.0) * shambase::constants::pi<Tscal>
400 * (-t7 + 20 * t6 - 168 * t5 + 756 * t4 - 1890 * t3 + 2268 * t2
401 - 2916 * q + 507)
402 / t1;
403 } else
404 return 120 * shambase::constants::pi<Tscal> / t1;
405 }
406 };
407
408 template<class Tscal>
410 public:
411 inline static constexpr Tscal Rkern = 3.5;
413 inline static constexpr Tscal hfactd = 1.0;
414
416 inline static constexpr Tscal norm_1d = 1. / 720;
418 inline static constexpr Tscal norm_2d = 256. / (113149 * shambase::constants::pi<Tscal>);
420 inline static constexpr Tscal norm_3d = 6. / (5040. * shambase::constants::pi<Tscal>);
421
422 inline static Tscal f(Tscal q) {
423
424 constexpr Tscal div7_2 = (7. / 2.);
425 constexpr Tscal div5_2 = (5. / 2.);
426 constexpr Tscal div3_2 = (3. / 2.);
427 constexpr Tscal div1_2 = (1. / 2.);
428
429 Tscal t1 = div7_2 - q;
430 Tscal t2 = div5_2 - q;
431 Tscal t3 = div3_2 - q;
432 Tscal t4 = div1_2 - q;
433
434 // up to order 6
435 t1 = sham::pow_constexpr<6>(t1);
436 t2 = sham::pow_constexpr<6>(t2);
437 t3 = sham::pow_constexpr<6>(t3);
438 t4 = sham::pow_constexpr<6>(t4);
439
440 t1 *= 1.;
441 t2 *= -7.;
442 t3 *= 21.;
443 t4 *= -35.;
444
445 if (q < div1_2) {
446 return t1 + t2 + t3 + t4;
447 } else if (q < div3_2) {
448 return t1 + t2 + t3;
449 } else if (q < div5_2) {
450 return t1 + t2;
451 } else if (q < div7_2) {
452 return t1;
453 } else
454 return 0;
455 }
456
457 inline static Tscal df(Tscal q) {
458
459 constexpr Tscal div7_2 = (7. / 2.);
460 constexpr Tscal div5_2 = (5. / 2.);
461 constexpr Tscal div3_2 = (3. / 2.);
462 constexpr Tscal div1_2 = (1. / 2.);
463
464 Tscal t1 = div7_2 - q;
465 Tscal t2 = div5_2 - q;
466 Tscal t3 = div3_2 - q;
467 Tscal t4 = div1_2 - q;
468
469 // up to order 6
470 t1 = sham::pow_constexpr<5>(t1);
471 t2 = sham::pow_constexpr<5>(t2);
472 t3 = sham::pow_constexpr<5>(t3);
473 t4 = sham::pow_constexpr<5>(t4);
474
475 t1 *= (-6.) * (1.);
476 t2 *= (-6.) * (-7.);
477 t3 *= (-6.) * (21.);
478 t4 *= (-6.) * (-35.);
479
480 if (q < div1_2) {
481 return t1 + t2 + t3 + t4;
482 } else if (q < div3_2) {
483 return t1 + t2 + t3;
484 } else if (q < div5_2) {
485 return t1 + t2;
486 } else if (q < div7_2) {
487 return t1;
488 } else
489 return 0;
490 }
491
492 inline static Tscal ddf(Tscal q) {
493 Tscal t1 = sham::pow_constexpr<4>(1.0 / 2.0 - q);
494 Tscal t2 = sham::pow_constexpr<4>(3.0 / 2.0 - q);
495 Tscal t3 = sham::pow_constexpr<4>(5.0 / 2.0 - q);
496 Tscal t4 = sham::pow_constexpr<4>(7.0 / 2.0 - q);
497 if (q < 1.0 / 2.0) {
498 return -1050 * t1 + 630 * t2 - 210 * t3 + 30 * t4;
499 } else if (q < 3.0 / 2.0) {
500 return 630 * t2 - 210 * t3 + 30 * t4;
501 } else if (q < 5.0 / 2.0) {
502 return -210 * t3 + 30 * t4;
503 } else if (q < 7.0 / 2.0) {
504 return 30 * t4;
505 } else
506 return 0;
507 }
508
509 inline static Tscal phi_tilde_3d(Tscal q) {
510 Tscal t1 = sham::pow_constexpr<2>(q);
511 Tscal t2 = sham::pow_constexpr<3>(q);
512 Tscal t3 = sham::pow_constexpr<4>(q);
513 Tscal t4 = sham::pow_constexpr<5>(q);
514 Tscal t5 = sham::pow_constexpr<6>(q);
515 Tscal t6 = sham::pow_constexpr<7>(q);
516 Tscal t7 = sham::pow_constexpr<8>(q);
517 Tscal t8 = sham::pow_constexpr<9>(q);
518 if (q < 1.0 / 2.0) {
519 return (1.0 / 1152.0) * shambase::constants::pi<Tscal>
520 * (-1280 * t7 + 11520 * t5 - 66528 * t3 + 282576 * t1 - 1018341);
521 } else if (q < 3.0 / 2.0) {
522 return (1.0 / 4608.0) * shambase::constants::pi<Tscal>
523 * (3840 * t8 - 34560 * t7 + 103680 * t6 - 53760 * t5 - 235872 * t4
524 - 10080 * t3 + 1131984 * t2 - 4073409 * q + 5)
525 / q;
526 } else if (q < 5.0 / 2.0) {
527 return (1.0 / 2304.0) * shambase::constants::pi<Tscal>
528 * (-768 * t8 + 13824 * t7 - 103680 * t6 + 408576 * t5 - 852768 * t4
529 + 729792 * t3 + 198576 * t2 - 1948131 * q - 29522)
530 / q;
531 } else if (q < 7.0 / 2.0) {
532 return (1.0 / 4608.0) * shambase::constants::pi<Tscal>
533 * (256 * t8 - 6912 * t7 + 80640 * t6 - 526848 * t5 + 2074464 * t4
534 - 4840416 * t3 + 5647152 * t2 - 7411887 * q + 1894081)
535 / q;
536 } else
537 return -840 * shambase::constants::pi<Tscal> / q;
538 }
539
540 inline static Tscal phi_tilde_3d_prime(Tscal q) {
541 Tscal t1 = sham::pow_constexpr<2>(q);
542 Tscal t2 = sham::pow_constexpr<3>(q);
543 Tscal t3 = sham::pow_constexpr<4>(q);
544 Tscal t4 = sham::pow_constexpr<5>(q);
545 Tscal t5 = sham::pow_constexpr<6>(q);
546 Tscal t6 = sham::pow_constexpr<7>(q);
547 Tscal t7 = sham::pow_constexpr<8>(q);
548 Tscal t8 = sham::pow_constexpr<9>(q);
549 if (q < 1.0 / 2.0) {
550 return (1.0 / 1152.0) * shambase::constants::pi<Tscal>
551 * (-10240 * t6 + 69120 * t4 - 266112 * t2 + 565152 * q);
552 } else if (q < 3.0 / 2.0) {
553 return (1.0 / 4608.0) * shambase::constants::pi<Tscal>
554 * (34560 * t7 - 276480 * t6 + 725760 * t5 - 322560 * t4 - 1179360 * t3
555 - 40320 * t2 + 3395952 * t1 - 4073409)
556 / q
557 - (1.0 / 4608.0) * shambase::constants::pi<Tscal>
558 * (3840 * t8 - 34560 * t7 + 103680 * t6 - 53760 * t5 - 235872 * t4
559 - 10080 * t3 + 1131984 * t2 - 4073409 * q + 5)
560 / t1;
561 } else if (q < 5.0 / 2.0) {
562 return (1.0 / 2304.0) * shambase::constants::pi<Tscal>
563 * (-6912 * t7 + 110592 * t6 - 725760 * t5 + 2451456 * t4 - 4263840 * t3
564 + 2919168 * t2 + 595728 * t1 - 1948131)
565 / q
566 - (1.0 / 2304.0) * shambase::constants::pi<Tscal>
567 * (-768 * t8 + 13824 * t7 - 103680 * t6 + 408576 * t5 - 852768 * t4
568 + 729792 * t3 + 198576 * t2 - 1948131 * q - 29522)
569 / t1;
570 } else if (q < 7.0 / 2.0) {
571 return (1.0 / 4608.0) * shambase::constants::pi<Tscal>
572 * (2304 * t7 - 55296 * t6 + 564480 * t5 - 3161088 * t4 + 10372320 * t3
573 - 19361664 * t2 + 16941456 * t1 - 7411887)
574 / q
575 - (1.0 / 4608.0) * shambase::constants::pi<Tscal>
576 * (256 * t8 - 6912 * t7 + 80640 * t6 - 526848 * t5 + 2074464 * t4
577 - 4840416 * t3 + 5647152 * t2 - 7411887 * q + 1894081)
578 / t1;
579 } else
580 return 840 * shambase::constants::pi<Tscal> / t1;
581 }
582 };
583
584 template<class Tscal>
586 public:
587 inline static constexpr Tscal Rkern = 4.0;
589 inline static constexpr Tscal hfactd = 1.0;
590
592 inline static constexpr Tscal norm_1d = 1.0 / 5040.0;
594 inline static constexpr Tscal norm_2d = (9.0 / 29740.0) / shambase::constants::pi<Tscal>;
596 inline static constexpr Tscal norm_3d = (1.0 / 6720.0) / shambase::constants::pi<Tscal>;
597
598 inline static Tscal f(Tscal q) {
599
600 Tscal t1 = 4 - q;
601 Tscal t2 = 3 - q;
602 Tscal t3 = 2 - q;
603 Tscal t4 = 1 - q;
604
605 t1 = sham::pow_constexpr<7>(t1);
606 t2 = sham::pow_constexpr<7>(t2);
607 t3 = sham::pow_constexpr<7>(t3);
608 t4 = sham::pow_constexpr<7>(t4);
609
610 t1 *= 1.;
611 t2 *= -8.;
612 t3 *= 28.;
613 t4 *= -56.;
614
615 if (q < 1) {
616 return t1 + t2 + t3 + t4;
617 } else if (q < 2) {
618 return t1 + t2 + t3;
619 } else if (q < 3) {
620 return t1 + t2;
621 } else if (q < 4) {
622 return t1;
623 } else
624 return 0;
625 }
626
627 inline static Tscal df(Tscal q) {
628
629 Tscal t1 = 4 - q;
630 Tscal t2 = 3 - q;
631 Tscal t3 = 2 - q;
632 Tscal t4 = 1 - q;
633
634 t1 = sham::pow_constexpr<6>(t1);
635 t2 = sham::pow_constexpr<6>(t2);
636 t3 = sham::pow_constexpr<6>(t3);
637 t4 = sham::pow_constexpr<6>(t4);
638
639 t1 *= (-7.) * (1.);
640 t2 *= (-7.) * (-8.);
641 t3 *= (-7.) * (28.);
642 t4 *= (-7.) * (-56.);
643
644 if (q < 1) {
645 return t1 + t2 + t3 + t4;
646 } else if (q < 2) {
647 return t1 + t2 + t3;
648 } else if (q < 3) {
649 return t1 + t2;
650 } else if (q < 4) {
651 return t1;
652 } else
653 return 0;
654 }
655
656 inline static Tscal ddf(Tscal q) {
657 Tscal t1 = sham::pow_constexpr<5>(1 - q);
658 Tscal t2 = sham::pow_constexpr<5>(2 - q);
659 Tscal t3 = sham::pow_constexpr<5>(3 - q);
660 Tscal t4 = sham::pow_constexpr<5>(4 - q);
661 if (q < 1) {
662 return -2352 * t1 + 1176 * t2 - 336 * t3 + 42 * t4;
663 } else if (q < 2) {
664 return 1176 * t2 - 336 * t3 + 42 * t4;
665 } else if (q < 3) {
666 return -336 * t3 + 42 * t4;
667 } else if (q < 4) {
668 return 42 * t4;
669 } else
670 return 0;
671 }
672
673 inline static Tscal phi_tilde_3d(Tscal q) {
674 Tscal t1 = sham::pow_constexpr<10>(q);
675 Tscal t2 = sham::pow_constexpr<2>(q);
676 Tscal t3 = sham::pow_constexpr<3>(q);
677 Tscal t4 = sham::pow_constexpr<4>(q);
678 Tscal t5 = sham::pow_constexpr<5>(q);
679 Tscal t6 = sham::pow_constexpr<6>(q);
680 Tscal t7 = sham::pow_constexpr<7>(q);
681 Tscal t8 = sham::pow_constexpr<8>(q);
682 Tscal t9 = sham::pow_constexpr<9>(q);
683 if (q < 1) {
684 return (2.0 / 9.0) * shambase::constants::pi<Tscal>
685 * (t2 * (7 * t7 - 35 * t6 + 240 * t4 - 1512 * t2 + 7248) - 29740);
686 } else if (q < 2) {
687 return (2.0 / 45.0) * shambase::constants::pi<Tscal>
688 * (-21 * t1 + 315 * t9 - 1890 * t8 + 5400 * t7 - 5880 * t6 - 2268 * t5
689 - 2940 * t4 + 37080 * t3 - 148770 * q + 14)
690 / q;
691 } else if (q < 3) {
692 return (2.0 / 45.0) * shambase::constants::pi<Tscal>
693 * (7 * t1 - 175 * t9 + 1890 * t8 - 11400 * t7 + 41160 * t6 - 86940 * t5
694 + 91140 * t4 - 16680 * t3 - 130850 * q - 7154)
695 / q;
696 } else if (q < 4) {
697 return (2.0 / 45.0) * shambase::constants::pi<Tscal>
698 * (-t1 + 35 * t9 - 540 * t8 + 4800 * t7 - 26880 * t6 + 96768 * t5
699 - 215040 * t4 + 245760 * t3 - 327680 * q + 110944)
700 / q;
701 } else
702 return -6720 * shambase::constants::pi<Tscal> / q;
703 }
704
705 inline static Tscal phi_tilde_3d_prime(Tscal q) {
706 Tscal t1 = sham::pow_constexpr<10>(q);
707 Tscal t2 = sham::pow_constexpr<2>(q);
708 Tscal t3 = sham::pow_constexpr<3>(q);
709 Tscal t4 = sham::pow_constexpr<4>(q);
710 Tscal t5 = sham::pow_constexpr<5>(q);
711 Tscal t6 = sham::pow_constexpr<6>(q);
712 Tscal t7 = sham::pow_constexpr<7>(q);
713 Tscal t8 = sham::pow_constexpr<8>(q);
714 Tscal t9 = sham::pow_constexpr<9>(q);
715 if (q < 1) {
716 return (2.0 / 9.0) * shambase::constants::pi<Tscal>
717 * (t2 * (49 * t6 - 210 * t5 + 960 * t3 - 3024 * q)
718 + 2 * q * (7 * t7 - 35 * t6 + 240 * t4 - 1512 * t2 + 7248));
719 } else if (q < 2) {
720 return (2.0 / 45.0) * shambase::constants::pi<Tscal>
721 * (-210 * t9 + 2835 * t8 - 15120 * t7 + 37800 * t6 - 35280 * t5
722 - 11340 * t4 - 11760 * t3 + 111240 * t2 - 148770)
723 / q
724 - (2.0 / 45.0) * shambase::constants::pi<Tscal>
725 * (-21 * t1 + 315 * t9 - 1890 * t8 + 5400 * t7 - 5880 * t6 - 2268 * t5
726 - 2940 * t4 + 37080 * t3 - 148770 * q + 14)
727 / t2;
728 } else if (q < 3) {
729 return (2.0 / 45.0) * shambase::constants::pi<Tscal>
730 * (70 * t9 - 1575 * t8 + 15120 * t7 - 79800 * t6 + 246960 * t5
731 - 434700 * t4 + 364560 * t3 - 50040 * t2 - 130850)
732 / q
733 - (2.0 / 45.0) * shambase::constants::pi<Tscal>
734 * (7 * t1 - 175 * t9 + 1890 * t8 - 11400 * t7 + 41160 * t6 - 86940 * t5
735 + 91140 * t4 - 16680 * t3 - 130850 * q - 7154)
736 / t2;
737 } else if (q < 4) {
738 return (2.0 / 45.0) * shambase::constants::pi<Tscal>
739 * (-10 * t9 + 315 * t8 - 4320 * t7 + 33600 * t6 - 161280 * t5
740 + 483840 * t4 - 860160 * t3 + 737280 * t2 - 327680)
741 / q
742 - (2.0 / 45.0) * shambase::constants::pi<Tscal>
743 * (-t1 + 35 * t9 - 540 * t8 + 4800 * t7 - 26880 * t6 + 96768 * t5
744 - 215040 * t4 + 245760 * t3 - 327680 * q + 110944)
745 / t2;
746 } else
747 return 6720 * shambase::constants::pi<Tscal> / t2;
748 }
749 };
750
751 template<class Tscal>
753 public:
754 inline static constexpr Tscal Rkern = 4.5;
756 inline static constexpr Tscal hfactd = 1.0;
757
759 inline static constexpr Tscal norm_1d = 1. / 40320;
761 inline static constexpr Tscal norm_2d = 512. / (14345663 * shambase::constants::pi<Tscal>);
763 inline static constexpr Tscal norm_3d = 6. / (362880. * shambase::constants::pi<Tscal>);
764
765 inline static Tscal f(Tscal q) {
766
767 constexpr Tscal div9_2 = (9. / 2.);
768 constexpr Tscal div7_2 = (7. / 2.);
769 constexpr Tscal div5_2 = (5. / 2.);
770 constexpr Tscal div3_2 = (3. / 2.);
771 constexpr Tscal div1_2 = (1. / 2.);
772
773 Tscal t1 = div9_2 - q;
774 Tscal t2 = div7_2 - q;
775 Tscal t3 = div5_2 - q;
776 Tscal t4 = div3_2 - q;
777 Tscal t5 = div1_2 - q;
778
779 t1 = sham::pow_constexpr<8>(t1);
780 t2 = sham::pow_constexpr<8>(t2);
781 t3 = sham::pow_constexpr<8>(t3);
782 t4 = sham::pow_constexpr<8>(t4);
783 t5 = sham::pow_constexpr<8>(t5);
784
785 t1 *= 1.;
786 t2 *= -9.;
787 t3 *= 36.;
788 t4 *= -84.;
789 t5 *= 126.;
790
791 if (q < div1_2) {
792 return t1 + t2 + t3 + t4 + t5;
793 } else if (q < div3_2) {
794 return t1 + t2 + t3 + t4;
795 } else if (q < div5_2) {
796 return t1 + t2 + t3;
797 } else if (q < div7_2) {
798 return t1 + t2;
799 } else if (q < div9_2) {
800 return t1;
801 } else
802 return 0;
803 }
804
805 inline static Tscal df(Tscal q) {
806
807 constexpr Tscal div9_2 = (9. / 2.);
808 constexpr Tscal div7_2 = (7. / 2.);
809 constexpr Tscal div5_2 = (5. / 2.);
810 constexpr Tscal div3_2 = (3. / 2.);
811 constexpr Tscal div1_2 = (1. / 2.);
812
813 Tscal t1 = div9_2 - q;
814 Tscal t2 = div7_2 - q;
815 Tscal t3 = div5_2 - q;
816 Tscal t4 = div3_2 - q;
817 Tscal t5 = div1_2 - q;
818
819 t1 = sham::pow_constexpr<7>(t1);
820 t2 = sham::pow_constexpr<7>(t2);
821 t3 = sham::pow_constexpr<7>(t3);
822 t4 = sham::pow_constexpr<7>(t4);
823 t5 = sham::pow_constexpr<7>(t5);
824
825 t1 *= (-8.) * (1.);
826 t2 *= (-8.) * (-9.);
827 t3 *= (-8.) * (36.);
828 t4 *= (-8.) * (-84.);
829 t5 *= (-8.) * (126.);
830
831 if (q < div1_2) {
832 return t1 + t2 + t3 + t4 + t5;
833 } else if (q < div3_2) {
834 return t1 + t2 + t3 + t4;
835 } else if (q < div5_2) {
836 return t1 + t2 + t3;
837 } else if (q < div7_2) {
838 return t1 + t2;
839 } else if (q < div9_2) {
840 return t1;
841 } else
842 return 0;
843 }
844
845 inline static Tscal ddf(Tscal q) {
846 Tscal t1 = sham::pow_constexpr<6>(1.0 / 2.0 - q);
847 Tscal t2 = sham::pow_constexpr<6>(3.0 / 2.0 - q);
848 Tscal t3 = sham::pow_constexpr<6>(5.0 / 2.0 - q);
849 Tscal t4 = sham::pow_constexpr<6>(7.0 / 2.0 - q);
850 Tscal t5 = sham::pow_constexpr<6>(9.0 / 2.0 - q);
851 if (q < 1.0 / 2.0) {
852 return 7056 * t1 - 4704 * t2 + 2016 * t3 - 504 * t4 + 56 * t5;
853 } else if (q < 3.0 / 2.0) {
854 return -4704 * t2 + 2016 * t3 - 504 * t4 + 56 * t5;
855 } else if (q < 5.0 / 2.0) {
856 return 2016 * t3 - 504 * t4 + 56 * t5;
857 } else if (q < 7.0 / 2.0) {
858 return -504 * t4 + 56 * t5;
859 } else if (q < 9.0 / 2.0) {
860 return 56 * t5;
861 } else
862 return 0;
863 }
864
865 inline static Tscal phi_tilde_3d(Tscal q) {
866 Tscal t1 = sham::pow_constexpr<10>(q);
867 Tscal t2 = sham::pow_constexpr<11>(q);
868 Tscal t3 = sham::pow_constexpr<2>(q);
869 Tscal t4 = sham::pow_constexpr<3>(q);
870 Tscal t5 = sham::pow_constexpr<4>(q);
871 Tscal t6 = sham::pow_constexpr<5>(q);
872 Tscal t7 = sham::pow_constexpr<6>(q);
873 Tscal t8 = sham::pow_constexpr<7>(q);
874 Tscal t9 = sham::pow_constexpr<8>(q);
875 Tscal t10 = sham::pow_constexpr<9>(q);
876 if (q < 1.0 / 2.0) {
877 return (1.0 / 2816.0) * shambase::constants::pi<Tscal>
878 * (7168 * t1 - 98560 * t9 + 908160 * t7 - 6408864 * t5 + 34283436 * t3
879 - 157802293);
880 } else if (q < 3.0 / 2.0) {
881 return (1.0 / 14080.0) * shambase::constants::pi<Tscal>
882 * (-28672 * t2 + 315392 * t1 - 1182720 * t10 + 887040 * t9 + 3801600 * t8
883 + 413952 * t7 - 32199552 * t6 + 36960 * t5 + 171412560 * t4
884 - 789011388 * q - 7)
885 / q;
886 } else if (q < 5.0 / 2.0) {
887 return (1.0 / 14080.0) * shambase::constants::pi<Tscal>
888 * (14336 * t2 - 315392 * t1 + 2956800 * t10 - 15079680 * t9 + 43718400 * t8
889 - 66646272 * t7 + 43243200 * t6 - 53850720 * t5 + 191620440 * t4
890 - 792042570 * q + 826679)
891 / q;
892 } else if (q < 7.0 / 2.0) {
893 return (1.0 / 14080.0) * shambase::constants::pi<Tscal>
894 * (-4096 * t2 + 135168 * t1 - 1971200 * t10 + 16600320 * t9 - 88281600 * t8
895 + 302953728 * t7 - 649756800 * t6 + 771149280 * t5 - 324004560 * t4
896 - 577198820 * q - 96829571)
897 / q;
898 } else if (q < 9.0 / 2.0) {
899 return (1.0 / 28160.0) * shambase::constants::pi<Tscal>
900 * (1024 * t2 - 45056 * t1 + 887040 * t10 - 10264320 * t9 + 76982400 * t8
901 - 387991296 * t7 + 1309470624 * t6 - 2806008480 * t5 + 3156759540 * t4
902 - 4261625379 * q + 1783667601)
903 / q;
904 } else
905 return -60480 * shambase::constants::pi<Tscal> / q;
906 }
907
908 inline static Tscal phi_tilde_3d_prime(Tscal q) {
909 Tscal t1 = sham::pow_constexpr<10>(q);
910 Tscal t2 = sham::pow_constexpr<11>(q);
911 Tscal t3 = sham::pow_constexpr<2>(q);
912 Tscal t4 = sham::pow_constexpr<3>(q);
913 Tscal t5 = sham::pow_constexpr<4>(q);
914 Tscal t6 = sham::pow_constexpr<5>(q);
915 Tscal t7 = sham::pow_constexpr<6>(q);
916 Tscal t8 = sham::pow_constexpr<7>(q);
917 Tscal t9 = sham::pow_constexpr<8>(q);
918 Tscal t10 = sham::pow_constexpr<9>(q);
919 if (q < 1.0 / 2.0) {
920 return (1.0 / 2816.0) * shambase::constants::pi<Tscal>
921 * (71680 * t10 - 788480 * t8 + 5448960 * t6 - 25635456 * t4 + 68566872 * q);
922 } else if (q < 3.0 / 2.0) {
923 return (1.0 / 14080.0) * shambase::constants::pi<Tscal>
924 * (-315392 * t1 + 3153920 * t10 - 10644480 * t9 + 7096320 * t8
925 + 26611200 * t7 + 2483712 * t6 - 160997760 * t5 + 147840 * t4
926 + 514237680 * t3 - 789011388)
927 / q
928 - (1.0 / 14080.0) * shambase::constants::pi<Tscal>
929 * (-28672 * t2 + 315392 * t1 - 1182720 * t10 + 887040 * t9
930 + 3801600 * t8 + 413952 * t7 - 32199552 * t6 + 36960 * t5
931 + 171412560 * t4 - 789011388 * q - 7)
932 / t3;
933 } else if (q < 5.0 / 2.0) {
934 return (1.0 / 14080.0) * shambase::constants::pi<Tscal>
935 * (157696 * t1 - 3153920 * t10 + 26611200 * t9 - 120637440 * t8
936 + 306028800 * t7 - 399877632 * t6 + 216216000 * t5 - 215402880 * t4
937 + 574861320 * t3 - 792042570)
938 / q
939 - (1.0 / 14080.0) * shambase::constants::pi<Tscal>
940 * (14336 * t2 - 315392 * t1 + 2956800 * t10 - 15079680 * t9
941 + 43718400 * t8 - 66646272 * t7 + 43243200 * t6 - 53850720 * t5
942 + 191620440 * t4 - 792042570 * q + 826679)
943 / t3;
944 } else if (q < 7.0 / 2.0) {
945 return (1.0 / 14080.0) * shambase::constants::pi<Tscal>
946 * (-45056 * t1 + 1351680 * t10 - 17740800 * t9 + 132802560 * t8
947 - 617971200 * t7 + 1817722368 * t6 - 3248784000 * t5 + 3084597120 * t4
948 - 972013680 * t3 - 577198820)
949 / q
950 - (1.0 / 14080.0) * shambase::constants::pi<Tscal>
951 * (-4096 * t2 + 135168 * t1 - 1971200 * t10 + 16600320 * t9
952 - 88281600 * t8 + 302953728 * t7 - 649756800 * t6 + 771149280 * t5
953 - 324004560 * t4 - 577198820 * q - 96829571)
954 / t3;
955 } else if (q < 9.0 / 2.0) {
956 return (1.0 / 28160.0) * shambase::constants::pi<Tscal>
957 * (11264 * t1 - 450560 * t10 + 7983360 * t9 - 82114560 * t8
958 + 538876800 * t7 - 2327947776 * t6 + 6547353120 * t5
959 - 11224033920 * t4 + 9470278620 * t3 - 4261625379)
960 / q
961 - (1.0 / 28160.0) * shambase::constants::pi<Tscal>
962 * (1024 * t2 - 45056 * t1 + 887040 * t10 - 10264320 * t9
963 + 76982400 * t8 - 387991296 * t7 + 1309470624 * t6 - 2806008480 * t5
964 + 3156759540 * t4 - 4261625379 * q + 1783667601)
965 / t3;
966 } else
967 return 60480 * shambase::constants::pi<Tscal> / t3;
968 }
969 };
970
971 template<class Tscal>
973 public:
974 inline static constexpr Tscal Rkern = 5;
976 inline static constexpr Tscal hfactd = 1.0;
977
979 inline static constexpr Tscal norm_1d = 1. / 362880;
981 inline static constexpr Tscal norm_2d = 11. / (2922230 * shambase::constants::pi<Tscal>);
983 inline static constexpr Tscal norm_3d = 6. / (3628800. * shambase::constants::pi<Tscal>);
984
985 inline static Tscal f(Tscal q) {
986
987 Tscal t1 = 5 - q;
988 Tscal t2 = 4 - q;
989 Tscal t3 = 3 - q;
990 Tscal t4 = 2 - q;
991 Tscal t5 = 1 - q;
992
993 t1 = sham::pow_constexpr<9>(t1);
994 t2 = sham::pow_constexpr<9>(t2);
995 t3 = sham::pow_constexpr<9>(t3);
996 t4 = sham::pow_constexpr<9>(t4);
997 t5 = sham::pow_constexpr<9>(t5);
998
999 t1 *= 1.;
1000 t2 *= -10.;
1001 t3 *= 45.;
1002 t4 *= -120.;
1003 t5 *= 210.;
1004
1005 if (q < 1) {
1006 return t1 + t2 + t3 + t4 + t5;
1007 } else if (q < 2) {
1008 return t1 + t2 + t3 + t4;
1009 } else if (q < 3) {
1010 return t1 + t2 + t3;
1011 } else if (q < 4) {
1012 return t1 + t2;
1013 } else if (q < 5) {
1014 return t1;
1015 } else
1016 return 0;
1017 }
1018
1019 inline static Tscal df(Tscal q) {
1020
1021 Tscal t1 = 5 - q;
1022 Tscal t2 = 4 - q;
1023 Tscal t3 = 3 - q;
1024 Tscal t4 = 2 - q;
1025 Tscal t5 = 1 - q;
1026
1027 t1 = sham::pow_constexpr<8>(t1);
1028 t2 = sham::pow_constexpr<8>(t2);
1029 t3 = sham::pow_constexpr<8>(t3);
1030 t4 = sham::pow_constexpr<8>(t4);
1031 t5 = sham::pow_constexpr<8>(t5);
1032
1033 t1 *= (-9.) * (1.);
1034 t2 *= (-9.) * (-10.);
1035 t3 *= (-9.) * (45.);
1036 t4 *= (-9.) * (-120.);
1037 t5 *= (-9.) * (210.);
1038
1039 if (q < 1) {
1040 return t1 + t2 + t3 + t4 + t5;
1041 } else if (q < 2) {
1042 return t1 + t2 + t3 + t4;
1043 } else if (q < 3) {
1044 return t1 + t2 + t3;
1045 } else if (q < 4) {
1046 return t1 + t2;
1047 } else if (q < 5) {
1048 return t1;
1049 } else
1050 return 0;
1051 }
1052
1053 inline static Tscal ddf(Tscal q) {
1054 Tscal t1 = sham::pow_constexpr<7>(1 - q);
1055 Tscal t2 = sham::pow_constexpr<7>(2 - q);
1056 Tscal t3 = sham::pow_constexpr<7>(3 - q);
1057 Tscal t4 = sham::pow_constexpr<7>(4 - q);
1058 Tscal t5 = sham::pow_constexpr<7>(5 - q);
1059 if (q < 1) {
1060 return 15120 * t1 - 8640 * t2 + 3240 * t3 - 720 * t4 + 72 * t5;
1061 } else if (q < 2) {
1062 return -8640 * t2 + 3240 * t3 - 720 * t4 + 72 * t5;
1063 } else if (q < 3) {
1064 return 3240 * t3 - 720 * t4 + 72 * t5;
1065 } else if (q < 4) {
1066 return -720 * t4 + 72 * t5;
1067 } else if (q < 5) {
1068 return 72 * t5;
1069 } else
1070 return 0;
1071 }
1072
1073 inline static Tscal phi_tilde_3d(Tscal q) {
1074 Tscal t1 = sham::pow_constexpr<10>(q);
1075 Tscal t2 = sham::pow_constexpr<11>(q);
1076 Tscal t3 = sham::pow_constexpr<12>(q);
1077 Tscal t4 = sham::pow_constexpr<2>(q);
1078 Tscal t5 = sham::pow_constexpr<3>(q);
1079 Tscal t6 = sham::pow_constexpr<4>(q);
1080 Tscal t7 = sham::pow_constexpr<5>(q);
1081 Tscal t8 = sham::pow_constexpr<6>(q);
1082 Tscal t9 = sham::pow_constexpr<7>(q);
1083 Tscal t10 = sham::pow_constexpr<8>(q);
1084 Tscal t11 = sham::pow_constexpr<9>(q);
1085 if (q < 1) {
1086 return (2.0 / 33.0) * shambase::constants::pi<Tscal>
1087 * (-63 * t2 + 378 * t1 - 3850 * t10 + 37620 * t8 - 291060 * t6 + 1718090 * t4
1088 - 8766690);
1089 } else if (q < 2) {
1090 return (2.0 / 33.0) * shambase::constants::pi<Tscal>
1091 * (42 * t3 - 756 * t2 + 5544 * t1 - 20020 * t11 + 31185 * t10 - 3960 * t9
1092 + 38808 * t8 - 316008 * t7 + 10395 * t6 + 1715780 * t5 - 8766564 * q - 21)
1093 / q;
1094 } else if (q < 3) {
1095 return (2.0 / 33.0) * shambase::constants::pi<Tscal>
1096 * (-18 * t3 + 540 * t2 - 7128 * t1 + 53900 * t11 - 253935 * t10 + 756360 * t9
1097 - 1380456 * t8 + 1508760 * t7 - 1510245 * t6 + 2391620 * t5 - 8914020 * q
1098 + 49131)
1099 / q;
1100 } else if (q < 4) {
1101 return (1.0 / 33.0) * shambase::constants::pi<Tscal>
1102 * (9 * t3 - 378 * t2 + 7128 * t1 - 79310 * t11 + 574695 * t10 - 2817540 * t9
1103 + 9363816 * t8 - 20365884 * t7 + 26208765 * t6 - 14702930 * t5
1104 - 8262102 * q - 4684707)
1105 / q;
1106 } else if (q < 5) {
1107 return (1.0 / 33.0) * shambase::constants::pi<Tscal>
1108 * (-t3 + 54 * t2 - 1320 * t1 + 19250 * t11 - 185625 * t10 + 1237500 * t9
1109 - 5775000 * t8 + 18562500 * t7 - 38671875 * t6 + 42968750 * t5
1110 - 58593750 * q + 28869725)
1111 / q;
1112 } else
1113 return -604800 * shambase::constants::pi<Tscal> / q;
1114 }
1115
1116 inline static Tscal phi_tilde_3d_prime(Tscal q) {
1117 Tscal t1 = sham::pow_constexpr<10>(q);
1118 Tscal t2 = sham::pow_constexpr<11>(q);
1119 Tscal t3 = sham::pow_constexpr<12>(q);
1120 Tscal t4 = sham::pow_constexpr<2>(q);
1121 Tscal t5 = sham::pow_constexpr<3>(q);
1122 Tscal t6 = sham::pow_constexpr<4>(q);
1123 Tscal t7 = sham::pow_constexpr<5>(q);
1124 Tscal t8 = sham::pow_constexpr<6>(q);
1125 Tscal t9 = sham::pow_constexpr<7>(q);
1126 Tscal t10 = sham::pow_constexpr<8>(q);
1127 Tscal t11 = sham::pow_constexpr<9>(q);
1128 if (q < 1) {
1129 return (2.0 / 33.0) * shambase::constants::pi<Tscal>
1130 * (-693 * t1 + 3780 * t11 - 30800 * t9 + 225720 * t7 - 1164240 * t5
1131 + 3436180 * q);
1132 } else if (q < 2) {
1133 return (2.0 / 33.0) * shambase::constants::pi<Tscal>
1134 * (504 * t2 - 8316 * t1 + 55440 * t11 - 180180 * t10 + 249480 * t9
1135 - 27720 * t8 + 232848 * t7 - 1580040 * t6 + 41580 * t5 + 5147340 * t4
1136 - 8766564)
1137 / q
1138 - (2.0 / 33.0) * shambase::constants::pi<Tscal>
1139 * (42 * t3 - 756 * t2 + 5544 * t1 - 20020 * t11 + 31185 * t10
1140 - 3960 * t9 + 38808 * t8 - 316008 * t7 + 10395 * t6 + 1715780 * t5
1141 - 8766564 * q - 21)
1142 / t4;
1143 } else if (q < 3) {
1144 return (2.0 / 33.0) * shambase::constants::pi<Tscal>
1145 * (-216 * t2 + 5940 * t1 - 71280 * t11 + 485100 * t10 - 2031480 * t9
1146 + 5294520 * t8 - 8282736 * t7 + 7543800 * t6 - 6040980 * t5
1147 + 7174860 * t4 - 8914020)
1148 / q
1149 - (2.0 / 33.0) * shambase::constants::pi<Tscal>
1150 * (-18 * t3 + 540 * t2 - 7128 * t1 + 53900 * t11 - 253935 * t10
1151 + 756360 * t9 - 1380456 * t8 + 1508760 * t7 - 1510245 * t6
1152 + 2391620 * t5 - 8914020 * q + 49131)
1153 / t4;
1154 } else if (q < 4) {
1155 return (1.0 / 33.0) * shambase::constants::pi<Tscal>
1156 * (108 * t2 - 4158 * t1 + 71280 * t11 - 713790 * t10 + 4597560 * t9
1157 - 19722780 * t8 + 56182896 * t7 - 101829420 * t6 + 104835060 * t5
1158 - 44108790 * t4 - 8262102)
1159 / q
1160 - (1.0 / 33.0) * shambase::constants::pi<Tscal>
1161 * (9 * t3 - 378 * t2 + 7128 * t1 - 79310 * t11 + 574695 * t10
1162 - 2817540 * t9 + 9363816 * t8 - 20365884 * t7 + 26208765 * t6
1163 - 14702930 * t5 - 8262102 * q - 4684707)
1164 / t4;
1165 } else if (q < 5) {
1166 return (1.0 / 33.0) * shambase::constants::pi<Tscal>
1167 * (-12 * t2 + 594 * t1 - 13200 * t11 + 173250 * t10 - 1485000 * t9
1168 + 8662500 * t8 - 34650000 * t7 + 92812500 * t6 - 154687500 * t5
1169 + 128906250 * t4 - 58593750)
1170 / q
1171 - (1.0 / 33.0) * shambase::constants::pi<Tscal>
1172 * (-t3 + 54 * t2 - 1320 * t1 + 19250 * t11 - 185625 * t10
1173 + 1237500 * t9 - 5775000 * t8 + 18562500 * t7 - 38671875 * t6
1174 + 42968750 * t5 - 58593750 * q + 28869725)
1175 / t4;
1176 } else
1177 return 604800 * shambase::constants::pi<Tscal> / t4;
1178 }
1179 };
1180
1181 template<class Tscal>
1183 public:
1184 inline static constexpr Tscal Rkern = 2;
1186 inline static constexpr Tscal hfactd = 1.4;
1187
1189 inline static constexpr Tscal norm_1d = 3. / 4.;
1191 inline static constexpr Tscal norm_2d = 7. / (4 * shambase::constants::pi<Tscal>);
1193 inline static constexpr Tscal norm_3d = 21 / (16 * shambase::constants::pi<Tscal>);
1194
1195 inline static Tscal f(Tscal q) {
1196
1197 constexpr Tscal div1_2 = (1. / 2.);
1198
1199 Tscal p1 = (1 - q * div1_2);
1200 Tscal p2 = (1 + q * 2);
1201
1202 p1 *= p1;
1203 p1 *= p1;
1204
1205 if (q < 2.) {
1206 return p1 * p2;
1207 } else
1208 return 0;
1209 }
1210
1211 inline static Tscal df(Tscal q) {
1212
1213 constexpr Tscal div1_2 = (1. / 2.);
1214 constexpr Tscal div1_8 = (1. / 8.);
1215 constexpr Tscal div1_4 = (1. / 4.);
1216
1217 Tscal p1 = (1 - q * div1_2);
1218 Tscal p2 = (1 + q * 2);
1219
1220 Tscal p3 = p1 * p1 * p1;
1221
1222 if (q < 2.) {
1223 return 2 * (p3 * p1 - p3 * p2);
1224 } else
1225 return 0;
1226 }
1227
1228 inline static Tscal ddf(Tscal q) {
1229 Tscal t1 = sham::pow_constexpr<2>(1 - (1.0 / 2.0) * q);
1230 Tscal t2 = sham::pow_constexpr<3>(1 - (1.0 / 2.0) * q);
1231 if (q < 2) {
1232 return -8 * t2 + 3 * t1 * (2 * q + 1);
1233 } else
1234 return 0;
1235 }
1236
1237 inline static Tscal phi_tilde_3d(Tscal q) {
1238 Tscal t1 = sham::pow_constexpr<2>(q);
1239 Tscal t2 = sham::pow_constexpr<3>(q);
1240 Tscal t3 = sham::pow_constexpr<4>(q);
1241 Tscal t4 = sham::pow_constexpr<5>(q);
1242 if (q < 2) {
1243 return (1.0 / 336.0) * shambase::constants::pi<Tscal>
1244 * (t1 * (3 * t4 - 30 * t3 + 112 * t2 - 168 * t1 + 224) - 384);
1245 } else
1246 return -(16.0 / 21.0) * shambase::constants::pi<Tscal> / q;
1247 }
1248
1249 inline static Tscal phi_tilde_3d_prime(Tscal q) {
1250 Tscal t1 = sham::pow_constexpr<2>(q);
1251 Tscal t2 = sham::pow_constexpr<3>(q);
1252 Tscal t3 = sham::pow_constexpr<4>(q);
1253 Tscal t4 = sham::pow_constexpr<5>(q);
1254 if (q < 2) {
1255 return (1.0 / 336.0) * shambase::constants::pi<Tscal>
1256 * (t1 * (15 * t3 - 120 * t2 + 336 * t1 - 336 * q)
1257 + 2 * q * (3 * t4 - 30 * t3 + 112 * t2 - 168 * t1 + 224));
1258 } else
1259 return (16.0 / 21.0) * shambase::constants::pi<Tscal> / t1;
1260 }
1261 };
1262
1263 template<class Tscal>
1265 public:
1266 inline static constexpr Tscal Rkern = 2;
1268 inline static constexpr Tscal hfactd = 1.6;
1269
1271 inline static constexpr Tscal norm_1d = 27. / 32.;
1273 inline static constexpr Tscal norm_2d = 9. / (4 * shambase::constants::pi<Tscal>);
1275 inline static constexpr Tscal norm_3d = 495. / (256. * shambase::constants::pi<Tscal>);
1276
1277 inline static Tscal f(Tscal q) {
1278
1279 constexpr Tscal div1_2 = (1. / 2.);
1280 constexpr Tscal div35_12 = (35. / 12.);
1281
1282 Tscal p1 = (1 - q * div1_2);
1283 Tscal p2 = (1 + q * 3 + div35_12 * q * q);
1284
1285 p1 *= p1;
1286 p1 = p1 * p1 * p1;
1287
1288 if (q < 2.) {
1289 return p1 * p2;
1290 } else
1291 return 0;
1292 }
1293
1294 inline static Tscal df(Tscal q) {
1295
1296 constexpr Tscal div7_96 = (7. / 96.);
1297
1298 Tscal p1 = (-2 + q);
1299 Tscal p2 = (2 + 5 * q);
1300
1301 Tscal p14 = p1 * p1;
1302 p14 *= p14;
1303
1304 if (q < 2.) {
1305 return div7_96 * p14 * p1 * q * p2;
1306 } else
1307 return 0;
1308 }
1309
1310 inline static Tscal ddf(Tscal q) {
1311 Tscal t1 = sham::pow_constexpr<2>(q);
1312 Tscal t2 = sham::pow_constexpr<4>(1 - (1.0 / 2.0) * q);
1313 Tscal t3 = sham::pow_constexpr<5>(1 - (1.0 / 2.0) * q);
1314 Tscal t4 = sham::pow_constexpr<6>(1 - (1.0 / 2.0) * q);
1315 if (q < 2) {
1316 return (35.0 / 6.0) * t4 - 6 * t3 * ((35.0 / 6.0) * q + 3)
1317 + (15.0 / 2.0) * t2 * ((35.0 / 12.0) * t1 + 3 * q + 1);
1318 } else
1319 return 0;
1320 }
1321
1322 inline static Tscal phi_tilde_3d(Tscal q) {
1323 Tscal t1 = sham::pow_constexpr<2>(q);
1324 Tscal t2 = sham::pow_constexpr<4>(q);
1325 Tscal t3 = sham::pow_constexpr<5>(q);
1326 Tscal t4 = sham::pow_constexpr<6>(q);
1327 Tscal t5 = sham::pow_constexpr<7>(q);
1328 Tscal t6 = sham::pow_constexpr<8>(q);
1329 if (q < 2) {
1330 return (1.0 / 63360.0) * shambase::constants::pi<Tscal>
1331 * (t1
1332 * (105 * t6 - 1408 * t5 + 7700 * t4 - 21120 * t3 + 26400 * t2
1333 - 29568 * t1 + 42240)
1334 - 56320);
1335 } else
1336 return -(256.0 / 495.0) * shambase::constants::pi<Tscal> / q;
1337 }
1338
1339 inline static Tscal phi_tilde_3d_prime(Tscal q) {
1340 Tscal t1 = sham::pow_constexpr<2>(q);
1341 Tscal t2 = sham::pow_constexpr<3>(q);
1342 Tscal t3 = sham::pow_constexpr<4>(q);
1343 Tscal t4 = sham::pow_constexpr<5>(q);
1344 Tscal t5 = sham::pow_constexpr<6>(q);
1345 Tscal t6 = sham::pow_constexpr<7>(q);
1346 Tscal t7 = sham::pow_constexpr<8>(q);
1347 if (q < 2) {
1348 return (1.0 / 63360.0) * shambase::constants::pi<Tscal>
1349 * (t1
1350 * (840 * t6 - 9856 * t5 + 46200 * t4 - 105600 * t3 + 105600 * t2
1351 - 59136 * q)
1352 + 2 * q
1353 * (105 * t7 - 1408 * t6 + 7700 * t5 - 21120 * t4 + 26400 * t3
1354 - 29568 * t1 + 42240));
1355 } else
1356 return (256.0 / 495.0) * shambase::constants::pi<Tscal> / t1;
1357 }
1358 };
1359
1360 template<class Tscal>
1362 public:
1363 inline static constexpr Tscal Rkern = 2;
1365 inline static constexpr Tscal hfactd = 2.2;
1366
1368 inline static constexpr Tscal norm_1d = 15. / 16.;
1370 inline static constexpr Tscal norm_2d = 39. / (14. * shambase::constants::pi<Tscal>);
1372 inline static constexpr Tscal norm_3d = 1365. / (512. * shambase::constants::pi<Tscal>);
1373
1374 inline static Tscal f(Tscal q) {
1375
1376 constexpr Tscal div1_2 = (1. / 2.);
1377 constexpr Tscal div25_4 = (25. / 4.);
1378
1379 Tscal p1 = (1 - q * div1_2);
1380 Tscal p2 = (1 + q * 4 + div25_4 * q * q + 4 * q * q * q);
1381
1382 p1 *= p1;
1383 p1 *= p1;
1384 p1 *= p1;
1385
1386 if (q < 2.) {
1387 return p1 * p2;
1388 } else
1389 return 0;
1390 }
1391
1392 inline static Tscal df(Tscal q) {
1393
1394 constexpr Tscal div11_512 = (11. / 512.);
1395
1396 Tscal p1 = (-2 + q);
1397 Tscal p2 = 2 + 7 * q + 8 * q * q;
1398
1399 Tscal p12 = p1 * p1;
1400 Tscal p14 = p12 * p12;
1401 Tscal p17 = p12 * p14 * p1;
1402
1403 if (q < 2.) {
1404 return div11_512 * p17 * q * p2;
1405 } else
1406 return 0;
1407 }
1408
1409 inline static Tscal ddf(Tscal q) {
1410 Tscal t1 = sham::pow_constexpr<2>(q);
1411 Tscal t2 = sham::pow_constexpr<3>(q);
1412 Tscal t3 = sham::pow_constexpr<6>(1 - (1.0 / 2.0) * q);
1413 Tscal t4 = sham::pow_constexpr<7>(1 - (1.0 / 2.0) * q);
1414 Tscal t5 = sham::pow_constexpr<8>(1 - (1.0 / 2.0) * q);
1415 if (q < 2) {
1416 return t5 * (24 * q + 25.0 / 2.0) - 8 * t4 * (12 * t1 + (25.0 / 2.0) * q + 4)
1417 + 14 * t3 * (4 * t2 + (25.0 / 4.0) * t1 + 4 * q + 1);
1418 } else
1419 return 0;
1420 }
1421
1422 inline static Tscal phi_tilde_3d(Tscal q) {
1423 Tscal t1 = sham::pow_constexpr<10>(q);
1424 Tscal t2 = sham::pow_constexpr<11>(q);
1425 Tscal t3 = sham::pow_constexpr<2>(q);
1426 Tscal t4 = sham::pow_constexpr<4>(q);
1427 Tscal t5 = sham::pow_constexpr<6>(q);
1428 Tscal t6 = sham::pow_constexpr<7>(q);
1429 Tscal t7 = sham::pow_constexpr<8>(q);
1430 Tscal t8 = sham::pow_constexpr<9>(q);
1431 if (q < 2) {
1432 return (1.0 / 1397760.0) * shambase::constants::pi<Tscal>
1433 * (t3
1434 * (480 * t2 - 8085 * t1 + 58240 * t8 - 229320 * t7 + 512512 * t6
1435 - 560560 * t5 + 549120 * t4 - 768768 * t3 + 931840)
1436 - 1003520);
1437 } else
1438 return -(512.0 / 1365.0) * shambase::constants::pi<Tscal> / q;
1439 }
1440
1441 inline static Tscal phi_tilde_3d_prime(Tscal q) {
1442 Tscal t1 = sham::pow_constexpr<10>(q);
1443 Tscal t2 = sham::pow_constexpr<11>(q);
1444 Tscal t3 = sham::pow_constexpr<2>(q);
1445 Tscal t4 = sham::pow_constexpr<3>(q);
1446 Tscal t5 = sham::pow_constexpr<4>(q);
1447 Tscal t6 = sham::pow_constexpr<5>(q);
1448 Tscal t7 = sham::pow_constexpr<6>(q);
1449 Tscal t8 = sham::pow_constexpr<7>(q);
1450 Tscal t9 = sham::pow_constexpr<8>(q);
1451 Tscal t10 = sham::pow_constexpr<9>(q);
1452 if (q < 2) {
1453 return (1.0 / 1397760.0) * shambase::constants::pi<Tscal>
1454 * (t3
1455 * (5280 * t1 - 80850 * t10 + 524160 * t9 - 1834560 * t8 + 3587584 * t7
1456 - 3363360 * t6 + 2196480 * t4 - 1537536 * q)
1457 + 2 * q
1458 * (480 * t2 - 8085 * t1 + 58240 * t10 - 229320 * t9 + 512512 * t8
1459 - 560560 * t7 + 549120 * t5 - 768768 * t3 + 931840));
1460 } else
1461 return (512.0 / 1365.0) * shambase::constants::pi<Tscal> / t3;
1462 }
1463 };
1464
1473 template<class Tscal>
1475 public:
1476 inline static constexpr Tscal Rkern = 3;
1477 inline static constexpr Tscal hfactd = 1.5;
1478
1480 inline static constexpr Tscal norm_1d = 0.564202047051383;
1482 inline static constexpr Tscal norm_2d = 0.318349173592935;
1484 inline static constexpr Tscal norm_3d = 0.179666148218087;
1485
1486 inline static Tscal f(Tscal q) {
1487 Tscal t1 = sham::pow_constexpr<2>(q);
1488 if (q < 3) {
1489 return sycl::exp(-t1);
1490 } else
1491 return 0;
1492 }
1493
1494 inline static Tscal df(Tscal q) {
1495 Tscal t1 = sham::pow_constexpr<2>(q);
1496 if (q < 3) {
1497 return -2 * q * sycl::exp(-t1);
1498 } else
1499 return 0;
1500 }
1501
1502 inline static Tscal ddf(Tscal q) {
1503 Tscal t1 = sham::pow_constexpr<2>(q);
1504 if (q < 3) {
1505 return (4 * t1 - 2) * sycl::exp(-t1);
1506 } else
1507 return 0;
1508 }
1509
1510 inline static Tscal phi_tilde_3d(Tscal q) {
1511 if (q == 0) {
1512 return -6.282409900511787;
1513 } else if (q < 3) {
1514 return 2 * shambase::constants::pi<Tscal> * sycl::exp(Tscal{-9})
1515 - sycl::pow(shambase::constants::pi<Tscal>, 3.0 / 2.0) * sycl::erf(q) / q;
1516 } else
1517 return (-sycl::pow(shambase::constants::pi<Tscal>, 3.0 / 2.0) * sycl::erf(Tscal{3})
1518 + 6 * shambase::constants::pi<Tscal> * sycl::exp(Tscal{-9}))
1519 / q;
1520 }
1521
1522 inline static Tscal phi_tilde_3d_prime(Tscal q) {
1523 Tscal t1 = sham::pow_constexpr<2>(q);
1524 if (q == 0) {
1525 return 0;
1526 } else if (q < 3) {
1527 return -2 * shambase::constants::pi<Tscal> * sycl::exp(-t1) / q
1528 + sycl::pow(shambase::constants::pi<Tscal>, 3.0 / 2.0) * sycl::erf(q) / t1;
1529 } else
1530 return -(-sycl::pow(shambase::constants::pi<Tscal>, 3.0 / 2.0) * sycl::erf(Tscal{3})
1531 + 6 * shambase::constants::pi<Tscal> * sycl::exp(Tscal{-9}))
1532 / t1;
1533 }
1534 };
1535
1544 template<class Tscal>
1546 public:
1547 inline static constexpr Tscal Rkern = 5;
1548 inline static constexpr Tscal hfactd = 1.5;
1549
1551 inline static constexpr Tscal norm_1d = 0.564189583548624;
1553 inline static constexpr Tscal norm_2d = 0.318309886188211;
1555 inline static constexpr Tscal norm_3d = 0.179587122139514;
1556
1557 inline static Tscal f(Tscal q) {
1558 Tscal t1 = sham::pow_constexpr<2>(q);
1559 if (q < 5) {
1560 return sycl::exp(-t1);
1561 } else
1562 return 0;
1563 }
1564
1565 inline static Tscal df(Tscal q) {
1566 Tscal t1 = sham::pow_constexpr<2>(q);
1567 if (q < 5) {
1568 return -2 * q * sycl::exp(-t1);
1569 } else
1570 return 0;
1571 }
1572
1573 inline static Tscal ddf(Tscal q) {
1574 Tscal t1 = sham::pow_constexpr<2>(q);
1575 if (q < 5) {
1576 return (4 * t1 - 2) * sycl::exp(-t1);
1577 } else
1578 return 0;
1579 }
1580
1581 inline static Tscal phi_tilde_3d(Tscal q) {
1582 if (q == 0) {
1583 return -6.283185307092326;
1584 } else if (q < 5) {
1585 return 2 * shambase::constants::pi<Tscal> * sycl::exp(Tscal{-25})
1586 - sycl::pow(shambase::constants::pi<Tscal>, 3.0 / 2.0) * sycl::erf(q) / q;
1587 } else
1588 return (-sycl::pow(shambase::constants::pi<Tscal>, 3.0 / 2.0) * sycl::erf(Tscal{5})
1589 + 10 * shambase::constants::pi<Tscal> * sycl::exp(Tscal{-25}))
1590 / q;
1591 }
1592
1593 inline static Tscal phi_tilde_3d_prime(Tscal q) {
1594 Tscal t1 = sham::pow_constexpr<2>(q);
1595 if (q == 0) {
1596 return 0;
1597 } else if (q < 5) {
1598 return -2 * shambase::constants::pi<Tscal> * sycl::exp(-t1) / q
1599 + sycl::pow(shambase::constants::pi<Tscal>, 3.0 / 2.0) * sycl::erf(q) / t1;
1600 } else
1601 return -(-sycl::pow(shambase::constants::pi<Tscal>, 3.0 / 2.0) * sycl::erf(Tscal{5})
1602 + 10 * shambase::constants::pi<Tscal> * sycl::exp(Tscal{-25}))
1603 / t1;
1604 }
1605 };
1606
1607 template<class Tscal>
1609 public:
1610 inline static constexpr Tscal Rkern = 2;
1612 inline static constexpr Tscal hfactd = 1.2;
1613
1615 inline static constexpr Tscal norm_1d = 2.;
1617 inline static constexpr Tscal norm_2d
1618 = (49. / 31.) * 10. / (7. * shambase::constants::pi<Tscal>);
1620 inline static constexpr Tscal norm_3d = (10. / 9.) * 1 / shambase::constants::pi<Tscal>;
1621
1622 inline static Tscal f(Tscal q) { return KernelDefM4<Tscal>::f(q) * q * q; }
1623
1624 inline static Tscal df(Tscal q) {
1625 return KernelDefM4<Tscal>::df(q) * q * q + 2 * KernelDefM4<Tscal>::f(q) * q;
1626 }
1627
1628 inline static Tscal ddf(Tscal q) {
1629 Tscal t1 = sham::pow_constexpr<2>(1 - q);
1630 Tscal t2 = sham::pow_constexpr<2>(2 - q);
1631 Tscal t3 = sham::pow_constexpr<2>(q);
1632 Tscal t4 = sham::pow_constexpr<3>(1 - q);
1633 Tscal t5 = sham::pow_constexpr<3>(2 - q);
1634 if (q < 1) {
1635 return t3 * ((9.0 / 2.0) * q - 3) + 4 * q * (3 * t1 - (3.0 / 4.0) * t2) - 2 * t4
1636 + (1.0 / 2.0) * t5;
1637 } else if (q < 2) {
1638 return -(3.0 / 4.0) * t3 * (2 * q - 4) - 3 * q * t2 + (1.0 / 2.0) * t5;
1639 } else
1640 return 0;
1641 }
1642
1643 inline static Tscal phi_tilde_3d(Tscal q) {
1644 Tscal t1 = sham::pow_constexpr<2>(q);
1645 Tscal t2 = sham::pow_constexpr<3>(q);
1646 Tscal t3 = sham::pow_constexpr<4>(q);
1647 Tscal t4 = sham::pow_constexpr<5>(q);
1648 Tscal t5 = sham::pow_constexpr<6>(q);
1649 Tscal t6 = sham::pow_constexpr<7>(q);
1650 Tscal t7 = sham::pow_constexpr<8>(q);
1651 if (q < 1) {
1652 return (1.0 / 280.0) * shambase::constants::pi<Tscal>
1653 * (t3 * (15 * t2 - 40 * t1 + 56) - 248);
1654 } else if (q < 2) {
1655 return (1.0 / 280.0) * shambase::constants::pi<Tscal>
1656 * (-5 * t7 + 40 * t6 - 112 * t5 + 112 * t4 - 256 * q + 4) / q;
1657 } else
1658 return -(9.0 / 10.0) * shambase::constants::pi<Tscal> / q;
1659 }
1660
1661 inline static Tscal phi_tilde_3d_prime(Tscal q) {
1662 Tscal t1 = sham::pow_constexpr<2>(q);
1663 Tscal t2 = sham::pow_constexpr<3>(q);
1664 Tscal t3 = sham::pow_constexpr<4>(q);
1665 Tscal t4 = sham::pow_constexpr<5>(q);
1666 Tscal t5 = sham::pow_constexpr<6>(q);
1667 Tscal t6 = sham::pow_constexpr<7>(q);
1668 Tscal t7 = sham::pow_constexpr<8>(q);
1669 if (q < 1) {
1670 return (1.0 / 280.0) * shambase::constants::pi<Tscal>
1671 * (t3 * (45 * t1 - 80 * q) + 4 * t2 * (15 * t2 - 40 * t1 + 56));
1672 } else if (q < 2) {
1673 return (1.0 / 280.0) * shambase::constants::pi<Tscal>
1674 * (-40 * t6 + 280 * t5 - 672 * t4 + 560 * t3 - 256) / q
1675 - (1.0 / 280.0) * shambase::constants::pi<Tscal>
1676 * (-5 * t7 + 40 * t6 - 112 * t5 + 112 * t4 - 256 * q + 4) / t1;
1677 } else
1678 return (9.0 / 10.0) * shambase::constants::pi<Tscal> / t1;
1679 }
1680 };
1681
1682 template<class Tscal>
1684 public:
1685 inline static constexpr Tscal Rkern = 2;
1687 inline static constexpr Tscal hfactd = 1.2;
1688
1690 inline static constexpr Tscal norm_1d = (105. / 31.) * 2. / 3.;
1692 inline static constexpr Tscal norm_2d
1693 = (14. / 9.) * 10. / (7. * shambase::constants::pi<Tscal>);
1695 inline static constexpr Tscal norm_3d = (126. / 127.) * 1 / shambase::constants::pi<Tscal>;
1696
1697 inline static Tscal f(Tscal q) { return KernelDefM4<Tscal>::f(q) * q * q * q; }
1698
1699 inline static Tscal df(Tscal q) {
1700 return KernelDefM4<Tscal>::df(q) * q * q * q + 3 * KernelDefM4<Tscal>::f(q) * q * q;
1701 }
1702
1703 inline static Tscal ddf(Tscal q) {
1704 Tscal t1 = sham::pow_constexpr<2>(1 - q);
1705 Tscal t2 = sham::pow_constexpr<2>(2 - q);
1706 Tscal t3 = sham::pow_constexpr<2>(q);
1707 Tscal t4 = sham::pow_constexpr<3>(1 - q);
1708 Tscal t5 = sham::pow_constexpr<3>(2 - q);
1709 Tscal t6 = sham::pow_constexpr<3>(q);
1710 if (q < 1) {
1711 return t6 * ((9.0 / 2.0) * q - 3) + 6 * t3 * (3 * t1 - (3.0 / 4.0) * t2)
1712 + 6 * q * (-t4 + (1.0 / 4.0) * t5);
1713 } else if (q < 2) {
1714 return -(3.0 / 4.0) * t6 * (2 * q - 4) - (9.0 / 2.0) * t3 * t2
1715 + (3.0 / 2.0) * q * t5;
1716 } else
1717 return 0;
1718 }
1719
1720 inline static Tscal phi_tilde_3d(Tscal q) {
1721 Tscal t1 = sham::pow_constexpr<2>(q);
1722 Tscal t2 = sham::pow_constexpr<3>(q);
1723 Tscal t3 = sham::pow_constexpr<5>(q);
1724 Tscal t4 = sham::pow_constexpr<6>(q);
1725 Tscal t5 = sham::pow_constexpr<7>(q);
1726 Tscal t6 = sham::pow_constexpr<8>(q);
1727 Tscal t7 = sham::pow_constexpr<9>(q);
1728 if (q < 1) {
1729 return (1.0 / 840.0) * shambase::constants::pi<Tscal>
1730 * (t3 * (35 * t2 - 90 * t1 + 112) - 756);
1731 } else if (q < 2) {
1732 return (1.0 / 2520.0) * shambase::constants::pi<Tscal>
1733 * (-35 * t7 + 270 * t6 - 720 * t5 + 672 * t4 - 2304 * q + 20) / q;
1734 } else
1735 return -(127.0 / 126.0) * shambase::constants::pi<Tscal> / q;
1736 }
1737
1738 inline static Tscal phi_tilde_3d_prime(Tscal q) {
1739 Tscal t1 = sham::pow_constexpr<2>(q);
1740 Tscal t2 = sham::pow_constexpr<3>(q);
1741 Tscal t3 = sham::pow_constexpr<4>(q);
1742 Tscal t4 = sham::pow_constexpr<5>(q);
1743 Tscal t5 = sham::pow_constexpr<6>(q);
1744 Tscal t6 = sham::pow_constexpr<7>(q);
1745 Tscal t7 = sham::pow_constexpr<8>(q);
1746 Tscal t8 = sham::pow_constexpr<9>(q);
1747 if (q < 1) {
1748 return (1.0 / 840.0) * shambase::constants::pi<Tscal>
1749 * (t4 * (105 * t1 - 180 * q) + 5 * t3 * (35 * t2 - 90 * t1 + 112));
1750 } else if (q < 2) {
1751 return (1.0 / 2520.0) * shambase::constants::pi<Tscal>
1752 * (-315 * t7 + 2160 * t6 - 5040 * t5 + 4032 * t4 - 2304) / q
1753 - (1.0 / 2520.0) * shambase::constants::pi<Tscal>
1754 * (-35 * t8 + 270 * t7 - 720 * t6 + 672 * t5 - 2304 * q + 20) / t1;
1755 } else
1756 return (127.0 / 126.0) * shambase::constants::pi<Tscal> / t1;
1757 }
1758 };
1759
1760 template<class Tscal>
1762 public:
1763 inline static constexpr Tscal Rkern = 2;
1765 inline static constexpr Tscal hfactd = 1.2;
1766
1768 inline static constexpr Tscal norm_1d = 252.0 / 127.0;
1770 inline static constexpr Tscal norm_2d = (28.0 / 17.0) / shambase::constants::pi<Tscal>;
1772 inline static constexpr Tscal norm_3d = (330.0 / 511.0) / shambase::constants::pi<Tscal>;
1773
1774 inline static Tscal f(Tscal q) {
1775 return KernelDefM4<Tscal>::f(q) * sham::pow_constexpr<5>(q);
1776 }
1777
1778 inline static Tscal df(Tscal q) {
1779 return KernelDefM4<Tscal>::df(q) * sham::pow_constexpr<5>(q)
1780 + 5 * KernelDefM4<Tscal>::f(q) * sham::pow_constexpr<4>(q);
1781 }
1782
1783 inline static Tscal ddf(Tscal q) {
1784 Tscal t1 = sham::pow_constexpr<2>(1 - q);
1785 Tscal t2 = sham::pow_constexpr<2>(2 - q);
1786 Tscal t3 = sham::pow_constexpr<3>(1 - q);
1787 Tscal t4 = sham::pow_constexpr<3>(2 - q);
1788 Tscal t5 = sham::pow_constexpr<3>(q);
1789 Tscal t6 = sham::pow_constexpr<4>(q);
1790 Tscal t7 = sham::pow_constexpr<5>(q);
1791 if (q < 1) {
1792 return t7 * ((9.0 / 2.0) * q - 3) + 10 * t6 * (3 * t1 - (3.0 / 4.0) * t2)
1793 + 20 * t5 * (-t3 + (1.0 / 4.0) * t4);
1794 } else if (q < 2) {
1795 return -(3.0 / 4.0) * t7 * (2 * q - 4) - (15.0 / 2.0) * t6 * t2 + 5 * t5 * t4;
1796 } else
1797 return 0;
1798 }
1799
1800 inline static Tscal phi_tilde_3d(Tscal q) {
1801 Tscal t1 = sham::pow_constexpr<10>(q);
1802 Tscal t2 = sham::pow_constexpr<11>(q);
1803 Tscal t3 = sham::pow_constexpr<2>(q);
1804 Tscal t4 = sham::pow_constexpr<3>(q);
1805 Tscal t5 = sham::pow_constexpr<7>(q);
1806 Tscal t6 = sham::pow_constexpr<8>(q);
1807 Tscal t7 = sham::pow_constexpr<9>(q);
1808 if (q < 1) {
1809 return (1.0 / 2310.0) * shambase::constants::pi<Tscal>
1810 * (t5 * (63 * t4 - 154 * t3 + 165) - 2805);
1811 } else if (q < 2) {
1812 return (1.0 / 2310.0) * shambase::constants::pi<Tscal>
1813 * (-21 * t2 + 154 * t1 - 385 * t7 + 330 * t6 - 2816 * q + 7) / q;
1814 } else
1815 return -(511.0 / 330.0) * shambase::constants::pi<Tscal> / q;
1816 }
1817
1818 inline static Tscal phi_tilde_3d_prime(Tscal q) {
1819 Tscal t1 = sham::pow_constexpr<10>(q);
1820 Tscal t2 = sham::pow_constexpr<11>(q);
1821 Tscal t3 = sham::pow_constexpr<2>(q);
1822 Tscal t4 = sham::pow_constexpr<3>(q);
1823 Tscal t5 = sham::pow_constexpr<6>(q);
1824 Tscal t6 = sham::pow_constexpr<7>(q);
1825 Tscal t7 = sham::pow_constexpr<8>(q);
1826 Tscal t8 = sham::pow_constexpr<9>(q);
1827 if (q < 1) {
1828 return (1.0 / 2310.0) * shambase::constants::pi<Tscal>
1829 * (t6 * (189 * t3 - 308 * q) + 7 * t5 * (63 * t4 - 154 * t3 + 165));
1830 } else if (q < 2) {
1831 return (1.0 / 2310.0) * shambase::constants::pi<Tscal>
1832 * (-231 * t1 + 1540 * t8 - 3465 * t7 + 2640 * t6 - 2816) / q
1833 - (1.0 / 2310.0) * shambase::constants::pi<Tscal>
1834 * (-21 * t2 + 154 * t1 - 385 * t8 + 330 * t7 - 2816 * q + 7) / t3;
1835 } else
1836 return (511.0 / 330.0) * shambase::constants::pi<Tscal> / t3;
1837 }
1838 };
1839
1840 template<class Tscal>
1842 public:
1843 inline static constexpr Tscal Rkern = 2;
1845 inline static constexpr Tscal hfactd = 1.2;
1846
1848 inline static constexpr Tscal norm_1d = 660.0 / 511.0;
1850 inline static constexpr Tscal norm_2d = (30.0 / 31.0) / shambase::constants::pi<Tscal>;
1852 inline static constexpr Tscal norm_3d = (715.0 / 2047.0) / shambase::constants::pi<Tscal>;
1853
1854 inline static Tscal f(Tscal q) {
1855 return KernelDefM4<Tscal>::f(q) * sham::pow_constexpr<7>(q);
1856 }
1857
1858 inline static Tscal df(Tscal q) {
1859 return KernelDefM4<Tscal>::df(q) * sham::pow_constexpr<7>(q)
1860 + 7 * KernelDefM4<Tscal>::f(q) * sham::pow_constexpr<6>(q);
1861 }
1862
1863 inline static Tscal ddf(Tscal q) {
1864 Tscal t1 = sham::pow_constexpr<2>(1 - q);
1865 Tscal t2 = sham::pow_constexpr<2>(2 - q);
1866 Tscal t3 = sham::pow_constexpr<3>(1 - q);
1867 Tscal t4 = sham::pow_constexpr<3>(2 - q);
1868 Tscal t5 = sham::pow_constexpr<5>(q);
1869 Tscal t6 = sham::pow_constexpr<6>(q);
1870 Tscal t7 = sham::pow_constexpr<7>(q);
1871 if (q < 1) {
1872 return t7 * ((9.0 / 2.0) * q - 3) + 14 * t6 * (3 * t1 - (3.0 / 4.0) * t2)
1873 + 42 * t5 * (-t3 + (1.0 / 4.0) * t4);
1874 } else if (q < 2) {
1875 return -(3.0 / 4.0) * t7 * (2 * q - 4) - (21.0 / 2.0) * t6 * t2
1876 + (21.0 / 2.0) * t5 * t4;
1877 } else
1878 return 0;
1879 }
1880
1881 inline static Tscal phi_tilde_3d(Tscal q) {
1882 Tscal t1 = sham::pow_constexpr<10>(q);
1883 Tscal t2 = sham::pow_constexpr<11>(q);
1884 Tscal t3 = sham::pow_constexpr<12>(q);
1885 Tscal t4 = sham::pow_constexpr<13>(q);
1886 Tscal t5 = sham::pow_constexpr<2>(q);
1887 Tscal t6 = sham::pow_constexpr<3>(q);
1888 Tscal t7 = sham::pow_constexpr<9>(q);
1889 if (q < 1) {
1890 return (1.0 / 25740.0) * shambase::constants::pi<Tscal>
1891 * (t7 * (495 * t6 - 1170 * t5 + 1144) - 53196);
1892 } else if (q < 2) {
1893 return (1.0 / 25740.0) * shambase::constants::pi<Tscal>
1894 * (-165 * t4 + 1170 * t3 - 2808 * t2 + 2288 * t1 - 53248 * q + 36) / q;
1895 } else
1896 return -(2047.0 / 715.0) * shambase::constants::pi<Tscal> / q;
1897 }
1898
1899 inline static Tscal phi_tilde_3d_prime(Tscal q) {
1900 Tscal t1 = sham::pow_constexpr<10>(q);
1901 Tscal t2 = sham::pow_constexpr<11>(q);
1902 Tscal t3 = sham::pow_constexpr<12>(q);
1903 Tscal t4 = sham::pow_constexpr<13>(q);
1904 Tscal t5 = sham::pow_constexpr<2>(q);
1905 Tscal t6 = sham::pow_constexpr<3>(q);
1906 Tscal t7 = sham::pow_constexpr<8>(q);
1907 Tscal t8 = sham::pow_constexpr<9>(q);
1908 if (q < 1) {
1909 return (1.0 / 25740.0) * shambase::constants::pi<Tscal>
1910 * (t8 * (1485 * t5 - 2340 * q) + 9 * t7 * (495 * t6 - 1170 * t5 + 1144));
1911 } else if (q < 2) {
1912 return (1.0 / 25740.0) * shambase::constants::pi<Tscal>
1913 * (-2145 * t3 + 14040 * t2 - 30888 * t1 + 22880 * t8 - 53248) / q
1914 - (1.0 / 25740.0) * shambase::constants::pi<Tscal>
1915 * (-165 * t4 + 1170 * t3 - 2808 * t2 + 2288 * t1 - 53248 * q + 36)
1916 / t5;
1917 } else
1918 return (2047.0 / 715.0) * shambase::constants::pi<Tscal> / t5;
1919 }
1920 };
1921
1922 template<class Tscal>
1924 public:
1925 inline static constexpr Tscal Rkern = 2;
1927 inline static constexpr Tscal hfactd = 1.2;
1928
1930 inline static constexpr Tscal norm_1d = 4.0 / 11.0;
1932 inline static constexpr Tscal norm_2d = (40.0 / 77.0) / shambase::constants::pi<Tscal>;
1934 inline static constexpr Tscal norm_3d = (120.0 / 439.0) / shambase::constants::pi<Tscal>;
1935
1936 inline static Tscal f(Tscal q) {
1937 if (q < 1.) {
1938 return 1.;
1939 } else {
1940 return KernelDefM4<Tscal>::f((q - 1) * 2);
1941 }
1942 }
1943
1944 inline static Tscal df(Tscal q) {
1945 if (q < 1.) {
1946 return 0.;
1947 } else {
1948 return 2 * KernelDefM4<Tscal>::df((q - 1) * 2);
1949 }
1950 }
1951
1952 inline static Tscal ddf(Tscal q) {
1953 if (q < 1.) {
1954 return 0.;
1955 } else {
1956 return 4 * KernelDefM4<Tscal>::ddf((q - 1) * 2);
1957 }
1958 }
1959
1960 inline static Tscal phi_tilde_3d(Tscal q) {
1961 Tscal t1 = sham::pow_constexpr<2>(q);
1962 Tscal t2 = sham::pow_constexpr<3>(q);
1963 Tscal t3 = sham::pow_constexpr<4>(q);
1964 Tscal t4 = sham::pow_constexpr<5>(q);
1965 Tscal t5 = sham::pow_constexpr<6>(q);
1966 if (q < 1) {
1967 return (1.0 / 60.0) * shambase::constants::pi<Tscal> * (40 * t1 - 231);
1968 } else if (q < 3.0 / 2.0) {
1969 return (1.0 / 60.0) * shambase::constants::pi<Tscal>
1970 * (48 * t5 - 288 * t4 + 600 * t3 - 440 * t2 - 39 * q - 72) / q;
1971 } else if (q < 2) {
1972 return (1.0 / 120.0) * shambase::constants::pi<Tscal>
1973 * (-32 * t5 + 288 * t4 - 960 * t3 + 1280 * t2 - 1536 * q + 585) / q;
1974 } else
1975 return -(439.0 / 120.0) * shambase::constants::pi<Tscal> / q;
1976 }
1977
1978 inline static Tscal phi_tilde_3d_prime(Tscal q) {
1979 Tscal t1 = sham::pow_constexpr<2>(q);
1980 Tscal t2 = sham::pow_constexpr<3>(q);
1981 Tscal t3 = sham::pow_constexpr<4>(q);
1982 Tscal t4 = sham::pow_constexpr<5>(q);
1983 Tscal t5 = sham::pow_constexpr<6>(q);
1984 if (q < 1) {
1985 return (4.0 / 3.0) * shambase::constants::pi<Tscal> * q;
1986 } else if (q < 3.0 / 2.0) {
1987 return (1.0 / 60.0) * shambase::constants::pi<Tscal>
1988 * (288 * t4 - 1440 * t3 + 2400 * t2 - 1320 * t1 - 39) / q
1989 - (1.0 / 60.0) * shambase::constants::pi<Tscal>
1990 * (48 * t5 - 288 * t4 + 600 * t3 - 440 * t2 - 39 * q - 72) / t1;
1991 } else if (q < 2) {
1992 return (1.0 / 120.0) * shambase::constants::pi<Tscal>
1993 * (-192 * t4 + 1440 * t3 - 3840 * t2 + 3840 * t1 - 1536) / q
1994 - (1.0 / 120.0) * shambase::constants::pi<Tscal>
1995 * (-32 * t5 + 288 * t4 - 960 * t3 + 1280 * t2 - 1536 * q + 585) / t1;
1996 } else
1997 return (439.0 / 120.0) * shambase::constants::pi<Tscal> / t1;
1998 }
1999 };
2000
2001 template<class Tscal>
2003 public:
2004 inline static constexpr Tscal Rkern = 2;
2006 inline static constexpr Tscal hfactd = 1.2;
2007
2009 inline static constexpr Tscal norm_1d = 8.0 / 27.0;
2011 inline static constexpr Tscal norm_2d = (160.0 / 457.0) / shambase::constants::pi<Tscal>;
2013 inline static constexpr Tscal norm_3d = (320.0 / 2069.0) / shambase::constants::pi<Tscal>;
2014
2015 inline static Tscal f(Tscal q) {
2016 if (q < 1.5) {
2017 return 1.;
2018 } else {
2019 return KernelDefM4<Tscal>::f((q - 1.5) * 4);
2020 }
2021 }
2022
2023 inline static Tscal df(Tscal q) {
2024 if (q < 1.5) {
2025 return 0.;
2026 } else {
2027 return 4 * KernelDefM4<Tscal>::df((q - 1.5) * 4);
2028 }
2029 }
2030
2031 inline static Tscal ddf(Tscal q) {
2032 if (q < 1.5) {
2033 return 0.;
2034 } else {
2035 return 16 * KernelDefM4<Tscal>::ddf((q - 1.5) * 4);
2036 }
2037 }
2038
2039 inline static Tscal phi_tilde_3d(Tscal q) {
2040 Tscal t1 = sham::pow_constexpr<2>(q);
2041 Tscal t2 = sham::pow_constexpr<3>(q);
2042 Tscal t3 = sham::pow_constexpr<4>(q);
2043 Tscal t4 = sham::pow_constexpr<5>(q);
2044 Tscal t5 = sham::pow_constexpr<6>(q);
2045 if (q < 3.0 / 2.0) {
2046 return (1.0 / 240.0) * shambase::constants::pi<Tscal> * (160 * t1 - 1371);
2047 } else if (q < 7.0 / 4.0) {
2048 return (1.0 / 240.0) * shambase::constants::pi<Tscal>
2049 * (1536 * t5 - 11520 * t4 + 31680 * t3 - 34400 * t2 + 25845 * q - 14580) / q;
2050 } else if (q < 2) {
2051 return (1.0 / 960.0) * shambase::constants::pi<Tscal>
2052 * (-2048 * t5 + 18432 * t4 - 61440 * t3 + 81920 * t2 - 98304 * q + 59329)
2053 / q;
2054 } else
2055 return -(2069.0 / 320.0) * shambase::constants::pi<Tscal> / q;
2056 }
2057
2058 inline static Tscal phi_tilde_3d_prime(Tscal q) {
2059 Tscal t1 = sham::pow_constexpr<2>(q);
2060 Tscal t2 = sham::pow_constexpr<3>(q);
2061 Tscal t3 = sham::pow_constexpr<4>(q);
2062 Tscal t4 = sham::pow_constexpr<5>(q);
2063 Tscal t5 = sham::pow_constexpr<6>(q);
2064 if (q < 3.0 / 2.0) {
2065 return (4.0 / 3.0) * shambase::constants::pi<Tscal> * q;
2066 } else if (q < 7.0 / 4.0) {
2067 return (1.0 / 240.0) * shambase::constants::pi<Tscal>
2068 * (9216 * t4 - 57600 * t3 + 126720 * t2 - 103200 * t1 + 25845) / q
2069 - (1.0 / 240.0) * shambase::constants::pi<Tscal>
2070 * (1536 * t5 - 11520 * t4 + 31680 * t3 - 34400 * t2 + 25845 * q
2071 - 14580)
2072 / t1;
2073 } else if (q < 2) {
2074 return (1.0 / 960.0) * shambase::constants::pi<Tscal>
2075 * (-12288 * t4 + 92160 * t3 - 245760 * t2 + 245760 * t1 - 98304) / q
2076 - (1.0 / 960.0) * shambase::constants::pi<Tscal>
2077 * (-2048 * t5 + 18432 * t4 - 61440 * t3 + 81920 * t2 - 98304 * q
2078 + 59329)
2079 / t1;
2080 } else
2081 return (2069.0 / 320.0) * shambase::constants::pi<Tscal> / t1;
2082 }
2083 };
2084
2085 template<class Tscal>
2087 public:
2088 inline static constexpr Tscal Rkern = 2;
2090 inline static constexpr Tscal hfactd = 1.2;
2091
2093 inline static constexpr Tscal norm_1d = 16.0 / 59.0;
2095 inline static constexpr Tscal norm_2d = (640.0 / 2177.0) / shambase::constants::pi<Tscal>;
2097 inline static constexpr Tscal norm_3d = (7680.0 / 64303.0) / shambase::constants::pi<Tscal>;
2098
2099 inline static Tscal f(Tscal q) {
2100 if (q < 1.75) {
2101 return 1.;
2102 } else {
2103 return KernelDefM4<Tscal>::f((q - 1.75) * 8);
2104 }
2105 }
2106
2107 inline static Tscal df(Tscal q) {
2108 if (q < 1.75) {
2109 return 0.;
2110 } else {
2111 return 8 * KernelDefM4<Tscal>::df((q - 1.75) * 8);
2112 }
2113 }
2114
2115 inline static Tscal ddf(Tscal q) {
2116 if (q < 1.75) {
2117 return 0.;
2118 } else {
2119 return 64 * KernelDefM4<Tscal>::ddf((q - 1.75) * 8);
2120 }
2121 }
2122
2123 inline static Tscal phi_tilde_3d(Tscal q) {
2124 Tscal t1 = sham::pow_constexpr<2>(q);
2125 Tscal t2 = sham::pow_constexpr<3>(q);
2126 Tscal t3 = sham::pow_constexpr<4>(q);
2127 Tscal t4 = sham::pow_constexpr<5>(q);
2128 Tscal t5 = sham::pow_constexpr<6>(q);
2129 if (q < 7.0 / 4.0) {
2130 return (1.0 / 960.0) * shambase::constants::pi<Tscal> * (640 * t1 - 6531);
2131 } else if (q < 15.0 / 8.0) {
2132 return (1.0 / 960.0) * shambase::constants::pi<Tscal>
2133 * (49152 * t5 - 405504 * t4 + 1236480 * t3 - 1504640 * t2 + 1491693 * q
2134 - 907578)
2135 / q;
2136 } else if (q < 2) {
2137 return (1.0 / 7680.0) * shambase::constants::pi<Tscal>
2138 * (-131072 * t5 + 1179648 * t4 - 3932160 * t3 + 5242880 * t2 - 6291456 * q
2139 + 4130001)
2140 / q;
2141 } else
2142 return -(64303.0 / 7680.0) * shambase::constants::pi<Tscal> / q;
2143 }
2144
2145 inline static Tscal phi_tilde_3d_prime(Tscal q) {
2146 Tscal t1 = sham::pow_constexpr<2>(q);
2147 Tscal t2 = sham::pow_constexpr<3>(q);
2148 Tscal t3 = sham::pow_constexpr<4>(q);
2149 Tscal t4 = sham::pow_constexpr<5>(q);
2150 Tscal t5 = sham::pow_constexpr<6>(q);
2151 if (q < 7.0 / 4.0) {
2152 return (4.0 / 3.0) * shambase::constants::pi<Tscal> * q;
2153 } else if (q < 15.0 / 8.0) {
2154 return (1.0 / 960.0) * shambase::constants::pi<Tscal>
2155 * (294912 * t4 - 2027520 * t3 + 4945920 * t2 - 4513920 * t1 + 1491693)
2156 / q
2157 - (1.0 / 960.0) * shambase::constants::pi<Tscal>
2158 * (49152 * t5 - 405504 * t4 + 1236480 * t3 - 1504640 * t2 + 1491693 * q
2159 - 907578)
2160 / t1;
2161 } else if (q < 2) {
2162 return (1.0 / 7680.0) * shambase::constants::pi<Tscal>
2163 * (-786432 * t4 + 5898240 * t3 - 15728640 * t2 + 15728640 * t1 - 6291456)
2164 / q
2165 - (1.0 / 7680.0) * shambase::constants::pi<Tscal>
2166 * (-131072 * t5 + 1179648 * t4 - 3932160 * t3 + 5242880 * t2
2167 - 6291456 * q + 4130001)
2168 / t1;
2169 } else
2170 return (64303.0 / 7680.0) * shambase::constants::pi<Tscal> / t1;
2171 }
2172 };
2173
2174 template<class Tscal>
2176 public:
2177 inline static constexpr Tscal Rkern = 2;
2179 inline static constexpr Tscal hfactd = 1.2;
2180
2182 inline static constexpr Tscal norm_1d = 32.0 / 123.0;
2184 inline static constexpr Tscal norm_2d = (2560.0 / 9457.0) / shambase::constants::pi<Tscal>;
2186 inline static constexpr Tscal norm_3d = (4096.0 / 38785.0) / shambase::constants::pi<Tscal>;
2187
2188 inline static Tscal f(Tscal q) {
2189 if (q < 1.875) {
2190 return 1.;
2191 } else {
2192 return KernelDefM4<Tscal>::f((q - 1.875) * 16);
2193 }
2194 }
2195
2196 inline static Tscal df(Tscal q) {
2197 if (q < 1.875) {
2198 return 0.;
2199 } else {
2200 return 16 * KernelDefM4<Tscal>::df((q - 1.875) * 16);
2201 }
2202 }
2203
2204 inline static Tscal ddf(Tscal q) {
2205 if (q < 1.875) {
2206 return 0.;
2207 } else {
2208 return 256 * KernelDefM4<Tscal>::ddf((q - 1.875) * 16);
2209 }
2210 }
2211
2212 inline static Tscal phi_tilde_3d(Tscal q) {
2213 Tscal t1 = sham::pow_constexpr<2>(q);
2214 Tscal t2 = sham::pow_constexpr<3>(q);
2215 Tscal t3 = sham::pow_constexpr<4>(q);
2216 Tscal t4 = sham::pow_constexpr<5>(q);
2217 Tscal t5 = sham::pow_constexpr<6>(q);
2218 if (q < 15.0 / 8.0) {
2219 return (1.0 / 3840.0) * shambase::constants::pi<Tscal> * (2560 * t1 - 28371);
2220 } else if (q < 31.0 / 16.0) {
2221 return (1.0 / 3840.0) * shambase::constants::pi<Tscal>
2222 * (1572864 * t5 - 13565952 * t4 + 43315200 * t3 - 55293440 * t2
2223 + 60721629 * q - 38728125)
2224 / q;
2225 } else if (q < 2) {
2226 return (1.0 / 61440.0) * shambase::constants::pi<Tscal>
2227 * (-8388608 * t5 + 75497472 * t4 - 251658240 * t3 + 335544320 * t2
2228 - 402653184 * q + 267853681)
2229 / q;
2230 } else
2231 return -(38785.0 / 4096.0) * shambase::constants::pi<Tscal> / q;
2232 }
2233
2234 inline static Tscal phi_tilde_3d_prime(Tscal q) {
2235 Tscal t1 = sham::pow_constexpr<2>(q);
2236 Tscal t2 = sham::pow_constexpr<3>(q);
2237 Tscal t3 = sham::pow_constexpr<4>(q);
2238 Tscal t4 = sham::pow_constexpr<5>(q);
2239 Tscal t5 = sham::pow_constexpr<6>(q);
2240 if (q < 15.0 / 8.0) {
2241 return (4.0 / 3.0) * shambase::constants::pi<Tscal> * q;
2242 } else if (q < 31.0 / 16.0) {
2243 return (1.0 / 3840.0) * shambase::constants::pi<Tscal>
2244 * (9437184 * t4 - 67829760 * t3 + 173260800 * t2 - 165880320 * t1
2245 + 60721629)
2246 / q
2247 - (1.0 / 3840.0) * shambase::constants::pi<Tscal>
2248 * (1572864 * t5 - 13565952 * t4 + 43315200 * t3 - 55293440 * t2
2249 + 60721629 * q - 38728125)
2250 / t1;
2251 } else if (q < 2) {
2252 return (1.0 / 61440.0) * shambase::constants::pi<Tscal>
2253 * (-50331648 * t4 + 377487360 * t3 - 1006632960 * t2 + 1006632960 * t1
2254 - 402653184)
2255 / q
2256 - (1.0 / 61440.0) * shambase::constants::pi<Tscal>
2257 * (-8388608 * t5 + 75497472 * t4 - 251658240 * t3 + 335544320 * t2
2258 - 402653184 * q + 267853681)
2259 / t1;
2260 } else
2261 return (38785.0 / 4096.0) * shambase::constants::pi<Tscal> / t1;
2262 }
2263 };
2264} // namespace shammath::details
2265
2266namespace shammath {
2267
2268 // Type trait to detect if BaseKernel has phi_tilde_3d method
2269 template<typename T, typename Tscal, typename = void>
2270 struct has_phi_tilde_3d : std::false_type {};
2271
2272 template<typename T, typename Tscal>
2273 struct has_phi_tilde_3d<T, Tscal, std::void_t<decltype(T::phi_tilde_3d(std::declval<Tscal>()))>>
2274 : std::true_type {};
2275
2276 // Type trait to detect if BaseKernel has phi_tilde_3d_prime method
2277 template<typename T, typename Tscal, typename = void>
2278 struct has_phi_tilde_3d_prime : std::false_type {};
2279
2280 template<typename T, typename Tscal>
2282 T,
2283 Tscal,
2284 std::void_t<decltype(T::phi_tilde_3d_prime(std::declval<Tscal>()))>> : std::true_type {};
2285
2286 template<class Tscal_, class BaseKernel>
2288 public:
2289 using Generator = BaseKernel;
2290 using Tscal = Tscal_;
2291 inline static constexpr Tscal Rkern = BaseKernel::Rkern;
2292 inline static constexpr Tscal hfactd
2293 = BaseKernel::hfactd;
2294
2303 inline static Tscal f(Tscal q) { return BaseKernel::f(q); }
2304
2311 inline static Tscal df(Tscal q) { return BaseKernel::df(q); }
2312
2313 inline static Tscal ddf(Tscal q) { return BaseKernel::ddf(q); }
2314
2315 inline static Tscal W_1d(Tscal r, Tscal h) { return BaseKernel::norm_1d * f(r / h) / (h); }
2316
2317 inline static Tscal W_2d(Tscal r, Tscal h) {
2318 return BaseKernel::norm_2d * f(r / h) / (h * h);
2319 }
2320
2330 inline static Tscal W_3d(Tscal r, Tscal h) {
2331 return BaseKernel::norm_3d * f(r / h) / (h * h * h);
2332 }
2333
2334 inline static Tscal dW_3d(Tscal r, Tscal h) {
2335 return BaseKernel::norm_3d * df(r / h) / (h * h * h * h);
2336 }
2337
2338 inline static Tscal ddW_3d(Tscal r, Tscal h) {
2339 return BaseKernel::norm_3d * ddf(r / h) / (h * h * h * h * h);
2340 }
2341
2342 inline static Tscal dhW_3d(Tscal r, Tscal h) {
2343 return -(BaseKernel::norm_3d) * (3 * f(r / h) + (r / h) * df(r / h)) / (h * h * h * h);
2344 }
2345
2363 template<int np>
2364 inline static Tscal f3d_integ_z(Tscal x) {
2365 constexpr Tscal step = Rkern / np;
2366
2367 Tscal xx = x * x;
2368
2369 Tscal acc = f(sycl::fabs(x)); // z = 0
2370 for (int k = 1; k < np; k++) {
2371 Tscal z = k * step;
2372 // slightly faster than z*z + xx
2373 acc += 2 * f(sqrt(sycl::fma(z, z, xx)));
2374 }
2375 return acc * step;
2376 }
2377
2378 inline static Tscal f3d_integ_z(Tscal x, int np = 32) {
2379 return integ_riemann_sum<Tscal>(-Rkern, Rkern, Rkern / np, [&](Tscal z) {
2380 return f(sqrt(x * x + z * z));
2381 });
2382 }
2383
2384 inline static Tscal Y_3d(Tscal r, Tscal h, int np) {
2385 return BaseKernel::norm_3d * f3d_integ_z(r / h, np) / (h * h);
2386 }
2387
2388 template<int np>
2389 inline static Tscal Y_3d(Tscal r, Tscal h) {
2390 return BaseKernel::norm_3d * f3d_integ_z<np>(r / h) / (h * h);
2391 }
2392
2393 static constexpr bool has_3d_phi_soft
2394 = ::shammath::has_phi_tilde_3d<BaseKernel, Tscal>::value;
2395
2396 inline static Tscal phi_tilde_3d(Tscal q) {
2397 if constexpr (has_3d_phi_soft) {
2398 return BaseKernel::phi_tilde_3d(q);
2399 } else {
2400 return std::numeric_limits<Tscal>::quiet_NaN();
2401 }
2402 }
2403
2404 static constexpr bool has_3d_phi_soft_prime
2405 = ::shammath::has_phi_tilde_3d_prime<BaseKernel, Tscal>::value;
2406
2407 inline static Tscal phi_tilde_3d_prime(Tscal q) {
2408 if constexpr (has_3d_phi_soft_prime) {
2409 return BaseKernel::phi_tilde_3d_prime(q);
2410 } else {
2411 return std::numeric_limits<Tscal>::quiet_NaN();
2412 }
2413 }
2414
2415 inline static Tscal phi_3D(Tscal r, Tscal h) {
2416 return BaseKernel::norm_3d * phi_tilde_3d(r / h) / h;
2417 }
2418
2419 inline static Tscal phi_3D_prime(Tscal r, Tscal h) {
2420 return BaseKernel::norm_3d * phi_tilde_3d_prime(r / h) / (h * h);
2421 }
2422 };
2423
2430 template<class flt_type>
2432
2439 template<class flt_type>
2441
2448 template<class flt_type>
2450
2457 template<class flt_type>
2459
2466 template<class flt_type>
2468
2475 template<class flt_type>
2477
2484 template<class flt_type>
2486
2493 template<class flt_type>
2495
2502 template<class flt_type>
2504
2511 template<class flt_type>
2513
2519 template<class flt_type>
2521
2527 template<class flt_type>
2529
2536 template<class flt_type>
2538
2545 template<class flt_type>
2547
2554 template<class flt_type>
2556
2563 template<class flt_type>
2565
2572 template<class flt_type>
2574
2581 template<class flt_type>
2583
2590 template<class flt_type>
2592
2599 template<class flt_type>
2601
2602} // namespace shammath
2603
2604namespace shambase {
2605
2606 template<class flt_type>
2607 struct TypeNameInfo<shammath::M4<flt_type>> {
2608 inline static const std::string name = "M4<" + get_type_name<flt_type>() + ">";
2609 };
2610 template<class flt_type>
2611 struct TypeNameInfo<shammath::M5<flt_type>> {
2612 inline static const std::string name = "M5<" + get_type_name<flt_type>() + ">";
2613 };
2614 template<class flt_type>
2615 struct TypeNameInfo<shammath::M6<flt_type>> {
2616 inline static const std::string name = "M6<" + get_type_name<flt_type>() + ">";
2617 };
2618 template<class flt_type>
2619 struct TypeNameInfo<shammath::M7<flt_type>> {
2620 inline static const std::string name = "M7<" + get_type_name<flt_type>() + ">";
2621 };
2622 template<class flt_type>
2623 struct TypeNameInfo<shammath::M8<flt_type>> {
2624 inline static const std::string name = "M8<" + get_type_name<flt_type>() + ">";
2625 };
2626 template<class flt_type>
2627 struct TypeNameInfo<shammath::M9<flt_type>> {
2628 inline static const std::string name = "M9<" + get_type_name<flt_type>() + ">";
2629 };
2630 template<class flt_type>
2631 struct TypeNameInfo<shammath::M10<flt_type>> {
2632 inline static const std::string name = "M10<" + get_type_name<flt_type>() + ">";
2633 };
2634
2635 template<class flt_type>
2636 struct TypeNameInfo<shammath::C2<flt_type>> {
2637 inline static const std::string name = "C2<" + get_type_name<flt_type>() + ">";
2638 };
2639 template<class flt_type>
2640 struct TypeNameInfo<shammath::C4<flt_type>> {
2641 inline static const std::string name = "C4<" + get_type_name<flt_type>() + ">";
2642 };
2643 template<class flt_type>
2644 struct TypeNameInfo<shammath::C6<flt_type>> {
2645 inline static const std::string name = "C6<" + get_type_name<flt_type>() + ">";
2646 };
2647
2648 template<class flt_type>
2649 struct TypeNameInfo<shammath::TGauss3<flt_type>> {
2650 inline static const std::string name = "TGauss3<" + get_type_name<flt_type>() + ">";
2651 };
2652
2653 template<class flt_type>
2654 struct TypeNameInfo<shammath::TGauss5<flt_type>> {
2655 inline static const std::string name = "TGauss5<" + get_type_name<flt_type>() + ">";
2656 };
2657
2658 template<class flt_type>
2659 struct TypeNameInfo<shammath::M4DH<flt_type>> {
2660 inline static const std::string name = "M4DH<" + get_type_name<flt_type>() + ">";
2661 };
2662
2663 template<class flt_type>
2664 struct TypeNameInfo<shammath::M4DH3<flt_type>> {
2665 inline static const std::string name = "M4DH3<" + get_type_name<flt_type>() + ">";
2666 };
2667
2668 template<class flt_type>
2669 struct TypeNameInfo<shammath::M4DH5<flt_type>> {
2670 inline static const std::string name = "M4DH5<" + get_type_name<flt_type>() + ">";
2671 };
2672
2673 template<class flt_type>
2674 struct TypeNameInfo<shammath::M4DH7<flt_type>> {
2675 inline static const std::string name = "M4DH7<" + get_type_name<flt_type>() + ">";
2676 };
2677
2678 template<class flt_type>
2679 struct TypeNameInfo<shammath::M4Shift2<flt_type>> {
2680 inline static const std::string name = "M4Shift2<" + get_type_name<flt_type>() + ">";
2681 };
2682
2683 template<class flt_type>
2684 struct TypeNameInfo<shammath::M4Shift4<flt_type>> {
2685 inline static const std::string name = "M4Shift4<" + get_type_name<flt_type>() + ">";
2686 };
2687
2688 template<class flt_type>
2689 struct TypeNameInfo<shammath::M4Shift8<flt_type>> {
2690 inline static const std::string name = "M4Shift8<" + get_type_name<flt_type>() + ">";
2691 };
2692
2693 template<class flt_type>
2694 struct TypeNameInfo<shammath::M4Shift16<flt_type>> {
2695 inline static const std::string name = "M4Shift16<" + get_type_name<flt_type>() + ">";
2696 };
2697
2698} // namespace shambase
static Tscal W_3d(Tscal r, Tscal h)
compute the normed & resized version of the kernel :
static Tscal f(Tscal q)
the base function for this SPH kernel
static Tscal f3d_integ_z(Tscal x)
Riemann sum of along z over the kernel support.
static Tscal df(Tscal q)
derivative of M4::f
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal Rkern
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal Rkern
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal Rkern
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal Rkern
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal Rkern
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal Rkern
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal Rkern
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal Rkern
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal Rkern
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal Rkern
static constexpr Tscal hfactd
default hfact to be used for this kernel
Truncated Gaussian kernel with compact support R=3h.
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal norm_2d
2D norm of the kernel (accounts for truncation at q=3)
static constexpr Tscal hfactd
default hfact to be used for this kernel
static constexpr Tscal Rkern
Compact support radius of the kernel.
Truncated Gaussian kernel with compact support R=5h.
static constexpr Tscal norm_2d
2D norm of the kernel
static constexpr Tscal norm_1d
1D norm of the kernel
static constexpr Tscal Rkern
Compact support radius of the kernel.
static constexpr Tscal norm_3d
3D norm of the kernel
static constexpr Tscal hfactd
default hfact to be used for this kernel
constexpr Unit h
Planck constant.
Class holding the value of numerous constants generated from the following source.
constexpr T pow_constexpr(T a) noexcept
generalized pow constexpr
Definition math.hpp:724
namespace for basic c++ utilities
namespace for math utility
Definition AABB.hpp:26
SPHKernelGen< flt_type, details::KernelDefTGauss5< flt_type > > TGauss5
Truncated Gaussian kernel with compact support R=5h.
SPHKernelGen< flt_type, details::KernelDefM4Shift8< flt_type > > M4Shift8
The M4Shift8 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefTGauss3< flt_type > > TGauss3
Truncated Gaussian kernel with compact support R=3h.
SPHKernelGen< flt_type, details::KernelDefM4< flt_type > > M4
The M4 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM10< flt_type > > M10
The M8 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM4Shift2< flt_type > > M4Shift2
The M4Shift2 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefC4< flt_type > > C4
The C4 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM4Shift4< flt_type > > M4Shift4
The M4Shift4 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM4DoubleHump3< flt_type > > M4DH3
The M4DoubleHump3 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM9< flt_type > > M9
The M8 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefC6< flt_type > > C6
The C6 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM6< flt_type > > M6
The M6 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM4Shift16< flt_type > > M4Shift16
The M4Shift16 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM4DoubleHump5< flt_type > > M4DH5
The M4DoubleHump5 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM4DoubleHump< flt_type > > M4DH
The M4DoubleHump SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM7< flt_type > > M7
The M7 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM8< flt_type > > M8
The M8 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM5< flt_type > > M5
The M5 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefM4DoubleHump7< flt_type > > M4DH7
The M4DoubleHump7 SPH kernel.
SPHKernelGen< flt_type, details::KernelDefC2< flt_type > > C2
The C2 SPH kernel.