![]() |
00001 // Copyright (C) 2003 Johan Hoffman and Anders Logg. 00002 // Licensed under the GNU GPL Version 2. 00003 00004 #ifndef __ADAPTIVITY_H 00005 #define __ADAPTIVITY_H 00006 00007 #include <dolfin/NewArray.h> 00008 #include <dolfin/Regulator.h> 00009 00010 namespace dolfin { 00011 00012 class ODE; 00013 class TimeSlab; 00014 class Solution; 00015 class RHS; 00016 00018 00019 class Adaptivity { 00020 public: 00021 00023 Adaptivity(ODE& ode); 00024 00026 ~Adaptivity(); 00027 00029 Regulator& regulator(unsigned int i); 00030 00032 const Regulator& regulator(unsigned int i) const; 00033 00035 real tolerance() const; 00036 00038 real maxstep() const; 00039 00041 real minstep() const; 00042 00044 void stabilize(real k, unsigned int m); 00045 00047 bool fixed() const; 00048 00050 real threshold() const; 00051 00053 unsigned int size() const; 00054 00056 void shift(Solution& u, RHS& f); 00057 00059 bool accept(TimeSlab& timeslab, RHS& f); 00060 00062 void adjustMaximumTimeStep(real kmax); 00063 00064 private: 00065 00066 // Regulators, one for each component 00067 NewArray<Regulator> regulators; 00068 00069 // Tolerance 00070 real TOL; 00071 00072 // Maximum and minimum allowed time step 00073 real kmax; 00074 00075 // Current maximum time step 00076 real kmax_current; 00077 00078 // Flag for fixed time steps 00079 bool kfixed; 00080 00081 // Threshold for reaching end of interval 00082 real beta; 00083 00084 // Remaining number of small time steps 00085 unsigned int m; 00086 00087 }; 00088 00089 } 00090 00091 #endif
![]()
Documentation automatically generated with Doxygen on 10 Sep 2004.