xref: /petsc/src/vec/is/utils/ftn-custom/zvsectionisf.c (revision 52fb3346b8456450f5aecda47e4b2a062554a749)
1 #include <petsc/private/fortranimpl.h>
2 #include <petscis.h>
3 #include <petscsection.h>
4 #include <petscviewer.h>
5 
6 #if defined(PETSC_HAVE_FORTRAN_CAPS)
7   #define petscsectiongetpointsyms_          PETSCSECTIONGETPOINTSYMS
8   #define petscsectionrestorepointsyms_      PETSCSECTIONRESTOREPOINTSYMS
9   #define petscsectiongetfieldpointsyms_     PETSCSECTIONGETFIELDPOINTSYMS
10   #define petscsectionrestorefieldpointsyms_ PETSCSECTIONRESTOREFIELDPOINTSYMS
11   #define petscsectionview_                  PETSCSECTIONVIEW
12 #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
13   #define petscsectiongetpointsyms_          petscsectiongetpointsyms
14   #define petscsectionrestorepointsyms_      petscsectionrestorepointsyms
15   #define petscsectiongetfieldpointsyms_     petscsectiongetfieldpointsyms
16   #define petscsectionrestorefieldpointsyms_ petscsectionrestorefieldpointsyms
17   #define petscsectionview_                  petscsectionview
18 #endif
19 
20 PETSC_EXTERN void petscsectiongetpointsyms_(PetscSection section, PetscInt *numPoints, PetscInt *points, PetscInt ***perms, PetscScalar ***rots, int *__ierr)
21 {
22   *__ierr = PetscSectionGetPointSyms(section, *numPoints, points, (const PetscInt ***)perms, (const PetscScalar ***)rots);
23 }
24 PETSC_EXTERN void petscsectionrestorepointsyms_(PetscSection section, PetscInt *numPoints, PetscInt *points, PetscInt ***perms, PetscScalar ***rots, int *__ierr)
25 {
26   *__ierr = PetscSectionRestorePointSyms(section, *numPoints, points, (const PetscInt ***)perms, (const PetscScalar ***)rots);
27 }
28 PETSC_EXTERN void petscsectiongetfieldpointsyms_(PetscSection section, PetscInt *field, PetscInt *numPoints, PetscInt *points, PetscInt ***perms, PetscScalar ***rots, int *__ierr)
29 {
30   *__ierr = PetscSectionGetFieldPointSyms(section, *field, *numPoints, points, (const PetscInt ***)perms, (const PetscScalar ***)rots);
31 }
32 PETSC_EXTERN void petscsectionrestorefieldpointsyms_(PetscSection section, PetscInt *field, PetscInt *numPoints, PetscInt *points, PetscInt ***perms, PetscScalar ***rots, int *__ierr)
33 {
34   *__ierr = PetscSectionRestoreFieldPointSyms(section, *field, *numPoints, points, (const PetscInt ***)perms, (const PetscScalar ***)rots);
35 }
36 
37 PETSC_EXTERN void petscsectionview_(PetscSection *s, PetscViewer *vin, PetscErrorCode *ierr)
38 {
39   PetscViewer v;
40 
41   PetscPatchDefaultViewers_Fortran(vin, v);
42   *ierr = PetscSectionView(*s, v);
43 }
44