mirror of https://github.com/QMCPACK/qmcpack.git
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:
parent
dda2520044
commit
d4218411a3
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue