1 
2 #include <petscis.h>
3 #include <petsc/private/f90impl.h>
4 
5 #if defined(PETSC_HAVE_FORTRAN_CAPS)
6 #define islocaltoglobalmappinggetindicesf90_           ISLOCALTOGLOBALMAPPINGGETINDICESF90
7 #define islocaltoglobalmappingrestoreindicesf90_       ISLOCALTOGLOBALMAPPINGRESTOREINDICESF90
8 #define islocaltoglobalmappinggetblockindicesf90_      ISLOCALTOGLOBALMAPPINGGETBLOCKINDICESF90
9 #define islocaltoglobalmappingrestoreblockindicesf90_  ISLOCALTOGLOBALMAPPINGRESTOREBLOCKINDICESF90
10 #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
11 #define islocaltoglobalmappinggetindicesf90_           islocaltoglobalmappinggetindicesf90
12 #define islocaltoglobalmappingrestoreindicesf90_       islocaltoglobalmappingrestoreindicesf90
13 #define islocaltoglobalmappinggetblockindicesf90_      islocaltoglobalmappinggetblockindicesf90
14 #define islocaltoglobalmappingrestoreblockindicesf90_  islocaltoglobalmappingrestoreblockindicesf90
15 #endif
16 
islocaltoglobalmappinggetindicesf90_(ISLocalToGlobalMapping * da,F90Array1d * indices,int * ierr PETSC_F90_2PTR_PROTO (ptrd))17 PETSC_EXTERN void islocaltoglobalmappinggetindicesf90_(ISLocalToGlobalMapping *da,F90Array1d *indices,int *ierr PETSC_F90_2PTR_PROTO(ptrd))
18 {
19   const PetscInt *idx;
20   PetscInt       n;
21   *ierr = ISLocalToGlobalMappingGetIndices(*da,&idx); if (*ierr) return;
22   *ierr = ISLocalToGlobalMappingGetSize(*da,&n); if (*ierr) return;
23   *ierr = F90Array1dCreate((void*)idx,MPIU_INT,1,n,indices PETSC_F90_2PTR_PARAM(ptrd));
24 }
25 
islocaltoglobalmappingrestoreindicesf90_(ISLocalToGlobalMapping * da,F90Array1d * ptr,int * ierr PETSC_F90_2PTR_PROTO (ptrd))26 PETSC_EXTERN void islocaltoglobalmappingrestoreindicesf90_(ISLocalToGlobalMapping *da,F90Array1d *ptr,int *ierr PETSC_F90_2PTR_PROTO(ptrd))
27 {
28   const PetscInt *fa;
29 
30   *ierr = F90Array1dAccess(ptr,MPIU_INT,(void**)&fa PETSC_F90_2PTR_PARAM(ptrd));if (*ierr) return;
31   *ierr = F90Array1dDestroy(ptr,MPIU_INT PETSC_F90_2PTR_PARAM(ptrd));if (*ierr) return;
32   *ierr = ISLocalToGlobalMappingRestoreIndices(*da,&fa); if (*ierr) return;
33 }
34 
islocaltoglobalmappinggetblockindicesf90_(ISLocalToGlobalMapping * da,F90Array1d * indices,int * ierr PETSC_F90_2PTR_PROTO (ptrd))35 PETSC_EXTERN void islocaltoglobalmappinggetblockindicesf90_(ISLocalToGlobalMapping *da,F90Array1d *indices,int *ierr PETSC_F90_2PTR_PROTO(ptrd))
36 {
37   const PetscInt *idx;
38   PetscInt       n;
39   *ierr = ISLocalToGlobalMappingGetBlockIndices(*da,&idx); if (*ierr) return;
40   *ierr = ISLocalToGlobalMappingGetSize(*da,&n); if (*ierr) return;
41   *ierr = F90Array1dCreate((void*)idx,MPIU_INT,1,n,indices PETSC_F90_2PTR_PARAM(ptrd));
42 }
43 
islocaltoglobalmappingrestoreblockindicesf90_(ISLocalToGlobalMapping * da,F90Array1d * ptr,int * ierr PETSC_F90_2PTR_PROTO (ptrd))44 PETSC_EXTERN void islocaltoglobalmappingrestoreblockindicesf90_(ISLocalToGlobalMapping *da,F90Array1d *ptr,int *ierr PETSC_F90_2PTR_PROTO(ptrd))
45 {
46   const PetscInt *fa;
47 
48   *ierr = F90Array1dAccess(ptr,MPIU_INT,(void**)&fa PETSC_F90_2PTR_PARAM(ptrd));if (*ierr) return;
49   *ierr = F90Array1dDestroy(ptr,MPIU_INT PETSC_F90_2PTR_PARAM(ptrd));if (*ierr) return;
50   *ierr = ISLocalToGlobalMappingRestoreBlockIndices(*da,&fa); if (*ierr) return;
51 }
52 
53 
54 
55