<div dir="ltr"><div dir="ltr">On Thu, Jul 16, 2020 at 5:43 AM Karl Yang <<a href="mailto:y.juntao@hotmail.com">y.juntao@hotmail.com</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>Hi, Matt, </div><br><div>Sorry for the confusion. The error shows as below without SetIS().</div></blockquote><div><br></div><div>I see the problem now. It is about the interface for MatNest.</div><div><br></div><div>MatNest is intended _only_ as an optimization. I think you should never have MatNest in user code. Here the</div><div>problem is that MatNest only supports extraction using the ISes it was created with, whereas detection is</div><div>finding a different IS. I recommend getting everything working with AIJ, and then use MatSetType() or</div><div>-mat_type at the end to try out Nest. The interfaces are the same.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div><div>[0]PETSC ERROR: Arguments are incompatible</div><div>[0]PETSC ERROR: Could not find index set</div><div>[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.</div><div>[0]PETSC ERROR: Petsc Release Version 3.12.5, Mar, 29, 2020 </div><div>[0]PETSC ERROR: ./testSolve on a arch-linux2-c-debug named ae3f0ab5a8c4 by Unknown Thu Jul 16 17:36:52 2020</div><div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --with-cuda</div><div>[0]PETSC ERROR: #1 MatNestFindIS() line 365 in /usr/local/petsc/petsc-3.12.5/src/mat/impls/nest/matnest.c</div><div>[0]PETSC ERROR: #2 MatNestFindSubMat() line 425 in /usr/local/petsc/petsc-3.12.5/src/mat/impls/nest/matnest.c</div><div>[0]PETSC ERROR: #3 MatCreateSubMatrix_Nest() line 456 in /usr/local/petsc/petsc-3.12.5/src/mat/impls/nest/matnest.c</div><div>[0]PETSC ERROR: #4 MatCreateSubMatrix() line 7859 in /usr/local/petsc/petsc-3.12.5/src/mat/interface/matrix.c</div><div>[0]PETSC ERROR: #5 PCSetUp_FieldSplit() line 676 in /usr/local/petsc/petsc-3.12.5/src/ksp/pc/impls/fieldsplit/fieldsplit.c</div><div>[0]PETSC ERROR: #6 PCSetUp() line 894 in /usr/local/petsc/petsc-3.12.5/src/ksp/pc/interface/precon.c</div><div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div><div>[0]PETSC ERROR: Corrupt argument: <a href="https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind" target="_blank">https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind</a></div><div>[0]PETSC ERROR: Invalid Pointer to Object: Parameter # 1</div><div>[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.</div><div>[0]PETSC ERROR: Petsc Release Version 3.12.5, Mar, 29, 2020 </div><div>[0]PETSC ERROR: ./testSolve on a arch-linux2-c-debug named ae3f0ab5a8c4 by Unknown Thu Jul 16 17:36:52 2020</div><div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --with-cuda</div><div>[0]PETSC ERROR: #7 MatDestroy() line 1266 in /usr/local/petsc/petsc-3.12.5/src/mat/interface/matrix.c</div><div>[0]PETSC ERROR: #8 PCSetUp_FieldSplit() line 697 in /usr/local/petsc/petsc-3.12.5/src/ksp/pc/impls/fieldsplit/fieldsplit.c</div><div>[0]PETSC ERROR: #9 PCSetUp() line 894 in /usr/local/petsc/petsc-3.12.5/src/ksp/pc/interface/precon.c</div><div>[0]PETSC ERROR: #10 KSPSetUp() line 376 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/interface/itfunc.c</div><div>KSP Object: 1 MPI processes</div><div>  type: fgmres</div><div>    restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement</div><div>    happy breakdown tolerance 1e-30</div><div>  maximum iterations=10000, initial guess is zero</div><div>  tolerances:  relative=1e-05, absolute=1e-50, divergence=10000.</div><div>  right preconditioning</div><div>  using UNPRECONDITIONED norm type for convergence test</div><div>PC Object: 1 MPI processes</div><div>  type: fieldsplit</div><div>  PC has not been set up so information may be incomplete</div><div>    FieldSplit with Schur preconditioner, blocksize = 1, factorization FULL</div><div>    Preconditioner for the Schur complement formed from S itself</div><div>    Split info:</div><div>    Split number 0 Defined by IS</div><div>    Split number 1 Defined by IS</div><div>    KSP solver for A00 block</div><div>      KSP Object: (fieldsplit_0_) 1 MPI processes</div><div>        type: preonly</div><div>        maximum iterations=10000, initial guess is zero</div><div>        tolerances:  relative=1e-05, absolute=1e-50, divergence=10000.</div><div>        left preconditioning</div><div>        using DEFAULT norm type for convergence test</div><div>      PC Object: (fieldsplit_0_) 1 MPI processes</div><div>        type not yet set</div><div>        PC has not been set up so information may be incomplete</div><div>    KSP solver for upper A00 in upper triangular factor </div><div>        not yet available</div><div>    KSP solver for S = A11 - A10 inv(A00) A01 </div><div>        not yet available</div><div>  linear system matrix = precond matrix:</div><div>  Mat Object: 1 MPI processes</div><div>    type: nest</div><div>    rows=15, cols=15</div><div>      Matrix object: </div><div>        type=nest, rows=3, cols=3 </div><div>        MatNest structure: </div><div>        (0,0) : type=seqaij, rows=5, cols=5 </div><div>        (0,1) : NULL </div><div>        (0,2) : type=seqaij, rows=5, cols=5 </div><div>        (1,0) : NULL </div><div>        (1,1) : type=seqaij, rows=5, cols=5 </div><div>        (1,2) : type=seqaij, rows=5, cols=5 </div><div>        (2,0) : type=seqaij, rows=5, cols=5 </div><div>        (2,1) : type=seqaij, rows=5, cols=5 </div><div>        (2,2) : NULL </div><div>Segmentation fault (core dumped)</div><br><br><div>Attached is the test code. </div><br><div>Regards</div><div>JT</div><br><br><br><br><div>On Jul 16 2020, at 5:30 pm, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><blockquote><div><div><div>On Thu, Jul 16, 2020 at 1:23 AM Karl Yang <<a href="https://link.getmailspring.com/link/1D2D2990-B215-4510-B196-F29BD06D4684@getmailspring.com/0?redirect=mailto%3Ay.juntao%40hotmail.com&recipient=a25lcGxleUBnbWFpbC5jb20%3D" title="mailto:y.juntao@hotmail.com" target="_blank">y.juntao@hotmail.com</a>> wrote:</div></div><img alt="Sent from Mailspring" width="0" height="0" style="border: 0px; width: 0px; height: 0px;" src="https://link.getmailspring.com/open/1D2D2990-B215-4510-B196-F29BD06D4684@getmailspring.com?me=05842e25&recipient=a25lcGxleUBnbWFpbC5jb20%3D"><div class="gmail_quote"><blockquote><div>Hi, Junchao,</div><br><div>Thank you. It works. :)</div><br><div>May I ask some follow up question regarding the same example about fieldsplit. I am trying to learn about matnest with fieldsplit preconditioner on manual page 94. But I get a bit lost trying to understand fields, ISs once it is not eactly the same on the manual.</div><br><div>In this same example, I tried to use PCFIELDSPLIT and  PCFieldSplitSetDetectSaddlePoint as follows.</div></blockquote><div><br></div><div>You cannot mix DetectSaddlePoint() with SetIS() since the detection tries to make the proper ISes. Maybe we should check that.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote><div>IS rows[3];</div><div>IS cols[3];</div><div>MatNestGetISs(testMesh->system, rows, cols);</div><br><div>KSP ksp;</div><div>PC  pc;</div><div>KSPCreate(PETSC_COMM_WORLD, &ksp);</div><div>KSPSetType(ksp, KSPFGMRES);</div><div>KSPSetOperators(ksp, testMesh->system, testMesh->system);</div><div>KSPGetPC(ksp, &pc);</div><div>PCFieldSplitSetIS(pc, "u", rows[0]);</div><div>PCFieldSplitSetIS(pc, "v", rows[1]);</div><div>PCFieldSplitSetIS(pc, "p", rows[2]);</div><div>PCSetType(pc, PCFIELDSPLIT);</div><div>PCFieldSplitSetDetectSaddlePoint(pc, PETSC_TRUE);</div><div>KSPSetUp(ksp);</div><div>KSPSolve(ksp, testMesh->rhs, testMesh->solution);</div><div> </div><div>But I will get the following error,</div><br><div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div><div>[0]PETSC ERROR: Arguments are incompatible</div><div>[0]PETSC ERROR: Could not find index set</div><div>[0]PETSC ERROR: See <a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" title="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">https://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.</div><div>[0]PETSC ERROR: Petsc Release Version 3.12.5, Mar, 29, 2020</div><div>[0]PETSC ERROR: ./testSolve on a arch-linux2-c-debug named f601294ac804 by Unknown Thu Jul 16 13:08:39 2020</div><div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --with-cuda</div><div>[0]PETSC ERROR: #1 MatNestFindIS() line 365 in /usr/local/petsc/petsc-3.12.5/src/mat/impls/nest/matnest.c</div><div>[0]PETSC ERROR: #2 MatNestFindSubMat() line 425 in /usr/local/petsc/petsc-3.12.5/src/mat/impls/nest/matnest.c</div><div>[0]PETSC ERROR: #3 MatCreateSubMatrix_Nest() line 456 in /usr/local/petsc/petsc-3.12.5/src/mat/impls/nest/matnest.c</div><div>[0]PETSC ERROR: #4 MatCreateSubMatrix() line 7859 in /usr/local/petsc/petsc-3.12.5/src/mat/interface/matrix.c</div><div>[0]PETSC ERROR: #5 PCSetUp_FieldSplit() line 676 in /usr/local/petsc/petsc-3.12.5/src/ksp/pc/impls/fieldsplit/fieldsplit.c</div><div>[0]PETSC ERROR: #6 PCSetUp() line 894 in /usr/local/petsc/petsc-3.12.5/src/ksp/pc/interface/precon.c</div><div>[0]PETSC ERROR: #7 KSPSetUp() line 376 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/interface/itfunc.c</div><div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div><div>[0]PETSC ERROR: Corrupt argument: <a href="https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind" title="https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind" target="_blank">https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind</a></div><div>[0]PETSC ERROR: Invalid Pointer to Object: Parameter # 1</div><div>[0]PETSC ERROR: See <a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" title="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">https://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.</div><div>[0]PETSC ERROR: Petsc Release Version 3.12.5, Mar, 29, 2020</div><div>[0]PETSC ERROR: ./testSolve on a arch-linux2-c-debug named f601294ac804 by Unknown Thu Jul 16 13:08:39 2020</div><div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --with-cuda</div><div>[0]PETSC ERROR: #8 MatDestroy() line 1266 in /usr/local/petsc/petsc-3.12.5/src/mat/interface/matrix.c</div><div>[0]PETSC ERROR: #9 PCSetUp_FieldSplit() line 697 in /usr/local/petsc/petsc-3.12.5/src/ksp/pc/impls/fieldsplit/fieldsplit.c</div><div>[0]PETSC ERROR: #10 PCSetUp() line 894 in /usr/local/petsc/petsc-3.12.5/src/ksp/pc/interface/precon.c</div><div>[0]PETSC ERROR: #11 KSPSetUp() line 376 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/interface/itfunc.c</div><div>[0]PETSC ERROR: #12 KSPSolve() line 703 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/interface/itfunc.c</div><br><div>I read about the examples on the manual and mostly are based on 2<em>2 blocks but still cannot figure out how pcfieldsplit should be set in this 3</em> *<em>3 blocks, and how IS should be set accordingly. I read about -fieldsplit_1_pc_type none option suggested on the documentation, but I am not sure is it still valid in a 33 blocks.</em></div><br><div><em>Regards</em></div><div><em>JT</em></div><div>On Jul 16 2020, at 6:57 am, Junchao Zhang <<a href="mailto:junchao.zhang@gmail.com" title="mailto:junchao.zhang@gmail.com" target="_blank">junchao.zhang@gmail.com</a>> wrote:</div><blockquote><div><div>Adding the MatNestSetVecType() line fixed the problem.  But I don't know why petsc had this weird design originally.</div><div><br></div><div>      MatCreateNest(PETSC_COMM_WORLD, 3, NULL, 3, NULL, mblock, &testMesh->system);</div><div> +   MatNestSetVecType(testMesh->system,VECNEST);</div><div><div><div><br></div><div>--Junchao Zhang</div></div></div><br></div><br><div class="gmail_quote"><div class="gmail_attr"><div>On Wed, Jul 15, 2020 at 2:16 PM Karl Yang <<a href="mailto:y.juntao@hotmail.com" title="mailto:y.juntao@hotmail.com" target="_blank">y.juntao@hotmail.com</a>> wrote:</div></div><blockquote><div>Hi, Barry,</div><br><div>I created a minimum example to reproduce the error. The example code is attached.</div><br><div>Mat Object: 1 MPI processes</div><div>  type: nest</div><div>  Matrix object:</div><div>    type=nest, rows=3, cols=3</div><div>    MatNest structure:</div><div>    (0,0) : type=seqaij, rows=5, cols=5</div><div>    (0,1) : NULL</div><div>    (0,2) : type=seqaij, rows=5, cols=5</div><div>    (1,0) : NULL</div><div>    (1,1) : type=seqaij, rows=5, cols=5</div><div>    (1,2) : type=seqaij, rows=5, cols=5</div><div>    (2,0) : type=seqaij, rows=5, cols=5</div><div>    (2,1) : type=seqaij, rows=5, cols=5</div><div>    (2,2) : NULL</div><div>Vec Object: 1 MPI processes</div><div>  type: nest</div><div>  VecNest, rows=3,  structure:</div><div>  (0) : type=seq, rows=5</div><div>    Vec Object: 1 MPI processes</div><div>      type: seq</div><div>    1.</div><div>    1.</div><div>    1.</div><div>    1.</div><div>    1.</div><div>  (1) : type=seq, rows=5</div><div>    Vec Object: 1 MPI processes</div><div>      type: seq</div><div>    1.</div><div>    1.</div><div>    1.</div><div>    1.</div><div>    1.</div><div>  (2) : type=seq, rows=5</div><div>    Vec Object: 1 MPI processes</div><div>      type: seq</div><div>    1.</div><div>    1.</div><div>    1.</div><div>    1.</div><div>    1.</div><div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div><div>[0]PETSC ERROR: Invalid argument</div><div>[0]PETSC ERROR: Nest vector argument 2 not setup.</div><div>[0]PETSC ERROR: See <a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" title="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">https://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.</div><div>[0]PETSC ERROR: Petsc Release Version 3.12.5, Mar, 29, 2020</div><div>[0]PETSC ERROR: ./testSolve on a arch-linux2-c-debug named f601294ac804 by Unknown Thu Jul 16 03:11:02 2020</div><div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --with-cuda</div><div>[0]PETSC ERROR: #1 VecCopy_Nest() line 68 in /usr/local/petsc/petsc-3.12.5/src/vec/vec/impls/nest/vecnest.c</div><div>[0]PETSC ERROR: #2 VecCopy() line 1577 in /usr/local/petsc/petsc-3.12.5/src/vec/vec/interface/vector.c</div><div>[0]PETSC ERROR: #3 KSPInitialResidual() line 61 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/interface/itres.c</div><div>[0]PETSC ERROR: #4 KSPSolve_GMRES() line 236 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/impls/gmres/gmres.c</div><div>[0]PETSC ERROR: #5 KSPSolve() line 760 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/interface/itfunc.c</div><div>On Jul 16 2020, at 2:39 am, Barry Smith <<a href="mailto:bsmith@petsc.dev" title="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>> wrote:</div><blockquote><div><br></div><div>  Could be a bug in PETSc, please send a sample program that produces the problem.</div><div><br></div><div>  Barry</div><div><br><div><br><blockquote><div>On Jul 15, 2020, at 1:28 PM, Karl Yang <<a href="https://link.getmailspring.com/link/060AB2C3-F3D7-408C-99CF-C4D1B27DD59F@getmailspring.com/0?redirect=mailto%3Ay.juntao%40hotmail.com&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" title="https://link.getmailspring.com/link/060AB2C3-F3D7-408C-99CF-C4D1B27DD59F@getmailspring.com/0?redirect=mailto%3Ay.juntao%40hotmail.com&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" target="_blank">y.juntao@hotmail.com</a>> wrote:</div><br><div><div>Hi, Barry,</div><br><div>Thanks for your reply. I output the matrix and vec with matview and vecview. And I think I do have the values set as it has been shown.</div><br><div>Mat Object: 1 MPI processes</div><div>  type: nest</div><div>  Matrix object:</div><div>    type=nest, rows=3, cols=3</div><div>    MatNest structure:</div><div>    (0,0) : type=seqaij, rows=25, cols=25</div><div>    (0,1) : NULL</div><div>    (0,2) : type=seqaij, rows=25, cols=25</div><div>    (1,0) : NULL</div><div>    (1,1) : type=seqaij, rows=25, cols=25</div><div>    (1,2) : type=seqaij, rows=25, cols=25</div><div>    (2,0) : type=seqaij, rows=25, cols=25</div><div>    (2,1) : type=seqaij, rows=25, cols=25</div><div>    (2,2) : NULL</div><div>Vec Object: 1 MPI processes</div><div>  type: nest</div><div>  VecNest, rows=3,  structure:</div><div>  (0) : type=seq, rows=25</div><div>    Vec Object: 1 MPI processes</div><div>      type: seq</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    75.8279</div><div>    -51.0776</div><div>    -75.8279</div><div>    0.</div><div>    0.</div><div>    -90.8404</div><div>    58.7011</div><div>    90.8404</div><div>    0.</div><div>    0.</div><div>    -75.8279</div><div>    51.0776</div><div>    75.8279</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>  (1) : name="Vec_0x84000000_0", type=seq, rows=25</div><div>    Vec Object: Vec_0x84000000_0 1 MPI processes</div><div>      type: seq</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    75.8279</div><div>    -51.0776</div><div>    -75.8279</div><div>    0.</div><div>    0.</div><div>    -90.8404</div><div>    58.7011</div><div>    90.8404</div><div>    0.</div><div>    0.</div><div>    -75.8279</div><div>    51.0776</div><div>    75.8279</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>  (2) : type=seq, rows=25</div><div>    Vec Object: 1 MPI processes</div><div>      type: seq</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>    0.</div><div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div><div>[0]PETSC ERROR: Invalid argument</div><div>[0]PETSC ERROR: Nest vector argument 4 not setup.</div><div>[0]PETSC ERROR: See <a href="https://link.getmailspring.com/link/060AB2C3-F3D7-408C-99CF-C4D1B27DD59F@getmailspring.com/1?redirect=https%3A%2F%2Fwww.mcs.anl.gov%2Fpetsc%2Fdocumentation%2Ffaq.html&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" title="https://link.getmailspring.com/link/060AB2C3-F3D7-408C-99CF-C4D1B27DD59F@getmailspring.com/1?redirect=https%3A%2F%2Fwww.mcs.anl.gov%2Fpetsc%2Fdocumentation%2Ffaq.html&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" target="_blank">https://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.</div><div>[0]PETSC ERROR: Petsc Release Version 3.12.5, Mar, 29, 2020</div><div>[0]PETSC ERROR: ./testSolve on a arch-linux2-c-debug named f601294ac804 by Unknown Thu Jul 16 02:15:26 2020</div><div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --with-cuda</div><div>[0]PETSC ERROR: #1 VecPointwiseMult_Nest() line 245 in /usr/local/petsc/petsc-3.12.5/src/vec/vec/impls/nest/vecnest.c</div><div>[0]PETSC ERROR: #2 VecPointwiseMult() line 1107 in /usr/local/petsc/petsc-3.12.5/src/vec/vec/interface/vector.c</div><div>[0]PETSC ERROR: #3 PCApply_Jacobi() line 272 in /usr/local/petsc/petsc-3.12.5/src/ksp/pc/impls/jacobi/jacobi.c</div><div>[0]PETSC ERROR: #4 PCApply() line 444 in /usr/local/petsc/petsc-3.12.5/src/ksp/pc/interface/precon.c</div><div>[0]PETSC ERROR: #5 KSP_PCApply() line 281 in /usr/local/petsc/petsc-3.12.5/include/petsc/private/kspimpl.h</div><div>[0]PETSC ERROR: #6 KSPInitialResidual() line 65 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/interface/itres.c</div><div>[0]PETSC ERROR: #7 KSPSolve_GMRES() line 236 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/impls/gmres/gmres.c</div><div>[0]PETSC ERROR: #8 KSPSolve() line 760 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/interface/itfunc.c</div><br><div>On Jul 16 2020, at 2:13 am, Barry Smith <<a href="https://link.getmailspring.com/link/060AB2C3-F3D7-408C-99CF-C4D1B27DD59F@getmailspring.com/2?redirect=mailto%3Absmith%40petsc.dev&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" title="https://link.getmailspring.com/link/060AB2C3-F3D7-408C-99CF-C4D1B27DD59F@getmailspring.com/2?redirect=mailto%3Absmith%40petsc.dev&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" target="_blank">bsmith@petsc.dev</a>> wrote:</div><blockquote><div><br></div><div>  From the error message the second vector you are using to form the nest vector has not been completely created/set up. Make sure you called either VecCreateSeq(), VecCreateMPI() or did VecCreate(), VecSetType(), VecSetUp() and if it is the right hand side make sure you put numerical values in it.</div><div><br></div><div>   Barry</div><div><br><div><br><blockquote><div>On Jul 15, 2020, at 1:05 PM, Karl Yang <<a href="https://link.getmailspring.com/link/060AB2C3-F3D7-408C-99CF-C4D1B27DD59F@getmailspring.com/3?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F540F752A-DB59-4878-9C98-B8F4B4D9FD0D%40getmailspring.com%2F0%3Fredirect%3Dmailto%253Ay.juntao%2540hotmail.com%26recipient%3DYnNtaXRoQHBldHNjLmRldg%253D%253D&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" title="https://link.getmailspring.com/link/060AB2C3-F3D7-408C-99CF-C4D1B27DD59F@getmailspring.com/3?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F540F752A-DB59-4878-9C98-B8F4B4D9FD0D%40getmailspring.com%2F0%3Fredirect%3Dmailto%253Ay.juntao%2540hotmail.com%26recipient%3DYnNtaXRoQHBldHNjLmRldg%253D%253D&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" target="_blank">y.juntao@hotmail.com</a>> wrote:</div><br><div><div>Hello,</div><br><div>I'm trying to solve a 2*2 block matrix system.</div><div>I managed to form a 2*2 MatNest and a 21 VecNest. However when I try to  make use of ksp solve, I encounter the following error. There is only one or two examples on MatNest and VecNest. I could not figure out what could be the trouble.</div><br><br><div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div><div>[0]PETSC ERROR: Invalid argument</div><div>[0]PETSC ERROR: Nest vector argument 2 not setup.</div><div>[0]PETSC ERROR: See <a href="https://link.getmailspring.com/link/060AB2C3-F3D7-408C-99CF-C4D1B27DD59F@getmailspring.com/4?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F540F752A-DB59-4878-9C98-B8F4B4D9FD0D%40getmailspring.com%2F1%3Fredirect%3Dhttps%253A%252F%252Fwww.mcs.anl.gov%252Fpetsc%252Fdocumentation%252Ffaq.html%26recipient%3DYnNtaXRoQHBldHNjLmRldg%253D%253D&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" title="https://link.getmailspring.com/link/060AB2C3-F3D7-408C-99CF-C4D1B27DD59F@getmailspring.com/4?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F540F752A-DB59-4878-9C98-B8F4B4D9FD0D%40getmailspring.com%2F1%3Fredirect%3Dhttps%253A%252F%252Fwww.mcs.anl.gov%252Fpetsc%252Fdocumentation%252Ffaq.html%26recipient%3DYnNtaXRoQHBldHNjLmRldg%253D%253D&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" target="_blank">https://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.</div><div>[0]PETSC ERROR: Petsc Release Version 3.12.5, Mar, 29, 2020</div><div>[0]PETSC ERROR: ./testSolve on a arch-linux2-c-debug named f601294ac804 by Unknown Thu Jul 16 01:56:11 2020</div><div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --with-cuda</div><div>[0]PETSC ERROR: #1 VecCopy_Nest() line 68 in /usr/local/petsc/petsc-3.12.5/src/vec/vec/impls/nest/vecnest.c</div><div>[0]PETSC ERROR: #2 VecCopy() line 1577 in /usr/local/petsc/petsc-3.12.5/src/vec/vec/interface/vector.c</div><div>[0]PETSC ERROR: #3 KSPInitialResidual() line 61 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/interface/itres.c</div><div>[0]PETSC ERROR: #4 KSPSolve_GMRES() line 236 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/impls/gmres/gmres.c</div><div>[0]PETSC ERROR: #5 KSPSolve() line 760 in /usr/local/petsc/petsc-3.12.5/src/ksp/ksp/interface/itfunc.c</div><br><br><div>Regards</div><div>JT</div></div></blockquote></div></div></blockquote></div></blockquote></div></div></blockquote></blockquote></div></blockquote></blockquote></div><br><div><br></div><div>--</div><div><div><div><div><div><div><div><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.</div><div>-- Norbert Wiener</div></div><div><br></div><div><div><a href="https://link.getmailspring.com/link/1D2D2990-B215-4510-B196-F29BD06D4684@getmailspring.com/1?redirect=http%3A%2F%2Fwww.cse.buffalo.edu%2F~knepley%2F&recipient=a25lcGxleUBnbWFpbC5jb20%3D" title="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></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>