src/eigsolv/KnyazevLOBPCG.h

Go to the documentation of this file.
00001 //**************************************************************************
00002 //
00003 //                                 NOTICE
00004 //
00005 // This software is a result of the research described in the report
00006 //
00007 // " A comparison of algorithms for modal analysis in the absence 
00008 //   of a sparse direct method", P. Arbenz, R. Lehoucq, and U. Hetmaniuk,
00009 //  Sandia National Laboratories, Technical report SAND2003-1028J.
00010 //
00011 // It is based on the Epetra, AztecOO, and ML packages defined in the Trilinos
00012 // framework ( http://software.sandia.gov/trilinos/ ).
00013 //
00014 // The distribution of this software follows also the rules defined in Trilinos.
00015 // This notice shall be marked on any reproduction of this software, in whole or
00016 // in part.
00017 //
00018 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00019 // license for use of this work by or on behalf of the U.S. Government.
00020 //
00021 // This program is distributed in the hope that it will be useful, but
00022 // WITHOUT ANY WARRANTY; without even the implied warranty of
00023 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00024 //
00025 // Code Authors: U. Hetmaniuk (ulhetma@sandia.gov), R. Lehoucq (rblehou@sandia.gov)
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     // Private functions
00098     void accuracyCheck(const Epetra_MultiVector *X, const Epetra_MultiVector *MX,
00099                        const Epetra_MultiVector *R) const;
00100 
00101     // Don't define these functions
00102     //KnyazevLOBPCG(const KnyazevLOBPCG &ref);
00103     //KnyazevLOBPCG& operator=(const KnyazevLOBPCG &ref);
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

Generated on Fri Oct 26 13:35:11 2007 for FEMAXX (Finite Element Maxwell Eigensolver) by  doxygen 1.4.7