Skip to content

Commit

Permalink
Bug fix in the criteria for deciding which state has to be used for c…
Browse files Browse the repository at this point in the history
…omputing residual norm to decide the number of passes. This came up when testing on a system with thousands of k-points for validating the DOS with espresso
  • Loading branch information
Phani Motamarri committed Apr 23, 2024
1 parent bb88f79 commit fc31b96
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/dft/kohnShamEigenSolve.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1023,15 +1023,12 @@ namespace dftfe
if (factor <= 0.0)
{
double temp2 = 1.0 / (1.0 + exp(factor));
functionValue = (2.0 - d_dftParamsPtr->spinPolarized) *
d_kPointWeights[kPoint] * temp2;
functionValue = (2.0 - d_dftParamsPtr->spinPolarized)*temp2;
}
else
{
double temp2 = 1.0 / (1.0 + exp(-factor));
functionValue = (2.0 - d_dftParamsPtr->spinPolarized) *
d_kPointWeights[kPoint] * exp(-factor) *
temp2;
functionValue = (2.0 - d_dftParamsPtr->spinPolarized) * exp(-factor) * temp2;
}
if (functionValue > 1e-3)
highestOccupiedState = i;
Expand Down

0 comments on commit fc31b96

Please sign in to comment.