1 #pragma once 2 3 #include <petscviewer.h> 4 #include <SAWs.h> 5 6 /* MANSEC = Viewer */ 7 8 PETSC_EXTERN PetscErrorCode PetscViewerSAWsOpen(MPI_Comm, PetscViewer *); 9 PETSC_EXTERN PetscViewer PETSC_VIEWER_SAWS_(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 PetscCallSAWs(func, args) \ 14 do { \ 15 int _ierr; \ 16 PetscStackPushExternal(#func); \ 17 _ierr = func args; \ 18 PetscStackPop; \ 19 PetscCheck(!_ierr, PETSC_COMM_SELF, PETSC_ERR_LIB, "Error in %s() %d", #func, _ierr); \ 20 } while (0) 21