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 LOBPCG_H
00030 #define 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 LOBPCG : 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 timeOrtho;
00092 double timeOuterLoop;
00093 double timePostProce;
00094 double timePrecOp;
00095 double timeResidual;
00096 double timeRestart;
00097 double timeStifOp;
00098
00099
00100 void accuracyCheck(const Epetra_MultiVector *X, const Epetra_MultiVector *MX,
00101 const Epetra_MultiVector *R, const Epetra_MultiVector *Q,
00102 const Epetra_MultiVector *H, const Epetra_MultiVector *P) const;
00103
00104
00105 LOBPCG(const LOBPCG &ref);
00106 LOBPCG& operator=(const LOBPCG &ref);
00107
00108 public:
00109
00110 LOBPCG(const Epetra_Comm &_Comm, const Epetra_Operator *KK,
00111 const Epetra_Operator *PP, Projector* YHCP, int _blk,
00112 double _tol = 1.0e-08, int _maxIter = 100, int _verb = 0);
00113
00114 LOBPCG(const Epetra_Comm &_Comm, const Epetra_Operator *KK,
00115 const Epetra_Operator *MM, const Epetra_Operator *PP, Projector* YHCP, int _blk,
00116 double _tol = 1.0e-08, int _maxIter = 100, int _verb = 0, double *_weight = 0);
00117
00118 ~LOBPCG();
00119
00120 int solve(int numEigen, Epetra_MultiVector &Q, double *lambda);
00121
00122 int minimumSpaceDimension(int nev) const { return nev+blockSize; }
00123
00124 void initializeCounters();
00125
00126 void algorithmInfo() const;
00127 void historyInfo() const;
00128 void memoryInfo() const;
00129 void operationInfo() const;
00130 void timeInfo() const;
00131 };
00132
00133 #endif