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_STATUSTEST_NORMF_H
00043 #define NOX_STATUSTEST_NORMF_H
00044
00045 #include "NOX_StatusTest_Generic.H"
00046 #include "NOX_Abstract_Vector.H"
00047 #include "NOX_Utils.H"
00048
00049
00050 namespace NOX {
00051 namespace Abstract {
00052 class Group;
00053 }
00054 }
00055
00056 namespace NOX {
00057
00058 namespace StatusTest {
00059
00061
00110 class NormF : public Generic {
00111
00112 public:
00113
00115 enum ScaleType {
00117 Unscaled,
00119 Scaled
00120 };
00121
00123 enum ToleranceType {
00125 Relative,
00127 Absolute
00128 };
00129
00131
00132 NormF(double tolerance, NOX::Abstract::Vector::NormType ntype,
00133 ScaleType stype = Scaled, const NOX::Utils* u = NULL);
00134
00136
00137 NormF(double tolerance, ScaleType stype = Scaled,
00138 const NOX::Utils* u = NULL);
00139
00141
00142 NormF(NOX::Abstract::Group& initialGuess, double tolerance,
00143 NOX::Abstract::Vector::NormType ntype, ScaleType stype = Scaled,
00144 const NOX::Utils* u = NULL);
00145
00147
00148 NormF(NOX::Abstract::Group& initialGuess, double tolerance,
00149 ScaleType stype = Scaled, const NOX::Utils* u = NULL);
00150
00152 virtual ~NormF();
00153
00154
00155 virtual NOX::StatusTest::StatusType
00156 checkStatus(const NOX::Solver::Generic& problem,
00157 NOX::StatusTest::CheckType checkType);
00158
00159
00160 virtual NOX::StatusTest::StatusType getStatus() const;
00161
00162 virtual ostream& print(ostream& stream, int indent = 0) const;
00163
00164
00165
00166
00168
00170 virtual void reset(double tolerance);
00171
00173 virtual void reset(NOX::Abstract::Group& initialGuess, double tolerance);
00174
00176
00177
00178
00179
00181
00183 virtual double getNormF() const;
00184
00186 virtual double getTrueTolerance() const;
00187
00189 virtual double getSpecifiedTolerance() const;
00190
00192 virtual double getInitialTolerance() const;
00193
00195
00196
00197 private:
00198
00205 double computeNorm(const NOX::Abstract::Group& grp);
00206
00209 void relativeSetup(NOX::Abstract::Group& initialGuess);
00210
00211 private:
00212
00214 NOX::StatusTest::StatusType status;
00215
00217 NOX::Abstract::Vector::NormType normType;
00218
00220 ScaleType scaleType;
00221
00223 ToleranceType toleranceType;
00224
00226 double specifiedTolerance;
00227
00229 double initialTolerance;
00230
00232 double trueTolerance;
00233
00235 double normF;
00236
00238 NOX::Utils utils;
00239
00240 };
00241
00242 }
00243 }
00244
00245 #endif