[11896] | 1 | /*
|
---|
| 2 | PetscViewers are objects where other objects can be looked at or stored.
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | #if !defined(__PETSCVIEWER_H)
|
---|
| 6 | #define __PETSCVIEWER_H
|
---|
| 7 |
|
---|
| 8 | #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus)
|
---|
| 9 | extern "C" {
|
---|
| 10 | #endif
|
---|
| 11 |
|
---|
| 12 | /*S
|
---|
| 13 | PetscViewer - Abstract PETSc object that helps view (in ASCII, binary, graphically etc)
|
---|
| 14 | other PETSc objects
|
---|
| 15 |
|
---|
| 16 | Level: beginner
|
---|
| 17 |
|
---|
| 18 | Concepts: viewing
|
---|
| 19 |
|
---|
| 20 | .seealso: PetscViewerCreate(), PetscViewerSetType(), PetscViewerType
|
---|
| 21 | S*/
|
---|
| 22 | typedef struct _p_PetscViewer* PetscViewer;
|
---|
| 23 |
|
---|
| 24 | #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus)
|
---|
| 25 | }
|
---|
| 26 | #endif
|
---|
| 27 |
|
---|
| 28 | #include "petscsys.h"
|
---|
| 29 |
|
---|
| 30 | #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus)
|
---|
| 31 | extern "C" {
|
---|
| 32 | #endif
|
---|
| 33 |
|
---|
| 34 | extern PetscClassId PETSC_VIEWER_CLASSID;
|
---|
| 35 |
|
---|
| 36 | #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus)
|
---|
| 37 | }
|
---|
| 38 | #endif
|
---|
| 39 |
|
---|
| 40 |
|
---|
| 41 | /*
|
---|
| 42 | petscsys.h must be included AFTER the definition of PetscViewer for ADIC to
|
---|
| 43 | process correctly.
|
---|
| 44 | */
|
---|
| 45 | PETSC_EXTERN_CXX_BEGIN
|
---|
| 46 | /*J
|
---|
| 47 | PetscViewerType - String with the name of a PETSc PETScViewer
|
---|
| 48 |
|
---|
| 49 | Level: beginner
|
---|
| 50 |
|
---|
| 51 | .seealso: PetscViewerSetType(), PetscViewer
|
---|
| 52 | J*/
|
---|
| 53 | #define PetscViewerType char*
|
---|
| 54 | #define PETSCVIEWERSOCKET "socket"
|
---|
| 55 | #define PETSCVIEWERASCII "ascii"
|
---|
| 56 | #define PETSCVIEWERBINARY "binary"
|
---|
| 57 | #define PETSCVIEWERSTRING "string"
|
---|
| 58 | #define PETSCVIEWERDRAW "draw"
|
---|
| 59 | #define PETSCVIEWERVU "vu"
|
---|
| 60 | #define PETSCVIEWERMATHEMATICA "mathematica"
|
---|
| 61 | #define PETSCVIEWERNETCDF "netcdf"
|
---|
| 62 | #define PETSCVIEWERHDF5 "hdf5"
|
---|
| 63 | #define PETSCVIEWERVTK "vtk"
|
---|
| 64 | #define PETSCVIEWERMATLAB "matlab"
|
---|
| 65 | #define PETSCVIEWERAMS "ams"
|
---|
| 66 |
|
---|
| 67 | extern PetscFList PetscViewerList;
|
---|
| 68 | extern PetscErrorCode PetscViewerRegisterAll(const char *);
|
---|
| 69 | extern PetscErrorCode PetscViewerRegisterDestroy(void);
|
---|
| 70 | extern PetscErrorCode PetscViewerInitializePackage(const char[]);
|
---|
| 71 |
|
---|
| 72 | extern PetscErrorCode PetscViewerRegister(const char*,const char*,const char*,PetscErrorCode (*)(PetscViewer));
|
---|
| 73 |
|
---|
| 74 | /*MC
|
---|
| 75 | PetscViewerRegisterDynamic - Adds a viewer
|
---|
| 76 |
|
---|
| 77 | Synopsis:
|
---|
| 78 | PetscErrorCode PetscViewerRegisterDynamic(const char *name_solver,const char *path,const char *name_create,PetscErrorCode (*routine_create)(PetscViewer))
|
---|
| 79 |
|
---|
| 80 | Not Collective
|
---|
| 81 |
|
---|
| 82 | Input Parameters:
|
---|
| 83 | + name_solver - name of a new user-defined viewer
|
---|
| 84 | . path - path (either absolute or relative) the library containing this viewer
|
---|
| 85 | . name_create - name of routine to create method context
|
---|
| 86 | - routine_create - routine to create method context
|
---|
| 87 |
|
---|
| 88 | Level: developer
|
---|
| 89 |
|
---|
| 90 | Notes:
|
---|
| 91 | PetscViewerRegisterDynamic() may be called multiple times to add several user-defined viewers.
|
---|
| 92 |
|
---|
| 93 | If dynamic libraries are used, then the fourth input argument (routine_create)
|
---|
| 94 | is ignored.
|
---|
| 95 |
|
---|
| 96 | Sample usage:
|
---|
| 97 | .vb
|
---|
| 98 | PetscViewerRegisterDynamic("my_viewer_type",/home/username/my_lib/lib/libO/solaris/mylib.a,
|
---|
| 99 | "MyViewerCreate",MyViewerCreate);
|
---|
| 100 | .ve
|
---|
| 101 |
|
---|
| 102 | Then, your solver can be chosen with the procedural interface via
|
---|
| 103 | $ PetscViewerSetType(viewer,"my_viewer_type")
|
---|
| 104 | or at runtime via the option
|
---|
| 105 | $ -viewer_type my_viewer_type
|
---|
| 106 |
|
---|
| 107 | Concepts: registering^Viewers
|
---|
| 108 |
|
---|
| 109 | .seealso: PetscViewerRegisterAll(), PetscViewerRegisterDestroy()
|
---|
| 110 | M*/
|
---|
| 111 | #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
|
---|
| 112 | #define PetscViewerRegisterDynamic(a,b,c,d) PetscViewerRegister(a,b,c,0)
|
---|
| 113 | #else
|
---|
| 114 | #define PetscViewerRegisterDynamic(a,b,c,d) PetscViewerRegister(a,b,c,d)
|
---|
| 115 | #endif
|
---|
| 116 |
|
---|
| 117 | extern PetscErrorCode PetscViewerCreate(MPI_Comm,PetscViewer*);
|
---|
| 118 | PetscPolymorphicSubroutine(PetscViewerCreate,(PetscViewer *v),(PETSC_COMM_SELF,v))
|
---|
| 119 | extern PetscErrorCode PetscViewerSetFromOptions(PetscViewer);
|
---|
| 120 | extern PetscErrorCode PetscViewerASCIIOpenWithFILE(MPI_Comm,FILE*,PetscViewer*);
|
---|
| 121 |
|
---|
| 122 | extern PetscErrorCode PetscViewerASCIIOpen(MPI_Comm,const char[],PetscViewer*);
|
---|
| 123 | extern PetscErrorCode PetscViewerASCIISetFILE(PetscViewer,FILE*);
|
---|
| 124 | extern PetscErrorCode PetscViewerBinaryOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
|
---|
| 125 | extern PetscErrorCode PetscViewerBinaryGetFlowControl(PetscViewer,PetscInt*);
|
---|
| 126 | extern PetscErrorCode PetscViewerBinarySetFlowControl(PetscViewer,PetscInt);
|
---|
| 127 | extern PetscErrorCode PetscViewerBinarySetMPIIO(PetscViewer);
|
---|
| 128 | extern PetscErrorCode PetscViewerBinaryGetMPIIO(PetscViewer,PetscBool *);
|
---|
| 129 | #if defined(PETSC_HAVE_MPIIO)
|
---|
| 130 | extern PetscErrorCode PetscViewerBinaryGetMPIIODescriptor(PetscViewer,MPI_File*);
|
---|
| 131 | extern PetscErrorCode PetscViewerBinaryGetMPIIOOffset(PetscViewer,MPI_Offset*);
|
---|
| 132 | extern PetscErrorCode PetscViewerBinaryAddMPIIOOffset(PetscViewer,MPI_Offset);
|
---|
| 133 | #endif
|
---|
| 134 |
|
---|
| 135 | extern PetscErrorCode PetscViewerSocketOpen(MPI_Comm,const char[],int,PetscViewer*);
|
---|
| 136 | extern PetscErrorCode PetscViewerStringOpen(MPI_Comm,char[],PetscInt,PetscViewer*);
|
---|
| 137 | extern PetscErrorCode PetscViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,PetscViewer*);
|
---|
| 138 | extern PetscErrorCode PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *);
|
---|
| 139 | extern PetscErrorCode PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *);
|
---|
| 140 | extern PetscErrorCode PetscViewerMatlabOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
|
---|
| 141 |
|
---|
| 142 | extern PetscErrorCode PetscViewerGetType(PetscViewer,const PetscViewerType*);
|
---|
| 143 | extern PetscErrorCode PetscViewerSetType(PetscViewer,const PetscViewerType);
|
---|
| 144 | extern PetscErrorCode PetscViewerDestroy(PetscViewer*);
|
---|
| 145 | extern PetscErrorCode PetscViewerGetSingleton(PetscViewer,PetscViewer*);
|
---|
| 146 | extern PetscErrorCode PetscViewerRestoreSingleton(PetscViewer,PetscViewer*);
|
---|
| 147 | extern PetscErrorCode PetscViewerGetSubcomm(PetscViewer,MPI_Comm,PetscViewer*);
|
---|
| 148 | extern PetscErrorCode PetscViewerRestoreSubcomm(PetscViewer,MPI_Comm,PetscViewer*);
|
---|
| 149 |
|
---|
| 150 | extern PetscErrorCode PetscViewerSetUp(PetscViewer);
|
---|
| 151 | extern PetscErrorCode PetscViewerView(PetscViewer,PetscViewer);
|
---|
| 152 |
|
---|
| 153 | extern PetscErrorCode PetscViewerSetOptionsPrefix(PetscViewer,const char[]);
|
---|
| 154 | extern PetscErrorCode PetscViewerAppendOptionsPrefix(PetscViewer,const char[]);
|
---|
| 155 | extern PetscErrorCode PetscViewerGetOptionsPrefix(PetscViewer,const char*[]);
|
---|
| 156 |
|
---|
| 157 | /*E
|
---|
| 158 | PetscViewerFormat - Way a viewer presents the object
|
---|
| 159 |
|
---|
| 160 | Level: beginner
|
---|
| 161 |
|
---|
| 162 | The values below are also listed in finclude/petscviewer.h. If another values is added below it
|
---|
| 163 | must also be added there.
|
---|
| 164 |
|
---|
| 165 | .seealso: PetscViewerSetFormat(), PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat()
|
---|
| 166 | E*/
|
---|
| 167 | typedef enum {
|
---|
| 168 | PETSC_VIEWER_DEFAULT,
|
---|
| 169 | PETSC_VIEWER_ASCII_MATLAB,
|
---|
| 170 | PETSC_VIEWER_ASCII_MATHEMATICA,
|
---|
| 171 | PETSC_VIEWER_ASCII_IMPL,
|
---|
| 172 | PETSC_VIEWER_ASCII_INFO,
|
---|
| 173 | PETSC_VIEWER_ASCII_INFO_DETAIL,
|
---|
| 174 | PETSC_VIEWER_ASCII_COMMON,
|
---|
| 175 | PETSC_VIEWER_ASCII_SYMMODU,
|
---|
| 176 | PETSC_VIEWER_ASCII_INDEX,
|
---|
| 177 | PETSC_VIEWER_ASCII_DENSE,
|
---|
| 178 | PETSC_VIEWER_ASCII_MATRIXMARKET,
|
---|
| 179 | PETSC_VIEWER_ASCII_VTK,
|
---|
| 180 | PETSC_VIEWER_ASCII_VTK_CELL,
|
---|
| 181 | PETSC_VIEWER_ASCII_VTK_COORDS,
|
---|
| 182 | PETSC_VIEWER_ASCII_PCICE,
|
---|
| 183 | PETSC_VIEWER_ASCII_PYTHON,
|
---|
| 184 | PETSC_VIEWER_ASCII_FACTOR_INFO,
|
---|
| 185 | PETSC_VIEWER_ASCII_LATEX,
|
---|
| 186 | PETSC_VIEWER_DRAW_BASIC,
|
---|
| 187 | PETSC_VIEWER_DRAW_LG,
|
---|
| 188 | PETSC_VIEWER_DRAW_CONTOUR,
|
---|
| 189 | PETSC_VIEWER_DRAW_PORTS,
|
---|
| 190 | PETSC_VIEWER_VTK_VTS,
|
---|
| 191 | PETSC_VIEWER_NATIVE,
|
---|
| 192 | PETSC_VIEWER_NOFORMAT
|
---|
| 193 | } PetscViewerFormat;
|
---|
| 194 | extern const char *const PetscViewerFormats[];
|
---|
| 195 |
|
---|
| 196 | extern PetscErrorCode PetscViewerSetFormat(PetscViewer,PetscViewerFormat);
|
---|
| 197 | extern PetscErrorCode PetscViewerPushFormat(PetscViewer,PetscViewerFormat);
|
---|
| 198 | extern PetscErrorCode PetscViewerPopFormat(PetscViewer);
|
---|
| 199 | extern PetscErrorCode PetscViewerGetFormat(PetscViewer,PetscViewerFormat*);
|
---|
| 200 | extern PetscErrorCode PetscViewerFlush(PetscViewer);
|
---|
| 201 |
|
---|
| 202 | /*
|
---|
| 203 | Operations explicit to a particular class of viewers
|
---|
| 204 | */
|
---|
| 205 |
|
---|
| 206 | extern PetscErrorCode PetscViewerASCIIGetPointer(PetscViewer,FILE**);
|
---|
| 207 | extern PetscErrorCode PetscViewerFileGetMode(PetscViewer,PetscFileMode*);
|
---|
| 208 | extern PetscErrorCode PetscViewerFileSetMode(PetscViewer,PetscFileMode);
|
---|
| 209 | extern PetscErrorCode PetscViewerASCIIPrintf(PetscViewer,const char[],...);
|
---|
| 210 | extern PetscErrorCode PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...);
|
---|
| 211 | extern PetscErrorCode PetscViewerASCIISynchronizedAllow(PetscViewer,PetscBool);
|
---|
| 212 | extern PetscErrorCode PetscViewerASCIIPushTab(PetscViewer);
|
---|
| 213 | extern PetscErrorCode PetscViewerASCIIPopTab(PetscViewer);
|
---|
| 214 | extern PetscErrorCode PetscViewerASCIIUseTabs(PetscViewer,PetscBool );
|
---|
| 215 | extern PetscErrorCode PetscViewerASCIISetTab(PetscViewer,PetscInt);
|
---|
| 216 | extern PetscErrorCode PetscViewerASCIIAddTab(PetscViewer,PetscInt);
|
---|
| 217 | extern PetscErrorCode PetscViewerASCIISubtractTab(PetscViewer,PetscInt);
|
---|
| 218 | extern PetscErrorCode PetscViewerBinaryGetDescriptor(PetscViewer,int*);
|
---|
| 219 | extern PetscErrorCode PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **);
|
---|
| 220 | extern PetscErrorCode PetscViewerBinaryRead(PetscViewer,void*,PetscInt,PetscDataType);
|
---|
| 221 | extern PetscErrorCode PetscViewerBinaryWrite(PetscViewer,void*,PetscInt,PetscDataType,PetscBool );
|
---|
| 222 | extern PetscErrorCode PetscViewerStringSPrintf(PetscViewer,const char[],...);
|
---|
| 223 | extern PetscErrorCode PetscViewerStringSetString(PetscViewer,char[],PetscInt);
|
---|
| 224 | extern PetscErrorCode PetscViewerDrawClear(PetscViewer);
|
---|
| 225 | extern PetscErrorCode PetscViewerDrawSetHold(PetscViewer,PetscBool);
|
---|
| 226 | extern PetscErrorCode PetscViewerDrawGetHold(PetscViewer,PetscBool*);
|
---|
| 227 | extern PetscErrorCode PetscViewerDrawSetPause(PetscViewer,PetscReal);
|
---|
| 228 | extern PetscErrorCode PetscViewerDrawGetPause(PetscViewer,PetscReal*);
|
---|
| 229 | extern PetscErrorCode PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int);
|
---|
| 230 | extern PetscErrorCode PetscViewerDrawResize(PetscViewer,int,int);
|
---|
| 231 | extern PetscErrorCode PetscViewerDrawSetBounds(PetscViewer,PetscInt,const PetscReal*);
|
---|
| 232 | extern PetscErrorCode PetscViewerDrawGetBounds(PetscViewer,PetscInt*,const PetscReal**);
|
---|
| 233 | extern PetscErrorCode PetscViewerSocketSetConnection(PetscViewer,const char[],int);
|
---|
| 234 | extern PetscErrorCode PetscViewerBinarySkipInfo(PetscViewer);
|
---|
| 235 | extern PetscErrorCode PetscViewerBinarySetSkipOptions(PetscViewer,PetscBool );
|
---|
| 236 | extern PetscErrorCode PetscViewerBinaryGetSkipOptions(PetscViewer,PetscBool *);
|
---|
| 237 | extern PetscErrorCode PetscViewerBinarySetSkipHeader(PetscViewer,PetscBool);
|
---|
| 238 | extern PetscErrorCode PetscViewerBinaryGetSkipHeader(PetscViewer,PetscBool*);
|
---|
| 239 | extern PetscErrorCode PetscViewerBinaryReadStringArray(PetscViewer,char***);
|
---|
| 240 | extern PetscErrorCode PetscViewerBinaryWriteStringArray(PetscViewer,char**);
|
---|
| 241 |
|
---|
| 242 | extern PetscErrorCode PetscViewerFileSetName(PetscViewer,const char[]);
|
---|
| 243 | extern PetscErrorCode PetscViewerFileGetName(PetscViewer,const char**);
|
---|
| 244 |
|
---|
| 245 | extern PetscErrorCode PetscPLAPACKInitializePackage(MPI_Comm com);
|
---|
| 246 | extern PetscErrorCode PetscPLAPACKFinalizePackage(void);
|
---|
| 247 |
|
---|
| 248 | extern PetscErrorCode PetscViewerVUGetPointer(PetscViewer, FILE**);
|
---|
| 249 | extern PetscErrorCode PetscViewerVUSetVecSeen(PetscViewer, PetscBool );
|
---|
| 250 | extern PetscErrorCode PetscViewerVUGetVecSeen(PetscViewer, PetscBool *);
|
---|
| 251 | extern PetscErrorCode PetscViewerVUPrintDeferred(PetscViewer, const char [], ...);
|
---|
| 252 | extern PetscErrorCode PetscViewerVUFlushDeferred(PetscViewer);
|
---|
| 253 |
|
---|
| 254 | extern PetscErrorCode PetscViewerMathematicaInitializePackage(const char[]);
|
---|
| 255 | extern PetscErrorCode PetscViewerMathematicaFinalizePackage(void);
|
---|
| 256 | extern PetscErrorCode PetscViewerMathematicaGetName(PetscViewer, const char **);
|
---|
| 257 | extern PetscErrorCode PetscViewerMathematicaSetName(PetscViewer, const char []);
|
---|
| 258 | extern PetscErrorCode PetscViewerMathematicaClearName(PetscViewer);
|
---|
| 259 | extern PetscErrorCode PetscViewerMathematicaSkipPackets(PetscViewer, int);
|
---|
| 260 |
|
---|
| 261 | extern PetscErrorCode PetscViewerSiloGetName(PetscViewer, char **);
|
---|
| 262 | extern PetscErrorCode PetscViewerSiloSetName(PetscViewer, const char []);
|
---|
| 263 | extern PetscErrorCode PetscViewerSiloClearName(PetscViewer);
|
---|
| 264 | extern PetscErrorCode PetscViewerSiloGetMeshName(PetscViewer, char **);
|
---|
| 265 | extern PetscErrorCode PetscViewerSiloSetMeshName(PetscViewer, const char []);
|
---|
| 266 | extern PetscErrorCode PetscViewerSiloClearMeshName(PetscViewer);
|
---|
| 267 |
|
---|
| 268 | extern PetscErrorCode PetscViewerNetcdfOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
|
---|
| 269 | extern PetscErrorCode PetscViewerNetcdfGetID(PetscViewer, int *);
|
---|
| 270 |
|
---|
| 271 | extern PetscErrorCode PetscViewerHDF5WriteSDS(PetscViewer,float *,int,int *,int);
|
---|
| 272 |
|
---|
| 273 | extern PetscErrorCode PetscViewerHDF5Open(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
|
---|
| 274 | extern PetscErrorCode PetscViewerHDF5PushGroup(PetscViewer,const char *);
|
---|
| 275 | extern PetscErrorCode PetscViewerHDF5PopGroup(PetscViewer);
|
---|
| 276 | extern PetscErrorCode PetscViewerHDF5GetGroup(PetscViewer, const char **);
|
---|
| 277 | extern PetscErrorCode PetscViewerHDF5IncrementTimestep(PetscViewer);
|
---|
| 278 | extern PetscErrorCode PetscViewerHDF5SetTimestep(PetscViewer,PetscInt);
|
---|
| 279 | extern PetscErrorCode PetscViewerHDF5GetTimestep(PetscViewer,PetscInt*);
|
---|
| 280 | #ifdef PETSC_HAVE_HDF5
|
---|
| 281 | #include <hdf5.h>
|
---|
| 282 | extern PetscErrorCode PetscViewerHDF5GetFileId(PetscViewer,hid_t*);
|
---|
| 283 | extern PetscErrorCode PetscViewerHDF5OpenGroup(PetscViewer, hid_t *, hid_t *);
|
---|
| 284 | #endif
|
---|
| 285 |
|
---|
| 286 | typedef PetscErrorCode (*PetscViewerVTKWriteFunction)(PetscObject,PetscViewer);
|
---|
| 287 | extern PetscErrorCode PetscViewerVTKAddField(PetscViewer,PetscObject,PetscViewerVTKWriteFunction,PetscObject);
|
---|
| 288 | extern PetscErrorCode PetscViewerVTKOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
|
---|
| 289 |
|
---|
| 290 | /*
|
---|
| 291 | These are all the default viewers that do not have
|
---|
| 292 | to be explicitly opened
|
---|
| 293 | */
|
---|
| 294 | extern PetscViewer PETSC_VIEWER_STDOUT_(MPI_Comm);
|
---|
| 295 | extern PetscErrorCode PetscViewerASCIIGetStdout(MPI_Comm,PetscViewer*);
|
---|
| 296 | extern PetscViewer PETSC_VIEWER_STDERR_(MPI_Comm);
|
---|
| 297 | extern PetscErrorCode PetscViewerASCIIGetStderr(MPI_Comm,PetscViewer*);
|
---|
| 298 | extern PetscViewer PETSC_VIEWER_DRAW_(MPI_Comm);
|
---|
| 299 | extern PetscViewer PETSC_VIEWER_SOCKET_(MPI_Comm);
|
---|
| 300 | extern PetscViewer PETSC_VIEWER_BINARY_(MPI_Comm);
|
---|
| 301 | extern PetscViewer PETSC_VIEWER_MATLAB_(MPI_Comm);
|
---|
| 302 | extern PetscViewer PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE;
|
---|
| 303 |
|
---|
| 304 | #define PETSC_VIEWER_STDERR_SELF PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
|
---|
| 305 | #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
|
---|
| 306 |
|
---|
| 307 | /*MC
|
---|
| 308 | PETSC_VIEWER_STDOUT_WORLD - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
|
---|
| 309 |
|
---|
| 310 | Level: beginner
|
---|
| 311 | M*/
|
---|
| 312 | #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
|
---|
| 313 |
|
---|
| 314 | /*MC
|
---|
| 315 | PETSC_VIEWER_STDOUT_SELF - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
|
---|
| 316 |
|
---|
| 317 | Level: beginner
|
---|
| 318 | M*/
|
---|
| 319 | #define PETSC_VIEWER_STDOUT_SELF PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
|
---|
| 320 |
|
---|
| 321 | /*MC
|
---|
| 322 | PETSC_VIEWER_DRAW_WORLD - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
|
---|
| 323 |
|
---|
| 324 | Level: intermediate
|
---|
| 325 | M*/
|
---|
| 326 | #define PETSC_VIEWER_DRAW_WORLD PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
|
---|
| 327 |
|
---|
| 328 | /*MC
|
---|
| 329 | PETSC_VIEWER_DRAW_SELF - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
|
---|
| 330 |
|
---|
| 331 | Level: intermediate
|
---|
| 332 | M*/
|
---|
| 333 | #define PETSC_VIEWER_DRAW_SELF PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
|
---|
| 334 |
|
---|
| 335 | /*MC
|
---|
| 336 | PETSC_VIEWER_SOCKET_WORLD - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
|
---|
| 337 |
|
---|
| 338 | Level: intermediate
|
---|
| 339 | M*/
|
---|
| 340 | #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
|
---|
| 341 |
|
---|
| 342 | /*MC
|
---|
| 343 | PETSC_VIEWER_SOCKET_SELF - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
|
---|
| 344 |
|
---|
| 345 | Level: intermediate
|
---|
| 346 | M*/
|
---|
| 347 | #define PETSC_VIEWER_SOCKET_SELF PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
|
---|
| 348 |
|
---|
| 349 | /*MC
|
---|
| 350 | PETSC_VIEWER_BINARY_WORLD - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
|
---|
| 351 |
|
---|
| 352 | Level: intermediate
|
---|
| 353 | M*/
|
---|
| 354 | #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
|
---|
| 355 |
|
---|
| 356 | /*MC
|
---|
| 357 | PETSC_VIEWER_BINARY_SELF - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
|
---|
| 358 |
|
---|
| 359 | Level: intermediate
|
---|
| 360 | M*/
|
---|
| 361 | #define PETSC_VIEWER_BINARY_SELF PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
|
---|
| 362 |
|
---|
| 363 | /*MC
|
---|
| 364 | PETSC_VIEWER_MATLAB_WORLD - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
|
---|
| 365 |
|
---|
| 366 | Level: intermediate
|
---|
| 367 | M*/
|
---|
| 368 | #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
|
---|
| 369 |
|
---|
| 370 | /*MC
|
---|
| 371 | PETSC_VIEWER_MATLAB_SELF - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
|
---|
| 372 |
|
---|
| 373 | Level: intermediate
|
---|
| 374 | M*/
|
---|
| 375 | #define PETSC_VIEWER_MATLAB_SELF PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
|
---|
| 376 |
|
---|
| 377 | #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE)
|
---|
| 378 |
|
---|
| 379 | #define PetscViewerFlowControlStart(viewer,mcnt,cnt) (PetscViewerBinaryGetFlowControl(viewer,mcnt) || PetscViewerBinaryGetFlowControl(viewer,cnt))
|
---|
| 380 | #define PetscViewerFlowControlStepMaster(viewer,i,mcnt,cnt) ((i >= mcnt) ? (mcnt += cnt,MPI_Bcast(&mcnt,1,MPIU_INT,0,((PetscObject)viewer)->comm)) : 0)
|
---|
| 381 | #define PetscViewerFlowControlEndMaster(viewer,mcnt) (mcnt = 0,MPI_Bcast(&mcnt,1,MPIU_INT,0,((PetscObject)viewer)->comm))
|
---|
| 382 | #define PetscViewerFlowControlStepWorker(viewer,rank,mcnt) 0; while (1) { PetscErrorCode _ierr; \
|
---|
| 383 | if (rank < mcnt) break; \
|
---|
| 384 | _ierr = MPI_Bcast(&mcnt,1,MPIU_INT,0,((PetscObject)viewer)->comm);CHKERRQ(_ierr);\
|
---|
| 385 | }
|
---|
| 386 | #define PetscViewerFlowControlEndWorker(viewer,mcnt) 0; while (1) { PetscErrorCode _ierr; \
|
---|
| 387 | _ierr = MPI_Bcast(&mcnt,1,MPIU_INT,0,((PetscObject)viewer)->comm);CHKERRQ(_ierr);\
|
---|
| 388 | if (mcnt == 0) break; \
|
---|
| 389 | }
|
---|
| 390 |
|
---|
| 391 | /*
|
---|
| 392 | petscViewer writes to MATLAB .mat file
|
---|
| 393 | */
|
---|
| 394 | extern PetscErrorCode PetscViewerMatlabPutArray(PetscViewer,int,int,const PetscScalar*,const char*);
|
---|
| 395 | extern PetscErrorCode PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,const char*);
|
---|
| 396 | extern PetscErrorCode PetscViewerMatlabPutVariable(PetscViewer,const char*,void*);
|
---|
| 397 |
|
---|
| 398 | /*S
|
---|
| 399 | PetscViewers - Abstract collection of PetscViewers. It is just an expandable array of viewers.
|
---|
| 400 |
|
---|
| 401 | Level: intermediate
|
---|
| 402 |
|
---|
| 403 | Concepts: viewing
|
---|
| 404 |
|
---|
| 405 | .seealso: PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(),
|
---|
| 406 | PetscViewersGetViewer()
|
---|
| 407 | S*/
|
---|
| 408 | typedef struct _n_PetscViewers* PetscViewers;
|
---|
| 409 | extern PetscErrorCode PetscViewersCreate(MPI_Comm,PetscViewers*);
|
---|
| 410 | extern PetscErrorCode PetscViewersDestroy(PetscViewers*);
|
---|
| 411 | extern PetscErrorCode PetscViewersGetViewer(PetscViewers,PetscInt,PetscViewer*);
|
---|
| 412 |
|
---|
| 413 | #if defined(PETSC_HAVE_AMS)
|
---|
| 414 | #include <ams.h>
|
---|
| 415 | extern PetscErrorCode PetscViewerAMSSetCommName(PetscViewer,const char[]);
|
---|
| 416 | extern PetscErrorCode PetscViewerAMSGetAMSComm(PetscViewer,AMS_Comm *);
|
---|
| 417 | extern PetscErrorCode PetscViewerAMSOpen(MPI_Comm,const char[],PetscViewer*);
|
---|
| 418 | extern PetscErrorCode PetscViewerAMSLock(PetscViewer);
|
---|
| 419 | extern PetscViewer PETSC_VIEWER_AMS_(MPI_Comm);
|
---|
| 420 | extern PetscErrorCode PETSC_VIEWER_AMS_Destroy(MPI_Comm);
|
---|
| 421 | #define PETSC_VIEWER_AMS_WORLD PETSC_VIEWER_AMS_(PETSC_COMM_WORLD)
|
---|
| 422 | #endif
|
---|
| 423 |
|
---|
| 424 |
|
---|
| 425 | PETSC_EXTERN_CXX_END
|
---|
| 426 | #endif
|
---|