1 #include <petscsection.h>
2 #include <petsc/private/f90impl.h>
3
4 #if defined(PETSC_HAVE_FORTRAN_CAPS)
5 #define petscsectiongetconstraintindicesf90_ PETSCSECTIONGETCONSTRAINTINDICESF90
6 #define petscsectionrestoreconstraintindicesf90_ PETSCSECTIONRESTORECONSTRAINTINDICESF90
7 #define petscsectionsetconstraintindicesf90_ PETSCSECTIONSETCONSTRAINTINDICESF90
8 #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
9 #define petscsectiongetconstraintindicesf90_ petscsectiongetconstraintindicesf90
10 #define petscsectionrestoreconstraintindicesf90_ petscsectionrestoreconstraintindicesf90
11 #define petscsectionsetconstraintindicesf90_ petscsectionsetconstraintindicesf90
12 #endif
13
petscsectiongetconstraintindicesf90_(PetscSection * s,PetscInt * point,F90Array1d * indices,int * ierr PETSC_F90_2PTR_PROTO (ptrd))14 PETSC_EXTERN void petscsectiongetconstraintindicesf90_(PetscSection *s, PetscInt *point, F90Array1d *indices, int *ierr PETSC_F90_2PTR_PROTO(ptrd))
15 {
16 const PetscInt *idx;
17 PetscInt n;
18
19 *ierr = PetscSectionGetConstraintIndices(*s, *point, &idx); if (*ierr) return;
20 *ierr = PetscSectionGetConstraintDof(*s, *point, &n); if (*ierr) return;
21 *ierr = F90Array1dCreate((void *) idx, MPIU_INT, 1, n, indices PETSC_F90_2PTR_PARAM(ptrd));
22 }
23
petscsectionrestoreconstraintindicesf90_(PetscSection * s,PetscInt * point,F90Array1d * indices,int * ierr PETSC_F90_2PTR_PROTO (ptrd))24 PETSC_EXTERN void petscsectionrestoreconstraintindicesf90_(PetscSection *s, PetscInt *point, F90Array1d *indices, int *ierr PETSC_F90_2PTR_PROTO(ptrd))
25 {
26 *ierr = F90Array1dDestroy(indices, MPIU_INT PETSC_F90_2PTR_PARAM(ptrd));if (*ierr) return;
27 }
28
petscsectionsetconstraintindicesf90_(PetscSection * s,PetscInt * point,F90Array1d * indices,int * ierr PETSC_F90_2PTR_PROTO (ptrd))29 PETSC_EXTERN void petscsectionsetconstraintindicesf90_(PetscSection *s, PetscInt *point, F90Array1d *indices, int *ierr PETSC_F90_2PTR_PROTO(ptrd))
30 {
31 const PetscInt *idx;
32
33 *ierr = F90Array1dAccess(indices, MPIU_INT, (void **) &idx PETSC_F90_2PTR_PARAM(ptrd));if (*ierr) return;
34 *ierr = PetscSectionSetConstraintIndices(*s, *point, idx); if (*ierr) return;
35 }
36