On Thu, Aug 9, 2012 at 5:20 PM, Yifei Li <span dir="ltr"><<a href="mailto:yifli82@gmail.com" target="_blank">yifli82@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Hi all,</div>
<div> </div>
<div>I only filled the entries in the upper triangular part of the matrix, however, I got 0 when I tried to get the value of some entry in the lower triangular part.</div>
<div> </div>
<div>Here's how I do it:</div>
<div> </div>
<div><font>
<p>MatCreate(PETSC_COMM_WORLD, &A); </p>
<p>MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, n, n); </p>
<p>MatSetType(A, MATSEQSBAIJ); </p>
<p>MatSetUp(A); </p>
<p>// I set the value for the entry at (0, 2)</p><font>
<p>int i = 2, j = 0;</p>
<p>MatGetValues(A,1,&i,1,&j,values);</p></font></font></div></blockquote><div>MatGetValues() is not synchronous, so it would not be able to communicate to the</div><div>correct process to retrieve the values. Thus, you cannot retrieve the lower triangle.</div>
<div>This is analogous to only having access to local values with VecGetArray().</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><font><font>
<p>Any help is highly appreicated.</p><span class="HOEnZb"><font color="#888888">
<p> </p>
<p>Yifei</p></font></span></font></font></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>