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

operator/bilinearForm.hh
Go to the documentation of this file.
00001 /* Bilinear Form
00002  */
00003 
00004 #ifndef BilinearForm_hh
00005 #define BilinearForm_hh
00006 
00007 #include <memory>
00008 #include "basics/outputOperator.hh"
00009 #include "basics/cloneable.hh"
00010 #include "space/elementPairs.hh"
00011 
00012 namespace concepts {
00013 
00014   // forward declaration
00015   template<class F>
00016   class Element;
00017 
00018   template<class F>
00019   class ElementMatrix;
00020 
00021   // ********************************************************** BilinearForm **
00022 
00028   template<class F, class G = typename Realtype<F>::type>
00029     class BilinearForm : public Cloneable, virtual public OutputOperator {
00030       public:
00039         virtual void operator()(const Element<G>& elmX, const Element<G>& elmY,
00040             ElementMatrix<F>& em) = 0;
00053         virtual void operator()(const Element<G>& elmX, const Element<G>& elmY,
00054             ElementMatrix<F>& em, const ElementPair<G>& ep) {
00055           operator()(elmX, elmY, em); }
00056       protected:
00057         virtual std::ostream& info(std::ostream& os) const;
00058     };
00059 
00060   // ****************************************************** BilinearFormLiCo **
00061 
00068   template<class F, class G = typename Realtype<F>::type>
00069     class BilinearFormLiCo : public BilinearForm<F,G> {
00070       public:
00077         BilinearFormLiCo(BilinearForm<F,G>& bfA,
00078             BilinearForm<F,G>& bfB,
00079             const F cA = 1.0, const F cB = 1.0) :
00080           bfAptr_(0), bfBptr_(0),
00081           bfA_(&bfA), bfB_(&bfB), cA_(cA), cB_(cB), em_() {}
00083         BilinearFormLiCo(const BilinearFormLiCo& b);
00084         virtual ~BilinearFormLiCo() {}
00085         virtual void operator()(const Element<G>& elmX,
00086             const Element<G>& elmY, 
00087             ElementMatrix<F>& em);
00088         virtual BilinearFormLiCo<F,G>* clone() const;
00089       protected:
00090         virtual std::ostream& info(std::ostream& os) const;
00091       private:
00092         std::auto_ptr<BilinearForm<F,G> > bfAptr_, bfBptr_;
00094         BilinearForm<F,G>* bfA_, * bfB_;
00096         const F cA_;
00098         const F cB_;
00100         ElementMatrix<F> em_;
00101     };
00102 
00103 } // namespace concepts
00104 
00105 #endif // BilinearForm_hh

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