diff -Naur lammps-17Aug09/doc/Section_start.html lammps-18Aug09/doc/Section_start.html --- lammps-17Aug09/doc/Section_start.html 2009-08-13 11:12:38.000000000 -0600 +++ lammps-18Aug09/doc/Section_start.html 2009-08-14 15:20:35.000000000 -0600 @@ -764,9 +764,9 @@

When using GPUs, you are restricted to one physical GPU per LAMMPS process. This can be multiple GPUs on a single node or across multiple nodes. For each GPU pair style, the first two arguments (GPU -mode followed by GPU parameter) control how GPUs are selected. If you -are running on a single node, the mode is "one/node" and the parameter -is the ID of the first GPU to select: +mode followed by GPU ID) control how GPUs are selected. If you are +running on a single node, the mode is "one/node" and the parameter is +the ID of the first GPU to select:

pair_style lj/cut/gpu one/node 0 2.5 
 
diff -Naur lammps-17Aug09/doc/Section_start.txt lammps-18Aug09/doc/Section_start.txt --- lammps-17Aug09/doc/Section_start.txt 2009-08-13 11:12:38.000000000 -0600 +++ lammps-18Aug09/doc/Section_start.txt 2009-08-14 15:20:35.000000000 -0600 @@ -757,9 +757,9 @@ When using GPUs, you are restricted to one physical GPU per LAMMPS process. This can be multiple GPUs on a single node or across multiple nodes. For each GPU pair style, the first two arguments (GPU -mode followed by GPU parameter) control how GPUs are selected. If you -are running on a single node, the mode is "one/node" and the parameter -is the ID of the first GPU to select: +mode followed by GPU ID) control how GPUs are selected. If you are +running on a single node, the mode is "one/node" and the parameter is +the ID of the first GPU to select: pair_style lj/cut/gpu one/node 0 2.5 :pre diff -Naur lammps-17Aug09/src/min_linesearch.cpp lammps-18Aug09/src/min_linesearch.cpp --- lammps-17Aug09/src/min_linesearch.cpp 2009-08-14 14:54:10.000000000 -0600 +++ lammps-18Aug09/src/min_linesearch.cpp 2009-08-18 10:13:16.000000000 -0600 @@ -498,37 +498,7 @@ ecurrent = energy_force(1); nfunc++; - // if backtracking energy change is better than ideal, exit with success - - de_ideal = -BACKTRACK_SLOPE*alpha0*fdothall; - de = ecurrent - eoriginal; - if (de <= de_ideal || de_ideal >= -IDEAL_TOL) { - alpha = alpha0; - return 0; - } - - // drop back from alpha0 to alpha - - if (nextra_global) modify->min_step(0.0,hextra); - for (i = 0; i < n3; i++) x[i] = x0[i]; - if (nextra_atom) - for (m = 0; m < nextra_atom; m++) { - xatom = xextra_atom[m]; - x0atom = x0extra_atom[m]; - n = extra_nlen[m]; - for (i = 0; i < n; i++) xatom[i] = x0atom[i]; - } - if (nextra_global) modify->min_step(alpha,hextra); - for (i = 0; i < n3; i++) x[i] += alpha*h[i]; - if (nextra_atom) - for (m = 0; m < nextra_atom; m++) { - xatom = xextra_atom[m]; - hatom = hextra_atom[m]; - n = extra_nlen[m]; - for (i = 0; i < n; i++) xatom[i] += alpha*hatom[i]; - } - ecurrent = energy_force(1); - nfunc++; + return 0; } // if backtracking energy change is better than ideal, exit with success diff -Naur lammps-17Aug09/src/velocity.cpp lammps-18Aug09/src/velocity.cpp --- lammps-17Aug09/src/velocity.cpp 2009-07-14 07:50:43.000000000 -0600 +++ lammps-18Aug09/src/velocity.cpp 2009-08-18 09:27:33.000000000 -0600 @@ -50,15 +50,16 @@ void Velocity::command(int narg, char **arg) { - // require atom masses to all be set + if (narg < 2) error->all("Illegal velocity command"); if (domain->box_exist == 0) error->all("Velocity command before simulation box is defined"); if (atom->natoms == 0) error->all("Velocity command with no atoms existing"); - atom->check_mass(); - if (narg < 2) error->all("Illegal velocity command"); + // atom masses must all be set + + atom->check_mass(); // identify group @@ -109,23 +110,44 @@ } // initialize velocities based on style + // create() invoked differently, so can be called externally - if (style == CREATE) create(narg-2,&arg[2]); + if (style == CREATE) { + double t_desired = atof(arg[2]); + int seed = atoi(arg[3]); + create(t_desired,seed); + } else if (style == SET) set(narg-2,&arg[2]); else if (style == SCALE) scale(narg-2,&arg[2]); else if (style == RAMP) ramp(narg-2,&arg[2]); else if (style == ZERO) zero(narg-2,&arg[2]); } +/* ---------------------------------------------------------------------- + initialization of defaults before calling velocity methods externaly +------------------------------------------------------------------------- */ + +void Velocity::init_external(char *extgroup) +{ + igroup = group->find(extgroup); + if (igroup == -1) error->all("Could not find velocity group ID"); + groupbit = group->bitmask[igroup]; + + temperature = NULL; + dist_flag = 0; + sum_flag = 0; + momentum_flag = 1; + rotation_flag = 0; + loop_flag = ALL; + scale_flag = 1; +} + /* ---------------------------------------------------------------------- */ -void Velocity::create(int narg, char **arg) +void Velocity::create(double t_desired, int seed) { int i; - double t_desired = atof(arg[0]); - int seed = atoi(arg[1]); - if (seed <= 0) error->all("Illegal velocity create command"); // if temperature = NULL, create a new ComputeTemp with the velocity group diff -Naur lammps-17Aug09/src/velocity.h lammps-18Aug09/src/velocity.h --- lammps-17Aug09/src/velocity.h 2007-06-20 07:17:59.000000000 -0600 +++ lammps-18Aug09/src/velocity.h 2009-08-18 09:27:23.000000000 -0600 @@ -22,6 +22,9 @@ public: Velocity(class LAMMPS *); void command(int, char **); + void init_external(char *); + void options(int, char **); + void create(double, int); private: int igroup,groupbit; @@ -30,7 +33,6 @@ double xscale,yscale,zscale; class Compute *temperature; - void create(int, char **); void set(int, char **); void scale(int, char **); void ramp(int, char **); @@ -39,8 +41,6 @@ void rescale(double, double); void zero_momentum(); void zero_rotation(); - - void options(int, char **); }; }