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

app-bholger/PC_Naiv_Solver.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include <iostream>
00004 #include <memory>
00005 #include <algorithm>
00006 #include <sstream>
00007 #include <unistd.h> // for command line parsing
00008 #include <fstream>
00009 #include <memory>
00010 #include <vector>
00011 #include <fstream>
00012 #include <sstream>
00013 #include <string>
00014 #include <map>
00015 
00016 #include "basics.hh"
00017 #include "basics/outputMatlab.hh"
00018 #include "geometry.hh"
00019 #include "space.hh"
00020 #include "graphics.hh"
00021 #include "toolbox.hh"
00022 #include "function.hh"
00023 #include "operator.hh"
00024 #include "integration.hh"
00025 #include "graphics.hh"
00026 #include "linearFEM.hh"
00027 #include "linDG1D.hh"
00028 #include "hp2D.hh"
00029 #include "toolbox/inputParam.hh"
00030 #include "l2projection.hh"
00031 
00032 typedef std::map<int, double> MID;
00033 
00037 class PC_Naiv_Solver {
00038 public:
00039     enum EquationType {TRANSVERSAL_ELECTRIC, TRANSVERSAL_MAGNETIC};
00040 
00041   PC_Naiv_Solver(const concepts::Space<concepts::Real>& space, 
00042           EquationType type, 
00043           const MID& attrToEpsilon, 
00044           double omega,
00045           const concepts::BoundaryConditions& bc,
00046           concepts::Set<uint> nonRefl_bdAttr
00047           );
00048 
00049   static concepts::PiecewiseConstFormula<concepts::Real> genTMCoeff(
00050           const MID& attToEps);
00051 
00052   static concepts::PiecewiseConstFormula<concepts::Real> genTECoeff(
00053           const MID& attToEps);
00054 
00055   void setRhs(const std::string& rhs_r, const std::string& rhs_i);
00056   //TODO: implement methods taking Formula or ElementFormula instances
00057   
00058   void setNonRefl(concepts::Set<uint> nonRefl_bdAttr, 
00059       std::string u_inc_r, std::string u_inc_i,  
00060       std::string Du_inc_r, std::string Du_inc_i  
00061       );
00062   
00063   void solve(concepts::Vector<concepts::Cmplx>& sol );
00064 
00065   void setOmega(double omega);
00066 
00067   const hp2D::TraceSpace& getTraceSpace() { 
00068     return trace_space;
00069   }
00070 
00071 private:
00072   const concepts::Space<concepts::Real>& space;
00073   hp2D::TraceSpace trace_space;
00074   concepts::BoundaryConditions bc;
00075 
00076   double omega;
00077 
00078   static concepts::PiecewiseConstFormula<concepts::Real> zero_F;
00079   static concepts::PiecewiseConstFormula<concepts::Real> one_F;
00080   static concepts::ParsedFormula one_F2;
00081   concepts::PiecewiseConstFormula<concepts::Real> coeff_TM_F;
00082   concepts::PiecewiseConstFormula<concepts::Real> coeff_TE_F;
00083   hp2D::Laplace<concepts::Real>   lap_BF;
00084   hp2D::Identity<Real>    id_mass_BF;
00085   hp2D::Identity<Real>    id_trace_BF;
00086 
00087   concepts::Vector<concepts::Cmplx> rhs;
00088   concepts::SparseMatrix<concepts::Real> lap_M;
00089   concepts::SparseMatrix<concepts::Real> id_mass_M;
00090   concepts::SparseMatrix<concepts::Real> id_trace_M;
00091 
00092 };

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