[petsc-users] output vec

Jed Brown jed at jedbrown.org
Thu May 22 10:07:06 CDT 2014


Likun Tan <likunt at caltech.edu> writes:

> Thanks for your suggestion.  
> Using VecView or PetscViewerBinaryWrite will print the vec vertically, i.e.
> m1
> m2
> m3
> m4
> m5
> m6

The binary viewer writes a *binary* file.  No formatting or line breaks.

> But I prefer the form
>
> m1 m2 m3
> m4 m5 m6
>
> Since in the end I will have about 1e+7 elements in the vec. If there is no way to output the vec in the second form, I will simply use VecView. Thanks.

Use VecView to write a binary (not ASCII) file.  See
PetscViewerBinaryOpen().  You can look at it with python, matlab/octave,
etc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140522/1d83dcad/attachment.pgp>


More information about the petsc-users mailing list