Skip to content

Commit 8073403

Browse files
committed
update LCAO output stress format
1 parent 106d2a4 commit 8073403

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

source/source_lcao/FORCE_STRESS.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,8 @@ void Force_Stress_LCAO<T>::getForceStress(UnitCell& ucell,
778778
GlobalV::ofs_running << std::setiosflags(std::ios::left);
779779

780780
// print total stress
781-
bool screen = false;
782-
ModuleIO::print_stress("TOTAL-STRESS", scs, screen, ry, GlobalV::ofs_running);
781+
bool screen_normal = true;
782+
ModuleIO::print_stress("TOTAL-STRESS", scs, screen_normal, ry, GlobalV::ofs_running);
783783

784784
double unit_transform = 0.0;
785785
unit_transform = ModuleBase::RYDBERG_SI / pow(ModuleBase::BOHR_RADIUS_SI, 3) * 1.0e-8;

source/source_relax/relax_driver.cpp

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -174,21 +174,28 @@ void Relax_Driver::relax_driver(
174174
} // end while (istep <= inp.relax_nmax && !stop)
175175

176176

177-
if (istep-1 == inp.relax_nmax || stop)
178-
{
179-
std::cout << "\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
180-
std::cout << " Geometry relaxation stops here due to reaching the maximum " << std::endl;
181-
std::cout << " relaxation steps. More steps are needed to converge the results " << std::endl;
182-
std::cout << " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
183-
}
184-
else
185-
{
186-
std::cout << "\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
187-
std::cout << " Geometry relaxation thresholds are reached within " << istep-1 << " steps." << std::endl;
188-
std::cout << " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
189-
}
177+
if (inp.calculation == "relax" || inp.calculation == "cell-relax")
178+
{
179+
if (istep-1 == inp.relax_nmax || stop)
180+
{
181+
std::cout << "\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
182+
std::cout << " Geometry relaxation stops here due to reaching the maximum " << std::endl;
183+
std::cout << " relaxation steps. More steps are needed to converge the results " << std::endl;
184+
std::cout << " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
185+
}
186+
else
187+
{
188+
std::cout << "\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
189+
std::cout << " Geometry relaxation thresholds are reached within " << istep-1 << " steps." << std::endl;
190+
std::cout << " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
191+
}
192+
}
193+
else
194+
{
195+
// do nothing
196+
}
190197

191-
if (inp.relax_nmax == 0)
198+
if (inp.relax_nmax == 0)
192199
{
193200
std::cout << "-----------------------------------------------" << std::endl;
194201
std::cout << " relax_nmax = 0, DRY RUN TEST SUCCEEDS :)" << std::endl;

0 commit comments

Comments
 (0)