1 2 #ifndef 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 #define PETSC_VIEWER_SAWS_WORLD PETSC_VIEWER_SAWS_(PETSC_COMM_WORLD) 10 #define PETSC_VIEWER_SAWS_SELF PETSC_VIEWER_SAWS_(PETSC_COMM_SELF) 11 12 #define PetscCallSAWs(func, args) \ 13 do { \ 14 PetscErrorCode _ierr; \ 15 PetscStackPushExternal(#func); \ 16 _ierr = func args; \ 17 PetscStackPop; \ 18 PetscCheck(!_ierr, PETSC_COMM_SELF, PETSC_ERR_LIB, "Error in %s() %d", #func, _ierr); \ 19 } while (0) 20 21 #endif 22