<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I am trying to solve a very ordinary nonlinear elasticity problem<br>
using -ksp_type cg -pc_type gamg in PETSc 3.7.0, which worked fine <br>
in PETSc 3.5.3.<br>
<br>
The problem I am seeing is on my first Newton iteration, the Ax=b<br>
solve returns with and Indefinite Preconditioner error
(KSPGetConvergedReason == -8):<br>
(log_view.txt output also attached)<br>
<br>
0 KSP Residual norm 8.411630828687e-02 <br>
1 KSP Residual norm 2.852209578900e-02 <br>
NO CONVERGENCE REASON: Indefinite Preconditioner<br>
NO CONVERGENCE REASON: Indefinite Preconditioner<br>
<br>
On the next and subsequent Newton iterations, I see perfectly normal<br>
behavior and the problem converges quadratically. The results look
fine.<br>
<br>
I tried the same problem with -pc_type jacobi as well as super-lu,
and mumps <br>
and they all work without complaint. <br>
<br>
My run line for GAMG is: <br>
-ksp_type cg -ksp_monitor -log_view -pc_type gamg -pc_gamg_type agg
-pc_gamg_agg_nsmooths 1 -options_left<br>
<br>
The code flow looks like:<br>
<br>
<blockquote>! If no matrix allocation yet<br>
if(Kmat.eq.0) then <br>
call MatCreate(PETSC_COMM_WORLD,Kmat,ierr)<br>
call
MatSetSizes(Kmat,numpeq,numpeq,PETSC_DETERMINE,PETSC_DETERMINE,ierr)<br>
call MatSetBlockSize(Kmat,nsbk,ierr)<br>
call MatSetFromOptions(Kmat, ierr)<br>
call MatSetType(Kmat,MATAIJ,ierr)<br>
call
MatMPIAIJSetPreallocation(Kmat,PETSC_NULL_INTEGER,mr(np(246)),PETSC_NULL_INTEGER,mr(np(247)),ierr)<br>
call
MatSeqAIJSetPreallocation(Kmat,PETSC_NULL_INTEGER,mr(np(246)),ierr)<br>
endif<br>
<br>
call MatZeroEntries(Kmat,ierr)<br>
<br>
! Code to set values in matrix<br>
<br>
call MatAssemblyBegin(Kmat, MAT_FINAL_ASSEMBLY, ierr)<br>
call MatAssemblyEnd(Kmat, MAT_FINAL_ASSEMBLY, ierr)<br>
call MatSetOption(Kmat,MAT_NEW_NONZERO_LOCATIONS,PETSC_TRUE,ierr)<br>
<br>
! If no rhs allocation yet<br>
if(rhs.eq.0) then<br>
call VecCreate (PETSC_COMM_WORLD, rhs, ierr)<br>
call VecSetSizes (rhs, numpeq, PETSC_DECIDE, ierr)<br>
call VecSetFromOptions(rhs, ierr)<br>
endif<br>
<br>
! Code to set values in RHS<br>
<br>
call VecAssemblyBegin(rhs, ierr)<br>
call VecAssemblyEnd(rhs, ierr)<br>
<br>
if(kspsol_exists) then<br>
call KSPDestroy(kspsol,ierr)<br>
endif<br>
<br>
call KSPCreate(PETSC_COMM_WORLD, kspsol ,ierr)<br>
call KSPSetOperators(kspsol, Kmat, Kmat, ierr)<br>
call KSPSetFromOptions(kspsol,ierr)<br>
call KSPGetPC(kspsol, pc , ierr)<br>
<br>
call PCSetCoordinates(pc,ndm,numpn,hr(np(43)),ierr)<br>
<br>
call KSPSolve(kspsol, rhs, sol, ierr)<br>
call KSPGetConvergedReason(kspsol,reason,ierr)<br>
<br>
! update solution, go back to the top<br>
</blockquote>
<br>
reason is coming back as -8 on my first Ax=b solve and 2 or 3 after
that<br>
(with gamg). With the other solvers it is coming back as 2 or 3 for<br>
iterative options and 4 if I use one of the direct solvers.<br>
<br>
Any ideas on what is causing the Indefinite PC on the first
iteration with GAMG?<br>
<br>
Thanks in advance,<br>
-sanjay<br>
<br>
<pre class="moz-signature" cols="72">--
-----------------------------------------------
Sanjay Govindjee, PhD, PE
Professor of Civil Engineering
779 Davis Hall
University of California
Berkeley, CA 94720-1710
Voice: +1 510 642 6060
FAX: +1 510 643 5264
<a class="moz-txt-link-abbreviated" href="mailto:s_g@berkeley.edu">s_g@berkeley.edu</a>
<a class="moz-txt-link-freetext" href="http://www.ce.berkeley.edu/~sanjay">http://www.ce.berkeley.edu/~sanjay</a>
-----------------------------------------------
Books:
Engineering Mechanics of Deformable
Solids: A Presentation with Exercises
<a class="moz-txt-link-freetext" href="http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641">http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641</a>
<a class="moz-txt-link-freetext" href="http://ukcatalogue.oup.com/product/9780199651641.do">http://ukcatalogue.oup.com/product/9780199651641.do</a>
<a class="moz-txt-link-freetext" href="http://amzn.com/0199651647">http://amzn.com/0199651647</a>
Engineering Mechanics 3 (Dynamics) 2nd Edition
<a class="moz-txt-link-freetext" href="http://www.springer.com/978-3-642-53711-0">http://www.springer.com/978-3-642-53711-0</a>
<a class="moz-txt-link-freetext" href="http://amzn.com/3642537111">http://amzn.com/3642537111</a>
Engineering Mechanics 3, Supplementary Problems: Dynamics
<a class="moz-txt-link-freetext" href="http://www.amzn.com/B00SOXN8JU">http://www.amzn.com/B00SOXN8JU</a>
-----------------------------------------------
</pre>
</body>
</html>