From 23febc71011057716696fd650da7d785e63c39e6 Mon Sep 17 00:00:00 2001 From: Oliver Henrich Date: Fri, 24 Jan 2020 14:19:18 +0000 Subject: [PATCH 01/13] Increased tolerance for fatal error in FENE bond argument --- src/USER-CGDNA/bond_oxdna_fene.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/USER-CGDNA/bond_oxdna_fene.cpp b/src/USER-CGDNA/bond_oxdna_fene.cpp index 1cb332df8f..834b53a5c7 100644 --- a/src/USER-CGDNA/bond_oxdna_fene.cpp +++ b/src/USER-CGDNA/bond_oxdna_fene.cpp @@ -221,7 +221,7 @@ void BondOxdnaFene::compute(int eflag, int vflag) TAGINT_FORMAT " " TAGINT_FORMAT " %g", update->ntimestep,atom->tag[a],atom->tag[b],r); error->warning(FLERR,str,0); - if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond"); + if (rlogarg <= -8.0) error->one(FLERR,"Bad FENE bond"); } fbond = -k[type]*rr0/rlogarg/Deltasq/r; @@ -421,7 +421,7 @@ double BondOxdnaFene::single(int type, double rsq, int /*i*/, int /*j*/, sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %g", update->ntimestep,sqrt(rsq)); error->warning(FLERR,str,0); - if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond"); + if (rlogarg <= -8.0) error->one(FLERR,"Bad FENE bond"); } double eng = -0.5 * k[type]*log(rlogarg); From 5962e880d47419f484eb4d61bf2295685c62baf1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 29 Jan 2020 14:33:36 -0500 Subject: [PATCH 02/13] remove some unneeded backslash escapes --- doc/src/angle_cosine_buck6d.rst | 6 +++--- doc/src/angle_cosine_shift.rst | 2 +- doc/src/angle_cosine_shift_exp.rst | 4 ++-- doc/src/bond_harmonic_shift_cut.rst | 2 +- doc/src/compute_fep.rst | 2 +- doc/src/pair_thole.rst | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/src/angle_cosine_buck6d.rst b/doc/src/angle_cosine_buck6d.rst index bb024c3474..86f22b9ec4 100644 --- a/doc/src/angle_cosine_buck6d.rst +++ b/doc/src/angle_cosine_buck6d.rst @@ -46,9 +46,9 @@ internally. Additional to the cosine term the *cosine/buck6d* angle style computes the short range (vdW) interaction belonging to the -:doc:`pair\_buck6d ` between the end atoms of the +:doc:`pair_style buck6d ` between the end atoms of the angle. For this reason this angle style only works in combination -with the :doc:`pair\_buck6d ` styles and needs +with the :doc:`pair_style buck6d ` styles and needs the :doc:`special_bonds ` 1-3 interactions to be weighted 0.0 to prevent double counting. @@ -61,7 +61,7 @@ Restrictions *cosine/buck6d* can only be used in combination with the -:doc:`pair\_buck6d ` style and with a +:doc:`pair_style buck6d ` style and with a :doc:`special_bonds ` 0.0 weighting of 1-3 interactions. This angle style can only be used if LAMMPS was built with the diff --git a/doc/src/angle_cosine_shift.rst b/doc/src/angle_cosine_shift.rst index 00b494bc08..b4c5f9c38d 100644 --- a/doc/src/angle_cosine_shift.rst +++ b/doc/src/angle_cosine_shift.rst @@ -83,6 +83,6 @@ Related commands """""""""""""""" :doc:`angle_coeff `, -:doc:`angle\_cosine\_shift\_exp ` +:doc:`angle_style cosine/shift/exp ` **Default:** none diff --git a/doc/src/angle_cosine_shift_exp.rst b/doc/src/angle_cosine_shift_exp.rst index ae810f9f33..40117df221 100644 --- a/doc/src/angle_cosine_shift_exp.rst +++ b/doc/src/angle_cosine_shift_exp.rst @@ -94,7 +94,7 @@ Related commands """""""""""""""" :doc:`angle_coeff `, -:doc:`angle\_cosine\_shift `, -:doc:`dihedral\_cosine\_shift\_exp ` +:doc:`angle_style cosine/shift `, +:doc:`dihedral_style cosine/shift/exp ` **Default:** none diff --git a/doc/src/bond_harmonic_shift_cut.rst b/doc/src/bond_harmonic_shift_cut.rst index 6b7e7d4fbb..4a2dcbb4b2 100644 --- a/doc/src/bond_harmonic_shift_cut.rst +++ b/doc/src/bond_harmonic_shift_cut.rst @@ -86,6 +86,6 @@ Related commands :doc:`bond_coeff `, :doc:`delete_bonds `, :doc:`bond_harmonic `, -:doc:`bond\_harmonic\_shift ` +:doc:`bond_style harmonic/shift ` **Default:** none diff --git a/doc/src/compute_fep.rst b/doc/src/compute_fep.rst index 0f2fdc18c1..7d6c76bb45 100644 --- a/doc/src/compute_fep.rst +++ b/doc/src/compute_fep.rst @@ -301,7 +301,7 @@ Related commands """""""""""""""" :doc:`fix adapt/fep `, :doc:`fix ave/time `, -:doc:`pair\_fep\_soft ` +:doc:`pair_style .../soft ` Default """"""" diff --git a/doc/src/pair_thole.rst b/doc/src/pair_thole.rst index 9f8cb67714..e2ee506d3d 100644 --- a/doc/src/pair_thole.rst +++ b/doc/src/pair_thole.rst @@ -53,7 +53,7 @@ describes how to use the :doc:`thermalized Drude oscillator model ` discussed on the :doc:`Howto polarizable ` doc page. The *thole* pair style should be used as a sub-style within in the -:doc:`pair\_hybrid/overlay ` command, in conjunction with a +:doc:`pair_style hybrid/overlay ` command, in conjunction with a main pair style including Coulomb interactions, i.e. any pair style containing *coul/cut* or *coul/long* in its style name. From ccd395fdd896b6a2c14a6d16a5677eb6cc3ca84a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 29 Jan 2020 14:34:03 -0500 Subject: [PATCH 03/13] remove dead code --- src/neighbor.cpp | 7 ------- src/neighbor.h | 1 - 2 files changed, 8 deletions(-) diff --git a/src/neighbor.cpp b/src/neighbor.cpp index b62945f116..3d1f37a03b 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -402,13 +402,6 @@ void Neighbor::init() } } - // maxwt = max multiplicative factor on atom indices stored in neigh list - - maxwt = 0; - if (special_flag[1] == 2) maxwt = 2; - if (special_flag[2] == 2) maxwt = 3; - if (special_flag[3] == 2) maxwt = 4; - // ------------------------------------------------------------------ // xhold array diff --git a/src/neighbor.h b/src/neighbor.h index 50de4b4c98..8fe423c60c 100644 --- a/src/neighbor.h +++ b/src/neighbor.h @@ -166,7 +166,6 @@ class Neighbor : protected Pointers { int maxatom; // max size of atom-based NeighList arrays int maxrequest; // max size of NeighRequest list - int maxwt; // max weighting factor applied + 1 // info for other Neigh classes: NBin,NStencil,NPair,NTopo From 0613790b6bb4ecb66f414e484737815c0279d4be Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 29 Jan 2020 17:23:11 -0500 Subject: [PATCH 04/13] support having the keyword special multiple times after pair in pair_modify --- src/pair_hybrid.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index b88fa49a85..fe319da9e9 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -859,14 +859,17 @@ void PairHybrid::modify_params(int narg, char **arg) iarg = 3; } - // if 2nd keyword (after pair) is special: - // invoke modify_special() for the sub-style + // keywords "special" and "compute/tally" have to be listed directly + // after "pair" but can be given multiple times + +again: if (iarg < narg && strcmp(arg[iarg],"special") == 0) { if (narg < iarg+5) error->all(FLERR,"Illegal pair_modify special command"); modify_special(m,narg-iarg,&arg[iarg+1]); iarg += 5; + goto again; } // if 2nd keyword (after pair) is compute/tally: @@ -881,11 +884,13 @@ void PairHybrid::modify_params(int narg, char **arg) compute_tally[m] = 0; } else error->all(FLERR,"Illegal pair_modify compute/tally command"); iarg += 2; + goto again; } - // apply the remaining keywords to the base pair style itself and the - // sub-style except for "pair" and "special". - // the former is important for some keywords like "tail" or "compute" + // apply the remaining keywords to the base pair style itself and + // the sub-style except for "pair" and "special" or "compute/tally" + // and their arguments. the former is important for some keywords + // like "tail" or "compute" if (narg-iarg > 0) { Pair::modify_params(narg-iarg,&arg[iarg]); From eb7958d04ccb94d15a462a75be84f5b047e1c1a3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 30 Jan 2020 12:50:19 -0500 Subject: [PATCH 05/13] update documentation for pair_modify to reflect code changes and clarify the use of special --- doc/src/pair_modify.rst | 239 +++++++++++++++++++++------------------- 1 file changed, 127 insertions(+), 112 deletions(-) diff --git a/doc/src/pair_modify.rst b/doc/src/pair_modify.rst index dee1390234..7694279e20 100644 --- a/doc/src/pair_modify.rst +++ b/doc/src/pair_modify.rst @@ -13,18 +13,14 @@ Syntax * one or more keyword/value pairs may be listed * keyword = *pair* or *shift* or *mix* or *table* or *table/disp* or *tabinner* - or *tabinner/disp* or *tail* or *compute* or *nofdotr* + or *tabinner/disp* or *tail* or *compute* or *nofdotr* or *special* or + *compute/tally* .. parsed-literal:: - *pair* values = sub-style N *special* which wt1 wt2 wt3 - or sub-style N *compute/tally* flag + *pair* value = sub-style N sub-style = sub-style of :doc:`pair hybrid ` - N = which instance of sub-style (only if sub-style is used multiple times) - *special* which wt1 wt2 wt3 = override *special_bonds* settings (optional) - which = *lj/coul* or *lj* or *coul* - w1,w2,w3 = 1-2, 1-3, and 1-4 weights from 0.0 to 1.0 inclusive - *compute/tally* flag = *yes* or *no* + N = which instance of sub-style (1 to M), only specify if sub-style is used multiple times *mix* value = *geometric* or *arithmetic* or *sixthpower* *shift* value = *yes* or *no* *table* value = N @@ -37,8 +33,11 @@ Syntax cutoff = inner cutoff at which to begin table (distance units) *tail* value = *yes* or *no* *compute* value = *yes* or *no* - *nofdotr* - + *nofdotr* value = none + *special* values = which wt1 wt2 wt3 + which = *lj/coul* or *lj* or *coul* + w1,w2,w3 = 1-2, 1-3, 1-4 weights from 0.0 to 1.0 inclusive + *compute/tally* value = *yes* or *no* Examples @@ -53,47 +52,40 @@ Examples pair_modify pair lj/cut compute no pair_modify pair tersoff compute/tally no pair_modify pair lj/cut/coul/long 1 special lj/coul 0.0 0.0 0.0 + pair_modify pair lj/cut/coul/long special lj 0.0 0.0 0.5 special coul 0.0 0.0 0.8333333 Description """"""""""" -Modify the parameters of the currently defined pair style. Not all -parameters are relevant to all pair styles. +Modify the parameters of the currently defined pair style. If the +pair style is :doc:`hybrid or hybrid/overlay `, then the +specified parameters are by default modified for all the hybrid sub-styles. -If used, the *pair* keyword must appear first in the list of keywords. -It can only be used with the :doc:`hybrid and hybrid/overlay ` pair styles. It means that all the -following parameters will only be modified for the specified -sub-style. If the sub-style is defined multiple times, then an -additional numeric argument *N* must also be specified, which is a -number from 1 to M where M is the number of times the sub-style was -listed in the :doc:`pair_style hybrid ` command. The extra -number indicates which instance of the sub-style the remaining -keywords will be applied to. Note that if the *pair* keyword is not -used, and the pair style is *hybrid* or *hybrid/overlay*\ , then all the -specified keywords will be applied to all sub-styles. +.. note:: -The *special* and *compute/tally* keywords can **only** be used in -conjunction with the *pair* keyword and must directly follow it. -*special* allows to override the -:doc:`special_bonds ` settings for the specified sub-style. -*compute/tally* allows to disable or enable registering -:doc:`compute \*/tally ` computes for a given sub-style. -More details are given below. + The behavior for hybrid pair styles can be changed by using the *pair* + keyword, which allows to select a specific sub-style to apply a setting to. + The *special* and *compute/tally* keywords can **only** be + used in conjunction with the *pair* keyword. See further details about + these 3 keywords below. The *mix* keyword affects pair coefficients for interactions between atoms of type I and J, when I != J and the coefficients are not explicitly set in the input script. Note that coefficients for I = J must be set explicitly, either in the input script via the -"pair\_coeff" command or in the "Pair Coeffs" section of the :doc:`data file `. For some pair styles it is not necessary to -specify coefficients when I != J, since a "mixing" rule will create -them from the I,I and J,J settings. The pair\_modify *mix* value -determines what formulas are used to compute the mixed coefficients. -In each case, the cutoff distance is mixed the same way as sigma. +:doc:`pair_coeff ` command or in the "Pair Coeffs" section of the +:doc:`data file `. For some pair styles it is not +necessary to specify coefficients when I != J, since a "mixing" rule +will create them from the I,I and J,J settings. The pair\_modify +*mix* value determines what formulas are used to compute the mixed +coefficients. In each case, the cutoff distance is mixed the same way +as sigma. -Note that not all pair styles support mixing. Also, some mix options -are not available for certain pair styles. See the doc page for -individual pair styles for those restrictions. Note also that the -:doc:`pair_coeff ` command also can be to directly set +Note that not all pair styles support mixing and some mix options +are not available for certain pair styles. Also, there are additional +restrictions when using :doc:`pair style hybrid or hybrid/overlay `. +See the doc page for individual pair styles for those restrictions. Note also that the +:doc:`pair_coeff ` command also can be used to directly set coefficients for a specific I != J pairing, in which case no mixing is performed. @@ -135,10 +127,11 @@ see the doc page for individual styles to see which potentials support these options. If N is non-zero, a table of length 2\^N is pre-computed for forces and energies, which can shrink their computational cost by up to a factor of 2. The table is indexed via a -bit-mapping technique :ref:`(Wolff) ` and a linear interpolation is -performed between adjacent table values. In our experiments with -different table styles (lookup, linear, spline), this method typically -gave the best performance in terms of speed and accuracy. +bit-mapping technique :ref:`(Wolff) ` and a linear +interpolation is performed between adjacent table values. In our +experiments with different table styles (lookup, linear, spline), this +method typically gave the best performance in terms of speed and +accuracy. The choice of table length is a tradeoff in accuracy versus speed. A larger N yields more accurate force computations, but requires more @@ -162,27 +155,28 @@ pairwise interactions are computed via table lookup for simulations with "real" units, but some close pairs may be computed directly (non-table) for simulations with "lj" units. -When the *tail* keyword is set to *yes*\ , certain pair styles will add -a long-range VanderWaals tail "correction" to the energy and pressure. -These corrections are bookkeeping terms which do not affect dynamics, -unless a constant-pressure simulation is being performed. See the doc -page for individual styles to see which support this option. These -corrections are included in the calculation and printing of -thermodynamic quantities (see the :doc:`thermo_style ` -command). Their effect will also be included in constant NPT or NPH -simulations where the pressure influences the simulation box -dimensions (e.g. the :doc:`fix npt ` and :doc:`fix nph ` -commands). The formulas used for the long-range corrections come from -equation 5 of :ref:`(Sun) `. +When the *tail* keyword is set to *yes*\ , certain pair styles will +add a long-range VanderWaals tail "correction" to the energy and +pressure. These corrections are bookkeeping terms which do not affect +dynamics, unless a constant-pressure simulation is being performed. +See the doc page for individual styles to see which support this +option. These corrections are included in the calculation and +printing of thermodynamic quantities (see the :doc:`thermo_style +` command). Their effect will also be included in +constant NPT or NPH simulations where the pressure influences the +simulation box dimensions (e.g. the :doc:`fix npt ` and +:doc:`fix nph ` commands). The formulas used for the +long-range corrections come from equation 5 of :ref:`(Sun) `. .. note:: The tail correction terms are computed at the beginning of each run, using the current atom counts of each atom type. If atoms are - deleted (or lost) or created during a simulation, e.g. via the :doc:`fix gcmc ` command, the correction factors are not - re-computed. If you expect the counts to change dramatically, you can - break a run into a series of shorter runs so that the correction - factors are re-computed more frequently. + deleted (or lost) or created during a simulation, e.g. via the + :doc:`fix gcmc ` command, the correction factors are not + re-computed. If you expect the counts to change dramatically, you + can break a run into a series of shorter runs so that the + correction factors are re-computed more frequently. Several additional assumptions are inherent in using tail corrections, including the following: @@ -191,26 +185,27 @@ including the following: should not be used for systems that are non-liquid, 2d, have a slab geometry (only 2d periodic), or inhomogeneous. * G(r), the radial distribution function (rdf), is unity beyond the - cutoff, so a fairly large cutoff should be used (i.e. 2.5 sigma for an - LJ fluid), and it is probably a good idea to verify this assumption by - checking the rdf. The rdf is not exactly unity beyond the cutoff for - each pair of interaction types, so the tail correction is necessarily - an approximation. + cutoff, so a fairly large cutoff should be used (i.e. 2.5 sigma for + an LJ fluid), and it is probably a good idea to verify this + assumption by checking the rdf. The rdf is not exactly unity beyond + the cutoff for each pair of interaction types, so the tail + correction is necessarily an approximation. - The tail corrections are computed at the beginning of each simulation - run. If the number of atoms changes during the run, e.g. due to atoms - leaving the simulation domain, or use of the :doc:`fix gcmc ` - command, then the corrections are not updated to reflect the changed - atom count. If this is a large effect in your simulation, you should - break the long run into several short runs, so that the correction - factors are re-computed multiple times. + The tail corrections are computed at the beginning of each + simulation run. If the number of atoms changes during the run, + e.g. due to atoms leaving the simulation domain, or use of the + :doc:`fix gcmc ` command, then the corrections are not + updated to reflect the changed atom count. If this is a large + effect in your simulation, you should break the long run into + several short runs, so that the correction factors are re-computed + multiple times. -* Thermophysical properties obtained from calculations with this option - enabled will not be thermodynamically consistent with the truncated - force-field that was used. In other words, atoms do not feel any LJ - pair interactions beyond the cutoff, but the energy and pressure - reported by the simulation include an estimated contribution from - those interactions. +* Thermophysical properties obtained from calculations with this + option enabled will not be thermodynamically consistent with the + truncated force-field that was used. In other words, atoms do not + feel any LJ pair interactions beyond the cutoff, but the energy and + pressure reported by the simulation include an estimated + contribution from those interactions. The *compute* keyword allows pairwise computations to be turned off, @@ -225,53 +220,73 @@ a simulation with :doc:`pair_style hybrid ` with only a subset of the hybrid sub-styles enabled. Second, this option allows you to perform a simulation with only long-range interactions but no short-range pairwise interactions. Doing this by simply not defining -a pair style will not work, because the -:doc:`kspace_style ` command requires a Kspace-compatible -pair style be defined. +a pair style will not work, because the :doc:`kspace_style +` command requires a Kspace-compatible pair style be +defined. The *nofdotr* keyword allows to disable an optimization that computes -the global stress tensor from the total forces and atom positions rather -than from summing forces between individual pairs of atoms. +the global stress tensor from the total forces and atom positions +rather than from summing forces between individual pairs of atoms. ---------- +The *pair* keyword can only be used with the :doc:`hybrid and +hybrid/overlay ` pair styles. If used, it must appear +first in the list of keywords. -The *special* keyword allows to override the 1-2, 1-3, and 1-4 -exclusion settings for individual sub-styles of a -:doc:`hybrid pair style `. It requires 4 arguments similar -to the :doc:`special_bonds ` command, *which* and -wt1,wt2,wt3. The *which* argument can be *lj* to change the -Lennard-Jones settings, *coul* to change the Coulombic settings, -or *lj/coul* to change both to the same set of 3 values. The wt1,wt2,wt3 -values are numeric weights from 0.0 to 1.0 inclusive, for the 1-2, -1-3, and 1-4 bond topology neighbors, respectively. The *special* -keyword can only be used in conjunction with the *pair* keyword -and has to directly follow it. This option is not compatible with -pair styles from the GPU or the USER-INTEL package and attempting -it will cause an error. +Its meaning is that all the following parameters will only be modified +for the specified sub-style. If the sub-style is defined multiple +times, then an additional numeric argument *N* must also be specified, +which is a number from 1 to M where M is the number of times the +sub-style was listed in the :doc:`pair_style hybrid ` +command. The extra number indicates which instance of the sub-style +the remaining keywords will be applied to. + +The *special* and *compute/tally* keywords can **only** be used in +conjunction with the *pair* keyword and they must directly follow it. +I.e. any other keyword, must appear after *pair*, *special*, and +*compute/tally*. + +The *special* keyword overrides the global :doc:`special_bonds ` +1-2, 1-3, 1-4 exclusion settings (weights) for the sub-style selected +by the *pair* keyword. + +Similar to the :doc:`special_bonds ` command, it takes +4 arguments. The *which* argument can be *lj* to change only the +non-Coulomb weights (e.g. Lennard-Jones or Buckingham), *coul* to change +only the Coulombic settings, or *lj/coul* to change both to the same +values. The *wt1,wt2,wt3* values are numeric weights from 0.0 to 1.0 +inclusive, for the 1-2, 1-3, and 1-4 bond topology neighbors, respectively. +The *special* keyword can be used multiple times, e.g. to set the *lj* +and *coul* settings to different values. .. note:: - The global settings specified by the - :doc:`special_bonds ` command affect the construction of - neighbor lists. Weights of 0.0 (for 1-2, 1-3, or 1-4 neighbors) - exclude those pairs from the neighbor list entirely. Weights of 1.0 - store the neighbor with no weighting applied. Thus only global values - different from exactly 0.0 or 1.0 can be overridden and an error is - generated if the requested setting is not compatible with the global - setting. Substituting 1.0e-10 for 0.0 and 0.9999999999 for 1.0 is - usually a sufficient workaround in this case without causing a - significant error. - -The *compute/tally* keyword takes exactly 1 argument (\ *no* or *yes*\ ), -and allows to selectively disable or enable processing of the various -:doc:`compute \*/tally ` styles for a given -:doc:`pair hybrid or hybrid/overlay ` sub-style. + The *special* keyword is not compatible with pair styles from the + GPU or the USER-INTEL package and attempting to use it will cause + an error. .. note:: - Any "pair\_modify pair compute/tally" command must be issued + Weights of exactly 0.0 or 1.0 in the :doc:`special_bonds ` + command have implications on the neighbor list construction, which + means that they cannot be overridden by using the *special* keyword. + One workaround for this restriction is to use the :doc:`special_bonds ` + command with weights like 1.0e-10 or 0.999999999 instead of 0.0 or 1.0, + respectively, which enables to reset each them to any value between 0.0 + and 1.0 inclusively. Otherwise you can set **all** global weights to + an arbitrary number outside of 0.0 or 1.0, like 0.5, and then you have + to override **all** *special* settings for **all** sub-styles which use + the 1-2, 1-3, and 1-4 exclusion weights in their force/energy computation. + +The *compute/tally* keyword disables or enables registering :doc:`compute +\*/tally ` computes for the sub-style specified by +the *pair* keyword. Use *no* to disable, or *yes* to enable. + +.. note:: + + The "pair_modify pair compute/tally" command must be issued **before** the corresponding compute style is defined. @@ -290,7 +305,7 @@ Related commands """""""""""""""" :doc:`pair_style `, :doc:`pair_style hybrid `, -pair\_coeff"_pair\_coeff.html, :doc:`thermo_style `, +:doc:`pair_coeff `, :doc:`thermo_style `, :doc:`compute \*/tally ` Default From 292fc77dce75db59e09fb4ec1fe69e8ae8a59967 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 30 Jan 2020 12:55:59 -0500 Subject: [PATCH 06/13] correct broken links to commands --- doc/src/Packages_details.rst | 2 +- doc/src/set.rst | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index efdd222cf1..fc0175433b 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -927,7 +927,7 @@ Also several computes which calculate properties of rigid bodies. * src/RIGID: filenames -> commands * :doc:`compute erotate/rigid ` -* fix shake"_fix\_shake.html +* :doc:`fix shake ` * :doc:`fix rattle ` * :doc:`fix rigid/\* ` * examples/ASPHERE diff --git a/doc/src/set.rst b/doc/src/set.rst index 613c19bcca..c9d75070fd 100644 --- a/doc/src/set.rst +++ b/doc/src/set.rst @@ -359,9 +359,9 @@ particles must be ellipsoids as defined by the :doc:`atom_style ellipsoid ` command. The angular velocity +vector of the particles is set to the 3 specified components. Keyword *mass* sets the mass of all selected particles. The particles must have a per-atom mass attribute, as defined by the From e4cf0a07a052488e838beed59e3edbbe95f5771e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 31 Jan 2020 00:45:13 -0500 Subject: [PATCH 07/13] remove more `\_` escapes from doc anchors and a bunch of other issues found in the process --- doc/src/Intro_features.rst | 2 +- doc/src/Packages_details.rst | 2 +- doc/src/compute_hma.rst | 25 +++++++++------- doc/src/dihedral_cosine_shift_exp.rst | 2 +- doc/src/fix_adapt_fep.rst | 2 +- doc/src/fix_bond_react.rst | 2 +- doc/src/fix_nh_uef.rst | 6 ++-- doc/src/fix_precession_spin.rst | 2 +- doc/src/fix_wall_gran.rst | 2 +- doc/src/fix_wall_gran_region.rst | 2 +- doc/src/min_modify.rst | 41 +++++++++++++-------------- doc/src/min_spin.rst | 15 +++++----- doc/src/neb_spin.rst | 5 ++-- doc/src/pair_class2.rst | 4 +-- doc/src/pair_coul.rst | 2 +- doc/src/pair_fep_soft.rst | 6 ++-- doc/src/pair_lj.rst | 2 +- doc/src/pair_lj_long.rst | 2 +- doc/src/pair_morse.rst | 4 +-- doc/src/pair_spin_exchange.rst | 2 +- doc/src/pair_spin_magelec.rst | 4 +-- doc/src/temper_grem.rst | 2 +- 22 files changed, 68 insertions(+), 68 deletions(-) diff --git a/doc/src/Intro_features.rst b/doc/src/Intro_features.rst index d8dd0a0531..aa41f2d488 100644 --- a/doc/src/Intro_features.rst +++ b/doc/src/Intro_features.rst @@ -87,7 +87,7 @@ commands) * water potentials: TIP3P, TIP4P, SPC * implicit solvent potentials: hydrodynamic lubrication, Debye * force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options -* access to the `OpenKIM Repository `_ of potentials via :doc:`kim\_init, kim\_interactions, and kim\_query ` commands +* access to the `OpenKIM Repository `_ of potentials via :doc:`kim_init, kim_interactions, and kim_query ` commands * hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation * overlaid potentials: superposition of multiple pair potentials diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index efdd222cf1..fc0175433b 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -927,7 +927,7 @@ Also several computes which calculate properties of rigid bodies. * src/RIGID: filenames -> commands * :doc:`compute erotate/rigid ` -* fix shake"_fix\_shake.html +* :doc:`fix shake ` * :doc:`fix rattle ` * :doc:`fix rigid/\* ` * examples/ASPHERE diff --git a/doc/src/compute_hma.rst b/doc/src/compute_hma.rst index 61e598948e..d122fceea1 100644 --- a/doc/src/compute_hma.rst +++ b/doc/src/compute_hma.rst @@ -54,19 +54,22 @@ effects, smaller timestep inaccuracy, faster equilibration and shorter decorrelation time. HMA should not be used if atoms are expected to diffuse. It is also -restricted to simulations in the NVT ensemble. While this compute may be -used with any potential in LAMMPS, it will provide inaccurate results +restricted to simulations in the NVT ensemble. While this compute may +be used with any potential in LAMMPS, it will provide inaccurate results for potentials that do not go to 0 at the truncation distance; -:doc:`pair\_lj\_smooth\_linear ` and Ewald summation should -work fine, while :doc:`pair_lj ` will perform poorly unless -the potential is shifted (via :doc:`pair_modify ` shift) or the cutoff is large. Furthermore, computation of the heat capacity with -this compute is restricted to those that implement the single\_hessian method -in Pair. Implementing single\_hessian in additional pair styles is simple. -Please contact Andrew Schultz (ajs42 at buffalo.edu) and David Kofke (kofke at -buffalo.edu) if your desired pair style does not have this method. This is -the list of pair styles that currently implement pair\_hessian: +:doc:`pair_style lj/smooth/linear ` and Ewald +summation should work fine, while :doc:`pair_style lj/cut ` +will perform poorly unless the potential is shifted (via +:doc:`pair_modify ` shift) or the cutoff is large. +Furthermore, computation of the heat capacity with this compute is +restricted to those that implement the *single\_hessian* method in Pair. +Implementing *single\_hessian* in additional pair styles is simple. +Please contact Andrew Schultz (ajs42 at buffalo.edu) and David Kofke +(kofke at buffalo.edu) if your desired pair style does not have this +method. This is the list of pair styles that currently implement +*single\_hessian*: -* :doc:`lj\_smooth\_linear ` +* :doc:`pair_style lj/smooth/linear ` In this method, the analytically known harmonic behavior of a crystal is removed from the traditional ensemble diff --git a/doc/src/dihedral_cosine_shift_exp.rst b/doc/src/dihedral_cosine_shift_exp.rst index 2a9aadc99e..b0e6b0f8f6 100644 --- a/doc/src/dihedral_cosine_shift_exp.rst +++ b/doc/src/dihedral_cosine_shift_exp.rst @@ -92,7 +92,7 @@ Related commands """""""""""""""" :doc:`dihedral_coeff `, -:doc:`angle\_cosine\_shift\_exp ` +:doc:`angle_style cosine/shift/exp ` **Default:** none diff --git a/doc/src/fix_adapt_fep.rst b/doc/src/fix_adapt_fep.rst index 2cc3a59191..76dcfadda1 100644 --- a/doc/src/fix_adapt_fep.rst +++ b/doc/src/fix_adapt_fep.rst @@ -319,7 +319,7 @@ Restrictions Related commands """""""""""""""" -:doc:`compute fep `, :doc:`fix adapt `, :doc:`compute ti `, :doc:`pair\_fep\_soft ` +:doc:`compute fep `, :doc:`fix adapt `, :doc:`compute ti `, :doc:`pair_style \*/soft ` Default """"""" diff --git a/doc/src/fix_bond_react.rst b/doc/src/fix_bond_react.rst index ec9533788e..f066eb8e45 100644 --- a/doc/src/fix_bond_react.rst +++ b/doc/src/fix_bond_react.rst @@ -390,7 +390,7 @@ the activation energy (:doc:`units ` of energy), and *seed* is a random number seed. The temperature is defined as the instantaneous temperature averaged over all atoms in the reaction site, and is calculated in the same manner as for example -:doc:`compute\_temp\_chunk `. Currently, there are no +:doc:`compute temp/chunk `. Currently, there are no options for additional temperature averaging or velocity-biased temperature calculations. A uniform random number between 0 and 1 is generated using *seed*\ ; if this number is less than the result of the diff --git a/doc/src/fix_nh_uef.rst b/doc/src/fix_nh_uef.rst index 7c15f5ffcb..99660ac672 100644 --- a/doc/src/fix_nh_uef.rst +++ b/doc/src/fix_nh_uef.rst @@ -89,14 +89,14 @@ in the LAMMPS frame. Only when the positions and velocities are updated is the system rotated to the flow frame, and it is rotated back to the LAMMPS frame immediately afterwards. For this reason, all vector-valued quantities (except for the tensors from -:doc:`compute\_pressure/uef ` and -:doc:`compute\_temp/uef `) will be computed in the +:doc:`compute pressure/uef ` and +:doc:`compute temp/uef `) will be computed in the LAMMPS frame. Rotationally invariant scalar quantities like the temperature and hydrostatic pressure are frame-invariant and will be computed correctly. Additionally, the system is in the LAMMPS frame during all of the output steps, and therefore trajectory files made using the dump command will be in the LAMMPS frame unless the -:doc:`dump\_cfg/uef ` command is used. +:doc:`dump cfg/uef ` command is used. ---------- diff --git a/doc/src/fix_precession_spin.rst b/doc/src/fix_precession_spin.rst index b81d0a8bf8..9cd15119bd 100644 --- a/doc/src/fix_precession_spin.rst +++ b/doc/src/fix_precession_spin.rst @@ -85,7 +85,7 @@ function for the same parameters. The temperature effects are accounted for by connecting the spin :math:`i` to a thermal bath using a Langevin thermostat (see -:doc:`fix\_langevin\_spin ` for the definition of +:doc:`fix langevin/spin ` for the definition of this thermostat). Style *anisotropy* is used to simulate an easy axis or an easy plane diff --git a/doc/src/fix_wall_gran.rst b/doc/src/fix_wall_gran.rst index 0db5a3e5ac..bb06aec0f6 100644 --- a/doc/src/fix_wall_gran.rst +++ b/doc/src/fix_wall_gran.rst @@ -89,7 +89,7 @@ The nature of the wall/particle interactions are determined by the *pair\_coeff* command for the latter. The equation for the force between the wall and particles touching it is the same as the corresponding equation on the :doc:`pair_style gran/\* ` and -:doc:`pair\_style\_granular ` doc pages, in the limit of +:doc:`pair_style granular ` doc pages, in the limit of one of the two particles going to infinite radius and mass (flat wall). Specifically, delta = radius - r = overlap of particle with wall, m\_eff = mass of particle, and the effective radius of contact = diff --git a/doc/src/fix_wall_gran_region.rst b/doc/src/fix_wall_gran_region.rst index 3ca17aa440..c2ecff8119 100644 --- a/doc/src/fix_wall_gran_region.rst +++ b/doc/src/fix_wall_gran_region.rst @@ -160,7 +160,7 @@ The nature of the wall/particle interactions are determined by the *pair\_coeff* command for the latter. The equation for the force between the wall and particles touching it is the same as the corresponding equation on the :doc:`pair_style gran/\* ` and -:doc:`pair\_style\_granular ` doc pages, but the effective +:doc:`pair_style granular ` doc pages, but the effective radius is calculated using the radius of the particle and the radius of curvature of the wall at the contact point. diff --git a/doc/src/min_modify.rst b/doc/src/min_modify.rst index b90354deb0..b9426020af 100644 --- a/doc/src/min_modify.rst +++ b/doc/src/min_modify.rst @@ -106,34 +106,31 @@ all atoms in the system: For the min styles *spin*\ , *spin/cg* and *spin/lbfgs*\ , the force norm is replaced by the spin-torque norm. -Keywords *alpha\_damp* and *discrete\_factor* only make sense when -a :doc:`min_spin ` command is declared. -Keyword *alpha\_damp* defines an analog of a magnetic Gilbert -damping. It defines a relaxation rate toward an equilibrium for -a given magnetic system. -Keyword *discrete\_factor* defines a discretization factor for the -adaptive timestep used in the *spin* minimization. -See :doc:`min_spin ` for more information about those -quantities. +Keywords *alpha\_damp* and *discrete\_factor* only make sense when a +:doc:`min_spin ` command is declared. Keyword *alpha\_damp* +defines an analog of a magnetic Gilbert damping. It defines a relaxation +rate toward an equilibrium for a given magnetic system. Keyword +*discrete\_factor* defines a discretization factor for the adaptive +timestep used in the *spin* minimization. See :doc:`min_spin +` for more information about those quantities. -The choice of a line search algorithm for the *spin/cg* and -*spin/lbfgs* styles can be specified via the *line* keyword. -The *spin\_cubic* and *spin\_none* only make sense when one of those -two minimization styles is declared. -The *spin\_cubic* performs the line search based on a cubic interpolation -of the energy along the search direction. The *spin\_none* keyword -deactivates the line search procedure. -The *spin\_none* is a default value for *line* keyword for both *spin/lbfgs* -and *spin/cg*\ . Convergence of *spin/lbfgs* can be more robust if -*spin\_cubic* line search is used. +The choice of a line search algorithm for the *spin/cg* and *spin/lbfgs* +styles can be specified via the *line* keyword. The *spin\_cubic* and +*spin\_none* options only make sense when one of those two minimization +styles is declared. The *spin\_cubic* option performs the line search +based on a cubic interpolation of the energy along the search +direction. The *spin\_none* option deactivates the line search +procedure. The *spin\_none* option is a default value for *line* +keyword for both *spin/lbfgs* and *spin/cg*\ . Convergence of +*spin/lbfgs* can be more robust if *spin\_cubic* line search is used. Restrictions """""""""""" -For magnetic GNEB calculations, only *spin\_none* value for *line* keyword can be used -when styles *spin/cg* and *spin/lbfgs* are employed. -See :doc:`neb/spin ` for more explanation. +For magnetic GNEB calculations, only the *spin\_none* value for *line* keyword can be used +when minimization styles *spin/cg* and *spin/lbfgs* are employed. +See :doc:`neb/spin ` for more explanations. Related commands """""""""""""""" diff --git a/doc/src/min_spin.rst b/doc/src/min_spin.rst index 96053fda98..57416ec826 100644 --- a/doc/src/min_spin.rst +++ b/doc/src/min_spin.rst @@ -70,14 +70,13 @@ discretization factor *discrete\_factor*. By default, style *spin/cg* does not employ the line search procedure and uses the adaptive time-step technique in the same way as style *spin*\ . -Style *spin/lbfgs* defines an orthogonal spin optimization -(OSO) combined to a limited-memory Broyden-Fletcher-Goldfarb-Shanno -(L-BFGS) algorithm. -By default, style *spin/lbfgs* does not employ line search procedure. -If the line search procedure is not used then the discrete factor defines -the maximum root mean squared rotation angle of spins by equation *pi/(5\*Kappa)*. -The default value for Kappa is 10. -The *spin\_cubic* line search can improve the convergence of the +Style *spin/lbfgs* defines an orthogonal spin optimization (OSO) +combined to a limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) +algorithm. By default, style *spin/lbfgs* does not employ line search +procedure. If the line search procedure is not used then the discrete +factor defines the maximum root mean squared rotation angle of spins by +equation *pi/(5\*Kappa)*. The default value for Kappa is 10. The +*spin\_cubic* line search option can improve the convergence of the *spin/lbfgs* algorithm. The :doc:`min_modify ` command can be used to diff --git a/doc/src/neb_spin.rst b/doc/src/neb_spin.rst index 74c46ff58e..9d7e2ba17f 100644 --- a/doc/src/neb_spin.rst +++ b/doc/src/neb_spin.rst @@ -389,8 +389,9 @@ This command can only be used if LAMMPS was built with the SPIN package. See the :doc:`Build package ` doc page for more info. -For magnetic GNEB calculations, only *spin\_none* value for *line* keyword can be used -when styles *spin/cg* and *spin/lbfgs* are employed. +For magnetic GNEB calculations, only the *spin\_none* value for the +*line* keyword can be used when minimization styles *spin/cg* and +*spin/lbfgs* are employed. ---------- diff --git a/doc/src/pair_class2.rst b/doc/src/pair_class2.rst index 01c442176f..b45dd32bac 100644 --- a/doc/src/pair_class2.rst +++ b/doc/src/pair_class2.rst @@ -133,7 +133,7 @@ cutoff distance. A version of these styles with a soft core, *lj/cut/soft*\ , suitable for use in free energy calculations, is part of the USER-FEP package and is documented with -the :doc:`pair\_fep\_soft ` styles. The version with soft core is +the :doc:`pair_style */soft ` styles. The version with soft core is only available if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. @@ -203,7 +203,7 @@ LAMMPS was built with that package. See the :doc:`Build package Related commands """""""""""""""" -:doc:`pair_coeff `, :doc:`pair\_fep\_soft ` +:doc:`pair_coeff `, :doc:`pair_style */soft ` **Default:** none diff --git a/doc/src/pair_coul.rst b/doc/src/pair_coul.rst index 735b52cb6e..d85df6ad6a 100644 --- a/doc/src/pair_coul.rst +++ b/doc/src/pair_coul.rst @@ -392,7 +392,7 @@ info. Related commands """""""""""""""" -:doc:`pair_coeff `, :doc:`pair\_style, hybrid/overlay `, :doc:`kspace_style ` +:doc:`pair_coeff `, :doc:`pair_style, hybrid/overlay `, :doc:`kspace_style ` **Default:** none diff --git a/doc/src/pair_fep_soft.rst b/doc/src/pair_fep_soft.rst index d1e64ae5df..8e706f77df 100644 --- a/doc/src/pair_fep_soft.rst +++ b/doc/src/pair_fep_soft.rst @@ -193,7 +193,7 @@ and Coulomb potentials modified by a soft core, with the functional form The *lj/class2/soft* style is a 9-6 potential with the exponent of the denominator of the first term in brackets taking the value 1.5 instead of 2 (other details differ, see the form of the potential in -:doc:`pair\_class2 `). +:doc:`pair_style lj/class2 `). Coulomb interactions can also be damped with a soft core at short distance, @@ -255,14 +255,14 @@ optional cutoffs. Style *lj/charmm/coul/long/soft* implements a soft-core version of the modified 12-6 LJ potential used in CHARMM and documented in the -:doc:`pair\_lj\_charmm ` style. In the soft version the parameters n, +:doc:`pair_style lj/charmm/coul/long ` style. In the soft version the parameters n, alpha\_LJ and alpha\_C are set in the :doc:`pair_style ` command, before the global cutoffs. The activation parameter lambda is introduced as an argument of the :doc:`pair_coeff ` command, after epsilon and sigma and before the optional eps14 and sigma14. Style *lj/class2/soft* implements a soft-core version of the 9-6 potential in -:doc:`pair\_class2 `. In the soft version the parameters n, alpha\_LJ +:doc:`pair_style lj/class2 `. In the soft version the parameters n, alpha\_LJ and alpha\_C are set in the :doc:`pair_style ` command, before the global cutoffs. The activation parameter lambda is introduced as an argument of the the :doc:`pair_coeff ` command, after epsilon and sigma and before diff --git a/doc/src/pair_lj.rst b/doc/src/pair_lj.rst index 3fa1cb0bca..cdcb481e5f 100644 --- a/doc/src/pair_lj.rst +++ b/doc/src/pair_lj.rst @@ -348,7 +348,7 @@ pair\_style command. A version of these styles with a soft core, *lj/cut/soft*\ , suitable for use in free energy calculations, is part of the USER-FEP package and is documented with -the :doc:`pair\_fep\_soft ` styles. The version with soft core is +the :doc:`pair_style */soft ` styles. The version with soft core is only available if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. diff --git a/doc/src/pair_lj_long.rst b/doc/src/pair_lj_long.rst index 40d5688a33..3a0afbd674 100644 --- a/doc/src/pair_lj_long.rst +++ b/doc/src/pair_lj_long.rst @@ -180,7 +180,7 @@ specified in the pair\_style command. A version of these styles with a soft core, *lj/cut/soft*\ , suitable for use in free energy calculations, is part of the USER-FEP package and is documented with -the :doc:`pair\_fep\_soft ` styles. The version with soft core is +the :doc:`pair_style */soft ` styles. The version with soft core is only available if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. diff --git a/doc/src/pair_morse.rst b/doc/src/pair_morse.rst index ac1c106b06..f5d95f3f85 100644 --- a/doc/src/pair_morse.rst +++ b/doc/src/pair_morse.rst @@ -95,7 +95,7 @@ the *morse* and *morse/smooth/linear* styles. A version of the *morse* style with a soft core, *morse/soft*\ , suitable for use in free energy calculations, is part of the USER-FEP package and is documented with -the :doc:`pair\_fep\_soft ` styles. The version with soft core is only +the :doc:`pair_style */soft ` styles. The version with soft core is only available if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. @@ -160,7 +160,7 @@ built with the USER-MISC package. See the :doc:`Build package ` Related commands """""""""""""""" -:doc:`pair_coeff `, :doc:`pair\_fep\_soft ` +:doc:`pair_coeff `, :doc:`pair_style */soft ` **Default:** none diff --git a/doc/src/pair_spin_exchange.rst b/doc/src/pair_spin_exchange.rst index b232649f95..1393e47cdd 100644 --- a/doc/src/pair_spin_exchange.rst +++ b/doc/src/pair_spin_exchange.rst @@ -55,7 +55,7 @@ in :ref:`(Tranchida) `. From this exchange interaction, each spin :math:`i` will be submitted to a magnetic torque :math:`\vec{\omega}`, and its associated atom can be submitted to a -force :math:`\vec{F}` for spin-lattice calculations (see :doc:`fix\_nve\_spin `), +force :math:`\vec{F}` for spin-lattice calculations (see :doc:`fix nve/spin `), such as: .. math:: diff --git a/doc/src/pair_spin_magelec.rst b/doc/src/pair_spin_magelec.rst index bd5ff51650..66bb82dafc 100644 --- a/doc/src/pair_spin_magelec.rst +++ b/doc/src/pair_spin_magelec.rst @@ -41,7 +41,7 @@ direction of a screened dielectric atomic polarization (in eV). From this magneto-electric interaction, each spin i will be submitted to a magnetic torque omega, and its associated atom can be submitted to a -force F for spin-lattice calculations (see :doc:`fix\_nve\_spin `), +force F for spin-lattice calculations (see :doc:`fix nve/spin `), such as: .. image:: Eqs/pair_spin_me_forces.jpg @@ -68,7 +68,7 @@ Related commands """""""""""""""" :doc:`atom_style spin `, :doc:`pair_coeff `, -:doc:`pair\_spin\_exchange `, :doc:`pair_eam `, +:doc:`pair_style spin/exchange `, :doc:`pair_eam `, **Default:** none diff --git a/doc/src/temper_grem.rst b/doc/src/temper_grem.rst index e686ef23a4..2e19592879 100644 --- a/doc/src/temper_grem.rst +++ b/doc/src/temper_grem.rst @@ -14,7 +14,7 @@ Syntax * N = total # of timesteps to run * M = attempt a tempering swap every this many steps * lambda = initial lambda for this ensemble -* fix-ID = ID of fix\_grem +* fix-ID = ID of *fix grem* * thermostat-ID = ID of the thermostat that controls kinetic temperature * seed1 = random # seed used to decide on adjacent temperature to partner with * seed2 = random # seed for Boltzmann factor in Metropolis swap From 82286702cb9bf14db7577e4dcdb990cdab43ecea Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 31 Jan 2020 08:32:14 -0500 Subject: [PATCH 08/13] switch OpenMP pragma to default(shared), so it is compatible with all OpenMP standard versions --- src/kspace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kspace.cpp b/src/kspace.cpp index 2399c10e2b..a9356a39f1 100644 --- a/src/kspace.cpp +++ b/src/kspace.cpp @@ -286,7 +286,7 @@ void KSpace::qsum_qsq(int warning_flag) double qsum_local(0.0), qsqsum_local(0.0); #if defined(_OPENMP) -#pragma omp parallel for default(none) reduction(+:qsum_local,qsqsum_local) +#pragma omp parallel for default(shared) reduction(+:qsum_local,qsqsum_local) #endif for (int i = 0; i < nlocal; i++) { qsum_local += q[i]; From ed628a2de7d3e2f1da4807186c78c730aa658f71 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 31 Jan 2020 09:01:26 -0500 Subject: [PATCH 09/13] remove some more unneeded backslash escapes and fix up a few more doc links --- doc/src/fix_atc.rst | 160 +++++++++++++++---------------- doc/src/fix_wall_gran.rst | 15 +-- doc/src/fix_wall_gran_region.rst | 11 ++- doc/src/rerun.rst | 10 +- 4 files changed, 99 insertions(+), 97 deletions(-) diff --git a/doc/src/fix_atc.rst b/doc/src/fix_atc.rst index 2c2f474c93..935a951d17 100644 --- a/doc/src/fix_atc.rst +++ b/doc/src/fix_atc.rst @@ -143,97 +143,97 @@ Related commands After specifying this fix in your input script, several other :doc:`fix_modify ` commands are used to setup the problem, e.g. define the finite element mesh and prescribe initial and boundary conditions. -fix\_modify commands for setup: +*fix\_modify* commands for setup: -* `fix\_modify AtC mesh create `_ -* `fix\_modify AtC mesh quadrature `_ -* `fix\_modify AtC mesh read `_ -* `fix\_modify AtC mesh write `_ -* `fix\_modify AtC mesh create\_nodeset `_ -* `fix\_modify AtC mesh add\_to\_nodeset `_ -* `fix\_modify AtC mesh create\_faceset box `_ -* `fix\_modify AtC mesh create\_faceset plane `_ -* `fix\_modify AtC mesh create\_elementset `_ -* `fix\_modify AtC mesh delete\_elements `_ -* `fix\_modify AtC mesh nodeset\_to\_elementset `_ -* `fix\_modify AtC boundary `_ -* `fix\_modify AtC internal\_quadrature `_ -* `fix\_modify AtC time\_integration (thermal) `_ -* `fix\_modify AtC time\_integration (momentum) `_ -* `fix\_modify AtC extrinsic electron\_integration `_ -* `fix\_modify AtC internal\_element\_set `_ -* `fix\_modify AtC decomposition `_ +* `fix_modify AtC mesh create `_ +* `fix_modify AtC mesh quadrature `_ +* `fix_modify AtC mesh read `_ +* `fix_modify AtC mesh write `_ +* `fix_modify AtC mesh create_nodeset `_ +* `fix_modify AtC mesh add_to_nodeset `_ +* `fix_modify AtC mesh create_faceset box `_ +* `fix_modify AtC mesh create_faceset plane `_ +* `fix_modify AtC mesh create_elementset `_ +* `fix_modify AtC mesh delete_elements `_ +* `fix_modify AtC mesh nodeset_to_elementset `_ +* `fix_modify AtC boundary `_ +* `fix_modify AtC internal_quadrature `_ +* `fix_modify AtC time_integration (thermal) `_ +* `fix_modify AtC time_integration (momentum) `_ +* `fix_modify AtC extrinsic electron_integration `_ +* `fix_modify AtC internal_element_set `_ +* `fix_modify AtC decomposition `_ -fix\_modify commands for boundary and initial conditions: +*fix\_modify* commands for boundary and initial conditions: -* `fix\_modify AtC initial `_ -* `fix\_modify AtC fix `_ -* `fix\_modify AtC unfix `_ -* `fix\_modify AtC fix\_flux `_ -* `fix\_modify AtC unfix\_flux `_ -* `fix\_modify AtC source `_ -* `fix\_modify AtC remove\_source `_ +* `fix_modify AtC initial `_ +* `fix_modify AtC fix `_ +* `fix_modify AtC unfix `_ +* `fix_modify AtC fix_flux `_ +* `fix_modify AtC unfix_flux `_ +* `fix_modify AtC source `_ +* `fix_modify AtC remove_source `_ -fix\_modify commands for control and filtering: +*fix\_modify* commands for control and filtering: -* `fix\_modify AtC control `_ -* `fix\_modify AtC control thermal `_ -* `fix\_modify AtC control thermal correction\_max\_iterations `_ -* `fix\_modify AtC control momentum `_ -* `fix\_modify AtC control localized\_lambda `_ -* `fix\_modify AtC control lumped\_lambda\_solve `_ -* `fix\_modify AtC control mask\_direction `_ control -* `fix\_modify AtC filter `_ -* `fix\_modify AtC filter scale `_ -* `fix\_modify AtC filter type `_ -* `fix\_modify AtC equilibrium\_start `_ -* `fix\_modify AtC extrinsic exchange `_ -* `fix\_modify AtC poisson\_solver `_ +* `fix_modify AtC control `_ +* `fix_modify AtC control thermal `_ +* `fix_modify AtC control thermal correction_max_iterations `_ +* `fix_modify AtC control momentum `_ +* `fix_modify AtC control localized_lambda `_ +* `fix_modify AtC control lumped_lambda_solve `_ +* `fix_modify AtC control mask_direction `_ control +* `fix_modify AtC filter `_ +* `fix_modify AtC filter scale `_ +* `fix_modify AtC filter type `_ +* `fix_modify AtC equilibrium_start `_ +* `fix_modify AtC extrinsic exchange `_ +* `fix_modify AtC poisson_solver `_ -fix\_modify commands for output: +*fix\_modify* commands for output: -* `fix\_modify AtC output `_ -* `fix\_modify AtC output nodeset `_ -* `fix\_modify AtC output elementset `_ -* `fix\_modify AtC output boundary\_integral `_ -* `fix\_modify AtC output contour\_integral `_ -* `fix\_modify AtC mesh output `_ -* `fix\_modify AtC write\_restart `_ -* `fix\_modify AtC read\_restart `_ +* `fix_modify AtC output `_ +* `fix_modify AtC output nodeset `_ +* `fix_modify AtC output elementset `_ +* `fix_modify AtC output boundary_integral `_ +* `fix_modify AtC output contour_integral `_ +* `fix_modify AtC mesh output `_ +* `fix_modify AtC write_restart `_ +* `fix_modify AtC read_restart `_ -fix\_modify commands for post-processing: +*fix\_modify* commands for post-processing: -* `fix\_modify AtC kernel `_ -* `fix\_modify AtC fields `_ -* `fix\_modify AtC grdients `_ -* `fix\_modify AtC rates `_ -* `fix\_modify AtC computes `_ -* `fix\_modify AtC on\_the\_fly `_ -* `fix\_modify AtC pair\_interactions/bond\_interactions `_ -* `fix\_modify AtC sample\_frequency `_ -* `fix\_modify AtC set `_ +* `fix_modify AtC kernel `_ +* `fix_modify AtC fields `_ +* `fix_modify AtC grdients `_ +* `fix_modify AtC rates `_ +* `fix_modify AtC computes `_ +* `fix_modify AtC on_the_fly `_ +* `fix_modify AtC pair_interactions/bond_interactions `_ +* `fix_modify AtC sample_frequency `_ +* `fix_modify AtC set `_ -miscellaneous fix\_modify commands: +miscellaneous *fix\_modify* commands: -* `fix\_modify AtC atom\_element\_map `_ -* `fix\_modify AtC atom\_weight `_ -* `fix\_modify AtC write\_atom\_weights `_ -* `fix\_modify AtC reset\_time `_ -* `fix\_modify AtC reset\_atomic\_reference\_positions `_ -* `fix\_modify AtC fe\_md\_boundary `_ -* `fix\_modify AtC boundary\_faceset `_ -* `fix\_modify AtC consistent\_fe\_initialization `_ -* `fix\_modify AtC mass\_matrix `_ -* `fix\_modify AtC material `_ -* `fix\_modify AtC atomic\_charge `_ -* `fix\_modify AtC source\_integration `_ -* `fix\_modify AtC temperature\_definition `_ -* `fix\_modify AtC track\_displacement `_ -* `fix\_modify AtC boundary\_dynamics `_ -* `fix\_modify AtC add\_species `_ -* `fix\_modify AtC add\_molecule `_ -* `fix\_modify AtC remove\_species `_ -* `fix\_modify AtC remove\_molecule `_ +* `fix_modify AtC atom_element_map `_ +* `fix_modify AtC atom_weight `_ +* `fix_modify AtC write_atom_weights `_ +* `fix_modify AtC reset_time `_ +* `fix_modify AtC reset_atomic_reference_positions `_ +* `fix_modify AtC fe_md_boundary `_ +* `fix_modify AtC boundary_faceset `_ +* `fix_modify AtC consistent_fe_initialization `_ +* `fix_modify AtC mass_matrix `_ +* `fix_modify AtC material `_ +* `fix_modify AtC atomic_charge `_ +* `fix_modify AtC source_integration `_ +* `fix_modify AtC temperature_definition `_ +* `fix_modify AtC track_displacement `_ +* `fix_modify AtC boundary_dynamics `_ +* `fix_modify AtC add_species `_ +* `fix_modify AtC add_molecule `_ +* `fix_modify AtC remove_species `_ +* `fix_modify AtC remove_molecule `_ Note: a set of example input files with the attendant material files are included with this package diff --git a/doc/src/fix_wall_gran.rst b/doc/src/fix_wall_gran.rst index bb06aec0f6..a939659b02 100644 --- a/doc/src/fix_wall_gran.rst +++ b/doc/src/fix_wall_gran.rst @@ -83,17 +83,18 @@ close enough to touch it. The nature of the wall/particle interactions are determined by the *fstyle* setting. It can be any of the styles defined by the -:doc:`pair_style gran/\* ` or the more general `pair\_style granular `_ commands. Currently the options are -*hooke*\ , *hooke/history*\ , or *hertz/history* for the former, and -*granular* with all the possible options of the associated +:doc:`pair_style gran/\* ` or the more general +:doc:`pair_style granular ` commands. Currently the +options are *hooke*\ , *hooke/history*\ , or *hertz/history* for the +former, and *granular* with all the possible options of the associated *pair\_coeff* command for the latter. The equation for the force between the wall and particles touching it is the same as the corresponding equation on the :doc:`pair_style gran/\* ` and :doc:`pair_style granular ` doc pages, in the limit of -one of the two particles going to infinite radius and mass (flat -wall). Specifically, delta = radius - r = overlap of particle with -wall, m\_eff = mass of particle, and the effective radius of contact = -RiRj/Ri+Rj is set to the radius of the particle. +one of the two particles going to infinite radius and mass (flat wall). +Specifically, delta = radius - r = overlap of particle with wall, m\_eff += mass of particle, and the effective radius of contact = RiRj/Ri+Rj is +set to the radius of the particle. The parameters *Kn*\ , *Kt*\ , *gamma\_n*, *gamma\_t*, *xmu* and *dampflag* have the same meaning and units as those specified with the diff --git a/doc/src/fix_wall_gran_region.rst b/doc/src/fix_wall_gran_region.rst index c2ecff8119..1fa9269186 100644 --- a/doc/src/fix_wall_gran_region.rst +++ b/doc/src/fix_wall_gran_region.rst @@ -154,15 +154,16 @@ corresponding manner. The nature of the wall/particle interactions are determined by the *fstyle* setting. It can be any of the styles defined by the -:doc:`pair_style gran/\* ` or the more general `pair\_style granular `_ commands. Currently the options are -*hooke*\ , *hooke/history*\ , or *hertz/history* for the former, and -*granular* with all the possible options of the associated +:doc:`pair_style gran/\* ` or the more general +:doc:`pair_style granular ` commands. Currently the +options are *hooke*\ , *hooke/history*\ , or *hertz/history* for the +former, and *granular* with all the possible options of the associated *pair\_coeff* command for the latter. The equation for the force between the wall and particles touching it is the same as the corresponding equation on the :doc:`pair_style gran/\* ` and :doc:`pair_style granular ` doc pages, but the effective -radius is calculated using the radius of the particle and the radius -of curvature of the wall at the contact point. +radius is calculated using the radius of the particle and the radius of +curvature of the wall at the contact point. Specifically, delta = radius - r = overlap of particle with wall, m\_eff = mass of particle, and RiRj/Ri+Rj is the effective radius, with diff --git a/doc/src/rerun.rst b/doc/src/rerun.rst index 6563ef7dd0..3e0da24e75 100644 --- a/doc/src/rerun.rst +++ b/doc/src/rerun.rst @@ -115,13 +115,13 @@ However if you specify a series of dump files in an incorrect order (with respect to the timesteps they contain), you may skip large numbers of snapshots -Note that the dump files specified as part of the *dump* keyword can -be parallel files, i.e. written as multiple files either per processor +Note that the dump files specified as part of the *dump* keyword can be +parallel files, i.e. written as multiple files either per processor and/or per snapshot. If that is the case they will also be read in parallel which can make the rerun command operate dramatically faster -for large systems. See the doc page for the `read\_dump `_ and -:doc:`dump ` commands which describe how to read and write -parallel dump files. +for large systems. See the doc page for the :doc:`read_dump +` and :doc:`dump ` commands which describe how to read +and write parallel dump files. The *first*\ , *last*\ , *every*\ , *skip* keywords determine which snapshots are read from the dump file(s). Snapshots are skipped until From 31c483370730aba17d49032368fc7a22d7def227 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 31 Jan 2020 09:51:23 -0500 Subject: [PATCH 10/13] correct out-of-bounds array access in RanMars::select_subset() --- src/random_mars.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/random_mars.cpp b/src/random_mars.cpp index e4330b772f..b2fa828488 100644 --- a/src/random_mars.cpp +++ b/src/random_mars.cpp @@ -183,8 +183,8 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next) int mode,index,oldindex,newvalue,nflip,which,niter; int active[2],first[2],last[2]; int newactive[2],newfirst[2],newlast[2]; - bigint nmark,nactive,nactiveall,nflipall,bnflip; - bigint activeall[2],bsum[3],bsumall[3]; + bigint nmark,nactive,nactiveall,nflipall; + bigint activeall[2],bsum[4],bsumall[4]; double thresh; active[0] = nmine; From 2069c7a5fd4f3a89b8140e43e2802dd1e4a582db Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 31 Jan 2020 09:58:04 -0500 Subject: [PATCH 11/13] correct incorrect bugfix --- src/random_mars.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/random_mars.cpp b/src/random_mars.cpp index b2fa828488..2f935c92c2 100644 --- a/src/random_mars.cpp +++ b/src/random_mars.cpp @@ -183,7 +183,7 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next) int mode,index,oldindex,newvalue,nflip,which,niter; int active[2],first[2],last[2]; int newactive[2],newfirst[2],newlast[2]; - bigint nmark,nactive,nactiveall,nflipall; + bigint nmark,nflipall; bigint activeall[2],bsum[4],bsumall[4]; double thresh; @@ -210,15 +210,12 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next) // choose to ADD or SUBTRACT from current nmark // thresh = desired flips / size of active set - // nactive = size of current active set, only for debug output below if (ntarget-nmark > 0) { mode = ADD; - // nactive = active[mode]; thresh = 1.0 * (ntarget-nmark) / activeall[mode]; } else { mode = SUBTRACT; - // nactive = active[mode]; thresh = 1.0 * (nmark-ntarget) / activeall[mode]; } @@ -278,12 +275,10 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next) bsum[0] = nflip; bsum[1] = active[0]; bsum[2] = active[1]; - bsum[3] = nactive; - MPI_Allreduce(&bsum,&bsumall,4,MPI_LMP_BIGINT,MPI_SUM,world); + MPI_Allreduce(&bsum,&bsumall,3,MPI_LMP_BIGINT,MPI_SUM,world); nflipall = bsumall[0]; activeall[0] = bsumall[1]; activeall[1] = bsumall[2]; - nactiveall = bsumall[3]; if (mode == ADD) nmark += nflipall; else if (mode == SUBTRACT) nmark -= nflipall; From 82aab36898bce226b43826aecc9978e4313b0ead Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 31 Jan 2020 09:59:35 -0500 Subject: [PATCH 12/13] reset array size since we don't use the last element anymore --- src/random_mars.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/random_mars.cpp b/src/random_mars.cpp index 2f935c92c2..36fd2b4bc8 100644 --- a/src/random_mars.cpp +++ b/src/random_mars.cpp @@ -184,7 +184,7 @@ void RanMars::select_subset(bigint ntarget, int nmine, int *mark, int *next) int active[2],first[2],last[2]; int newactive[2],newfirst[2],newlast[2]; bigint nmark,nflipall; - bigint activeall[2],bsum[4],bsumall[4]; + bigint activeall[2],bsum[3],bsumall[3]; double thresh; active[0] = nmine; From 6424883daffec2bc089cca0286165355b94a42c9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 31 Jan 2020 10:52:31 -0500 Subject: [PATCH 13/13] apply revisions suggested by @sjplimp --- doc/src/pair_modify.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/src/pair_modify.rst b/doc/src/pair_modify.rst index 7694279e20..71960c52c2 100644 --- a/doc/src/pair_modify.rst +++ b/doc/src/pair_modify.rst @@ -59,12 +59,13 @@ Description Modify the parameters of the currently defined pair style. If the pair style is :doc:`hybrid or hybrid/overlay `, then the -specified parameters are by default modified for all the hybrid sub-styles. +specified parameters are by default modified for all the hybrid sub-styles. .. note:: The behavior for hybrid pair styles can be changed by using the *pair* - keyword, which allows to select a specific sub-style to apply a setting to. + keyword, which allows selection of a specific sub-style to apply all + remaining keywords to. The *special* and *compute/tally* keywords can **only** be used in conjunction with the *pair* keyword. See further details about these 3 keywords below. @@ -276,7 +277,7 @@ and *coul* settings to different values. command with weights like 1.0e-10 or 0.999999999 instead of 0.0 or 1.0, respectively, which enables to reset each them to any value between 0.0 and 1.0 inclusively. Otherwise you can set **all** global weights to - an arbitrary number outside of 0.0 or 1.0, like 0.5, and then you have + an arbitrary number between 0.0 or 1.0, like 0.5, and then you have to override **all** *special* settings for **all** sub-styles which use the 1-2, 1-3, and 1-4 exclusion weights in their force/energy computation.