xref: /petsc/src/ksp/pc/impls/gasm/ftn-custom/zgasmf.c (revision ab32a8f333ac0303adfd31137139d114f03757c4)
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)
5*ab32a8f3SSatish Balay #define pcgasmgetsubksp1_           PCGASMGETSUBKSP1
6*ab32a8f3SSatish Balay #define pcgasmgetsubksp2_           PCGASMGETSUBKSP2
7768de9afSRichard Tran Mills #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
8*ab32a8f3SSatish Balay #define pcgasmgetsubksp1_           pcgasmgetsubksp1
9*ab32a8f3SSatish Balay #define pcgasmgetsubksp2_           pcgasmgetsubksp2
10768de9afSRichard Tran Mills #endif
11768de9afSRichard Tran Mills 
12*ab32a8f3SSatish Balay PETSC_EXTERN void pcgasmgetsubksp1_(PC *pc,PetscInt *n_local,PetscInt *first_local,KSP *ksp,PetscErrorCode *ierr)
13768de9afSRichard Tran Mills {
14768de9afSRichard Tran Mills   KSP      *tksp;
15768de9afSRichard Tran Mills   PetscInt i,nloc;
16768de9afSRichard Tran Mills   CHKFORTRANNULLINTEGER(n_local);
17768de9afSRichard Tran Mills   CHKFORTRANNULLINTEGER(first_local);
18768de9afSRichard Tran Mills   CHKFORTRANNULLOBJECT(ksp);
19768de9afSRichard Tran Mills   *ierr = PCGASMGetSubKSP(*pc,&nloc,first_local,&tksp);
20768de9afSRichard Tran Mills   if (n_local) *n_local = nloc;
21768de9afSRichard Tran Mills   if (ksp) {
22768de9afSRichard Tran Mills     for (i=0; i<nloc; i++) ksp[i] = tksp[i];
23768de9afSRichard Tran Mills   }
24768de9afSRichard Tran Mills }
25768de9afSRichard Tran Mills 
26*ab32a8f3SSatish Balay PETSC_EXTERN void pcgasmgetsubksp2_(PC *pc,PetscInt *n_local,PetscInt *first_local,KSP *ksp,PetscErrorCode *ierr)
27*ab32a8f3SSatish Balay {
28*ab32a8f3SSatish Balay   pcgasmgetsubksp1_(pc,n_local,first_local,ksp,ierr);
29*ab32a8f3SSatish Balay }
30