Actual source code: zmatnullf.c

      1: #include <petsc/private/ftnimpl.h>
      2: #include <petscmat.h>
      3: #include <petscviewer.h>

      5: #if defined(PETSC_HAVE_FORTRAN_CAPS)
      6:   #define matnullspacegetvecs_     MATNULLSPACEGETVECS
      7:   #define matnullspacerestorevecs_ MATNULLSPACERESTOREVECS
      8: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
      9:   #define matnullspacegetvecs_     matnullspacegetvecs
     10:   #define matnullspacerestorevecs_ matnullspacerestorevecs
     11: #endif

     13: PETSC_EXTERN void matnullspacegetvecs_(MatNullSpace *sp, PetscBool *HAS_CNST, PetscInt *N, F90Array1d *vecs, PetscErrorCode *ierr PETSC_F90_2PTR_PROTO(ptrd))
     14: {
     15:   PetscBool has_cnst;
     16:   PetscInt  n;
     17:   Vec      *tvecs;

     19:   CHKFORTRANNULLBOOL(HAS_CNST);
     20:   CHKFORTRANNULLINTEGER(N);
     21:   *ierr = MatNullSpaceGetVecs(*sp, &has_cnst, &n, (const Vec **)&tvecs);
     22:   if (HAS_CNST) *HAS_CNST = has_cnst;
     23:   if (N) *N = n;
     24:   *ierr = F90Array1dCreate(tvecs, MPIU_FORTRANADDR, 1, n, vecs PETSC_F90_2PTR_PARAM(ptrd));
     25: }

     27: PETSC_EXTERN void matnullspacerestorevecs_(MatNullSpace *sp, PetscBool *HAS_CNST, PetscInt *N, F90Array1d *vecs, PetscErrorCode *ierr PETSC_F90_2PTR_PROTO(ptrd))
     28: {
     29:   *ierr = F90Array1dDestroy(vecs, MPIU_FORTRANADDR PETSC_F90_2PTR_PARAM(ptrd));
     30: }