aboutsummaryrefslogtreecommitdiff
path: root/src/interpolate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interpolate.c')
-rw-r--r--src/interpolate.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/interpolate.c b/src/interpolate.c
index d48da6e..7b318d7 100644
--- a/src/interpolate.c
+++ b/src/interpolate.c
@@ -241,6 +241,13 @@ CCTK_REAL interpolate_eno(CCTK_REAL x0, CCTK_REAL dx,
CCTK_INT seed = 0;
CCTK_INT j,r;
+ CCTK_REAL c0;
+ CCTK_REAL c1;
+ CCTK_REAL c2;
+
+ CCTK_REAL xc;
+ CCTK_REAL xr;
+
/* Find seed index */
while (x > x0 + dx * ((float)seed+0.5)) seed++;
@@ -270,12 +277,12 @@ CCTK_REAL interpolate_eno(CCTK_REAL x0, CCTK_REAL dx,
}
/* Interpolate second order */
- double c0 = y[r+1];
- double c1 = (-1.0/2.0)*y[r] + (+1.0/2.0)*y[r+2];
- double c2 = (+1.0/2.0)*y[r] - y[r+1] + (+1.0/2.0)*y[r+2];
+ c0 = y[r+1];
+ c1 = (-1.0/2.0)*y[r] + (+1.0/2.0)*y[r+2];
+ c2 = (+1.0/2.0)*y[r] - y[r+1] + (+1.0/2.0)*y[r+2];
- double xc = x0 + dx * (double)(r+1);
- double xr = (x - xc) / dx;
+ xc = x0 + dx * (CCTK_REAL)(r+1);
+ xr = (x - xc) / dx;
return( c0 + xr*(c1 + xr*c2) );