Making initial estimate for g_ewald more robust and better documented.

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8448 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
pscrozi 2012-06-29 22:25:31 +00:00
parent a8338a0263
commit 4323d1522a
4 changed files with 12 additions and 10 deletions

View File

@ -157,10 +157,11 @@ void Ewald::init()
// zprd used rather than zprd_slab
if (!gewaldflag) {
if (accuracy <= 0.0)
error->all(FLERR,"KSpace accuracy must be > 0");
g_ewald = accuracy*sqrt(natoms*cutoff*xprd*yprd*zprd) / (2.0*q2);
if (g_ewald >= 1.0)
error->all(FLERR,"KSpace accuracy too large to estimate G vector");
g_ewald = sqrt(-log(g_ewald)) / cutoff;
if (g_ewald >= 1.0) g_ewald = (1.35 - 0.15*log(accuracy))/cutoff;
else g_ewald = sqrt(-log(g_ewald)) / cutoff;
}
// setup Ewald coefficients so can print stats

View File

@ -119,9 +119,9 @@ W: System is not charge neutral, net charge = %g
The total charge on all atoms on the system is not 0.0, which
is not valid for Ewald or PPPM.
E: KSpace accuracy too large to estimate G vector
E: KSpace accuracy must be > 0
UNDOCUMENTED
The kspace accuracy designated in the input must be greater than zero.
E: Cannot (yet) use Kspace slab correction with compute group/group

View File

@ -1003,10 +1003,11 @@ void PPPM::set_grid()
bigint natoms = atom->natoms;
if (!gewaldflag) {
if (accuracy <= 0.0)
error->all(FLERR,"KSpace accuracy must be > 0");
g_ewald = accuracy*sqrt(natoms*cutoff*xprd*yprd*zprd) / (2.0*q2);
if (g_ewald >= 1.0)
error->all(FLERR,"KSpace accuracy too large to estimate G vector");
g_ewald = sqrt(-log(g_ewald)) / cutoff;
if (g_ewald >= 1.0) g_ewald = (1.35 - 0.15*log(accuracy))/cutoff;
else g_ewald = sqrt(-log(g_ewald)) / cutoff;
}
// set optimal nx_pppm,ny_pppm,nz_pppm based on order and accuracy

View File

@ -245,9 +245,9 @@ to run, but can reduce the order no further. Try increasing the
accuracy of PPPM by reducing the tolerance size, thus inducing a
larger PPPM grid.
E: KSpace accuracy too large to estimate G vector
E: KSpace accuracy must be > 0
UNDOCUMENTED
The kspace accuracy designated in the input must be greater than zero.
E: Cannot compute PPPM G