2009/9/11 tsjb00 <span dir="ltr">&lt;<a href="mailto:tsjb00@hotmail.com">tsjb00@hotmail.com</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>
Many thanks for your replies! I have three follow-up questions. I use the AIJ format for the matrix, BCGS for KSP and ILU for PC. The matrix changes with time.<br><br>Now I put PC and KSP definition in initialization. In each timestep, I redefine the matrix and rhs vector, use the KSPSetOperators and KSPSolve. When I run the program, I get the following error info, which seems to occur right before KSPSetOperators <br>
&nbsp;[0]PETSC ERROR: --------------------- Error Message ------------------------------------<br>[0]PETSC ERROR: Arguments are incompatible!<br>[0]PETSC ERROR: Incompatible vector global lengths!<br>[0]PETSC ERROR: ------------------------------------------------------------------------<br>
[0]PETSC ERROR: Petsc Release Version 3.0.0, Patch 5, Mon Apr 13 09:15:37 CDT 2009<br>[0]PETSC ERROR: See docs/changes/index.html for recent updates.<br>[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
[0]PETSC ERROR: See docs/index.html for manual pages
 .<br>[0]PETSC ERROR: ------------------------------------------------------------------------<br>[0]PETSC ERROR: ../src_o_petsc/min3pp on a linux-gnu named pardiff by jinbei Fri Sep 11 08:49:22 2009<br>[0]PETSC ERROR: Libraries linked from /home/jinbei/Soft/petsc-3.0.0-p5/linux-gnu-c-debug/lib<br>
[0]PETSC ERROR: Configure run at Thu Aug 20 11:36:14 2009<br>[0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=ifort --download-f-blas-lapack=1 --download-mpich=1 --with-shared=0<br>[0]PETSC ERROR: ------------------------------------------------------------------------<br>
[0]PETSC ERROR: VecCopy() line 1685 in src/vec/vec/interface/vector.c<br>[0]PETSC ERROR: KSPInitialResidual() line 60 in src/ksp/ksp/interface/itres.c<br>[0]PETSC ERROR: KSPSolve_BCGS() line 44 in src/ksp/ksp/impls/bcgs/bcgs.c<br>
[0]PETSC ERROR: KSPSolve() line 385 in src/ksp/ksp/interface/itfunc.c<br><br><br>What might cause the problem? <br></div></blockquote><div><br>You cannot change the problem size dynamically with KSP, since it allocates work vectors, etc. to support the computation. If the<br>
size changes, everything will have to be recreated.<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Another question is, the BCGS+ILU combination is kind of slo
 w. Would you please give me some suggestions on how to optimize the solver performance? I&#39;ve tried setting PC level to 1 and reducing maximum iterations, but doesn&#39;t really work well.<br></div></blockquote><div>
<br>Preconditioning is highly problem dependent. I do not believe in block-box preconditioners.<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>The last question is, if I want to use the true residual norm (based on&nbsp; original A*x=y) and the norm of solution updates as the criteria of convergence, what functions would do? Any example in the package I can refer to?<br>
</div></blockquote><div><br><a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPSetNormType.html">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPSetNormType.html</a><br>
<br>If you want something more sophisticated, you can always use<br><br><a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPSetConvergenceTest.html">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPSetConvergenceTest.html</a><br>
<br>&nbsp; Matt<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Many thanks again and have a nice day!<br><br><br><hr>与任何您希望的人分享您的回忆。 <a href="http://www.microsoft.com/china/windows/windowslive/products/photos-share.aspx?tab=1" target="_blank">任何您希望的人。</a></div>

</blockquote></div><br><br clear="all"><br>-- <br>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<br>