1 #include <petsc/private/ftnimpl.h> 2 #include <petscmat.h> 3 #include <petscviewer.h> 4 5 #if defined(PETSC_HAVE_FORTRAN_CAPS) 6 #define matnullspacegetvecs_ MATNULLSPACEGETVECS 7 #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) 8 #define matnullspacegetvecs_ matnullspacegetvecs 9 #endif 10 11 PETSC_EXTERN void matnullspacegetvecs_(MatNullSpace *sp, PetscBool *HAS_CNST, PetscInt *N, Vec *VECS, PetscErrorCode *ierr) 12 { 13 PetscBool has_cnst; 14 PetscInt i, n; 15 const Vec *vecs; 16 17 CHKFORTRANNULLBOOL(HAS_CNST); 18 CHKFORTRANNULLINTEGER(N); 19 CHKFORTRANNULLOBJECT(VECS); 20 21 *ierr = MatNullSpaceGetVecs(*sp, &has_cnst, &n, &vecs); 22 23 if (HAS_CNST) { *HAS_CNST = has_cnst; } 24 if (N) { *N = n; } 25 if (VECS) { 26 for (i = 0; i < n; i++) { VECS[i] = vecs[i]; } 27 } 28 } 29