aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sfac.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/sfac.c b/src/sfac.c
index 3d39fa42..dda1901e 100644
--- a/src/sfac.c
+++ b/src/sfac.c
@@ -532,6 +532,7 @@ double *get_reflections(struct molecule *mol, double en, double res,
for ( j=0; j<spec->n_atoms; j++ ) {
double ph, u, v, w;
+ double complex cpart;
u = h*asx + k*bsx + l*csx;
v = h*asy + k*bsy + l*csy;
@@ -540,17 +541,17 @@ double *get_reflections(struct molecule *mol, double en, double res,
ph = u*spec->x[j] + v*spec->y[j] + w*spec->z[j];
/* Conversion from revolutions to radians */
- contrib += cexp(-2.0*M_PI*I*ph);
+ cpart = cexp(-2.0*M_PI*I*ph);
+ if ( do_thermal ) {
+ cpart *= exp(-2.0 * spec->B[j] * s * s);
+ }
+ contrib += cpart;
}
sfac = get_sfac(spec->species, s, en);
F += sfac * contrib;
- if ( do_thermal ) {
- F *= exp(-2.0 * spec->B[j] * s);
- }
-
}
set_intensity(reflections, h, k, l, pow(cabs(F), 2.0));