From d7fed70887996c69a77b91d368f4f68565d36bae Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 7 Aug 2018 16:19:58 +0200 Subject: mg2d: actually initialize u to zero as documented --- mg2d.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- cgit v1.2.3