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

app-bholger/gfem/gfemIdentity.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include "formula/formula.hh"
00004 #include "operator/bilinearForm.hh"
00005 #include "hp2D/bf_identity.hh"
00006 #include "gfemQuad.h"
00007 #include "gfemQuadFast.h"
00008 
00009 namespace concepts {
00010 namespace gfem {
00011 
00012 class GfemIdentity : public hp2D::Identity<Cmplx>
00013 {
00014 public:
00015     typedef concepts::RCP<const concepts::ElementFormula<Cmplx> >
00016       ElementFormulaRCP;
00017 
00022     GfemIdentity(ElementFormulaRCP formula) 
00023       : hp2D::Identity<Cmplx>(formula)
00024     { }
00025 
00026     GfemIdentity(const GfemIdentity& other)
00027       : hp2D::Identity<Cmplx>(other)
00028     { }
00029 
00030 
00031     virtual GfemIdentity* clone() const { 
00032       return new GfemIdentity(*this);
00033     }
00034 
00035     virtual void operator()(
00036           const concepts::Element<Real>& elmX,
00037           const concepts::Element<Real>& elmY, 
00038           concepts::ElementMatrix<Cmplx>& em); 
00039 
00040       void operator()(
00041           const GfemQuad& elmX, 
00042           const GfemQuad& elmY, 
00043           concepts::ElementMatrix<Cmplx>& em);
00044 
00045       void operator()(
00046           const GfemQuadFast& elmX, 
00047           const GfemQuadFast& elmY, 
00048           concepts::ElementMatrix<Cmplx>& em);
00049 
00051       void computeEM_reference(
00052           const GfemQuadFast& elmX, 
00053           const GfemQuadFast& elmY, 
00054           concepts::ElementMatrix<Cmplx>& em);
00055 
00056     virtual ~GfemIdentity() {}
00057 
00058 protected:
00059     virtual std::ostream& info(std::ostream& os) const;
00060 
00061 protected:
00062     void allocHelpers(const GfemDofIteratorFast& itBeg);
00063     void fillHelpers(const GfemQuadFast& elm1);
00064 
00065     Cmplx& getH4(int ikappa1, int ikappa2, int imic1, int imic2) {
00066       assert(ikappa1 <  nKappa[0]);
00067       assert(ikappa2 <  nKappa[1]);
00068       assert(imic1 <  nMic);
00069       assert(imic2 <  nMic);
00070       return H4[ikappa1 + (ikappa2 + (imic1 + imic2 * nMic) * nKappa[1] ) * nKappa[0]];
00071     }
00072 
00073     Cmplx& getH2(int ikappa1, int imac2, int jmac2, int imic1, int imic2) {
00074       assert(ikappa1 <  nKappa[0]);
00075       assert(imac2 <  nMacro[1]);
00076       assert(jmac2 <  nMacro[1]);
00077       assert(imic1 <  nMic);
00078       assert(imic2 <  nMic);
00079       return H2[ikappa1 + (imac2 + (jmac2 + (imic1 + imic2 * nMic) 
00080                         * nMacro[1]) * nMacro[1] ) * nKappa[0]];
00081     }
00082 
00083     Cmplx& getH1(int nu1, int jmac1, int imac2, int jmac2, int imic1, int imic2) {
00084       assert(nu1 <  nMacro[0]);
00085       assert(jmac1 <  nMacro[0]);
00086       assert(imac2 <  nMacro[1]);
00087       assert(jmac2 <  nMacro[1]);
00088       assert(imic1 <  nMic);
00089       assert(imic2 <  nMic);
00090       return H1[nu1 + (jmac1 + (imac2 + (jmac2 + (imic1 + imic2 * nMic) 
00091                         * nMacro[1]) * nMacro[1] ) * nMacro[1]) * nMacro[1] ];
00092     }
00093 
00094 protected:
00095     int nMic;
00096     int pMacro[2];
00097     int nMacro[2]; // = pMacro + 1
00098     int nKappa[2]; // = 2*pMacro + 1
00099 
00100     Cmplx* H4;
00101     Cmplx* H2;
00102     Cmplx* H1;
00103 };
00104 
00105 } // namespace
00106 } // namespace

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