Actual source code: zblockf90.c

      1: #include <petscis.h>
      2: #include <petsc/private/f90impl.h>

      4: #if defined(PETSC_HAVE_FORTRAN_CAPS)
      5:   #define isblockgetindicesf90_     ISBLOCKGETINDICESF90
      6:   #define isblockrestoreindicesf90_ ISBLOCKRESTOREINDICESF90
      7: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
      8:   #define isblockgetindicesf90_     isblockgetindicesf90
      9:   #define isblockrestoreindicesf90_ isblockrestoreindicesf90
     10: #endif

     12: PETSC_EXTERN void isblockgetindicesf90_(IS *x, F90Array1d *ptr, int *__ierr PETSC_F90_2PTR_PROTO(ptrd))
     13: {
     14:   const PetscInt *fa;
     15:   PetscInt        len;
     16:   *__ierr = ISBlockGetIndices(*x, &fa);
     17:   if (*__ierr) return;
     18:   *__ierr = ISBlockGetLocalSize(*x, &len);
     19:   if (*__ierr) return;
     20:   *__ierr = F90Array1dCreate((void *)fa, MPIU_INT, 1, len, ptr PETSC_F90_2PTR_PARAM(ptrd));
     21: }
     22: PETSC_EXTERN void isblockrestoreindicesf90_(IS *x, F90Array1d *ptr, int *__ierr PETSC_F90_2PTR_PROTO(ptrd))
     23: {
     24:   const PetscInt *fa;
     25:   *__ierr = F90Array1dAccess(ptr, MPIU_INT, (void **)&fa PETSC_F90_2PTR_PARAM(ptrd));
     26:   if (*__ierr) return;
     27:   *__ierr = F90Array1dDestroy(ptr, MPIU_INT PETSC_F90_2PTR_PARAM(ptrd));
     28:   if (*__ierr) return;
     29:   *__ierr = ISBlockRestoreIndices(*x, &fa);
     30: }