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 "PetscVectorHandle.h"
00012 #include "petscksp.h"
00013
00014 class PetscIterativeSolver : public DoubleLinearSolver {
00015 protected:
00016 KSP mKsp;
00017 int deleteKSP;
00018 int cits;
00019 Vec x;
00020 PetscVectorHandle hx;
00021 PetscSparseStorageHandle mStorage;
00022 public:
00023 PetscIterativeSolver( PetscSpSymMatrix * Mat,
00024 KSPType ksptype, PCType pctype );
00025 PetscIterativeSolver( PetscSpSymMatrix * Mat, KSP ksp );
00026
00027 int totalLinearIterations() { return cits; };
00028 virtual void diagonalChanged( int idiag, int extent );
00029 virtual void matrixChanged();
00030 virtual void solve ( OoqpVector& x );
00031 KSP ksp() { return mKsp; };
00032 virtual ~PetscIterativeSolver();
00033 };
00034
00035 #endif