Ifpack_OverlapSolveObject.h

00001 /*@HEADER
00002 // ***********************************************************************
00003 // 
00004 //       Ifpack: Object-Oriented Algebraic Preconditioner Package
00005 //                 Copyright (2002) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 //@HEADER
00028 */
00029 
00030 #ifndef IFPACK_SOLVEOBJECT_H
00031 #define IFPACK_SOLVEOBJECT_H
00032 
00033 #include "Epetra_Operator.h"
00034 #include "Epetra_CrsMatrix.h"
00035 #include "Epetra_Vector.h"
00036 #include "Epetra_CombineMode.h"
00037 class Epetra_Flops;
00038 
00040 
00041 class Ifpack_OverlapSolveObject: public virtual Epetra_Operator {
00042 
00043  public:
00045 
00046   Ifpack_OverlapSolveObject(char * Label, const Epetra_Comm & Comm);
00047 
00049   Ifpack_OverlapSolveObject(const Ifpack_OverlapSolveObject & Source);
00050 
00052   virtual ~Ifpack_OverlapSolveObject();
00054 
00056 
00058   void SetOverlapMode( Epetra_CombineMode OverlapMode) {OverlapMode_ = OverlapMode; return;}
00059 
00061   int SetLowerOperator (Epetra_CrsMatrix * L, bool UseLTrans) {L_ = L; UseLTrans_ = UseLTrans; return(0);};
00062 
00064   int SetDiagonal (Epetra_Vector * D, bool UseDInv) {D_ = D; UseDInv_ = UseDInv; return(0);};
00065 
00067   int SetUpperOperator (Epetra_CrsMatrix * U, bool UseUTrans) {U_ = U; UseUTrans_ = UseUTrans; return(0);};
00069 
00071   
00072   
00074 
00084   int Solve(bool Trans, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00085 
00087 
00097   int Multiply(bool Trans, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00098 
00100 
00108   int Condest(bool Trans, double & ConditionNumberEstimate) const;
00110 
00112 
00114 
00119   Epetra_CombineMode OverlapMode() const {return(OverlapMode_);}
00120   
00122   int NumGlobalNonzeros() const {return(L().NumGlobalNonzeros()+U().NumGlobalNonzeros());};
00123   
00125   int NumMyNonzeros() const {return(L().NumMyNonzeros()+U().NumMyNonzeros());};
00126   
00128   const Epetra_CrsMatrix & L() const {return(*L_);};
00129     
00131   const Epetra_Vector & D() const {return(*D_);};
00132     
00134   const Epetra_CrsMatrix & U() const {return(*U_);};
00136   
00138 
00140     char * Label() const {return(Label_);};
00141     
00143 
00152   int SetUseTranspose(bool UseTranspose) {UseTranspose_ = UseTranspose; return(0);};
00153 
00155 
00166   int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const {
00167     return(Multiply(Ifpack_OverlapSolveObject::UseTranspose(), X, Y));};
00168 
00170 
00183   int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const {
00184     return(Solve(Ifpack_OverlapSolveObject::UseTranspose(), X, Y));};
00185 
00187     double NormInf() const {return(0.0);};
00188 
00190     bool HasNormInf() const {return(false);};
00191 
00193     bool UseTranspose() const {return(UseTranspose_);};
00194 
00196     const Epetra_Map & OperatorDomainMap() const {return(U_->OperatorDomainMap());};
00197 
00199     const Epetra_Map & OperatorRangeMap() const{return(L_->OperatorRangeMap());};
00200 
00202     const Epetra_Comm & Comm() const{return(Comm_);};
00204 
00205  protected:
00206     virtual int SetupXY(bool Trans, 
00207             const Epetra_MultiVector& Xin, const Epetra_MultiVector& Yin,
00208             Epetra_MultiVector * & Xout, Epetra_MultiVector * & Yout) const=0;
00209  private:
00210   char * Label_;
00211   Epetra_CrsMatrix * L_;
00212   bool UseLTrans_;
00213   Epetra_Vector * D_;
00214   bool UseDInv_;
00215   Epetra_CrsMatrix * U_;
00216   bool UseUTrans_;
00217   bool UseTranspose_;
00218   const Epetra_Comm & Comm_;
00219   mutable double Condest_;
00220   Epetra_Flops * Counter_;
00221   Epetra_CombineMode OverlapMode_;
00222 
00223 };
00224 #endif // IFPACK_SOLVEOBJECT_H

Generated on Wed May 12 21:30:18 2010 for IFPACK by  doxygen 1.4.7