Skip to content

Commit

Permalink
Merge branch inelastic and cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
pecchia committed Aug 22, 2022
1 parent 5883c1b commit eb5ea1c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 25 deletions.
1 change: 1 addition & 0 deletions config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ option(WITH_ELSI "Whether DFTB+ with MPI-parallelism should use the ELSI librari
# enabled (and must have been built with GPU support).

option(WITH_TRANSPORT "Whether transport via libNEGF should be included." FALSE)
option(WITH_TRANSPORT_GPU "Whether libNEGF should enable GPU." FALSE)
# Works only when building static libraries (see option BUILD_SHARED_LIBS)

option(WITH_POISSON "Whether the Poisson-solver should be included" ${WITH_TRANSPORT})
Expand Down
2 changes: 0 additions & 2 deletions src/dftbp/dftbplus/initprogram.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4502,8 +4502,6 @@ subroutine initTransport_(env, input, electronicSolver, nSpin, tempElec, tNegf,
end associate

if (tNegf) then
write(stdOut,*) 'init negf'

! Some checks and initialization of GDFTB/NEGF
call TNegfInt_init(negfInt, input%transpar, env, input%ginfo%greendens,&
& input%ginfo%tundos, tempElec, kPoint, kWeight, localKS)
Expand Down
14 changes: 6 additions & 8 deletions src/dftbp/dftbplus/parser.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6714,15 +6714,15 @@ subroutine readInelastic(node, elph, geom, orb, tp)
call getChildValue(child2, "Eps0", elph%eps_r, default=1.0_dp)
call getChildValue(child2, "ScreeningLength", tmp, 10.0_dp, modifier=modifier,&
& child=field)
call convertByMul(char(modifier), lengthUnits, field, tmp)
call convertUnitHsd(char(modifier), lengthUnits, field, tmp)
elph%q0 = 1.0_dp/tmp
case ("nonpolaroptical")
elph%model = interaction_models%nonpolaroptical
call getChild(child, "NonPolarOptical", child2)
call read_common_part(child2)
call getChildValue(child2, "DeformationPotential", elph%D0, 0.0_dp, modifier=modifier,&
& child=field)
call convertByMul(char(modifier), energyUnits, field, elph%D0)
call convertUnitHsd(char(modifier), energyUnits, field, elph%D0)
case default
call detailedError(child,"unkown inelastic phonon type: "//char(phonontype))
end select
Expand All @@ -6742,7 +6742,7 @@ subroutine read_common_part(node)
if (tmp == 0.0_dp) then
call detailedError(node, "PhononFrequency must be defined > 0.0")
end if
call convertByMul(char(modifier), energyUnits, field, tmp)
call convertUnitHsd(char(modifier), energyUnits, field, tmp)
elph%wq = tmp
call getChildValue(node, "Umklapp", elph%tUmklapp, .false.)
call getChildValue(node, "KSymmetry", elph%tKSymmetry, .true.)
Expand Down Expand Up @@ -6916,7 +6916,7 @@ subroutine readCoupling(node, elph, geom, orb, tp)

case (textNodeName)
call getChildValue(node, "Coupling", rTmp, child=field, modifier=modifier)
call convertByMul(char(modifier), energyUnits, field, rTmp)
call convertUnitHsd(char(modifier), energyUnits, field, rTmp)
elph%coupling = rTmp

case ("constant")
Expand Down Expand Up @@ -6959,12 +6959,10 @@ subroutine readCommonBlock(root, orb, geo, tundos, transpar, tempElec)

call getChildValue(root, "Delta", tundos%delta, &
&1.0e-5_dp, modifier=modifier, child=field)
call convertByMul(char(modifier), energyUnits, field, &
&tundos%delta)
call convertUnitHsd(char(modifier), energyUnits, field, tundos%delta)
call getChildValue(root, "BroadeningDelta", tundos%broadeningDelta, &
&0.0_dp, modifier=modifier, child=field)
call convertByMul(char(modifier), energyUnits, field, &
&tundos%broadeningDelta)
call convertUnitHsd(char(modifier), energyUnits, field, tundos%broadeningDelta)
! Read Temperature. Can override contact definition
allocate(tundos%kbT(ncont))

Expand Down
25 changes: 12 additions & 13 deletions src/dftbp/transport/negfint.F90
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ subroutine TNegfInt_init(this, transpar, env, greendens, tundos, tempElec, kPoin
integer :: i, l, ncont, nldos
integer, allocatable :: sizes(:)
type(lnParams) :: params

#:if WITH_MPI
call negf_mpi_init(this%negf, env%mpi%globalComm, env%mpi%groupComm, &
& env%mpi%interGroupComm)
Expand All @@ -132,6 +132,8 @@ subroutine TNegfInt_init(this, transpar, env, greendens, tundos, tempElec, kPoin
ncont = 0
endif

write(stdOut,*) 'Initialize libNEGF'

! ------------------------------------------------------------------------------
! Set defaults and fill up the parameter structure with them
call init_negf(this%negf)
Expand Down Expand Up @@ -229,7 +231,7 @@ subroutine TNegfInt_init(this, transpar, env, greendens, tundos, tempElec, kPoin
params%FictCont(i) = transpar%contacts(i)%wideBand
params%contact_DOS(i) = transpar%contacts(i)%wideBandDOS

write(stdOut,"(1X,A,I0,A)") '(negf_init) CONTACT INFO #', i,&
write(stdOut,"(1X,A,I0,A)") 'CONTACT INFO #', i,&
& ' "'//trim(transpar%contacts(i)%name)//'"'

if (params%FictCont(i)) then
Expand All @@ -238,20 +240,17 @@ subroutine TNegfInt_init(this, transpar, env, greendens, tundos, tempElec, kPoin
end if
write(stdOut,*) 'Temperature (DM): ', params%kbT_dm(i)
write(stdOut,*) 'Temperature (Current): ', params%kbT_t(i)
if (transpar%contacts(i)%tFermiSet) then
write(stdOut,format2U)'Potential (with built-in)', pot(i), 'H', Hartree__eV*pot(i), 'eV'
write(stdOut,format2U)'eFermi', eFermi(i), 'H', Hartree__eV*eFermi(i), 'eV'
end if
write(stdOut,*)

! Define electrochemical potentials
params%mu(i) = eFermi(i) - pot(i)

if (transpar%contacts(i)%tFermiSet) then
write(stdOut,format2U)'Potential (with built-in)', pot(i), 'H', Hartree__eV*pot(i), 'eV'
write(stdOut,format2U)'eFermi', eFermi(i), 'H', Hartree__eV*eFermi(i), 'eV'
write(stdOut,format2U)'Electro-chemical potentials', params%mu(i), 'H',&
& Hartree__eV*params%mu(i), 'eV'
write(stdOut,*)
end if

write(stdOut,*)

enddo

Expand Down Expand Up @@ -765,10 +764,10 @@ subroutine setup_str(this, denseDescr, transpar, greendens, coords, latVec, &

end if

write(stdOut,*) ' Structure info:'
write(stdOut,*) ' Number of PLs:',nbl
write(stdOut,*) ' PLs coupled to contacts:',cblk(1:ncont)
write(stdOut,*)
!write(stdOut,*) ' Structure info:'
!write(stdOut,*) ' Number of PLs:',nbl
!write(stdOut,*) ' PLs coupled to contacts:',cblk(1:ncont)
!write(stdOut,*)

end if

Expand Down
2 changes: 1 addition & 1 deletion test/app/dftb+/transport/local-curr/dftb_in.hsd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Transport{

Hamiltonian = DFTB {
SCC = Yes
MaxSCCIterations = 100
MaxSCCIterations = 1
SCCTolerance = 1e-6
ReadInitialCharges = Yes

Expand Down

0 comments on commit eb5ea1c

Please sign in to comment.