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  * This is the header file for the ARKBBDPRE module, for a
15  * band-block-diagonal preconditioner, i.e. a block-diagonal
16  * matrix with banded blocks.
17  * -----------------------------------------------------------------*/
18 
19 #ifndef _ARKBBDPRE_H
20 #define _ARKBBDPRE_H
21 
22 #include <sundials/sundials_nvector.h>
23 
24 #ifdef __cplusplus  /* wrapper to enable C++ usage */
25 extern "C" {
26 #endif
27 
28 
29 /* User-supplied function Types */
30 
31 typedef int (*ARKLocalFn)(sunindextype Nlocal, realtype t,
32                           N_Vector y, N_Vector g, void *user_data);
33 
34 typedef int (*ARKCommFn)(sunindextype Nlocal, realtype t,
35                          N_Vector y, void *user_data);
36 
37 /* Exported Functions */
38 
39 SUNDIALS_EXPORT int ARKBBDPrecInit(void *arkode_mem,
40                                    sunindextype Nlocal,
41                                    sunindextype mudq,
42                                    sunindextype mldq,
43                                    sunindextype mukeep,
44                                    sunindextype mlkeep,
45                                    realtype dqrely,
46                                    ARKLocalFn gloc,
47                                    ARKCommFn cfn);
48 
49 SUNDIALS_EXPORT int ARKBBDPrecReInit(void *arkode_mem,
50                                      sunindextype mudq,
51                                      sunindextype mldq,
52                                      realtype dqrely);
53 
54 /* Optional output functions */
55 
56 SUNDIALS_EXPORT int ARKBBDPrecGetWorkSpace(void *arkode_mem,
57                                            long int *lenrwBBDP,
58                                            long int *leniwBBDP);
59 
60 SUNDIALS_EXPORT int ARKBBDPrecGetNumGfnEvals(void *arkode_mem,
61                                              long int *ngevalsBBDP);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif
68