aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-01-22 19:08:30 +0100
committerThomas White <taw@physics.org>2010-01-22 19:08:30 +0100
commit35e3e0d31f51277c86b1f42963b26dd45d522880 (patch)
treef34a0e82a7d2190e9a20f46d9f5c4a571e563582
parent59d475c1788a8153dd9b936eadabafc1bfee8924 (diff)
Make simulation in indexamajig work
-rw-r--r--src/diffraction.c13
-rw-r--r--src/indexamajig.c3
2 files changed, 13 insertions, 3 deletions
diff --git a/src/diffraction.c b/src/diffraction.c
index b7bdb75a..eb67e4a8 100644
--- a/src/diffraction.c
+++ b/src/diffraction.c
@@ -140,16 +140,25 @@ void get_diffraction(struct image *image, int na, int nb, int nc)
double bx, by, bz;
double cx, cy, cz;
double a, b, c, d;
+ struct molecule *mtmp;
/* Generate the array of reciprocal space vectors in image->qvecs */
if ( image->qvecs == NULL ) {
get_ewald(image);
}
+ /* FIXME: Nasty */
+ mtmp = load_molecule();
if ( image->molecule == NULL ) {
- image->molecule = load_molecule();
- if ( image->molecule == NULL ) return;
+ image->molecule = mtmp;
+ } else {
+ int i;
+ for ( i=0; i<32; i++ ) {
+ image->molecule->species[i] = mtmp->species[i];
+ }
+ image->molecule->n_species = mtmp->n_species;
}
+ if ( image->molecule == NULL ) return;
cell_get_cartesian(image->molecule->cell, &ax, &ay, &az,
&bx, &by, &bz,
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 53c947d1..1a94882b 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -171,7 +171,6 @@ int main(int argc, char *argv[])
/* Simulate a diffraction pattern */
image.sfacs = NULL;
- image.data = NULL;
image.qvecs = NULL;
image.twotheta = NULL;
image.hdr = NULL;
@@ -192,6 +191,8 @@ int main(int argc, char *argv[])
if ( config_simulate ) {
+ image.data = NULL;
+
get_diffraction(&image, 8, 8, 8);
if ( image.molecule == NULL ) {
ERROR("Couldn't open molecule.pdb\n");