Go to the documentation of this file.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
00043
00044
00045
00046
00047
00048
00049
00050 #ifndef NOX_Playa_GROUP_H
00051 #define NOX_Playa_GROUP_H
00052
00053 #include "NOX_Abstract_Group.H"
00054 #include "Teuchos_ParameterList.hpp"
00055
00056 #include "NOX_Common.H"
00057 #include "NOX_Playa_Vector.hpp"
00058 #include "Teuchos_RCP.hpp"
00059 #include "PlayaVectorType.hpp"
00060 #include "PlayaVectorSpaceDecl.hpp"
00061 #include "PlayaLinearSolverDecl.hpp"
00062 #include "PlayaLinearOperatorDecl.hpp"
00063 #include "PlayaNonlinearOperator.hpp"
00064
00065
00066 namespace Teuchos
00067 {
00068 namespace Parameter
00069 {
00070 class List;
00071 }
00072 }
00073
00074 namespace NOX {
00075 namespace NOXPlaya {
00076
00077 using Teuchos::rcp;
00078 using Teuchos::rcp_dynamic_cast;
00079
00080 class Group : public virtual NOX::Abstract::Group
00081 {
00082
00083 public:
00084
00085
00086
00087
00088
00089
00090 Group(const Playa::Vector<double>& initcond,
00091 const Playa::NonlinearOperator<double>& nonlinOp,
00092 const Playa::LinearSolver<double>& solver);
00093
00094
00095
00096
00097
00098
00099 Group(const Playa::NonlinearOperator<double>& nonlinOp,
00100 const Playa::LinearSolver<double>& solver);
00101
00102
00103
00104
00105
00106
00107 Group(const Playa::Vector<double>& initcond,
00108 const Playa::NonlinearOperator<double>& nonlinOp,
00109 const Playa::LinearSolver<double>& solver,
00110 int numdigits);
00111
00112
00113
00114
00115
00116
00117 Group(const Playa::NonlinearOperator<double>& nonlinOp,
00118 const Playa::LinearSolver<double>& solver,
00119 int numdigits);
00120
00121
00122
00123
00124
00125
00126
00127
00128 Group(const NOX::NOXPlaya::Group& source, NOX::CopyType type = DeepCopy);
00129
00130
00131 ~Group();
00132
00133
00134 NOX::Abstract::Group& operator=(const NOX::Abstract::Group& source);
00135
00136 NOX::Abstract::Group& operator=(const NOX::NOXPlaya::Group& source);
00137
00138
00139
00140
00141 void setX(const NOX::Abstract::Vector& y);
00142
00143 void setX(const NOX::NOXPlaya::Vector& y);
00144
00145 void computeX(const NOX::Abstract::Group& grp,
00146 const NOX::Abstract::Vector& d,
00147 double step);
00148
00149 void computeX(const NOX::NOXPlaya::Group& grp,
00150 const NOX::NOXPlaya::Vector& d,
00151 double step);
00152
00153 NOX::Abstract::Group::ReturnType computeF();
00154
00155 NOX::Abstract::Group::ReturnType computeJacobian();
00156
00157 NOX::Abstract::Group::ReturnType computeGradient();
00158
00159 NOX::Abstract::Group::ReturnType computeNewton(Teuchos::ParameterList& params);
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170 NOX::Abstract::Group::ReturnType
00171 applyJacobian(const NOX::NOXPlaya::Vector& input,
00172 NOX::NOXPlaya::Vector& result) const;
00173
00174
00175 NOX::Abstract::Group::ReturnType
00176 applyJacobian(const NOX::Abstract::Vector& input,
00177 NOX::Abstract::Vector& result) const;
00178
00179 NOX::Abstract::Group::ReturnType
00180 applyJacobianTranspose(const NOX::NOXPlaya::Vector& input,
00181 NOX::NOXPlaya::Vector& result) const;
00182
00183
00184 NOX::Abstract::Group::ReturnType
00185 applyJacobianTranspose(const NOX::Abstract::Vector& input,
00186 NOX::Abstract::Vector& result) const;
00187
00188 NOX::Abstract::Group::ReturnType
00189 applyJacobianInverse(Teuchos::ParameterList& params,
00190 const NOX::NOXPlaya::Vector& input,
00191 NOX::NOXPlaya::Vector& result) const;
00192
00193 NOX::Abstract::Group::ReturnType
00194 applyJacobianInverse(Teuchos::ParameterList& params,
00195 const NOX::Abstract::Vector& input,
00196 NOX::Abstract::Vector& result) const;
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208 bool isF() const;
00209 bool isJacobian() const;
00210 bool isGradient() const;
00211 bool isNewton() const;
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221 const NOX::Abstract::Vector& getX() const;
00222
00223 const NOX::Abstract::Vector& getF() const;
00224
00225 double getNormF() const;
00226
00227 const NOX::Abstract::Vector& getGradient() const;
00228
00229 const NOX::Abstract::Vector& getNewton() const;
00230
00231
00232 virtual Teuchos::RCP< const NOX::Abstract::Vector > getXPtr() const
00233 {return rcp_dynamic_cast<const NOX::Abstract::Vector>(xVector);}
00234
00235
00236 virtual Teuchos::RCP< const NOX::Abstract::Vector > getFPtr() const
00237 {return rcp_dynamic_cast<const NOX::Abstract::Vector>(fVector);}
00238
00239
00240
00241
00242 virtual Teuchos::RCP< const NOX::Abstract::Vector > getGradientPtr() const
00243 {return rcp_dynamic_cast<const NOX::Abstract::Vector>(gradientVector);}
00244
00245
00246 virtual Teuchos::RCP< const NOX::Abstract::Vector > getNewtonPtr() const
00247 {return rcp_dynamic_cast<const NOX::Abstract::Vector>(newtonVector);}
00248
00249
00250 #ifdef TRILINOS_6
00251 virtual NOX::Abstract::Group* clone(NOX::CopyType type = NOX::DeepCopy) const;
00252 #else
00253 virtual RCP<NOX::Abstract::Group> clone(NOX::CopyType type = NOX::DeepCopy) const;
00254 #endif
00255
00256
00257 void print() const;
00258
00259 protected:
00260
00261
00262 void resetIsValid();
00263
00264 protected:
00265
00266
00267 int precision;
00268
00269
00270
00271
00272 RCP<NOX::NOXPlaya::Vector> xVector;
00273
00274 RCP<NOX::NOXPlaya::Vector> fVector;
00275
00276 RCP<NOX::NOXPlaya::Vector> newtonVector;
00277
00278 RCP<NOX::NOXPlaya::Vector> gradientVector;
00279
00280
00281
00282 mutable Playa::LinearSolver<double> solver;
00283
00284
00285 Playa::LinearOperator<double> jacobian;
00286
00287
00288
00289 Playa::NonlinearOperator<double> nonlinearOp;
00290
00291
00292
00293
00294
00295
00296 bool isValidF;
00297 bool isValidJacobian;
00298 bool isValidGradient;
00299 bool isValidNewton;
00300
00301
00302
00303 double normF;
00304
00305 };
00306
00307 }
00308 }
00309
00310
00311 #endif