aboutsummaryrefslogtreecommitdiff
path: root/src/diffraction.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2009-11-20 15:15:02 +0100
committerThomas White <taw@physics.org>2009-11-20 15:15:02 +0100
commitfb42533ca6f9077c6b1a03ad9cc76d73a53fb9f1 (patch)
tree45e50ffa8afec07c00b8cfb6ec740d53d85a242c /src/diffraction.c
parentc72fcf4bc2a9f46daf6cbcb14ac2fc388696de09 (diff)
Tidy up and fix
Diffstat (limited to 'src/diffraction.c')
-rw-r--r--src/diffraction.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/diffraction.c b/src/diffraction.c
index 87f2a5f7..6bb48332 100644
--- a/src/diffraction.c
+++ b/src/diffraction.c
@@ -129,7 +129,7 @@ static double complex water_factor(struct threevec q, double en)
/* Density of water molecules */
molecules_per_m3 = WATER_DENSITY * (AVOGADRO / WATER_MOLAR_MASS);
-
+
/* Number of water molecules per slice */
molecules_per_m = (2*rb*2*rc) * molecules_per_m3 / N_WATER_SLICES;
@@ -168,8 +168,11 @@ void get_diffraction(struct image *image, UnitCell *cell)
/* Generate the array of reciprocal space vectors in image->qvecs */
get_ewald(image);
- image->molecule = load_molecule();
- if ( image->molecule == NULL ) return;
+
+ if ( image->molecule == NULL ) {
+ image->molecule = load_molecule();
+ if ( image->molecule == NULL ) return;
+ }
cell_get_cartesian(cell, &ax, &ay, &az,
&bx, &by, &bz,