Commit ecb16b50 by Francois Gygi

fixed add_kpoint to avoid modifying occ of existing kpoints

git-svn-id: http://qboxcode.org/svn/qb/trunk@1303 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 400088f6
......@@ -372,7 +372,23 @@ void Wavefunction::add_kpoint(D3vector kpoint, double weight)
sd_[ispin].push_back(new SlaterDet(*sdcontext_,kpoint_[nkp-1]));
sd_[ispin][nkp-1]->resize(cell_,refcell_,ecut_,nst_[ispin]);
}
update_occ(0.0);
if ( nspin_ == 1 )
{
sd_[0][nkp-1]->update_occ(nel_,nspin_);
}
else if ( nspin_ == 2 )
{
const int nocc_up = (nel_+1)/2+deltaspin_;
const int nocc_dn = nel_/2 - deltaspin_;
sd_[0][nkp-1]->update_occ(nocc_up,nspin_);
sd_[1][nkp-1]->update_occ(nocc_dn,nspin_);
}
else
{
// incorrect value of nspin_
assert(false);
}
}
////////////////////////////////////////////////////////////////////////////////
......
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