#include <LinSolver.hpp>
Inheritance diagram for LinSolver< T >:


Public Member Functions | |
| virtual void | PrintParam ()=0 |
| Prints the name of the solver and (optionally) the parameters. | |
| virtual void | PreProcess (SysMatrix< T > &A)=0 |
| Prepares the solver for a given system matrix. | |
| virtual bool | Run (GridVec< T > &f, GridVec< T > &x)=0 |
Solves the linear system with a right-hand side and writes the solution to . Note that in some cases and must be physically different vectors, but they should have equal sizes. This function should throw exceptions on errors. The function returns nonzero if the prescribed precision has not been achieved. | |
| virtual void | PostProcess ()=0 |
| Releases the memory allocated in PreProcess, ... | |
| bool | Solve (SysMatrix< T > &A, GridVec< T > &f, GridVec< T > &x) |
| A shorter method to call the solver: this function merely calls the preprocess, then 'Run' and the postprocess. | |
| virtual | ~LinSolver () |
| Virtual destructor. | |
This is the virtual class template for generic linear solvers for large sparse linear systems. All such the solvers (line the damped linear iteration, the CG-method or the BiCGStab method) should be derived from this class. This class is further used as the interface for the linear solver in for ex. the Newton method.
| virtual void LinSolver< T >::PrintParam | ( | ) | [pure virtual] |
Prints the name of the solver and (optionally) the parameters.
Implemented in BiCGStab< T >, CGIter< T >, and LinIter< T >.
Prepares the solver for a given system matrix.
This function must be called only once for a given system matrix. Then the solver can be applied to any right-hand side. This function does not return any value but may throw exceptions:
| [in] | A | The system matrix hierarchy |
Implemented in BiCGStab< T >, CGIter< T >, and LinIter< T >.
| virtual bool LinSolver< T >::Run | ( | GridVec< T > & | f, | |
| GridVec< T > & | x | |||
| ) | [pure virtual] |
Solves the linear system with a right-hand side
and writes the solution to
. Note that in some cases
and
must be physically different vectors, but they should have equal sizes. This function should throw exceptions on errors. The function returns nonzero if the prescribed precision has not been achieved.
| [in] | f | The right-hand side |
| [in] | x | The solution (and the initial guess) |
Implemented in BiCGStab< T >, CGIter< T >, and LinIter< T >.
| virtual void LinSolver< T >::PostProcess | ( | ) | [pure virtual] |
Releases the memory allocated in PreProcess, ...
After you called this function the solver cannot work before you call PreProcess again. This function does not return any value but may throw exceptions.
Implemented in BiCGStab< T >, CGIter< T >, and LinIter< T >.
| bool LinSolver< T >::Solve | ( | SysMatrix< T > & | A, | |
| GridVec< T > & | f, | |||
| GridVec< T > & | x | |||
| ) | [inline] |
A shorter method to call the solver: this function merely calls the preprocess, then 'Run' and the postprocess.
| [in] | A | The system matrix hierarchy |
| [in] | f | The right-hand side |
| [in] | x | The solution |
1.5.2