Actual source code: zitfuncf90.c

  1: #include <petscksp.h>
  2: #include <petsc/private/ftnimpl.h>

  4: #if PetscDefined(HAVE_FORTRAN_CAPS)
  5:   #define kspgetresidualhistory_     KSPGETRESIDUALHISTORY
  6:   #define ksprestoreresidualhistory_ KSPRESTORERESIDUALHISTORY
  7: #elif !PetscDefined(HAVE_FORTRAN_UNDERSCORE)
  8:   #define kspgetresidualhistory_     kspgetresidualhistory
  9:   #define ksprestoreresidualhistory_ ksprestoreresidualhistory
 10: #endif

 12: PETSC_EXTERN void kspgetresidualhistory_(KSP *ksp, F90Array1d *a, PetscInt *na, int *ierr PETSC_F90_2PTR_PROTO(ptrd))
 13: {
 14:   PetscReal const *hist;
 15:   *ierr = KSPGetResidualHistory(*ksp, &hist, na);
 16:   if (*ierr) return;
 17:   *ierr = F90Array1dCreate((void *)hist, MPIU_REAL, 1, *na, a PETSC_F90_2PTR_PARAM(ptrd));
 18: }

 20: PETSC_EXTERN void ksprestoreresidualhistory_(KSP *ksp, F90Array1d *a, PetscInt *na, int *ierr PETSC_F90_2PTR_PROTO(ptrd))
 21: {
 22:   *ierr = F90Array1dDestroy(a, MPIU_REAL PETSC_F90_2PTR_PARAM(ptrd));
 23: }