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 8e9fa29b7SSatish Balay #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus) 9e9fa29b7SSatish Balay extern "C" { 10e9fa29b7SSatish Balay #endif 112eb8c8abSBarry Smith 12b9617806SBarry Smith /*S 13b9617806SBarry Smith PetscViewer - Abstract PETSc object that helps view (in ASCII, binary, graphically etc) 14b9617806SBarry Smith other PETSc objects 15b9617806SBarry Smith 16b9617806SBarry Smith Level: beginner 17b9617806SBarry Smith 18b9617806SBarry Smith Concepts: viewing 19b9617806SBarry Smith 20b9617806SBarry Smith .seealso: PetscViewerCreate(), PetscViewerSetType(), PetscViewerType 21b9617806SBarry Smith S*/ 22b0a32e0cSBarry Smith typedef struct _p_PetscViewer* PetscViewer; 233c119ea2SBarry Smith 24e9fa29b7SSatish Balay #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus) 25e9fa29b7SSatish Balay } 26e9fa29b7SSatish Balay #endif 27e9fa29b7SSatish Balay 288fb59f0aSKris Buschelman #include "petsc.h" 298fb59f0aSKris Buschelman 308fb59f0aSKris Buschelman #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus) 318fb59f0aSKris Buschelman extern "C" { 328fb59f0aSKris Buschelman #endif 338fb59f0aSKris Buschelman 34ff73aad6SKris Buschelman extern PETSC_DLLEXPORT PetscCookie PETSC_VIEWER_COOKIE; 358fb59f0aSKris Buschelman 368fb59f0aSKris Buschelman #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus) 378fb59f0aSKris Buschelman } 388fb59f0aSKris Buschelman #endif 398fb59f0aSKris Buschelman 40e9fa29b7SSatish Balay 413c119ea2SBarry Smith /* 42b0a32e0cSBarry Smith petsc.h must be included AFTER the definition of PetscViewer for ADIC to 433c119ea2SBarry Smith process correctly. 443c119ea2SBarry Smith */ 45e9fa29b7SSatish Balay PETSC_EXTERN_CXX_BEGIN 46b9617806SBarry Smith /*E 47b9617806SBarry Smith PetscViewerType - String with the name of a PETSc PETScViewer 48b9617806SBarry Smith 49b9617806SBarry Smith Level: beginner 50b9617806SBarry Smith 51b9617806SBarry Smith .seealso: PetscViewerSetType(), PetscViewer 52b9617806SBarry Smith E*/ 53f69a0ea3SMatthew Knepley #define PetscViewerType const char* 54b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET "socket" 55b0a32e0cSBarry Smith #define PETSC_VIEWER_ASCII "ascii" 56fb9695e5SSatish Balay #define PETSC_VIEWER_BINARY "binary" 57b0a32e0cSBarry Smith #define PETSC_VIEWER_STRING "string" 58fb9695e5SSatish Balay #define PETSC_VIEWER_DRAW "draw" 5944c73c46SMatthew Knepley #define PETSC_VIEWER_VU "vu" 604ebda54eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA "mathematica" 614ebda54eSMatthew Knepley #define PETSC_VIEWER_SILO "silo" 62e3eb5169SDinesh Kaushik #define PETSC_VIEWER_NETCDF "netcdf" 6300ccbe27SDinesh Kaushik #define PETSC_VIEWER_HDF4 "hdf4" 64cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB "matlab" 6577ed5343SBarry Smith 66b0a32e0cSBarry Smith extern PetscFList PetscViewerList; 67ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerRegisterAll(const char *); 68ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerRegisterDestroy(void); 697b2a1423SBarry Smith 70ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerRegister(const char*,const char*,const char*,PetscErrorCode (*)(PetscViewer)); 7130de9b25SBarry Smith 7230de9b25SBarry Smith /*MC 7330de9b25SBarry Smith PetscViewerRegisterDynamic - Adds a method to the Krylov subspace solver package. 7430de9b25SBarry Smith 7530de9b25SBarry Smith Synopsis: 76d360dc6fSBarry Smith PetscErrorCode PetscViewerRegisterDynamic(char *name_solver,char *path,char *name_create,PetscErrorCode (*routine_create)(PetscViewer)) 7730de9b25SBarry Smith 7830de9b25SBarry Smith Not Collective 7930de9b25SBarry Smith 8030de9b25SBarry Smith Input Parameters: 8130de9b25SBarry Smith + name_solver - name of a new user-defined solver 8230de9b25SBarry Smith . path - path (either absolute or relative) the library containing this solver 8330de9b25SBarry Smith . name_create - name of routine to create method context 8430de9b25SBarry Smith - routine_create - routine to create method context 8530de9b25SBarry Smith 8630de9b25SBarry Smith Level: developer 8730de9b25SBarry Smith 8830de9b25SBarry Smith Notes: 8930de9b25SBarry Smith PetscViewerRegisterDynamic() may be called multiple times to add several user-defined solvers. 9030de9b25SBarry Smith 9130de9b25SBarry Smith If dynamic libraries are used, then the fourth input argument (routine_create) 9230de9b25SBarry Smith is ignored. 9330de9b25SBarry Smith 9430de9b25SBarry Smith Sample usage: 9530de9b25SBarry Smith .vb 9630de9b25SBarry Smith PetscViewerRegisterDynamic("my_viewer_type",/home/username/my_lib/lib/libO/solaris/mylib.a, 9730de9b25SBarry Smith "MyViewerCreate",MyViewerCreate); 9830de9b25SBarry Smith .ve 9930de9b25SBarry Smith 10030de9b25SBarry Smith Then, your solver can be chosen with the procedural interface via 10130de9b25SBarry Smith $ PetscViewerSetType(ksp,"my_viewer_type") 10230de9b25SBarry Smith or at runtime via the option 10330de9b25SBarry Smith $ -viewer_type my_viewer_type 10430de9b25SBarry Smith 10530de9b25SBarry Smith Concepts: registering^Viewers 10630de9b25SBarry Smith 10730de9b25SBarry Smith .seealso: PetscViewerRegisterAll(), PetscViewerRegisterDestroy() 10830de9b25SBarry Smith M*/ 109aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 110b0a32e0cSBarry Smith #define PetscViewerRegisterDynamic(a,b,c,d) PetscViewerRegister(a,b,c,0) 1117b2a1423SBarry Smith #else 112b0a32e0cSBarry Smith #define PetscViewerRegisterDynamic(a,b,c,d) PetscViewerRegister(a,b,c,d) 1137b2a1423SBarry Smith #endif 11430de9b25SBarry Smith 115ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerCreate(MPI_Comm,PetscViewer*); 116045ff3e0SBarry Smith PetscPolymorphicSubroutine(PetscViewerCreate,(PetscViewer *v),(PETSC_COMM_SELF,v)) 117ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetFromOptions(PetscViewer); 1187b2a1423SBarry Smith 119ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIOpen(MPI_Comm,const char[],PetscViewer*); 120ae8c01a2SBarry Smith 121ae8c01a2SBarry Smith /*E 122ae8c01a2SBarry Smith PetscViewerFileType - Indicates how the file should be opened for the viewer 123ae8c01a2SBarry Smith 124ae8c01a2SBarry Smith Level: beginner 125ae8c01a2SBarry Smith 126ae8c01a2SBarry Smith .seealso: PetscViewerSetFileName(), PetscViewerSetFileType(), PetscViewerBinaryOpen(), PetscViewerASCIIOpen(), 127ae8c01a2SBarry Smith PetscViewerMatlabOpen() 128ae8c01a2SBarry Smith E*/ 12945f7d322SBarry Smith typedef enum {PETSC_FILE_RDONLY,PETSC_FILE_WRONLY,PETSC_FILE_CREATE} PetscViewerFileType; 130ae8c01a2SBarry Smith 1311f7e983dSSatish Balay /*MC 132ae8c01a2SBarry Smith PETSC_FILE_RDONLY - File is open to be read from only, not written to 133ae8c01a2SBarry Smith 134ae8c01a2SBarry Smith Level: beginner 135ae8c01a2SBarry Smith 136ae8c01a2SBarry Smith .seealso: PetscViewerFileType, PETSC_FILE_WRONLY, PETSC_FILE_CREATE, PetscViewerSetFileName(), PetscViewerSetFileType(), 137ae8c01a2SBarry Smith PetscViewerBinaryOpen(), PetscViewerASCIIOpen(), PetscViewerMatlabOpen() 138ae8c01a2SBarry Smith 139ae8c01a2SBarry Smith M*/ 140ae8c01a2SBarry Smith 1411f7e983dSSatish Balay /*MC 142ae8c01a2SBarry Smith PETSC_FILE_WRONLY - File is open to be appended to. 143ae8c01a2SBarry Smith 144ae8c01a2SBarry Smith Level: beginner 145ae8c01a2SBarry Smith 146ae8c01a2SBarry Smith .seealso: PetscViewerFileType, PETSC_FILE_RDONLY, PETSC_FILE_CREATE, PetscViewerSetFileName(), PetscViewerSetFileType(), 147ae8c01a2SBarry Smith PetscViewerBinaryOpen(), PetscViewerASCIIOpen(), PetscViewerMatlabOpen() 148ae8c01a2SBarry Smith 149ae8c01a2SBarry Smith M*/ 150ae8c01a2SBarry Smith 1511f7e983dSSatish Balay /*MC 152ae8c01a2SBarry Smith PETSC_FILE_CREATE - Create the file, or delete it and open an empty file if it already existed 153ae8c01a2SBarry Smith 154ae8c01a2SBarry Smith Level: beginner 155ae8c01a2SBarry Smith 156ae8c01a2SBarry Smith .seealso: PetscViewerFileType, PETSC_FILE_RDONLY, PETSC_FILE_WRONLY, PetscViewerSetFileName(), PetscViewerSetFileType(), 157ae8c01a2SBarry Smith PetscViewerBinaryOpen(), PetscViewerASCIIOpen(), PetscViewerMatlabOpen() 158ae8c01a2SBarry Smith 159ae8c01a2SBarry Smith M*/ 160ae8c01a2SBarry Smith 161*b1967279SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryCreate(MPI_Comm,PetscViewer*); 162ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryOpen(MPI_Comm,const char[],PetscViewerFileType,PetscViewer*); 163ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketOpen(MPI_Comm,const char[],int,PetscViewer*); 164ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerStringOpen(MPI_Comm,char[],PetscInt,PetscViewer*); 165ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,PetscViewer*); 166ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *); 167ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *); 168ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMatlabOpen(MPI_Comm,const char[],PetscViewerFileType,PetscViewer*); 1694b0e389bSBarry Smith 170ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetType(PetscViewer,PetscViewerType*); 171f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetType(PetscViewer,PetscViewerType); 172ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerDestroy(PetscViewer); 173ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetSingleton(PetscViewer,PetscViewer*); 174ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerRestoreSingleton(PetscViewer,PetscViewer*); 175ae39576cSLois Curfman McInnes 176f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetUp(PetscViewer); 177f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerView(PetscViewer,PetscViewer); 178f69a0ea3SMatthew Knepley 179f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetOptionsPrefix(PetscViewer,const char[]); 180f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerAppendOptionsPrefix(PetscViewer,const char[]); 181f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetOptionsPrefix(PetscViewer,const char*[]); 182090de74eSSatish Balay 183b9617806SBarry Smith /*E 184b9617806SBarry Smith PetscViewerFormat - Way a viewer presents the object 185b9617806SBarry Smith 186b9617806SBarry Smith Level: beginner 187b9617806SBarry Smith 188b9617806SBarry Smith .seealso: PetscViewerSetFormat(), PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat() 189b9617806SBarry Smith E*/ 190fb9695e5SSatish Balay typedef enum { 191f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_DEFAULT, 192f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_MATLAB, 1934ebda54eSMatthew Knepley PETSC_VIEWER_ASCII_MATHEMATICA, 194f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_IMPL, 195f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_INFO, 196456192e2SBarry Smith PETSC_VIEWER_ASCII_INFO_DETAIL, 197f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_COMMON, 198f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_SYMMODU, 199f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_INDEX, 200f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_DENSE, 201f3ef73ceSBarry Smith PETSC_VIEWER_BINARY_DEFAULT, 202f3ef73ceSBarry Smith PETSC_VIEWER_BINARY_NATIVE, 203f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_BASIC, 204f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_LG, 205f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_CONTOUR, 206f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_PORTS, 207f3ef73ceSBarry Smith PETSC_VIEWER_NATIVE, 2084aedb280SBarry Smith PETSC_VIEWER_NOFORMAT, 2094aedb280SBarry Smith PETSC_VIEWER_ASCII_FACTOR_INFO} PetscViewerFormat; 210090de74eSSatish Balay 211ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetFormat(PetscViewer,PetscViewerFormat); 212ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerPushFormat(PetscViewer,PetscViewerFormat); 213ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerPopFormat(PetscViewer); 214ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetFormat(PetscViewer,PetscViewerFormat*); 215ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerFlush(PetscViewer); 2164b0e389bSBarry Smith 21777ed5343SBarry Smith /* 21877ed5343SBarry Smith Operations explicit to a particular class of viewers 21977ed5343SBarry Smith */ 220ed5c6e3eSMatthew Knepley 221ed5c6e3eSMatthew Knepley /*E 222ed5c6e3eSMatthew Knepley PetscViewerFormat - Access mode for a file. 223ed5c6e3eSMatthew Knepley 224ed5c6e3eSMatthew Knepley Level: beginner 225ed5c6e3eSMatthew Knepley 226ed5c6e3eSMatthew Knepley .seealso: PetscViewerASCIISetMode() 227ed5c6e3eSMatthew Knepley E*/ 228ed5c6e3eSMatthew Knepley typedef enum {FILE_MODE_READ, FILE_MODE_WRITE, FILE_MODE_APPEND, FILE_MODE_UPDATE, FILE_MODE_APPEND_UPDATE} PetscFileMode; 229ed5c6e3eSMatthew Knepley 230ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIGetPointer(PetscViewer,FILE**); 231ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIISetMode(PetscViewer,PetscFileMode); 232ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3); 233ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3); 234ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIPushTab(PetscViewer); 235ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIPopTab(PetscViewer); 236ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIUseTabs(PetscViewer,PetscTruth); 237ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIISetTab(PetscViewer,PetscInt); 238ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryGetDescriptor(PetscViewer,int*); 239ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **); 240f588057bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryRead(PetscViewer,void*,PetscInt,PetscDataType); 241f588057bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryWrite(PetscViewer,void*,PetscInt,PetscDataType,PetscTruth); 242*b1967279SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetFileType(PetscViewer,PetscViewerFileType*); 243ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetFileType(PetscViewer,PetscViewerFileType); 244ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerStringSPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3); 245ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerStringSetString(PetscViewer,char[],PetscInt); 246ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerDrawClear(PetscViewer); 247ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int); 248ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketSetConnection(PetscViewer,const char[],PetscInt); 249ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinarySkipInfo(PetscViewer); 250ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryLoadInfo(PetscViewer); 2519dcbbd2bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinarySetSkipOptions(PetscViewer,PetscTruth); 2529dcbbd2bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryGetSkipOptions(PetscViewer,PetscTruth*); 2538a13ba5bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryReadStringArray(PetscViewer,char***); 2548a13ba5bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryWriteStringArray(PetscViewer,char**); 255c655490fSBarry Smith 256ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetFilename(PetscViewer,const char[]); 257ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetFilename(PetscViewer,char**); 25877ed5343SBarry Smith 259ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscPLAPACKInitializePackage(char *); 260ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscPLAPACKFinalizePackage(void); 26144c6da4fSMatthew Knepley 262ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUGetPointer(PetscViewer, FILE**); 263ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUSetMode(PetscViewer, PetscFileMode); 264ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUSetVecSeen(PetscViewer, PetscTruth); 265ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUGetVecSeen(PetscViewer, PetscTruth *); 266ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUPrintDeferred(PetscViewer, const char [], ...) PETSC_PRINTF_FORMAT_CHECK(2,3); 267ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUFlushDeferred(PetscViewer); 26855dcf840SMatthew Knepley 269ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaInitializePackage(char *); 270ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaFinalizePackage(void); 271ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaGetName(PetscViewer, const char **); 272ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaSetName(PetscViewer, const char []); 273ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaClearName(PetscViewer); 274ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaSkipPackets(PetscViewer, int); 2754ebda54eSMatthew Knepley 276ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloGetName(PetscViewer, char **); 277ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloSetName(PetscViewer, const char []); 278ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloClearName(PetscViewer); 279ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloGetMeshName(PetscViewer, char **); 280ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloSetMeshName(PetscViewer, const char []); 281ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloClearMeshName(PetscViewer); 2824ebda54eSMatthew Knepley 283ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerNetcdfOpen(MPI_Comm,const char[],PetscViewerFileType,PetscViewer*); 284ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerNetcdfGetID(PetscViewer, int *); 285e3eb5169SDinesh Kaushik 286ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerHDF4Open(MPI_Comm,const char[],PetscViewerFileType,PetscViewer*); 287ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerHDF4WriteSDS(PetscViewer viewer, float *xf, int d, int *dims, int bs); 28800ccbe27SDinesh Kaushik 28977ed5343SBarry Smith /* 29077ed5343SBarry Smith These are all the default viewers that do not have 29177ed5343SBarry Smith to be explicitly opened 29277ed5343SBarry Smith */ 293ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_STDOUT_(MPI_Comm); 294ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_STDERR_(MPI_Comm); 295ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_DRAW_(MPI_Comm); 296ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_SOCKET_(MPI_Comm); 297ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_BINARY_(MPI_Comm); 298ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_MATLAB_(MPI_Comm); 2997eb62a3eSMatthew Knepley EXTERN PetscViewer PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE; 3005311e20fSBarry Smith 301b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF PETSC_VIEWER_STDERR_(PETSC_COMM_SELF) 302b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD) 30330de9b25SBarry Smith 30430de9b25SBarry Smith /*MC 30530de9b25SBarry Smith PETSC_VIEWER_STDOUT_WORLD - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD) 30630de9b25SBarry Smith 30730de9b25SBarry Smith Level: beginner 30830de9b25SBarry Smith M*/ 30930de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD) 31030de9b25SBarry Smith 31130de9b25SBarry Smith /*MC 31230de9b25SBarry Smith PETSC_VIEWER_STDOUT_SELF - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF) 31330de9b25SBarry Smith 31430de9b25SBarry Smith Level: beginner 31530de9b25SBarry Smith M*/ 31630de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF) 31730de9b25SBarry Smith 31830de9b25SBarry Smith /*MC 31930de9b25SBarry Smith PETSC_VIEWER_DRAW_WORLD - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD) 32030de9b25SBarry Smith 32130de9b25SBarry Smith Level: intermediate 32230de9b25SBarry Smith M*/ 323b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD) 32430de9b25SBarry Smith 32530de9b25SBarry Smith /*MC 32630de9b25SBarry Smith PETSC_VIEWER_DRAW_SELF - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF) 32730de9b25SBarry Smith 32830de9b25SBarry Smith Level: intermediate 32930de9b25SBarry Smith M*/ 33030de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF PETSC_VIEWER_DRAW_(PETSC_COMM_SELF) 33130de9b25SBarry Smith 33230de9b25SBarry Smith /*MC 33330de9b25SBarry Smith PETSC_VIEWER_SOCKET_WORLD - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD) 33430de9b25SBarry Smith 33530de9b25SBarry Smith Level: intermediate 33630de9b25SBarry Smith M*/ 337b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD) 33830de9b25SBarry Smith 33930de9b25SBarry Smith /*MC 34030de9b25SBarry Smith PETSC_VIEWER_SOCKET_SELF - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF) 34130de9b25SBarry Smith 34230de9b25SBarry Smith Level: intermediate 34330de9b25SBarry Smith M*/ 344b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF) 34530de9b25SBarry Smith 34630de9b25SBarry Smith /*MC 34730de9b25SBarry Smith PETSC_VIEWER_BINARY_WORLD - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD) 34830de9b25SBarry Smith 34930de9b25SBarry Smith Level: intermediate 35030de9b25SBarry Smith M*/ 351b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD) 35230de9b25SBarry Smith 35330de9b25SBarry Smith /*MC 35430de9b25SBarry Smith PETSC_VIEWER_BINARY_SELF - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF) 35530de9b25SBarry Smith 35630de9b25SBarry Smith Level: intermediate 35730de9b25SBarry Smith M*/ 358b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF PETSC_VIEWER_BINARY_(PETSC_COMM_SELF) 35930de9b25SBarry Smith 360cbb32127SBarry Smith /*MC 361cbb32127SBarry Smith PETSC_VIEWER_MATLAB_WORLD - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD) 362cbb32127SBarry Smith 363cbb32127SBarry Smith Level: intermediate 364cbb32127SBarry Smith M*/ 365cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD) 366cbb32127SBarry Smith 367cbb32127SBarry Smith /*MC 368cbb32127SBarry Smith PETSC_VIEWER_MATLAB_SELF - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF) 369cbb32127SBarry Smith 370cbb32127SBarry Smith Level: intermediate 371cbb32127SBarry Smith M*/ 372cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF) 373cbb32127SBarry Smith 3747eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE) 37565ef3172SBarry Smith 37677ed5343SBarry Smith /* 377cbb32127SBarry Smith petscViewer writes to Matlab .mat file 378cbb32127SBarry Smith */ 379ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMatlabPutArray(PetscViewer,int,int,PetscScalar*,char*); 380ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,char*); 381ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMatlabPutVariable(PetscViewer,const char*,void*); 382cbb32127SBarry Smith 383cbb32127SBarry Smith /* 384b0a32e0cSBarry Smith PetscViewer utility routines used by PETSc that are not normally used 385f2b01315SBarry Smith by users. 386f2b01315SBarry Smith */ 387ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketPutScalar(PetscViewer,PetscInt,PetscInt,PetscScalar*); 388ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketPutReal(PetscViewer,PetscInt,PetscInt,PetscReal*); 389ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketPutInt(PetscViewer,PetscInt,PetscInt*); 390ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketPutSparse_Private(PetscViewer,PetscInt,PetscInt,PetscInt,PetscScalar*,PetscInt*,PetscInt *); 391f2b01315SBarry Smith 392b9617806SBarry Smith /*S 393b9617806SBarry Smith PetscViewers - Abstract collection of PetscViewers 394b9617806SBarry Smith 395b9617806SBarry Smith Level: intermediate 396b9617806SBarry Smith 397b9617806SBarry Smith Concepts: viewing 398b9617806SBarry Smith 399b9617806SBarry Smith .seealso: PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(), 400b9617806SBarry Smith PetscViewersGetViewer() 401b9617806SBarry Smith S*/ 40295fbd943SSatish Balay typedef struct _n_PetscViewers* PetscViewers; 403ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewersCreate(MPI_Comm,PetscViewers*); 404ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewersDestroy(PetscViewers); 405ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewersGetViewer(PetscViewers,int,PetscViewer*); 406d132466eSBarry Smith 407e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END 408cb5b572fSBarry Smith #endif 409