aboutsummaryrefslogtreecommitdiff
path: root/src/Cartoon2DBC.c
diff options
context:
space:
mode:
authorhawke <hawke@eec4d7dc-71c2-46d6-addf-10296150bf52>2005-09-14 13:01:59 +0000
committerhawke <hawke@eec4d7dc-71c2-46d6-addf-10296150bf52>2005-09-14 13:01:59 +0000
commit2b42ff6020d0ab36b11b65466ef6850f7ec68242 (patch)
tree3a389a7d05130250c70d1f5bdc8590bf845a4781 /src/Cartoon2DBC.c
parent49ebff9fcba20d579d938f5142903178f22d1387 (diff)
Modify the ENO interpolators so that it takes an "order" parameter.
Add knowledge of the PROLONG_NONE type to lower level bits of the code, in case that case propagates. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/Cartoon2D/trunk@94 eec4d7dc-71c2-46d6-addf-10296150bf52
Diffstat (limited to 'src/Cartoon2DBC.c')
-rw-r--r--src/Cartoon2DBC.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/Cartoon2DBC.c b/src/Cartoon2DBC.c
index ba995d0..f74c30f 100644
--- a/src/Cartoon2DBC.c
+++ b/src/Cartoon2DBC.c
@@ -39,7 +39,7 @@ static CCTK_REAL Cartoon2DInterp_ENO(const cGH *cctkGH,
int ijk, CCTK_REAL x);
CCTK_REAL interpolate_local(int order, CCTK_REAL x0, CCTK_REAL dx,
CCTK_REAL y[], CCTK_REAL x);
-CCTK_REAL interpolate_eno(CCTK_REAL x0, CCTK_REAL dx,
+CCTK_REAL interpolate_eno(CCTK_INT order, CCTK_REAL x0, CCTK_REAL dx,
CCTK_REAL y[], CCTK_REAL x);
void CCTK_FCALL CCTK_FNAME(BndCartoon2DVI)(int *retval, const cGH **GH,
int *tensortype, int *vi);
@@ -198,6 +198,10 @@ int BndCartoon2DVI(const cGH *cctkGH, int tensortype, int prolongtype, int vi)
/* interpolate grid functions */
switch (prolongtype)
{
+ case PROLONG_NONE:
+ /* no-op */
+ return (0);
+ break;
case PROLONG_LAGRANGE:
for (n = 0; n < n_vars; n++)
f[n] = Cartoon2DInterp(cctkGH, cctkGH->data[var0+n][timelevel],
@@ -383,9 +387,10 @@ static CCTK_REAL Cartoon2DInterp_ENO(const cGH *cctkGH,
CCTK_REAL x0;
CCTK_REAL lx0, dx0;
- CCTK_REAL y[5], r;
+ CCTK_REAL y[11], r;
int lnx;
int n, offset;
+ int tmp_order = 2;
lnx = cctkGH->cctk_lsh[0];
@@ -400,25 +405,30 @@ static CCTK_REAL Cartoon2DInterp_ENO(const cGH *cctkGH,
/* offset of stencil, note that rotation leads to x close to x0
for large x */
- offset = 2;
+ offset = eno_order;
+/* offset = tmp_order; */
/* shift stencil at boundaries */
/* note that for simplicity we don't distinguish between true boundaries
and decomposition boundaries: the sync fixes that! */
if (i-offset < 0) offset = i;
- if (i-offset+4 >= lnx) offset = i+5-lnx;
+/* if (i-offset+4 >= lnx) offset = i+5-lnx; */
+/* if (i-offset+2*tmp_order >= lnx) offset = i+2*tmp_order+1-lnx; */
+ if (i-offset+2*eno_order >= lnx) offset = i+2*eno_order+1-lnx;
/* fill in info */
/* fills in old data near axis, but as long as stencil at axis is
centered, no interpolation happens anyway */
x0 = lx0 + dx0 * (i-offset);
- for (n = 0; n <= 4; n++)
+/* for (n = 0; n < 2 * tmp_order + 1; ++n) */
+ for (n = 0; n < 2 * eno_order + 1; ++n)
{
y[n] = f[ijk-offset+n];
}
/* call interpolator */
- r = interpolate_eno(x0, dx0, y, x);
+/* r = interpolate_eno(tmp_order, x0, dx0, y, x); */
+ r = interpolate_eno(eno_order, x0, dx0, y, x);
return r;
}