aboutsummaryrefslogtreecommitdiff
path: root/mg2d.c
diff options
context:
space:
mode:
Diffstat (limited to 'mg2d.c')
-rw-r--r--mg2d.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mg2d.c b/mg2d.c
index 73157f5..7dacece 100644
--- a/mg2d.c
+++ b/mg2d.c
@@ -450,6 +450,9 @@ MG2DContext *mg2d_solver_alloc(size_t domain_size)
ctx->u = priv->root->solver->u;
ctx->u_stride = priv->root->solver->u_stride;
+ /* initialize the initial guess to zero */
+ memset(ctx->u, 0, sizeof(*ctx->u) * ctx->u_stride * ctx->domain_size);
+
ctx->rhs = priv->root->solver->rhs;
ctx->rhs_stride = priv->root->solver->rhs_stride;