<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Oct 21, 2017 at 5:21 PM, Hao Zhang <span dir="ltr"><<a href="mailto:hbcbh1999@gmail.com" target="_blank">hbcbh1999@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>ierr = MatAssemblyBegin(A,MAT_FINAL_<wbr>ASSEMBLY);</div><div>  <span style="white-space:pre-wrap">       </span>ierr = MatAssemblyEnd(A,MAT_FINAL_<wbr>ASSEMBLY);</div><div><br></div><div>  <span style="white-space:pre-wrap">      </span>ierr = VecAssemblyBegin(x);</div><div>  <span style="white-space:pre-wrap">   </span>ierr = VecAssemblyEnd(x);</div></div></blockquote><div>This is probably unnecessary </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>  <span style="white-space:pre-wrap">      </span>ierr = VecAssemblyBegin(b);</div><div>  <span style="white-space:pre-wrap">   </span>ierr = VecAssemblyEnd(b);</div></div></blockquote><div>This is probably unnecessary </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"></div></blockquote><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 dir="ltr"><div></div><div><br></div><div><span style="white-space:pre-wrap">        </span>ierr = MatNullSpaceCreate(PETSC_COMM_<wbr>WORLD,PETSC_TRUE,0,PETSC_NULL,<wbr>&nullsp);</div><div>        ierr = MatSetNullSpace(A,nullsp); // Petsc-3.8</div></div></blockquote><div>Is your rhs consistent with this nullspace?</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 dir="ltr"><div>        // KSPSetOperators(ksp,A,A,<wbr>DIFFERENT_NONZERO_PATTERN);</div><div>        KSPSetOperators(ksp,A,A);</div><div><br></div><div><span style="white-space:pre-wrap">     </span>KSPSetType(ksp,KSPBCGS);</div><div><br></div><div>        KSPSetComputeSingularValues(<wbr>ksp, PETSC_TRUE);</div><div>#if defined(__HYPRE__)</div><div><span style="white-space:pre-wrap">        </span>KSPGetPC(ksp, &pc);</div><div><span style="white-space:pre-wrap">  </span>PCSetType(pc, PCHYPRE);</div><div>    PCHYPRESetType(pc,"boomeramg")<wbr>;</div></div></blockquote><div>This is terribly unnecessary. You just use</div><div><br></div><div>   -pc_type hypre -pc_hypre_type boomeramg</div><div><br></div><div>or</div><div><br></div><div>  -pc_type gamg</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>#else</div><div><span style="white-space:pre-wrap">  </span>KSPSetType(ksp,KSPBCGSL);</div><div><span style="white-space:pre-wrap">        </span>KSPBCGSLSetEll(ksp,2);</div><div>#endif /* defined(__HYPRE__) */</div><div><br></div><div>        KSPSetFromOptions(ksp);</div><div>        KSPSetUp(ksp);</div><div><br></div><div>        ierr = KSPSolve(ksp,b,x);<br></div><div><br></div><div><br></div><div>command line </div></div></blockquote><div><br></div><div>You did not provide any of what I asked for the in the eprevious mail.</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 class="gmail_extra"><div class="gmail_quote">On Sat, Oct 21, 2017 at 5:16 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Sat, Oct 21, 2017 at 5:04 PM, Hao Zhang <span dir="ltr"><<a href="mailto:hbcbh1999@gmail.com" target="_blank">hbcbh1999@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">hi, <div><br></div><div>I implemented HYPRE preconditioner for my study due to the fact that without preconditioner, PETSc solver will take thousands of iterations to converge for fine grid simulation.</div><div><br></div><div>with HYPRE, depending on the parallel partition, it will take HYPRE forever to do anything. observation of output file is that the simulation is hanging with no output.</div><div><br></div><div>Any idea what happened? will post snippet of code.</div></div></blockquote><div><br></div></span><div>1) For any question about convergence, we need to see the output of</div><div><br></div><div>  -ksp_view_pre -ksp_view -ksp_monitor_true_residual -ksp_converged_reason</div><div><br></div><div>2) Hypre has many preconditioners, which one are you talking about</div><div><br></div><div>3) PETSc has some preconditioners in common with Hypre, like AMG</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><span><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 dir="ltr"><span class="gmail-m_3490654126839091020m_4609829663930822582HOEnZb"><font color="#888888"><div>-- <br><div class="gmail-m_3490654126839091020m_4609829663930822582m_8504183156012973410gmail_signature">Hao Zhang<br>Dept. of Applid Mathematics and Statistics,<br>Stony Brook University, <br>Stony Brook, New York, 11790</div></div></font></span></div>
</blockquote></span></div><span class="gmail-m_3490654126839091020HOEnZb"><font color="#888888"><br><br clear="all"><span class="gmail-HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="gmail-m_3490654126839091020m_4609829663930822582gmail_signature"><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.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~k<wbr>nepley/</a><br></div></div></div></div></div>
</font></span></font></span></div></div><span class="gmail-HOEnZb"><font color="#888888">
</font></span></blockquote></div><span class="gmail-HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="gmail-m_3490654126839091020gmail_signature">Hao Zhang<br>Dept. of Applid Mathematics and Statistics,<br>Stony Brook University, <br>Stony Brook, New York, 11790</div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><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.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>