[petsc-users] Use block Jacobi preconditioner with SNES

Jed Brown jed at jedbrown.org
Mon Aug 27 16:32:43 CDT 2018


"Smith, Barry F." <bsmith at mcs.anl.gov> writes:

>> On Aug 27, 2018, at 4:04 PM, Jed Brown <jed at jedbrown.org> wrote:
>> 
>> "Smith, Barry F." <bsmith at mcs.anl.gov> writes:
>> 
>>>    I have added new functionality within SNES to allow one to do as you desire in the branch barry/feature-snessetkspsetupcallback. Please see src/snes/examples/tests/ex3.c 
>> 
>> Note that this example is block Jacobi with O(1) sparse blocks per
>> process, not variable-sized point-block Jacobi which I think is what Ali
>> had in mind.
>
>     It is almost a cut and paste of the original code provided, just
>     set up as a callback. 

Yeah, but each of these blocks would be less than 10x10.

  PCBJacobiSetTotalBlocks(Petsc_pc, 2*Nx*Ny*Nz, SadeqSize);

>     If it performs well convergence wise then 

Yes.

>     one could consider implementing the (presumably) more efficient
>     variable blocksize point block Jacobi (either as an entirely new
>     preconditioner or as an option to the current point block Jacobi;
>     I would advocate a new one PCVPBJACOBI in order to limit code
>     complexity even though there might be a bit of code duplication.)

Yeah, possibly.  We'd need MatInvertBlockDiagonal (or a generalization)
to be able to return a variable block size at which point it's almost
the same.


More information about the petsc-users mailing list