diff options
-rw-r--r-- | src/refine.c | 13 |
1 files changed, 8 insertions, 5 deletions
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<maxiter; it++ ) { double conv; |