From 1ffcf082a9b8020c019748b1aa6059c70a956f88 Mon Sep 17 00:00:00 2001 From: taw27 Date: Tue, 19 Aug 2008 12:47:07 +0000 Subject: Enable debugging, relax tolerance and monitor simplex size git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@291 bf6ca9ba-c028-0410-8290-897cf20841d1 --- src/refine.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/refine.c') diff --git a/src/refine.c b/src/refine.c index 5de8df3..5e9a5eb 100644 --- a/src/refine.c +++ b/src/refine.c @@ -36,7 +36,7 @@ #define NUM_PARAMS 9 /* Refine debug */ -#define REFINE_DEBUG 0 +#define REFINE_DEBUG 1 /* A simplex is an array of ten of these */ typedef struct { @@ -309,7 +309,7 @@ static double refine_iteration(SimplexVertex *s, Deviation *d, int nf) { } /* Check convergence and return */ - fom_worst = 0; + fom_worst = 0.0; fom_best = 100e9; for ( i=0; i<=NUM_PARAMS; i++ ) { double fom; @@ -321,7 +321,10 @@ static double refine_iteration(SimplexVertex *s, Deviation *d, int nf) { fom_best = fom; } } - return fom_worst - fom_best; + + printf("Simplex size: %e - %e = %e\n", fom_worst/DISPFACTOR, fom_best/DISPFACTOR, (fom_worst - fom_best)/DISPFACTOR); + + return fom_best; } @@ -331,7 +334,7 @@ double refine_do_cell(ControlContext *ctx) { Deviation *d; double delta; int i, nf, f, it, maxiter; - const double tol = 0.00001e9; /* Stopping condition */ + const double tol = 0.001e9; /* Stopping condition */ //const double tol = 0.001; /* For testing */ if ( !ctx->cell_lattice ) { @@ -432,7 +435,7 @@ double refine_do_cell(ControlContext *ctx) { memcpy(&s[9], &s[0], sizeof(SimplexVertex)); s[9].dcz = delta; /* Iterate */ - maxiter = 500; + maxiter = 10000; for ( it=0; it