Commit 74801531 by Francois Gygi

Modified printout of variables when computing stress


git-svn-id: http://qboxcode.org/svn/qb/trunk@215 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 835ffb0a
......@@ -3,7 +3,7 @@
// BOSampleStepper.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: BOSampleStepper.C,v 1.8 2004-04-20 22:15:01 fgygi Exp $
// $Id: BOSampleStepper.C,v 1.9 2004-05-04 21:26:24 fgygi Exp $
#include "BOSampleStepper.h"
#include "EnergyFunctional.h"
......@@ -140,6 +140,8 @@ void BOSampleStepper::step(int niter)
{
const double pext = (sigma_ext[0]+sigma_ext[1]+sigma_ext[2])/3.0;
const double enthalpy = ef_.etotal() + pext * cell.volume();
cout << " <pv> " << setw(15) << pext * cell.volume()
<< " </pv>" << endl;
cout << " <enthalpy> " << setw(15) << enthalpy << " </enthalpy>\n"
<< flush;
}
......@@ -387,7 +389,7 @@ void BOSampleStepper::step(int niter)
cout.setf(ios::right,ios::adjustfield);
cout << " <ekin_int> " << setprecision(8)
<< setw(15) << ef_.ekin() << " </ekin_int>\n";
if ( compute_stress )
if ( use_confinement )
{
cout << " <econf_int> " << setw(15) << ef_.econf()
<< " </econf_int>\n";
......@@ -403,8 +405,6 @@ void BOSampleStepper::step(int niter)
{
const double pext = (sigma_ext[0]+sigma_ext[1]+sigma_ext[2])/3.0;
const double enthalpy = ef_.etotal() + pext * cell.volume();
cout << " <pv> " << setw(15) << pext * cell.volume()
<< " </pv>" << endl;
cout << " <enthalpy_int> " << setw(15) << enthalpy << " </enthalpy_int>\n"
<< flush;
}
......
......@@ -3,7 +3,7 @@
// CPSampleStepper.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: CPSampleStepper.C,v 1.5 2004-05-03 19:16:20 fgygi Exp $
// $Id: CPSampleStepper.C,v 1.6 2004-05-04 21:26:24 fgygi Exp $
#include "CPSampleStepper.h"
#include "EnergyFunctional.h"
......@@ -86,21 +86,30 @@ void CPSampleStepper::step(int niter)
{
cout.setf(ios::fixed,ios::floatfield);
cout.setf(ios::right,ios::adjustfield);
cout << " <ekin> " << setprecision(8)
cout << " <ekin> " << setprecision(8)
<< setw(15) << ef_.ekin() << " </ekin>\n";
if ( use_confinement )
{
cout << " <econf_int> " << setw(15) << ef_.econf()
<< " </econf_int>\n";
cout << " <econf> " << setw(15) << ef_.econf()
<< " </econf>\n";
}
cout << " <eps> " << setw(15) << ef_.eps() << " </eps>\n"
<< " <enl> " << setw(15) << ef_.enl() << " </enl>\n"
<< " <ecoul> " << setw(15) << ef_.ecoul() << " </ecoul>\n"
<< " <exc> " << setw(15) << ef_.exc() << " </exc>\n"
<< " <esr> " << setw(15) << ef_.esr() << " </esr>\n"
<< " <eself> " << setw(15) << ef_.eself() << " </eself>\n"
<< " <etotal> " << setw(15) << ef_.etotal() << " </etotal>\n"
cout << " <eps> " << setw(15) << ef_.eps() << " </eps>\n"
<< " <enl> " << setw(15) << ef_.enl() << " </enl>\n"
<< " <ecoul> " << setw(15) << ef_.ecoul() << " </ecoul>\n"
<< " <exc> " << setw(15) << ef_.exc() << " </exc>\n"
<< " <esr> " << setw(15) << ef_.esr() << " </esr>\n"
<< " <eself> " << setw(15) << ef_.eself() << " </eself>\n"
<< " <etotal> " << setw(15) << ef_.etotal() << " </etotal>\n"
<< flush;
if ( compute_stress )
{
const double pext = (sigma_ext[0]+sigma_ext[1]+sigma_ext[2])/3.0;
const double enthalpy = ef_.etotal() + pext * s_.wf.cell().volume();
cout << " <pv> " << setw(15) << pext * s_.wf.cell().volume()
<< " </pv>" << endl;
cout << " <enthalpy> " << setw(15) << enthalpy << " </enthalpy>\n"
<< flush;
}
}
if ( compute_forces )
......@@ -160,6 +169,12 @@ void CPSampleStepper::step(int niter)
if ( compute_stress )
{
if ( s_.ctxt_.onpe0() )
{
cout << "<unit_cell>" << endl;
cout << s_.wf.cell();
cout << "</unit_cell>" << endl;
}
compute_sigma();
print_stress();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment