aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-11-25 00:39:05 +0100
committerThomas White <taw@bitwiz.org.uk>2009-11-25 00:39:05 +0100
commit48477c86c4fae48d581ee6614615152b6e61ee3f (patch)
tree9ecd78b18e62e3b6cef22912d9fc13694c2c039b /src
parentfdffe20d34dc1131b98f7c1738af690af65f5206 (diff)
Progress bar improvements and tidy-up
Diffstat (limited to 'src')
-rw-r--r--src/sfac.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sfac.c b/src/sfac.c
index 7bf30f82..0c82eb2f 100644
--- a/src/sfac.c
+++ b/src/sfac.c
@@ -447,10 +447,9 @@ double complex *get_reflections(struct molecule *mol, double en)
//}
}
+ progress_bar((k+INDMAX)+IDIM*(h+INDMAX), IDIM*IDIM-1);
}
- progress_bar((h+INDMAX+1), 2*INDMAX);
}
- printf("\n");
//printf("Total scattered = %f, F000 = %f\n", tscat, F00);
return reflections;
@@ -463,7 +462,8 @@ void get_reflections_cached(struct molecule *mol, double en)
FILE *fh;
size_t r;
- snprintf(s, 1023, "reflections-%ieV.cache", (int)J_to_eV(en));
+ /* Add 0.5 to improve rounding */
+ snprintf(s, 1023, "reflections-%ieV.cache", (int)(J_to_eV(en)+0.5));
fh = fopen(s, "rb");
if ( fh == NULL ) {
printf("No cache file found (looked for %s)\n", s);
@@ -491,7 +491,7 @@ calc:
r = fwrite(mol->reflections, sizeof(double complex),
IDIM*IDIM*IDIM, fh);
- if ( r < IDIM*IDIM*IDIM ) {
+ if ( r < IDIM*IDIM*IDIM ) {
printf("Failed to write cache file (%s)\n", s);
return;
}