diff options
author | Anton Khirnov <anton@khirnov.net> | 2019-04-09 09:45:16 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2019-06-14 11:05:39 +0200 |
commit | 373dbd15f216c2ce97396af37ea3f7cc5d39455c (patch) | |
tree | 9fec3609181410c7584bced57b118c23499a90eb /transfer.c | |
parent | 33d18edb8db8cad947b7a06206d4000ad0bfa619 (diff) |
egs: add higher-order finite difference operatorstmp
Diffstat (limited to 'transfer.c')
-rw-r--r-- | transfer.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; |