<div dir="ltr"><div dir="ltr">On Tue, Apr 20, 2021 at 4:33 PM Jorti, Zakariae via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_-1889263841708740911divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hello,</p>
<p><br>
</p>
<p>I have a block matrix A,</p>
<p><br>
</p>
<p>[A_{00} A_{01}]</p>
<p>[A_{10} A_{11}] , </p>
<p><br>
</p>
<p>and <span style="font-size:12pt">a</span><span style="font-size:12pt">m trying to use PCFIELDSPLIT as a preconditioner on</span><span style="font-size:12pt"> it. The preconditioner has this shape: </span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p>[inv(A_{00}) 0 ]</p>
<p>[ 0 -ksp(S)] ;</p>
<p><br>
</p>
<p>where S is the Schur Complement matrix: </p>
<p>S = <span style="font-size:12pt">A_{11} - </span><span style="font-size:12pt">A_{10} * inv(</span><span style="font-size:12pt">A_{00}</span><span style="font-size:12pt">) * </span><span style="font-size:12pt">A_{01},</span></p>
<p><span style="font-size:12pt">that I get by calling: </span></p>
<p><br>
</p>
<p>MatGetSchurComplement(A, isrow0, iscol0, isrow1, iscol1, MAT_INITIAL_MATRIX, &S, MAT_SCHUR_COMPLEMENT_AINV_DIAG, MAT_IGNORE_MATRIX, NULL);</p>
<div><br>
</div>
<p><span style="font-size:12pt">I would like to set BoomerAMG preconditioner for </span>ksp(S). So, I am calling:</p>
<p> </p>
<p>PCFieldSplitGetSubKSP(pc, &n, &subksp);</p>
<p>KSPSetOperators(subksp[1], S, S);</p>
<p>KSPGetPC(<span style="font-size:12pt">subksp[1],</span><span style="font-size:12pt"> subpc</span><span style="font-size:12pt">);</span></p>
<p><span style="font-size:12pt">PCSetType(subpc,"boomeramg");</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">but I end up getting the following error:</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p>[0]PETSC ERROR: No support for this operation for this object type</p>
<p>[0]PETSC ERROR: Mat type schurcomplement</p>
<p>[0]PETSC ERROR: See <a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">https://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.</p>
<p>[0]PETSC ERROR: Petsc Release Version 3.14.2, Dec 03, 2020 </p>
<p>[0]PETSC ERROR: ./mimeticcurleuler2 on a arch-linux-c-debug named nid00140 by zjorti Tue Apr 20 12:23:34 2021</p>
<p>[0]PETSC ERROR: Configure options CC=cc CXX=CC FC=ftn COPTFLAGS=-g CXXOPTFLAGS=-g FOPTFLAGS=-g --download-hypre --with-debugging=1 --with-cxx-dialect=C++11</p>
<p>[0]PETSC ERROR: #1 MatGetRow() line 561 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/mat/interface/matrix.c</p>
<p>[0]PETSC ERROR: #2 MatConvert_Basic() line 53 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/mat/utils/convert.c</p>
<p>[0]PETSC ERROR: #3 MatConvert() line 4254 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/mat/interface/matrix.c</p>
<p>[0]PETSC ERROR: #4 PCSetUp_HYPRE() line 231 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ksp/pc/impls/hypre/hypre.c</p>
<p>[0]PETSC ERROR: #5 PCSetUp() line 1009 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ksp/pc/interface/precon.c</p>
<p>[0]PETSC ERROR: #6 KSPSetUp() line 406 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ksp/ksp/interface/itfunc.c</p>
<p>[0]PETSC ERROR: #7 KSPSolve_Private() line 658 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ksp/ksp/interface/itfunc.c</p>
<p>[0]PETSC ERROR: #8 KSPSolve() line 889 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ksp/ksp/interface/itfunc.c</p>
<p>[0]PETSC ERROR: #9 PCApply_FieldSplit_Schur() line 1133 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ksp/pc/impls/fieldsplit/fieldsplit.c</p>
<p>[0]PETSC ERROR: #10 PCApply() line 444 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ksp/pc/interface/precon.c</p>
<p>[0]PETSC ERROR: #11 KSP_PCApply() line 283 in /global/u1/z/zjorti/Software/petsc-3.14.2/include/petsc/private/kspimpl.h</p>
<p>[0]PETSC ERROR: #12 KSPInitialResidual() line 65 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ksp/ksp/interface/itres.c</p>
<p>[0]PETSC ERROR: #13 KSPSolve_GMRES() line 245 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ksp/ksp/impls/gmres/gmres.c</p>
<p>[0]PETSC ERROR: #14 KSPSolve_Private() line 719 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ksp/ksp/interface/itfunc.c</p>
<p>[0]PETSC ERROR: #15 KSPSolve() line 889 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ksp/ksp/interface/itfunc.c</p>
<p>[0]PETSC ERROR: #16 SNESSolve_KSPONLY() line 51 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/snes/impls/ksponly/ksponly.c</p>
<p>[0]PETSC ERROR: #17 SNESSolve() line 4569 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/snes/interface/snes.c</p>
<p>[0]PETSC ERROR: #18 TSTheta_SNESSolve() line 185 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ts/impls/implicit/theta/theta.c</p>
<p>[0]PETSC ERROR: #19 TSStep_Theta() line 223 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ts/impls/implicit/theta/theta.c</p>
<p>[0]PETSC ERROR: #20 TSStep() line 3757 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ts/interface/ts.c</p>
<p>[0]PETSC ERROR: #21 TSSolve() line 4154 in /global/u1/z/zjorti/Software/petsc-3.14.2/src/ts/interface/ts.c</p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">Am I doing something </span>wrong here? How can I fix this?</p></div></div></blockquote><div>It really is best to do this with options. It will take a lot of programming to replicate what you can do.</div><div><br></div><div>You are trying to precondition an implicit matrix (S) with Boomeramg, which needs explicit entries. You can tell PCFIELDSPLIT to build an</div><div>explicit matrix for the Schur complement:</div><div><br></div><div> <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCFieldSplitSetSchurPre.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCFieldSplitSetSchurPre.html</a></div><div><br></div><div> Thanks,</div><div><br></div><div> Matt <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div id="gmail-m_-1889263841708740911divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Many thanks.</p>
<p><br>
</p>
<p>Best regards,</p>
<p><br>
</p>
<p>Zakariae Jorti</p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt"></span><span style="font-size:12pt"> </span></p>
</div>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>