src/eigsolv/LOBPCG.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 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     // Private functions
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     // Don't define these functions
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

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