SyFi 0.3
|
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 MIXED_FE_IS_INCLUDED 00005 #define MIXED_FE_IS_INCLUDED 00006 00007 #include "FE.h" 00008 #include <vector> 00009 #include <string> 00010 00011 namespace SyFi 00012 { 00013 00014 // FIXME: what about memory management ??? 00015 // 00016 // FIXME: one assumption when using this MixedFE is that none of the dofs 00017 // in the vector of finite elements have different dofs. This assumption 00018 // is valid for all elements I know of. 00019 // If this is not appropriate, we could add an int to the dof, in a 00020 // similar way that it is done with the vector elements. 00021 // The current implementation is more efficient. 00022 // Could do a consistency check. 00023 00024 class MixedFE : public FE 00025 { 00026 std::string description; 00027 public: 00028 std::vector<StandardFE*> mfe; 00029 public: 00030 MixedFE(); 00031 MixedFE(StandardFE* fe1, StandardFE* fe2); 00032 virtual ~MixedFE(); 00033 00034 //FIXME: check that the domain are ok. 00035 // Set polygonal domain 00036 virtual void set_polygon(Polygon& p) 00037 { 00038 } 00039 // Get polygonal domain 00040 virtual Polygon& get_polygon() 00041 { 00042 return (*(mfe[0])).get_polygon(); 00043 } 00044 virtual void compute_basis_functions() { } 00045 00046 StandardFE* get(unsigned int i); 00047 void append(StandardFE* fe); 00048 00049 // The i'th basis function 00050 virtual GiNaC::ex N(unsigned int i); 00051 // The i'th degree of freedom 00052 virtual GiNaC::ex dof(unsigned int i); 00053 // Number of basis functions/degrees of freedom 00054 virtual unsigned int nbf() const; 00055 virtual std::string str(); 00056 00057 }; 00058 00059 } // namespace SyFi 00060 #endif