Skip to content
Snippets Groups Projects
Commit c9c1d581 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

factors out of integrand

parent 0d7b26de
No related branches found
No related tags found
1 merge request!1145Optimize integrands in form factor quadrature
...@@ -51,19 +51,13 @@ complex_t HemiEllipsoid::formfactor_at_bottom(C3 q) const ...@@ -51,19 +51,13 @@ complex_t HemiEllipsoid::formfactor_at_bottom(C3 q) const
if (std::abs(q.mag()) <= std::numeric_limits<double>::epsilon()) if (std::abs(q.mag()) <= std::numeric_limits<double>::epsilon())
return M_TWOPI * R * W * H / 3.; return M_TWOPI * R * W * H / 3.;
return M_TWOPI * H return M_TWOPI * H * R * W
* ComplexIntegrator().integrate( * ComplexIntegrator().integrate(
[=](double z) { [=](double z) {
double Rz = R * std::sqrt(1.0 - z * z);
double Wz = W * std::sqrt(1.0 - z * z);
complex_t qxRz = q.x() * Rz;
complex_t qyWz = q.y() * Wz;
complex_t gamma = G * std::sqrt(1.0 - z * z); complex_t gamma = G * std::sqrt(1.0 - z * z);
complex_t J1_gamma_div_gamma = Math::Bessel::J1c(gamma); complex_t J1_gamma_div_gamma = Math::Bessel::J1c(gamma);
return Rz * Wz * J1_gamma_div_gamma * exp_I(q.z() * H * z); return (1. - z*z) * J1_gamma_div_gamma * exp_I(q.z() * H * z);
}, },
0., 1.); 0., 1.);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment