diff options
author | Anton Khirnov <anton@khirnov.net> | 2018-08-07 16:19:58 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2018-08-07 16:19:58 +0200 |
commit | d7fed70887996c69a77b91d368f4f68565d36bae (patch) | |
tree | 02724cd40cd0d4796dc05b3df06a0312ff89e054 /mg2d.c | |
parent | a024abad458af1ba6eb9135ca982d3fe762ea855 (diff) |
mg2d: actually initialize u to zero as documented
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; |