<p>Dear Barry:</p><p>I have solved my problem. If I need to do it according to my previous idea, because the matrix is MPIDense, I can't find MatPermute() for MPIDense. I have thought it didn't work in PETSc according to your suggestion.<br>
</p><p>Happy holiday!</p><p>Regards,</p><p>Yujie</p><br><div class="gmail_quote">On Wed, Dec 24, 2008 at 11:18 AM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d"><br>
On Dec 23, 2008, at 5:36 PM, Yujie wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear Matthew:<br>
<br>
The question is that I can't sort the IS. Because I need extract the matrix according to the index of IS. I have tried to use MatPermute(). However, there is not MPIDense-based. I am wondering why MatGetSubMatrices() need use the sorted IS.<br>
<br>
</blockquote>
<br></div>
Because its damn hard to do the getsubmatrices if they are not sorted.<br>
<br>
Why not sort the IS in your call and then use that renumbering when it is needed in your code? An ordering is just a naming<br>
of each value so once it is sorted that is just giving you a new naming and you can use that new naming everywhere.<br><font color="#888888">
<br>
Barry</font><div><div class="Wj3C7c"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks a lot.<br>
Regards,<br>
<br>
Yujie<br>
<br>
<br>
On Tue, Dec 23, 2008 at 2:06 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
You can sort them with ISSort.<br>
<br>
Matt<br>
<br>
On Tue, Dec 23, 2008 at 12:35 PM, Yujie <<a href="mailto:recrusader@gmail.com" target="_blank">recrusader@gmail.com</a>> wrote:<br>
Hi, PETSc developer<br>
<br>
I am using MatGetSubMatrices() for my application. Because I need to exact several matrices from the old one according to my index sets. These index sets are not sorted. To MPIDense matrix, it didn't work. could you give me some help? thanks a lot.<br>
<br>
Happy holiday:).<br>
<br>
Regards,<br>
<br>
Yujie<br>
<br>
<br>
<br>
<br>
-- <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>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br>