Date: 2026-03-31T05:46:16+00:00

Actual source code: zbjacobif.c

      1: #include <petsc/private/ftnimpl.h>
      2: #include <petscksp.h>

      4: #if defined(PETSC_HAVE_FORTRAN_CAPS)
      5:   #define pcbjacobigetsubksp_     PCBJACOBIGETSUBKSP
      6:   #define pcbjacobirestoresubksp_ PCBJACOBIRESTORESUBKSP
      7: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
      8:   #define pcbjacobigetsubksp_     pcbjacobigetsubksp
      9:   #define pcbjacobirestoresubksp_ pcbjacobirestoresubksp
     10: #endif

     12: PETSC_EXTERN void pcbjacobigetsubksp_(PC *pc, PetscInt *n_local, PetscInt *first_local, F90Array1d *ksp, PetscErrorCode *ierr PETSC_F90_2PTR_PROTO(ptrd))
     13: {
     14:   KSP     *tksp;
     15:   PetscInt nloc, flocal;

     17:   CHKFORTRANNULLINTEGER(n_local);
     18:   CHKFORTRANNULLINTEGER(first_local);
     19:   *ierr = PCBJacobiGetSubKSP(*pc, &nloc, &flocal, &tksp);
     20:   if (n_local) *n_local = nloc;
     21:   if (first_local) *first_local = flocal;
     22:   *ierr = F90Array1dCreate(tksp, MPIU_FORTRANADDR, 1, nloc, ksp PETSC_F90_2PTR_PARAM(ptrd));
     23: }

     25: PETSC_EXTERN void pcbjacobirestoresubksp_(PC *pc, PetscInt *n_local, PetscInt *first_local, F90Array1d *ksp, PetscErrorCode *ierr PETSC_F90_2PTR_PROTO(ptrd))
     26: {
     27:   *ierr = F90Array1dDestroy(ksp, MPIU_FORTRANADDR PETSC_F90_2PTR_PARAM(ptrd));
     28: }