Skip to content

Commit 9766c3e

Browse files
committed
print pressure in the log file and on the screen
1 parent 072e395 commit 9766c3e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/src_pw/stress_func_print.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void Stress_Func::printstress_total(const ModuleBase::matrix& scs, bool ry)
6666
unit_transform = ModuleBase::RYDBERG_SI / pow(ModuleBase::BOHR_RADIUS_SI,3) * 1.0e-8;
6767
}
6868
// std::cout.setf(ios::fixed);
69-
69+
7070

7171
//GlobalV::ofs_running << std::setiosflags(ios::right);
7272
GlobalV::ofs_running << std::setprecision(6) << std::setiosflags(ios::showpos) << std::setiosflags(ios::fixed) << std::endl;
@@ -90,6 +90,9 @@ void Stress_Func::printstress_total(const ModuleBase::matrix& scs, bool ry)
9090
<< scs(i,1)*unit_transform << std::setw(15) << scs(i,2)*unit_transform << std::endl;
9191

9292
}
93+
double pressure = (scs(0,0)+scs(1,1)+scs(2,2))/3.0*unit_transform;
94+
std::cout << " TOTAL-PRESSURE: " <<pressure<<" KBAR"<< std::endl;
95+
GlobalV::ofs_running << " TOTAL-PRESSURE: " <<pressure<<" KBAR"<< std::endl;
9396
GlobalV::ofs_running << std::setiosflags(ios::left);
9497
std::cout << std::resetiosflags(ios::showpos);
9598

0 commit comments

Comments
 (0)