<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 18, 2015 at 2:54 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">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"><br>
You can use MatSetValuesBlocked() for AIJ matrices, obviously the matrix needs to have the block size<br></blockquote><div><br></div><div>Barry,<br></div><div>I don't think that is the problem. The problem should be like Jed said, the MatConvert didn't actually work. <br></div><div>Now we can focus on how to make it work in my case.<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
Barry<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> On Mar 18, 2015, at 2:46 PM, Chung-Kan Huang <<a href="mailto:ckhuangf@gmail.com">ckhuangf@gmail.com</a>> wrote:<br>
><br>
> Yes, I was suprised that I can still use MatSetValuesBlocked after I did MatConvert MATBAIJ to MATAIJ.<br>
><br>
> Then I just found the mat type is still seqbaij which means the MatConvert didn't work.<br>
><br>
> This is how I did MatConvert<br>
><br>
> MatConvert(J, MATAIJ, MAT_REUSE_MATRIX, & J);<br>
><br>
> where J is my Jacobian matrix.<br>
><br>
> Thanks,<br>
><br>
><br>
> On Wed, Mar 18, 2015 at 2:24 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
><br>
> Are you always using MatSetValuesBlocked()?<br>
><br>
> Did you look at the three matrices (before passing to the solve), do they all have the exact same nonzero structure and entries?<br>
><br>
> Barry<br>
><br>
> > On Mar 18, 2015, at 1:45 PM, Chung-Kan Huang <<a href="mailto:ckhuangf@gmail.com">ckhuangf@gmail.com</a>> wrote:<br>
> ><br>
> > So go back to my original question,<br>
> ><br>
> > I found the resuls look like<br>
> > MATBAIJ == MATBAIJ2MATAIJ != MATAIJ<br>
> > as I was expected to see<br>
> > MATBAIJ != MATBAIJ2MATAIJ == MATAIJ<br>
> ><br>
> > because I thought MATBAIJ2MATAIJ & MATAIJ should use the same ILU factorization.<br>
> ><br>
> > On Wed, Mar 18, 2015 at 1:33 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
> ><br>
> > As I think I said earlier: ILU will behave differently with BAIJ and AIJ format. With BAIJ it uses a point block factorization (doing an ILU treating each block in the matrix as a single point (and doing a dense factorization for the inverse) while AIJ ignores the block size and just uses a point ILU. So in general the convergence with BAIJ vs AIJ and ILU will be different; usually BAIJ will converge better but it need not.<br>
> ><br>
> > Barry<br>
> ><br>
> > > On Mar 18, 2015, at 1:23 PM, Chung-Kan Huang <<a href="mailto:ckhuangf@gmail.com">ckhuangf@gmail.com</a>> wrote:<br>
> > ><br>
> > > Sorry I didn't state my problem more accurate. The entries in the input matrixes and vectors are correct -- they have right values and correct nonzero structure.<br>
> > > The KSP was setup so I can solve the lienar systems for an unsteady state convective problem.<br>
> > > I use KSPBCGS + PCILU and so far I only try sequential on a very small problem.<br>
> > > I wonder if blocked ilu is actually used in MATBAIJ2MATAIJ case.<br>
> > ><br>
> > > Thanks,<br>
> > ><br>
> > ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Cheers<br>
> ><br>
><br>
><br>
><br>
><br>
> --<br>
> Cheers<br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><p><b>Cheers</b></p></div>
</div></div>