xref: /petsc/src/ksp/pc/impls/gasm/ftn-custom/zgasmf.c (revision 59fc98c0e007577605bbd6efb456a2edcc99aaca)
1768de9afSRichard Tran Mills #include <petsc/private/fortranimpl.h>
2768de9afSRichard Tran Mills #include <petscksp.h>
3768de9afSRichard Tran Mills 
4768de9afSRichard Tran Mills #if defined(PETSC_HAVE_FORTRAN_CAPS)
5ab32a8f3SSatish Balay #define pcgasmgetsubksp1_           PCGASMGETSUBKSP1
6ab32a8f3SSatish Balay #define pcgasmgetsubksp2_           PCGASMGETSUBKSP2
7*59fc98c0SBarry Smith #define pcgasmgetsubksp3_           PCGASMGETSUBKSP3
8*59fc98c0SBarry Smith #define pcgasmgetsubksp4_           PCGASMGETSUBKSP4
9*59fc98c0SBarry Smith #define pcgasmgetsubksp5_           PCGASMGETSUBKSP5
10*59fc98c0SBarry Smith #define pcgasmgetsubksp6_           PCGASMGETSUBKSP6
11*59fc98c0SBarry Smith #define pcgasmgetsubksp7_           PCGASMGETSUBKSP7
12*59fc98c0SBarry Smith #define pcgasmgetsubksp8_           PCGASMGETSUBKSP8
13768de9afSRichard Tran Mills #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
14ab32a8f3SSatish Balay #define pcgasmgetsubksp1_           pcgasmgetsubksp1
15ab32a8f3SSatish Balay #define pcgasmgetsubksp2_           pcgasmgetsubksp2
16*59fc98c0SBarry Smith #define pcgasmgetsubksp3_           pcgasmgetsubksp3
17*59fc98c0SBarry Smith #define pcgasmgetsubksp4_           pcgasmgetsubksp4
18*59fc98c0SBarry Smith #define pcgasmgetsubksp5_           pcgasmgetsubksp5
19*59fc98c0SBarry Smith #define pcgasmgetsubksp6_           pcgasmgetsubksp6
20*59fc98c0SBarry Smith #define pcgasmgetsubksp7_           pcgasmgetsubksp7
21*59fc98c0SBarry Smith #define pcgasmgetsubksp8_           pcgasmgetsubksp8
22768de9afSRichard Tran Mills #endif
23768de9afSRichard Tran Mills 
24ab32a8f3SSatish Balay PETSC_EXTERN void pcgasmgetsubksp1_(PC *pc,PetscInt *n_local,PetscInt *first_local,KSP *ksp,PetscErrorCode *ierr)
25768de9afSRichard Tran Mills {
26768de9afSRichard Tran Mills   KSP      *tksp;
27768de9afSRichard Tran Mills   PetscInt i,nloc;
28768de9afSRichard Tran Mills   CHKFORTRANNULLINTEGER(n_local);
29768de9afSRichard Tran Mills   CHKFORTRANNULLINTEGER(first_local);
30768de9afSRichard Tran Mills   CHKFORTRANNULLOBJECT(ksp);
31768de9afSRichard Tran Mills   *ierr = PCGASMGetSubKSP(*pc,&nloc,first_local,&tksp);
32768de9afSRichard Tran Mills   if (n_local) *n_local = nloc;
33768de9afSRichard Tran Mills   if (ksp) {
34768de9afSRichard Tran Mills     for (i=0; i<nloc; i++) ksp[i] = tksp[i];
35768de9afSRichard Tran Mills   }
36768de9afSRichard Tran Mills }
37768de9afSRichard Tran Mills 
38ab32a8f3SSatish Balay PETSC_EXTERN void pcgasmgetsubksp2_(PC *pc,PetscInt *n_local,PetscInt *first_local,KSP *ksp,PetscErrorCode *ierr)
39ab32a8f3SSatish Balay {
40ab32a8f3SSatish Balay   pcgasmgetsubksp1_(pc,n_local,first_local,ksp,ierr);
41ab32a8f3SSatish Balay }
42*59fc98c0SBarry Smith 
43*59fc98c0SBarry Smith PETSC_EXTERN void pcgasmgetsubksp3_(PC *pc,PetscInt *n_local,PetscInt *first_local,KSP *ksp,PetscErrorCode *ierr)
44*59fc98c0SBarry Smith {
45*59fc98c0SBarry Smith   pcgasmgetsubksp1_(pc,n_local,first_local,ksp,ierr);
46*59fc98c0SBarry Smith }
47*59fc98c0SBarry Smith 
48*59fc98c0SBarry Smith PETSC_EXTERN void pcgasmgetsubksp4_(PC *pc,PetscInt *n_local,PetscInt *first_local,KSP *ksp,PetscErrorCode *ierr)
49*59fc98c0SBarry Smith {
50*59fc98c0SBarry Smith   pcgasmgetsubksp1_(pc,n_local,first_local,ksp,ierr);
51*59fc98c0SBarry Smith }
52*59fc98c0SBarry Smith 
53*59fc98c0SBarry Smith PETSC_EXTERN void pcgasmgetsubksp5_(PC *pc,PetscInt *n_local,PetscInt *first_local,KSP *ksp,PetscErrorCode *ierr)
54*59fc98c0SBarry Smith {
55*59fc98c0SBarry Smith   pcgasmgetsubksp1_(pc,n_local,first_local,ksp,ierr);
56*59fc98c0SBarry Smith }
57*59fc98c0SBarry Smith 
58*59fc98c0SBarry Smith PETSC_EXTERN void pcgasmgetsubksp6_(PC *pc,PetscInt *n_local,PetscInt *first_local,KSP *ksp,PetscErrorCode *ierr)
59*59fc98c0SBarry Smith {
60*59fc98c0SBarry Smith   pcgasmgetsubksp1_(pc,n_local,first_local,ksp,ierr);
61*59fc98c0SBarry Smith }
62*59fc98c0SBarry Smith 
63*59fc98c0SBarry Smith PETSC_EXTERN void pcgasmgetsubksp7_(PC *pc,PetscInt *n_local,PetscInt *first_local,KSP *ksp,PetscErrorCode *ierr)
64*59fc98c0SBarry Smith {
65*59fc98c0SBarry Smith   pcgasmgetsubksp1_(pc,n_local,first_local,ksp,ierr);
66*59fc98c0SBarry Smith }
67*59fc98c0SBarry Smith 
68*59fc98c0SBarry Smith PETSC_EXTERN void pcgasmgetsubksp8_(PC *pc,PetscInt *n_local,PetscInt *first_local,KSP *ksp,PetscErrorCode *ierr)
69*59fc98c0SBarry Smith {
70*59fc98c0SBarry Smith   pcgasmgetsubksp1_(pc,n_local,first_local,ksp,ierr);
71*59fc98c0SBarry Smith }
72