Skip to content

Commit 35925f9

Browse files
committed
Refactor SOC check logic for improved readability
1 parent 40e0ed5 commit 35925f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/module_cell/read_pp_upf100.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ void Pseudopot_upf::read_pseudo_so(std::ifstream& ifs, Atom_pseudo& pp)
478478
for (int nw = 0; nw < pp.nchi; nw++)
479479
{
480480
ifs >> pp.els[nw] >> pp.nn[nw] >> pp.lchi[nw] >> pp.jchi[nw] >> pp.oc[nw];
481-
if (std::abs(pp.lchi[nw] - pp.jchi[nw] - 0.5) > 1e-7 && std::abs(pp.lchi[nw] - pp.jchi[nw] + 0.5) > 1e-7)
481+
if (std::abs(std::abs(pp.lchi[nw] - pp.jchi[nw]) - 0.5) > 1e-7)
482482
{
483483
std::cout << "Ignore ADDINFO section" << std::endl;
484484
pp.has_so = false;
@@ -488,7 +488,7 @@ void Pseudopot_upf::read_pseudo_so(std::ifstream& ifs, Atom_pseudo& pp)
488488
for (int nb = 0; nb < pp.nbeta; nb++)
489489
{
490490
ifs >> pp.lll[nb] >> pp.jjj[nb];
491-
if (std::abs(pp.lll[nb] - pp.jjj[nb] - 0.5) > 1e-7 && std::abs(pp.lll[nb] - pp.jjj[nb] + 0.5) > 1e-7)
491+
if (std::abs(std::abs(pp.lll[nb] - pp.jjj[nb]) - 0.5) > 1e-7)
492492
{
493493
std::cout << "Ignore ADDINFO section" << std::endl;
494494
pp.has_so = false;

0 commit comments

Comments
 (0)