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

FunctionList.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 __FUNCTION_LIST_H
00005 #define __FUNCTION_LIST_H
00006 
00007 #include <dolfin/FunctionPointer.h>
00008 #include <dolfin/Array.h>
00009 #include <dolfin/ShapeFunction.h>
00010 #include <dolfin/ElementFunction.h>
00011 
00012 namespace dolfin {
00013   
00014   class Map;
00015   
00016   class FunctionList {
00017   public:
00018     
00019     FunctionList();
00020     
00021     // Addition of functions
00022     static int add(function f);
00023     
00024     // Specification of derivatives wrt reference coordinates
00025     static void set(int id,
00026                     FunctionSpace::ElementFunction ddX,
00027                     FunctionSpace::ElementFunction ddY,
00028                     FunctionSpace::ElementFunction ddZ,
00029                     FunctionSpace::ElementFunction ddT);
00030     
00031     // Update derivatives with current map
00032     static void update(const FunctionSpace::ShapeFunction& v, const Map& map);
00033          
00034     // Size of list
00035     static unsigned int size();
00036     
00037     // Evaluation
00038     static real eval(int id, real x, real y, real z, real t);
00039     
00040     // Derivatives wrt real coordinates
00041     static const FunctionSpace::ElementFunction& ddx(int id);
00042     static const FunctionSpace::ElementFunction& ddy(int id);
00043     static const FunctionSpace::ElementFunction& ddz(int id);
00044     static const FunctionSpace::ElementFunction& ddt(int id);
00045     
00046     // Derivatives wrt reference coordinates
00047     static const FunctionSpace::ElementFunction& ddX(int id);
00048     static const FunctionSpace::ElementFunction& ddY(int id);
00049     static const FunctionSpace::ElementFunction& ddZ(int id);
00050     static const FunctionSpace::ElementFunction& ddT(int id);
00051     
00052   private:
00053     
00054     class FunctionData {
00055     public:
00056       
00057       FunctionData();
00058       FunctionData(function f);
00059       
00060       // 
00061       void operator= (int zero);
00062       bool operator! () const;
00063       
00064       function f; // Function pointer
00065       
00066       FunctionSpace::ElementFunction ddx; // Derivative wrt dx
00067       FunctionSpace::ElementFunction ddy; // Derivative wrt dy
00068       FunctionSpace::ElementFunction ddz; // Derivative wrt dz
00069       FunctionSpace::ElementFunction ddt; // Derivative wrt dt
00070       
00071       FunctionSpace::ElementFunction ddX; // Derivative wrt dX
00072       FunctionSpace::ElementFunction ddY; // Derivative wrt dY
00073       FunctionSpace::ElementFunction ddZ; // Derivative wrt dZ
00074       FunctionSpace::ElementFunction ddT; // Derivative wrt dT
00075     };
00076     
00077     static void init();
00078     
00079     static Array<FunctionData> list;
00080     static int _size;
00081     static bool initialised;
00082     
00083   };
00084   
00085 }
00086 
00087 #endif


Documentation automatically generated with Doxygen on 10 Sep 2004.