1 /* -----------------------------------------------------------------
2  * Programmer(s): Daniel R. Reynolds @ SMU
3  *                Radu Serban @ 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  * This is the header file for the CVBBDPRE module, for a
16  * band-block-diagonal preconditioner, i.e. a block-diagonal
17  * matrix with banded blocks.
18  * -----------------------------------------------------------------*/
19 
20 #ifndef _CVSBBDPRE_H
21 #define _CVSBBDPRE_H
22 
23 #include <sundials/sundials_nvector.h>
24 
25 #ifdef __cplusplus  /* wrapper to enable C++ usage */
26 extern "C" {
27 #endif
28 
29 
30 /*-----------------
31   FORWARD PROBLEMS
32   -----------------*/
33 
34 /* User-supplied function Types */
35 
36 typedef int (*CVLocalFn)(sunindextype Nlocal, realtype t,
37                          N_Vector y, N_Vector g, void *user_data);
38 
39 typedef int (*CVCommFn)(sunindextype Nlocal, realtype t,
40                         N_Vector y, void *user_data);
41 
42 /* Exported Functions */
43 
44 SUNDIALS_EXPORT int CVBBDPrecInit(void *cvode_mem, sunindextype Nlocal,
45                                   sunindextype mudq, sunindextype mldq,
46                                   sunindextype mukeep, sunindextype mlkeep,
47                                   realtype dqrely, CVLocalFn gloc, CVCommFn cfn);
48 
49 SUNDIALS_EXPORT int CVBBDPrecReInit(void *cvode_mem,
50                                     sunindextype mudq, sunindextype mldq,
51                                     realtype dqrely);
52 
53 
54 /* Optional output functions */
55 
56 SUNDIALS_EXPORT int CVBBDPrecGetWorkSpace(void *cvode_mem,
57                                           long int *lenrwBBDP,
58                                           long int *leniwBBDP);
59 
60 SUNDIALS_EXPORT int CVBBDPrecGetNumGfnEvals(void *cvode_mem,
61                                             long int *ngevalsBBDP);
62 
63 
64 /*------------------
65   BACKWARD PROBLEMS
66   ------------------*/
67 
68 /* User-Supplied Function Types */
69 
70 typedef int (*CVLocalFnB)(sunindextype NlocalB, realtype t,
71                           N_Vector y, N_Vector yB, N_Vector gB, void *user_dataB);
72 
73 typedef int (*CVCommFnB)(sunindextype NlocalB, realtype t,
74                          N_Vector y, N_Vector yB, void *user_dataB);
75 
76 
77 /* Exported Functions */
78 
79 SUNDIALS_EXPORT int CVBBDPrecInitB(void *cvode_mem, int which, sunindextype NlocalB,
80                                    sunindextype mudqB, sunindextype mldqB,
81                                    sunindextype mukeepB, sunindextype mlkeepB,
82                                    realtype dqrelyB, CVLocalFnB glocB, CVCommFnB cfnB);
83 
84 SUNDIALS_EXPORT int CVBBDPrecReInitB(void *cvode_mem, int which,
85                                      sunindextype mudqB, sunindextype mldqB,
86                                      realtype dqrelyB);
87 
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif
94