Date: 2025-03-29T05:58:29+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: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
      7:   #define pcbjacobigetsubksp_ pcbjacobigetsubksp
      8: #endif

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

     16:   CHKFORTRANNULLINTEGER(n_local);
     17:   CHKFORTRANNULLINTEGER(first_local);
     18:   *ierr = PCBJacobiGetSubKSP(*pc, &nloc, &flocal, &tksp);
     19:   if (n_local) *n_local = nloc;
     20:   if (first_local) *first_local = flocal;
     21:   *ierr = F90Array1dAccess(ksp, MPIU_FORTRANADDR, (void **)&iksp PETSC_F90_2PTR_PARAM(ptrd));
     22:   if (*ierr) return;
     23:   if (!iksp || *iksp == 0) { *ierr = F90Array1dCreate(tksp, MPIU_FORTRANADDR, 1, nloc, ksp PETSC_F90_2PTR_PARAM(ptrd)); }
     24: }