Skip to content

Commit 8f70b45

Browse files
authored
Merge pull request #910 from sunliang98/debug
fix: Add the support to the multiple line heading in pseudopotential.
2 parents 8f6f4c7 + 16a5348 commit 8f70b45

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

source/module_cell/read_pp_upf201.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ int Pseudopot_upf::read_pseudo_upf201(std::ifstream &ifs)
128128

129129
if (ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "<PP_R", true, false))
130130
{
131-
ModuleBase::GlobalFunc::READ_VALUE(ifs, word); // type size columns
131+
ifs.ignore(150, '>');
132+
// ModuleBase::GlobalFunc::READ_VALUE(ifs, word); // type size columns
132133
this->read_pseudo_upf201_r(ifs);
133134
}
134135
else if (ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "<PP_R>"))
@@ -139,7 +140,8 @@ int Pseudopot_upf::read_pseudo_upf201(std::ifstream &ifs)
139140

140141
if (ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "<PP_RAB", true, false))
141142
{
142-
ModuleBase::GlobalFunc::READ_VALUE(ifs, word); // type size columns
143+
ifs.ignore(150, '>');
144+
// ModuleBase::GlobalFunc::READ_VALUE(ifs, word); // type size columns
143145
this->read_pseudo_upf201_rab(ifs);
144146
}
145147
else if (ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "<PP_RAB>"))
@@ -224,7 +226,8 @@ int Pseudopot_upf::read_pseudo_upf201(std::ifstream &ifs)
224226

225227
if (ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "<PP_DIJ", true, false))
226228
{
227-
ModuleBase::GlobalFunc::READ_VALUE(ifs, word); // type size columns
229+
ifs.ignore(150, '>');
230+
// ModuleBase::GlobalFunc::READ_VALUE(ifs, word); // type size columns
228231
this->read_pseudo_upf201_dij(ifs);
229232
}
230233
else if ( ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "<PP_DIJ>"))
@@ -289,7 +292,8 @@ int Pseudopot_upf::read_pseudo_upf201(std::ifstream &ifs)
289292
//--------------------------------------
290293
if (ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "<PP_RHOATOM", true, false))
291294
{
292-
ModuleBase::GlobalFunc::READ_VALUE(ifs, word); // type size columns
295+
ifs.ignore(150, '>');
296+
// ModuleBase::GlobalFunc::READ_VALUE(ifs, word); // type size columns
293297
this->read_pseudo_upf201_rhoatom(ifs);
294298
}
295299
else if (ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "<PP_RHOATOM>"))
@@ -527,10 +531,10 @@ void Pseudopot_upf::read_pseudo_upf201_dij(std::ifstream &ifs)
527531
for(int j=0;j<nbeta;j++)
528532
{
529533
ifs >> dion(i,j);
530-
if ( i != j && dion(i,j) != 0.0 )
531-
{
532-
ModuleBase::WARNING_QUIT("read_pseudo_upf201","Error: for i != j, Dij of Pseudopotential must be 0.0");
533-
}
534+
// if ( i != j && dion(i,j) != 0.0 )
535+
// {
536+
// ModuleBase::WARNING_QUIT("read_pseudo_upf201","Error: for i != j, Dij of Pseudopotential must be 0.0");
537+
// }
534538
}
535539
}
536540
}

0 commit comments

Comments
 (0)