summaryrefslogtreecommitdiff
path: root/src/qms.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qms.c')
-rw-r--r--src/qms.c10
1 files changed, 10 insertions, 0 deletions
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);