1 /*-----------------------------------------------------------------
2  * Programmer(s): Daniel R. Reynolds @ SMU
3  *         Alan Hindmarsh, Radu Serban and Aaron Collier @ LLNL
4  *-----------------------------------------------------------------
5  * SUNDIALS Copyright Start
6  * Copyright (c) 2002-2021, Lawrence Livermore National Security
7  * and Southern Methodist University.
8  * All rights reserved.
9  *
10  * See the top-level LICENSE and NOTICE files for details.
11  *
12  * SPDX-License-Identifier: BSD-3-Clause
13  * SUNDIALS Copyright End
14  *-----------------------------------------------------------------
15  * Implementation file for the deprecated Scaled and Preconditioned
16  * Iterative Linear Solver interface in IDA; these routines now just
17  * wrap the updated IDA generic linear solver interface in ida_ls.h.
18  *-----------------------------------------------------------------*/
19 
20 #include <ida/ida_ls.h>
21 #include <ida/ida_spils.h>
22 
23 #ifdef __cplusplus  /* wrapper to enable C++ usage */
24 extern "C" {
25 #endif
26 
27 /*=================================================================
28   Exported Functions (wrappers for equivalent routines in ida_ls.h)
29   =================================================================*/
30 
IDASpilsSetLinearSolver(void * ida_mem,SUNLinearSolver LS)31 int IDASpilsSetLinearSolver(void *ida_mem, SUNLinearSolver LS)
32 { return(IDASetLinearSolver(ida_mem, LS, NULL)); }
33 
IDASpilsSetPreconditioner(void * ida_mem,IDASpilsPrecSetupFn pset,IDASpilsPrecSolveFn psolve)34 int IDASpilsSetPreconditioner(void *ida_mem, IDASpilsPrecSetupFn pset,
35                               IDASpilsPrecSolveFn psolve)
36 { return(IDASetPreconditioner(ida_mem, pset, psolve)); }
37 
IDASpilsSetJacTimes(void * ida_mem,IDASpilsJacTimesSetupFn jtsetup,IDASpilsJacTimesVecFn jtimes)38 int IDASpilsSetJacTimes(void *ida_mem, IDASpilsJacTimesSetupFn jtsetup,
39                         IDASpilsJacTimesVecFn jtimes)
40 { return(IDASetJacTimes(ida_mem, jtsetup, jtimes)); }
41 
IDASpilsSetEpsLin(void * ida_mem,realtype eplifac)42 int IDASpilsSetEpsLin(void *ida_mem, realtype eplifac)
43 { return(IDASetEpsLin(ida_mem, eplifac)); }
44 
IDASpilsSetIncrementFactor(void * ida_mem,realtype dqincfac)45 int IDASpilsSetIncrementFactor(void *ida_mem, realtype dqincfac)
46 { return(IDASetIncrementFactor(ida_mem, dqincfac)); }
47 
IDASpilsGetWorkSpace(void * ida_mem,long int * lenrwLS,long int * leniwLS)48 int IDASpilsGetWorkSpace(void *ida_mem, long int *lenrwLS, long int *leniwLS)
49 { return(IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS)); }
50 
IDASpilsGetNumPrecEvals(void * ida_mem,long int * npevals)51 int IDASpilsGetNumPrecEvals(void *ida_mem, long int *npevals)
52 { return(IDAGetNumPrecEvals(ida_mem, npevals)); }
53 
IDASpilsGetNumPrecSolves(void * ida_mem,long int * npsolves)54 int IDASpilsGetNumPrecSolves(void *ida_mem, long int *npsolves)
55 { return(IDAGetNumPrecSolves(ida_mem, npsolves)); }
56 
IDASpilsGetNumLinIters(void * ida_mem,long int * nliters)57 int IDASpilsGetNumLinIters(void *ida_mem, long int *nliters)
58 { return(IDAGetNumLinIters(ida_mem, nliters)); }
59 
IDASpilsGetNumConvFails(void * ida_mem,long int * nlcfails)60 int IDASpilsGetNumConvFails(void *ida_mem, long int *nlcfails)
61 { return(IDAGetNumLinConvFails(ida_mem, nlcfails)); }
62 
IDASpilsGetNumJTSetupEvals(void * ida_mem,long int * njtsetups)63 int IDASpilsGetNumJTSetupEvals(void *ida_mem, long int *njtsetups)
64 { return(IDAGetNumJTSetupEvals(ida_mem, njtsetups)); }
65 
IDASpilsGetNumJtimesEvals(void * ida_mem,long int * njvevals)66 int IDASpilsGetNumJtimesEvals(void *ida_mem, long int *njvevals)
67 { return(IDAGetNumJtimesEvals(ida_mem, njvevals)); }
68 
IDASpilsGetNumResEvals(void * ida_mem,long int * nrevalsLS)69 int IDASpilsGetNumResEvals(void *ida_mem, long int *nrevalsLS)
70 { return(IDAGetNumLinResEvals(ida_mem, nrevalsLS)); }
71 
IDASpilsGetLastFlag(void * ida_mem,long int * flag)72 int IDASpilsGetLastFlag(void *ida_mem, long int *flag)
73 { return(IDAGetLastLinFlag(ida_mem, flag)); }
74 
IDASpilsGetReturnFlagName(long int flag)75 char *IDASpilsGetReturnFlagName(long int flag)
76 { return(IDAGetLinReturnFlagName(flag)); }
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82