Skip to content

Commit b12774a

Browse files
committed
update output of pw basis set
1 parent 2cbbc87 commit b12774a

File tree

5 files changed

+42
-34
lines changed

5 files changed

+42
-34
lines changed

source/source_esolver/esolver_ks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ void ESolver_KS<T, Device>::after_scf(UnitCell& ucell, const int istep, const bo
561561
{
562562
if (istep % PARAM.inp.out_freq_ion == 0)
563563
{
564-
// elecstate::print_eigenvalue(this->pelec->ekb,this->pelec->wg,this->pelec->klist,GlobalV::ofs_running);
564+
// celecstate::print_eigenvalue(this->pelec->ekb,this->pelec->wg,this->pelec->klist,GlobalV::ofs_running);
565565
}
566566
}
567567
}

source/source_esolver/esolver_ks_pw.cpp

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -616,44 +616,48 @@ void ESolver_KS_PW<T, Device>::iter_finish(UnitCell& ucell, const int istep, int
616616
// we only print information every few ionic steps
617617
//----------------------------------------------------------
618618

619+
// if istep_in = -1, istep will not appear in file name
620+
// if iter_in = -1, iter will not appear in file name
621+
int istep_in = -1;
622+
int iter_in = -1;
623+
bool out_wfc_flag = false;
619624
if (PARAM.inp.out_freq_ion>0) // default value of out_freq_ion is 0
620625
{
621626
if (istep % PARAM.inp.out_freq_ion == 0)
622627
{
623-
if (iter % PARAM.inp.out_freq_elec == 0 || iter == PARAM.inp.scf_nmax || conv_esolver)
628+
if(iter % PARAM.inp.out_freq_elec == 0 || iter == PARAM.inp.scf_nmax || conv_esolver)
624629
{
625-
// if iter_in = -1, iter will not appear in file name
626-
int iter_in = -1;
627-
if(iter % PARAM.inp.out_freq_elec == 0)
628-
{
629-
iter_in = iter;
630-
}
631-
632-
int istep_in = istep;
633-
if(PARAM.inp.calculation == "scf" || PARAM.inp.calculation == "nscf")
634-
{
635-
istep_in = -1;
636-
}
637-
638-
ModuleIO::write_wfc_pw(istep_in, iter_in,
639-
GlobalV::KPAR,
640-
GlobalV::MY_POOL,
641-
GlobalV::MY_RANK,
642-
PARAM.inp.nbands,
643-
PARAM.inp.nspin,
644-
PARAM.globalv.npol,
645-
GlobalV::RANK_IN_POOL,
646-
GlobalV::NPROC_IN_POOL,
647-
PARAM.inp.out_wfc_pw,
648-
PARAM.inp.ecutwfc,
649-
PARAM.globalv.global_out_dir,
650-
this->psi[0],
651-
this->kv,
652-
this->pw_wfc,
653-
GlobalV::ofs_running);
630+
istep_in = istep;
631+
iter_in = iter;
632+
out_wfc_flag = true;
654633
}
655634
}
656635
}
636+
else if(iter == PARAM.inp.scf_nmax || conv_esolver)
637+
{
638+
out_wfc_flag = true;
639+
}
640+
641+
642+
if (out_wfc_flag)
643+
{
644+
ModuleIO::write_wfc_pw(istep_in, iter_in,
645+
GlobalV::KPAR,
646+
GlobalV::MY_POOL,
647+
GlobalV::MY_RANK,
648+
PARAM.inp.nbands,
649+
PARAM.inp.nspin,
650+
PARAM.globalv.npol,
651+
GlobalV::RANK_IN_POOL,
652+
GlobalV::NPROC_IN_POOL,
653+
PARAM.inp.out_wfc_pw,
654+
PARAM.inp.ecutwfc,
655+
PARAM.globalv.global_out_dir,
656+
this->psi[0],
657+
this->kv,
658+
this->pw_wfc,
659+
GlobalV::ofs_running);
660+
}
657661

658662
//----------------------------------------------------------
659663
// 4) check if oscillate for delta_spin method

source/source_io/nscf_band.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ void ModuleIO::nscf_band(
2323

2424
assert(precision>0);
2525

26+
/*
2627
GlobalV::ofs_running << "\n";
2728
GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
2829
GlobalV::ofs_running << " | |" << std::endl;
2930
GlobalV::ofs_running << " | #Print out the eigenvalues for each spin# |" << std::endl;
3031
GlobalV::ofs_running << " | |" << std::endl;
3132
GlobalV::ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl;
3233
GlobalV::ofs_running << "\n";
34+
*/
3335

34-
GlobalV::ofs_running << " Eigenvalues for plot are in file: " << eig_file << std::endl;
36+
GlobalV::ofs_running << " Write eigenvalues data for plot to file: " << eig_file << std::endl;
3537

3638
// number of k points without spin;
3739
// nspin = 1,2, nkstot = nkstot_np * nspin;

source/source_io/write_eig_occ.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,15 @@ void ModuleIO::write_eig_file(const ModuleBase::matrix &ekb,const ModuleBase::ma
163163
ModuleBase::TITLE("ModuleIO","write_eig_file");
164164
ModuleBase::timer::tick("ModuleIO", "write_eig_file");
165165

166+
/*
166167
GlobalV::ofs_running << "\n";
167168
GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
168169
GlobalV::ofs_running << " | |" << std::endl;
169170
GlobalV::ofs_running << " | #Print out the eigenvalues and occupations# |" << std::endl;
170171
GlobalV::ofs_running << " | |" << std::endl;
171172
GlobalV::ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl;
172173
GlobalV::ofs_running << "\n";
174+
*/
173175

174176
const int nspin = PARAM.inp.nspin;
175177
const int nks = kv.get_nks();
@@ -206,7 +208,7 @@ void ModuleIO::write_eig_file(const ModuleBase::matrix &ekb,const ModuleBase::ma
206208

207209
// file name to store eigenvalues
208210
std::string filename = PARAM.globalv.global_out_dir + "eig_occ.txt";
209-
GlobalV::ofs_running << " Eigenvalues and occupations are in file: " << filename << std::endl;
211+
GlobalV::ofs_running << " Write eigenvalues and occupations to file: " << filename << std::endl;
210212

211213
if (GlobalV::MY_RANK == 0)
212214
{

source/source_io/write_wfc_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void ModuleIO::write_wfc_pw(
5858
ik_local,kv.ik2iktot,nspin,nkstot,
5959
out_wfc_pw,out_app_flag,gamma_only,istep,iter);
6060

61-
ofs_running << " Write G-space wave functions into file "
61+
ofs_running << " Write G-space wave functions to file: "
6262
<< fn << std::endl;
6363

6464
wfilename[ik_local] = fn;

0 commit comments

Comments
 (0)