/__w/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration/finiteT/integrator_fT_p2_1ang.hh Source File#

DiFfRG: /__w/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration/finiteT/integrator_fT_p2_1ang.hh Source File
DiFfRG
Discretization Framework for functional Renormalization Group flows
integrator_fT_p2_1ang.hh
Go to the documentation of this file.
1#pragma once
2
3// DiFfRG
6
7namespace DiFfRG
8{
9 namespace internal
10 {
11 template <int dim, typename NT, typename KERNEL> class Transform_fT_p2_1ang
12 {
13 public:
14 static constexpr int sdim = dim - 1; // spatial dimension
15 using ctype = typename get_type::ctype<NT>;
16
17 // The polar angle (spatial loop vs. external momentum) of a 2-point loop lives in the sdim
18 // spatial dimensions and carries the zonal measure (1-c^2)^{(sdim-3)/2} dc, supplied by the
19 // Gauss-Jacobi(alpha=beta=(sdim-3)/2) angular quadrature (see the class below). The remaining
20 // (sdim-2)-sphere gives S_{sdim-1} = S_d_prec(sdim-1).
21 static constexpr ctype int_prefactor = S_d_prec<ctype>(sdim - 1) // remaining solid angle after the polar angle
22 / powr<sdim>(2 * (ctype)M_PI); // fourier factor
23
24 template <typename... T>
25 static KOKKOS_FORCEINLINE_FUNCTION NT kernel(const ctype q, const ctype cos, const ctype q0, const T &...t)
26 {
27 using namespace DiFfRG::compute;
28
29 const ctype int_element = powr<sdim - 1>(q); // from p integral
30 const NT result = KERNEL::kernel(q, cos, q0, t...);
31
32 return int_prefactor * int_element * result;
33 }
34
35 template <typename... T> static KOKKOS_FORCEINLINE_FUNCTION NT constant(const T &...t)
36 {
37 return KERNEL::constant(t...);
38 }
39 };
40
41 } // namespace internal
42
43 template <int dim, typename NT, typename KERNEL, typename ExecutionSpace>
44 requires(dim >= 3)
46 : public QuadratureIntegrator_fT<3, NT, internal::Transform_fT_p2_1ang<dim, NT, KERNEL>, ExecutionSpace>
47 {
49
50 static constexpr int sdim = dim - 1; // spatial dimension
51
52 // Gauss-Jacobi quadrature on [-1,1] with weight (1-c^2)^{(sdim-3)/2} for the spatial polar angle.
53 // Dimension-agnostic: reduces to Chebyshev-1 (sdim=2), Legendre (sdim=3), Chebyshev-2 (sdim=4), ...
55 {
57 t.a = static_cast<double>(-1);
58 t.b = static_cast<double>(1);
59 t.alpha = (static_cast<double>(sdim) - 3.) / 2.;
60 t.beta = t.alpha;
61 return t;
62 }
63
64 public:
68 using ctype = typename get_type::ctype<NT>;
69 using execution_space = ExecutionSpace;
70
71 Integrator_fT_p2_1ang(QuadratureProvider &quadrature_provider, const JSONValue &json)
73 : Integrator_fT_p2_1ang(quadrature_provider, internal::make_int_grid<2, NT>(json, {"x_order", "cos1_order"}),
74 optimize_x_extent<typename KERNEL::Regulator>(json), json.get_double("T", 1.0))
75 {
76 }
77
78 Integrator_fT_p2_1ang(QuadratureProvider &quadrature_provider, const std::array<size_t, 2> grid_size,
79 ctype x_extent = 2., ctype T = 1, ctype typical_E = 1)
80 : Base(quadrature_provider, grid_size, {0, 0.}, {std::sqrt(x_extent), 1.},
81 {QuadratureType(QuadratureType::legendre), polar_quadrature()}, T, typical_E),
82 x_extent(x_extent), k(1.)
83 {
84 }
85
86 void set_x_extent(ctype x_extent)
87 {
88 this->x_extent = x_extent;
89 Base::set_grid_extents({0, 0.}, {std::sqrt(x_extent) * k, 1.});
90 }
91
92 void set_k(ctype k)
93 {
94 this->k = k;
95 Base::set_grid_extents({0, 0.}, {std::sqrt(x_extent) * k, 1.});
96 Base::set_typical_E(k); // update typical energy
97 }
98
99 void set_typical_E(ctype typical_E) { Base::set_typical_E(typical_E); }
100
101 private:
104 };
105} // namespace DiFfRG
Definition integrator_fT_p2_1ang.hh:47
void set_x_extent(ctype x_extent)
Definition integrator_fT_p2_1ang.hh:86
void set_k(ctype k)
Definition integrator_fT_p2_1ang.hh:92
ExecutionSpace execution_space
Definition integrator_fT_p2_1ang.hh:69
ctype k
Definition integrator_fT_p2_1ang.hh:103
Integrator_fT_p2_1ang(QuadratureProvider &quadrature_provider, const JSONValue &json)
Definition integrator_fT_p2_1ang.hh:71
Integrator_fT_p2_1ang(QuadratureProvider &quadrature_provider, const std::array< size_t, 2 > grid_size, ctype x_extent=2., ctype T=1, ctype typical_E=1)
Definition integrator_fT_p2_1ang.hh:78
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_1ang.hh:68
void set_typical_E(ctype typical_E)
Definition integrator_fT_p2_1ang.hh:99
static QuadratureType polar_quadrature()
Definition integrator_fT_p2_1ang.hh:54
ctype x_extent
Definition integrator_fT_p2_1ang.hh:102
A wrapper around the boost json value class.
Definition json.hh:19
Definition quadrature_integrator_fT.hh:26
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_1ang.hh:12
static constexpr ctype int_prefactor
Definition integrator_fT_p2_1ang.hh:21
typename get_type::ctype< NT > ctype
Definition integrator_fT_p2_1ang.hh:15
static KOKKOS_FORCEINLINE_FUNCTION NT constant(const T &...t)
Definition integrator_fT_p2_1ang.hh:35
static KOKKOS_FORCEINLINE_FUNCTION NT kernel(const ctype q, const ctype cos, const ctype q0, const T &...t)
Definition integrator_fT_p2_1ang.hh:25
static constexpr int sdim
Definition integrator_fT_p2_1ang.hh:14
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
Definition quadrature.hh:44
double a
Definition quadrature.hh:47
double beta
Definition quadrature.hh:48
@ jacobi
Definition quadrature.hh:45
@ legendre
Definition quadrature.hh:45
double alpha
Definition quadrature.hh:48
double b
Definition quadrature.hh:47