40 throw std::runtime_error(
"Grid sizes must be currently equal for all angular dimensions!");
43 template <
typename... T> NT
get(
const ctype k,
const T &...t)
const
47 const auto constant = KERNEL::constant(k, t...);
48 return constant + tbb::parallel_reduce(
52 [&](
const tbb::blocked_range3d<uint, uint, uint> &r, NT value) -> NT {
53 for (
uint idx_x = r.pages().begin(); idx_x != r.pages().end(); ++idx_x) {
55 for (
uint idx_y = r.rows().begin(); idx_y != r.rows().end(); ++idx_y) {
60 for (
uint idx_z = r.cols().begin(); idx_z != r.cols().end(); ++idx_z) {
66 value += int_element * weight *
67 (KERNEL::kernel(q, cos, phi, q0, k, t...) +
68 KERNEL::kernel(q, cos, phi, -q0, k, t...));
74 [&](NT x, NT y) -> NT {
return x + y; });
87 template <
typename... T> std::future<NT>
request(
const ctype k,
const T &...t)
const
89 return std::async(std::launch::deferred, [=,
this]() {
return get(k, t...); });
Definition integrator_3Dpx0_cpu.hh:15
const std::vector< ctype > & ang_quadrature_p
Definition integrator_3Dpx0_cpu.hh:100
typename get_type::ctype< NT > ctype
Numerical type to be used for integration tasks e.g. the argument or possible jacobians.
Definition integrator_3Dpx0_cpu.hh:20
NT get(const ctype k, const T &...t) const
Definition integrator_3Dpx0_cpu.hh:43
const ctype x_extent
Definition integrator_3Dpx0_cpu.hh:95
const std::array< uint, 4 > grid_sizes
Definition integrator_3Dpx0_cpu.hh:93
Integrator3Dpx0TBB(QuadratureProvider &quadrature_provider, const std::array< uint, 4 > grid_sizes, const ctype x_extent, const ctype x0_extent, const JSONValue &)
Definition integrator_3Dpx0_cpu.hh:22
const ctype x0_extent
Definition integrator_3Dpx0_cpu.hh:96
std::future< NT > request(const ctype k, const T &...t) const
Request a future for the integral of the kernel.
Definition integrator_3Dpx0_cpu.hh:87
const std::vector< ctype > & x0_quadrature_p
Definition integrator_3Dpx0_cpu.hh:102
const std::vector< ctype > & x0_quadrature_w
Definition integrator_3Dpx0_cpu.hh:103
const std::vector< ctype > & x_quadrature_w
Definition integrator_3Dpx0_cpu.hh:99
Integrator3Dpx0TBB(QuadratureProvider &quadrature_provider, std::array< uint, 4 > grid_sizes, const ctype x_extent, const ctype x0_extent, const uint max_block_size=0)
Definition integrator_3Dpx0_cpu.hh:28
const std::vector< ctype > & x_quadrature_p
Definition integrator_3Dpx0_cpu.hh:98
const std::vector< ctype > & ang_quadrature_w
Definition integrator_3Dpx0_cpu.hh:101
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