Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error handling in cvode #382

Merged
merged 32 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2d59639
error handling in cvode
balos1 Dec 6, 2023
631660a
Merge branch 'feature/error-handling-just-the-core-formatted' into fe…
balos1 Dec 6, 2023
fdd7d02
Merge branch 'feature/error-handling-just-the-core-formatted' into fe…
balos1 Dec 7, 2023
055fc4f
Merge branch 'feature/error-handling-just-the-core-formatted' into fe…
balos1 Dec 7, 2023
e6f4902
Apply suggestions from code review
balos1 Dec 7, 2023
eff4012
Merge remote-tracking branch 'origin/feature/error-handling-cvode' in…
balos1 Dec 7, 2023
6ae4831
Merge branch 'feature/error-handling-just-the-core-formatted' into fe…
balos1 Dec 7, 2023
d5757fc
fix cvode.c changes
balos1 Dec 7, 2023
5c5d3c3
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 7, 2023
3ef61b1
add cvode error handling unit test
balos1 Dec 7, 2023
4e2d8dd
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 7, 2023
7174507
Merge branch 'feature/error-handling-just-the-core-formatted' into fe…
balos1 Dec 7, 2023
f4e361e
Merge branch 'feature/error-handling-just-the-core-formatted' into fe…
balos1 Dec 7, 2023
7a0ec4d
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 7, 2023
eec60e6
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 7, 2023
2f46396
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 8, 2023
dd35902
remove cvode error handler function
balos1 Dec 8, 2023
bbf6ff7
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 8, 2023
7c6ba5a
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 8, 2023
8aeede6
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 8, 2023
574d9c1
format after merge
balos1 Dec 8, 2023
f26a776
ensure sundials_mpi_errors.h is included when MPI is enabled
balos1 Dec 8, 2023
3c1635c
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 8, 2023
741b58f
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 11, 2023
03a3033
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 11, 2023
5cf67b9
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 11, 2023
5670a7a
make requested changes
balos1 Dec 11, 2023
329fccb
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 12, 2023
81bf98f
fix cmake for unit test
balos1 Dec 12, 2023
74da510
call GetLastError in ProcessError
balos1 Dec 12, 2023
2871a5a
Merge branch 'feature/error-handling-staging' into feature/error-hand…
balos1 Dec 12, 2023
fc3920d
address comments
balos1 Dec 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion doc/cvode/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ This fixes some duplicate symbol errors on Windows when linking to multiple SUND

**Breaking change**
The functions ``CVodeSetErrFile`` and ``CVodeSetHandlerErrFn`` have been removed.
Users of these functions should use the :c:type:`SUNLogger` API instead.
Users of these functions can use the functions :c:func:`SUNContext_PushErrHandler`,
and :c:func:`SUNLogger_SetErrorFilename` instead. For further details see
Sections :numref:`SUNDIALS.Errors` and :numref:`SUNDIALS.Logging`.

Changes in v6.6.2
-----------------
Expand Down
11 changes: 0 additions & 11 deletions doc/cvode/guide/source/Usage/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -806,13 +806,6 @@ We note that, on an error return, all of the optional input functions send an
error message to the error handler function. All error return values are
negative, so the test ``flag < 0`` will catch all errors.

The optional input calls can, unless otherwise noted, be executed in any order.
However, if the user's program calls either :c:func:`CVodeSetErrFile` or
:c:func:`CVodeSetErrHandlerFn`, then that call should appear first, in order to
take effect for any later error message. Finally, a call to an ``CVodeSet***``
function can, unless otherwise noted, be made at any time from the user's
calling program and, if successful, takes effect immediately.

balos1 marked this conversation as resolved.
Show resolved Hide resolved

.. _CVODE.Usage.CC.optional_input.optin_main:

Expand All @@ -826,10 +819,6 @@ Main solver optional input functions
+-------------------------------+---------------------------------------------+----------------+
| **Optional input** | **Function name** | **Default** |
+===============================+=============================================+================+
| Pointer to an error file | :c:func:`CVodeSetErrFile` | ``stderr`` |
+-------------------------------+---------------------------------------------+----------------+
| Error handler function | :c:func:`CVodeSetErrHandlerFn` | internal fn. |
+-------------------------------+---------------------------------------------+----------------+
| User data | :c:func:`CVodeSetUserData` | ``NULL`` |
+-------------------------------+---------------------------------------------+----------------+
| Maximum order for BDF method | :c:func:`CVodeSetMaxOrd` | 5 |
Expand Down
36 changes: 27 additions & 9 deletions src/cvode/cvode.c
balos1 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
/* Import Header Files */
/*=================================================================*/

#include "cvode/cvode.h"

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -27,6 +29,7 @@
#include <sunnonlinsol/sunnonlinsol_newton.h>

#include "cvode_impl.h"
#include "sundials/priv/sundials_errors_impl.h"

/*=================================================================*/
/* CVODE Private Constants */
Expand Down Expand Up @@ -4821,6 +4824,8 @@ static int cvEwtSetSV(CVodeMem cv_mem, N_Vector ycur, N_Vector weight)
void cvProcessError(CVodeMem cv_mem, int error_code, int line, const char* func,
const char* file, const char* msgfmt, ...)
{
SUNFunctionBegin(cv_mem->cv_sunctx);

/* Initialize the argument pointer variable
(msgfmt is the last required argument to cvProcessError) */
va_list ap;
Expand All @@ -4831,18 +4836,31 @@ void cvProcessError(CVodeMem cv_mem, int error_code, int line, const char* func,
char* msg = (char*)malloc(msglen);
vsnprintf(msg, msglen, msgfmt, ap);

if (cv_mem == NULL)
{ /* We write to stderr */
#ifndef NO_FPRINTF_OUTPUT
fprintf(stderr, "\n[CVODE ERROR] %s at %s:%d\n ", func, __FILE__, line);
fprintf(stderr, "%s\n\n", msg);
do {
if (cv_mem == NULL)
{
SUNGlobalFallbackErrHandler(line, func, file, msg, error_code);
break;
}

if (error_code == CV_WARNING)
{
#if SUNDIALS_LOGGING_LEVEL >= 1
balos1 marked this conversation as resolved.
Show resolved Hide resolved
char* file_and_line = sunCombineFileAndLine(line, file);
SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_WARNING, file_and_line, func,
msg);
free(file_and_line);
#endif
}
else
{
break;
}

/* Call the SUNDIALS main error handler */
SUNHandleErrWithMsg(line, func, file, msg, error_code, cv_mem->cv_sunctx);
SUNHandleErrWithMsg(line, func, file, msg, error_code, SUNCTX_);

/* Clear the error now */
(void)SUNContext_GetLastError(SUNCTX_);
}
while (0);

/* Finalize argument processing */
va_end(ap);
Expand Down
73 changes: 31 additions & 42 deletions src/cvode/cvode_ls.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ int CVodeSetJacFn(void* cvode_mem, CVLsJacFn jac)
int retval;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "CVodeSetJacFn", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* return with failure if jac cannot be used */
Expand Down Expand Up @@ -330,8 +330,7 @@ int CVodeSetDeltaGammaMaxBadJac(void* cvode_mem, sunrealtype dgmax_jbad)
int retval;

/* Access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "CVodeSetDeltaGammaMaxBadJac", &cv_mem,
&cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* Set value or use default */
Expand All @@ -349,7 +348,7 @@ int CVodeSetEpsLin(void* cvode_mem, sunrealtype eplifac)
int retval;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "CVodeSetEpsLin", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* Check for legal eplifac */
Expand All @@ -374,7 +373,7 @@ int CVodeSetLSNormFactor(void* cvode_mem, sunrealtype nrmfac)
int retval;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "CVodeSetLSNormFactor", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

if (nrmfac > ZERO)
Expand Down Expand Up @@ -406,8 +405,7 @@ int CVodeSetJacEvalFrequency(void* cvode_mem, long int msbj)
int retval;

/* access CVLsMem structure; store input and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeSetJacEvalFrequency", &cv_mem,
&cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* Check for legal msbj */
Expand All @@ -432,8 +430,7 @@ int CVodeSetLinearSolutionScaling(void* cvode_mem, sunbooleantype onoff)
int retval;

/* access CVLsMem structure; store input and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeSetLinearSolutionScaling", &cv_mem,
&cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* check for valid solver and method type */
Expand All @@ -460,8 +457,7 @@ int CVodeSetPreconditioner(void* cvode_mem, CVLsPrecSetupFn psetup,
int retval;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "CVodeSetPreconditioner", &cv_mem,
&cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* store function pointers for user-supplied routines in CVLs interface */
Expand Down Expand Up @@ -502,7 +498,7 @@ int CVodeSetJacTimes(void* cvode_mem, CVLsJacTimesSetupFn jtsetup,
int retval;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "CVodeSetJacTimes", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* issue error if LS object does not allow user-supplied ATimes */
Expand Down Expand Up @@ -544,8 +540,7 @@ int CVodeSetJacTimesRhsFn(void* cvode_mem, CVRhsFn jtimesRhsFn)
int retval;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "CVodeSetJacTimesRhsFn", &cv_mem,
&cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* check if using internal finite difference approximation */
Expand All @@ -571,7 +566,7 @@ int CVodeSetLinSysFn(void* cvode_mem, CVLsLinSysFn linsys)
int retval;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "CVodeSetLinSysFn", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* return with failure if linsys cannot be used */
Expand Down Expand Up @@ -610,7 +605,7 @@ int CVodeGetJac(void* cvode_mem, SUNMatrix* J)
int retval;

/* access CVLsMem structure; set output and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetJac", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return retval; }
*J = cvls_mem->savedJ;
return CVLS_SUCCESS;
Expand All @@ -623,7 +618,7 @@ int CVodeGetJacTime(void* cvode_mem, sunrealtype* t_J)
int retval;

/* access CVLsMem structure; set output and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetJacTime", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return retval; }
*t_J = cvls_mem->tnlj;
return CVLS_SUCCESS;
Expand All @@ -636,7 +631,7 @@ int CVodeGetJacNumSteps(void* cvode_mem, long int* nst_J)
int retval;

/* access CVLsMem structure; set output and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetJacNumSteps", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return retval; }
*nst_J = cvls_mem->nstlj;
return CVLS_SUCCESS;
Expand All @@ -653,7 +648,7 @@ int CVodeGetLinWorkSpace(void* cvode_mem, long int* lenrwLS, long int* leniwLS)
int retval;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetLinWorkSpace", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* start with fixed sizes plus vector/matrix pointers */
Expand Down Expand Up @@ -704,7 +699,7 @@ int CVodeGetNumJacEvals(void* cvode_mem, long int* njevals)
int retval;

/* access CVLsMem structure; set output value and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetNumJacEvals", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }
*njevals = cvls_mem->nje;
return (CVLS_SUCCESS);
Expand All @@ -720,8 +715,7 @@ int CVodeGetNumLinRhsEvals(void* cvode_mem, long int* nfevalsLS)
int retval;

/* access CVLsMem structure; set output value and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetNumLinRhsEvals", &cv_mem,
&cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }
*nfevalsLS = cvls_mem->nfeDQ;
return (CVLS_SUCCESS);
Expand All @@ -736,7 +730,7 @@ int CVodeGetNumPrecEvals(void* cvode_mem, long int* npevals)
int retval;

/* access CVLsMem structure; set output value and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetNumPrecEvals", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }
*npevals = cvls_mem->npe;
return (CVLS_SUCCESS);
Expand All @@ -751,8 +745,7 @@ int CVodeGetNumPrecSolves(void* cvode_mem, long int* npsolves)
int retval;

/* access CVLsMem structure; set output value and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetNumPrecSolves", &cv_mem,
&cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }
*npsolves = cvls_mem->nps;
return (CVLS_SUCCESS);
Expand All @@ -767,7 +760,7 @@ int CVodeGetNumLinIters(void* cvode_mem, long int* nliters)
int retval;

/* access CVLsMem structure; set output value and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetNumLinIters", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }
*nliters = cvls_mem->nli;
return (CVLS_SUCCESS);
Expand All @@ -782,8 +775,7 @@ int CVodeGetNumLinConvFails(void* cvode_mem, long int* nlcfails)
int retval;

/* access CVLsMem structure; set output value and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetNumLinConvFails", &cv_mem,
&cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }
*nlcfails = cvls_mem->ncfl;
return (CVLS_SUCCESS);
Expand All @@ -798,8 +790,7 @@ int CVodeGetNumJTSetupEvals(void* cvode_mem, long int* njtsetups)
int retval;

/* access CVLsMem structure; set output value and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetNumJTSetupEvals", &cv_mem,
&cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }
*njtsetups = cvls_mem->njtsetup;
return (CVLS_SUCCESS);
Expand All @@ -814,8 +805,7 @@ int CVodeGetNumJtimesEvals(void* cvode_mem, long int* njvevals)
int retval;

/* access CVLsMem structure; set output value and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetNumJtimesEvals", &cv_mem,
&cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }
*njvevals = cvls_mem->njtimes;
return (CVLS_SUCCESS);
Expand All @@ -832,8 +822,7 @@ int CVodeGetLinSolveStats(void* cvode_mem, long int* njevals, long int* nfevalsL
int retval;

/* access CVLsMem structure; set output value and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetLinSolveStats", &cv_mem,
&cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

*njevals = cvls_mem->nje;
Expand All @@ -856,7 +845,7 @@ int CVodeGetLastLinFlag(void* cvode_mem, long int* flag)
int retval;

/* access CVLsMem structure; set output value and return */
retval = cvLs_AccessLMem(cvode_mem, "CVodeGetLastLinFlag", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }
*flag = cvls_mem->last_flag;
return (CVLS_SUCCESS);
Expand Down Expand Up @@ -907,7 +896,7 @@ int cvLsATimes(void* cvode_mem, N_Vector v, N_Vector z)
int retval;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "cvLsATimes", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* call Jacobian-times-vector product routine
Expand Down Expand Up @@ -940,7 +929,7 @@ int cvLsPSetup(void* cvode_mem)
CVLsMem cvls_mem;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "cvLsPSetup", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* Call user pset routine to update preconditioner and possibly
Expand Down Expand Up @@ -970,7 +959,7 @@ int cvLsPSolve(void* cvode_mem, N_Vector r, N_Vector z, sunrealtype tol, int lr)
int retval;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "cvLsPSolve", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* call the user-supplied psolve routine, and accumulate count */
Expand Down Expand Up @@ -1279,7 +1268,7 @@ int cvLsDQJtimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y,
int iter, retval;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "cvLsDQJtimes", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* Initialize perturbation to 1/||v|| */
Expand Down Expand Up @@ -1325,7 +1314,7 @@ static int cvLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A,
int retval;

/* access CVLsMem structure */
retval = cvLs_AccessLMem(cvode_mem, "cvLsLinSys", &cv_mem, &cvls_mem);
retval = cvLs_AccessLMem(cvode_mem, __func__, &cv_mem, &cvls_mem);
if (retval != CVLS_SUCCESS) { return (retval); }

/* Check if Jacobian needs to be updated */
Expand Down Expand Up @@ -1917,14 +1906,14 @@ int cvLs_AccessLMem(void* cvode_mem, const char* fname, CVodeMem* cv_mem,
{
if (cvode_mem == NULL)
{
cvProcessError(NULL, CVLS_MEM_NULL, __LINE__, __func__, __FILE__,
cvProcessError(NULL, CVLS_MEM_NULL, __LINE__, fname, __FILE__,
MSG_LS_CVMEM_NULL);
return (CVLS_MEM_NULL);
}
*cv_mem = (CVodeMem)cvode_mem;
if ((*cv_mem)->cv_lmem == NULL)
{
cvProcessError(*cv_mem, CVLS_LMEM_NULL, __LINE__, __func__, __FILE__,
cvProcessError(*cv_mem, CVLS_LMEM_NULL, __LINE__, fname, __FILE__,
MSG_LS_LMEM_NULL);
return (CVLS_LMEM_NULL);
}
Expand Down
Loading
Loading