[petsc-users] VecView and MatView Question

Barry Smith bsmith at mcs.anl.gov
Tue Oct 23 12:49:51 CDT 2012


   Peter,

     You can use PETSC_VIEWER_ASCII_MATLAB   this causes all the decimal digits to be printed (useful for debugging)

   Barry


Just ignore the fact that it is related to MATLAB.


On Oct 23, 2012, at 9:08 AM, Peter Zhoujie Lyu <lzj at umich.edu> wrote:

> Okay, thanks. My output file is for debugging purpose. I need to check the possible errors at much higher digits, where VecView cut off at 6 digits for my case. I will try out HDF5 output then. 
> 
> Thanks,
> 
> Peter
> 
> On Tue, Oct 23, 2012 at 9:51 AM, Matthew Knepley <knepley at gmail.com> wrote:
> On Tue, Oct 23, 2012 at 9:49 AM, Peter Zhoujie Lyu <lzj at umich.edu> wrote:
> Hi everyone,
> 
> My code dumps petsc vec and mat into an output file using VecView and MatView. I was wondering if there is any way to set the format, such as number of digits that was showing in the output file?
> 
>       call PetscViewerASCIIOpen(PETSC_COMM_WORLD,"dJdWd.output",viewer,PETScIerr)
>       call PetscViewerSetFormat(viewer,PETSC_VIEWER_ASCII_INDEX,PetscIerr)
>       call VecView(dJdW,viewer,PETScIerr)
> 
> There is not. Our intention for ASCII output is debugging only. For production, we suggest using
> the binary output which is smaller and faster, or perhaps the HDF5 for which many good tools exist.
> 
>   Thanks,
> 
>     Matt
>  
> Thanks,
> 
> Peter
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
> 



More information about the petsc-users mailing list