00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef PetscSparseSeqSolver_h
00035 #define PetscSparseSeqSolver_h
00036
00037 #include <petscksp.h>
00038 #include <SparseGenRowLinSolver.h>
00039
00040 #define PetscMinRelTol 1.0e-6
00041
00042 class SparseGenRowLinSOE;
00043
00044 class PetscSparseSeqSolver : public SparseGenRowLinSolver
00045 {
00046 public:
00047 PetscSparseSeqSolver(KSPType method, PCType preconditioner);
00048 PetscSparseSeqSolver(KSPType method, PCType preconditioner, double rTol, double aTol, double dTol, int maxIts);
00049 ~PetscSparseSeqSolver();
00050
00051 int solve(void);
00052 int setSize(void);
00053 int getNumIterations(void);
00054 virtual int setLinearSOE(SparseGenRowLinSOE &theSOE);
00055
00056 int sendSelf(int commitTag, Channel &theChannel);
00057 int recvSelf(int commitTag, Channel &theChannel,
00058 FEM_ObjectBroker &theBroker);
00059
00060 protected:
00061 SparseGenRowLinSOE *theSOE;
00062
00063 private:
00064 KSP ksp;
00065 PC pc;
00066 int its;
00067 KSPType method;
00068 PCType preconditioner;
00069 double rTol;
00070 double aTol;
00071 double dTol;
00072 int maxIts;
00073
00074 Mat A;
00075 Vec x, b;
00076 };
00077
00078 #endif
00079