On 1/31/07, <b class="gmail_sendername">#DOMINIC DENVER JOHN CHANDAR#</b> <<a href="mailto:DOMI0002@ntu.edu.sg">DOMI0002@ntu.edu.sg</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><font face="Arial" size="2"><span>Hi,</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span> 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>i
j val</span></font></div>
<div><font face="Arial" size="2"><span>1 1
1.0</span></font></div>
<div><font face="Arial" size="2"><span>2 2
1.0</span></font></div>
<div><font face="Arial" size="2"><span>2 3
-1.5..</span></font></div>
<div><font face="Arial" size="2"><span>so
on...</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span> The matrix
<u>may not </u></span></font><font face="Arial" size="2"><span><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>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>insert
values of this sparse matrix using MatSetValues in parallel. How can I
achieve this ?</span></font></div></div></blockquote><div><br>We do not have CRS format as it is not a very space efficient format. Most of our formats are row-oriented. I suggest<br>looking at the example for MatSetValues() and trying to rework the discretization function to directly call this. Most
<br>discretizations naturally generate row-by-row values or even blocks like FEM. Even totally nustructured stuff from<br>economics is row-by-row.<br><br> Thanks,<br><br> Matt<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div><font face="Arial" size="2"><span>Cheers,</span></font></div>
<div><font face="Arial" size="2"><span>Dominic <br></span></font></div></div>
</blockquote></div>-- <br>One trouble is that despite this system, anyone who reads journals widely<br>and critically is forced to realize that there are scarcely any bars to eventual<br>publication. There seems to be no study too fragmented, no hypothesis too
<br>trivial, no literature citation too biased or too egotistical, no design too<br>warped, no methodology too bungled, no presentation of results too<br>inaccurate, too obscure, and too contradictory, no analysis too self-serving,
<br>no argument too circular, no conclusions too trifling or too unjustified, and<br>no grammar and syntax too offensive for a paper to end up in print. -- Drummond Rennie