Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #ifndef QCAD_COUPLEDPSJACOBIAN_H
00008 #define QCAD_COUPLEDPSJACOBIAN_H
00009
00010 #include <iostream>
00011 #include "Epetra_Comm.h"
00012 #include "Epetra_Map.h"
00013 #include "Epetra_Vector.h"
00014 #include "Epetra_Operator.h"
00015 #include "Epetra_CrsMatrix.h"
00016 #include "Epetra_Import.h"
00017
00018
00019 #include "Teuchos_RCP.hpp"
00020
00021 namespace QCAD {
00022
00027 class CoupledPSJacobian : public Epetra_Operator {
00028 public:
00029 CoupledPSJacobian(int nEigenvals,
00030 const Teuchos::RCP<const Epetra_Map>& discMap,
00031 const Teuchos::RCP<const Epetra_Map>& fullPSMap,
00032 const Teuchos::RCP<const Epetra_Comm>& comm,
00033 int dim, int valleyDegen, double temp,
00034 double lengthUnitInMeters, double energyUnitInElectronVolts,
00035 double effMass, double conductionBandOffset);
00036 ~CoupledPSJacobian();
00037
00039 void initialize(const Teuchos::RCP<Epetra_CrsMatrix>& poissonJac, const Teuchos::RCP<Epetra_CrsMatrix>& schrodingerJac,
00040 const Teuchos::RCP<Epetra_CrsMatrix>& massMatrix,
00041 const Teuchos::RCP<Epetra_Vector>& eigenvals, const Teuchos::RCP<const Epetra_MultiVector>& eigenvecs);
00042
00044 virtual int SetUseTranspose(bool UseTranspose) { bUseTranspose = UseTranspose; return 0; };
00045
00047 virtual int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00048
00050 virtual int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00051
00053 virtual double NormInf() const { return 0.0; }
00054
00056 virtual const char * Label() const { return "Coupled Poisson-Schrodinger Jacobian"; }
00057
00059 virtual bool UseTranspose() const { return bUseTranspose; }
00060
00062 virtual bool HasNormInf() const { return false; }
00063
00065 virtual const Epetra_Comm & Comm() const { return *myComm; }
00066
00068 virtual const Epetra_Map & OperatorDomainMap() const { return *domainMap; }
00069
00071 virtual const Epetra_Map & OperatorRangeMap() const { return *rangeMap; }
00072
00073 private:
00074
00075 Teuchos::RCP<const Epetra_Map> discMap;
00076 Teuchos::RCP<const Epetra_Map> dist_evalMap, local_evalMap;
00077 Teuchos::RCP<const Epetra_Map> domainMap, rangeMap;
00078 Teuchos::RCP<const Epetra_Comm> myComm;
00079 Teuchos::RCP<const Epetra_Import> eval_importer;
00080 bool bUseTranspose;
00081 bool bInitialized;
00082
00083 Teuchos::RCP<Epetra_CrsMatrix> poissonJacobian, schrodingerJacobian;
00084 Teuchos::RCP<Epetra_CrsMatrix> massMatrix;
00085 Teuchos::RCP<Epetra_Vector> neg_eigenvalues;
00086 Teuchos::RCP<const Epetra_MultiVector> psiVectors;
00087
00088
00089 Teuchos::RCP<Epetra_MultiVector> dn_dPsi, dn_dEval;
00090 Teuchos::RCP<Epetra_MultiVector> M_Psi, MT_Psi;
00091 Teuchos::RCP<Epetra_Vector> x_neg_evals_local;
00092
00093
00094 int numDims;
00095 int valleyDegenFactor;
00096 double temperature;
00097 double length_unit_in_m;
00098 double energy_unit_in_eV;
00099 double effmass;
00100
00101 double offset_to_CB;
00102 };
00103
00104 }
00105 #endif