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_INTERFACE_XYZT_H
00040 #define LOCA_EPETRA_INTERFACE_XYZT_H
00041
00042 #include "LOCA.H"
00043 #include "NOX_Common.H"
00044 #include "LOCA_Epetra_Interface_Required.H"
00045 #include "NOX_Epetra_Interface_Preconditioner.H"
00046 #include "LOCA_Epetra_Interface_TimeDependent.H"
00047 #include "LOCA_Epetra_xyztPrec.H"
00048
00049 #ifdef HAVE_NOX_EPETRAEXT
00050
00051 #include <iostream>
00052 #include "Epetra_Map.h"
00053 #include "Epetra_Vector.h"
00054 #include "Epetra_Operator.h"
00055 #include "Epetra_RowMatrix.h"
00056 #include "Epetra_CrsMatrix.h"
00057 #include "Epetra_DistObject.h"
00058 #include "Epetra_Import.h"
00059 #ifdef HAVE_MPI
00060 #include "Epetra_MpiComm.h"
00061 #include "EpetraExt_MultiMpiComm.h"
00062 #else
00063 #include "Epetra_SerialComm.h"
00064 #include "EpetraExt_MultiSerialComm.h"
00065 #endif
00066
00067 #include "EpetraExt_BlockVector.h"
00068 #include "EpetraExt_BlockCrsMatrix.h"
00069
00070
00071 namespace LOCA {
00072 namespace Epetra {
00073 namespace Interface {
00074 class Required;
00075 }
00076 }
00077 }
00078 namespace NOX {
00079 namespace Epetra {
00080 namespace Interface {
00081 class Jacobian;
00082 }
00083 }
00084 }
00085
00086
00087 namespace LOCA {
00088 namespace Epetra {
00089 namespace Interface {
00090
00106 class xyzt :
00107 public LOCA::Epetra::Interface::Required,
00108 public NOX::Epetra::Interface::Jacobian {
00109
00110 public:
00111
00119 xyzt( const Teuchos::RCP<LOCA::Epetra::Interface::TimeDependent>
00120 &interface,
00121 const Epetra_MultiVector &splitMultiVec,
00122 const Teuchos::RCP<Epetra_RowMatrix> &splitJac,
00123 const Teuchos::RCP<EpetraExt::MultiComm> &globalComm,
00124 const Epetra_Vector &initialCondVec,
00125 double dt,
00126 Teuchos::ParameterList *precPrintParams = 0,
00127 Teuchos::ParameterList *precLSParams = 0);
00128
00130 virtual ~xyzt();
00131
00138 virtual bool computeF(const Epetra_Vector& x, Epetra_Vector& F,
00139 const FillType fillFlag);
00140
00147 virtual bool computeJacobian(const Epetra_Vector& x,
00148 Epetra_Operator& Jac);
00149
00151 virtual void setParameters(const LOCA::ParameterVector& param);
00152
00154 virtual void printSolution(const Epetra_Vector& x_, double conParam);
00155
00158 void setFloquetFillFlag(bool fff);
00159
00162 void beginFloquetOperatorApplication(Epetra_Vector& v);
00163
00166 void finishFloquetOperatorApplication(Epetra_Vector& v);
00167
00169 virtual EpetraExt::BlockVector& getSolution();
00170
00172 virtual EpetraExt::BlockCrsMatrix& getJacobian();
00173
00175 virtual LOCA::Epetra::xyztPrec& getPreconditioner();
00176
00178 virtual void throwError(const string& functionName,
00179 const string& errorMsg) const;
00180
00181 private:
00182
00184 Teuchos::RCP<LOCA::Epetra::Interface::TimeDependent> interface;
00185
00187 Teuchos::RCP<Epetra_RowMatrix> splitJac;
00188
00190 Teuchos::RCP<EpetraExt::MultiComm> globalComm;
00191
00193 Epetra_Vector splitVec;
00194
00196 Epetra_Vector splitRes;
00197
00199 Epetra_Vector splitVecOld;
00200
00202 const Epetra_Vector initialCondVec;
00203
00205 EpetraExt::BlockCrsMatrix* jacobian;
00206
00208 EpetraExt::BlockVector* solution;
00209
00211 EpetraExt::BlockVector* solutionOverlap;
00212
00214 Epetra_Import* overlapImporter;
00215
00217 int timeStepsOnTimeDomain;
00218
00220 int numTimeDomains;
00221
00223 int timeDomain;
00224
00226 int conStep;
00227
00234 std::vector< std::vector<int> >* rowStencil;
00235
00237 std::vector<int>* rowIndex;
00238
00243 Teuchos::ParameterList* precPrintParams;
00244
00249 Teuchos::ParameterList* precLSParams;
00250
00252 LOCA::Epetra::xyztPrec* preconditioner;
00253
00255 Epetra_CrsMatrix* splitJacCrs;
00256
00258 Epetra_RowMatrix* savedSplitMassForFloquet;
00259
00261 bool isCrsMatrix;
00262
00264 bool isPeriodic;
00265
00267 bool floquetFillFlag;
00268
00270 double dt;
00271
00272
00273
00274 };
00275
00276 }
00277 }
00278 }
00279
00280 #endif // HAVE_NOX_EPETRAEXT
00281 #endif // LOCA_EPETRA_INTERFACE_XYZT_H