aboutsummaryrefslogtreecommitdiff
path: root/mg2d.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-03-23 19:34:48 +0100
committerAnton Khirnov <anton@khirnov.net>2019-03-25 08:27:15 +0100
commite1d1bdc0d20cc379f2cf31fca84f6179eba0cb36 (patch)
tree93380722784295565802ad37b118b8bb007c446d /mg2d.c
parent71ad1d672f3724426184e799252b87c1d54cb115 (diff)
mg2d: use appropriate full-weighted restriction for 3rd order FDs
Diffstat (limited to 'mg2d.c')
-rw-r--r--mg2d.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mg2d.c b/mg2d.c
index ce92ba2..3e02ac1 100644
--- a/mg2d.c
+++ b/mg2d.c
@@ -376,9 +376,12 @@ static int mg_levels_init(MG2DContext *ctx)
else
op_interp = GRID_TRANSFER_LAGRANGE_3;
- if (cur->solver->domain_size[0] == 2 * (cur->child->solver->domain_size[0] - 1) + 1)
- op_restrict = GRID_TRANSFER_FW_1;
- else
+ 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 = op_interp;
cur->transfer_restrict = mg2di_gt_alloc(op_restrict);