Ifpack_PointRelaxation.h

00001 #ifndef IFPACK_POINTRELAXATION_H
00002 #define IFPACK_POINTRELAXATION_H
00003 
00004 #include "Ifpack_ConfigDefs.h"
00005 #ifdef HAVE_IFPACK_TEUCHOS
00006 #include "Ifpack_Preconditioner.h"
00007 namespace Teuchos {
00008   class ParameterList;
00009 }
00010 class Epetra_MultiVector;
00011 class Epetra_Vector;
00012 class Epetra_Map;
00013 class Epetra_Comm;
00014 class Epetra_Time;
00015 class Epetra_Vector;
00016 class Epetra_RowMatrix;
00017 class Epetra_CrsMatrix;
00018 class Epetra_Import;
00019 
00021 
00085 class Ifpack_PointRelaxation : public Ifpack_Preconditioner {
00086 
00087 public:
00088 
00090 
00091 
00096   Ifpack_PointRelaxation(const Epetra_RowMatrix* Matrix);
00097 
00099   virtual ~Ifpack_PointRelaxation();
00100 
00102 
00109   virtual inline int SetUseTranspose(bool UseTranspose)
00110   {
00111     UseTranspose_ = UseTranspose;
00112     return(0);
00113   }
00114 
00116 
00118 
00120 
00128   virtual inline int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00129 
00131 
00141   virtual int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00142 
00144   virtual double NormInf() const
00145   {
00146     return(-1.0);
00147   }
00149 
00151 
00152   virtual const char * Label() const
00153   {
00154     return(Label_.c_str());
00155   }
00156 
00158   virtual bool UseTranspose() const
00159   {
00160     return(UseTranspose_);
00161   }
00162 
00164   virtual bool HasNormInf() const
00165   {
00166     return(false);
00167   }
00168 
00170   virtual const Epetra_Comm & Comm() const;
00171 
00173   virtual const Epetra_Map & OperatorDomainMap() const;
00174 
00176   virtual const Epetra_Map & OperatorRangeMap() const;
00177 
00178   virtual int Initialize();
00179   
00180   virtual bool IsInitialized() const
00181   {
00182     return(IsInitialized_);
00183   }
00184 
00186   virtual inline bool IsComputed() const
00187   {
00188     return(IsComputed_);
00189   }
00190 
00192   virtual int Compute();
00193 
00195  
00197 
00198   virtual const Epetra_RowMatrix& Matrix() const 
00199   {
00200     return(*Matrix_);
00201   }
00202 
00204   virtual double Condest(const Ifpack_CondestType CT = Ifpack_Cheap,
00205                          const int MaxIters = 1550,
00206                          const double Tol = 1e-9,
00207              Epetra_RowMatrix* Matrix = 0);
00208 
00210   virtual double Condest() const
00211   {
00212     return(Condest_);
00213   }
00214 
00216   virtual int SetParameters(Teuchos::ParameterList& List);
00217 
00219   virtual ostream& Print(ostream & os) const;
00220 
00222 
00224 
00226   virtual int NumInitialize() const
00227   {
00228     return(NumInitialize_);
00229   }
00230 
00232   virtual int NumCompute() const
00233   {
00234     return(NumCompute_);
00235   }
00236 
00238   virtual int NumApplyInverse() const
00239   {
00240     return(NumApplyInverse_);
00241   }
00242 
00244   virtual double InitializeTime() const
00245   {
00246     return(InitializeTime_);
00247   }
00248 
00250   virtual double ComputeTime() const
00251   {
00252     return(ComputeTime_);
00253   }
00254 
00256   virtual double ApplyInverseTime() const
00257   {
00258     return(ApplyInverseTime_);
00259   }
00260 
00262   virtual double InitializeFlops() const
00263   {
00264     return(0.0);
00265   }
00266 
00268   virtual double ComputeFlops() const
00269   {
00270     return(ComputeFlops_);
00271   }
00272 
00274   virtual double ApplyInverseFlops() const
00275   {
00276     return(ApplyInverseFlops_);
00277   }
00278 
00279   // @}
00280 
00281 private:
00282  
00283   // @{ Application of the preconditioner
00284   
00286   virtual int ApplyInverseJacobi(const Epetra_MultiVector& X, 
00287                                  Epetra_MultiVector& Y) const;
00288 
00290   virtual int ApplyInverseGS(const Epetra_MultiVector& X, 
00291                              Epetra_MultiVector& Y) const;
00292 
00294   virtual int ApplyInverseSGS(const Epetra_MultiVector& X, 
00295                               Epetra_MultiVector& Y) const;
00296 
00297   virtual int ApplyInverseSGS_RowMatrix(const Epetra_MultiVector& X, 
00298                                         Epetra_MultiVector& Y) const;
00299 
00300   virtual int ApplyInverseSGS_CrsMatrix(const Epetra_CrsMatrix* A,
00301                                         const Epetra_MultiVector& X, 
00302                                         Epetra_MultiVector& Y) const;
00303 
00304   virtual int ApplyInverseSGS_FastCrsMatrix(const Epetra_CrsMatrix* A,
00305                                             const Epetra_MultiVector& X, 
00306                                             Epetra_MultiVector& Y) const;
00308 
00309 private:
00310   
00312   virtual void SetLabel();
00313 
00315   Ifpack_PointRelaxation(const Ifpack_PointRelaxation& rhs)
00316   {}
00317   
00319   Ifpack_PointRelaxation& operator=(const Ifpack_PointRelaxation& rhs)
00320   {
00321     return(*this);
00322   }
00323 
00324   // @{ Initializations, timing and flops
00326   bool IsInitialized_;
00328   bool IsComputed_;
00330   int NumInitialize_;
00332   int NumCompute_;
00334   mutable int NumApplyInverse_;
00336   double InitializeTime_;
00338   double ComputeTime_;
00340   mutable double ApplyInverseTime_;
00342   double ComputeFlops_;
00344   mutable double ApplyInverseFlops_;
00345   // @}
00346 
00347   // @{ Settings
00349   int NumSweeps_;
00351   double DampingFactor_;
00353   bool UseTranspose_;
00355   double Condest_;
00357   bool ComputeCondest_;
00359   string Label_;
00360   int PrecType_;
00361   double MinDiagonalValue_;
00362   // @}
00363 
00364   // @{ Other data
00366   int NumMyRows_;
00368   int NumMyNonzeros_;
00370   int NumGlobalRows_;
00372   int NumGlobalNonzeros_;
00374   const Epetra_RowMatrix* Matrix_;
00376   Epetra_Import* Importer_;
00378   mutable Epetra_Vector* Diagonal_;
00380   Epetra_Time* Time_;
00382   bool IsParallel_;
00384   bool ZeroStartingSolution_;
00385   // @}
00386 
00387 };
00388 
00389 #endif // HAVE_IFPACK_TEUCHOS
00390 #endif // IFPACK_POINTRELAXATION_H

Generated on Thu Sep 18 12:37:08 2008 for IFPACK by doxygen 1.3.9.1