Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

TimeSlab.h

Go to the documentation of this file.
00001 // Copyright (C) 2003 Johan Hoffman and Anders Logg.
00002 // Licensed under the GNU GPL Version 2.
00003 //
00004 // Updates by Johan Jansson 2003
00005 
00006 #ifndef __TIME_SLAB_H
00007 #define __TIME_SLAB_H
00008 
00009 #include <dolfin/dolfin_log.h>
00010 #include <dolfin/constants.h>
00011 #include <dolfin/ElementGroup.h>
00012 
00013 namespace dolfin {
00014 
00015   class Element;
00016   class Partition;
00017   class Adaptivity;
00018   class RHS;
00019   class Solution;
00020 
00023 
00024   class TimeSlab {
00025   public:
00026 
00028     TimeSlab(real t0, real t1);
00029 
00031     virtual ~TimeSlab();
00032 
00034     bool within(real t) const;
00035     
00037     bool finished() const;
00038     
00040     real starttime() const;
00041     
00043     real endtime() const;
00044     
00046     real length() const;
00047 
00049     virtual bool accept(RHS& f, real TOL) = 0;
00050 
00052     virtual void countElementGroups(unsigned int& size) = 0;
00053     
00055     virtual void addElementGroups(NewArray<ElementGroup*>& groups, unsigned int& pos) = 0;
00056 
00058 
00060     virtual void show(unsigned int depth = 0) const = 0;
00061 
00063     friend LogStream& operator<<(LogStream& stream, const TimeSlab& timeslab);
00064 
00065   protected:
00066     
00067     // Specify and adjust the time step
00068     void setsize(real K, const Adaptivity& adaptivity);
00069 
00070     //--- Time slab data ---
00071 
00072     // Start and end time for time slab
00073     real t0;
00074     real t1;
00075 
00076     // True if we reached the given end time
00077     bool reached_endtime;
00078 
00079     // Element group contained in this time slab
00080     ElementGroup group;
00081 
00082   };
00083 
00084 }
00085 
00086 #endif


Documentation automatically generated with Doxygen on 10 Sep 2004.