diff --git a/include/finclude/ftn-custom/petscmatdef.h90 b/include/finclude/ftn-custom/petscmatdef.h90 --- a/include/finclude/ftn-custom/petscmatdef.h90 +++ b/include/finclude/ftn-custom/petscmatdef.h90 @@ -4,5 +4,11 @@ type Mat PetscFortranAddr:: v end type Mat + type MatNullSpace + PetscFortranAddr:: v + end type MatNullSpace + type MatFDColoring + PetscFortranAddr:: v + end type MatFDColoring #endif #endif diff --git a/src/mat/interface/ftn-custom/makefile b/src/mat/interface/ftn-custom/makefile --- a/src/mat/interface/ftn-custom/makefile +++ b/src/mat/interface/ftn-custom/makefile @@ -3,7 +3,7 @@ ALL: lib CFLAGS = FFLAGS = -SOURCEC = zmatregf.c zmatrixf.c +SOURCEC = zmatregf.c zmatrixf.c zmatnull.c OBJSC = ${SOURCEC:.c=.o} SOURCEF = SOURCEH = diff --git a/src/mat/interface/ftn-custom/zmatnull.c b/src/mat/interface/ftn-custom/zmatnull.c new file mode 100644 --- /dev/null +++ b/src/mat/interface/ftn-custom/zmatnull.c @@ -0,0 +1,17 @@ +#include +#include + +#if defined(PETSC_HAVE_FORTRAN_CAPS) +#define matnullspaceview_ MATNULLSPACEVIEW +#elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) +#define matnullspaceview_ matnullspaceview +#endif + +EXTERN_C_BEGIN +void PETSC_STDCALL matnullspaceview_(MatNullSpace *sp,PetscViewer *vin,PetscErrorCode *ierr) +{ + PetscViewer v; + PetscPatchDefaultViewers_Fortran(vin,v); + *ierr = MatNullSpaceView(*sp,v); +} +EXTERN_C_END