question on solving the transpose of a system

Randall Mackie randy at geosystem.us
Mon Sep 25 14:18:49 CDT 2006



Barry Smith wrote:
>   Randy,
> 
>> 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)
> 
>    Yes, this is the way we intend it to be used. You should not
> have to construct the transposed matrices.
> 
>   Questions:
> 
> Are you using KSPSetNullSpace()?

No

> Are you using right or left preconditioning? Or not setting it?

I'm not setting it, just using the default


> What KSP method are you using?
> What preconditioner are you using?

          -em_ksp_truemonitor \
          -em_ksp_type bcgs \
          -em_pc_type bjacobi \
          -em_sub_pc_type ilu \
          -em_sub_pc_factor_levels 3 \
          -em_sub_pc_factor_fill 6 \

> 
>    Barry
> 
> 
> 
> On Mon, 25 Sep 2006, Randall Mackie wrote:
> 
>> 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