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

constant factor out of integrand

parent f7ad16a1
No related branches found
No related tags found
1 merge request!1145Optimize integrands in form factor quadrature
......@@ -46,6 +46,7 @@ complex_t HemiEllipsoid::formfactor_at_bottom(C3 q) const
const double R = m_radius_x;
const double W = m_radius_y;
const double H = m_height;
const complex_t G = std::sqrt((q.x() * R)*(q.x() * R) + (q.y() * W) * (q.y() * W));
if (std::abs(q.mag()) <= std::numeric_limits<double>::epsilon())
return M_TWOPI * R * W * H / 3.;
......@@ -59,8 +60,7 @@ complex_t HemiEllipsoid::formfactor_at_bottom(C3 q) const
complex_t qxRz = q.x() * Rz;
complex_t qyWz = q.y() * Wz;
complex_t gamma = std::sqrt((q.x() * R)*(q.x() * R)
+ (q.y() * W) * (q.y() * W)) * 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);
return Rz * Wz * J1_gamma_div_gamma * exp_I(q.z() * H * z);
......
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