$extrastylesheet
adaptive_time_solver.h
Go to the documentation of this file.
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_ADAPTIVE_TIME_SOLVER_H
00021 #define LIBMESH_ADAPTIVE_TIME_SOLVER_H
00022 
00023 // Local includes
00024 #include "libmesh/system_norm.h"
00025 #include "libmesh/unsteady_solver.h"
00026 
00027 // C++ includes
00028 
00029 namespace libMesh
00030 {
00031 
00032 // Forward declarations
00033 class System;
00034 
00049 // ------------------------------------------------------------
00050 // Solver class definition
00051 class AdaptiveTimeSolver : public UnsteadySolver
00052 {
00053 public:
00057   typedef UnsteadySolver Parent;
00058 
00063   explicit
00064   AdaptiveTimeSolver (sys_type& s);
00065 
00069   virtual ~AdaptiveTimeSolver ();
00070 
00071   virtual void init();
00072 
00073   virtual void reinit();
00074 
00075   virtual void solve() = 0;
00076 
00077   virtual void advance_timestep();
00078 
00082   virtual Real error_order () const;
00083 
00087   virtual bool element_residual (bool get_jacobian,
00088                                  DiffContext&);
00089 
00093   virtual bool side_residual (bool get_jacobian,
00094                               DiffContext&);
00095 
00099   virtual bool nonlocal_residual (bool get_jacobian,
00100                                   DiffContext&);
00101 
00105   virtual UniquePtr<DiffSolver> &diff_solver();
00106 
00111   virtual UniquePtr<LinearSolver<Number> > &linear_solver();
00112 
00116   UniquePtr<UnsteadySolver> core_time_solver;
00117 
00121   SystemNorm component_norm;
00122 
00129   std::vector<float> component_scale;
00130 
00146   Real target_tolerance;
00147 
00163   Real upper_tolerance;
00164 
00169   Real max_deltat;
00170 
00175   Real min_deltat;
00176 
00183   Real max_growth;
00184 
00199   bool global_tolerance;
00200 
00201 protected:
00202 
00208   Real last_deltat;
00209 
00213   virtual Real calculate_norm(System &, NumericVector<Number> &);
00214 };
00215 
00216 
00217 } // namespace libMesh
00218 
00219 
00220 #endif // LIBMESH_ADAPTIVE_TIME_SOLVER_H