[petsc-users] Questions about MatConvert BAIJ to AIJ

Barry Smith bsmith at mcs.anl.gov
Wed Mar 18 14:54:43 CDT 2015


   You can use MatSetValuesBlocked() for AIJ matrices, obviously the matrix needs to have the block size

  Barry

> On Mar 18, 2015, at 2:46 PM, Chung-Kan Huang <ckhuangf at gmail.com> 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 <bsmith at mcs.anl.gov> 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 <ckhuangf at gmail.com> 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 <bsmith at mcs.anl.gov> 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 <ckhuangf at gmail.com> 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
> 



More information about the petsc-users mailing list