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:12 +0200 |
commit | 33d18edb8db8cad947b7a06206d4000ad0bfa619 (patch) | |
tree | 1f5cce5c2d074dfb8678ba2f2531b630129bf768 /mg2d.c | |
parent | 553c8fb35710da42ed958a79940693d4b68290ee (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; |