6.2. Solving Successive Linear Systems

Up: Contents Next: Krylov Methods Previous: Using SLES

When solving multiple linear systems of the same size with the same method, several options are available. 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.

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 Section Using SLES for a description of various flags for SLESSetOperators() that can save work for such cases.


Up: Contents Next: Krylov Methods Previous: Using SLES