[petsc-dev] composite vs. shell

Pierre Jolivet pierre.jolivet at enseeiht.fr
Sat Nov 4 17:44:01 CDT 2017


I’d like to use PCCOMPOSITE to define a preconditioner as the sum of two preconditioners with different operators.
My current code works with a PCSHELL, but I don’t know how to setup the PCCOMPOSITE appropriately to get the same results.
Attached is a reproducer (using complex scalars).
$ ./SHELL_v_COMPOSITE -fSp S.bin -fMp Mp.bin -fLp Lp.bin -ksp_view -pc_type shell -ksp_type preonly 
$ ./SHELL_v_COMPOSITE -fSp S.bin -fMp Mp.bin -fLp Lp.bin -ksp_view -ksp_type preonly -pc_type composite -pc_composite_type additive -prefix_push sub_0_ -pc_type ksp -ksp_ksp_type preonly -ksp_pc_type jacobi -prefix_pop -prefix_push sub_1_ -pc_type ksp -ksp_ksp_type preonly -ksp_pc_type jacobi -prefix_pop
What looks weird to me is that for the PCSHELL, the operators for both PCs are of the correct size (36588 and 36814 nonzeros respectively), while for the PCCOMPOSITE, it looks like the same operator is duplicated (-ksp_view tells me that both have 36814 nonzeros which is not what I get with -mat_view ::ascii_info).
Any idea on how to fix this?

Thanks,
Pierre

-------------- next part --------------
A non-text attachment was scrubbed...
Name: SHELL_v_COMPOSITE.tar.gz
Type: application/x-gzip
Size: 763656 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20171104/a15eeccc/attachment-0001.gz>


More information about the petsc-dev mailing list