xref: /petsc/src/ksp/pc/impls/bjacobi/ftn-custom/zbjacobif.c (revision 6dd63270497ad23dcf16ae500a87ff2b2a0b7474)
1*6dd63270SBarry Smith #include <petsc/private/ftnimpl.h>
2c6db04a5SJed Brown #include <petscksp.h>
3e54e4138SSatish Balay 
4e54e4138SSatish Balay #if defined(PETSC_HAVE_FORTRAN_CAPS)
5ce78bad3SBarry Smith   #define pcbjacobigetsubksp_ PCBJACOBIGETSUBKSP
6e54e4138SSatish Balay #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
7ce78bad3SBarry Smith   #define pcbjacobigetsubksp_ pcbjacobigetsubksp
8e54e4138SSatish Balay #endif
9e54e4138SSatish Balay 
10ce78bad3SBarry Smith PETSC_EXTERN void pcbjacobigetsubksp_(PC *pc, PetscInt *n_local, PetscInt *first_local, F90Array1d *ksp, PetscErrorCode *ierr PETSC_F90_2PTR_PROTO(ptrd))
11e54e4138SSatish Balay {
12e54e4138SSatish Balay   KSP     *tksp;
13ce78bad3SBarry Smith   PetscInt nloc, flocal;
14ce78bad3SBarry Smith   size_t  *iksp;
15ce78bad3SBarry Smith 
16e54e4138SSatish Balay   CHKFORTRANNULLINTEGER(n_local);
17e54e4138SSatish Balay   CHKFORTRANNULLINTEGER(first_local);
18ce78bad3SBarry Smith   *ierr = PCBJacobiGetSubKSP(*pc, &nloc, &flocal, &tksp);
19e54e4138SSatish Balay   if (n_local) *n_local = nloc;
20ce78bad3SBarry Smith   if (first_local) *first_local = flocal;
21ce78bad3SBarry Smith   *ierr = F90Array1dAccess(ksp, MPIU_FORTRANADDR, (void **)&iksp PETSC_F90_2PTR_PARAM(ptrd));
22ce78bad3SBarry Smith   if (*ierr) return;
23ce78bad3SBarry Smith   if (!iksp || *iksp == 0) { *ierr = F90Array1dCreate(tksp, MPIU_FORTRANADDR, 1, nloc, ksp PETSC_F90_2PTR_PARAM(ptrd)); }
2417a42bb7SSatish Balay }
25