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

finalize HemiEllipsoid ff

parent c9c1d581
No related branches found
No related tags found
1 merge request!1145Optimize integrands in form factor quadrature
......@@ -46,7 +46,8 @@ 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));
const complex_t G = std::sqrt((q.x() * R) * (q.x() * R) + (q.y() * W) * (q.y() * W));
const complex_t HQ = q.z() * H;
if (std::abs(q.mag()) <= std::numeric_limits<double>::epsilon())
return M_TWOPI * R * W * H / 3.;
......@@ -54,10 +55,8 @@ complex_t HemiEllipsoid::formfactor_at_bottom(C3 q) const
return M_TWOPI * H * R * W
* ComplexIntegrator().integrate(
[=](double z) {
complex_t gamma = G * std::sqrt(1.0 - z * z);
complex_t J1_gamma_div_gamma = Math::Bessel::J1c(gamma);
return (1. - z*z) * J1_gamma_div_gamma * exp_I(q.z() * H * z);
const double cz = 1 - z * z;
return cz * Math::Bessel::J1c(G * std::sqrt(cz)) * exp_I(HQ * z);
},
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