Re: [petsc-users] Implementing of a variable block size BILU preconditioner

2018-12-01 Thread Jed Brown via petsc-users
This would use the blocks as indicated by MatSetVariableBlockSizes, not
by using a matrix format that explicitly blocks?  The information it
needs is too big/complex to yield to the preconditioner via a call like
MatInvertVariableBlockDiagonal.  Instead, I would model it off MatFactor
and the ILU code.  I think it would be okay to go into
MatILUFactorSymbolic_SeqAIJ and take a different code path (into your
new code) when (variable) block sizes are set.

Note that the benefits from this might be marginal -- I think the
algorithms will produce effectively identical results and doubt there is
much opportunity for performance improvement without changing data
structures (at least in the common regimes I can think of).

Ali Reza Khaz'ali via petsc-users  writes:

> Hi,
>
> I want to implement a variable block size BILU preconditioner in PETSc. 
> I am wondering if modifying the PCVPBJACOBI preconditioner 
> (vpbjacobi.c), to get what I want, is a good idea.
>
> Any help is much appreciated.
>
> -- 
> Ali Reza Khaz’ali
> Assistant Professor of Petroleum Engineering,
> Department of Chemical Engineering
> Isfahan University of Technology
> Isfahan, Iran


Re: [petsc-users] Implementing of a variable block size BILU preconditioner

2018-12-01 Thread Smith, Barry F. via petsc-users

   Well, you need to start somewhere. It is going to take a combination of 
this, MatLUFactorSymbolic_SeqAIJ(), MatLUFactorSymbolic_SeqAIJ() and 
MatLUFactorNumerical_SeqAIJ() to get what you want. Note that one of the first 
things you need to do is given the MatGetVariableBlockSizes() determine the 
nonzero pattern of the "variable block" matrix from the nonzero pattern of the 
SeqAIJ matrix and then do a symbolic factorization on that new "reduced" sparse 
matrix. Them you do a numerical factorization using the "reduced sparse matrix" 
factorization.

Barry


> On Dec 1, 2018, at 4:54 PM, Ali Reza Khaz'ali  wrote:
> 
> Hi,
> 
> I want to implement a variable block size BILU preconditioner in PETSc. I am 
> wondering if modifying the PCVPBJACOBI preconditioner (vpbjacobi.c), to get 
> what I want, is a good idea.
> 
> Any help is much appreciated.
> 
> -- 
> Ali Reza Khaz’ali
> Assistant Professor of Petroleum Engineering,
> Department of Chemical Engineering
> Isfahan University of Technology
> Isfahan, Iran
> 



Re: [petsc-users] Implementing of a variable block size BILU preconditioner

2018-12-01 Thread Mark Adams via petsc-users
There is a reason PETSc does not have variable block matrices. It is messy
and rarely a big win. It is doable, ML/Aztec does it, but it is messy.

On Sat, Dec 1, 2018 at 6:20 PM Smith, Barry F. via petsc-users <
petsc-users@mcs.anl.gov> wrote:

>
>Well, you need to start somewhere. It is going to take a combination of
> this, MatLUFactorSymbolic_SeqAIJ(), MatLUFactorSymbolic_SeqAIJ() and
> MatLUFactorNumerical_SeqAIJ() to get what you want. Note that one of the
> first things you need to do is given the MatGetVariableBlockSizes()
> determine the nonzero pattern of the "variable block" matrix from the
> nonzero pattern of the SeqAIJ matrix and then do a symbolic factorization
> on that new "reduced" sparse matrix. Them you do a numerical factorization
> using the "reduced sparse matrix" factorization.
>
> Barry
>
>
> > On Dec 1, 2018, at 4:54 PM, Ali Reza Khaz'ali 
> wrote:
> >
> > Hi,
> >
> > I want to implement a variable block size BILU preconditioner in PETSc.
> I am wondering if modifying the PCVPBJACOBI preconditioner (vpbjacobi.c),
> to get what I want, is a good idea.
> >
> > Any help is much appreciated.
> >
> > --
> > Ali Reza Khaz’ali
> > Assistant Professor of Petroleum Engineering,
> > Department of Chemical Engineering
> > Isfahan University of Technology
> > Isfahan, Iran
> >
>
>