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
00035
00036 #ifndef PetscSolver_h
00037 #define PetscSolver_h
00038
00039 #include <petscksp.h>
00040 #include <LinearSOESolver.h>
00041
00042 class PetscSOE;
00043
00044 class PetscSolver : public LinearSOESolver
00045 {
00046 public:
00047 PetscSolver();
00048 PetscSolver(KSPType method, PCType preconditioner);
00049 PetscSolver(KSPType method, PCType preconditioner, double rTol, double aTol, double dTol, int maxIts);
00050 ~PetscSolver();
00051
00052 int solve(void);
00053 int setSize(void);
00054 virtual int setLinearSOE(PetscSOE &theSOE);
00055
00056 int sendSelf(int commitTag, Channel &theChannel);
00057 int recvSelf(int commitTag, Channel &theChannel,
00058 FEM_ObjectBroker &theBroker);
00059
00060 friend class ActorPetscSOE;
00061 friend class ShadowPetscSOE;
00062
00063 protected:
00064 PetscSOE *theSOE;
00065
00066 private:
00067 KSP ksp;
00068 PC pc;
00069 int its;
00070 KSPType method;
00071 PCType preconditioner;
00072 double rTol;
00073 double aTol;
00074 double dTol;
00075 int maxIts;
00076
00077 static int numSolver;
00078 };
00079
00080 #endif
00081