PetscObjectViewSynchronizedFromOptions#
Processes command line options to determine if/how a serial PetscObject is to be collectively viewed.
Synopsis#
#include "petscsys.h"
PetscErrorCode PetscObjectViewSynchronizedFromOptions(PetscObject obj, PetscObject sobj, const char name[])
Collective
Input Parameters#
obj - the serial object
sobj - synchronization object that provides the synchronizing communicator
name - option string that is used to activate viewing. It typically ends with _view.
Options Database Key#
-name [viewertype][:…] - option name and values. In actual usage the key might be something like
-vec_view
Notes#
The objects will be viewed in sequence, following the MPI rank order.
For a viewertype that represents files, including ascii, binary, matlab, vu, vtk, glvis, cgns, and hdf5, the argument has the following form
viewertype[:filename[:format[:filemode]]]
where all parts are optional, but you need to include the colon to access the next part.
filename is the name of the file where the object data will be stored. format is the string name
of a PetscViewerFormat, for example, default or ascii_info. filemode can be append to indicate the file named filename should be appended
to and not replaced, while read indicates the file is for reading.
For example, to read from an HDF5 file, use
hdf5:sol.h5::read
For a viewertype of draw the argument is of the form
draw[:drawtype[:filename]]
where drawtype is, for example, tikz or x and filename indicates where the data is to be saved if it is not directly displayed.
Other formats, such as
socket[:port]
saws[:communicatorname]
that send the data to a Unix socket or publish the object to the Scientific Application Webserver (SAWs) exist.
If no value is provided ascii:stdout is used
This function is usually not called directly but is called by, for example, MatViewFromOptions().
See Also#
PetscObject, PetscObjectViewFromOptions(), PetscObjectView(), PetscOptionsCreateViewer()
Level#
developer
Location#
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages