00001 // element for linear FEM in 1D 00002 00003 #ifndef element1DLin_hh 00004 #define element1DLin_hh 00005 00006 #include "element.hh" 00007 #include "geometry/cell1D.hh" 00008 00009 namespace concepts { 00010 // forward declaration 00011 template<typename F> 00012 class ElementGraphics; 00013 } 00014 00015 namespace linearFEM { 00016 // forward declaration 00017 class LineGraphics; 00018 00019 // ****************************************************************** Line ** 00020 00031 class Line : public Element { 00032 public: 00038 Line(const concepts::Edge1d& cell, uint idx[]) : 00039 Element(2, idx), cell_(cell) {} 00046 Line(const concepts::Edge1d& cell, concepts::TColumn<Real>* T0, 00047 concepts::TColumn<Real>* T1 = 0) : 00048 Element(T0, T1), cell_(cell) {} 00049 virtual const concepts::Edge& support() const { return cell_.connector(); } 00050 virtual const concepts::Edge1d& cell() const { return cell_; } 00056 Real shapefct(const uint i, const Real xi) const; 00062 Real shapefctD(const uint i) const; 00063 virtual const concepts::ElementGraphics<Real>* graphics() const; 00064 protected: 00065 virtual std::ostream& info(std::ostream& os) const; 00066 private: 00068 const concepts::Edge1d& cell_; 00069 static std::auto_ptr<LineGraphics> graphics_; 00070 }; 00071 00072 } // namespace linearFEM 00073 00074 #endif // element1DLin_hh