00001 // bilinear forms for intervalls for the Laplacian and the mass matrix 00002 00003 #ifndef bilinearLinFEM1d_hh 00004 #define bilinearLinFEM1d_hh 00005 00006 #include <memory> 00007 #include "basics/typedefs.hh" 00008 #include "basics/vectorsMatrices.hh" 00009 #include "formula/formula.hh" 00010 #include "operator/bilinearForm.hh" 00011 #include "integration/quadrature.hh" 00012 00013 00014 namespace linearFEM { 00015 00016 using concepts::Real; 00017 00018 class Line; 00019 00020 // ************************************************************* Laplace1d ** 00021 00029 class Laplace1d : public concepts::BilinearForm<Real> { 00030 public: 00031 virtual void operator()(const concepts::Element<Real>& elmX, 00032 const concepts::Element<Real>& elmY, 00033 concepts::ElementMatrix<Real>& em); 00034 virtual Laplace1d* clone() const { return new Laplace1d(); } 00035 }; 00036 00037 // ************************************************************ Identity1d ** 00038 00046 class Identity1d : public concepts::BilinearForm<Real> { 00047 public: 00048 virtual void operator()(const concepts::Element<Real>& elmX, 00049 const concepts::Element<Real>& elmY, 00050 concepts::ElementMatrix<Real>& em); 00051 virtual Identity1d* clone() const { return new Identity1d(); } 00052 }; 00053 00054 // *********************************************************** CIdentity1d ** 00055 00064 class CIdentity1d : public concepts::BilinearForm<Real> { 00065 public: 00070 CIdentity1d(const concepts::Formula<Real>& frm, 00071 const uint gauss_p = 1) : 00072 frm_(frm.clone()), quad_(gauss_p) {} 00073 virtual void operator()(const concepts::Element<Real>& elmX, 00074 const concepts::Element<Real>& elmY, 00075 concepts::ElementMatrix<Real>& em); 00076 virtual CIdentity1d* clone() const { 00077 return new CIdentity1d(*frm_.get(), quad_.n()); } 00078 private: 00080 std::auto_ptr<const concepts::Formula<Real> > frm_; 00082 const concepts::Quadrature<4> quad_; 00083 }; 00084 00085 } // namespace linearFEM 00086 00087 #endif // bilinearLinFEM1d_hh