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*); 120b1967279SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryCreate(MPI_Comm,PetscViewer*); 1213c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*); 122ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketOpen(MPI_Comm,const char[],int,PetscViewer*); 123ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerStringOpen(MPI_Comm,char[],PetscInt,PetscViewer*); 124ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,PetscViewer*); 125ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *); 126ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *); 1273c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMatlabOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*); 1284b0e389bSBarry Smith 129ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetType(PetscViewer,PetscViewerType*); 130f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetType(PetscViewer,PetscViewerType); 131ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerDestroy(PetscViewer); 132ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetSingleton(PetscViewer,PetscViewer*); 133ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerRestoreSingleton(PetscViewer,PetscViewer*); 134ae39576cSLois Curfman McInnes 135f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetUp(PetscViewer); 136f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerView(PetscViewer,PetscViewer); 137f69a0ea3SMatthew Knepley 138f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetOptionsPrefix(PetscViewer,const char[]); 139f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerAppendOptionsPrefix(PetscViewer,const char[]); 140f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetOptionsPrefix(PetscViewer,const char*[]); 141090de74eSSatish Balay 142b9617806SBarry Smith /*E 143b9617806SBarry Smith PetscViewerFormat - Way a viewer presents the object 144b9617806SBarry Smith 145b9617806SBarry Smith Level: beginner 146b9617806SBarry Smith 147b9617806SBarry Smith .seealso: PetscViewerSetFormat(), PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat() 148b9617806SBarry Smith E*/ 149fb9695e5SSatish Balay typedef enum { 150f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_DEFAULT, 151f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_MATLAB, 1524ebda54eSMatthew Knepley PETSC_VIEWER_ASCII_MATHEMATICA, 153f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_IMPL, 154f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_INFO, 155456192e2SBarry Smith PETSC_VIEWER_ASCII_INFO_DETAIL, 156f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_COMMON, 157f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_SYMMODU, 158f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_INDEX, 159f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_DENSE, 160a505fa5bSMatthew Knepley PETSC_VIEWER_ASCII_VTK, 161*b85befe5SMatthew Knepley PETSC_VIEWER_ASCII_VTK_CELL, 162b6d733afSMatthew Knepley PETSC_VIEWER_ASCII_VTK_COORDS, 163493617b5SMatthew Knepley PETSC_VIEWER_ASCII_PCICE, 164493617b5SMatthew Knepley PETSC_VIEWER_ASCII_PYLITH, 165f3ef73ceSBarry Smith PETSC_VIEWER_BINARY_DEFAULT, 166f3ef73ceSBarry Smith PETSC_VIEWER_BINARY_NATIVE, 167f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_BASIC, 168f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_LG, 169f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_CONTOUR, 170f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_PORTS, 171f3ef73ceSBarry Smith PETSC_VIEWER_NATIVE, 1724aedb280SBarry Smith PETSC_VIEWER_NOFORMAT, 1734aedb280SBarry Smith PETSC_VIEWER_ASCII_FACTOR_INFO} PetscViewerFormat; 174090de74eSSatish Balay 175ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetFormat(PetscViewer,PetscViewerFormat); 176ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerPushFormat(PetscViewer,PetscViewerFormat); 177ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerPopFormat(PetscViewer); 178ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetFormat(PetscViewer,PetscViewerFormat*); 179ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerFlush(PetscViewer); 1804b0e389bSBarry Smith 18177ed5343SBarry Smith /* 18277ed5343SBarry Smith Operations explicit to a particular class of viewers 18377ed5343SBarry Smith */ 184ed5c6e3eSMatthew Knepley 185ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIGetPointer(PetscViewer,FILE**); 1863c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerFileSetMode(PetscViewer,PetscFileMode); 187ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3); 188ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3); 189ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIPushTab(PetscViewer); 190ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIPopTab(PetscViewer); 191ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIUseTabs(PetscViewer,PetscTruth); 192ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIISetTab(PetscViewer,PetscInt); 193ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryGetDescriptor(PetscViewer,int*); 194ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **); 195f588057bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryRead(PetscViewer,void*,PetscInt,PetscDataType); 196f588057bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryWrite(PetscViewer,void*,PetscInt,PetscDataType,PetscTruth); 197ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerStringSPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3); 198ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerStringSetString(PetscViewer,char[],PetscInt); 199ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerDrawClear(PetscViewer); 200ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int); 201ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketSetConnection(PetscViewer,const char[],PetscInt); 202ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinarySkipInfo(PetscViewer); 203ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryLoadInfo(PetscViewer); 2049dcbbd2bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinarySetSkipOptions(PetscViewer,PetscTruth); 2059dcbbd2bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryGetSkipOptions(PetscViewer,PetscTruth*); 2068a13ba5bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryReadStringArray(PetscViewer,char***); 2078a13ba5bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryWriteStringArray(PetscViewer,char**); 208c655490fSBarry Smith 2093c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerFileSetName(PetscViewer,const char[]); 2103c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerFileGetName(PetscViewer,char**); 21177ed5343SBarry Smith 212ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscPLAPACKInitializePackage(char *); 213ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscPLAPACKFinalizePackage(void); 21444c6da4fSMatthew Knepley 215ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUGetPointer(PetscViewer, FILE**); 216ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUSetVecSeen(PetscViewer, PetscTruth); 217ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUGetVecSeen(PetscViewer, PetscTruth *); 218ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUPrintDeferred(PetscViewer, const char [], ...) PETSC_PRINTF_FORMAT_CHECK(2,3); 219ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUFlushDeferred(PetscViewer); 22055dcf840SMatthew Knepley 221ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaInitializePackage(char *); 222ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaFinalizePackage(void); 223ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaGetName(PetscViewer, const char **); 224ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaSetName(PetscViewer, const char []); 225ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaClearName(PetscViewer); 226ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaSkipPackets(PetscViewer, int); 2274ebda54eSMatthew Knepley 228ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloGetName(PetscViewer, char **); 229ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloSetName(PetscViewer, const char []); 230ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloClearName(PetscViewer); 231ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloGetMeshName(PetscViewer, char **); 232ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloSetMeshName(PetscViewer, const char []); 233ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloClearMeshName(PetscViewer); 2344ebda54eSMatthew Knepley 2353c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerNetcdfOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*); 236ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerNetcdfGetID(PetscViewer, int *); 237e3eb5169SDinesh Kaushik 2383c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerHDF4Open(MPI_Comm,const char[],PetscFileMode,PetscViewer*); 239ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerHDF4WriteSDS(PetscViewer viewer, float *xf, int d, int *dims, int bs); 24000ccbe27SDinesh Kaushik 24177ed5343SBarry Smith /* 24277ed5343SBarry Smith These are all the default viewers that do not have 24377ed5343SBarry Smith to be explicitly opened 24477ed5343SBarry Smith */ 245ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_STDOUT_(MPI_Comm); 246ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_STDERR_(MPI_Comm); 247ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_DRAW_(MPI_Comm); 248ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_SOCKET_(MPI_Comm); 249ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_BINARY_(MPI_Comm); 250ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_MATLAB_(MPI_Comm); 2517eb62a3eSMatthew Knepley EXTERN PetscViewer PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE; 2525311e20fSBarry Smith 253b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF PETSC_VIEWER_STDERR_(PETSC_COMM_SELF) 254b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD) 25530de9b25SBarry Smith 25630de9b25SBarry Smith /*MC 25730de9b25SBarry Smith PETSC_VIEWER_STDOUT_WORLD - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD) 25830de9b25SBarry Smith 25930de9b25SBarry Smith Level: beginner 26030de9b25SBarry Smith M*/ 26130de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD) 26230de9b25SBarry Smith 26330de9b25SBarry Smith /*MC 26430de9b25SBarry Smith PETSC_VIEWER_STDOUT_SELF - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF) 26530de9b25SBarry Smith 26630de9b25SBarry Smith Level: beginner 26730de9b25SBarry Smith M*/ 26830de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF) 26930de9b25SBarry Smith 27030de9b25SBarry Smith /*MC 27130de9b25SBarry Smith PETSC_VIEWER_DRAW_WORLD - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD) 27230de9b25SBarry Smith 27330de9b25SBarry Smith Level: intermediate 27430de9b25SBarry Smith M*/ 275b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD) 27630de9b25SBarry Smith 27730de9b25SBarry Smith /*MC 27830de9b25SBarry Smith PETSC_VIEWER_DRAW_SELF - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF) 27930de9b25SBarry Smith 28030de9b25SBarry Smith Level: intermediate 28130de9b25SBarry Smith M*/ 28230de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF PETSC_VIEWER_DRAW_(PETSC_COMM_SELF) 28330de9b25SBarry Smith 28430de9b25SBarry Smith /*MC 28530de9b25SBarry Smith PETSC_VIEWER_SOCKET_WORLD - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD) 28630de9b25SBarry Smith 28730de9b25SBarry Smith Level: intermediate 28830de9b25SBarry Smith M*/ 289b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD) 29030de9b25SBarry Smith 29130de9b25SBarry Smith /*MC 29230de9b25SBarry Smith PETSC_VIEWER_SOCKET_SELF - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF) 29330de9b25SBarry Smith 29430de9b25SBarry Smith Level: intermediate 29530de9b25SBarry Smith M*/ 296b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF) 29730de9b25SBarry Smith 29830de9b25SBarry Smith /*MC 29930de9b25SBarry Smith PETSC_VIEWER_BINARY_WORLD - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD) 30030de9b25SBarry Smith 30130de9b25SBarry Smith Level: intermediate 30230de9b25SBarry Smith M*/ 303b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD) 30430de9b25SBarry Smith 30530de9b25SBarry Smith /*MC 30630de9b25SBarry Smith PETSC_VIEWER_BINARY_SELF - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF) 30730de9b25SBarry Smith 30830de9b25SBarry Smith Level: intermediate 30930de9b25SBarry Smith M*/ 310b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF PETSC_VIEWER_BINARY_(PETSC_COMM_SELF) 31130de9b25SBarry Smith 312cbb32127SBarry Smith /*MC 313cbb32127SBarry Smith PETSC_VIEWER_MATLAB_WORLD - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD) 314cbb32127SBarry Smith 315cbb32127SBarry Smith Level: intermediate 316cbb32127SBarry Smith M*/ 317cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD) 318cbb32127SBarry Smith 319cbb32127SBarry Smith /*MC 320cbb32127SBarry Smith PETSC_VIEWER_MATLAB_SELF - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF) 321cbb32127SBarry Smith 322cbb32127SBarry Smith Level: intermediate 323cbb32127SBarry Smith M*/ 324cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF) 325cbb32127SBarry Smith 3267eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE) 32765ef3172SBarry Smith 32877ed5343SBarry Smith /* 329cbb32127SBarry Smith petscViewer writes to Matlab .mat file 330cbb32127SBarry Smith */ 331ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMatlabPutArray(PetscViewer,int,int,PetscScalar*,char*); 332ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,char*); 333ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMatlabPutVariable(PetscViewer,const char*,void*); 334cbb32127SBarry Smith 335cbb32127SBarry Smith /* 336b0a32e0cSBarry Smith PetscViewer utility routines used by PETSc that are not normally used 337f2b01315SBarry Smith by users. 338f2b01315SBarry Smith */ 339ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketPutScalar(PetscViewer,PetscInt,PetscInt,PetscScalar*); 340ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketPutReal(PetscViewer,PetscInt,PetscInt,PetscReal*); 341ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketPutInt(PetscViewer,PetscInt,PetscInt*); 342ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketPutSparse_Private(PetscViewer,PetscInt,PetscInt,PetscInt,PetscScalar*,PetscInt*,PetscInt *); 343f2b01315SBarry Smith 344b9617806SBarry Smith /*S 345b9617806SBarry Smith PetscViewers - Abstract collection of PetscViewers 346b9617806SBarry Smith 347b9617806SBarry Smith Level: intermediate 348b9617806SBarry Smith 349b9617806SBarry Smith Concepts: viewing 350b9617806SBarry Smith 351b9617806SBarry Smith .seealso: PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(), 352b9617806SBarry Smith PetscViewersGetViewer() 353b9617806SBarry Smith S*/ 35495fbd943SSatish Balay typedef struct _n_PetscViewers* PetscViewers; 355ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewersCreate(MPI_Comm,PetscViewers*); 356ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewersDestroy(PetscViewers); 357ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewersGetViewer(PetscViewers,int,PetscViewer*); 358d132466eSBarry Smith 359e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END 360cb5b572fSBarry Smith #endif 361