Commit a5375a95 authored by Francois Gygi's avatar Francois Gygi
Browse files

Fix Wavefunction::add_kpoint

parent 0c2dfb9d
......@@ -447,12 +447,19 @@ void Wavefunction::add_kpoint(D3vector kpoint, double weight)
}
else if ( nspin_ == 2 )
{
const int nocc_up = (nel_+1)/2+deltaspin_;
const int nocc_dn = nel_/2 - deltaspin_;
if ( nsp_loc() > 0 )
sd_[0][ikp_loc]->update_occ(nocc_up,nspin_);
if ( nsp_loc() > 1 )
sd_[1][ikp_loc]->update_occ(nocc_dn,nspin_);
for ( int isp_loc = 0; isp_loc < sd_.size(); ++isp_loc )
{
if ( isp_global_[isp_loc] == 0 )
{
const int nocc_up = (nel_+1)/2+deltaspin_;
sd_[isp_loc][ikp_loc]->update_occ(nocc_up,nspin_);
}
else
{
const int nocc_dn = nel_/2 - deltaspin_;
sd_[isp_loc][ikp_loc]->update_occ(nocc_dn,nspin_);
}
}
}
else
{
......
Supports Markdown
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