/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration/finiteT/integrator_fT_p2_4d_2ang.hh Source File#

DiFfRG: /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration/finiteT/integrator_fT_p2_4d_2ang.hh Source File
DiFfRG
integrator_fT_p2_4d_2ang.hh
Go to the documentation of this file.
1#pragma once
2
3// DiFfRG
6
7namespace DiFfRG
8{
9 namespace internal
10 {
11 template <typename NT, typename KERNEL> class Transform_fT_p2_4D_2ang
12 {
13 public:
14 using ctype = typename get_type::ctype<NT>;
15
16 static constexpr ctype int_prefactor = powr<-3>((ctype)2 * M_PI); // fourier factor
17
18 template <typename... T>
19 static KOKKOS_FORCEINLINE_FUNCTION NT kernel(const ctype q, const ctype cos1, const ctype phi, const ctype q0,
20 const T &...t)
21 {
22 using namespace DiFfRG::compute;
23
24 const ctype int_element = powr<3 - 1>(q); // from p integral
25
26 const NT result = KERNEL::kernel(q, cos1, phi, q0, t...);
27
28 return int_prefactor * int_element * result;
29 }
30
31 template <typename... T> static KOKKOS_FORCEINLINE_FUNCTION NT constant(const T &...t)
32 {
33 return KERNEL::constant(t...);
34 }
35 };
36 } // namespace internal
37
38 template <int dim, typename NT, typename KERNEL, typename ExecutionSpace>
39 requires(dim == 4)
41 : public QuadratureIntegrator_fT<4, NT, internal::Transform_fT_p2_4D_2ang<NT, KERNEL>, ExecutionSpace>
42 {
44
45 public:
49 using ctype = typename get_type::ctype<NT>;
53 using execution_space = ExecutionSpace;
54
55 Integrator_fT_p2_4D_2ang(QuadratureProvider &quadrature_provider, const JSONValue &json)
57 : Integrator_fT_p2_4D_2ang(quadrature_provider,
58 internal::make_int_grid<3, NT>(json, {"x_order", "cos1_order", "phi_order"}),
59 optimize_x_extent<typename KERNEL::Regulator>(json), json.get_double("T", 1.0))
60 {
61 }
62
63 Integrator_fT_p2_4D_2ang(QuadratureProvider &quadrature_provider, const std::array<size_t, 3> grid_size,
64 ctype x_extent = 2., ctype T = 1, ctype typical_E = 1)
65 : Base(quadrature_provider, grid_size, {0, -1, 0}, {std::sqrt(x_extent), 1, 2 * M_PI},
67 x_extent(x_extent), k(1.)
68 {
69 }
70
71 void set_x_extent(ctype x_extent)
72 {
73 this->x_extent = x_extent;
74 Base::set_grid_extents({0, -1, 0}, {std::sqrt(x_extent) * k, 1, 2 * M_PI});
75 }
76
77 void set_k(ctype k)
78 {
79 this->k = k;
80 Base::set_grid_extents({0, -1, 0}, {std::sqrt(x_extent) * k, 1, 2 * M_PI});
81 Base::set_typical_E(k); // update typical energy
82 }
83
84 void set_typical_E(ctype typical_E) { Base::set_typical_E(typical_E); }
85
86 private:
89 };
90} // namespace DiFfRG
Definition integrator_fT_p2_4d_2ang.hh:42
ctype x_extent
Definition integrator_fT_p2_4d_2ang.hh:87
Integrator_fT_p2_4D_2ang(QuadratureProvider &quadrature_provider, const JSONValue &json)
Definition integrator_fT_p2_4d_2ang.hh:55
typename get_type::ctype< NT > ctype
Numerical type to be used for integration tasks e.g. the argument or possible jacobians.
Definition integrator_fT_p2_4d_2ang.hh:49
ExecutionSpace execution_space
Execution space to be used for the integration, e.g. GPU_exec, TBB_exec.
Definition integrator_fT_p2_4d_2ang.hh:53
void set_x_extent(ctype x_extent)
Definition integrator_fT_p2_4d_2ang.hh:71
Integrator_fT_p2_4D_2ang(QuadratureProvider &quadrature_provider, const std::array< size_t, 3 > grid_size, ctype x_extent=2., ctype T=1, ctype typical_E=1)
Definition integrator_fT_p2_4d_2ang.hh:63
ctype k
Definition integrator_fT_p2_4d_2ang.hh:88
void set_typical_E(ctype typical_E)
Definition integrator_fT_p2_4d_2ang.hh:84
void set_k(ctype k)
Definition integrator_fT_p2_4d_2ang.hh:77
A wrapper around the boost json value class.
Definition json.hh:19
Definition quadrature_integrator_fT.hh:19
A class that provides quadrature points and weights, in host and device memory. The quadrature points...
Definition quadrature_provider.hh:137
Definition integrator_fT_p2_4d_2ang.hh:12
static KOKKOS_FORCEINLINE_FUNCTION NT constant(const T &...t)
Definition integrator_fT_p2_4d_2ang.hh:31
static constexpr ctype int_prefactor
Definition integrator_fT_p2_4d_2ang.hh:16
static KOKKOS_FORCEINLINE_FUNCTION NT kernel(const ctype q, const ctype cos1, const ctype phi, const ctype q0, const T &...t)
Definition integrator_fT_p2_4d_2ang.hh:19
typename get_type::ctype< NT > ctype
Definition integrator_fT_p2_4d_2ang.hh:14
Definition abstract_integrator.hh:28
Definition math.hh:220
typename internal::_ctype< CT >::value ctype
Definition types.hh:134
std::array< size_t, dim > make_int_grid(const JSONValue &json, const std::array< std::string, dim > &names)
Definition abstract_integrator.hh:13
Definition complex_math.hh:10
double optimize_x_extent(const JSONValue &json)
Definition optimize.hh:8
@ legendre
Definition quadrature.hh:45