Actual source code: ziscoloringf90.c

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

      4: #if defined(PETSC_HAVE_FORTRAN_CAPS)
      5:   #define iscoloringgetisf90_     ISCOLORINGGETISF90
      6:   #define iscoloringrestoreisf90_ ISCOLORINGRESTOREISF90
      7: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
      8:   #define iscoloringgetisf90_     iscoloringgetisf90
      9:   #define iscoloringrestoreisf90_ iscoloringrestoreisf90
     10: #endif

     12: PETSC_EXTERN void iscoloringgetisf90_(ISColoring *iscoloring, PetscCopyMode mode, PetscInt *n, F90Array1d *ptr, int *__ierr PETSC_F90_2PTR_PROTO(ptrd))
     13: {
     14:   IS               *lis;
     15:   PetscFortranAddr *newisint;
     16:   int               i;

     18:   *__ierr = ISColoringGetIS(*iscoloring, mode, n, &lis);
     19:   if (*__ierr) return;
     20:   *__ierr = PetscMalloc1(*n, &newisint);
     21:   if (*__ierr) return;
     22:   for (i = 0; i < *n; i++) newisint[i] = (PetscFortranAddr)lis[i];
     23:   *__ierr = F90Array1dCreate(newisint, MPIU_FORTRANADDR, 1, *n, ptr PETSC_F90_2PTR_PARAM(ptrd));
     24: }

     26: PETSC_EXTERN void iscoloringrestoreisf90_(ISColoring *iscoloring, PetscCopyMode mode, F90Array1d *ptr, int *__ierr PETSC_F90_2PTR_PROTO(ptrd))
     27: {
     28:   PetscFortranAddr *is;

     30:   *__ierr = F90Array1dAccess(ptr, MPIU_FORTRANADDR, (void **)&is PETSC_F90_2PTR_PARAM(ptrd));
     31:   if (*__ierr) return;
     32:   *__ierr = F90Array1dDestroy(ptr, MPIU_FORTRANADDR PETSC_F90_2PTR_PARAM(ptrd));
     33:   if (*__ierr) return;
     34:   *__ierr = ISColoringRestoreIS(*iscoloring, mode, (IS **)is);
     35:   if (*__ierr) return;
     36:   *__ierr = PetscFree(is);
     37: }