173f4d377SMatthew Knepley /* $Id: petscviewer.h,v 1.85 2001/08/06 21:13:28 bsmith Exp $ */ 284cb2905SBarry Smith /* 3b0a32e0cSBarry Smith PetscViewers are objects where other objects can be looked at or stored. 484cb2905SBarry Smith */ 53c119ea2SBarry Smith 60a835dfdSSatish Balay #if !defined(__PETSCVIEWER_H) 70a835dfdSSatish Balay #define __PETSCVIEWER_H 8e9fa29b7SSatish Balay #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus) 9e9fa29b7SSatish Balay extern "C" { 10e9fa29b7SSatish Balay #endif 112eb8c8abSBarry Smith 128ba1e511SMatthew Knepley extern int PETSC_VIEWER_COOKIE; 138ba1e511SMatthew Knepley 14b9617806SBarry Smith /*S 15b9617806SBarry Smith PetscViewer - Abstract PETSc object that helps view (in ASCII, binary, graphically etc) 16b9617806SBarry Smith other PETSc objects 17b9617806SBarry Smith 18b9617806SBarry Smith Level: beginner 19b9617806SBarry Smith 20b9617806SBarry Smith Concepts: viewing 21b9617806SBarry Smith 22b9617806SBarry Smith .seealso: PetscViewerCreate(), PetscViewerSetType(), PetscViewerType 23b9617806SBarry Smith S*/ 24b0a32e0cSBarry Smith typedef struct _p_PetscViewer* PetscViewer; 253c119ea2SBarry Smith 26e9fa29b7SSatish Balay #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus) 27e9fa29b7SSatish Balay } 28e9fa29b7SSatish Balay #endif 29e9fa29b7SSatish Balay 30e9fa29b7SSatish Balay 313c119ea2SBarry Smith /* 32b0a32e0cSBarry Smith petsc.h must be included AFTER the definition of PetscViewer for ADIC to 333c119ea2SBarry Smith process correctly. 343c119ea2SBarry Smith */ 352eb8c8abSBarry Smith #include "petsc.h" 36e9fa29b7SSatish Balay PETSC_EXTERN_CXX_BEGIN 37b9617806SBarry Smith /*E 38b9617806SBarry Smith PetscViewerType - String with the name of a PETSc PETScViewer 39b9617806SBarry Smith 40b9617806SBarry Smith Level: beginner 41b9617806SBarry Smith 42b9617806SBarry Smith .seealso: PetscViewerSetType(), PetscViewer 43b9617806SBarry Smith E*/ 44b9617806SBarry Smith typedef char* PetscViewerType; 45b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET "socket" 46b0a32e0cSBarry Smith #define PETSC_VIEWER_ASCII "ascii" 47fb9695e5SSatish Balay #define PETSC_VIEWER_BINARY "binary" 48b0a32e0cSBarry Smith #define PETSC_VIEWER_STRING "string" 49fb9695e5SSatish Balay #define PETSC_VIEWER_DRAW "draw" 50b0a32e0cSBarry Smith #define PETSC_VIEWER_AMS "ams" 5144c73c46SMatthew Knepley #define PETSC_VIEWER_VU "vu" 524ebda54eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA "mathematica" 534ebda54eSMatthew Knepley #define PETSC_VIEWER_SILO "silo" 54e3eb5169SDinesh Kaushik #define PETSC_VIEWER_NETCDF "netcdf" 5500ccbe27SDinesh Kaushik #define PETSC_VIEWER_HDF4 "hdf4" 56*cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB "matlab" 5777ed5343SBarry Smith 58b0a32e0cSBarry Smith extern PetscFList PetscViewerList; 59b0a32e0cSBarry Smith EXTERN int PetscViewerRegisterAll(char *); 60b0a32e0cSBarry Smith EXTERN int PetscViewerRegisterDestroy(void); 617b2a1423SBarry Smith 62b0a32e0cSBarry Smith EXTERN int PetscViewerRegister(char*,char*,char*,int(*)(PetscViewer)); 6330de9b25SBarry Smith 6430de9b25SBarry Smith /*MC 6530de9b25SBarry Smith PetscViewerRegisterDynamic - Adds a method to the Krylov subspace solver package. 6630de9b25SBarry Smith 6730de9b25SBarry Smith Synopsis: 6830de9b25SBarry Smith int PetscViewerRegisterDynamic(char *name_solver,char *path,char *name_create,int (*routine_create)(PetscViewer)) 6930de9b25SBarry Smith 7030de9b25SBarry Smith Not Collective 7130de9b25SBarry Smith 7230de9b25SBarry Smith Input Parameters: 7330de9b25SBarry Smith + name_solver - name of a new user-defined solver 7430de9b25SBarry Smith . path - path (either absolute or relative) the library containing this solver 7530de9b25SBarry Smith . name_create - name of routine to create method context 7630de9b25SBarry Smith - routine_create - routine to create method context 7730de9b25SBarry Smith 7830de9b25SBarry Smith Level: developer 7930de9b25SBarry Smith 8030de9b25SBarry Smith Notes: 8130de9b25SBarry Smith PetscViewerRegisterDynamic() may be called multiple times to add several user-defined solvers. 8230de9b25SBarry Smith 8330de9b25SBarry Smith If dynamic libraries are used, then the fourth input argument (routine_create) 8430de9b25SBarry Smith is ignored. 8530de9b25SBarry Smith 8630de9b25SBarry Smith Sample usage: 8730de9b25SBarry Smith .vb 8830de9b25SBarry Smith PetscViewerRegisterDynamic("my_viewer_type",/home/username/my_lib/lib/libO/solaris/mylib.a, 8930de9b25SBarry Smith "MyViewerCreate",MyViewerCreate); 9030de9b25SBarry Smith .ve 9130de9b25SBarry Smith 9230de9b25SBarry Smith Then, your solver can be chosen with the procedural interface via 9330de9b25SBarry Smith $ PetscViewerSetType(ksp,"my_viewer_type") 9430de9b25SBarry Smith or at runtime via the option 9530de9b25SBarry Smith $ -viewer_type my_viewer_type 9630de9b25SBarry Smith 9730de9b25SBarry Smith Concepts: registering^Viewers 9830de9b25SBarry Smith 9930de9b25SBarry Smith .seealso: PetscViewerRegisterAll(), PetscViewerRegisterDestroy() 10030de9b25SBarry Smith M*/ 101aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 102b0a32e0cSBarry Smith #define PetscViewerRegisterDynamic(a,b,c,d) PetscViewerRegister(a,b,c,0) 1037b2a1423SBarry Smith #else 104b0a32e0cSBarry Smith #define PetscViewerRegisterDynamic(a,b,c,d) PetscViewerRegister(a,b,c,d) 1057b2a1423SBarry Smith #endif 10630de9b25SBarry Smith 107b0a32e0cSBarry Smith EXTERN int PetscViewerCreate(MPI_Comm,PetscViewer*); 108b0a32e0cSBarry Smith EXTERN int PetscViewerSetFromOptions(PetscViewer); 1097b2a1423SBarry Smith 110b0a32e0cSBarry Smith EXTERN int PetscViewerASCIIOpen(MPI_Comm,const char[],PetscViewer*); 111b0a32e0cSBarry Smith typedef enum {PETSC_BINARY_RDONLY,PETSC_BINARY_WRONLY,PETSC_BINARY_CREATE} PetscViewerBinaryType; 112b0a32e0cSBarry Smith EXTERN int PetscViewerBinaryOpen(MPI_Comm,const char[],PetscViewerBinaryType,PetscViewer*); 113b0a32e0cSBarry Smith EXTERN int PetscViewerSocketOpen(MPI_Comm,const char[],int,PetscViewer*); 114b0a32e0cSBarry Smith EXTERN int PetscViewerStringOpen(MPI_Comm,char[],int,PetscViewer*); 115b0a32e0cSBarry Smith EXTERN int PetscViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,PetscViewer*); 116b0a32e0cSBarry Smith EXTERN int PetscViewerAMSSetCommName(PetscViewer,const char[]); 1174ebda54eSMatthew Knepley EXTERN int PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *); 1184ebda54eSMatthew Knepley EXTERN int PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *); 119*cbb32127SBarry Smith typedef enum {PETSC_MATLAB_RDONLY,PETSC_MATLAB_WRONLY,PETSC_MATLAB_CREATE} PetscViewerMatlabType; 120*cbb32127SBarry Smith EXTERN int PetscViewerMatlabOpen(MPI_Comm,const char[],PetscViewerMatlabType,PetscViewer*); 1214b0e389bSBarry Smith 122b0a32e0cSBarry Smith EXTERN int PetscViewerGetType(PetscViewer,PetscViewerType*); 123b0a32e0cSBarry Smith EXTERN int PetscViewerSetType(PetscViewer,PetscViewerType); 124b0a32e0cSBarry Smith EXTERN int PetscViewerDestroy(PetscViewer); 125b0a32e0cSBarry Smith EXTERN int PetscViewerGetSingleton(PetscViewer,PetscViewer*); 126b0a32e0cSBarry Smith EXTERN int PetscViewerRestoreSingleton(PetscViewer,PetscViewer*); 127ae39576cSLois Curfman McInnes 128090de74eSSatish Balay 129b9617806SBarry Smith /*E 130b9617806SBarry Smith PetscViewerFormat - Way a viewer presents the object 131b9617806SBarry Smith 132b9617806SBarry Smith Level: beginner 133b9617806SBarry Smith 134b9617806SBarry Smith .seealso: PetscViewerSetFormat(), PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat() 135b9617806SBarry Smith E*/ 136fb9695e5SSatish Balay typedef enum { 137f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_DEFAULT, 138f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_MATLAB, 1394ebda54eSMatthew Knepley PETSC_VIEWER_ASCII_MATHEMATICA, 140f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_IMPL, 141f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_INFO, 142456192e2SBarry Smith PETSC_VIEWER_ASCII_INFO_DETAIL, 143f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_COMMON, 144f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_SYMMODU, 145f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_INDEX, 146f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_DENSE, 147f3ef73ceSBarry Smith PETSC_VIEWER_BINARY_DEFAULT, 148f3ef73ceSBarry Smith PETSC_VIEWER_BINARY_NATIVE, 149f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_BASIC, 150f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_LG, 151f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_CONTOUR, 152f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_PORTS, 153f3ef73ceSBarry Smith PETSC_VIEWER_NATIVE, 1544aedb280SBarry Smith PETSC_VIEWER_NOFORMAT, 1554aedb280SBarry Smith PETSC_VIEWER_ASCII_FACTOR_INFO} PetscViewerFormat; 156090de74eSSatish Balay 157f3ef73ceSBarry Smith EXTERN int PetscViewerSetFormat(PetscViewer,PetscViewerFormat); 158f3ef73ceSBarry Smith EXTERN int PetscViewerPushFormat(PetscViewer,PetscViewerFormat); 159b0a32e0cSBarry Smith EXTERN int PetscViewerPopFormat(PetscViewer); 160f3ef73ceSBarry Smith EXTERN int PetscViewerGetFormat(PetscViewer,PetscViewerFormat*); 161b0a32e0cSBarry Smith EXTERN int PetscViewerFlush(PetscViewer); 1624b0e389bSBarry Smith 16377ed5343SBarry Smith /* 16477ed5343SBarry Smith Operations explicit to a particular class of viewers 16577ed5343SBarry Smith */ 166ed5c6e3eSMatthew Knepley 167ed5c6e3eSMatthew Knepley /*E 168ed5c6e3eSMatthew Knepley PetscViewerFormat - Access mode for a file. 169ed5c6e3eSMatthew Knepley 170ed5c6e3eSMatthew Knepley Level: beginner 171ed5c6e3eSMatthew Knepley 172ed5c6e3eSMatthew Knepley .seealso: PetscViewerASCIISetMode() 173ed5c6e3eSMatthew Knepley E*/ 174ed5c6e3eSMatthew Knepley typedef enum {FILE_MODE_READ, FILE_MODE_WRITE, FILE_MODE_APPEND, FILE_MODE_UPDATE, FILE_MODE_APPEND_UPDATE} PetscFileMode; 175ed5c6e3eSMatthew Knepley 176b0a32e0cSBarry Smith EXTERN int PetscViewerASCIIGetPointer(PetscViewer,FILE**); 177ed5c6e3eSMatthew Knepley EXTERN int PetscViewerASCIISetMode(PetscViewer,PetscFileMode); 178f80b7eb0SBarry Smith EXTERN int PetscViewerASCIIPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3); 179f80b7eb0SBarry Smith EXTERN int PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3); 180b0a32e0cSBarry Smith EXTERN int PetscViewerASCIIPushTab(PetscViewer); 181b0a32e0cSBarry Smith EXTERN int PetscViewerASCIIPopTab(PetscViewer); 182b0a32e0cSBarry Smith EXTERN int PetscViewerASCIIUseTabs(PetscViewer,PetscTruth); 183b0a32e0cSBarry Smith EXTERN int PetscViewerASCIISetTab(PetscViewer,int); 184b0a32e0cSBarry Smith EXTERN int PetscViewerBinaryGetDescriptor(PetscViewer,int*); 185b0a32e0cSBarry Smith EXTERN int PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **); 186b0a32e0cSBarry Smith EXTERN int PetscViewerBinarySetType(PetscViewer,PetscViewerBinaryType); 187f80b7eb0SBarry Smith EXTERN int PetscViewerStringSPrintf(PetscViewer,char *,...) PETSC_PRINTF_FORMAT_CHECK(2,3); 188b0a32e0cSBarry Smith EXTERN int PetscViewerStringSetString(PetscViewer,char[],int); 189b0a32e0cSBarry Smith EXTERN int PetscViewerDrawClear(PetscViewer); 190b0a32e0cSBarry Smith EXTERN int PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int); 191b0a32e0cSBarry Smith EXTERN int PetscViewerSocketSetConnection(PetscViewer,const char[],int); 192bba1ac68SSatish Balay EXTERN int PetscViewerBinarySkipInfo(PetscViewer); 19308641331SSatish Balay EXTERN int PetscViewerBinaryLoadInfo(PetscViewer); 19408641331SSatish Balay 195c655490fSBarry Smith 196b0a32e0cSBarry Smith EXTERN int PetscViewerSetFilename(PetscViewer,const char[]); 197b0a32e0cSBarry Smith EXTERN int PetscViewerGetFilename(PetscViewer,char**); 19877ed5343SBarry Smith 19944c6da4fSMatthew Knepley EXTERN int PetscPLAPACKInitializePackage(char *); 20065804fbbSSatish Balay EXTERN int PetscPLAPACKFinalizePackage(void); 20144c6da4fSMatthew Knepley 20255dcf840SMatthew Knepley EXTERN int PetscViewerVUGetPointer(PetscViewer, FILE**); 203c4b95c56SMatthew Knepley EXTERN int PetscViewerVUSetMode(PetscViewer, PetscFileMode); 204c4b95c56SMatthew Knepley EXTERN int PetscViewerVUSetVecSeen(PetscViewer, PetscTruth); 205c4b95c56SMatthew Knepley EXTERN int PetscViewerVUGetVecSeen(PetscViewer, PetscTruth *); 206f80b7eb0SBarry Smith EXTERN int PetscViewerVUPrintDeferred(PetscViewer, const char [], ...) PETSC_PRINTF_FORMAT_CHECK(2,3); 207c4b95c56SMatthew Knepley EXTERN int PetscViewerVUFlushDeferred(PetscViewer); 20855dcf840SMatthew Knepley 20944c6da4fSMatthew Knepley EXTERN int PetscViewerMathematicaInitializePackage(char *); 21086e45947SSatish Balay EXTERN int PetscViewerMathematicaFinalizePackage(void); 211918c3ce8SMatthew Knepley EXTERN int PetscViewerMathematicaGetName(PetscViewer, const char **); 2127eb62a3eSMatthew Knepley EXTERN int PetscViewerMathematicaSetName(PetscViewer, const char []); 2137eb62a3eSMatthew Knepley EXTERN int PetscViewerMathematicaClearName(PetscViewer); 2147eb62a3eSMatthew Knepley EXTERN int PetscViewerMathematicaSkipPackets(PetscViewer, int); 2154ebda54eSMatthew Knepley 2167eb62a3eSMatthew Knepley EXTERN int PetscViewerSiloGetName(PetscViewer, char **); 2177eb62a3eSMatthew Knepley EXTERN int PetscViewerSiloSetName(PetscViewer, const char []); 2187eb62a3eSMatthew Knepley EXTERN int PetscViewerSiloClearName(PetscViewer); 2197eb62a3eSMatthew Knepley EXTERN int PetscViewerSiloGetMeshName(PetscViewer, char **); 2207eb62a3eSMatthew Knepley EXTERN int PetscViewerSiloSetMeshName(PetscViewer, const char []); 2217eb62a3eSMatthew Knepley EXTERN int PetscViewerSiloClearMeshName(PetscViewer); 2224ebda54eSMatthew Knepley 223e3eb5169SDinesh Kaushik typedef enum {PETSC_NETCDF_RDONLY,PETSC_NETCDF_RDWR,PETSC_NETCDF_CREATE} PetscViewerNetcdfType; 224e3eb5169SDinesh Kaushik EXTERN int PetscViewerNetcdfOpen(MPI_Comm,const char[],PetscViewerNetcdfType,PetscViewer*); 225e3eb5169SDinesh Kaushik EXTERN int PetscViewerNetcdfGetID(PetscViewer, int *); 226e3eb5169SDinesh Kaushik 22700ccbe27SDinesh Kaushik EXTERN int PetscViewerHDF4Open(MPI_Comm,const char[],PetscViewerBinaryType,PetscViewer*); 22800ccbe27SDinesh Kaushik EXTERN int PetscViewerHDF4WriteSDS(PetscViewer viewer, float *xf, int d, int *dims, int bs); 22900ccbe27SDinesh Kaushik 23077ed5343SBarry Smith /* 23177ed5343SBarry Smith These are all the default viewers that do not have 23277ed5343SBarry Smith to be explicitly opened 23377ed5343SBarry Smith */ 234b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_STDOUT_(MPI_Comm); 235b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_STDERR_(MPI_Comm); 236b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_DRAW_(MPI_Comm); 237b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_SOCKET_(MPI_Comm); 238b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_BINARY_(MPI_Comm); 239*cbb32127SBarry Smith EXTERN PetscViewer PETSC_VIEWER_MATLAB_(MPI_Comm); 2407eb62a3eSMatthew Knepley EXTERN PetscViewer PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE; 2415311e20fSBarry Smith 242b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF PETSC_VIEWER_STDERR_(PETSC_COMM_SELF) 243b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD) 24430de9b25SBarry Smith 24530de9b25SBarry Smith /*MC 24630de9b25SBarry Smith PETSC_VIEWER_STDOUT_WORLD - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD) 24730de9b25SBarry Smith 24830de9b25SBarry Smith Level: beginner 24930de9b25SBarry Smith M*/ 25030de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD) 25130de9b25SBarry Smith 25230de9b25SBarry Smith /*MC 25330de9b25SBarry Smith PETSC_VIEWER_STDOUT_SELF - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF) 25430de9b25SBarry Smith 25530de9b25SBarry Smith Level: beginner 25630de9b25SBarry Smith M*/ 25730de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF) 25830de9b25SBarry Smith 25930de9b25SBarry Smith /*MC 26030de9b25SBarry Smith PETSC_VIEWER_DRAW_WORLD - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD) 26130de9b25SBarry Smith 26230de9b25SBarry Smith Level: intermediate 26330de9b25SBarry Smith M*/ 264b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD) 26530de9b25SBarry Smith 26630de9b25SBarry Smith /*MC 26730de9b25SBarry Smith PETSC_VIEWER_DRAW_SELF - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF) 26830de9b25SBarry Smith 26930de9b25SBarry Smith Level: intermediate 27030de9b25SBarry Smith M*/ 27130de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF PETSC_VIEWER_DRAW_(PETSC_COMM_SELF) 27230de9b25SBarry Smith 27330de9b25SBarry Smith /*MC 27430de9b25SBarry Smith PETSC_VIEWER_SOCKET_WORLD - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD) 27530de9b25SBarry Smith 27630de9b25SBarry Smith Level: intermediate 27730de9b25SBarry Smith M*/ 278b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD) 27930de9b25SBarry Smith 28030de9b25SBarry Smith /*MC 28130de9b25SBarry Smith PETSC_VIEWER_SOCKET_SELF - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF) 28230de9b25SBarry Smith 28330de9b25SBarry Smith Level: intermediate 28430de9b25SBarry Smith M*/ 285b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF) 28630de9b25SBarry Smith 28730de9b25SBarry Smith /*MC 28830de9b25SBarry Smith PETSC_VIEWER_BINARY_WORLD - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD) 28930de9b25SBarry Smith 29030de9b25SBarry Smith Level: intermediate 29130de9b25SBarry Smith M*/ 292b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD) 29330de9b25SBarry Smith 29430de9b25SBarry Smith /*MC 29530de9b25SBarry Smith PETSC_VIEWER_BINARY_SELF - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF) 29630de9b25SBarry Smith 29730de9b25SBarry Smith Level: intermediate 29830de9b25SBarry Smith M*/ 299b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF PETSC_VIEWER_BINARY_(PETSC_COMM_SELF) 30030de9b25SBarry Smith 301*cbb32127SBarry Smith /*MC 302*cbb32127SBarry Smith PETSC_VIEWER_MATLAB_WORLD - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD) 303*cbb32127SBarry Smith 304*cbb32127SBarry Smith Level: intermediate 305*cbb32127SBarry Smith M*/ 306*cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD) 307*cbb32127SBarry Smith 308*cbb32127SBarry Smith /*MC 309*cbb32127SBarry Smith PETSC_VIEWER_MATLAB_SELF - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF) 310*cbb32127SBarry Smith 311*cbb32127SBarry Smith Level: intermediate 312*cbb32127SBarry Smith M*/ 313*cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF) 314*cbb32127SBarry Smith 3157eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE) 31665ef3172SBarry Smith 31777ed5343SBarry Smith /* 318b0a32e0cSBarry Smith PetscViewer based on the ALICE Memory Snooper 31977ed5343SBarry Smith */ 320aa482453SBarry Smith #if defined(PETSC_HAVE_AMS) 321cb5b572fSBarry Smith #include "ams.h" 322b0a32e0cSBarry Smith EXTERN int PetscViewerAMSGetAMSComm(PetscViewer,AMS_Comm *); 323b0a32e0cSBarry Smith EXTERN int PetscViewerAMSOpen(MPI_Comm,const char[],PetscViewer*); 324b1607693SBarry Smith EXTERN int PetscViewerAMSLock(PetscViewer); 325b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_AMS_(MPI_Comm); 326b0a32e0cSBarry Smith EXTERN int PETSC_VIEWER_AMS_Destroy(MPI_Comm); 327b0a32e0cSBarry Smith #define PETSC_VIEWER_AMS_WORLD PETSC_VIEWER_AMS_(PETSC_COMM_WORLD) 3282eb8c8abSBarry Smith #endif 329cb5b572fSBarry Smith 330f2b01315SBarry Smith /* 331*cbb32127SBarry Smith petscViewer writes to Matlab .mat file 332*cbb32127SBarry Smith */ 333*cbb32127SBarry Smith EXTERN int PetscViewerMatlabPutArray(PetscViewer,int,int,PetscScalar*,char*); 334*cbb32127SBarry Smith EXTERN int PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,char*); 335*cbb32127SBarry Smith EXTERN int PetscViewerMatlabSetType(PetscViewer,PetscViewerMatlabType); 336*cbb32127SBarry Smith EXTERN int PetscViewerMatlabPutVariable(PetscViewer,const char*,void*); 337*cbb32127SBarry Smith 338*cbb32127SBarry Smith /* 339b0a32e0cSBarry Smith PetscViewer utility routines used by PETSc that are not normally used 340f2b01315SBarry Smith by users. 341f2b01315SBarry Smith */ 34287828ca2SBarry Smith EXTERN int PetscViewerSocketPutScalar(PetscViewer,int,int,PetscScalar*); 34387828ca2SBarry Smith EXTERN int PetscViewerSocketPutReal(PetscViewer,int,int,PetscReal*); 344b0a32e0cSBarry Smith EXTERN int PetscViewerSocketPutInt(PetscViewer,int,int*); 34587828ca2SBarry Smith EXTERN int PetscViewerSocketPutSparse_Private(PetscViewer,int,int,int,PetscScalar*,int*,int *); 346b0a32e0cSBarry Smith EXTERN int PetscViewerDestroyAMS_Private(void); 347f2b01315SBarry Smith 348b9617806SBarry Smith /*S 349b9617806SBarry Smith PetscViewers - Abstract collection of PetscViewers 350b9617806SBarry Smith 351b9617806SBarry Smith Level: intermediate 352b9617806SBarry Smith 353b9617806SBarry Smith Concepts: viewing 354b9617806SBarry Smith 355b9617806SBarry Smith .seealso: PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(), 356b9617806SBarry Smith PetscViewersGetViewer() 357b9617806SBarry Smith S*/ 358b0a32e0cSBarry Smith typedef struct _p_PetscViewers* PetscViewers; 359b0a32e0cSBarry Smith EXTERN int PetscViewersCreate(MPI_Comm,PetscViewers*); 360b0a32e0cSBarry Smith EXTERN int PetscViewersDestroy(PetscViewers); 361b0a32e0cSBarry Smith EXTERN int PetscViewersGetViewer(PetscViewers,int,PetscViewer*); 362d132466eSBarry Smith 363e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END 364cb5b572fSBarry Smith #endif 365