src/eigsolv/Projectors.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 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     // Don't define these functions !
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     // Functions inherited from Epetra_Operator
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

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