00001 // $Id: NOX_Solver_TrustRegionBased.H,v 1.28 2007/08/09 22:51:14 rppawlo Exp $ 00002 // $Source: /space/CVS/Trilinos/packages/nox/src/NOX_Solver_TrustRegionBased.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_Solver_TrustRegionBased.H,v $ 00036 // $Author: rppawlo $ 00037 // $Date: 2007/08/09 22:51:14 $ 00038 // $Revision: 1.28 $ 00039 // ************************************************************************ 00040 //@HEADER 00041 00042 #ifndef NOX_SOLVER_TRUSTREGIONBASED_H 00043 #define NOX_SOLVER_TRUSTREGIONBASED_H 00044 00045 #include "NOX_Solver_Generic.H" // base class 00046 #include "Teuchos_ParameterList.hpp" // class data element 00047 #include "NOX_Utils.H" // class data element 00048 #include "NOX_Solver_PrePostOperator.H" // class data element 00049 00050 // Forward declaration 00051 namespace NOX { 00052 class GlobalData; 00053 namespace MeritFunction { 00054 class Generic; 00055 } 00056 namespace Direction { 00057 class Generic; 00058 } 00059 } 00060 00061 namespace NOX { 00062 namespace Solver { 00063 00239 class TrustRegionBased : public Generic { 00240 00241 public: 00242 00248 TrustRegionBased(const Teuchos::RCP<NOX::Abstract::Group>& grp, 00249 const Teuchos::RCP<NOX::StatusTest::Generic>& tests, 00250 const Teuchos::RCP<Teuchos::ParameterList>& params); 00251 00253 virtual ~TrustRegionBased(); 00254 00255 virtual void reset(const NOX::Abstract::Vector& initialGuess, 00256 const Teuchos::RCP<NOX::StatusTest::Generic>& tests); 00257 virtual void reset(const NOX::Abstract::Vector& initialGuess); 00258 virtual NOX::StatusTest::StatusType getStatus(); 00259 virtual NOX::StatusTest::StatusType step(); 00260 virtual NOX::StatusTest::StatusType solve(); 00261 virtual const NOX::Abstract::Group& getSolutionGroup() const; 00262 virtual const NOX::Abstract::Group& getPreviousSolutionGroup() const; 00263 virtual int getNumIterations() const; 00264 virtual const Teuchos::ParameterList& getList() const; 00265 00266 protected: 00267 00269 virtual void init(); 00270 00272 virtual void invalid(const string& param, double value) const; 00273 00275 virtual void printUpdate(); 00276 00277 protected: 00278 00280 Teuchos::RCP<NOX::GlobalData> globalDataPtr; 00281 00283 Teuchos::RCP<NOX::Utils> utilsPtr; 00284 00286 Teuchos::RCP<NOX::Abstract::Group> solnPtr; 00287 00289 00291 Teuchos::RCP<NOX::Abstract::Group> oldSolnPtr; 00292 00294 00296 Teuchos::RCP<NOX::Abstract::Vector> newtonVecPtr; 00297 00299 00301 Teuchos::RCP<NOX::Abstract::Vector> cauchyVecPtr; 00302 00304 00306 Teuchos::RCP<NOX::Abstract::Vector> aVecPtr; 00307 00309 00311 Teuchos::RCP<NOX::Abstract::Vector> bVecPtr; 00312 00314 Teuchos::RCP<NOX::StatusTest::Generic> testPtr; 00315 00317 NOX::StatusTest::CheckType checkType; 00318 00320 Teuchos::RCP<Teuchos::ParameterList> paramsPtr; 00321 00323 Teuchos::RCP<NOX::Direction::Generic> newtonPtr; 00324 00326 Teuchos::RCP<NOX::Direction::Generic> cauchyPtr; 00327 00329 double radius; 00330 00332 double minRatio; 00333 00335 double minRadius; 00336 00338 double maxRadius; 00339 00341 double contractTriggerRatio; 00342 00344 double expandTriggerRatio; 00345 00347 double expandFactor; 00348 00350 double contractFactor; 00351 00354 double recoveryStep; 00355 00357 double newF; 00359 double oldF; 00360 00362 double dx; 00363 00365 int nIter; 00366 00368 NOX::StatusTest::StatusType status; 00369 00371 enum StepType 00372 { 00374 Newton, 00376 Cauchy, 00378 Dogleg 00379 }; 00380 00382 StepType stepType; 00383 00385 Teuchos::RCP<NOX::MeritFunction::Generic> meritFuncPtr; 00386 00388 bool useAredPredRatio; 00389 00391 NOX::Solver::PrePostOperator prePostOperator; 00392 00393 }; 00394 } // namespace Solver 00395 } // namespace NOX 00396 00397 #endif 00398