77 template <
typename... T> NT
get(
const ctype k,
const T &...t)
const
79 const ctype S_2d = 2. * std::pow(M_PI, 2 / 2.) / std::tgamma(2 / 2.);
82 const auto constant = KERNEL::constant(k, t...);
86 [&](
const tbb::blocked_range3d<uint, uint, uint> &r, NT value) -> NT {
87 for (
uint idx_x = r.pages().begin(); idx_x != r.pages().end(); ++idx_x) {
90 * S_2d * (1 / (
ctype)2)
92 for (
uint idx_y = r.rows().begin(); idx_y != r.rows().end(); ++idx_y) {
94 for (
uint idx_z = r.cols().begin(); idx_z != r.cols().end(); ++idx_z) {
98 value += int_element * weight *
99 (KERNEL::kernel(q, cos, q0, k, t...) + KERNEL::kernel(q, cos, -q0, k, t...));
105 [&](NT x, NT y) -> NT {
return x + y; });
118 template <
typename... T> std::future<NT>
request(
const ctype k,
const T &...t)
const
120 return std::async(std::launch::deferred, [=,
this]() {
return get(k, t...); });
Integrator for 2+1D integrals over p, q0 and an angle using TBB. Calculates.
Definition integrator_2Dpq0_cpu.hh:23
typename get_type::ctype< NT > ctype
Numerical type to be used for integration tasks e.g. the argument or possible jacobians.
Definition integrator_2Dpq0_cpu.hh:28
Integrator2Dpq0TBB(QuadratureProvider &quadrature_provider, std::array< uint, 3 > grid_sizes, const ctype x_extent, const ctype q0_extent, const uint max_block_size=0)
Construct a new Integrator2Dpq0TBB object.
Definition integrator_2Dpq0_cpu.hh:54
const std::vector< ctype > & q0_quadrature_w
Definition integrator_2Dpq0_cpu.hh:134
const std::array< uint, 3 > grid_sizes
Definition integrator_2Dpq0_cpu.hh:124
const std::vector< ctype > & x_quadrature_w
Definition integrator_2Dpq0_cpu.hh:130
const std::vector< ctype > & ang_quadrature_p
Definition integrator_2Dpq0_cpu.hh:131
const std::vector< ctype > & q0_quadrature_p
Definition integrator_2Dpq0_cpu.hh:133
const std::vector< ctype > & ang_quadrature_w
Definition integrator_2Dpq0_cpu.hh:132
const std::vector< ctype > & x_quadrature_p
Definition integrator_2Dpq0_cpu.hh:129
std::future< NT > request(const ctype k, const T &...t) const
Request a future for the integral of the kernel.
Definition integrator_2Dpq0_cpu.hh:118
NT get(const ctype k, const T &...t) const
Get the integral of the kernel.
Definition integrator_2Dpq0_cpu.hh:77
const ctype x_extent
Definition integrator_2Dpq0_cpu.hh:126
Integrator2Dpq0TBB(QuadratureProvider &quadrature_provider, const std::array< uint, 3 > grid_sizes, const ctype x_extent, const ctype q0_extent, const JSONValue &)
Construct a new Integrator2Dpq0TBB object.
Definition integrator_2Dpq0_cpu.hh:39
const ctype q0_extent
Definition integrator_2Dpq0_cpu.hh:127
A wrapper around the boost json value class.
Definition json.hh:19
A class that provides quadrature points and weights, in host and device memory. The quadrature points...
Definition quadrature_provider.hh:139
typename internal::_ctype< CT >::value ctype
Definition types.hh:106
Definition complex_math.hh:14
constexpr __forceinline__ __host__ __device__ NumberType powr(const NumberType x)
A compile-time evaluatable power function for whole number exponents.
Definition math.hh:45
unsigned int uint
Definition utils.hh:22