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 #ifndef LOCA_EPETRA_XYZTPREC_H
00040 #define LOCA_EPETRA_XYZTPREC_H
00041
00042 #include "NOX_Common.H"
00043 #include "Teuchos_ParameterList.hpp"
00044 #include "NOX_Epetra_Interface_Required.H"
00045 #include "NOX_Epetra_Interface_Jacobian.H"
00046 #include "NOX_Epetra_Interface_Preconditioner.H"
00047 #include "NOX_Epetra_Vector.H"
00048 #ifdef HAVE_MPI
00049 #include "EpetraExt_MultiMpiComm.h"
00050 #else
00051 #include "EpetraExt_MultiSerialComm.h"
00052 #endif
00053 #include "EpetraExt_BlockVector.h"
00054 #include "EpetraExt_BlockCrsMatrix.h"
00055 #include "Epetra_Operator.h"
00056 #include "Epetra_Import.h"
00057 #include "NOX_Epetra_LinearSystem_AztecOO.H"
00058
00059 namespace LOCA {
00060 namespace Epetra {
00061
00106 class xyztPrec : public Epetra_Operator,
00107 public NOX::Epetra::Interface::Required,
00108 public NOX::Epetra::Interface::Jacobian,
00109 public NOX::Epetra::Interface::Preconditioner
00110 {
00111
00112 public:
00113
00121 xyztPrec(EpetraExt::BlockCrsMatrix& jacobian,
00122 Epetra_CrsMatrix &splitJac,
00123 EpetraExt::BlockVector& solution,
00124 EpetraExt::BlockVector& solutionOverlap,
00125 Epetra_Import &overlapImporter,
00126 Teuchos::ParameterList& precPrintParams,
00127 Teuchos::ParameterList& precLSParams,
00128 const Teuchos::RCP<EpetraExt::MultiComm> globalComm_);
00129
00131 virtual ~xyztPrec();
00132
00134 virtual int SetUseTranspose(bool UseTranspose);
00135
00137 virtual int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00138
00140 virtual int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00141
00143 virtual double NormInf() const;
00144
00146 virtual const char* Label() const;
00147
00149 virtual bool UseTranspose() const;
00150
00152 virtual bool HasNormInf() const;
00153
00158 virtual const Epetra_Comm& Comm() const;
00159
00164 virtual const Epetra_Map& OperatorDomainMap() const;
00165
00170 virtual const Epetra_Map& OperatorRangeMap() const;
00171
00173 virtual bool computeF(const Epetra_Vector&,
00174 Epetra_Vector&,
00175 NOX::Epetra::Interface::Required::FillType);
00176
00178 virtual bool computeJacobian(const Epetra_Vector&, Epetra_Operator&);
00179
00181 virtual bool computePreconditioner(const Epetra_Vector& x,
00182 Epetra_Operator& Prec,
00183 Teuchos::ParameterList* p = 0);
00184
00185
00187 virtual void throwError(const string& functionName,
00188 const string& errorMsg) const;
00189
00190
00191 private:
00192
00194 EpetraExt::BlockCrsMatrix& jacobian;
00195
00197 Epetra_CrsMatrix &splitJac;
00198
00200 EpetraExt::BlockVector& solution;
00201
00203 EpetraExt::BlockVector& solutionOverlap;
00204
00206 Epetra_Import& overlapImporter;
00207
00209 Teuchos::ParameterList& printParams;
00210
00212 Teuchos::ParameterList& lsParams;
00213
00215 const Teuchos::RCP<EpetraExt::MultiComm> globalComm;
00216
00218 std::vector<NOX::Epetra::LinearSystemAztecOO *> linSys;
00219
00221 std::vector<Teuchos::RCP<Epetra_CrsMatrix> > jacobianBlock;
00222
00224 std::vector<Teuchos::RCP<Epetra_CrsMatrix> > massBlock;
00225
00227 std::vector<Teuchos::RCP<Epetra_Vector> > diagBlockSubdiag;
00228
00230 EpetraExt::BlockVector *residual;
00231
00233 Epetra_Vector *splitVec;
00234
00236 Epetra_Vector *splitRes;
00237
00239 Epetra_Vector *splitVecOld;
00240
00242 NOX::Epetra::Vector *splitRes_NEV;
00243
00245 NOX::Epetra::Vector *splitVec_NEV;
00246
00248 bool isPeriodic;
00249
00251 string label;
00252
00253 };
00254
00255 }
00256 }
00257
00258 #endif // LOCA_EPETRA_XYZTPREC_H