[petsc-users] Reading in a matrix from ASCII file

Storm Weiner stormweiner at berkeley.edu
Thu Oct 5 15:56:18 CDT 2017


Hey there,

I'm working through some basic examples, and I want to read in a test
matrix I have stored in a (row, column, value) ASCII file.   How can I read
this in using PETSc?


I found the routine PetscViewerASCIIOpen and PetscViewerASCIIRead  but I'm
not sure how to tell it that what I have is actually a matrix.  In this
example, I know the matrix, so I can specify how many entries to read, but
is there a way to just read "the whole file"?

What's the preferred PETSc way to do this?

I'm using F90 by the way.


-Storm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171005/f03723e2/attachment.html>


More information about the petsc-users mailing list