Commit 8602d7f6 by Francois Gygi

Modify tau calculation for SCAN

parent 6dfc64d7
......@@ -211,22 +211,15 @@ void ChargeDensity::update_rhor(void)
}
////////////////////////////////////////////////////////////////////////////////
void ChargeDensity::update_taur(void) const
void ChargeDensity::update_taur(double* taur) const
{
if (taur.size() != vft_->np012loc())
{
taur.resize(vft_->np012loc());
}
for ( int ispin = 0; ispin < wf_.nspin(); ispin++ )
{
tmap["update_taur"].start();
fill(taur.begin(),taur.end(),0.0);
memset( (void*)taur, 0, vft_->np012loc()*sizeof(double) );
for ( int ikp = 0; ikp < wf_.nkp(); ikp++ )
{
assert(taur.size()==ft_[ikp]->np012loc());
wf_.sd(ispin,ikp)->compute_tau(*ft_[ikp],
wf_.weight(ikp), &taur[0]);
wf_.sd(ispin,ikp)->compute_tau(*ft_[ikp], wf_.weight(ikp), taur);
}
tmap["update_taur"].stop();
......
......@@ -51,13 +51,12 @@ class ChargeDensity
mutable TimerMap tmap;
std::vector<std::vector<double> > rhor; // rhor[ispin][i]
mutable std::vector<double> taur; // taur[i]
std::vector<std::vector<std::complex<double> > > rhog; // rhog[ispin][ig]
// core density ptr. If non-zero, contains the real-space core density
double* rhocore_r;
void update_density(void);
void update_rhor(void);
void update_taur(void) const;
void update_taur(double* taur) const;
const Context& context(void) const { return ctxt_; }
MPI_Comm vcomm(void) const { return vcomm_; }
......
......@@ -238,7 +238,7 @@ void SCANFunctional::excSCAN(double rho, double grad, double tau, double *exc,
//!! abs value in next line
XCalpha = fabs(tau - tau_W) / tau_unif;
oneMalpha = 1.0 - XCalpha;
// exchange
exunif = -3.0 / 4.0 * pow(3.0 * rho / pi, 1.0/3.0);
......
......@@ -236,15 +236,11 @@ void XCPotential::update(vector<vector<double> >& vr)
dcopy(&np012loc_,p+1,&inc2,grj_dn,&inc1);
} // j
}
if ( xcf_->isMeta() )
{
// compute tau
cd_.update_taur();
double* tautmp = xcf_->tau;
#pragma omp parallel for
for ( int i = 0; i < np012loc_; i++ )
tautmp[i] = cd_.taur[i];
cd_.update_taur(xcf_->tau);
}
xcf_->setxc();
......
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