diff options
author | Thomas White <taw@bitwiz.org.uk> | 2009-11-25 00:39:05 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2009-11-25 00:39:05 +0100 |
commit | 48477c86c4fae48d581ee6614615152b6e61ee3f (patch) | |
tree | 9ecd78b18e62e3b6cef22912d9fc13694c2c039b | |
parent | fdffe20d34dc1131b98f7c1738af690af65f5206 (diff) |
Progress bar improvements and tidy-up
-rw-r--r-- | src/sfac.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; } |