Skip to content

Commit

Permalink
Merge branch 'development' into TrapCharge_2Dsheet_Sims
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh-s-sawant committed Dec 13, 2024
2 parents 31e2aae + 91bffbc commit bf8a752
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 24 deletions.
6 changes: 3 additions & 3 deletions Source/Solver/Transport/NEGF/CNT.H
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ class c_CNT : public c_NEGF_Common<ComplexType[BLOCK_SIZE]>
virtual int get_Hsize() final { return rings_per_unitcell * num_unitcells; }
virtual int get_offDiag_repeatBlkSize() final { return 2; }

virtual AMREX_GPU_HOST_DEVICE void Compute_SurfaceGreensFunction(
MatrixBlock<BlkType> &gr, const ComplexType E,
const ComplexType U) final;
virtual void Compute_SurfaceGreensFunction(MatrixBlock<BlkType> &gr,
const ComplexType E,
const ComplexType U) final;

public:
static int get_1D_site_id(int par_id_local_to_NS)
Expand Down
1 change: 0 additions & 1 deletion Source/Solver/Transport/NEGF/CNT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ void c_CNT::Define_ContactInfo()
}
}

AMREX_GPU_HOST_DEVICE
void c_CNT::Compute_SurfaceGreensFunction(MatrixBlock<BlkType> &gr,
const ComplexType E,
const ComplexType U)
Expand Down
8 changes: 4 additions & 4 deletions Source/Solver/Transport/NEGF/Graphene.H
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class c_Graphene : public c_NEGF_Common<ComplexType[BLOCK_SIZE][BLOCK_SIZE]>
virtual int get_Hsize() final { return 0; }
virtual int get_offDiag_repeatBlkSize() final { return 1; }

virtual AMREX_GPU_HOST_DEVICE void Compute_SurfaceGreensFunction(
MatrixBlock<BlkType> & gr, const ComplexType EmU) final
{
}
// virtual void Compute_SurfaceGreensFunction(
// MatrixBlock<BlkType> & gr, const ComplexType EmU) final
//{
// }

public:
static int get_1D_site_id(int par_id_local_to_NS)
Expand Down
21 changes: 9 additions & 12 deletions Source/Solver/Transport/NEGF/NEGF_Common.H
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,9 @@ class c_NEGF_Common : protected MatrixBlock<T>, private c_IntegrationPath
void Write_InputInducedCharge(const std::string filename_prefix,
const RealTable1D &n_curr_in_data);

virtual AMREX_GPU_HOST_DEVICE void Compute_SurfaceGreensFunction(
MatrixBlock<T> &gr, const ComplexType E, const ComplexType U);

/*Decimation*/
virtual AMREX_GPU_HOST_DEVICE void Compute_CondensedHamiltonian(
CondensedHamiltonian &CondH, const ComplexType EmU);

AMREX_GPU_HOST_DEVICE void DecimationTechnique(MatrixBlock<T> &gr,
const ComplexType EmU);
virtual void Compute_SurfaceGreensFunction(MatrixBlock<T> &gr,
const ComplexType E,
const ComplexType U);

void Write_Current(const int step, const int total_iterations_in_step,
const amrex::Real avg_intg_pts);
Expand Down Expand Up @@ -471,6 +465,7 @@ class c_NEGF_Common : protected MatrixBlock<T>, private c_IntegrationPath
#endif

/*Decimation Technique*/
BlkTable1D h_H_tilde_data; // condensed Hamiltonian
int use_decimation = false;
// whether to use decimation technique in the derived class.
// derived class default is false.
Expand All @@ -497,6 +492,11 @@ class c_NEGF_Common : protected MatrixBlock<T>, private c_IntegrationPath
virtual void Define_MPI_BlkType() = 0;
virtual void Construct_Hamiltonian() = 0;

void DecimationTechnique(MatrixBlock<T> &gr, const ComplexType EmU);

virtual void Compute_CondensedHamiltonian(CondensedHamiltonian &CondH,
const ComplexType EmU);

/*define the following in overridden Define_ContactInfo:
*global_contact_index
*contact_transmission_index
Expand All @@ -505,9 +505,6 @@ class c_NEGF_Common : protected MatrixBlock<T>, private c_IntegrationPath
virtual void Define_ContactInfo() = 0;

virtual void Generate_AtomLocations(amrex::Vector<s_Position3D> &pos) = 0;
virtual AMREX_GPU_HOST_DEVICE void Compute_SurfaceGreensFunction(
MatrixBlock<T> &gr, const ComplexType EmU) = 0;

virtual void Define_FileHeaderForCurrent();
virtual void Define_EnergyLimits();
virtual void Define_IntegrationPaths();
Expand Down
9 changes: 5 additions & 4 deletions Source/Solver/Transport/NEGF/NEGF_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4092,8 +4092,8 @@ void c_NEGF_Common<T>::Compute_Rho0()
}

template <typename T>
AMREX_GPU_HOST_DEVICE void c_NEGF_Common<T>::DecimationTechnique(
MatrixBlock<T> &gr, const ComplexType EmU)
void c_NEGF_Common<T>::DecimationTechnique(MatrixBlock<T> &gr,
const ComplexType EmU)
{
CondensedHamiltonian CondH;
Compute_CondensedHamiltonian(CondH, EmU);
Expand Down Expand Up @@ -4153,8 +4153,9 @@ AMREX_GPU_HOST_DEVICE void c_NEGF_Common<T>::DecimationTechnique(
}

template <typename T>
AMREX_GPU_HOST_DEVICE void c_NEGF_Common<T>::Compute_SurfaceGreensFunction(
MatrixBlock<T> &gr, const ComplexType E, ComplexType U)
void c_NEGF_Common<T>::Compute_SurfaceGreensFunction(MatrixBlock<T> &gr,
const ComplexType E,
ComplexType U)
{
DecimationTechnique(gr, E - U);
// amrex::Print() << "Using decimation, gr: " << gr << "\n";
Expand Down

0 comments on commit bf8a752

Please sign in to comment.