diff options
author | Anton Khirnov <anton@khirnov.net> | 2019-01-21 13:08:50 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2019-01-21 13:08:50 +0100 |
commit | 6df6baeb31b82349748acc219aa64c549a45c91a (patch) | |
tree | ccf5822db25d8c28b7d6c5bb5256b87cf19a8a8c /mg2d.c | |
parent | d0ec0a0ba813dd20a7d4c34d77dacd9b81c63b6e (diff) |
mg2d: check and propagate the error from mg_solve_subgrid()
Diffstat (limited to 'mg2d.c')
-rw-r--r-- | mg2d.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -471,7 +471,9 @@ int mg2d_solve(MG2DContext *ctx) res_prev = s_root->residual_max; for (int i = 0; i < ctx->maxiter; i++) { - mg_solve_subgrid(ctx, root); + ret = mg_solve_subgrid(ctx, root); + if (ret < 0) + goto fail; res_cur = s_root->residual_max; @@ -491,8 +493,10 @@ int mg2d_solve(MG2DContext *ctx) res_prev = res_cur; } + ret = -EDOM; +fail: mg2di_log(&priv->logger, MG2D_LOG_ERROR, "The solver failed to converge\n"); - return -EDOM; + return ret; } static void mg_level_free(MG2DLevel **plevel) |