<html aria-label="message body"><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;"><div><br></div> Apparently. Just call ISSort() on the IS after forming it.<br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Jan 19, 2026, at 1:31 PM, neil liu <liufield@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr">Dear Petsc developers and users, <div><br></div><div>I am exploring Schur complement to reuse the inverse of A, for a block matrix [ A B; C D].</div><div>Here A's size is much bigger than D. Therefore it is desirable to reuse the inverse of A. The code is listed below. It works well for 10k tetrahedra elements on 4 ranks . But it shows some error for a coarse mesh (260 tetrahedra cells) on 4 ranks. </div><div>Do i have to sort <b>isNonPort and isPort? </b></div><div>Thanks a lot,</div><div>Xiaodong </div><div><p><b>MatCreateSubMatrix(A, isNonPort, isNonPort, MAT_INITIAL_MATRIX, &A11);</b></p><p><b>MatCreateSubMatrix(A, isNonPort, isPorts, MAT_INITIAL_MATRIX, &A12);</b></p><p><b> MatCreateSubMatrix(A, isPorts, isNonPort, MAT_INITIAL_MATRIX, &A21);
</b></p><p><b> MatCreateSubMatrix(A, isPorts, isPorts, MAT_INITIAL_MATRIX, &A22);</b></p><p><b> Mat S;
</b></p><p><b> MatCreateSchurComplement(A11, A11, A12, A21, A22, &S);
</b></p><p><b> MatSchurComplementSetKSP(S, kspA11);</b></p><p><b> Mat Sdense;
</b></p><p> <b>MatSchurComplementComputeExplicitOperator(S, &Sdense); </b></p><p><b> MatAssemblyBegin(Sdense, MAT_FINAL_ASSEMBLY);
</b></p><p><b> MatAssemblyEnd(Sdense, MAT_FINAL_ASSEMBLY);</b></p><div class="gmail-gs" style="margin:0px;min-width:0px;padding:0px 0px 20px;width:auto;font-family:"Google Sans",Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:medium"><div class="gmail-"><div class="gmail-ii gmail-gt gmail-adO" id="gmail-:o1" style="direction:ltr;margin:8px 0px 0px;padding:0px;font-size:0.875rem;overflow-x:hidden"><div class="gmail-a3s gmail-aiL" id="gmail-:o0" style="direction:ltr;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:small;line-height:1.5;font-family:Arial,Helvetica,sans-serif;overflow:auto hidden"><div id="gmail-avWBGd-94"><div dir="ltr">[1]PETSC ERROR: Argument out of range<br>[1]PETSC ERROR: Column entry number 2 (actual column 0) in row 74 is not sorted<br>[1]PETSC ERROR: See <a href="https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!az-Ao1BxQdotvJlqia0i_iZ5sCx1AZNlDZwT2d1YUzJ4TE_esLV_bwZ-lyIBrsVlK3JJu36cOohpqoohAStoSQ$" target="_blank">https://petsc.org/release/faq/</a> for trouble shooting.<br>[1]PETSC ERROR: PETSc Release Version 3.23.3, May 30, 2025<br>[1]PETSC ERROR: ./app with 4 MPI process(es) and PETSC_ARCH arch-linux-c-debug <br>[1]PETSC ERROR: Configure options: -with-cc=gcc --with-fc=gfortran --with-cxx=g++ --download-fblaslapack --download-mpich --with-scalar-type=complex --with-debugging=yes --download-parmetis --download-metis --download-hdf5 --download-scalapack --download-mumps -<br>[1]PETSC ERROR: #1 MatCreateSeqAIJWithArrays() at /Documents/petsc-3.23.3/src/mat/impls/aij/seq/aij.c:5275<br>[1]PETSC ERROR: #2 MatMPIAIJGetLocalMat() at /Documents/petsc-3.23.3/src/mat/impls/aij/mpi/mpiaij.c:5246<br>[1]PETSC ERROR: #3 MatConvert_MPIAIJ_MPIDense() at /Documents/petsc-3.23.3/src/mat/impls/dense/mpi/mpidense.c:1393<br>[1]PETSC ERROR: #4 MatConvert() at /Documents/petsc-3.23.3/src/mat/interface/matrix.c:4485<br>[1]PETSC ERROR: #5 MatSchurComplementComputeExplicitOperator() at /Documents/petsc-3.23.3/src/ksp/ksp/utils/schurm/schurm.c:518</div></div></div></div><div class="gmail-WhmR8e" id="gmail-avWBGd-95" style="clear:both"></div></div></div><p><br class="gmail-Apple-interchange-newline"></p></div><div><br></div></div>
</div></blockquote></div><br></body></html>