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
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
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
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