[petsc-users] How to access the KSP objects from a PCFIELDSPLIT Schur preconditioner

Jed Brown jedbrown at mcs.anl.gov
Wed Oct 24 15:19:06 CDT 2012


You are looking for PCFieldSplitGetSubKSP().

Matt's comment was about distinguishing between the KSP living inside of S
= D - C A^{-1} B and the one used directly by PCFIeldSplit when solving
with A.

On Wed, Oct 24, 2012 at 3:04 PM, Thomas Witkowski <
thomas.witkowski at tu-dresden.de> wrote:

>  Am 24.10.2012 21:33, schrieb Matthew Knepley:
>
> On Wed, Oct 24, 2012 at 3:23 PM, Thomas Witkowski <
> thomas.witkowski at tu-dresden.de> wrote:
>
>> I want to play around with some special type of a Schur complement
>> preconditioner. It perfectly fits into PETSc's fieldsplit preconditioner
>> (schur - full factorization). But for the inner solvers, I would like to
>> create some MatShells. So I need to access both KSP objects, for the upper
>> block (KSP(A_00)) and for the Schur complement (KSP(S)). How can I get
>> these objects in my source code?
>>
>
>  First you have to make them different. This happens when you give
> options for
>
>    -fieldsplit_1_upper_*
>   -fieldsplit_1_inner_*
>
>  This is how I customize the solvers to get things like SIMPLE. Once they
> are created, you
> can get them by pulling apart the FS. The upper is fs->kspupper, and the
> inner is the KSP
> from the MATSCHUR from fs->schur.
>
> I don't understand your solution. Maybe I should put some lines of code to
> emphasize my question. The relevant part looks as follows:
>
> PCSetType(pc, PCFIELDSPLIT);
> PCFieldSplitSetSchurFactType(pc, PC_FIELDSPLIT_SCHUR_FACT_FULL);
> ...
> PCFieldSplitSetIS(pc, "velocity", is0);
> PCFieldSplitSetIS(pc, "pressure", is1);
> ...
> KSP velocity;
> KSP schur;
> ....
>
> Okay, I don't solve any Stokes/Navier Stokes equation, but to make the
> names somehow convenient I choose here the names velocity and pressure for
> the two system blocks. My question is now, how to figure out the two inner
> solver objects from the field split preconditioner.
>
> Matt, if your answer is still appropriate to my question, can you make it
> clear on the above piece of code? Thank you very much.
>
> Thomas
>
>
>
>     Matt
>
>
>> Best regards,
>>
>> Thomas
>>
>
>
>
>  --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20121024/706daefd/attachment.html>


More information about the petsc-users mailing list