summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-07-25 10:57:54 +0200
committerAnton Khirnov <anton@khirnov.net>2019-07-25 10:57:54 +0200
commit9368ff05753ddbf5c00f6c12e2f4bcd9ce034867 (patch)
tree1f14f7ac3b75336df12146ef6df0e75f9f4a2d54
parent43c18a92f8430a26f56b790baea2fdc1607dd02b (diff)
Set the initial guess on refined levels.
-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);