aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}