diff --git a/doc/lammps.1 b/doc/lammps.1 index 299f8538b0..9351ba5636 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,4 +1,4 @@ -.TH LAMMPS "24 December 2020" "2020-12-24" +.TH LAMMPS "10 February 2021" "2021-02-10" .SH NAME .B LAMMPS \- Molecular Dynamics Simulator. diff --git a/doc/src/Intro_citing.rst b/doc/src/Intro_citing.rst index a74d3134f3..e758992e2b 100644 --- a/doc/src/Intro_citing.rst +++ b/doc/src/Intro_citing.rst @@ -38,17 +38,18 @@ In addition there are DOIs for individual stable releases. Currently there are: Home page ^^^^^^^^^ -The LAMMPS website at `https://lammps.sandia.gov/ `_ is the canonical -location for information about LAMMPS and more detailed lists of publications -using LAMMPS and contributing features. +The LAMMPS website at `https://lammps.sandia.gov/ +`_ is the canonical location for information +about LAMMPS and its features. Citing contributions ^^^^^^^^^^^^^^^^^^^^ -LAMMPS has many features and uses previously published methods and -algorithms or novel features. It also includes potential parameter -filed for specific models. You can look up relevant publications either -in the LAMMPS output to the screen, the ``log.cite`` file (which is -populated with references to relevant papers through embedding them into -the source code) and in the documentation of the :doc:`corresponding commands +LAMMPS has many features and that use either previously published +methods and algorithms or novel features. It also includes potential +parameter filed for specific models. Where available, a reminder about +references for optional features used in a specific run is printed to +the screen and log file. Style and output location can be selected with +the :ref:`-cite command-line switch `. Additional references are +given in the documentation of the :doc:`corresponding commands ` or in the :doc:`Howto tutorials `. diff --git a/doc/src/Modify_contribute.rst b/doc/src/Modify_contribute.rst index 27de36f30c..4998712a3d 100644 --- a/doc/src/Modify_contribute.rst +++ b/doc/src/Modify_contribute.rst @@ -206,16 +206,22 @@ packages in the src directory for examples. If you are uncertain, please ask. algorithm/science behind the feature itself, or its initial usage, or its implementation in LAMMPS), you can add the citation to the \*.cpp source file. See src/USER-EFF/atom_vec_electron.cpp for an example. - A LaTeX citation is stored in a variable at the top of the file and a - single line of code that references the variable is added to the - constructor of the class. Whenever a user invokes your feature from - their input script, this will cause LAMMPS to output the citation to a - log.cite file and prompt the user to examine the file. Note that you - should only use this for a paper you or your group authored. - E.g. adding a cite in the code for a paper by Nose and Hoover if you - write a fix that implements their integrator is not the intended - usage. That kind of citation should just be in the doc page you - provide. + A LaTeX citation is stored in a variable at the top of the file and + a single line of code registering this variable is added to the + constructor of the class. If there is additional functionality (which + may have been added later) described in a different publication, + additional citation descriptions may be added for as long as they + are only registered when the corresponding keyword activating this + functionality is used. With these options it is possible to have + LAMMPS output a specific citation reminder whenever a user invokes + your feature from their input script. Note that you should only use + this for the most relevant paper for a feature and a publication that + you or your group authored. E.g. adding a citation in the code for + a paper by Nose and Hoover if you write a fix that implements their + integrator is not the intended usage. That kind of citation should + just be included in the documentation page you provide describing + your contribution. If you are not sure what the best option would + be, please contact the LAMMPS developers for advice. Finally, as a general rule-of-thumb, the more clear and self-explanatory you make your documentation and README files, and the diff --git a/doc/src/Run_options.rst b/doc/src/Run_options.rst index 9c269e552f..25756d9be0 100644 --- a/doc/src/Run_options.rst +++ b/doc/src/Run_options.rst @@ -11,6 +11,7 @@ letter abbreviation can be used: * :ref:`-k or -kokkos ` * :ref:`-l or -log ` * :ref:`-m or -mpicolor ` +* :ref:`-c or -cite ` * :ref:`-nc or -nocite ` * :ref:`-pk or -package ` * :ref:`-p or -partition ` @@ -220,14 +221,31 @@ links with from the lib/message directory. See the ---------- +.. _cite: + +**-cite style or file name** + +Select how and where to output a reminder about citing contributions +to the LAMMPS code that were used during the run. Available styles are +"both", "none", "screen", or "log". Any flag will be considered a file +name to write the detailed citation info to. Default is the "log" style +where there is a short summary in the screen output and detailed citations +in BibTeX format in the logfile. The option "both" selects the detailed +output for both, "none", the short output for both, and "screen" will +write the detailed info to the screen and the short version to the log +file. If a dedicated citation info file is requested, the screen and +log file output will be in the short format (same as with "none"). + +See the :doc:`citation page ` for more details on +how to correctly reference and cite LAMMPS. + +---------- + .. _nocite: **-nocite** -Disable writing the log.cite file which is normally written to list -references for specific cite-able features used during a LAMMPS run. -See the `citation page `_ for more -details. +Disable generating a citation reminder (see above) at all. ---------- diff --git a/doc/src/compute_pressure.rst b/doc/src/compute_pressure.rst index b89d17bc5a..f69f70daba 100644 --- a/doc/src/compute_pressure.rst +++ b/doc/src/compute_pressure.rst @@ -122,8 +122,11 @@ Output info This compute calculates a global scalar (the pressure) and a global vector of length 6 (pressure tensor), which can be accessed by indices 1-6. These values can be used by any command that uses global scalar -or vector values from a compute as input. See the :doc:`Howto output ` doc page for an overview of LAMMPS output -options. +or vector values from a compute as input. See the :doc:`Howto output +` doc page for an overview of LAMMPS output options. + +The ordering of values in the symmetric pressure tensor is as follows: +pxx, pyy, pzz, pxy, pxz, pyz. The scalar and vector values calculated by this compute are "intensive". The scalar and vector values will be in pressure diff --git a/doc/src/compute_stress_atom.rst b/doc/src/compute_stress_atom.rst index 08f1c5f1ba..393d3b2ffb 100644 --- a/doc/src/compute_stress_atom.rst +++ b/doc/src/compute_stress_atom.rst @@ -216,6 +216,11 @@ an identical manner to compute *stress/atom*. See the :doc:`Howto output ` doc page for an overview of LAMMPS output options. +The ordering of the 6 columns for *stress/atom* is as follows: xx, yy, +zz, xy, xz, yz. The ordering of the 9 columns for +*centroid/stress/atom* is as follows: xx, yy, zz, xy, xz, yz, yx, zx, +zy. + The per-atom array values will be in pressure\*volume :doc:`units ` as discussed above. diff --git a/doc/src/create_bonds.rst b/doc/src/create_bonds.rst index b69fd909f0..056b60c7aa 100644 --- a/doc/src/create_bonds.rst +++ b/doc/src/create_bonds.rst @@ -125,6 +125,16 @@ cannot appear in the neighbor list, to avoid creation of duplicate bonds. The neighbor list for all atom type pairs must also extend to a distance that encompasses the *rmax* for new bonds to create. +.. note:: + + If you want to create bonds between pairs of 1-3 or 1-4 atoms in + the current bond topology, then you need to use :doc:`special_bonds + lj 0 1 1 ` to insure those pairs appear in the + neighbor list. They will not appear with the default special_bonds + settings which are zero for 1-2, 1-3, and 1-4 atoms. 1-3 or 1-4 + atoms are those which are 2 hops or 3 hops apart in the bond + topology. + An additional requirement for this style is that your system must be ready to perform a simulation. This means, for example, that all :doc:`pair_style ` coefficients be set via the diff --git a/doc/src/fix_bond_react.rst b/doc/src/fix_bond_react.rst index b995239d08..5291aff81b 100644 --- a/doc/src/fix_bond_react.rst +++ b/doc/src/fix_bond_react.rst @@ -650,8 +650,8 @@ reset_mol_ids = yes, custom_charges = no, molecule = off, modify_create = no .. _Gissinger: -**(Gissinger)** Gissinger, Jensen and Wise, Polymer, 128, 211-217 (2017). +**(Gissinger2017)** Gissinger, Jensen and Wise, Polymer, 128, 211-217 (2017). .. _Gissinger2020: -**(Gissinger)** Gissinger, Jensen and Wise, Macromolecules, 53, 22, 9953-9961 (2020). +**(Gissinger2020)** Gissinger, Jensen and Wise, Macromolecules, 53, 22, 9953-9961 (2020). diff --git a/doc/src/kim_commands.rst b/doc/src/kim_commands.rst index 99f7efffd5..e9afa48fd5 100644 --- a/doc/src/kim_commands.rst +++ b/doc/src/kim_commands.rst @@ -1286,7 +1286,7 @@ to cite the OpenKIM project :ref:`(Tadmor) `, KIM API in addition to the relevant scientific references for the IM. The citation format for an IM is displayed on its page on `OpenKIM `_ along with the corresponding BibTex file, -and is automatically added to the LAMMPS *log.cite* file. +and is automatically added to the LAMMPS citation reminder. Citing the IM software (KIM infrastructure and specific PM or SM codes) used in the simulation gives credit to the researchers who developed them diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 13282ebe9c..9937a98850 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -2540,6 +2540,8 @@ Px pxx Pxx Pxy +pxy +pxz py Py pydir @@ -2551,10 +2553,13 @@ pymol pypar pythonic pytorch +pyy Pyy +pyz pz Pz Pzz +pzz qbmsst qcore qdist diff --git a/src/USER-INTEL/npair_skip_intel.cpp b/src/USER-INTEL/npair_skip_intel.cpp index 4f6648ddc1..53900f116f 100644 --- a/src/USER-INTEL/npair_skip_intel.cpp +++ b/src/USER-INTEL/npair_skip_intel.cpp @@ -55,8 +55,8 @@ void NPairSkipIntel::copy_neighbor_info() { NPair::copy_neighbor_info(); if (_full_props) delete []_full_props; - _full_props = new int[neighbor->nlist]; - for (int i = 0; i < neighbor->nlist; i++) + _full_props = new int[neighbor->nrequest]; + for (int i = 0; i < neighbor->nrequest; i++) _full_props[i] = neighbor->requests[i]->full; } diff --git a/src/angle.h b/src/angle.h index ffed437743..c8af8202f0 100644 --- a/src/angle.h +++ b/src/angle.h @@ -26,7 +26,7 @@ class Angle : protected Pointers { int *setflag; int writedata; // 1 if writes coeffs to data file double energy; // accumulated energies - double virial[6]; // accumulated virial + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom,**vatom; // accumulated per-atom energy/virial double **cvatom; // accumulated per-atom centroid virial diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index e9477a7d41..44a0986cb8 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -539,7 +539,7 @@ void AtomVecTri::data_atom_bonus(int m, char **values) double area = 0.5 * MathExtra::len3(norm); rmass[m] *= area; - // inertia = inertia tensor of triangle as 6-vector in Voigt notation + // inertia = inertia tensor of triangle as 6-vector in Voigt ordering double inertia[6]; MathExtra::inertia_triangle(c1,c2,c3,rmass[m],inertia); diff --git a/src/bond.h b/src/bond.h index 5406aa3f02..74f38ad455 100644 --- a/src/bond.h +++ b/src/bond.h @@ -26,7 +26,7 @@ class Bond : protected Pointers { int *setflag; int writedata; // 1 if writes coeffs to data file double energy; // accumulated energies - double virial[6]; // accumulated virial + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom,**vatom; // accumulated per-atom energy/virial int reinitflag; // 1 if compatible with fix adapt and alike diff --git a/src/citeme.cpp b/src/citeme.cpp index 4b1b627298..fdd1ee867d 100644 --- a/src/citeme.cpp +++ b/src/citeme.cpp @@ -12,64 +12,118 @@ ------------------------------------------------------------------------- */ #include "citeme.h" +#include "comm.h" #include "universe.h" using namespace LAMMPS_NS; -static const char cite_header[] = - "This LAMMPS simulation made specific use of work described in the\n" - "following references. See https://lammps.sandia.gov/cite.html\n" - "for details.\n\n"; +static const char cite_separator[] = + "CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE\n\n"; -static const char cite_nagline[] = "\nPlease see the log.cite file " - "for references relevant to this simulation\n\n"; +static const char cite_nagline[] = + "Your simulation uses code contributions which should be cited:\n"; + +static const char cite_file[] = "The {} {} lists these citations in " + "BibTeX format.\n\n"; /* ---------------------------------------------------------------------- */ -CiteMe::CiteMe(LAMMPS *lmp) : Pointers(lmp) +CiteMe::CiteMe(LAMMPS *lmp, int _screen, int _logfile, const char *_file) + : Pointers(lmp) { fp = nullptr; cs = new citeset(); + + screen_flag = _screen; + scrbuffer.clear(); + logfile_flag = _logfile; + logbuffer.clear(); + + if (_file && universe->me == 0) { + citefile = _file; + fp = fopen(_file,"w"); + if (fp) { + fputs(cite_nagline,fp); + fflush(fp); + } else { + utils::logmesg(lmp, "Unable to open citation file '" + citefile + + "': " + utils::getsyserror() + "\n"); + } + } } /* ---------------------------------------------------------------------- - write out nag-line at the end of the regular output and clean up + write out remaining citations at end of the regular output and clean up ------------------------------------------------------------------------- */ CiteMe::~CiteMe() { - if (universe->me || cs->size() == 0) { - delete cs; - return; - } - + flush(); delete cs; - if (fp) { - if (screen) fprintf(screen,cite_nagline); - if (logfile) fprintf(logfile,cite_nagline); - - fclose(fp); - } + if (fp) fclose(fp); } /* ---------------------------------------------------------------------- - write out and register a citation so it will be written only once + process an added citation so it will be shown only once and as requested ------------------------------------------------------------------------- */ void CiteMe::add(const char *ref) { - if (universe->me) return; + if (comm->me != 0) return; if (cs->find(ref) != cs->end()) return; cs->insert(ref); - if (!fp) { - fp = fopen("log.cite","w"); - if (!fp) return; - fputs(cite_header,fp); + if (fp) { + fputs(ref,fp); fflush(fp); } - fputs(ref,fp); - fflush(fp); + if (scrbuffer.empty()) { + scrbuffer += "\n"; + scrbuffer += cite_separator; + scrbuffer += cite_nagline; + if (screen_flag == VERBOSE) scrbuffer += "\n"; + } + + if (logbuffer.empty()) { + logbuffer += "\n"; + logbuffer += cite_separator; + logbuffer += cite_nagline; + if (logfile_flag == VERBOSE) logbuffer += "\n"; + } + + std::string reference = ref; + std::size_t found = reference.find_first_of("\n"); + std::string header = reference.substr(0,found+1); + if (screen_flag == VERBOSE) scrbuffer += "- " + reference; + if (screen_flag == TERSE) scrbuffer += "- " + header; + if (logfile_flag == VERBOSE) logbuffer += "- " + reference; + if (logfile_flag == TERSE) logbuffer += "- " + header; } + +void CiteMe::flush() +{ + if (comm->me == 0) { + if (!scrbuffer.empty()) { + if (!citefile.empty()) + scrbuffer += fmt::format(cite_file,"file",citefile); + if (logfile_flag == VERBOSE) + scrbuffer += fmt::format(cite_file,"log","file"); + scrbuffer += cite_separator; + if (screen) fputs(scrbuffer.c_str(),screen); + scrbuffer.clear(); + } + if (!logbuffer.empty()) { + if (!citefile.empty()) + logbuffer += fmt::format(cite_file,"file",citefile); + if (screen_flag == VERBOSE) + scrbuffer += fmt::format(cite_file,"screen","output"); + logbuffer += cite_separator; + if (logfile) fputs(logbuffer.c_str(),logfile); + logbuffer.clear(); + } + } + return; +} + diff --git a/src/citeme.h b/src/citeme.h index c383ec2227..dd54268a3b 100644 --- a/src/citeme.h +++ b/src/citeme.h @@ -21,27 +21,33 @@ namespace LAMMPS_NS { class CiteMe : protected Pointers { public: - CiteMe(class LAMMPS *); + CiteMe(class LAMMPS *, int, int, const char *); virtual ~CiteMe(); - void add(const char *); // print out and register publication + void add(const char *); // register publication for output + void flush(); // flush buffers to screen and logfile + enum {VERBOSE, TERSE}; private: - FILE *fp; // opaque pointer to log.cite file object + FILE *fp; // explicit citation file pointer or NULL + std::string citefile; // name of the explicit citation file. + int screen_flag; // determine whether verbose or terse output + int logfile_flag; // determine whether verbose or terse output + std::string scrbuffer; // output buffer for screen + std::string logbuffer; // output buffer for logfile typedef std::set citeset; citeset *cs; // registered set of publications }; - } #endif /* ERROR/WARNING messages: -E: Cannot open log.cite file +E: Cannot open citation file This file is created when you use some LAMMPS features, to indicate what paper you should cite on behalf of those who implemented -the feature. Check that you have write privileges into the directory +the feature. Check that you have write privileges in the directory you are running in. */ diff --git a/src/compute_pressure.h b/src/compute_pressure.h index 8d0ec4aa04..235ccbe1eb 100644 --- a/src/compute_pressure.h +++ b/src/compute_pressure.h @@ -40,7 +40,7 @@ class ComputePressure : public Compute { double *kspace_virial; Compute *temperature; char *id_temp; - double virial[6]; + double virial[6]; // ordering: xx,yy,zz,xy,xz,yz int pairhybridflag; class Pair *pairhybrid; int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag; diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index 7ee17bcfcc..e5274d2cf8 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -233,7 +233,7 @@ void CreateBonds::many() // build neighbor list this command needs based on earlier request NeighList *list = neighbor->lists[irequest]; - neighbor->build_one(list); + neighbor->build_one(list,1); // loop over all neighs of each atom // compute distance between two atoms consistently on both procs diff --git a/src/dihedral.h b/src/dihedral.h index c571a74dd4..c7fd459f1e 100644 --- a/src/dihedral.h +++ b/src/dihedral.h @@ -26,7 +26,7 @@ class Dihedral : protected Pointers { int *setflag; int writedata; // 1 if writes coeffs to data file double energy; // accumulated energy - double virial[6]; // accumulated virial + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom,**vatom; // accumulated per-atom energy/virial double **cvatom; // accumulated per-atom centroid virial diff --git a/src/domain.h b/src/domain.h index d807463bf3..c3ea9e2bea 100644 --- a/src/domain.h +++ b/src/domain.h @@ -75,7 +75,8 @@ class Domain : protected Pointers { // triclinic box double xy,xz,yz; // 3 tilt factors - double h[6],h_inv[6]; // shape matrix in Voigt notation + double h[6],h_inv[6]; // shape matrix in Voigt ordering + // Voigt = xx,yy,zz,yz,xz,xy double h_rate[6],h_ratelo[3]; // rate of box size/shape change int box_change; // 1 if any of next 3 flags are set, else 0 diff --git a/src/fix_box_relax.cpp b/src/fix_box_relax.cpp index 0200f8ed03..ef3032fe0c 100644 --- a/src/fix_box_relax.cpp +++ b/src/fix_box_relax.cpp @@ -738,7 +738,7 @@ void FixBoxRelax::couple() if (!std::isfinite(p_current[0]) || !std::isfinite(p_current[1]) || !std::isfinite(p_current[2])) error->all(FLERR,"Non-numeric pressure - simulation unstable"); - // switch order from xy-xz-yz to Voigt + // switch order from xy-xz-yz to Voigt ordering if (pstyle == TRICLINIC) { p_current[3] = tensor[5]; diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index d1a2cb1463..46afe7b2d7 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -1063,7 +1063,7 @@ void FixNH::couple() if (!std::isfinite(p_current[0]) || !std::isfinite(p_current[1]) || !std::isfinite(p_current[2])) error->all(FLERR,"Non-numeric pressure - simulation unstable"); - // switch order from xy-xz-yz to Voigt + // switch order from xy-xz-yz to Voigt ordering if (pstyle == TRICLINIC) { p_current[3] = tensor[5]; @@ -1118,7 +1118,7 @@ void FixNH::remap() // h_dot = omega_dot * h // // where h_dot, omega_dot and h are all upper-triangular - // 3x3 tensors. In Voigt notation, the elements of the + // 3x3 tensors. In Voigt ordering, the elements of the // RHS product tensor are: // h_dot = [0*0, 1*1, 2*2, 1*3+3*2, 0*4+5*3+4*2, 0*5+5*1] // diff --git a/src/improper.h b/src/improper.h index 9e73be931c..1b3c9b6786 100644 --- a/src/improper.h +++ b/src/improper.h @@ -26,7 +26,7 @@ class Improper : protected Pointers { int *setflag; int writedata; // 1 if writes coeffs to data file double energy; // accumulated energies - double virial[6]; // accumulated virial + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom,**vatom; // accumulated per-atom energy/virial double **cvatom; // accumulated per-atom centroid virial diff --git a/src/integrate.cpp b/src/integrate.cpp index 5c700527a1..f866840f1c 100644 --- a/src/integrate.cpp +++ b/src/integrate.cpp @@ -12,12 +12,14 @@ ------------------------------------------------------------------------- */ #include "integrate.h" -#include "update.h" + +#include "citeme.h" +#include "compute.h" #include "force.h" -#include "pair.h" #include "kspace.h" #include "modify.h" -#include "compute.h" +#include "pair.h" +#include "update.h" using namespace LAMMPS_NS; @@ -45,6 +47,7 @@ Integrate::~Integrate() void Integrate::init() { + if (lmp->citeme) lmp->citeme->flush(); update->atimestep = update->ntimestep; // allow pair and Kspace compute() to be turned off via modify flags diff --git a/src/kspace.h b/src/kspace.h index 978daeace1..4777963d8a 100644 --- a/src/kspace.h +++ b/src/kspace.h @@ -32,7 +32,7 @@ class KSpace : protected Pointers { public: double energy; // accumulated energies double energy_1,energy_6; - double virial[6]; // accumulated virial + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom,**vatom; // accumulated per-atom energy/virial double e2group; // accumulated group-group energy double f2group[3]; // accumulated group-group force diff --git a/src/lammps.cpp b/src/lammps.cpp index 0b38f09ef5..6734fbd209 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -171,6 +171,9 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : int restart2dump = 0; int restartremap = 0; int citeflag = 1; + int citescreen = CiteMe::TERSE; + int citelogfile = CiteMe::VERBOSE; + char *citefile = nullptr; int helpflag = 0; suffix = suffix2 = suffixp = nullptr; @@ -190,7 +193,35 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : iarg = 1; while (iarg < narg) { - if (strcmp(arg[iarg],"-echo") == 0 || + if (strcmp(arg[iarg],"-cite") == 0 || + strcmp(arg[iarg],"-c") == 0) { + if (iarg+2 > narg) + error->universe_all(FLERR,"Invalid command-line argument"); + + if (strcmp(arg[iarg+1],"both") == 0) { + citescreen = CiteMe::VERBOSE; + citelogfile = CiteMe::VERBOSE; + citefile = nullptr; + } else if (strcmp(arg[iarg+1],"none") == 0) { + citescreen = CiteMe::TERSE; + citelogfile = CiteMe::TERSE; + citefile = nullptr; + } else if (strcmp(arg[iarg+1],"screen") == 0) { + citescreen = CiteMe::VERBOSE; + citelogfile = CiteMe::TERSE; + citefile = nullptr; + } else if (strcmp(arg[iarg+1],"log") == 0) { + citescreen = CiteMe::TERSE; + citelogfile = CiteMe::VERBOSE; + citefile = nullptr; + } else { + citescreen = CiteMe::TERSE; + citelogfile = CiteMe::TERSE; + citefile = arg[iarg+1]; + } + iarg += 2; + + } else if (strcmp(arg[iarg],"-echo") == 0 || strcmp(arg[iarg],"-e") == 0) { if (iarg+2 > narg) error->universe_all(FLERR,"Invalid command-line argument"); @@ -605,7 +636,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // allocate CiteMe class if enabled - if (citeflag) citeme = new CiteMe(this); + if (citeflag) citeme = new CiteMe(this,citescreen,citelogfile,citefile); else citeme = nullptr; // allocate input class now that MPI is fully setup @@ -669,8 +700,8 @@ LAMMPS::~LAMMPS() { const int me = comm->me; - destroy(); delete citeme; + destroy(); if (num_package) { for (int i = 0; i < num_package; i++) { @@ -1111,7 +1142,8 @@ void _noopt LAMMPS::help() "-kokkos on/off ... : turn KOKKOS mode on or off (-k)\n" "-log none/filename : where to send log output (-l)\n" "-mpicolor color : which exe in a multi-exe mpirun cmd (-m)\n" - "-nocite : disable writing log.cite file (-nc)\n" + "-cite : select citation reminder style (-c)\n" + "-nocite : disable citation reminder (-nc)\n" "-package style ... : invoke package command (-pk)\n" "-partition size1 size2 ... : assign partition sizes (-p)\n" "-plog basename : basename for partition logs (-pl)\n" diff --git a/src/lammps.h b/src/lammps.h index 49d55d4e37..553db6597e 100644 --- a/src/lammps.h +++ b/src/lammps.h @@ -56,7 +56,6 @@ class LAMMPS { char *exename; // pointer to argv[0] char ***packargs; // arguments for cmdline package commands int num_package; // number of cmdline package commands - int cite_enable; // 1 if generating log.cite, 0 if disabled int clientserver; // 0 = neither, 1 = client, 2 = server void *cslib; // client/server messaging via CSlib @@ -66,9 +65,9 @@ class LAMMPS { class AtomKokkos *atomKK; // KOKKOS version of Atom class class MemoryKokkos *memoryKK; // KOKKOS version of Memory class - class Python * python; // Python interface + class Python *python; // Python interface - class CiteMe *citeme; // citation info + class CiteMe *citeme; // handle citation info const char *match_style(const char *style, const char *name); static const char * installed_packages[]; diff --git a/src/math_extra.cpp b/src/math_extra.cpp index 2116324494..df74ad5be2 100644 --- a/src/math_extra.cpp +++ b/src/math_extra.cpp @@ -396,7 +396,7 @@ void quat_to_mat_trans(const double *quat, double mat[3][3]) compute space-frame inertia tensor of an ellipsoid radii = 3 radii of ellipsoid quat = orientiation quaternion of ellipsoid - return symmetric inertia tensor as 6-vector in Voigt notation + return symmetric inertia tensor as 6-vector in Voigt ordering ------------------------------------------------------------------------- */ void inertia_ellipsoid(double *radii, double *quat, double mass, @@ -424,7 +424,7 @@ void inertia_ellipsoid(double *radii, double *quat, double mass, compute space-frame inertia tensor of a line segment in 2d length = length of line theta = orientiation of line - return symmetric inertia tensor as 6-vector in Voigt notation + return symmetric inertia tensor as 6-vector in Voigt ordering ------------------------------------------------------------------------- */ void inertia_line(double length, double theta, double mass, double *inertia) @@ -462,7 +462,7 @@ void inertia_line(double length, double theta, double mass, double *inertia) S = 1/24 [2 1 1] [1 2 1] [1 1 2] - return symmetric inertia tensor as 6-vector in Voigt notation + return symmetric inertia tensor as 6-vector in Voigt ordering ------------------------------------------------------------------------- */ void inertia_triangle(double *v0, double *v1, double *v2, @@ -503,7 +503,7 @@ void inertia_triangle(double *v0, double *v1, double *v2, compute space-frame inertia tensor of a triangle idiag = previously computed diagonal inertia tensor quat = orientiation quaternion of triangle - return symmetric inertia tensor as 6-vector in Voigt notation + return symmetric inertia tensor as 6-vector in Voigt ordering ------------------------------------------------------------------------- */ void inertia_triangle(double *idiag, double *quat, double /*mass*/, diff --git a/src/math_extra.h b/src/math_extra.h index 390538efdb..767ae3f531 100644 --- a/src/math_extra.h +++ b/src/math_extra.h @@ -95,7 +95,7 @@ namespace MathExtra { double dt); // shape matrix operations - // upper-triangular 3x3 matrix stored in Voigt notation as 6-vector + // upper-triangular 3x3 matrix stored in Voigt ordering as 6-vector inline void multiply_shape_shape(const double *one, const double *two, double *ans); @@ -593,7 +593,7 @@ inline void MathExtra::scalar_times3(const double f, double m[3][3]) /* ---------------------------------------------------------------------- multiply 2 shape matrices - upper-triangular 3x3, stored as 6-vector in Voigt notation + upper-triangular 3x3, stored as 6-vector in Voigt ordering ------------------------------------------------------------------------- */ inline void MathExtra::multiply_shape_shape(const double *one, diff --git a/src/minimize.cpp b/src/minimize.cpp index a909afdaa5..8e55d6e0ea 100644 --- a/src/minimize.cpp +++ b/src/minimize.cpp @@ -13,6 +13,7 @@ #include "minimize.h" +#include "citeme.h" #include "domain.h" #include "error.h" #include "finish.h" @@ -46,6 +47,7 @@ void Minimize::command(int narg, char **arg) if (update->etol < 0.0 || update->ftol < 0.0) error->all(FLERR,"Illegal minimize command"); + if (lmp->citeme) lmp->citeme->flush(); update->whichflag = 2; update->beginstep = update->firststep = update->ntimestep; update->endstep = update->laststep = update->firststep + update->nsteps; diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp index 0d4818fbe1..8c8168952e 100644 --- a/src/neigh_request.cpp +++ b/src/neigh_request.cpp @@ -225,6 +225,8 @@ void NeighRequest::copy_request(NeighRequest *other, int skipflag) int i,j; int ntypes = atom->ntypes; + skip = other->skip; + if (other->iskip) { iskip = new int[ntypes+1]; for (i = 1; i <= ntypes; i++) diff --git a/src/pair.h b/src/pair.h index 5801941458..9bca64fbf3 100644 --- a/src/pair.h +++ b/src/pair.h @@ -35,7 +35,7 @@ class Pair : protected Pointers { static int instance_total; // # of Pair classes ever instantiated double eng_vdwl,eng_coul; // accumulated energies - double virial[6]; // accumulated virial + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom,**vatom; // accumulated per-atom energy/virial double **cvatom; // accumulated per-atom centroid virial diff --git a/src/version.h b/src/version.h index f812b62821..84541d4456 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "24 Dec 2020" +#define LAMMPS_VERSION "10 Feb 2021"