From e3d41026e188d6225c16a86accab05a6897977f6 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 19 Feb 2010 14:49:36 +0100 Subject: Push particle size display up to top level --- src/diffraction-gpu.c | 6 ------ src/diffraction.c | 6 ------ src/pattern_sim.c | 11 ++++++++--- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/diffraction-gpu.c b/src/diffraction-gpu.c index 5ea7a646..26aa7e34 100644 --- a/src/diffraction-gpu.c +++ b/src/diffraction-gpu.c @@ -140,7 +140,6 @@ void get_diffraction_gpu(struct image *image, int na, int nb, int nc, double ax, ay, az; double bx, by, bz; double cx, cy, cz; - double a, b, c, d; float kc; const size_t dims[2] = {1024, 1024}; cl_event event_d; @@ -176,11 +175,6 @@ void get_diffraction_gpu(struct image *image, int na, int nb, int nc, cell[3] = bx; cell[4] = by; cell[5] = bz; cell[6] = cx; cell[7] = cy; cell[8] = cz; - 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", - na, nb, nc, na*a/1.0e-9, nb*b/1.0e-9, nc*c/1.0e-9); - err = clGetPlatformIDs(8, platforms, &nplat); if ( err != CL_SUCCESS ) { ERROR("Couldn't get platform IDs: %i\n", err); diff --git a/src/diffraction.c b/src/diffraction.c index b71c28ce..a66c2310 100644 --- a/src/diffraction.c +++ b/src/diffraction.c @@ -184,7 +184,6 @@ void get_diffraction(struct image *image, int na, int nb, int nc, int no_sfac) double ax, ay, az; double bx, by, bz; double cx, cy, cz; - double a, b, c, d; float kc; if ( image->molecule == NULL ) return; @@ -193,11 +192,6 @@ void get_diffraction(struct image *image, int na, int nb, int nc, int no_sfac) &bx, &by, &bz, &cx, &cy, &cz); - 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", - na, nb, nc, na*a/1.0e-9, nb*b/1.0e-9, nc*c/1.0e-9); - /* Allocate (and zero) the "diffraction array" */ image->sfacs = calloc(image->width * image->height, sizeof(double complex)); diff --git a/src/pattern_sim.c b/src/pattern_sim.c index a64c754b..c722d2f9 100644 --- a/src/pattern_sim.c +++ b/src/pattern_sim.c @@ -256,10 +256,11 @@ int main(int argc, char *argv[]) do { int na, nb, nc; + double a, b, c, d; - na = 8;//*random()/RAND_MAX + 4; - nb = 8;//*random()/RAND_MAX + 4; - nc = 16;//*random()/RAND_MAX + 30; + na = 8*random()/RAND_MAX + 4; + nb = 8*random()/RAND_MAX + 4; + nc = 16*random()/RAND_MAX + 30; /* Read quaternion from stdin */ if ( config_randomquat ) { @@ -283,6 +284,10 @@ int main(int argc, char *argv[]) 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", + na, nb, nc, na*a/1.0e-9, nb*b/1.0e-9, nc*c/1.0e-9); + if ( config_gpu ) { get_diffraction_gpu(&image, na, nb, nc, config_nosfac); } else { -- cgit v1.2.3