[petsc-users] Fwd: Questions using PCFIELDSPLIT

Jed Brown jedbrown at mcs.anl.gov
Sat Dec 14 11:29:30 CST 2013


Adriano Côrtes <adrimacortes at gmail.com> writes:

> Hi all,
> I'm trying to play with PCFIELDSPLIT, but after reading I'm still confused
> interpreting the monitors. I'm trying to solve a Stokes problem
>
>         [  A    B^t  ]
> M =  [               ]
>         [  B    0     ]
>
> My first question is about the MINRES behaviour with pcfieldsplit. My
> options for pcfieldsplit are
>
>     ierr = PCFieldSplitSetType(pc,PC_COMPOSITE_SCHUR);CHKERRQ(ierr);
>
>     PCFieldSplitSchurFactType schurfact = PC_FIELDSPLIT_SCHUR_FACT_DIAG;
>     ierr = PCFieldSplitSetSchurFactType(pc,schurfact);CHKERRQ(ierr);
>
>     PCFieldSplitSchurPreType  schurpre = PC_FIELDSPLIT_SCHUR_PRE_USER;

Use -ksp_view to check that these are being used.  I recommend setting
all these options using run-time options unless your code is taking
active control over the choice of algorithm.

>   where I'm providing the pressure mass matrix as a preconditioner for S.

Where are you putting it?

> When I run with
>
> -snes_type ksponly
> -ksp_type minres
> -pc_type fieldsplit
>
>  #Velocity
> -fieldsplit_u_ksp_type cg
> -fieldsplit_u_pc_type jacobi
> -fieldsplit_u_ksp_rtol 1e-05
> -fieldsplit_u_ksp_monitor
>
> #Pressure
> -fieldsplit_p_ksp_type cg
> -fieldsplit_p_pc_type jacobi
> -fieldsplit_p_ksp_rtol 1e-05
> -fieldsplit_p_ksp_monitor
>
> the solution does not converge

"does not converge" is to imprecise to say anything.  What exactly do
you observe?

> (i'm testing an analytical one), but when I use -ksp_type gmres it
> converges.

Are you sure your matrices are symmetric?  (Including boundary conditions.)

> If you guys want I can dump both monitors outputs on a file an attach
> on the email.
>
> My second question is: what options I have to set up if I want to use as
> preconditionr for M the matrix
>
>         [  A    0  ]
> P =   [            ]
>         [  0    Q  ]
>
> where again Q is the pressure mass matrix, and with A and Q being solved by
> CG with BJACOBI.

I can't tell for sure from what you've sent, but PCFIELDSPLIT is likely
iterating on the actual Schur complement S = - B A^{-1} B^T,
preconditioned by your matrix Q.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131214/edd9631a/attachment.pgp>


More information about the petsc-users mailing list