![]() |
00001 // Copyright (C) 2003 Johan Hoffman and Anders Logg. 00002 // Licensed under the GNU GPL Version 2. 00003 00004 #ifndef __SOLUTION_H 00005 #define __SOLUTION_H 00006 00007 #include <fstream> 00008 #include <dolfin/constants.h> 00009 #include <dolfin/Element.h> 00010 #include <dolfin/NewArray.h> 00011 #include <dolfin/Variable.h> 00012 00013 namespace dolfin { 00014 00015 class ODE; 00016 class RHS; 00017 class Function; 00018 class ElementData; 00019 00030 00031 class Solution : public Variable 00032 { 00033 public: 00034 00036 Solution(ODE& ode, Function& u); 00037 00039 ~Solution(); 00040 00042 Element* createElement(Element::Type type, unsigned int q, unsigned int index, real t0, real t1); 00043 00045 Element* element(unsigned int i, real t); 00046 00048 Element* first(unsigned int i); 00049 00051 Element* last(unsigned int i); 00052 00054 real operator() (unsigned int i, unsigned int node, real t); 00055 00057 real u(unsigned int i, real t); 00058 00060 real u(unsigned int i, unsigned int node, real t); 00061 00063 real k(unsigned int i, real t); 00064 00066 real r(unsigned int i, real t, RHS& f); 00067 00069 unsigned int size() const; 00070 00072 Element::Type method(unsigned int i); 00073 00075 unsigned int order(unsigned int i); 00076 00078 void setlast(unsigned int i, real value); 00079 00081 void shift(real t0); 00082 00084 void save(real t0); 00085 00087 void reset(); 00088 00090 enum Action { create = 0, update }; 00091 void debug(Element& element, Action action); 00092 00093 private: 00094 00095 // The ODE 00096 ODE& ode; 00097 00098 // Element data 00099 ElementData& elmdata; 00100 00101 // Initial values (propagated values) 00102 NewArray<real> u0; 00103 00104 // Time where current initial values are specified 00105 real t0; 00106 00107 // Save debug info to file 'timesteps.debug' 00108 bool _debug; 00109 std::ofstream file; 00110 00111 }; 00112 00113 } 00114 00115 #endif
Documentation automatically generated with Doxygen on 10 Sep 2004.