1 #include <petscvec.h>
2 #include <petscsection.h>
3 #include <petsc/private/ftnimpl.h>
4
5 #if defined(PETSC_HAVE_FORTRAN_CAPS)
6 #define vecgetvaluessection_ VECGETVALUESSECTION
7 #define vecrestorevaluessection_ VECRESTOREVALUESSECTION
8 #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
9 #define vecgetvaluessection_ vecgetvaluessection
10 #define vecrestorevaluessection_ vecrestorevaluessection
11 #endif
12
vecgetvaluessection_(Vec * v,PetscSection * section,PetscInt * point,F90Array1d * ptr,int * __ierr PETSC_F90_2PTR_PROTO (ptrd))13 PETSC_EXTERN void vecgetvaluessection_(Vec *v, PetscSection *section, PetscInt *point, F90Array1d *ptr, int *__ierr PETSC_F90_2PTR_PROTO(ptrd))
14 {
15 PetscScalar *fa;
16 PetscInt len;
17
18 *__ierr = VecGetValuesSection(*v, *section, *point, &fa);
19 if (*__ierr) return;
20 *__ierr = PetscSectionGetDof(*section, *point, &len);
21 if (*__ierr) return;
22 *__ierr = F90Array1dCreate(fa, MPIU_SCALAR, 1, len, ptr PETSC_F90_2PTR_PARAM(ptrd));
23 }
24
vecrestorevaluessection_(Vec * v,PetscSection * section,PetscInt * point,F90Array1d * ptr,int * __ierr PETSC_F90_2PTR_PROTO (ptrd))25 PETSC_EXTERN void vecrestorevaluessection_(Vec *v, PetscSection *section, PetscInt *point, F90Array1d *ptr, int *__ierr PETSC_F90_2PTR_PROTO(ptrd))
26 {
27 PetscScalar *fa;
28
29 *__ierr = F90Array1dAccess(ptr, MPIU_SCALAR, (void **)&fa PETSC_F90_2PTR_PARAM(ptrd));
30 if (*__ierr) return;
31 *__ierr = F90Array1dDestroy(ptr, MPIU_SCALAR PETSC_F90_2PTR_PARAM(ptrd));
32 if (*__ierr) return;
33 }
34