> On Mar 18, 2015, at 3:10 PM, Chung-Kan Huang <[email protected]> wrote: > > > > On Wed, Mar 18, 2015 at 2:54 PM, Barry Smith <[email protected]> wrote: > > You can use MatSetValuesBlocked() for AIJ matrices, obviously the matrix > needs to have the block size > > Barry, > I don't think that is the problem. The problem should be like Jed said, the > MatConvert didn't actually work. > Now we can focus on how to make it work in my case.
Just print the three matrices and confirm if they are different or the same. > > Barry > > > On Mar 18, 2015, at 2:46 PM, Chung-Kan Huang <[email protected]> wrote: > > > > Yes, I was suprised that I can still use MatSetValuesBlocked after I did > > MatConvert MATBAIJ to MATAIJ. > > > > Then I just found the mat type is still seqbaij which means the MatConvert > > didn't work. > > > > This is how I did MatConvert > > > > MatConvert(J, MATAIJ, MAT_REUSE_MATRIX, & J); > > > > where J is my Jacobian matrix. > > > > Thanks, > > > > > > On Wed, Mar 18, 2015 at 2:24 PM, Barry Smith <[email protected]> wrote: > > > > Are you always using MatSetValuesBlocked()? > > > > Did you look at the three matrices (before passing to the solve), do they > > all have the exact same nonzero structure and entries? > > > > Barry > > > > > On Mar 18, 2015, at 1:45 PM, Chung-Kan Huang <[email protected]> wrote: > > > > > > So go back to my original question, > > > > > > I found the resuls look like > > > MATBAIJ == MATBAIJ2MATAIJ != MATAIJ > > > as I was expected to see > > > MATBAIJ != MATBAIJ2MATAIJ == MATAIJ > > > > > > because I thought MATBAIJ2MATAIJ & MATAIJ should use the same ILU > > > factorization. > > > > > > On Wed, Mar 18, 2015 at 1:33 PM, Barry Smith <[email protected]> wrote: > > > > > > 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. > > > > > > Barry > > > > > > > On Mar 18, 2015, at 1:23 PM, Chung-Kan Huang <[email protected]> wrote: > > > > > > > > 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. > > > > The KSP was setup so I can solve the lienar systems for an unsteady > > > > state convective problem. > > > > I use KSPBCGS + PCILU and so far I only try sequential on a very small > > > > problem. > > > > I wonder if blocked ilu is actually used in MATBAIJ2MATAIJ case. > > > > > > > > Thanks, > > > > > > > > > > > > > > > > > > > > > > > -- > > > Cheers > > > > > > > > > > > > > -- > > Cheers > > > > > > > -- > Cheers >
