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

app-bholger/gfem/gfemAdvectionIgnore.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include "formula/elementFormula.hh"
00004 #include "operator/bilinearForm.hh"
00005 #include "gfemQuad.h"
00006 #include "gfemQuadFast.h"
00007 #include "riesz.h"
00008 
00009 namespace concepts {
00010 namespace gfem {
00011 
00012 class GfemAdvectionIgnore : public hp2D::Advection<Cmplx> 
00013 {
00014 public:
00015     typedef concepts::RCP<const concepts::ElementFormula<Cmplx> >
00016       ElementFormulaRCP;
00017 
00018     typedef concepts::RCP<const concepts::ElementFormula<Point< Cmplx, 2 > > >
00019       ElementFormulaPoint2dRCP;
00020 
00021     GfemAdvectionIgnore(ElementFormulaRCP frm1, 
00022         ElementFormulaRCP frm2)
00023       : hp2D::Advection<Cmplx>(frm1, frm2, false)
00024     { }
00025 
00026     GfemAdvectionIgnore(ElementFormulaPoint2dRCP frm)
00027       : hp2D::Advection<Cmplx>(frm, false)
00028     { }
00029 
00030     virtual GfemAdvectionIgnore* clone() const { 
00031       return new GfemAdvectionIgnore(this->frm_);
00032     }
00033 
00034     virtual void operator()(
00035           const concepts::Element<Real>& elmX,
00036           const concepts::Element<Real>& elmY,
00037           concepts::ElementMatrix<Cmplx>& em) 
00038     {
00039       const hp2D::Quad<Real>* elmYH = dynamic_cast<const hp2D::Quad<Real>* >(&elmY);
00040       const hp2D::Quad<Real>* elmXH = dynamic_cast<const hp2D::Quad<Real>* >(&elmX);
00041       if (elmYH && elmXH) { 
00042         hp2D::Advection<Cmplx>::operator()(*elmXH, *elmYH, em);              
00043         return;
00044       }
00045 
00046       // FIXME: this should not be necessary ... change concepts
00047       uint n = elmX.T().m();
00048       uint m = elmX.T().m();
00049       em.resize(n, m);
00050       em.zeros();
00051 
00052       // simply ignore all non-quad elements
00053       return;
00054     } 
00055 
00056     virtual ~GfemAdvectionIgnore() {}
00057 };
00058 
00059 } // namespace
00060 } // namespace

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