[petsc-users] Nesting splits based on IS

Pierre Jolivet pierre at joliv.et
Sat Apr 17 12:14:06 CDT 2021


Dear Nicolas,
Here is how I would do it:
- if your Pmat type is MATNEST, that’s quite easy, see https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/tutorials/ex81.c.html <https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/tutorials/ex81.c.html>
- otherwise, you’ll need to first define a 2-way field splitting (with v+p and t), then fetch the appropriate (0,0) block with PCFieldSplitGetSubKSP(), and define an inner 2-way field splitting (with v and p).

Thanks,
Pierre

> On 17 Apr 2021, at 6:53 PM, Karin&NiKo <niko.karin at gmail.com> wrote:
> 
> Dear PETSc users,
> 
> I use the fieldsplit PC in an application where the splits are programmatically defined by IS using PCFieldSplitSetIS. Then the user can specify its own PC at runtime using PETSc options.
> My question : is it possible to define nested splits in this case as it can be done with strided splits (see snes/examples/tutorials/ex19.c with test suffix fieldsplit_4).
> 
> In order to be perfectly clear : let's say I have a 3 fields problem : velocity (v split), pressure (p split) and temperature (t split).
> What I would like to do is something like the following but it fails : 
> 
> -ksp_type fgmres
> -pc_fieldsplit_type multiplicative 
> -pc_type fieldsplit    -pc_fieldsplit_0_fields fieldsplit_v_, fieldsplit_p_    -pc_fieldsplit_1_fields fieldsplit_t_ 
> 
> -prefix_push  fieldsplit_0_  
> -ksp_type fgmres
> -pc_fieldsplit_schur_factorization_type upper 
> -pc_type fieldsplit 
> -pc_fieldsplit_type schur 
> -pc_fieldsplit_schur_precondition a11 
> -prefix_pop
> 
> -prefix_push  fieldsplit_1_  
> -ksp_type fgmres
> -pc_type jacobi
> -prefix_pop
> 
> -prefix_push  fieldsplit_v_  
> -ksp_type fgmres
> -pc_type gamg
> -prefix_pop
> 
> -prefix_push  fieldsplit_p_  
> -ksp_type fgmres
> -pc_type jacobi
> -prefix_pop
> 
> I thank you for your help,
> Nicolas
>  
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210417/ca26e664/attachment.html>


More information about the petsc-users mailing list