00001 // $Id: NOX_StatusTest_NormUpdate.H,v 1.17 2007/06/21 16:22:46 rhoope Exp $ 00002 // $Source: /space/CVS/Trilinos/packages/nox/src/NOX_StatusTest_NormUpdate.H,v $ 00003 00004 //@HEADER 00005 // ************************************************************************ 00006 // 00007 // NOX: An Object-Oriented Nonlinear Solver Package 00008 // Copyright (2002) Sandia Corporation 00009 // 00010 // LOCA: Library of Continuation Algorithms Package 00011 // Copyright (2005) Sandia Corporation 00012 // 00013 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00014 // license for use of this work by or on behalf of the U.S. Government. 00015 // 00016 // This library is free software; you can redistribute it and/or modify 00017 // it under the terms of the GNU Lesser General Public License as 00018 // published by the Free Software Foundation; either version 2.1 of the 00019 // License, or (at your option) any later version. 00020 // 00021 // This library is distributed in the hope that it will be useful, but 00022 // WITHOUT ANY WARRANTY; without even the implied warranty of 00023 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00024 // Lesser General Public License for more details. 00025 // 00026 // You should have received a copy of the GNU Lesser General Public 00027 // License along with this library; if not, write to the Free Software 00028 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00029 // USA 00030 // 00031 // Questions? Contact Roger Pawlowski (rppawlo@sandia.gov) or 00032 // Eric Phipps (etphipp@sandia.gov), Sandia National Laboratories. 00033 // ************************************************************************ 00034 // CVS Information 00035 // $Source: /space/CVS/Trilinos/packages/nox/src/NOX_StatusTest_NormUpdate.H,v $ 00036 // $Author: rhoope $ 00037 // $Date: 2007/06/21 16:22:46 $ 00038 // $Revision: 1.17 $ 00039 // ************************************************************************ 00040 //@HEADER 00041 00042 #ifndef NOX_STATUSTEST_NORM_UPDATE_H 00043 #define NOX_STATUSTEST_NORM_UPDATE_H 00044 00045 #include "NOX_StatusTest_Generic.H" // base class 00046 #include "NOX_Abstract_Vector.H" // for NormType 00047 #include "Teuchos_RCP.hpp" 00048 00049 // Forward declaration 00050 namespace NOX { 00051 namespace Abstract { 00052 class Group; 00053 } 00054 } 00055 00056 namespace NOX { 00057 00058 namespace StatusTest { 00059 00110 /* 00111 NOTE: If no iterations have been performed, then there is no 00112 information for\f$ x_{k-1} \f$. If the test is called while the 00113 number of iterations is zero (i.e. before an iteration takes place), 00114 the code returns the status test as Unconverged and sets the value 00115 to -1.0. Once an iteration has taken place the Norm of the update 00116 is calculated as above. 00117 00118 */ 00119 class NormUpdate : public Generic { 00120 00121 public: 00122 00124 enum ScaleType { 00126 Unscaled, 00128 Scaled 00129 }; 00130 00132 00133 NormUpdate(double tolerance, NOX::Abstract::Vector::NormType ntype, ScaleType stype = Scaled); 00134 00136 00137 NormUpdate(double tolerance, ScaleType stype = Scaled); 00138 00140 virtual ~NormUpdate(); 00141 00142 virtual NOX::StatusTest::StatusType 00143 checkStatus(const NOX::Solver::Generic& problem, 00144 NOX::StatusTest::CheckType checkType); 00145 00146 virtual NOX::StatusTest::StatusType getStatus() const; 00147 00148 virtual ostream& print(ostream& stream, int indent = 0) const; 00149 00150 /* @name Accessor Functions 00151 Used to query current values of variables in the status test. 00152 */ 00154 00156 virtual double getNormUpdate() const; 00157 00159 virtual double getTolerance() const; 00160 00162 00163 private: 00164 00166 NOX::StatusTest::StatusType status; 00167 00169 Teuchos::RCP<NOX::Abstract::Vector> updateVectorPtr; 00170 00172 NOX::Abstract::Vector::NormType normType; 00173 00175 ScaleType scaleType; 00176 00178 double tolerance; 00179 00181 double normUpdate; 00182 00183 }; 00184 00185 } // namespace Status 00186 } // namespace NOX 00187 00188 #endif