<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 16, 2018 at 12:20 PM Josh L <<a href="mailto:ysjosh.lo@gmail.com">ysjosh.lo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">2018-08-16 10:39 GMT-05:00 Mark Adams <span dir="ltr"><<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>></span>:</div><div class="gmail_quote"><br></div><div class="gmail_quote">Hi Mark,</div><div class="gmail_quote"><br></div><div class="gmail_quote"><span style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255);float:none;display:inline">The problem I am running is simply 2-D linear elasticity, and I use petsc's ex49 of KSP to do benchmark.</span><span style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255);float:none;display:inline"> </span><br></div><div class="gmail_quote"><span style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255);float:none;display:inline"><br></span></div><div class="gmail_quote">I have solved the error by using MatZeroRowsColumns(diagonal =1.0) to apply BC instead of MatZeroRows.</div><div class="gmail_quote">(My code is actually using newton's method to solve nonlinear problem(Now, use it to run a linear elasticity problem), and the rhs entries for Dirichlet BC is just zero, so either zerorowscolumns or zerorows gives the same solution). </div><div class="gmail_quote"><br></div><div class="gmail_quote">With GMRES and gamg, the 120K degrees of freedoms linear elasticity problem converges in 7 iterations.  </div><div class="gmail_quote">But with " -ksp_type chebyshev -ksp_chebyshev_esteig_noisy"  I still get NAN residual that comes out of nowhere (it is not diverging. all of a sudden NAN shows up)</div></div></div></blockquote><div><br></div><div><div>You want to use CG as the ksp type if it is symmetric (and positive definite). I would guess you don't need to zero columns but go ahead and do it, if it is easy.</div><div><br></div><div>I am confused. I thought you were using '-ksp_type chebyshev' to debug Cheby errors when using GAMG. </div></div><div><br></div><div>Anyway, with -ksp_type chebyshev you want to use CG in the eigen estimator. CG is much faster than GAMG. So you should use <span style="color:rgb(80,0,80)">'</span><span style="color:rgb(80,0,80);font-size:14px">-ksp_chebyshev_estei</span><span style="color:rgb(80,0,80);font-size:14px">g_ksp_type cg'. And use -options_left to make sure that these parameters are getting in correctly.</span></div><div><span style="color:rgb(80,0,80);font-size:14px"><br></span></div><div><span style="color:rgb(80,0,80);font-size:14px">And you should use '-ksp_type cg'.</span></div><div><br></div><div><br></div></div></div>