Skip to content

Commit ce03241

Browse files
committed
read_wfc
1 parent 6fdd1fe commit ce03241

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

source/source_io/get_wf_lcao.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ void Get_wf_lcao::begin(const UnitCell& ucell,
204204
}
205205

206206

207-
const int iter = -1; // -1 means electronic iteration number will not appear in file name
208207
const int istep = -1; // -1 means ionic iteration number will not appear in file name
208+
const int iter = -1; // -1 means electronic iteration number will not appear in file name
209209
ModuleIO::write_wfc_pw(istep, iter, GlobalV::KPAR,
210210
GlobalV::MY_POOL,
211211
GlobalV::MY_RANK,
@@ -369,8 +369,8 @@ void Get_wf_lcao::begin(const UnitCell& ucell,
369369
}
370370
}
371371

372-
const int iter = -1; // -1 means electronic iteration number will not appear in file name
373372
const int istep = -1; // -1 means ionic iteration number will not appear in file name
373+
const int iter = -1; // -1 means electronic iteration number will not appear in file name
374374
ModuleIO::write_wfc_pw(istep, iter, GlobalV::KPAR,
375375
GlobalV::MY_POOL,
376376
GlobalV::MY_RANK,

source/source_io/read_wfc_nao.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ bool ModuleIO::read_wfc_nao(
3131
const int nkstot,
3232
const int nspin,
3333
const int skip_band,
34-
const int nstep)
34+
const int istep)
3535
{
3636
ModuleBase::TITLE("ModuleIO", "read_wfc_nao");
3737
ModuleBase::timer::tick("ModuleIO", "read_wfc_nao");
@@ -158,12 +158,12 @@ bool ModuleIO::read_wfc_nao(
158158
const bool out_app_flag = false;
159159
std::stringstream error_message;
160160
std::string readin_dir = global_readin_dir;
161-
if(nstep >= 0)
161+
if(istep >= 0)
162162
{
163163
readin_dir = readin_dir + "WFC/";
164164
}
165165
std::string ss = ModuleIO::filename_output(readin_dir,"wf","nao",
166-
ik,ik2iktot,nspin,nkstot,out_type,out_app_flag,gamma_only,nstep);
166+
ik,ik2iktot,nspin,nkstot,out_type,out_app_flag,gamma_only,istep);
167167

168168
read_success = read_one_file(ss, error_message, ik, ctot);
169169
errors = error_message.str();
@@ -211,7 +211,7 @@ template bool ModuleIO::read_wfc_nao<double>(const std::string& global_readin_di
211211
const std::vector<int> &ik2iktot,
212212
const int nkstot,
213213
const int nspin,
214-
const int nstep,
214+
const int istep,
215215
const int skip_band);
216216

217217
template bool ModuleIO::read_wfc_nao<std::complex<double>>(const std::string& global_readin_dir,
@@ -221,5 +221,5 @@ template bool ModuleIO::read_wfc_nao<std::complex<double>>(const std::string& gl
221221
const std::vector<int> &ik2iktot,
222222
const int nkstot,
223223
const int nspin,
224-
const int nstep,
224+
const int istep,
225225
const int skip_band);

source/source_io/read_wfc_nao.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bool read_wfc_nao(
4545
const int nkstot,
4646
const int nspin,
4747
const int skip_band = 0,
48-
const int nstep = -1);
48+
const int istep = -1);
4949

5050
} // namespace ModuleIO
5151

source/source_io/test/read_wf2rho_pw_test.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,11 @@ TEST_F(ReadWfcRhoTest, ReadWfcRho)
283283

284284
const double ecutwfc = 20; // this is a fake number
285285

286-
ModuleIO::write_wfc_pw(
286+
287+
const int istep = -1; // -1 means ionic iteration number will not appear in file name
288+
const int iter = -1; // -1 means electronic iteration number will not appear in file name
289+
290+
ModuleIO::write_wfc_pw(istep, iter,
287291
kpar, my_pool, my_rank, nbands, nspin, npol,
288292
GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL,
289293
PARAM.input.out_wfc_pw, ecutwfc, out_dir, *psi, *kv, wfcpw,

source/source_io/test/read_wfc_nao_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ std::string filename_output(
2929
const int out_type,
3030
const bool out_app_flag,
3131
const bool gamma_only,
32-
const int istep)
32+
const int istep,
33+
const int iter)
3334
{
3435
return "./support/wfs1_nao.txt";
3536
}

0 commit comments

Comments
 (0)