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

linDG3D/bilinearForm.hh
Go to the documentation of this file.
00001 /* Classes for DG bilinear forms
00002  */
00003 
00004 #ifndef dgBilinearForms_hh
00005 #define dgBilinearForms_hh
00006 
00007 #include "basics/typedefs.hh"
00008 #include "elementPair.hh"
00009 #include "operator/bilinearForm.hh"
00010 #include "operator/matrix.hh"
00011 
00012 #define DEBUG_ASSEMBLY 0
00013 #define DEBUG_IDENTITY 0
00014 #define DEBUG_LAPLACE 0
00015 
00016 namespace linDG3D {
00017 
00018   using concepts::Real;
00019   // ***************************************************** FvdgBilinearForm  **
00020   
00024   class FvdgBilinearForm {
00025   public:
00035     virtual void operator()(const FvdgElement& elmX, const FvdgElement& elmY,
00036           concepts::ElementMatrix<Real>& em,
00037           const FvdgElementPair& ep) = 0;
00038   };
00039   
00040 
00041   // ************************************************************** Assembly **
00042 
00046   class Assembly
00047   {
00048   public:
00057     static void inner(concepts::Matrix<Real>& dest,
00058           FvdgBilinearForm& bf,
00059           const concepts::ElementPairList<Real>& pairs,
00060           bool transpose = false);
00069     static void boundary(concepts::Matrix<Real>& dest,
00070        FvdgBilinearForm& bf,
00071        const concepts::ElementPairList<Real>& pairs,
00072        bool transpose = false);
00073   private:
00075     Assembly() {};
00076   };
00077   
00078   // ************************************************************** Identity **
00084   class Identity : public concepts::BilinearForm<Real> {
00085   public:
00086     Identity() {}
00088     virtual void operator()(const concepts::Element<Real>& elmX,
00089           const concepts::Element<Real>& elmY,
00090           concepts::ElementMatrix<Real>& em);
00092     void operator()(const FvdgP0TetElem& eX,
00093         const FvdgP0TetElem& eY,
00094         concepts::ElementMatrix<Real>& em);
00096     void operator()(const FvdgP1TetElem& eX,
00097         const FvdgP1TetElem& eY,
00098         concepts::ElementMatrix<Real>& em);
00099     virtual Identity* clone() const { return new Identity(); }
00100   };
00101   
00102   //*********************************************************** LaplaceVolBF **
00108   class LaplaceVolBF : public concepts::BilinearForm<Real> {
00109   public:
00110     LaplaceVolBF() {}
00112     virtual void operator()(const concepts::Element<Real>& elmX,
00113           const concepts::Element<Real>& elmY,
00114           concepts::ElementMatrix<Real>& em);
00116     void operator()(const FvdgP1TetElem& eX,
00117         const FvdgP1TetElem& eY,
00118         concepts::ElementMatrix<Real>& em);
00119     virtual LaplaceVolBF* clone() const { return new LaplaceVolBF(); }
00120   };
00121   
00122   //********************************************************* LaplaceInnerBF **
00128   class LaplaceInnerBF : public FvdgBilinearForm {
00129   public:
00134     LaplaceInnerBF(bool symm = false) { symm_ = symm ? -1 : 1; }
00136     virtual void operator()(const FvdgElement& elmX, const FvdgElement& elmY,
00137           concepts::ElementMatrix<Real>& em,
00138           const FvdgElementPair& ep);
00139     virtual LaplaceInnerBF* clone() const { return new LaplaceInnerBF(symm_); }
00140   private:
00142     int symm_;
00143   };
00144 
00145   //****************************************************** LaplaceBoundaryBF **
00151   class LaplaceBoundaryBF : public FvdgBilinearForm {
00152   public:
00157     LaplaceBoundaryBF(bool symm = false) {
00158       symm_ = symm ? -1 : 1;
00159     }
00161     virtual void operator()(const FvdgElement& elmX, const FvdgElement& elmY,
00162           concepts::ElementMatrix<Real>& em,
00163           const FvdgElementPair& ep);
00164     virtual LaplaceBoundaryBF* clone() const {
00165       return new LaplaceBoundaryBF(symm_); }
00166   private:
00168     int symm_;
00169   };
00170   
00171   //************************************************************** PenaltyBF **
00177   class PenaltyBF : public FvdgBilinearForm {
00178   public:
00180     PenaltyBF() {}
00182     virtual void operator()(const FvdgElement& elmX, const FvdgElement& elmY,
00183           concepts::ElementMatrix<Real>& em,
00184           const FvdgElementPair& ep);
00185     virtual PenaltyBF* clone() const { return new PenaltyBF(); }
00186   };
00187   
00188 } // namespace linDG3D
00189 
00190 #endif // dgBilinearForms_hh

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