src/eigsolv/JDBSYM.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  *                                                                         *
00030  *               Swiss Federal Institute of Technology (ETH)               *
00031  *                       CH-8092 Zuerich, Switzerland                      *
00032  *                                                                         *
00033  *                       (C) 1999 All Rights Reserved                      *
00034  *                                                                         *
00035  *                                NOTICE                                   *
00036  *                                                                         *
00037  *  Permission to use, copy, modify, and distribute this software and      *
00038  *  its documentation for any purpose and without fee is hereby granted    *
00039  *  provided that the above copyright notice appear in all copies and      *
00040  *  that both the copyright notice and this permission notice appear in    *
00041  *  supporting documentation.                                              *
00042  *                                                                         *
00043  *  Neither the Swiss Federal Institute of Technology nor the author make  *
00044  *  any representations about the suitability of this software for any     *
00045  *  purpose.  This software is provided ``as is'' without express or       *
00046  *  implied warranty.                                                      *
00047  *                                                                         *
00048  ***************************************************************************/
00049 
00050 #ifndef JDBSYM_H
00051 #define JDBSYM_H
00052 
00053 #include "Epetra_ConfigDefs.h"
00054 
00055 #include "Epetra_BLAS.h"
00056 #include "Epetra_Comm.h"
00057 #include "Epetra_LAPACK.h"
00058 #include "Epetra_Operator.h"
00059 #include "Epetra_Time.h"
00060 
00061 #include "CheckingTools.h"
00062 #include "FortranRoutines.h"
00063 #include "ModalAnalysisSolver.h"
00064 #include "MyMemory.h"
00065 #include "ModalTools.h"
00066 #include "LinSolvers.h"
00067 #include "OrthoPack.h"
00068 #include "Projectors.h"
00069 #include "SortingTools.h"
00070 
00071 namespace Teuchos {
00072     class ParameterList;
00073 }
00074 
00075 class JDBSYM: public ModalAnalysisSolver {
00076 
00077 private:
00078 
00079     enum opType { OP_UNSYM1 = 1, OP_UNSYM2 = 2, OP_SYM = 3};
00080 
00081     const CheckingTools myVerify;
00082     const Epetra_BLAS callBLAS;
00083     const Epetra_LAPACK callLAPACK;
00084     OrthoPack ortho;
00085     ModalTools modalTool;
00086     const SortingTools mySort;
00087 
00088     const Epetra_Comm &MyComm;
00089     const Epetra_Operator *K;
00090     const Epetra_Operator *M;
00091     const Epetra_Operator *Prec;
00092     const Epetra_Time MyWatch;
00093     const Epetra_Operator *YHC;
00094 
00095     LinSolvers *linSolver;
00096     Projectors *projK;
00097     Projectors *projP;
00098 
00099     int historyCount;
00100     double *resHistory;
00101 
00102     int maxSpaceSize;
00103     int sumSpaceSize;
00104     int *spaceSizeHistory;
00105 
00106     int maxIterPCG;
00107     int sumIterPCG;
00108     int *iterPCGHistory;
00109 
00110     double memRequested;
00111     double highMem;
00112 
00113     int numCorrectionSolve;
00114     int numOrtho;
00115     int outerIter;
00116     int precOp;
00117     int residual;
00118     int stifOp;
00119 
00120     double timeBuildG;
00121     double timeBuildH;
00122     double timeCorrectionRHS;
00123     double timeCorrectionSolve;
00124     double timeLocalProj;
00125     double timeLocalSolve;
00126     double timeLocalUpdate;
00127     double timeNorm;
00128     double timeOrtho;
00129     double timeOuterLoop;
00130     double timePostProce;
00131     double timePrecOp;
00132     double timeResidual;
00133     double timeRestart;
00134     double timeStifOp;
00135 
00136     Teuchos::ParameterList& params_;
00137 
00138     // Don't define these functions
00139     JDBSYM(const JDBSYM &ref);
00140     JDBSYM & operator=(const JDBSYM &ref);
00141 
00142 protected:
00143 
00144     int jdbsym(double tau, double jdtol,
00145                int kmax, int jmax, int jmin, int blockSize, int blkwise,
00146                int V0dim, double *V0,
00147                opType _optype, double eps_tr, double toldecay,
00148                int strategy, int max_it, int max_inner_it,
00149                int clvl,
00150                int &k_conv, double *Q, double *lambda, int &it);
00151 
00152     void validate(Epetra_MultiVector *Q, Epetra_MultiVector *MQ, Epetra_MultiVector *Y,
00153                   Epetra_MultiVector *V, double *H, int ldh, opType _optype, double *work1);
00154 
00155     void print_status(int clvl, int it, int k, int j, int kmax,
00156                       int _blkSize, int actblkSize,    
00157                       double *s, double *resnrm, int *actcorrits);
00158 
00159     void sorteig(int j, double S[], double U[], int ldu, double tau,
00160                  double dtemp[], int idx1[], int idx2[], int strategy);
00161     void quicksort(int n, double arr[], int idx[]);
00162 
00163 public:
00164 
00165     JDBSYM(const Epetra_Comm &_Comm, const Epetra_Operator *KK,
00166            const Epetra_Operator *MM, const Epetra_Operator *PP, const Epetra_Operator *YHCP,
00167            Teuchos::ParameterList& params);
00168 
00169     ~JDBSYM();
00170 
00173     static void set_defaults(Teuchos::ParameterList& param, int kmax);
00174 
00175     int solve(int numEigen, Epetra_MultiVector &Q, double *lambda);
00176 
00177     int minimumSpaceDimension(int nev) const { return nev; };
00178 
00179     void initializeCounters();
00180 
00181     void algorithmInfo() const;
00182     void historyInfo() const;
00183     void memoryInfo() const;
00184     void operationInfo() const;
00185     void timeInfo() const;
00186 
00187 };
00188 
00189 #endif

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