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