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

ODE.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 #ifndef __ODE_H
00005 #define __ODE_H
00006 
00007 #include <dolfin/constants.h>
00008 #include <dolfin/Element.h>
00009 #include <dolfin/Sparsity.h>
00010 #include <dolfin/Sample.h>
00011 #include <dolfin/RHS.h>
00012 #include <dolfin/Function.h>
00013 #include <dolfin/Solution.h>
00014 #include <dolfin/Adaptivity.h>
00015 
00016 namespace dolfin
00017 {
00018   class Vector;
00019   class Function;
00020 
00028 
00029   class ODE
00030   {
00031   public:
00032     
00034     ODE(unsigned int N);
00035     
00037     virtual ~ODE();
00038 
00040     virtual real u0(unsigned int i) = 0;
00041 
00043     virtual real f(const Vector& u, real t, unsigned int i) = 0;
00044 
00046     virtual Element::Type method(unsigned int i);
00047 
00049     virtual unsigned int order(unsigned int i);
00050 
00052     virtual real timestep(unsigned int i);
00053 
00055     virtual void update(RHS& f, Function& u, real t);
00056 
00058     virtual void update(Solution& u, Adaptivity& adaptivity, real t);
00059 
00061     virtual void save(Sample& sample);
00062 
00064     unsigned int size() const;
00065 
00067     real endtime() const;
00068 
00070     void solve();
00071 
00073     void solve(Function& u);
00074 
00076     void solve(Function& u, Function& phi);
00077     
00079     void sparse();
00080 
00082     void sparse(const Matrix& A);
00083 
00085     friend class Dual;
00086     friend class RHS;
00087     friend class ReducedModel;
00088 
00089   protected:
00090     
00091     // Number of components
00092     unsigned int N;
00093     
00094     // Final time
00095     real T;
00096     
00097     // Sparsity
00098     Sparsity sparsity;
00099 
00100   private:
00101 
00102     Element::Type default_method;
00103     unsigned int default_order;
00104     real default_timestep;
00105 
00106   };
00107 
00108 }
00109 
00110 #endif


Documentation automatically generated with Doxygen on 10 Sep 2004.