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 #ifndef KNYAZEV_LOBPCG_H
00030 #define KNYAZEV_LOBPCG_H
00031
00032 #include "Epetra_ConfigDefs.h"
00033
00034 #include "Epetra_BLAS.h"
00035 #include "Epetra_Comm.h"
00036 #include "Epetra_Operator.h"
00037 #include "Epetra_Time.h"
00038
00039 #include "CheckingTools.h"
00040 #include "FortranRoutines.h"
00041 #include "ModalAnalysisSolver.h"
00042 #include "MyMemory.h"
00043 #include "ModalTools.h"
00044 #include "SortingTools.h"
00045 #include "Projector.h"
00046
00047 class KnyazevLOBPCG : public ModalAnalysisSolver {
00048
00049 private:
00050
00051 const CheckingTools myVerify;
00052 const Epetra_BLAS callBLAS;
00053 const FortranRoutines callFortran;
00054 ModalTools modalTool;
00055 const SortingTools mySort;
00056
00057 const Epetra_Comm &MyComm;
00058 const Epetra_Operator *K;
00059 const Epetra_Operator *M;
00060 const Epetra_Operator *Prec;
00061 Projector *YHC;
00062 const Epetra_Time MyWatch;
00063
00064 double tolEigenSolve;
00065 int maxIterEigenSolve;
00066
00067 int blockSize;
00068
00069 double *normWeight;
00070
00071 int verbose;
00072
00073 int historyCount;
00074 double *resHistory;
00075
00076 double memRequested;
00077 double highMem;
00078
00079 int massOp;
00080 int numRestart;
00081 int outerIter;
00082 int precOp;
00083 int residual;
00084 int stifOp;
00085
00086 double timeLocalProj;
00087 double timeLocalSolve;
00088 double timeLocalUpdate;
00089 double timeMassOp;
00090 double timeNorm;
00091 double timeOuterLoop;
00092 double timePostProce;
00093 double timePrecOp;
00094 double timeResidual;
00095 double timeStifOp;
00096
00097
00098 void accuracyCheck(const Epetra_MultiVector *X, const Epetra_MultiVector *MX,
00099 const Epetra_MultiVector *R) const;
00100
00101
00102
00103
00104
00105 public:
00106
00107 KnyazevLOBPCG(const Epetra_Comm &_Comm, const Epetra_Operator *KK,
00108 const Epetra_Operator *PP,
00109 double _tol = 1.0e-08, int _maxIter = 100, int _verb = 0);
00110
00111 KnyazevLOBPCG(const Epetra_Comm &_Comm, const Epetra_Operator *KK,
00112 const Epetra_Operator *MM, const Epetra_Operator *PP, Projector *YHCP,
00113 double _tol = 1.0e-08, int _maxIter = 100, int _verb = 0, double *_weight = 0);
00114
00115 ~KnyazevLOBPCG();
00116
00117 int solve(int numEigen, Epetra_MultiVector &Q, double *lambda);
00118
00119 int minimumSpaceDimension(int nev) const { return nev; }
00120
00121 void initializeCounters();
00122
00123 void algorithmInfo() const;
00124 void historyInfo() const;
00125 void memoryInfo() const;
00126 void operationInfo() const;
00127 void timeInfo() const;
00128
00129 };
00130
00131 #endif