Skip to content

Commit

Permalink
Fix: No warning is given if KPT is ill set (#4134)
Browse files Browse the repository at this point in the history
* throw warning when kpoints is non-standard

* modified
  • Loading branch information
Luc1anoo committed May 10, 2024
1 parent 2f1e062 commit 98f8ae9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/module_cell/klist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,15 @@ bool K_Vectors::read_kpoints(const std::string &fn)
}

ifk >> nmp[0] >> nmp[1] >> nmp[2];

koffset[0] = 0;
koffset[1] = 0;
koffset[2] = 0;
if (!(ifk >> koffset[0] >> koffset[1] >> koffset[2]))
{
ModuleBase::WARNING("K_Vectors::read_kpoints", "Missing k-point offsets in the k-points file.");
}

ifk >> koffset[0] >> koffset[1] >> koffset[2];
this->Monkhorst_Pack(nmp, koffset, k_type);
}
else if (nkstot > 0)
Expand Down

0 comments on commit 98f8ae9

Please sign in to comment.