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
00040
00041
00042 #ifndef NOX_EPETRA_LINEARSYSTEM_H
00043 #define NOX_EPETRA_LINEARSYSTEM_H
00044
00045 #include "NOX_Epetra_Vector.H"
00046 #include "NOX_Utils.H"
00047 #include "NOX_Common.H"
00048 #include "Teuchos_RCP.hpp"
00049
00050
00051 namespace NOX {
00052 namespace Epetra {
00053 class Scaling;
00054 }
00055 namespace Parameter {
00056 class List;
00057 }
00058 }
00059 class Epetra_Vector;
00060 class Epetra_Operator;
00061
00062 namespace NOX {
00063 namespace Epetra {
00064
00066 class LinearSystem {
00067
00068 public:
00070 enum PreconditionerReusePolicyType {
00072 PRPT_REBUILD,
00074 PRPT_RECOMPUTE,
00076 PRPT_REUSE
00077 };
00078
00079 public:
00081 LinearSystem(){};
00082
00084 virtual ~LinearSystem(){};
00085
00094 virtual bool applyJacobian(const NOX::Epetra::Vector& input,
00095 NOX::Epetra::Vector& result) const = 0;
00096
00105 virtual bool applyJacobianTranspose(const NOX::Epetra::Vector& input,
00106 NOX::Epetra::Vector& result) const = 0;
00107
00119 virtual bool applyJacobianInverse(Teuchos::ParameterList ¶ms,
00120 const NOX::Epetra::Vector &input,
00121 NOX::Epetra::Vector &result) = 0;
00122
00142 virtual bool applyRightPreconditioning(bool useTranspose,
00143 Teuchos::ParameterList& params,
00144 const NOX::Epetra::Vector& input,
00145 NOX::Epetra::Vector& result) const = 0;
00146
00148 virtual Teuchos::RCP<NOX::Epetra::Scaling> getScaling() = 0;
00149
00156 virtual void
00157 resetScaling(const Teuchos::RCP<NOX::Epetra::Scaling>& s) = 0;
00158
00160 virtual bool computeJacobian(const NOX::Epetra::Vector& x) = 0;
00161
00169 virtual bool createPreconditioner(const NOX::Epetra::Vector& x,
00170 Teuchos::ParameterList& p,
00171 bool recomputeGraph) const = 0;
00172
00178 virtual bool destroyPreconditioner() const = 0;
00179
00187 virtual bool recomputePreconditioner(const NOX::Epetra::Vector& x,
00188 Teuchos::ParameterList& linearSolverParams) const = 0;
00189
00195 virtual PreconditionerReusePolicyType
00196 getPreconditionerPolicy(bool advanceReuseCounter=true) = 0;
00197
00199 virtual bool isPreconditionerConstructed() const = 0;
00200
00202 virtual bool hasPreconditioner() const = 0;
00203
00205 virtual Teuchos::RCP<const Epetra_Operator>
00206 getJacobianOperator() const = 0;
00207
00209 virtual Teuchos::RCP<Epetra_Operator> getJacobianOperator() = 0;
00210
00212
00215 virtual Teuchos::RCP<const Epetra_Operator>
00216 getGeneratedPrecOperator() const = 0;
00217
00219 virtual Teuchos::RCP<Epetra_Operator> getGeneratedPrecOperator() = 0;
00220
00222 virtual void setJacobianOperatorForSolve(const
00223 Teuchos::RCP<const Epetra_Operator>& solveJacOp) = 0;
00224
00226
00229 virtual void setPrecOperatorForSolve(const
00230 Teuchos::RCP<const Epetra_Operator>& solvePrecOp) = 0;
00231 };
00232
00233 }
00234 }
00235
00236
00237 #endif