diff options
author | Anton Khirnov <anton@khirnov.net> | 2019-04-09 09:44:46 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2019-04-09 09:45:32 +0200 |
commit | 1e83fd63c30d433ee53769d4e4768feabf822ae2 (patch) | |
tree | bc915af5b981f6bb282a9a6e857eb861de6dc42e /mg2d.c | |
parent | 9c47c8202644e20e6ae054a6c7ddf09b6a0e4808 (diff) |
mg2d: add higher-order interpolation operators
Diffstat (limited to 'mg2d.c')
-rw-r--r-- | mg2d.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -396,16 +396,17 @@ static int mg_levels_init(MG2DContext *ctx) enum GridTransferOperator op_interp; enum GridTransferOperator op_restrict; - if (ctx->fd_stencil == 1) - op_interp = GRID_TRANSFER_LAGRANGE_1; - else - op_interp = GRID_TRANSFER_LAGRANGE_3; + switch (ctx->fd_stencil) { + case 1: op_interp = GRID_TRANSFER_LAGRANGE_3; break; + case 2: op_interp = GRID_TRANSFER_LAGRANGE_5; break; + default: return -ENOSYS; + } if (cur->solver->domain_size[0] == 2 * (cur->child->solver->domain_size[0] - 1) + 1) { if (ctx->fd_stencil == 1) - op_restrict = GRID_TRANSFER_FW_1; - else op_restrict = GRID_TRANSFER_FW_3; + else + op_restrict = GRID_TRANSFER_FW_5; } else op_restrict = op_interp; |