Added kmax/ewald keyword

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10852 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
athomps 2013-10-03 22:20:29 +00:00
parent 19496d9756
commit 7b71c0dfd5
2 changed files with 21 additions and 0 deletions

View File

@ -46,6 +46,8 @@ KSpace::KSpace(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
overlap_allowed = 1;
fftbench = 1;
kewaldflag = 0;
order_6 = 5;
gridflag_6 = 0;
gewaldflag_6 = 0;
@ -434,6 +436,18 @@ void KSpace::modify_params(int narg, char **arg)
else if (strcmp(arg[iarg+1],"no") == 0) adjust_cutoff_flag = 0;
else error->all(FLERR,"Illegal kspace_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"kmax/ewald") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal kspace_modify command");
kx_ewald = atoi(arg[iarg+1]);
ky_ewald = atoi(arg[iarg+2]);
kz_ewald = atoi(arg[iarg+3]);
if (kx_ewald < 0 || ky_ewald < 0 || kz_ewald < 0)
error->all(FLERR,"Bad kspace_modify kmax/ewald parameter");
if (kx_ewald > 0 && ky_ewald > 0 && kz_ewald > 0)
kewaldflag = 1;
else
kewaldflag = 0;
iarg += 4;
} else error->all(FLERR,"Illegal kspace_modify command");
}
}

View File

@ -160,6 +160,9 @@ class KSpace : protected Pointers {
int vflag_either,vflag_global,vflag_atom;
int maxeatom,maxvatom;
int kewaldflag; // 1 if kspace range set for Ewald sum
int kx_ewald,ky_ewald,kz_ewald; // kspace settings for Ewald sum
void pair_check();
void ev_setup(int, int);
double estimate_table_accuracy(double, double);
@ -199,6 +202,10 @@ E: Bad kspace_modify slab parameter
Kspace_modify value for the slab/volume keyword must be >= 2.0.
E: Bad kspace_modify kmax/ewald parameter
Kspace_modify values for the kmax/ewald keyword must be integers > 0
W: Kspace_modify slab param < 2.0 may cause unphysical behavior
The kspace_modify slab parameter should be larger to insure periodic