SLESSolveTranspose

Solves the transpose of a linear system.

Synopsis

#include "petscsles.h"    
int SLESSolveTranspose(SLES sles,Vec b,Vec x,int *its)
Collective on SLES

Input Parameters

sles - the SLES context
b - the right hand side

Output Parameters

x - the approximate solution
its - the number of iterations until termination

Notes

On return, the parameter "its" contains
<its> - the iteration number at which convergence was successfully reached, or
<- its> - the negative of the iteration at which divergence or breakdown was detected.

Currently works only with the KSPPREONLY method.

Setting a Nonzero Initial Guess

By default, SLES assumes an initial guess of zero by zeroing the initial value for the solution vector, x. To use a nonzero initial guess, the user must call
        SLESGetKSP(sles,&ksp);
        KSPSetInitialGuessNonzero(ksp,PETSC_TRUE);

Solving Successive Linear Systems

When solving multiple linear systems of the same size with the same method, several options are available.

(1) To solve successive linear systems having the SAME preconditioner matrix (i.e., the same data structure with exactly the same matrix elements) but different right-hand-side vectors, the user should simply call SLESSolve() multiple times. The preconditioner setup operations (e.g., factorization for ILU) will be done during the first call to SLESSolve() only; such operations will NOT be repeated for successive solves.

(2) To solve successive linear systems that have DIFFERENT preconditioner matrices (i.e., the matrix elements and/or the matrix data structure change), the user MUST call SLESSetOperators() and SLESSolve() for each solve. See SLESSetOperators() for options that can save work for such cases.

Keywords

SLES, solve, linear system

See Also

SLESCreate(), SLESSetOperators(), SLESGetKSP(), KSPSetTolerances(),
KSPDefaultConverged(), KSPSetInitialGuessNonzero(), KSPGetResidualNorm(), KSPSolve()

Level:intermediate
Location:
src/sles/interface/sles.c
Index of all SLES routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/sles/examples/tutorials/ex10.c.html
src/snes/examples/tutorials/ex24.c.html