Skip to content

Commit cd29e4c

Browse files
committed
change eV/A to eV/Angstrom
1 parent 4fdc28d commit cd29e4c

File tree

7 files changed

+22
-21
lines changed

7 files changed

+22
-21
lines changed

source/source_relax/bfgs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ void BFGS::CalculateLargestGrad(const ModuleBase::matrix& _force,UnitCell& ucell
344344
Ions_Move_Basic::largest_grad /= ucell.lat0;
345345
if (PARAM.inp.out_level == "ie")
346346
{
347-
std::cout << " LARGEST GRAD (eV/A) : " << Ions_Move_Basic::largest_grad
347+
std::cout << " LARGEST GRAD (eV/Angstrom) : " << Ions_Move_Basic::largest_grad
348348
* ModuleBase::Ry_to_eV / 0.5291772109
349349
<< std::endl;
350350
}

source/source_relax/ions_move_basic.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ void Ions_Move_Basic::check_converged(const UnitCell &ucell, const double *grad)
147147
if (PARAM.inp.out_level == "ie")
148148
{
149149
std::cout << " ETOT DIFF (eV) : " << Ions_Move_Basic::ediff * ModuleBase::Ry_to_eV << std::endl;
150-
std::cout << " LARGEST GRAD (eV/A) : " << Ions_Move_Basic::largest_grad * ModuleBase::Ry_to_eV / 0.529177
150+
std::cout << " LARGEST GRAD (eV/Angstrom) : " << Ions_Move_Basic::largest_grad * ModuleBase::Ry_to_eV / 0.529177
151151
<< std::endl;
152152

153153
GlobalV::ofs_running << "\n Largest force is " << largest_grad * ModuleBase::Ry_to_eV / 0.529177
154-
<< " eV/A while threshold is "
155-
<< PARAM.inp.force_thr_ev << " eV/A" << std::endl;
154+
<< " eV/Angstrom while threshold is "
155+
<< PARAM.inp.force_thr_ev << " eV/Angstrom" << std::endl;
156156
}
157157

158158
const double etot_diff = std::abs(Ions_Move_Basic::ediff);

source/source_relax/lbfgs.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ void LBFGS::calculate_largest_grad(const ModuleBase::matrix& _force,UnitCell& uc
287287
Ions_Move_Basic::largest_grad /= ucell.lat0;
288288
if (PARAM.inp.out_level == "ie")
289289
{
290-
std::cout << " LARGEST GRAD (eV/A) : " << Ions_Move_Basic::largest_grad * ModuleBase::Ry_to_eV / 0.5291772109
290+
std::cout << " LARGEST GRAD (eV/Angstrom) : "
291+
<< Ions_Move_Basic::largest_grad * ModuleBase::Ry_to_eV / 0.5291772109
291292
<< std::endl;
292293
}
293294

source/source_relax/relax_driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void Relax_Driver::relax_driver(
176176

177177
if (inp.calculation == "relax" || inp.calculation == "cell-relax")
178178
{
179-
if (istep-1 == inp.relax_nmax || stop)
179+
if (istep-1 == inp.relax_nmax)
180180
{
181181
std::cout << "\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
182182
std::cout << " Geometry relaxation stops here due to reaching the maximum " << std::endl;

source/source_relax/test/ions_move_basic_test.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ TEST_F(IonsMoveBasicTest, CheckConvergedCase1)
133133
std::string expected_ofs
134134
= " old total energy (ry) = 0\n new total energy (ry) = 0\n "
135135
" energy difference (ry) = 0\n largest gradient (ry/bohr) = 0\n\n"
136-
" Largest force is 0 eV/A while threshold is -1 eV/A\n largest force is 0, no "
136+
" Largest force is 0 eV/Angstrom while threshold is -1 eV/Angstrom\n largest force is 0, no "
137137
"movement is possible.\n it may converged, otherwise no movement of atom is allowed.\n";
138-
std::string expected_std = " ETOT DIFF (eV) : 0\n LARGEST GRAD (eV/A) : 0\n";
138+
std::string expected_std = " ETOT DIFF (eV) : 0\n LARGEST GRAD (eV/Angstrom) : 0\n";
139139

140140
EXPECT_THAT(ofs_output , ::testing::HasSubstr(expected_ofs));
141141
EXPECT_EQ(expected_std, std_outout);
@@ -172,9 +172,9 @@ TEST_F(IonsMoveBasicTest, CheckConvergedCase2)
172172
std::string expected_ofs
173173
= " old total energy (ry) = 0\n new total energy (ry) = 0\n "
174174
" energy difference (ry) = 0\n largest gradient (ry/bohr) = 0.1\n\n"
175-
" Largest force is 2.57111 eV/A while threshold is -1 eV/A\n\n Ion relaxation is "
175+
" Largest force is 2.57111 eV/Angstrom while threshold is -1 eV/Angstrom\n\n Ion relaxation is "
176176
"converged!\n\n Energy difference (Ry) = 0\n";
177-
std::string expected_std = " ETOT DIFF (eV) : 0\n LARGEST GRAD (eV/A) : 2.57111\n";
177+
std::string expected_std = " ETOT DIFF (eV) : 0\n LARGEST GRAD (eV/Angstrom) : 2.57111\n";
178178

179179
EXPECT_THAT(ofs_output , ::testing::HasSubstr(expected_ofs));
180180
EXPECT_EQ(expected_std, std_outout);
@@ -211,9 +211,9 @@ TEST_F(IonsMoveBasicTest, CheckConvergedCase3)
211211
std::string expected_ofs
212212
= " old total energy (ry) = 0\n new total energy (ry) = 0\n "
213213
" energy difference (ry) = 1\n largest gradient (ry/bohr) = 0.1\n\n"
214-
" Largest force is 2.57111 eV/A while threshold is -1 eV/A\n\n Ion relaxation is not "
214+
" Largest force is 2.57111 eV/Angstrom while threshold is -1 eV/Angstrom\n\n Ion relaxation is not "
215215
"converged yet (threshold is 25.7111)\n";
216-
std::string expected_std = " ETOT DIFF (eV) : 13.6057\n LARGEST GRAD (eV/A) : 2.57111\n";
216+
std::string expected_std = " ETOT DIFF (eV) : 13.6057\n LARGEST GRAD (eV/Angstrom) : 2.57111\n";
217217

218218
EXPECT_THAT(ofs_output , ::testing::HasSubstr(expected_ofs));
219219
EXPECT_EQ(expected_std, std_outout);

source/source_relax/test/ions_move_cg_test.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ TEST_F(IonsMoveCGTest, TestStartConverged)
114114
GlobalV::ofs_running.close();
115115

116116
// Check output
117-
std::string expected_output = "\n Largest force is 0 eV/A while threshold is -1 eV/A\n"
117+
std::string expected_output = "\n Largest force is 0 eV/Angstrom while threshold is -1 eV/Angstrom\n"
118118
" largest force is 0, no movement is possible.\n it may converged, otherwise no "
119119
"movement of atom is allowed.\n end of geometry optimization\n "
120120
" istep = 1\n update iteration = 5\n";
@@ -152,7 +152,7 @@ TEST_F(IonsMoveCGTest, TestStartSd)
152152
GlobalV::ofs_running.close();
153153

154154
// Check output
155-
std::string expected_output = "\n Largest force is 0.257111 eV/A while threshold is -1 eV/A\n\n"
155+
std::string expected_output = "\n Largest force is 0.257111 eV/Angstrom while threshold is -1 eV/Angstrom\n\n"
156156
" Ion relaxation is not converged yet (threshold is 0.0257111)\n";
157157
std::ifstream ifs("TestStartSd.log");
158158
std::string output((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
@@ -191,7 +191,7 @@ TEST_F(IonsMoveCGTest, TestStartTrialGoto)
191191
GlobalV::ofs_running.close();
192192

193193
// Check output
194-
std::string expected_output = "\n Largest force is 0.0257111 eV/A while threshold is -1 eV/A\n\n"
194+
std::string expected_output = "\n Largest force is 0.0257111 eV/Angstrom while threshold is -1 eV/Angstrom\n\n"
195195
" Ion relaxation is not converged yet (threshold is 0.0257111)\n";
196196
std::ifstream ifs("TestStartTrialGoto.log");
197197
std::string output((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
@@ -229,7 +229,7 @@ TEST_F(IonsMoveCGTest, TestStartTrial)
229229
GlobalV::ofs_running.close();
230230

231231
// Check output
232-
std::string expected_output = "\n Largest force is 0.257111 eV/A while threshold is -1 eV/A\n\n"
232+
std::string expected_output = "\n Largest force is 0.257111 eV/Angstrom while threshold is -1 eV/Angstrom\n\n"
233233
" Ion relaxation is not converged yet (threshold is 0.0257111)\n";
234234
std::ifstream ifs("TestStartTrial.log");
235235
std::string output((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
@@ -269,7 +269,7 @@ TEST_F(IonsMoveCGTest, TestStartNoTrialGotoCase1)
269269
GlobalV::ofs_running.close();
270270

271271
// Check output
272-
std::string expected_output = "\n Largest force is 0.0257111 eV/A while threshold is -1 eV/A\n\n"
272+
std::string expected_output = "\n Largest force is 0.0257111 eV/Angstrom while threshold is -1 eV/Angstrom\n\n"
273273
" Ion relaxation is not converged yet (threshold is 0.0257111)\n";
274274
std::ifstream ifs("TestStartNoTrialGotoCase1.log");
275275
std::string output((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
@@ -308,7 +308,7 @@ TEST_F(IonsMoveCGTest, TestStartNoTrialGotoCase2)
308308
GlobalV::ofs_running.close();
309309

310310
// Check output
311-
std::string expected_output = "\n Largest force is 0.257111 eV/A while threshold is -1 eV/A\n\n"
311+
std::string expected_output = "\n Largest force is 0.257111 eV/Angstrom while threshold is -1 eV/Angstrom\n\n"
312312
" Ion relaxation is not converged yet (threshold is 0.0257111)\n";
313313
std::ifstream ifs("TestStartNoTrialGotoCase2.log");
314314
std::string output((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
@@ -348,7 +348,7 @@ TEST_F(IonsMoveCGTest, TestStartNoTrial)
348348
GlobalV::ofs_running.close();
349349

350350
// Check output
351-
std::string expected_output = "\n Largest force is 0.0257111 eV/A while threshold is -1 eV/A\n\n"
351+
std::string expected_output = "\n Largest force is 0.0257111 eV/Angstrom while threshold is -1 eV/Angstrom\n\n"
352352
" Ion relaxation is not converged yet (threshold is 0.0257111)\n";
353353
std::ifstream ifs("TestStartNoTrial.log");
354354
std::string output((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());

source/source_relax/test/ions_move_sd_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ TEST_F(IonsMoveSDTest, TestStartConverged)
8585
GlobalV::ofs_running.close();
8686

8787
// Check output
88-
std::string expected_output = "\n Largest force is 0 eV/A while threshold is -1 eV/A\n"
88+
std::string expected_output = "\n Largest force is 0 eV/Angstrom while threshold is -1 eV/Angstrom\n"
8989
" largest force is 0, no movement is possible.\n it may converged, otherwise no "
9090
"movement of atom is allowed.\n end of geometry optimization\n "
9191
" istep = 1\n update iteration = 5\n";
@@ -138,7 +138,7 @@ TEST_F(IonsMoveSDTest, TestStartNotConverged)
138138
GlobalV::ofs_running.close();
139139

140140
// Check output
141-
std::string expected_output = "\n Largest force is 25.7111 eV/A while threshold is -1 eV/A\n\n"
141+
std::string expected_output = "\n Largest force is 25.7111 eV/Angstrom while threshold is -1 eV/Angstrom\n\n"
142142
" Ion relaxation is not converged yet (threshold is 0.0257111)\n";
143143
std::ifstream ifs("log");
144144
std::string output((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());

0 commit comments

Comments
 (0)