[petsc-dev] Problem with conjugate gradient solver
Keita Teranishi
keita at cray.com
Thu Aug 26 12:27:34 CDT 2010
The default solver is GMRES, which can solve indefinite systems.
================================
Keita Teranishi
Scientific Library Group
Cray, Inc.
keita at cray.com
================================
From: petsc-dev-bounces at mcs.anl.gov [mailto:petsc-dev-bounces at mcs.anl.gov] On Behalf Of Anush Krishnan
Sent: Thursday, August 26, 2010 12:08 PM
To: petsc-dev at mcs.anl.gov
Subject: Re: [petsc-dev] Problem with conjugate gradient solver
Message: 2
Date: Tue, 24 Aug 2010 10:56:53 -0500
From: Barry Smith <bsmith at mcs.anl.gov<mailto:bsmith at mcs.anl.gov>>
Subject: Re: [petsc-dev] Problem with conjugate gradient solver
To: For users of the development version of PETSc
<petsc-dev at mcs.anl.gov<mailto:petsc-dev at mcs.anl.gov>>, Victor Eijkhout <eijkhout at tacc.utexas.edu<mailto:eijkhout at tacc.utexas.edu>>
Message-ID: <A4C6A1ED-CDE7-4653-8046-C2797AD5AF31 at mcs.anl.gov<mailto:A4C6A1ED-CDE7-4653-8046-C2797AD5AF31 at mcs.anl.gov>>
Content-Type: text/plain; charset="us-ascii"
Well you are doing nothing wrong. When I run the code I get the same results as you. I dump the matrix into Matlab and it has a negative eigenvalue so the example is wrong. The code is handling it correctly.
>> eig(full(Mat_0))
ans =
-0.8042
0.1716
0.6489
1.0000
1.0000
1.0000
1.0000
So are you saying that trying to solve the system of equations in the example will always result in divergence? I tried the same program with a different system that I know has a solution, and even that diverges. I get a proper solution if I use the default KSP solver.
Anush
I am cc:iing Victor who supposedly wrote the original example.
Barry
Attached is the matrix saved with -mat_view_matlab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20100826/0e6594f5/attachment.html>
More information about the petsc-dev
mailing list