diff --git a/doc/doxygen/Doxyfile.in b/doc/doxygen/Doxyfile.in index 6a74e0606cc..dacbb088d4c 100644 --- a/doc/doxygen/Doxyfile.in +++ b/doc/doxygen/Doxyfile.in @@ -2,7 +2,7 @@ DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = "LAMMPS Programmer's Guide" -PROJECT_NUMBER = "11 February 2026" +PROJECT_NUMBER = "30 March 2026" PROJECT_BRIEF = "Documentation of the LAMMPS library interface and Python wrapper" PROJECT_LOGO = lammps-logo.png CREATE_SUBDIRS = NO diff --git a/doc/lammps.1 b/doc/lammps.1 index b25c0b166f4..153cef1802b 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,7 +1,7 @@ -.TH LAMMPS "1" "11 February 2026" "2026-02-11" +.TH LAMMPS "1" "30 March 2026" "2026-03-30" .SH NAME .B LAMMPS -\- Molecular Dynamics Simulator. Version 11 February 2026 +\- Molecular Dynamics Simulator. Version 30 March 2026 .SH SYNOPSIS .B lmp diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index b7c03b5a607..5d1ae8a88ad 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -1258,7 +1258,7 @@ then load this plugin at runtime with the :doc:`plugin command .. tab:: CMake build - .. versionchanged:: TBD + .. versionchanged:: 30Mar2026 Replaced MD5 checksums with SHA-256 @@ -1300,7 +1300,7 @@ folder and then load this plugin at runtime with the :doc:`plugin command ` * :doc:`class2 (ko) ` * :doc:`class2/p6 ` + * :doc:`class2xe ` * :doc:`cosine (ko) ` * :doc:`cosine/buck6d ` * :doc:`cosine/delta (o) ` @@ -122,6 +123,7 @@ OPT. * :doc:`charmm (iko) ` * :doc:`charmmfsw (k) ` * :doc:`class2 (ko) ` + * :doc:`class2xe ` * :doc:`cosine/shift/exp (o) ` * :doc:`cosine/squared/restricted ` * :doc:`fourier (iko) ` diff --git a/doc/src/Howto_bioFF.rst b/doc/src/Howto_bioFF.rst index 7c5df22dd9d..d400ec03678 100644 --- a/doc/src/Howto_bioFF.rst +++ b/doc/src/Howto_bioFF.rst @@ -1,5 +1,5 @@ -CHARMM, AMBER, COMPASS, DREIDING, and OPLS force fields -======================================================= +CHARMM, AMBER, COMPASS, ClassII-xe, DREIDING, and OPLS force fields +=================================================================== Here we only discuss formulas implemented in LAMMPS that correspond to formulas commonly used in the CHARMM, AMBER, COMPASS, and DREIDING force @@ -50,17 +50,17 @@ The interaction styles listed below compute force field formulas that are consistent with common options in CHARMM or AMBER. See each command's documentation for the formula it computes. -* :doc:`bond_style ` harmonic -* :doc:`angle_style ` charmm -* :doc:`dihedral_style ` charmmfsh -* :doc:`dihedral_style ` charmm -* :doc:`pair_style ` lj/charmmfsw/coul/charmmfsh -* :doc:`pair_style ` lj/charmmfsw/coul/long -* :doc:`pair_style ` lj/charmm/coul/charmm -* :doc:`pair_style ` lj/charmm/coul/charmm/implicit -* :doc:`pair_style ` lj/charmm/coul/long -* :doc:`special_bonds ` charmm -* :doc:`special_bonds ` amber +* :doc:`bond_style harmonic ` +* :doc:`angle_style charmm ` +* :doc:`dihedral_style charmmfsh ` +* :doc:`dihedral_style charmm ` +* :doc:`pair_style lj/charmmfsw/coul/charmmfsh ` +* :doc:`pair_style lj/charmmfsw/coul/long ` +* :doc:`pair_style lj/charmm/coul/charmm ` +* :doc:`pair_style lj/charmm/coul/charmm/implicit ` +* :doc:`pair_style lj/charmm/coul/long ` +* :doc:`special_bonds charmm ` +* :doc:`special_bonds amber ` The pair styles compute Lennard Jones (LJ) and Coulombic interactions with additional switching or shifting functions that ramp the energy @@ -174,16 +174,104 @@ These interaction styles listed below compute force field formulas that are consistent with the COMPASS force field. See each command's documentation for the formula it computes. -* :doc:`bond_style ` class2 -* :doc:`angle_style ` class2 -* :doc:`dihedral_style ` class2 -* :doc:`improper_style ` class2 +* :doc:`bond_style class2 ` +* :doc:`angle_style class2 ` +* :doc:`dihedral_style class2 ` +* :doc:`improper_style class2 ` -* :doc:`pair_style ` lj/class2 -* :doc:`pair_style ` lj/class2/coul/cut -* :doc:`pair_style ` lj/class2/coul/long +* :doc:`pair_style lj/class2 ` +* :doc:`pair_style lj/class2/coul/cut ` +* :doc:`pair_style lj/class2/coul/long` -* :doc:`special_bonds ` lj/coul 0 0 1 +* :doc:`special_bonds lj/coul 0 0 1 ` + +ClassII-xe +---------- + +.. versionadded:: 30Mar2026 + +The computationally efficient simulation of condensed-phase materials +such as metals, polymers, and composites can be achieved with fixed-bond +force fields. Two popular fixed-bond force fields for such materials +are COMPASS :ref:`(Sun) ` and PCFF :ref:`(Maple) +`. Both use a Class II-based functional form that +incorporates anharmonic vibrational modes via the quartic Taylor-series +expansion of the Hamiltonian. In addition, Class II-based force fields +add intermolecular coupling via cross-term interactions that also +account for more complex vibrational modes. The underlying harmonic +bonds and harmonic cross-terms can limit the reliability of the physics, +e.g., when calculating mechanical properties. To overcome the harmonic +bonding limitations, a Morse bond :ref:`(Morse) ` can be +used in place of the quartic bond, but this improvement when modeling +bond dissociation is limited when the cross-terms remain harmonic. To +improve the physicality of the response of the cross-terms that couple +bond stretch to other higher-order interactions (angles, dihedrals, and +impropers), those respective cross-terms also need to be modified. + +The cross-term potentials that model bond stretch coupling to +higher-order interactions are similar in functional form to the harmonic +bonding potential. Thus, the exponential function that :ref:`(Morse) +` derived for converting a harmonic bonding potential to a +bonding potential that accommodates larger bond stretches and can model +bond dissociation, can also be implemented into the cross-terms. This +defines the naming convention for the ClassII-xe functional form, where +x refers to cross-term and e refers to an exponential function, and +defines the purpose of the ClassII-xe functional form. The purpose is +to allow bond dissociation in a ClassII-based force field via a +consistent definition of bond dissociation via the Morse bonding +potential and the higher-order cross-term coupling potentials. See +:ref:`(Kemppainen) ` for a description of the +ClassII-xe functional form. The interaction styles listed below compute +the force field formulas for the ClassII-xe functional form: + +* :doc:`bond_style morse ` +* :doc:`angle_style class2xe ` +* :doc:`dihedral_style class2xe ` +* :doc:`improper_style class2 ` + +* :doc:`pair_style lj/class2 ` +* :doc:`pair_style lj/class2/coul/cut ` +* :doc:`pair_style lj/class2/coul/long ` + +* :doc:`special_bonds lj/coul 0 0 1 ` + +Since both COMPASS and PCFF are Class II-based, their parameters can be +converted into the ClassII-xe functional form. The conversion from +ClassII to ClassII-xe functional form requires reparameterizing the +cross-terms, which can be accomplished via the LUNAR tool, for which a +link is provided on the `Pre/Post processing +`_ page. LUNAR can be used to +build a model from scratch in either COMPASS or PCFF (using its +'atom_typing' and 'all2lmp' modules) and then convert that model to +COMPASS-xe or PCFF-xe (using its 'auto_morse_bond_update' module). To +establish a consistent naming convention for the new ClassII-xe +functional form when converting from a parent force field, the -xe +suffix should be added to the parent force field name (e.g. PCFF +vs. PCFF-xe). + +The usage of the ClassII-xe functional form can only let a bond +dissociate; however, to disconnect the dissociated bond and remove the +higher-order interactions, other LAMMPS commands are required, such as +:doc:`fix bond/react ` or :doc:`fix bond/break +`. It was demonstrated that PCFF-xe (without :doc:`fix +bond/react ` or :doc:`fix bond/break `) +can model a material up to fracture :ref:`(Kemppainen) +`, allowing for calculation of mechanical properties +such such as tensile and shear modulus, tensile and shear yield +strength, Poisson's ratio, etc. However, the simulation may crash after +fracture if bonds beyond than the processor communication cutoff +distance. Thus, post-fracture phenomena cannot be simulated without the +usage of :doc:`fix bond/react ` or :doc:`fix bond/break +`. Note that using :doc:`fix bond/break +` can cause instabilities and crashes because a +discontinuity is introduced to the energy landscape when a bond is +removed. On the other hand, :doc:`fix bond/react ` can +relax high-energy configurations via the ``stabilization`` keyword, +whereby a small local group of atoms involved in the discontinuity are +integrated with :doc:`fix nve/limit `. `LUNAR +`_ can also be used to assist with +setting up simulations that include :doc:`fix bond/react +`. DREIDING -------- @@ -209,28 +297,28 @@ The interaction styles listed below compute force field formulas that are consistent with the DREIDING force field. See each command's documentation for the formula it computes. -* :doc:`bond_style ` harmonic -* :doc:`bond_style ` morse +* :doc:`bond_style harmonic ` +* :doc:`bond_style morse ` -* :doc:`angle_style ` cosine/squared -* :doc:`angle_style ` harmonic -* :doc:`angle_style ` cosine -* :doc:`angle_style ` cosine/periodic +* :doc:`angle_style cosine/squared ` +* :doc:`angle_style harmonic ` +* :doc:`angle_style cosine ` +* :doc:`angle_style cosine/periodic ` -* :doc:`dihedral_style ` charmm -* :doc:`improper_style ` umbrella +* :doc:`dihedral_style charmm ` +* :doc:`improper_style umbrella ` -* :doc:`pair_style ` buck -* :doc:`pair_style ` buck/coul/cut -* :doc:`pair_style ` buck/coul/long -* :doc:`pair_style ` lj/cut -* :doc:`pair_style ` lj/cut/coul/cut -* :doc:`pair_style ` lj/cut/coul/long +* :doc:`pair_style buck ` +* :doc:`pair_style buck/coul/cut ` +* :doc:`pair_style buck/coul/long ` +* :doc:`pair_style lj/cut ` +* :doc:`pair_style lj/cut/coul/cut ` +* :doc:`pair_style lj/cut/coul/long ` -* :doc:`pair_style ` hbond/dreiding/lj -* :doc:`pair_style ` hbond/dreiding/morse +* :doc:`pair_style hbond/dreiding/lj ` +* :doc:`pair_style hbond/dreiding/morse ` -* :doc:`special_bonds ` dreiding +* :doc:`special_bonds dreiding ` OPLS ---- @@ -255,16 +343,16 @@ are fully or in part consistent with the OPLS style force fields. See each command's documentation for the formula it computes. Some are only compatible with a subset of OPLS interactions. -* :doc:`bond_style ` harmonic -* :doc:`angle_style ` harmonic -* :doc:`dihedral_style ` opls -* :doc:`improper_style ` cvff -* :doc:`improper_style ` fourier -* :doc:`improper_style ` harmonic -* :doc:`pair_style ` lj/cut/coul/cut -* :doc:`pair_style ` lj/cut/coul/long -* :doc:`pair_modify ` geometric -* :doc:`special_bonds ` lj/coul 0.0 0.0 0.5 +* :doc:`bond_style harmonic ` +* :doc:`angle_style harmonic ` +* :doc:`dihedral_style opls ` +* :doc:`improper_style cvff ` +* :doc:`improper_style fourier ` +* :doc:`improper_style harmonic ` +* :doc:`pair_style lj/cut/coul/cut ` +* :doc:`pair_style lj/cut/coul/long ` +* :doc:`pair_modify geometric ` +* :doc:`special_bonds lj/coul 0.0 0.0 0.5 ` ---------- @@ -295,3 +383,15 @@ compatible with a subset of OPLS interactions. .. _howto-Jorgensen: **(Jorgensen)** Jorgensen, Tirado-Rives (1988). J Am Chem Soc, 110, 1657-1666. https://doi.org/10.1021/ja00214a001 + +.. _howto-Maple: + +**(Maple)** Maple, Journal of Computational Chemistry, 15, 162-182 (1994). https://doi.org/10.1002/jcc.540150207 + +.. _howto-Morse: + +**(Morse)** Morse, Physical review, 34, 57 (1929). https://doi.org/10.1103/PhysRev.34.57 + +.. _howto-Kemppainen: + +**(Kemppainen)** Kemppainen, npj Computational Materials 11, 341 (2025). https://doi.org/10.1038/s41524-025-01838-5 diff --git a/doc/src/Howto_viz.rst b/doc/src/Howto_viz.rst index 7a703b5d818..1346f58a6dc 100644 --- a/doc/src/Howto_viz.rst +++ b/doc/src/Howto_viz.rst @@ -621,7 +621,7 @@ follows the documented steps, those trajectory dump files can be `imported and visualized in OVITO `_ -.. versionchanged:: TBD +.. versionchanged:: 30Mar2026 Now uses curved triangles instead of flat ones; "both" option is removed; support for superellipsoids was added @@ -673,7 +673,7 @@ commands to the ``in.ellipse.resquared`` input example: color map1 0.459 0.055 0.075 color map2 0.000 0.227 0.427 & amap min max cf 0.0 5 min map1 0.1 map1 0.5 white 0.9 map2 max map2 -.. versionadded:: TBD +.. versionadded:: 30Mar2026 The visualization of superellipsoids works exactly the same way as for ellipsoids by creating a triangle mesh of an icosahedron and refining diff --git a/doc/src/angle_class2.rst b/doc/src/angle_class2.rst index f697af47f85..2f66ee494c5 100644 --- a/doc/src/angle_class2.rst +++ b/doc/src/angle_class2.rst @@ -1,6 +1,7 @@ .. index:: angle_style class2 .. index:: angle_style class2/kk .. index:: angle_style class2/omp +.. index:: angle_style class2xe .. index:: angle_style class2/p6 angle_style class2 command @@ -8,6 +9,9 @@ angle_style class2 command Accelerator Variants: *class2/kk*, *class2/omp* +angle_style class2xe command +============================ + angle_style class2/p6 command ============================= @@ -40,12 +44,13 @@ The *class2* angle style uses the potential E_{bb} & = M (r_{ij} - r_1) (r_{jk} - r_2) \\ E_{ba} & = N_1 (r_{ij} - r_1) (\theta - \theta_0) + N_2(r_{jk} - r_2)(\theta - \theta_0) -where :math:`E_a` is the angle term, :math:`E_{bb}` is a bond-bond -term, and :math:`E_{ba}` is a bond-angle term. :math:`\theta_0` is -the equilibrium angle and :math:`r_1` and :math:`r_2` are the -equilibrium bond lengths. +where :math:`E_a` is the angle term, :math:`E_{bb}` is a bond-bond term, +and :math:`E_{ba}` is a bond-angle term. :math:`\theta_0` is the +equilibrium angle and :math:`r_1` and :math:`r_2` are the equilibrium +bond lengths. -See :ref:`(Sun) ` for a description of the COMPASS class2 force field. +See :ref:`(Sun) ` for a description of the COMPASS class2 +force field. Coefficients for the :math:`E_a`, :math:`E_{bb}`, and :math:`E_{ba}` formulas must be defined for each angle type via the :doc:`angle_coeff @@ -66,10 +71,10 @@ per radian\^2 or radian\^3 or radian\^4. For the :math:`E_{bb}` formula, each line in a :doc:`angle_coeff ` command in the input script lists 4 coefficients, the -first of which is "bb" to indicate they are BondBond coefficients. In -a data file, these coefficients should be listed under a "BondBond -Coeffs" heading and you must leave out the "bb", i.e. only list 3 -coefficients after the angle type. +first of which is "bb" to indicate they are BondBond coefficients. In a +data file, these coefficients should be listed under a "BondBond Coeffs" +heading and you must leave out the "bb", i.e. only list 3 coefficients +after the angle type. * bb * :math:`M` (energy/distance\^2) @@ -78,8 +83,8 @@ coefficients after the angle type. For the :math:`E_{ba}` formula, each line in a :doc:`angle_coeff ` command in the input script lists 5 coefficients, the -first of which is "ba" to indicate they are BondAngle coefficients. -In a data file, these coefficients should be listed under a "BondAngle +first of which is "ba" to indicate they are BondAngle coefficients. In +a data file, these coefficients should be listed under a "BondAngle Coeffs" heading and you must leave out the "ba", i.e. only list 4 coefficients after the angle type. @@ -96,15 +101,99 @@ since it is the same value from the :math:`E_a` formula. It is important that the order of the I,J,K atoms in each angle listed in the Angles section of the data file read by the - :doc:`read_data ` command be consistent with the order - of the :math:`r_1` and :math:`r_2` BondBond and BondAngle - coefficients. This is because the terms in the formulas for - :math:`E_{bb}` and :math:`E_{ba}` will use the I,J atoms to compute - :math:`r_{ij}` and the J,K atoms to compute :math:`r_{jk}`. + :doc:`read_data ` command be consistent with the order of + the :math:`r_1` and :math:`r_2` BondBond and BondAngle coefficients. + This is because the terms in the formulas for :math:`E_{bb}` and + :math:`E_{ba}` will use the I,J atoms to compute :math:`r_{ij}` and + the J,K atoms to compute :math:`r_{jk}`. ---------- -.. include:: accel_styles.rst +.. versionadded:: 30Mar2026 + +The *class2xe* angle style uses the potential + +.. math:: + + \begin{aligned} + E_a = & K_2 (\theta - \theta_0)^2 + K_3 (\theta - \theta_0)^3 + K_4(\theta - \theta_0)^4 \\ + E_{bb} = & D \left[ 1 - e^{-\alpha (r_{ij} - r_1)} \right] \left[ 1 - e^{-\alpha (r_{jk} - r_2)} \right] \\ + E_{ba} = & D_1 \left[ 1 - e^{-\alpha_1 (r_{ij} - r_1)} \right] \left[\theta - \theta_0\right] + D_2 \left[ 1 - e^{-\alpha_2 (r_{jk} - r_2)} \right] \left[\theta - \theta_0\right] + \end{aligned} + +where :math:`E_a` is the angle term, :math:`E_{bb}` is a bond-bond term +(:math:`D` is the dissociation energy), and :math:`E_{ba}` is a +bond-angle term (:math:`D_1` and :math:`D_2` are the dissociation +energies). :math:`\theta_0` is the equilibrium angle and :math:`r_1` and +:math:`r_2` are the equilibrium bond lengths. + +See :ref:`(Kemppainen) ` for a description of the +ClassII-xe force field and see :doc:`Howto bioFF ` page for +a motivation for the ClassII-xe force field. + +.. note:: + + The *class2xe* angle style only describes the dissociation of a bond + stretch. However once a bond is dissociated and stretched beyond the + processor communication cutoff distance in parallel, the simulation + will crash with atoms missing errors. This is often after the + material fractures and thus for post-fracture phenomena the bonded + interactions need to be removed for proper parallel communication. + + To disconnect the dissociated bond and remove higher order + interactions (angles, dihedrals, and impropers) the following LAMMPS + commands can be used with the *class2xe* angle style :doc:`fix + bond/react ` or :doc:`fix bond/break + `. See the :doc:`Howto bioFF ` page for + more details. + +Coefficients for the :math:`E_a`, :math:`E_{bb}`, and :math:`E_{ba}` +formulas must be defined for each angle type via the :doc:`angle_coeff +` command as in the example above, or in the data file or +restart files read by the :doc:`read_data ` or +:doc:`read_restart ` commands. + +These are the 4 coefficients for the :math:`E_a` formula: + +* :math:`\theta_0` (degrees) +* :math:`K_2` (energy) +* :math:`K_3` (energy) +* :math:`K_4` (energy) + +:math:`\theta_0` is specified in degrees, but LAMMPS converts it to +radians internally; hence the various :math:`K` are effectively energy +per radian\^2 or radian\^3 or radian\^4. + +For the :math:`E_{bb}` formula, each line in a :doc:`angle_coeff +` command in the input script lists 5 coefficients, the +first of which is "bb" to indicate they are BondBond coefficients. In a +data file, these coefficients should be listed under a "BondBond Coeffs" +heading and you must leave out the "bb", i.e. only list 4 coefficients +after the angle type. + +* bb +* :math:`D` (energy) +* :math:`\alpha` (inverse distance) +* :math:`r_1` (distance) +* :math:`r_2` (distance) + +For the :math:`E_{ba}` formula, each line in a :doc:`angle_coeff +` command in the input script lists 7 coefficients, the +first of which is "ba" to indicate they are BondAngle coefficients. In +a data file, these coefficients should be listed under a "BondAngle +Coeffs" heading and you must leave out the "ba", i.e. only list 6 +coefficients after the angle type. + +* ba +* :math:`D_1` (energy) +* :math:`D_2` (energy) +* :math:`\alpha_1` (inverse distance) +* :math:`\alpha_2` (inverse distance) +* :math:`r_1` (distance) +* :math:`r_2` (distance) + +The :math:`\theta_0` value in the :math:`E_{ba}` formula is not specified, +since it is the same value from the :math:`E_a` formula. ---------- @@ -114,7 +203,8 @@ The *class2/p6* angle style uses the *class2* potential expanded to sixth order: E_{a} = K_2\left(\theta - \theta_0\right)^2 + K_3\left(\theta - \theta_0\right)^3 + K_4\left(\theta - \theta_0\right)^4 + K_5\left(\theta - \theta_0\right)^5 + K_6\left(\theta - \theta_0\right)^6 -In this expanded term 6 coefficients for the :math:`E_a` formula need to be set: +In this expanded term 6 coefficients for the :math:`E_a` formula need to +be set: * :math:`\theta_0` (degrees) * :math:`K_2` (energy) @@ -131,13 +221,17 @@ The bond-bond and bond-angle terms remain unchanged. ---------- +.. include:: accel_styles.rst + +---------- + Restrictions """""""""""" -This angle style can only be used if LAMMPS was built with the CLASS2 -package. For the *class2/p6* style LAMMPS needs to be built with the -MOFFF package. See the :doc:`Build package ` doc -page for more info. +The *class2* and *class2xe* angle styles can only be used if LAMMPS was +built with the CLASS2 package. For the *class2/p6* angle style LAMMPS +needs to be built with the MOFFF package. See the :doc:`Build package +` doc page for more info. Related commands """""""""""""""" @@ -154,3 +248,7 @@ none .. _angle-Sun: **(Sun)** Sun, J Phys Chem B 102, 7338-7364 (1998). + +.. _angle-Kemppainen: + +**(Kemppainen)** Kemppainen, npj Computational Materials 11, 341 (2025). diff --git a/doc/src/angle_style.rst b/doc/src/angle_style.rst index ab7671c75d4..7d5a9730b27 100644 --- a/doc/src/angle_style.rst +++ b/doc/src/angle_style.rst @@ -10,7 +10,7 @@ Syntax angle_style style -* style = *none* or *zero* or *hybrid* or *amoeba* or *charmm* or *class2* or *class2/p6* or *cosine* or *cosine/buck6d* or *cosine/delta* or *cosine/periodic* or *cosine/shift* or *cosine/shift/exp* or *cosine/squared* or *cosine/squared/restricted* or *cross* or *dipole* or *fourier* or *fourier/simple* or *gaussian* or *harmonic* or *lepton* or *mm3* or *quartic* or *spica* or *table* +* style = *none* or *zero* or *hybrid* or *amoeba* or *charmm* or *class2* or *class2xe* or *class2/p6* or *cosine* or *cosine/buck6d* or *cosine/delta* or *cosine/periodic* or *cosine/shift* or *cosine/shift/exp* or *cosine/squared* or *cosine/squared/restricted* or *cross* or *dipole* or *fourier* or *fourier/simple* or *gaussian* or *harmonic* or *lepton* or *mm3* or *quartic* or *spica* or *table* Examples """""""" @@ -76,6 +76,7 @@ of (g,i,k,o,t) to indicate which accelerated styles exist. * :doc:`amoeba ` - AMOEBA angle * :doc:`charmm ` - CHARMM angle * :doc:`class2 ` - COMPASS (class 2) angle +* :doc:`class2xe ` - ClassII-xe (class 2) angle * :doc:`class2/p6 ` - COMPASS (class 2) angle expanded to 6th order * :doc:`cosine ` - angle with cosine term * :doc:`cosine/buck6d ` - same as cosine with Buckingham term between 1-3 atoms diff --git a/doc/src/atom_style.rst b/doc/src/atom_style.rst index ca367cc0d9d..cd94cc54645 100644 --- a/doc/src/atom_style.rst +++ b/doc/src/atom_style.rst @@ -279,7 +279,7 @@ with both flavors of mass. Additional information about specific atom styles """"""""""""""""""""""""""""""""""""""""""""""""" -.. versionchanged:: TBD +.. versionchanged:: 30Mar2026 For the *apip* style, one can choose between the style for conservative potentials and the style for the @@ -355,7 +355,7 @@ quaternion 4-vector with its orientation. Each particle stores a flag in the ellipsoid vector which indicates whether it is an ellipsoid (1) or a point particle (0). -.. versionadded:: TBD +.. versionadded:: 30Mar2026 By adding the flag *superellipsoid* to the *ellipsoid* atom_style command, the particles can be superellipsoids, which are a diff --git a/doc/src/compute_property_atom.rst b/doc/src/compute_property_atom.rst index 79d3932b6cc..cea100f3d59 100644 --- a/doc/src/compute_property_atom.rst +++ b/doc/src/compute_property_atom.rst @@ -167,13 +167,13 @@ If :doc:`newton bond off ` is set, it will be tallied with both atom The quantities *shapex*, *shapey*, and *shapez* are defined for ellipsoidal particles and define the 3d shape of each particle. -.. versionadded:: TBD +.. versionadded:: 30Mar2026 The quantities *block1*, and *block2*, are defined for superellipsoidal particles and define the blockiness of each superellipsoid particle. See the :doc:`set ` command for an explanation of the blockiness. -.. versionadded:: TBD +.. versionadded:: 30Mar2026 The quantities *inertiax*, *inertiay*, and *inertiaz* are defined for superellipsoidal particles and define the 3 principal moments of inertia @@ -201,7 +201,7 @@ the energies of a fast (*apip_e_fast*) and a precise (*apip_e_precise*) potential into an adaptive-precision energy. -.. versionchanged:: TBD +.. versionchanged:: 30Mar2026 Alternatively, the switching parameter can be calculated from a locally averaged descriptor (*apip_la_avg*) to obtain a conservative diff --git a/doc/src/dihedral_class2.rst b/doc/src/dihedral_class2.rst index a98cf6b041b..8ee11a1864b 100644 --- a/doc/src/dihedral_class2.rst +++ b/doc/src/dihedral_class2.rst @@ -1,12 +1,16 @@ .. index:: dihedral_style class2 .. index:: dihedral_style class2/omp .. index:: dihedral_style class2/kk +.. index:: dihedral_style class2xe dihedral_style class2 command ============================= Accelerator Variants: *class2/omp*, *class2/kk* +dihedral_style class2xe command +=============================== + Syntax """""" @@ -44,19 +48,21 @@ The *class2* dihedral style uses the potential E_{aat} = & M (\theta_{ijk} - \theta_1) (\theta_{jkl} - \theta_2) \cos (\phi) \\ E_{bb13} = & N (r_{ij} - r_1) (r_{kl} - r_3) -where :math:`E_d` is the dihedral term, :math:`E_{mbt}` is a middle-bond-torsion term, -:math:`E_{ebt}` is an end-bond-torsion term, :math:`E_{at}` is an angle-torsion term, :math:`E_{aat}` -is an angle-angle-torsion term, and :math:`E_{bb13}` is a bond-bond-13 term. +where :math:`E_d` is the dihedral term, :math:`E_{mbt}` is a +middle-bond-torsion term, :math:`E_{ebt}` is an end-bond-torsion term, +:math:`E_{at}` is an angle-torsion term, :math:`E_{aat}` is an +angle-angle-torsion term, and :math:`E_{bb13}` is a bond-bond-13 term. -:math:`\theta_1` and :math:`\theta_2` are equilibrium angles and :math:`r_1`, :math:`r_2`, and -:math:`r_3` are equilibrium bond lengths. +:math:`\theta_1` and :math:`\theta_2` are equilibrium angles and +:math::math:`r_1`, :math:`r_2`, and `r_3` are equilibrium bond lengths. -See :ref:`(Sun) ` for a description of the COMPASS class2 force field. +See :ref:`(Sun) ` for a description of the COMPASS class2 +force field. Coefficients for the :math:`E_d`, :math:`E_{mbt}`, :math:`E_{ebt}`, :math:`E_{at}`, :math:`E_{aat}`, and :math:`E_{bb13}` formulas must be -defined for each dihedral type via the :doc:`dihedral_coeff ` -command as in the example above, or in the data file +defined for each dihedral type via the :doc:`dihedral_coeff +` command as in the example above, or in the data file or restart files read by the :doc:`read_data ` or :doc:`read_restart ` commands. @@ -69,13 +75,12 @@ These are the 6 coefficients for the :math:`E_d` formula: * :math:`K_3` (energy) * :math:`phi_3` (degrees) -For the :math:`E_{mbt}` formula, each line in a -:doc:`dihedral_coeff ` command in the input script lists -5 coefficients, the first of which is *mbt* to indicate they are -MiddleBondTorsion coefficients. In a data file, these coefficients -should be listed under a *MiddleBondTorsion Coeffs* heading and you -must leave out the *mbt*, i.e. only list 4 coefficients after the -dihedral type. +For the :math:`E_{mbt}` formula, each line in a :doc:`dihedral_coeff +` command in the input script lists 5 coefficients, the +first of which is *mbt* to indicate they are MiddleBondTorsion +coefficients. In a data file, these coefficients should be listed under +a *MiddleBondTorsion Coeffs* heading and you must leave out the *mbt*, +i.e. only list 4 coefficients after the dihedral type. * *mbt* * :math:`A_1` (energy/distance) @@ -83,13 +88,12 @@ dihedral type. * :math:`A_3` (energy/distance) * :math:`r_2` (distance) -For the :math:`E_{ebt}` formula, each line in a -:doc:`dihedral_coeff ` command in the input script lists -9 coefficients, the first of which is *ebt* to indicate they are -EndBondTorsion coefficients. In a data file, these coefficients -should be listed under a *EndBondTorsion Coeffs* heading and you must -leave out the *ebt*, i.e. only list 8 coefficients after the dihedral -type. +For the :math:`E_{ebt}` formula, each line in a :doc:`dihedral_coeff +` command in the input script lists 9 coefficients, the +first of which is *ebt* to indicate they are EndBondTorsion +coefficients. In a data file, these coefficients should be listed under +a *EndBondTorsion Coeffs* heading and you must leave out the *ebt*, +i.e. only list 8 coefficients after the dihedral type. * *ebt* * :math:`B_1` (energy/distance) @@ -101,12 +105,12 @@ type. * :math:`r_1` (distance) * :math:`r_3` (distance) -For the :math:`E_{at}` formula, each line in a -:doc:`dihedral_coeff ` command in the input script lists -9 coefficients, the first of which is *at* to indicate they are -AngleTorsion coefficients. In a data file, these coefficients should -be listed under a *AngleTorsion Coeffs* heading and you must leave out -the *at*, i.e. only list 8 coefficients after the dihedral type. +For the :math:`E_{at}` formula, each line in a :doc:`dihedral_coeff +` command in the input script lists 9 coefficients, the +first of which is *at* to indicate they are AngleTorsion coefficients. +In a data file, these coefficients should be listed under a +*AngleTorsion Coeffs* heading and you must leave out the *at*, i.e. only +list 8 coefficients after the dihedral type. * *at* * :math:`D_1` (energy) @@ -119,15 +123,15 @@ the *at*, i.e. only list 8 coefficients after the dihedral type. * :math:`\theta_2` (degrees) :math:`\theta_1` and :math:`\theta_2` are specified in degrees, but -LAMMPS converts them to radians internally; hence the various -:math:`D` and :math:`E` are effectively energy per radian. +LAMMPS converts them to radians internally; hence the various :math:`D` +and :math:`E` are effectively energy per radian. For the :math:`E_{aat}` formula, each line in a :doc:`dihedral_coeff -` command in the input script lists 4 coefficients, -the first of which is *aat* to indicate they are AngleAngleTorsion -coefficients. In a data file, these coefficients should be listed -under a *AngleAngleTorsion Coeffs* heading and you must leave out the -*aat*, i.e. only list 3 coefficients after the dihedral type. +` command in the input script lists 4 coefficients, the +first of which is *aat* to indicate they are AngleAngleTorsion +coefficients. In a data file, these coefficients should be listed under +a *AngleAngleTorsion Coeffs* heading and you must leave out the *aat*, +i.e. only list 3 coefficients after the dihedral type. * *aat* * :math:`M` (energy) @@ -138,18 +142,118 @@ under a *AngleAngleTorsion Coeffs* heading and you must leave out the LAMMPS converts them to radians internally; hence :math:`M` is effectively energy per radian\^2. +For the :math:`E_{bb13}` formula, each line in a :doc:`dihedral_coeff +` command in the input script lists 4 coefficients, the +first of which is *bb13* to indicate they are BondBond13 coefficients. +In a data file, these coefficients should be listed under a *BondBond13 +Coeffs* heading and you must leave out the *bb13*, i.e. only list 3 +coefficients after the dihedral type. + +* *bb13* +* :math:`N` (energy/distance\^2) +* :math:`r_1` (distance) +* :math:`r_3` (distance) + +---------- + +.. versionadded:: 30Mar2026 + +The *class2xe* dihedral style uses the potential + +.. math:: + + \begin{aligned} + E_{mbt} = & \left[ 1 - e^{-\alpha_2 (r_{jk} - r_2)} \right] [ A_1 \cos (\phi) + A_2 \cos (2\phi) + A_3 \cos (3\phi) ] \\ + E_{ebt} = & \left[ 1 - e^{-\alpha_1 (r_{ij} - r_1)} \right] [ B_1 \cos (\phi) + B_2 \cos (2\phi) + B_3 \cos (3\phi) ] + \\ + & \left[ 1 - e^{-\alpha_3 (r_{kl} - r_3)} \right] [ C_1 \cos (\phi) + C_2 \cos (2\phi) + C_3 \cos (3\phi) ] \\ + E_{bb13} = & D \left[ 1 - e^{-\alpha (r_{ij} - r_1)} \right] \left[ 1 - e^{-\alpha (r_{kl} - r_3)} \right] + \end{aligned} + +where :math:`E_{mbt}` is a middle-bond-torsion term, :math:`E_{ebt}` is +an end-bond-torsion term, and :math:`E_{bb13}` is a bond-bond-13 term +(:math:`D` is the dissociation energy). + +:math:`\theta_1` and :math:`\theta_2` are equilibrium angles and +:math::math:`r_1`, :math:`r_2`, and `r_3` are equilibrium bond lengths. + +See :ref:`(Kemppainen) ` for a description of the +ClassII-xe force field and see :doc:`Howto bioFF ` page for +a motivation for the ClassII-xe force field. + +.. note:: + + The *class2xe* dihedral style only describes the dissociation of + a bond stretch. However once a bond is dissociated and stretched + beyond the processor communication cutoff distance in parallel, + the simulation will crash with atoms missing errors. This is + often after the material fractures and thus for post-fracture + phenomena the bonded interactions need to be removed for proper + parallel communication. + + To disconnect the dissociated bond and remove higher order + interactions (angles, dihedrals, and impropers) the following + LAMMPS commands can be used with the *class2xe* dihedral style + :doc:`fix bond/react ` or + :doc:`fix bond/break `. See the + :doc:`Howto bioFF ` page for more details. + +Coefficients for the :math:`E_{mbt}`, :math:`E_{ebt}`, +and :math:`E_{bb13}` formulas must be +defined for each dihedral type via the :doc:`dihedral_coeff ` +command as in the example above, or in the data file +or restart files read by the :doc:`read_data ` or +:doc:`read_restart ` commands. + +For the :math:`E_{mbt}` formula, each line in a +:doc:`dihedral_coeff ` command in the input script lists +6 coefficients, the first of which is *mbt* to indicate they are +MiddleBondTorsion coefficients. In a data file, these coefficients +should be listed under a *MiddleBondTorsion Coeffs* heading and you +must leave out the *mbt*, i.e. only list 5 coefficients after the +dihedral type. + +* *mbt* +* :math:`\alpha_2` (inverse distance) +* :math:`A_1` (energy/distance) +* :math:`A_2` (energy/distance) +* :math:`A_3` (energy/distance) +* :math:`r_2` (distance) + +For the :math:`E_{ebt}` formula, each line in a +:doc:`dihedral_coeff ` command in the input script lists +11 coefficients, the first of which is *ebt* to indicate they are +EndBondTorsion coefficients. In a data file, these coefficients +should be listed under a *EndBondTorsion Coeffs* heading and you must +leave out the *ebt*, i.e. only list 10 coefficients after the dihedral +type. + +* *ebt* +* :math:`\alpha_1` (inverse distance) +* :math:`\alpha_3` (inverse distance) +* :math:`B_1` (energy/distance) +* :math:`B_2` (energy/distance) +* :math:`B_3` (energy/distance) +* :math:`C_1` (energy/distance) +* :math:`C_2` (energy/distance) +* :math:`C_3` (energy/distance) +* :math:`r_1` (distance) +* :math:`r_3` (distance) + For the :math:`E_{bb13}` formula, each line in a :doc:`dihedral_coeff ` command in the input script lists -4 coefficients, the first of which is *bb13* to indicate they are +5 coefficients, the first of which is *bb13* to indicate they are BondBond13 coefficients. In a data file, these coefficients should be listed under a *BondBond13 Coeffs* heading and you must leave out the -*bb13*, i.e. only list 3 coefficients after the dihedral type. +*bb13*, i.e. only list 4 coefficients after the dihedral type. * *bb13* -* :math:`N` (energy/distance\^2) +* :math:`D` (energy) +* :math:`\alpha` (inverse distance) * :math:`r_1` (distance) * :math:`r_3` (distance) +The dihedral, AngleTorsion and AngleAngleTorsion terms remain unchanged. + ---------- .. include:: accel_styles.rst @@ -159,9 +263,9 @@ listed under a *BondBond13 Coeffs* heading and you must leave out the Restrictions """""""""""" -This dihedral style can only be used if LAMMPS was built with the -CLASS2 package. See the :doc:`Build package ` doc -page for more info. +This dihedral style can only be used if LAMMPS was built with the CLASS2 +package. See the :doc:`Build package ` doc page for more +info. Related commands """""""""""""""" @@ -178,3 +282,7 @@ none .. _dihedral-Sun: **(Sun)** Sun, J Phys Chem B 102, 7338-7364 (1998). + +.. _dihedral-Kemppainen: + +**(Kemppainen)** Kemppainen, npj Computational Materials 11, 341 (2025). diff --git a/doc/src/dihedral_style.rst b/doc/src/dihedral_style.rst index 56b8ff52265..baf0e7eba80 100644 --- a/doc/src/dihedral_style.rst +++ b/doc/src/dihedral_style.rst @@ -10,7 +10,7 @@ Syntax dihedral_style style -* style = *none* or *zero* or *hybrid* or *charmm* or *charmmfsw* or *class2* or *cosine/shift/exp* or *cosine/squared/restricted* or *fourier* or *harmonic* or *helix* or *lepton* or *multi/harmonic* or *nharmonic* or *opls* or *spherical* or *table* or *table/cut* +* style = *none* or *zero* or *hybrid* or *charmm* or *charmmfsw* or *class2* or *class2xe* or *cosine/shift/exp* or *cosine/squared/restricted* or *fourier* or *harmonic* or *helix* or *lepton* or *multi/harmonic* or *nharmonic* or *opls* or *spherical* or *table* or *table/cut* Examples """""""" @@ -104,6 +104,7 @@ exist. * :doc:`charmm ` - CHARMM dihedral * :doc:`charmmfsw ` - CHARMM dihedral with force switching * :doc:`class2 ` - COMPASS (class 2) dihedral +* :doc:`class2xe ` - ClassII-xe (class 2) dihedral * :doc:`cosine/shift/exp ` - dihedral with exponential in spring constant * :doc:`cosine/squared/restricted ` - squared cosine dihedral with restricted term * :doc:`fourier ` - dihedral with multiple cosine terms diff --git a/doc/src/dump_image.rst b/doc/src/dump_image.rst index 5154e6f96aa..a69217daa86 100644 --- a/doc/src/dump_image.rst +++ b/doc/src/dump_image.rst @@ -496,7 +496,7 @@ is used to define particles as line segments, and will draw them as lines. If this keyword is not used, such particles will be drawn as spheres, the same as if they were regular atoms. -.. versionchanged:: TBD +.. versionchanged:: 30Mar2026 added *index* and *atom* color styles @@ -536,7 +536,7 @@ edges are drawn, the *width* setting determines the diameters of the line segments. If this keyword is not used, triangle particles will be drawn as spheres, the same as if they were regular atoms. -.. versionchanged:: TBD +.. versionchanged:: 30Mar2026 added *index* and *atom* color styles @@ -566,7 +566,7 @@ colors than atom types are desired, the *number of atom types* must be .. versionadded:: 11Feb2026 -.. versionchanged:: TBD +.. versionchanged:: 30Mar2026 Now uses rounded triangles @@ -579,7 +579,7 @@ If edges are drawn, the *width* setting determines the diameters of the line segments. If this keyword is not used, ellipsoid particles will be drawn as spheres, the same as if they were regular atoms. -.. versionchanged:: TBD +.. versionchanged:: 30Mar2026 added *index* and *atom* color styles @@ -605,7 +605,7 @@ colors than atom types are desired, the *number of atom types* must be *increased* correspondingly when using either the :doc:`create_box ` or the :doc:`read_data ` command. -.. versionchanged:: TBD +.. versionchanged:: 30Mar2026 changed initial geometry to icosahedron and use rounded triangles @@ -650,7 +650,7 @@ parameters mean for each body style. added *index* color style -.. versionchanged:: TBD +.. versionchanged:: 30Mar2026 added *atom* color style @@ -1183,7 +1183,7 @@ dump_modify color option. ---------- -.. versionchanged:: TBD +.. versionchanged:: 30Mar2026 add support for entering colors in hexadecimal diff --git a/doc/src/fix_colvars.rst b/doc/src/fix_colvars.rst index d16e367a91d..c34fb0d5f68 100644 --- a/doc/src/fix_colvars.rst +++ b/doc/src/fix_colvars.rst @@ -168,7 +168,7 @@ Aside from the state information in a ".colvars.state" file, other are produced by Colvars depending on the type of simulation. For this reason, the "output" keyword is required for fix colvars. -.. versionadded:: TBD +.. versionadded:: 30Mar2026 This fix provides access to a global array of the current values of each collective variable computed in the Colvars module. The number of rows diff --git a/doc/src/fix_gcmc.rst b/doc/src/fix_gcmc.rst index 04cbc326078..c4cd8e55f29 100644 --- a/doc/src/fix_gcmc.rst +++ b/doc/src/fix_gcmc.rst @@ -25,7 +25,7 @@ Syntax .. parsed-literal:: - keyword = *mol*, *region*, *maxangle*, *pressure*, *fugacity_coeff*, *full_energy*, *charge*, *group*, *grouptype*, *intra_energy*, *tfac_insert*, or *overlap_cutoff* + keyword = *mol* or *mcmoves* or *rigid* or *shake* or *region* or *maxangle* or *pressure* or *fugacity_coeff* or *full_energy* or *charge* or *group* or *grouptype* or *intra_energy* or *tfac_insert* or *overlap_cutoff* or *max* or *min* *mol* value = template-ID template-ID = ID of molecule template specified in a separate :doc:`molecule ` command *mcmoves* values = Patomtrans Pmoltrans Pmolrotate @@ -402,7 +402,10 @@ Restart, fix_modify, output, run start/stop, minimize info This fix writes the state of the fix to :doc:`binary restart files `. This includes information about the random number generator seed, the next timestep for MC exchanges, the number of MC -step attempts and successes etc. See the :doc:`read_restart +step attempts and successes etc. This ensures that the +sequence of Monte Carlo moves generated after reading from a restart +file are exactly the same as those that are generated in the original +run. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. diff --git a/doc/src/fix_lambda_la_csp_apip.rst b/doc/src/fix_lambda_la_csp_apip.rst index dce4a141de9..ee7a541f8a8 100644 --- a/doc/src/fix_lambda_la_csp_apip.rst +++ b/doc/src/fix_lambda_la_csp_apip.rst @@ -48,7 +48,7 @@ Examples Description """"""""""" -.. versionadded:: TBD +.. versionadded:: 30Mar2026 The potential energy :math:`E_i` of an atom :math:`i` according to an adaptive-precision potential is given by :ref:`(Immel2025) ` diff --git a/doc/src/fix_nh.rst b/doc/src/fix_nh.rst index bd207b88b43..e4fa7bd3891 100644 --- a/doc/src/fix_nh.rst +++ b/doc/src/fix_nh.rst @@ -373,7 +373,7 @@ large volume of communication needed to acquire ghost atoms around a processor's irregular-shaped subdomain. For extreme values of tilt, LAMMPS may also lose atoms and generate an error. -.. versionadded:: TBD +.. versionadded:: 30Mar2026 The *isochoric* keyword allows to maintain constant volume when barostatting up to two dimensions with this fix. The values following diff --git a/doc/src/group.rst b/doc/src/group.rst index 7fdf7069c0d..5f4c4f312ab 100644 --- a/doc/src/group.rst +++ b/doc/src/group.rst @@ -265,7 +265,7 @@ energy minimization, via the :doc:`minimize ` command, an assignment is made at the beginning of the minimization, but not during the iterations of the minimizer. -.. versionadded:: TBD +.. versionadded:: 30Mar2026 The optional *exclude* keyword has a group ID as argument and after all other atom selections for the dynamic group have been performed, it @@ -286,7 +286,7 @@ molecules straddle the region boundary, then atoms outside the region that are part of molecules with atoms inside the region will be added to the group (see above). -.. versionadded:: TBD +.. versionadded:: 30Mar2026 The optional *within* keyword with its *cutoff* argument adds atoms to a dynamic group that are within the given cutoff distance from any of the diff --git a/doc/src/labelmap.rst b/doc/src/labelmap.rst index 96db81727a6..da25857dce5 100644 --- a/doc/src/labelmap.rst +++ b/doc/src/labelmap.rst @@ -81,7 +81,7 @@ label mappings to a file as a sequence of *labelmap* commands, so the file can be copied into a new LAMMPS input file or read in using the :doc:`include ` command. -.. versionadded:: TBD +.. versionadded:: 30Mar2026 The *check_labels* keyword provides a warning if the type label of a bond, angle, dihedral, or improper defined in the simulation is not diff --git a/doc/src/molecule.rst b/doc/src/molecule.rst index fd1d478c18b..4ce823d3bcc 100644 --- a/doc/src/molecule.rst +++ b/doc/src/molecule.rst @@ -168,7 +168,7 @@ complex and are described on the doc page for each improper style in the `, thus binary restart files need to be converted to data files first. -.. versionadded:: TBD +.. versionadded:: 30Mar2026 The *auto* keyword allows the molecule command to generate new angles, dihedrals, and/or impropers, and assign their angle types, dihedral diff --git a/doc/src/pair_granular_superellipsoid.rst b/doc/src/pair_granular_superellipsoid.rst index 9c4d63f0611..a7a313b5f8f 100644 --- a/doc/src/pair_granular_superellipsoid.rst +++ b/doc/src/pair_granular_superellipsoid.rst @@ -30,7 +30,7 @@ Examples Description """"""""""" -.. versionadded:: TBD +.. versionadded:: 30Mar2026 The *granular/superellipsoid* style calculates granular contact forces between superellipsoidal particles (see :doc:`atom style ellipsoid diff --git a/doc/src/read_data.rst b/doc/src/read_data.rst index 72fc88c55c2..dcb29264eba 100644 --- a/doc/src/read_data.rst +++ b/doc/src/read_data.rst @@ -1365,7 +1365,7 @@ the quaternion that represents its new orientation is given by LAMMPS normalizes each atom's quaternion in case (a,b,c) is not specified as a unit vector. -.. versionadded:: TBD +.. versionadded:: 30Mar2026 The blockiness values *block1*, *block2* generalize the geometry to a super ellipsoid for use in granular simulations. Sections through the diff --git a/doc/src/set.rst b/doc/src/set.rst index 6af2b15a93d..7518ca536a9 100644 --- a/doc/src/set.rst +++ b/doc/src/set.rst @@ -541,7 +541,7 @@ other. Note that the SPH smoothing kernel diameter used for computing long range, nonlocal interactions, is set using the *diameter* keyword. -.. versionadded:: TBD +.. versionadded:: 30Mar2026 Keyword *block* sets the blockiness of the selected atoms. The particles must be ellipsoids as defined by the :doc:`atom_style diff --git a/doc/src/variable.rst b/doc/src/variable.rst index 7fa8bbfe39b..eac38749a66 100644 --- a/doc/src/variable.rst +++ b/doc/src/variable.rst @@ -227,7 +227,7 @@ from the list of active variables, and is thus available to be re-defined in a subsequent variable command. The *delete* style does the same thing. -.. versionchanged:: TBD +.. versionchanged:: 30Mar2026 .. admonition:: Auto-deleted variables can lead to problems :class: warning diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index d8ed1a1e258..1b7113b4959 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -4397,6 +4397,7 @@ Xcm Xcode xCORE xdmf +xe Xeon xflag xhi diff --git a/examples/PACKAGES/class2xe/README b/examples/PACKAGES/class2xe/README new file mode 100644 index 00000000000..d383f4a7fe9 --- /dev/null +++ b/examples/PACKAGES/class2xe/README @@ -0,0 +1,7 @@ +The data file was built with LUNAR: https://github.com/CMMRLab/LUNAR + +The math/science behind classII-xe and benchmarking can +be found at: https://doi.org/10.1038/s41524-025-01838-5 + +The example LAMMPS script was written by Josh Kemppainen, +if you have questions reach out to josh at: jdkemppa@mtu.edu diff --git a/examples/PACKAGES/class2xe/detda_PCFF-2xe.data b/examples/PACKAGES/class2xe/detda_PCFF-2xe.data new file mode 100644 index 00000000000..e63885600f9 --- /dev/null +++ b/examples/PACKAGES/class2xe/detda_PCFF-2xe.data @@ -0,0 +1,524 @@ +HEADER, detda.mol read w/ mol2lmp > atom_typing v1.7 / 4 November 2023 w/PCFF-IFF atom-types > all2lmp: v1.14 / 18 December 2023 Class: 2 > auto_morse_bond version: v1.13 / 15 October 2025 + +31 atoms +31 bonds +54 angles +68 dihedrals +28 impropers + +6 atom types +9 bond types +14 angle types +14 dihedral types +11 improper types + +-10.000000000 10.000000000 xlo xhi +-10.000000000 10.000000000 ylo yhi +-10.000000000 10.000000000 zlo zhi + +Atom Type Labels + + 1 c2 + 2 c3 + 3 cp + 4 hc + 5 hn + 6 nn + +Bond Type Labels + + 1 c2-c3 + 2 c2-cp + 3 c2-hc + 4 c3-cp + 5 c3-hc + 6 cp-cp + 7 cp-hc + 8 cp-nn + 9 hn-nn + +Angle Type Labels + + 1 c2-c3-hc + 2 c2-cp-cp + 3 c3-c2-cp + 4 c3-c2-hc + 5 c3-cp-cp + 6 cp-c2-hc + 7 cp-c3-hc + 8 cp-cp-cp + 9 cp-cp-hc +10 cp-cp-nn +11 cp-nn-hn +12 hc-c2-hc +13 hc-c3-hc +14 hn-nn-hn + +Dihedral Type Labels + + 1 cp-c2-c3-hc + 2 hc-c2-c3-hc + 3 c3-c2-cp-cp + 4 hc-c2-cp-cp + 5 hc-c3-cp-cp + 6 c3-cp-cp-cp + 7 c2-cp-cp-cp + 8 cp-cp-cp-cp + 9 cp-cp-cp-hc +10 c2-cp-cp-hc +11 c3-cp-cp-nn +12 c2-cp-cp-nn +13 cp-cp-cp-nn +14 cp-cp-nn-hn + +Improper Type Labels + + 1 c2-cp-cp-cp-nb==3 + 2 c3-cp-cp-cp-nb==3 + 3 cp-cp-cp-hc-nb==3 + 4 cp-cp-cp-nn-nb==3 + 5 cp-nn-hn-hn-nb==3 + 6 c2-c3-hc-hc-nb!=3 + 7 c3-c2-cp-hc-nb!=3 + 8 c3-c2-hc-hc-nb!=3 + 9 cp-c2-hc-hc-nb!=3 +10 cp-c3-hc-hc-nb!=3 +11 hc-c3-hc-hc-nb!=3 + +Masses + + 1 12.01115 # c2 + 2 12.01115 # c3 + 3 12.01115 # cp + 4 1.00797 # hc + 5 1.00797 # hn + 6 14.00670 # nn + +Pair Coeffs # lj/class2/coul/long + + 1 0.05400000 4.01000000 # c2 + 2 0.05400000 3.90000000 # c3 + 3 0.06400000 4.01000000 # cp + 4 0.02000000 2.99500000 # hc + 5 0.01300000 1.09800000 # hn + 6 0.06500000 4.07000000 # nn + +Bond Coeffs # morse + + 1 82.69610000 2.00000000 1.53000000 # c2 c3 + 2 82.69610000 2.00000000 1.50100000 # c2 cp + 3 98.23150000 2.00000000 1.10100000 # c2 hc + 4 82.69610000 2.00000000 1.50100000 # c3 cp + 5 98.23150000 2.00000000 1.10100000 # c3 hc + 6 150.00000000 1.90000000 1.41700000 # cp cp + 7 98.23150000 2.10000000 1.09820000 # cp hc + 8 110.00010000 2.10000000 1.39120000 # cp nn + 9 92.25630000 2.40000000 1.00120000 # hn nn + +Angle Coeffs # class2xe + + 1 110.77000000 41.45300000 -10.60400000 5.12900000 # c2 c3 hc + 2 120.05000000 44.71480000 -22.73520000 0.00000000 # c2 cp cp + 3 108.40000000 43.95940000 -8.39240000 -9.33790000 # c3 c2 cp + 4 110.77000000 41.45300000 -10.60400000 5.12900000 # c3 c2 hc + 5 120.05000000 44.71480000 -22.73520000 0.00000000 # c3 cp cp + 6 111.00000000 44.32340000 -9.44540000 0.00000000 # cp c2 hc + 7 111.00000000 44.32340000 -9.44540000 0.00000000 # cp c3 hc + 8 118.90000000 61.02260000 -34.99310000 0.00000000 # cp cp cp + 9 117.94000000 35.15580000 -12.46820000 0.00000000 # cp cp hc +10 121.45840000 61.06470000 -21.61720000 0.00000000 # cp cp nn +11 111.87250000 40.83690000 -15.66730000 0.00000000 # cp nn hn +12 107.66000000 39.64100000 -12.92100000 -2.43180000 # hc c2 hc +13 107.66000000 39.64100000 -12.92100000 -2.43180000 # hc c3 hc +14 107.51300000 42.51820000 -21.75660000 -4.33720000 # hn nn hn + +Dihedral Coeffs # class2xe + + 1 -0.02280000 0.00000000 0.02800000 0.00000000 -0.18630000 0.00000000 # cp c2 c3 hc + 2 -0.14320000 0.00000000 0.06170000 0.00000000 -0.10830000 0.00000000 # hc c2 c3 hc + 3 -0.28020000 0.00000000 -0.06780000 0.00000000 -0.01220000 0.00000000 # c3 c2 cp cp + 4 -0.28010000 0.00000000 -0.06780000 0.00000000 -0.01220000 0.00000000 # hc c2 cp cp + 5 -0.28010000 0.00000000 -0.06780000 0.00000000 -0.01220000 0.00000000 # hc c3 cp cp + 6 0.00000000 0.00000000 4.40720000 0.00000000 0.00000000 0.00000000 # c3 cp cp cp + 7 0.00000000 0.00000000 4.40720000 0.00000000 0.00000000 0.00000000 # c2 cp cp cp + 8 8.36670000 0.00000000 1.19320000 0.00000000 0.00000000 0.00000000 # cp cp cp cp + 9 0.00000000 0.00000000 3.96610000 0.00000000 0.00000000 0.00000000 # cp cp cp hc +10 0.00000000 0.00000000 1.55900000 0.00000000 0.00000000 0.00000000 # c2 cp cp hc +11 0.00000000 0.00000000 3.00000000 0.00000000 0.00000000 0.00000000 # c3 cp cp nn +12 0.00000000 0.00000000 3.00000000 0.00000000 0.00000000 0.00000000 # c2 cp cp nn +13 0.00000000 0.00000000 5.38260000 0.00000000 0.00000000 0.00000000 # cp cp cp nn +14 0.00000000 0.00000000 1.21900000 0.00000000 0.00000000 0.00000000 # cp cp nn hn + +Improper Coeffs # class2 + + 1 7.81530000 0.00000000 # c2 cp cp cp nb==3 + 2 7.81530000 0.00000000 # c3 cp cp cp nb==3 + 3 4.89120000 0.00000000 # cp cp cp hc nb==3 + 4 10.78550000 0.00000000 # cp cp cp nn nb==3 + 5 0.00000000 0.00000000 # cp nn hn hn nb==3 + 6 0.00000000 0.00000000 # c2 c3 hc hc nb!=3 + 7 0.00000000 0.00000000 # c3 c2 cp hc nb!=3 + 8 0.00000000 0.00000000 # c3 c2 hc hc nb!=3 + 9 0.00000000 0.00000000 # cp c2 hc hc nb!=3 +10 0.00000000 0.00000000 # cp c3 hc hc nb!=3 +11 0.00000000 0.00000000 # hc c3 hc hc nb!=3 + +BondBond Coeffs # class2xe + + 1 90.46380000 0.13682580 1.53000000 1.10100000 # c2 c3 hc + 2 116.34805000 0.22772772 1.50100000 1.41700000 # c2 cp cp + 3 82.69610000 0.00000000 1.53000000 1.50100000 # c3 c2 cp + 4 90.46380000 0.13682580 1.53000000 1.10100000 # c3 c2 hc + 5 116.34805000 0.22772772 1.50100000 1.41700000 # c3 cp cp + 6 90.46380000 0.12696994 1.50100000 1.10100000 # cp c2 hc + 7 90.46380000 0.12696994 1.50100000 1.10100000 # cp c3 hc + 8 150.00000000 0.47709398 1.41700000 1.41700000 # cp cp cp + 9 124.11575000 0.06594515 1.41700000 1.09820000 # cp cp hc +10 130.00005000 0.42494924 1.41700000 1.39120000 # cp cp nn +11 101.12820000 0.14981086 1.39120000 1.00120000 # cp nn hn +12 98.23150000 0.16473595 1.10100000 1.10100000 # hc c2 hc +13 98.23150000 0.16473595 1.10100000 1.10100000 # hc c3 hc +14 -92.25630000 0.23215756 1.00120000 1.00120000 # hn nn hn + +BondAngle Coeffs # class2xe + + 1 82.69610000 98.23150000 0.35423657 0.24110803 1.53000000 1.10100000 # c2 c3 hc + 2 82.69610000 150.00000000 0.53340706 0.32185452 1.50100000 1.41700000 # c2 cp cp + 3 82.69610000 82.69610000 0.00000000 0.00000000 1.53000000 1.50100000 # c3 c2 cp + 4 82.69610000 98.23150000 0.35423657 0.24110803 1.53000000 1.10100000 # c3 c2 hc + 5 82.69610000 150.00000000 0.53340706 0.32185452 1.50100000 1.41700000 # c3 cp cp + 6 82.69610000 98.23150000 0.39998525 0.24478185 1.50100000 1.10100000 # cp c2 hc + 7 82.69610000 98.23150000 0.39998525 0.24478185 1.50100000 1.10100000 # cp c3 hc + 8 150.00000000 150.00000000 0.31021928 0.31021928 1.41700000 1.41700000 # cp cp cp + 9 150.00000000 98.23150000 0.25822019 0.35110049 1.41700000 1.09820000 # cp cp hc +10 150.00000000 110.00010000 0.36241781 0.57861407 1.41700000 1.39120000 # cp cp nn +11 110.00010000 92.25630000 0.41871212 0.29951424 1.39120000 1.00120000 # cp nn hn +12 98.23150000 98.23150000 0.30355325 0.30355325 1.10100000 1.10100000 # hc c2 hc +13 98.23150000 98.23150000 0.30355325 0.30355325 1.10100000 1.10100000 # hc c3 hc +14 92.25630000 92.25630000 0.30495926 0.30495926 1.00120000 1.00120000 # hn nn hn + +AngleAngleTorsion Coeffs # class2xe + + 1 0.00000000 108.40000000 110.77000000 # cp c2 c3 hc + 2 -12.56400000 110.77000000 110.77000000 # hc c2 c3 hc + 3 0.00000000 108.40000000 120.05000000 # c3 c2 cp cp + 4 -5.88880000 111.00000000 120.05000000 # hc c2 cp cp + 5 -5.88880000 111.00000000 120.05000000 # hc c3 cp cp + 6 -14.40970000 120.05000000 118.90000000 # c3 cp cp cp + 7 -14.40970000 120.05000000 118.90000000 # c2 cp cp cp + 8 0.00000000 118.90000000 118.90000000 # cp cp cp cp + 9 -4.81410000 118.90000000 117.94000000 # cp cp cp hc +10 4.44440000 120.05000000 117.94000000 # c2 cp cp hc +11 0.00000000 120.05000000 121.45840000 # c3 cp cp nn +12 0.00000000 120.05000000 121.45840000 # c2 cp cp nn +13 0.00000000 118.90000000 121.45840000 # cp cp cp nn +14 -7.17550000 121.45840000 111.87250000 # cp cp nn hn + +EndBondTorsion Coeffs # class2xe + + 1 2.00000000 2.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 1.50100000 1.10100000 # cp c2 c3 hc + 2 2.00000000 2.00000000 0.21300000 0.31200000 0.07770000 0.21300000 0.31200000 0.07770000 1.10100000 1.10100000 # hc c2 c3 hc + 3 2.00000000 1.90000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 1.53000000 1.41700000 # c3 c2 cp cp + 4 2.00000000 1.90000000 1.39970000 0.77560000 0.00000000 -0.58350000 1.12200000 0.39780000 1.10100000 1.41700000 # hc c2 cp cp + 5 2.00000000 1.90000000 1.39970000 0.77560000 0.00000000 -0.58350000 1.12200000 0.39780000 1.10100000 1.41700000 # hc c3 cp cp + 6 2.00000000 1.90000000 0.00000000 0.24210000 0.00000000 0.00000000 -0.69180000 0.00000000 1.50100000 1.41700000 # c3 cp cp cp + 7 2.00000000 1.90000000 0.00000000 0.24210000 0.00000000 0.00000000 -0.69180000 0.00000000 1.50100000 1.41700000 # c2 cp cp cp + 8 1.90000000 1.90000000 -0.11850000 6.32040000 0.00000000 -0.11850000 6.32040000 0.00000000 1.41700000 1.41700000 # cp cp cp cp + 9 1.90000000 2.10000000 0.00000000 -6.89580000 0.00000000 0.00000000 -0.46690000 0.00000000 1.41700000 1.09820000 # cp cp cp hc +10 2.00000000 2.10000000 0.00000000 -1.79700000 0.00000000 0.00000000 -0.48790000 0.00000000 1.50100000 1.09820000 # c2 cp cp hc +11 2.00000000 2.10000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 1.50100000 1.39120000 # c3 cp cp nn +12 2.00000000 2.10000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 1.50100000 1.39120000 # c2 cp cp nn +13 1.90000000 2.10000000 0.00000000 -6.54040000 0.00000000 0.00000000 -7.34770000 0.00000000 1.41700000 1.39120000 # cp cp cp nn +14 1.90000000 2.40000000 0.00000000 -3.72810000 0.00000000 0.00000000 0.28490000 0.00000000 1.41700000 1.00120000 # cp cp nn hn + +MiddleBondTorsion Coeffs # class2xe + + 1 2.00000000 0.00000000 0.00000000 0.00000000 1.53000000 # cp c2 c3 hc + 2 2.00000000 -14.26100000 -0.53220000 -0.48640000 1.53000000 # hc c2 c3 hc + 3 2.00000000 0.00000000 0.00000000 0.00000000 1.50100000 # c3 c2 cp cp + 4 2.00000000 -5.56790000 1.40830000 0.30100000 1.50100000 # hc c2 cp cp + 5 2.00000000 -5.56790000 1.40830000 0.30100000 1.50100000 # hc c3 cp cp + 6 1.90000000 0.00000000 9.17920000 0.00000000 1.41700000 # c3 cp cp cp + 7 1.90000000 0.00000000 9.17920000 0.00000000 1.41700000 # c2 cp cp cp + 8 1.90000000 27.59890000 -2.31200000 0.00000000 1.41700000 # cp cp cp cp + 9 1.90000000 0.00000000 -1.15210000 0.00000000 1.41700000 # cp cp cp hc +10 1.90000000 0.00000000 3.94210000 0.00000000 1.41700000 # c2 cp cp hc +11 1.90000000 0.00000000 0.00000000 0.00000000 1.41700000 # c3 cp cp nn +12 1.90000000 0.00000000 0.00000000 0.00000000 1.41700000 # c2 cp cp nn +13 1.90000000 0.00000000 -0.56930000 0.00000000 1.41700000 # cp cp cp nn +14 2.10000000 0.00000000 3.20850000 0.00000000 1.39120000 # cp cp nn hn + +BondBond13 Coeffs # class2xe + + 1 90.46380000 0.00000000 1.50100000 1.10100000 # cp c2 c3 hc + 2 98.23150000 0.00000000 1.10100000 1.10100000 # hc c2 c3 hc + 3 116.34805000 0.00000000 1.53000000 1.41700000 # c3 c2 cp cp + 4 -124.11575000 0.11844681 1.10100000 1.41700000 # hc c2 cp cp + 5 -124.11575000 0.11844681 1.10100000 1.41700000 # hc c3 cp cp + 6 116.34805000 0.10382752 1.50100000 1.41700000 # c3 cp cp cp + 7 116.34805000 0.10382752 1.50100000 1.41700000 # c2 cp cp cp + 8 150.00000000 0.42031734 1.41700000 1.41700000 # cp cp cp cp + 9 -124.11575000 0.15898175 1.41700000 1.09820000 # cp cp cp hc +10 90.46380000 0.06951489 1.50100000 1.09820000 # c2 cp cp hc +11 96.34810000 0.00000000 1.50100000 1.39120000 # c3 cp cp nn +12 96.34810000 0.00000000 1.50100000 1.39120000 # c2 cp cp nn +13 -130.00005000 0.19414404 1.41700000 1.39120000 # cp cp cp nn +14 121.12815000 0.13224254 1.41700000 1.00120000 # cp cp nn hn + +AngleTorsion Coeffs # class2xe + + 1 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 108.40000000 110.77000000 # cp c2 c3 hc + 2 -0.80850000 0.55690000 -0.24660000 -0.80850000 0.55690000 -0.24660000 110.77000000 110.77000000 # hc c2 c3 hc + 3 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 108.40000000 120.05000000 # c3 c2 cp cp + 4 4.62660000 0.16320000 0.04610000 0.22510000 0.65480000 0.12370000 111.00000000 120.05000000 # hc c2 cp cp + 5 4.62660000 0.16320000 0.04610000 0.22510000 0.65480000 0.12370000 111.00000000 120.05000000 # hc c3 cp cp + 6 0.00000000 -4.46830000 0.00000000 0.00000000 3.89870000 0.00000000 120.05000000 118.90000000 # c3 cp cp cp + 7 0.00000000 -4.46830000 0.00000000 0.00000000 3.89870000 0.00000000 120.05000000 118.90000000 # c2 cp cp cp + 8 1.97670000 1.02390000 0.00000000 1.97670000 1.02390000 0.00000000 118.90000000 118.90000000 # cp cp cp cp + 9 0.00000000 2.50140000 0.00000000 0.00000000 2.71470000 0.00000000 118.90000000 117.94000000 # cp cp cp hc +10 0.00000000 -0.12420000 0.00000000 0.00000000 3.46010000 0.00000000 120.05000000 117.94000000 # c2 cp cp hc +11 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 120.05000000 121.45840000 # c3 cp cp nn +12 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 120.05000000 121.45840000 # c2 cp cp nn +13 0.00000000 9.09010000 0.00000000 0.00000000 -6.08820000 0.00000000 118.90000000 121.45840000 # cp cp cp nn +14 0.00000000 1.26160000 0.00000000 0.00000000 0.77440000 0.00000000 121.45840000 111.87250000 # cp cp nn hn + +AngleAngle Coeffs # class2 + + 1 0.00000000 0.00000000 0.00000000 120.05000000 118.90000000 120.05000000 # c2 cp cp cp nb==3 + 2 0.00000000 0.00000000 0.00000000 120.05000000 118.90000000 120.05000000 # c3 cp cp cp nb==3 + 3 0.00000000 0.00000000 0.00000000 118.90000000 117.94000000 117.94000000 # cp cp cp hc nb==3 + 4 0.00000000 0.00000000 0.00000000 118.90000000 121.45840000 121.45840000 # cp cp cp nn nb==3 + 5 0.00000000 0.00000000 0.00000000 111.87250000 107.51300000 111.87250000 # cp nn hn hn nb==3 + 6 0.27380000 -0.48250000 0.27380000 110.77000000 110.77000000 107.66000000 # c2 c3 hc hc nb!=3 + 7 2.04030000 -1.82020000 1.08270000 108.40000000 110.77000000 111.00000000 # c3 c2 cp hc nb!=3 + 8 0.27380000 -0.48250000 0.27380000 110.77000000 110.77000000 107.66000000 # c3 c2 hc hc nb!=3 + 9 2.37940000 3.01180000 2.37940000 111.00000000 111.00000000 107.66000000 # cp c2 hc hc nb!=3 +10 2.37940000 3.01180000 2.37940000 111.00000000 111.00000000 107.66000000 # cp c3 hc hc nb!=3 +11 -0.31570000 -0.31570000 -0.31570000 107.66000000 107.66000000 107.66000000 # hc c3 hc hc nb!=3 + +Atoms # full + + 1 1 3 0.000000 -1.596190323 0.232054839 -0.000003226 0 0 0 # cp/C + 2 1 3 0.082700 -0.977190323 -0.971745161 -0.000003226 0 0 0 # cp/C + 3 1 3 0.000000 0.371109677 -1.056245161 -0.000003226 0 0 0 # cp/C + 4 1 3 -0.126800 1.062509677 0.099854839 -0.000103226 0 0 0 # cp/C + 5 1 3 0.000000 0.494309677 1.315354839 -0.000103226 0 0 0 # cp/C + 6 1 3 0.082700 -0.851090323 1.358054839 -0.000003226 0 0 0 # cp/C + 7 1 1 -0.106000 1.326109677 2.590054839 -0.000103226 0 0 0 # c2/C + 8 1 2 -0.159000 2.855209677 2.449754839 -0.000003226 0 0 0 # c3/C + 9 1 1 -0.106000 1.247009677 -2.308945161 -0.000003226 0 0 0 # c2/C + 10 1 2 -0.159000 0.690509677 -3.736545161 0.000196774 0 0 0 # c3/C + 11 1 2 -0.159000 -3.111990323 0.385054839 -0.000003226 0 0 0 # c3/C + 12 1 6 -0.580100 -1.420690323 2.493454839 -0.000103226 0 0 0 # nn/N + 13 1 6 -0.580100 -1.693590323 -2.018245161 0.000096774 0 0 0 # nn/N + 14 1 4 0.126800 2.160909677 0.031154839 -0.000103226 0 0 0 # hc/H + 15 1 4 0.053000 1.047309677 3.184754839 -0.904103226 0 0 0 # hc/H + 16 1 4 0.053000 1.047209677 3.184954839 0.903696774 0 0 0 # hc/H + 17 1 4 0.053000 3.340909677 3.453254839 -0.000003226 0 0 0 # hc/H + 18 1 4 0.053000 3.221009677 1.916954839 0.907496774 0 0 0 # hc/H + 19 1 4 0.053000 3.221109677 1.916854839 -0.907403226 0 0 0 # hc/H + 20 1 4 0.053000 1.910909677 -2.234745161 -0.897603226 0 0 0 # hc/H + 21 1 4 0.053000 1.911009677 -2.234645161 0.897496774 0 0 0 # hc/H + 22 1 4 0.053000 1.523909677 -4.477545161 0.000196774 0 0 0 # hc/H + 23 1 4 0.053000 0.093509677 -3.950845161 0.915896774 0 0 0 # hc/H + 24 1 4 0.053000 0.093509677 -3.951045161 -0.915503226 0 0 0 # hc/H + 25 1 4 0.053000 -3.710490323 -0.546245161 -0.000203226 0 0 0 # hc/H + 26 1 4 0.053000 -3.442090323 0.941854839 0.906896774 0 0 0 # hc/H + 27 1 4 0.053000 -3.442090323 0.942154839 -0.906703226 0 0 0 # hc/H + 28 1 5 0.248700 -2.463690323 2.591454839 -0.000003226 0 0 0 # hn/H + 29 1 5 0.248700 -0.868790323 3.384154839 -0.000103226 0 0 0 # hn/H + 30 1 5 0.248700 -1.302090323 -2.982245161 0.000096774 0 0 0 # hn/H + 31 1 5 0.248700 -2.738090323 -2.002145161 0.000096774 0 0 0 # hn/H + +Bonds + +1 6 1 2 +2 6 1 6 +3 4 11 1 +4 6 2 3 +5 8 2 13 +6 6 3 4 +7 2 9 3 +8 6 4 5 +9 7 4 14 +10 6 5 6 +11 2 7 5 +12 8 6 12 +13 1 7 8 +14 3 7 15 +15 3 7 16 +16 5 8 17 +17 5 8 18 +18 5 8 19 +19 1 9 10 +20 3 9 20 +21 3 9 21 +22 5 10 22 +23 5 10 23 +24 5 10 24 +25 5 11 25 +26 5 11 26 +27 5 11 27 +28 9 28 12 +29 9 29 12 +30 9 30 13 +31 9 31 13 + +Angles + +1 8 2 1 6 +2 5 11 1 6 +3 5 11 1 2 +4 10 3 2 13 +5 10 1 2 13 +6 8 1 2 3 +7 2 9 3 2 +8 8 2 3 4 +9 2 9 3 4 +10 9 5 4 14 +11 8 3 4 5 +12 9 3 4 14 +13 8 4 5 6 +14 2 7 5 6 +15 2 7 5 4 +16 10 1 6 12 +17 8 1 6 5 +18 10 5 6 12 +19 6 5 7 15 +20 4 8 7 16 +21 3 8 7 5 +22 4 8 7 15 +23 12 15 7 16 +24 6 5 7 16 +25 13 17 8 19 +26 1 7 8 19 +27 13 17 8 18 +28 1 7 8 18 +29 13 18 8 19 +30 1 7 8 17 +31 3 10 9 3 +32 4 10 9 20 +33 6 3 9 21 +34 6 3 9 20 +35 12 20 9 21 +36 4 10 9 21 +37 1 9 10 22 +38 1 9 10 24 +39 13 22 10 24 +40 13 23 10 24 +41 1 9 10 23 +42 13 22 10 23 +43 13 25 11 26 +44 7 1 11 26 +45 13 26 11 27 +46 7 1 11 25 +47 7 1 11 27 +48 13 25 11 27 +49 11 6 12 29 +50 11 6 12 28 +51 14 28 12 29 +52 14 30 13 31 +53 11 2 13 31 +54 11 2 13 30 + +Dihedrals + +1 11 11 1 6 12 +2 5 26 11 1 6 +3 5 27 11 1 2 +4 13 2 1 6 12 +5 13 6 1 2 13 +6 5 25 11 1 6 +7 5 26 11 1 2 +8 11 11 1 2 13 +9 8 2 1 6 5 +10 5 27 11 1 6 +11 5 25 11 1 2 +12 8 3 2 1 6 +13 14 1 2 13 30 +14 8 1 2 3 4 +15 14 3 2 13 31 +16 6 11 1 2 3 +17 7 9 3 2 1 +18 14 3 2 13 30 +19 14 1 2 13 31 +20 3 10 9 3 4 +21 13 4 3 2 13 +22 4 20 9 3 2 +23 10 9 3 4 14 +24 8 2 3 4 5 +25 4 21 9 3 4 +26 9 2 3 4 14 +27 3 10 9 3 2 +28 12 9 3 2 13 +29 4 20 9 3 4 +30 4 21 9 3 2 +31 8 3 4 5 6 +32 7 9 3 4 5 +33 7 7 5 4 3 +34 4 15 7 5 4 +35 4 15 7 5 6 +36 12 7 5 6 12 +37 3 8 7 5 4 +38 13 4 5 6 12 +39 3 8 7 5 6 +40 10 7 5 4 14 +41 4 16 7 5 4 +42 9 6 5 4 14 +43 4 16 7 5 6 +44 14 1 6 12 28 +45 8 1 6 5 4 +46 7 7 5 6 1 +47 14 5 6 12 28 +48 14 1 6 12 29 +49 6 11 1 6 5 +50 14 5 6 12 29 +51 2 16 7 8 18 +52 2 15 7 8 19 +53 1 5 7 8 17 +54 2 16 7 8 17 +55 2 15 7 8 18 +56 1 5 7 8 19 +57 2 16 7 8 19 +58 2 15 7 8 17 +59 1 5 7 8 18 +60 2 21 9 10 23 +61 1 3 9 10 22 +62 2 20 9 10 22 +63 2 21 9 10 22 +64 1 3 9 10 24 +65 2 20 9 10 24 +66 2 21 9 10 24 +67 1 3 9 10 23 +68 2 20 9 10 23 + +Impropers + +1 2 11 1 2 6 +2 4 1 2 3 13 +3 1 9 3 2 4 +4 3 3 4 5 14 +5 1 7 5 4 6 +6 4 1 6 5 12 +7 5 6 12 28 29 +8 5 2 13 30 31 +9 8 8 7 15 16 +10 9 5 7 15 16 +11 7 8 7 5 16 +12 7 8 7 5 15 +13 6 7 8 17 18 +14 6 7 8 18 19 +15 6 7 8 17 19 +16 11 17 8 18 19 +17 9 3 9 20 21 +18 7 10 9 3 21 +19 8 10 9 20 21 +20 7 10 9 3 20 +21 6 9 10 22 24 +22 11 22 10 23 24 +23 6 9 10 22 23 +24 6 9 10 23 24 +25 10 1 11 25 27 +26 11 25 11 26 27 +27 10 1 11 25 26 +28 10 1 11 26 27 diff --git a/examples/PACKAGES/class2xe/in.NVT_class2xe.script b/examples/PACKAGES/class2xe/in.NVT_class2xe.script new file mode 100644 index 00000000000..23664da7b66 --- /dev/null +++ b/examples/PACKAGES/class2xe/in.NVT_class2xe.script @@ -0,0 +1,47 @@ +# +# LAMMPS example script to call the class2-xe potential +# +#------------Input_variables------------ +variable pseed equal 12345 +variable myid string detda_class2xe_test + + +#------------Initialization------------ +units real +dimension 3 +boundary p p p +newton on + + +#------------Force Field------------ +atom_style full +bond_style morse +angle_style class2xe +dihedral_style class2xe +improper_style class2 +special_bonds lj/coul 0 0 1 + +kspace_style pppm 1.0e-4 +pair_style lj/class2/coul/long 12.0 +pair_modify mix sixthpower + +neighbor 2.0 bin +neigh_modify delay 0 every 1 check yes one 5000 page 100000 + +read_data detda_PCFF-2xe.data + + +#------------Thermosettings------------ +timestep 1.0 +thermo 10 +thermo_style custom step temp press density ke pe etotal evdwl ecoul epair ebond eangle edihed eimp +restart 10 rst1.a.${myid} rst2.a.${myid} + + +#------------Run some dynamics------------ +velocity all create 300 ${pseed} rot yes mom yes +fix 1 all nvt temp 300 300 $(100*dt) + +run 100 +write_data ${myid}.data + diff --git a/examples/PACKAGES/class2xe/log.11Feb26.class2xe.g++.1 b/examples/PACKAGES/class2xe/log.11Feb26.class2xe.g++.1 new file mode 100644 index 00000000000..cbba64e150a --- /dev/null +++ b/examples/PACKAGES/class2xe/log.11Feb26.class2xe.g++.1 @@ -0,0 +1,128 @@ +LAMMPS (11 Feb 2026) + using 1 OpenMP thread(s) per MPI task +Reading data file ... + orthogonal box = (-10 -10 -10) to (10 10 10) + 1 by 1 by 1 MPI processor grid + reading atom labelmap ... + reading bond labelmap ... + reading angle labelmap ... + reading dihedral labelmap ... + reading improper labelmap ... + reading atoms ... + 31 atoms + scanning bonds ... + 4 = max bonds/atom + scanning angles ... + 6 = max angles/atom + scanning dihedrals ... + 15 = max dihedrals/atom + scanning impropers ... + 4 = max impropers/atom + orthogonal box = (-10 -10 -10) to (10 10 10) + 1 by 1 by 1 MPI processor grid + reading bonds ... + 31 bonds + reading angles ... + 54 angles + reading dihedrals ... + 68 dihedrals + reading impropers ... + 28 impropers +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 1 + special bond factors coul: 0 0 1 + 4 = max # of 1-2 neighbors + 7 = max # of 1-3 neighbors + 10 = max # of special neighbors + special bonds CPU = 0.001 seconds + read_data CPU = 0.026 seconds + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: +- ClassII-xe Style: https://doi.org/10.1038/s41524-025-01838-5 +- Type Label Framework: https://doi.org/10.1021/acs.jpcb.3c08419 +The log file lists these citations in BibTeX format. + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +PPPM initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17877424 + grid = 5 5 5 + stencil order = 5 + estimated absolute RMS force accuracy = 0.00601225 + estimated relative force accuracy = 1.8105712e-05 + using double precision KISS FFT + 3d grid and FFT values/proc = 1000 125 +Generated 15 of 15 mixed pair_coeff terms from sixthpower/sixthpower mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 5000, page size: 100000 + master list distance cutoff = 14 + ghost atom cutoff = 14 + binsize = 7, bins = 3 3 3 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/class2/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Setting up Verlet run ... + Unit style : real + Current step : 0 + Time step : 1 +Per MPI rank memory allocation (min/avg/max) = 14.98 | 14.98 | 14.98 Mbytes + Step Temp Press Density KinEng PotEng TotEng E_vdwl E_coul E_pair E_bond E_angle E_dihed E_impro + 0 300 1739.4974 0.037005008 26.82729 50.795577 77.622867 20.655036 47.173946 31.194238 41.590973 15.446336 -37.451902 0.015931822 + 10 392.90619 14.768189 0.037005008 35.135361 41.835325 76.970687 19.746545 46.599878 29.679987 23.187758 20.023985 -31.861844 0.80543826 + 20 344.32353 -1718.9816 0.037005008 30.790892 45.28744 76.078332 14.239357 45.906296 23.47885 16.888354 14.255508 -9.3574917 0.02221999 + 30 396.32094 -1127.4506 0.037005008 35.440723 40.244508 75.685231 15.116786 45.849074 24.265104 22.306847 9.7769077 -16.578754 0.47440349 + 40 338.74793 1020.7769 0.037005008 30.292297 45.670472 75.962769 17.370352 45.899076 26.572666 27.685444 21.861584 -30.569892 0.12067103 + 50 285.37987 2305.7954 0.037005008 25.519895 50.809627 76.329522 19.205394 46.20846 28.716275 36.314245 15.817663 -30.314364 0.27580687 + 60 305.2622 1169.9177 0.037005008 27.297859 47.154733 74.452591 17.857056 46.723144 27.918252 23.626928 24.282943 -28.879101 0.20571015 + 70 329.41332 -590.62548 0.037005008 29.457556 44.771281 74.228837 15.677153 46.306206 25.297824 11.06237 22.88821 -14.691447 0.21432402 + 80 362.73192 -619.31497 0.037005008 32.437049 40.795975 73.233024 15.958011 46.196401 25.498357 27.843746 15.226837 -27.86224 0.089274965 + 90 248.50576 -875.30133 0.037005008 22.222454 50.451376 72.67383 17.856866 45.983233 27.136834 21.702464 25.637603 -24.067766 0.042239931 + 100 295.1639 -224.80687 0.037005008 26.394826 45.321518 71.716344 18.987736 46.309596 28.632455 26.341346 16.848156 -26.826461 0.32602225 +Loop time of 0.0576385 on 1 procs for 100 steps with 31 atoms + +Performance: 149.900 ns/day, 0.160 hours/ns, 1734.952 timesteps/s, 53.784 katom-step/s +10.6% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.001074 | 0.001074 | 0.001074 | 0.0 | 1.86 +Bond | 0.0036317 | 0.0036317 | 0.0036317 | 0.0 | 6.30 +Kspace | 0.0023867 | 0.0023867 | 0.0023867 | 0.0 | 4.14 +Neigh | 0.0006792 | 0.0006792 | 0.0006792 | 0.0 | 1.18 +Comm | 0.0003439 | 0.0003439 | 0.0003439 | 0.0 | 0.60 +Output | 0.049246 | 0.049246 | 0.049246 | 0.0 | 85.44 +Modify | 0.0001265 | 0.0001265 | 0.0001265 | 0.0 | 0.22 +Other | | 0.0001507 | | | 0.26 + +Nlocal: 31 ave 31 max 31 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 788 ave 788 max 788 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 512 ave 512 max 512 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 512 +Ave neighs/atom = 16.516129 +Ave special neighs/atom = 5.483871 +Neighbor list builds = 10 +Dangerous builds = 0 +System init for write_data ... +PPPM initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17877424 + grid = 5 5 5 + stencil order = 5 + estimated absolute RMS force accuracy = 0.00601225 + estimated relative force accuracy = 1.8105712e-05 + using double precision KISS FFT + 3d grid and FFT values/proc = 1000 125 +Generated 15 of 15 mixed pair_coeff terms from sixthpower/sixthpower mixing rule +Total wall time: 0:00:00 diff --git a/examples/PACKAGES/class2xe/log.11Feb26.class2xe.g++.4 b/examples/PACKAGES/class2xe/log.11Feb26.class2xe.g++.4 new file mode 100644 index 00000000000..f0e02569b7c --- /dev/null +++ b/examples/PACKAGES/class2xe/log.11Feb26.class2xe.g++.4 @@ -0,0 +1,128 @@ +LAMMPS (11 Feb 2026) + using 1 OpenMP thread(s) per MPI task +Reading data file ... + orthogonal box = (-10 -10 -10) to (10 10 10) + 1 by 2 by 2 MPI processor grid + reading atom labelmap ... + reading bond labelmap ... + reading angle labelmap ... + reading dihedral labelmap ... + reading improper labelmap ... + reading atoms ... + 31 atoms + scanning bonds ... + 4 = max bonds/atom + scanning angles ... + 6 = max angles/atom + scanning dihedrals ... + 15 = max dihedrals/atom + scanning impropers ... + 4 = max impropers/atom + orthogonal box = (-10 -10 -10) to (10 10 10) + 1 by 2 by 2 MPI processor grid + reading bonds ... + 31 bonds + reading angles ... + 54 angles + reading dihedrals ... + 68 dihedrals + reading impropers ... + 28 impropers +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 1 + special bond factors coul: 0 0 1 + 4 = max # of 1-2 neighbors + 7 = max # of 1-3 neighbors + 10 = max # of special neighbors + special bonds CPU = 0.001 seconds + read_data CPU = 0.036 seconds + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: +- ClassII-xe Style: https://doi.org/10.1038/s41524-025-01838-5 +- Type Label Framework: https://doi.org/10.1021/acs.jpcb.3c08419 +The log file lists these citations in BibTeX format. + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +PPPM initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17877424 + grid = 5 5 5 + stencil order = 5 + estimated absolute RMS force accuracy = 0.00601225 + estimated relative force accuracy = 1.8105712e-05 + using double precision KISS FFT + 3d grid and FFT values/proc = 640 45 +Generated 15 of 15 mixed pair_coeff terms from sixthpower/sixthpower mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 5000, page size: 100000 + master list distance cutoff = 14 + ghost atom cutoff = 14 + binsize = 7, bins = 3 3 3 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/class2/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Setting up Verlet run ... + Unit style : real + Current step : 0 + Time step : 1 +Per MPI rank memory allocation (min/avg/max) = 14.93 | 15.14 | 15.58 Mbytes + Step Temp Press Density KinEng PotEng TotEng E_vdwl E_coul E_pair E_bond E_angle E_dihed E_impro + 0 300 1739.4974 0.037005008 26.82729 50.795577 77.622867 20.655036 47.173946 31.194238 41.590973 15.446336 -37.451902 0.015931822 + 10 392.90619 14.768189 0.037005008 35.135361 41.835325 76.970687 19.746545 46.599878 29.679987 23.187758 20.023985 -31.861844 0.80543826 + 20 344.32353 -1718.9816 0.037005008 30.790892 45.28744 76.078332 14.239357 45.906296 23.47885 16.888354 14.255508 -9.3574917 0.02221999 + 30 396.32094 -1127.4506 0.037005008 35.440723 40.244508 75.685231 15.116786 45.849074 24.265104 22.306847 9.7769077 -16.578754 0.47440349 + 40 338.74793 1020.7769 0.037005008 30.292297 45.670472 75.962769 17.370352 45.899076 26.572666 27.685444 21.861584 -30.569892 0.12067103 + 50 285.37987 2305.7954 0.037005008 25.519895 50.809627 76.329522 19.205394 46.20846 28.716275 36.314245 15.817663 -30.314364 0.27580687 + 60 305.2622 1169.9177 0.037005008 27.297859 47.154733 74.452591 17.857056 46.723144 27.918252 23.626928 24.282943 -28.879101 0.20571015 + 70 329.41332 -590.62548 0.037005008 29.457556 44.771281 74.228837 15.677153 46.306206 25.297824 11.06237 22.88821 -14.691447 0.21432402 + 80 362.73192 -619.31497 0.037005008 32.437049 40.795975 73.233024 15.958011 46.196401 25.498357 27.843746 15.226837 -27.86224 0.089274965 + 90 248.50576 -875.30133 0.037005008 22.222454 50.451376 72.67383 17.856866 45.983233 27.136834 21.702464 25.637603 -24.067766 0.042239931 + 100 295.1639 -224.80687 0.037005008 26.394826 45.321518 71.716344 18.987736 46.309596 28.632455 26.341346 16.848156 -26.826461 0.32602225 +Loop time of 0.0843581 on 4 procs for 100 steps with 31 atoms + +Performance: 102.420 ns/day, 0.234 hours/ns, 1185.422 timesteps/s, 36.748 katom-step/s +76.6% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0002442 | 0.00045187 | 0.0006193 | 0.0 | 0.54 +Bond | 0.0003901 | 0.0011175 | 0.0018941 | 1.7 | 1.32 +Kspace | 0.0045432 | 0.0050136 | 0.0055096 | 0.5 | 5.94 +Neigh | 0.0004722 | 0.00049452 | 0.0005168 | 0.0 | 0.59 +Comm | 0.001994 | 0.0020892 | 0.0021904 | 0.2 | 2.48 +Output | 0.074685 | 0.074687 | 0.074689 | 0.0 | 88.54 +Modify | 0.0002263 | 0.00024025 | 0.0002482 | 0.0 | 0.28 +Other | | 0.0002645 | | | 0.31 + +Nlocal: 7.75 ave 10 max 7 min +Histogram: 3 0 0 0 0 0 0 0 0 1 +Nghost: 358.25 ave 365 max 353 min +Histogram: 2 0 0 0 0 0 0 1 0 1 +Neighs: 128 ave 218 max 23 min +Histogram: 1 0 1 0 0 0 0 0 0 2 + +Total # of neighbors = 512 +Ave neighs/atom = 16.516129 +Ave special neighs/atom = 5.483871 +Neighbor list builds = 10 +Dangerous builds = 0 +System init for write_data ... +PPPM initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17877424 + grid = 5 5 5 + stencil order = 5 + estimated absolute RMS force accuracy = 0.00601225 + estimated relative force accuracy = 1.8105712e-05 + using double precision KISS FFT + 3d grid and FFT values/proc = 640 45 +Generated 15 of 15 mixed pair_coeff terms from sixthpower/sixthpower mixing rule +Total wall time: 0:00:00 diff --git a/examples/mc/in.gcmc.restart b/examples/mc/in.gcmc.restart new file mode 100644 index 00000000000..461f24e94b0 --- /dev/null +++ b/examples/mc/in.gcmc.restart @@ -0,0 +1,220 @@ +# Test correctness GCMC restart +# Restart should exactly reproduce original simulation + +### LJ ### + +variable mu equal -1.25 +variable temp equal 2.0 +variable disp equal 1.0 +variable lbox equal 5.0 +variable nequil equal 100 +variable nsteps equal 1000 +variable restartfile string restart.gcmc.lj + +# global model settings + +units lj +atom_style atomic +pair_style lj/cut 3.0 +pair_modify tail no # turn of to avoid triggering full_energy + +# box and other settings + +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} +create_box 1 box +group gcmcgroup type 1 +pair_coeff * * 1.0 1.0 +mass * 1.0 + +# gcmc + +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} + +# output + +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms + +# run equilibration and write restart + +run ${nequil} +write_restart ${restartfile} + +# run simulation, store reference values, and clear simulation + +run ${nsteps} +variable tmp equal temp +variable tref equal ${tmp} +variable tmp equal press +variable pref equal ${tmp} +variable tmp equal sum(f_mygcmc) +variable gcmcref equal ${tmp} +clear + +# rerun simulation from restart + +read_restart ${restartfile} + +# gcmc + +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} + +# output + +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms + +# rerun simulation from restart, measure errors, and clear + +run ${nsteps} +variable tmp equal temp +variable terror equal ${tmp} - v_tref +variable tmp equal press +variable perror equal ${tmp} - v_pref +variable tmp equal sum(f_mygcmc) +variable gcmcerror equal ${tmp} - v_gcmcref +clear + +# report restart errors + +print "LJ: change in temperature from restart = ${terror} " +print "LJ: change in pressure from restart = ${perror} " +print "LJ: change in fix GCMC from restart = ${gcmcerror} " + +#### H2O ### + +variable mu equal -8.1 +variable disp equal 0.5 +variable temp equal 338.0 +variable lbox equal 10.0 +variable spacing equal 5.0 +variable nequil equal 100 +variable nsteps equal 100 +variable nevery equal 10 +variable restartfile string restart.gcmc.h2o + +# global model settings + +units real +atom_style full +boundary p p p +pair_style lj/cut/coul/long 14 +pair_modify mix arithmetic tail yes +kspace_style ewald 0.0001 +bond_style harmonic +angle_style harmonic + +# box, start molecules on simple cubic lattice + +lattice sc ${spacing} +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box +create_box 2 box & + bond/types 1 & + angle/types 1 & + extra/bond/per/atom 2 & + extra/angle/per/atom 1 & + extra/special/per/atom 2 + +molecule h2omol H2O.txt +create_atoms 0 box mol h2omol 464563 units box + +# rigid SPC/E water model + +pair_coeff 1 1 0.15535 3.166 +pair_coeff * 2 0.0000 0.0000 + +bond_coeff 1 1000 1.0 +angle_coeff 1 100 109.47 + +# masses + +mass 1 15.9994 +mass 2 1.0 + +# MD settings + +group h2o type 1 2 +neighbor 2.0 bin +neigh_modify every 1 delay 1 check yes +velocity all create ${temp} 54654 +timestep 1.0 + +minimize 0.0 0.0 100 1000 +reset_timestep 0 + +# rigid constraints with thermostat + +fix mynvt h2o nvt temp ${temp} ${temp} 100 +fix wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol + +# important to make temperature dofs dynamic + +compute_modify thermo_temp dynamic/dof yes +compute_modify mynvt_temp dynamic/dof yes + +# output + +thermo_style custom step temp press pe ke density atoms + +# gcmc + +variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) +fix mygcmc h2o gcmc ${nevery} 100 0 0 54341 ${temp} ${mu} ${disp} mol & + h2omol tfac_insert ${tfac} group h2o shake wshake + +# run equilibration and write restart + +run ${nequil} +write_restart ${restartfile} + +# run simulation, store reference values, and clear simulation + +run ${nsteps} +variable tmp equal temp +variable tref equal ${tmp} +variable tmp equal press +variable pref equal ${tmp} +variable tmp equal sum(f_mygcmc) +variable gcmcref equal ${tmp} +clear + +# rerun simulation from restart + +read_restart ${restartfile} +molecule h2omol H2O.txt +kspace_style ewald 0.0001 +fix mynvt h2o nvt temp ${temp} ${temp} 100 +fix wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol + +# important to make temperature dofs dynamic + +compute_modify thermo_temp dynamic/dof yes +compute_modify mynvt_temp dynamic/dof yes + +# gcmc + +fix mygcmc h2o gcmc ${nevery} 100 0 0 54341 ${temp} ${mu} ${disp} mol & + h2omol tfac_insert ${tfac} group h2o shake wshake + +# output + +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms + +# rerun simulation from restart, measure errors, and clear + +run ${nsteps} +variable tmp equal temp +variable terror equal ${tmp} - v_tref +variable tmp equal press +variable perror equal ${tmp} - v_pref +variable tmp equal sum(f_mygcmc) +variable gcmcerror equal ${tmp} - v_gcmcref +clear + +# report restart errors + +print "H2O: change in temperature from restart = ${terror} " +print "H2O: change in pressure from restart = ${perror} " +print "H2O: change in fix GCMC from restart = ${gcmcerror} " + diff --git a/examples/mc/log.03Mar22.gcmc.h2o.g++.4 b/examples/mc/log.03Mar22.gcmc.h2o.g++.4 deleted file mode 100644 index 63f14c0d7cd..00000000000 --- a/examples/mc/log.03Mar22.gcmc.h2o.g++.4 +++ /dev/null @@ -1,296 +0,0 @@ -LAMMPS (17 Feb 2022) -# fix gcmc example with fix shake - -# variables available on command line - -variable mu index -8.1 -variable disp index 0.5 -variable temp index 338.0 -variable lbox index 10.0 -variable spacing index 5.0 - -# global model settings - -units real -atom_style full -boundary p p p -pair_style lj/cut/coul/long 14 -pair_modify mix arithmetic tail yes -kspace_style ewald 0.0001 -bond_style harmonic -angle_style harmonic - -# box, start molecules on simple cubic lattice - -lattice sc ${spacing} -lattice sc 5.0 -Lattice spacing in x,y,z = 5 5 5 -region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box -region box block 0 10.0 0 ${lbox} 0 ${lbox} units box -region box block 0 10.0 0 10.0 0 ${lbox} units box -region box block 0 10.0 0 10.0 0 10.0 units box -create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 -Created orthogonal box = (0 0 0) to (10 10 10) - 1 by 2 by 2 MPI processor grid - -molecule h2omol H2O.txt -Read molecule template h2omol: - 1 molecules - 0 fragments - 3 atoms with max type 2 - 2 bonds with max type 1 - 1 angles with max type 1 - 0 dihedrals with max type 0 - 0 impropers with max type 0 -create_atoms 0 box mol h2omol 464563 units box -Created 24 atoms - using box units in orthogonal box = (0 0 0) to (10 10 10) - create_atoms CPU = 0.002 seconds - -# rigid SPC/E water model - -pair_coeff 1 1 0.15535 3.166 -pair_coeff * 2 0.0000 0.0000 - -bond_coeff 1 1000 1.0 -angle_coeff 1 100 109.47 - -# masses - -mass 1 15.9994 -mass 2 1.0 - -# MD settings - -group h2o type 1 2 -24 atoms in group h2o -neighbor 2.0 bin -neigh_modify every 1 delay 1 check yes -velocity all create ${temp} 54654 -velocity all create 338.0 54654 -timestep 1.0 - -minimize 0.0 0.0 100 1000 -WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (src/min.cpp:187) -Ewald initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:340) - G vector (1/distance) = 0.17044845 - estimated absolute RMS force accuracy = 0.033206374 - estimated relative force accuracy = 0.00010000001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 - generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 16 - ghost atom cutoff = 16 - binsize = 8, bins = 2 2 2 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut/coul/long, perpetual - attributes: half, newton on - pair build: half/bin/newton - stencil: half/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 11.85 | 11.85 | 11.85 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 338 -4.9610706 9.2628112e-06 18.211756 730.90791 - 100 338 -15.815905 0.10936727 7.4662793 -278.75864 -Loop time of 0.0318772 on 4 procs for 100 steps with 24 atoms - -99.9% CPU use with 4 MPI tasks x no OpenMP threads - -Minimization stats: - Stopping criterion = max iterations - Energy initial, next-to-last, final = - -4.96106135392776 -15.6966371009978 -15.7065379926413 - Force two-norm initial, final = 15.47396 4.3807065 - Force max component initial, final = 5.8004229 2.0143175 - Final line search alpha, max atom move = 0.0046871063 0.00944132 - Iterations, force evaluations = 100 346 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0044502 | 0.008939 | 0.014884 | 4.0 | 28.04 -Bond | 0.00010079 | 0.00013115 | 0.0001615 | 0.0 | 0.41 -Kspace | 0.0015161 | 0.0073496 | 0.011723 | 4.3 | 23.06 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.013957 | 0.014086 | 0.01416 | 0.1 | 44.19 -Output | 1.1416e-05 | 1.2871e-05 | 1.6202e-05 | 0.0 | 0.04 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.001359 | | | 4.26 - -Nlocal: 6 ave 8 max 3 min -Histogram: 1 0 0 0 1 0 0 0 0 2 -Nghost: 1722 ave 1725 max 1720 min -Histogram: 2 0 0 0 0 0 1 0 0 1 -Neighs: 1256.75 ave 2101 max 667 min -Histogram: 1 0 1 0 1 0 0 0 0 1 - -Total # of neighbors = 5027 -Ave neighs/atom = 209.45833 -Ave special neighs/atom = 2 -Neighbor list builds = 0 -Dangerous builds = 0 -reset_timestep 0 - -# rigid constraints with thermostat - -fix mynvt h2o nvt temp ${temp} ${temp} 100 -fix mynvt h2o nvt temp 338.0 ${temp} 100 -fix mynvt h2o nvt temp 338.0 338.0 100 -fix wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol - 0 = # of size 2 clusters - 0 = # of size 3 clusters - 0 = # of size 4 clusters - 8 = # of frozen angles - find clusters CPU = 0.001 seconds - -# important to make temperature dofs dynamic - -compute_modify thermo_temp dynamic/dof yes -compute_modify mynvt_temp dynamic/dof yes - -run 1000 -Ewald initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:340) - G vector (1/distance) = 0.17044845 - estimated absolute RMS force accuracy = 0.033206374 - estimated relative force accuracy = 0.00010000001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 - generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule -Per MPI rank memory allocation (min/avg/max) = 11.6 | 11.6 | 11.6 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 518.26667 -15.815905 0 7.3569121 -385.7767 - 1000 240.84589 -44.723106 0 -33.954368 61.365522 -Loop time of 0.0928135 on 4 procs for 1000 steps with 24 atoms - -Performance: 930.900 ns/day, 0.026 hours/ns, 10774.300 timesteps/s -99.9% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0079337 | 0.014647 | 0.023202 | 4.8 | 15.78 -Bond | 7.45e-05 | 9.0251e-05 | 0.00012098 | 0.0 | 0.10 -Kspace | 0.0044849 | 0.012865 | 0.019419 | 5.0 | 13.86 -Neigh | 0.0015513 | 0.0015789 | 0.0016063 | 0.1 | 1.70 -Comm | 0.038145 | 0.038416 | 0.038704 | 0.1 | 41.39 -Output | 9.084e-06 | 1.0765e-05 | 1.546e-05 | 0.0 | 0.01 -Modify | 0.023572 | 0.023646 | 0.023723 | 0.0 | 25.48 -Other | | 0.00156 | | | 1.68 - -Nlocal: 6 ave 9 max 1 min -Histogram: 1 0 0 0 0 0 1 0 1 1 -Nghost: 1375.25 ave 1495 max 1251 min -Histogram: 1 0 0 1 0 0 1 0 0 1 -Neighs: 1263.25 ave 2045 max 122 min -Histogram: 1 0 0 0 0 0 2 0 0 1 - -Total # of neighbors = 5053 -Ave neighs/atom = 210.54167 -Ave special neighs/atom = 2 -Neighbor list builds = 30 -Dangerous builds = 0 -reset_timestep 0 - -# gcmc - -variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) -fix mygcmc h2o gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake - -# atom counts - -variable oxygen atom "type==1" -variable hydrogen atom "type==2" -group oxygen dynamic all var oxygen -dynamic group oxygen defined -group hydrogen dynamic all var hydrogen -dynamic group hydrogen defined -variable nO equal count(oxygen) -variable nH equal count(hydrogen) - -# output - -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) -variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH -thermo 1000 - -# run - -run 20000 -Ewald initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:340) - G vector (1/distance) = 0.17044845 - estimated absolute RMS force accuracy = 0.033206374 - estimated relative force accuracy = 0.00010000001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 - generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule -WARNING: Fix gcmc using full_energy option (src/MC/fix_gcmc.cpp:486) -0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc -0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc -WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:635) -Per MPI rank memory allocation (min/avg/max) = 11.6 | 11.6 | 11.6 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH - 0 240.84589 61.724018 -44.723106 10.768738 0.23910963 24 0 0 0 0 8 16 - 1000 345.18281 -1439.9493 -275.72969 56.590842 0.83688372 84 0.054205983 0.013941446 0 0 28 56 - 2000 345.18939 -1776.1886 -334.1935 66.88136 0.98632724 99 0.03258324 0.0068755525 0 0 33 66 - 3000 371.00685 1611.457 -344.8868 71.883561 0.98632724 99 0.021303508 0.0046725853 0 0 33 66 - 4000 333.39448 -779.09163 -363.7251 66.583637 1.0162159 102 0.016400775 0.0035209497 0 0 34 68 - 5000 313.43793 1752.7257 -366.08712 62.598028 1.0162159 102 0.012996731 0.0028442566 0 0 34 68 - 6000 372.34785 3089.6885 -378.09103 74.36318 1.0162159 102 0.011272836 0.0026808753 0 0 34 68 - 7000 393.56304 1095.6551 -359.16911 78.600157 1.0162159 102 0.0096096775 0.0023107363 0 0 34 68 - 8000 378.04525 -1933.9224 -346.54153 75.501032 1.0162159 102 0.0084617108 0.0020089902 0 0 34 68 - 9000 297.05101 4804.6743 -367.61786 59.325326 1.0162159 102 0.0074970783 0.0017916732 0 0 34 68 - 10000 379.5212 -951.43658 -368.99713 78.058362 1.0461046 105 0.0069429291 0.0016131959 0 0 35 70 - 11000 308.54229 1335.2452 -378.61796 63.459711 1.0461046 105 0.006303921 0.0014684018 0 0 35 70 - 12000 375.19931 2791.9525 -368.98209 79.406248 1.0759934 108 0.0059493315 0.0013447412 0 0 36 72 - 13000 392.21002 4857.5806 -386.58586 83.006354 1.0759934 108 0.005490232 0.0012416383 0 0 36 72 - 14000 327.23916 3472.146 -393.65093 69.256081 1.0759934 108 0.0051077595 0.0011507314 0 0 36 72 - 15000 330.63194 5995.4662 -389.36253 69.974121 1.0759934 108 0.004761212 0.0010753989 0 0 36 72 - 16000 329.25034 694.90103 -387.21725 69.681723 1.0759934 108 0.0044719941 0.0010062767 0 0 36 72 - 17000 368.22282 -3340.8134 -399.58632 77.929761 1.0759934 108 0.0042070328 0.00094751928 0 0 36 72 - 18000 270.78376 1831.8085 -388.15376 57.308002 1.0759934 108 0.0039804956 0.00089324594 0 0 36 72 - 19000 337.54827 1211.6625 -387.9744 71.437877 1.0759934 108 0.0037779014 0.00084467485 0 0 36 72 - 20000 382.5465 5070.3639 -399.03603 83.241787 1.1058821 111 0.0036877934 0.00080264069 0 0 37 74 -Loop time of 47.6346 on 4 procs for 20000 steps with 111 atoms - -Performance: 36.276 ns/day, 0.662 hours/ns, 419.863 timesteps/s -99.9% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 4.3783 | 5.9819 | 7.7932 | 52.3 | 12.56 -Bond | 0.014825 | 0.015376 | 0.016097 | 0.4 | 0.03 -Kspace | 0.27624 | 2.0815 | 3.68 | 88.4 | 4.37 -Neigh | 0.60717 | 0.60731 | 0.60741 | 0.0 | 1.27 -Comm | 1.6019 | 1.6072 | 1.6116 | 0.3 | 3.37 -Output | 0.00049839 | 0.00055603 | 0.00072798 | 0.0 | 0.00 -Modify | 37.253 | 37.253 | 37.253 | 0.0 | 78.21 -Other | | 0.08782 | | | 0.18 - -Nlocal: 27.75 ave 31 max 26 min -Histogram: 2 0 0 0 1 0 0 0 0 1 -Nghost: 6387 ave 6439 max 6327 min -Histogram: 1 0 0 1 0 0 0 0 1 1 -Neighs: 26407 ave 33738 max 18362 min -Histogram: 1 0 0 0 0 2 0 0 0 1 - -Total # of neighbors = 105628 -Ave neighs/atom = 951.6036 -Ave special neighs/atom = 2 -Neighbor list builds = 20923 -Dangerous builds = 0 - -Total wall time: 0:00:47 diff --git a/examples/mc/log.23Mar23.gcmc.lj.g++.1 b/examples/mc/log.23Mar23.gcmc.lj.g++.1 deleted file mode 100644 index a934180536e..00000000000 --- a/examples/mc/log.23Mar23.gcmc.lj.g++.1 +++ /dev/null @@ -1,144 +0,0 @@ -LAMMPS (8 Feb 2023) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) - using 1 OpenMP thread(s) per MPI task -# GCMC for LJ simple fluid, no dynamics -# T = 2.0 -# rho ~ 0.5 -# p ~ 1.5 -# mu_ex ~ 0.0 -# comparable to Frenkel and Smit GCMC Case Study, Figure 5.8 - -# variables modifiable using -var command line switch - -variable mu index -1.25 -variable temp index 2.0 -variable disp index 1.0 -variable lbox index 5.0 - -# global model settings - -units lj -atom_style atomic -pair_style lj/cut 3.0 -pair_modify tail no # turn of to avoid triggering full_energy - -# box - -region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} -region box block 0 5.0 0 ${lbox} 0 ${lbox} -region box block 0 5.0 0 5.0 0 ${lbox} -region box block 0 5.0 0 5.0 0 5.0 -create_box 1 box -Created orthogonal box = (0 0 0) to (5 5 5) - 1 by 1 by 1 MPI processor grid - -# lj parameters - -pair_coeff * * 1.0 1.0 -mass * 1.0 - -# we recommend setting up a dedicated group for gcmc - -group gcmcgroup type 1 -0 atoms in group gcmcgroup - -# gcmc - -fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} -fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2.0 ${mu} ${disp} -fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2.0 -1.25 ${disp} -fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2.0 -1.25 1.0 - -# atom count - -variable type1 atom "type==1" -group type1 dynamic gcmcgroup var type1 -dynamic group type1 defined -variable n1 equal count(type1) - -# averaging - -variable rho equal density -variable p equal press -variable nugget equal 1.0e-8 -variable lambda equal 1.0 -variable muex equal ${mu}-${temp}*ln(density*${lambda}+${nugget}) -variable muex equal -1.25-${temp}*ln(density*${lambda}+${nugget}) -variable muex equal -1.25-2.0*ln(density*${lambda}+${nugget}) -variable muex equal -1.25-2.0*ln(density*1+${nugget}) -variable muex equal -1.25-2.0*ln(density*1+1e-08) -fix ave all ave/time 10 100 1000 v_rho v_p v_muex v_n1 ave one file rho_vs_p.dat -variable rhoav equal f_ave[1] -variable pav equal f_ave[2] -variable muexav equal f_ave[3] -variable n1av equal f_ave[4] - -# output - -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+${nugget}) -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+1e-08) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+${nugget}) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+1e-08) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+${nugget}) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+1e-08) -compute_modify thermo_temp dynamic yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av -thermo 1000 - -# run - -run 10000 -WARNING: No fixes with time integration, atoms won't move (src/verlet.cpp:60) -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Neighbor list info ... - update: every = 1 steps, delay = 0 steps, check = yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 3.3 - ghost atom cutoff = 3.3 - binsize = 1.65, bins = 4 4 4 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 0.4341 | 0.4341 | 0.4341 Mbytes - Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av - 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 - 1000 2.0603874 2.9024736 -3.2576986 3.0482443 0.584 73 0.069266074 0.066959582 0.11158434 0.53624 1.3978532 0.0014407586 67.03 - 2000 2.1586837 1.5581387 -2.8420766 3.1857993 0.496 62 0.068487803 0.067570935 0.1126652 0.53128 1.3713694 0.020274019 66.41 - 3000 2.4664064 0.65471138 -3.3428236 3.6435549 0.528 66 0.068182273 0.067547792 0.11226502 0.53472 1.3892234 0.0070204504 66.84 - 4000 1.8880496 1.4802782 -2.7846019 2.785647 0.488 61 0.068250075 0.067843541 0.11299989 0.52744 1.299496 0.033918563 65.93 - 5000 2.0578649 1.3204331 -3.5571862 3.0433213 0.568 71 0.067858571 0.067732262 0.11271981 0.5364 1.4237505 0.00065741209 67.05 - 6000 2.3627973 0.97064566 -3.1107668 3.4879388 0.504 63 0.067846204 0.06757018 0.11272207 0.5332 1.3945131 0.014216594 66.65 - 7000 1.6629817 0.98138972 -2.7780297 2.4514644 0.464 58 0.067451389 0.067269791 0.11263692 0.53688 1.4207486 -0.0012887793 67.11 - 8000 2.2135488 2.0878792 -3.0471089 3.2707661 0.536 67 0.067926473 0.067738312 0.1135594 0.52736 1.4348314 0.034380623 65.92 - 9000 1.8904287 0.52639383 -3.3548657 2.7920177 0.52 65 0.06818197 0.068003094 0.11356319 0.53072 1.4528143 0.021683615 66.34 - 10000 2.2353281 0.73275312 -3.2197702 3.3006016 0.512 64 0.068465059 0.068208485 0.11414748 0.52712 1.4143492 0.03497858 65.89 -Loop time of 12.3703 on 1 procs for 10000 steps with 64 atoms - -Performance: 349224.803 tau/day, 808.391 timesteps/s, 51.737 katom-step/s -99.5% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.28 | 0.28 | 0.28 | 0.0 | 2.26 -Neigh | 0.76133 | 0.76133 | 0.76133 | 0.0 | 6.15 -Comm | 0.073181 | 0.073181 | 0.073181 | 0.0 | 0.59 -Output | 0.00031081 | 0.00031081 | 0.00031081 | 0.0 | 0.00 -Modify | 11.24 | 11.24 | 11.24 | 0.0 | 90.87 -Other | | 0.01498 | | | 0.12 - -Nlocal: 64 ave 64 max 64 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 714 ave 714 max 714 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2423 ave 2423 max 2423 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 2423 -Ave neighs/atom = 37.859375 -Neighbor list builds = 10000 -Dangerous builds = 0 -Total wall time: 0:00:12 diff --git a/examples/mc/log.23Mar23.gcmc.lj.g++.4 b/examples/mc/log.23Mar23.gcmc.lj.g++.4 deleted file mode 100644 index 0c4d76151ff..00000000000 --- a/examples/mc/log.23Mar23.gcmc.lj.g++.4 +++ /dev/null @@ -1,144 +0,0 @@ -LAMMPS (8 Feb 2023) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) - using 1 OpenMP thread(s) per MPI task -# GCMC for LJ simple fluid, no dynamics -# T = 2.0 -# rho ~ 0.5 -# p ~ 1.5 -# mu_ex ~ 0.0 -# comparable to Frenkel and Smit GCMC Case Study, Figure 5.8 - -# variables modifiable using -var command line switch - -variable mu index -1.25 -variable temp index 2.0 -variable disp index 1.0 -variable lbox index 5.0 - -# global model settings - -units lj -atom_style atomic -pair_style lj/cut 3.0 -pair_modify tail no # turn of to avoid triggering full_energy - -# box - -region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} -region box block 0 5.0 0 ${lbox} 0 ${lbox} -region box block 0 5.0 0 5.0 0 ${lbox} -region box block 0 5.0 0 5.0 0 5.0 -create_box 1 box -Created orthogonal box = (0 0 0) to (5 5 5) - 1 by 2 by 2 MPI processor grid - -# lj parameters - -pair_coeff * * 1.0 1.0 -mass * 1.0 - -# we recommend setting up a dedicated group for gcmc - -group gcmcgroup type 1 -0 atoms in group gcmcgroup - -# gcmc - -fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} -fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2.0 ${mu} ${disp} -fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2.0 -1.25 ${disp} -fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2.0 -1.25 1.0 - -# atom count - -variable type1 atom "type==1" -group type1 dynamic gcmcgroup var type1 -dynamic group type1 defined -variable n1 equal count(type1) - -# averaging - -variable rho equal density -variable p equal press -variable nugget equal 1.0e-8 -variable lambda equal 1.0 -variable muex equal ${mu}-${temp}*ln(density*${lambda}+${nugget}) -variable muex equal -1.25-${temp}*ln(density*${lambda}+${nugget}) -variable muex equal -1.25-2.0*ln(density*${lambda}+${nugget}) -variable muex equal -1.25-2.0*ln(density*1+${nugget}) -variable muex equal -1.25-2.0*ln(density*1+1e-08) -fix ave all ave/time 10 100 1000 v_rho v_p v_muex v_n1 ave one file rho_vs_p.dat -variable rhoav equal f_ave[1] -variable pav equal f_ave[2] -variable muexav equal f_ave[3] -variable n1av equal f_ave[4] - -# output - -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+${nugget}) -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+1e-08) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+${nugget}) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+1e-08) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+${nugget}) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+1e-08) -compute_modify thermo_temp dynamic yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av -thermo 1000 - -# run - -run 10000 -WARNING: No fixes with time integration, atoms won't move (src/verlet.cpp:60) -Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule -Neighbor list info ... - update: every = 1 steps, delay = 0 steps, check = yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 3.3 - ghost atom cutoff = 3.3 - binsize = 1.65, bins = 4 4 4 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 0.4492 | 0.4492 | 0.4492 Mbytes - Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av - 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 - 1000 2.4378552 1.9014939 -3.23439 3.6030066 0.544 68 0.073050445 0.070796636 0.11934255 0.52552 1.3006333 0.04152087 65.69 - 2000 1.9339159 1.0360287 -3.5001391 2.8594327 0.56 70 0.069588893 0.068587488 0.11319584 0.542 1.4012888 -0.020696665 67.75 - 3000 1.8891807 2.2857708 -3.3755633 2.7954769 0.592 74 0.068329031 0.067640916 0.11187803 0.53536 1.3380926 0.0062359288 66.92 - 4000 2.0436517 1.7600211 -3.4067452 3.0229014 0.576 72 0.067464211 0.067003868 0.11060324 0.54144 1.4484907 -0.016246603 67.68 - 5000 2.1512268 1.0811095 -3.2418366 3.1786785 0.536 67 0.066830654 0.066717982 0.1094094 0.54368 1.4962073 -0.025791643 67.96 - 6000 2.128931 1.5444487 -3.1904474 3.1450116 0.528 66 0.067479197 0.067193531 0.1104464 0.53112 1.4247377 0.019908014 66.39 - 7000 1.8194311 0.72981963 -3.6601329 2.6912418 0.576 72 0.068131849 0.067910074 0.11182024 0.51968 1.4517098 0.063444774 64.96 - 8000 1.947817 0.74570466 -3.0935809 2.8753489 0.504 63 0.068034071 0.067855883 0.11217045 0.53304 1.4924302 0.012298733 66.63 - 9000 1.8942389 1.3367401 -2.8925016 2.7962574 0.504 63 0.068117479 0.067943081 0.11236152 0.536 1.4091106 0.0011494886 67 - 10000 2.2092799 0.95517153 -2.9117781 3.2586879 0.48 60 0.068264792 0.068016591 0.11310789 0.52272 1.4774174 0.051284873 65.34 -Loop time of 14.6475 on 4 procs for 10000 steps with 60 atoms - -Performance: 294930.892 tau/day, 682.710 timesteps/s, 40.963 katom-step/s -99.2% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.079336 | 0.086188 | 0.093829 | 2.2 | 0.59 -Neigh | 0.25224 | 0.26194 | 0.26946 | 1.4 | 1.79 -Comm | 0.31594 | 0.33181 | 0.34839 | 2.4 | 2.27 -Output | 0.00039633 | 0.00063799 | 0.00071881 | 0.0 | 0.00 -Modify | 13.956 | 13.957 | 13.958 | 0.0 | 95.29 -Other | | 0.01003 | | | 0.07 - -Nlocal: 15 ave 16 max 14 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 437 ave 446 max 431 min -Histogram: 2 0 0 0 0 0 1 0 0 1 -Neighs: 529 ave 595 max 437 min -Histogram: 1 0 0 0 1 0 0 0 0 2 - -Total # of neighbors = 2116 -Ave neighs/atom = 35.266667 -Neighbor list builds = 10000 -Dangerous builds = 0 -Total wall time: 0:00:14 diff --git a/examples/mc/log.27Nov18.gcmc.h2o.g++.1 b/examples/mc/log.27Nov18.gcmc.h2o.g++.1 deleted file mode 100644 index 86b8fa7b450..00000000000 --- a/examples/mc/log.27Nov18.gcmc.h2o.g++.1 +++ /dev/null @@ -1,290 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# fix gcmc example with fix shake - -# variables available on command line - -variable mu index -8.1 -variable disp index 0.5 -variable temp index 338.0 -variable lbox index 10.0 -variable spacing index 5.0 - -# global model settings - -units real -atom_style full -boundary p p p -pair_style lj/cut/coul/long 14 -pair_modify mix arithmetic tail yes -kspace_style ewald 0.0001 -bond_style harmonic -angle_style harmonic - -# box, start molecules on simple cubic lattice - -lattice sc ${spacing} -lattice sc 5.0 -Lattice spacing in x,y,z = 5 5 5 -region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box -region box block 0 10.0 0 ${lbox} 0 ${lbox} units box -region box block 0 10.0 0 10.0 0 ${lbox} units box -region box block 0 10.0 0 10.0 0 10.0 units box -create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 -Created orthogonal box = (0 0 0) to (10 10 10) - 1 by 1 by 1 MPI processor grid - -molecule h2omol H2O.txt -Read molecule h2omol: - 3 atoms with max type 2 - 2 bonds with max type 1 - 1 angles with max type 1 - 0 dihedrals with max type 0 - 0 impropers with max type 0 -create_atoms 0 box mol h2omol 464563 units box -Created 24 atoms - Time spent = 0.00128841 secs - -# rigid SPC/E water model - -pair_coeff 1 1 0.15535 3.166 -pair_coeff * 2 0.0000 0.0000 - -bond_coeff 1 1000 1.0 -angle_coeff 1 100 109.47 - -# masses - -mass 1 15.9994 -mass 2 1.0 - -# MD settings - -group h2o type 1 2 -24 atoms in group h2o -neighbor 2.0 bin -neigh_modify every 1 delay 1 check yes -velocity all create ${temp} 54654 -velocity all create 338.0 54654 -timestep 1.0 - -minimize 0.0 0.0 100 1000 -WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (src/min.cpp:168) -Ewald initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:321) - G vector (1/distance) = 0.170448 - estimated absolute RMS force accuracy = 0.0332064 - estimated relative force accuracy = 0.0001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 16 - ghost atom cutoff = 16 - binsize = 8, bins = 2 2 2 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut/coul/long, perpetual - attributes: half, newton on - pair build: half/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 11.88 | 11.88 | 11.88 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 338 -4.1890564 9.2628112e-06 18.98377 739.06991 - 100 338 -36.122455 0.67828405 -12.271354 573.22675 -Loop time of 0.0461962 on 1 procs for 100 steps with 24 atoms - -98.3% CPU use with 1 MPI tasks x 1 OpenMP threads - -Minimization stats: - Stopping criterion = max iterations - Energy initial, next-to-last, final = - -4.18904713252 -34.586018764 -35.4441713339 - Force two-norm initial, final = 18.0027 42.115 - Force max component initial, final = 5.8993 15.4907 - Final line search alpha, max atom move = 0.00127226 0.0197082 - Iterations, force evaluations = 100 239 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.038526 | 0.038526 | 0.038526 | 0.0 | 83.40 -Bond | 0.00031209 | 0.00031209 | 0.00031209 | 0.0 | 0.68 -Kspace | 0.0019636 | 0.0019636 | 0.0019636 | 0.0 | 4.25 -Neigh | 0.00055456 | 0.00055456 | 0.00055456 | 0.0 | 1.20 -Comm | 0.0040288 | 0.0040288 | 0.0040288 | 0.0 | 8.72 -Output | 1.5259e-05 | 1.5259e-05 | 1.5259e-05 | 0.0 | 0.03 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.0007958 | | | 1.72 - -Nlocal: 24 ave 24 max 24 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 2011 ave 2011 max 2011 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 4921 ave 4921 max 4921 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 4921 -Ave neighs/atom = 205.042 -Ave special neighs/atom = 2 -Neighbor list builds = 2 -Dangerous builds = 0 -reset_timestep 0 - -# rigid constraints with thermostat - -fix mynvt h2o nvt temp ${temp} ${temp} 100 -fix mynvt h2o nvt temp 338.0 ${temp} 100 -fix mynvt h2o nvt temp 338.0 338.0 100 -fix wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol - 0 = # of size 2 clusters - 0 = # of size 3 clusters - 0 = # of size 4 clusters - 8 = # of frozen angles - -# important to make temperature dofs dynamic - -compute_modify thermo_temp dynamic/dof yes -compute_modify mynvt_temp dynamic/dof yes - -run 1000 -Ewald initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:321) - G vector (1/distance) = 0.170448 - estimated absolute RMS force accuracy = 0.0332064 - estimated relative force accuracy = 0.0001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 -Per MPI rank memory allocation (min/avg/max) = 11.63 | 11.63 | 11.63 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 518.26667 -36.122455 0 -12.949638 703.43827 - 1000 260.39219 -55.141232 0 -43.498537 -1698.672 -Loop time of 0.140376 on 1 procs for 1000 steps with 24 atoms - -Performance: 615.489 ns/day, 0.039 hours/ns, 7123.720 timesteps/s -99.1% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.10434 | 0.10434 | 0.10434 | 0.0 | 74.33 -Bond | 0.00013041 | 0.00013041 | 0.00013041 | 0.0 | 0.09 -Kspace | 0.008199 | 0.008199 | 0.008199 | 0.0 | 5.84 -Neigh | 0.0061581 | 0.0061581 | 0.0061581 | 0.0 | 4.39 -Comm | 0.015352 | 0.015352 | 0.015352 | 0.0 | 10.94 -Output | 1.4305e-05 | 1.4305e-05 | 1.4305e-05 | 0.0 | 0.01 -Modify | 0.004544 | 0.004544 | 0.004544 | 0.0 | 3.24 -Other | | 0.001639 | | | 1.17 - -Nlocal: 24 ave 24 max 24 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1776 ave 1776 max 1776 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 5073 ave 5073 max 5073 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 5073 -Ave neighs/atom = 211.375 -Ave special neighs/atom = 2 -Neighbor list builds = 27 -Dangerous builds = 0 -reset_timestep 0 - -# gcmc - -variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) -fix mygcmc h2o gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake - -# atom counts - -variable oxygen atom "type==1" -variable hydrogen atom "type==2" -group oxygen dynamic all var oxygen -dynamic group oxygen defined -group hydrogen dynamic all var hydrogen -dynamic group hydrogen defined -variable nO equal count(oxygen) -variable nH equal count(hydrogen) - -# output - -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) -variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH -thermo 1000 - -# run - -run 20000 -Ewald initialization ... - using 12-bit tables for long-range coulomb (src/kspace.cpp:321) - G vector (1/distance) = 0.170448 - estimated absolute RMS force accuracy = 0.0332064 - estimated relative force accuracy = 0.0001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 -WARNING: Fix gcmc using full_energy option (src/MC/fix_gcmc.cpp:487) -0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc -0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc -WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:471) -Per MPI rank memory allocation (min/avg/max) = 11.63 | 11.63 | 11.63 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH - 0 260.39219 -1699.3643 -55.141232 11.642695 0.23910963 24 0 0 0 0 8 16 - 1000 340.44409 -2560.1501 -280.70157 53.784356 0.80699501 81 0.054205983 0.015933081 0 0 27 54 - 2000 302.57602 592.41718 -310.37771 53.213377 0.89666113 90 0.030546787 0.0078577743 0 0 30 60 - 3000 270.18045 -817.18659 -346.75773 50.737466 0.95643854 96 0.021969243 0.0060076096 0 0 32 64 - 4000 334.17192 1153.3017 -335.25519 62.75449 0.95643854 96 0.016400775 0.0045269353 0 0 32 64 - 5000 360.36872 -647.99689 -336.2928 67.674015 0.95643854 96 0.012996731 0.0036569014 0 0 32 64 - 6000 282.37822 -986.51765 -341.91848 53.028098 0.95643854 96 0.010941282 0.0030159847 0 0 32 64 - 7000 363.01448 2952.0391 -358.72963 70.335018 0.98632724 99 0.0098923151 0.0028884203 0 0 33 66 - 8000 331.70391 323.34886 -382.04165 68.223498 1.0461046 105 0.0092083323 0.0025112378 0 0 35 70 - 9000 337.2032 -3637.5257 -390.66472 69.35457 1.0461046 105 0.0081585853 0.0022395915 0 0 35 70 - 10000 373.67063 3081.3271 -380.5107 76.855041 1.0461046 105 0.0073396679 0.0020164949 0 0 35 70 - 11000 336.64665 5535.9451 -405.21548 71.247059 1.0759934 108 0.0068442571 0.0018355023 0 0 36 72 - 12000 306.51164 1448.1757 -410.3655 64.869362 1.0759934 108 0.0062798499 0.0016809265 0 0 36 72 - 13000 319.03497 177.44405 -406.17113 67.519768 1.0759934 108 0.0057952448 0.0015520479 0 0 36 72 - 14000 309.89701 -1022.6798 -384.20239 65.585833 1.0759934 108 0.005391524 0.0014384143 0 0 36 72 - 15000 398.91559 2058.9251 -404.32604 84.425503 1.0759934 108 0.0050257238 0.0013442486 0 0 36 72 - 16000 318.98778 873.46142 -392.13338 67.50978 1.0759934 108 0.0047204383 0.0012578458 0 0 36 72 - 17000 333.16025 2347.0215 -387.73943 70.509206 1.0759934 108 0.0044407568 0.0011843991 0 0 36 72 - 18000 353.23789 -2305.787 -382.1633 74.758389 1.0759934 108 0.0042016342 0.0011165574 0 0 36 72 - 19000 322.70939 5619.9631 -381.81328 68.297412 1.0759934 108 0.0039877848 0.0010558436 0 0 36 72 - 20000 371.07261 3916.1113 -389.76357 78.532884 1.0759934 108 0.0037874635 0.0010033009 0 0 36 72 -Loop time of 242.59 on 1 procs for 20000 steps with 108 atoms - -Performance: 7.123 ns/day, 3.369 hours/ns, 82.444 timesteps/s -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 38.279 | 38.279 | 38.279 | 0.0 | 15.78 -Bond | 0.055672 | 0.055672 | 0.055672 | 0.0 | 0.02 -Kspace | 0.60623 | 0.60623 | 0.60623 | 0.0 | 0.25 -Neigh | 4.4189 | 4.4189 | 4.4189 | 0.0 | 1.82 -Comm | 1.2719 | 1.2719 | 1.2719 | 0.0 | 0.52 -Output | 0.00096583 | 0.00096583 | 0.00096583 | 0.0 | 0.00 -Modify | 197.85 | 197.85 | 197.85 | 0.0 | 81.56 -Other | | 0.1098 | | | 0.05 - -Nlocal: 108 ave 108 max 108 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 8000 ave 8000 max 8000 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 100006 ave 100006 max 100006 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 100006 -Ave neighs/atom = 925.981 -Ave special neighs/atom = 2 -Neighbor list builds = 20903 -Dangerous builds = 0 - -Total wall time: 0:04:02 diff --git a/examples/mc/log.15Jul25.gcmc.co2.g++.1 b/examples/mc/log.30Mar26.gcmc.co2.g++.1 similarity index 61% rename from examples/mc/log.15Jul25.gcmc.co2.g++.1 rename to examples/mc/log.30Mar26.gcmc.co2.g++.1 index e2438ffcd57..b22e837fa25 100644 --- a/examples/mc/log.15Jul25.gcmc.co2.g++.1 +++ b/examples/mc/log.30Mar26.gcmc.co2.g++.1 @@ -1,4 +1,4 @@ -LAMMPS (12 Jun 2025 - Development - patch_12Jun2025-747-g3fabe8e766-modified) +LAMMPS (10 Dec 2025 - Development - patch_10Dec2025-125-g8985ed3c66-modified) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. using 1 OpenMP thread(s) per MPI task # GCMC for CO2 molecular fluid, rigid/small dynamics @@ -131,10 +131,10 @@ Ewald initialization ... KSpace vectors: actual max1d max3d = 16 2 62 kxmax kymax kzmax = 2 2 2 Generated 1 of 1 mixed pair_coeff terms from arithmetic mixing rule -WARNING: Fix gcmc using full_energy option (src/MC/fix_gcmc.cpp:544) +WARNING: Fix gcmc using full_energy option (src/MC/fix_gcmc.cpp:545) 0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc 0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc -WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:671) +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:659) Neighbor list info ... update: every = 1 steps, delay = 10 steps, check = yes max neighbors/atom: 2000, page size: 100000 @@ -150,54 +150,54 @@ Neighbor list info ... Per MPI rank memory allocation (min/avg/max) = 16.23 | 16.23 | 16.23 Mbytes Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO 0 364.27579 4238.8638 -9.6809362 13.391989 0.5846359 24 0 0 0 0 8 16 - 1000 261.50951 -204.60972 -9.6459262 8.3147751 0.51155641 21 0.096366192 0.097590121 0 0 7 14 - 2000 479.39488 231.26661 -7.008929 10.479224 0.36539744 15 0.085531005 0.085453295 0 0 5 10 - 3000 318.30562 -433.20078 -7.368017 8.5392774 0.43847693 18 0.078556687 0.080101462 0 0 6 12 - 4000 357.37576 -185.42051 -16.451291 14.91377 0.65771539 27 0.082003877 0.08249082 0 0 9 18 - 5000 397.73596 1560.2024 -16.579282 18.574014 0.73079488 30 0.071678941 0.073138028 0 0 10 20 - 6000 439.12281 1378.5794 -27.216281 24.869892 0.87695385 36 0.067637015 0.067021883 0 0 12 24 - 7000 394.34069 -838.36998 -19.380063 18.415457 0.73079488 30 0.062462904 0.063256405 0 0 10 20 - 8000 493.77819 -103.13104 -14.023136 20.606026 0.65771539 27 0.0647072 0.065041059 0 0 9 18 - 9000 263.67062 672.93097 -18.720307 12.313248 0.73079488 30 0.063945668 0.064500235 0 0 10 20 - 10000 479.12943 -464.7806 -23.438968 24.75536 0.80387436 33 0.067842336 0.068359178 0 0 11 22 - 11000 324.16871 177.40662 -24.554474 16.748946 0.80387436 33 0.070603916 0.071401039 0 0 11 22 - 12000 342.58054 -273.62776 -30.03447 19.402183 0.87695385 36 0.066775756 0.067225761 0 0 12 24 - 13000 293.86469 -1074.6789 -27.428996 16.643142 0.87695385 36 0.063452357 0.063934452 0 0 12 24 - 14000 445.63956 458.50971 -23.067963 23.025026 0.80387436 33 0.062428172 0.062858705 0 0 11 22 - 15000 267.33755 -9.409495 -8.9343062 8.5000796 0.51155641 21 0.071881495 0.07305838 0 0 7 14 - 16000 329.01771 -218.13496 -8.0156279 8.8266537 0.43847693 18 0.080411628 0.081593141 0 0 6 12 - 17000 294.51982 390.9315 -6.9199497 7.9011688 0.43847693 18 0.090153296 0.091499864 0 0 6 12 - 18000 296.09139 -530.1433 -19.71414 13.827278 0.73079488 30 0.092870347 0.093351624 0 0 10 20 - 19000 435.11989 -38.222576 -7.8345577 11.673088 0.43847693 18 0.10319018 0.10396766 0 0 6 12 - 20000 453.60252 183.44303 -6.2297259 12.168927 0.43847693 18 0.11379162 0.1146083 0 0 6 12 -Loop time of 26.1869 on 1 procs for 20000 steps with 18 atoms - -Performance: 65.987 ns/day, 0.364 hours/ns, 763.741 timesteps/s, 13.747 katom-step/s -99.5% CPU use with 1 MPI tasks x 1 OpenMP threads + 1000 441.23908 1196.2158 -38.016927 29.373914 1.0231128 42 0.059394179 0.048475056 0 0 14 28 + 2000 1317.0761 98.969826 -0.086412882 2.6173025 0.073079488 3 0.085531005 0.089382182 0 0 1 2 + 3000 385.46784 165.90176 -4.6922258 8.4260471 0.36539744 15 0.15950674 0.15980373 0 0 5 10 + 4000 259.17383 -163.00669 -9.501605 8.2405116 0.51155641 21 0.2121105 0.20840552 0 0 7 14 + 5000 301.93801 -25.34487 -12.501675 11.100245 0.5846359 24 0.18075428 0.18003273 0 0 8 16 + 6000 265.53022 1141.4489 -25.076385 15.038408 0.87695385 36 0.16007439 0.15991436 0 0 12 24 + 7000 320.64786 -580.40809 -34.76376 19.753001 0.95003334 39 0.1403768 0.14047284 0 0 13 26 + 8000 327.38906 191.78644 -26.116742 18.541807 0.87695385 36 0.12443692 0.12455739 0 0 12 24 + 9000 490.82664 250.20812 -17.862635 22.921289 0.73079488 30 0.11310461 0.1131126 0 0 10 20 + 10000 391.99786 -344.27861 -22.065439 20.2535 0.80387436 33 0.10876277 0.10903396 0 0 11 22 + 11000 391.1814 306.6284 -9.5427881 14.381129 0.5846359 24 0.10718618 0.1080864 0 0 8 16 + 12000 346.20004 227.14734 -5.7952857 9.287609 0.43847693 18 0.1162116 0.11779293 0 0 6 12 + 13000 291.11722 1724.3638 -23.536535 16.487538 0.87695385 36 0.12251266 0.12333452 0 0 12 24 + 14000 229.08717 -137.67534 -2.2524897 3.8695702 0.29231795 12 0.12761235 0.12924789 0 0 4 8 + 15000 456.01062 886.30377 -12.07992 19.029935 0.65771539 27 0.13229655 0.13343873 0 0 9 18 + 16000 474.21032 -817.15865 -30.239888 26.857087 0.87695385 36 0.12572618 0.12753718 0 0 12 24 + 17000 341.05154 -79.512323 -11.184892 12.538188 0.5846359 24 0.12987013 0.1320269 0 0 8 16 + 18000 405.96549 -155.37609 -14.399665 16.941484 0.65771539 27 0.1310847 0.13326459 0 0 9 18 + 19000 223.22317 -463.83032 -6.9796552 5.9884729 0.43847693 18 0.13345706 0.13625108 0 0 6 12 + 20000 250.80826 -851.52938 -27.81638 14.204624 0.87695385 36 0.1302055 0.13261768 0 0 12 24 +Loop time of 13.5908 on 1 procs for 20000 steps with 36 atoms + +Performance: 127.145 ns/day, 0.189 hours/ns, 1471.588 timesteps/s, 52.977 katom-step/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 4.1672 | 4.1672 | 4.1672 | 0.0 | 15.91 -Bond | 0.028771 | 0.028771 | 0.028771 | 0.0 | 0.11 -Kspace | 0.40296 | 0.40296 | 0.40296 | 0.0 | 1.54 -Neigh | 0.1455 | 0.1455 | 0.1455 | 0.0 | 0.56 -Comm | 0.5177 | 0.5177 | 0.5177 | 0.0 | 1.98 -Output | 0.001405 | 0.001405 | 0.001405 | 0.0 | 0.01 -Modify | 20.905 | 20.905 | 20.905 | 0.0 | 79.83 -Other | | 0.01861 | | | 0.07 - -Nlocal: 18 ave 18 max 18 min +Pair | 2.5994 | 2.5994 | 2.5994 | 0.0 | 19.13 +Bond | 0.020329 | 0.020329 | 0.020329 | 0.0 | 0.15 +Kspace | 0.10469 | 0.10469 | 0.10469 | 0.0 | 0.77 +Neigh | 0.075741 | 0.075741 | 0.075741 | 0.0 | 0.56 +Comm | 0.11347 | 0.11347 | 0.11347 | 0.0 | 0.83 +Output | 0.0013142 | 0.0013142 | 0.0013142 | 0.0 | 0.01 +Modify | 10.651 | 10.651 | 10.651 | 0.0 | 78.37 +Other | | 0.02498 | | | 0.18 + +Nlocal: 36 ave 36 max 36 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1444 ave 1444 max 1444 min +Nghost: 2504 ave 2504 max 2504 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2747 ave 2747 max 2747 min +Neighs: 11099 ave 11099 max 11099 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Total # of neighbors = 2747 -Ave neighs/atom = 152.61111 +Total # of neighbors = 11099 +Ave neighs/atom = 308.30556 Ave special neighs/atom = 2 -Neighbor list builds = 20371 +Neighbor list builds = 20226 Dangerous builds = 0 -Total wall time: 0:00:26 +Total wall time: 0:00:13 diff --git a/examples/mc/log.15Jul25.gcmc.co2.g++.4 b/examples/mc/log.30Mar26.gcmc.co2.g++.4 similarity index 60% rename from examples/mc/log.15Jul25.gcmc.co2.g++.4 rename to examples/mc/log.30Mar26.gcmc.co2.g++.4 index 9d0f5f8a79f..4caed1b284c 100644 --- a/examples/mc/log.15Jul25.gcmc.co2.g++.4 +++ b/examples/mc/log.30Mar26.gcmc.co2.g++.4 @@ -1,4 +1,4 @@ -LAMMPS (12 Jun 2025 - Development - patch_12Jun2025-747-g3fabe8e766-modified) +LAMMPS (10 Dec 2025 - Development - patch_10Dec2025-125-g8985ed3c66-modified) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. using 1 OpenMP thread(s) per MPI task # GCMC for CO2 molecular fluid, rigid/small dynamics @@ -80,7 +80,7 @@ timestep 1.0 fix myrigid co2 rigid/small molecule mol co2mol Fix rigid/small setup ... - create bodies CPU = 0.000 seconds + create bodies CPU = 0.001 seconds 8 rigid bodies with 24 atoms 1.16 = max distance from body owner to body atom @@ -131,10 +131,10 @@ Ewald initialization ... KSpace vectors: actual max1d max3d = 16 2 62 kxmax kymax kzmax = 2 2 2 Generated 1 of 1 mixed pair_coeff terms from arithmetic mixing rule -WARNING: Fix gcmc using full_energy option (src/MC/fix_gcmc.cpp:544) +WARNING: Fix gcmc using full_energy option (src/MC/fix_gcmc.cpp:545) 0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc 0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc -WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:671) +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:659) Neighbor list info ... update: every = 1 steps, delay = 10 steps, check = yes max neighbors/atom: 2000, page size: 100000 @@ -150,54 +150,54 @@ Neighbor list info ... Per MPI rank memory allocation (min/avg/max) = 15.98 | 15.98 | 15.98 Mbytes Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO 0 386.52184 23582.466 -3.243336 14.209828 0.5846359 24 0 0 0 0 8 16 - 1000 384.36038 168.8565 -23.23756 19.858892 0.80387436 33 0.066251757 0.059749054 0 0 11 22 - 2000 259.20312 79.93135 -7.8419179 6.9537173 0.43847693 18 0.051929539 0.052057755 0 0 6 12 - 3000 302.31867 445.47652 -13.370169 12.616164 0.65771539 27 0.047267159 0.046725853 0 0 9 18 - 4000 311.13345 -938.38621 -29.22157 17.621165 0.87695385 36 0.054172258 0.052814245 0 0 12 24 - 5000 396.33597 -44.28057 -26.752206 20.477639 0.80387436 33 0.044110118 0.044289139 0 0 11 22 - 6000 245.89021 2482.6039 -25.362995 15.147675 0.95003334 39 0.039786479 0.038537583 0 0 13 26 - 7000 440.67757 717.28698 -20.567519 22.768653 0.80387436 33 0.041265086 0.041304411 0 0 11 22 - 8000 248.13001 -14.926787 -0.63740551 1.7257997 0.14615898 6 0.071888759 0.074118741 0 0 2 4 - 9000 277.15623 -227.47853 -5.5250283 7.4353507 0.43847693 18 0.094678996 0.096439999 0 0 6 12 - 10000 345.47492 -635.34218 -16.880341 14.417131 0.65771539 27 0.11141675 0.11360191 0 0 9 18 - 11000 247.76523 -37.50499 -14.914147 10.339575 0.65771539 27 0.11884001 0.12136592 0 0 9 18 - 12000 278.10084 -1130.3749 -20.865779 12.987131 0.73079488 30 0.11547154 0.11754602 0 0 10 20 - 13000 232.97823 35.772245 -1.6446369 2.7778553 0.21923846 9 0.11117711 0.11423509 0 0 3 6 - 14000 634.7214 67.540076 -14.886044 26.487775 0.65771539 27 0.12892099 0.13153145 0 0 9 18 - 15000 254.33403 -662.65902 -17.026551 10.6137 0.65771539 27 0.13170558 0.13459023 0 0 9 18 - 16000 337.751 -185.58714 -12.789359 10.738897 0.51155641 21 0.12753681 0.13010941 0 0 7 14 - 17000 245.62037 -950.33014 -16.014926 10.250067 0.65771539 27 0.1293842 0.13169301 0 0 9 18 - 18000 267.9213 -164.14366 -3.4939825 4.5255275 0.29231795 12 0.12884579 0.13116809 0 0 4 8 - 19000 451.13558 431.21581 -17.744905 21.067742 0.73079488 30 0.13599607 0.13748398 0 0 10 20 - 20000 622.65114 956.80085 -31.853322 38.357432 0.95003334 39 0.13225226 0.13345276 0 0 13 26 -Loop time of 15.2689 on 4 procs for 20000 steps with 39 atoms - -Performance: 113.171 ns/day, 0.212 hours/ns, 1309.853 timesteps/s, 51.084 katom-step/s -98.4% CPU use with 4 MPI tasks x 1 OpenMP threads + 1000 428.94255 -422.42418 -8.5806217 13.63836 0.51155641 21 0.055434567 0.058574025 0 0 7 14 + 2000 675.73952 233.54331 -1.5188658 8.0570046 0.21923846 9 0.11389981 0.11705188 0 0 3 6 + 3000 554.41535 145.57544 -2.5722713 9.3647721 0.29231795 12 0.14724583 0.1487285 0 0 4 8 + 4000 295.598 493.56332 -23.35589 15.272772 0.80387436 33 0.13924625 0.13527575 0 0 11 22 + 5000 366.47778 -496.60153 -7.6837736 11.652274 0.51155641 21 0.12399504 0.12439502 0 0 7 14 + 6000 348.14226 -478.39477 -34.364661 21.44675 0.95003334 39 0.1242071 0.12344853 0 0 13 26 + 7000 409.75692 473.48309 -22.831794 21.171064 0.80387436 33 0.11085529 0.11113983 0 0 11 22 + 8000 228.69984 178.3046 -2.5485773 3.8630278 0.29231795 12 0.11426153 0.11624112 0 0 4 8 + 9000 486.65267 -167.89541 -15.608852 20.308668 0.65771539 27 0.12541342 0.12546996 0 0 9 18 + 10000 447.16 24.810849 -1.6263705 5.3315961 0.21923846 9 0.13408778 0.13611451 0 0 3 6 + 11000 447.95067 1601.6456 -32.952684 29.820714 1.0231128 42 0.13481479 0.13499936 0 0 14 28 + 12000 449.15312 -124.71742 -31.02635 25.437963 0.87695385 36 0.12408795 0.12524974 0 0 12 24 + 13000 391.62252 -1278.3998 -20.263025 18.28852 0.73079488 30 0.11895503 0.12074933 0 0 10 20 + 14000 507.79213 204.59384 -5.5780157 13.622687 0.43847693 18 0.11852944 0.12062587 0 0 6 12 + 15000 293.86612 228.51951 -18.497427 13.723359 0.73079488 30 0.1248327 0.1261051 0 0 10 20 + 16000 401.59081 -152.35272 -13.603327 14.763813 0.5846359 24 0.12246261 0.12506158 0 0 8 16 + 17000 302.88363 457.41463 -26.171548 17.153933 0.87695385 36 0.11771425 0.11947602 0 0 12 24 + 18000 313.23405 590.78833 -22.841178 14.627829 0.73079488 30 0.11218637 0.11405053 0 0 10 20 + 19000 217.86614 -851.02605 -16.690476 9.0918461 0.65771539 27 0.10818022 0.11025933 0 0 9 18 + 20000 347.05996 -1114.5685 -27.731887 19.655877 0.87695385 36 0.10600113 0.10801954 0 0 12 24 +Loop time of 12.3169 on 4 procs for 20000 steps with 36 atoms + +Performance: 140.295 ns/day, 0.171 hours/ns, 1623.785 timesteps/s, 58.456 katom-step/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 1.0667 | 1.3648 | 1.6088 | 17.2 | 8.94 -Bond | 0.018075 | 0.018542 | 0.018852 | 0.2 | 0.12 -Kspace | 0.37763 | 0.62405 | 0.92221 | 25.5 | 4.09 -Neigh | 0.04681 | 0.046871 | 0.046941 | 0.0 | 0.31 -Comm | 0.75101 | 0.75373 | 0.75705 | 0.2 | 4.94 -Output | 0.0013081 | 0.001343 | 0.0014374 | 0.1 | 0.01 -Modify | 12.398 | 12.406 | 12.413 | 0.2 | 81.25 -Other | | 0.05376 | | | 0.35 - -Nlocal: 9.75 ave 12 max 9 min -Histogram: 3 0 0 0 0 0 0 0 0 1 -Nghost: 2218.75 ave 2292 max 2147 min -Histogram: 1 0 1 0 0 0 1 0 0 1 -Neighs: 3245.5 ave 3905 max 2859 min -Histogram: 1 1 0 1 0 0 0 0 0 1 - -Total # of neighbors = 12982 -Ave neighs/atom = 332.87179 +Pair | 0.64519 | 0.83716 | 1.0492 | 19.4 | 6.80 +Bond | 0.0094923 | 0.010025 | 0.010632 | 0.4 | 0.08 +Kspace | 0.24916 | 0.45733 | 0.64766 | 26.1 | 3.71 +Neigh | 0.030106 | 0.030136 | 0.030172 | 0.0 | 0.24 +Comm | 0.7716 | 0.77506 | 0.7773 | 0.2 | 6.29 +Output | 0.0011776 | 0.0013585 | 0.0018831 | 0.8 | 0.01 +Modify | 10.141 | 10.143 | 10.144 | 0.0 | 82.35 +Other | | 0.06288 | | | 0.51 + +Nlocal: 9 ave 12 max 6 min +Histogram: 1 0 0 1 0 0 1 0 0 1 +Nghost: 2113.25 ave 2140 max 2087 min +Histogram: 1 0 0 1 0 1 0 0 0 1 +Neighs: 2774.5 ave 4142 max 1238 min +Histogram: 1 0 0 0 1 0 1 0 0 1 + +Total # of neighbors = 11098 +Ave neighs/atom = 308.27778 Ave special neighs/atom = 2 -Neighbor list builds = 20270 +Neighbor list builds = 20280 Dangerous builds = 0 -Total wall time: 0:00:15 +Total wall time: 0:00:12 diff --git a/examples/mc/log.30Mar26.gcmc.h2o.g++.1 b/examples/mc/log.30Mar26.gcmc.h2o.g++.1 new file mode 100644 index 00000000000..228a874a5e7 --- /dev/null +++ b/examples/mc/log.30Mar26.gcmc.h2o.g++.1 @@ -0,0 +1,301 @@ +LAMMPS (10 Dec 2025 - Development - patch_10Dec2025-125-g8985ed3c66-modified) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task +# fix gcmc example with fix shake + +# variables available on command line + +variable mu index -8.1 +variable disp index 0.5 +variable temp index 338.0 +variable lbox index 10.0 +variable spacing index 5.0 + +# global model settings + +units real +atom_style full +boundary p p p +pair_style lj/cut/coul/long 14 +pair_modify mix arithmetic tail yes +kspace_style ewald 0.0001 +bond_style harmonic +angle_style harmonic + +# box, start molecules on simple cubic lattice + +lattice sc ${spacing} +lattice sc 5.0 +Lattice spacing in x,y,z = 5 5 5 +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box +region box block 0 10.0 0 ${lbox} 0 ${lbox} units box +region box block 0 10.0 0 10.0 0 ${lbox} units box +region box block 0 10.0 0 10.0 0 10.0 units box +create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 +Created orthogonal box = (0 0 0) to (10 10 10) + 1 by 1 by 1 MPI processor grid + +molecule h2omol H2O.txt +Read molecule template h2omol: +# Water molecule. SPC/E model. + 1 molecules + 0 fragments + 0 bodies + 3 atoms with max type 2 + 2 bonds with max type 1 + 1 angles with max type 1 + 0 dihedrals with max type 0 + 0 impropers with max type 0 +create_atoms 0 box mol h2omol 464563 units box +Created 24 atoms + using box units in orthogonal box = (0 0 0) to (10 10 10) + create_atoms CPU = 0.002 seconds + +# rigid SPC/E water model + +pair_coeff 1 1 0.15535 3.166 +pair_coeff * 2 0.0000 0.0000 + +bond_coeff 1 1000 1.0 +angle_coeff 1 100 109.47 + +# masses + +mass 1 15.9994 +mass 2 1.0 + +# MD settings + +group h2o type 1 2 +24 atoms in group h2o +neighbor 2.0 bin +neigh_modify every 1 delay 1 check yes +velocity all create ${temp} 54654 +velocity all create 338.0 54654 +timestep 1.0 + +minimize 0.0 0.0 100 1000 +Switching to 'neigh_modify every 1 delay 0 check yes' setting during minimization +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17044845 + estimated absolute RMS force accuracy = 0.033206374 + estimated relative force accuracy = 0.00010000001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 16 + ghost atom cutoff = 16 + binsize = 8, bins = 2 2 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 11.88 | 11.88 | 11.88 Mbytes + Step Temp E_pair E_mol TotEng Press + 0 338 -1.1958379 9.2628112e-06 21.976989 795.36071 + 100 338 -17.048203 0.087408665 6.2120228 -128.40105 +Loop time of 0.039038 on 1 procs for 100 steps with 24 atoms + +99.5% CPU use with 1 MPI tasks x 1 OpenMP threads + +Minimization stats: + Stopping criterion = max iterations + Energy initial, next-to-last, final = + -1.19582867716414 -16.9383361132258 -16.9607945702029 + Force two-norm initial, final = 20.819507 6.0831083 + Force max component initial, final = 7.29323 1.5282493 + Final line search alpha, max atom move = 0.042670736 0.065211522 + Iterations, force evaluations = 100 285 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.034543 | 0.034543 | 0.034543 | 0.0 | 88.48 +Bond | 0.00026967 | 0.00026967 | 0.00026967 | 0.0 | 0.69 +Kspace | 0.0016768 | 0.0016768 | 0.0016768 | 0.0 | 4.30 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0020804 | 0.0020804 | 0.0020804 | 0.0 | 5.33 +Output | 2.1989e-05 | 2.1989e-05 | 2.1989e-05 | 0.0 | 0.06 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.0004465 | | | 1.14 + +Nlocal: 24 ave 24 max 24 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 2163 ave 2163 max 2163 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 5041 ave 5041 max 5041 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 5041 +Ave neighs/atom = 210.04167 +Ave special neighs/atom = 2 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + +# rigid constraints with thermostat + +fix mynvt h2o nvt temp ${temp} ${temp} 100 +fix mynvt h2o nvt temp 338.0 ${temp} 100 +fix mynvt h2o nvt temp 338.0 338.0 100 +fix wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol +Finding SHAKE clusters ... + 0 = # of size 2 clusters + 0 = # of size 3 clusters + 0 = # of size 4 clusters + 8 = # of frozen angles + find clusters CPU = 0.000 seconds + +# important to make temperature dofs dynamic + +compute_modify thermo_temp dynamic/dof yes +compute_modify mynvt_temp dynamic/dof yes + +run 1000 +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17044845 + estimated absolute RMS force accuracy = 0.033206374 + estimated relative force accuracy = 0.00010000001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +Per MPI rank memory allocation (min/avg/max) = 11.63 | 11.63 | 11.63 Mbytes + Step Temp E_pair E_mol TotEng Press + 0 518.26667 -17.048203 0 6.1246141 -6999.4459 + 1000 273.95583 -52.606563 0 -40.357408 1250.0241 +Loop time of 0.0881289 on 1 procs for 1000 steps with 24 atoms + +Performance: 980.382 ns/day, 0.024 hours/ns, 11347.014 timesteps/s, 272.328 katom-step/s +99.5% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.065116 | 0.065116 | 0.065116 | 0.0 | 73.89 +Bond | 0.00018504 | 0.00018504 | 0.00018504 | 0.0 | 0.21 +Kspace | 0.0053274 | 0.0053274 | 0.0053274 | 0.0 | 6.04 +Neigh | 0.0040103 | 0.0040103 | 0.0040103 | 0.0 | 4.55 +Comm | 0.0058553 | 0.0058553 | 0.0058553 | 0.0 | 6.64 +Output | 2.1843e-05 | 2.1843e-05 | 2.1843e-05 | 0.0 | 0.02 +Modify | 0.0065919 | 0.0065919 | 0.0065919 | 0.0 | 7.48 +Other | | 0.001022 | | | 1.16 + +Nlocal: 24 ave 24 max 24 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 1576 ave 1576 max 1576 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 5083 ave 5083 max 5083 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 5083 +Ave neighs/atom = 211.79167 +Ave special neighs/atom = 2 +Neighbor list builds = 29 +Dangerous builds = 0 +reset_timestep 0 + +# gcmc + +variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) +fix mygcmc h2o gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake + +# atom counts + +variable oxygen atom "type==1" +variable hydrogen atom "type==2" +group oxygen dynamic all var oxygen +dynamic group oxygen defined +group hydrogen dynamic all var hydrogen +dynamic group hydrogen defined +variable nO equal count(oxygen) +variable nH equal count(hydrogen) + +# output + +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) +variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH +thermo 1000 + +# run + +run 20000 +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17044845 + estimated absolute RMS force accuracy = 0.033206374 + estimated relative force accuracy = 0.00010000001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +WARNING: Fix gcmc using full_energy option (src/MC/fix_gcmc.cpp:545) +0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:659) +Per MPI rank memory allocation (min/avg/max) = 11.63 | 11.63 | 11.63 Mbytes + Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH + 0 273.95583 1250.2451 -52.606563 12.249154 0.23910963 24 0 0 0 0 8 16 + 1000 376.29773 -3571.6252 -252.46712 54.961931 0.74721761 75 0.047515343 0.014138558 0 0 25 50 + 2000 347.9602 -3571.2779 -299.50244 59.120586 0.86677242 87 0.030515716 0.0088486874 0 0 29 58 + 3000 332.23652 -1121.7913 -359.80969 62.39104 0.95643854 96 0.02211648 0.005967774 0 0 32 64 + 4000 341.60417 550.82996 -360.57319 66.186713 0.98632724 99 0.017188211 0.0044508185 0 0 33 66 + 5000 336.78405 -3205.0106 -353.62536 65.252804 0.98632724 99 0.013621249 0.0035941057 0 0 33 66 + 6000 355.79734 -352.598 -358.16351 68.936679 0.98632724 99 0.01129906 0.0030089265 0 0 33 66 + 7000 347.83371 372.84976 -358.56096 67.393704 0.98632724 99 0.0099485518 0.0028718302 0 0 33 66 + 8000 306.31582 -2924.6686 -361.09984 61.175642 1.0162159 102 0.0089550011 0.0025124997 0 0 34 68 + 9000 324.49336 -647.77656 -373.97999 64.805955 1.0162159 102 0.0079909436 0.0022246446 0 0 34 68 + 10000 344.18171 -960.98077 -358.08301 70.789881 1.0461046 105 0.0073733086 0.0020071857 0 0 35 70 + 11000 282.72492 993.631 -375.70013 58.149701 1.0461046 105 0.0067027771 0.0018247842 0 0 35 70 + 12000 372.79512 608.65077 -365.29144 76.674968 1.0461046 105 0.0061196474 0.001679515 0 0 35 70 + 13000 354.55064 -4246.9935 -384.43983 72.92252 1.0461046 105 0.0056461827 0.001551085 0 0 35 70 + 14000 358.09494 -1429.4282 -366.43983 73.651497 1.0461046 105 0.005248897 0.0014386212 0 0 35 70 + 15000 345.03216 4791.8109 -399.57809 73.021748 1.0759934 108 0.0050323794 0.0013424441 0 0 36 72 + 16000 383.00624 2915.3513 -393.66417 81.058487 1.0759934 108 0.0048213027 0.0013904514 0 0 36 72 + 17000 326.96999 4790.2179 -389.52685 69.199115 1.0759934 108 0.0045438128 0.0013068634 0 0 36 72 + 18000 337.80476 955.80681 -377.58946 71.49216 1.0759934 108 0.0042917983 0.0012341385 0 0 36 72 + 19000 306.14688 1345.463 -383.33331 64.792165 1.0759934 108 0.0040637276 0.001169827 0 0 36 72 + 20000 316.33439 1698.0501 -397.45128 66.948223 1.0759934 108 0.0038537169 0.0011133491 0 0 36 72 +Loop time of 157.023 on 1 procs for 20000 steps with 108 atoms + +Performance: 11.005 ns/day, 2.181 hours/ns, 127.370 timesteps/s, 13.756 katom-step/s +99.7% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 37.619 | 37.619 | 37.619 | 0.0 | 23.96 +Bond | 0.059003 | 0.059003 | 0.059003 | 0.0 | 0.04 +Kspace | 0.45592 | 0.45592 | 0.45592 | 0.0 | 0.29 +Neigh | 2.4465 | 2.4465 | 2.4465 | 0.0 | 1.56 +Comm | 0.54509 | 0.54509 | 0.54509 | 0.0 | 0.35 +Output | 0.0012392 | 0.0012392 | 0.0012392 | 0.0 | 0.00 +Modify | 115.81 | 115.81 | 115.81 | 0.0 | 73.75 +Other | | 0.08599 | | | 0.05 + +Nlocal: 108 ave 108 max 108 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 7937 ave 7937 max 7937 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 99951 ave 99951 max 99951 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 99951 +Ave neighs/atom = 925.47222 +Ave special neighs/atom = 2 +Neighbor list builds = 20910 +Dangerous builds = 0 + +Total wall time: 0:02:37 diff --git a/examples/mc/log.30Mar26.gcmc.h2o.g++.4 b/examples/mc/log.30Mar26.gcmc.h2o.g++.4 new file mode 100644 index 00000000000..c9fd7aae7cf --- /dev/null +++ b/examples/mc/log.30Mar26.gcmc.h2o.g++.4 @@ -0,0 +1,301 @@ +LAMMPS (10 Dec 2025 - Development - patch_10Dec2025-125-g8985ed3c66-modified) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task +# fix gcmc example with fix shake + +# variables available on command line + +variable mu index -8.1 +variable disp index 0.5 +variable temp index 338.0 +variable lbox index 10.0 +variable spacing index 5.0 + +# global model settings + +units real +atom_style full +boundary p p p +pair_style lj/cut/coul/long 14 +pair_modify mix arithmetic tail yes +kspace_style ewald 0.0001 +bond_style harmonic +angle_style harmonic + +# box, start molecules on simple cubic lattice + +lattice sc ${spacing} +lattice sc 5.0 +Lattice spacing in x,y,z = 5 5 5 +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box +region box block 0 10.0 0 ${lbox} 0 ${lbox} units box +region box block 0 10.0 0 10.0 0 ${lbox} units box +region box block 0 10.0 0 10.0 0 10.0 units box +create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 +Created orthogonal box = (0 0 0) to (10 10 10) + 1 by 2 by 2 MPI processor grid + +molecule h2omol H2O.txt +Read molecule template h2omol: +# Water molecule. SPC/E model. + 1 molecules + 0 fragments + 0 bodies + 3 atoms with max type 2 + 2 bonds with max type 1 + 1 angles with max type 1 + 0 dihedrals with max type 0 + 0 impropers with max type 0 +create_atoms 0 box mol h2omol 464563 units box +Created 24 atoms + using box units in orthogonal box = (0 0 0) to (10 10 10) + create_atoms CPU = 0.003 seconds + +# rigid SPC/E water model + +pair_coeff 1 1 0.15535 3.166 +pair_coeff * 2 0.0000 0.0000 + +bond_coeff 1 1000 1.0 +angle_coeff 1 100 109.47 + +# masses + +mass 1 15.9994 +mass 2 1.0 + +# MD settings + +group h2o type 1 2 +24 atoms in group h2o +neighbor 2.0 bin +neigh_modify every 1 delay 1 check yes +velocity all create ${temp} 54654 +velocity all create 338.0 54654 +timestep 1.0 + +minimize 0.0 0.0 100 1000 +Switching to 'neigh_modify every 1 delay 0 check yes' setting during minimization +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17044845 + estimated absolute RMS force accuracy = 0.033206374 + estimated relative force accuracy = 0.00010000001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 16 + ghost atom cutoff = 16 + binsize = 8, bins = 2 2 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 11.85 | 11.92 | 12.12 Mbytes + Step Temp E_pair E_mol TotEng Press + 0 338 -0.95546485 9.2628112e-06 22.217362 805.04028 + 100 338 -15.273306 0.20594388 8.1054551 -95.912612 +Loop time of 0.0320509 on 4 procs for 100 steps with 24 atoms + +98.7% CPU use with 4 MPI tasks x 1 OpenMP threads + +Minimization stats: + Stopping criterion = max iterations + Energy initial, next-to-last, final = + -0.955455591456625 -15.0222740429501 -15.0673621835651 + Force two-norm initial, final = 24.052787 14.932952 + Force max component initial, final = 8.3161245 5.4344027 + Final line search alpha, max atom move = 0.010391588 0.056472074 + Iterations, force evaluations = 100 291 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0045716 | 0.0092022 | 0.014285 | 3.6 | 28.71 +Bond | 8.6504e-05 | 0.00013352 | 0.00016946 | 0.0 | 0.42 +Kspace | 0.0016563 | 0.0066016 | 0.011073 | 4.1 | 20.60 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.014098 | 0.0143 | 0.014499 | 0.1 | 44.62 +Output | 1.9238e-05 | 2.1567e-05 | 2.8412e-05 | 0.0 | 0.07 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.001792 | | | 5.59 + +Nlocal: 6 ave 8 max 4 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Nghost: 1722 ave 1724 max 1720 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Neighs: 1256 ave 2048 max 640 min +Histogram: 1 0 0 1 1 0 0 0 0 1 + +Total # of neighbors = 5024 +Ave neighs/atom = 209.33333 +Ave special neighs/atom = 2 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + +# rigid constraints with thermostat + +fix mynvt h2o nvt temp ${temp} ${temp} 100 +fix mynvt h2o nvt temp 338.0 ${temp} 100 +fix mynvt h2o nvt temp 338.0 338.0 100 +fix wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol +Finding SHAKE clusters ... + 0 = # of size 2 clusters + 0 = # of size 3 clusters + 0 = # of size 4 clusters + 8 = # of frozen angles + find clusters CPU = 0.000 seconds + +# important to make temperature dofs dynamic + +compute_modify thermo_temp dynamic/dof yes +compute_modify mynvt_temp dynamic/dof yes + +run 1000 +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17044845 + estimated absolute RMS force accuracy = 0.033206374 + estimated relative force accuracy = 0.00010000001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +Per MPI rank memory allocation (min/avg/max) = 11.6 | 11.6 | 11.6 Mbytes + Step Temp E_pair E_mol TotEng Press + 0 518.26667 -15.273306 0 7.8995113 20.304529 + 1000 262.00762 -52.750541 0 -41.035617 -263.49214 +Loop time of 0.101894 on 4 procs for 1000 steps with 24 atoms + +Performance: 847.944 ns/day, 0.028 hours/ns, 9814.168 timesteps/s, 235.540 katom-step/s +99.6% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0091663 | 0.016578 | 0.027766 | 6.1 | 16.27 +Bond | 9.0373e-05 | 0.0001131 | 0.00014015 | 0.0 | 0.11 +Kspace | 0.005337 | 0.015901 | 0.022831 | 5.8 | 15.61 +Neigh | 0.0019387 | 0.001953 | 0.0019755 | 0.0 | 1.92 +Comm | 0.039254 | 0.040091 | 0.04074 | 0.3 | 39.35 +Output | 3.7821e-05 | 4.512e-05 | 6.6671e-05 | 0.0 | 0.04 +Modify | 0.025217 | 0.025472 | 0.025739 | 0.1 | 25.00 +Other | | 0.001741 | | | 1.71 + +Nlocal: 6 ave 9 max 2 min +Histogram: 1 0 0 0 1 0 0 0 1 1 +Nghost: 1356 ave 1502 max 1219 min +Histogram: 1 0 0 1 0 1 0 0 0 1 +Neighs: 1260.25 ave 2079 max 510 min +Histogram: 1 1 0 0 0 0 0 1 0 1 + +Total # of neighbors = 5041 +Ave neighs/atom = 210.04167 +Ave special neighs/atom = 2 +Neighbor list builds = 31 +Dangerous builds = 0 +reset_timestep 0 + +# gcmc + +variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) +fix mygcmc h2o gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake + +# atom counts + +variable oxygen atom "type==1" +variable hydrogen atom "type==2" +group oxygen dynamic all var oxygen +dynamic group oxygen defined +group hydrogen dynamic all var hydrogen +dynamic group hydrogen defined +variable nO equal count(oxygen) +variable nH equal count(hydrogen) + +# output + +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) +variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH +thermo 1000 + +# run + +run 20000 +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17044845 + estimated absolute RMS force accuracy = 0.033206374 + estimated relative force accuracy = 0.00010000001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +WARNING: Fix gcmc using full_energy option (src/MC/fix_gcmc.cpp:545) +0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:659) +Per MPI rank memory allocation (min/avg/max) = 11.6 | 11.6 | 11.6 Mbytes + Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH + 0 262.00762 -263.4426 -52.750541 11.714924 0.23910963 24 0 0 0 0 8 16 + 1000 300.09641 -2543.5353 -214.54971 42.042929 0.7173289 72 0.051474955 0.02019794 0 0 24 48 + 2000 366.84617 -458.2176 -306.31773 62.329429 0.86677242 87 0.037636049 0.015731 0 0 29 58 + 3000 375.36053 -3757.2166 -328.77789 68.251586 0.92654983 93 0.026807855 0.011272462 0 0 31 62 + 4000 316.25676 -3445.2121 -351.50855 61.275586 0.98632724 99 0.021232496 0.0084071015 0 0 33 66 + 5000 293.30834 -2568.2718 -345.42657 56.829269 0.98632724 99 0.016826249 0.0067888663 0 0 33 66 + 6000 329.11459 -177.52243 -361.86182 63.766825 0.98632724 99 0.013957662 0.0056835278 0 0 33 66 + 7000 320.23345 4885.5216 -334.68456 62.04608 0.98632724 99 0.011938262 0.0048821114 0 0 33 66 + 8000 360.37147 -695.02117 -358.29214 69.822928 0.98632724 99 0.010696251 0.0045224994 0 0 33 66 + 9000 302.59106 -951.87476 -369.37693 60.431754 1.0162159 102 0.0097667088 0.0040043603 0 0 34 68 + 10000 474.58368 1158.9568 -380.49229 94.781134 1.0162159 102 0.0087682589 0.0036129343 0 0 34 68 + 11000 352.95317 -1060.7663 -363.98491 70.489787 1.0162159 102 0.0079708701 0.0032846116 0 0 34 68 + 12000 335.54351 2278.8028 -374.11303 69.013212 1.0461046 105 0.0074428144 0.0030231269 0 0 35 70 + 13000 364.07851 2137.7734 -361.70012 74.882174 1.0461046 105 0.006866979 0.002791953 0 0 35 70 + 14000 335.63158 1741.4419 -384.79157 69.031326 1.0461046 105 0.0063837937 0.0025895182 0 0 35 70 + 15000 338.94802 1167.7028 -358.31824 69.713438 1.0461046 105 0.0059593966 0.0024163993 0 0 35 70 + 16000 342.68914 1256.0864 -384.13374 70.482895 1.0461046 105 0.0055630416 0.0022752841 0 0 35 70 + 17000 352.75174 2408.804 -379.32761 72.55253 1.0461046 105 0.005242861 0.0021385038 0 0 35 70 + 18000 356.15373 1240.0612 -378.98192 73.252237 1.0461046 105 0.0049520749 0.0020194994 0 0 35 70 + 19000 319.35421 -1510.6497 -352.75892 65.683462 1.0461046 105 0.0046889164 0.0019142623 0 0 35 70 + 20000 330.87049 -1094.8927 -369.84741 68.052084 1.0461046 105 0.0044465964 0.0018218439 0 0 35 70 +Loop time of 59.1548 on 4 procs for 20000 steps with 105 atoms + +Performance: 29.211 ns/day, 0.822 hours/ns, 338.096 timesteps/s, 35.500 katom-step/s +99.6% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 7.4544 | 10.23 | 12.775 | 63.3 | 17.29 +Bond | 0.020637 | 0.021321 | 0.022468 | 0.5 | 0.04 +Kspace | 0.61747 | 3.1551 | 5.9262 | 113.8 | 5.33 +Neigh | 0.70619 | 0.70678 | 0.70716 | 0.0 | 1.19 +Comm | 1.8687 | 1.8758 | 1.8786 | 0.3 | 3.17 +Output | 0.00080807 | 0.001116 | 0.0020367 | 1.6 | 0.00 +Modify | 43.074 | 43.074 | 43.075 | 0.0 | 72.82 +Other | | 0.09035 | | | 0.15 + +Nlocal: 26.25 ave 29 max 24 min +Histogram: 1 0 1 0 0 0 1 0 0 1 +Nghost: 5919.5 ave 5977 max 5853 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Neighs: 23614.2 ave 27235 max 16467 min +Histogram: 1 0 0 0 0 0 0 1 0 2 + +Total # of neighbors = 94457 +Ave neighs/atom = 899.59048 +Ave special neighs/atom = 2 +Neighbor list builds = 20935 +Dangerous builds = 0 + +Total wall time: 0:00:59 diff --git a/examples/mc/log.30Mar26.gcmc.lj.g++.1 b/examples/mc/log.30Mar26.gcmc.lj.g++.1 new file mode 100644 index 00000000000..9d33c076d9a --- /dev/null +++ b/examples/mc/log.30Mar26.gcmc.lj.g++.1 @@ -0,0 +1,145 @@ +LAMMPS (10 Dec 2025 - Development - patch_10Dec2025-120-ga51f9ba0e7-modified) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task +# GCMC for LJ simple fluid, no dynamics +# T = 2.0 +# rho ~ 0.5 +# p ~ 1.5 +# mu_ex ~ 0.0 +# comparable to Frenkel and Smit GCMC Case Study, Figure 5.8 + +# variables modifiable using -var command line switch + +variable mu index -1.25 +variable temp index 2.0 +variable disp index 1.0 +variable lbox index 5.0 + +# global model settings + +units lj +atom_style atomic +pair_style lj/cut 3.0 +pair_modify tail no # turn of to avoid triggering full_energy + +# box + +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} +region box block 0 5.0 0 ${lbox} 0 ${lbox} +region box block 0 5.0 0 5.0 0 ${lbox} +region box block 0 5.0 0 5.0 0 5.0 +create_box 1 box +Created orthogonal box = (0 0 0) to (5 5 5) + 1 by 1 by 1 MPI processor grid + +# lj parameters + +pair_coeff * * 1.0 1.0 +mass * 1.0 + +# we recommend setting up a dedicated group for gcmc + +group gcmcgroup type 1 +0 atoms in group gcmcgroup + +# gcmc + +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2.0 ${mu} ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2.0 -1.25 ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2.0 -1.25 1.0 + +# atom count + +variable type1 atom "type==1" +group type1 dynamic gcmcgroup var type1 +dynamic group type1 defined +variable n1 equal count(type1) + +# averaging + +variable rho equal density +variable p equal press +variable nugget equal 1.0e-8 +variable lambda equal 1.0 +variable muex equal ${mu}-${temp}*ln(density*${lambda}+${nugget}) +variable muex equal -1.25-${temp}*ln(density*${lambda}+${nugget}) +variable muex equal -1.25-2.0*ln(density*${lambda}+${nugget}) +variable muex equal -1.25-2.0*ln(density*1+${nugget}) +variable muex equal -1.25-2.0*ln(density*1+1e-08) +fix ave all ave/time 10 100 1000 v_rho v_p v_muex v_n1 ave one file rho_vs_p.dat +variable rhoav equal f_ave[1] +variable pav equal f_ave[2] +variable muexav equal f_ave[3] +variable n1av equal f_ave[4] + +# output + +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+${nugget}) +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+1e-08) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+${nugget}) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+1e-08) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+${nugget}) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+1e-08) +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av +thermo 1000 + +# run + +run 10000 +WARNING: No fixes with time integration, atoms won't move +For more information see https://docs.lammps.org/err0028 (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 3.3 + ghost atom cutoff = 3.3 + binsize = 1.65, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 0.4341 | 0.4341 | 0.4341 Mbytes + Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av + 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 + 1000 1.9111873 2.2903746 -2.5743907 2.8197846 0.488 61 0.069245944 0.067178274 0.11416374 0.53408 1.4234514 0.01016356 66.76 + 2000 2.0648782 1.5248961 -3.4073067 3.05307 0.56 70 0.068637952 0.067640698 0.11439227 0.52912 1.345277 0.028098024 66.14 + 3000 1.9497857 1.673179 -3.0505429 2.8796834 0.52 65 0.068755962 0.068126488 0.11428 0.53184 1.4333493 0.018308553 66.48 + 4000 2.1700807 1.0125782 -3.1848954 3.205801 0.528 66 0.067023726 0.066594028 0.11091812 0.54896 1.4286118 -0.046595156 68.62 + 5000 2.320784 1.9515174 -3.2589747 3.4307241 0.552 69 0.066506679 0.066385234 0.11038035 0.54224 1.5009698 -0.022233959 67.78 + 6000 2.2691764 1.031331 -2.9034235 3.3470352 0.48 60 0.06702878 0.066763551 0.11103948 0.53088 1.3916066 0.021125622 66.36 + 7000 1.7131829 2.2435568 -3.5644059 2.5359615 0.608 76 0.066908164 0.066675242 0.11115347 0.53792 1.4472355 -0.0052220884 67.24 + 8000 2.029454 2.6613103 -3.1425103 3.0019007 0.576 72 0.06702816 0.066827764 0.11114373 0.53544 1.4862905 0.003752126 66.93 + 9000 1.9597711 0.60367588 -2.7239253 2.8862084 0.44 55 0.066665332 0.066509449 0.11025249 0.54544 1.4519616 -0.033095475 68.18 + 10000 2.4091509 0.90529185 -2.9615679 3.5514207 0.464 58 0.066734757 0.066493429 0.1105049 0.5368 1.4855021 -0.0014460475 67.1 +Loop time of 12.9509 on 1 procs for 10000 steps with 58 atoms + +Performance: 333566.857 tau/day, 772.146 timesteps/s, 44.784 katom-step/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.46917 | 0.46917 | 0.46917 | 0.0 | 3.62 +Neigh | 0.79658 | 0.79658 | 0.79658 | 0.0 | 6.15 +Comm | 0.072812 | 0.072812 | 0.072812 | 0.0 | 0.56 +Output | 0.0003403 | 0.0003403 | 0.0003403 | 0.0 | 0.00 +Modify | 11.601 | 11.601 | 11.601 | 0.0 | 89.58 +Other | | 0.01099 | | | 0.08 + +Nlocal: 58 ave 58 max 58 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 717 ave 717 max 717 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2010 ave 2010 max 2010 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2010 +Ave neighs/atom = 34.655172 +Neighbor list builds = 10000 +Dangerous builds = 0 +Total wall time: 0:00:12 diff --git a/examples/mc/log.30Mar26.gcmc.lj.g++.4 b/examples/mc/log.30Mar26.gcmc.lj.g++.4 new file mode 100644 index 00000000000..251096b832b --- /dev/null +++ b/examples/mc/log.30Mar26.gcmc.lj.g++.4 @@ -0,0 +1,145 @@ +LAMMPS (10 Dec 2025 - Development - patch_10Dec2025-120-ga51f9ba0e7-modified) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task +# GCMC for LJ simple fluid, no dynamics +# T = 2.0 +# rho ~ 0.5 +# p ~ 1.5 +# mu_ex ~ 0.0 +# comparable to Frenkel and Smit GCMC Case Study, Figure 5.8 + +# variables modifiable using -var command line switch + +variable mu index -1.25 +variable temp index 2.0 +variable disp index 1.0 +variable lbox index 5.0 + +# global model settings + +units lj +atom_style atomic +pair_style lj/cut 3.0 +pair_modify tail no # turn of to avoid triggering full_energy + +# box + +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} +region box block 0 5.0 0 ${lbox} 0 ${lbox} +region box block 0 5.0 0 5.0 0 ${lbox} +region box block 0 5.0 0 5.0 0 5.0 +create_box 1 box +Created orthogonal box = (0 0 0) to (5 5 5) + 1 by 2 by 2 MPI processor grid + +# lj parameters + +pair_coeff * * 1.0 1.0 +mass * 1.0 + +# we recommend setting up a dedicated group for gcmc + +group gcmcgroup type 1 +0 atoms in group gcmcgroup + +# gcmc + +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2.0 ${mu} ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2.0 -1.25 ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2.0 -1.25 1.0 + +# atom count + +variable type1 atom "type==1" +group type1 dynamic gcmcgroup var type1 +dynamic group type1 defined +variable n1 equal count(type1) + +# averaging + +variable rho equal density +variable p equal press +variable nugget equal 1.0e-8 +variable lambda equal 1.0 +variable muex equal ${mu}-${temp}*ln(density*${lambda}+${nugget}) +variable muex equal -1.25-${temp}*ln(density*${lambda}+${nugget}) +variable muex equal -1.25-2.0*ln(density*${lambda}+${nugget}) +variable muex equal -1.25-2.0*ln(density*1+${nugget}) +variable muex equal -1.25-2.0*ln(density*1+1e-08) +fix ave all ave/time 10 100 1000 v_rho v_p v_muex v_n1 ave one file rho_vs_p.dat +variable rhoav equal f_ave[1] +variable pav equal f_ave[2] +variable muexav equal f_ave[3] +variable n1av equal f_ave[4] + +# output + +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+${nugget}) +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+1e-08) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+${nugget}) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+1e-08) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+${nugget}) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+1e-08) +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av +thermo 1000 + +# run + +run 10000 +WARNING: No fixes with time integration, atoms won't move +For more information see https://docs.lammps.org/err0028 (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 3.3 + ghost atom cutoff = 3.3 + binsize = 1.65, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 0.4492 | 0.4492 | 0.4492 Mbytes + Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av + 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 + 1000 2.130875 1.7777378 -3.1553531 3.1486064 0.536 67 0.072124482 0.069901986 0.11925257 0.52712 1.4751223 0.036566467 65.89 + 2000 1.9047617 1.9976253 -3.1997954 2.8163262 0.56 70 0.071170459 0.07016215 0.11750601 0.5276 1.3903295 0.034469819 65.95 + 3000 1.9248762 1.1346815 -3.5308388 2.8466479 0.568 71 0.069896669 0.069224015 0.11611816 0.5332 1.5066929 0.012268844 66.65 + 4000 2.0114989 1.3636206 -3.0409321 2.9715324 0.528 66 0.068695565 0.068263377 0.11422445 0.54208 1.4393652 -0.021286047 67.76 + 5000 2.2017019 2.5154404 -3.2870797 3.256038 0.568 71 0.068514519 0.06838974 0.11370874 0.53728 1.4592362 -0.0024323526 67.16 + 6000 2.0008227 1.8029552 -3.2573296 2.9583593 0.56 70 0.06872702 0.068426807 0.11340843 0.53664 1.3985506 -0.00031314198 67.08 + 7000 2.6130785 1.2983047 -3.2917984 3.861116 0.536 67 0.068820887 0.068613243 0.11368062 0.53104 1.417407 0.02184654 66.38 + 8000 2.1027456 1.3236378 -3.4245623 3.1096943 0.568 71 0.069310226 0.06911164 0.11478723 0.52472 1.423241 0.044825683 65.59 + 9000 2.1368755 1.7343177 -3.5915073 3.1625757 0.6 75 0.069173788 0.068972185 0.11447721 0.53504 1.3773871 0.0052393953 66.88 + 10000 1.948858 1.7053149 -3.0949918 2.8796558 0.536 67 0.068981746 0.068718205 0.11424544 0.5344 1.4579298 0.0092427379 66.8 +Loop time of 12.9217 on 4 procs for 10000 steps with 67 atoms + +Performance: 334321.330 tau/day, 773.892 timesteps/s, 51.851 katom-step/s +99.9% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.12796 | 0.12992 | 0.13385 | 0.7 | 1.01 +Neigh | 0.23732 | 0.24291 | 0.24961 | 0.9 | 1.88 +Comm | 0.26744 | 0.27861 | 0.28455 | 1.3 | 2.16 +Output | 0.00044929 | 0.0015983 | 0.0019868 | 1.7 | 0.01 +Modify | 12.261 | 12.262 | 12.263 | 0.0 | 94.89 +Other | | 0.006876 | | | 0.05 + +Nlocal: 16.75 ave 19 max 14 min +Histogram: 1 0 0 0 1 0 0 0 1 1 +Nghost: 507.25 ave 511 max 503 min +Histogram: 1 0 0 1 0 0 0 1 0 1 +Neighs: 667.5 ave 788 max 484 min +Histogram: 1 0 0 0 0 0 1 1 0 1 + +Total # of neighbors = 2670 +Ave neighs/atom = 39.850746 +Neighbor list builds = 10000 +Dangerous builds = 0 +Total wall time: 0:00:12 diff --git a/examples/mc/log.30Mar26.gcmc.restart.g++.1 b/examples/mc/log.30Mar26.gcmc.restart.g++.1 new file mode 100644 index 00000000000..593dccd6d5e --- /dev/null +++ b/examples/mc/log.30Mar26.gcmc.restart.g++.1 @@ -0,0 +1,702 @@ +LAMMPS (10 Dec 2025 - Development - patch_10Dec2025-125-g8985ed3c66-modified) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task +# Test correctness GCMC restart +# Restart should exactly reproduce original simulation + +### LJ ### + +variable mu equal -1.25 +variable temp equal 2.0 +variable disp equal 1.0 +variable lbox equal 5.0 +variable nequil equal 100 +variable nsteps equal 1000 +variable restartfile string restart.gcmc.lj + +# global model settings + +units lj +atom_style atomic +pair_style lj/cut 3.0 +pair_modify tail no # turn of to avoid triggering full_energy + +# box and other settings + +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} +region box block 0 5 0 ${lbox} 0 ${lbox} +region box block 0 5 0 5 0 ${lbox} +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (5 5 5) + 1 by 1 by 1 MPI processor grid +group gcmcgroup type 1 +0 atoms in group gcmcgroup +pair_coeff * * 1.0 1.0 +mass * 1.0 + +# gcmc + +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2 ${mu} ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2 -1.25 ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2 -1.25 1 + +# output + +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms + +# run equilibration and write restart + +run ${nequil} +run 100 +WARNING: No fixes with time integration, atoms won't move +For more information see https://docs.lammps.org/err0028 (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 3.3 + ghost atom cutoff = 3.3 + binsize = 1.65, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 0.4341 | 0.4341 | 0.4341 Mbytes + Step Temp Press PotEng KinEng Density Atoms + 0 0 0 0 -0 0 0 + 100 2.0073546 0.60923915 -3.1356723 2.9632377 0.504 63 +Loop time of 0.133457 on 1 procs for 100 steps with 63 atoms + +Performance: 323698.733 tau/day, 749.303 timesteps/s, 47.206 katom-step/s +99.6% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0026083 | 0.0026083 | 0.0026083 | 0.0 | 1.95 +Neigh | 0.0085552 | 0.0085552 | 0.0085552 | 0.0 | 6.41 +Comm | 0.00074373 | 0.00074373 | 0.00074373 | 0.0 | 0.56 +Output | 3.647e-05 | 3.647e-05 | 3.647e-05 | 0.0 | 0.03 +Modify | 0.12139 | 0.12139 | 0.12139 | 0.0 | 90.96 +Other | | 0.0001265 | | | 0.09 + +Nlocal: 63 ave 63 max 63 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 727 ave 727 max 727 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2342 ave 2342 max 2342 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2342 +Ave neighs/atom = 37.174603 +Neighbor list builds = 100 +Dangerous builds = 0 +write_restart ${restartfile} +write_restart restart.gcmc.lj +System init for write_restart ... +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule + +# run simulation, store reference values, and clear simulation + +run ${nsteps} +run 1000 +WARNING: No fixes with time integration, atoms won't move +For more information see https://docs.lammps.org/err0028 (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.149 | 3.149 | 3.149 Mbytes + Step Temp Press PotEng KinEng Density Atoms + 100 2.0073546 0.60923915 -3.1356723 2.9632377 0.504 63 + 1100 1.9185225 0.96901528 -3.2283467 2.8348317 0.536 67 +Loop time of 1.32269 on 1 procs for 1000 steps with 67 atoms + +Performance: 326606.334 tau/day, 756.033 timesteps/s, 50.654 katom-step/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.028116 | 0.028116 | 0.028116 | 0.0 | 2.13 +Neigh | 0.081631 | 0.081631 | 0.081631 | 0.0 | 6.17 +Comm | 0.0074931 | 0.0074931 | 0.0074931 | 0.0 | 0.57 +Output | 2.4779e-05 | 2.4779e-05 | 2.4779e-05 | 0.0 | 0.00 +Modify | 1.2042 | 1.2042 | 1.2042 | 0.0 | 91.04 +Other | | 0.001228 | | | 0.09 + +Nlocal: 67 ave 67 max 67 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 797 ave 797 max 797 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2687 ave 2687 max 2687 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2687 +Ave neighs/atom = 40.104478 +Neighbor list builds = 1000 +Dangerous builds = 0 +variable tmp equal temp +variable tref equal ${tmp} +variable tref equal 1.91852248323097 +variable tmp equal press +variable pref equal ${tmp} +variable pref equal 0.96901527697847 +variable tmp equal sum(f_mygcmc) +variable gcmcref equal ${tmp} +variable gcmcref equal 240158 +clear +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task + +# rerun simulation from restart + +read_restart ${restartfile} +read_restart restart.gcmc.lj +Reading restart file ... + restart file = 10 Dec 2025, LAMMPS = 10 Dec 2025 + restoring atom style atomic from restart + orthogonal box = (0 0 0) to (5 5 5) + 1 by 1 by 1 MPI processor grid + restoring pair style lj/cut from restart + 63 atoms + read_restart CPU = 0.001 seconds + +# gcmc + +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2 ${mu} ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2 -1.25 ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2 -1.25 1 +Resetting global fix info from restart file: + fix style: gcmc, fix ID: mygcmc + +# output + +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms + +# rerun simulation from restart, measure errors, and clear + +run ${nsteps} +run 1000 +WARNING: No fixes with time integration, atoms won't move +For more information see https://docs.lammps.org/err0028 (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +All restart file global fix info was re-assigned +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 3.3 + ghost atom cutoff = 3.3 + binsize = 1.65, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.083 | 3.083 | 3.083 Mbytes + Step Temp Press PotEng KinEng Density Atoms + 100 2.0073546 0.60923915 -3.1356723 2.9632377 0.504 63 + 1100 1.9185225 0.96901528 -3.2283467 2.8348317 0.536 67 +Loop time of 1.29199 on 1 procs for 1000 steps with 67 atoms + +Performance: 334367.571 tau/day, 773.999 timesteps/s, 51.858 katom-step/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.02722 | 0.02722 | 0.02722 | 0.0 | 2.11 +Neigh | 0.079518 | 0.079518 | 0.079518 | 0.0 | 6.15 +Comm | 0.0073563 | 0.0073563 | 0.0073563 | 0.0 | 0.57 +Output | 2.0895e-05 | 2.0895e-05 | 2.0895e-05 | 0.0 | 0.00 +Modify | 1.1767 | 1.1767 | 1.1767 | 0.0 | 91.07 +Other | | 0.001199 | | | 0.09 + +Nlocal: 67 ave 67 max 67 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 797 ave 797 max 797 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2687 ave 2687 max 2687 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2687 +Ave neighs/atom = 40.104478 +Neighbor list builds = 1000 +Dangerous builds = 0 +variable tmp equal temp +variable terror equal ${tmp} - v_tref +variable terror equal 1.91852248323097 - v_tref +variable tmp equal press +variable perror equal ${tmp} - v_pref +variable perror equal 0.96901527697847 - v_pref +variable tmp equal sum(f_mygcmc) +variable gcmcerror equal ${tmp} - v_gcmcref +variable gcmcerror equal 240158 - v_gcmcref +clear +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task + +# report restart errors + +print "LJ: change in temperature from restart = ${terror} " +LJ: change in temperature from restart = 0 +print "LJ: change in pressure from restart = ${perror} " +LJ: change in pressure from restart = 0 +print "LJ: change in fix GCMC from restart = ${gcmcerror} " +LJ: change in fix GCMC from restart = 0 + +#### H2O ### + +variable mu equal -8.1 +variable disp equal 0.5 +variable temp equal 338.0 +variable lbox equal 10.0 +variable spacing equal 5.0 +variable nequil equal 100 +variable nsteps equal 100 +variable nevery equal 10 +variable restartfile string restart.gcmc.h2o + +# global model settings + +units real +atom_style full +boundary p p p +pair_style lj/cut/coul/long 14 +pair_modify mix arithmetic tail yes +kspace_style ewald 0.0001 +bond_style harmonic +angle_style harmonic + +# box, start molecules on simple cubic lattice + +lattice sc ${spacing} +lattice sc 5 +Lattice spacing in x,y,z = 5 5 5 +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box +region box block 0 10 0 ${lbox} 0 ${lbox} units box +region box block 0 10 0 10 0 ${lbox} units box +region box block 0 10 0 10 0 10 units box +create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 +Created orthogonal box = (0 0 0) to (10 10 10) + 1 by 1 by 1 MPI processor grid + +molecule h2omol H2O.txt +Read molecule template h2omol: +# Water molecule. SPC/E model. + 1 molecules + 0 fragments + 0 bodies + 3 atoms with max type 2 + 2 bonds with max type 1 + 1 angles with max type 1 + 0 dihedrals with max type 0 + 0 impropers with max type 0 +create_atoms 0 box mol h2omol 464563 units box +Created 24 atoms + using box units in orthogonal box = (0 0 0) to (10 10 10) + create_atoms CPU = 0.001 seconds + +# rigid SPC/E water model + +pair_coeff 1 1 0.15535 3.166 +pair_coeff * 2 0.0000 0.0000 + +bond_coeff 1 1000 1.0 +angle_coeff 1 100 109.47 + +# masses + +mass 1 15.9994 +mass 2 1.0 + +# MD settings + +group h2o type 1 2 +24 atoms in group h2o +neighbor 2.0 bin +neigh_modify every 1 delay 1 check yes +velocity all create ${temp} 54654 +velocity all create 338 54654 +timestep 1.0 + +minimize 0.0 0.0 100 1000 +Switching to 'neigh_modify every 1 delay 0 check yes' setting during minimization +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17044845 + estimated absolute RMS force accuracy = 0.033206374 + estimated relative force accuracy = 0.00010000001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 16 + ghost atom cutoff = 16 + binsize = 8, bins = 2 2 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 11.88 | 11.88 | 11.88 Mbytes + Step Temp E_pair E_mol TotEng Press + 0 338 -1.1958379 9.2628112e-06 21.976989 795.36071 + 100 338 -17.048203 0.087408665 6.2120228 -128.40105 +Loop time of 0.0364618 on 1 procs for 100 steps with 24 atoms + +99.6% CPU use with 1 MPI tasks x 1 OpenMP threads + +Minimization stats: + Stopping criterion = max iterations + Energy initial, next-to-last, final = + -1.19582867716414 -16.9383361132258 -16.9607945702029 + Force two-norm initial, final = 20.819507 6.0831083 + Force max component initial, final = 7.29323 1.5282493 + Final line search alpha, max atom move = 0.042670736 0.065211522 + Iterations, force evaluations = 100 285 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.032077 | 0.032077 | 0.032077 | 0.0 | 87.98 +Bond | 0.00024779 | 0.00024779 | 0.00024779 | 0.0 | 0.68 +Kspace | 0.0015919 | 0.0015919 | 0.0015919 | 0.0 | 4.37 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.002074 | 0.002074 | 0.002074 | 0.0 | 5.69 +Output | 1.7182e-05 | 1.7182e-05 | 1.7182e-05 | 0.0 | 0.05 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.0004536 | | | 1.24 + +Nlocal: 24 ave 24 max 24 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 2163 ave 2163 max 2163 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 5041 ave 5041 max 5041 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 5041 +Ave neighs/atom = 210.04167 +Ave special neighs/atom = 2 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + +# rigid constraints with thermostat + +fix mynvt h2o nvt temp ${temp} ${temp} 100 +fix mynvt h2o nvt temp 338 ${temp} 100 +fix mynvt h2o nvt temp 338 338 100 +fix wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol +Finding SHAKE clusters ... + 0 = # of size 2 clusters + 0 = # of size 3 clusters + 0 = # of size 4 clusters + 8 = # of frozen angles + find clusters CPU = 0.000 seconds + +# important to make temperature dofs dynamic + +compute_modify thermo_temp dynamic/dof yes +compute_modify mynvt_temp dynamic/dof yes + +# output + +thermo_style custom step temp press pe ke density atoms + +# gcmc + +variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) +fix mygcmc h2o gcmc ${nevery} 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 -8.1 ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake + +# run equilibration and write restart + +run ${nequil} +run 100 +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17044845 + estimated absolute RMS force accuracy = 0.033206374 + estimated relative force accuracy = 0.00010000001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +WARNING: Fix gcmc using full_energy option (src/MC/fix_gcmc.cpp:545) +0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:659) +Per MPI rank memory allocation (min/avg/max) = 11.63 | 11.63 | 11.63 Mbytes + Step Temp Press PotEng KinEng Density Atoms + 0 518.26667 -6999.4459 -17.048203 23.172817 0.23910963 24 + 100 571.05246 -2472.5592 -174.45312 83.407747 0.74721761 75 +Loop time of 2.31613 on 1 procs for 100 steps with 75 atoms + +Performance: 3.730 ns/day, 6.434 hours/ns, 43.175 timesteps/s, 3.238 katom-step/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.043599 | 0.043599 | 0.043599 | 0.0 | 1.88 +Bond | 0.00010007 | 0.00010007 | 0.00010007 | 0.0 | 0.00 +Kspace | 0.0012073 | 0.0012073 | 0.0012073 | 0.0 | 0.05 +Neigh | 0.014271 | 0.014271 | 0.014271 | 0.0 | 0.62 +Comm | 0.0019227 | 0.0019227 | 0.0019227 | 0.0 | 0.08 +Output | 1.8697e-05 | 1.8697e-05 | 1.8697e-05 | 0.0 | 0.00 +Modify | 2.2547 | 2.2547 | 2.2547 | 0.0 | 97.35 +Other | | 0.0002658 | | | 0.01 + +Nlocal: 75 ave 75 max 75 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 5664 ave 5664 max 5664 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 48150 ave 48150 max 48150 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 48150 +Ave neighs/atom = 642 +Ave special neighs/atom = 2 +Neighbor list builds = 1020 +Dangerous builds = 0 +write_restart ${restartfile} +write_restart restart.gcmc.h2o +System init for write_restart ... +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.1787719 + estimated absolute RMS force accuracy = 0.033206435 + estimated relative force accuracy = 0.00010000019 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:659) + +# run simulation, store reference values, and clear simulation + +run ${nsteps} +run 100 +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.1787719 + estimated absolute RMS force accuracy = 0.033206435 + estimated relative force accuracy = 0.00010000019 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:659) +Per MPI rank memory allocation (min/avg/max) = 12.13 | 12.13 | 12.13 Mbytes + Step Temp Press PotEng KinEng Density Atoms + 100 571.05246 -2319.4412 -173.87261 83.407747 0.74721761 75 + 200 481.44535 -3939.0525 -191.47024 70.319759 0.74721761 75 +Loop time of 3.01724 on 1 procs for 100 steps with 75 atoms + +Performance: 2.864 ns/day, 8.381 hours/ns, 33.143 timesteps/s, 2.486 katom-step/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.055316 | 0.055316 | 0.055316 | 0.0 | 1.83 +Bond | 0.000117 | 0.000117 | 0.000117 | 0.0 | 0.00 +Kspace | 0.0013531 | 0.0013531 | 0.0013531 | 0.0 | 0.04 +Neigh | 0.017781 | 0.017781 | 0.017781 | 0.0 | 0.59 +Comm | 0.0020907 | 0.0020907 | 0.0020907 | 0.0 | 0.07 +Output | 1.7285e-05 | 1.7285e-05 | 1.7285e-05 | 0.0 | 0.00 +Modify | 2.9403 | 2.9403 | 2.9403 | 0.0 | 97.45 +Other | | 0.0002983 | | | 0.01 + +Nlocal: 75 ave 75 max 75 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 5602 ave 5602 max 5602 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 48190 ave 48190 max 48190 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 48190 +Ave neighs/atom = 642.53333 +Ave special neighs/atom = 2 +Neighbor list builds = 1020 +Dangerous builds = 0 +variable tmp equal temp +variable tref equal ${tmp} +variable tref equal 481.445345275028 +variable tmp equal press +variable pref equal ${tmp} +variable pref equal -3939.05250319059 +variable tmp equal sum(f_mygcmc) +variable gcmcref equal ${tmp} +variable gcmcref equal 2033 +clear +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task + +# rerun simulation from restart + +read_restart ${restartfile} +read_restart restart.gcmc.h2o +Reading restart file ... + restart file = 10 Dec 2025, LAMMPS = 10 Dec 2025 + restoring atom style full from restart + orthogonal box = (0 0 0) to (10 10 10) + 1 by 1 by 1 MPI processor grid + restoring pair style lj/cut/coul/long from restart + restoring bond style harmonic from restart + restoring angle style harmonic from restart + 75 atoms + 62 bonds + 31 angles +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 2 = max # of 1-2 neighbors + 1 = max # of 1-3 neighbors + 1 = max # of 1-4 neighbors + 3 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_restart CPU = 0.002 seconds +molecule h2omol H2O.txt +Read molecule template h2omol: +# Water molecule. SPC/E model. + 1 molecules + 0 fragments + 0 bodies + 3 atoms with max type 2 + 2 bonds with max type 1 + 1 angles with max type 1 + 0 dihedrals with max type 0 + 0 impropers with max type 0 +kspace_style ewald 0.0001 +fix mynvt h2o nvt temp ${temp} ${temp} 100 +fix mynvt h2o nvt temp 338 ${temp} 100 +fix mynvt h2o nvt temp 338 338 100 +Resetting global fix info from restart file: + fix style: nvt, fix ID: mynvt +fix wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol +Finding SHAKE clusters ... + 0 = # of size 2 clusters + 0 = # of size 3 clusters + 0 = # of size 4 clusters + 25 = # of frozen angles + find clusters CPU = 0.000 seconds + +# important to make temperature dofs dynamic + +compute_modify thermo_temp dynamic/dof yes +compute_modify mynvt_temp dynamic/dof yes + +# gcmc + +fix mygcmc h2o gcmc ${nevery} 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 -8.1 ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake +Resetting global fix info from restart file: + fix style: gcmc, fix ID: mygcmc + +# output + +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms + +# rerun simulation from restart, measure errors, and clear + +run ${nsteps} +run 100 +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.1787719 + estimated absolute RMS force accuracy = 0.033206435 + estimated relative force accuracy = 0.00010000019 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +All restart file global fix info was re-assigned +WARNING: Fix gcmc using full_energy option (src/MC/fix_gcmc.cpp:545) +0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:659) +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 16 + ghost atom cutoff = 16 + binsize = 8, bins = 2 2 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 11.83 | 11.83 | 11.83 Mbytes + Step Temp Press PotEng KinEng Density Atoms + 100 571.05246 -2319.4412 -173.87261 83.407747 0.74721761 75 + 200 481.44534 -3939.0523 -191.47024 70.319759 0.74721761 75 +Loop time of 3.03914 on 1 procs for 100 steps with 75 atoms + +Performance: 2.843 ns/day, 8.442 hours/ns, 32.904 timesteps/s, 2.468 katom-step/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.059323 | 0.059323 | 0.059323 | 0.0 | 1.95 +Bond | 1.95e-05 | 1.95e-05 | 1.95e-05 | 0.0 | 0.00 +Kspace | 0.0013932 | 0.0013932 | 0.0013932 | 0.0 | 0.05 +Neigh | 0.017642 | 0.017642 | 0.017642 | 0.0 | 0.58 +Comm | 0.0020875 | 0.0020875 | 0.0020875 | 0.0 | 0.07 +Output | 1.9441e-05 | 1.9441e-05 | 1.9441e-05 | 0.0 | 0.00 +Modify | 2.9584 | 2.9584 | 2.9584 | 0.0 | 97.34 +Other | | 0.0003085 | | | 0.01 + +Nlocal: 75 ave 75 max 75 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 5602 ave 5602 max 5602 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 48190 ave 48190 max 48190 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 48190 +Ave neighs/atom = 642.53333 +Ave special neighs/atom = 2 +Neighbor list builds = 1020 +Dangerous builds = 0 +variable tmp equal temp +variable terror equal ${tmp} - v_tref +variable terror equal 481.445342250678 - v_tref +variable tmp equal press +variable perror equal ${tmp} - v_pref +variable perror equal -3939.05227305224 - v_pref +variable tmp equal sum(f_mygcmc) +variable gcmcerror equal ${tmp} - v_gcmcref +variable gcmcerror equal 2033 - v_gcmcref +clear +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task + +# report restart errors + +print "H2O: change in temperature from restart = ${terror} " +H2O: change in temperature from restart = -3.02435000776313e-06 +print "H2O: change in pressure from restart = ${perror} " +H2O: change in pressure from restart = 0.000230138350161724 +print "H2O: change in fix GCMC from restart = ${gcmcerror} " +H2O: change in fix GCMC from restart = 0 + +Total wall time: 0:00:11 diff --git a/examples/mc/log.30Mar26.gcmc.restart.g++.4 b/examples/mc/log.30Mar26.gcmc.restart.g++.4 new file mode 100644 index 00000000000..a40e3aa42e7 --- /dev/null +++ b/examples/mc/log.30Mar26.gcmc.restart.g++.4 @@ -0,0 +1,702 @@ +LAMMPS (10 Dec 2025 - Development - patch_10Dec2025-125-g8985ed3c66-modified) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task +# Test correctness GCMC restart +# Restart should exactly reproduce original simulation + +### LJ ### + +variable mu equal -1.25 +variable temp equal 2.0 +variable disp equal 1.0 +variable lbox equal 5.0 +variable nequil equal 100 +variable nsteps equal 1000 +variable restartfile string restart.gcmc.lj + +# global model settings + +units lj +atom_style atomic +pair_style lj/cut 3.0 +pair_modify tail no # turn of to avoid triggering full_energy + +# box and other settings + +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} +region box block 0 5 0 ${lbox} 0 ${lbox} +region box block 0 5 0 5 0 ${lbox} +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (5 5 5) + 1 by 2 by 2 MPI processor grid +group gcmcgroup type 1 +0 atoms in group gcmcgroup +pair_coeff * * 1.0 1.0 +mass * 1.0 + +# gcmc + +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2 ${mu} ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2 -1.25 ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2 -1.25 1 + +# output + +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms + +# run equilibration and write restart + +run ${nequil} +run 100 +WARNING: No fixes with time integration, atoms won't move +For more information see https://docs.lammps.org/err0028 (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 3.3 + ghost atom cutoff = 3.3 + binsize = 1.65, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 0.4492 | 0.4492 | 0.4492 Mbytes + Step Temp Press PotEng KinEng Density Atoms + 0 0 0 0 -0 0 0 + 100 2.1078187 1.1020099 -2.9854213 3.1098965 0.488 61 +Loop time of 0.139078 on 4 procs for 100 steps with 61 atoms + +Performance: 310617.078 tau/day, 719.021 timesteps/s, 43.860 katom-step/s +99.3% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.00063735 | 0.00074719 | 0.00083708 | 0.0 | 0.54 +Neigh | 0.002497 | 0.0026307 | 0.0027167 | 0.2 | 1.89 +Comm | 0.0027386 | 0.0028894 | 0.0031358 | 0.3 | 2.08 +Output | 1.7403e-05 | 1.9861e-05 | 2.7053e-05 | 0.0 | 0.01 +Modify | 0.13267 | 0.13268 | 0.13269 | 0.0 | 95.40 +Other | | 0.0001094 | | | 0.08 + +Nlocal: 15.25 ave 19 max 13 min +Histogram: 2 0 0 0 0 1 0 0 0 1 +Nghost: 450.5 ave 470 max 431 min +Histogram: 1 0 0 0 1 1 0 0 0 1 +Neighs: 550.75 ave 684 max 459 min +Histogram: 2 0 0 0 0 0 1 0 0 1 + +Total # of neighbors = 2203 +Ave neighs/atom = 36.114754 +Neighbor list builds = 100 +Dangerous builds = 0 +write_restart ${restartfile} +write_restart restart.gcmc.lj +System init for write_restart ... +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule + +# run simulation, store reference values, and clear simulation + +run ${nsteps} +run 1000 +WARNING: No fixes with time integration, atoms won't move +For more information see https://docs.lammps.org/err0028 (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.141 | 3.145 | 3.149 Mbytes + Step Temp Press PotEng KinEng Density Atoms + 100 2.1078187 1.1020099 -2.9854213 3.1098965 0.488 61 + 1100 2.0377985 0.82361869 -3.5056264 3.0130306 0.56 70 +Loop time of 1.39997 on 4 procs for 1000 steps with 70 atoms + +Performance: 308577.539 tau/day, 714.300 timesteps/s, 50.001 katom-step/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0069866 | 0.0076821 | 0.0086723 | 0.7 | 0.55 +Neigh | 0.025 | 0.025659 | 0.026227 | 0.3 | 1.83 +Comm | 0.028134 | 0.029677 | 0.031101 | 0.6 | 2.12 +Output | 1.317e-05 | 1.5591e-05 | 2.242e-05 | 0.0 | 0.00 +Modify | 1.336 | 1.3361 | 1.3361 | 0.0 | 95.43 +Other | | 0.0008862 | | | 0.06 + +Nlocal: 17.5 ave 22 max 14 min +Histogram: 1 0 0 2 0 0 0 0 0 1 +Nghost: 522.5 ave 529 max 518 min +Histogram: 1 0 1 1 0 0 0 0 0 1 +Neighs: 727 ave 876 max 611 min +Histogram: 1 0 0 2 0 0 0 0 0 1 + +Total # of neighbors = 2908 +Ave neighs/atom = 41.542857 +Neighbor list builds = 1000 +Dangerous builds = 0 +variable tmp equal temp +variable tref equal ${tmp} +variable tref equal 2.03779849781659 +variable tmp equal press +variable pref equal ${tmp} +variable pref equal 0.823618694046359 +variable tmp equal sum(f_mygcmc) +variable gcmcref equal ${tmp} +variable gcmcref equal 240838 +clear +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task + +# rerun simulation from restart + +read_restart ${restartfile} +read_restart restart.gcmc.lj +Reading restart file ... + restart file = 10 Dec 2025, LAMMPS = 10 Dec 2025 + restoring atom style atomic from restart + orthogonal box = (0 0 0) to (5 5 5) + 1 by 2 by 2 MPI processor grid + restoring pair style lj/cut from restart + 61 atoms + read_restart CPU = 0.001 seconds + +# gcmc + +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2 ${mu} ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2 -1.25 ${disp} +fix mygcmc gcmcgroup gcmc 1 100 100 1 29494 2 -1.25 1 +Resetting global fix info from restart file: + fix style: gcmc, fix ID: mygcmc + +# output + +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms + +# rerun simulation from restart, measure errors, and clear + +run ${nsteps} +run 1000 +WARNING: No fixes with time integration, atoms won't move +For more information see https://docs.lammps.org/err0028 (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +All restart file global fix info was re-assigned +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 3.3 + ghost atom cutoff = 3.3 + binsize = 1.65, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.078 | 3.078 Mbytes + Step Temp Press PotEng KinEng Density Atoms + 100 2.1078187 1.1020099 -2.9854213 3.1098965 0.488 61 + 1100 2.0377985 0.82361869 -3.5056264 3.0130306 0.56 70 +Loop time of 1.3855 on 4 procs for 1000 steps with 70 atoms + +Performance: 311800.843 tau/day, 721.761 timesteps/s, 50.523 katom-step/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0076498 | 0.008266 | 0.0089383 | 0.5 | 0.60 +Neigh | 0.02496 | 0.02559 | 0.026163 | 0.3 | 1.85 +Comm | 0.028035 | 0.029311 | 0.030654 | 0.6 | 2.12 +Output | 1.4729e-05 | 1.7636e-05 | 2.5893e-05 | 0.0 | 0.00 +Modify | 1.3214 | 1.3215 | 1.3215 | 0.0 | 95.38 +Other | | 0.0008397 | | | 0.06 + +Nlocal: 17.5 ave 22 max 14 min +Histogram: 1 0 0 2 0 0 0 0 0 1 +Nghost: 522.5 ave 529 max 518 min +Histogram: 1 0 1 1 0 0 0 0 0 1 +Neighs: 727 ave 876 max 611 min +Histogram: 1 0 0 2 0 0 0 0 0 1 + +Total # of neighbors = 2908 +Ave neighs/atom = 41.542857 +Neighbor list builds = 1000 +Dangerous builds = 0 +variable tmp equal temp +variable terror equal ${tmp} - v_tref +variable terror equal 2.03779849781659 - v_tref +variable tmp equal press +variable perror equal ${tmp} - v_pref +variable perror equal 0.823618694046359 - v_pref +variable tmp equal sum(f_mygcmc) +variable gcmcerror equal ${tmp} - v_gcmcref +variable gcmcerror equal 240838 - v_gcmcref +clear +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task + +# report restart errors + +print "LJ: change in temperature from restart = ${terror} " +LJ: change in temperature from restart = 0 +print "LJ: change in pressure from restart = ${perror} " +LJ: change in pressure from restart = 0 +print "LJ: change in fix GCMC from restart = ${gcmcerror} " +LJ: change in fix GCMC from restart = 0 + +#### H2O ### + +variable mu equal -8.1 +variable disp equal 0.5 +variable temp equal 338.0 +variable lbox equal 10.0 +variable spacing equal 5.0 +variable nequil equal 100 +variable nsteps equal 100 +variable nevery equal 10 +variable restartfile string restart.gcmc.h2o + +# global model settings + +units real +atom_style full +boundary p p p +pair_style lj/cut/coul/long 14 +pair_modify mix arithmetic tail yes +kspace_style ewald 0.0001 +bond_style harmonic +angle_style harmonic + +# box, start molecules on simple cubic lattice + +lattice sc ${spacing} +lattice sc 5 +Lattice spacing in x,y,z = 5 5 5 +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box +region box block 0 10 0 ${lbox} 0 ${lbox} units box +region box block 0 10 0 10 0 ${lbox} units box +region box block 0 10 0 10 0 10 units box +create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 +Created orthogonal box = (0 0 0) to (10 10 10) + 1 by 2 by 2 MPI processor grid + +molecule h2omol H2O.txt +Read molecule template h2omol: +# Water molecule. SPC/E model. + 1 molecules + 0 fragments + 0 bodies + 3 atoms with max type 2 + 2 bonds with max type 1 + 1 angles with max type 1 + 0 dihedrals with max type 0 + 0 impropers with max type 0 +create_atoms 0 box mol h2omol 464563 units box +Created 24 atoms + using box units in orthogonal box = (0 0 0) to (10 10 10) + create_atoms CPU = 0.002 seconds + +# rigid SPC/E water model + +pair_coeff 1 1 0.15535 3.166 +pair_coeff * 2 0.0000 0.0000 + +bond_coeff 1 1000 1.0 +angle_coeff 1 100 109.47 + +# masses + +mass 1 15.9994 +mass 2 1.0 + +# MD settings + +group h2o type 1 2 +24 atoms in group h2o +neighbor 2.0 bin +neigh_modify every 1 delay 1 check yes +velocity all create ${temp} 54654 +velocity all create 338 54654 +timestep 1.0 + +minimize 0.0 0.0 100 1000 +Switching to 'neigh_modify every 1 delay 0 check yes' setting during minimization +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17044845 + estimated absolute RMS force accuracy = 0.033206374 + estimated relative force accuracy = 0.00010000001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 16 + ghost atom cutoff = 16 + binsize = 8, bins = 2 2 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 11.85 | 11.92 | 12.12 Mbytes + Step Temp E_pair E_mol TotEng Press + 0 338 -0.95546485 9.2628112e-06 22.217362 805.04028 + 100 338 -15.273306 0.20594388 8.1054551 -95.912612 +Loop time of 0.0330999 on 4 procs for 100 steps with 24 atoms + +99.1% CPU use with 4 MPI tasks x 1 OpenMP threads + +Minimization stats: + Stopping criterion = max iterations + Energy initial, next-to-last, final = + -0.955455591456625 -15.0222740429501 -15.0673621835651 + Force two-norm initial, final = 24.052787 14.932952 + Force max component initial, final = 8.3161245 5.4344027 + Final line search alpha, max atom move = 0.010391588 0.056472074 + Iterations, force evaluations = 100 291 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0047184 | 0.0094663 | 0.015478 | 4.0 | 28.60 +Bond | 0.00011125 | 0.00014832 | 0.00022241 | 0.0 | 0.45 +Kspace | 0.0017978 | 0.0076389 | 0.012171 | 4.3 | 23.08 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.01406 | 0.014288 | 0.014542 | 0.2 | 43.17 +Output | 1.1627e-05 | 1.3888e-05 | 2.0571e-05 | 0.0 | 0.04 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.001544 | | | 4.67 + +Nlocal: 6 ave 8 max 4 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Nghost: 1722 ave 1724 max 1720 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Neighs: 1256 ave 2048 max 640 min +Histogram: 1 0 0 1 1 0 0 0 0 1 + +Total # of neighbors = 5024 +Ave neighs/atom = 209.33333 +Ave special neighs/atom = 2 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 + +# rigid constraints with thermostat + +fix mynvt h2o nvt temp ${temp} ${temp} 100 +fix mynvt h2o nvt temp 338 ${temp} 100 +fix mynvt h2o nvt temp 338 338 100 +fix wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol +Finding SHAKE clusters ... + 0 = # of size 2 clusters + 0 = # of size 3 clusters + 0 = # of size 4 clusters + 8 = # of frozen angles + find clusters CPU = 0.000 seconds + +# important to make temperature dofs dynamic + +compute_modify thermo_temp dynamic/dof yes +compute_modify mynvt_temp dynamic/dof yes + +# output + +thermo_style custom step temp press pe ke density atoms + +# gcmc + +variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) +fix mygcmc h2o gcmc ${nevery} 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 -8.1 ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake + +# run equilibration and write restart + +run ${nequil} +run 100 +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17044845 + estimated absolute RMS force accuracy = 0.033206374 + estimated relative force accuracy = 0.00010000001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +WARNING: Fix gcmc using full_energy option (src/MC/fix_gcmc.cpp:545) +0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:659) +Per MPI rank memory allocation (min/avg/max) = 11.6 | 11.6 | 11.6 Mbytes + Step Temp Press PotEng KinEng Density Atoms + 0 518.26667 20.304529 -15.273306 23.172817 0.23910963 24 + 100 477.28863 -969.19761 -181.03568 66.867217 0.7173289 72 +Loop time of 0.839098 on 4 procs for 100 steps with 72 atoms + +Performance: 10.297 ns/day, 2.331 hours/ns, 119.176 timesteps/s, 8.581 katom-step/s +99.7% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0070271 | 0.010148 | 0.015674 | 3.5 | 1.21 +Bond | 4.0937e-05 | 4.8649e-05 | 6.3285e-05 | 0.0 | 0.01 +Kspace | 0.00072686 | 0.0062102 | 0.0093288 | 4.4 | 0.74 +Neigh | 0.0039266 | 0.0039462 | 0.0039631 | 0.0 | 0.47 +Comm | 0.0069446 | 0.0069817 | 0.0069959 | 0.0 | 0.83 +Output | 1.5107e-05 | 1.7919e-05 | 2.601e-05 | 0.0 | 0.00 +Modify | 0.8114 | 0.81144 | 0.81146 | 0.0 | 96.70 +Other | | 0.0003104 | | | 0.04 + +Nlocal: 18 ave 21 max 14 min +Histogram: 1 0 0 0 1 0 0 0 1 1 +Nghost: 4162.75 ave 4179 max 4143 min +Histogram: 1 0 0 0 1 0 0 1 0 1 +Neighs: 11105.2 ave 16263 max 9039 min +Histogram: 3 0 0 0 0 0 0 0 0 1 + +Total # of neighbors = 44421 +Ave neighs/atom = 616.95833 +Ave special neighs/atom = 2 +Neighbor list builds = 1020 +Dangerous builds = 0 +write_restart ${restartfile} +write_restart restart.gcmc.h2o +System init for write_restart ... +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17848041 + estimated absolute RMS force accuracy = 0.033206428 + estimated relative force accuracy = 0.00010000017 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:659) + +# run simulation, store reference values, and clear simulation + +run ${nsteps} +run 100 +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17848041 + estimated absolute RMS force accuracy = 0.033206428 + estimated relative force accuracy = 0.00010000017 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:659) +Per MPI rank memory allocation (min/avg/max) = 12.02 | 12.03 | 12.04 Mbytes + Step Temp Press PotEng KinEng Density Atoms + 100 477.28863 -803.33794 -180.4094 66.867217 0.7173289 72 + 200 372.04171 -1361.109 -206.19712 56.558269 0.77710631 78 +Loop time of 1.36562 on 4 procs for 100 steps with 78 atoms + +Performance: 6.327 ns/day, 3.793 hours/ns, 73.227 timesteps/s, 5.712 katom-step/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.012082 | 0.016647 | 0.026323 | 4.4 | 1.22 +Bond | 5.5164e-05 | 6.392e-05 | 7.7342e-05 | 0.0 | 0.00 +Kspace | 0.00091105 | 0.010519 | 0.015073 | 5.5 | 0.77 +Neigh | 0.0060308 | 0.0060427 | 0.0060546 | 0.0 | 0.44 +Comm | 0.0082789 | 0.0083293 | 0.0084129 | 0.1 | 0.61 +Output | 1.278e-05 | 1.4785e-05 | 2.0625e-05 | 0.0 | 0.00 +Modify | 1.3236 | 1.3236 | 1.3237 | 0.0 | 96.93 +Other | | 0.0003676 | | | 0.03 + +Nlocal: 19.5 ave 26 max 14 min +Histogram: 1 0 1 0 0 1 0 0 0 1 +Nghost: 4550.5 ave 4579 max 4507 min +Histogram: 1 0 0 0 0 0 1 0 1 1 +Neighs: 13053.8 ave 21816 max 10038 min +Histogram: 3 0 0 0 0 0 0 0 0 1 + +Total # of neighbors = 52215 +Ave neighs/atom = 669.42308 +Ave special neighs/atom = 2 +Neighbor list builds = 1020 +Dangerous builds = 0 +variable tmp equal temp +variable tref equal ${tmp} +variable tref equal 372.041710334682 +variable tmp equal press +variable pref equal ${tmp} +variable pref equal -1361.10897131464 +variable tmp equal sum(f_mygcmc) +variable gcmcref equal ${tmp} +variable gcmcref equal 2062 +clear +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task + +# rerun simulation from restart + +read_restart ${restartfile} +read_restart restart.gcmc.h2o +Reading restart file ... + restart file = 10 Dec 2025, LAMMPS = 10 Dec 2025 + restoring atom style full from restart + orthogonal box = (0 0 0) to (10 10 10) + 1 by 2 by 2 MPI processor grid + restoring pair style lj/cut/coul/long from restart + restoring bond style harmonic from restart + restoring angle style harmonic from restart + 72 atoms + 86 bonds + 43 angles +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 2 = max # of 1-2 neighbors + 1 = max # of 1-3 neighbors + 1 = max # of 1-4 neighbors + 3 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_restart CPU = 0.003 seconds +molecule h2omol H2O.txt +Read molecule template h2omol: +# Water molecule. SPC/E model. + 1 molecules + 0 fragments + 0 bodies + 3 atoms with max type 2 + 2 bonds with max type 1 + 1 angles with max type 1 + 0 dihedrals with max type 0 + 0 impropers with max type 0 +kspace_style ewald 0.0001 +fix mynvt h2o nvt temp ${temp} ${temp} 100 +fix mynvt h2o nvt temp 338 ${temp} 100 +fix mynvt h2o nvt temp 338 338 100 +Resetting global fix info from restart file: + fix style: nvt, fix ID: mynvt +fix wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol +Finding SHAKE clusters ... + 0 = # of size 2 clusters + 0 = # of size 3 clusters + 0 = # of size 4 clusters + 24 = # of frozen angles + find clusters CPU = 0.000 seconds + +# important to make temperature dofs dynamic + +compute_modify thermo_temp dynamic/dof yes +compute_modify mynvt_temp dynamic/dof yes + +# gcmc + +fix mygcmc h2o gcmc ${nevery} 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 -8.1 ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc h2o gcmc 10 100 0 0 54341 338 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake +Resetting global fix info from restart file: + fix style: gcmc, fix ID: mygcmc + +# output + +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms + +# rerun simulation from restart, measure errors, and clear + +run ${nsteps} +run 100 +Ewald initialization ... + using 12-bit tables for long-range coulomb + G vector (1/distance) = 0.17848041 + estimated absolute RMS force accuracy = 0.033206428 + estimated relative force accuracy = 0.00010000017 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Generated 0 of 1 mixed pair_coeff terms from arithmetic mixing rule +All restart file global fix info was re-assigned +WARNING: Fix gcmc using full_energy option (src/MC/fix_gcmc.cpp:545) +0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (src/neighbor.cpp:659) +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 16 + ghost atom cutoff = 16 + binsize = 8, bins = 2 2 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 11.7 | 11.7 | 11.7 Mbytes + Step Temp Press PotEng KinEng Density Atoms + 100 477.28863 -803.33797 -180.4094 66.867217 0.7173289 72 + 200 372.04171 -1361.1086 -206.19711 56.558269 0.77710631 78 +Loop time of 1.3193 on 4 procs for 100 steps with 78 atoms + +Performance: 6.549 ns/day, 3.665 hours/ns, 75.798 timesteps/s, 5.912 katom-step/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.012206 | 0.015874 | 0.024191 | 3.8 | 1.20 +Bond | 1.5642e-05 | 1.6845e-05 | 1.8294e-05 | 0.0 | 0.00 +Kspace | 0.00085567 | 0.0091213 | 0.012769 | 5.0 | 0.69 +Neigh | 0.0064763 | 0.0065015 | 0.0065163 | 0.0 | 0.49 +Comm | 0.0081516 | 0.0081865 | 0.008247 | 0.0 | 0.62 +Output | 1.3163e-05 | 1.582e-05 | 2.3263e-05 | 0.0 | 0.00 +Modify | 1.2792 | 1.2792 | 1.2792 | 0.0 | 96.96 +Other | | 0.0003742 | | | 0.03 + +Nlocal: 19.5 ave 26 max 14 min +Histogram: 1 0 1 0 0 1 0 0 0 1 +Nghost: 4550.5 ave 4579 max 4507 min +Histogram: 1 0 0 0 0 0 1 0 1 1 +Neighs: 13053.8 ave 21816 max 10038 min +Histogram: 3 0 0 0 0 0 0 0 0 1 + +Total # of neighbors = 52215 +Ave neighs/atom = 669.42308 +Ave special neighs/atom = 2 +Neighbor list builds = 1020 +Dangerous builds = 0 +variable tmp equal temp +variable terror equal ${tmp} - v_tref +variable terror equal 372.041708654967 - v_tref +variable tmp equal press +variable perror equal ${tmp} - v_pref +variable perror equal -1361.10863412158 - v_pref +variable tmp equal sum(f_mygcmc) +variable gcmcerror equal ${tmp} - v_gcmcref +variable gcmcerror equal 2062 - v_gcmcref +clear +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. + using 1 OpenMP thread(s) per MPI task + +# report restart errors + +print "H2O: change in temperature from restart = ${terror} " +H2O: change in temperature from restart = -1.67971501241482e-06 +print "H2O: change in pressure from restart = ${perror} " +H2O: change in pressure from restart = 0.000337193059976926 +print "H2O: change in fix GCMC from restart = ${gcmcerror} " +H2O: change in fix GCMC from restart = 0 + +Total wall time: 0:00:06 diff --git a/src/CLASS2/angle_class2xe.cpp b/src/CLASS2/angle_class2xe.cpp new file mode 100644 index 00000000000..2c30178d03b --- /dev/null +++ b/src/CLASS2/angle_class2xe.cpp @@ -0,0 +1,516 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Josh Kemppainen (Michigan Technological University) + jdkemppa@mtu.edu +------------------------------------------------------------------------- */ + +#include "angle_class2xe.h" + +#include +#include +#include "atom.h" +#include "neighbor.h" +#include "domain.h" +#include "comm.h" +#include "force.h" +#include "citeme.h" +#include "math_const.h" +#include "memory.h" +#include "error.h" + + +using namespace LAMMPS_NS; +using namespace MathConst; + +static constexpr double SMALL = 0.001; + +static const char cite_style_classII_xe[] = + "ClassII-xe Style: https://doi.org/10.1038/s41524-025-01838-5\n\n" + "@Article{Kemppainen 2025,\n" + " author = {J. Kemppainen and H. Heinz and G. M. Odegard},\n" + " title = {Integrating complete bond dissociation in Class II force fields},\n" + " journal = {npj Computational Materials},\n" + " year = 2025,\n" + " volume = 11,\n" + " pages = {341}\n" + "}\n\n"; + +/* ---------------------------------------------------------------------- */ + +AngleClass2xe::AngleClass2xe(LAMMPS *lmp) : Angle(lmp) +{ + if (lmp->citeme) lmp->citeme->add(cite_style_classII_xe); +} + +/* ---------------------------------------------------------------------- */ + +AngleClass2xe::~AngleClass2xe() +{ + if (copymode) return; + + if (allocated) { + memory->destroy(setflag); + memory->destroy(setflag_a); + memory->destroy(setflag_bb); + memory->destroy(setflag_ba); + + memory->destroy(theta0); + memory->destroy(k2); + memory->destroy(k3); + memory->destroy(k4); + + memory->destroy(bb_d0); + memory->destroy(bb_alpha); + memory->destroy(bb_r1); + memory->destroy(bb_r2); + + memory->destroy(ba_d1); + memory->destroy(ba_d2); + memory->destroy(ba_alpha1); + memory->destroy(ba_alpha2); + memory->destroy(ba_r1); + memory->destroy(ba_r2); + } +} + +/* ---------------------------------------------------------------------- */ + +void AngleClass2xe::compute(int eflag, int vflag) +{ + int i1,i2,i3,n,type; + double delx1,dely1,delz1,delx2,dely2,delz2; + double eangle,f1[3],f3[3]; + double dtheta,dtheta2,dtheta3,dtheta4,de_angle; + double dr1,dr2,tk1,tk2,aa1,aa2,aa11,aa12,aa21,aa22; + double rsq1,rsq2,r1,r2,c,s,a,a11,a12,a22,b1,b2; + double vx11,vx12,vy11,vy12,vz11,vz12,vx21,vx22,vy21,vy22,vz21,vz22; + double bb_ralpha1,bb_ralpha2; + double ba_ralpha1,ba_ralpha2; + + eangle = 0.0; + ev_init(eflag,vflag); + + double **x = atom->x; + double **f = atom->f; + int **anglelist = neighbor->anglelist; + int nanglelist = neighbor->nanglelist; + int nlocal = atom->nlocal; + int newton_bond = force->newton_bond; + + for (n = 0; n < nanglelist; n++) { + i1 = anglelist[n][0]; + i2 = anglelist[n][1]; + i3 = anglelist[n][2]; + type = anglelist[n][3]; + + // 1st bond + + delx1 = x[i1][0] - x[i2][0]; + dely1 = x[i1][1] - x[i2][1]; + delz1 = x[i1][2] - x[i2][2]; + + rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1; + r1 = sqrt(rsq1); + + // 2nd bond + + delx2 = x[i3][0] - x[i2][0]; + dely2 = x[i3][1] - x[i2][1]; + delz2 = x[i3][2] - x[i2][2]; + + rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; + r2 = sqrt(rsq2); + + // angle (cos and sin) + + c = delx1*delx2 + dely1*dely2 + delz1*delz2; + c /= r1*r2; + + if (c > 1.0) c = 1.0; + if (c < -1.0) c = -1.0; + + s = sqrt(1.0 - c*c); + if (s < SMALL) s = SMALL; + s = 1.0/s; + + // force & energy for angle term + + dtheta = acos(c) - theta0[type]; + dtheta2 = dtheta*dtheta; + dtheta3 = dtheta2*dtheta; + dtheta4 = dtheta3*dtheta; + + de_angle = 2.0*k2[type]*dtheta + 3.0*k3[type]*dtheta2 + + 4.0*k4[type]*dtheta3; + + a = -de_angle*s; + a11 = a*c / rsq1; + a12 = -a / (r1*r2); + a22 = a*c / rsq2; + + f1[0] = a11*delx1 + a12*delx2; + f1[1] = a11*dely1 + a12*dely2; + f1[2] = a11*delz1 + a12*delz2; + + f3[0] = a22*delx2 + a12*delx1; + f3[1] = a22*dely2 + a12*dely1; + f3[2] = a22*delz2 + a12*delz1; + + if (eflag) eangle = k2[type]*dtheta2 + k3[type]*dtheta3 + k4[type]*dtheta4; + + // force & energy for bond-bond term + + dr1 = r1 - bb_r1[type]; + dr2 = r2 - bb_r2[type]; + bb_ralpha1 = exp(-bb_alpha[type]*dr1); + bb_ralpha2 = exp(-bb_alpha[type]*dr2); + tk1 = bb_d0[type]*bb_alpha[type]*bb_ralpha1*(1 - bb_ralpha2); + tk2 = bb_d0[type]*bb_alpha[type]*bb_ralpha2*(1 - bb_ralpha1); + + f1[0] -= delx1*tk2/r1; + f1[1] -= dely1*tk2/r1; + f1[2] -= delz1*tk2/r1; + + f3[0] -= delx2*tk1/r2; + f3[1] -= dely2*tk1/r2; + f3[2] -= delz2*tk1/r2; + + if (eflag) eangle += bb_d0[type]*(1 - bb_ralpha1)*(1 - bb_ralpha2); + + // force & energy for bond-angle term + + dr1 = r1 - ba_r1[type]; + dr2 = r2 - ba_r2[type]; + ba_ralpha1 = exp(-ba_alpha1[type]*dr1); + ba_ralpha2 = exp(-ba_alpha2[type]*dr2); + aa1 = ba_d1[type]*(1 - ba_ralpha1)*s; + aa2 = ba_d2[type]*(1 - ba_ralpha2)*s; + + aa11 = aa1 * c / rsq1; + aa12 = -aa1 / (r1 * r2); + aa21 = aa2 * c / rsq1; + aa22 = -aa2 / (r1 * r2); + + vx11 = (aa11 * delx1) + (aa12 * delx2); + vx12 = (aa21 * delx1) + (aa22 * delx2); + vy11 = (aa11 * dely1) + (aa12 * dely2); + vy12 = (aa21 * dely1) + (aa22 * dely2); + vz11 = (aa11 * delz1) + (aa12 * delz2); + vz12 = (aa21 * delz1) + (aa22 * delz2); + + aa11 = aa1 * c / rsq2; + aa21 = aa2 * c / rsq2; + + vx21 = (aa11 * delx2) + (aa12 * delx1); + vx22 = (aa21 * delx2) + (aa22 * delx1); + vy21 = (aa11 * dely2) + (aa12 * dely1); + vy22 = (aa21 * dely2) + (aa22 * dely1); + vz21 = (aa11 * delz2) + (aa12 * delz1); + vz22 = (aa21 * delz2) + (aa22 * delz1); + + b1 = ba_d1[type]*ba_alpha1[type]*ba_ralpha1*dtheta/r1; + b2 = ba_d2[type]*ba_alpha2[type]*ba_ralpha2*dtheta/r2; + + f1[0] -= vx11 + b1*delx1 + vx12; + f1[1] -= vy11 + b1*dely1 + vy12; + f1[2] -= vz11 + b1*delz1 + vz12; + + f3[0] -= vx21 + b2*delx2 + vx22; + f3[1] -= vy21 + b2*dely2 + vy22; + f3[2] -= vz21 + b2*delz2 + vz22; + + if (eflag) eangle += ba_d1[type]*(1 - ba_ralpha1)*dtheta + ba_d2[type]*(1 - ba_ralpha2)*dtheta; + + // apply force to each of 3 atoms + + if (newton_bond || i1 < nlocal) { + f[i1][0] += f1[0]; + f[i1][1] += f1[1]; + f[i1][2] += f1[2]; + } + + if (newton_bond || i2 < nlocal) { + f[i2][0] -= f1[0] + f3[0]; + f[i2][1] -= f1[1] + f3[1]; + f[i2][2] -= f1[2] + f3[2]; + } + + if (newton_bond || i3 < nlocal) { + f[i3][0] += f3[0]; + f[i3][1] += f3[1]; + f[i3][2] += f3[2]; + } + + if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3, + delx1,dely1,delz1,delx2,dely2,delz2); + } +} + +/* ---------------------------------------------------------------------- */ + +void AngleClass2xe::allocate() +{ + allocated = 1; + int n = atom->nangletypes; + + memory->create(theta0,n+1,"angle:theta0"); + memory->create(k2,n+1,"angle:k2"); + memory->create(k3,n+1,"angle:k3"); + memory->create(k4,n+1,"angle:k4"); + + memory->create(bb_d0,n+1,"angle:bb_d0"); + memory->create(bb_alpha,n+1,"angle:bb_alpha"); + memory->create(bb_r1,n+1,"angle:bb_r1"); + memory->create(bb_r2,n+1,"angle:bb_r2"); + + memory->create(ba_d1,n+1,"angle:ba_d1"); + memory->create(ba_d2,n+1,"angle:ba_d2"); + memory->create(ba_alpha1,n+1,"angle:ba_alpha1"); + memory->create(ba_alpha2,n+1,"angle:ba_alpha2"); + memory->create(ba_r1,n+1,"angle:ba_r1"); + memory->create(ba_r2,n+1,"angle:ba_r2"); + + memory->create(setflag,n+1,"angle:setflag"); + memory->create(setflag_a,n+1,"angle:setflag_a"); + memory->create(setflag_bb,n+1,"angle:setflag_bb"); + memory->create(setflag_ba,n+1,"angle:setflag_ba"); + for (int i = 1; i <= n; i++) + setflag[i] = setflag_a[i] = setflag_bb[i] = setflag_ba[i] = 0; +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more types + arg1 = "bb" -> BondBond coeffs + arg1 = "ba" -> BondAngle coeffs + else -> Angle coeffs +------------------------------------------------------------------------- */ + +void AngleClass2xe::coeff(int narg, char **arg) +{ + if (narg < 2) error->all(FLERR,"Incorrect args for angle coefficients"); + if (!allocated) allocate(); + + int ilo,ihi; + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); + + int count = 0; + + if (strcmp(arg[1],"bb") == 0) { + if (narg != 6) error->all(FLERR,"Incorrect args for angle coefficients"); + + double bb_d0_one = utils::numeric(FLERR,arg[2],false,lmp); + double bb_alpha_one = utils::numeric(FLERR,arg[3],false,lmp); + double bb_r1_one = utils::numeric(FLERR,arg[4],false,lmp); + double bb_r2_one = utils::numeric(FLERR,arg[5],false,lmp); + + for (int i = ilo; i <= ihi; i++) { + bb_d0[i] = bb_d0_one; + bb_alpha[i] = bb_alpha_one; + bb_r1[i] = bb_r1_one; + bb_r2[i] = bb_r2_one; + setflag_bb[i] = 1; + count++; + } + + } else if (strcmp(arg[1],"ba") == 0) { + if (narg != 8) error->all(FLERR,"Incorrect args for angle coefficients"); + + double ba_d1_one = utils::numeric(FLERR,arg[2],false,lmp); + double ba_d2_one = utils::numeric(FLERR,arg[3],false,lmp); + double ba_alpha1_one = utils::numeric(FLERR,arg[4],false,lmp); + double ba_alpha2_one = utils::numeric(FLERR,arg[5],false,lmp); + double ba_r1_one = utils::numeric(FLERR,arg[6],false,lmp); + double ba_r2_one = utils::numeric(FLERR,arg[7],false,lmp); + + for (int i = ilo; i <= ihi; i++) { + ba_d1[i] = ba_d1_one; + ba_d2[i] = ba_d2_one; + ba_alpha1[i] = ba_alpha1_one; + ba_alpha2[i] = ba_alpha2_one; + ba_r1[i] = ba_r1_one; + ba_r2[i] = ba_r2_one; + setflag_ba[i] = 1; + count++; + } + + } else { + if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients"); + + double theta0_one = utils::numeric(FLERR,arg[1],false,lmp); + double k2_one = utils::numeric(FLERR,arg[2],false,lmp); + double k3_one = utils::numeric(FLERR,arg[3],false,lmp); + double k4_one = utils::numeric(FLERR,arg[4],false,lmp); + + // convert theta0 from degrees to radians + + for (int i = ilo; i <= ihi; i++) { + theta0[i] = theta0_one/180.0 * MY_PI; + k2[i] = k2_one; + k3[i] = k3_one; + k4[i] = k4_one; + setflag_a[i] = 1; + count++; + } + } + + if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients"); + + for (int i = ilo; i <= ihi; i++) + if (setflag_a[i] == 1 && setflag_bb[i] == 1 && setflag_ba[i] == 1) + setflag[i] = 1; +} + +/* ---------------------------------------------------------------------- */ + +double AngleClass2xe::equilibrium_angle(int i) +{ + return theta0[i]; +} + +/* ---------------------------------------------------------------------- + proc 0 writes out coeffs to restart file +------------------------------------------------------------------------- */ + +void AngleClass2xe::write_restart(FILE *fp) +{ + fwrite(&theta0[1],sizeof(double),atom->nangletypes,fp); + fwrite(&k2[1],sizeof(double),atom->nangletypes,fp); + fwrite(&k3[1],sizeof(double),atom->nangletypes,fp); + fwrite(&k4[1],sizeof(double),atom->nangletypes,fp); + + fwrite(&bb_d0[1],sizeof(double),atom->nangletypes,fp); + fwrite(&bb_alpha[1],sizeof(double),atom->nangletypes,fp); + fwrite(&bb_r1[1],sizeof(double),atom->nangletypes,fp); + fwrite(&bb_r2[1],sizeof(double),atom->nangletypes,fp); + + fwrite(&ba_d1[1],sizeof(double),atom->nangletypes,fp); + fwrite(&ba_d2[1],sizeof(double),atom->nangletypes,fp); + fwrite(&ba_alpha1[1],sizeof(double),atom->nangletypes,fp); + fwrite(&ba_alpha2[1],sizeof(double),atom->nangletypes,fp); + fwrite(&ba_r1[1],sizeof(double),atom->nangletypes,fp); + fwrite(&ba_r2[1],sizeof(double),atom->nangletypes,fp); +} + +/* ---------------------------------------------------------------------- + proc 0 reads coeffs from restart file, bcasts them +------------------------------------------------------------------------- */ + +void AngleClass2xe::read_restart(FILE *fp) +{ + allocate(); + + if (comm->me == 0) { + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + + utils::sfread(FLERR,&bb_d0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_alpha[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + + utils::sfread(FLERR,&ba_d1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_d2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_alpha1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_alpha2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + } + + MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); + MPI_Bcast(&k2[1],atom->nangletypes,MPI_DOUBLE,0,world); + MPI_Bcast(&k3[1],atom->nangletypes,MPI_DOUBLE,0,world); + MPI_Bcast(&k4[1],atom->nangletypes,MPI_DOUBLE,0,world); + + MPI_Bcast(&bb_d0[1],atom->nangletypes,MPI_DOUBLE,0,world); + MPI_Bcast(&bb_alpha[1],atom->nangletypes,MPI_DOUBLE,0,world); + MPI_Bcast(&bb_r1[1],atom->nangletypes,MPI_DOUBLE,0,world); + MPI_Bcast(&bb_r2[1],atom->nangletypes,MPI_DOUBLE,0,world); + + MPI_Bcast(&ba_d1[1],atom->nangletypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ba_d2[1],atom->nangletypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ba_alpha1[1],atom->nangletypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ba_alpha2[1],atom->nangletypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ba_r1[1],atom->nangletypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ba_r2[1],atom->nangletypes,MPI_DOUBLE,0,world); + + for (int i = 1; i <= atom->nangletypes; i++) setflag[i] = 1; +} + +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void AngleClass2xe::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nangletypes; i++) + fprintf(fp,"%d %g %g %g %g\n", + i,theta0[i]/MY_PI*180.0,k2[i],k3[i],k4[i]); + + fprintf(fp,"\nBondBond Coeffs\n\n"); + for (int i = 1; i <= atom->nangletypes; i++) + fprintf(fp,"%d %g %g %g %g\n",i,bb_d0[i],bb_alpha[i],bb_r1[i],bb_r2[i]); + + fprintf(fp,"\nBondAngle Coeffs\n\n"); + for (int i = 1; i <= atom->nangletypes; i++) + fprintf(fp,"%d %g %g %g %g %g %g\n",i,ba_d1[i],ba_d2[i],ba_alpha1[i],ba_alpha2[i],ba_r1[i],ba_r2[i]); +} + +/* ---------------------------------------------------------------------- */ + +double AngleClass2xe::single(int type, int i1, int i2, int i3) +{ + double **x = atom->x; + + double delx1 = x[i1][0] - x[i2][0]; + double dely1 = x[i1][1] - x[i2][1]; + double delz1 = x[i1][2] - x[i2][2]; + domain->minimum_image(FLERR, delx1,dely1,delz1); + double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1); + + double delx2 = x[i3][0] - x[i2][0]; + double dely2 = x[i3][1] - x[i2][1]; + double delz2 = x[i3][2] - x[i2][2]; + domain->minimum_image(FLERR, delx2,dely2,delz2); + double r2 = sqrt(delx2*delx2 + dely2*dely2 + delz2*delz2); + + double c = delx1*delx2 + dely1*dely2 + delz1*delz2; + c /= r1*r2; + if (c > 1.0) c = 1.0; + if (c < -1.0) c = -1.0; + + double dtheta = acos(c) - theta0[type]; + double dtheta2 = dtheta*dtheta; + double dtheta3 = dtheta2*dtheta; + double dtheta4 = dtheta3*dtheta; + + double energy = k2[type]*dtheta2 + k3[type]*dtheta3 + k4[type]*dtheta4; + + double dr1 = r1 - bb_r1[type]; + double dr2 = r2 - bb_r2[type]; + double bb_ralpha1 = exp(-bb_alpha[type] * dr1); + double bb_ralpha2 = exp(-bb_alpha[type] * dr2); + energy += bb_d0[type]*(1 - bb_ralpha1)*(1 - bb_ralpha2); + + dr1 = r1 - ba_r1[type]; + dr2 = r2 - ba_r2[type]; + double ba_ralpha1 = exp(-ba_alpha1[type]*dr1); + double ba_ralpha2 = exp(-ba_alpha2[type]*dr2); + energy += ba_d1[type]*(1 - ba_ralpha1)*dtheta + ba_d2[type]*(1 - ba_ralpha2)*dtheta; + + return energy; +} diff --git a/src/CLASS2/angle_class2xe.h b/src/CLASS2/angle_class2xe.h new file mode 100644 index 00000000000..71d4caf902f --- /dev/null +++ b/src/CLASS2/angle_class2xe.h @@ -0,0 +1,51 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef ANGLE_CLASS +// clang-format off +AngleStyle(class2xe,AngleClass2xe); +// clang-format on +#else + +#ifndef LMP_ANGLE_CLASS2XE_H +#define LMP_ANGLE_CLASS2XE_H + +#include "angle.h" + +namespace LAMMPS_NS { + +class AngleClass2xe : public Angle { + public: + AngleClass2xe(class LAMMPS *); + ~AngleClass2xe() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; + + protected: + double *theta0, *k2, *k3, *k4; + double *bb_d0, *bb_alpha, *bb_r1, *bb_r2; + double *ba_d1, *ba_d2, *ba_alpha1, *ba_alpha2, *ba_r1, *ba_r2; + int *setflag_a, *setflag_bb, *setflag_ba; + + void allocate(); +}; + +} // namespace LAMMPS_NS + +#endif +#endif diff --git a/src/CLASS2/dihedral_class2xe.cpp b/src/CLASS2/dihedral_class2xe.cpp new file mode 100644 index 00000000000..f586b3d52d4 --- /dev/null +++ b/src/CLASS2/dihedral_class2xe.cpp @@ -0,0 +1,998 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Josh Kemppainen (Michigan Technological University) + jdkemppa@mtu.edu +------------------------------------------------------------------------- */ + +#include "dihedral_class2xe.h" + +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "citeme.h" +#include "math_const.h" +#include "memory.h" +#include "neighbor.h" + +#include +#include + +using namespace LAMMPS_NS; +using namespace MathConst; + +static constexpr double TOLERANCE = 0.05; +static constexpr double SMALL = 0.0000001; + +static const char cite_style_classII_xe[] = + "ClassII-xe Style: https://doi.org/10.1038/s41524-025-01838-5\n\n" + "@Article{Kemppainen 2025,\n" + " author = {J. Kemppainen and H. Heinz and G. M. Odegard},\n" + " title = {Integrating complete bond dissociation in Class II force fields},\n" + " journal = {npj Computational Materials},\n" + " year = 2025,\n" + " volume = 11,\n" + " pages = {341}\n" + "}\n\n"; + +/* ---------------------------------------------------------------------- */ + +DihedralClass2xe::DihedralClass2xe(LAMMPS *lmp) : Dihedral(lmp) +{ + if (lmp->citeme) lmp->citeme->add(cite_style_classII_xe); + writedata = 1; +} + +/* ---------------------------------------------------------------------- */ + +DihedralClass2xe::~DihedralClass2xe() +{ + if (copymode) return; + + if (allocated) { + memory->destroy(setflag); + memory->destroy(setflag_d); + memory->destroy(setflag_mbt); + memory->destroy(setflag_ebt); + memory->destroy(setflag_at); + memory->destroy(setflag_aat); + memory->destroy(setflag_bb13t); + + memory->destroy(k1); + memory->destroy(k2); + memory->destroy(k3); + memory->destroy(phi1); + memory->destroy(phi2); + memory->destroy(phi3); + + memory->destroy(mbt_f1); + memory->destroy(mbt_f2); + memory->destroy(mbt_f3); + memory->destroy(mbt_r0); + memory->destroy(mbt_alpha2); + + memory->destroy(ebt_f1_1); + memory->destroy(ebt_f2_1); + memory->destroy(ebt_f3_1); + memory->destroy(ebt_r0_1); + memory->destroy(ebt_alpha1); + + memory->destroy(ebt_f1_2); + memory->destroy(ebt_f2_2); + memory->destroy(ebt_f3_2); + memory->destroy(ebt_r0_2); + memory->destroy(ebt_alpha3); + + memory->destroy(at_f1_1); + memory->destroy(at_f2_1); + memory->destroy(at_f3_1); + memory->destroy(at_theta0_1); + + memory->destroy(at_f1_2); + memory->destroy(at_f2_2); + memory->destroy(at_f3_2); + memory->destroy(at_theta0_2); + + memory->destroy(aat_k); + memory->destroy(aat_theta0_1); + memory->destroy(aat_theta0_2); + + memory->destroy(bb13t_d0); + memory->destroy(bb13t_alpha); + memory->destroy(bb13t_r10); + memory->destroy(bb13t_r30); + } +} + +/* ---------------------------------------------------------------------- */ + +void DihedralClass2xe::compute(int eflag, int vflag) +{ + int i1,i2,i3,i4,i,j,k,n,type; + double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,vb2xm,vb2ym,vb2zm; + double edihedral; + double r1mag2,r1,r2mag2,r2,r3mag2,r3; + double sb1,rb1,sb2,rb2,sb3,rb3,c0,r12c1; + double r12c2,costh12,costh13,costh23,sc1,sc2,s1,s2,c; + double cosphi,phi,sinphi,a11,a22,a33,a12,a13,a23,sx1,sx2; + double sx12,sy1,sy2,sy12,sz1,sz2,sz12,dphi1,dphi2,dphi3; + double de_dihedral,t1,t2,t3,t4,cos2phi,cos3phi,bt1,bt2; + double bt3,sumbte,db,sumbtf,at1,at2,at3,da,da1,da2; + double dr1,dr2,tk1,tk2,s12,sin2; + double dcosphidr[4][3],dphidr[4][3],dbonddr[3][4][3],dthetadr[2][4][3]; + double fabcd[4][3]; + double bb13_ralpha1,bb13_ralpha2; + double mbt_dr2,mbt_ralpha2; + double ebt_dr1,ebt_dr3,ebt_ralpha1,ebt_ralpha3; + + edihedral = 0.0; + ev_init(eflag,vflag); + + double **x = atom->x; + double **f = atom->f; + int **dihedrallist = neighbor->dihedrallist; + int ndihedrallist = neighbor->ndihedrallist; + int nlocal = atom->nlocal; + int newton_bond = force->newton_bond; + + for (n = 0; n < ndihedrallist; n++) { + i1 = dihedrallist[n][0]; + i2 = dihedrallist[n][1]; + i3 = dihedrallist[n][2]; + i4 = dihedrallist[n][3]; + type = dihedrallist[n][4]; + + // 1st bond + + vb1x = x[i1][0] - x[i2][0]; + vb1y = x[i1][1] - x[i2][1]; + vb1z = x[i1][2] - x[i2][2]; + + // 2nd bond + + vb2x = x[i3][0] - x[i2][0]; + vb2y = x[i3][1] - x[i2][1]; + vb2z = x[i3][2] - x[i2][2]; + + vb2xm = -vb2x; + vb2ym = -vb2y; + vb2zm = -vb2z; + + // 3rd bond + + vb3x = x[i4][0] - x[i3][0]; + vb3y = x[i4][1] - x[i3][1]; + vb3z = x[i4][2] - x[i3][2]; + + // distances + + r1mag2 = vb1x*vb1x + vb1y*vb1y + vb1z*vb1z; + r1 = sqrt(r1mag2); + r2mag2 = vb2x*vb2x + vb2y*vb2y + vb2z*vb2z; + r2 = sqrt(r2mag2); + r3mag2 = vb3x*vb3x + vb3y*vb3y + vb3z*vb3z; + r3 = sqrt(r3mag2); + + sb1 = 1.0/r1mag2; + rb1 = 1.0/r1; + sb2 = 1.0/r2mag2; + rb2 = 1.0/r2; + sb3 = 1.0/r3mag2; + rb3 = 1.0/r3; + + c0 = (vb1x*vb3x + vb1y*vb3y + vb1z*vb3z) * rb1*rb3; + + // angles + + r12c1 = rb1*rb2; + r12c2 = rb2*rb3; + costh12 = (vb1x*vb2x + vb1y*vb2y + vb1z*vb2z) * r12c1; + costh13 = c0; + costh23 = (vb2xm*vb3x + vb2ym*vb3y + vb2zm*vb3z) * r12c2; + + costh12 = MAX(MIN(costh12, 1.0), -1.0); + costh13 = MAX(MIN(costh13, 1.0), -1.0); + costh23 = MAX(MIN(costh23, 1.0), -1.0); + c0 = costh13; + + // cos and sin of 2 angles and final c + + sin2 = MAX(1.0 - costh12*costh12,0.0); + sc1 = sqrt(sin2); + if (sc1 < SMALL) sc1 = SMALL; + sc1 = 1.0/sc1; + + sin2 = MAX(1.0 - costh23*costh23,0.0); + sc2 = sqrt(sin2); + if (sc2 < SMALL) sc2 = SMALL; + sc2 = 1.0/sc2; + + s1 = sc1 * sc1; + s2 = sc2 * sc2; + s12 = sc1 * sc2; + c = (c0 + costh12*costh23) * s12; + + // error check + + if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) + problem(FLERR, i1, i2, i3, i4); + + if (c > 1.0) c = 1.0; + if (c < -1.0) c = -1.0; + cosphi = c; + phi = acos(c); + + sinphi = sqrt(1.0 - c*c); + sinphi = MAX(sinphi,SMALL); + + // n123 = vb1 x vb2 + + double n123x = vb1y*vb2z - vb1z*vb2y; + double n123y = vb1z*vb2x - vb1x*vb2z; + double n123z = vb1x*vb2y - vb1y*vb2x; + double n123_dot_vb3 = n123x*vb3x + n123y*vb3y + n123z*vb3z; + if (n123_dot_vb3 > 0.0) { + phi = -phi; + sinphi = -sinphi; + } + + a11 = -c*sb1*s1; + a22 = sb2 * (2.0*costh13*s12 - c*(s1+s2)); + a33 = -c*sb3*s2; + a12 = r12c1 * (costh12*c*s1 + costh23*s12); + a13 = rb1*rb3*s12; + a23 = r12c2 * (-costh23*c*s2 - costh12*s12); + + sx1 = a11*vb1x + a12*vb2x + a13*vb3x; + sx2 = a12*vb1x + a22*vb2x + a23*vb3x; + sx12 = a13*vb1x + a23*vb2x + a33*vb3x; + sy1 = a11*vb1y + a12*vb2y + a13*vb3y; + sy2 = a12*vb1y + a22*vb2y + a23*vb3y; + sy12 = a13*vb1y + a23*vb2y + a33*vb3y; + sz1 = a11*vb1z + a12*vb2z + a13*vb3z; + sz2 = a12*vb1z + a22*vb2z + a23*vb3z; + sz12 = a13*vb1z + a23*vb2z + a33*vb3z; + + // set up d(cos(phi))/d(r) and dphi/dr arrays + + dcosphidr[0][0] = -sx1; + dcosphidr[0][1] = -sy1; + dcosphidr[0][2] = -sz1; + dcosphidr[1][0] = sx2 + sx1; + dcosphidr[1][1] = sy2 + sy1; + dcosphidr[1][2] = sz2 + sz1; + dcosphidr[2][0] = sx12 - sx2; + dcosphidr[2][1] = sy12 - sy2; + dcosphidr[2][2] = sz12 - sz2; + dcosphidr[3][0] = -sx12; + dcosphidr[3][1] = -sy12; + dcosphidr[3][2] = -sz12; + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + dphidr[i][j] = -dcosphidr[i][j] / sinphi; + + // energy + + dphi1 = phi - phi1[type]; + dphi2 = 2.0*phi - phi2[type]; + dphi3 = 3.0*phi - phi3[type]; + + if (eflag) edihedral = k1[type]*(1.0 - cos(dphi1)) + + k2[type]*(1.0 - cos(dphi2)) + + k3[type]*(1.0 - cos(dphi3)); + + de_dihedral = k1[type]*sin(dphi1) + 2.0*k2[type]*sin(dphi2) + + 3.0*k3[type]*sin(dphi3); + + // torsion forces on all 4 atoms + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + fabcd[i][j] = de_dihedral*dphidr[i][j]; + + // set up d(bond)/d(r) array + // dbonddr(i,j,k) = bond i, atom j, coordinate k + + for (i = 0; i < 3; i++) + for (j = 0; j < 4; j++) + for (k = 0; k < 3; k++) + dbonddr[i][j][k] = 0.0; + + // bond1 + + dbonddr[0][0][0] = vb1x / r1; + dbonddr[0][0][1] = vb1y / r1; + dbonddr[0][0][2] = vb1z / r1; + dbonddr[0][1][0] = -vb1x / r1; + dbonddr[0][1][1] = -vb1y / r1; + dbonddr[0][1][2] = -vb1z / r1; + + // bond2 + + dbonddr[1][1][0] = vb2x / r2; + dbonddr[1][1][1] = vb2y / r2; + dbonddr[1][1][2] = vb2z / r2; + dbonddr[1][2][0] = -vb2x / r2; + dbonddr[1][2][1] = -vb2y / r2; + dbonddr[1][2][2] = -vb2z / r2; + + // bond3 + + dbonddr[2][2][0] = vb3x / r3; + dbonddr[2][2][1] = vb3y / r3; + dbonddr[2][2][2] = vb3z / r3; + dbonddr[2][3][0] = -vb3x / r3; + dbonddr[2][3][1] = -vb3y / r3; + dbonddr[2][3][2] = -vb3z / r3; + + // set up d(theta)/d(r) array + // dthetadr(i,j,k) = angle i, atom j, coordinate k + + for (i = 0; i < 2; i++) + for (j = 0; j < 4; j++) + for (k = 0; k < 3; k++) + dthetadr[i][j][k] = 0.0; + + t1 = costh12 / r1mag2; + t2 = costh23 / r2mag2; + t3 = costh12 / r2mag2; + t4 = costh23 / r3mag2; + + // angle12 + + dthetadr[0][0][0] = sc1 * ((t1 * vb1x) - (vb2x * r12c1)); + dthetadr[0][0][1] = sc1 * ((t1 * vb1y) - (vb2y * r12c1)); + dthetadr[0][0][2] = sc1 * ((t1 * vb1z) - (vb2z * r12c1)); + + dthetadr[0][1][0] = sc1 * ((-t1 * vb1x) + (vb2x * r12c1) + + (-t3 * vb2x) + (vb1x * r12c1)); + dthetadr[0][1][1] = sc1 * ((-t1 * vb1y) + (vb2y * r12c1) + + (-t3 * vb2y) + (vb1y * r12c1)); + dthetadr[0][1][2] = sc1 * ((-t1 * vb1z) + (vb2z * r12c1) + + (-t3 * vb2z) + (vb1z * r12c1)); + + dthetadr[0][2][0] = sc1 * ((t3 * vb2x) - (vb1x * r12c1)); + dthetadr[0][2][1] = sc1 * ((t3 * vb2y) - (vb1y * r12c1)); + dthetadr[0][2][2] = sc1 * ((t3 * vb2z) - (vb1z * r12c1)); + + // angle23 + + dthetadr[1][1][0] = sc2 * ((t2 * vb2x) + (vb3x * r12c2)); + dthetadr[1][1][1] = sc2 * ((t2 * vb2y) + (vb3y * r12c2)); + dthetadr[1][1][2] = sc2 * ((t2 * vb2z) + (vb3z * r12c2)); + + dthetadr[1][2][0] = sc2 * ((-t2 * vb2x) - (vb3x * r12c2) + + (t4 * vb3x) + (vb2x * r12c2)); + dthetadr[1][2][1] = sc2 * ((-t2 * vb2y) - (vb3y * r12c2) + + (t4 * vb3y) + (vb2y * r12c2)); + dthetadr[1][2][2] = sc2 * ((-t2 * vb2z) - (vb3z * r12c2) + + (t4 * vb3z) + (vb2z * r12c2)); + + dthetadr[1][3][0] = -sc2 * ((t4 * vb3x) + (vb2x * r12c2)); + dthetadr[1][3][1] = -sc2 * ((t4 * vb3y) + (vb2y * r12c2)); + dthetadr[1][3][2] = -sc2 * ((t4 * vb3z) + (vb2z * r12c2)); + + // mid-bond/torsion coupling + // energy on bond2 (middle bond) + + cos2phi = cos(2.0*phi); + cos3phi = cos(3.0*phi); + + bt1 = mbt_f1[type]*cosphi; + bt2 = mbt_f2[type]*cos2phi; + bt3 = mbt_f3[type]*cos3phi; + sumbte = bt1 + bt2 + bt3; + + mbt_dr2 = r2 - mbt_r0[type]; + mbt_ralpha2 = exp(-mbt_alpha2[type]*mbt_dr2); + db = 1 - mbt_ralpha2; + if (eflag) edihedral += db*sumbte; + + // force on bond2 + + bt1 = -mbt_f1[type]*sinphi; + bt2 = -2.0*mbt_f2[type]*sin(2.0*phi); + bt3 = -3.0*mbt_f3[type]*sin(3.0*phi); + sumbtf = bt1 + bt2 + bt3; + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + fabcd[i][j] += db*sumbtf*dphidr[i][j] + sumbte*(mbt_alpha2[type]*mbt_ralpha2)*dbonddr[1][i][j]; + + // end-bond/torsion coupling + // energy on bond1 (first bond) + + bt1 = ebt_f1_1[type]*cosphi; + bt2 = ebt_f2_1[type]*cos2phi; + bt3 = ebt_f3_1[type]*cos3phi; + sumbte = bt1 + bt2 + bt3; + + ebt_dr1 = r1 - ebt_r0_1[type]; + ebt_ralpha1 = exp(-ebt_alpha1[type]*ebt_dr1); + db = 1 - ebt_ralpha1; + if (eflag) edihedral += db*(bt1+bt2+bt3); + + // force on bond1 + + bt1 = ebt_f1_1[type]*sinphi; + bt2 = 2.0*ebt_f2_1[type]*sin(2.0*phi); + bt3 = 3.0*ebt_f3_1[type]*sin(3.0*phi); + sumbtf = bt1 + bt2 + bt3; + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + fabcd[i][j] -= db*sumbtf*dphidr[i][j] + sumbte*(ebt_alpha1[type]*ebt_ralpha1)*dbonddr[0][i][j]; + + // end-bond/torsion coupling + // energy on bond3 (last bond) + + bt1 = ebt_f1_2[type]*cosphi; + bt2 = ebt_f2_2[type]*cos2phi; + bt3 = ebt_f3_2[type]*cos3phi; + sumbte = bt1 + bt2 + bt3; + + ebt_dr3 = r3 - ebt_r0_2[type]; + ebt_ralpha3 = exp(-ebt_alpha3[type]*ebt_dr3); + db = 1 - ebt_ralpha3; + if (eflag) edihedral += db*(bt1+bt2+bt3); + + // force on bond3 + + bt1 = -ebt_f1_2[type]*sinphi; + bt2 = -2.0*ebt_f2_2[type]*sin(2.0*phi); + bt3 = -3.0*ebt_f3_2[type]*sin(3.0*phi); + sumbtf = bt1 + bt2 + bt3; + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + fabcd[i][j] += db*sumbtf*dphidr[i][j] + sumbte*(ebt_alpha3[type]*ebt_ralpha3)*dbonddr[2][i][j]; + + // angle/torsion coupling + // energy on angle1 + + at1 = at_f1_1[type] * cosphi; + at2 = at_f2_1[type] * cos2phi; + at3 = at_f3_1[type] * cos3phi; + sumbte = at1 + at2 + at3; + + da = acos(costh12) - at_theta0_1[type]; + if (eflag) edihedral += da * (at1+at2+at3); + + // force on angle1 + + bt1 = at_f1_1[type] * sinphi; + bt2 = 2.0 * at_f2_1[type] * sin(2.0*phi); + bt3 = 3.0 * at_f3_1[type] * sin(3.0*phi); + sumbtf = bt1 + bt2 + bt3; + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + fabcd[i][j] -= da*sumbtf*dphidr[i][j] + sumbte*dthetadr[0][i][j]; + + // energy on angle2 + + at1 = at_f1_2[type] * cosphi; + at2 = at_f2_2[type] * cos2phi; + at3 = at_f3_2[type] * cos3phi; + sumbte = at1 + at2 + at3; + + da = acos(costh23) - at_theta0_2[type]; + if (eflag) edihedral += da * (at1+at2+at3); + + // force on angle2 + + bt1 = -at_f1_2[type] * sinphi; + bt2 = -2.0 * at_f2_2[type] * sin(2.0*phi); + bt3 = -3.0 * at_f3_2[type] * sin(3.0*phi); + sumbtf = bt1 + bt2 + bt3; + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + fabcd[i][j] += da*sumbtf*dphidr[i][j] + sumbte*dthetadr[1][i][j]; + + // angle/angle/torsion coupling + + da1 = acos(costh12) - aat_theta0_1[type]; + da2 = acos(costh23) - aat_theta0_2[type]; + + if (eflag) edihedral += aat_k[type]*da1*da2*cosphi; + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + fabcd[i][j] -= aat_k[type] * + (cosphi * (da2*dthetadr[0][i][j] - da1*dthetadr[1][i][j]) + + sinphi * da1*da2*dphidr[i][j]); + + // bond1/bond3 coupling + + if (fabs(bb13t_d0[type]) > SMALL) { + + dr1 = r1 - bb13t_r10[type]; + dr2 = r3 - bb13t_r30[type]; + bb13_ralpha1 = exp(-bb13t_alpha[type]*dr1); + bb13_ralpha2 = exp(-bb13t_alpha[type]*dr2); + tk1 = -bb13t_d0[type]*bb13t_alpha[type]*bb13_ralpha1*(1 - bb13_ralpha2)/r3; + tk2 = -bb13t_d0[type]*bb13t_alpha[type]*bb13_ralpha2*(1 - bb13_ralpha1)/r1; + + if (eflag) edihedral += bb13t_d0[type]*(1 - bb13_ralpha1)*(1 - bb13_ralpha2); + + fabcd[0][0] += tk2*vb1x; + fabcd[0][1] += tk2*vb1y; + fabcd[0][2] += tk2*vb1z; + + fabcd[1][0] -= tk2*vb1x; + fabcd[1][1] -= tk2*vb1y; + fabcd[1][2] -= tk2*vb1z; + + fabcd[2][0] -= tk1*vb3x; + fabcd[2][1] -= tk1*vb3y; + fabcd[2][2] -= tk1*vb3z; + + fabcd[3][0] += tk1*vb3x; + fabcd[3][1] += tk1*vb3y; + fabcd[3][2] += tk1*vb3z; + } + + // apply force to each of 4 atoms + + if (newton_bond || i1 < nlocal) { + f[i1][0] += fabcd[0][0]; + f[i1][1] += fabcd[0][1]; + f[i1][2] += fabcd[0][2]; + } + + if (newton_bond || i2 < nlocal) { + f[i2][0] += fabcd[1][0]; + f[i2][1] += fabcd[1][1]; + f[i2][2] += fabcd[1][2]; + } + + if (newton_bond || i3 < nlocal) { + f[i3][0] += fabcd[2][0]; + f[i3][1] += fabcd[2][1]; + f[i3][2] += fabcd[2][2]; + } + + if (newton_bond || i4 < nlocal) { + f[i4][0] += fabcd[3][0]; + f[i4][1] += fabcd[3][1]; + f[i4][2] += fabcd[3][2]; + } + + if (evflag) + ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral, + fabcd[0],fabcd[2],fabcd[3], + vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z); + } +} + +/* ---------------------------------------------------------------------- */ + +void DihedralClass2xe::allocate() +{ + allocated = 1; + int n = atom->ndihedraltypes; + + memory->create(k1,n+1,"dihedral:k1"); + memory->create(k2,n+1,"dihedral:k2"); + memory->create(k3,n+1,"dihedral:k3"); + memory->create(phi1,n+1,"dihedral:phi1"); + memory->create(phi2,n+1,"dihedral:phi2"); + memory->create(phi3,n+1,"dihedral:phi3"); + + memory->create(mbt_f1,n+1,"dihedral:mbt_f1"); + memory->create(mbt_f2,n+1,"dihedral:mbt_f2"); + memory->create(mbt_f3,n+1,"dihedral:mbt_f3"); + memory->create(mbt_r0,n+1,"dihedral:mbt_r0"); + memory->create(mbt_alpha2,n+1,"dihedral:mbt_alpha2"); + + memory->create(ebt_alpha1,n+1,"dihedral:ebt_alpha1"); + memory->create(ebt_f1_1,n+1,"dihedral:ebt_f1_1"); + memory->create(ebt_f2_1,n+1,"dihedral:ebt_f2_1"); + memory->create(ebt_f3_1,n+1,"dihedral:ebt_f3_1"); + memory->create(ebt_r0_1,n+1,"dihedral:ebt_r0_1"); + + memory->create(ebt_alpha3,n+1,"dihedral:ebt_alpha3"); + memory->create(ebt_f1_2,n+1,"dihedral:ebt_f1_2"); + memory->create(ebt_f2_2,n+1,"dihedral:ebt_f2_2"); + memory->create(ebt_f3_2,n+1,"dihedral:ebt_f3_2"); + memory->create(ebt_r0_2,n+1,"dihedral:ebt_r0_2"); + + memory->create(at_f1_1,n+1,"dihedral:at_f1_1"); + memory->create(at_f2_1,n+1,"dihedral:at_f2_1"); + memory->create(at_f3_1,n+1,"dihedral:at_f3_1"); + memory->create(at_theta0_1,n+1,"dihedral:at_theta0_1"); + + memory->create(at_f1_2,n+1,"dihedral:at_f1_2"); + memory->create(at_f2_2,n+1,"dihedral:at_f2_2"); + memory->create(at_f3_2,n+1,"dihedral:at_f3_2"); + memory->create(at_theta0_2,n+1,"dihedral:at_theta0_2"); + + memory->create(aat_k,n+1,"dihedral:aat_k"); + memory->create(aat_theta0_1,n+1,"dihedral:aat_theta0_1"); + memory->create(aat_theta0_2,n+1,"dihedral:aat_theta0_2"); + + memory->create(bb13t_d0,n+1,"dihedral:bb13t_d0"); + memory->create(bb13t_alpha,n+1,"dihedral:bb13t_alpha"); + memory->create(bb13t_r10,n+1,"dihedral:bb13t_r10"); + memory->create(bb13t_r30,n+1,"dihedral:bb13t_r30"); + + memory->create(setflag,n+1,"dihedral:setflag"); + memory->create(setflag_d,n+1,"dihedral:setflag_d"); + memory->create(setflag_mbt,n+1,"dihedral:setflag_mbt"); + memory->create(setflag_ebt,n+1,"dihedral:setflag_ebt"); + memory->create(setflag_at,n+1,"dihedral:setflag_at"); + memory->create(setflag_aat,n+1,"dihedral:setflag_aat"); + memory->create(setflag_bb13t,n+1,"dihedral:setflag_bb13t"); + for (int i = 1; i <= n; i++) + setflag[i] = setflag_d[i] = setflag_mbt[i] = setflag_ebt[i] = + setflag_at[i] = setflag_aat[i] = setflag_bb13t[i] = 0; +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more types + arg1 = "mbt" -> MiddleBondTorsion coeffs + arg1 = "ebt" -> EndBondTorsion coeffs + arg1 = "at" -> AngleTorsion coeffs + arg1 = "aat" -> AngleAngleTorsion coeffs + arg1 = "bb13" -> BondBond13Torsion coeffs + arg1 -> Dihedral coeffs +------------------------------------------------------------------------- */ + +void DihedralClass2xe::coeff(int narg, char **arg) +{ + if (narg < 2) error->all(FLERR,"Invalid coeffs for this dihedral style"); + if (!allocated) allocate(); + + int ilo,ihi; + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); + + int count = 0; + + if (strcmp(arg[1],"mbt") == 0) { + if (narg != 7) error->all(FLERR,"Incorrect args for dihedral coefficients"); + + double alpha_one = utils::numeric(FLERR,arg[2],false,lmp); + double f1_one = utils::numeric(FLERR,arg[3],false,lmp); + double f2_one = utils::numeric(FLERR,arg[4],false,lmp); + double f3_one = utils::numeric(FLERR,arg[5],false,lmp); + double r0_one = utils::numeric(FLERR,arg[6],false,lmp); + + for (int i = ilo; i <= ihi; i++) { + mbt_alpha2[i] = alpha_one; + mbt_f1[i] = f1_one; + mbt_f2[i] = f2_one; + mbt_f3[i] = f3_one; + mbt_r0[i] = r0_one; + setflag_mbt[i] = 1; + count++; + } + + } else if (strcmp(arg[1],"ebt") == 0) { + if (narg != 12) + error->all(FLERR,"Incorrect args for dihedral coefficients"); + + double alpha1_one = utils::numeric(FLERR,arg[2],false,lmp); + double alpha3_one = utils::numeric(FLERR,arg[3],false,lmp); + double f1_1_one = utils::numeric(FLERR,arg[4],false,lmp); + double f2_1_one = utils::numeric(FLERR,arg[5],false,lmp); + double f3_1_one = utils::numeric(FLERR,arg[6],false,lmp); + double f1_2_one = utils::numeric(FLERR,arg[7],false,lmp); + double f2_2_one = utils::numeric(FLERR,arg[8],false,lmp); + double f3_2_one = utils::numeric(FLERR,arg[9],false,lmp); + double r0_1_one = utils::numeric(FLERR,arg[10],false,lmp); + double r0_2_one = utils::numeric(FLERR,arg[11],false,lmp); + + for (int i = ilo; i <= ihi; i++) { + ebt_alpha1[i] = alpha1_one; + ebt_alpha3[i] = alpha3_one; + ebt_f1_1[i] = f1_1_one; + ebt_f2_1[i] = f2_1_one; + ebt_f3_1[i] = f3_1_one; + ebt_f1_2[i] = f1_2_one; + ebt_f2_2[i] = f2_2_one; + ebt_f3_2[i] = f3_2_one; + ebt_r0_1[i] = r0_1_one; + ebt_r0_2[i] = r0_2_one; + setflag_ebt[i] = 1; + count++; + } + + } else if (strcmp(arg[1],"at") == 0) { + if (narg != 10) + error->all(FLERR,"Incorrect args for dihedral coefficients"); + + double f1_1_one = utils::numeric(FLERR,arg[2],false,lmp); + double f2_1_one = utils::numeric(FLERR,arg[3],false,lmp); + double f3_1_one = utils::numeric(FLERR,arg[4],false,lmp); + double f1_2_one = utils::numeric(FLERR,arg[5],false,lmp); + double f2_2_one = utils::numeric(FLERR,arg[6],false,lmp); + double f3_2_one = utils::numeric(FLERR,arg[7],false,lmp); + double theta0_1_one = utils::numeric(FLERR,arg[8],false,lmp); + double theta0_2_one = utils::numeric(FLERR,arg[9],false,lmp); + + // convert theta0's from degrees to radians + + for (int i = ilo; i <= ihi; i++) { + at_f1_1[i] = f1_1_one; + at_f2_1[i] = f2_1_one; + at_f3_1[i] = f3_1_one; + at_f1_2[i] = f1_2_one; + at_f2_2[i] = f2_2_one; + at_f3_2[i] = f3_2_one; + at_theta0_1[i] = theta0_1_one/180.0 * MY_PI; + at_theta0_2[i] = theta0_2_one/180.0 * MY_PI; + setflag_at[i] = 1; + count++; + } + + } else if (strcmp(arg[1],"aat") == 0) { + if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients"); + + double k_one = utils::numeric(FLERR,arg[2],false,lmp); + double theta0_1_one = utils::numeric(FLERR,arg[3],false,lmp); + double theta0_2_one = utils::numeric(FLERR,arg[4],false,lmp); + + // convert theta0's from degrees to radians + + for (int i = ilo; i <= ihi; i++) { + aat_k[i] = k_one; + aat_theta0_1[i] = theta0_1_one/180.0 * MY_PI; + aat_theta0_2[i] = theta0_2_one/180.0 * MY_PI; + setflag_aat[i] = 1; + count++; + } + + } else if (strcmp(arg[1],"bb13") == 0) { + if (narg != 6) error->all(FLERR,"Incorrect args for dihedral coefficients"); + + double d0_one = utils::numeric(FLERR,arg[2],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[3],false,lmp); + double r10_one = utils::numeric(FLERR,arg[4],false,lmp); + double r30_one = utils::numeric(FLERR,arg[5],false,lmp); + + for (int i = ilo; i <= ihi; i++) { + bb13t_d0[i] = d0_one; + bb13t_alpha[i] = alpha_one; + bb13t_r10[i] = r10_one; + bb13t_r30[i] = r30_one; + setflag_bb13t[i] = 1; + count++; + } + + } else { + if (narg != 7) error->all(FLERR,"Incorrect args for dihedral coefficients"); + + double k1_one = utils::numeric(FLERR,arg[1],false,lmp); + double phi1_one = utils::numeric(FLERR,arg[2],false,lmp); + double k2_one = utils::numeric(FLERR,arg[3],false,lmp); + double phi2_one = utils::numeric(FLERR,arg[4],false,lmp); + double k3_one = utils::numeric(FLERR,arg[5],false,lmp); + double phi3_one = utils::numeric(FLERR,arg[6],false,lmp); + + // convert phi's from degrees to radians + + for (int i = ilo; i <= ihi; i++) { + k1[i] = k1_one; + phi1[i] = phi1_one/180.0 * MY_PI; + k2[i] = k2_one; + phi2[i] = phi2_one/180.0 * MY_PI; + k3[i] = k3_one; + phi3[i] = phi3_one/180.0 * MY_PI; + setflag_d[i] = 1; + count++; + } + } + + if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients"); + + for (int i = ilo; i <= ihi; i++) + if (setflag_d[i] == 1 && setflag_mbt[i] == 1 && setflag_ebt[i] == 1 && + setflag_at[i] == 1 && setflag_aat[i] == 1 && setflag_bb13t[i] == 1) + setflag[i] = 1; +} + +/* ---------------------------------------------------------------------- + proc 0 writes out coeffs to restart file +------------------------------------------------------------------------- */ + +void DihedralClass2xe::write_restart(FILE *fp) +{ + fwrite(&k1[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&k2[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&k3[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&phi1[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&phi2[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&phi3[1],sizeof(double),atom->ndihedraltypes,fp); + + fwrite(&mbt_alpha2[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&mbt_f1[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&mbt_f2[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&mbt_f3[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&mbt_r0[1],sizeof(double),atom->ndihedraltypes,fp); + + fwrite(&ebt_alpha1[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&ebt_alpha3[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&ebt_f1_1[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&ebt_f2_1[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&ebt_f3_1[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&ebt_r0_1[1],sizeof(double),atom->ndihedraltypes,fp); + + fwrite(&ebt_f1_2[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&ebt_f2_2[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&ebt_f3_2[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&ebt_r0_2[1],sizeof(double),atom->ndihedraltypes,fp); + + fwrite(&at_f1_1[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&at_f2_1[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&at_f3_1[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&at_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp); + + fwrite(&at_f1_2[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&at_f2_2[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&at_f3_2[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&at_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp); + + fwrite(&aat_k[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&aat_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&aat_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp); + + fwrite(&bb13t_d0[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&bb13t_alpha[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&bb13t_r10[1],sizeof(double),atom->ndihedraltypes,fp); + fwrite(&bb13t_r30[1],sizeof(double),atom->ndihedraltypes,fp); +} + +/* ---------------------------------------------------------------------- + proc 0 reads coeffs from restart file, bcasts them +------------------------------------------------------------------------- */ + +void DihedralClass2xe::read_restart(FILE *fp) +{ + allocate(); + + if (comm->me == 0) { + utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&mbt_alpha2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_f1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_f2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_f3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_r0[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + + utils::sfread(FLERR,&ebt_alpha1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_alpha3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_r0_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_r0_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&at_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&at_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&aat_k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&aat_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&aat_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + + utils::sfread(FLERR,&bb13t_d0[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&bb13t_alpha[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&bb13t_r10[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&bb13t_r30[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + } + + MPI_Bcast(&k1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&k2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&k3[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&phi1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&phi2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&phi3[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + + MPI_Bcast(&mbt_f1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&mbt_f2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&mbt_f3[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&mbt_r0[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + + MPI_Bcast(&ebt_alpha1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ebt_alpha3[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ebt_f1_1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ebt_f2_1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ebt_f3_1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ebt_r0_1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ebt_f1_2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ebt_f2_2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ebt_f3_2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&ebt_r0_2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + + MPI_Bcast(&at_f1_1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&at_f2_1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&at_f3_1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&at_theta0_1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + + MPI_Bcast(&at_f1_2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&at_f2_2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&at_f3_2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&at_theta0_2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + + MPI_Bcast(&aat_k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&aat_theta0_1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&aat_theta0_2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + + MPI_Bcast(&bb13t_d0[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&bb13t_alpha[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&bb13t_r10[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + MPI_Bcast(&bb13t_r30[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); + + for (int i = 1; i <= atom->ndihedraltypes; i++) setflag[i] = 1; +} + +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void DihedralClass2xe::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->ndihedraltypes; i++) + fprintf(fp,"%d %g %g %g %g %g %g\n",i, + k1[i],phi1[i]*180.0/MY_PI, + k2[i],phi2[i]*180.0/MY_PI, + k3[i],phi3[i]*180.0/MY_PI); + + fprintf(fp,"\nAngleAngleTorsion Coeffs\n\n"); + for (int i = 1; i <= atom->ndihedraltypes; i++) + fprintf(fp,"%d %g %g %g\n",i,aat_k[i], + aat_theta0_1[i]*180.0/MY_PI,aat_theta0_2[i]*180.0/MY_PI); + + fprintf(fp,"\nEndBondTorsion Coeffs\n\n"); + for (int i = 1; i <= atom->ndihedraltypes; i++) + fprintf(fp,"%d %g %g %g %g %g %g %g %g %g %g\n",i,ebt_alpha1[i],ebt_alpha3[i], + ebt_f1_1[i],ebt_f2_1[i],ebt_f3_1[i], + ebt_f1_2[i],ebt_f2_2[i],ebt_f3_2[i], + ebt_r0_1[i],ebt_r0_2[i]); + + fprintf(fp,"\nMiddleBondTorsion Coeffs\n\n"); + for (int i = 1; i <= atom->ndihedraltypes; i++) + fprintf(fp,"%d %g %g %g %g %g\n",i,mbt_alpha2[i],mbt_f1[i],mbt_f2[i],mbt_f3[i],mbt_r0[i]); + + fprintf(fp,"\nBondBond13 Coeffs\n\n"); + for (int i = 1; i <= atom->ndihedraltypes; i++) + fprintf(fp,"%d %g %g %g %g\n",i,bb13t_d0[i],bb13t_alpha[i],bb13t_r10[i],bb13t_r30[i]); + + fprintf(fp,"\nAngleTorsion Coeffs\n\n"); + for (int i = 1; i <= atom->ndihedraltypes; i++) + fprintf(fp,"%d %g %g %g %g %g %g %g %g\n",i, + at_f1_1[i],at_f2_1[i],at_f3_1[i], + at_f1_2[i],at_f2_2[i],at_f3_2[i], + at_theta0_1[i]*180.0/MY_PI,at_theta0_2[i]*180.0/MY_PI); +} + diff --git a/src/CLASS2/dihedral_class2xe.h b/src/CLASS2/dihedral_class2xe.h new file mode 100644 index 00000000000..021da7e5376 --- /dev/null +++ b/src/CLASS2/dihedral_class2xe.h @@ -0,0 +1,56 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef DIHEDRAL_CLASS +// clang-format off +DihedralStyle(class2xe,DihedralClass2xe); +// clang-format on +#else + +#ifndef LMP_DIHEDRAL_CLASS2XE_H +#define LMP_DIHEDRAL_CLASS2XE_H + +#include "dihedral.h" + +namespace LAMMPS_NS { + +class DihedralClass2xe : public Dihedral { + public: + DihedralClass2xe(class LAMMPS *); + ~DihedralClass2xe() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + + protected: + double *k1, *k2, *k3; + double *phi1, *phi2, *phi3; + double *mbt_f1, *mbt_f2, *mbt_f3, *mbt_r0, *mbt_alpha2; + double *ebt_f1_1, *ebt_f2_1, *ebt_f3_1, *ebt_r0_1, *ebt_alpha1; + double *ebt_f1_2, *ebt_f2_2, *ebt_f3_2, *ebt_r0_2, *ebt_alpha3; + double *at_f1_1, *at_f2_1, *at_f3_1, *at_theta0_1; + double *at_f1_2, *at_f2_2, *at_f3_2, *at_theta0_2; + double *aat_k, *aat_theta0_1, *aat_theta0_2; + double *bb13t_d0, *bb13t_alpha, *bb13t_r10, *bb13t_r30; + int *setflag_d, *setflag_mbt, *setflag_ebt; + int *setflag_at, *setflag_aat, *setflag_bb13t; + + void allocate(); +}; + +} // namespace LAMMPS_NS + +#endif +#endif diff --git a/src/COLVARS/fix_colvars.cpp b/src/COLVARS/fix_colvars.cpp index c5b6fea4738..0716128515d 100644 --- a/src/COLVARS/fix_colvars.cpp +++ b/src/COLVARS/fix_colvars.cpp @@ -854,13 +854,13 @@ double FixColvars::compute_array(int m, int n) double value = 0.0; if (comm->me == 0) { const auto& variables = *proxy->colvars->variables(); - if (m >= variables.size()) { + if (m >= (int)variables.size()) { error->all(FLERR, Error::NOLASTLINE, "f_{}[{}][{}] out-of-bounds: {} collective variables " "available.", id, m+1, n+1, variables.size()); } const auto& variable = variables[m]->value(); const auto& name = variables[m]->name; - if (n >= variable.size()) { + if (n >= (int)variable.size()) { error->all(FLERR, Error::NOLASTLINE, "f_{}[{}][{}] out-of-bounds: collective variable {} " "has size {}.", id, m+1, n+1, name, variable.size()); } diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index 16e5234e0b4..d892d40df03 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -47,6 +47,7 @@ #include #include #include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -1051,6 +1052,7 @@ void FixGCMC::attempt_atomic_insertion() atom->v[m][0] = random_unequal->gaussian()*sigma; atom->v[m][1] = random_unequal->gaussian()*sigma; atom->v[m][2] = random_unequal->gaussian()*sigma; + random_unequal->gaussian(); // this ensures exact restart modify->create_attribute(m); success = 1; @@ -1458,6 +1460,7 @@ void FixGCMC::attempt_molecule_insertion() vnew[0] = random_equal->gaussian()*sigma; vnew[1] = random_equal->gaussian()*sigma; vnew[2] = random_equal->gaussian()*sigma; + random_equal->gaussian(); // this ensures exact restart for (int i = 0; i < natoms_per_molecule; i++) { if (procflag[i]) { @@ -1735,6 +1738,7 @@ void FixGCMC::attempt_atomic_insertion_full() atom->v[m][0] = random_unequal->gaussian()*sigma; atom->v[m][1] = random_unequal->gaussian()*sigma; atom->v[m][2] = random_unequal->gaussian()*sigma; + random_unequal->gaussian(); // this ensures exact restart if (charge_flag) atom->q[m] = charge; modify->create_attribute(m); } @@ -2134,6 +2138,7 @@ void FixGCMC::attempt_molecule_insertion_full() vnew[0] = random_equal->gaussian()*sigma; vnew[1] = random_equal->gaussian()*sigma; vnew[2] = random_equal->gaussian()*sigma; + random_equal->gaussian(); // this ensures exact restart for (int i = 0; i < natoms_per_molecule; i++) { double xtmp[3]; @@ -2540,6 +2545,13 @@ void FixGCMC::update_gas_atoms_list() } } + // sort local atoms on tags to ensure exact restart + + tagint *tag = atom->tag; + std::sort(local_gas_list, local_gas_list + ngas_local, + [&tag](int i, int j) { return tag[i] < tag[j]; } + ); + MPI_Allreduce(&ngas_local,&ngas,1,MPI_INT,MPI_SUM,world); MPI_Scan(&ngas_local,&ngas_before,1,MPI_INT,MPI_SUM,world); ngas_before -= ngas_local; @@ -2578,10 +2590,12 @@ double FixGCMC::memory_usage() void FixGCMC::write_restart(FILE *fp) { + int nglobalvals = 12; + int nlocalvals = comm->nprocs; + int ntotalvals = nglobalvals + nlocalvals; + std::vector list(ntotalvals); int n = 0; - double list[12]; list[n++] = random_equal->state(); - list[n++] = random_unequal->state(); list[n++] = ubuf(next_reneighbor).d; list[n++] = ntranslation_attempts; list[n++] = ntranslation_successes; @@ -2592,11 +2606,15 @@ void FixGCMC::write_restart(FILE *fp) list[n++] = ninsertion_attempts; list[n++] = ninsertion_successes; list[n++] = ubuf(update->ntimestep).d; + list[n++] = nlocalvals; + + double state = random_unequal->state(); + MPI_Gather(&state, 1, MPI_DOUBLE, &list[n], 1, MPI_DOUBLE, 0, world); if (comm->me == 0) { - int size = n * sizeof(double); - fwrite(&size,sizeof(int),1,fp); - fwrite(list,sizeof(double),n,fp); + int size = ntotalvals * sizeof(double); + fwrite(&size, sizeof(int), 1, fp); + fwrite(&list[0], sizeof(double), ntotalvals, fp); } } @@ -2612,9 +2630,6 @@ void FixGCMC::restart(char *buf) seed = static_cast (list[n++]); random_equal->reset(seed); - seed = static_cast (list[n++]); - random_unequal->reset(seed); - next_reneighbor = (bigint) ubuf(list[n++]).i; ntranslation_attempts = list[n++]; @@ -2629,6 +2644,14 @@ void FixGCMC::restart(char *buf) bigint ntimestep_restart = (bigint) ubuf(list[n++]).i; if (ntimestep_restart != update->ntimestep) error->all(FLERR,"Must not reset timestep when restarting fix gcmc"); + + // read stored state of RNG unique to this process + // if nprocs changed, use state of proc 0 + + int nlocalvals = list[n++]; + if (nlocalvals == comm->nprocs) n += comm->me; + seed = static_cast (list[n]); + random_unequal->reset(seed); } void FixGCMC::grow_molecule_arrays(int nmolatoms) { diff --git a/src/version.h b/src/version.h index cfc657f67cc..c5557f8649a 100644 --- a/src/version.h +++ b/src/version.h @@ -1,2 +1 @@ -#define LAMMPS_VERSION "11 Feb 2026" -#define LAMMPS_UPDATE "Development" +#define LAMMPS_VERSION "30 Mar 2026" diff --git a/unittest/force-styles/tests/fix-timestep-efield_dipole_variable.yaml b/unittest/force-styles/tests/fix-timestep-efield_dipole_variable.yaml index b6e636d7193..9038004c485 100644 --- a/unittest/force-styles/tests/fix-timestep-efield_dipole_variable.yaml +++ b/unittest/force-styles/tests/fix-timestep-efield_dipole_variable.yaml @@ -1,7 +1,7 @@ --- lammps_version: 27 Jun 2024 date_generated: Sun Aug 4 22:46:18 2024 -epsilon: 2e-13 +epsilon: 5.0e-13 skip_tests: prerequisites: ! | atom full