diff options
Diffstat (limited to 'packages/sundials/src/helpers.c')
-rw-r--r-- | packages/sundials/src/helpers.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/packages/sundials/src/helpers.c b/packages/sundials/src/helpers.c index 420d3be..f0ca592 100644 --- a/packages/sundials/src/helpers.c +++ b/packages/sundials/src/helpers.c | |||
@@ -42,25 +42,3 @@ int check_flag(void *flagvalue, const char *funcname, int opt) | |||
42 | 42 | ||
43 | return 0; | 43 | return 0; |
44 | } | 44 | } |
45 | |||
46 | /* check the computed solution */ | ||
47 | int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) | ||
48 | { | ||
49 | int passfail=0; /* answer pass (0) or fail (1) flag */ | ||
50 | realtype ans, err, ewt; /* answer data, error, and error weight */ | ||
51 | realtype ONE=RCONST(1.0); | ||
52 | |||
53 | /* compute solution error */ | ||
54 | ans = atan(t); | ||
55 | ewt = ONE / (rtol * SUNRabs(ans) + atol); | ||
56 | err = ewt * SUNRabs(NV_Ith_S(y,0) - ans); | ||
57 | |||
58 | /* is the solution within the tolerances? */ | ||
59 | passfail = (err < ONE) ? 0 : 1; | ||
60 | |||
61 | if (passfail) { | ||
62 | fprintf(stdout, "\nSUNDIALS_WARNING: check_ans error=%g \n\n", err); | ||
63 | } | ||
64 | |||
65 | return(passfail); | ||
66 | } | ||