1 2 #if !defined(__PETSCVIEWERSAWS_H) 3 #define __PETSCVIEWERSAWS_H 4 5 #include <petscviewer.h> 6 #include <SAWs.h> 7 PETSC_EXTERN PetscErrorCode PetscViewerSAWsOpen(MPI_Comm,PetscViewer*); 8 PETSC_EXTERN PetscViewer PETSC_VIEWER_SAWS_(MPI_Comm); 9 PETSC_EXTERN PetscErrorCode PETSC_VIEWER_SAWS_Destroy(MPI_Comm); 10 #define PETSC_VIEWER_SAWS_WORLD PETSC_VIEWER_SAWS_(PETSC_COMM_WORLD) 11 #define PETSC_VIEWER_SAWS_SELF PETSC_VIEWER_SAWS_(PETSC_COMM_SELF) 12 13 #define PetscStackCallSAWs(func,args) do {PetscErrorCode _ierr; \ 14 PetscStackPush(#func);_ierr = func args;PetscStackPop; if (_ierr) {SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error in %s() %d",#func,_ierr);} \ 15 } while (0) 16 17 #endif 18