Skip to content
Snippets Groups Projects
Commit 78ab2da9 authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Fixed bug in FormFactorDWBA

parent 31039618
No related branches found
No related tags found
No related merge requests found
......@@ -59,39 +59,16 @@ void FormFactorDWBA::calculateTerms(const cvector_t& k_i,
// Retrieve the two different incoming wavevectors in the layer
const ILayerRTCoefficients *p_in_coeff =
mp_specular_info->getInCoefficients();
cvector_t k_i_R = k_i;
k_i_R.setZ(p_in_coeff->getScalarKz());
cvector_t k_i_T = k_i;
k_i_T.setZ(-k_i_R.z());
// Retrieve the two different outgoing wavevector bins in the layer
kvector_t k_real_lower(k_f_bin.m_q_lower.x().real(),
k_f_bin.m_q_lower.y().real(),
k_f_bin.m_q_lower.z().real());
double k_length = k_real_lower.mag();
double z_min = std::sin(alpha_f_bin.m_lower)*k_length;
double z_max = std::sin(alpha_f_bin.m_upper)*k_length;
double zeta_lower = 0.0;
double zeta_upper = 0.0;
if (alpha_f_bin.m_lower != alpha_f_bin.m_upper) {
zeta_lower = (k_f_bin.m_q_lower.z().real() - z_min) / (z_max - z_min);
zeta_upper = (k_f_bin.m_q_upper.z().real() - z_min) / (z_max - z_min);
}
cvector_t k_i_R = k_i;
k_i_R.setZ(-k_i_T.z());
const ILayerRTCoefficients *p_out_lower = getOutCoeffs(alpha_f_bin.m_lower);
const ILayerRTCoefficients *p_out_upper = getOutCoeffs(alpha_f_bin.m_upper);
// Retrieve the two different outgoing wavevector bins in the layer
Bin1DCVector k_f_T_bin = k_f_bin;
complex_t kfz_lower = p_out_lower->getScalarKz() + zeta_lower*
(p_out_upper->getScalarKz() - p_out_lower->getScalarKz());
complex_t kfz_upper = p_out_lower->getScalarKz() + zeta_upper*
(p_out_upper->getScalarKz() - p_out_lower->getScalarKz());
k_f_T_bin.m_q_lower.setZ(kfz_lower);
k_f_T_bin.m_q_upper.setZ(kfz_upper);
Bin1DCVector k_f_R_bin = k_f_bin;
k_f_R_bin.m_q_lower.setZ(-k_f_T_bin.m_q_lower.z());
k_f_R_bin.m_q_upper.setZ(-k_f_T_bin.m_q_upper.z());
// The four different scattering contributions; S stands for scattering
// off the particle, R for reflection off the layer interface
double alpha_f = alpha_f_bin.getMidPoint();
......
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