00001 /* Coping boundary conditions for hp 2D edgeFEM 00002 */ 00003 00004 #ifndef hp2dEdgeBoundaries_hh 00005 #define hp2dEdgeBoundaries_hh 00006 00007 #include <memory> 00008 #include "basics/typedefs.hh" 00009 #include "function/linearForm.hh" 00010 #include "space.hh" 00011 #include "space/dirichlet.hh" 00012 #include "hp2Dedge/bilinearForm.hh" 00013 #include "hp2Dedge/quad.hh" 00014 00015 00016 namespace concepts { 00017 // forward declarations 00018 template<class F> 00019 class Formula; 00020 00021 class BoundaryConditions; 00022 00023 template<class F> 00024 class Element; 00025 00026 template<class F> 00027 class ElementMatrix; 00028 00029 template<class F> 00030 class Array; 00031 } 00032 00033 namespace hp2Dedge { 00034 // forward declarations 00035 template<class F> 00036 class Quad; 00037 00038 using concepts::Real; 00039 00040 // ************************************************* DirichletCoefficients ** 00041 00046 class DirichletCoefficients : public concepts::Dirichlet<Real> { 00047 public: 00052 DirichletCoefficients(Space& spc); 00053 ~DirichletCoefficients(); 00054 protected: 00055 virtual std::ostream& info(std::ostream& os) const; 00056 }; 00057 00058 // ******************************************************* DirichletRotRot ** 00059 00073 class DirichletRotRot : public concepts::LinearForm<Real> { 00074 public: 00078 DirichletRotRot(DirichletCoefficients* dc = 0); 00079 00080 virtual ~DirichletRotRot(); 00081 00088 void operator()(const concepts::Element<Real>& elm, 00089 concepts::ElementMatrix<Real>& em); 00090 void operator()(const Quad<>& elm, concepts::ElementMatrix<Real>& em); 00091 protected: 00092 virtual std::ostream& info(std::ostream& os) const; 00093 private: 00095 concepts::Array<Real> jacobianReciprocal_, function_; 00096 concepts::Array<Real> tmp_; 00098 DirichletCoefficients* dc_; 00099 }; 00100 00101 // ***************************************************** DirichletIdentity ** 00102 00116 class DirichletIdentity : public concepts::LinearForm<Real> { 00117 public: 00121 DirichletIdentity(DirichletCoefficients* dc = 0); 00122 00123 virtual ~DirichletIdentity(); 00124 00131 void operator()(const concepts::Element<Real>& elm, 00132 concepts::ElementMatrix<Real>& em); 00133 void operator()(const Quad<>& elm, concepts::ElementMatrix<Real>& em); 00134 protected: 00135 virtual std::ostream& info(std::ostream& os) const; 00136 private: 00138 concepts::Array<Real> jacobian_, function_; 00139 concepts::Array<concepts::MapReal2d> jacobianInv_; 00140 concepts::Array<Real> tmp_; 00142 DirichletCoefficients* dc_; 00143 }; 00144 00145 } // namespace hp2Dedge 00146 00147 #endif // hp2dEdgeBoundaries_hh