git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13129 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
pscrozi
2015-02-19 23:17:27 +00:00
parent 58f6f56953
commit ccac6df71d
2 changed files with 7 additions and 2 deletions

View File

@ -70,6 +70,7 @@ KSpace::KSpace(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
adjust_cutoff_flag = 1;
scalar_pressure_flag = 0;
warn_nonneutral = 1;
warn_nocharge = 1;
accuracy_absolute = -1.0;
accuracy_real_6 = -1.0;
@ -279,8 +280,10 @@ void KSpace::qsum_qsq()
MPI_Allreduce(&qsum_local,&qsum,1,MPI_DOUBLE,MPI_SUM,world);
MPI_Allreduce(&qsqsum_local,&qsqsum,1,MPI_DOUBLE,MPI_SUM,world);
if (qsqsum == 0.0)
error->all(FLERR,"Cannot use kspace solver on system with no charge");
if ((qsqsum == 0.0) && (comm->me == 0) && warn_nocharge) {
error->warning(FLERR,"Using kspace solver on system with no charge");
warn_nocharge = 0;
}
q2 = qsqsum * force->qqrd2e;

View File

@ -56,6 +56,8 @@ class KSpace : protected Pointers {
int warn_nonneutral; // 0 = error if non-neutral system
// 1 = warn once if non-neutral system
// 2 = warn, but already warned
int warn_nocharge; // 0 = already warned
// 1 = warn if zero charge
int order,order_6,order_allocated;
double accuracy; // accuracy of KSpace solver (force units)