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 #define petscsectiongetfieldname_ PETSCSECTIONGETFIELDNAME 13 #define petscsectionsetfieldname_ PETSCSECTIONSETFIELDNAME 14 #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) 15 #define petscsectiongetpointsyms_ petscsectiongetpointsyms 16 #define petscsectionrestorepointsyms_ petscsectionrestorepointsyms 17 #define petscsectiongetfieldpointsyms_ petscsectiongetfieldpointsyms 18 #define petscsectionrestorefieldpointsyms_ petscsectionrestorefieldpointsyms 19 #define petscsectionview_ petscsectionview 20 #define petscsectiongetfieldname_ petscsectiongetfieldname 21 #define petscsectionsetfieldname_ petscsectionsetfieldname 22 #endif 23 24 PETSC_EXTERN void petscsectiongetpointsyms_(PetscSection section, PetscInt *numPoints, PetscInt *points, PetscInt ***perms, PetscScalar ***rots, int *__ierr) 25 { 26 *__ierr = PetscSectionGetPointSyms(section, *numPoints, points, (const PetscInt ***)perms, (const PetscScalar ***)rots); 27 } 28 PETSC_EXTERN void petscsectionrestorepointsyms_(PetscSection section, PetscInt *numPoints, PetscInt *points, PetscInt ***perms, PetscScalar ***rots, int *__ierr) 29 { 30 *__ierr = PetscSectionRestorePointSyms(section, *numPoints, points, (const PetscInt ***)perms, (const PetscScalar ***)rots); 31 } 32 PETSC_EXTERN void petscsectiongetfieldpointsyms_(PetscSection section, PetscInt *field, PetscInt *numPoints, PetscInt *points, PetscInt ***perms, PetscScalar ***rots, int *__ierr) 33 { 34 *__ierr = PetscSectionGetFieldPointSyms(section, *field, *numPoints, points, (const PetscInt ***)perms, (const PetscScalar ***)rots); 35 } 36 PETSC_EXTERN void petscsectionrestorefieldpointsyms_(PetscSection section, PetscInt *field, PetscInt *numPoints, PetscInt *points, PetscInt ***perms, PetscScalar ***rots, int *__ierr) 37 { 38 *__ierr = PetscSectionRestoreFieldPointSyms(section, *field, *numPoints, points, (const PetscInt ***)perms, (const PetscScalar ***)rots); 39 } 40 41 PETSC_EXTERN void petscsectionview_(PetscSection *s, PetscViewer *vin, PetscErrorCode *ierr) 42 { 43 PetscViewer v; 44 45 PetscPatchDefaultViewers_Fortran(vin, v); 46 *ierr = PetscSectionView(*s, v); 47 } 48 49 PETSC_EXTERN void petscsectiongetfieldname_(PetscSection *s, PetscInt *field, char *name, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len) 50 { 51 const char *fname; 52 53 *ierr = PetscSectionGetFieldName(*s, *field, &fname); 54 if (*ierr) return; 55 *ierr = PetscStrncpy(name, fname, len); 56 FIXRETURNCHAR(PETSC_TRUE, name, len); 57 } 58 59 PETSC_EXTERN void petscsectionsetfieldname_(PetscSection *s, PetscInt *field, char *name, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len) 60 { 61 char *f; 62 63 FIXCHAR(name, len, f); 64 *ierr = PetscSectionSetFieldName(*s, *field, f); 65 if (*ierr) return; 66 FREECHAR(name, f); 67 } 68