/__w/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration/vacuum/integrator_p2_4d_3ang.hh Source File#

DiFfRG: /__w/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration/vacuum/integrator_p2_4d_3ang.hh Source File
DiFfRG
Discretization Framework for functional Renormalization Group flows
integrator_p2_4d_3ang.hh
Go to the documentation of this file.
1#pragma once
2
3// DiFfRG
6
7// standard libraries
8#include <array>
9
10namespace DiFfRG
11{
12 namespace internal
13 {
14 template <typename NT, typename KERNEL> class Transform_p2_4D_3ang
15 {
16 public:
17 using ctype = typename get_type::ctype<NT>;
18
19 static constexpr ctype int_prefactor = powr<-4>((ctype)2 * M_PI); // fourier factor
20
21 template <typename... T>
22 static KOKKOS_FORCEINLINE_FUNCTION NT kernel(const ctype q, const ctype cos1, const ctype cos2, const ctype phi,
23 const T &...t)
24 requires provides_kernel<NT, KERNEL, ctype, 4, T...>
25 {
26 using namespace DiFfRG::compute;
27
28 const ctype int_element = powr<4 - 1>(q); // from p integral
29
30 // sqrt(1. - powr<2>(cos1)); // the cos1 integral jacobian is already included
31 // in the chebyshev2 quadrature
32
33 const NT result = KERNEL::kernel(q, cos1, cos2, phi, t...);
34
35 return int_prefactor * int_element * result;
36 }
37
38 template <typename... T>
39 static KOKKOS_FORCEINLINE_FUNCTION NT constant(const T &...t)
40 requires provides_constant<NT, KERNEL, T...>
41 {
42 return KERNEL::constant(t...);
43 }
44 };
45
46 } // namespace internal
47
61 template <int dim, typename NT, typename KERNEL, typename ExecutionSpace>
62 requires(dim == 4)
64 : public QuadratureIntegrator<4, NT, internal::Transform_p2_4D_3ang<NT, KERNEL>, ExecutionSpace>
65 {
67
68 public:
72 using ctype = typename get_type::ctype<NT>;
76 using execution_space = ExecutionSpace;
77
78 Integrator_p2_4D_3ang(QuadratureProvider &quadrature_provider, const JSONValue &json)
80 : Integrator_p2_4D_3ang(quadrature_provider,
81 internal::make_int_grid<4, NT>(json, {"x_order", "cos1_order", "cos2_order", "phi_order"}),
82 optimize_x_extent<typename KERNEL::Regulator>(json))
83 {
84 }
85
86 Integrator_p2_4D_3ang(QuadratureProvider &quadrature_provider, const std::array<size_t, 4> grid_size,
87 ctype x_extent = 2.)
88 // The azimuthal angle phi in [0,2pi) has a smooth 2pi-periodic integrand; the periodic trapezoidal
89 // rule integrates it with spectral (exponential) accuracy, unlike Gauss-Legendre.
90 : Base(quadrature_provider, grid_size, {0, 0, -1, 0}, {std::sqrt(x_extent), 1, 1, 2 * M_PI},
93 x_extent(x_extent), k(1.)
94 {
95 }
96
97 void set_x_extent(ctype x_extent)
98 {
99 this->x_extent = x_extent;
100 Base::set_grid_extents({0, 0, -1, 0}, {std::sqrt(x_extent) * k, 1, 1, 2 * M_PI});
101 }
102
103 void set_k(ctype k)
104 {
105 this->k = k;
106 Base::set_grid_extents({0, 0, -1, 0}, {std::sqrt(x_extent) * k, 1, 1, 2 * M_PI});
107 }
108
109 private:
112 };
113} // namespace DiFfRG
Integrator_p2_4D_3ang integrates a kernel depending on the radial momentum and two angles on and o...
Definition integrator_p2_4d_3ang.hh:65
void set_k(ctype k)
Definition integrator_p2_4d_3ang.hh:103
ctype k
Definition integrator_p2_4d_3ang.hh:111
Integrator_p2_4D_3ang(QuadratureProvider &quadrature_provider, const std::array< size_t, 4 > grid_size, ctype x_extent=2.)
Definition integrator_p2_4d_3ang.hh:86
void set_x_extent(ctype x_extent)
Definition integrator_p2_4d_3ang.hh:97
ctype x_extent
Definition integrator_p2_4d_3ang.hh:110
typename get_type::ctype< NT > ctype
Numerical type to be used for integration tasks e.g. the argument or possible jacobians.
Definition integrator_p2_4d_3ang.hh:72
Integrator_p2_4D_3ang(QuadratureProvider &quadrature_provider, const JSONValue &json)
Definition integrator_p2_4d_3ang.hh:78
ExecutionSpace execution_space
Execution space to be used for the integration, e.g. GPU_exec, TBB_exec.
Definition integrator_p2_4d_3ang.hh:76
A wrapper around the boost json value class.
Definition json.hh:19
This class performs numerical integration over a d-dimensional hypercube using quadrature rules.
Definition quadrature_integrator.hh:27
A class that provides quadrature points and weights, in host and device memory. The quadrature points...
Definition quadrature_provider.hh:137
Definition integrator_p2_4d_3ang.hh:15
typename get_type::ctype< NT > ctype
Definition integrator_p2_4d_3ang.hh:17
static constexpr ctype int_prefactor
Definition integrator_p2_4d_3ang.hh:19
static KOKKOS_FORCEINLINE_FUNCTION NT constant(const T &...t)
Definition integrator_p2_4d_3ang.hh:39
static KOKKOS_FORCEINLINE_FUNCTION NT kernel(const ctype q, const ctype cos1, const ctype cos2, const ctype phi, const T &...t)
Definition integrator_p2_4d_3ang.hh:22
Definition abstract_integrator.hh:46
Definition abstract_integrator.hh:42
Definition abstract_integrator.hh:28
Definition math.hh:220
typename internal::_ctype< CT >::value ctype
Definition types.hh:134
Definition complex_math.hh:10
constexpr KOKKOS_INLINE_FUNCTION NumberType powr(const NumberType x)
A compile-time evaluatable power function for whole number exponents.
Definition math.hh:41
@ trapezoidal
Definition quadrature.hh:45
@ chebyshev2
Definition quadrature.hh:45
@ legendre
Definition quadrature.hh:45