Go to the documentation of this file.00001
00006 #ifndef Maxwell2D_hh
00007 #define Maxwell2D_hh
00008
00009 #include <set>
00010 #include "basics/typedefs.hh"
00011 #include "geometry/mesh.hh"
00012 #include "space/formula.hh"
00013 #include "formula/formula.hh"
00014 #include "operator/sparseMatrix.hh"
00015 #include "hp2D/bf_identity.hh"
00016 #include "hp2D/bf_laplace.hh"
00017 #include "hp2D/linearForm.hh"
00018 #include "maxwellConstants.hh"
00019 #include "Eddy2D_geometries.hh"
00020 #include "Models.hh"
00021
00022 namespace hp2D {
00023
00024 using concepts::Real;
00025 using concepts::Cmplx;
00026
00027 class InputMaxwell2D_H;
00028
00029
00030
00036 class Maxwell2D_H : public Models<Cmplx> {
00037 public:
00038 enum solverType { SUPERLU = 0, SUPERLU2 = 1, BICGSTAB = 2, BICGSTAB2 = 3,
00039 BICGSTABSUPERLU = 4};
00040
00041 Maxwell2D_H(concepts::EddyGeometry2D& geom,
00042 enum solverType type = SUPERLU, bool diagPrecond = true,
00043 bool afterIter = false,
00044 const Real eps = EPS0, const Real omega = OMEGA50,
00045 const Real mu = MU0);
00046 Maxwell2D_H(concepts::EddyGeometry2D& geom, InputMaxwell2D_H& input);
00047 virtual ~Maxwell2D_H();
00049 Real dissipation();
00051 Real magnEnergy();
00056 virtual void graphicsOut(const uint numPoints,
00057 const std::string path = "");
00058 protected:
00059 virtual std::ostream& info(std::ostream& os) const;
00061 virtual concepts::Mesh2& mesh_() { return geom_.mesh(); }
00063 virtual const std::string mshAbbr_() { return geom_.meshAbbreviation(); }
00064 private:
00066 void constructor_();
00068 concepts::EddyGeometry2D& geom_;
00070 enum solverType type_;
00072 bool diagPrecond_;
00074 bool afterIter_;
00079 bool statusAfterIter_;
00081 std::auto_ptr<concepts::SparseMatrix<Cmplx> > A_;
00083 std::auto_ptr<concepts::SparseMatrix<Real> > M_;
00085 std::auto_ptr<concepts::SparseMatrix<Cmplx> > S_;
00086
00087 std::auto_ptr<concepts::Vector<Cmplx> > rhs_;
00091 concepts::Vector<Cmplx>* rhsScaled_;
00093 std::auto_ptr<concepts::Vector<Cmplx> > residual_;
00095 std::auto_ptr<Real> residualNorm_;
00097 concepts::PiecewiseFormulaFun<Cmplx, Real> iOmegaEps_plus_Sigma_Inv_;
00099 const Real eps_;
00101 const Real omega_;
00103 const Real mu_;
00105 virtual void solve_();
00107 virtual void matrices_();
00109 void laplaceMatrix_();
00111 void identityMatrix_();
00113 void systemMatrix_();
00115 void linearform_();
00117 virtual void dataOut_();
00119 std::auto_ptr<Real> dissipation_;
00121 std::auto_ptr<Real> magnEnergy_;
00122 };
00123
00124
00125
00126
00131 class InputMaxwell2D_H : public concepts::InputParameter {
00132 public:
00134 InputMaxwell2D_H(concepts::InOutParameters& input);
00138 virtual std::ostream& letters(std::ostream& os) const;
00140 virtual std::ostream& arguments(std::ostream& os) const;
00142 virtual std::ostream& description(std::ostream& os) const;
00147 virtual int input(int opt, const char* optarg);
00149 enum Maxwell2D_H::solverType type() const { return type_; }
00151 bool solving() const { return solving_; }
00152 protected:
00153 virtual std::ostream& info(std::ostream& os) const;
00154 private:
00155 enum Maxwell2D_H::solverType type_;
00157 bool solving_;
00158 };
00159
00160 }
00161
00162 #endif // Maxwell2D_hh