Follow up CG and PC question
Barry Smith
bsmith at mcs.anl.gov
Wed Jul 12 17:22:30 CDT 2006
Run with -ksp_converged_reason or call KSPGetConvergedReason()
after the KSPSolve() to see why it stopped. My guess is that
the matrix is not symmetric positive definite, perhaps it has
some negative numbers on the diagonal?
Barry
On Wed, 12 Jul 2006, KClimp at psl.nmsu.edu wrote:
> PETSC Help,
>
>
>
> This e-mail is a follow up to the one Matt Funk wrote last week. I work
> with matt at NMSU and just wanted to give a little more information to
> try and solve our problem.
>
>
>
> The issue in a nutshell is we are solving our linear system using PETSC
> to experiment with different solvers and PCs. We have had great success
> with GMRES and BICG using Jacobi and block Jacobi and CG with no PC.
> The problem is when we try to run CG w/ the jacobi or bjacobi.
>
>
>
> Shown below are some results when our system was ran with CG and no pc
> and CG and Jacobi.
>
>
>
> Shown below is the ksp_view information for the system using no PC. It
> converges at 302 iterations and the solution vector is very accurate
> relative to our other results.
>
>
>
> CASE 1: CG AND NO PC
>
> ========================================================================
> ========
>
> Time Step #1 and Total Time 0.001 msec
>
> call lrmodel()
>
> call asm2_rhs()
>
> KSP Object:
>
> type: cg
>
> maximum iterations=10000
>
> tolerances: relative=1e-05, absolute=1e-50, divergence=10000
>
> left preconditioning
>
> PC Object:
>
> type: none
>
> linear system matrix = precond matrix:
>
> Matrix Object:
>
> type=aij, rows=8192, cols=8192
>
> total: nonzeros=48640, allocated nonzeros=156280
>
> not using I-node routines
>
> Norm of error 1.59444e-07, Iterations 302
>
>
>
>
>
> CASE 2: CG AND JACOBI PC
>
> Shown below is the same system as above with the only change being
> -pc_type cg added at runtime. The ksp_view and ksp_monitor information
> are shown here. KSP reports a residual norm of 1.27 then does not
> iterate any more. This is what matt described as does not run.
>
> ========================================================================
> ========
>
> Time Step #1 and Total Time 0.001 msec
>
> call lrmodel()
>
> call asm2_rhs()
>
> 0 KSP Residual norm 1.270723190170e+00
>
> KSP Object:
>
> type: cg
>
> maximum iterations=10000
>
> tolerances: relative=1e-05, absolute=1e-50, divergence=10000
>
> left preconditioning
>
> PC Object:
>
> type: jacobi
>
> linear system matrix = precond matrix:
>
> Matrix Object:
>
> type=aij, rows=8192, cols=8192
>
> total: nonzeros=48640, allocated nonzeros=156280
>
> not using I-node routines
>
> Norm of error 0.0160078, Iterations 1
>
>
>
>
>
> I hope that this will help diagnosis the problem and the issue is a
> simple mistake on our part.
>
>
>
> Thank you guys for helping beginner users like me.
>
>
>
>
>
> Kevin Climp
>
> Target and Missile Systems
>
> Physical Science Laboratory-New Mexico State University
>
> Phone - (505) 646-9244
>
>
>
>
More information about the petsc-users
mailing list