Commit 4b76ca55 by Francois Gygi

add eext function

git-svn-id: http://qboxcode.org/svn/qb/branches/vext@1903 cba15fb0-1239-40c8-b417-11db7ca47a34
parent a19df5b8
......@@ -348,6 +348,8 @@ void EnergyFunctional::update_vhxc(bool compute_stress, bool update_vxc)
{
for ( int i = 0; i < tmp_r.size(); i++ )
tmp_r[i] += s_.vext->v(i);
// update eext_
eext_ = s_.vext->compute_eext(cd_);
}
// compute local potential v_r[ispin][i]
......@@ -691,6 +693,8 @@ double EnergyFunctional::energy(bool compute_hpsi, Wavefunction& dwf,
ets_ = - wf_entropy * s_.ctrl.fermi_temp * boltz;
}
etotal_ = ekin_ + econf_ + eps_ + enl_ + ecoul_ + exc_ + ets_ + eexf_;
if ( s_.vext )
etotal_ += eext_;
enthalpy_ = etotal_;
// Electric enthalpy
......@@ -1201,6 +1205,8 @@ void EnergyFunctional::print(ostream& os) const
<< " <epv> " << setw(15) << epv() << " </epv>\n"
<< " <eefield> " << setw(15) << eefield() << " </eefield>\n"
<< " <enthalpy>" << setw(15) << enthalpy() << " </enthalpy>" << endl;
if ( s_.vext )
os << " <eext> " << setw(15) << eext() << " </eext>" << endl;
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -68,7 +68,7 @@ class EnergyFunctional
std::vector<int> na_;
int nsp_;
double ekin_, econf_, eps_, enl_, ehart_, ehart_e_, ehart_ep_, ehart_p_,
ecoul_, exc_, esr_, eself_, ets_, eexf_, etotal_;
ecoul_, exc_, esr_, eself_, ets_, eexf_, eext_, etotal_;
double dxc_;
double epv_, eefield_, enthalpy_;
std::valarray<double> sigma_ekin,sigma_econf,sigma_eps,sigma_ehart,sigma_exc,
......@@ -105,6 +105,7 @@ class EnergyFunctional
double eefield(void) const { return eefield_; }
double epv(void) const { return epv_; }
double enthalpy(void) const { return enthalpy_; }
double eext(void) const { return eext_; }
ElectricEnthalpy* el_enth() { return el_enth_; }
......
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