aboutsummaryrefslogtreecommitdiff
path: root/src/pattern_sim.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-02-26 16:47:27 +0100
committerThomas White <taw@physics.org>2010-02-26 16:54:59 +0100
commit7d8662ffe897dc2438141ecc8848863bad9b9d92 (patch)
tree46af84456de347220cfcb363c3b4e4ef70362f40 /src/pattern_sim.c
parent86dd71e8640394f4e4f5aa71b2e5f51f5fea4a11 (diff)
Move water calculation to diffraction.c, and work out the consequences
Diffstat (limited to 'src/pattern_sim.c')
-rw-r--r--src/pattern_sim.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index a6a2156b..91100426 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -106,6 +106,9 @@ static void show_details()
"algorithm. When the intensity is sufficiently high that Knuth's algorithm\n"
"would result in machine precision problems, a normal distribution with\n"
"standard deviation sqrt(I) is used instead.\n"
+"\n"
+"The coherent, elastic part of the diffuse scattering from the water jet can\n"
+"be simulated.\n"
);
}
@@ -215,6 +218,12 @@ int main(int argc, char *argv[])
return 0;
}
+ if ( (!config_nowater) && config_gpu ) {
+ ERROR("Cannot simulate water scattering on the GPU.\n");
+ ERROR("Please try again with the --no-water option.\n");
+ return 1;
+ }
+
/* Define image parameters */
image.width = 1024;
image.height = 1024;
@@ -257,10 +266,8 @@ int main(int argc, char *argv[])
}
/* Ensure no residual information */
- image.sfacs = NULL;
image.data = NULL;
image.twotheta = NULL;
- image.hdr = NULL;
cell_get_parameters(image.molecule->cell, &a, &b, &c, &d, &d, &d);
STATUS("Particle size = %i x %i x %i (=%5.2f x %5.2f x %5.2f nm)\n",
@@ -273,18 +280,19 @@ int main(int argc, char *argv[])
}
get_diffraction_gpu(gctx, &image, na, nb, nc);
} else {
- get_diffraction(&image, na, nb, nc, config_nosfac);
+ get_diffraction(&image, na, nb, nc, config_nosfac,
+ !config_nowater);
}
if ( image.molecule == NULL ) {
ERROR("Couldn't open molecule.pdb\n");
return 1;
}
- if ( image.sfacs == NULL ) {
+ if ( image.data == NULL ) {
ERROR("Diffraction calculation failed.\n");
goto skip;
}
- record_image(&image, !config_nowater, !config_nonoise);
+ record_image(&image, !config_nonoise);
if ( config_nearbragg ) {
output_intensities(&image, image.molecule->cell);
@@ -324,8 +332,6 @@ int main(int argc, char *argv[])
/* Clean up */
free(image.data);
- free(image.hdr);
- free(image.sfacs);
free(image.twotheta);
skip: