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

models/Maxwell2D_H_eField.hh
Go to the documentation of this file.
00001 /* Element function to get electric field from magnetic field
00002    in translation-symmetric Maxwell's equations
00003 */
00004 
00005 #ifndef Maxwell2D_H_eField_hh
00006 #define Maxwell2D_H_eField_hh
00007 
00008 #include "basics.hh"
00009 #include "geometry/formula.hh"
00010 #include "hp2D/function.hh"
00011 #include "models/maxwellConstants.hh"
00012 
00013 namespace hp2D {
00014 
00015   using concepts::Real;
00016   using concepts::Real2d;
00017   using concepts::Cmplx;
00018 
00019   // ****************************************************** Maxwell2D_eField **
00020 
00025   class Maxwell2D_eField : public hp2D::ElementFunction<2,Cmplx> {
00026   public:
00027     Maxwell2D_eField(const concepts::PiecewiseFormulaBase<Real2d>& J0,
00028          const concepts::PiecewiseFormulaBase<Cmplx>&
00029          iOmegaEps_plus_Sigma_Inv);
00030     Maxwell2D_eField(const concepts::PiecewiseFormulaBase<Real>& J0x,
00031          const concepts::PiecewiseFormulaBase<Real>& J0y,
00032          const concepts::PiecewiseFormulaBase<Cmplx>&
00033          iOmegaEps_plus_Sigma_Inv);
00034     virtual ~Maxwell2D_eField() {}
00035 
00036     virtual Maxwell2D_eField* clone() const {
00037       if (J0_.get())
00038   return new Maxwell2D_eField(*J0_, *iOmegaEps_plus_Sigma_Inv_);
00039       return new Maxwell2D_eField(*J0x_, *J0y_, *iOmegaEps_plus_Sigma_Inv_);
00040     }
00041   protected:
00042     virtual std::ostream& info(std::ostream& os) const;
00043   private:
00044     virtual void compute_(const Quad<>& elm,
00045         const concepts::Array<Cmplx>& coeff,
00046         concepts::Array<Cmplx>& val,
00047         const uint i[2]) const;
00048     virtual void compute_(const Quad<>& elm, const uint j[2],
00049         concepts::Array<Cmplx>& val,
00050         const uint i[2]) const;
00051     virtual void compute_(const Quad<>& elm,
00052         const concepts::Array<Cmplx>& coeff,
00053         concepts::Array<Cmplx>& val,
00054         const Real2d& p, const Real t = 0.0) const;
00056     void convert_(const Quad<>& elm, concepts::Array<Cmplx>& val,
00057       const Real2d& p, const Real t = 0.0) const;
00059     std::auto_ptr<concepts::PiecewiseFormulaBase<Real2d> > J0_;
00061     std::auto_ptr<concepts::PiecewiseFormulaBase<Real> > J0x_;
00062     std::auto_ptr<concepts::PiecewiseFormulaBase<Real> > J0y_;
00064     std::auto_ptr<concepts::PiecewiseFormulaBase<Cmplx> > 
00065       iOmegaEps_plus_Sigma_Inv_ ;
00067     PlCurl<Cmplx> plcurl_;
00068   };
00069 
00070   // ************************************************* Maxwell2D_dissipation **
00071 
00076   class Maxwell2D_dissipation : public ElementFunction<1,Cmplx> {
00077   public:
00078     Maxwell2D_dissipation(const concepts::PiecewiseConstFormula<Real>& sigma,
00079         const Real eps = EPS0, const Real omega = OMEGA50);
00080     virtual ~Maxwell2D_dissipation() {}
00081     virtual Maxwell2D_dissipation* clone() const {
00082       return new Maxwell2D_dissipation(sigma_, eps_, omega_);
00083     }
00084   protected:
00085     virtual std::ostream& info(std::ostream& os) const;
00086   private:
00087     virtual void compute_(const Quad<>& elm,
00088         const concepts::Array<Cmplx>& coeff,
00089         Cmplx& val, const uint i[2]) const;
00090     virtual void compute_(const Quad<>& elm, const uint j[2],
00091         Cmplx& val, const uint i[2]) const;
00092     virtual void compute_(const Quad<>& elm,
00093         const concepts::Array<Cmplx>& coeff, Cmplx& val,
00094         const Real2d& p, const Real t = 0.0) const;
00096     void convert_(const Quad<>& elm, const concepts::Array<Cmplx>& gradh,
00097       Cmplx& val) const;
00099     const concepts::PiecewiseConstFormula<Real>& sigma_;
00101     const Real eps_, omega_;
00103     Grad<Cmplx> grad_;
00104   };
00105 
00106 } // namespace hp2D
00107 
00108 #endif // Maxwell2D_H_eField_hh

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