petsc-3.7.1 2016-05-15
Report Typos and Errors

PetscViewerASCIIOpen

Opens an ASCII file as a PetscViewer.

Synopsis

#include "petscsys.h"   
PetscErrorCode  PetscViewerASCIIOpen(MPI_Comm comm,const char name[],PetscViewer *lab)
Collective on MPI_Comm Many br

Input Parameters

comm - the communicator Many br
name - the file name Many br

Output Parameter

lab -the PetscViewer to use with the specified file Many br

Many br

Notes

This PetscViewer can be destroyed with PetscViewerDestroy(). Many br

The MPI communicator used here must match that used by the object one is viewing. For example if the Many brMat was created with a PETSC_COMM_WORLD, then the Viewer must be created with PETSC_COMM_WORLD Many br

As shown below, PetscViewerASCIIOpen() is useful in conjunction with Many brMatView() and VecView() Many br

     PetscViewerASCIIOpen(PETSC_COMM_WORLD,"mat.output",&viewer);
     MatView(matrix,viewer);
Many br

See Also

MatView(), VecView(), PetscViewerDestroy(), PetscViewerBinaryOpen(),
PetscViewerASCIIGetPointer(), PetscViewerPushFormat(), PETSC_VIEWER_STDOUT_, PETSC_VIEWER_STDERR_, Many brPETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_STDOUT_SELF, Many br

Level:beginner
Location:
src/sys/classes/viewer/impls/ascii/vcreatea.c
Index of all Viewer routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/ksp/ksp/examples/tutorials/ex4.c.html
src/ksp/ksp/examples/tutorials/ex10.c.html
src/ksp/ksp/examples/tutorials/ex54.c.html
src/ksp/ksp/examples/tutorials/ex55.c.html
src/ksp/ksp/examples/tutorials/ex56.c.html
src/snes/examples/tutorials/ex15.c.html
src/snes/examples/tutorials/ex48.c.html
src/snes/examples/tutorials/ex70.c.html
src/ts/examples/tutorials/ex9.c.html
src/ts/examples/tutorials/ex14.c.html