diff --git a/doc/Manual.html b/doc/Manual.html index 1287022592..e1449e8090 100644 --- a/doc/Manual.html +++ b/doc/Manual.html @@ -22,7 +22,7 @@

LAMMPS-ICMS Documentation

-

9 Aug 2013 version +

12 Aug 2013 version

Version info:

diff --git a/doc/Manual.txt b/doc/Manual.txt index 3faf07d40d..89ba7cfc68 100644 --- a/doc/Manual.txt +++ b/doc/Manual.txt @@ -18,7 +18,7 @@

LAMMPS-ICMS Documentation :c,h3 -9 Aug 2013 version :c,h4 +12 Aug 2013 version :c,h4 Version info: :h4 diff --git a/doc/Section_packages.html b/doc/Section_packages.html index 7db318937d..1b80327bc0 100644 --- a/doc/Section_packages.html +++ b/doc/Section_packages.html @@ -51,10 +51,10 @@ packages, more details are provided. FLD Fast Lubrication Dynamics Kumar & Bybee & Higdon (1) pair_style lubricateU - - GPU GPU-enabled potentials Mike Brown (ORNL) Section accelerate gpu lib/gpu GRANULAR granular systems - Section_howto pour - -KIM openKIM potentials Smirichinski & Elliot & Tadmor (3) pair_style kim kim lib/kim +KIM openKIM potentials Smirichinski & Elliot & Tadmor (3) pair_style kim kim KIM KSPACE long-range Coulombic solvers - kspace_style peptide - MANYBODY many-body potentials - pair_style tersoff shear - -MEAM modified EAM potential Greg Wagner (Sandia) pair_style meam meam KIM +MEAM modified EAM potential Greg Wagner (Sandia) pair_style meam meam lib/meam MC Monte Carlo options - fix gcmc - - MOLECULE molecular system force fields - Section_howto peptide - OPT optimized pair potentials Fischer & Richie & Natoli (2) Section accelerate - - @@ -97,10 +97,10 @@ lib/package, then the code for the library is under the lib directory of the LAMMPS distribution. See the lib/package/README file for info on how to build the library. If it is not listed as lib/package, then it is a third-party library not included in the LAMMPS distribution. -See the src/package/Makefile.lammps file for info on where to download -the library. Section start of the -manual also gives details on how to build LAMMPS with both kinds of -auxiliary libraries. +See the src/package/README or src/package/Makefile.lammps file for +info on where to download the library. Section +start of the manual also gives details +on how to build LAMMPS with both kinds of auxiliary libraries.


diff --git a/doc/Section_packages.txt b/doc/Section_packages.txt index be14e6fa9c..144c7a77af 100644 --- a/doc/Section_packages.txt +++ b/doc/Section_packages.txt @@ -46,10 +46,10 @@ DIPOLE, point dipole particles, -, "pair_style dipole/cut"_pair_dipole.html, dip FLD, Fast Lubrication Dynamics, Kumar & Bybee & Higdon (1), "pair_style lubricateU"_pair_lubricateU.html, -, - GPU, GPU-enabled potentials, Mike Brown (ORNL), "Section accelerate"_Section_accelerate.html#acc_6, gpu, lib/gpu GRANULAR, granular systems, -, "Section_howto"_Section_howto.html#howto_6, pour, - -KIM, openKIM potentials, Smirichinski & Elliot & Tadmor (3), "pair_style kim"_pair_kim.html, kim, lib/kim +KIM, openKIM potentials, Smirichinski & Elliot & Tadmor (3), "pair_style kim"_pair_kim.html, kim, KIM KSPACE, long-range Coulombic solvers, -, "kspace_style"_kspace_style.html, peptide, - MANYBODY, many-body potentials, -, "pair_style tersoff"_pair_tersoff.html, shear, - -MEAM, modified EAM potential, Greg Wagner (Sandia), "pair_style meam"_pair_meam.html, meam, KIM +MEAM, modified EAM potential, Greg Wagner (Sandia), "pair_style meam"_pair_meam.html, meam, lib/meam MC, Monte Carlo options, -, "fix gcmc"_fix_gcmc.html, -, - MOLECULE, molecular system force fields, -, "Section_howto"_Section_howto.html#howto_3, peptide, - OPT, optimized pair potentials, Fischer & Richie & Natoli (2), "Section accelerate"_Section_accelerate.html#acc_4, -, - @@ -91,10 +91,10 @@ lib/package, then the code for the library is under the lib directory of the LAMMPS distribution. See the lib/package/README file for info on how to build the library. If it is not listed as lib/package, then it is a third-party library not included in the LAMMPS distribution. -See the src/package/Makefile.lammps file for info on where to download -the library. "Section start"_Section_start.html#start_3_3 of the -manual also gives details on how to build LAMMPS with both kinds of -auxiliary libraries. +See the src/package/README or src/package/Makefile.lammps file for +info on where to download the library. "Section +start"_Section_start.html#start_3_3 of the manual also gives details +on how to build LAMMPS with both kinds of auxiliary libraries. :line :line diff --git a/doc/fix_external.html b/doc/fix_external.html index 788079d6e9..717bc456e4 100644 --- a/doc/fix_external.html +++ b/doc/fix_external.html @@ -47,7 +47,7 @@ script.

If mode is pf/callback then the fix will make a callback every -Ncall timesteps or minimization iteration to the external program. +Ncall timesteps or minimization iterations to the external program. The external program computes forces on atoms by setting values in an array owned by the fix. The fix then adds these forces to each atom in the group, once every Napply steps, similar to the way the fix @@ -89,29 +89,70 @@ array. The fix adds these forces to each atom in the group, once every Napply steps, similar to the way the fix addforce command works.

+

The name of the public force array provided by the FixExternal +class is +

+
double **fexternal; 
+
+

It is allocated by the FixExternal class as an (N,3) array where N is +the number of atoms owned by a processor. The 3 corresponds to the +fx, fy, fz components of force. +

It is up to the external program to set the values in this array to the desired quantities, as often as desired. For example, the driver program might perform an MD run in stages of 1000 timesteps each. In between calls to the LAMMPS run command, it could retrieve -atom coordinates from LAMMPS, compute forces, set values in the fix -external array, etc. +atom coordinates from LAMMPS, compute forces, set values in fexternal, +etc. +

+
+ +

To use this fix during energy minimization, the energy corresponding +to the added forces must also be set so as to be consistent with the +added forces. Otherwise the minimization will not converge correctly. +

+

This can be done from the external driver by calling this public +method of the FixExternal class: +

+
void set_energy(double eng); 
+
+

where eng is the potential energy. Eng is an extensive quantity, +meaning it should be the sum over per-atom energies of all affected +atoms. It should also be provided in energy units +consistent with the simulation. See the details below for how to +insure this energy setting is used appropriately in a minimization.


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 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. +files. +

+

The fix_modify energy option is supported by this +fix to add the potential "energy" set by the external driver to the +system's potential energy as part of thermodynamic +output. This is a fictitious quantity but is +needed so that the minimize command can include the +forces added by this fix in a consistent manner. I.e. there is a +decrease in potential energy when atoms move in the direction of the +added force. +

+

This fix computes a global scalar which can be accessed by various +output commands. The scalar is the +potential energy discussed above. The scalar stored by this fix +is "extensive". +

+

No parameter of this fix can be used with the start/stop keywords of +the run command.

The forces due to this fix are imposed during an energy minimization, -invoked by the minimize command. However, LAMMPS -knows nothing about the energy associated with these forces. So you -should perform the minimization based on a force tolerance, not an -energy tolerance. +invoked by the minimize command. +

+

IMPORTANT NOTE: If you want the fictitious potential energy associated +with the added forces to be included in the total potential energy of +the system (the quantity being minimized), you MUST enable the +fix_modify energy option for this fix.

Restrictions: none

diff --git a/doc/fix_external.txt b/doc/fix_external.txt index 80bead420e..1b06214e61 100644 --- a/doc/fix_external.txt +++ b/doc/fix_external.txt @@ -40,7 +40,7 @@ script"_Section_python.html. :line If mode is {pf/callback} then the fix will make a callback every -{Ncall} timesteps or minimization iteration to the external program. +{Ncall} timesteps or minimization iterations to the external program. The external program computes forces on atoms by setting values in an array owned by the fix. The fix then adds these forces to each atom in the group, once every {Napply} steps, similar to the way the "fix @@ -82,29 +82,70 @@ array. The fix adds these forces to each atom in the group, once every {Napply} steps, similar to the way the "fix addforce"_fix_addforce.html command works. +The name of the public force array provided by the FixExternal +class is + +double **fexternal; :pre + +It is allocated by the FixExternal class as an (N,3) array where N is +the number of atoms owned by a processor. The 3 corresponds to the +fx, fy, fz components of force. + It is up to the external program to set the values in this array to the desired quantities, as often as desired. For example, the driver program might perform an MD run in stages of 1000 timesteps each. In between calls to the LAMMPS "run"_run.html command, it could retrieve -atom coordinates from LAMMPS, compute forces, set values in the fix -external array, etc. +atom coordinates from LAMMPS, compute forces, set values in fexternal, +etc. + +:line + +To use this fix during energy minimization, the energy corresponding +to the added forces must also be set so as to be consistent with the +added forces. Otherwise the minimization will not converge correctly. + +This can be done from the external driver by calling this public +method of the FixExternal class: + +void set_energy(double eng); :pre + +where eng is the potential energy. Eng is an extensive quantity, +meaning it should be the sum over per-atom energies of all affected +atoms. It should also be provided in "energy units"_units.html +consistent with the simulation. See the details below for how to +insure this energy setting is used appropriately in a minimization. :line [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 or per-atom quantities are stored -by this fix for access by various "output -commands"_Section_howto.html#howto_15. No parameter of this fix can -be used with the {start/stop} keywords of the "run"_run.html command. +files"_restart.html. + +The "fix_modify"_fix_modify.html {energy} option is supported by this +fix to add the potential "energy" set by the external driver to the +system's potential energy as part of "thermodynamic +output"_thermo_style.html. This is a fictitious quantity but is +needed so that the "minimize"_minimize.html command can include the +forces added by this fix in a consistent manner. I.e. there is a +decrease in potential energy when atoms move in the direction of the +added force. + +This fix computes a global scalar which can be accessed by various +"output commands"_Section_howto.html#howto_15. The scalar is the +potential energy discussed above. The scalar stored by this fix +is "extensive". + +No parameter of this fix can be used with the {start/stop} keywords of +the "run"_run.html command. The forces due to this fix are imposed during an energy minimization, -invoked by the "minimize"_minimize.html command. However, LAMMPS -knows nothing about the energy associated with these forces. So you -should perform the minimization based on a force tolerance, not an -energy tolerance. +invoked by the "minimize"_minimize.html command. + +IMPORTANT NOTE: If you want the fictitious potential energy associated +with the added forces to be included in the total potential energy of +the system (the quantity being minimized), you MUST enable the +"fix_modify"_fix_modify.html {energy} option for this fix. [Restrictions:] none diff --git a/doc/fix_qeq_reax.html b/doc/fix_qeq_reax.html index 7c53630d11..8524f5a69a 100644 --- a/doc/fix_qeq_reax.html +++ b/doc/fix_qeq_reax.html @@ -100,7 +100,7 @@ be used for periodic cell dimensions less than 10 angstroms.

-

(Aktulga) Aktulga, Fogarty, Pandit, Grama, Parallel Computing, to -appear (2011). +

(Aktulga) Aktulga, Fogarty, Pandit, Grama, Parallel Computing, 38, +245-259 (2012).

diff --git a/doc/fix_qeq_reax.txt b/doc/fix_qeq_reax.txt index a89163d5b3..3a899e1e3a 100644 --- a/doc/fix_qeq_reax.txt +++ b/doc/fix_qeq_reax.txt @@ -94,5 +94,5 @@ be used for periodic cell dimensions less than 10 angstroms. [(Nakano)] Nakano, Computer Physics Communications, 104, 59-69 (1997). :link(Aktulga) -[(Aktulga)] Aktulga, Fogarty, Pandit, Grama, Parallel Computing, to -appear (2011). +(Aktulga) Aktulga, Fogarty, Pandit, Grama, Parallel Computing, 38, +245-259 (2012). diff --git a/doc/pair_reax_c.html b/doc/pair_reax_c.html index 05a0aa3f02..a9d78ac2a5 100644 --- a/doc/pair_reax_c.html +++ b/doc/pair_reax_c.html @@ -316,8 +316,8 @@ Journal of Physical Chemistry A, 112, 1040-1053 (2008).

-

(Aktulga) Aktulga, Fogarty, Pandit, Grama, Parallel Computing, to -appear (2011). +

(Aktulga) Aktulga, Fogarty, Pandit, Grama, Parallel Computing, 38, +245-259 (2012).

diff --git a/doc/pair_reax_c.txt b/doc/pair_reax_c.txt index 74dcef8e66..5a3d8ed3a5 100644 --- a/doc/pair_reax_c.txt +++ b/doc/pair_reax_c.txt @@ -308,8 +308,8 @@ mincap = 50. Journal of Physical Chemistry A, 112, 1040-1053 (2008). :link(Aktulga) -[(Aktulga)] Aktulga, Fogarty, Pandit, Grama, Parallel Computing, to -appear (2011). +(Aktulga) Aktulga, Fogarty, Pandit, Grama, Parallel Computing, 38, +245-259 (2012). :link(Liu_2011) [(Liu)] L. Liu, Y. Liu, S. V. Zybin, H. Sun and W. A. Goddard, Journal diff --git a/examples/voronoi/in.voronoi b/examples/voronoi/in.voronoi index 671a7c9b54..a9af704608 100644 --- a/examples/voronoi/in.voronoi +++ b/examples/voronoi/in.voronoi @@ -92,7 +92,7 @@ undump d1 # # TEST 4: Edge histogram tests # -compute v1 type2 voronoi/atom edge_histo 6 +compute v1 type2 voronoi/atom edge_histo 8 thermo_style custom c_v1[1] c_v1[2] c_v1[3] c_v1[4] c_v1[5] c_v1[6] c_v1[7] run 1 variable t4a equal (abs(c_v1[4]-12000)+c_v1[1]+c_v1[2]+c_v1[3]+c_v1[5]+c_v1[6]+c_v1[7])/120 @@ -150,6 +150,5 @@ uncompute v1 uncompute r0 undump d1 - # All tests done print TEST_DONE diff --git a/src/dump_image.cpp b/src/dump_image.cpp index 536dd9e33a..2f302354b8 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -47,11 +47,12 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : { if (binary || multiproc) error->all(FLERR,"Invalid dump image filename"); - // set filetype based on filename suffix - // _and_ turn on the binary flag so we don't get corrupted - // output on windows. + // force binary flag on to avoid corrupted output on Windows + binary = 1; + // set filetype based on filename suffix + int n = strlen(filename); if (strlen(filename) > 4 && strcmp(&filename[n-4],".jpg") == 0) filetype = JPG; diff --git a/src/fix_external.cpp b/src/fix_external.cpp index fffc57c72c..a09dd62ffd 100644 --- a/src/fix_external.cpp +++ b/src/fix_external.cpp @@ -33,6 +33,10 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : { if (narg < 4) error->all(FLERR,"Illegal fix external command"); + scalar_flag = 1; + global_freq = 1; + extscalar = 1; + if (strcmp(arg[3],"pf/callback") == 0) { if (narg != 6) error->all(FLERR,"Illegal fix external command"); mode = PF_CALLBACK; @@ -55,6 +59,8 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : fexternal = NULL; grow_arrays(atom->nmax); atom->add_callback(0); + + user_energy = 0.0; } /* ---------------------------------------------------------------------- */ @@ -75,6 +81,7 @@ int FixExternal::setmask() int mask = 0; if (mode == PF_CALLBACK || mode == PF_ARRAY) { mask |= POST_FORCE; + mask |= THERMO_ENERGY; mask |= MIN_POST_FORCE; } return mask; @@ -138,6 +145,23 @@ void FixExternal::min_post_force(int vflag) post_force(vflag); } +/* ---------------------------------------------------------------------- */ + +void FixExternal::set_energy(double eng) +{ + user_energy = eng; +} + +/* ---------------------------------------------------------------------- + potential energy of added force + up to user to set it via set_energy() +------------------------------------------------------------------------- */ + +double FixExternal::compute_scalar() +{ + return user_energy; +} + /* ---------------------------------------------------------------------- memory usage of local atom-based array ------------------------------------------------------------------------- */ diff --git a/src/fix_external.h b/src/fix_external.h index e6bea2d111..437519e54d 100644 --- a/src/fix_external.h +++ b/src/fix_external.h @@ -26,6 +26,8 @@ namespace LAMMPS_NS { class FixExternal : public Fix { public: + double **fexternal; + FixExternal(class LAMMPS *, int, char **); ~FixExternal(); int setmask(); @@ -34,6 +36,9 @@ class FixExternal : public Fix { void min_setup(int); void post_force(int); void min_post_force(int); + double compute_scalar(); + + void set_energy(double eng); double memory_usage(); void grow_arrays(int); @@ -48,7 +53,7 @@ class FixExternal : public Fix { int mode,ncall,napply; FnPtr callback; void *ptr_caller; - double **fexternal; + double user_energy; }; } diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index dd55d1c3ad..d4eb9718a1 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -534,15 +534,12 @@ void FixLangevin::post_force_untemplated if (Tp_BIAS) { temperature->remove_bias(i,v[i]); + fdrag[0] = gamma1*v[i][0]; fdrag[1] = gamma1*v[i][1]; fdrag[2] = gamma1*v[i][2]; - fdrag[0] = gamma1*v[i][0]; - if (v[i][0] != 0.0) f[i][0] += fdrag[0] + fran[0]; - else fran[0] = 0.0; - if (v[i][1] != 0.0) f[i][1] += fdrag[1] + fran[1]; - else fran[1] = 0.0; - if (v[i][2] != 0.0) f[i][2] += fdrag[2] + fran[2]; - else fran[2] = 0.0; + if (v[i][0] == 0.0) fran[0] = 0.0; + if (v[i][1] == 0.0) fran[1] = 0.0; + if (v[i][2] == 0.0) fran[2] = 0.0; temperature->restore_bias(i,v[i]); } else { fdrag[0] = gamma1*v[i][0]; diff --git a/src/fix_shake.cpp b/src/fix_shake.cpp index 584c05a7f2..c010004cb0 100644 --- a/src/fix_shake.cpp +++ b/src/fix_shake.cpp @@ -413,9 +413,15 @@ void FixShake::setup(int vflag) dtv = step_respa[0]; dtf_innerhalf = 0.5 * step_respa[0] * force->ftm2v; dtf_inner = dtf_innerhalf; - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); - post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + + // apply correction to all rRESPA levels + + for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { + ((Respa *) update->integrate)->copy_flevel_f(ilevel); + post_force_respa(vflag,ilevel,loop_respa[ilevel]-1); + ((Respa *) update->integrate)->copy_f_flevel(ilevel); + } + dtf_inner = step_respa[0] * force->ftm2v; } } @@ -543,10 +549,12 @@ void FixShake::post_force_respa(int vflag, int ilevel, int iloop) if (ilevel == nlevels_respa-1 && update->ntimestep == next_output) stats(); - // enforce SHAKE constraints on every loop iteration of every rRESPA level - // except last loop iteration of inner levels + // might be OK to skip enforcing SHAKE constraings + // on last iteration of inner levels if pressure not requested + // however, leads to slightly different trajectories - if (ilevel < nlevels_respa-1 && iloop == loop_respa[ilevel]-1) return; + //if (ilevel < nlevels_respa-1 && iloop == loop_respa[ilevel]-1 && !vflag) + // return; // xshake = unconstrained move with current v,f as function of level // communicate results if necessary @@ -554,9 +562,12 @@ void FixShake::post_force_respa(int vflag, int ilevel, int iloop) unconstrained_update_respa(ilevel); if (nprocs > 1) comm->forward_comm_fix(this); - // virial setup, only need to compute on outermost level + // virial setup only needed on last iteration of innermost level + // and if pressure is requested + // virial accumulation happens at outermost level - if (ilevel == nlevels_respa-1 && vflag) v_setup(vflag); + if (ilevel == 0 && iloop == loop_respa[ilevel] - 1 && vflag) v_setup(vflag); + if (iloop == loop_respa[ilevel]-1) evflag = 1; else evflag = 0; // loop over clusters to add constraint forces diff --git a/src/neigh_derive.cpp b/src/neigh_derive.cpp index dbf5fe258a..5de3750968 100644 --- a/src/neigh_derive.cpp +++ b/src/neigh_derive.cpp @@ -439,9 +439,13 @@ void Neighbor::skip_from_respa(NeighList *list) if (ipage_middle->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one"); } + + inum++; } list->inum = inum; + listinner->inum = inum; + if (respamiddle) listmiddle->inum = inum; } /* ---------------------------------------------------------------------- diff --git a/src/respa.cpp b/src/respa.cpp index bc20a505f7..65da00b165 100644 --- a/src/respa.cpp +++ b/src/respa.cpp @@ -286,7 +286,8 @@ void Respa::init() ev_setup(); - // detect if fix omp is present and will clear force arrays for us + // detect if fix omp is present and will clear force arrays + int ifix = modify->find_fix("package_omp"); if (ifix >= 0) external_force_clear = 1; diff --git a/src/version.h b/src/version.h index c809e0595f..d2a51b3ce2 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "9 Aug 2013" +#define LAMMPS_VERSION "12 Aug 2013"