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 JDSYM_PROJECTORS_H
00051 #define JDSYM_PROJECTORS_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_MultiVector.h"
00059 #include "Epetra_Operator.h"
00060 #include "Epetra_Time.h"
00061 #include "Epetra_Vector.h"
00062
00063 #include "OrthoPack.h"
00064
00065 class Projectors : public virtual Epetra_Operator {
00066
00067 private:
00068
00069 const Epetra_BLAS callBLAS;
00070 const Epetra_LAPACK callLAPACK;
00071 OrthoPack orthoTool;
00072
00073 const Epetra_Comm &MyComm;
00074 const Epetra_Time MyWatch;
00075
00076 const Epetra_Operator *A;
00077 const Epetra_Operator *B;
00078 const Epetra_Operator *APrec;
00079
00080 int Pro_k;
00081 int Pro_kmax;
00082
00083 int Pro_EquationType;
00084
00085 int *Pro_Hpiv;
00086 int *Pro_Gpiv;
00087
00088 double Pro_theta;
00089
00090 double *Pro_Hlu;
00091 double *Pro_Glu;
00092
00093 Epetra_MultiVector *Pro_Q;
00094 Epetra_MultiVector *Pro_Qb;
00095 Epetra_MultiVector *Pro_Y;
00096
00097 double *work1;
00098 double *work2;
00099
00100 mutable double timeApply;
00101 mutable double timeApplyInverse;
00102
00103 static const int OP_UNSYM1;
00104 static const int OP_UNSYM2;
00105 static const int OP_SYM;
00106
00107
00108 Projectors(const Projectors &ref);
00109 Projectors& operator=(const Projectors &ref);
00110
00111 protected:
00112
00113 void LinOp_UNSYM1(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const;
00114 void LinOp_UNSYM2(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const;
00115 void LinOp_SYM(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const;
00116
00117 void Precon_UNSYM1(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const;
00118 void Precon_UNSYM2(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const;
00119 void Precon_SYM(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const;
00120
00121 void Right_UNSYM1(Epetra_Vector &r);
00122 void Right_UNSYM2(Epetra_Vector &r);
00123 void Right_SYM(Epetra_Vector &r);
00124
00125 void A_theta_B(const Epetra_MultiVector &X, Epetra_MultiVector &Y, double *wTmp) const;
00126 void A_theta_I(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const;
00127
00128 void Project1(Epetra_MultiVector *AA, Epetra_MultiVector *BB, const Epetra_MultiVector &X,
00129 Epetra_MultiVector &Y) const;
00130
00131 void Project2(Epetra_MultiVector *AA, int rowB, int *piv, double *Blu, Epetra_MultiVector *CC,
00132 const Epetra_MultiVector &X, Epetra_MultiVector &Y) const;
00133
00134 public:
00135
00136 Projectors(const Epetra_Comm &_Comm,
00137 const Epetra_Operator *AA, const Epetra_Operator *BB, const Epetra_Operator *PP,
00138 int eqType, int k, int kmax, int *Hpiv, int *Gpiv,
00139 double theta, double *Hlu, double *Glu,
00140 Epetra_MultiVector *Q, Epetra_MultiVector *Qb, Epetra_MultiVector *Y,
00141 double *w1, double *w2);
00142
00143 ~Projectors() { };
00144
00145 void MakeRHS(Epetra_MultiVector &R);
00146
00147 void resetPro_k(int k) { Pro_k = k; };
00148 void resetPro_theta(double t) { Pro_theta = t; };
00149 void resetPro_Q(Epetra_MultiVector *dd) { Pro_Q = dd; };
00150 void resetPro_Qb(Epetra_MultiVector *dd) { Pro_Qb = dd; };
00151 void resetPro_Y(Epetra_MultiVector *dd) { Pro_Y = dd; };
00152
00153 const double getTimeApply() const { return timeApply; };
00154 const double getTimeApplyInverse() const { return timeApplyInverse; };
00155
00156
00157
00158 const char *Label() const { return "Linear operators for JDSYM"; };
00159
00160 bool UseTranspose() const { return false; };
00161 int SetUseTranspose(bool UseTranspose) { return 0; };
00162
00163 bool HasNormInf() const { return (false); };
00164 double NormInf() const { return (-1.0); };
00165
00166 int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00167 int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00168
00169 const Epetra_Comm& Comm() const { return MyComm; };
00170
00171 const Epetra_Map& OperatorDomainMap() const;
00172 const Epetra_Map& OperatorRangeMap() const;
00173
00174 };
00175
00176 #endif