<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=805512806-31012007>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=805512806-31012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=805512806-31012007> I have a function
which creates a sparse matrix following a certain eqn and returns a pointer to
the row, column index and the value of a sparse matrix (CRS-
form).</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=805512806-31012007>i
j val</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=805512806-31012007>1 1
1.0</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=805512806-31012007>2 2
1.0</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=805512806-31012007>2 3
-1.5..</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=805512806-31012007>so
on...</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=805512806-31012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=805512806-31012007> The matrix
<U>may not </U></SPAN></FONT><FONT face=Arial size=2><SPAN
class=805512806-31012007><U>have a definite pattern</U> like the one we see for
tridiagonal or pentadiagonal matrices or the test cases (linear solvers) cited
in the petsc documentation. </SPAN></FONT><FONT face=Arial size=2><SPAN
class=805512806-31012007>Now, i would like to use the linear solvers
in petsc to solve the system of equations. I do not want to write that sparse
matrix into a file and read it into petsc since it may be huge.I would like
to call that function from petsc and would return the pointer to i j and val and
</SPAN></FONT><FONT face=Arial size=2><SPAN class=805512806-31012007>insert
values of this sparse matrix using MatSetValues in parallel. How can I
achieve this ?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=805512806-31012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=805512806-31012007>Cheers,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=805512806-31012007>Dominic </SPAN></FONT></DIV></BODY></HTML>