Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef QCAD_GREENSFUNCTIONTUNNELING_HPP
00019 #define QCAD_GREENSFUNCTIONTUNNELING_HPP
00020
00021 #include "Epetra_Map.h"
00022 #include "Epetra_Comm.h"
00023 #include "AnasaziEpetraAdapter.hpp"
00024
00025 namespace QCAD {
00026
00027 class GreensFunctionTunnelingSolver
00028 {
00029 public:
00030
00031
00032
00033
00034 GreensFunctionTunnelingSolver(const Teuchos::RCP<std::vector<double> >& EcValues_,
00035 const Teuchos::RCP<std::vector<double> >& pathLen_, int nGFPts_,
00036 double ptSpacing_, double effMass_,
00037 const Teuchos::RCP<const Epetra_Comm>& Comm_,
00038 const std::string& outputFilename,
00039 bool bNeumannBC_ = true);
00040 ~GreensFunctionTunnelingSolver();
00041
00042
00043 double computeCurrent(double Vds, double kbT, double Ecutoff_offset_from_Emax, bool bUseAnasazi);
00044
00045 void computeCurrentRange(const std::vector<double> Vds, double kbT, double Ecutoff_offset_from_Emax,
00046 std::vector<double>& resultingCurrent, bool bUseAnasazi);
00047
00048 private:
00049 double f0(double x) const;
00050
00051 bool doMatrixDiag_Anasazi(double Vds, std::vector<double>& Ec, double Ecutoff,
00052 std::vector<double>& evals,
00053 Teuchos::RCP<Epetra_MultiVector>& evecs);
00054 bool doMatrixDiag_tql2(double Vds, std::vector<double>& Ec, double Ecutoff,
00055 std::vector<double>& evals,
00056 std::vector<double>& evecs);
00057 int tql2(int n, int max_iter, std::vector<double>& d, std::vector<double>& e,
00058 std::vector<double>& z, int& ierr);
00059 void sortTql2PartialResults(int n, std::vector<double>& d, std::vector<double>& z);
00060
00061
00062
00063 void prepSplineInterp(const std::vector<double>& x, const std::vector<double>& y,
00064 std::vector<double>& y2, const int& n);
00065
00066
00067 double execSplineInterp(const std::vector<double>& xa, const std::vector<double>& ya,
00068 const std::vector<double>& y2a, const int& n, const double& x);
00069
00070 private:
00071 Teuchos::RCP<const Epetra_Comm> Comm;
00072 Teuchos::RCP<Epetra_Map> Map;
00073 Teuchos::RCP<std::vector<double> > EcValues;
00074
00075 double ptSpacing, effMass, t0;
00076 bool bNeumannBC;
00077 int nGFPts;
00078
00079 std::vector<double> matlabEvals;
00080 };
00081
00082 }
00083
00084 #endif