summaryrefslogtreecommitdiff
path: root/transfer.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-04-09 09:45:16 +0200
committerAnton Khirnov <anton@khirnov.net>2019-06-14 11:05:39 +0200
commit373dbd15f216c2ce97396af37ea3f7cc5d39455c (patch)
tree9fec3609181410c7584bced57b118c23499a90eb /transfer.c
parent33d18edb8db8cad947b7a06206d4000ad0bfa619 (diff)
egs: add higher-order finite difference operatorstmp
Diffstat (limited to 'transfer.c')
-rw-r--r--transfer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/transfer.c b/transfer.c
index 311c6a9..d2809fa 100644
--- a/transfer.c
+++ b/transfer.c
@@ -118,10 +118,12 @@ static int transfer_factors_lagrange(GridTransferContext *ctx, unsigned int dim)
return -ENOMEM;
for (ptrdiff_t idx_dst = 0; idx_dst < ctx->dst.size[dim]; idx_dst++) {
- const ptrdiff_t idx_src = (ptrdiff_t)(scale * idx_dst) - (priv->stencil / 2 - 1);
- const double coord_dst = idx_dst * step_dst;
+ const double coord_dst = idx_dst * step_dst;
+ double *fact = priv->fact[dim] + priv->stencil * idx_dst;
- double *fact = priv->fact[dim] + priv->stencil * idx_dst;
+ ptrdiff_t idx_src = (ptrdiff_t)(scale * idx_dst) - (priv->stencil / 2 - 1);
+
+ //idx_src = MAX(MIN(idx_src, ctx->src.size[dim] - priv->stencil - 1), 0);
for (int i = 0; i < priv->stencil; i++)
coord_src[i] = (idx_src + i) * step_src;