forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14876 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
98ed24437d
commit
4314ef01f6
|
@ -64,10 +64,13 @@ FixMomentum::FixMomentum(LAMMPS *lmp, int narg, char **arg) :
|
|||
zflag < 0 || zflag > 1)
|
||||
error->all(FLERR,"Illegal fix momentum command");
|
||||
|
||||
// cannot have 0 atoms in group
|
||||
|
||||
if (group->count(igroup) == 0)
|
||||
error->all(FLERR,"Fix momentum group has no atoms");
|
||||
dynamic_group_allow = 1;
|
||||
if (group->dynamic[igroup]) {
|
||||
dynamic = 1;
|
||||
} else {
|
||||
if (group->count(igroup) == 0)
|
||||
error->all(FLERR,"Fix momentum group has no atoms");
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
@ -96,6 +99,13 @@ void FixMomentum::end_of_step()
|
|||
double ekin_old,ekin_new;
|
||||
ekin_old = ekin_new = 0.0;
|
||||
|
||||
if (dynamic)
|
||||
masstotal = group->mass(igroup);
|
||||
|
||||
// do nothing is group is empty, i.e. mass is zero;
|
||||
|
||||
if (masstotal == 0.0) return;
|
||||
|
||||
// compute kinetic energy before momentum removal, if needed
|
||||
|
||||
if (rescale) {
|
||||
|
|
|
@ -34,6 +34,7 @@ class FixMomentum : public Fix {
|
|||
private:
|
||||
int linear,angular,rescale;
|
||||
int xflag,yflag,zflag;
|
||||
int dynamic;
|
||||
double masstotal;
|
||||
};
|
||||
|
||||
|
|
|
@ -307,6 +307,15 @@ double KSpace::estimate_table_accuracy(double q2_over_sqrt, double spr)
|
|||
{
|
||||
double table_accuracy = 0.0;
|
||||
int nctb = force->pair->ncoultablebits;
|
||||
if (comm->me == 0) {
|
||||
char str[128];
|
||||
if (nctb)
|
||||
sprintf(str,"Using %d-bit tables for long-range coulomb",nctb);
|
||||
else
|
||||
sprintf(str,"Using polynomial approximation for long-range coulomb");
|
||||
error->warning(FLERR,str);
|
||||
}
|
||||
|
||||
if (nctb) {
|
||||
double empirical_precision[17];
|
||||
empirical_precision[6] = 6.99E-03;
|
||||
|
|
Loading…
Reference in New Issue