Actual source code: zfieldsplitf.c

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

      4: #if defined(PETSC_HAVE_FORTRAN_CAPS)
      5:   #define pcfieldsplitgetsubksp_      PCFIELDSPLITGETSUBKSP
      6:   #define pcfieldsplitschurgetsubksp_ PCFIELDSPLITSCHURGETSUBKSP
      7: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
      8:   #define pcfieldsplitgetsubksp_      pcfieldsplitgetsubksp
      9:   #define pcfieldsplitschurgetsubksp_ pcfieldsplitschurgetsubksp
     10: #endif

     12: PETSC_EXTERN void pcfieldsplitschurgetsubksp_(PC *pc, PetscInt *n_local, KSP *ksp, PetscErrorCode *ierr)
     13: {
     14:   KSP     *tksp;
     15:   PetscInt i, nloc;
     16:   CHKFORTRANNULLINTEGER(n_local);
     17:   *ierr = PCFieldSplitSchurGetSubKSP(*pc, &nloc, &tksp);
     18:   if (*ierr) return;
     19:   if (n_local) *n_local = nloc;
     20:   CHKFORTRANNULLOBJECT(ksp);
     21:   if (ksp) {
     22:     for (i = 0; i < nloc; i++) ksp[i] = tksp[i];
     23:   }
     24:   *ierr = PetscFree(tksp);
     25: }

     27: PETSC_EXTERN void pcfieldsplitgetsubksp_(PC *pc, PetscInt *n_local, KSP *ksp, PetscErrorCode *ierr)
     28: {
     29:   KSP     *tksp;
     30:   PetscInt i, nloc;
     31:   CHKFORTRANNULLINTEGER(n_local);
     32:   *ierr = PCFieldSplitGetSubKSP(*pc, &nloc, &tksp);
     33:   if (*ierr) return;
     34:   if (n_local) *n_local = nloc;
     35:   CHKFORTRANNULLOBJECT(ksp);
     36:   if (ksp) {
     37:     for (i = 0; i < nloc; i++) ksp[i] = tksp[i];
     38:   }
     39:   *ierr = PetscFree(tksp);
     40: }