ViewerASCIIOpen

Opens an ASCII file as a viewer.

Synopsis

#include "petsc.h"   
int ViewerASCIIOpen(MPI_Comm comm,const char name[],Viewer *lab)
Collective on MPI_Comm

Input Parameters

comm - the communicator
name - the file name

Output Parameter

lab -the viewer to use with the specified file

Notes

This viewer can be destroyed with ViewerDestroy().

If a multiprocessor communicator is used (such as PETSC_COMM_WORLD), then only the first processor in the group opens the file. All other processors send their data to the first processor to print.

Each processor can instead write its own independent output by specifying the communicator PETSC_COMM_SELF.

As shown below, ViewerASCIIOpen() is useful in conjunction with MatView() and VecView()

     ViewerASCIIOpen(PETSC_COMM_WORLD,"mat.output",&viewer);
     MatView(matrix,viewer);

Keywords

Viewer, file, open

See Also

MatView(), VecView(), ViewerDestroy(), ViewerBinaryOpen(),
ViewerASCIIGetPointer(), ViewerSetFormat(), VIEWER_STDOUT_, VIEWER_STDERR_, VIEWER_STDOUT_WORLD, VIEWER_STDOUT_SELF,

Level:beginner
Location:src/sys/src/viewer/impls/ascii/vcreatea.c
Viewer Index
Table of Contents