Put extra electrons in charged system around molecular center rather than on top of one and another

git-svn-id: https://subversion.assembla.com/svn/qmcdev/trunk@5708 e5b18d87-469d-4833-9cc0-8cdfa06e9491
This commit is contained in:
Luke Shulenburger 2013-02-15 17:11:39 +00:00
parent dda2520044
commit d4218411a3
1 changed files with 26 additions and 0 deletions

View File

@ -121,7 +121,10 @@ namespace qmcplusplus {
vector<LoneElectron> loneQ;
double rmin=cutoff;
ParticleSet::SingleParticlePos_t cm;
for(int iat=0; iat<Centers; iat++) {
cm += ions->R[iat];
for(int nn=d_ii->M[iat]; nn<d_ii->M[iat+1]; nn++){
rmin = std::min(rmin,d_ii->r(nn));
}
@ -148,6 +151,29 @@ namespace qmcplusplus {
++it;
}
//extra electrons around the geometric center
double cnorm=1.0/static_cast<double>(Centers);
cm=cnorm*cm;
if(nup_tot<numUp)
{
double sep=rmin*2;
int iu=0;
while(nup_tot<numUp)
{
els->R[nup_tot++]=cm+sep*chi[iu++];
}
}
if(ndown_tot<numDown)
{
double sep=rmin*2;
int iu=0;
while(ndown_tot<numDown)
{
els->R[ndown_tot++]=cm+sep*chi[iu++];
}
}
//put all the electrons in a unit box
if(els->Lattice.SuperCellEnum != SUPERCELL_OPEN)
{