184cb2905SBarry Smith /* 2b0a32e0cSBarry Smith PetscViewers are objects where other objects can be looked at or stored. 384cb2905SBarry Smith */ 43c119ea2SBarry Smith 50a835dfdSSatish Balay #if !defined(__PETSCVIEWER_H) 60a835dfdSSatish Balay #define __PETSCVIEWER_H 7dfbe8321SBarry Smith 86420c192SJed Brown #include <petscsys.h> 9c619b03eSJed Brown #include <petscviewertypes.h> 100954c5ccSStefano Zampini #include <petscdrawtypes.h> 11e9fa29b7SSatish Balay 12014dd563SJed Brown PETSC_EXTERN PetscClassId PETSC_VIEWER_CLASSID; 13e9fa29b7SSatish Balay 1476bdecfbSBarry Smith /*J 15b9617806SBarry Smith PetscViewerType - String with the name of a PETSc PETScViewer 16b9617806SBarry Smith 17b9617806SBarry Smith Level: beginner 18b9617806SBarry Smith 198f6c3df8SBarry Smith .seealso: PetscViewerSetType(), PetscViewer, PetscViewerRegister(), PetscViewerCreate() 2076bdecfbSBarry Smith J*/ 2119fd82e9SBarry Smith typedef const char* PetscViewerType; 222692d6eeSBarry Smith #define PETSCVIEWERSOCKET "socket" 232692d6eeSBarry Smith #define PETSCVIEWERASCII "ascii" 242692d6eeSBarry Smith #define PETSCVIEWERBINARY "binary" 252692d6eeSBarry Smith #define PETSCVIEWERSTRING "string" 262692d6eeSBarry Smith #define PETSCVIEWERDRAW "draw" 272692d6eeSBarry Smith #define PETSCVIEWERVU "vu" 282692d6eeSBarry Smith #define PETSCVIEWERMATHEMATICA "mathematica" 292692d6eeSBarry Smith #define PETSCVIEWERHDF5 "hdf5" 304061b8bfSJed Brown #define PETSCVIEWERVTK "vtk" 312692d6eeSBarry Smith #define PETSCVIEWERMATLAB "matlab" 32e04113cfSBarry Smith #define PETSCVIEWERSAWS "saws" 338135c375SStefano Zampini #define PETSCVIEWERGLVIS "glvis" 3477ed5343SBarry Smith 35140e18c1SBarry Smith PETSC_EXTERN PetscFunctionList PetscViewerList; 36607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerInitializePackage(void); 377b2a1423SBarry Smith 38bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRegister(const char[],PetscErrorCode (*)(PetscViewer)); 3930de9b25SBarry Smith 40014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerCreate(MPI_Comm,PetscViewer*); 41014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetFromOptions(PetscViewer); 42014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpenWithFILE(MPI_Comm,FILE*,PetscViewer*); 437b2a1423SBarry Smith 44014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpen(MPI_Comm,const char[],PetscViewer*); 45014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetFILE(PetscViewer,FILE*); 46014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*); 47014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetFlowControl(PetscViewer,PetscInt*); 48014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetFlowControl(PetscViewer,PetscInt); 49bc196f7cSDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetUseMPIIO(PetscViewer,PetscBool); 50bc196f7cSDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetUseMPIIO(PetscViewer,PetscBool *); 510fc9d207SBarry Smith #if defined(PETSC_HAVE_MPIIO) 52014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIODescriptor(PetscViewer,MPI_File*); 53014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIOOffset(PetscViewer,MPI_Offset*); 54014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryAddMPIIOOffset(PetscViewer,MPI_Offset); 55951e3c8eSBarry Smith #endif 5639802e9eSBarry Smith 57014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketOpen(MPI_Comm,const char[],int,PetscViewer*); 5889d949e2SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringOpen(MPI_Comm,char[],size_t,PetscViewer*); 59014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,PetscViewer*); 60d1da0b69SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerDrawSetDrawType(PetscViewer,PetscDrawType); 610954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDraw(PetscViewer,PetscInt,PetscDraw*); 620954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawBaseAdd(PetscViewer,PetscInt); 630954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawBaseSet(PetscViewer,PetscInt); 640954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawLG(PetscViewer,PetscInt,PetscDrawLG*); 650954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawAxis(PetscViewer,PetscInt,PetscDrawAxis*); 660954c5ccSStefano Zampini 67014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *); 68014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *); 69014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*); 704b0e389bSBarry Smith 718135c375SStefano Zampini /*E 728135c375SStefano Zampini PetscViewerGLVisType - indicates what type of GLVis viewer to use 738135c375SStefano Zampini 748135c375SStefano Zampini Level: beginner 758135c375SStefano Zampini 768135c375SStefano Zampini .seealso: PetscViewerGLVisOpen() 778135c375SStefano Zampini E*/ 788135c375SStefano Zampini typedef enum {PETSC_VIEWER_GLVIS_DUMP, PETSC_VIEWER_GLVIS_SOCKET} PetscViewerGLVisType; 798135c375SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisOpen(MPI_Comm,PetscViewerGLVisType,const char*,PetscInt,PetscViewer*); 8077eacf09SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetPrecision(PetscViewer,PetscInt); 818135c375SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetSnapId(PetscViewer,PetscInt); 82bb77a09fSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetFields(PetscViewer,PetscInt,const char*[],const char*[],PetscInt[],PetscInt[],PetscInt[],PetscErrorCode(*)(PetscObject,PetscInt,PetscObject[],void*),void*,PetscErrorCode(*)(void*)); 838135c375SStefano Zampini 8419fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetType(PetscViewer,PetscViewerType*); 8519fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerSetType(PetscViewer,PetscViewerType); 86014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDestroy(PetscViewer*); 873f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetSubViewer(PetscViewer,MPI_Comm,PetscViewer*); 883f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRestoreSubViewer(PetscViewer,MPI_Comm,PetscViewer*); 89ae39576cSLois Curfman McInnes 90014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetUp(PetscViewer); 91014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerView(PetscViewer,PetscViewer); 92685405a1SBarry Smith PETSC_STATIC_INLINE PetscErrorCode PetscViewerViewFromOptions(PetscViewer A,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,obj,name);} 93f69a0ea3SMatthew Knepley 94014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetOptionsPrefix(PetscViewer,const char[]); 95014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerAppendOptionsPrefix(PetscViewer,const char[]); 96014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetOptionsPrefix(PetscViewer,const char*[]); 97090de74eSSatish Balay 98b9617806SBarry Smith /*E 99b9617806SBarry Smith PetscViewerFormat - Way a viewer presents the object 100b9617806SBarry Smith 101b9617806SBarry Smith Level: beginner 102b9617806SBarry Smith 103af0996ceSBarry Smith The values below are also listed in petsc/finclude/petscviewer.h. If another values is added below it 104cfaaf4edSHong Zhang must also be added there. 105cfaaf4edSHong Zhang 1066a9046bcSBarry Smith .seealso: PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat() 107b9617806SBarry Smith E*/ 108fb9695e5SSatish Balay typedef enum { 109117016b1SBarry Smith PETSC_VIEWER_DEFAULT, 110f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_MATLAB, 1114ebda54eSMatthew Knepley PETSC_VIEWER_ASCII_MATHEMATICA, 112f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_IMPL, 113f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_INFO, 114456192e2SBarry Smith PETSC_VIEWER_ASCII_INFO_DETAIL, 115f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_COMMON, 116f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_SYMMODU, 117f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_INDEX, 118f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_DENSE, 1193c215bfdSMatthew Knepley PETSC_VIEWER_ASCII_MATRIXMARKET, 120a505fa5bSMatthew Knepley PETSC_VIEWER_ASCII_VTK, 121b85befe5SMatthew Knepley PETSC_VIEWER_ASCII_VTK_CELL, 122b6d733afSMatthew Knepley PETSC_VIEWER_ASCII_VTK_COORDS, 123493617b5SMatthew Knepley PETSC_VIEWER_ASCII_PCICE, 124cfaaf4edSHong Zhang PETSC_VIEWER_ASCII_PYTHON, 125cfaaf4edSHong Zhang PETSC_VIEWER_ASCII_FACTOR_INFO, 12667ad5babSMatthew G Knepley PETSC_VIEWER_ASCII_LATEX, 127bb1d7374SBarry Smith PETSC_VIEWER_ASCII_XML, 1288135c375SStefano Zampini PETSC_VIEWER_ASCII_GLVIS, 129f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_BASIC, 130f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_LG, 131f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_CONTOUR, 132f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_PORTS, 1334061b8bfSJed Brown PETSC_VIEWER_VTK_VTS, 134a13bc4e3SShao-Ching Huang PETSC_VIEWER_VTK_VTR, 135b263465dSJed Brown PETSC_VIEWER_VTK_VTU, 136a261c58fSBarry Smith PETSC_VIEWER_BINARY_MATLAB, 137f3ef73ceSBarry Smith PETSC_VIEWER_NATIVE, 138ffe0aed0SMatthew G. Knepley PETSC_VIEWER_HDF5_VIZ, 139*ef5fdb51SBarry Smith PETSC_VIEWER_NOFORMAT, 140*ef5fdb51SBarry Smith PETSC_VIEWER_LOAD_BALANCE 141cfaaf4edSHong Zhang } PetscViewerFormat; 142014dd563SJed Brown PETSC_EXTERN const char *const PetscViewerFormats[]; 143090de74eSSatish Balay 1446a9046bcSBarry Smith PETSC_EXTERN PETSC_DEPRECATED("Use PetscViewerPushFormat()/PetscViewerPopFormat()") PetscErrorCode PetscViewerSetFormat(PetscViewer,PetscViewerFormat); 145014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPushFormat(PetscViewer,PetscViewerFormat); 146014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPopFormat(PetscViewer); 147014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetFormat(PetscViewer,PetscViewerFormat*); 148014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFlush(PetscViewer); 1494b0e389bSBarry Smith 150eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsPushGetViewerOff(PetscBool); 151a30ec4eaSSatish Balay PETSC_EXTERN PetscErrorCode PetscOptionsPopGetViewerOff(void); 152eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsGetViewerOff(PetscBool*); 153cffb1e40SBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsGetViewer(MPI_Comm,const char[],const char[],PetscViewer*,PetscViewerFormat*,PetscBool*); 154e55864a3SBarry Smith #define PetscOptionsViewer(a,b,c,d,e,f) PetscOptionsViewer_Private(PetscOptionsObject,a,b,c,d,e,f); 1554416b707SBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsViewer_Private(PetscOptionItems*,const char[],const char[],const char[],PetscViewer*,PetscViewerFormat *,PetscBool *); 1562bf49c77SBarry Smith 157fe01d993SBarry Smith typedef struct {PetscViewer viewer;PetscViewerFormat format;} PetscViewerAndFormat; 158d7cbc13eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerAndFormatCreate(PetscViewer,PetscViewerFormat,PetscViewerAndFormat**); 159fe01d993SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerAndFormatDestroy(PetscViewerAndFormat**); 160fe01d993SBarry Smith 16177ed5343SBarry Smith /* 16277ed5343SBarry Smith Operations explicit to a particular class of viewers 16377ed5343SBarry Smith */ 164ed5c6e3eSMatthew Knepley 165014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetPointer(PetscViewer,FILE**); 166014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetMode(PetscViewer,PetscFileMode*); 167014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetMode(PetscViewer,PetscFileMode); 168060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerRead(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType); 169014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPrintf(PetscViewer,const char[],...); 170014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...); 1711575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushSynchronized(PetscViewer); 1721575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopSynchronized(PetscViewer); 173014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushTab(PetscViewer); 174014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopTab(PetscViewer); 175014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIUseTabs(PetscViewer,PetscBool ); 176014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetTab(PetscViewer,PetscInt); 177014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetTab(PetscViewer,PetscInt*); 178014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIAddTab(PetscViewer,PetscInt); 179014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISubtractTab(PetscViewer,PetscInt); 180060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerASCIIRead(PetscViewer,void *,PetscInt,PetscInt*,PetscDataType); 181014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetDescriptor(PetscViewer,int*); 182014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **); 183060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerBinaryRead(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType); 184014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryWrite(PetscViewer,void*,PetscInt,PetscDataType,PetscBool ); 185014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerStringSPrintf(PetscViewer,const char[],...); 186014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerStringSetString(PetscViewer,char[],PetscInt); 187014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawClear(PetscViewer); 188014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetHold(PetscViewer,PetscBool); 189014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetHold(PetscViewer,PetscBool*); 190014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetPause(PetscViewer,PetscReal); 191014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetPause(PetscViewer,PetscReal*); 192014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int); 193014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawResize(PetscViewer,int,int); 194014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetBounds(PetscViewer,PetscInt,const PetscReal*); 195014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetBounds(PetscViewer,PetscInt*,const PetscReal**); 196014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketSetConnection(PetscViewer,const char[],int); 197014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySkipInfo(PetscViewer); 198807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipInfo(PetscViewer,PetscBool); 199807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipInfo(PetscViewer,PetscBool*); 200014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipOptions(PetscViewer,PetscBool ); 201014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipOptions(PetscViewer,PetscBool *); 202014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipHeader(PetscViewer,PetscBool); 203014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipHeader(PetscViewer,PetscBool*); 204014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadStringArray(PetscViewer,char***); 20578fbdcc8SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteStringArray(PetscViewer,const char *const*); 206c655490fSBarry Smith 207014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetName(PetscViewer,const char[]); 208014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetName(PetscViewer,const char**); 20977ed5343SBarry Smith 210014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetPointer(PetscViewer, FILE**); 211014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUSetVecSeen(PetscViewer, PetscBool ); 212014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetVecSeen(PetscViewer, PetscBool *); 213014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUPrintDeferred(PetscViewer, const char [], ...); 214014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUFlushDeferred(PetscViewer); 21555dcf840SMatthew Knepley 216607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerMathematicaInitializePackage(void); 217014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaFinalizePackage(void); 218014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaGetName(PetscViewer, const char **); 219014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetName(PetscViewer, const char []); 220014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaClearName(PetscViewer); 221014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSkipPackets(PetscViewer, int); 2224ebda54eSMatthew Knepley 223014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloGetName(PetscViewer, char **); 224014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloSetName(PetscViewer, const char []); 225014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearName(PetscViewer); 226014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloGetMeshName(PetscViewer, char **); 227014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloSetMeshName(PetscViewer, const char []); 228014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearMeshName(PetscViewer); 2294ebda54eSMatthew Knepley 230893c9c94SMatthew G Knepley typedef enum {PETSC_VTK_POINT_FIELD, PETSC_VTK_POINT_VECTOR_FIELD, PETSC_VTK_CELL_FIELD, PETSC_VTK_CELL_VECTOR_FIELD} PetscViewerVTKFieldType; 23118e2ec27SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerVTKAddField(PetscViewer,PetscObject,PetscErrorCode (*PetscViewerVTKWriteFunction)(PetscObject,PetscViewer),PetscViewerVTKFieldType,PetscObject); 232014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVTKOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*); 2334061b8bfSJed Brown 23477ed5343SBarry Smith /* 235d70abbfaSBarry Smith These are all the default viewers that do not have to be explicitly opened 23677ed5343SBarry Smith */ 237014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_STDOUT_(MPI_Comm); 238014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStdout(MPI_Comm,PetscViewer*); 239014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_STDERR_(MPI_Comm); 240014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStderr(MPI_Comm,PetscViewer*); 241014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_DRAW_(MPI_Comm); 242014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_SOCKET_(MPI_Comm); 243014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_BINARY_(MPI_Comm); 244014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_MATLAB_(MPI_Comm); 245a75e6a4aSMatthew G. Knepley PETSC_EXTERN PetscViewer PETSC_VIEWER_HDF5_(MPI_Comm); 2468135c375SStefano Zampini PETSC_EXTERN PetscViewer PETSC_VIEWER_GLVIS_(MPI_Comm); 247014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE; 2485311e20fSBarry Smith 249b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF PETSC_VIEWER_STDERR_(PETSC_COMM_SELF) 250b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD) 25130de9b25SBarry Smith 25230de9b25SBarry Smith /*MC 25330de9b25SBarry Smith PETSC_VIEWER_STDOUT_WORLD - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD) 25430de9b25SBarry Smith 25530de9b25SBarry Smith Level: beginner 25630de9b25SBarry Smith M*/ 25730de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD) 25830de9b25SBarry Smith 25930de9b25SBarry Smith /*MC 26030de9b25SBarry Smith PETSC_VIEWER_STDOUT_SELF - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF) 26130de9b25SBarry Smith 26230de9b25SBarry Smith Level: beginner 26330de9b25SBarry Smith M*/ 26430de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF) 26530de9b25SBarry Smith 26630de9b25SBarry Smith /*MC 26730de9b25SBarry Smith PETSC_VIEWER_DRAW_WORLD - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD) 26830de9b25SBarry Smith 26930de9b25SBarry Smith Level: intermediate 27030de9b25SBarry Smith M*/ 271b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD) 27230de9b25SBarry Smith 27330de9b25SBarry Smith /*MC 27430de9b25SBarry Smith PETSC_VIEWER_DRAW_SELF - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF) 27530de9b25SBarry Smith 27630de9b25SBarry Smith Level: intermediate 27730de9b25SBarry Smith M*/ 27830de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF PETSC_VIEWER_DRAW_(PETSC_COMM_SELF) 27930de9b25SBarry Smith 28030de9b25SBarry Smith /*MC 28130de9b25SBarry Smith PETSC_VIEWER_SOCKET_WORLD - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD) 28230de9b25SBarry Smith 28330de9b25SBarry Smith Level: intermediate 28430de9b25SBarry Smith M*/ 285b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD) 28630de9b25SBarry Smith 28730de9b25SBarry Smith /*MC 28830de9b25SBarry Smith PETSC_VIEWER_SOCKET_SELF - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF) 28930de9b25SBarry Smith 29030de9b25SBarry Smith Level: intermediate 29130de9b25SBarry Smith M*/ 292b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF) 29330de9b25SBarry Smith 29430de9b25SBarry Smith /*MC 29530de9b25SBarry Smith PETSC_VIEWER_BINARY_WORLD - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD) 29630de9b25SBarry Smith 29730de9b25SBarry Smith Level: intermediate 29830de9b25SBarry Smith M*/ 299b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD) 30030de9b25SBarry Smith 30130de9b25SBarry Smith /*MC 30230de9b25SBarry Smith PETSC_VIEWER_BINARY_SELF - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF) 30330de9b25SBarry Smith 30430de9b25SBarry Smith Level: intermediate 30530de9b25SBarry Smith M*/ 306b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF PETSC_VIEWER_BINARY_(PETSC_COMM_SELF) 30730de9b25SBarry Smith 308cbb32127SBarry Smith /*MC 309cbb32127SBarry Smith PETSC_VIEWER_MATLAB_WORLD - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD) 310cbb32127SBarry Smith 311cbb32127SBarry Smith Level: intermediate 312cbb32127SBarry Smith M*/ 313cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD) 314cbb32127SBarry Smith 315cbb32127SBarry Smith /*MC 316cbb32127SBarry Smith PETSC_VIEWER_MATLAB_SELF - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF) 317cbb32127SBarry Smith 318cbb32127SBarry Smith Level: intermediate 319cbb32127SBarry Smith M*/ 320cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF) 321cbb32127SBarry Smith 3227eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE) 32365ef3172SBarry Smith 3244a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStart(PetscViewer,PetscInt*,PetscInt*); 3254a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepMaster(PetscViewer,PetscInt,PetscInt*,PetscInt); 3264a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndMaster(PetscViewer,PetscInt*); 3274a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepWorker(PetscViewer,PetscMPIInt,PetscInt*); 3284a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndWorker(PetscViewer,PetscInt*); 329e03d165dSBarry Smith 33077ed5343SBarry Smith /* 331a5057860SBarry Smith PetscViewer writes to MATLAB .mat file 332cbb32127SBarry Smith */ 333014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutArray(PetscViewer,int,int,const PetscScalar*,const char*); 334014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,const char*); 335014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutVariable(PetscViewer,const char*,void*); 336cbb32127SBarry Smith 337e04113cfSBarry Smith #if defined(PETSC_HAVE_SAWS) 338e04113cfSBarry Smith PETSC_EXTERN PetscErrorCode PetscObjectViewSAWs(PetscObject,PetscViewer); 339bfb97211SBarry Smith #endif 340bfb97211SBarry Smith 341b9617806SBarry Smith /*S 3421890ba74SBarry Smith PetscViewers - Abstract collection of PetscViewers. It is just an expandable array of viewers. 343b9617806SBarry Smith 344b9617806SBarry Smith Level: intermediate 345b9617806SBarry Smith 346b9617806SBarry Smith Concepts: viewing 347b9617806SBarry Smith 348b9617806SBarry Smith .seealso: PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(), 349b9617806SBarry Smith PetscViewersGetViewer() 350b9617806SBarry Smith S*/ 35195fbd943SSatish Balay typedef struct _n_PetscViewers* PetscViewers; 352014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersCreate(MPI_Comm,PetscViewers*); 353014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersDestroy(PetscViewers*); 354014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersGetViewer(PetscViewers,PetscInt,PetscViewer*); 355d132466eSBarry Smith 356cb5b572fSBarry Smith #endif 357