diff options
-rw-r--r-- | src/patch/fp.hh | 6 | ||||
-rw-r--r-- | src/patch/grid.cc | 8 | ||||
-rw-r--r-- | src/patch/test_fd_grid.cc | 4 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/patch/fp.hh b/src/patch/fp.hh index baafad5..7a136ff 100644 --- a/src/patch/fp.hh +++ b/src/patch/fp.hh @@ -26,4 +26,8 @@ #endif // FIXME: another hack -#define FINITE_DIFF_ORDER 2 +#ifdef FINITE_DIFF_ORDER + // someone (probably a Makefile) has already defined this ==> leave it alone +#else + #define FINITE_DIFF_ORDER 2 +#endif diff --git a/src/patch/grid.cc b/src/patch/grid.cc index c2e382b..2943ccd 100644 --- a/src/patch/grid.cc +++ b/src/patch/grid.cc @@ -130,18 +130,18 @@ void grid::print_gridfn(int gfn, FILE *output_fp = stdout) { fprintf(output_fp, "# gfn=%d\n", gfn); -fprintf(output_fp, "# rho\t\tsigma\t\tgridfn\n"); +fprintf(output_fp, "# drho\t\tdsigma\t\tgridfn\n"); for (int irho = min_irho() ; irho <= max_irho() ; ++irho) { - const fp rho = rho_of_irho(irho); + const fp drho = drho_of_irho(irho); for (int isigma = min_isigma() ; isigma <= max_isigma() ; ++isigma) { - const fp sigma = sigma_of_isigma(isigma); + const fp dsigma = dsigma_of_isigma(isigma); fprintf(output_fp, "%g\t%g\t%.15g\n", - rho, sigma, gridfn(gfn, irho,isigma)); + drho, dsigma, gridfn(gfn, irho,isigma)); } printf("\n"); } diff --git a/src/patch/test_fd_grid.cc b/src/patch/test_fd_grid.cc index e440a53..a9c0125 100644 --- a/src/patch/test_fd_grid.cc +++ b/src/patch/test_fd_grid.cc @@ -7,7 +7,7 @@ /// /// f - test function /// derivs - analytical derivatives of f (code generated by Maple) -// +/// #include <stdio.h> #include <assert.h> @@ -283,7 +283,7 @@ printf("# setting up analytic derivatives\n"); { const fp rho = g.rho_of_irho(irho); const fp sigma = g.sigma_of_isigma(isigma); - g.gridfn(gfn_fn, irho,isigma) = deriv(rho,sigma, flags); + g.gridfn(gfn_deriv_true, irho,isigma) = deriv(rho,sigma, flags); } } } |