From 7f88b344adb92434814c82c839a513fc1ccf3b11 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 20 Jan 2020 15:25:21 +0100 Subject: mg2d: add a designated error code for reaching maxiter Allows to reliably distinguish it from other error cases. Also specify that the values of u are defined for this error code. --- mg2d_constants.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mg2d_constants.h') diff --git a/mg2d_constants.h b/mg2d_constants.h index aa3d5cb..a197240 100644 --- a/mg2d_constants.h +++ b/mg2d_constants.h @@ -20,7 +20,14 @@ #define MG2D_CONSTANTS_H enum MG2DError { - MG2D_ERR_DIVERGE = -0xff00, + /** + * The solver has diverged. + */ + MG2D_ERR_DIVERGE = -0xff00, + /* Maximum number of iterations has been executed without the solution + * reaching desired tolerance. + */ + MG2D_ERR_MAXITER_REACHED = -0xff01, }; /** -- cgit v1.2.3