question on solving the transpose of a system

Randall Mackie randy at geosystem.us
Mon Sep 25 13:59:47 CDT 2006


I have a situation where I have to solve the following problems:

1) Ax=b

2) (A)^T u = c

A is not symmetric.


After I set up my A matrix and the preconditioner P (which is NOT the same as A),
I solve it like so:


         call set_P(da,P,l,m,n,period,resist,x,y,z)
         call set_A(da,A,l,m,n,period,resist,x,y,z)

         call MatSetBlockSize(A,3,ierr)
         call MatSetBlockSize(P,3,ierr)

         call KSPSetOperators(ksp,A,P,DIFFERENT_NONZERO_PATTERN,ierr)
         call KSPSetInitialGuessNonzero(ksp,PETSC_TRUE,ierr)

             call KSPSolve(ksp,b,xsol,ierr)
             call KSPGetIterationNumber(ksp,its,ierr)
             call KSPGetConvergedReason(ksp,reason,ierr)


Now, if I want to solve (2) above, do I simply make a call to
KSPSolveTranspose(ksp,b,xsol), where I've set b to the right
hand side of (2), or do I have to create the transposes of both
A and the preconditioner and just use KSPSolve?


When I've tried just using KSPSolveTranspose, the preconditioned residual
norm falls, but not as rapidly as when doing (1), and the true residual norm
seems not to change much at all.


Thanks, Randy


-- 
Randall Mackie
GSY-USA, Inc.
PMB# 643
2261 Market St.,
San Francisco, CA 94114-1600
Tel (415) 469-8649
Fax (415) 469-5044

California Registered Geophysicist
License No. GP 1034




More information about the petsc-users mailing list