diff -Naur lammps-22Jun09/doc/fix_freeze.html lammps-23Jun09/doc/fix_freeze.html --- lammps-22Jun09/doc/fix_freeze.html 2007-10-10 16:28:11.000000000 -0600 +++ lammps-23Jun09/doc/fix_freeze.html 2009-06-22 14:49:14.000000000 -0600 @@ -25,17 +25,27 @@
Description:
Zero out the force and torque on a granular particle. This is useful -for preventing certain particles from moving in a simulation. +for preventing certain particles from moving in a simulation. The +granular pair styles also detect if this fix has been +defined and compute interactions between frozen and non-frozen +particles appropriately, as if the frozen particle has infinite mass.
Restart, fix_modify, output, run start/stop, minimize info:
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 3-vector of forces, which can be accessed by +various output commands. This is the total +force on the group of atoms before the forces on individual atoms are +changed by the fix. The vector values calculated by this fix are +"extensive", meaning they scale 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:
@@ -44,9 +54,9 @@ LAMMPS section for more info.There can only be a single freeze fix defined. This is because other -parts of the code (pair potentials, thermodynamics, etc) treat frozen -particles differently and need to be able to reference a single group -to which this fix is applied. +the granular pair styles treat frozen particles +differently and need to be able to reference a single group to which +this fix is applied.
Related commands: none
diff -Naur lammps-22Jun09/doc/fix_freeze.txt lammps-23Jun09/doc/fix_freeze.txt --- lammps-22Jun09/doc/fix_freeze.txt 2007-10-10 16:28:11.000000000 -0600 +++ lammps-23Jun09/doc/fix_freeze.txt 2009-06-22 14:49:14.000000000 -0600 @@ -22,17 +22,27 @@ [Description:] Zero out the force and torque on a granular particle. This is useful -for preventing certain particles from moving in a simulation. +for preventing certain particles from moving in a simulation. The +"granular pair styles"_pair_gran.html also detect if this fix has been +defined and compute interactions between frozen and non-frozen +particles appropriately, as if the frozen particle has infinite mass. [Restart, fix_modify, output, run start/stop, minimize info:] 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 3-vector of forces, which can be accessed by +various "output commands"_Section_howto.html#4_15. This is the total +force on the group of atoms before the forces on individual atoms are +changed by the fix. The vector values calculated by this fix are +"extensive", meaning they scale 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:] @@ -41,9 +51,9 @@ LAMMPS"_Section_start.html#2_3 section for more info. There can only be a single freeze fix defined. This is because other -parts of the code (pair potentials, thermodynamics, etc) treat frozen -particles differently and need to be able to reference a single group -to which this fix is applied. +the "granular pair styles"_pair_gran.html treat frozen particles +differently and need to be able to reference a single group to which +this fix is applied. [Related commands:] none diff -Naur lammps-22Jun09/doc/pair_reax.html lammps-23Jun09/doc/pair_reax.html --- lammps-22Jun09/doc/pair_reax.html 2009-06-03 13:59:51.000000000 -0600 +++ lammps-23Jun09/doc/pair_reax.html 2009-06-22 14:49:58.000000000 -0600 @@ -39,7 +39,8 @@LAMMPS provides a ReaxFF potential file in its potentials dir, namely potentials/ffield.reax. Its format is identical to that used by van Duin and co-workers. It contains parameterizations for the following -elements: C, H, O, N, S, and Si. You can use your another file in +elements: C, H, O, N, S (Si has been temporarily removed). +You can use another file in place of it, and ReaxFF files with parameterizations for other elements or for specific chemical systems may be available elsewhere.
diff -Naur lammps-22Jun09/src/GRANULAR/fix_freeze.cpp lammps-23Jun09/src/GRANULAR/fix_freeze.cpp --- lammps-22Jun09/src/GRANULAR/fix_freeze.cpp 2009-04-15 07:05:53.000000000 -0600 +++ lammps-23Jun09/src/GRANULAR/fix_freeze.cpp 2009-06-22 14:48:55.000000000 -0600 @@ -31,6 +31,14 @@ if (!atom->torque_flag) error->all("Fix freeze requires atom attribute torque"); + + vector_flag = 1; + size_vector = 3; + scalar_vector_freq = 1; + extvector = 1; + + force_flag = 0; + foriginal[0] = foriginal[1] = foriginal[2] = 0.0; } /* ---------------------------------------------------------------------- */ @@ -82,8 +90,14 @@ int nlocal = atom->nlocal; if (igroup == atom->firstgroup) nlocal = atom->nfirst; + foriginal[0] = foriginal[1] = foriginal[2] = 0.0; + force_flag = 0; + for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { + foriginal[0] += f[i][0]; + foriginal[1] += f[i][1]; + foriginal[2] += f[i][2]; f[i][0] = 0.0; f[i][1] = 0.0; f[i][2] = 0.0; @@ -100,3 +114,17 @@ post_force(vflag); } +/* ---------------------------------------------------------------------- + return components of total force on fix group before force was changed +------------------------------------------------------------------------- */ + +double FixFreeze::compute_vector(int n) +{ + // only sum across procs one time + + if (force_flag == 0) { + MPI_Allreduce(foriginal,foriginal_all,3,MPI_DOUBLE,MPI_SUM,world); + force_flag = 1; + } + return foriginal_all[n]; +} diff -Naur lammps-22Jun09/src/GRANULAR/fix_freeze.h lammps-23Jun09/src/GRANULAR/fix_freeze.h --- lammps-22Jun09/src/GRANULAR/fix_freeze.h 2009-04-15 07:05:53.000000000 -0600 +++ lammps-23Jun09/src/GRANULAR/fix_freeze.h 2009-06-22 14:48:55.000000000 -0600 @@ -26,6 +26,11 @@ void setup(int); void post_force(int); void post_force_respa(int, int, int); + double compute_vector(int); + + private: + int force_flag; + double foriginal[3],foriginal_all[3]; }; }