From 1e83fd63c30d433ee53769d4e4768feabf822ae2 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 9 Apr 2019 09:44:46 +0200 Subject: mg2d: add higher-order interpolation operators --- mg2d.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'mg2d.c') diff --git a/mg2d.c b/mg2d.c index b1c7fb7..11a8158 100644 --- a/mg2d.c +++ b/mg2d.c @@ -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; -- cgit v1.2.3