diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp index 04fa5330f9..71b8a82cc7 100644 --- a/src/ASPHERE/pair_gayberne.cpp +++ b/src/ASPHERE/pair_gayberne.cpp @@ -34,13 +34,14 @@ using namespace LAMMPS_NS; static const char cite_pair_gayberne[] = - "pair gayberne command:\n\n" + "pair gayberne command: doi:10.1063/1.3058435\n\n" "@Article{Brown09,\n" - " author = {W. M. Brown, M. K. Petersen, S. J. Plimpton, and G. S. Grest},\n" - " title = {Liquid crystal nanodroplets in solution},\n" - " journal = {J.~Chem.~Phys.},\n" + " author = {W. M. Brown and M. K. Petersen and S. J. Plimpton and G. S. Grest},\n" + " title = {Liquid Crystal Nanodroplets in Solution},\n" + " journal = {J.~Chem.\\ Phys.},\n" " year = 2009,\n" " volume = 130,\n" + " number = 4,\n" " pages = {044901}\n" "}\n\n"; diff --git a/src/BOCS/fix_bocs.cpp b/src/BOCS/fix_bocs.cpp index 3083286be8..449deefd59 100644 --- a/src/BOCS/fix_bocs.cpp +++ b/src/BOCS/fix_bocs.cpp @@ -42,13 +42,15 @@ using namespace LAMMPS_NS; using namespace FixConst; static const char cite_user_bocs_package[] = - "BOCS package:\n\n" + "BOCS package: doi:10.1021/acs.jpcb.7b09993\n\n" "@Article{Dunn2018,\n" - " author = {NJH Dunn, KM Lebold, MR DeLyser, JF Rudzinski, WG Noid},\n" - " title = {BOCS: Bottom-Up Open-Source Coarse-Graining Software},\n" - " journal = {J. Phys. Chem. B},\n" + " author = {N. J. H. Dunn and K. M. Lebold and M. R. {DeLyser} and\n" + " J. F. Rudzinski and W. G. Noid},\n" + " title = {{BOCS}: Bottom-Up Open-Source Coarse-Graining Software},\n" + " journal = {J.~Phys.\\ Chem.~B},\n" " year = 2018,\n" " volume = 122,\n" + " number = 13,\n" " pages = {3363--3377}\n" "}\n\n"; diff --git a/src/DIELECTRIC/atom_vec_dielectric.cpp b/src/DIELECTRIC/atom_vec_dielectric.cpp index 67bb9f7dc3..f1126d8d7a 100644 --- a/src/DIELECTRIC/atom_vec_dielectric.cpp +++ b/src/DIELECTRIC/atom_vec_dielectric.cpp @@ -21,13 +21,13 @@ using namespace LAMMPS_NS; static const char cite_user_dielectric_package[] = - "DIELECTRIC package:\n\n" + "DIELECTRIC package: doi:10.1016/j.cpc.2019.03.006\n\n" "@Article{TrungCPC19,\n" - " author = {Trung Dac Nguyen, Honghao Li, Debarshee Bagchi," - " Francisco J. Solis, Monica Olvera de la Cruz,\n" - " title = {Incorporating surface polarization effects into large-scale" - " coarse-grained Molecular Dynamics simulation},\n" - " journal = {Comp.~Phys.~Comm.},\n" + " author = {Trung Dac Nguyen and Honghao Li and Debarshee Bagchi and" + " Francisco J. Solis and Olvera de la Cruz, Monica}\n" + " title = {Incorporating Surface Polarization Effects Into Large-Scale\n" + " Coarse-Grained Molecular Dynamics Simulation},\n" + " journal = {Comput.\\ Phys.\\ Commun.},\n" " year = 2019,\n" " volume = 241,\n" " pages = {80--91}\n" diff --git a/src/DIFFRACTION/compute_saed.cpp b/src/DIFFRACTION/compute_saed.cpp index e21570d76d..6688d7a010 100644 --- a/src/DIFFRACTION/compute_saed.cpp +++ b/src/DIFFRACTION/compute_saed.cpp @@ -39,8 +39,8 @@ using namespace MathConst; static const char cite_compute_saed_c[] = "compute_saed command: doi:10.1088/0965-0393/21/5/055020\n\n" "@Article{Coleman13,\n" - " author = {S. P. Coleman, D. E. Spearot, L. Capolungo},\n" - " title = {Virtual diffraction analysis of Ni [010] symmetric tilt grain boundaries},\n" + " author = {S. P. Coleman and D. E. Spearot and L. Capolungo},\n" + " title = {Virtual Diffraction Analysis of {Ni} [010] Symmetric Tilt Grain Boundaries},\n" " journal = {Modelling and Simulation in Materials Science and Engineering},\n" " year = 2013,\n" " volume = 21,\n" diff --git a/src/DIFFRACTION/compute_xrd.cpp b/src/DIFFRACTION/compute_xrd.cpp index aef4d932a9..874fc614ce 100644 --- a/src/DIFFRACTION/compute_xrd.cpp +++ b/src/DIFFRACTION/compute_xrd.cpp @@ -40,8 +40,8 @@ using namespace MathConst; static const char cite_compute_xrd_c[] = "compute_xrd command: doi:10.1088/0965-0393/21/5/055020\n\n" "@Article{Coleman13,\n" - " author = {S. P. Coleman, D. E. Spearot, L. Capolungo},\n" - " title = {Virtual diffraction analysis of Ni [010] symmetric tilt grain boundaries},\n" + " author = {S. P. Coleman and D. E. Spearot and L. Capolungo},\n" + " title = {Virtual Diffraction Analysis of {Ni} [010] Symmetric Tilt Grain Boundaries},\n" " journal = {Modelling and Simulation in Materials Science and Engineering},\n" " year = 2013,\n" " volume = 21,\n" diff --git a/src/DPD-MESO/pair_edpd.cpp b/src/DPD-MESO/pair_edpd.cpp index b05f588b7c..13cbed2ece 100644 --- a/src/DPD-MESO/pair_edpd.cpp +++ b/src/DPD-MESO/pair_edpd.cpp @@ -41,18 +41,18 @@ using namespace LAMMPS_NS; #define EPSILON 1.0e-10 static const char cite_pair_edpd[] = - "pair edpd command:\n\n" + "pair edpd command: doi:10.1016/j.jcp.2014.02.003\n\n" "@Article{ZLi2014_JCP,\n" - " author = {Li, Z. and Tang, Y.-H. and Lei, H. and Caswell, B. and Karniadakis, G.E.},\n" - " title = {Energy-conserving dissipative particle dynamics with temperature-dependent properties},\n" + " author = {Li, Z. and Tang, Y.-H. and Lei, H. and Caswell, B. and Karniadakis, G. E.},\n" + " title = {Energy-Conserving Dissipative Particle Dynamics with Temperature-Dependent Properties},\n" " journal = {Journal of Computational Physics},\n" " year = {2014},\n" " volume = {265},\n" " pages = {113--127}\n" "}\n\n" "@Article{ZLi2015_CC,\n" - " author = {Li, Z. and Tang, Y.-H. and Li, X. and Karniadakis, G.E.},\n" - " title = {Mesoscale modeling of phase transition dynamics of thermoresponsive polymers},\n" + " author = {Li, Z. and Tang, Y.-H. and Li, X. and Karniadakis, G. E.},\n" + " title = {Mesoscale Modeling of Phase Transition Dynamics of Thermoresponsive Polymers},\n" " journal = {Chemical Communications},\n" " year = {2015},\n" " volume = {51},\n" diff --git a/src/DPD-MESO/pair_mdpd.cpp b/src/DPD-MESO/pair_mdpd.cpp index ec0a57be15..c08ac2dde3 100644 --- a/src/DPD-MESO/pair_mdpd.cpp +++ b/src/DPD-MESO/pair_mdpd.cpp @@ -37,13 +37,14 @@ using namespace LAMMPS_NS; #define EPSILON 1.0e-10 static const char cite_pair_mdpd[] = - "pair mdpd command:\n\n" + "pair mdpd command: doi:10.1063/1.4812366\n\n" "@Article{ZLi2013_POF,\n" - " author = {Li, Z. and Hu, G.H. and Wang, Z.L. and Ma Y.B. and Zhou, Z.W.},\n" - " title = {Three dimensional flow structures in a moving droplet on substrate: a dissipative particle dynamics study},\n" + " author = {Li, Z. and Hu, G. H. and Wang, Z. L. and Ma Y. B. and Zhou, Z. W.},\n" + " title = {Three Dimensional Flow Structures in a Moving Droplet on Substrate: a Dissipative Particle Dynamics Study},\n" " journal = {Physics of Fluids},\n" " year = {2013},\n" " volume = {25},\n" + " number = {7},\n" " pages = {072103}\n" "}\n\n"; diff --git a/src/DPD-MESO/pair_tdpd.cpp b/src/DPD-MESO/pair_tdpd.cpp index 39d9a151d9..6efe3f4546 100644 --- a/src/DPD-MESO/pair_tdpd.cpp +++ b/src/DPD-MESO/pair_tdpd.cpp @@ -40,13 +40,14 @@ using namespace LAMMPS_NS; #define EPSILON 1.0e-10 static const char cite_pair_tdpd[] = - "pair tdpd command:\n\n" + "pair tdpd command: doi:10.1063/1.4923254\n\n" "@Article{ZLi2015_JCP,\n" - " author = {Li, Z. and Yazdani, A. and Tartakovsky, A. and Karniadakis, G.E.},\n" - " title = {Transport dissipative particle dynamics model for mesoscopic advection-diffusion-reaction problems},\n" + " author = {Li, Z. and Yazdani, A. and Tartakovsky, A. and Karniadakis, G. E.},\n" + " title = {Transport Dissipative Particle Dynamics Model for Mesoscopic Advection-Diffusion-Reaction Problems},\n" " journal = {The Journal of Chemical Physics},\n" " year = {2015},\n" " volume = {143},\n" + " number = {1},\n" " pages = {014101}\n" "}\n\n"; diff --git a/src/DPD-REACT/fix_shardlow.cpp b/src/DPD-REACT/fix_shardlow.cpp index 7ab8c6f857..41239c9058 100644 --- a/src/DPD-REACT/fix_shardlow.cpp +++ b/src/DPD-REACT/fix_shardlow.cpp @@ -63,21 +63,22 @@ using namespace random_external_state; #define EPSILON_SQUARED ((EPSILON) * (EPSILON)) static const char cite_fix_shardlow[] = - "fix shardlow command:\n\n" + "fix shardlow command: doi:10.1016/j.cpc.2014.03.029, doi:10.1063/1.3660209\n\n" "@Article{Larentzos14,\n" - " author = {J. P. Larentzos, J. K. Brennan, J. D. Moore, M. Lisal, W. D. Mattson},\n" - " title = {Parallel implementation of isothermal and isoenergetic Dissipative Particle Dynamics using Shardlow-like splitting algorithms},\n" - " journal = {Computer Physics Communications},\n" + " author = {J. P. Larentzos and J. K. Brennan and J. D. Moore and M. Lisal and W. D. Mattson},\n" + " title = {Parallel Implementation of Isothermal and Isoenergetic Dissipative Particle Dynamics Using {S}hardlow-Like Splitting Algorithms},\n" + " journal = {Comput.\\ Phys.\\ Commun.},\n" " year = 2014,\n" " volume = 185\n" " pages = {1987--1998}\n" "}\n\n" "@Article{Lisal11,\n" - " author = {M. Lisal, J. K. Brennan, J. Bonet Avalos},\n" - " title = {Dissipative particle dynamics at isothermal, isobaric, isoenergetic, and isoenthalpic conditions using Shardlow-like splitting algorithms},\n" - " journal = {Journal of Chemical Physics},\n" + " author = {M. Lisal and J. K. Brennan and J. Bonet Avalos},\n" + " title = {Dissipative Particle Dynamics at Isothermal, Isobaric, Isoenergetic, and Isoenthalpic Conditions Using {S}hardlow-Like Splitting Algorithms},\n" + " journal = {J.~Chem.\\ Phys.},\n" " year = 2011,\n" - " volume = 135\n" + " volume = 135,\n" + " number = 20,\n" " pages = {204105}\n" "}\n\n"; diff --git a/src/DPD-REACT/pair_multi_lucy.cpp b/src/DPD-REACT/pair_multi_lucy.cpp index 009ebfc21f..bb6792da74 100644 --- a/src/DPD-REACT/pair_multi_lucy.cpp +++ b/src/DPD-REACT/pair_multi_lucy.cpp @@ -44,13 +44,14 @@ enum{NONE,RLINEAR,RSQ}; #define MAXLINE 1024 static const char cite_pair_multi_lucy[] = - "pair_style multi/lucy command:\n\n" + "pair_style multi/lucy command: doi:10.1063/1.4942520\n\n" "@Article{Moore16,\n" - " author = {J.D. Moore, B.C. Barnes, S. Izvekov, M. Lisal, M.S. Sellers, D.E. Taylor and J. K. Brennan},\n" - " title = {A coarse-grain force field for RDX: Density dependent and energy conserving},\n" - " journal = {J. Chem. Phys.},\n" + " author = {J. D. Moore and B. C. Barnes and S. Izvekov and M. Lisal and M. S. Sellers and D. E. Taylor and J. K. Brennan},\n" + " title = {A Coarse-Grain Force Field for {RDX}: Density Dependent and Energy Conserving},\n" + " journal = {J.~Chem.\\ Phys.},\n" " year = 2016,\n" " volume = 144\n" + " number = 10,\n" " pages = {104501}\n" "}\n\n"; diff --git a/src/DPD-REACT/pair_multi_lucy_rx.cpp b/src/DPD-REACT/pair_multi_lucy_rx.cpp index bd508707dd..c2a3f1a55e 100644 --- a/src/DPD-REACT/pair_multi_lucy_rx.cpp +++ b/src/DPD-REACT/pair_multi_lucy_rx.cpp @@ -55,11 +55,11 @@ enum{NONE,RLINEAR,RSQ}; #define isOneFluid(_site) ( (_site) == oneFluidParameter ) static const char cite_pair_multi_lucy_rx[] = - "pair_style multi/lucy/rx command:\n\n" + "pair_style multi/lucy/rx command: doi:10.1063/1.4942520\n\n" "@Article{Moore16,\n" - " author = {J.D. Moore, B.C. Barnes, S. Izvekov, M. Lisal, M.S. Sellers, D.E. Taylor and J. K. Brennan},\n" - " title = {A coarse-grain force field for RDX: Density dependent and energy conserving},\n" - " journal = {J. Chem. Phys.},\n" + " author = {J. D. Moore and B. C. Barnes and S. Izvekov and M. Lisal and M. S. Sellers and D. E. Taylor and J. K. Brennan},\n" + " title = {A Coarse-Grain Force Field for {RDX}: {D}ensity Dependent and Energy Conserving},\n" + " journal = {J.~Chem.\\ Phys.},\n" " year = 2016,\n" " volume = 144\n" " pages = {104501}\n" diff --git a/src/EFF/atom_vec_electron.cpp b/src/EFF/atom_vec_electron.cpp index 1f9d1f3e65..5d600b5037 100644 --- a/src/EFF/atom_vec_electron.cpp +++ b/src/EFF/atom_vec_electron.cpp @@ -23,14 +23,15 @@ using namespace LAMMPS_NS; static const char cite_user_eff_package[] = - "EFF package:\n\n" + "EFF package: doi:10.1002/jcc.21637\n\n" "@Article{Jaramillo-Botero11,\n" - " author = {A. Jaramillo-Botero, J. Su, A. Qi, W. A. Goddard III},\n" + " author = {A. Jaramillo-Botero and J. Su and A. Qi and Goddard, III, W. A.},\n" " title = {Large-Scale, Long-Term Nonadiabatic Electron Molecular Dynamics for Describing " "Material Properties and Phenomena in Extreme Environments},\n" - " journal = {J.~Comp.~Chem.},\n" + " journal = {J.~Comp.\\ Chem.},\n" " year = 2011,\n" " volume = 32,\n" + " number = 3,\n" " pages = {497--512}\n" "}\n\n"; diff --git a/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp b/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp index 2dde2397db..1e942627bb 100644 --- a/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp @@ -37,10 +37,10 @@ using namespace LAMMPS_NS; ------------------------------------------------------------------------------------*/ static const char cite_compute_stress_cartesian[] = - "compute stress/cartesian:\n\n" + "compute stress/cartesian: doi:10.3390/nano11010165\n\n" "@article{galteland2021nanothermodynamic,\n" - "title={Nanothermodynamic description and molecular simulation of a single-phase fluid in a " - "slit pore},\n" + "title={Nanothermodynamic Description and Molecular Simulation of a\n" + " Single-Phase Fluid in a Slit Pore},\n" "author={Galteland, Olav and Bedeaux, Dick and Kjelstrup, Signe},\n" "journal={Nanomaterials},\n" "volume={11},\n" diff --git a/src/EXTRA-COMPUTE/compute_stress_cylinder.cpp b/src/EXTRA-COMPUTE/compute_stress_cylinder.cpp index e4c246b469..6304744ba1 100644 --- a/src/EXTRA-COMPUTE/compute_stress_cylinder.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_cylinder.cpp @@ -43,13 +43,14 @@ using MathSpecial::square; ------------------------------------------------------------------------------------*/ static const char cite_compute_stress_cylinder[] = - "compute stress/cylinder:\n\n" + "compute stress/cylinder: doi:10.1063/1.5037054\n\n" "@Article{Addington,\n" - " author = {C. K. Addington, Y. Long, K. E. Gubbins},\n" - " title = {The pressure in interfaces having cylindrical geometry},\n" - " journal = {J.~Chem.~Phys.},\n" + " author = {C. K. Addington and Y. Long and K. E. Gubbins},\n" + " title = {The Pressure in Interfaces Having Cylindrical Geometry},\n" + " journal = {J.~Chem.\\ Phys.},\n" " year = 2018,\n" " volume = 149,\n" + " number = 8,\n" " pages = {084109}\n" "}\n\n"; diff --git a/src/EXTRA-COMPUTE/compute_stress_spherical.cpp b/src/EXTRA-COMPUTE/compute_stress_spherical.cpp index 18165513f9..c893d21f51 100644 --- a/src/EXTRA-COMPUTE/compute_stress_spherical.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_spherical.cpp @@ -46,11 +46,11 @@ using MathSpecial::square; ------------------------------------------------------------------------------------*/ static const char cite_compute_stress_sphere[] = - "compute stress/spherical:\n\n" + "compute stress/spherical: doi:10.48550/arXiv.2201.13060\n\n" "@article{galteland2022defining,\n" - "title={Defining the pressures of a fluid in a nanoporous, heterogeneous medium},\n" + "title={Defining the Pressures of a Fluid in a Nanoporous, Heterogeneous Medium},\n" "author={Galteland, Olav and Rauter, Michael T and Varughese, Kevin K and Bedeaux, Dick and " - "Kjelstrup, Signe},\n" + " Kjelstrup, Signe},\n" "journal={arXiv preprint arXiv:2201.13060},\n" "year={2022}\n" "}\n\n"; diff --git a/src/EXTRA-FIX/fix_ave_correlate_long.cpp b/src/EXTRA-FIX/fix_ave_correlate_long.cpp index c51ff7f3bd..9ed8a1e466 100644 --- a/src/EXTRA-FIX/fix_ave_correlate_long.cpp +++ b/src/EXTRA-FIX/fix_ave_correlate_long.cpp @@ -43,13 +43,14 @@ using namespace FixConst; enum{AUTO,UPPER,LOWER,AUTOUPPER,AUTOLOWER,FULL}; static const char cite_fix_ave_correlate_long[] = -"fix ave/correlate/long command:\n\n" +"fix ave/correlate/long command: doi:10.1063/1.3491098\n\n" "@Article{Ramirez10,\n" " author = {Jorge Rami{\'}rez and Sathish K. Sukumaran and Bart Vorselaars and Alexei E. Likhtman},\n" -" title = {Efficient on the fly calculation of time correlation functions in computer simulations}," -" journal = {J.~Chem.~Phys.},\n" +" title = {Efficient on the Fly Calculation of Time Correlation Functions in Computer Simulations}," +" journal = {J.~Chem.\\ Phys.},\n" " year = 2010,\n" " volume = 133,\n" +" number = 15,\n" " pages = {154103}\n" "}\n\n"; diff --git a/src/EXTRA-FIX/fix_electron_stopping_fit.cpp b/src/EXTRA-FIX/fix_electron_stopping_fit.cpp index 0e0ccc0ebb..aa3e7fc867 100644 --- a/src/EXTRA-FIX/fix_electron_stopping_fit.cpp +++ b/src/EXTRA-FIX/fix_electron_stopping_fit.cpp @@ -35,24 +35,24 @@ using namespace FixConst; // --------------------------------------------------------------------- static const char cite_fix_electron_stopping_fit_c[] = - "fix electron/stopping/fit command:\n\n" + "fix electron/stopping/fit command: doi:10.1063/1.5022471, doi:10.1103/PhysRevB.102.024107\n\n" "@Article{Stewart2018,\n" - " author = { J.A. Stewart and G. Brookman and P. Price and M. Franco and W. Ji and K. Hattar and R. Dingreville },\n" - " title = { Characterizing single isolated radiation-damage events from molecular dynamics via virtual diffraction methods },\n" - " journal = { Journal of Applied Physics },\n" - " year = { 2018 },\n" - " volume = { 123 },\n" - " number = { 16 },\n" - " pages = { 165902 }\n" + " author = {J. A. Stewart and G. Brookman and P. Price and M. Franco and W. Ji and K. Hattar and R. Dingreville},\n" + " title = {Characterizing Single Isolated Radiation-Damage Events from Molecular Dynamics via Virtual Diffraction Methods},\n" + " journal = {Journal of Applied Physics},\n" + " year = {2018},\n" + " volume = {123},\n" + " number = {16},\n" + " pages = {165902}\n" "}\n\n" "@Article{Lee2020,\n" - " author = { C.W. Lee and J.A. Stewart and S.M. Foiles and R. Dingreville and A. Schleife },\n" - " title = { Multiscale simulations of electron and ion dynamics in self-irradiated silicon },\n" - " journal = { Physical Review B },\n" - " year = { 2020 },\n" - " volume = { 102 },\n" - " number = { 2 },\n" - " pages = { 024107 }\n" + " author = {C. W. Lee and J. A. Stewart and S. M. Foiles and R. Dingreville and A. Schleife },\n" + " title = {Multiscale Simulations of Electron and Ion Dynamics in Self-Irradiated Silicon},\n" + " journal = {Physical Review~B},\n" + " year = {2020},\n" + " volume = {102},\n" + " number = {2},\n" + " pages = {024107}\n" "}\n\n"; // --------------------------------------------------------------------- diff --git a/src/EXTRA-FIX/fix_filter_corotate.cpp b/src/EXTRA-FIX/fix_filter_corotate.cpp index e2bd982617..06eefd9ebd 100644 --- a/src/EXTRA-FIX/fix_filter_corotate.cpp +++ b/src/EXTRA-FIX/fix_filter_corotate.cpp @@ -46,14 +46,14 @@ using namespace FixConst; #define MASSDELTA 0.1 static const char cite_filter_corotate[] = - "Mollified Impulse Method with Corotational Filter:\n\n" + "Mollified Impulse Method with Corotational Filter: doi:10.1016/j.jcp.2016.12.024\n\n" "@Article{Fath2017,\n" " Title =" - "{A fast mollified impulse method for biomolecular atomistic simulations},\n" - " Author = {L. Fath and M. Hochbruck and C.V. Singh},\n" + "{A Fast Mollified Impulse Method for Biomolecular Atomistic Simulations},\n" + " Author = {L. Fath and M. Hochbruck and C. V. Singh},\n" " Journal = {Journal of Computational Physics},\n" " Year = {2017},\n" - " Pages = {180 - 198},\n" + " Pages = {180--198},\n" " Volume = {333},\n\n" " Doi = {https://doi.org/10.1016/j.jcp.2016.12.024},\n" " ISSN = {0021-9991},\n" diff --git a/src/EXTRA-FIX/fix_flow_gauss.cpp b/src/EXTRA-FIX/fix_flow_gauss.cpp index a1238ea748..8b9d9dca8f 100644 --- a/src/EXTRA-FIX/fix_flow_gauss.cpp +++ b/src/EXTRA-FIX/fix_flow_gauss.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; using namespace FixConst; static const char cite_flow_gauss[] = - "Gaussian dynamics package:\n\n" + "Gaussian dynamics package: doi:10.1021/acs.jpcb.6b09387\n\n" "@Article{strong_water_2017,\n" "title = {The Dynamics of Water in Porous Two-Dimensional Crystals},\n" "volume = {121},\n" @@ -41,7 +41,7 @@ static const char cite_flow_gauss[] = "url = {https://doi.org/10.1021/acs.jpcb.6b09387},\n" "doi = {10.1021/acs.jpcb.6b09387},\n" "urldate = {2016-12-07},\n" - "journal = {J. Phys. Chem. B},\n" + "journal = {J.~Phys.\\ Chem.~B},\n" "author = {Strong, Steven E. and Eaves, Joel D.},\n" "year = {2017},\n" "pages = {189--207}\n" diff --git a/src/EXTRA-FIX/fix_pafi.cpp b/src/EXTRA-FIX/fix_pafi.cpp index d6ee4627c9..1326dcc44a 100644 --- a/src/EXTRA-FIX/fix_pafi.cpp +++ b/src/EXTRA-FIX/fix_pafi.cpp @@ -40,11 +40,11 @@ using namespace LAMMPS_NS; static const char cite_fix_pafi_package[] = - "citation for fix pafi:\n\n" + "citation for fix pafi: doi:10.1103/PhysRevLett.120.135503\n\n" "@article{SwinburneMarinica2018,\n" "author={T. D. Swinburne and M. C. Marinica},\n" - "title={Unsupervised calculation of free energy barriers in large " - "crystalline systems},\n" + "title={Unsupervised Calculation of Free Energy Barriers in Large\n" + " Crystalline Systems},\n" "journal={Physical Review Letters},\n" "volume={120},\n" "number={13},\n" diff --git a/src/EXTRA-FIX/fix_rhok.cpp b/src/EXTRA-FIX/fix_rhok.cpp index 9bdf940a7b..077dad7f25 100644 --- a/src/EXTRA-FIX/fix_rhok.cpp +++ b/src/EXTRA-FIX/fix_rhok.cpp @@ -31,15 +31,15 @@ using namespace FixConst; using namespace MathConst; static const char cite_fix_rhok[] = - "Bias on the collective density field (fix rhok):\n\n" + "Bias on the collective density field (fix rhok): doi:10.1063/1.4818747\n\n" "@Article{pedersen_jcp139_104102_2013,\n" - "title = {Direct calculation of the solid-liquid Gibbs free energy difference in a single equilibrium simulation},\n" + "title = {Direct Calculation of the Solid-Liquid {G}ibbs Free Energy Difference in a Single Equilibrium Simulation},\n" "volume = {139},\n" "number = {10},\n" "url = {https://aip.scitation.org/doi/10.1063/1.4818747},\n" "doi = {10.1063/1.4818747},\n" "urldate = {2017-10-03},\n" - "journal = {J. Chem. Phys.},\n" + "journal = {J.~Chem.\\ Phys.},\n" "author = {Pedersen, Ulf R.},\n" "year = {2013},\n" "pages = {104102}\n" diff --git a/src/EXTRA-FIX/fix_ti_spring.cpp b/src/EXTRA-FIX/fix_ti_spring.cpp index b332c18148..e44afdba01 100644 --- a/src/EXTRA-FIX/fix_ti_spring.cpp +++ b/src/EXTRA-FIX/fix_ti_spring.cpp @@ -35,10 +35,10 @@ using namespace LAMMPS_NS; using namespace FixConst; static const char cite_fix_ti_spring[] = - "ti/spring command:\n\n" + "ti/spring command: doi:10.1016/j.commatsci.2015.10.050\n\n" "@article{freitas2016,\n" " author={Freitas, Rodrigo and Asta, Mark and de Koning, Maurice},\n" - " title={Nonequilibrium free-energy calculation of solids using LAMMPS},\n" + " title={Nonequilibrium Free-Energy Calculation of Solids Using {LAMMPS}},\n" " journal={Computational Materials Science},\n" " volume={112},\n" " pages={333--341},\n" diff --git a/src/EXTRA-FIX/fix_ttm_mod.cpp b/src/EXTRA-FIX/fix_ttm_mod.cpp index 8979a30bf4..539b7e1c19 100644 --- a/src/EXTRA-FIX/fix_ttm_mod.cpp +++ b/src/EXTRA-FIX/fix_ttm_mod.cpp @@ -48,11 +48,11 @@ using namespace MathConst; // to spatially average consistent with the TTM grid static const char cite_fix_ttm_mod[] = - "fix ttm/mod command:\n\n" + "fix ttm/mod command: doi:10.1088/0953-8984/26/47/475401, doi:10.1002/ctpp.201310025\n\n" "@article{Pisarev2014,\n" "author = {Pisarev, V. V. and Starikov, S. V.},\n" - "title = {{Atomistic simulation of ion track formation in UO2.}},\n" - "journal = {J.~Phys.:~Condens.~Matter},\n" + "title = {Atomistic Simulation of Ion Track Formation in {UO$_2$}.},\n" + "journal = {J.~Phys.\\ Condens.\\ Matter},\n" "volume = {26},\n" "number = {47},\n" "pages = {475401},\n" @@ -60,8 +60,8 @@ static const char cite_fix_ttm_mod[] = "}\n\n" "@article{Norman2013,\n" "author = {Norman, G. E. and Starikov, S. V. and Stegailov, V. V. and Saitov, I. M. and Zhilyaev, P. A.},\n" - "title = {{Atomistic Modeling of Warm Dense Matter in the Two-Temperature State}},\n" - "journal = {Contrib.~Plasm.~Phys.},\n" + "title = {Atomistic Modeling of Warm Dense Matter in the Two-Temperature State},\n" + "journal = {Contrib.\\ Plasma Phys.},\n" "number = {2},\n" "volume = {53},\n" "pages = {129--139},\n" diff --git a/src/EXTRA-MOLECULE/dihedral_table_cut.cpp b/src/EXTRA-MOLECULE/dihedral_table_cut.cpp index 5ac3ab6ebb..4830516b1d 100644 --- a/src/EXTRA-MOLECULE/dihedral_table_cut.cpp +++ b/src/EXTRA-MOLECULE/dihedral_table_cut.cpp @@ -36,13 +36,13 @@ using namespace LAMMPS_NS; using namespace MathConst; static const char cite_dihedral_tablecut[] = - "dihedral_style table/cut command:\n\n" + "dihedral_style table/cut command: doi:10.1021/acs.jctc.7b01229\n\n" "@Article{Salerno17,\n" " author = {K. M. Salerno and N. Bernstein},\n" " title = {Persistence Length, End-to-End Distance, and Structure of Coarse-Grained Polymers},\n" - " journal = {J.~Chem.~Theory Comput.},\n" + " journal = {J.~Chem.\\ Theory Comput.},\n" " year = 2018,\n" - " DOI = 10.1021/acs.jctc.7b01229" + " DOI = \"10.1021/acs.jctc.7b01229\"\n" "}\n\n"; /* ---------------------------------------------------------------------- */ diff --git a/src/EXTRA-PAIR/pair_e3b.cpp b/src/EXTRA-PAIR/pair_e3b.cpp index 5011cc01e0..ab68b5c729 100644 --- a/src/EXTRA-PAIR/pair_e3b.cpp +++ b/src/EXTRA-PAIR/pair_e3b.cpp @@ -468,40 +468,40 @@ void PairE3B::init_style() } static const char cite_E3B1[] = - "Explicit Three-Body (E3B) potential for water:\n\n" + "Explicit Three-Body (E3B) potential for water: doi:10.1021/jp8009468\n\n" "@article{kumar_water_2008,\n" "title = {Water Simulation Model with Explicit Three-Molecule Interactions},\n" "volume = {112},\n" - "doi = {10.1021/jp8009468},\n" "number = {28},\n" - "journal = {J Phys. Chem. B},\n" + "doi = {10.1021/jp8009468},\n" + "journal = {J.~Phys.\\ Chem.~B},\n" "author = {Kumar, R. and Skinner, J. L.},\n" "year = {2008},\n" "pages = {8311--8318}\n" "}\n\n"; static const char cite_E3B2[] = - "Explicit Three-Body (E3B) potential for water:\n\n" + "Explicit Three-Body (E3B) potential for water: doi:10.1063/1.3587053\n\n" "@article{tainter_robust_2011,\n" - "title = {Robust three-body water simulation model},\n" + "title = {Robust Three-Body Water Simulation Model},\n" "volume = {134},\n" "doi = {10.1063/1.3587053},\n" "number = {18},\n" - "journal = {J. Chem. Phys},\n" + "journal = {J.~Chem.\\ Phys},\n" "author = {Tainter, C. J. and Pieniazek, P. A. and Lin, Y.-S. and Skinner, J. L.},\n" "year = {2011},\n" "pages = {184501}\n" "}\n\n"; static const char cite_E3B3[] = - "Explicit Three-Body (E3B) potential for water:\n\n" + "Explicit Three-Body (E3B) potential for water: doi:10.1021/acs.jctc.5b00117\n\n" "@article{tainter_reparametrized_2015,\n" "title = {Reparametrized {E3B} (Explicit Three-Body) Water Model Using the {TIP4P/2005} Model " "as a Reference},\n" "volume = {11},\n" "doi = {10.1021/acs.jctc.5b00117},\n" "number = {5},\n" - "journal = {J. Chem. Theory Comput.},\n" + "journal = {J.~Chem.\\ Theory Comput.},\n" "author = {Tainter, Craig J. and Shi, Liang and Skinner, James L.},\n" "year = {2015},\n" "pages = {2268--2277}\n" diff --git a/src/EXTRA-PAIR/pair_lj_relres.cpp b/src/EXTRA-PAIR/pair_lj_relres.cpp index 5d1ed4fdf0..88621fe54a 100644 --- a/src/EXTRA-PAIR/pair_lj_relres.cpp +++ b/src/EXTRA-PAIR/pair_lj_relres.cpp @@ -31,18 +31,18 @@ using namespace LAMMPS_NS; static const char cite_relres[] = - "Pair style lj/relres: doi:10.1021/acs.jctc.0c01003\n\n" + "Pair style lj/relres: doi:10.1021/acs.jctc.0c01003, doi:10.1021/acs.jctc.0c01003\n\n" "@Article{Chaimovich1,\n" " author = {A. Chaimovich, C. Peter, K. Kremer},\n" - " title = {Relative resolution: A hybrid formalism for fluid mixtures},\n" - " journal = {J.~Chem.~Phys.},\n" + " title = {Relative Resolution: {A} Hybrid Formalism for Fluid Mixtures},\n" + " journal = {J.~Chem.\\ Phys.},\n" " year = 2015,\n" " volume = 143,\n" " pages = {243107}\n" "@Article{Chaimovich2,\n" - " author = {M. Chaimovich, A. Chaimovich},\n" + " author = {M. Chaimovich and A. Chaimovich},\n" " title = {Relative Resolution: A Computationally Efficient Implementation in LAMMPS},\n" - " journal = {J.~Chem.~Theory~Comput.},\n" + " journal = {J.~Chem.\\ Theory Comput.},\n" " year = 2021,\n" " volume = 17,\n" " pages = {1045--1059}\n" diff --git a/src/EXTRA-PAIR/pair_momb.cpp b/src/EXTRA-PAIR/pair_momb.cpp index 2adb206308..d8b6e04d11 100644 --- a/src/EXTRA-PAIR/pair_momb.cpp +++ b/src/EXTRA-PAIR/pair_momb.cpp @@ -32,16 +32,16 @@ using namespace LAMMPS_NS; static const char cite_momb[] = - "Pair style momb:\n\n" + "Pair style momb: doi:10.1021/jp412098n\n\n" "@Article{pair_momb_2015,\n" - "title = {A force field for describing the polyvinylpyrrolidone-mediated" - " solution-phase synthesis of shape-selective Ag nanoparticles.},\n" + "title = {A Force Field for Describing the Polyvinylpyrrolidone-Mediated\n" + " Solution-Phase Synthesis of Shape-Selective {Ag} Nanoparticles},\n" "volume = {118},\n" "number = {6},\n" "url = {https://doi.org/10.1021/jp412098n},\n" "doi = {10.1021/jp412098n},\n" - "journal = {J. Phys. Chem. C},\n" - "author = {Zhou, Ya, Wissam A. Saidi, and Kristen A. Fichthorn},\n" + "journal = {J.~Phys.\\ Chem.~C},\n" + "author = {Zhou, Ya and Wissam A. Saidi and Kristen A. Fichthorn},\n" "year = {2014},\n" "pages = {3366--3374}\n" "}\n\n"; diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index 3ca57133a9..1488900aec 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -53,51 +53,59 @@ extern double lmp_gpu_update_bin_size(const double subx, const double suby, cons const int nlocal, const double cut); static const char cite_gpu_package[] = - "GPU package (short-range, long-range and three-body potentials):\n\n" + "GPU package (short-range, long-range and three-body potentials): doi:10.1016/j.cpc.2010.12.021, doi:10.1016/j.cpc.2011.10.012, doi:10.1016/j.cpc.2013.08.002, doi:10.1016/j.commatsci.2014.10.068, doi:10.1016/j.cpc.2016.10.020, doi:10.3233/APC200086\n\n" "@Article{Brown11,\n" - " author = {W. M. Brown, P. Wang, S. J. Plimpton, A. N. Tharrington},\n" - " title = {Implementing Molecular Dynamics on Hybrid High Performance Computers - Short Range Forces},\n" - " journal = {Comp.~Phys.~Comm.},\n" + " author = {W. M. Brown and P. Wang and S. J. Plimpton and A. N. Tharrington},\n" + " title = {Implementing Molecular Dynamics on Hybrid High Performance Computers---Short Range Forces},\n" + " journal = {Comput.\\ Phys.\\ Commun.},\n" " year = 2011,\n" " volume = 182,\n" - " pages = {898--911}\n" + " pages = {898--911},\n" + " doi = {10.1016/j.cpc.2010.12.021}\n" "}\n\n" "@Article{Brown12,\n" - " author = {W. M. Brown, A. Kohlmeyer, S. J. Plimpton, A. N. Tharrington},\n" + " author = {W. M. Brown and A. Kohlmeyer and S. J. Plimpton and A. N. Tharrington},\n" " title = {Implementing Molecular Dynamics on Hybrid High Performance Computers - Particle-Particle Particle-Mesh},\n" - " journal = {Comp.~Phys.~Comm.},\n" + " journal = {Comput.\\ Phys.\\ Commun.},\n" " year = 2012,\n" " volume = 183,\n" + " doi = {10.1016/j.cpc.2011.10.012},\n" " pages = {449--459}\n" "}\n\n" "@Article{Brown13,\n" - " author = {W. M. Brown, Y. Masako},\n" - " title = {Implementing Molecular Dynamics on Hybrid High Performance Computers – Three-Body Potentials},\n" - " journal = {Comp.~Phys.~Comm.},\n" + " author = {W. M. Brown and Y. Masako},\n" + " title = {Implementing Molecular Dynamics on Hybrid High Performance Computers---Three-Body Potentials},\n" + " journal = {Comput.\\ Phys.\\ Commun.},\n" " year = 2013,\n" " volume = 184,\n" - " pages = {2785--2793}\n" + " pages = {2785--2793},\n" + " doi = {10.1016/j.cpc.2013.08.002},\n" "}\n\n" "@Article{Trung15,\n" - " author = {T. D. Nguyen, S. J. Plimpton},\n" - " title = {Accelerating dissipative particle dynamics simulations for soft matter systems},\n" - " journal = {Comput.~Mater.~Sci.},\n" + " author = {T. D. Nguyen and S. J. Plimpton},\n" + " title = {Accelerating Dissipative Particle Dynamics Simulations for Soft Matter Systems},\n" + " journal = {Comput.\\ Mater.\\ Sci.},\n" " year = 2015,\n" + " doi = {10.1016/j.commatsci.2014.10.068},\n" " volume = 100,\n" " pages = {173--180}\n" "}\n\n" "@Article{Trung17,\n" " author = {T. D. Nguyen},\n" - " title = {GPU-accelerated Tersoff potentials for massively parallel Molecular Dynamics simulations},\n" - " journal = {Comp.~Phys.~Comm.},\n" + " title = {{GPU}-Accelerated {T}ersoff Potentials for Massively Parallel\n" + " Molecular Dynamics Simulations},\n" + " journal = {Comput.\\ Phys.\\ Commun.},\n" " year = 2017,\n" + " doi = {10.1016/j.cpc.2016.10.020},\n" " volume = 212,\n" " pages = {113--122}\n" "}\n\n" - "@Article{Nikolskiy19,\n" - " author = {V. Nikolskiy, V. Stegailov},\n" - " title = {GPU acceleration of four-site water models in LAMMPS},\n" - " journal = {Proceeding of the International Conference on Parallel Computing (ParCo 2019), Prague, Czech Republic},\n" + "@inproceedings{Nikolskiy19,\n" + " author = {V. Nikolskiy and V. Stegailov},\n" + " title = {{GPU} Acceleration of Four-Site Water Models in {LAMMPS}},\n" + " booktitle = {Proceedings of the International Conference on Parallel\n" + " Computing (ParCo 2019), Prague, Czech Republic},\n" + " doi = {10.3233/APC200086},\n" " year = 2019\n" "}\n\n"; diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 7a8bf630df..00455096f8 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -131,7 +131,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) error->all(FLERR, "Fix pour molecule template ID must be same as atom style template ID"); - onemols[i]->check_attributes(0); + onemols[i]->check_attributes(); // fix pour uses geoemetric center of molecule for insertion diff --git a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp index 49b2adbd33..17f2260af4 100644 --- a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp +++ b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp @@ -47,11 +47,11 @@ using namespace InterLayer; static const char cite_ilp[] = "ilp/graphene/hbn potential doi:10.1021/acs.nanolett.8b02848\n" "@Article{Ouyang2018\n" - " author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod},\n" + " author = {W. Ouyang and D. Mandelli and M. Urbakh and O. Hod},\n" " title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials},\n" " journal = {Nano Letters},\n" " volume = 18,\n" - " pages = {6009}\n" + " pages = 6009,\n" " year = 2018,\n" "}\n\n"; diff --git a/src/INTERLAYER/pair_ilp_tmd.cpp b/src/INTERLAYER/pair_ilp_tmd.cpp index 52119cbf12..e80f542716 100644 --- a/src/INTERLAYER/pair_ilp_tmd.cpp +++ b/src/INTERLAYER/pair_ilp_tmd.cpp @@ -42,17 +42,18 @@ using namespace InterLayer; #define DELTA 4 #define PGDELTA 1 -static const char cite_ilp_tmd[] = "ilp/tmd potential doi/10.1021/acs.jctc.1c00782\n" - "@Article{Ouyang2021\n" - " author = {W. Ouyang, R. Sofer, X. Gao, J. Hermann, A. " - "Tkatchenko, L. Kronik, M. Urbakh, and O. Hod},\n" - " title = {Anisotropic Interlayer Force Field for Transition " - "Metal Dichalcogenides: The Case of Molybdenum Disulfide},\n" - " journal = {J. Chem. Theory Comput.},\n" - " volume = 17,\n" - " pages = {7237–7245}\n" - " year = 2021,\n" - "}\n\n"; +static const char cite_ilp_tmd[] = +"ilp/tmd potential doi:10.1021/acs.jctc.1c00782\n" + "@Article{Ouyang2021\n" + " author = {W. Ouyang and R. Sofer and X. Gao and J. Hermann and\n" + " A. Tkatchenko and L. Kronik and M. Urbakh and O. Hod},\n" + " title = {Anisotropic Interlayer Force Field for Transition\n" + " Metal Dichalcogenides: The Case of Molybdenum Disulfide},\n" + " journal = {J.~Chem.\\ Theory Comput.},\n" + " volume = 17,\n" + " pages = {7237--7245}\n" + " year = 2021,\n" + "}\n\n"; /* ---------------------------------------------------------------------- */ diff --git a/src/INTERLAYER/pair_kolmogorov_crespi_full.cpp b/src/INTERLAYER/pair_kolmogorov_crespi_full.cpp index 116018f18a..0f9dd9ec47 100644 --- a/src/INTERLAYER/pair_kolmogorov_crespi_full.cpp +++ b/src/INTERLAYER/pair_kolmogorov_crespi_full.cpp @@ -47,7 +47,7 @@ using namespace InterLayer; static const char cite_kc[] = "kolmogorov/crespi/full potential doi:10.1021/acs.nanolett.8b02848\n" "@Article{Ouyang2018\n" - " author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod},\n" + " author = {W. Ouyang and D. Mandelli and M. Urbakh and O. Hod},\n" " title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials},\n" " journal = {Nano Letters},\n" " volume = 18,\n" diff --git a/src/INTERLAYER/pair_saip_metal.cpp b/src/INTERLAYER/pair_saip_metal.cpp index bb23cad840..4e768a9168 100644 --- a/src/INTERLAYER/pair_saip_metal.cpp +++ b/src/INTERLAYER/pair_saip_metal.cpp @@ -40,13 +40,13 @@ using namespace InterLayer; #define PGDELTA 1 static const char cite_saip[] = - "saip/metal potential doi.org/10.1021/acs.jctc.1c00622\n" + "saip/metal potential: doi:10.1021/acs.jctc.1c00622\n\n" "@Article{Ouyang2021\n" - " author = {W. Ouyang, O. Hod, and R. Guerra},\n" + " author = {W. Ouyang and O. Hod and R. Guerra},\n" " title = {Registry-Dependent Potential for Interfaces of Gold with Graphitic Systems},\n" - " journal = {J. Chem. Theory Comput.},\n" + " journal = {J.~Chem.\\ Theory Comput.},\n" " volume = 17,\n" - " pages = {7215-7223}\n" + " pages = {7215--7223}\n" " year = 2021,\n" "}\n\n"; diff --git a/src/LATBOLTZ/fix_lb_fluid.cpp b/src/LATBOLTZ/fix_lb_fluid.cpp index e3662b338b..049d9ce44e 100644 --- a/src/LATBOLTZ/fix_lb_fluid.cpp +++ b/src/LATBOLTZ/fix_lb_fluid.cpp @@ -45,11 +45,11 @@ using namespace FixConst; static const char cite_fix_lbfluid[] = "fix lb/fluid command: doi:10.1016/j.cpc.2022.108318\n\n" "@Article{Denniston et al.,\n" - " author = {C. Denniston, N. Afrasiabian, M.G. Cole-Andre," - "F.E. Mackay, S.T.T. Ollila, T. Whitehead},\n" - " title = {LAMMPS lb/fluid fix version 2: Improved Hydrodynamic " - "Forces Implemented into LAMMPS through a lattice-Boltzmann fluid}," - " journal = {Comp.~Phys.~Comm.},\n" + " author = {C. Denniston and N. Afrasiabian and M. G. Cole-Andre," + " F. E. Mackay and S. T. T. Ollila and T. Whitehead},\n" + " title = {{LAMMPS} lb/fluid fix version 2: Improved Hydrodynamic " + " Forces Implemented into {LAMMPS} Through a Lattice-{B}oltzmann Fluid}," + " journal = {Comput.\\ Phys.\\ Commun.},\n" " year = 2022,\n" " volume = 275,\n" " pages = {108318}\n" diff --git a/src/MANIFOLD/fix_nve_manifold_rattle.cpp b/src/MANIFOLD/fix_nve_manifold_rattle.cpp index f9a728cb73..1ccf7c2e04 100644 --- a/src/MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/MANIFOLD/fix_nve_manifold_rattle.cpp @@ -55,7 +55,7 @@ using namespace user_manifold; enum { CONST, EQUAL }; // For treating the variables. static const char* cite_fix_nve_manifold_rattle = - "fix nve/manifold/rattle command:\n\n" + "fix nve/manifold/rattle command: doi:10.1016/j.bpj.2016.02.017\n\n" "@article{paquay-2016,\n" " author = {Paquay, Stefan and Kusters, Remy},\n" " doi = {10.1016/j.bpj.2016.02.017},\n" diff --git a/src/MANIFOLD/fix_nvt_manifold_rattle.cpp b/src/MANIFOLD/fix_nvt_manifold_rattle.cpp index 6dbd211042..a7b2c5ed37 100644 --- a/src/MANIFOLD/fix_nvt_manifold_rattle.cpp +++ b/src/MANIFOLD/fix_nvt_manifold_rattle.cpp @@ -59,7 +59,7 @@ enum {NOBIAS,BIAS}; static const char* cite_fix_nvt_manifold_rattle = - "fix nvt/manifold/rattle command:\n\n" + "fix nvt/manifold/rattle command: doi:10.1016/j.bpj.2016.02.017\n\n" "@article{paquay-2016,\n" " author = {Paquay, Stefan and Kusters, Remy},\n" " doi = {10.1016/j.bpj.2016.02.017},\n" diff --git a/src/MANYBODY/pair_atm.cpp b/src/MANYBODY/pair_atm.cpp index 4b61e575a3..9e125c3403 100644 --- a/src/MANYBODY/pair_atm.cpp +++ b/src/MANYBODY/pair_atm.cpp @@ -32,13 +32,14 @@ using namespace LAMMPS_NS; static const char cite_atm_package[] = - "ATM package:\n\n" + "ATM package: doi:10.1063/1.4704930\n\n" "@Article{Lishchuk:2012:164501,\n" " author = {S. V. Lishchuk},\n" - " title = {Role of three-body interactions in formation of bulk viscosity in liquid argon},\n" - " journal = {J.~Chem.~Phys.},\n" + " title = {Role of Three-Body Interactions in Formation of Bulk Viscosity in Liquid Argon},\n" + " journal = {J.~Chem.\\ Phys.},\n" " year = 2012,\n" " volume = 136,\n" + " number = 16,\n" " pages = {164501}\n" "}\n\n"; diff --git a/src/MANYBODY/pair_edip_multi.cpp b/src/MANYBODY/pair_edip_multi.cpp index cb50426033..e51e92893d 100644 --- a/src/MANYBODY/pair_edip_multi.cpp +++ b/src/MANYBODY/pair_edip_multi.cpp @@ -42,18 +42,20 @@ using namespace MathExtra; #define DELTA 4 static const char cite_pair_edip[] = + "pair edip/multi: doi:10.1103/PhysRevB.86.144118, doi:10.1088/0953-8984/22/3/035802\n\n" "@article{cjiang2012\n" " author = {Jian, Chao and Morgan, Dane, and Szlufarska, Izabella},\n" - " title = {Carbon tri-interstitial defect: A model for DII center},\n" - " journal = {Physical Review B},\n" + " title = {Carbon Tri-Interstitial Defect: {A} Model for {D$_{\\mathrm{II}}$} Center},\n" + " journal = {Phys.\\ Rev.~B},\n" " volume = {86},\n" " pages = {144118},\n" " year = {2012},\n" "}\n\n" "@article{lpizzagalli2010,\n" - " author = {G. Lucas, M. Bertolus, and L. Pizzagalli},\n" - " journal = {J. Phys. : Condens. Matter 22},\n" + " author = {G. Lucas and M. Bertolus and L. Pizzagalli},\n" + " journal = {J.~Phys.\\ Condens.\\ Matter},\n" " volume = {22},\n" + " number = 3,\n" " pages = {035802},\n" " year = {2010},\n" "}\n\n"; diff --git a/src/MANYBODY/pair_local_density.cpp b/src/MANYBODY/pair_local_density.cpp index d8bfd9d03a..789b1ddad9 100644 --- a/src/MANYBODY/pair_local_density.cpp +++ b/src/MANYBODY/pair_local_density.cpp @@ -37,20 +37,20 @@ using namespace LAMMPS_NS; #define MAXLINE 1024 static const char cite_pair_local_density[] = - "pair_style local/density command:\n\n" + "pair_style local/density command: doi:10.1063/1.4958629, doi:10.1021/acs.jpcb.7b12446\n\n" "@Article{Sanyal16,\n" - " author = {T.Sanyal and M.Scott Shell},\n" - " title = {Coarse-grained models using local-density potentials optimized with the relative entropy: Application to implicit solvation},\n" - " journal = {J.~Chem.~Phys.},\n" + " author = {T. Sanyal and M. Scott Shell},\n" + " title = {Coarse-Grained Models Using Local-Density Potentials Optimized With the Relative Entropy: {A}pplication to Implicit Solvation},\n" + " journal = {J.~Chem.\\ Phys.},\n" " year = 2016,\n" - " DOI = doi.org/10.1063/1.4958629" + " DOI = {10.1063/1.4958629}" "}\n\n" "@Article{Sanyal18,\n" - " author = {T.Sanyal and M.Scott Shell},\n" - " title = {Transferable coarse-grained models of liquid-liquid equilibrium using local density potentials optimized with the relative entropy},\n" - " journal = {J.~Phys.~Chem. B},\n" + " author = {T. Sanyal and M. Scott Shell},\n" + " title = {Transferable Coarse-Grained Models of Liquid-Liquid Equilibrium Using Local Density Potentials Optimized with the Relative Entropy},\n" + " journal = {J.~Phys.\\ Chem.~B},\n" " year = 2018,\n" - " DOI = doi.org/10.1021/acs.jpcb.7b12446" + " DOI = {10.1021/acs.jpcb.7b12446}" "}\n\n"; /* ---------------------------------------------------------------------- */ diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp index 59fabc8ffe..6a7ab6dbb7 100644 --- a/src/MC/fix_bond_swap.cpp +++ b/src/MC/fix_bond_swap.cpp @@ -39,13 +39,14 @@ using namespace LAMMPS_NS; using namespace FixConst; static const char cite_fix_bond_swap[] = - "fix bond/swap command:\n\n" + "fix bond/swap command: doi:10.1063/1.1628670\n\n" "@Article{Auhl03,\n" - " author = {R. Auhl, R. Everaers, G. S. Grest, K. Kremer, S. J. Plimpton},\n" - " title = {Equilibration of long chain polymer melts in computer simulations},\n" - " journal = {J.~Chem.~Phys.},\n" + " author = {R. Auhl and R. Everaers and G. S. Grest and K. Kremer and S. J. Plimpton},\n" + " title = {Equilibration of Long Chain Polymer Melts in Computer Simulations},\n" + " journal = {J.~Chem.\\ Phys.},\n" " year = 2003,\n" " volume = 119,\n" + " number = 12,\n" " pages = {12718--12728}\n" "}\n\n"; diff --git a/src/MC/fix_charge_regulation.cpp b/src/MC/fix_charge_regulation.cpp index 81f722bb6c..795ccb75d1 100644 --- a/src/MC/fix_charge_regulation.cpp +++ b/src/MC/fix_charge_regulation.cpp @@ -54,11 +54,11 @@ using namespace MathConst; using namespace MathSpecial; static const char cite_fix_charge_regulation[] = - "fix charge/regulation: \n\n" + "fix charge/regulation: doi:10.1063/5.0066432\n\n" "@Article{Curk22,\n" - " author = {T. Curk, J. Yuan, E. Luijten},\n" - " title = {Accelerated simulation method for charge regulation effects},\n" - " journal = {The Journal of Chemical Physics},\n" + " author = {T. Curk and J. Yuan and E. Luijten},\n" + " title = {Accelerated Simulation Method for Charge Regulation Effects},\n" + " journal = {Journal of Chemical Physics},\n" " year = 2022,\n" " volume = 156\n" "}\n\n"; diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index 835d049bc6..0cc6590d5a 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -177,7 +177,7 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) error->all(FLERR,"Fix gcmc molecule template ID must be same " "as atom_style template ID"); - onemols[imol]->check_attributes(0); + onemols[imol]->check_attributes(); } if (charge_flag && atom->q == nullptr) diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index 0a20e7adf3..d1bc5dfa58 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -153,7 +153,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) error->all(FLERR,"Fix widom molecule template ID must be same " "as atom_style template ID"); - onemols[imol]->check_attributes(0); + onemols[imol]->check_attributes(); } if (charge_flag && atom->q == nullptr) diff --git a/src/MISC/pair_agni.cpp b/src/MISC/pair_agni.cpp index ee744173fc..3c309d578b 100644 --- a/src/MISC/pair_agni.cpp +++ b/src/MISC/pair_agni.cpp @@ -37,13 +37,13 @@ using namespace LAMMPS_NS; using namespace MathSpecial; static const char cite_pair_agni[] = - "pair agni command:\n\n" + "pair agni command: doi:10.1021/acs.jpcc.9b04207\n\n" "@article{huan2019jpc,\n" " author = {Huan, T. and Batra, R. and Chapman, J. and Kim, C. and Chandrasekaran, A. and Ramprasad, Rampi},\n" - " journal = {J. Phys. Chem. C},\n" - " volume = {121},\n" + " journal = {J.~Phys.\\ Chem.~C},\n" + " volume = {123},\n" " number = {34},\n" - " pages = {20715},\n" + " pages = {20715--20722},\n" " year = {2019},\n" "}\n\n"; diff --git a/src/MISC/pair_srp.cpp b/src/MISC/pair_srp.cpp index bb731cdc32..1c95caadc2 100644 --- a/src/MISC/pair_srp.cpp +++ b/src/MISC/pair_srp.cpp @@ -52,10 +52,11 @@ using namespace LAMMPS_NS; #define ONETWOBIT 0x40000000 static const char cite_srp[] = + "pair srp command: doi:10.1063/1.3698476\n\n" "@Article{Sirk2012\n" - " author = {T. Sirk and Y. Sliozberg and J. Brennan and M. Lisal and J. Andzelm},\n" - " title = {An enhanced entangled polymer model for dissipative particle dynamics},\n" - " journal = {J.~Chem.~Phys.},\n" + " author = {T. W. Sirk and Y. R. Sliozberg and J. K. Brennan and M. Lisal and J. W. Andzelm},\n" + " title = {An Enhanced Entangled Polymer Model for Dissipative Particle Dynamics},\n" + " journal = {J.~Chem.\\ Phys.},\n" " year = 2012,\n" " volume = 136,\n" " pages = {134903}\n" diff --git a/src/MISC/pair_srp_react.cpp b/src/MISC/pair_srp_react.cpp index f486aa33b7..25975c7fb0 100644 --- a/src/MISC/pair_srp_react.cpp +++ b/src/MISC/pair_srp_react.cpp @@ -47,13 +47,15 @@ There is an example script for this package in examples/PACKAGES/srp_react/. using namespace LAMMPS_NS; static const char cite_srpreact[] = + "pair srp/react style: doi:10.1021/acs.jpcb.1c09570\n\n" "@Article{palkar2022\n" " author = {Palkar, Vaibhav and Kuksenok, Olga},\n" " title = {Controlling Degradation and Erosion of Polymer Networks: Insights from Mesoscale Modeling},\n" - " journal = {J. Phys. Chem. B},\n" - " year = {2022},\n" - " volume = {126},\n" - " pages = {336-346}\n" + " journal = {J.~Phys.\\ Chem.~B},\n" + " year = 2022,\n" + " volume = 126,\n" + " number = 1,\n" + " pages = {336--346}\n" "}\n\n"; static int srp_instance = 0; diff --git a/src/ML-HDNNP/pair_hdnnp.cpp b/src/ML-HDNNP/pair_hdnnp.cpp index eb79a396b2..6873f76779 100644 --- a/src/ML-HDNNP/pair_hdnnp.cpp +++ b/src/ML-HDNNP/pair_hdnnp.cpp @@ -36,17 +36,17 @@ using namespace LAMMPS_NS; static const char cite_user_hdnnp_package[] = - "ML-HDNNP package: 10.1021/acs.jctc.8b00770\n\n" + "ML-HDNNP package: doi:10.1021/acs.jctc.8b00770\n\n" "@Article{Singraber19,\n" " author = {Singraber, Andreas and Behler, J{\"o}rg and Dellago, Christoph},\n" - " title = {Library-{{Based LAMMPS Implementation}} of {{High}}-{{Dimensional Neural Network " - "Potentials}}},\n" + " title = {Library-Based {LAMMPS} Implementation of High-Dimensional\n" + " Neural Network Potentials},\n" " year = {2019},\n" " month = mar,\n" " volume = {15},\n" " pages = {1827--1840},\n" " doi = {10.1021/acs.jctc.8b00770},\n" - " journal = {J.~Chem.~Theory~Comput.},\n" + " journal = {J.~Chem.\\ Theory Comput.},\n" " number = {3}\n" "}\n\n"; diff --git a/src/ML-RANN/pair_rann.cpp b/src/ML-RANN/pair_rann.cpp index d20a750ff8..8eb95f6dfb 100644 --- a/src/ML-RANN/pair_rann.cpp +++ b/src/ML-RANN/pair_rann.cpp @@ -60,14 +60,14 @@ DISTRIBUTION A. Approved for public release; distribution unlimited. OPSEC#4918 using namespace LAMMPS_NS; static const char cite_ml_rann_package[] = - "ML-RANN package:\n\n" + "ML-RANN package: doi:10.1016/j.commatsci.2020.110207\n\n" "@Article{Nitol2021,\n" " author = {Nitol, Mashroor S and Dickel, Doyl E and Barrett, Christopher D},\n" - " title = {Artificial neural network potential for pure zinc},\n" + " title = {Artificial Neural Network Potential for Pure Zinc},\n" " journal = {Computational Materials Science},\n" " year = 2021,\n" " volume = 188,\n" - " pages = {110207}\n" + " pages = 110207\n" "}\n\n"; diff --git a/src/OPENMP/pair_reaxff_omp.cpp b/src/OPENMP/pair_reaxff_omp.cpp index f10f5885bd..7112681b06 100644 --- a/src/OPENMP/pair_reaxff_omp.cpp +++ b/src/OPENMP/pair_reaxff_omp.cpp @@ -63,12 +63,14 @@ using namespace LAMMPS_NS; using namespace ReaxFF; static const char cite_pair_reaxff_omp[] = - "pair reaxff/omp and fix qeq/reaxff/omp command:\n\n" + "pair reaxff/omp and fix qeq/reaxff/omp command: doi:10.1177/1094342017746221\n\n" "@Article{Aktulga17,\n" - " author = {H. M. Aktulga, C. Knight, P. Coffman, K. A. OHearn, T. R. Shan, W. Jiang},\n" - " title = {Optimizing the performance of reactive molecular dynamics simulations for multi-core architectures},\n" + " author = {H. M. Aktulga and C. Knight and P. Coffman and\n" + " K. A. O'Hearn and T. R. Shan and W. Jiang},\n" + " title = {Optimizing the Performance of Reactive Molecular Dynamics\n" + " Simulations for Multi-Core Architectures},\n" " journal = {International Journal of High Performance Computing Applications},\n" - " year = to appear\n" + " year = 2018\n" "}\n\n"; /* ---------------------------------------------------------------------- */ diff --git a/src/OPT/pair_ilp_graphene_hbn_opt.cpp b/src/OPT/pair_ilp_graphene_hbn_opt.cpp index 36fac54f52..953340ff5d 100644 --- a/src/OPT/pair_ilp_graphene_hbn_opt.cpp +++ b/src/OPT/pair_ilp_graphene_hbn_opt.cpp @@ -39,10 +39,10 @@ using namespace LAMMPS_NS; using namespace InterLayer; static const char cite_ilp_cur[] = - "ilp/graphene/hbn/opt potential doi:10.1145/3458817.3476137\n" + "ilp/graphene/hbn/opt potential: doi:10.1145/3458817.3476137\n" "@inproceedings{gao2021lmff\n" - " author = {Gao, Ping and Duan, Xiaohui and Others},\n" - " title = {LMFF: Efficient and Scalable Layered Materials Force Field on Heterogeneous " + " author = {Gao, Ping and Duan, Xiaohui and others},\n" + " title = {{LMFF}: Efficient and Scalable Layered Materials Force Field on Heterogeneous " "Many-Core Processors},\n" " year = {2021},\n" " isbn = {9781450384421},\n" @@ -52,9 +52,9 @@ static const char cite_ilp_cur[] = " doi = {10.1145/3458817.3476137},\n" " booktitle = {Proceedings of the International Conference for High Performance Computing, " "Networking, Storage and Analysis},\n" - " articleno = {42},\n" + " pages = {42},\n" " numpages = {14},\n" - " location = {St. Louis, Missouri},\n" + " location = {St.~Louis, Missouri},\n" " series = {SC'21},\n" "}\n\n"; diff --git a/src/ORIENT/fix_orient_bcc.cpp b/src/ORIENT/fix_orient_bcc.cpp index 919927ea07..c8979794e8 100644 --- a/src/ORIENT/fix_orient_bcc.cpp +++ b/src/ORIENT/fix_orient_bcc.cpp @@ -41,14 +41,15 @@ using namespace MathConst; #define BIG 1000000000 static const char cite_fix_orient_bcc[] = - "fix orient/bcc command:\n\n" + "fix orient/bcc command: doi:10.1016/j.commatsci.2016.02.016\n\n" "@Article{Wicaksono16,\n" - " author = {A. T. Wicaksono, C. W. Sinclair, M. Militzer},\n" - " title = {An atomistic study of the correlation between the migration of planar and curved grain boundaries},\n" - " journal = {Computational Materials Science},\n" - " year = 2016,\n" - " volume = 117,\n" - " pages = {397--405}\n" + " author = {A. T. Wicaksono and C. W. Sinclair and M. Militzer},\n" + " title = {An Atomistic Study of the Correlation Between the Migration\n" + " of Planar and Curved Grain Boundaries},\n" + " journal = {Computational Materials Science},\n" + " year = 2016,\n" + " volume = 117,\n" + " pages = {397--405}\n" "}\n\n"; /* ---------------------------------------------------------------------- */ diff --git a/src/ORIENT/fix_orient_eco.cpp b/src/ORIENT/fix_orient_eco.cpp index 7c8ff1f6aa..5f725a9e06 100644 --- a/src/ORIENT/fix_orient_eco.cpp +++ b/src/ORIENT/fix_orient_eco.cpp @@ -38,10 +38,10 @@ using namespace FixConst; using namespace MathConst; static const char cite_fix_orient_eco[] = - "fix orient/eco command:\n\n" + "fix orient/eco command: doi:j.commatsci.2020.109774\n\n" "@Article{Schratt20,\n" - " author = {A. A. Schratt, V. Mohles},\n" - " title = {Efficient calculation of the ECO driving force for atomistic simulations of grain boundary motion},\n" + " author = {A. A. Schratt and V. Mohles},\n" + " title = {Efficient Calculation of the {ECO} Driving Force for Atomistic Simulations of Grain Boundary Motion},\n" " journal = {Computational Materials Science},\n" " volume = {182},\n" " year = {2020},\n" diff --git a/src/ORIENT/fix_orient_fcc.cpp b/src/ORIENT/fix_orient_fcc.cpp index f64889d141..069d4b58fc 100644 --- a/src/ORIENT/fix_orient_fcc.cpp +++ b/src/ORIENT/fix_orient_fcc.cpp @@ -38,7 +38,7 @@ using namespace MathConst; #define BIG 1000000000 static const char cite_fix_orient_fcc[] = - "fix orient/fcc command:\n\n" + "fix orient/fcc command: doi:10.1038/nmat1559\n\n" "@Article{Janssens06,\n" " author = {K. G. F. Janssens, D. Olmsted, E.A. Holm, S. M. Foiles, S. J. Plimpton, and P. M. Derlet},\n" " title = {Computing the Mobility of Grain Boundaries},\n" diff --git a/src/PERI/atom_vec_peri.cpp b/src/PERI/atom_vec_peri.cpp index fd6b47990a..20eeef3042 100644 --- a/src/PERI/atom_vec_peri.cpp +++ b/src/PERI/atom_vec_peri.cpp @@ -26,13 +26,14 @@ using namespace LAMMPS_NS; static const char cite_peri_package[] = - "PERI package for Peridynamics:\n\n" + "PERI package for Peridynamics: doi:10.1016/j.cpc.2008.06.011\n\n" "@Article{Parks08,\n" - " author = {M. L. Parks, R. B. Lehoucq, S. J. Plimpton, S. A. Silling},\n" - " title = {Implementing peridynamics within a molecular dynamics code},\n" - " journal = {Comp.~Phys.~Comm.},\n" + " author = {M. L. Parks and R. B. Lehoucq and S. J. Plimpton and S. A. Silling},\n" + " title = {Implementing Peridynamics Within a Molecular Dynamics Code},\n" + " journal = {Comput.\\ Phys.\\ Commun.},\n" " year = 2008,\n" " volume = 179,\n" + " number = 11,\n" " pages = {777--783}\n" "}\n\n"; diff --git a/src/PHONON/fix_phonon.cpp b/src/PHONON/fix_phonon.cpp index b5774ad97c..3b4f182a16 100644 --- a/src/PHONON/fix_phonon.cpp +++ b/src/PHONON/fix_phonon.cpp @@ -50,11 +50,11 @@ using namespace FixConst; enum{FORWARD=-1,BACKWARD=1}; static const char cite_fix_phonon[] = - "fix phonon command:\n\n" + "fix phonon command: doi:10.1016/j.cpc.2011.04.019\n\n" "@Article{Kong11,\n" " author = {L. T. Kong},\n" - " title = {Phonon dispersion measured directly from molecular dynamics simulations},\n" - " journal = {Comp.~Phys.~Comm.},\n" + " title = {Phonon Dispersion Measured Directly from Molecular Dynamics Simulations},\n" + " journal = {Comput.\\ Phys.\\ Commun.},\n" " year = 2011,\n" " volume = 182,\n" " pages = {2201--2207}\n" diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index 20e0b7cc6b..b2b0366b9e 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -47,14 +47,15 @@ using namespace FixConst; #define EPSILON 1.0e-7 static const char cite_fix_poems[] = - "fix poems command:\n\n" + "fix poems command: doi:10.1016/j.ijnonlinmec.2008.04.003\n\n" "@Article{Mukherjee08,\n" - " author = {R. M. Mukherjee, P. S. Crozier, S. J. Plimpton, K. S. Anderson},\n" - " title = {Substructured molecular dynamics using multibody dynamics algorithms},\n" - " journal = {Intl.~J.~Non-linear Mechanics},\n" + " author = {R. M. Mukherjee and P. S. Crozier and S. J. Plimpton and K. S. Anderson},\n" + " title = {Substructured Molecular Dynamics Using Multibody Dynamics Algorithms},\n" + " journal = {Intl.\\ J.\\ Non-Linear Mechanics},\n" " year = 2008,\n" " volume = 43,\n" - " pages = {1045--1055}\n" + " number = 10,\n" + " pages = {1040--1055}\n" "}\n\n"; /* ---------------------------------------------------------------------- diff --git a/src/PTM/compute_ptm_atom.cpp b/src/PTM/compute_ptm_atom.cpp index 10341d3cd0..676144eb42 100644 --- a/src/PTM/compute_ptm_atom.cpp +++ b/src/PTM/compute_ptm_atom.cpp @@ -47,13 +47,13 @@ under using namespace LAMMPS_NS; static const char cite_user_ptm_package[] = - "PTM package:\n\n" + "PTM package: doi:10.1088/0965-0393/24/5/055007\n\n" "@Article{larsen2016ptm,\n" - " author={Larsen, Peter Mahler and Schmidt, S{\\o}ren and Schi{\\o}tz, " - "Jakob},\n" - " title={Robust structural identification via polyhedral template " - "matching},\n" - " journal={Modelling~Simul.~Mater.~Sci.~Eng.},\n" + " author={Larsen, Peter Mahler and Schmidt, S{\\o}ren and\n" + " Schi{\\o}tz, Jakob},\n" + " title={Robust Structural Identification via Polyhedral Template\n" + " Matching},\n" + " journal={Model.\\ Simulat.\\ Mater.\\ Sci.\\ Eng.},\n" " year={2016},\n" " number={5},\n" " volume={24},\n" diff --git a/src/REACTION/fix_bond_react.cpp b/src/REACTION/fix_bond_react.cpp index 0383449bbd..60bd6fa82d 100644 --- a/src/REACTION/fix_bond_react.cpp +++ b/src/REACTION/fix_bond_react.cpp @@ -57,10 +57,10 @@ using namespace FixConst; using namespace MathConst; static const char cite_fix_bond_react[] = - "fix bond/react: reacter.org\n\n" + "fix bond/react: reacter.org doi:10.1016/j.polymer.2017.09.038, doi:10.1021/acs.macromol.0c02012\n\n" "@Article{Gissinger17,\n" - " author = {J. R. Gissinger, B. D. Jensen, K. E. Wise},\n" - " title = {Modeling chemical reactions in classical molecular dynamics simulations},\n" + " author = {J. R. Gissinger and B. D. Jensen and K. E. Wise},\n" + " title = {Modeling Chemical Reactions in Classical Molecular Dynamics Simulations},\n" " journal = {Polymer},\n" " year = 2017,\n" " volume = 128,\n" @@ -68,10 +68,11 @@ static const char cite_fix_bond_react[] = "}\n\n" "@Article{Gissinger20,\n" " author = {J. R. Gissinger, B. D. Jensen, K. E. Wise},\n" - " title = {REACTER: A Heuristic Method for Reactive Molecular Dynamics},\n" + " title = {{REACTER}: A Heuristic Method for Reactive Molecular Dynamics},\n" " journal = {Macromolecules},\n" " year = 2020,\n" " volume = 53,\n" + " number = 22,\n" " pages = {9953--9961}\n" "}\n\n"; @@ -471,8 +472,8 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : open(files[i]); onemol = atom->molecules[unreacted_mol[i]]; twomol = atom->molecules[reacted_mol[i]]; - onemol->check_attributes(0); - twomol->check_attributes(0); + onemol->check_attributes(); + twomol->check_attributes(); get_molxspecials(); read(i); fclose(fp); diff --git a/src/REAXFF/fix_acks2_reaxff.cpp b/src/REAXFF/fix_acks2_reaxff.cpp index be71bc761f..9d1775c272 100644 --- a/src/REAXFF/fix_acks2_reaxff.cpp +++ b/src/REAXFF/fix_acks2_reaxff.cpp @@ -38,13 +38,14 @@ using namespace LAMMPS_NS; using namespace FixConst; static const char cite_fix_acks2_reax[] = - "fix acks2/reaxff command:\n\n" + "fix acks2/reaxff command: doi:10.1137/18M1224684\n\n" "@Article{O'Hearn2020,\n" - " author = {K. A. O'Hearn, A. Alperen, and H. M. Aktulga},\n" + " author = {K. A. {O'Hearn} and A. Alperen and H. M. Aktulga},\n" " title = {Fast Solvers for Charge Distribution Models on Shared Memory Platforms},\n" - " journal = {SIAM J. Sci. Comput.},\n" + " journal = {SIAM J.\\ Sci.\\ Comput.},\n" " year = 2020,\n" " volume = 42,\n" + " number = 1,\n" " pages = {1--22}\n" "}\n\n"; diff --git a/src/REAXFF/fix_qeq_reaxff.cpp b/src/REAXFF/fix_qeq_reaxff.cpp index 48e93f682a..6c03683518 100644 --- a/src/REAXFF/fix_qeq_reaxff.cpp +++ b/src/REAXFF/fix_qeq_reaxff.cpp @@ -54,10 +54,10 @@ static constexpr double SMALL = 1.0e-14; static constexpr double QSUMSMALL = 0.00001; static const char cite_fix_qeq_reaxff[] = - "fix qeq/reaxff command:\n\n" + "fix qeq/reaxff command: doi:10.1016/j.parco.2011.08.005\n\n" "@Article{Aktulga12,\n" - " author = {H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama},\n" - " title = {Parallel reactive molecular dynamics: Numerical methods and algorithmic techniques},\n" + " author = {H. M. Aktulga and J. C. Fogarty and S. A. Pandit and A. Y. Grama},\n" + " title = {Parallel Reactive Molecular Dynamics: {N}umerical Methods and Algorithmic Techniques},\n" " journal = {Parallel Computing},\n" " year = 2012,\n" " volume = 38,\n" diff --git a/src/REAXFF/fix_reaxff_species.cpp b/src/REAXFF/fix_reaxff_species.cpp index 352dd33f62..0f5af77453 100644 --- a/src/REAXFF/fix_reaxff_species.cpp +++ b/src/REAXFF/fix_reaxff_species.cpp @@ -26,6 +26,7 @@ #include "error.h" #include "fix_ave_atom.h" #include "force.h" +#include "group.h" #include "memory.h" #include "modify.h" #include "neigh_list.h" @@ -68,6 +69,7 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, nevery = utils::inumeric(FLERR, arg[3], false, lmp); nrepeat = utils::inumeric(FLERR, arg[4], false, lmp); global_freq = nfreq = utils::inumeric(FLERR, arg[5], false, lmp); + if (nrepeat == 1) dynamic_group_allow = 1; comm_forward = 4; @@ -394,9 +396,7 @@ void FixReaxFFSpecies::Output_ReaxFF_Bonds(bigint ntimestep, FILE * /*fp*/) Nmole = Nspec = 0; FindMolecule(); - SortMolecule(Nmole); - FindSpecies(Nmole, Nspec); vector_nmole = Nmole; @@ -521,16 +521,21 @@ void FixReaxFFSpecies::SortMolecule(int &Nmole) hi = MAX(hi, nint(clusterID[n])); } int flagall; - MPI_Allreduce(&flag, &flagall, 1, MPI_INT, MPI_SUM, world); - if (flagall && me == 0) - error->warning(FLERR, "Atom with cluster ID = 0 included in fix reaxff/species group"); MPI_Allreduce(&lo, &idlo, 1, MPI_INT, MPI_MIN, world); MPI_Allreduce(&hi, &idhi, 1, MPI_INT, MPI_MAX, world); + int nlen = idhi - idlo + 1; + if (nlen <= 0) { // no atoms in group + Nmole = 0; + return; + } if (idlo == ntotal) if (me == 0) - error->warning(FLERR, "Atom with cluster ID = maxmol included in fix reaxff/species group"); + error->warning(FLERR, "Atom with cluster ID = maxmol included in fix reaxff/species group {}",group->names[igroup]); + + MPI_Allreduce(&flag, &flagall, 1, MPI_INT, MPI_SUM, world); + if (flagall && me == 0) + error->warning(FLERR, "Atom with cluster ID = 0 included in fix reaxff/species group {}", group->names[igroup]); - int nlen = idhi - idlo + 1; memory->create(molmap, nlen, "reaxff/species:molmap"); for (n = 0; n < nlen; n++) molmap[n] = 0; diff --git a/src/REAXFF/pair_reaxff.cpp b/src/REAXFF/pair_reaxff.cpp index e78edea9a9..b08a167431 100644 --- a/src/REAXFF/pair_reaxff.cpp +++ b/src/REAXFF/pair_reaxff.cpp @@ -46,13 +46,14 @@ using namespace LAMMPS_NS; using namespace ReaxFF; static const char cite_pair_reax_c[] = - "pair reaxff command:\n\n" + "pair reaxff command: doi:10.1016/j.parco.2011.08.005\n\n" "@Article{Aktulga12,\n" - " author = {H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama},\n" - " title = {Parallel reactive molecular dynamics: Numerical methods and algorithmic techniques},\n" + " author = {H. M. Aktulga and J. C. Fogarty and S. A. Pandit and A. Y. Grama},\n" + " title = {Parallel Reactive Molecular Dynamics: {N}umerical Methods and Algorithmic Techniques},\n" " journal = {Parallel Computing},\n" " year = 2012,\n" " volume = 38,\n" + " number = {4--5},\n" " pages = {245--259}\n" "}\n\n"; diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index 062f3c1b00..b075c2f88b 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -45,14 +45,14 @@ using namespace LAMMPS_NS; using namespace FixConst; static const char cite_fix_nve_spin[] = - "fix nve/spin command:\n\n" + "fix nve/spin command: doi:10.1016/j.jcp.2018.06.042\n\n" "@article{tranchida2018massively,\n" - "title={Massively parallel symplectic algorithm for coupled magnetic spin " - "dynamics and molecular dynamics},\n" - "author={Tranchida, J and Plimpton, SJ and Thibaudeau, P and Thompson, AP},\n" + "title={Massively Parallel Symplectic Algorithm for Coupled Magnetic Spin " + " Dynamics and Molecular Dynamics},\n" + "author={Tranchida, J and Plimpton, S J and Thibaudeau, P and Thompson, A P},\n" "journal={Journal of Computational Physics},\n" "volume={372},\n" - "pages={406-425},\n" + "pages={406--425},\n" "year={2018},\n" "publisher={Elsevier}\n" "doi={10.1016/j.jcp.2018.06.042}\n" diff --git a/src/SPIN/min_spin_cg.cpp b/src/SPIN/min_spin_cg.cpp index 9867f7aab5..84540a4a7f 100644 --- a/src/SPIN/min_spin_cg.cpp +++ b/src/SPIN/min_spin_cg.cpp @@ -43,7 +43,7 @@ using namespace LAMMPS_NS; using namespace MathConst; static const char cite_minstyle_spin_cg[] = - "min_style spin/cg command:\n\n" + "min_style spin/cg command: doi:10.48550/arXiv.1904.02669\n\n" "@article{ivanov2019fast,\n" "title={Fast and Robust Algorithm for the Minimisation of the Energy of " "Spin Systems},\n" diff --git a/src/SPIN/min_spin_lbfgs.cpp b/src/SPIN/min_spin_lbfgs.cpp index de3b70f01f..9972af0a7a 100644 --- a/src/SPIN/min_spin_lbfgs.cpp +++ b/src/SPIN/min_spin_lbfgs.cpp @@ -43,10 +43,10 @@ using namespace LAMMPS_NS; using namespace MathConst; static const char cite_minstyle_spin_lbfgs[] = - "min_style spin/lbfgs command:\n\n" + "min_style spin/lbfgs command: doi:10.48550/arXiv.1904.02669\n\n" "@article{ivanov2019fast,\n" - "title={Fast and Robust Algorithm for the Minimisation of the Energy of " - "Spin Systems},\n" + "title={Fast and Robust Algorithm for the Minimisation of the Energy of\n" + " Spin Systems},\n" "author={Ivanov, A. V and Uzdin, V. M. and J{\'o}nsson, H.},\n" "journal={arXiv preprint arXiv:1904.02669},\n" "year={2019}\n" diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index 692883fc0a..381d1827b3 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -48,12 +48,12 @@ using namespace LAMMPS_NS; static const char cite_neb_spin[] = - "neb/spin command:\n\n" + "neb/spin command: doi:10.1016/j.cpc.2015.07.001\n\n" "@article{bessarab2015method,\n" - "title={Method for finding mechanism and activation energy of " - "magnetic transitions, applied to skyrmion and antivortex " - "annihilation},\n" - "author={Bessarab, P.F. and Uzdin, V.M. and J{\'o}nsson, H.},\n" + "title={Method for Finding Mechanism and Activation Energy of\n" + " Magnetic Transitions, Applied to Skyrmion and Antivortex\n" + " Annihilation},\n" + "author={Bessarab, P. F. and Uzdin, V. M. and J{\'o}nsson, H.},\n" "journal={Computer Physics Communications},\n" "volume={196},\n" "pages={335--347},\n" diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index 76c5237f2d..0cec6fd794 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -60,17 +60,18 @@ enum { SHIFT_NO, SHIFT_YES, SHIFT_POSSIBLE }; #define TOLERANCE 0.00001 #define MAXITER 20 -static const char cite_fix_srd[] = "fix srd command:\n\n" - "@Article{Petersen10,\n" - " author = {M. K. Petersen, J. B. Lechman, S. J. Plimpton, G. " - "S. Grest, P. J. in 't Veld, P. R. Schunk},\n" - " title = {Mesoscale Hydrodynamics via Stochastic Rotation " - "Dynamics: Comparison with Lennard-Jones Fluid}," - " journal = {J.~Chem.~Phys.},\n" - " year = 2010,\n" - " volume = 132,\n" - " pages = {174106}\n" - "}\n\n"; +static const char cite_fix_srd[] = + "fix srd command: doi:10.1063/1.3419070\n\n" + "@Article{Petersen10,\n" + " author = {M. K. Petersen and J. B. Lechman and S. J. Plimpton and\n" + " G. S. Grest and in 't Veld, P. J. and P. R. Schunk},\n" + " title = {Mesoscale Hydrodynamics via Stochastic Rotation\n" + " Dynamics: Comparison with {L}ennard-{J}ones Fluid},\n" + " journal = {J.~Chem.\\ Phys.},\n" + " year = 2010,\n" + " volume = 132,\n" + " pages = 174106\n" + "}\n\n"; //#define SRD_DEBUG 1 //#define SRD_DEBUG_ATOMID 58 diff --git a/src/UEF/fix_nh_uef.cpp b/src/UEF/fix_nh_uef.cpp index 720c960252..71b076bddb 100644 --- a/src/UEF/fix_nh_uef.cpp +++ b/src/UEF/fix_nh_uef.cpp @@ -44,14 +44,16 @@ enum{ISO,ANISO,TRICLINIC}; // citation info static const char cite_user_uef_package[] = - "UEF package:\n\n" + "UEF package: doi:10.1063/1.4972894\n\n" "@Article{NicholsonRutledge16,\n" "author = {David A. Nicholson and Gregory C. Rutledge},\n" - "title = {Molecular simulation of flow-enhanced nucleation in n-eicosane melts under steady shear and uniaxial extension},\n" + "title = {Molecular Simulation of Flow-Enhanced Nucleation in\n" + " {$n$}-Eicosane Melts Under Steady Shear and Uniaxial Extension},\n" "journal = {The Journal of Chemical Physics},\n" "volume = {145},\n" "number = {24},\n" "pages = {244903},\n" + "doi = {10.1063/1.4972894},\n" "year = {2016}\n" "}\n\n"; diff --git a/src/angle.cpp b/src/angle.cpp index 8581095dca..757da3c56f 100644 --- a/src/angle.cpp +++ b/src/angle.cpp @@ -382,6 +382,7 @@ void Angle::ev_tally4(int i, int j, int k, int m, int nlocal, int newton_bond, if (i < nlocal) energy += eanglefourth; if (j < nlocal) energy += eanglefourth; if (k < nlocal) energy += eanglefourth; + if (m < nlocal) energy += eanglefourth; } } if (eflag_atom) { diff --git a/src/atom.cpp b/src/atom.cpp index 91b72841f0..3b9a47918d 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -1900,6 +1900,18 @@ int Atom::find_molecule(char *id) return -1; } +/* ---------------------------------------------------------------------- + return vector of molecules which match template ID +------------------------------------------------------------------------- */ + +std::vectorAtom::get_molecule_by_id(const std::string &id) +{ + std::vector result; + for (int imol = 0; imol < nmolecule; ++imol) + if (id == molecules[imol]->id) result.push_back(molecules[imol]); + return result; +} + /* ---------------------------------------------------------------------- add info to current atom ilocal from molecule template onemol and its iatom offset = atom ID preceding IDs of atoms in this molecule @@ -1912,8 +1924,7 @@ void Atom::add_molecule_atom(Molecule *onemol, int iatom, int ilocal, tagint off if (onemol->radiusflag && radius_flag) radius[ilocal] = onemol->radius[iatom]; if (onemol->rmassflag && rmass_flag) rmass[ilocal] = onemol->rmass[iatom]; else if (rmass_flag) - rmass[ilocal] = 4.0*MY_PI/3.0 * - radius[ilocal]*radius[ilocal]*radius[ilocal]; + rmass[ilocal] = 4.0*MY_PI/3.0 * radius[ilocal]*radius[ilocal]*radius[ilocal]; if (onemol->bodyflag) { body[ilocal] = 0; // as if a body read from data file onemol->avec_body->data_body(ilocal,onemol->nibody,onemol->ndbody, @@ -1923,10 +1934,8 @@ void Atom::add_molecule_atom(Molecule *onemol, int iatom, int ilocal, tagint off // initialize custom per-atom properties to zero if present - for (int i = 0; i < nivector; ++i) - ivector[i][ilocal] = 0; - for (int i = 0; i < ndvector; ++i) - dvector[i][ilocal] = 0.0; + for (int i = 0; i < nivector; ++i) ivector[i][ilocal] = 0; + for (int i = 0; i < ndvector; ++i) dvector[i][ilocal] = 0.0; for (int i = 0; i < niarray; ++i) for (int j = 0; j < icols[i]; ++j) iarray[i][ilocal][j] = 0; diff --git a/src/atom.h b/src/atom.h index df43898dbf..b5b52d7421 100644 --- a/src/atom.h +++ b/src/atom.h @@ -345,6 +345,7 @@ class Atom : protected Pointers { void add_molecule(int, char **); int find_molecule(char *); + std::vectorget_molecule_by_id(const std::string &); void add_molecule_atom(class Molecule *, int, int, tagint); void first_reorder(); diff --git a/src/compute_angmom_chunk.cpp b/src/compute_angmom_chunk.cpp index 226e0cd646..a44e577de0 100644 --- a/src/compute_angmom_chunk.cpp +++ b/src/compute_angmom_chunk.cpp @@ -185,11 +185,8 @@ void ComputeAngmomChunk::lock_enable() void ComputeAngmomChunk::lock_disable() { - int icompute = modify->find_compute(idchunk); - if (icompute >= 0) { - cchunk = dynamic_cast(modify->compute[icompute]); - cchunk->lockcount--; - } + cchunk = dynamic_cast(modify->get_compute_by_id(idchunk)); + if(cchunk) cchunk->lockcount--; } /* ---------------------------------------------------------------------- diff --git a/src/compute_centroid_stress_atom.cpp b/src/compute_centroid_stress_atom.cpp index ee362927cf..929b7007ff 100644 --- a/src/compute_centroid_stress_atom.cpp +++ b/src/compute_centroid_stress_atom.cpp @@ -36,12 +36,12 @@ using namespace LAMMPS_NS; enum { NOBIAS, BIAS }; static const char cite_centroid_angle_improper_dihedral[] = - "compute centroid/stress/atom for angles, impropers and dihedrals:\n\n" + "compute centroid/stress/atom for angles, impropers and dihedrals: doi:10.1103/PhysRevE.99.051301\n\n" "@article{PhysRevE.99.051301,\n" - " title = {Application of atomic stress to compute heat flux via molecular dynamics for " - "systems with many-body interactions},\n" + " title = {Application of Atomic Stress to Compute Heat Flux via Molecular\n" + " Dynamics for Systems With Many-Body Interactions},\n" " author = {Surblys, Donatas and Matsubara, Hiroki and Kikugawa, Gota and Ohara, Taku},\n" - " journal = {Physical Review E},\n" + " journal = {Physical Review~E},\n" " volume = {99},\n" " issue = {5},\n" " pages = {051301},\n" @@ -51,12 +51,12 @@ static const char cite_centroid_angle_improper_dihedral[] = "}\n\n"; static const char cite_centroid_shake_rigid[] = - "compute centroid/stress/atom for constrained dynamics:\n\n" + "compute centroid/stress/atom for constrained dynamics: doi:10.1063/5.0070930\n\n" "@article{doi:10.1063/5.0070930,\n" " author = {Surblys, Donatas and Matsubara, Hiroki and Kikugawa, Gota and Ohara, Taku},\n" " journal = {Journal of Applied Physics},\n" - " title = {Methodology and meaning of computing heat flux via atomic stress in systems with " - "constraint dynamics},\n" + " title = {Methodology and Meaning of Computing Heat Flux via Atomic Stress in Systems with\n" + " Constraint Dynamics},\n" " volume = {130},\n" " number = {21},\n" " pages = {215104},\n" diff --git a/src/compute_chunk_spread_atom.cpp b/src/compute_chunk_spread_atom.cpp index 3781e83aa7..a68174e058 100644 --- a/src/compute_chunk_spread_atom.cpp +++ b/src/compute_chunk_spread_atom.cpp @@ -89,21 +89,21 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < nvalues; i++) { if (which[i] == ArgInfo::COMPUTE) { - int icompute = modify->find_compute(ids[i]); - if (icompute < 0) - error->all(FLERR,"Compute ID for compute chunk/spread/atom does not exist"); + auto icompute = modify->get_compute_by_id(ids[i]); + if (!icompute) + error->all(FLERR,"Compute ID {} for compute chunk/spread/atom does not exist", ids[i]); - if (!utils::strmatch(modify->compute[icompute]->style,"/chunk$")) + if (!utils::strmatch(icompute->style,"/chunk$")) error->all(FLERR,"Compute for compute chunk/spread/atom " "does not calculate per-chunk values"); if (argindex[i] == 0) { - if (!modify->compute[icompute]->vector_flag) + if (!icompute->vector_flag) error->all(FLERR,"Compute chunk/spread/atom compute does not calculate global vector"); } else { - if (!modify->compute[icompute]->array_flag) + if (!icompute->array_flag) error->all(FLERR,"Compute chunk/spread/atom compute does not calculate global array"); - if (argindex[i] > modify->compute[icompute]->size_array_cols) + if (argindex[i] > icompute->size_array_cols) error->all(FLERR,"Compute chunk/spread/atom compute array is accessed out-of-range"); } @@ -164,14 +164,13 @@ void ComputeChunkSpreadAtom::init() if (which[m] == ArgInfo::COMPUTE) { int icompute = modify->find_compute(ids[m]); if (icompute < 0) - error->all(FLERR,"Compute ID for compute chunk/spread/atom " - "does not exist"); + error->all(FLERR,"Compute ID {} for compute chunk/spread/atom does not exist", ids[m]); value2index[m] = icompute; } else if (which[m] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[m]); if (ifix < 0) - error->all(FLERR,"Fix ID for compute chunk/spread/atom does not exist"); + error->all(FLERR,"Fix ID {} for compute chunk/spread/atom does not exist", ids[m]); value2index[m] = ifix; } } @@ -181,12 +180,11 @@ void ComputeChunkSpreadAtom::init() void ComputeChunkSpreadAtom::init_chunk() { - int icompute = modify->find_compute(idchunk); - if (icompute < 0) - error->all(FLERR,"Chunk/atom compute does not exist for compute chunk/spread/atom"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast( modify->get_compute_by_id(idchunk)); + if (!cchunk) + error->all(FLERR,"Chunk/atom compute does not exist for compute chunk/spread/atom {}", idchunk); if (strcmp(cchunk->style,"chunk/atom") != 0) - error->all(FLERR,"Compute chunk/spread/atom does not use chunk/atom compute"); + error->all(FLERR,"Compute chunk/spread/atom {} does not use chunk/atom compute", idchunk); } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_msd.cpp b/src/compute_msd.cpp index 7ecb89b4c0..90d8f47b7a 100644 --- a/src/compute_msd.cpp +++ b/src/compute_msd.cpp @@ -27,8 +27,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) - : Compute(lmp, narg, arg), id_fix(nullptr) +ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), id_fix(nullptr) { if (narg < 3) error->all(FLERR, "Illegal compute msd command"); @@ -46,15 +45,15 @@ ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) int iarg = 3; while (iarg < narg) { if (strcmp(arg[iarg], "com") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute msd command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "compute msd com", error); comflag = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "average") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute msd command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "compute msd average", error); avflag = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else - error->all(FLERR, "Illegal compute msd command"); + error->all(FLERR, "Unknown compute msd keyword: {}", arg[iarg]); } if (group->dynamic[igroup]) diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index da352e3ae5..85e83d694f 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -299,7 +299,7 @@ void CreateAtoms::command(int narg, char **arg) if (onemol->tag_require && !atom->tag_enable) error->all(FLERR, "Create_atoms molecule has atom IDs, but system does not"); - onemol->check_attributes(0); + onemol->check_attributes(); // use geometric center of molecule for insertion // molecule random number generator, different for each proc diff --git a/src/dump.cpp b/src/dump.cpp index 9a8bac052a..c4b4cc02e9 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -1035,31 +1035,31 @@ void Dump::balance() void Dump::modify_params(int narg, char **arg) { - if (narg == 0) error->all(FLERR,"Illegal dump_modify command"); + if (narg == 0) utils::missing_cmd_args(FLERR, "dump_modify", error); int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg],"append") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify append", error); append_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"buffer") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify buffer", error); buffer_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); if (buffer_flag && buffer_allow == 0) error->all(FLERR,"Dump_modify buffer yes not allowed for this style"); iarg += 2; } else if (strcmp(arg[iarg],"delay") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify delay", error); delaystep = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (delaystep >= 0) delay_flag = 1; else delay_flag = 0; iarg += 2; } else if (strcmp(arg[iarg],"every") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify every", error); int idump; for (idump = 0; idump < output->ndump; idump++) if (strcmp(id,output->dump[idump]->id) == 0) break; @@ -1070,14 +1070,14 @@ void Dump::modify_params(int narg, char **arg) n = 0; } else { n = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (n <= 0) error->all(FLERR,"Illegal dump_modify command"); + if (n <= 0) error->all(FLERR, "Invalid dump_modify every argument: {}", n); } output->mode_dump[idump] = 0; output->every_dump[idump] = n; iarg += 2; } else if (strcmp(arg[iarg],"every/time") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify every/time", error); int idump; for (idump = 0; idump < output->ndump; idump++) if (strcmp(id,output->dump[idump]->id) == 0) break; @@ -1088,7 +1088,7 @@ void Dump::modify_params(int narg, char **arg) delta = 0.0; } else { delta = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (delta <= 0.0) error->all(FLERR,"Illegal dump_modify command"); + if (delta <= 0.0) error->all(FLERR, "Invalid dump_modify every/time argument: {}", delta); } output->mode_dump[idump] = 1; output->every_time_dump[idump] = delta; @@ -1096,11 +1096,11 @@ void Dump::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"fileper") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify fileper", error); if (!multiproc) error->all(FLERR,"Cannot use dump_modify fileper without % in dump file name"); int nper = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (nper <= 0) error->all(FLERR,"Illegal dump_modify command"); + if (nper <= 0) error->all(FLERR, "Invalid dump_modify fileper argument: {}", nper); multiproc = nprocs/nper; if (nprocs % nper) multiproc++; @@ -1122,22 +1122,22 @@ void Dump::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"first") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify first", error); first_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"flush") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify flush", error); flush_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"colname") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify colname", error); if (strcmp(arg[iarg+1],"default") == 0) { for (auto item : keyword_user) item.clear(); iarg += 2; } else { - if (iarg+3 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+3 > narg) utils::missing_cmd_args(FLERR, "dump_modify colname", error); int icol = -1; if (utils::is_integer(arg[iarg + 1])) { icol = utils::inumeric(FLERR,arg[iarg + 1],false,lmp); @@ -1157,7 +1157,7 @@ void Dump::modify_params(int narg, char **arg) iarg += 3; } } else if (strcmp(arg[iarg],"format") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify format", error); if (strcmp(arg[iarg+1],"none") == 0) { delete[] format_line_user; @@ -1175,7 +1175,7 @@ void Dump::modify_params(int narg, char **arg) continue; } - if (iarg+3 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+3 > narg) utils::missing_cmd_args(FLERR, "dump_modify format", error); if (strcmp(arg[iarg+1],"line") == 0) { delete[] format_line_user; @@ -1183,17 +1183,17 @@ void Dump::modify_params(int narg, char **arg) iarg += 3; } else { // pass other format options to child classes int n = modify_param(narg-iarg,&arg[iarg]); - if (n == 0) error->all(FLERR,"Illegal dump_modify command"); + if (n == 0) error->all(FLERR,"Unknown dump_modify format keyword: {}", arg[iarg+1]); iarg += n; } } else if (strcmp(arg[iarg],"header") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify header", error); write_header_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"maxfiles") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify maxfiles", error); if (!multifile) error->all(FLERR,"Cannot use dump_modify maxfiles without * in dump file name"); // wipe out existing storage @@ -1203,7 +1203,7 @@ void Dump::modify_params(int narg, char **arg) delete[] nameslist; } maxfiles = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (maxfiles == 0) error->all(FLERR,"Illegal dump_modify command"); + if (maxfiles == 0) error->all(FLERR, "Invalid dump_modify maxfiles argument: {}", maxfiles); if (maxfiles > 0) { nameslist = new char*[maxfiles]; numfiles = 0; @@ -1213,11 +1213,11 @@ void Dump::modify_params(int narg, char **arg) } iarg += 2; } else if (strcmp(arg[iarg],"nfile") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify nfile", error); if (!multiproc) error->all(FLERR,"Cannot use dump_modify nfile without % in dump file name"); int nfile = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (nfile <= 0) error->all(FLERR,"Illegal dump_modify command"); + if (nfile <= 0) error->all(FLERR, "Invalid dump_modify nfile argument: {}", nfile); nfile = MIN(nfile,nprocs); multiproc = nfile; @@ -1244,18 +1244,18 @@ void Dump::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"pad") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify pad", error); padflag = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (padflag < 0) error->all(FLERR,"Illegal dump_modify command"); + if (padflag < 0) error->all(FLERR, "Invalid dump_modify pad argument: {}", padflag); iarg += 2; } else if (strcmp(arg[iarg],"pbc") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify pbc", error); pbcflag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"sort") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify sort", error); if (strcmp(arg[iarg+1],"off") == 0) sort_flag = 0; else if (strcmp(arg[iarg+1],"id") == 0) { sort_flag = 1; @@ -1265,7 +1265,7 @@ void Dump::modify_params(int narg, char **arg) sort_flag = 1; sortcol = utils::inumeric(FLERR,arg[iarg+1],false,lmp); sortorder = ASCEND; - if (sortcol == 0) error->all(FLERR,"Illegal dump_modify command"); + if (sortcol == 0) error->all(FLERR, "Invalid dump_modify sort argument: {}", sortcol); if (sortcol < 0) { sortorder = DESCEND; sortcol = -sortcol; @@ -1275,24 +1275,24 @@ void Dump::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"balance") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify blance", error); if (nprocs > 1) balance_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"time") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify time", error); time_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"units") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify units", error); unit_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else { int n = modify_param(narg-iarg,&arg[iarg]); - if (n == 0) error->all(FLERR,"Illegal dump_modify command"); + if (n == 0) error->all(FLERR,"Unknown dump_modify keyword: {}", arg[iarg]); iarg += n; } } diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 1a7b3a5917..87fe8575d0 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -1674,7 +1674,7 @@ int DumpCustom::modify_param(int narg, char **arg) } if (strcmp(arg[0],"format") == 0) { - if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + if (narg < 2) utils::missing_cmd_args(FLERR, "dump_modify format", error); if (strcmp(arg[1],"none") == 0) { // just clear format_column_user allocated by this dump child class @@ -1685,7 +1685,7 @@ int DumpCustom::modify_param(int narg, char **arg) return 2; } - if (narg < 3) error->all(FLERR,"Illegal dump_modify command"); + if (narg < 3) utils::missing_cmd_args(FLERR, "dump_modify format", error); if (strcmp(arg[1],"int") == 0) { delete[] format_int_user; @@ -1711,7 +1711,7 @@ int DumpCustom::modify_param(int narg, char **arg) } else { int i = utils::inumeric(FLERR,arg[1],false,lmp) - 1; if (i < 0 || i >= nfield) - error->all(FLERR,"Illegal dump_modify command"); + error->all(FLERR,"Unknown dump_modify format ID keyword: {}", arg[1]); delete[] format_column_user[i]; format_column_user[i] = utils::strdup(arg[2]); } @@ -1732,7 +1732,7 @@ int DumpCustom::modify_param(int narg, char **arg) } if (strcmp(arg[0],"refresh") == 0) { - if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + if (narg < 2) utils::missing_cmd_args(FLERR, "dump_modify refresh", error); ArgInfo argi(arg[1],ArgInfo::COMPUTE); if ((argi.get_type() != ArgInfo::COMPUTE) || (argi.get_dim() != 0)) error->all(FLERR,"Illegal dump_modify command"); @@ -1744,7 +1744,7 @@ int DumpCustom::modify_param(int narg, char **arg) } if (strcmp(arg[0],"thresh") == 0) { - if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + if (narg < 2) utils::missing_cmd_args(FLERR, "dump_modify thresh", error); if (strcmp(arg[1],"none") == 0) { if (nthresh) { memory->destroy(thresh_array); @@ -1766,7 +1766,7 @@ int DumpCustom::modify_param(int narg, char **arg) return 2; } - if (narg < 4) error->all(FLERR,"Illegal dump_modify command"); + if (narg < 4) utils::missing_cmd_args(FLERR, "dump_modify thresh", error); // grow threshold arrays diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 48b006eb2d..b4d13ff5fa 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -38,7 +38,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), estr(nullptr), idregion(nullptr), region(nullptr), sforce(nullptr) { - if (narg < 6) error->all(FLERR, "Illegal fix addforce command"); + if (narg < 6) utils::missing_cmd_args(FLERR, "fix addforce", error); dynamic_group_allow = 1; scalar_flag = 1; @@ -77,25 +77,25 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : int iarg = 6; while (iarg < narg) { if (strcmp(arg[iarg], "every") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal fix addforce command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "fix addforce every", error); nevery = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); - if (nevery <= 0) error->all(FLERR, "Illegal fix addforce command"); + if (nevery <= 0) error->all(FLERR, "Invalid fix addforce every argument: {}", nevery); iarg += 2; } else if (strcmp(arg[iarg], "region") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal fix addforce command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "fix addforce region", error); region = domain->get_region_by_id(arg[iarg + 1]); if (!region) error->all(FLERR, "Region {} for fix addforce does not exist", arg[iarg + 1]); idregion = utils::strdup(arg[iarg + 1]); iarg += 2; } else if (strcmp(arg[iarg], "energy") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal fix addforce command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "fix addforce energy", error); if (utils::strmatch(arg[iarg + 1], "^v_")) { estr = utils::strdup(arg[iarg + 1] + 2); } else - error->all(FLERR, "Illegal fix addforce command"); + error->all(FLERR, "Invalid fix addforce energy argument: {}", arg[iarg + 1]); iarg += 2; } else - error->all(FLERR, "Illegal fix addforce command"); + error->all(FLERR, "Unknown fix addforce keyword: {}", arg[iarg]); } force_flag = 0; diff --git a/src/fix_deposit.cpp b/src/fix_deposit.cpp index fd6eb3e36a..be30fbc97b 100644 --- a/src/fix_deposit.cpp +++ b/src/fix_deposit.cpp @@ -117,7 +117,7 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) : if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) error->all(FLERR,"Fix deposit molecule template ID must be same " "as atom_style template ID"); - onemols[i]->check_attributes(0); + onemols[i]->check_attributes(); // fix deposit uses geoemetric center of molecule for insertion diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp index 3f99d14a8c..f38ab5efa6 100644 --- a/src/fix_indent.cpp +++ b/src/fix_indent.cpp @@ -43,7 +43,7 @@ FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), rstr(nullptr), pstr(nullptr) { - if (narg < 4) error->all(FLERR,"Illegal fix indent command"); + if (narg < 4) utils::missing_cmd_args(FLERR, "fix indent", error); scalar_flag = 1; vector_flag = 1; @@ -83,7 +83,7 @@ FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) : if (cdim == 0 && !pstr) pvalue *= xscale; else if (cdim == 1 && !pstr) pvalue *= yscale; else if (cdim == 2 && !pstr) pvalue *= zscale; - } else error->all(FLERR,"Illegal fix indent command"); + } else error->all(FLERR,"Unknown fix indent keyword: {}", istyle); varflag = 0; if (xstr || ystr || zstr || rstr || pstr) varflag = 1; @@ -121,37 +121,37 @@ void FixIndent::init() if (xstr) { xvar = input->variable->find(xstr); if (xvar < 0) - error->all(FLERR,"Variable name for fix indent does not exist"); + error->all(FLERR,"Variable {} for fix indent does not exist", xstr); if (!input->variable->equalstyle(xvar)) - error->all(FLERR,"Variable for fix indent is invalid style"); + error->all(FLERR,"Variable {} for fix indent is invalid style", xstr); } if (ystr) { yvar = input->variable->find(ystr); if (yvar < 0) - error->all(FLERR,"Variable name for fix indent does not exist"); + error->all(FLERR,"Variable {} for fix indent does not exist", ystr); if (!input->variable->equalstyle(yvar)) - error->all(FLERR,"Variable for fix indent is not equal style"); + error->all(FLERR,"Variable {} for fix indent is invalid style", ystr); } if (zstr) { zvar = input->variable->find(zstr); if (zvar < 0) - error->all(FLERR,"Variable name for fix indent does not exist"); + error->all(FLERR,"Variable {} for fix indent does not exist", zstr); if (!input->variable->equalstyle(zvar)) - error->all(FLERR,"Variable for fix indent is not equal style"); + error->all(FLERR,"Variable {} for fix indent is invalid style", zstr); } if (rstr) { rvar = input->variable->find(rstr); if (rvar < 0) - error->all(FLERR,"Variable name for fix indent does not exist"); + error->all(FLERR,"Variable {} for fix indent does not exist", rstr); if (!input->variable->equalstyle(rvar)) - error->all(FLERR,"Variable for fix indent is not equal style"); + error->all(FLERR,"Variable {} for fix indent is invalid style", rstr); } if (pstr) { pvar = input->variable->find(pstr); if (pvar < 0) - error->all(FLERR,"Variable name for fix indent does not exist"); + error->all(FLERR,"Variable {} for fix indent does not exist", pstr); if (!input->variable->equalstyle(pvar)) - error->all(FLERR,"Variable for fix indent is not equal style"); + error->all(FLERR,"Variable {} for fix indent is invalid style", pstr); } if (utils::strmatch(update->integrate_style,"^respa")) { @@ -405,7 +405,7 @@ double FixIndent::compute_vector(int n) void FixIndent::options(int narg, char **arg) { - if (narg < 0) error->all(FLERR,"Illegal fix indent command"); + if (narg < 0) utils::missing_cmd_args(FLERR, "fix indent", error); istyle = NONE; xstr = ystr = zstr = rstr = pstr = nullptr; @@ -416,7 +416,7 @@ void FixIndent::options(int narg, char **arg) int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg],"sphere") == 0) { - if (iarg+5 > narg) error->all(FLERR,"Illegal fix indent command"); + if (iarg+5 > narg) utils::missing_cmd_args(FLERR, "fix indent sphere", error); if (utils::strmatch(arg[iarg+1],"^v_")) { xstr = utils::strdup(arg[iarg+1]+2); @@ -435,7 +435,7 @@ void FixIndent::options(int narg, char **arg) iarg += 5; } else if (strcmp(arg[iarg],"cylinder") == 0) { - if (iarg+5 > narg) error->all(FLERR,"Illegal fix indent command"); + if (iarg+5 > narg) utils::missing_cmd_args(FLERR, "fix indent cylinder", error); if (strcmp(arg[iarg+1],"x") == 0) { cdim = 0; @@ -461,7 +461,7 @@ void FixIndent::options(int narg, char **arg) if (utils::strmatch(arg[iarg+3],"^v_")) { ystr = utils::strdup(arg[iarg+3]+2); } else yvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); - } else error->all(FLERR,"Illegal fix indent command"); + } else error->all(FLERR,"Unknown fix indent cylinder argument: {}", arg[iarg+1]); if (utils::strmatch(arg[iarg+4],"^v_")) { rstr = utils::strdup(arg[iarg+4]+2); @@ -471,11 +471,11 @@ void FixIndent::options(int narg, char **arg) iarg += 5; } else if (strcmp(arg[iarg],"plane") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix indent command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "fix indent plane", error); if (strcmp(arg[iarg+1],"x") == 0) cdim = 0; else if (strcmp(arg[iarg+1],"y") == 0) cdim = 1; else if (strcmp(arg[iarg+1],"z") == 0) cdim = 2; - else error->all(FLERR,"Illegal fix indent command"); + else error->all(FLERR,"Unknown fix indent plane argument: {}", arg[iarg+1]); if (utils::strmatch(arg[iarg+2],"^v_")) { pstr = utils::strdup(arg[iarg+2]+2); @@ -483,23 +483,23 @@ void FixIndent::options(int narg, char **arg) if (strcmp(arg[iarg+3],"lo") == 0) planeside = -1; else if (strcmp(arg[iarg+3],"hi") == 0) planeside = 1; - else error->all(FLERR,"Illegal fix indent command"); + else error->all(FLERR,"Unknown fix indent plane argument: {}", arg[iarg+3]); istyle = PLANE; iarg += 4; } else if (strcmp(arg[iarg],"units") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix indent command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix indent units", error); if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0; else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1; - else error->all(FLERR,"Illegal fix indent command"); + else error->all(FLERR,"Unknown fix indent units argument: {}", arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"side") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix indent command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix indent side", error); if (strcmp(arg[iarg+1],"in") == 0) side = INSIDE; else if (strcmp(arg[iarg+1],"out") == 0) side = OUTSIDE; - else error->all(FLERR,"Illegal fix indent command"); + else error->all(FLERR,"Unknown fix indent side argument: {}", arg[iarg+1]); iarg += 2; - } else error->all(FLERR,"Illegal fix indent command"); + } else error->all(FLERR,"Unknown fix indent argument: {}", arg[iarg]); } } diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index cb0408a50c..9f5915cf1e 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -60,7 +60,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : eta_mass(nullptr), etap(nullptr), etap_dot(nullptr), etap_dotdot(nullptr), etap_mass(nullptr) { - if (narg < 4) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (narg < 4) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph", error); restart_global = 1; dynamic_group_allow = 1; @@ -130,7 +130,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"temp") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph temp", error); tstat_flag = 1; t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); t_target = t_start; @@ -142,7 +142,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : iarg += 4; } else if (strcmp(arg[iarg],"iso") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph iso", error); pcouple = XYZ; p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); @@ -155,7 +155,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } iarg += 4; } else if (strcmp(arg[iarg],"aniso") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph aniso", error); pcouple = NONE; p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); @@ -168,7 +168,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } iarg += 4; } else if (strcmp(arg[iarg],"tri") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph tri", error); pcouple = NONE; scalexy = scalexz = scaleyz = 0; p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); @@ -191,7 +191,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } iarg += 4; } else if (strcmp(arg[iarg],"x") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph x", error); p_start[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_stop[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = utils::numeric(FLERR,arg[iarg+3],false,lmp); @@ -199,7 +199,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : deviatoric_flag = 1; iarg += 4; } else if (strcmp(arg[iarg],"y") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph y", error); p_start[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_stop[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); @@ -207,7 +207,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : deviatoric_flag = 1; iarg += 4; } else if (strcmp(arg[iarg],"z") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph z", error); p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); @@ -218,7 +218,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation"); } else if (strcmp(arg[iarg],"yz") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph yz", error); p_start[3] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_stop[3] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); @@ -229,7 +229,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : if (dimension == 2) error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation"); } else if (strcmp(arg[iarg],"xz") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph xz", error); p_start[4] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_stop[4] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[4] = utils::numeric(FLERR,arg[iarg+3],false,lmp); @@ -240,7 +240,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : if (dimension == 2) error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation"); } else if (strcmp(arg[iarg],"xy") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph xy", error); p_start[5] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_stop[5] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[5] = utils::numeric(FLERR,arg[iarg+3],false,lmp); @@ -250,7 +250,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : iarg += 4; } else if (strcmp(arg[iarg],"couple") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph couple", error); if (strcmp(arg[iarg+1],"xyz") == 0) pcouple = XYZ; else if (strcmp(arg[iarg+1],"xy") == 0) pcouple = XY; else if (strcmp(arg[iarg+1],"yz") == 0) pcouple = YZ; @@ -260,18 +260,18 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"drag") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph drag", error); drag = utils::numeric(FLERR,arg[iarg+1],false,lmp); - if (drag < 0.0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (drag < 0.0) error->all(FLERR, "Invalid fix nvt/npt/nph drag argument: {}", drag); iarg += 2; } else if (strcmp(arg[iarg],"ptemp") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph ptemp", error); p_temp = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_temp_flag = 1; - if (p_temp <= 0.0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (p_temp <= 0.0) error->all(FLERR, "Invalid fix nvt/npt/nph ptemp argument: {}", p_temp); iarg += 2; } else if (strcmp(arg[iarg],"dilate") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph dilate", error); if (strcmp(arg[iarg+1],"all") == 0) allremap = 1; else { allremap = 0; @@ -284,62 +284,62 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"tchain") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph tchain", error); mtchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); // used by FixNVTSllod to preserve non-default value mtchain_default_flag = 0; - if (mtchain < 1) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (mtchain < 1) error->all(FLERR, "Invalid fix nvt/npt/nph tchain argument: {}", mtchain); iarg += 2; } else if (strcmp(arg[iarg],"pchain") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph pchain", error); mpchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (mpchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (mpchain < 0) error->all(FLERR, "Invalid fix nvt/npt/nph pchain argument: {}", mpchain); iarg += 2; } else if (strcmp(arg[iarg],"mtk") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph mtk", error); mtk_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"tloop") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph tloop", error); nc_tchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (nc_tchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (nc_tchain < 0) error->all(FLERR, "Invalid fix nvt/npt/nph tloop argument: {}", nc_tchain); iarg += 2; } else if (strcmp(arg[iarg],"ploop") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph ploop", error); nc_pchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (nc_pchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (nc_pchain < 0) error->all(FLERR, "Invalid fix nvt/npt/nph ploop argument: {}", nc_pchain); iarg += 2; } else if (strcmp(arg[iarg],"nreset") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph nreset", error); nreset_h0 = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (nreset_h0 < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (nreset_h0 < 0) error->all(FLERR, "Invalid fix nvt/npt/nph nreset argument: {}", nreset_h0); iarg += 2; } else if (strcmp(arg[iarg],"scalexy") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph scalexy", error); scalexy = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"scalexz") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph scalexz", error); scalexz = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"scaleyz") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph scaleyz", error); scaleyz = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"flip") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph flip", error); flipflag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"update") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph update", error); if (strcmp(arg[iarg+1],"dipole") == 0) dipole_flag = 1; else if (strcmp(arg[iarg+1],"dipole/dlm") == 0) { dipole_flag = 1; dlm_flag = 1; - } else error->all(FLERR,"Illegal fix nvt/npt/nph command"); + } else error->all(FLERR, "Invalid fix nvt/npt/nph update argument: {}", arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"fixedpoint") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "fix nvt/npt/nph fixedpoint", error); fixedpoint[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); fixedpoint[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); fixedpoint[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); @@ -359,7 +359,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"ext") == 0) { iarg += 2; - } else error->all(FLERR,"Illegal fix nvt/npt/nph command"); + } else error->all(FLERR,"Unknown fix nvt/npt/nph keyword: {}", arg[iarg]); } // error checks @@ -658,19 +658,17 @@ void FixNH::init() // set temperature and pressure ptrs - int icompute = modify->find_compute(id_temp); - if (icompute < 0) - error->all(FLERR,"Temperature ID for fix nvt/npt does not exist"); - temperature = modify->compute[icompute]; + temperature = modify->get_compute_by_id(id_temp); + if (!temperature) + error->all(FLERR,"Temperature ID {} for fix nvt/npt does not exist", id_temp); if (temperature->tempbias) which = BIAS; else which = NOBIAS; if (pstat_flag) { - icompute = modify->find_compute(id_press); - if (icompute < 0) - error->all(FLERR,"Pressure ID for fix npt/nph does not exist"); - pressure = modify->compute[icompute]; + pressure = modify->get_compute_by_id(id_press); + if (!pressure) + error->all(FLERR,"Pressure ID {} for fix npt/nph does not exist", id_press); } // set timesteps and frequencies @@ -1411,10 +1409,9 @@ int FixNH::modify_param(int narg, char **arg) delete [] id_temp; id_temp = utils::strdup(arg[1]); - int icompute = modify->find_compute(arg[1]); - if (icompute < 0) - error->all(FLERR,"Could not find fix_modify temperature ID"); - temperature = modify->compute[icompute]; + temperature = modify->get_compute_by_id(arg[1]); + if (!temperature) + error->all(FLERR,"Could not find fix_modify temperature ID {}", arg[1]); if (temperature->tempflag == 0) error->all(FLERR, @@ -1425,10 +1422,10 @@ int FixNH::modify_param(int narg, char **arg) // reset id_temp of pressure to new temperature ID if (pstat_flag) { - icompute = modify->find_compute(id_press); - if (icompute < 0) - error->all(FLERR,"Pressure ID for fix modify does not exist"); - modify->compute[icompute]->reset_extra_compute_fix(id_temp); + auto icompute = modify->get_compute_by_id(id_press); + if (!icompute) + error->all(FLERR,"Pressure ID {} for fix modify does not exist", id_press); + icompute->reset_extra_compute_fix(id_temp); } return 2; @@ -1443,9 +1440,8 @@ int FixNH::modify_param(int narg, char **arg) delete [] id_press; id_press = utils::strdup(arg[1]); - int icompute = modify->find_compute(arg[1]); - if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID"); - pressure = modify->compute[icompute]; + pressure = modify->get_compute_by_id(arg[1]); + if (!pressure) error->all(FLERR,"Could not find fix_modify pressure ID {}", arg[1]); if (pressure->pressflag == 0) error->all(FLERR,"Fix_modify pressure ID does not compute pressure"); diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp index 6a88e3ab17..8bd5477f76 100644 --- a/src/fix_setforce.cpp +++ b/src/fix_setforce.cpp @@ -37,7 +37,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), idregion(nullptr), region(nullptr), sforce(nullptr) { - if (narg < 6) error->all(FLERR, "Illegal fix setforce command"); + if (narg < 6) utils::missing_cmd_args(FLERR, "fix setforce", error); dynamic_group_allow = 1; vector_flag = 1; @@ -77,13 +77,13 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : int iarg = 6; while (iarg < narg) { if (strcmp(arg[iarg], "region") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal fix setforce command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "fix setforce region", error); region = domain->get_region_by_id(arg[iarg + 1]); if (!region) error->all(FLERR, "Region {} for fix setforce does not exist", arg[iarg + 1]); idregion = utils::strdup(arg[iarg + 1]); iarg += 2; } else - error->all(FLERR, "Illegal fix setforce command"); + error->all(FLERR, "Unknown fix setforce keyword: {}", arg[iarg]); } force_flag = 0; diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index 41fb49e3f4..f4f462c968 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -40,10 +40,10 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), tstr(nullptr), id_temp(nullptr), tflag(0) { - if (narg < 8) error->all(FLERR,"Illegal fix temp/rescale command"); + if (narg < 8) utils::missing_cmd_args(FLERR, "fix temp/rescale", error); nevery = utils::inumeric(FLERR,arg[3],false,lmp); - if (nevery <= 0) error->all(FLERR,"Illegal fix temp/rescale command"); + if (nevery <= 0) error->all(FLERR, "Invalid fix temp/rescale argument: {}", nevery); restart_global = 1; scalar_flag = 1; @@ -106,9 +106,9 @@ void FixTempRescale::init() if (tstr) { tvar = input->variable->find(tstr); if (tvar < 0) - error->all(FLERR,"Variable name for fix temp/rescale does not exist"); + error->all(FLERR,"Variable {} for fix temp/rescale does not exist", tstr); if (input->variable->equalstyle(tvar)) tstyle = EQUAL; - else error->all(FLERR,"Variable for fix temp/rescale is invalid style"); + else error->all(FLERR,"Variable {} for fix temp/rescale is invalid style", tstr); } int icompute = modify->find_compute(id_temp); @@ -195,7 +195,7 @@ void FixTempRescale::end_of_step() int FixTempRescale::modify_param(int narg, char **arg) { if (strcmp(arg[0],"temp") == 0) { - if (narg < 2) error->all(FLERR,"Illegal fix_modify command"); + if (narg < 2) utils::missing_cmd_args(FLERR, "fix_modify temp", error); if (tflag) { modify->delete_compute(id_temp); tflag = 0; @@ -205,7 +205,7 @@ int FixTempRescale::modify_param(int narg, char **arg) int icompute = modify->find_compute(id_temp); if (icompute < 0) - error->all(FLERR,"Could not find fix_modify temperature ID"); + error->all(FLERR,"Could not find fix_modify temperature ID {}", arg[1]); temperature = modify->compute[icompute]; if (temperature->tempflag == 0) diff --git a/src/fix_wall_reflect.cpp b/src/fix_wall_reflect.cpp index ac5940c513..27f3b41f8b 100644 --- a/src/fix_wall_reflect.cpp +++ b/src/fix_wall_reflect.cpp @@ -35,7 +35,7 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), nwall(0) { - if (narg < 4) error->all(FLERR,"Illegal fix wall/reflect command"); + if (narg < 4) utils::missing_cmd_args(FLERR, "fix wall/reflect", error); // let child class process all args @@ -53,7 +53,7 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) : if ((strcmp(arg[iarg],"xlo") == 0) || (strcmp(arg[iarg],"xhi") == 0) || (strcmp(arg[iarg],"ylo") == 0) || (strcmp(arg[iarg],"yhi") == 0) || (strcmp(arg[iarg],"zlo") == 0) || (strcmp(arg[iarg],"zhi") == 0)) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix wall/reflect command"); + if (iarg+2 > narg) error->all(FLERR, "Illegal fix wall/reflect {} command: missing argument(s)", arg[iarg]); int newwall; if (strcmp(arg[iarg],"xlo") == 0) newwall = XLO; @@ -86,26 +86,26 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"units") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal wall/reflect command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix wall/reflect units", error); if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0; else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1; - else error->all(FLERR,"Illegal fix wall/reflect command"); + else error->all(FLERR,"Unknown fix wall/reflect units argument: {}", arg[iarg+1]); iarg += 2; - } else error->all(FLERR,"Illegal fix wall/reflect command"); + } else error->all(FLERR,"Unknown fix wall/reflect keyword: {}", arg[iarg]); } // error check - if (nwall == 0) error->all(FLERR,"Illegal fix wall command"); + if (nwall == 0) utils::missing_cmd_args(FLERR, "fix wall/reflect", error); for (int m = 0; m < nwall; m++) { if ((wallwhich[m] == XLO || wallwhich[m] == XHI) && domain->xperiodic) - error->all(FLERR,"Cannot use fix wall/reflect in periodic dimension"); + error->all(FLERR,"Cannot use fix wall/reflect in periodic dimension x"); if ((wallwhich[m] == YLO || wallwhich[m] == YHI) && domain->yperiodic) - error->all(FLERR,"Cannot use fix wall/reflect in periodic dimension"); + error->all(FLERR,"Cannot use fix wall/reflect in periodic dimension y"); if ((wallwhich[m] == ZLO || wallwhich[m] == ZHI) && domain->zperiodic) - error->all(FLERR,"Cannot use fix wall/reflect in periodic dimension"); + error->all(FLERR,"Cannot use fix wall/reflect in periodic dimension z"); } for (int m = 0; m < nwall; m++) @@ -170,9 +170,9 @@ void FixWallReflect::init() if (wallstyle[m] != VARIABLE) continue; varindex[m] = input->variable->find(varstr[m]); if (varindex[m] < 0) - error->all(FLERR,"Variable name for fix wall/reflect does not exist"); + error->all(FLERR,"Variable {} for fix wall/reflect does not exist", varstr[m]); if (!input->variable->equalstyle(varindex[m])) - error->all(FLERR,"Variable for fix wall/reflect is invalid style"); + error->all(FLERR,"Variable {} for fix wall/reflect is invalid style", varstr[m]); } int nrigid = 0; diff --git a/src/minimize.cpp b/src/minimize.cpp index e9c6ec25b3..f4743d1815 100644 --- a/src/minimize.cpp +++ b/src/minimize.cpp @@ -31,7 +31,7 @@ Minimize::Minimize(LAMMPS *lmp) : Command(lmp) {} void Minimize::command(int narg, char **arg) { - if (narg != 4) error->all(FLERR, "Illegal minimize command"); + if (narg != 4) error->all(FLERR,"Illegal minimize command: expected 4 arguments but found {}", narg); if (domain->box_exist == 0) error->all(FLERR, "Minimize command before simulation box is defined"); @@ -44,7 +44,8 @@ void Minimize::command(int narg, char **arg) update->nsteps = utils::inumeric(FLERR, arg[2], false, lmp); update->max_eval = utils::inumeric(FLERR, arg[3], false, lmp); - if (update->etol < 0.0 || update->ftol < 0.0) error->all(FLERR, "Illegal minimize command"); + if (update->etol < 0.0) error->all(FLERR, "Illegal minimize energy tolerance: {}", update->etol); + if (update->ftol < 0.0) error->all(FLERR, "Illegal minimize force tolerance: {}", update->ftol); if (lmp->citeme) lmp->citeme->flush(); update->whichflag = 2; diff --git a/src/molecule.cpp b/src/molecule.cpp index 816b2686ab..702bee45af 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -1671,64 +1671,48 @@ int Molecule::findfragment(const char *name) /* ---------------------------------------------------------------------- error check molecule attributes and topology against system settings - flag = 0, just check this molecule - flag = 1, check all molecules in set, this is 1st molecule in set ------------------------------------------------------------------------- */ -void Molecule::check_attributes(int flag) +void Molecule::check_attributes() { - int n = 1; - if (flag) n = nset; - int imol = atom->find_molecule(id); + // check per-atom attributes of molecule + // warn if not a match - for (int i = imol; i < imol+n; i++) { - Molecule *onemol = atom->molecules[imol]; + int mismatch = 0; + if (qflag && !atom->q_flag) mismatch = 1; + if (radiusflag && !atom->radius_flag) mismatch = 1; + if (rmassflag && !atom->rmass_flag) mismatch = 1; - // check per-atom attributes of molecule - // warn if not a match + if (mismatch && me == 0) + error->warning(FLERR,"Molecule attributes do not match system attributes"); - int mismatch = 0; - if (onemol->qflag && !atom->q_flag) mismatch = 1; - if (onemol->radiusflag && !atom->radius_flag) mismatch = 1; - if (onemol->rmassflag && !atom->rmass_flag) mismatch = 1; + // for all atom styles, check nbondtype,etc - if (mismatch && me == 0) - error->warning(FLERR,"Molecule attributes do not match system attributes"); + mismatch = 0; + if (atom->nbondtypes < nbondtypes) mismatch = 1; + if (atom->nangletypes < nangletypes) mismatch = 1; + if (atom->ndihedraltypes < ndihedraltypes) mismatch = 1; + if (atom->nimpropertypes < nimpropertypes) mismatch = 1; - // for all atom styles, check nbondtype,etc + if (mismatch) error->all(FLERR,"Molecule topology type exceeds system topology type"); - mismatch = 0; - if (atom->nbondtypes < onemol->nbondtypes) mismatch = 1; - if (atom->nangletypes < onemol->nangletypes) mismatch = 1; - if (atom->ndihedraltypes < onemol->ndihedraltypes) mismatch = 1; - if (atom->nimpropertypes < onemol->nimpropertypes) mismatch = 1; + // for molecular atom styles, check bond_per_atom,etc + maxspecial + // do not check for atom style template, since nothing stored per atom - if (mismatch) - error->all(FLERR,"Molecule topology type exceeds system topology type"); + if (atom->molecular == Atom::MOLECULAR) { + if (atom->avec->bonds_allow && atom->bond_per_atom < bond_per_atom) mismatch = 1; + if (atom->avec->angles_allow && atom->angle_per_atom < angle_per_atom) mismatch = 1; + if (atom->avec->dihedrals_allow && atom->dihedral_per_atom < dihedral_per_atom) mismatch = 1; + if (atom->avec->impropers_allow && atom->improper_per_atom < improper_per_atom) mismatch = 1; + if (atom->maxspecial < maxspecial) mismatch = 1; - // for molecular atom styles, check bond_per_atom,etc + maxspecial - // do not check for atom style template, since nothing stored per atom - - if (atom->molecular == Atom::MOLECULAR) { - if (atom->avec->bonds_allow && - atom->bond_per_atom < onemol->bond_per_atom) mismatch = 1; - if (atom->avec->angles_allow && - atom->angle_per_atom < onemol->angle_per_atom) mismatch = 1; - if (atom->avec->dihedrals_allow && - atom->dihedral_per_atom < onemol->dihedral_per_atom) mismatch = 1; - if (atom->avec->impropers_allow && - atom->improper_per_atom < onemol->improper_per_atom) mismatch = 1; - if (atom->maxspecial < onemol->maxspecial) mismatch = 1; - - if (mismatch) - error->all(FLERR,"Molecule topology/atom exceeds system topology/atom"); - } - - // warn if molecule topology defined but no special settings - - if (onemol->bondflag && !onemol->specialflag) - if (me == 0) error->warning(FLERR,"Molecule has bond topology but no special bond settings"); + if (mismatch) error->all(FLERR,"Molecule topology/atom exceeds system topology/atom"); } + + // warn if molecule topology defined but no special settings + + if (bondflag && !specialflag) + if (me == 0) error->warning(FLERR,"Molecule has bond topology but no special bond settings"); } /* ---------------------------------------------------------------------- diff --git a/src/molecule.h b/src/molecule.h index 69106e5a34..b4a8e642cc 100644 --- a/src/molecule.h +++ b/src/molecule.h @@ -125,7 +125,7 @@ class Molecule : protected Pointers { void compute_com(); void compute_inertia(); int findfragment(const char *); - void check_attributes(int); + void check_attributes(); private: int me; diff --git a/src/neighbor.cpp b/src/neighbor.cpp index b6b095ddf4..23f0cc6c7d 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -68,24 +68,23 @@ enum{NONE,ALL,PARTIAL,TEMPLATE}; static const char cite_neigh_multi_old[] = "neighbor multi/old command: doi:10.1016/j.cpc.2008.03.005\n\n" "@Article{Intveld08,\n" - " author = {P.{\\,}J.~in{\\,}'t~Veld and S.{\\,}J.~Plimpton" - " and G.{\\,}S.~Grest},\n" + " author = {in 't Veld, P. J. and S. J. Plimpton and G. S. Grest},\n" " title = {Accurate and Efficient Methods for Modeling Colloidal\n" " Mixtures in an Explicit Solvent using Molecular Dynamics},\n" - " journal = {Comp.~Phys.~Comm.},\n" + " journal = {Comput.\\ Phys.\\ Commun.},\n" " year = 2008,\n" " volume = 179,\n" + " number = 5,\n" " pages = {320--329}\n" "}\n\n"; static const char cite_neigh_multi[] = "neighbor multi command: doi:10.1016/j.cpc.2008.03.005, doi:10.1007/s40571-020-00361-2\n\n" "@Article{Intveld08,\n" - " author = {P.{\\,}J.~in{\\,}'t~Veld and S.{\\,}J.~Plimpton" - " and G.{\\,}S.~Grest},\n" + " author = {in 't Veld, P. J. and S. J.~Plimpton and G. S. Grest},\n" " title = {Accurate and Efficient Methods for Modeling Colloidal\n" " Mixtures in an Explicit Solvent using Molecular Dynamics},\n" - " journal = {Comp.~Phys.~Comm.},\n" + " journal = {Comput.\\ Phys.\\ Commut.},\n" " year = 2008,\n" " volume = 179,\n" " pages = {320--329}\n" @@ -97,8 +96,8 @@ static const char cite_neigh_multi[] = "}\n\n" "@article{Shire2020,\n" " author = {Shire, Tom and Hanley, Kevin J. and Stratford, Kevin},\n" - " title = {DEM simulations of polydisperse media: efficient contact\n" - " detection applied to investigate the quasi-static limit},\n" + " title = {{DEM} Simulations of Polydisperse Media: Efficient Contact\n" + " Detection Applied to Investigate the Quasi-Static Limit},\n" " journal = {Computational Particle Mechanics},\n" " year = {2020}\n" "}\n\n"; @@ -1164,7 +1163,6 @@ void Neighbor::morph_unique() if (irq->cutoff != cutneighmax) { irq->unique = 1; - } else { irq->cut = 0; irq->cutoff = 0.0; @@ -1808,7 +1806,6 @@ void Neighbor::print_pairwise_info() out += " "; if (lists[i]->bin_method == 0) out += "bin: none\n"; else out += fmt::format("bin: {}\n",binnames[lists[i]->bin_method-1]); - } utils::logmesg(lmp,out); } @@ -2582,60 +2579,58 @@ void Neighbor::modify_params(int narg, char **arg) int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg],"every") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "neigh_modify every", error); every = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (every <= 0) error->all(FLERR,"Illegal neigh_modify command"); + if (every <= 0) error->all(FLERR, "Invalid neigh_modify every argument: {}", every); iarg += 2; } else if (strcmp(arg[iarg],"delay") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "neigh_modify delay", error); delay = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (delay < 0) error->all(FLERR,"Illegal neigh_modify command"); + if (delay < 0) error->all(FLERR, "Invalid neigh_modify delay argument: {}", delay); iarg += 2; } else if (strcmp(arg[iarg],"check") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "neigh_modify check", error); dist_check = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"once") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "neigh_modify once", error); build_once = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"page") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "neigh_modify page", error); old_pgsize = pgsize; pgsize = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"one") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "neigh_modify one", error); old_oneatom = oneatom; oneatom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"binsize") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "neigh_modify binsize", error); binsize_user = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (binsize_user <= 0.0) binsizeflag = 0; else binsizeflag = 1; iarg += 2; } else if (strcmp(arg[iarg],"cluster") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "neigh_modify cluster", error); cluster_check = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; - } else if (strcmp(arg[iarg],"include") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "neigh_modify include", error); includegroup = group->find(arg[iarg+1]); if (includegroup < 0) - error->all(FLERR,"Invalid group ID in neigh_modify command"); - if (includegroup && (atom->firstgroupname == nullptr || - strcmp(arg[iarg+1],atom->firstgroupname) != 0)) - error->all(FLERR, - "Neigh_modify include group != atom_modify first group"); + error->all(FLERR, "Invalid include keyword: group {} not found", arg[iarg+1]); + if (atom->firstgroupname == nullptr) + error->all(FLERR, "Invalid include keyword: atom_modify first command must be used"); + if (strcmp(arg[iarg+1],atom->firstgroupname) != 0) + error->all(FLERR, "Neigh_modify include group != atom_modify first group: {}", atom->firstgroupname); iarg += 2; - } else if (strcmp(arg[iarg],"exclude") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "neigh_modify exclude", error); if (strcmp(arg[iarg+1],"type") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "neigh_modify exclude type", error); if (nex_type == maxex_type) { maxex_type += EXDELTA; memory->grow(ex1_type,maxex_type,"neigh:ex1_type"); @@ -2645,9 +2640,8 @@ void Neighbor::modify_params(int narg, char **arg) ex2_type[nex_type] = utils::inumeric(FLERR,arg[iarg+3],false,lmp); nex_type++; iarg += 4; - } else if (strcmp(arg[iarg+1],"group") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "neigh_modify exclude group", error); if (nex_group == maxex_group) { maxex_group += EXDELTA; memory->grow(ex1_group,maxex_group,"neigh:ex1_group"); @@ -2655,14 +2649,15 @@ void Neighbor::modify_params(int narg, char **arg) } ex1_group[nex_group] = group->find(arg[iarg+2]); ex2_group[nex_group] = group->find(arg[iarg+3]); - if (ex1_group[nex_group] == -1 || ex2_group[nex_group] == -1) - error->all(FLERR,"Invalid group ID in neigh_modify command"); + if (ex1_group[nex_group] == -1) + error->all(FLERR, "Invalid exclude group keyword: group {} not found", arg[iarg+2]); + if (ex2_group[nex_group] == -1) + error->all(FLERR, "Invalid exclude group keyword: group {} not found", arg[iarg+3]); nex_group++; iarg += 4; - } else if (strcmp(arg[iarg+1],"molecule/inter") == 0 || strcmp(arg[iarg+1],"molecule/intra") == 0) { - if (iarg+3 > narg) error->all(FLERR,"Illegal neigh_modify command"); + if (iarg+3 > narg) utils::missing_cmd_args(FLERR, "neigh_modify exclude molecule", error); if (atom->molecule_flag == 0) error->all(FLERR,"Neigh_modify exclude molecule " "requires atom attribute molecule"); @@ -2676,30 +2671,28 @@ void Neighbor::modify_params(int narg, char **arg) } ex_mol_group[nex_mol] = group->find(arg[iarg+2]); if (ex_mol_group[nex_mol] == -1) - error->all(FLERR,"Invalid group ID in neigh_modify command"); + error->all(FLERR, "Invalid exclude keyword:group {} not found", arg[iarg+2]); if (strcmp(arg[iarg+1],"molecule/intra") == 0) ex_mol_intra[nex_mol] = 1; else ex_mol_intra[nex_mol] = 0; nex_mol++; iarg += 3; - } else if (strcmp(arg[iarg+1],"none") == 0) { nex_type = nex_group = nex_mol = 0; iarg += 2; - - } else error->all(FLERR,"Illegal neigh_modify command"); + } else error->all(FLERR,"Unknown neigh_modify exclude keyword: {}", arg[iarg+1]); } else if (strcmp(arg[iarg],"collection/interval") == 0) { if (style != Neighbor::MULTI) error->all(FLERR,"Cannot use collection/interval command without multi setting"); if (iarg+2 > narg) - error->all(FLERR,"Invalid collection/interval command"); + utils::missing_cmd_args(FLERR, "neigh_modify collection/interval", error); ncollections = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (ncollections < 1) - error->all(FLERR,"Invalid collection/interval command"); - if (iarg+1+ncollections > narg) - error->all(FLERR,"Invalid collection/interval command"); + error->all(FLERR, "Invalid collection/interval keyword: illegal number of custom collections: {}", ncollections); + if (iarg+2+ncollections > narg) + error->all(FLERR, "Invalid collection/interval keyword: expected {} separate lists of types", ncollections); int i; @@ -2728,12 +2721,12 @@ void Neighbor::modify_params(int narg, char **arg) error->all(FLERR,"Cannot use collection/type command without multi setting"); if (iarg+2 > narg) - error->all(FLERR,"Invalid collection/type command"); + utils::missing_cmd_args(FLERR, "neigh_modify collection/type", error); ncollections = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (ncollections < 1) - error->all(FLERR,"Invalid collection/interval command"); - if (iarg+1+ncollections > narg) - error->all(FLERR,"Invalid collection/type command"); + error->all(FLERR, "Invalid collection/type keyword: illegal number of custom collections: {}", ncollections); + if (iarg+2+ncollections > narg) + error->all(FLERR, "Invalid collection/type keyword: expected {} separate lists of types", ncollections); int ntypes = atom->ntypes; int nlo, nhi, i, k; @@ -2774,7 +2767,7 @@ void Neighbor::modify_params(int narg, char **arg) } iarg += 2 + ncollections; - } else error->all(FLERR,"Illegal neigh_modify command"); + } else error->all(FLERR,"Unknown neigh_modify keyword: {}", arg[iarg]); } } @@ -2818,7 +2811,6 @@ void Neighbor::exclusion_group_group_delete(int group1, int group2) nex_group--; } - /* ---------------------------------------------------------------------- return the value of exclude - used to check compatibility with GPU ------------------------------------------------------------------------- */ @@ -2881,7 +2873,6 @@ void Neighbor::build_collection(int istart) } } - /* ---------------------------------------------------------------------- for neighbor list statistics in Finish class ------------------------------------------------------------------------- */ diff --git a/src/read_data.cpp b/src/read_data.cpp index 1ec8210e5e..74bb7e73d3 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -866,7 +866,10 @@ void ReadData::command(int narg, char **arg) // insure nbondtypes,etc are still consistent with template molecules, // in case data file re-defined them - if (atom->molecular == Atom::TEMPLATE) atom->avec->onemols[0]->check_attributes(1); + if (atom->molecular == Atom::TEMPLATE) { + int nset = MAX(1, atom->avec->onemols[0]->nset); + for (int i = 0; i < nset; ++i) atom->avec->onemols[i]->check_attributes(); + } // if adding atoms, migrate atoms to new processors // use irregular() b/c box size could have changed dramaticaly diff --git a/src/region.cpp b/src/region.cpp index b533d45ea7..b61a5f8905 100644 --- a/src/region.cpp +++ b/src/region.cpp @@ -302,7 +302,7 @@ void Region::rotate(double &x, double &y, double &z, double angle) void Region::options(int narg, char **arg) { - if (narg < 0) error->all(FLERR, "Illegal region command"); + if (narg < 0) utils::missing_cmd_args(FLERR, "region", error); // option defaults @@ -316,46 +316,46 @@ void Region::options(int narg, char **arg) int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg], "units") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal region command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "region units", error); if (strcmp(arg[iarg + 1], "box") == 0) scaleflag = 0; else if (strcmp(arg[iarg + 1], "lattice") == 0) scaleflag = 1; else - error->all(FLERR, "Illegal region command"); + error->all(FLERR, "Illegal region units: {}", arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg], "side") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal region command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "region side", error); if (strcmp(arg[iarg + 1], "in") == 0) interior = 1; else if (strcmp(arg[iarg + 1], "out") == 0) interior = 0; else - error->all(FLERR, "Illegal region command"); + error->all(FLERR, "Illegal region side: {}", arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg], "move") == 0) { - if (iarg + 4 > narg) error->all(FLERR, "Illegal region command"); + if (iarg + 4 > narg) utils::missing_cmd_args(FLERR, "region move", error); if (strcmp(arg[iarg + 1], "NULL") != 0) { if (strstr(arg[iarg + 1], "v_") != arg[iarg + 1]) - error->all(FLERR, "Illegal region command"); + error->all(FLERR, "Illegal region move x displacement variable: {}", arg[iarg+1]); xstr = utils::strdup(&arg[iarg + 1][2]); } if (strcmp(arg[iarg + 2], "NULL") != 0) { if (strstr(arg[iarg + 2], "v_") != arg[iarg + 2]) - error->all(FLERR, "Illegal region command"); + error->all(FLERR, "Illegal region move y displacement variable: {}", arg[iarg+2]); ystr = utils::strdup(&arg[iarg + 2][2]); } if (strcmp(arg[iarg + 3], "NULL") != 0) { if (strstr(arg[iarg + 3], "v_") != arg[iarg + 3]) - error->all(FLERR, "Illegal region command"); + error->all(FLERR, "Illegal region move z displacement variable: {}", arg[iarg+3]); zstr = utils::strdup(&arg[iarg + 3][2]); } moveflag = 1; iarg += 4; } else if (strcmp(arg[iarg], "rotate") == 0) { - if (iarg + 8 > narg) error->all(FLERR, "Illegal region command"); + if (iarg + 8 > narg) utils::missing_cmd_args(FLERR, "region rotate", error); if (strstr(arg[iarg + 1], "v_") != arg[iarg + 1]) error->all(FLERR, "Illegal region command"); tstr = utils::strdup(&arg[iarg + 1][2]); point[0] = utils::numeric(FLERR, arg[iarg + 2], false, lmp); @@ -368,15 +368,14 @@ void Region::options(int narg, char **arg) iarg += 8; } else if (strcmp(arg[iarg], "open") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal region command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "region open", error); int iface = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); - if (iface < 1 || iface > 6) error->all(FLERR, "Illegal region command"); + if (iface < 1 || iface > 6) error->all(FLERR, "Illegal region open face index: {}", iface); // additional checks on valid face index are done by region classes open_faces[iface - 1] = 1; openflag = 1; iarg += 2; - } else - error->all(FLERR, "Illegal region command"); + } else error->all(FLERR, "Illegal region command argument: {}", arg[iarg]); } // error check diff --git a/src/region_block.cpp b/src/region_block.cpp index 36dad4ce84..76c27fbd55 100644 --- a/src/region_block.cpp +++ b/src/region_block.cpp @@ -80,8 +80,9 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) // error check - if (xlo > xhi || ylo > yhi || zlo > zhi) - error->all(FLERR,"Illegal region block command"); + if (xlo > xhi) error->all(FLERR,"Illegal region block xlo: {} >= xhi: {}", xlo, xhi); + if (ylo > yhi) error->all(FLERR,"Illegal region block ylo: {} >= yhi: {}", ylo, yhi); + if (zlo > zhi) error->all(FLERR,"Illegal region block zlo: {} >= zhi: {}", zlo, zhi); // extent of block diff --git a/src/region_cone.cpp b/src/region_cone.cpp index b838154034..84da1bae56 100644 --- a/src/region_cone.cpp +++ b/src/region_cone.cpp @@ -37,11 +37,12 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) : // check open face settings - if (openflag && (open_faces[3] || open_faces[4] || open_faces[5])) - error->all(FLERR,"Invalid region cone open setting"); + if (openflag) + for (int i=3; i<6; i++) + if (open_faces[i]) error->all(FLERR,"Illegal region cone open face: {}", i+1); - if (strcmp(arg[2],"x") != 0 && strcmp(arg[2],"y") && strcmp(arg[2],"z") != 0) - error->all(FLERR,"Illegal region cylinder command"); + if (strcmp(arg[2],"x") != 0 && strcmp(arg[2],"y") != 0 && strcmp(arg[2],"z") != 0) + error->all(FLERR,"Illegal region cone axis: {}", arg[2]); axis = arg[2][0]; if (axis == 'x') { diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index c37bcb4be0..0f7df1e3af 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -37,11 +37,12 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : // check open face settings - if (openflag && (open_faces[3] || open_faces[4] || open_faces[5])) - error->all(FLERR,"Invalid region cylinder open setting"); + if (openflag) + for (int i=3; i<6; i++) + if (open_faces[i]) error->all(FLERR,"Illegal region cylinder open face: {}", i+1); - if (strcmp(arg[2],"x") != 0 && strcmp(arg[2],"y") && strcmp(arg[2],"z") != 0) - error->all(FLERR,"Illegal region cylinder command"); + if (strcmp(arg[2],"x") != 0 && strcmp(arg[2],"y") != 0 && strcmp(arg[2],"z") != 0) + error->all(FLERR,"Illegal region cylinder axis: {}", arg[2]); axis = arg[2][0]; if (axis == 'x') { @@ -170,7 +171,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : // error check - if (radius <= 0.0) error->all(FLERR,"Illegal region cylinder command"); + if (radius <= 0.0) error->all(FLERR,"Illegal radius {} in region cylinder command", radius); // extent of cylinder // for variable radius, uses initial radius diff --git a/src/region_ellipsoid.cpp b/src/region_ellipsoid.cpp index 13b9736f5a..ee622aad85 100644 --- a/src/region_ellipsoid.cpp +++ b/src/region_ellipsoid.cpp @@ -101,7 +101,9 @@ RegEllipsoid::RegEllipsoid(LAMMPS *lmp, int narg, char **arg) : // error check - if (a < 0.0 || b < 0.0 || c < 0.0) error->all(FLERR, "Illegal region ellipsoid command"); + if (a < 0.0) error->all(FLERR, "Illegal region ellipsoid a: {}", a); + if (b < 0.0) error->all(FLERR, "Illegal region ellipsoid b: {}", b); + if (c < 0.0) error->all(FLERR, "Illegal region ellipsoid c: {}", c); // extent of ellipsoid // for variable axes, uses initial axes and origin for variable center diff --git a/src/region_intersect.cpp b/src/region_intersect.cpp index 682dd269c0..9dd624e7be 100644 --- a/src/region_intersect.cpp +++ b/src/region_intersect.cpp @@ -27,9 +27,9 @@ RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) : { nregion = 0; - if (narg < 5) error->all(FLERR, "Illegal region command"); + if (narg < 5) utils::missing_cmd_args(FLERR, "region intersect", error);; int n = utils::inumeric(FLERR, arg[2], false, lmp); - if (n < 2) error->all(FLERR, "Illegal region command"); + if (n < 2) error->all(FLERR, "Illegal region intersect n: {}", n); options(narg - (n + 3), &arg[n + 3]); // build list of regions to intersect diff --git a/src/region_plane.cpp b/src/region_plane.cpp index 2e99e4a0f9..a5163796d0 100644 --- a/src/region_plane.cpp +++ b/src/region_plane.cpp @@ -37,7 +37,7 @@ RegPlane::RegPlane(LAMMPS *lmp, int narg, char **arg) : // enforce unit normal double rsq = normal[0]*normal[0] + normal[1]*normal[1] + normal[2]*normal[2]; - if (rsq == 0.0) error->all(FLERR,"Illegal region plane command"); + if (rsq == 0.0) error->all(FLERR,"Illegal region plane normal vector: {} {} {}", normal[0], normal[1], normal[2]); normal[0] /= sqrt(rsq); normal[1] /= sqrt(rsq); normal[2] /= sqrt(rsq); diff --git a/src/region_prism.cpp b/src/region_prism.cpp index 375bd5ddab..f83da54e34 100644 --- a/src/region_prism.cpp +++ b/src/region_prism.cpp @@ -84,23 +84,24 @@ RegPrism::RegPrism(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) // prism cannot be 0 thickness in any dim, else inverse blows up // non-zero tilt values cannot be used if either dim is INF on both ends - if (xlo >= xhi || ylo >= yhi || zlo >= zhi) - error->all(FLERR,"Illegal region prism command"); + if (xlo >= xhi) error->all(FLERR,"Illegal region prism xlo: {} >= xhi: {}", xlo, xhi); + if (ylo >= yhi) error->all(FLERR,"Illegal region prism ylo: {} >= yhi: {}", ylo, yhi); + if (zlo >= zhi) error->all(FLERR,"Illegal region prism zlo: {} >= zhi: {}", zlo ,zhi); if (xy != 0.0 && xlo == -BIG && xhi == BIG) - error->all(FLERR,"Illegal region prism command"); + error->all(FLERR,"Illegal region prism non-zero xy tilt with infinite x size"); if (xy != 0.0 && ylo == -BIG && yhi == BIG) - error->all(FLERR,"Illegal region prism command"); + error->all(FLERR,"Illegal region prism non-zero xy tilt with infinite y size"); if (xz != 0.0 && xlo == -BIG && xhi == BIG) - error->all(FLERR,"Illegal region prism command"); + error->all(FLERR,"Illegal region prism non-zero xz tilt with infinite x size"); if (xz != 0.0 && zlo == -BIG && zhi == BIG) - error->all(FLERR,"Illegal region prism command"); + error->all(FLERR,"Illegal region prism non-zero xz tilt with infinite z size"); if (yz != 0.0 && ylo == -BIG && yhi == BIG) - error->all(FLERR,"Illegal region prism command"); + error->all(FLERR,"Illegal region prism non-zero yz tilt with infinite y size"); if (yz != 0.0 && zlo == -BIG && zhi == BIG) - error->all(FLERR,"Illegal region prism command"); + error->all(FLERR,"Illegal region prism non-zero yz tilt with infinite z size"); // extent of prism diff --git a/src/region_sphere.cpp b/src/region_sphere.cpp index b2c844c986..bbe8400f90 100644 --- a/src/region_sphere.cpp +++ b/src/region_sphere.cpp @@ -79,7 +79,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : // error check - if (radius < 0.0) error->all(FLERR,"Illegal region sphere command"); + if (radius < 0.0) error->all(FLERR,"Illegal region sphere radius: {}", radius); // extent of sphere // for variable radius, uses initial radius and origin for variable center diff --git a/src/region_union.cpp b/src/region_union.cpp index f4b26ade4d..ebd1197d86 100644 --- a/src/region_union.cpp +++ b/src/region_union.cpp @@ -28,9 +28,9 @@ RegUnion::RegUnion(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg), { nregion = 0; - if (narg < 5) error->all(FLERR, "Illegal region command"); + if (narg < 5) utils::missing_cmd_args(FLERR, "region union", error);; int n = utils::inumeric(FLERR, arg[2], false, lmp); - if (n < 2) error->all(FLERR, "Illegal region command"); + if (n < 2) error->all(FLERR, "Illegal region union n: {}", n); options(narg - (n + 3), &arg[n + 3]); // build list of region indices to union diff --git a/src/thermo.cpp b/src/thermo.cpp index c3cd5adcf5..c4a914e3a3 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -498,14 +498,14 @@ bigint Thermo::lost_check() void Thermo::modify_params(int narg, char **arg) { - if (narg == 0) error->all(FLERR, "Illegal thermo_modify command"); + if (narg == 0) utils::missing_cmd_args(FLERR, "thermo_modify", error); modified = 1; int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg], "temp") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "thermo_modify temp", error); if (index_temp < 0) error->all(FLERR, "Thermo style does not use temp"); delete[] id_compute[index_temp]; id_compute[index_temp] = utils::strdup(arg[iarg + 1]); @@ -540,7 +540,7 @@ void Thermo::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg], "press") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "thermo_modify press", error); if (index_press_scalar < 0 && index_press_vector < 0) error->all(FLERR, "Thermo style does not use press"); @@ -563,7 +563,7 @@ void Thermo::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg], "lost") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "thermo_modify lost", error); if (strcmp(arg[iarg + 1], "ignore") == 0) lostflag = Thermo::IGNORE; else if (strcmp(arg[iarg + 1], "warn") == 0) @@ -571,11 +571,11 @@ void Thermo::modify_params(int narg, char **arg) else if (strcmp(arg[iarg + 1], "error") == 0) lostflag = Thermo::ERROR; else - error->all(FLERR, "Illegal thermo_modify command"); + error->all(FLERR, "Unknown thermo_modify lost argument: {}", arg[iarg + 1]); iarg += 2; } else if (strcmp(arg[iarg], "lost/bond") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "thermo_modify lost/bond", error); if (strcmp(arg[iarg + 1], "ignore") == 0) lostbond = Thermo::IGNORE; else if (strcmp(arg[iarg + 1], "warn") == 0) @@ -583,11 +583,11 @@ void Thermo::modify_params(int narg, char **arg) else if (strcmp(arg[iarg + 1], "error") == 0) lostbond = Thermo::ERROR; else - error->all(FLERR, "Illegal thermo_modify command"); + error->all(FLERR, "Unknown thermo_modify lost/bond argument: {}", arg[iarg + 1]); iarg += 2; } else if (strcmp(arg[iarg], "warn") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "thermo_modify warn", error); if (strcmp(arg[iarg + 1], "ignore") == 0) error->set_maxwarn(-1); else if (strcmp(arg[iarg + 1], "always") == 0) @@ -604,18 +604,18 @@ void Thermo::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg], "norm") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "thermo_modify norm", error); normuserflag = 1; normuser = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "flush") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "thermo_modify flush", error); flushflag = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "line") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "thermo_modify line", error); if (strcmp(arg[iarg + 1], "one") == 0) lineflag = ONELINE; else if (strcmp(arg[iarg + 1], "multi") == 0) @@ -623,16 +623,16 @@ void Thermo::modify_params(int narg, char **arg) else if (strcmp(arg[iarg + 1], "yaml") == 0) lineflag = YAMLLINE; else - error->all(FLERR, "Illegal thermo_modify command"); + error->all(FLERR, "Unknown thermo_modify line argument: {}", arg[iarg + 1]); iarg += 2; } else if (strcmp(arg[iarg], "colname") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "thermo_modify colname", error); if (strcmp(arg[iarg + 1], "default") == 0) { for (auto item : keyword_user) item.clear(); iarg += 2; } else { - if (iarg + 3 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (iarg + 3 > narg) utils::missing_cmd_args(FLERR, "thermo_modify colname", error); int icol = -1; if (utils::is_integer(arg[iarg + 1])) { icol = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); @@ -646,12 +646,12 @@ void Thermo::modify_params(int narg, char **arg) } } if ((icol < 0) || (icol >= nfield_initial)) - error->all(FLERR, "Illegal thermo_modify command"); + error->all(FLERR, "Invalid thermo_modify colname argument: {}", arg[iarg + 1]); keyword_user[icol] = arg[iarg + 2]; iarg += 3; } } else if (strcmp(arg[iarg], "format") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "thermo_modify format", error); if (strcmp(arg[iarg + 1], "none") == 0) { format_line_user.clear(); @@ -663,7 +663,7 @@ void Thermo::modify_params(int narg, char **arg) continue; } - if (iarg + 3 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (iarg + 3 > narg) utils::missing_cmd_args(FLERR, "thermo_modify format", error); if (strcmp(arg[iarg + 1], "line") == 0) { format_line_user = arg[iarg + 2]; @@ -692,13 +692,13 @@ void Thermo::modify_params(int narg, char **arg) } } if (icol < 0 || icol >= nfield_initial + 1) - error->all(FLERR, "Illegal thermo_modify command"); + error->all(FLERR, "Invalid thermo_modify format argument: {}", arg[iarg + 1]); format_column_user[icol] = arg[iarg + 2]; } iarg += 3; } else - error->all(FLERR, "Illegal thermo_modify command"); + error->all(FLERR, "Unknown thermo_modify keyword: {}", arg[iarg]); } } diff --git a/src/velocity.cpp b/src/velocity.cpp index 34b8d5a700..e11317dd09 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -49,7 +49,7 @@ Velocity::Velocity(LAMMPS *lmp) : Command(lmp), rigid_fix(nullptr), temperature( void Velocity::command(int narg, char **arg) { - if (narg < 2) error->all(FLERR,"Illegal velocity command"); + if (narg < 2) utils::missing_cmd_args(FLERR, "velocity", error); if (domain->box_exist == 0) error->all(FLERR,"Velocity command before simulation box is defined"); @@ -63,7 +63,7 @@ void Velocity::command(int narg, char **arg) // identify group igroup = group->find(arg[0]); - if (igroup == -1) error->all(FLERR,"Could not find velocity group ID"); + if (igroup == -1) error->all(FLERR, "Could not find velocity group ID {}", arg[0]); groupbit = group->bitmask[igroup]; // check if velocities of atoms in rigid bodies are updated @@ -79,7 +79,7 @@ void Velocity::command(int narg, char **arg) else if (strcmp(arg[1],"scale") == 0) style = SCALE; else if (strcmp(arg[1],"ramp") == 0) style = RAMP; else if (strcmp(arg[1],"zero") == 0) style = ZERO; - else error->all(FLERR,"Illegal velocity command"); + else error->all(FLERR,"Unknown velocity keyword: {}", arg[1]); // set defaults @@ -163,7 +163,7 @@ void Velocity::create(double t_desired, int seed) int i; double **vhold; - if (seed <= 0) error->all(FLERR,"Illegal velocity create command"); + if (seed <= 0) error->all(FLERR, "Illegal velocity create seed argument: {}", seed); // if sum_flag set, store a copy of current velocities @@ -816,58 +816,58 @@ void Velocity::zero_rotation() void Velocity::options(int narg, char **arg) { - if (narg < 0) error->all(FLERR,"Illegal velocity command"); + if (narg < 0) utils::missing_cmd_args(FLERR, "velocity", error); int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg],"dist") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "velocity dist", error); if (strcmp(arg[iarg+1],"uniform") == 0) dist_flag = UNIFORM; else if (strcmp(arg[iarg+1],"gaussian") == 0) dist_flag = GAUSSIAN; - else error->all(FLERR,"Illegal velocity command"); + else error->all(FLERR,"Unknown velocity dist argument: {}", arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"sum") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "velocity sum", error); sum_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"mom") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "velocity mom", error); momentum_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"rot") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "velocity rot", error); rotation_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"temp") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "velocity temp", error); temperature = modify->get_compute_by_id(arg[iarg+1]); - if (!temperature) error->all(FLERR,"Could not find velocity temperature compute ID"); + if (!temperature) error->all(FLERR,"Could not find velocity temperature compute ID: {}", arg[iarg+1]); if (temperature->tempflag == 0) error->all(FLERR,"Velocity temperature compute {} does not compute temperature", arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"bias") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "velocity bias", error); bias_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"loop") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "velocity loop", error); if (strcmp(arg[iarg+1],"all") == 0) loop_flag = ALL; else if (strcmp(arg[iarg+1],"local") == 0) loop_flag = LOCAL; else if (strcmp(arg[iarg+1],"geom") == 0) loop_flag = GEOM; - else error->all(FLERR,"Illegal velocity command"); + else error->all(FLERR,"Unknown velocity loop argument: {}", arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"rigid") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "velocity rigid", error); rigid_fix = modify->get_fix_by_id(arg[iarg+1]); if (!rigid_fix) error->all(FLERR,"Fix ID {} for velocity does not exist", arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"units") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "velocity units", error); if (strcmp(arg[iarg+1],"box") == 0) scale_flag = 0; else if (strcmp(arg[iarg+1],"lattice") == 0) scale_flag = 1; - else error->all(FLERR,"Illegal velocity command"); + else error->all(FLERR,"Unknown velocity units argument: {}", arg[iarg+1]); iarg += 2; - } else error->all(FLERR,"Illegal velocity command"); + } else error->all(FLERR,"Unknown velocity keyword: {}", arg[iarg]); } // error check diff --git a/tools/valgrind/OpenMP.supp b/tools/valgrind/OpenMP.supp index 15531fa8ec..0227818262 100644 --- a/tools/valgrind/OpenMP.supp +++ b/tools/valgrind/OpenMP.supp @@ -81,7 +81,7 @@ obj:* } { - OpnMP_init_part7 + OpenMP_init_part7 Memcheck:Leak match-leak-kinds: reachable fun:malloc @@ -91,7 +91,7 @@ obj:* } { - OpnMP_init_part8 + OpenMP_init_part8 Memcheck:Leak match-leak-kinds: reachable fun:malloc @@ -101,7 +101,7 @@ obj:* } { - OpnMP_init_part9 + OpenMP_init_part9 Memcheck:Leak match-leak-kinds: possible fun:calloc @@ -113,7 +113,7 @@ obj:* } { - OpnMP_init_part10 + OpenMP_init_part10 Memcheck:Leak match-leak-kinds: reachable fun:malloc @@ -124,7 +124,7 @@ obj:* } { - OpnMP_init_part11 + OpenMP_init_part11 Memcheck:Leak match-leak-kinds: possible fun:calloc @@ -135,7 +135,7 @@ obj:* } { - OpnMP_open_part1 + OpenMP_open_part1 Memcheck:Leak match-leak-kinds: reachable fun:malloc @@ -149,7 +149,7 @@ fun:_dl_open } { - OpnMP_open_part2 + OpenMP_open_part2 Memcheck:Leak match-leak-kinds: reachable fun:calloc @@ -162,3 +162,13 @@ ... fun:_dl_open } +{ + OpenMP_team_part1 + Memcheck:Leak + match-leak-kinds: reachable + fun:memalign + fun:gomp_aligned_alloc + fun:gomp_new_team + fun:GOMP_parallel +} + diff --git a/tools/valgrind/README b/tools/valgrind/README index 8a32f7928c..63c440f7b2 100644 --- a/tools/valgrind/README +++ b/tools/valgrind/README @@ -14,5 +14,5 @@ valgrind --show-leak-kinds=all --track-origins=yes \ --suppressions=/path/to/lammps/tools/valgrind/readline.supp \ lmp -in in.melt -Last update: 2021-08-04 +Last update: 2022-08-11 diff --git a/unittest/commands/test_regions.cpp b/unittest/commands/test_regions.cpp index 3b614aa6ad..36d251e542 100644 --- a/unittest/commands/test_regions.cpp +++ b/unittest/commands/test_regions.cpp @@ -77,9 +77,10 @@ TEST_F(RegionTest, NoBox) command("region reg6 union 3 reg1 reg2 reg3"); command("region reg7 intersect 3 reg1 reg2 reg4"); command("region reg8 ellipsoid 0 0 0 2 1 2"); + command("region reg9 cylinder y 0 0 1 0 1 open 1 units box"); END_HIDE_OUTPUT(); list = domain->get_region_list(); - EXPECT_EQ(list.size(), 8); + EXPECT_EQ(list.size(), 9); auto reg = domain->get_region_by_id("reg1"); EXPECT_EQ(reg->interior, 1); @@ -161,21 +162,50 @@ TEST_F(RegionTest, NoBox) EXPECT_EQ(reg->rotateflag, 0); EXPECT_EQ(reg->openflag, 0); + reg = domain->get_region_by_id("reg9"); + EXPECT_EQ(reg->interior, 1); + EXPECT_EQ(reg->scaleflag, 0); + EXPECT_EQ(reg->bboxflag, 1); + EXPECT_EQ(reg->varshape, 0); + EXPECT_EQ(reg->dynamic, 0); + EXPECT_EQ(reg->moveflag, 0); + EXPECT_EQ(reg->rotateflag, 0); + EXPECT_EQ(reg->openflag, 1); + BEGIN_HIDE_OUTPUT(); command("region reg3 delete"); command("region reg5 delete"); command("region reg6 delete"); command("region reg1 delete"); + command("region reg9 delete"); END_HIDE_OUTPUT(); list = domain->get_region_list(); EXPECT_EQ(list.size(), 4); reg = domain->get_region_by_id("reg7"); TEST_FAILURE(".*ERROR: Region intersect region reg1 does not exist.*", reg->init();); + TEST_FAILURE(".*ERROR: Delete region reg3 does not exist.*", command("region reg3 delete");); +} + +TEST_F(RegionTest, DeathTests) +{ + atomic_system(); + + auto list = domain->get_region_list(); + ASSERT_EQ(list.size(), 1); + + TEST_FAILURE(".*ERROR: Illegal region block xlo: 1 >= xhi: 0.*", command("region reg1 block 1 0 0 1 0 1");); + TEST_FAILURE(".*ERROR: Illegal region cone open face: 4.*", command("region reg2 cone x 0 0 2 1 0 1 open 4");); + TEST_FAILURE(".*ERROR: Illegal region plane normal vector: 0 0 0.*", command("region reg3 plane 0 0 0 0 0 0 side out");); + TEST_FAILURE(".*ERROR: Illegal region prism non-zero xy tilt with infinite x size.*", command("region reg4 prism INF INF 0 1 0 1 0.1 0.2 0.3");); + TEST_FAILURE(".*ERROR: Illegal region sphere radius: -1.*", command("region reg5 sphere 0 0 0 -1");); + TEST_FAILURE(".*ERROR: Illegal region ellipsoid c: -2.*", command("region reg8 ellipsoid 0 0 0 2 1 -2");); + TEST_FAILURE(".*ERROR: Illegal region cylinder axis: xx.*", command("region reg9 cylinder xx 0 0 1 0 1 open 1 units box");); TEST_FAILURE(".*ERROR: Unrecognized region style 'xxx'.*", command("region new1 xxx");); - TEST_FAILURE(".*ERROR: Illegal region command.*", command("region new1 block 0 1");); - TEST_FAILURE(".*ERROR: Delete region reg3 does not exist.*", command("region reg3 delete");); + //TEST_FAILURE(".*ERROR: Illegal region command.*", command("region new1 block 0 1");); + TEST_FAILURE(".*ERROR: Illegal region command: missing argument\\(s\\).*", command("region new1 block 0 1");); + TEST_FAILURE(".*ERROR: Delete region new3 does not exist.*", command("region new3 delete");); } TEST_F(RegionTest, Counts) diff --git a/unittest/force-styles/tests/angle-amoeba.yaml b/unittest/force-styles/tests/angle-amoeba.yaml new file mode 100644 index 0000000000..2a0bf8266e --- /dev/null +++ b/unittest/force-styles/tests/angle-amoeba.yaml @@ -0,0 +1,93 @@ +--- +lammps_version: 3 Aug 2022 +date_generated: Thu Aug 11 22:52:48 2022 +epsilon: 7.5e-13 +skip_tests: +prerequisites: ! | + atom full + angle amoeba +pre_commands: ! "" +post_commands: ! "" +input_file: in.fourmol +angle_style: amoeba +angle_coeff: ! | + 1 0 0 110.7 75.2 -60.3209966714 13.8245541012 -9.90110754559 17.8291669244 + 2 0 0 112.8 42.0 -33.6899183537 7.72116053523 -5.52987389514 9.95777939927 + 3 1 0 124.2 77.0 -61.7648503151 14.1554609813 -10.1381021411 18.2559288987 + 4 0 1 108.5 48.7 -39.064262472 8.95286947775 -6.41202044508 11.5462823034 + * ba 0.0 0.0 0.0 0.0 + 3 ba 18.7 18.7 1.345 1.2255 + * ub 0.0 0.0 + 4 ub -7.6 1.5537 +equilibrium: 4 1.9320794819577227 1.9687313962496038 2.1676989309769574 1.8936822384138474 +extract: ! | + k 1 + theta0 1 +natoms: 29 +init_energy: 22.644137017730763 +init_stress: ! |2- + 8.0069830735080359e+01 -3.5631299059590688e+01 7.6225655947646445e+01 8.1736120667827365e+01 7.2013465899412790e+00 8.2262594357983385e+00 +init_forces: ! |2 + 1 2.3382397112473193e+01 2.6204280671595143e+01 -1.5273268962903451e+01 + 2 2.8209513407772366e+00 1.6180653500333166e+00 -4.0635641745598532e+00 + 3 2.8205279228337088e+00 2.5620101328184489e+01 4.3936577797739943e+01 + 4 -1.2638776805162639e+01 -1.3824805898242573e+01 -2.7317073537337189e+00 + 5 -2.5318239676435695e+01 -3.6262174062144588e+01 -9.5374679912363387e+00 + 6 6.3391009949330922e+01 -6.3772237406253097e+01 -5.8208287129770724e+01 + 7 -3.6557895688904566e+01 3.1826217417087904e+01 -1.2670905174746963e+01 + 8 -1.5229551211725893e+01 -2.2958155347116126e+01 1.1237818154548843e+02 + 9 -1.6817328803426232e+01 1.5371106267701142e+01 1.2141766414689670e-02 + 10 1.1424627870708282e+01 6.6710337921066838e+01 -8.8934773100398303e+01 + 11 -2.5989138685150749e+01 -1.2080151842281184e+01 1.3756692094988685e+01 + 12 2.9484036274487888e+00 -2.6956725547118825e+01 1.3659548663471837e+00 + 13 7.6630957609105295e+00 -4.5232010123397659e-01 6.5992987259825964e-01 + 14 1.1757288017944422e+01 9.7442493963408028e-01 -1.0737391586165961e+01 + 15 3.8766112312455707e+00 1.9953781155447081e+00 1.3141163967261480e+01 + 16 7.5673722277475952e-01 1.0089631915364025e+01 6.6009821803335491e+00 + 17 1.7092808143583640e+00 -4.1029737218213205e+00 1.0305741382343113e+01 + 18 2.2622995030459014e-01 2.3640960446027819e+00 -9.5942668204409394e+00 + 19 -2.7700202360114194e+00 -3.4508829432412442e+00 4.1088146046715197e+00 + 20 2.5437902857068293e+00 1.0867868986384621e+00 5.4854522157694205e+00 + 21 4.3865679328137528e+00 5.4912582616909633e+00 -1.6410813967282582e+01 + 22 -7.8112031248549751e+00 -5.3256741299179602e+00 5.8014508405675151e+00 + 23 3.4246351920412228e+00 -1.6558413177300335e-01 1.0609363126715067e+01 + 24 -1.9374085120147231e+00 7.5308216974441722e+00 -4.4835623765578756e+00 + 25 -1.5540790984197876e+00 -5.2067531942101803e+00 8.5153237332029730e-01 + 26 3.4914876104345107e+00 -2.3240685032339918e+00 3.6320300032375781e+00 + 27 -5.9599288325694122e-01 4.8926346836550785e+00 -1.6665937663582100e+00 + 28 -1.3031739154729478e+00 -2.9253781755851911e+00 6.7956287476963473e-02 + 29 1.8991667987298890e+00 -1.9672565080698869e+00 1.5986374788812465e+00 +run_energy: 22.380727842122464 +run_stress: ! |2- + 7.8597987795633571e+01 -3.4887289062092741e+01 7.7347944799275737e+01 8.0647386752920923e+01 6.7873579906334367e+00 7.0294127972048663e+00 +run_forces: ! |2 + 1 2.3157700819473931e+01 2.6395468155142254e+01 -1.4969298818384196e+01 + 2 2.8210244533699114e+00 1.4842855299208813e+00 -4.1994598890465529e+00 + 3 3.1511464912249090e+00 2.5121528571026332e+01 4.3618723572107740e+01 + 4 -1.2695217881113633e+01 -1.3575899068093007e+01 -2.6037244885350384e+00 + 5 -2.5380002626351260e+01 -3.6100629796588883e+01 -9.5049535548234338e+00 + 6 6.3417572946070585e+01 -6.3756617039179083e+01 -5.8243802460052855e+01 + 7 -3.6560702644605783e+01 3.1841587319998514e+01 -1.2689042533225763e+01 + 8 -1.5075539964575132e+01 -2.2832143583680168e+01 1.1220261221784521e+02 + 9 -1.6853170916746738e+01 1.5393757696980394e+01 2.7277430873688946e-02 + 10 1.1482694974719493e+01 6.6222694352494500e+01 -8.8673285934665799e+01 + 11 -2.5960852327589720e+01 -1.1996244977812598e+01 1.3718630701942040e+01 + 12 2.6216265031958366e+00 -2.6923219090449791e+01 1.6509053842148562e+00 + 13 7.6303908784314176e+00 -5.7702019180687059e-01 7.5541387871171439e-01 + 14 1.1763946667622841e+01 1.2422516956395069e+00 -1.0768935951092585e+01 + 15 3.9373239374008793e+00 2.1265452001019347e+00 1.2829156696801157e+01 + 16 8.4306483419547407e-01 1.0025669155875587e+01 6.5412499198499514e+00 + 17 1.6989938552769841e+00 -4.0920139295695144e+00 1.0308533827479888e+01 + 18 2.1106220929605124e-01 2.1200230965597004e+00 -8.5696345630789690e+00 + 19 -2.4682411459671947e+00 -3.0814598821874664e+00 3.6790252036755056e+00 + 20 2.2571789366711434e+00 9.6143678562776613e-01 4.8906093594034639e+00 + 21 4.1571999006730964e+00 5.1675917275108123e+00 -1.5533872925947044e+01 + 22 -7.3767098713413146e+00 -5.0117529432961323e+00 5.5029424676210486e+00 + 23 3.2195099706682182e+00 -1.5583878421468000e-01 1.0030930458325996e+01 + 24 -1.7862735784504773e+00 6.9342611925143895e+00 -4.1242111134384931e+00 + 25 -1.4199834587465987e+00 -4.7929499240605757e+00 7.8441305057066435e-01 + 26 3.2062570371970760e+00 -2.1413112684538138e+00 3.3397980628678292e+00 + 27 -5.7750756133737324e-01 4.7034301715431095e+00 -1.5928666568414294e+00 + 28 -1.2479826292102141e+00 -2.8122463433553637e+00 6.1142723852605441e-02 + 29 1.8254901905475873e+00 -1.8911838281877453e+00 1.5317239329888239e+00 +... diff --git a/unittest/force-styles/tests/fix-timestep-wall_region_harmonic_const.yaml b/unittest/force-styles/tests/fix-timestep-wall_region_harmonic_const.yaml new file mode 100644 index 0000000000..3564dabf02 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-wall_region_harmonic_const.yaml @@ -0,0 +1,84 @@ +--- +lammps_version: 3 Aug 2022 +tags: generated +date_generated: Mon Aug 15 01:14:02 2022 +epsilon: 4e-14 +skip_tests: +prerequisites: ! | + atom full + fix wall/region +pre_commands: ! | + boundary f f f +post_commands: ! | + fix move all nve + region box block EDGE EDGE EDGE EDGE EDGE EDGE + fix test solute wall/region box harmonic 0.1 1.0 1.0 + fix_modify test virial yes +input_file: in.fourmol +natoms: 29 +run_stress: ! |2- + 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 +global_scalar: 0 +global_vector: ! |- + 3 0 0 0 +run_pos: ! |2 + 1 -2.7045559775384026e-01 2.4912159905679729e+00 -1.6695851791541885e-01 + 2 3.1004029573899528e-01 2.9612354631094391e+00 -8.5466363037021464e-01 + 3 -7.0398551400789466e-01 1.2305509955830618e+00 -6.2777526944456274e-01 + 4 -1.5818159336499285e+00 1.4837407818929933e+00 -1.2538710836062004e+00 + 5 -9.0719763672789266e-01 9.2652103885675297e-01 3.9954210488374786e-01 + 6 2.4831720524855988e-01 2.8313021497871271e-01 -1.2314233331711453e+00 + 7 3.4143527641386412e-01 -2.2646551041391422e-02 -2.5292291414903052e+00 + 8 1.1743552229100009e+00 -4.8863228565853944e-01 -6.3783432910825522e-01 + 9 1.3800524229500313e+00 -2.5274721030406683e-01 2.8353985887095157e-01 + 10 2.0510765220543883e+00 -1.4604063740302866e+00 -9.8323745081712954e-01 + 11 1.7878031944442556e+00 -1.9921863272948861e+00 -1.8890602447625777e+00 + 12 3.0063007039340053e+00 -4.9013350496963298e-01 -1.6231898107386231e+00 + 13 4.0515402959192999e+00 -8.9202011606653986e-01 -1.6400005529924957e+00 + 14 2.6066963345543819e+00 -4.1789253965514156e-01 -2.6634003608794394e+00 + 15 2.9695287185712913e+00 5.5422613165234036e-01 -1.2342022021790127e+00 + 16 2.6747029695228521e+00 -2.4124119054564295e+00 -2.3435746150616152e-02 + 17 2.2153577785283796e+00 -2.0897985186907717e+00 1.1963150794479436e+00 + 18 2.1369701704094664e+00 3.0158507413593139e+00 -3.5179348337135590e+00 + 19 1.5355837135395243e+00 2.6255292354730009e+00 -4.2353987771401354e+00 + 20 2.7727573003748263e+00 3.6923910441179069e+00 -3.9330842453167185e+00 + 21 4.9040128073837339e+00 -4.0752348170758461e+00 -3.6210314709795299e+00 + 22 4.3582355554510048e+00 -4.2126119427061379e+00 -4.4612844196307497e+00 + 23 5.7439382849366911e+00 -3.5821957939240279e+00 -3.8766361295959513e+00 + 24 2.0689243582454213e+00 3.1513346907303501e+00 3.1550389751128463e+00 + 25 1.3045351331414130e+00 3.2665125705869009e+00 2.5111855257365274e+00 + 26 2.5809237402714267e+00 4.0117602605512728e+00 3.2212060528800821e+00 + 27 -1.9611343130357228e+00 -4.3563411931359752e+00 2.1098293115523705e+00 + 28 -2.7473562684513411e+00 -4.0200819932379330e+00 1.5830052163433954e+00 + 29 -1.3126000191359855e+00 -3.5962518039482929e+00 2.2746342468737835e+00 +run_vel: ! |2 + 1 8.1705744183262832e-03 1.6516406176274298e-02 4.7902264318913212e-03 + 2 5.4501493445687828e-03 5.1791699408496412e-03 -1.4372931530376577e-03 + 3 -8.2298292722385591e-03 -1.2926551614621364e-02 -4.0984181178163734e-03 + 4 -3.7699042590093506e-03 -6.5722892098813894e-03 -1.1184640360133316e-03 + 5 -1.1021961004346575e-02 -9.8906780939336039e-03 -2.8410737829284390e-03 + 6 -3.9676663166400027e-02 4.6817061464710263e-02 3.7148491979476131e-02 + 7 9.1033953013898753e-04 -1.0128524411938794e-02 -5.1568251805019748e-02 + 8 7.9064712058855742e-03 -3.3507254552631585e-03 3.4557098492564643e-02 + 9 1.5644176117320938e-03 3.7365546102722208e-03 1.5047408822037651e-02 + 10 2.9201446820573192e-02 -2.9249578745486140e-02 -1.5018077424322544e-02 + 11 -4.7835961513517542e-03 -3.7481385134185211e-03 -2.3464104142290089e-03 + 12 2.2696451841920672e-03 -3.4774154398129641e-04 -3.0640770327796966e-03 + 13 2.7531740451953164e-03 5.8171061612840502e-03 -7.9467454022160669e-04 + 14 3.5246182371994205e-03 -5.7939995585585538e-03 -3.9478431172751361e-03 + 15 -1.8547943640122950e-03 -5.8554729942777778e-03 6.2938485140538675e-03 + 16 1.8681499973445252e-02 -1.3262466204585332e-02 -4.5638651457003250e-02 + 17 -1.2896269981100378e-02 9.7527665265956451e-03 3.7296535360836762e-02 + 18 -8.0065795274987550e-04 -8.6270473974390637e-04 -1.4483040536385791e-03 + 19 1.2452390067376827e-03 -2.5061097800836321e-03 7.2998639311871857e-03 + 20 3.5930058460518109e-03 3.6938852051849871e-03 3.2322738480194727e-03 + 21 -1.4689219756961610e-03 -2.7352107824530291e-04 7.0581625180892197e-04 + 22 -7.0694199165145105e-03 -4.2577148692717545e-03 2.8079117911323598e-04 + 23 6.0446963236685230e-03 -1.4000131545098772e-03 2.5819754799379716e-03 + 24 3.1926368451268083e-04 -9.9445664487428820e-04 1.4999960207062409e-04 + 25 1.3789752933078488e-04 -4.4335894831520756e-03 -8.1808138106080120e-04 + 26 2.0485904023409989e-03 2.7813358660936129e-03 4.3245726853349256e-03 + 27 4.5604120293369840e-04 -1.0305523026921111e-03 2.1188058381358413e-04 + 28 -6.2544520861855151e-03 1.4127711176146879e-03 -1.8429821884794260e-03 + 29 6.4110631534402174e-04 3.1273432719593824e-03 3.7253671105656736e-03 +... diff --git a/unittest/formats/test_dump_atom.cpp b/unittest/formats/test_dump_atom.cpp index 702325f2fb..762a01e648 100644 --- a/unittest/formats/test_dump_atom.cpp +++ b/unittest/formats/test_dump_atom.cpp @@ -624,7 +624,7 @@ TEST_F(DumpAtomTest, dump_modify_invalid) command("dump id all atom 1 dump.txt"); END_HIDE_OUTPUT(); - TEST_FAILURE(".*Illegal dump_modify command.*", command("dump_modify id true");); + TEST_FAILURE(".*Unknown dump_modify keyword: true.*", command("dump_modify id true");); } TEST_F(DumpAtomTest, write_dump) diff --git a/unittest/formats/test_molecule_file.cpp b/unittest/formats/test_molecule_file.cpp index 17bd30a349..d84aa1c960 100644 --- a/unittest/formats/test_molecule_file.cpp +++ b/unittest/formats/test_molecule_file.cpp @@ -216,6 +216,9 @@ TEST_F(MoleculeFileTest, twomols) auto output = END_CAPTURE_OUTPUT(); ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*\n.*2 molecules.*\n" ".*0 fragments.*\n.*2 atoms with max type 2.*\n.*0 bonds.*")); + ASSERT_EQ(lmp->atom->nmolecule, 1); + auto mols = lmp->atom->get_molecule_by_id(test_name); + ASSERT_EQ(mols.size(), 1); } TEST_F(MoleculeFileTest, twofiles) @@ -231,6 +234,17 @@ TEST_F(MoleculeFileTest, twofiles) ".*Read molecule template twomols:.*\n.*1 molecules.*\n" ".*0 fragments.*\n.*3 atoms with max type 4.*\n.*2 bonds with max type 2.*\n" ".*1 angles with max type 2.*\n.*0 dihedrals.*")); + BEGIN_CAPTURE_OUTPUT(); + command("molecule h2o moltest.h2o.mol"); + command("molecule co2 moltest.co2.mol"); + output = END_CAPTURE_OUTPUT(); + ASSERT_EQ(lmp->atom->nmolecule, 4); + auto mols = lmp->atom->get_molecule_by_id("twomols"); + ASSERT_EQ(mols.size(), 2); + mols = lmp->atom->get_molecule_by_id("h2o"); + ASSERT_EQ(mols.size(), 1); + mols = lmp->atom->get_molecule_by_id("co2"); + ASSERT_EQ(mols.size(), 1); } TEST_F(MoleculeFileTest, bonds)