<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br><div><blockquote type="cite"><div>On 8 Feb 2024, at 5:37 PM, Zhang, Hong via petsc-users <petsc-users@mcs.anl.gov> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">Hana,</div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; font-size: 15px; color: rgb(36, 36, 36); background-color: rgb(255, 255, 255);"><i>"product AB with A nest, B nest"</i></span><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;"> is not supported by PETSc. I do not know why PETSc does not display such an error message. I'll check it.</span></div></div></blockquote><div><br></div><div>Did you?</div><div>A naive fix is to simply add the missing PetscCheck() in MatProduct_Private() right after MatProductSetFromOptions() <a href="https://petsc.org/release/src/mat/interface/matrix.c.html#line10026">https://petsc.org/release/src/mat/interface/matrix.c.html#line10026</a> (notice that it is there line 10048 in the other code branch)</div><div>I have this at <a href="https://gitlab.com/petsc/petsc/-/commit/9dcea022de3b0309e5c16b8c554ad9c85dea29cf?merge_request_iid=7283">https://gitlab.com/petsc/petsc/-/commit/9dcea022de3b0309e5c16b8c554ad9c85dea29cf?merge_request_iid=7283</a> (coupled with code refactoring to avoid missing any other operations), but maybe we could do things more elegantly.</div><div><br></div><div>Thanks,</div><div>Pierre</div><br><blockquote type="cite"><div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">Hong</span></div><div id="appendonsend" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"></div><hr tabindex="-1" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline-block; width: 792.8125px;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"></span><div id="divRplyFwdMsg" dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><font face="Calibri, sans-serif" style="font-size: 11pt;"><b>From:</b><span class="Apple-converted-space"> </span>petsc-users <petsc-users-bounces@mcs.anl.gov> on behalf of Hana Honnerová <hhornik@kma.zcu.cz><br><b>Sent:</b><span class="Apple-converted-space"> </span>Thursday, February 8, 2024 4:45 AM<br><b>To:</b><span class="Apple-converted-space"> </span>petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br><b>Subject:</b><span class="Apple-converted-space"> </span>[petsc-users] question on PCLSC with matrix blocks of type MATNEST</font><div> </div></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin-top: 0px; margin-bottom: 0px;">Hi all,</div><div style="margin-top: 0px; margin-bottom: 0px;">I am trying to solve linear systems arising from isogeometric discretization (similar to FEM) of the Navier-Stokes equations in parallel using PETSc. The linear systems are of saddle-point type, so I would like to use the PCFIELDSPLIT preconditioner with the -pc_fieldsplit_detect_saddle_point option, Schur complement factorization and the LSC Schur complement preconditioner. I do not provide any user-defined operators for PCLSC in my codes (at least for now).</div><div style="margin-top: 0px; margin-bottom: 0px;">I store the matrix as a MATNEST consisting of 4 blocks (F for velocity-velocity part, Bt for velocity-pressure part, B for pressure-velocity part and NULL for pressure-pressure part). It is also convenient for me to store the blocks F, Bt and B as another MATNEST consisting of blocks corresponding to individual velocity components.<span class="Apple-converted-space"> </span><br></div><div style="margin-top: 0px; margin-bottom: 0px;"><br>However, in this setting, I get the following error message:<br></div><div style="margin-top: 0px; margin-bottom: 0px;"><i>[0]PETSC ERROR: Petsc has generated inconsistent data<br>[0]PETSC ERROR: Unspecified symbolic phase for product AB with A nest, B nest. Call MatProductSetFromOptions() first<br>[0]PETSC ERROR: See<span class="Apple-converted-space"> </span><a class="x_moz-txt-link-freetext" href="https://petsc.org/release/faq/">https://petsc.org/release/faq/</a><span class="Apple-converted-space"> </span>for trouble shooting.<br>[0]PETSC ERROR: Petsc Release Version 3.20.4, unknown<span class="Apple-converted-space"> </span><br>[0]PETSC ERROR: /home/hhornik/gismo/build-petsc-mpi/RelWithDebInfo/bin/gsINSSolverPETScTest on a arch-debug named ThinkPad-T14 by hhornik Thu Feb 8 11:04:17 2024<br>[0]PETSC ERROR: Configure options PETSC_ARCH=arch-debug --with-debugging=1 --download-mumps --download-scalapack<br>[0]PETSC ERROR: #1 MatProductSymbolic() at /home/hhornik/Software/PETSc/src/mat/interface/matproduct.c:807<br>[0]PETSC ERROR: #2 MatProduct_Private() at /home/hhornik/Software/PETSc/src/mat/interface/matrix.c:10027<br>[0]PETSC ERROR: #3 MatMatMult() at /home/hhornik/Software/PETSc/src/mat/interface/matrix.c:10103<br>[0]PETSC ERROR: #4 PCSetUp_LSC() at /home/hhornik/Software/PETSc/src/ksp/pc/impls/lsc/lsc.c:79<br>[0]PETSC ERROR: #5 PCSetUp() at /home/hhornik/Software/PETSc/src/ksp/pc/interface/precon.c:1080<br>[0]PETSC ERROR: #6 KSPSetUp() at /home/hhornik/Software/PETSc/src/ksp/ksp/interface/itfunc.c:415<br>[0]PETSC ERROR: #7 KSPSolve_Private() at /home/hhornik/Software/PETSc/src/ksp/ksp/interface/itfunc.c:832<br>[0]PETSC ERROR: #8 KSPSolve() at /home/hhornik/Software/PETSc/src/ksp/ksp/interface/itfunc.c:1079<br>[0]PETSC ERROR: #9 PCApply_FieldSplit_Schur() at /home/hhornik/Software/PETSc/src/ksp/pc/impls/fieldsplit/fieldsplit.c:1165<br>[0]PETSC ERROR: #10 PCApply() at /home/hhornik/Software/PETSc/src/ksp/pc/interface/precon.c:498<br>[0]PETSC ERROR: #11 KSP_PCApply() at /home/hhornik/Software/PETSc/include/petsc/private/kspimpl.h:383<br>[0]PETSC ERROR: #12 KSPFGMRESCycle() at /home/hhornik/Software/PETSc/src/ksp/ksp/impls/gmres/fgmres/fgmres.c:123<br>[0]PETSC ERROR: #13 KSPSolve_FGMRES() at /home/hhornik/Software/PETSc/src/ksp/ksp/impls/gmres/fgmres/fgmres.c:235<br>[0]PETSC ERROR: #14 KSPSolve_Private() at /home/hhornik/Software/PETSc/src/ksp/ksp/interface/itfunc.c:906<br>[0]PETSC ERROR: #15 KSPSolve() at /home/hhornik/Software/PETSc/src/ksp/ksp/interface/itfunc.c:1079<br>[0]PETSC ERROR: #16 applySolver() at /home/hhornik/gismo/optional/gsIncompressibleFlow/src/gsINSSolver.hpp:531</i></div><div style="margin-top: 0px; margin-bottom: 0px;"><i><br></i>I could not find any solution for this so far. My question is: Is it possible to use the LSC preconditioner in such case, where the matrix blocks are of type MATNEST? And if so, how?</div><div style="margin-top: 0px; margin-bottom: 0px;">Thank you,<br>Hana Honnerova</div></div></div></blockquote></div><br></body></html>