xref: /petsc/src/ksp/pc/impls/bjacobi/ftn-custom/zbjacobif.c (revision 2ae2db358559b5b4e2d021d6074243931b3b092d)
16dd63270SBarry 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
6*36083efbSBarry Smith   #define pcbjacobirestoresubksp_ PCBJACOBIRESTORESUBKSP
7e54e4138SSatish Balay #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
8ce78bad3SBarry Smith   #define pcbjacobigetsubksp_     pcbjacobigetsubksp
9*36083efbSBarry Smith   #define pcbjacobirestoresubksp_ pcbjacobirestoresubksp
10e54e4138SSatish Balay #endif
11e54e4138SSatish Balay 
pcbjacobigetsubksp_(PC * pc,PetscInt * n_local,PetscInt * first_local,F90Array1d * ksp,PetscErrorCode * ierr PETSC_F90_2PTR_PROTO (ptrd))12ce78bad3SBarry Smith PETSC_EXTERN void pcbjacobigetsubksp_(PC *pc, PetscInt *n_local, PetscInt *first_local, F90Array1d *ksp, PetscErrorCode *ierr PETSC_F90_2PTR_PROTO(ptrd))
13e54e4138SSatish Balay {
14e54e4138SSatish Balay   KSP     *tksp;
15ce78bad3SBarry Smith   PetscInt nloc, flocal;
16ce78bad3SBarry Smith 
17e54e4138SSatish Balay   CHKFORTRANNULLINTEGER(n_local);
18e54e4138SSatish Balay   CHKFORTRANNULLINTEGER(first_local);
19ce78bad3SBarry Smith   *ierr = PCBJacobiGetSubKSP(*pc, &nloc, &flocal, &tksp);
20e54e4138SSatish Balay   if (n_local) *n_local = nloc;
21ce78bad3SBarry Smith   if (first_local) *first_local = flocal;
22*36083efbSBarry Smith   *ierr = F90Array1dCreate(tksp, MPIU_FORTRANADDR, 1, nloc, ksp PETSC_F90_2PTR_PARAM(ptrd));
23*36083efbSBarry Smith }
24*36083efbSBarry Smith 
pcbjacobirestoresubksp_(PC * pc,PetscInt * n_local,PetscInt * first_local,F90Array1d * ksp,PetscErrorCode * ierr PETSC_F90_2PTR_PROTO (ptrd))25*36083efbSBarry Smith PETSC_EXTERN void pcbjacobirestoresubksp_(PC *pc, PetscInt *n_local, PetscInt *first_local, F90Array1d *ksp, PetscErrorCode *ierr PETSC_F90_2PTR_PROTO(ptrd))
26*36083efbSBarry Smith {
27*36083efbSBarry Smith   *ierr = F90Array1dDestroy(ksp, MPIU_FORTRANADDR PETSC_F90_2PTR_PARAM(ptrd));
2817a42bb7SSatish Balay }
29