SyFi 0.3
FE.h
Go to the documentation of this file.
00001 // Copyright (C) 2006-2009 Kent-Andre Mardal and Simula Research Laboratory.
00002 // Licensed under the GNU GPL Version 2, or (at your option) any later version.
00003 
00004 #ifndef FE_IS_INCLUDED
00005 #define FE_IS_INCLUDED
00006 
00007 #include <string>
00008 #include "Polygon.h"
00009 
00010 namespace SyFi
00011 {
00012 
00013         class FE
00014         {
00015                 public:
00016                         FE() {}
00017                         virtual ~FE() {}
00018 
00019                                                                  // Set polygonal domain
00020                         virtual void set_polygon(Polygon& p) = 0;
00021                                                                  // Get polygonal domain
00022                         virtual Polygon& get_polygon() = 0;
00023 
00024                                                                  // precompute basis functions
00025                         virtual void compute_basis_functions() = 0;
00026                                                                  // Number of basis functions/ degrees of freedom
00027                         virtual unsigned int nbf() const = 0;
00028                                                                  // The i'th basis function
00029                         virtual GiNaC::ex N(unsigned int i) = 0;
00030                                                                  // The i'th degree of freedom
00031                         virtual GiNaC::ex dof(unsigned int i) = 0 ;
00032                         virtual std::string str() = 0;
00033         };
00034 
00035         class StandardFE : public FE
00036         {
00037                 protected:
00038                         GiNaC::exvector  Ns;
00039                         GiNaC::exvector  dofs;
00040                         Polygon* p;
00041                         unsigned int order;
00042                         std::string description;
00043 
00044                 public:
00045                         StandardFE();
00046                         StandardFE(Polygon& p, unsigned int order);
00047                         virtual ~StandardFE();
00048 
00049                         virtual void set_order(unsigned int order);
00050                         virtual unsigned int  get_order();
00051 
00052                         virtual void set_polygon(Polygon& p);
00053                         virtual Polygon& get_polygon();
00054 
00055                         virtual void compute_basis_functions();
00056                         virtual unsigned int nbf() const;
00057                         virtual GiNaC::ex N(unsigned int i);
00058                         virtual GiNaC::ex dof(unsigned int i);
00059                         virtual std::string str();
00060         };
00061 }
00062 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines