[petsc-users] Reading matrices into PETSc

Barry Smith bsmith at mcs.anl.gov
Tue Dec 21 22:16:47 CST 2010


 http://www.mcs.anl.gov/petsc/petsc-as/documentation/faq.html#sparse-matrix-ascii-format

   Barry

On Dec 21, 2010, at 10:03 PM, Gaurish Telang wrote:

> i have this large text file containing a matrix. 
>  
> This text file contains the non-zero entries of a very large sparse matrix
>  
> 
> The first two columns indicate the position of the non-zero entry
>   
> and the last column the actual non-zero value it self
>  
> 
> for 
> example the matrix 
>   
> 1 0 8
>   
> 0 0 5
>   
> 6 0 0
>   
> is written in the text file in the form of
>   
> 1 1 1
>   
> 1 3 8
>  
> 2 3 5
>   
> 3 1 6
> 
> This is the standard  [(row ,column),  non-zero] entry format. 
> i want PETSc to load this matrix
>   
> from the text file
>   
> i am not sure how
>   
> to do that. What commands do I use?  
> 
> I am new to PETSc, so some detail in the explanation will be really helpful.
> 
> Sincere thanks,
> 
> Gaurish.  



More information about the petsc-users mailing list