Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

hp2Dedge/function.hh
Go to the documentation of this file.
00001 /* Functions on space with hp edge elements in 2DEDGE
00002  */
00003 
00004 #ifndef hpFunction2dedge_hh
00005 #define hpFunction2dedge_hh
00006 
00007 #include "hp2D/formula.hh"
00008 #include "hp2D/functionBase.hh"
00009 #include "quad.hh"
00010 
00011 namespace hp2Dedge {
00012 
00013   using concepts::Real;
00014   using concepts::Real2d;
00015 
00016   // ***************************************************************** Value **
00017 
00023   template<typename F = Real, typename G = Real,
00024            typename H = typename concepts::Realtype<F>::type>
00025   class Value : public hp2D::ElementFunction<2, F, Quad<H> > {
00026   public:
00027     Value();
00028     Value(const concepts::ElementFormula<G,H>& frm);
00029     virtual Value<F,G,H>* clone() const {
00030       if (f_.get()) return new Value(*f_.get()); 
00031       return new Value();       
00032     }
00033   protected:
00034     virtual std::ostream& info(std::ostream& os) const;
00035   private:
00037     std::auto_ptr<const concepts::ElementFormula<G,H> > f_;
00038     virtual void compute_(const Quad<H>& elm, const concepts::Array<F>& coeff,
00039         concepts::Array<F>& val, const uint i[2]) const;
00040     virtual void compute_(const Quad<H>& elm, const uint j[3],
00041         concepts::Array<F>& val, const uint i[2]) const;
00042     virtual void compute_(const Quad<H>& elm, const concepts::Array<F>& coeff,
00043         concepts::Array<F>& val,
00044         const Real2d& p, const Real t = 0.0) const;
00045   };
00046 
00047   // ******************************************************************* Rot **
00048 
00055   template<typename F = Real, typename G = Real>
00056   class Rot : public  hp2D::ElementFunction<1, F, Quad<G> > {
00057   public:
00058     virtual Rot<F,G>* clone() const { return new Rot(); }
00059   protected:
00060     virtual std::ostream& info(std::ostream& os) const;
00061   private:
00062     virtual void compute_(const Quad<>& elm, const concepts::Array<F>& coeff,
00063         F& val, const uint i[2]) const;
00064     virtual void compute_(const Quad<>& elm, const uint j[3],
00065         F& val, const uint i[2]) const;
00066     virtual void compute_(const Quad<>& elm, const concepts::Array<F>& coeff,
00067         F& val,
00068         const Real2d& p, const Real t = 0.0) const;
00069   };
00070 
00071 } // namespace hp2Dedge
00072 
00073 
00074 #endif // hpRealunction2dedge_hh

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)