diff options
Diffstat (limited to 'mg2d.c')
-rw-r--r-- | mg2d.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; |