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>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> <LI>keyword = <I>linear</I> or <I>angular</I>
@ -31,12 +32,14 @@
</UL> </UL>
<P><B>Examples:</B> <P><B>Examples:</B>
</P> </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> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>
<P>Zero the linear and/or angular momentum of the group of atoms every N <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>
<P>If the <I>linear</I> keyword is used, the linear momentum is zeroed by <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. 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). thermostatting).
</P> </P>
<P>Note that the <A HREF = "velocity.html">velocity</A> command can be used to create <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>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </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 ID, group-ID are documented in "fix"_fix.html command :ulb,l
momentum = style name of this fix command :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 one or more keyword/value pairs may be appended to the args :l
keyword = {linear} or {angular} :l keyword = {linear} or {angular} :l
{linear} values = xflag yflag zflag {linear} values = xflag yflag zflag
@ -24,12 +24,14 @@ keyword = {linear} or {angular} :l
[Examples:] [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:] [Description:]
Zero the linear and/or angular momentum of the group of atoms every N 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 If the {linear} keyword is used, the linear momentum is zeroed by
subtracting the center-of-mass velocity of the group from each atom. 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). thermostatting).
Note that the "velocity"_velocity.html command can be used to create 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 [Restrictions:] none

View File

@ -33,7 +33,10 @@
</UL> </UL>
<P><B>Examples:</B> <P><B>Examples:</B>
</P> </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> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>

View File

@ -25,7 +25,9 @@ keyword = {shift} or {units} :l
[Examples:] [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:] [Description:]

View File

@ -27,7 +27,7 @@
FixMomentum::FixMomentum(int narg, char **arg) : Fix(narg, arg) 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]); nevery = atoi(arg[3]);
if (nevery <= 0) error->all("Illegal fix momentum command"); 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]; dy = (x[i][1] + ybox*yprd) - cm[1];
dz = (x[i][2] + zbox*zprd) - cm[2]; dz = (x[i][2] + zbox*zprd) - cm[2];
if (mass_require) massone = mass[type[i]]; 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[0] += massone * (dy*v[i][2] - dz*v[i][1]);
p[1] += massone * (dz*v[i][0] - dx*v[i][2]); p[1] += massone * (dz*v[i][0] - dx*v[i][2]);
p[2] += massone * (dx*v[i][1] - dy*v[i][0]); p[2] += massone * (dx*v[i][1] - dy*v[i][0]);

View File

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