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.
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 [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Arguments are incompatible! [0]PETSC ERROR: Incompatible vector global lengths! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 3.0.0, Patch 5, Mon Apr 13 09:15:37 CDT 2009 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: ../src_o_petsc/min3pp on a linux-gnu named pardiff by jinbei Fri Sep 11 08:49:22 2009 [0]PETSC ERROR: Libraries linked from /home/jinbei/Soft/petsc-3.0.0-p5/linux-gnu-c-debug/lib [0]PETSC ERROR: Configure run at Thu Aug 20 11:36:14 2009 [0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=ifort --download-f-blas-lapack=1 --download-mpich=1 --with-shared=0 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: VecCopy() line 1685 in src/vec/vec/interface/vector.c [0]PETSC ERROR: KSPInitialResidual() line 60 in src/ksp/ksp/interface/itres.c [0]PETSC ERROR: KSPSolve_BCGS() line 44 in src/ksp/ksp/impls/bcgs/bcgs.c [0]PETSC ERROR: KSPSolve() line 385 in src/ksp/ksp/interface/itfunc.c What might cause the problem? Another question is, the BCGS+ILU combination is kind of slow. Would you please give me some suggestions on how to optimize the solver performance? I've tried setting PC level to 1 and reducing maximum iterations, but doesn't really work well. The last question is, if I want to use the true residual norm (based on 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? Many thanks again and have a nice day! _________________________________________________________________ ?????????????????msn????? http://ditu.live.com/?form=TL&swm=1 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090911/2ad31adf/attachment-0001.htm>
