1 /* -----------------------------------------------------------------
2  * Programmer(s): Daniel R. Reynolds @ SMU
3  * -----------------------------------------------------------------
4  * SUNDIALS Copyright Start
5  * Copyright (c) 2002-2020, Lawrence Livermore National Security
6  * and Southern Methodist University.
7  * All rights reserved.
8  *
9  * See the top-level LICENSE and NOTICE files for details.
10  *
11  * SPDX-License-Identifier: BSD-3-Clause
12  * SUNDIALS Copyright End
13  * -----------------------------------------------------------------
14  * Header file for the deprecated Scaled, Preconditioned Iterative
15  * Linear Solver interface in CVODE; these routines now just wrap
16  * the updated CVODE generic linear solver interface in cvode_ls.h.
17  * -----------------------------------------------------------------*/
18 
19 #ifndef _CVSPILS_H
20 #define _CVSPILS_H
21 
22 #include <cvode/cvode_ls.h>
23 
24 #ifdef __cplusplus  /* wrapper to enable C++ usage */
25 extern "C" {
26 #endif
27 
28 
29 /*===============================================================
30   Function Types (typedefs for equivalent types in cvode_ls.h)
31   ===============================================================*/
32 
33 typedef CVLsPrecSetupFn CVSpilsPrecSetupFn;
34 typedef CVLsPrecSolveFn CVSpilsPrecSolveFn;
35 typedef CVLsJacTimesSetupFn CVSpilsJacTimesSetupFn;
36 typedef CVLsJacTimesVecFn CVSpilsJacTimesVecFn;
37 
38 /*====================================================================
39   Exported Functions (wrappers for equivalent routines in cvode_ls.h)
40   ====================================================================*/
41 
42 SUNDIALS_EXPORT int CVSpilsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS);
43 
44 SUNDIALS_EXPORT int CVSpilsSetEpsLin(void *cvode_mem, realtype eplifac);
45 
46 SUNDIALS_EXPORT int CVSpilsSetPreconditioner(void *cvode_mem, CVSpilsPrecSetupFn pset,
47                              CVSpilsPrecSolveFn psolve);
48 
49 SUNDIALS_EXPORT int CVSpilsSetJacTimes(void *cvode_mem, CVSpilsJacTimesSetupFn jtsetup,
50                        CVSpilsJacTimesVecFn jtimes);
51 
52 SUNDIALS_EXPORT int CVSpilsGetWorkSpace(void *cvode_mem, long int *lenrwLS,
53                         long int *leniwLS);
54 
55 SUNDIALS_EXPORT int CVSpilsGetNumPrecEvals(void *cvode_mem, long int *npevals);
56 
57 SUNDIALS_EXPORT int CVSpilsGetNumPrecSolves(void *cvode_mem, long int *npsolves);
58 
59 SUNDIALS_EXPORT int CVSpilsGetNumLinIters(void *cvode_mem, long int *nliters);
60 
61 SUNDIALS_EXPORT int CVSpilsGetNumConvFails(void *cvode_mem, long int *nlcfails);
62 
63 SUNDIALS_EXPORT int CVSpilsGetNumJTSetupEvals(void *cvode_mem, long int *njtsetups);
64 
65 SUNDIALS_EXPORT int CVSpilsGetNumJtimesEvals(void *cvode_mem, long int *njvevals);
66 
67 SUNDIALS_EXPORT int CVSpilsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS);
68 
69 SUNDIALS_EXPORT int CVSpilsGetLastFlag(void *cvode_mem, long int *flag);
70 
71 SUNDIALS_EXPORT char *CVSpilsGetReturnFlagName(long int flag);
72 
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif
79