@@ -213,7 +213,7 @@ void Input::Default(void)
213213// ----------------------------------------------------------
214214 scf_thr_rho = 1.0e-9 ;
215215 scf_nmax = 40 ;
216- this -> relax_nmax = 0 ;
216+ relax_nmax = 0 ;
217217 out_stru = 0 ;
218218// ----------------------------------------------------------
219219// occupation
@@ -1033,6 +1033,10 @@ bool Input::Read(const std::string &fn)
10331033 {
10341034 read_value (ifs, mdp.md_type );
10351035 }
1036+ else if (strcmp (" md_nstep" ,word) == 0 )
1037+ {
1038+ read_value (ifs, mdp.md_nstep );
1039+ }
10361040 else if (strcmp (" md_dt" ,word) == 0 )
10371041 {
10381042 read_value (ifs, mdp.md_dt );
@@ -1894,6 +1898,7 @@ void Input::Bcast()
18941898*/
18951899 // zheng daye add 2014/5/5
18961900 Parallel_Common::bcast_int (mdp.md_type );
1901+ Parallel_Common::bcast_int (mdp.md_nstep );
18971902 Parallel_Common::bcast_double (mdp.md_dt );
18981903 Parallel_Common::bcast_int (mdp.md_mnhc );
18991904 Parallel_Common::bcast_double (mdp.msst_qmass );
@@ -2177,9 +2182,10 @@ void Input::Check(void)
21772182 GlobalV::CALCULATION = " md" ;
21782183 symmetry = false ;
21792184 cal_force = 1 ;
2180- if (this ->relax_nmax ==0 ){
2181- GlobalV::ofs_running<<" relax_nmax should be set. Autoset relax_nmax to 50!" <<endl;
2182- this ->relax_nmax = 50 ;
2185+ if (mdp.md_nstep == 0 )
2186+ {
2187+ GlobalV::ofs_running<<" md_nstep should be set. Autoset md_nstep to 50!" <<endl;
2188+ mdp.md_nstep = 50 ;
21832189 }
21842190 if (!out_md_control) out_level = " m" ;// zhengdy add 2019-04-07
21852191
@@ -2188,23 +2194,23 @@ void Input::Check(void)
21882194 if (mdp.md_dt < 0 ) ModuleBase::WARNING_QUIT (" Input::Check" ," time interval of MD calculation should be set!" );
21892195 if (mdp.md_tfirst < 0 ) ModuleBase::WARNING_QUIT (" Input::Check" ," temperature of MD calculation should be set!" );
21902196 if (mdp.md_tlast < 0.0 ) mdp.md_tlast = mdp.md_tfirst ;
2191- if (mdp.md_tfirst !=mdp.md_tlast )
2192- {
2193- std::ifstream file1;
2194- file1.open (" ChangeTemp.dat" );
2195- if (!file1) // Peize Lin fix bug 2016-08-06
2196- {
2197- std::ofstream file;
2198- file.open (" ChangeTemp.dat" );
2199- for (int ii=0 ;ii<30 ;ii++)
2200- {
2201- file<<mdp.md_tfirst +(mdp.md_tlast -mdp.md_tfirst )/double (30 )*double (ii+1 )<<" " ;
2202- }
2203- file.close ();
2204- }
2205- else
2206- file1.close ();
2207- }
2197+ // if(mdp.md_tfirst!=mdp.md_tlast)
2198+ // {
2199+ // std::ifstream file1;
2200+ // file1.open("ChangeTemp.dat");
2201+ // if(!file1) // Peize Lin fix bug 2016-08-06
2202+ // {
2203+ // std::ofstream file;
2204+ // file.open("ChangeTemp.dat");
2205+ // for(int ii=0;ii<30;ii++)
2206+ // {
2207+ // file<<mdp.md_tfirst+(mdp.md_tlast-mdp.md_tfirst)/double(30)*double(ii+1)<<" ";
2208+ // }
2209+ // file.close();
2210+ // }
2211+ // else
2212+ // file1.close();
2213+ // }
22082214
22092215 }
22102216 else if (calculation == " cell-relax" ) // mohan add 2011-11-04
0 commit comments