00001
00002
00003
00004
00005 #ifndef PETSCITERATIVESOLVER_H
00006 #define PETSCITERATIVESOLVER_H
00007
00008 #include "DoubleLinearSolver.h"
00009 #include "PetscSpSymMatrixHandle.h"
00010 #include "PetscSparseStorageHandle.h"
00011 #include "petscsles.h"
00012
00013 class PetscIterativeSolver : public DoubleLinearSolver {
00014 protected:
00015 SLES sles;
00016 int deleteSLES;
00017 int cits;
00018 Vec x;
00019 PetscVectorHandle hx;
00020 PetscSparseStorageHandle mStorage;
00021 public:
00022 PetscIterativeSolver( PetscSpSymMatrix * Mat,
00023 KSPType ksptype, PCType pctype );
00024 PetscIterativeSolver( PetscSpSymMatrix * Mat, SLES sles_ );
00025
00026 int totalLinearIterations() { return cits; };
00027 virtual void diagonalChanged( int idiag, int extent );
00028 virtual void matrixChanged();
00029 virtual void solve ( OoqpVector& x );
00030 SLES getSLES() { return sles; };
00031 virtual ~PetscIterativeSolver();
00032 };
00033
00034 #endif