#include "petscvec.h" PetscErrorCode VecView(Vec vec,PetscViewer viewer)Collective on Vec
vec | - the vector | |
viewer | - an optional visualization context |
PETSC_VIEWER_STDOUT_SELF | - standard output (default) | |
PETSC_VIEWER_STDOUT_WORLD | - synchronized standard output where only the first processor opens the file. All other processors send their data to the first processor to print. |
You can change the format the vector is printed using the option PetscViewerSetFormat().
The user can open alternative visualization contexts with
PetscViewerASCIIOpen() | - Outputs vector to a specified file | |
PetscViewerBinaryOpen() | - Outputs vector in binary to a specified file; corresponding input uses VecLoad() | |
PetscViewerDrawOpen() | - Outputs vector to an X window display | |
PetscViewerSocketOpen() | - Outputs vector to Socket viewer |
The user can call PetscViewerSetFormat() to specify the output format of ASCII printed objects (when using PETSC_VIEWER_STDOUT_SELF, PETSC_VIEWER_STDOUT_WORLD and PetscViewerASCIIOpen). Available formats include
PETSC_VIEWER_DEFAULT | - default, prints vector contents | |
PETSC_VIEWER_ASCII_MATLAB | - prints vector contents in MATLAB format | |
PETSC_VIEWER_ASCII_INDEX | - prints vector contents, including indices of vector elements | |
PETSC_VIEWER_ASCII_COMMON | - prints vector contents, using a format common among all vector types |
Notes for HDF5 Viewer: the name of the Vec (given with PetscObjectSetName() is the name that is used for the object in the HDF5 file. If you wish to store the same vector to the HDF5 viewer (with different values, obviously) several times, you must change its name each time before calling the VecView(). The name you use here should equal the name that you use in the Vec object that you use with VecLoad().
See the manual page for VecLoad() on the exact format the binary viewer stores the values in the file.
Level:beginner
Location:src/vec/vec/interface/vector.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages