xref: /petsc/src/ksp/pc/impls/gasm/ftn-custom/zgasmf.c (revision b59c00aac33bcee8adab1e4f09d5a24aa820f6bc)
1 #include <petsc/private/fortranimpl.h>
2 #include <petscksp.h>
3 
4 #if defined(PETSC_HAVE_FORTRAN_CAPS)
5   #define pcgasmgetsubksp1_ PCGASMGETSUBKSP1
6   #define pcgasmgetsubksp2_ PCGASMGETSUBKSP2
7   #define pcgasmgetsubksp3_ PCGASMGETSUBKSP3
8   #define pcgasmgetsubksp4_ PCGASMGETSUBKSP4
9   #define pcgasmgetsubksp5_ PCGASMGETSUBKSP5
10   #define pcgasmgetsubksp6_ PCGASMGETSUBKSP6
11   #define pcgasmgetsubksp7_ PCGASMGETSUBKSP7
12   #define pcgasmgetsubksp8_ PCGASMGETSUBKSP8
13 #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
14   #define pcgasmgetsubksp1_ pcgasmgetsubksp1
15   #define pcgasmgetsubksp2_ pcgasmgetsubksp2
16   #define pcgasmgetsubksp3_ pcgasmgetsubksp3
17   #define pcgasmgetsubksp4_ pcgasmgetsubksp4
18   #define pcgasmgetsubksp5_ pcgasmgetsubksp5
19   #define pcgasmgetsubksp6_ pcgasmgetsubksp6
20   #define pcgasmgetsubksp7_ pcgasmgetsubksp7
21   #define pcgasmgetsubksp8_ pcgasmgetsubksp8
22 #endif
23 
24 PETSC_EXTERN void pcgasmgetsubksp1_(PC *pc, PetscInt *n_local, PetscInt *first_local, KSP *ksp, PetscErrorCode *ierr)
25 {
26   KSP     *tksp;
27   PetscInt i, nloc;
28   CHKFORTRANNULLINTEGER(n_local);
29   CHKFORTRANNULLINTEGER(first_local);
30   CHKFORTRANNULLOBJECT(ksp);
31   *ierr = PCGASMGetSubKSP(*pc, &nloc, first_local, &tksp);
32   if (n_local) *n_local = nloc;
33   if (ksp) {
34     for (i = 0; i < nloc; i++) ksp[i] = tksp[i];
35   }
36 }
37 
38 PETSC_EXTERN void pcgasmgetsubksp2_(PC *pc, PetscInt *n_local, PetscInt *first_local, KSP *ksp, PetscErrorCode *ierr)
39 {
40   pcgasmgetsubksp1_(pc, n_local, first_local, ksp, ierr);
41 }
42 
43 PETSC_EXTERN void pcgasmgetsubksp3_(PC *pc, PetscInt *n_local, PetscInt *first_local, KSP *ksp, PetscErrorCode *ierr)
44 {
45   pcgasmgetsubksp1_(pc, n_local, first_local, ksp, ierr);
46 }
47 
48 PETSC_EXTERN void pcgasmgetsubksp4_(PC *pc, PetscInt *n_local, PetscInt *first_local, KSP *ksp, PetscErrorCode *ierr)
49 {
50   pcgasmgetsubksp1_(pc, n_local, first_local, ksp, ierr);
51 }
52 
53 PETSC_EXTERN void pcgasmgetsubksp5_(PC *pc, PetscInt *n_local, PetscInt *first_local, KSP *ksp, PetscErrorCode *ierr)
54 {
55   pcgasmgetsubksp1_(pc, n_local, first_local, ksp, ierr);
56 }
57 
58 PETSC_EXTERN void pcgasmgetsubksp6_(PC *pc, PetscInt *n_local, PetscInt *first_local, KSP *ksp, PetscErrorCode *ierr)
59 {
60   pcgasmgetsubksp1_(pc, n_local, first_local, ksp, ierr);
61 }
62 
63 PETSC_EXTERN void pcgasmgetsubksp7_(PC *pc, PetscInt *n_local, PetscInt *first_local, KSP *ksp, PetscErrorCode *ierr)
64 {
65   pcgasmgetsubksp1_(pc, n_local, first_local, ksp, ierr);
66 }
67 
68 PETSC_EXTERN void pcgasmgetsubksp8_(PC *pc, PetscInt *n_local, PetscInt *first_local, KSP *ksp, PetscErrorCode *ierr)
69 {
70   pcgasmgetsubksp1_(pc, n_local, first_local, ksp, ierr);
71 }
72