[petsc-users] output vec

Jed Brown jed at jedbrown.org
Thu May 22 18:04:31 CDT 2014


likunt at caltech.edu writes:

> Thanks for your suggestion.
> I've successfully read some binary files from petsc examples using
> PetscBinaryRead, but I still have problem when reading the binary file
> from my code. The issue is that only the first 8 elements are read
> correctly and the rest are either extremely large or small numbers. I am
> using the following commands for data output:

It sounds like your code for reading the file is incorrect.  You can
look at the implementation (in C, Matlab, or Python), or you can just
call VecLoad().

> PetscViewerBinaryOpen(PETSC_COMM_WORLD, 'result.txt', FILE_MODE_WRITE,
> &view);
> VecView(field.M, view);
> PetscViewerDestroy(&view);
-------------- 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/6492b0ec/attachment.pgp>


More information about the petsc-users mailing list