diff -Naur lammps-2Jan08/doc/fix_nve_limit.html lammps-3Jan08/doc/fix_nve_limit.html --- lammps-2Jan08/doc/fix_nve_limit.html 2007-10-10 16:28:11.000000000 -0600 +++ lammps-3Jan08/doc/fix_nve_limit.html 2008-01-02 17:29:17.000000000 -0700 @@ -54,11 +54,22 @@
No information about this fix is written to binary restart files. None of the fix_modify options -are relevant to this fix. No global scalar or vector or per-atom -quantities are stored by this fix for access by various output -commands. No parameter of this fix can be -used with the start/stop keywords of the run command. -This fix is not invoked during energy minimization. +are relevant to this fix. +
+This fix computes a scalar quantity which is the count of how many +updates of atom's velocity/position were limited by the maximum +distance criterion. This should be roughly the number of atoms so +affected, except that updates occur at both the beginning and end of a +timestep in a velocity Verlet timestepping algorithm. This is a +cummulative quantity for the current run, but is re-initialized to +zero each time a run is performed. This value can be accessed by +various output commands. The scalar value +calculated by this fix is "extensive", meaning it scales with the +number of atoms in the simulation. +
+No parameter of this fix can be used with the start/stop keywords of +the run command. This fix is not invoked during energy +minimization.
Restrictions: none
diff -Naur lammps-2Jan08/doc/fix_nve_limit.txt lammps-3Jan08/doc/fix_nve_limit.txt --- lammps-2Jan08/doc/fix_nve_limit.txt 2007-10-10 16:28:11.000000000 -0600 +++ lammps-3Jan08/doc/fix_nve_limit.txt 2008-01-02 17:29:17.000000000 -0700 @@ -51,11 +51,22 @@ No information about this fix is written to "binary restart files"_restart.html. None of the "fix_modify"_fix_modify.html options -are relevant to this fix. No global scalar or vector or per-atom -quantities are stored by this fix for access by various "output -commands"_Section_howto.html#4_15. No parameter of this fix can be -used with the {start/stop} keywords of the "run"_run.html command. -This fix is not invoked during "energy minimization"_minimize.html. +are relevant to this fix. + +This fix computes a scalar quantity which is the count of how many +updates of atom's velocity/position were limited by the maximum +distance criterion. This should be roughly the number of atoms so +affected, except that updates occur at both the beginning and end of a +timestep in a velocity Verlet timestepping algorithm. This is a +cummulative quantity for the current run, but is re-initialized to +zero each time a run is performed. This value can be accessed by +various "output commands"_Section_howto.html#4_15. The scalar value +calculated by this fix is "extensive", meaning it scales with the +number of atoms in the simulation. + +No parameter of this fix can be used with the {start/stop} keywords of +the "run"_run.html command. This fix is not invoked during "energy +minimization"_minimize.html. [Restrictions:] none diff -Naur lammps-2Jan08/src/fix_nve_limit.cpp lammps-3Jan08/src/fix_nve_limit.cpp --- lammps-2Jan08/src/fix_nve_limit.cpp 2007-10-10 16:22:16.000000000 -0600 +++ lammps-3Jan08/src/fix_nve_limit.cpp 2008-01-02 17:30:07.000000000 -0700 @@ -31,6 +31,10 @@ { if (narg != 4) error->all("Illegal fix nve/limit command"); + scalar_flag = 1; + scalar_vector_freq = 1; + extscalar = 1; + xlimit = atof(arg[3]); } @@ -53,6 +57,7 @@ dtv = update->dt; dtf = 0.5 * update->dt * force->ftm2v; vlimitsq = (xlimit/dtv) * (xlimit/dtv); + ncount = 0; if (strcmp(update->integrate_style,"respa") == 0) step_respa = ((Respa *) update->integrate)->step; @@ -85,6 +90,7 @@ vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]; if (vsq > vlimitsq) { + ncount++; scale = sqrt(vlimitsq/vsq); v[i][0] *= scale; v[i][1] *= scale; @@ -107,6 +113,7 @@ vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]; if (vsq > vlimitsq) { + ncount++; scale = sqrt(vlimitsq/vsq); v[i][0] *= scale; v[i][1] *= scale; @@ -145,6 +152,7 @@ vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]; if (vsq > vlimitsq) { + ncount++; scale = sqrt(vlimitsq/vsq); v[i][0] *= scale; v[i][1] *= scale; @@ -163,6 +171,7 @@ vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]; if (vsq > vlimitsq) { + ncount++; scale = sqrt(vlimitsq/vsq); v[i][0] *= scale; v[i][1] *= scale; @@ -202,3 +211,15 @@ dtf = 0.5 * update->dt * force->ftm2v; vlimitsq = (xlimit/dtv) * (xlimit/dtv); } + +/* ---------------------------------------------------------------------- + energy of indenter interaction +------------------------------------------------------------------------- */ + +double FixNVELimit::compute_scalar() +{ + double one = ncount; + double all; + MPI_Allreduce(&one,&all,1,MPI_DOUBLE,MPI_SUM,world); + return all; +} diff -Naur lammps-2Jan08/src/fix_nve_limit.h lammps-3Jan08/src/fix_nve_limit.h --- lammps-2Jan08/src/fix_nve_limit.h 2007-10-10 16:22:16.000000000 -0600 +++ lammps-3Jan08/src/fix_nve_limit.h 2008-01-02 17:30:07.000000000 -0700 @@ -28,11 +28,12 @@ void initial_integrate_respa(int, int); void final_integrate_respa(int); void reset_dt(); + double compute_scalar(); private: double dtv,dtf; double *step_respa; - int mass_require; + int mass_require,ncount; double xlimit,vlimitsq; }; diff -Naur lammps-2Jan08/src/neighbor.cpp lammps-3Jan08/src/neighbor.cpp --- lammps-2Jan08/src/neighbor.cpp 2007-12-06 09:50:01.000000000 -0700 +++ lammps-3Jan08/src/neighbor.cpp 2008-01-02 17:30:07.000000000 -0700 @@ -434,7 +434,7 @@ } // detect lists that are connected to other lists - // if-the-else sequence is important + // if-then-else sequence is important // since don't want to re-process skip or copy lists further down // skip: point this list at request->otherlist, copy skip info from request // copy: point this list at request->otherlist