$extrastylesheet
00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 00020 #ifndef LIBMESH_CONTINUATION_SYSTEM_H 00021 #define LIBMESH_CONTINUATION_SYSTEM_H 00022 00023 // Local Includes 00024 #include "libmesh/fem_system.h" 00025 00026 // C++ includes 00027 00028 namespace libMesh 00029 { 00030 00031 // Forward Declarations 00032 template <typename T> class LinearSolver; 00033 class NewtonSolver; 00034 00054 class ContinuationSystem : public FEMSystem 00055 { 00056 public: 00061 ContinuationSystem (EquationSystems& es, 00062 const std::string& name, 00063 const unsigned int number); 00064 00068 virtual ~ContinuationSystem (); 00069 00073 typedef ContinuationSystem sys_type; 00074 00078 typedef FEMSystem Parent; 00079 00084 virtual void clear (); 00085 00089 virtual void solve(); 00090 00097 void continuation_solve(); 00098 00103 void advance_arcstep(); 00104 00114 Real* continuation_parameter; 00115 00120 bool quiet; 00121 00127 void set_max_arclength_stepsize(Real maxds) { ds=maxds; ds_current=maxds; } 00128 00133 Real continuation_parameter_tolerance; 00134 00139 Real solution_tolerance; 00140 00146 Real initial_newton_tolerance; 00147 00155 void save_current_solution(); 00156 00160 Real old_continuation_parameter; 00161 00166 Real min_continuation_parameter; 00167 00173 Real max_continuation_parameter; 00174 00180 Real Theta; 00181 00187 Real Theta_LOCA; 00188 00194 //Real tau; 00195 00201 unsigned int n_backtrack_steps; 00202 00208 unsigned int n_arclength_reductions; 00209 00213 Real ds_min; 00214 00220 enum Predictor { 00224 Euler, 00225 00229 AB2, 00230 00234 Invalid_Predictor 00235 }; 00236 00237 Predictor predictor; 00238 00246 Real newton_stepgrowth_aggressiveness; 00247 00255 bool newton_progress_check; 00256 00257 protected: 00262 virtual void init_data (); 00263 00285 enum RHS_Mode {Residual, 00286 G_Lambda}; 00287 00288 RHS_Mode rhs_mode; 00289 00290 00291 00292 private: 00299 void initialize_tangent(); 00300 00304 void solve_tangent(); 00305 00311 void update_solution(); 00312 00316 void set_Theta(); 00317 00322 void set_Theta_LOCA(); 00323 00328 void apply_predictor(); 00329 00337 NumericVector<Number>* du_ds; 00338 00342 NumericVector<Number>* previous_du_ds; 00343 00347 NumericVector<Number>* previous_u; 00348 00352 NumericVector<Number>* y; 00353 00358 NumericVector<Number>* y_old; 00359 00363 NumericVector<Number>* z; 00364 00369 NumericVector<Number>* delta_u; 00370 00376 UniquePtr<LinearSolver<Number> > linear_solver; 00377 00381 bool tangent_initialized; 00382 00388 NewtonSolver* newton_solver; 00389 00395 Real dlambda_ds; 00396 00402 Real ds; 00403 00408 Real ds_current; 00409 00413 Real previous_dlambda_ds; 00414 00418 Real previous_ds; 00419 00423 unsigned int newton_step; 00424 }; 00425 00426 } // namespace libMesh 00427 00428 #endif // LIBMESH_CONTINUATION_SYSTEM_H