From 9368ff05753ddbf5c00f6c12e2f4bcd9ce034867 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 25 Jul 2019 10:57:54 +0200 Subject: Set the initial guess on refined levels. --- src/qms.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qms.c b/src/qms.c index 162bd47..d931eef 100644 --- a/src/qms.c +++ b/src/qms.c @@ -914,6 +914,16 @@ void qms_mg_solve(CCTK_ARGUMENTS) } } } + + { + /* use the solution from the coarser level as the initial guess */ + CoordPatch *cp_coarse = get_coord_patch(ms, reflevel - 1); + + ret = mg2d_init_guess(cp->solver, cp_coarse->solver->u, cp_coarse->solver->u_stride, + cp_coarse->solver->local_start, cp_coarse->solver->local_size, cp_coarse->solver->step); + if (ret < 0) + CCTK_WARN(0, "Error setting the initial guess"); + } } fprintf(stderr, "%d qms solve: time %g\n", reflevel, time); -- cgit v1.2.3