git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14876 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -64,10 +64,13 @@ FixMomentum::FixMomentum(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
zflag < 0 || zflag > 1)
|
zflag < 0 || zflag > 1)
|
||||||
error->all(FLERR,"Illegal fix momentum command");
|
error->all(FLERR,"Illegal fix momentum command");
|
||||||
|
|
||||||
// cannot have 0 atoms in group
|
dynamic_group_allow = 1;
|
||||||
|
if (group->dynamic[igroup]) {
|
||||||
|
dynamic = 1;
|
||||||
|
} else {
|
||||||
if (group->count(igroup) == 0)
|
if (group->count(igroup) == 0)
|
||||||
error->all(FLERR,"Fix momentum group has no atoms");
|
error->all(FLERR,"Fix momentum group has no atoms");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -96,6 +99,13 @@ void FixMomentum::end_of_step()
|
|||||||
double ekin_old,ekin_new;
|
double ekin_old,ekin_new;
|
||||||
ekin_old = ekin_new = 0.0;
|
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
|
// compute kinetic energy before momentum removal, if needed
|
||||||
|
|
||||||
if (rescale) {
|
if (rescale) {
|
||||||
|
|||||||
@ -34,6 +34,7 @@ class FixMomentum : public Fix {
|
|||||||
private:
|
private:
|
||||||
int linear,angular,rescale;
|
int linear,angular,rescale;
|
||||||
int xflag,yflag,zflag;
|
int xflag,yflag,zflag;
|
||||||
|
int dynamic;
|
||||||
double masstotal;
|
double masstotal;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -307,6 +307,15 @@ double KSpace::estimate_table_accuracy(double q2_over_sqrt, double spr)
|
|||||||
{
|
{
|
||||||
double table_accuracy = 0.0;
|
double table_accuracy = 0.0;
|
||||||
int nctb = force->pair->ncoultablebits;
|
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) {
|
if (nctb) {
|
||||||
double empirical_precision[17];
|
double empirical_precision[17];
|
||||||
empirical_precision[6] = 6.99E-03;
|
empirical_precision[6] = 6.99E-03;
|
||||||
|
|||||||
Reference in New Issue
Block a user