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

Heat.h

Go to the documentation of this file.
00001 // Copyright (C) 2002 Johan Hoffman and Anders Logg.
00002 // Licensed under the GNU GPL Version 2.
00003 
00004 #ifndef __HEAT_H
00005 #define __HEAT_H
00006 
00007 #include <dolfin/PDE.h>
00008 
00009 namespace dolfin {
00010   
00011   class Heat : public PDE {
00012   public:
00013     
00014     Heat(Function& source,
00015          Function& previous,
00016          Function& diffusion) : PDE(3)
00017     {
00018       add(f,  source);
00019       add(up, previous);
00020       add(a,  diffusion);
00021     }
00022     
00023     real lhs(const ShapeFunction& u, const ShapeFunction& v)
00024     {
00025       return (u*v + a*(grad(u),grad(v))) * dx;
00026     }
00027     
00028     real rhs(const ShapeFunction& v)
00029     {
00030       return (up*v + k*f*v) * dx;
00031     }
00032     
00033   private:    
00034 
00035     ElementFunction f;         // Source term
00036     ElementFunction up;        // Function value at left end-point
00037     ElementFunction a;         // Diffusivity
00038 
00039   };
00040 
00041 }
00042 
00043 #endif


Documentation automatically generated with Doxygen on 10 Sep 2004.