Skip to content

Commit 0463de3

Browse files
authored
fix: bug when stru_file=../STRU (#1930)
1 parent 6ba9361 commit 0463de3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/module_io/input.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,11 @@ bool Input::Read(const std::string &fn)
20782078
// sunliang added on 2022-12-06
20792079
// To check if ntype in INPUT is equal to the atom species in STRU, if ntype is not set in INPUT, we will set it
20802080
// according to STRU.
2081-
double ntype_stru = this->count_ntype(GlobalV::stru_file);
2081+
if(this->stru_file == "")
2082+
{
2083+
this->stru_file="STRU";
2084+
}
2085+
double ntype_stru = this->count_ntype(this->stru_file);
20822086
if (this->ntype == 0)
20832087
{
20842088
this->ntype = ntype_stru;

0 commit comments

Comments
 (0)