[francois pacull] Re: fieldsplits

Barry Smith bsmith at mcs.anl.gov
Thu Dec 10 15:12:38 CST 2009


On Dec 10, 2009, at 3:03 PM, Jed Brown wrote:

> Can KSPView before KSPSolve reasonably be made to work?

    In general KSPView() should work perfect after KSPSetUp() but  
before KSPSolve() BUT with the heirarchical preconditioners (like even  
block Jacobi) some inner KSPSetUps() may not happen before the  
KSPSolve() hence the view may not work correctly.

There is a KSPSetUpOnBlocks() that is suppose to make sure the inner  
KSPSetUp()s are called, but with many-level heirarchical  
preconditioners it may not get all the inner setups done properly.

   I do not know if it is possible to get it all correct in all cases  
of composing preconditioners. I think  it is difficult.


    Barry


>
>
> From: francois pacull <fpacull at fluorem.com>
> Date: December 10, 2009 5:27:57 AM CST
> To: Jed Brown <jed at 59a2.org>
> Subject: Re: fieldsplits
>
>
> Thanks a lot, it works now.
>
> Besides my confusion with the fieldsplit Schur options, I think that  
> my
> mistake was that I was not calling a PCSetUp of the fieldsplit PC  
> before
> calling a KSPView (which I always call just before the KSPSolve):
> PCFieldSplitSetType(fieldsplitPC,PC_COMPOSITE_SCHUR) ...
> PCSetUp(fieldsplitPC), KSPView, KSPSolve works
> PCFieldSplitSetType(fieldsplitPC,PC_COMPOSITE_SCHUR) ... KSPSolve  
> works
> PCFieldSplitSetType(fieldsplitPC,PC_COMPOSITE_SCHUR) ... KSPView,
> KSPSolve does not work.
>
> francois.
>
>
> Jed Brown a écrit :
>> Thanks for the info, I'll read the rest more carefully later.
>>
>> On Wed, 09 Dec 2009 16:56:11 +0100, francois pacull <fpacull at fluorem.com 
>> > wrote:
>>
>>
>>> I would like to use an ILU factorization for A, a GMRES for S...  
>>> Also, I
>>> would like an ILU factorization for D,  in order to construct a
>>> preconditioner for S, but how to set it up? With fieldsplit_1 I  
>>> guess?
>>>
>>
>> I think this will do what you're asking for
>>
>> -fieldsplit_0_ksp_type preonly         # no subcycles on A
>> -fieldsplit_0_pc_type ilu              # precondition A using ILU
>> -pc_fieldsplit_schur_precondition diag # use D as preconditioning  
>> matrix for S
>> -fieldsplit_1_ksp_type gmres           # GMRES on S
>> -fieldsplit_1_ksp_max_it 10            # 10 iterations max
>> -fieldsplit_1_pc_type ilu              # ILU of D to precondition  
>> GMRES on S
>>
>> Use -ksp_type fgmres because the preconditioner is nonlinear,  
>> pc_types
>> would need to be asm or bjacobi in parallel, but try in serial first.
>>
>> Jed
>>
>>
>
>




More information about the petsc-dev mailing list