Skip to content

Commit

Permalink
Merge pull request dftbplus#1407 from bhourahine/ExtendPrefixSK
Browse files Browse the repository at this point in the history
Extends SK prefix mechanism to the default case
  • Loading branch information
bhourahine authored Mar 6, 2024
2 parents 8f9f775 + 270e9fe commit 2e33dae
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
14 changes: 13 additions & 1 deletion doc/dftb+/manual/dftbp.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2709,9 +2709,21 @@ \subsubsection{Explicit specification}
}
\end{verbatim}

You can also set a \kw{Prefix} for the files, typically their path
Example (C):
\invparskip
\begin{verbatim}
SlaterKosterFiles = {
Prefix = "my_skfiles/mio-1-1/"
C-C = "C-C.skf"
}
\end{verbatim}
Which would specify the file's location as {\tt
./my\_skfiles/mio-1-1/C-C.skf} inside the current directory.

If you treat shells from different species as shells of one atom by
using the \iscb{SelectedShells} keyword in the
\iscb{MaxAngularMomentum} block, you have to specify more than one
\iscb{MaxAngularMomentum} block, you will have to specify more than one
file name for certain species pairs. (For details see the description
about the \iscb{MaxAngularMomentum} keyword.)

Expand Down
8 changes: 6 additions & 2 deletions src/dftbp/dftbplus/parser.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ subroutine readDFTBHam(node, ctrl, geo, slako, poisson, errStatus)
type(TListIntR1), allocatable :: angShells(:)
logical, allocatable :: repPoly(:,:)
integer :: iSp1, iSp2, ii
character(lc) :: prefix, suffix, separator, elem1, elem2, strTmp
character(lc) :: prefix, suffix, separator, elem1, elem2, strTmp, str2Tmp
character(lc) :: errorStr
logical :: tLower, tExist
integer, allocatable :: pTmpI1(:)
Expand Down Expand Up @@ -1396,6 +1396,9 @@ subroutine readDFTBHam(node, ctrl, geo, slako, poisson, errStatus)
end do
case default
call setUnprocessed(value1)
call getChildValue(child, "Prefix", buffer2, "")
prefix = unquote(char(buffer2))

do iSp1 = 1, geo%nSpecies
do iSp2 = 1, geo%nSpecies
strTmp = trim(geo%speciesNames(iSp1)) // "-" // trim(geo%speciesNames(iSp2))
Expand All @@ -1408,7 +1411,8 @@ subroutine readDFTBHam(node, ctrl, geo, slako, poisson, errStatus)
call detailedError(child2, errorStr)
end if
do ii = 1, len(lStr)
call get(lStr, strTmp, ii)
call get(lStr, str2Tmp, ii)
strTmp = trim(prefix) // str2Tmp
call findFile(searchPath, strTmp, strOut)
if (allocated(strOut)) strTmp = strOut
inquire(file=strTmp, exist=tExist)
Expand Down
2 changes: 1 addition & 1 deletion test/app/dftb+/non-scc/Si41C23N35/dftb_in.hsd
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ Hamiltonian = DFTB {
Temperature [Kelvin] = 1.000000000000000E-008
}
SlaterKosterFiles = Type2FileNames {
Prefix = {slakos/origin/pbc-0-3/}
Prefix = {slakos/origin/pbc-0-3/}
Separator = "-"
Suffix = ".skf"
}
Expand Down
1 change: 0 additions & 1 deletion test/app/dftb+/non-scc/Si_2/Si-Si.skf

This file was deleted.

1 change: 1 addition & 0 deletions test/app/dftb+/non-scc/Si_2/dftb_in.hsd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Hamiltonian = DFTB {
Temperature [Kelvin] = 1.000000000000000E-008
}
SlaterKosterFiles = {
Prefix = {slakos/origin/pbc-0-3/}
Si-Si = "./Si-Si.skf"
}
KPointsAndWeights = {
Expand Down

0 comments on commit 2e33dae

Please sign in to comment.