[petsc-users] Output matrix in CSR format

Jed Brown jed at jedbrown.org
Tue Jan 20 12:03:11 CST 2015


Please always use "reply-all" so that your messages go to the list.
This is standard mailing list etiquette.  It is important to preserve
threading for people who find this discussion later and so that we do
not waste our time re-answering the same questions that have already
been answered in private side-conversations.  You'll likely get an
answer faster that way too.

Chung-Kan Huang <ckhuangf at gmail.com> writes:

> You meant MatView right?

Yes.

>
> So it will work if I do,
>
>  PetscViewerBinaryOpen
> <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/PetscViewerBinaryOpen.html#PetscViewerBinaryOpen>
> (PETSC_COMM_WORLD
> <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PETSC_COMM_WORLD.html#PETSC_COMM_WORLD>
> ,filename,FILE_MODE_WRITE,&viewer);
> MatView
> <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatView.html#MatView>
> (mat,PETSC_VIEWER_STDOUT_WORLD
> <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/PETSC_VIEWER_STDOUT_WORLD.html#PETSC_VIEWER_STDOUT_WORLD>
> );

PetscViewerBinaryOpen(comm,filename,FILE_MODE_WRITE,&viewer);
MatView(mat,viewer);
PetscViewerDestroy(&viewer);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150120/dae44f58/attachment.pgp>


More information about the petsc-users mailing list