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

This commit is contained in:
sjplimp 2006-10-02 20:21:36 +00:00
parent 05c701121c
commit e38d289fb6
7 changed files with 23 additions and 12 deletions

View File

@ -19,7 +19,8 @@
<LI>momentum = style name of this fix command
<LI>one or more keyword/value pairs may be appended to the args
<LI>N = adjust the momentum every this many timesteps
one or more keyword/value pairs may be appended to the args
<LI>keyword = <I>linear</I> or <I>angular</I>
@ -31,12 +32,14 @@
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all momentum 1 linear 1 1 0 angular
<PRE>fix 1 all momentum 1 linear 1 1 0
fix 1 all momentum 100 linear 1 1 1 angular
</PRE>
<P><B>Description:</B>
</P>
<P>Zero the linear and/or angular momentum of the group of atoms every N
timesteps by adjusting the velocities of the atoms.
timesteps by adjusting the velocities of the atoms. One (or both) of
the <I>linear</I> or <I>angular</I> keywords must be specified.
</P>
<P>If the <I>linear</I> keyword is used, the linear momentum is zeroed by
subtracting the center-of-mass velocity of the group from each atom.
@ -53,7 +56,7 @@ to random perturbations (e.g. <A HREF = "fix_langevin.html">fix langevin</A>
thermostatting).
</P>
<P>Note that the <A HREF = "velocity.html">velocity</A> command can be used to create
velocities with zero aggregate linear and/or angular momentum.
initial velocities with zero aggregate linear and/or angular momentum.
</P>
<P><B>Restrictions:</B> none
</P>

View File

@ -14,7 +14,7 @@ fix ID group-ID momentum N keyword values ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
momentum = style name of this fix command :l
N = adjust the momentum every this many timesteps
one or more keyword/value pairs may be appended to the args :l
keyword = {linear} or {angular} :l
{linear} values = xflag yflag zflag
@ -24,12 +24,14 @@ keyword = {linear} or {angular} :l
[Examples:]
fix 1 all momentum 1 linear 1 1 0 angular :pre
fix 1 all momentum 1 linear 1 1 0
fix 1 all momentum 100 linear 1 1 1 angular :pre
[Description:]
Zero the linear and/or angular momentum of the group of atoms every N
timesteps by adjusting the velocities of the atoms.
timesteps by adjusting the velocities of the atoms. One (or both) of
the {linear} or {angular} keywords must be specified.
If the {linear} keyword is used, the linear momentum is zeroed by
subtracting the center-of-mass velocity of the group from each atom.
@ -46,7 +48,7 @@ to random perturbations (e.g. "fix langevin"_fix_langevin.html
thermostatting).
Note that the "velocity"_velocity.html command can be used to create
velocities with zero aggregate linear and/or angular momentum.
initial velocities with zero aggregate linear and/or angular momentum.
[Restrictions:] none

View File

@ -33,7 +33,10 @@
</UL>
<P><B>Examples:</B>
</P>
<PRE>fix 1 all recenter 1 1 1 0
<PRE>fix 1 all recenter 0.0 0.5 0.0
</PRE>
<PRE>fix 1 all recenter INIT INIT NULL
fix 1 all recenter INIT 0.0 0.0 units box
</PRE>
<P><B>Description:</B>
</P>

View File

@ -25,7 +25,9 @@ keyword = {shift} or {units} :l
[Examples:]
fix 1 all recenter 1 1 1 0 :pre
fix 1 all recenter 0.0 0.5 0.0 :pre
fix 1 all recenter INIT INIT NULL
fix 1 all recenter INIT 0.0 0.0 units box :pre
[Description:]

View File

@ -27,7 +27,7 @@
FixMomentum::FixMomentum(int narg, char **arg) : Fix(narg, arg)
{
if (narg != 7) error->all("Illegal fix momentum command");
if (narg < 4) error->all("Illegal fix momentum command");
nevery = atoi(arg[3]);
if (nevery <= 0) error->all("Illegal fix momentum command");

View File

@ -699,7 +699,7 @@ void Group::angmom(int igroup, double *cm, double *lmom)
dy = (x[i][1] + ybox*yprd) - cm[1];
dz = (x[i][2] + zbox*zprd) - cm[2];
if (mass_require) massone = mass[type[i]];
massone = rmass[i];
else massone = rmass[i];
p[0] += massone * (dy*v[i][2] - dz*v[i][1]);
p[1] += massone * (dz*v[i][0] - dx*v[i][2]);
p[2] += massone * (dx*v[i][1] - dy*v[i][0]);

View File

@ -18,6 +18,7 @@
#include "mpi.h"
#include "string.h"
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
#include "pppm.h"
#include "atom.h"