changes to the output text

This commit is contained in:
Ilkka Kylanpaa 2018-01-22 10:14:09 -05:00
parent fad9f96b64
commit 1368295955
1 changed files with 51 additions and 36 deletions

View File

@ -200,19 +200,16 @@ bool MomentumEstimator::putSpecial(xmlNodePtr cur, ParticleSet& elns, bool rootN
} }
kgrid = int(kmax/min_Length)+1; kgrid = int(kmax/min_Length)+1;
} }
if (sum_kmaxs<1.0e-10)
{
app_log()<<" Using all k-space points with (kx^2+ky^2+kz^2)^0.5 < "<< kmax <<" for Momentum Distribution."<< std::endl;
}
else
{
app_log()<<" Using all k-space points within cut-offs "<< kmax0 << ", " << kmax1 << ", " << kmax2 <<" for Momentum Distribution."<< std::endl;
}
app_log()<<" My twist is: "<<twist[0]<<" "<<twist[1]<<" "<<twist[2]<< std::endl;
int kgrid_squared[OHMMS_DIM]; int kgrid_squared[OHMMS_DIM];
for (int i=0; i<OHMMS_DIM; i++) for (int i=0; i<OHMMS_DIM; i++)
kgrid_squared[i]=int(std::round(kmaxs[i]*kmaxs[i]/vec_length[i]/vec_length[i])); kgrid_squared[i]=int(std::round(kmaxs[i]*kmaxs[i]/vec_length[i]/vec_length[i]));
RealType kmax_squared=kmax*kmax; RealType kmax_squared=kmax*kmax;
std::vector<int> kcount0;
std::vector<int> kcount1;
std::vector<int> kcount2;
kcount0.resize(2*kgrid+1,0);
kcount1.resize(2*kgrid+1,0);
kcount2.resize(2*kgrid+1,0);
for (int i=-kgrid; i<(kgrid+1); i++) for (int i=-kgrid; i<(kgrid+1); i++)
{ {
for (int j=-kgrid; j<(kgrid+1); j++) for (int j=-kgrid; j<(kgrid+1); j++)
@ -234,11 +231,7 @@ bool MomentumEstimator::putSpecial(xmlNodePtr cur, ParticleSet& elns, bool rootN
} }
else else
{ {
if (i*i<=kgrid_squared[0]) if (i*i<=kgrid_squared[0] && j*j<=kgrid_squared[1] && k*k<=kgrid_squared[2])
{
if (j*j<=kgrid_squared[1])
{
if (k*k<=kgrid_squared[2])
{ {
PosType kpt; PosType kpt;
kpt[0]=i-twist[0]; kpt[0]=i-twist[0];
@ -247,13 +240,38 @@ bool MomentumEstimator::putSpecial(xmlNodePtr cur, ParticleSet& elns, bool rootN
//convert to Cartesian: note that 2Pi is multiplied //convert to Cartesian: note that 2Pi is multiplied
kpt=Lattice.k_cart(kpt); kpt=Lattice.k_cart(kpt);
kPoints.push_back(kpt); kPoints.push_back(kpt);
kcount0[kgrid+i]=1;
kcount1[kgrid+j]=1;
kcount2[kgrid+k]=1;
} }
} }
} }
} }
} }
if (sum_kmaxs<1.0e-10)
{
app_log()<<" Using all k-space points with (kx^2+ky^2+kz^2)^0.5 < "<< kmax <<" for Momentum Distribution."<< std::endl;
app_log()<<" Total number of k-points for Momentum Distribution is "<< kPoints.size() << std::endl;
} }
else
{
int sums[3];
sums[0]=0;
sums[1]=0;
sums[2]=0;
for (int i=0; i<2*kgrid+1; i++)
{
sums[0]+=kcount0[i];
sums[1]+=kcount1[i];
sums[2]+=kcount2[i];
} }
app_log()<<" Using all k-space points within cut-offs "<< kmax0 << ", " << kmax1 << ", " << kmax2 <<" for Momentum Distribution."<< std::endl;
app_log()<<" Total number of k-points for Momentum Distribution is "<< kPoints.size() << std::endl;
app_log()<<" Number of k-points in kmax0 direction " << sums[0] << std::endl;
app_log()<<" Number of k-points in kmax1 direction " << sums[1] << std::endl;
app_log()<<" Number of k-points in kmax2 direction " << sums[2] << std::endl;
}
app_log()<<" My twist is: "<<twist[0]<<" "<<twist[1]<<" "<<twist[2]<< std::endl;
#endif #endif
#if OHMMS_DIM==2 #if OHMMS_DIM==2
PosType kmaxs(0); PosType kmaxs(0);
@ -306,9 +324,7 @@ bool MomentumEstimator::putSpecial(xmlNodePtr cur, ParticleSet& elns, bool rootN
} }
else else
{ {
if (i*i<=kgrid_squared[0]) if (i*i<=kgrid_squared[0] && j*j<=kgrid_squared[1])
{
if (j*j<=kgrid_squared[1])
{ {
PosType kpt; PosType kpt;
kpt[0]=i-twist[0]; kpt[0]=i-twist[0];
@ -320,7 +336,6 @@ bool MomentumEstimator::putSpecial(xmlNodePtr cur, ParticleSet& elns, bool rootN
} }
} }
} }
}
#endif #endif
if (rootNode) if (rootNode)
{ {