00001 // space for linear FEM in 1D 00002 00003 #ifndef linSpace1D_hh 00004 #define linSpace1D_hh 00005 00006 #include "element1D.hh" 00007 #include "basics/typedefs.hh" 00008 #include "space/space.hh" 00009 #include "space/element.hh" 00010 #include "toolbox/scannerConnectors.hh" 00011 #include "toolbox/dynArray.hh" 00012 00013 namespace concepts { 00014 00015 // forward declarations 00016 class Mesh1; 00017 class BoundaryConditions; 00018 00019 // ************************************************************** Scanners ** 00020 00021 template<> 00022 class Scan<linearFEM::Line> : public Scan<linearFEM::Element> { 00023 public: 00024 virtual linearFEM::Line& operator++(int) = 0; 00025 }; 00026 00027 } // namespace concepts 00028 00029 namespace linearFEM { 00030 00031 // ************************************************************** Linear1d ** 00032 00036 class Linear1d : public concepts::Space<Real> { 00037 public: 00038 typedef concepts::Scan<Line> Scan; 00039 typedef void (*SMap)(const concepts::TColumn<Real>&, 00040 concepts::TColumn<Real>&); 00046 Linear1d(concepts::Mesh1& msh, uint level, 00047 concepts::BoundaryConditions* bc = 0); 00048 virtual ~Linear1d(); 00049 virtual uint dim() const { return dim_; } 00050 virtual uint nelm() const { return nelm_; } 00051 virtual Scan* scan() const { return new concepts::PListScan<Line>(*elm_); } 00052 protected: 00053 virtual std::ostream& info(std::ostream& os) const; 00054 private: 00056 uint dim_; 00058 uint nelm_; 00060 concepts::Mesh1& msh_; 00062 concepts::BoundaryConditions* bc_; 00064 concepts::Joiner<Line*, 1>* elm_; 00074 void enforceBC_(concepts::Cell1& cell, uint level, 00075 concepts::DynArray<uint>& bcMap); 00087 void constructor_(concepts::Cell1& cell, uint level, 00088 concepts::DynArray<uint>& dofMap, 00089 const concepts::DynArray<uint>& bcMap); 00090 }; 00091 00092 } // namespace linearFEM 00093 00094 #endif // linSpace1D_hh