SyFi
0.3
|
00001 // Copyright (C) 2006-2009 Kent-Andre Mardal and Simula Research Laboratory 00002 // 00003 // This file is part of SyFi. 00004 // 00005 // SyFi is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation, either version 2 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // SyFi is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with SyFi. If not, see <http://www.gnu.org/licenses/>. 00017 00018 #ifndef MIXED_FE_IS_INCLUDED 00019 #define MIXED_FE_IS_INCLUDED 00020 00021 #include "FE.h" 00022 #include <vector> 00023 #include <string> 00024 00025 namespace SyFi 00026 { 00027 00028 // FIXME: what about memory management ??? 00029 // 00030 // FIXME: one assumption when using this MixedFE is that none of the dofs 00031 // in the vector of finite elements have different dofs. This assumption 00032 // is valid for all elements I know of. 00033 // If this is not appropriate, we could add an int to the dof, in a 00034 // similar way that it is done with the vector elements. 00035 // The current implementation is more efficient. 00036 // Could do a consistency check. 00037 00038 class MixedFE : public FE 00039 { 00040 std::string description; 00041 public: 00042 std::vector<StandardFE*> mfe; 00043 public: 00044 MixedFE(); 00045 MixedFE(StandardFE* fe1, StandardFE* fe2); 00046 virtual ~MixedFE(); 00047 00048 //FIXME: check that the domain are ok. 00049 // Set polygonal domain 00050 virtual void set_polygon(Polygon& p) 00051 { 00052 } 00053 // Get polygonal domain 00054 virtual Polygon& get_polygon() 00055 { 00056 return (*(mfe[0])).get_polygon(); 00057 } 00058 virtual void compute_basis_functions() { } 00059 00060 StandardFE* get(unsigned int i); 00061 void append(StandardFE* fe); 00062 00063 // The i'th basis function 00064 virtual GiNaC::ex N(unsigned int i); 00065 // The i'th degree of freedom 00066 virtual GiNaC::ex dof(unsigned int i); 00067 // Number of basis functions/degrees of freedom 00068 virtual unsigned int nbf() const; 00069 virtual std::string str(); 00070 00071 }; 00072 00073 } // namespace SyFi 00074 #endif