question on solving the transpose of a system

Barry Smith bsmith at mcs.anl.gov
Mon Sep 25 14:24:38 CDT 2006


  Randy,

    Do you have this problem on one process?

   Barry


On Mon, 25 Sep 2006, Randall Mackie wrote:

> 
> 
> 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
> > > 
> > > 
> > > 
> > 
> 
> 




More information about the petsc-users mailing list