25 json.get_double(
"/discretization/integration/qx_min", -M_PI),
26 json.get_double(
"/discretization/integration/qy_min", -M_PI),
27 json.get_double(
"/discretization/integration/qz_min", -M_PI),
28 json.get_double(
"/discretization/integration/qx_max", M_PI),
29 json.get_double(
"/discretization/integration/qy_max", M_PI),
30 json.get_double(
"/discretization/integration/qz_max", M_PI))
37 const ctype qy_max = M_PI,
const ctype qz_max = M_PI)
97 template <
typename... T> NT
get(
const ctype k,
const T &...t)
const
102 const auto constant = KERNEL::constant(k, t...);
104 tbb::parallel_reduce(
106 [&](
const tbb::blocked_range3d<uint, uint, uint> &r, NT value) -> NT {
107 for (
uint idx_x = r.pages().begin(); idx_x != r.pages().end(); ++idx_x) {
109 for (
uint idx_y = r.rows().begin(); idx_y != r.rows().end(); ++idx_y) {
111 for (
uint idx_z = r.cols().begin(); idx_z != r.cols().end(); ++idx_z) {
116 value += int_element * weight * KERNEL::kernel(qx, qy, qz, k, t...);
122 [&](NT x, NT y) -> NT {
return x + y; });
135 template <
typename... T> std::future<NT>
request(
const ctype k,
const T &...t)
const
137 return std::async(std::launch::deferred, [=,
this]() {
return get(k, t...); });
Definition integrator_3D_cartesian_cpu.hh:15
const std::vector< ctype > & x_quadrature_w
Definition integrator_3D_cartesian_cpu.hh:151
void set_qx_max(const ctype qx_max)
Set the maximum value of the qx integration range.
Definition integrator_3D_cartesian_cpu.hh:85
ctype qz_extent
Definition integrator_3D_cartesian_cpu.hh:148
typename get_type::ctype< NT > ctype
Numerical type to be used for integration tasks e.g. the argument or possible jacobians.
Definition integrator_3D_cartesian_cpu.hh:20
ctype qy_min
Definition integrator_3D_cartesian_cpu.hh:144
Integrator3DCartesianTBB(QuadratureProvider &quadrature_provider, const std::array< uint, 3 > grid_sizes, const ctype x_extent, const JSONValue &json)
Definition integrator_3D_cartesian_cpu.hh:22
void set_qx_min(const ctype qx_min)
Set the minimum value of the qx integration range.
Definition integrator_3D_cartesian_cpu.hh:58
ctype qx_extent
Definition integrator_3D_cartesian_cpu.hh:145
void set_qy_min(const ctype qy_min)
Set the minimum value of the qy integration range.
Definition integrator_3D_cartesian_cpu.hh:67
void set_qz_min(const ctype qz_min)
Set the minimum value of the qz integration range.
Definition integrator_3D_cartesian_cpu.hh:76
ctype qx_min
Definition integrator_3D_cartesian_cpu.hh:143
ctype qy_extent
Definition integrator_3D_cartesian_cpu.hh:146
const std::vector< ctype > & y_quadrature_w
Definition integrator_3D_cartesian_cpu.hh:153
NT get(const ctype k, const T &...t) const
Definition integrator_3D_cartesian_cpu.hh:97
void set_qz_max(const ctype qz_max)
Set the maximum value of the qz integration range.
Definition integrator_3D_cartesian_cpu.hh:95
const std::array< uint, 3 > grid_sizes
Definition integrator_3D_cartesian_cpu.hh:141
Integrator3DCartesianTBB(QuadratureProvider &quadrature_provider, std::array< uint, 3 > grid_sizes, const ctype x_extent=0., const uint max_block_size=0, const ctype qx_min=-M_PI, const ctype qy_min=-M_PI, const ctype qz_min=-M_PI, const ctype qx_max=M_PI, const ctype qy_max=M_PI, const ctype qz_max=M_PI)
Definition integrator_3D_cartesian_cpu.hh:34
std::future< NT > request(const ctype k, const T &...t) const
Request a future for the integral of the kernel.
Definition integrator_3D_cartesian_cpu.hh:135
ctype qz_min
Definition integrator_3D_cartesian_cpu.hh:147
const std::vector< ctype > & y_quadrature_p
Definition integrator_3D_cartesian_cpu.hh:152
const std::vector< ctype > & z_quadrature_p
Definition integrator_3D_cartesian_cpu.hh:154
const std::vector< ctype > & z_quadrature_w
Definition integrator_3D_cartesian_cpu.hh:155
const std::vector< ctype > & x_quadrature_p
Definition integrator_3D_cartesian_cpu.hh:150
void set_qy_max(const ctype qy_max)
Set the maximum value of the qy integration range.
Definition integrator_3D_cartesian_cpu.hh:90
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