Skip to content

Commit ac29941

Browse files
committed
update output formats
1 parent 608488e commit ac29941

File tree

11 files changed

+23
-15
lines changed

11 files changed

+23
-15
lines changed

source/source_esolver/esolver_ks.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,15 @@ void ESolver_KS<T, Device>::runner(UnitCell& ucell, const int istep)
237237
bool conv_esolver = false;
238238
this->niter = this->maxniter;
239239
this->diag_ethr = PARAM.inp.pw_diag_thr;
240+
this->scf_nmax_flag = false; // mohan add 2025-09-21
240241
for (int iter = 1; iter <= this->maxniter; ++iter)
241-
{
242+
{
243+
// mohan add 2025-09-21
244+
if(iter == this->maxniter)
245+
{
246+
this->scf_nmax_flag=true;
247+
}
248+
242249
//----------------------------------------------------------------
243250
// 3) initialization of SCF iterations
244251
//----------------------------------------------------------------

source/source_esolver/esolver_ks.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ class ESolver_KS : public ESolver_FP
8383
int maxniter; //! maximum iter steps for scf
8484
int niter; //! iter steps actually used in scf
8585
bool oscillate_esolver = false; // whether esolver is oscillated
86+
87+
bool scf_nmax_flag = false; // whether scf has reached nmax, mohan add 20250921
8688
};
8789
} // namespace ModuleESolver
8890
#endif

source/source_esolver/lcao_after_scf.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep, const
4141
out_flag = true;
4242
}
4343
}
44-
//else if(iter == PARAM.inp.scf_nmax || conv_esolver) // we should output information when scf_nmax reached, fix this later 2025-09-21 by mohan
45-
else if(conv_esolver)
44+
else if(conv_esolver || this->scf_nmax_flag) // mohan add scf_nmax_flag on 20250921
4645
{
4746
out_flag = true;
4847
}

tests/03_NAO_multik/18_NO_KP_OH2/INPUT

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ calculation scf
55

66
nbands 6
77
symmetry 0
8-
pseudo_dir ../../PP_ORB
9-
orbital_dir ../../PP_ORB
8+
pseudo_dir ../../PP_ORB
9+
orbital_dir ../../PP_ORB
1010
gamma_only 0
1111

1212
#Parameters (2.Iteration)
1313
ecutwfc 20
14-
scf_thr 1e-8
15-
scf_nmax 1
14+
scf_thr 1e-8
15+
scf_nmax 1
1616

1717
#Parameters (3.Basis)
1818
basis_type lcao
1919

2020
#Parameters (4.Smearing)
21-
smearing_method gauss
22-
smearing_sigma 0.002
21+
smearing_method gauss
22+
smearing_sigma 0.002
2323

2424
#Parameters (5.Mixing)
2525
mixing_type broyden
2626
mixing_beta 0.7
2727
mixing_gg0 0.0
2828

29-
out_mat_hs2 1 5
29+
out_mat_hs2 1 5
3030
ks_solver scalapack_gvx
File renamed without changes.

0 commit comments

Comments
 (0)