Commit 8e7d5626 by Francois Gygi

Merge branch 'develop'

parents 30ab6b3e f9a03e25
......@@ -352,7 +352,12 @@ void BOSampleStepper::step(int niter)
const double q0_kerker = 2 * M_PI / rc_Kerker;
const double q0_kerker2 = q0_kerker * q0_kerker;
for ( int i = 0; i < wkerker.size(); i++ )
wkerker[i] = g2[i] / ( g2[i] + q0_kerker2 );
{
if ( g2[i] != 0.0 )
wkerker[i] = g2[i] / ( g2[i] + q0_kerker2 );
else
wkerker[i] = 1.0;
}
}
else
{
......
......@@ -623,6 +623,7 @@ void Wavefunction::move_kpoint(D3vector kpoint, D3vector newkpoint)
////////////////////////////////////////////////////////////////////////////////
void Wavefunction::randomize(double amplitude)
{
srand48((long int) MPIdata::rank());
for ( int isp_loc = 0; isp_loc < sd_.size(); ++isp_loc )
{
for ( int ikp_loc = 0; ikp_loc < sd_[isp_loc].size(); ++ikp_loc )
......@@ -743,39 +744,52 @@ void Wavefunction::update_occ(double temp)
{
cout << " Wavefunction::update_occ: sum = "
<< rhosum << endl;
cout << " Wavefunction::update_occ: mu = "
<< setprecision(4) << mu / eVolt << " eV" << endl;
cout.setf(ios::right,ios::adjustfield);
cout.setf(ios::fixed,ios::floatfield);
cout << "<mu> " << setprecision(6) << mu / eVolt << " </mu>" << endl;
cout << "<occ_set>" << endl;
}
cout << " Wavefunction::update_occ: occupation numbers" << endl;
for ( int ispin = 0; ispin < nspin_; ispin++ )
for ( int ispin = 0; ispin < nspin(); ++ispin )
{
const int isp_loc = isp_local(ispin);
for ( int ikp = 0; ikp < nkp(); ++ikp )
{
const int isp_loc = ispin / MPIdata::nspb();
const int ispb = ispin % MPIdata::nspb();
if ( ispb == MPIdata::ispb() )
const int ikp_loc = ikp_local(ikp);
ostringstream ostr;
ostr.setf(ios::fixed,ios::floatfield);
ostr.setf(ios::right,ios::adjustfield);
int isrc = -1;
if ( ( isp_loc >= 0 ) && ( ikp_loc >= 0 ) )
{
for ( int ikp = 0; ikp < kpoint_.size(); ikp++ )
if ( MPIdata::sd_rank() == 0 )
{
const int ikp_loc = ikp / MPIdata::nkpb();
const int ikpb = ikp % MPIdata::nkpb();
if ( ikpb == MPIdata::ikpb() )
ostr.str("");
isrc = MPIdata::rank();
const int nst = sd(isp_loc,ikp_loc)->nst();
ostr << " <occ spin=\"" << ispin
<< "\" kpoint=\""
<< setprecision(8)
<< sd(isp_loc,ikp_loc)->kpoint()
<< "\" weight=\""
<< setprecision(8)
<< weight(ikp)
<< "\" n=\"" << nst << "\">" << endl;
for ( int i = 0; i < nst; i++ )
{
cout << " k = " << kpoint_[ikp] << endl;
for ( int n = 0; n < sd_[isp_loc][ikp_loc]->nst(); n++ )
{
cout << setw(7) << setprecision(4)
<< sd_[isp_loc][ikp_loc]->occ(n);
if ( ( n%10 ) == 9 ) cout << endl;
}
if ( sd_[ispin][ikp]->nst() % 10 != 0 )
cout << endl;
ostr << setw(7) << setprecision(4)
<< sd(isp_loc,ikp_loc)->occ(i);
if ( i%10 == 9 ) ostr << endl;
}
if ( nst%10 != 0 ) ostr << endl;
ostr << " </occ>" << endl;
}
}
cout0(ostr.str(),isrc);
MPI_Barrier(MPIdata::comm());
}
}
if ( MPIdata::onpe0() )
cout << "</occ_set>" << endl;
MPI_Barrier(MPIdata::comm());
}
}
......@@ -1102,21 +1116,19 @@ void Wavefunction::info(ostream& os, string tag) const
for ( int ispin = 0; ispin < nspin(); ++ispin )
{
const int isp_loc = isp_local(ispin);
for ( int ikp = 0; ikp < nkp(); ++ikp )
{
for ( int ikp = 0; ikp < nkp(); ++ikp )
const int ikp_loc = ikp_local(ikp);
string s;
int isrc = -1;
if ( ( isp_loc >= 0 ) && ( ikp_loc >= 0 ) )
{
const int ikp_loc = ikp_local(ikp);
string s;
int isrc = -1;
if ( ( isp_loc >= 0 ) && ( ikp_loc >= 0 ) )
{
s = sd_[isp_loc][ikp_loc]->info();
if ( MPIdata::sd_rank() == 0 )
isrc = MPIdata::rank();
}
cout0(s,isrc);
MPI_Barrier(MPIdata::comm());
s = sd_[isp_loc][ikp_loc]->info();
if ( MPIdata::sd_rank() == 0 )
isrc = MPIdata::rank();
}
cout0(s,isrc);
MPI_Barrier(MPIdata::comm());
}
}
......
......@@ -19,5 +19,5 @@
#include "release.h"
std::string release(void)
{
return std::string("rel1_72_1");
return std::string("rel1_72_1dev");
}
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