|
Rythmos - Transient Integration for Differential Equations
Version of the Day
|
00001 //@HEADER 00002 // *********************************************************************** 00003 // 00004 // Rythmos Package 00005 // Copyright (2006) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00023 // USA 00024 // Questions? Contact Todd S. Coffey (tscoffe@sandia.gov) 00025 // 00026 // *********************************************************************** 00027 //@HEADER 00028 00029 00030 #ifndef RYTHMOS_TIME_STEP_NONLINEAR_SOLVER_DECL_HPP 00031 #define RYTHMOS_TIME_STEP_NONLINEAR_SOLVER_DECL_HPP 00032 00033 #include "Rythmos_Types.hpp" 00034 #include "Thyra_NonlinearSolverBase.hpp" 00035 00036 namespace Rythmos { 00037 00038 00049 template <class Scalar> 00050 class TimeStepNonlinearSolver : public Thyra::NonlinearSolverBase<Scalar> { 00051 public: 00052 00054 typedef Teuchos::ScalarTraits<Scalar> ST; 00056 typedef typename ST::magnitudeType ScalarMag; 00058 typedef Teuchos::ScalarTraits<ScalarMag> SMT; 00059 00062 00064 TimeStepNonlinearSolver(); 00065 00067 00070 00072 void setParameterList(RCP<ParameterList> const& paramList); 00074 RCP<ParameterList> getNonconstParameterList(); 00076 RCP<ParameterList> unsetParameterList(); 00078 RCP<const ParameterList> getParameterList() const; 00080 RCP<const ParameterList> getValidParameters() const; 00081 00083 00086 00088 void setModel( 00089 const RCP<const Thyra::ModelEvaluator<Scalar> > &model 00090 ); 00092 RCP<const Thyra::ModelEvaluator<Scalar> > getModel() const; 00094 Thyra::SolveStatus<Scalar> solve( 00095 Thyra::VectorBase<Scalar> *x, 00096 const Thyra::SolveCriteria<Scalar> *solveCriteria, 00097 Thyra::VectorBase<Scalar> *delta = NULL 00098 ); 00100 bool supportsCloning() const; 00102 RCP<Thyra::NonlinearSolverBase<Scalar> > 00103 cloneNonlinearSolver() const; 00105 RCP<const Thyra::VectorBase<Scalar> > get_current_x() const; 00107 bool is_W_current() const; 00109 RCP<Thyra::LinearOpWithSolveBase<Scalar> > 00110 get_nonconst_W(const bool forceUpToDate); 00112 RCP<const Thyra::LinearOpWithSolveBase<Scalar> > get_W() const; 00114 void set_W_is_current(bool W_is_current); 00115 00117 00118 private: 00119 00120 // private object data members 00121 00122 RCP<ParameterList> paramList_; 00123 RCP<const Thyra::ModelEvaluator<Scalar> > model_; 00124 RCP<Thyra::LinearOpWithSolveBase<Scalar> > J_; 00125 RCP<Thyra::VectorBase<Scalar> > current_x_; 00126 bool J_is_current_; 00127 00128 double defaultTol_; 00129 int defaultMaxIters_; 00130 double nonlinearSafetyFactor_; 00131 double linearSafetyFactor_; 00132 double RMinFraction_; 00133 bool throwOnLinearSolveFailure_; 00134 00135 // static class data members 00136 00137 static const std::string DefaultTol_name_; 00138 static const double DefaultTol_default_; 00139 00140 static const std::string DefaultMaxIters_name_; 00141 static const int DefaultMaxIters_default_; 00142 00143 static const std::string NonlinearSafetyFactor_name_; 00144 static const double NonlinearSafetyFactor_default_; 00145 00146 static const std::string LinearSafetyFactor_name_; 00147 static const double LinearSafetyFactor_default_; 00148 00149 static const std::string RMinFraction_name_; 00150 static const double RMinFraction_default_; 00151 00152 static const std::string ThrownOnLinearSolveFailure_name_; 00153 static const bool ThrownOnLinearSolveFailure_default_; 00154 00155 }; 00156 00157 00162 template <class Scalar> 00163 RCP<TimeStepNonlinearSolver<Scalar> > timeStepNonlinearSolver(); 00164 00165 00170 template <class Scalar> 00171 RCP<TimeStepNonlinearSolver<Scalar> > 00172 timeStepNonlinearSolver(const RCP<ParameterList> &pl); 00173 00174 } // namespace Rythmos 00175 00176 00177 #endif // RYTHMOS_TIME_STEP_NONLINEAR_SOLVER_DECL_HPP
1.7.6.1