diff --git a/cmake/Modules/Packages/OPENMP.cmake b/cmake/Modules/Packages/OPENMP.cmake index 922df86ef6..0a23e58b4b 100644 --- a/cmake/Modules/Packages/OPENMP.cmake +++ b/cmake/Modules/Packages/OPENMP.cmake @@ -25,15 +25,15 @@ endif() if(PKG_REAXFF) - list(APPEND OPENMP_SOURCES ${OPENMP_SOURCES_DIR}/reaxc_bond_orders_omp.cpp - ${OPENMP_SOURCES_DIR}/reaxc_hydrogen_bonds_omp.cpp - ${OPENMP_SOURCES_DIR}/reaxc_nonbonded_omp.cpp - ${OPENMP_SOURCES_DIR}/reaxc_bonds_omp.cpp - ${OPENMP_SOURCES_DIR}/reaxc_init_md_omp.cpp - ${OPENMP_SOURCES_DIR}/reaxc_torsion_angles_omp.cpp - ${OPENMP_SOURCES_DIR}/reaxc_forces_omp.cpp - ${OPENMP_SOURCES_DIR}/reaxc_multi_body_omp.cpp - ${OPENMP_SOURCES_DIR}/reaxc_valence_angles_omp.cpp) + list(APPEND OPENMP_SOURCES ${OPENMP_SOURCES_DIR}/reaxff_bond_orders_omp.cpp + ${OPENMP_SOURCES_DIR}/reaxff_hydrogen_bonds_omp.cpp + ${OPENMP_SOURCES_DIR}/reaxff_nonbonded_omp.cpp + ${OPENMP_SOURCES_DIR}/reaxff_bonds_omp.cpp + ${OPENMP_SOURCES_DIR}/reaxff_init_md_omp.cpp + ${OPENMP_SOURCES_DIR}/reaxff_torsion_angles_omp.cpp + ${OPENMP_SOURCES_DIR}/reaxff_forces_omp.cpp + ${OPENMP_SOURCES_DIR}/reaxff_multi_body_omp.cpp + ${OPENMP_SOURCES_DIR}/reaxff_valence_angles_omp.cpp) endif() target_sources(lammps PRIVATE ${OPENMP_SOURCES}) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 0ca71699a3..45a75ff394 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -179,14 +179,14 @@ OPT. * :doc:`qeq/dynamic ` * :doc:`qeq/fire ` * :doc:`qeq/point ` - * :doc:`qeq/reax (ko) ` + * :doc:`qeq/reaxff (ko) ` * :doc:`qeq/shielded ` * :doc:`qeq/slater ` * :doc:`qmmm ` * :doc:`qtb ` * :doc:`rattle ` - * :doc:`reax/c/bonds (k) ` - * :doc:`reax/c/species (k) ` + * :doc:`reaxff/bonds (k) ` + * :doc:`reaxff/species (k) ` * :doc:`recenter ` * :doc:`restrain ` * :doc:`rhok ` diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index 7abb1d582a..db3d947892 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -235,7 +235,7 @@ OPT. * :doc:`python ` * :doc:`quip ` * :doc:`rann ` - * :doc:`reax/c (ko) ` + * :doc:`reaxff (ko) ` * :doc:`rebo (io) ` * :doc:`resquared (go) ` * :doc:`sdpd/taitwater/isothermal ` diff --git a/doc/src/Errors_warnings.rst b/doc/src/Errors_warnings.rst index 68d6b0451a..806dec024b 100644 --- a/doc/src/Errors_warnings.rst +++ b/doc/src/Errors_warnings.rst @@ -514,7 +514,7 @@ This will most likely cause errors in kinetic fluctuations. will integrate the body motion, but it would be more efficient to use fix rigid. -*Not using real units with pair reax* +*Not using real units with pair reaxff* This is most likely an error, unless you have created your own ReaxFF parameter file in a different set of units. @@ -805,5 +805,3 @@ This will most likely cause errors in kinetic fluctuations. *Using pair tail corrections with pair_modify compute no* The tail corrections will thus not be computed. -*pair style reax is now deprecated and will soon be retired. Users should switch to pair_style reax/c* - Self-explanatory. diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index 5a4327dad6..1af1512bbf 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -2274,10 +2274,10 @@ for monitoring molecules as bonds are created and destroyed. * src/REAXFF: filenames -> commands * src/REAXFF/README -* :doc:`pair_style reax/c ` -* :doc:`fix reax/c/bonds ` -* :doc:`fix reax/c/species ` -* examples/reax +* :doc:`pair_style reaxff ` +* :doc:`fix reaxff/bonds ` +* :doc:`fix reaxff/species ` +* examples/reaxff ---------- diff --git a/doc/src/Packages_list.rst b/doc/src/Packages_list.rst index 44c05f8a39..d568976ffe 100644 --- a/doc/src/Packages_list.rst +++ b/doc/src/Packages_list.rst @@ -370,7 +370,7 @@ whether an extra library is needed to build and use the package: - no * - :ref:`REAXFF ` - ReaxFF potential (C/C++) - - :doc:`pair_style reaxc ` + - :doc:`pair_style reaxff ` - reax - no * - :ref:`REPLICA ` diff --git a/doc/src/Tools.rst b/doc/src/Tools.rst index 65a96ce44a..e7cd87aa78 100644 --- a/doc/src/Tools.rst +++ b/doc/src/Tools.rst @@ -76,7 +76,6 @@ Post-processing tools * :ref:`phonon ` * :ref:`pymol_asphere ` * :ref:`python ` - * :ref:`reax ` * :ref:`replica ` * :ref:`smd ` * :ref:`spin ` @@ -947,20 +946,6 @@ while at the Shell lab at UC Santa Barbara. (tanmoy dot 7989 at gmail.com) ---------- -.. _reax_tool: - -reax tool --------------------------- - -The reax sub-directory contains stand-alone codes that can -post-process the output of the :doc:`fix reax/c/bonds ` -command from a LAMMPS simulation using :doc:`ReaxFF `. See -the README.txt file for more info. - -These tools were written by Aidan Thompson at Sandia. - ----------- - .. _smd: smd tool diff --git a/doc/src/compute_pair.rst b/doc/src/compute_pair.rst index 1b074203aa..abfd1ebed4 100644 --- a/doc/src/compute_pair.rst +++ b/doc/src/compute_pair.rst @@ -24,7 +24,7 @@ Examples compute 1 all pair gauss compute 1 all pair lj/cut/coul/cut ecoul compute 1 all pair tersoff 2 epair - compute 1 all pair reax/c + compute 1 all pair reaxff Description """"""""""" @@ -64,7 +64,8 @@ is stored as a global scalar. :doc:`pair_modify ` command. Some pair styles tally additional quantities, e.g. a breakdown of -potential energy into 14 components is tallied by the :doc:`pair_style reax/c ` command. These values (1 or more) +potential energy into 14 components is tallied by the +:doc:`pair_style reaxff ` command. These values (1 or more) are stored as a global vector by this compute. See the doc page for :doc:`individual pair styles ` for info on these values. diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 912cfad255..07a663c789 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -322,14 +322,14 @@ accelerated styles exist. * :doc:`qeq/dynamic ` - charge equilibration via dynamic method * :doc:`qeq/fire ` - charge equilibration via FIRE minimizer * :doc:`qeq/point ` - charge equilibration via point method -* :doc:`qeq/reax ` - charge equilibration for ReaxFF potential +* :doc:`qeq/reaxff ` - charge equilibration for ReaxFF potential * :doc:`qeq/shielded ` - charge equilibration via shielded method * :doc:`qeq/slater ` - charge equilibration via Slater method * :doc:`qmmm ` - functionality to enable a quantum mechanics/molecular mechanics coupling * :doc:`qtb ` - implement quantum thermal bath scheme * :doc:`rattle ` - RATTLE constraints on bonds and/or angles -* :doc:`reax/c/bonds ` - write out ReaxFF bond information -* :doc:`reax/c/species ` - write out ReaxFF molecule information +* :doc:`reaxff/bonds ` - write out ReaxFF bond information +* :doc:`reaxff/species ` - write out ReaxFF molecule information * :doc:`recenter ` - constrain the center-of-mass position of a group of atoms * :doc:`restrain ` - constrain a bond, angle, dihedral * :doc:`rhok ` - add bias potential for long-range ordered systems diff --git a/doc/src/fix_adapt.rst b/doc/src/fix_adapt.rst index a110d93a8d..58d86f8472 100644 --- a/doc/src/fix_adapt.rst +++ b/doc/src/fix_adapt.rst @@ -186,7 +186,7 @@ formulas for the meaning of these parameters: +------------------------------------------------------------------------------+--------------------------------------------------+-------------+ | :doc:`nm/cut/coul/cut, nm/cut/coul/long ` | E0,R0,m,n,coulombic_cutoff | type pairs | +------------------------------------------------------------------------------+--------------------------------------------------+-------------+ -| :doc:`reax/c ` | chi, eta, gamma | type global | +| :doc:`reaxff ` | chi, eta, gamma | type global | +------------------------------------------------------------------------------+--------------------------------------------------+-------------+ | :doc:`snap ` | scale | type pairs | +------------------------------------------------------------------------------+--------------------------------------------------+-------------+ diff --git a/doc/src/fix_gcmc.rst b/doc/src/fix_gcmc.rst index c65dace601..e360fab86e 100644 --- a/doc/src/fix_gcmc.rst +++ b/doc/src/fix_gcmc.rst @@ -374,7 +374,7 @@ in the context of NVT dynamics. has been reached. With some pair_styles, such as :doc:`Buckingham `, -:doc:`Born-Mayer-Huggins ` and :doc:`ReaxFF `, two +:doc:`Born-Mayer-Huggins ` and :doc:`ReaxFF `, two atoms placed close to each other may have an arbitrary large, negative potential energy due to the functional form of the potential. While these unphysical configurations are inaccessible to typical dynamical diff --git a/doc/src/fix_qeq.rst b/doc/src/fix_qeq.rst index ccacea08db..113692da9b 100644 --- a/doc/src/fix_qeq.rst +++ b/doc/src/fix_qeq.rst @@ -32,7 +32,7 @@ Syntax * cutoff = global cutoff for charge-charge interactions (distance unit) * tolerance = precision to which charges will be equilibrated * maxiter = maximum iterations to perform charge equilibration -* qfile = a filename with QEq parameters or *coul/streitz* or *reax/c* +* qfile = a filename with QEq parameters or *coul/streitz* or *reaxff* * zero or more keyword/value pairs may be appended * keyword = *alpha* or *qdamp* or *qstep* or *warn* @@ -91,11 +91,11 @@ on the current atom configuration), then remove the fix via the The :doc:`fix qeq/comb ` command must still be used to perform charge equilibration with the :doc:`COMB potential - `. The :doc:`fix qeq/reax ` command can be + `. The :doc:`fix qeq/reaxff ` command can be used to perform charge equilibration with the :doc:`ReaxFF force - field `, although fix qeq/shielded yields the same - results as fix qeq/reax if *Nevery*\ , *cutoff*\ , and *tolerance* - are the same. Eventually the fix qeq/reax command will be + field `, although fix qeq/shielded yields the same + results as fix qeq/reaxff if *Nevery*\ , *cutoff*\ , and *tolerance* + are the same. Eventually the fix qeq/reaxff command will be deprecated. The QEq method minimizes the electrostatic energy of the system (or @@ -150,11 +150,11 @@ interaction between a pair of charged particles. Interaction through the shielded Coulomb is given by equation (13) of the :ref:`ReaxFF force field ` paper. The shielding accounts for charge overlap between charged particles at small separation. This style is the same -as :doc:`fix qeq/reax `, and can be used with -:doc:`pair_style reax/c `. Only the *chi*\ , *eta*\ , and +as :doc:`fix qeq/reaxff `, and can be used with +:doc:`pair_style reaxff `. Only the *chi*\ , *eta*\ , and *gamma* parameters from the *qfile* file are used. When using the string -*reax/c* as filename, these parameters are extracted directly from an -active *reax/c* pair style. This style solves partial charges on atoms +*reaxff* as filename, these parameters are extracted directly from an +active *reaxff* pair style. This style solves partial charges on atoms via the matrix inversion method. A tolerance of 1.0e-6 is usually a good number. @@ -235,7 +235,7 @@ The qeq fixes are not compatible with the GPU and USER-INTEL packages. Related commands """""""""""""""" -:doc:`fix qeq/reax `, :doc:`fix qeq/comb ` +:doc:`fix qeq/reaxff `, :doc:`fix qeq/comb ` Default """"""" diff --git a/doc/src/fix_qeq_comb.rst b/doc/src/fix_qeq_comb.rst index 74a97720dc..8eeea6c5b4 100644 --- a/doc/src/fix_qeq_comb.rst +++ b/doc/src/fix_qeq_comb.rst @@ -41,7 +41,7 @@ Perform charge equilibration (QeQ) in conjunction with the COMB equilibration portion of the calculation using the so-called QEq method, whereby the charge on each atom is adjusted to minimize the energy of the system. This fix can only be used with the COMB -potential; see the :doc:`fix qeq/reax ` command for a QeQ +potential; see the :doc:`fix qeq/reaxff ` command for a QeQ calculation that can be used with any potential. Only charges on the atoms in the specified group are equilibrated. diff --git a/doc/src/fix_qeq_reax.rst b/doc/src/fix_qeq_reaxff.rst similarity index 82% rename from doc/src/fix_qeq_reax.rst rename to doc/src/fix_qeq_reaxff.rst index 89fffcf2a3..96a20d4ca6 100644 --- a/doc/src/fix_qeq_reax.rst +++ b/doc/src/fix_qeq_reaxff.rst @@ -1,31 +1,31 @@ -.. index:: fix qeq/reax -.. index:: fix qeq/reax/kk -.. index:: fix qeq/reax/omp +.. index:: fix qeq/reaxff +.. index:: fix qeq/reaxff/kk +.. index:: fix qeq/reaxff/omp -fix qeq/reax command -==================== +fix qeq/reaxff command +====================== -Accelerator Variants: *qeq/reax/kk*, *qeq/reax/omp* +Accelerator Variants: *qeq/reaxff/kk*, *qeq/reaxff/omp* Syntax """""" .. parsed-literal:: - fix ID group-ID qeq/reax Nevery cutlo cuthi tolerance params args + fix ID group-ID qeq/reaxff Nevery cutlo cuthi tolerance params args * ID, group-ID are documented in :doc:`fix ` command -* qeq/reax = style name of this fix command +* qeq/reaxff = style name of this fix command * Nevery = perform QEq every this many steps * cutlo,cuthi = lo and hi cutoff for Taper radius * tolerance = precision to which charges will be equilibrated -* params = reax/c or a filename +* params = reaxff or a filename * one or more keywords or keyword/value pairs may be appended .. parsed-literal:: keyword = *dual* or *maxiter* or *nowarn* - *dual* = process S and T matrix in parallel (only for qeq/reax/omp) + *dual* = process S and T matrix in parallel (only for qeq/reaxff/omp) *maxiter* N = limit the number of iterations to *N* *nowarn* = do not print a warning message if the maximum number of iterations was reached @@ -34,8 +34,8 @@ Examples .. code-block:: LAMMPS - fix 1 all qeq/reax 1 0.0 10.0 1.0e-6 reax/c - fix 1 all qeq/reax 1 0.0 10.0 1.0e-6 param.qeq maxiter 500 + fix 1 all qeq/reaxff 1 0.0 10.0 1.0e-6 reaxff + fix 1 all qeq/reaxff 1 0.0 10.0 1.0e-6 param.qeq maxiter 500 Description """"""""""" @@ -43,19 +43,19 @@ Description Perform the charge equilibration (QEq) method as described in :ref:`(Rappe and Goddard) ` and formulated in :ref:`(Nakano) `. It is typically used in conjunction with the ReaxFF force -field model as implemented in the :doc:`pair_style reax/c ` +field model as implemented in the :doc:`pair_style reaxff ` command, but it can be used with any potential in LAMMPS, so long as it defines and uses charges on each atom. The :doc:`fix qeq/comb ` command should be used to perform charge equilibration with the :doc:`COMB potential `. For more technical details -about the charge equilibration performed by fix qeq/reax, see the +about the charge equilibration performed by fix qeq/reaxff, see the :ref:`(Aktulga) ` paper. The QEq method minimizes the electrostatic energy of the system by adjusting the partial charge on individual atoms based on interactions with their neighbors. It requires some parameters for each atom type. -If the *params* setting above is the word "reax/c", then these are -extracted from the :doc:`pair_style reax/c ` command and +If the *params* setting above is the word "reaxff", then these are +extracted from the :doc:`pair_style reaxff ` command and the ReaxFF force field file it reads in. If a file name is specified for *params*\ , then the parameters are taken from the specified file and the file must contain one line for each atom type. The latter @@ -76,7 +76,7 @@ of this fix are hard-coded to be A, eV, and electronic charge. The optional *dual* keyword allows to perform the optimization of the S and T matrices in parallel. This is only supported for -the *qeq/reax/omp* style. Otherwise they are processed separately. +the *qeq/reaxff/omp* style. Otherwise they are processed separately. The optional *maxiter* keyword allows changing the max number of iterations in the linear solver. The default value is 200. @@ -119,7 +119,7 @@ periodic cell dimensions less than 10 angstroms. Related commands """""""""""""""" -:doc:`pair_style reax/c ` +:doc:`pair_style reaxff `, :doc:`fix qeq/shielded ` Default """"""" diff --git a/doc/src/fix_reaxc_bonds.rst b/doc/src/fix_reaxff_bonds.rst similarity index 79% rename from doc/src/fix_reaxc_bonds.rst rename to doc/src/fix_reaxff_bonds.rst index 9207ee7a63..5dd4df7765 100644 --- a/doc/src/fix_reaxc_bonds.rst +++ b/doc/src/fix_reaxff_bonds.rst @@ -1,17 +1,17 @@ -.. index:: fix reax/c/bonds -.. index:: fix reax/c/bonds/kk +.. index:: fix reaxff/bonds +.. index:: fix reaxff/bonds/kk -fix reax/c/bonds command +fix reaxff/bonds command ======================== -Accelerator Variants: *reax/c/bonds/kk* +Accelerator Variants: *reaxff/bonds/kk* Syntax """""" .. parsed-literal:: - fix ID group-ID reaxc/bonds Nevery filename + fix ID group-ID reaxff/bonds Nevery filename * ID, group-ID are documented in :doc:`fix ` command * reax/bonds = style name of this fix command @@ -23,17 +23,17 @@ Examples .. code-block:: LAMMPS - fix 1 all reax/c/bonds 100 bonds.reaxc + fix 1 all reaxff/bonds 100 bonds.reaxff Description """"""""""" Write out the bond information computed by the ReaxFF potential specified -by :doc:`pair_style reax/c ` in the exact same format as the +by :doc:`pair_style reaxff ` in the exact same format as the original stand-alone ReaxFF code of Adri van Duin. The bond information is written to *filename* on timesteps that are multiples of *Nevery*\ , including timestep 0. For time-averaged chemical species analysis, -please see the :doc:`fix reaxc/c/species ` command. +please see the :doc:`fix reaxff/species ` command. The specified group-ID is ignored by this fix. @@ -76,7 +76,7 @@ the :doc:`run ` command. This fix is not invoked during :doc:`energy minim Restrictions """""""""""" -The fix reax/c/bonds command requires that the :doc:`pair_style reax/c ` is invoked. This fix is part of the +The fix reaxff/bonds command requires that the :doc:`pair_style reaxff ` is invoked. This fix is part of the REAXFF package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. @@ -87,7 +87,7 @@ To write gzipped bond files, you must compile LAMMPS with the Related commands """""""""""""""" -:doc:`pair_style reax/c `, :doc:`fix reax/c/species ` +:doc:`pair_style reaxff `, :doc:`fix reaxff/species ` Default """"""" diff --git a/doc/src/fix_reaxc_species.rst b/doc/src/fix_reaxff_species.rst similarity index 77% rename from doc/src/fix_reaxc_species.rst rename to doc/src/fix_reaxff_species.rst index bce140a9af..bca9c2c726 100644 --- a/doc/src/fix_reaxc_species.rst +++ b/doc/src/fix_reaxff_species.rst @@ -1,20 +1,20 @@ -.. index:: fix reax/c/species -.. index:: fix reax/c/species/kk +.. index:: fix reaxff/species +.. index:: fix reaxff/species/kk -fix reax/c/species command +fix reaxff/species command ========================== -Accelerator Variants: *reax/c/species/kk* +Accelerator Variants: *reaxff/species/kk* Syntax """""" .. parsed-literal:: - fix ID group-ID reax/c/species Nevery Nrepeat Nfreq filename keyword value ... + fix ID group-ID reaxff/species Nevery Nrepeat Nfreq filename keyword value ... * ID, group-ID are documented in :doc:`fix ` command -* reax/c/species = style name of this command +* reaxff/species = style name of this command * Nevery = sample bond-order every this many timesteps * Nrepeat = # of bond-order samples used for calculating averages * Nfreq = calculate average bond-order every this many timesteps @@ -37,15 +37,15 @@ Examples .. code-block:: LAMMPS - fix 1 all reax/c/species 10 10 100 species.out - fix 1 all reax/c/species 1 2 20 species.out cutoff 1 1 0.40 cutoff 1 2 0.55 - fix 1 all reax/c/species 1 100 100 species.out element Au O H position 1000 AuOH.pos + fix 1 all reaxff/species 10 10 100 species.out + fix 1 all reaxff/species 1 2 20 species.out cutoff 1 1 0.40 cutoff 1 2 0.55 + fix 1 all reaxff/species 1 100 100 species.out element Au O H position 1000 AuOH.pos Description """"""""""" Write out the chemical species information computed by the ReaxFF -potential specified by :doc:`pair_style reax/c `. +potential specified by :doc:`pair_style reaxff `. Bond-order values (either averaged or instantaneous, depending on value of *Nrepeat*\ ) are used to determine chemical bonds. Every *Nfreq* timesteps, chemical species information is written to @@ -73,7 +73,7 @@ symbol printed for each LAMMPS atom type. The number of symbols must match the number of LAMMPS atom types and each symbol must consist of 1 or 2 alphanumeric characters. Normally, these symbols should be chosen to match the chemical identity of each LAMMPS atom type, as -specified using the :doc:`reax/c pair_coeff ` command and +specified using the :doc:`reaxff pair_coeff ` command and the ReaxFF force field file. The optional keyword *position* writes center-of-mass positions of @@ -115,12 +115,12 @@ average bond-order for the species analysis output on timestep 100. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options -are relevant to this fix. +No information about this fix is written to :doc:`binary restart files `. +None of the :doc:`fix_modify ` options are relevant to this fix. -This fix computes both a global vector of length 2 and a per-atom -vector, either of which can be accessed by various :doc:`output commands `. The values in the global vector are -"intensive". +This fix computes both a global vector of length 2 and a per-atom vector, +either of which can be accessed by various :doc:`output commands `. +The values in the global vector are "intensive". The 2 values in the global vector are as follows: @@ -134,7 +134,8 @@ will be the same and will be equal to the smallest atom ID of any atom in the molecule. No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. +the :doc:`run ` command. +This fix is not invoked during :doc:`energy minimization `. ---------- @@ -145,26 +146,20 @@ the :doc:`run ` command. This fix is not invoked during :doc:`energy minim Restrictions """""""""""" -The "fix reax/c/species" currently only works with :doc:`pair_style reax/c ` and it requires that the :doc:`pair_style reax/c ` be invoked. This fix is part of the -REAXFF package. It is only enabled if LAMMPS was built with that -package. See the :doc:`Build package ` doc page for more -info. +The "fix reaxff/species" requires that :doc:`pair_style reaxff ` is used. +This fix is part of the REAXFF package. It is only enabled if LAMMPS was built with that +package. See the :doc:`Build package ` doc page for more info. -To write gzipped species files, you must compile LAMMPS with the --DLAMMPS_GZIP option. - -It should be possible to extend it to other reactive pair_styles (such as -:doc:`rebo `, :doc:`airebo `, -:doc:`comb `, and :doc:`bop `), but this has not yet been done. +To write gzipped species files, you must compile LAMMPS with the -DLAMMPS_GZIP option. Related commands """""""""""""""" -:doc:`pair_style reax/c `, :doc:`fix reax/c/bonds ` +:doc:`pair_style reaxff `, :doc:`fix reaxff/bonds ` Default """"""" -The default values for bond-order cutoffs are 0.3 for all I-J pairs. The -default element symbols are C, H, O, N. Position files are not written -by default. +The default values for bond-order cutoffs are 0.3 for all I-J pairs. +The default element symbols are C, H, O, N. +Position files are not written by default. diff --git a/doc/src/kim_commands.rst b/doc/src/kim_commands.rst index f116a70922..fc00a574d2 100644 --- a/doc/src/kim_commands.rst +++ b/doc/src/kim_commands.rst @@ -372,9 +372,9 @@ the *kim interactions* command executes the following LAMMPS input commands: .. code-block:: LAMMPS - pair_style reax/c lmp_control safezone 2.0 mincap 100 + pair_style reaxff lmp_control safezone 2.0 mincap 100 pair_coeff * * ffield.reax.rdx C H N O - fix reaxqeq all qeq/reax 1 0.0 10.0 1.0e-6 param.qeq + fix reaxqeq all qeq/reaxff 1 0.0 10.0 1.0e-6 param.qeq .. note:: diff --git a/doc/src/package.rst b/doc/src/package.rst index e997dc6147..54cf74f5be 100644 --- a/doc/src/package.rst +++ b/doc/src/package.rst @@ -448,7 +448,8 @@ does not require atomic operations in the calculation of pair forces. For that reason, *full* is the default setting for GPUs. However, when running on CPUs, a *half* neighbor list is the default because it are often faster, just as it is for non-accelerated pair styles. Similarly, -the *neigh/qeq* keyword determines how neighbor lists are built for :doc:`fix qeq/reax/kk `. +the *neigh/qeq* keyword determines how neighbor lists are built for +:doc:`fix qeq/reaxff/kk `. If the *neigh/thread* keyword is set to *off*\ , then the KOKKOS package threads only over atoms. However, for small systems, this may not expose diff --git a/doc/src/pair_reaxc.rst b/doc/src/pair_reaxff.rst similarity index 76% rename from doc/src/pair_reaxc.rst rename to doc/src/pair_reaxff.rst index 352bcb4847..0389742ea5 100644 --- a/doc/src/pair_reaxc.rst +++ b/doc/src/pair_reaxff.rst @@ -1,18 +1,18 @@ -.. index:: pair_style reax/c -.. index:: pair_style reax/c/kk -.. index:: pair_style reax/c/omp +.. index:: pair_style reaxff +.. index:: pair_style reaxff/kk +.. index:: pair_style reaxff/omp -pair_style reax/c command +pair_style reaxff command ========================= -Accelerator Variants: *reax/c/kk*, *reax/c/omp* +Accelerator Variants: *reaxff/kk*, *reaxff/omp* Syntax """""" .. code-block:: LAMMPS - pair_style reax/c cfile keyword value + pair_style reaxff cfile keyword value * cfile = NULL or name of a control file * zero or more keyword/value pairs may be appended @@ -20,7 +20,7 @@ Syntax .. parsed-literal:: keyword = *checkqeq* or *lgvdw* or *safezone* or *mincap* or *minhbonds* - *checkqeq* value = *yes* or *no* = whether or not to require qeq/reax fix + *checkqeq* value = *yes* or *no* = whether or not to require qeq/reaxff fix *enobonds* value = *yes* or *no* = whether or not to tally energy of atoms with no bonds *lgvdw* value = *yes* or *no* = whether or not to use a low gradient vdW correction *safezone* = factor used for array allocation @@ -32,37 +32,38 @@ Examples .. code-block:: LAMMPS - pair_style reax/c NULL - pair_style reax/c controlfile checkqeq no - pair_style reax/c NULL lgvdw yes - pair_style reax/c NULL safezone 1.6 mincap 100 + pair_style reaxff NULL + pair_style reaxff controlfile checkqeq no + pair_style reaxff NULL lgvdw yes + pair_style reaxff NULL safezone 1.6 mincap 100 pair_coeff * * ffield.reax C H O N Description """"""""""" -Style *reax/c* computes the ReaxFF potential of van Duin, Goddard and +Style *reaxff* computes the ReaxFF potential of van Duin, Goddard and co-workers. ReaxFF uses distance-dependent bond-order functions to represent the contributions of chemical bonding to the potential energy. There is more than one version of ReaxFF. The version implemented in LAMMPS uses the functional forms documented in the -supplemental information of the following paper: :ref:`(Chenoweth et al., 2008) `. The version integrated into LAMMPS matches -the most up-to-date version of ReaxFF as of summer 2010. For more -technical details about the pair reax/c implementation of ReaxFF, see -the :ref:`(Aktulga) ` paper. The *reax/c* style was initially -implemented as a stand-alone C code and is now integrated into LAMMPS -as a package. +supplemental information of the following paper: +:ref:`(Chenoweth et al., 2008) `. The version integrated +into LAMMPS matches the version of ReaxFF From Summer 2010. For more +technical details about the pair reaxff implementation of ReaxFF, see +the :ref:`(Aktulga) ` paper. The *reaxff* style was initially +implemented as a stand-alone C code and is now converted to C++ and +integrated into LAMMPS as a package. -The *reax/c/kk* style is a Kokkos version of the ReaxFF potential that -is derived from the *reax/c* style. The Kokkos version can run on GPUs +The *reaxff/kk* style is a Kokkos version of the ReaxFF potential that +is derived from the *reaxff* style. The Kokkos version can run on GPUs and can also use OpenMP multithreading. For more information about the Kokkos package, see :doc:`Packages details ` and :doc:`Speed kokkos ` doc pages. One important -consideration when using the *reax/c/kk* style is the choice of either +consideration when using the *reaxff/kk* style is the choice of either half or full neighbor lists. This setting can be changed using the Kokkos :doc:`package ` command. -The *reax/c* style differs from the (obsolete) "pair_style reax" +The *reaxff* style differs from the (obsolete) "pair_style reax" command in the implementation details. The *reax* style was a Fortran library, linked to LAMMPS. The *reax* style has been removed from LAMMPS after the 12 December 2018 version. @@ -73,7 +74,7 @@ documented in potentials/README.reax. The default ffield.reax contains parameterizations for the following elements: C, H, O, N. The format of these files is identical to that used originally by van -Duin. We have tested the accuracy of *pair_style reax/c* potential +Duin. We have tested the accuracy of *pair_style reaxff* potential against the original ReaxFF code for the systems mentioned above. You can use other ffield files for specific chemical systems that may be available elsewhere (but note that their accuracy may not have been @@ -102,10 +103,11 @@ control variable. The format of the control file is described below. The LAMMPS default values for the ReaxFF global parameters correspond to those used by Adri van Duin's stand-alone serial - code. If these are changed by setting control variables in the control - file, the results from LAMMPS and the serial code will not agree. + code. If these are changed by setting control variables in the + control file, the results from LAMMPS and the serial code will + not agree. -Examples using *pair_style reax/c* are provided in the examples/reax +Examples using *pair_style reaxff* are provided in the examples/reax sub-directory. Use of this pair style requires that a charge be defined for every @@ -115,25 +117,28 @@ charges. The ReaxFF parameter files provided were created using a charge equilibration (QEq) model for handling the electrostatic interactions. -Therefore, by default, LAMMPS requires that the :doc:`fix qeq/reax ` command be used with *pair_style reax/c* -when simulating a ReaxFF model, to equilibrate charge each timestep. -Using the keyword *checkqeq* with the value *no* -turns off the check for *fix qeq/reax*\ , -allowing a simulation to be run without charge equilibration. -In this case, the static charges you -assign to each atom will be used for computing the electrostatic -interactions in the system. -See the :doc:`fix qeq/reax ` command for details. +Therefore, by default, LAMMPS requires that either the +:doc:`fix qeq/reaxff ` or the +:doc:`fix qeq/shielded ` command be used with +*pair_style reaxff* when simulating a ReaxFF model, to equilibrate +the charges each timestep. + +Using the keyword *checkqeq* with the value *no* turns off the check +for the QEq fixes, allowing a simulation to be run without charge +equilibration. In this case, the static charges you assign to each +atom will be used for computing the electrostatic interactions in +the system. See the :doc:`fix qeq/reaxff ` or +:doc:`fix qeq/shielded ` command documentation for more details. Using the optional keyword *lgvdw* with the value *yes* turns on the -low-gradient correction of the ReaxFF/C for long-range London -Dispersion, as described in the :ref:`(Liu) ` paper. Force field -file *ffield.reax.lg* is designed for this correction, and is trained -for several energetic materials (see "Liu"). When using lg-correction, -recommended value for parameter *thb* is 0.01, which can be set in the +low-gradient correction of ReaxFF for long-range London Dispersion, +as described in the :ref:`(Liu) ` paper. The bundled force +field file *ffield.reax.lg* is designed for this correction, and is +trained for several energetic materials (see "Liu"). When using *lgvdw yes*, +the recommended value for parameter *thb* is 0.01, which can be set in the control file. Note: Force field files are different for the original -or lg corrected pair styles, using wrong ffield file generates an -error message. +or lg corrected pair styles, using the wrong ffield file generates an +error. Using the optional keyword *enobonds* with the value *yes*\ , the energy of atoms with no bonds (i.e. isolated atoms) is included in the total @@ -144,7 +149,7 @@ discontinuities in the potential energy when the bonding of an atom drops to zero. Optional keywords *safezone*\ , *mincap*\ , and *minhbonds* are used -for allocating reax/c arrays. Increasing these values can avoid memory +for allocating reaxff arrays. Increasing these values can avoid memory problems, such as segmentation faults and bondchk failed errors, that could occur under certain conditions. These keywords are not used by the Kokkos version, which instead uses a more robust memory allocation @@ -158,7 +163,8 @@ equilibration contributions which are stored in the thermo variable :doc:`thermo ` command. This pair style tallies a breakdown of the total ReaxFF potential -energy into sub-categories, which can be accessed via the :doc:`compute pair ` command as a vector of values of length 14. +energy into sub-categories, which can be accessed via the +:doc:`compute pair ` command as a vector of values of length 14. The 14 values correspond to the following sub-categories (the variable names in italics match those used in the original FORTRAN ReaxFF code): @@ -183,14 +189,14 @@ headings) the following commands could be included in an input script: .. code-block:: LAMMPS - compute reax all pair reax/c + compute reax all pair reaxff variable eb equal c_reax[1] variable ea equal c_reax[2] [...] variable eqeq equal c_reax[14] thermo_style custom step temp epair v_eb v_ea [...] v_eqeq -Only a single pair_coeff command is used with the *reax/c* style which +Only a single pair_coeff command is used with the *reaxff* style which specifies a ReaxFF potential file with parameters for all needed elements. These are mapped to LAMMPS atom types by specifying N additional arguments after the filename in the pair_coeff command, @@ -209,7 +215,7 @@ to M. Each of the N indices you specify for the N atom types of LAMMPS atoms must be an integer from 1 to M. Atoms with LAMMPS type 1 will be mapped to whatever element you specify as the first index value, etc. If a mapping value is specified as NULL, the mapping is not -performed. This can be used when the *reax/c* style is used as part +performed. This can be used when the *reaxff* style is used as part of the *hybrid* pair style. The NULL values are placeholders for atom types that will be used with other potentials. @@ -241,7 +247,7 @@ brief description of their use and default values. *simulation_name* - Output files produced by *pair_style reax/c* carry + Output files produced by *pair_style reaxff* carry this name + extensions specific to their contents. Partial energies are reported with a ".pot" extension, while the trajectory file has ".trj" extension. @@ -286,8 +292,7 @@ brief description of their use and default values. to be considered in three body interactions. (default value = 0.00001) *write_freq* - Frequency of writes into the trajectory file. (default - value = 0) + Frequency of writes into the trajectory file. (default value = 0) *traj_title* Title of the trajectory - not the name of the trajectory file. @@ -315,7 +320,8 @@ Mixing, shift, table, tail correction, restart, rRESPA info This pair style does not support the :doc:`pair_modify ` mix, shift, table, and tail options. -This pair style does not write its information to :doc:`binary restart files `, since it is stored in potential files. Thus, you +This pair style does not write its information to :doc:`binary restart files `, +since it is stored in potential files. Thus, you need to re-specify the pair_style and pair_coeff commands in an input script that reads a restart file. @@ -333,18 +339,20 @@ Restrictions """""""""""" This pair style is part of the REAXFF package. It is only enabled -if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. +if LAMMPS was built with that package. +See the :doc:`Build package ` doc page for more info. The ReaxFF potential files provided with LAMMPS in the potentials -directory are parameterized for real :doc:`units `. You can use -the ReaxFF potential with any LAMMPS units, but you would need to +directory are parameterized for *real* :doc:`units `. You can use +the ReaxFF pair style with any LAMMPS units, but you would need to create your own potential file with coefficients listed in the appropriate units if your simulation does not use "real" units. Related commands """""""""""""""" -:doc:`pair_coeff `, :doc:`fix qeq/reax `, :doc:`fix reax/c/bonds `, :doc:`fix reax/c/species ` +:doc:`pair_coeff `, :doc:`fix qeq/reaxff `, +:doc:`fix reaxff/bonds `, :doc:`fix reaxff/species ` Default """"""" diff --git a/doc/src/pair_style.rst b/doc/src/pair_style.rst index f0497cb931..50f49c87c9 100644 --- a/doc/src/pair_style.rst +++ b/doc/src/pair_style.rst @@ -299,7 +299,7 @@ accelerated styles exist. * :doc:`python ` - * :doc:`quip ` - * :doc:`rann ` - -* :doc:`reax/c ` - ReaxFF potential in C +* :doc:`reaxff ` - ReaxFF potential * :doc:`rebo ` - second generation REBO potential of Brenner * :doc:`resquared ` - Everaers RE-Squared ellipsoidal potential * :doc:`sdpd/taitwater/isothermal ` - smoothed dissipative particle dynamics for water at isothermal conditions diff --git a/doc/utils/check-styles.py b/doc/utils/check-styles.py index 16a7cf2a5c..6c1fd6dd35 100755 --- a/doc/utils/check-styles.py +++ b/doc/utils/check-styles.py @@ -254,40 +254,27 @@ for command_type, entries in index.items(): print("Total number of style index entries:", total_index) +skip_fix = ('python', 'NEIGH_HISTORY/omp','qeq/reax','reax/c/bonds','reax/c/species') +skip_pair = ('meam/c','lj/sf','reax/c') + counter = 0 -counter += check_style('Commands_all.rst', doc_dir, ":doc:`(.+) <.+>`", - command,'Command',suffix=False) -counter += check_style('Commands_compute.rst', doc_dir, ":doc:`(.+) `", - compute,'Compute',suffix=True) -counter += check_style('compute.rst', doc_dir, ":doc:`(.+) ` -", - compute,'Compute',suffix=False) -counter += check_style('Commands_fix.rst', doc_dir, ":doc:`(.+) `", - fix,'Fix',skip=('python', 'NEIGH_HISTORY/omp'),suffix=True) -counter += check_style('fix.rst', doc_dir, ":doc:`(.+) ` -", - fix,'Fix',skip=('python', 'NEIGH_HISTORY/omp'),suffix=False) -counter += check_style('Commands_pair.rst', doc_dir, ":doc:`(.+) `", - pair,'Pair',skip=('meam/c','lj/sf'),suffix=True) -counter += check_style('pair_style.rst', doc_dir, ":doc:`(.+) ` -", - pair,'Pair',skip=('meam/c','lj/sf'),suffix=False) -counter += check_style('Commands_bond.rst', doc_dir, ":doc:`(.+) `", - bond,'Bond',suffix=True) -counter += check_style('bond_style.rst', doc_dir, ":doc:`(.+) ` -", - bond,'Bond',suffix=False) -counter += check_style('Commands_bond.rst', doc_dir, ":doc:`(.+) `", - angle,'Angle',suffix=True) -counter += check_style('angle_style.rst', doc_dir, ":doc:`(.+) ` -", - angle,'Angle',suffix=False) -counter += check_style('Commands_bond.rst', doc_dir, ":doc:`(.+) `", - dihedral,'Dihedral',suffix=True) -counter += check_style('dihedral_style.rst', doc_dir, ":doc:`(.+) ` -", - dihedral,'Dihedral',suffix=False) -counter += check_style('Commands_bond.rst', doc_dir, ":doc:`(.+) `", - improper,'Improper',suffix=True) -counter += check_style('improper_style.rst', doc_dir, ":doc:`(.+) ` -", - improper,'Improper',suffix=False) -counter += check_style('Commands_kspace.rst', doc_dir, ":doc:`(.+) `", - kspace,'KSpace',suffix=True) +counter += check_style('Commands_all.rst', doc_dir, ":doc:`(.+) <.+>`",command,'Command',suffix=False) +counter += check_style('Commands_compute.rst', doc_dir, ":doc:`(.+) `",compute,'Compute',suffix=True) +counter += check_style('compute.rst', doc_dir, ":doc:`(.+) ` -",compute,'Compute',suffix=False) +counter += check_style('Commands_fix.rst', doc_dir, ":doc:`(.+) `",fix,'Fix',skip=skip_fix,suffix=True) +counter += check_style('fix.rst', doc_dir, ":doc:`(.+) ` -",fix,'Fix',skip=skip_fix,suffix=False) +counter += check_style('Commands_pair.rst', doc_dir, ":doc:`(.+) `",pair,'Pair',skip=skip_pair,suffix=True) +counter += check_style('pair_style.rst', doc_dir, ":doc:`(.+) ` -",pair,'Pair',skip=skip_pair,suffix=False) +counter += check_style('Commands_bond.rst', doc_dir, ":doc:`(.+) `",bond,'Bond',suffix=True) +counter += check_style('bond_style.rst', doc_dir, ":doc:`(.+) ` -",bond,'Bond',suffix=False) +counter += check_style('Commands_bond.rst', doc_dir, ":doc:`(.+) `",angle,'Angle',suffix=True) +counter += check_style('angle_style.rst', doc_dir, ":doc:`(.+) ` -",angle,'Angle',suffix=False) +counter += check_style('Commands_bond.rst', doc_dir, ":doc:`(.+) `",dihedral,'Dihedral',suffix=True) +counter += check_style('dihedral_style.rst', doc_dir, ":doc:`(.+) ` -",dihedral,'Dihedral',suffix=False) +counter += check_style('Commands_bond.rst', doc_dir, ":doc:`(.+) `",improper,'Improper',suffix=True) +counter += check_style('improper_style.rst', doc_dir, ":doc:`(.+) ` -",improper,'Improper',suffix=False) +counter += check_style('Commands_kspace.rst', doc_dir, ":doc:`(.+) `",kspace,'KSpace',suffix=True) if counter: print(f"Found {counter} issue(s) with style lists") @@ -295,13 +282,13 @@ if counter: counter = 0 counter += check_style_index("compute", compute, index["compute"]) -counter += check_style_index("fix", fix, index["fix"], skip=['python']) +counter += check_style_index("fix", fix, index["fix"], skip=['python','qeq/reax','reax/c/bonds','reax/c/species']) counter += check_style_index("angle_style", angle, index["angle_style"]) counter += check_style_index("bond_style", bond, index["bond_style"]) counter += check_style_index("dihedral_style", dihedral, index["dihedral_style"]) counter += check_style_index("improper_style", improper, index["improper_style"]) counter += check_style_index("kspace_style", kspace, index["kspace_style"]) -counter += check_style_index("pair_style", pair, index["pair_style"], skip=['meam/c', 'lj/sf']) +counter += check_style_index("pair_style", pair, index["pair_style"], skip=['meam/c', 'lj/sf','reax/c']) if counter: print(f"Found {counter} issue(s) with style index") diff --git a/examples/README b/examples/README index 4f4f671a29..68825a7dbd 100644 --- a/examples/README +++ b/examples/README @@ -103,7 +103,7 @@ pour: pouring of granular particles into a 3d box, then chute flow prd: parallel replica dynamics of vacancy diffusion in bulk Si python: use of PYTHON package to invoke Python code from input script qeq: use of QEQ package for charge equilibration -reax: RDX and TATB and several other models using ReaxFF +reaxff: RDX and TATB and several other models using ReaxFF rerun: use of rerun and read_dump commands rigid: rigid bodies modeled as independent or coupled shear: sideways shear applied to 2d solid, with and without a void diff --git a/examples/reax/AB/README b/examples/reaxff/AB/README similarity index 100% rename from examples/reax/AB/README rename to examples/reaxff/AB/README diff --git a/examples/reax/AB/data.AB b/examples/reaxff/AB/data.AB similarity index 100% rename from examples/reax/AB/data.AB rename to examples/reaxff/AB/data.AB diff --git a/examples/reax/AB/ffield.reax.AB b/examples/reaxff/AB/ffield.reax.AB similarity index 100% rename from examples/reax/AB/ffield.reax.AB rename to examples/reaxff/AB/ffield.reax.AB diff --git a/examples/reax/AB/in.AB b/examples/reaxff/AB/in.AB similarity index 100% rename from examples/reax/AB/in.AB rename to examples/reaxff/AB/in.AB diff --git a/examples/reax/AB/lmp_control b/examples/reaxff/AB/lmp_control similarity index 100% rename from examples/reax/AB/lmp_control rename to examples/reaxff/AB/lmp_control diff --git a/examples/reax/AB/log.8Mar18.AB.g++.1 b/examples/reaxff/AB/log.8Mar18.AB.g++.1 similarity index 100% rename from examples/reax/AB/log.8Mar18.AB.g++.1 rename to examples/reaxff/AB/log.8Mar18.AB.g++.1 diff --git a/examples/reax/AB/log.8Mar18.AB.g++.4 b/examples/reaxff/AB/log.8Mar18.AB.g++.4 similarity index 100% rename from examples/reax/AB/log.8Mar18.AB.g++.4 rename to examples/reaxff/AB/log.8Mar18.AB.g++.4 diff --git a/examples/reax/AB/param.qeq b/examples/reaxff/AB/param.qeq similarity index 100% rename from examples/reax/AB/param.qeq rename to examples/reaxff/AB/param.qeq diff --git a/examples/reax/AuO/README b/examples/reaxff/AuO/README similarity index 100% rename from examples/reax/AuO/README rename to examples/reaxff/AuO/README diff --git a/examples/reax/AuO/data.AuO b/examples/reaxff/AuO/data.AuO similarity index 100% rename from examples/reax/AuO/data.AuO rename to examples/reaxff/AuO/data.AuO diff --git a/examples/reax/AuO/ffield.reax.AuO b/examples/reaxff/AuO/ffield.reax.AuO similarity index 100% rename from examples/reax/AuO/ffield.reax.AuO rename to examples/reaxff/AuO/ffield.reax.AuO diff --git a/examples/reax/AuO/in.AuO b/examples/reaxff/AuO/in.AuO similarity index 100% rename from examples/reax/AuO/in.AuO rename to examples/reaxff/AuO/in.AuO diff --git a/examples/reax/AuO/lmp_control b/examples/reaxff/AuO/lmp_control similarity index 100% rename from examples/reax/AuO/lmp_control rename to examples/reaxff/AuO/lmp_control diff --git a/examples/reax/AuO/log.8Mar18.AuO.g++.1 b/examples/reaxff/AuO/log.8Mar18.AuO.g++.1 similarity index 100% rename from examples/reax/AuO/log.8Mar18.AuO.g++.1 rename to examples/reaxff/AuO/log.8Mar18.AuO.g++.1 diff --git a/examples/reax/AuO/log.8Mar18.AuO.g++.4 b/examples/reaxff/AuO/log.8Mar18.AuO.g++.4 similarity index 100% rename from examples/reax/AuO/log.8Mar18.AuO.g++.4 rename to examples/reaxff/AuO/log.8Mar18.AuO.g++.4 diff --git a/examples/reax/AuO/param.qeq b/examples/reaxff/AuO/param.qeq similarity index 100% rename from examples/reax/AuO/param.qeq rename to examples/reaxff/AuO/param.qeq diff --git a/examples/reax/CHO/README b/examples/reaxff/CHO/README similarity index 100% rename from examples/reax/CHO/README rename to examples/reaxff/CHO/README diff --git a/examples/reax/CHO/data.CHO b/examples/reaxff/CHO/data.CHO similarity index 100% rename from examples/reax/CHO/data.CHO rename to examples/reaxff/CHO/data.CHO diff --git a/examples/reax/CHO/ffield.reax.cho b/examples/reaxff/CHO/ffield.reax.cho similarity index 100% rename from examples/reax/CHO/ffield.reax.cho rename to examples/reaxff/CHO/ffield.reax.cho diff --git a/examples/reax/CHO/in.CHO b/examples/reaxff/CHO/in.CHO similarity index 100% rename from examples/reax/CHO/in.CHO rename to examples/reaxff/CHO/in.CHO diff --git a/examples/reax/CHO/lmp_control b/examples/reaxff/CHO/lmp_control similarity index 100% rename from examples/reax/CHO/lmp_control rename to examples/reaxff/CHO/lmp_control diff --git a/examples/reax/CHO/log.8Mar18.CHO.g++.1 b/examples/reaxff/CHO/log.8Mar18.CHO.g++.1 similarity index 100% rename from examples/reax/CHO/log.8Mar18.CHO.g++.1 rename to examples/reaxff/CHO/log.8Mar18.CHO.g++.1 diff --git a/examples/reax/CHO/log.8Mar18.CHO.g++.4 b/examples/reaxff/CHO/log.8Mar18.CHO.g++.4 similarity index 100% rename from examples/reax/CHO/log.8Mar18.CHO.g++.4 rename to examples/reaxff/CHO/log.8Mar18.CHO.g++.4 diff --git a/examples/reax/CHO/param.qeq b/examples/reaxff/CHO/param.qeq similarity index 100% rename from examples/reax/CHO/param.qeq rename to examples/reaxff/CHO/param.qeq diff --git a/examples/reax/FC/README b/examples/reaxff/FC/README similarity index 100% rename from examples/reax/FC/README rename to examples/reaxff/FC/README diff --git a/examples/reax/FC/data.FC b/examples/reaxff/FC/data.FC similarity index 100% rename from examples/reax/FC/data.FC rename to examples/reaxff/FC/data.FC diff --git a/examples/reax/FC/ffield.reax.FC b/examples/reaxff/FC/ffield.reax.FC similarity index 100% rename from examples/reax/FC/ffield.reax.FC rename to examples/reaxff/FC/ffield.reax.FC diff --git a/examples/reax/FC/in.FC b/examples/reaxff/FC/in.FC similarity index 100% rename from examples/reax/FC/in.FC rename to examples/reaxff/FC/in.FC diff --git a/examples/reax/FC/log.8Mar18.FC.g++.1 b/examples/reaxff/FC/log.8Mar18.FC.g++.1 similarity index 100% rename from examples/reax/FC/log.8Mar18.FC.g++.1 rename to examples/reaxff/FC/log.8Mar18.FC.g++.1 diff --git a/examples/reax/FC/log.8Mar18.FC.g++.4 b/examples/reaxff/FC/log.8Mar18.FC.g++.4 similarity index 100% rename from examples/reax/FC/log.8Mar18.FC.g++.4 rename to examples/reaxff/FC/log.8Mar18.FC.g++.4 diff --git a/examples/reax/FeOH3/README b/examples/reaxff/FeOH3/README similarity index 100% rename from examples/reax/FeOH3/README rename to examples/reaxff/FeOH3/README diff --git a/examples/reax/FeOH3/data.FeOH3 b/examples/reaxff/FeOH3/data.FeOH3 similarity index 100% rename from examples/reax/FeOH3/data.FeOH3 rename to examples/reaxff/FeOH3/data.FeOH3 diff --git a/examples/reax/FeOH3/ffield.reax.Fe_O_C_H b/examples/reaxff/FeOH3/ffield.reax.Fe_O_C_H similarity index 100% rename from examples/reax/FeOH3/ffield.reax.Fe_O_C_H rename to examples/reaxff/FeOH3/ffield.reax.Fe_O_C_H diff --git a/examples/reax/FeOH3/in.FeOH3 b/examples/reaxff/FeOH3/in.FeOH3 similarity index 100% rename from examples/reax/FeOH3/in.FeOH3 rename to examples/reaxff/FeOH3/in.FeOH3 diff --git a/examples/reax/FeOH3/lmp_control b/examples/reaxff/FeOH3/lmp_control similarity index 100% rename from examples/reax/FeOH3/lmp_control rename to examples/reaxff/FeOH3/lmp_control diff --git a/examples/reax/FeOH3/log.5Oct16.FeOH3.g++.1 b/examples/reaxff/FeOH3/log.5Oct16.FeOH3.g++.1 similarity index 100% rename from examples/reax/FeOH3/log.5Oct16.FeOH3.g++.1 rename to examples/reaxff/FeOH3/log.5Oct16.FeOH3.g++.1 diff --git a/examples/reax/FeOH3/log.5Oct16.FeOH3.g++.4 b/examples/reaxff/FeOH3/log.5Oct16.FeOH3.g++.4 similarity index 100% rename from examples/reax/FeOH3/log.5Oct16.FeOH3.g++.4 rename to examples/reaxff/FeOH3/log.5Oct16.FeOH3.g++.4 diff --git a/examples/reax/FeOH3/param.qeq b/examples/reaxff/FeOH3/param.qeq similarity index 100% rename from examples/reax/FeOH3/param.qeq rename to examples/reaxff/FeOH3/param.qeq diff --git a/examples/reax/HNS/README.txt b/examples/reaxff/HNS/README.txt similarity index 100% rename from examples/reax/HNS/README.txt rename to examples/reaxff/HNS/README.txt diff --git a/examples/reax/HNS/data.hns-equil b/examples/reaxff/HNS/data.hns-equil similarity index 100% rename from examples/reax/HNS/data.hns-equil rename to examples/reaxff/HNS/data.hns-equil diff --git a/examples/reax/HNS/ffield.reax.hns b/examples/reaxff/HNS/ffield.reax.hns similarity index 100% rename from examples/reax/HNS/ffield.reax.hns rename to examples/reaxff/HNS/ffield.reax.hns diff --git a/examples/reax/HNS/in.reaxc.hns b/examples/reaxff/HNS/in.reaxc.hns similarity index 100% rename from examples/reax/HNS/in.reaxc.hns rename to examples/reaxff/HNS/in.reaxc.hns diff --git a/examples/reax/HNS/log.8Mar18.reaxc.hns.g++.1 b/examples/reaxff/HNS/log.8Mar18.reaxc.hns.g++.1 similarity index 100% rename from examples/reax/HNS/log.8Mar18.reaxc.hns.g++.1 rename to examples/reaxff/HNS/log.8Mar18.reaxc.hns.g++.1 diff --git a/examples/reax/HNS/log.8Mar18.reaxc.hns.g++.4 b/examples/reaxff/HNS/log.8Mar18.reaxc.hns.g++.4 similarity index 100% rename from examples/reax/HNS/log.8Mar18.reaxc.hns.g++.4 rename to examples/reaxff/HNS/log.8Mar18.reaxc.hns.g++.4 diff --git a/examples/reax/RDX/README b/examples/reaxff/RDX/README similarity index 100% rename from examples/reax/RDX/README rename to examples/reaxff/RDX/README diff --git a/examples/reax/RDX/data.RDX b/examples/reaxff/RDX/data.RDX similarity index 100% rename from examples/reax/RDX/data.RDX rename to examples/reaxff/RDX/data.RDX diff --git a/examples/reax/RDX/ffield.reax.rdx b/examples/reaxff/RDX/ffield.reax.rdx similarity index 100% rename from examples/reax/RDX/ffield.reax.rdx rename to examples/reaxff/RDX/ffield.reax.rdx diff --git a/examples/reax/RDX/in.RDX b/examples/reaxff/RDX/in.RDX similarity index 100% rename from examples/reax/RDX/in.RDX rename to examples/reaxff/RDX/in.RDX diff --git a/examples/reax/RDX/lmp_control b/examples/reaxff/RDX/lmp_control similarity index 100% rename from examples/reax/RDX/lmp_control rename to examples/reaxff/RDX/lmp_control diff --git a/examples/reax/RDX/log.8Mar18.RDX.g++.1 b/examples/reaxff/RDX/log.8Mar18.RDX.g++.1 similarity index 100% rename from examples/reax/RDX/log.8Mar18.RDX.g++.1 rename to examples/reaxff/RDX/log.8Mar18.RDX.g++.1 diff --git a/examples/reax/RDX/log.8Mar18.RDX.g++.4 b/examples/reaxff/RDX/log.8Mar18.RDX.g++.4 similarity index 100% rename from examples/reax/RDX/log.8Mar18.RDX.g++.4 rename to examples/reaxff/RDX/log.8Mar18.RDX.g++.4 diff --git a/examples/reax/RDX/param.qeq b/examples/reaxff/RDX/param.qeq similarity index 100% rename from examples/reax/RDX/param.qeq rename to examples/reaxff/RDX/param.qeq diff --git a/examples/reax/README b/examples/reaxff/README similarity index 100% rename from examples/reax/README rename to examples/reaxff/README diff --git a/examples/reax/VOH/README b/examples/reaxff/VOH/README similarity index 100% rename from examples/reax/VOH/README rename to examples/reaxff/VOH/README diff --git a/examples/reax/VOH/data.VOH b/examples/reaxff/VOH/data.VOH similarity index 100% rename from examples/reax/VOH/data.VOH rename to examples/reaxff/VOH/data.VOH diff --git a/examples/reax/VOH/ffield.reax.V_O_C_H b/examples/reaxff/VOH/ffield.reax.V_O_C_H similarity index 100% rename from examples/reax/VOH/ffield.reax.V_O_C_H rename to examples/reaxff/VOH/ffield.reax.V_O_C_H diff --git a/examples/reax/VOH/in.VOH b/examples/reaxff/VOH/in.VOH similarity index 100% rename from examples/reax/VOH/in.VOH rename to examples/reaxff/VOH/in.VOH diff --git a/examples/reax/VOH/lmp_control b/examples/reaxff/VOH/lmp_control similarity index 100% rename from examples/reax/VOH/lmp_control rename to examples/reaxff/VOH/lmp_control diff --git a/examples/reax/VOH/log.8Mar18.VOH.g++.1 b/examples/reaxff/VOH/log.8Mar18.VOH.g++.1 similarity index 100% rename from examples/reax/VOH/log.8Mar18.VOH.g++.1 rename to examples/reaxff/VOH/log.8Mar18.VOH.g++.1 diff --git a/examples/reax/VOH/log.8Mar18.VOH.g++.4 b/examples/reaxff/VOH/log.8Mar18.VOH.g++.4 similarity index 100% rename from examples/reax/VOH/log.8Mar18.VOH.g++.4 rename to examples/reaxff/VOH/log.8Mar18.VOH.g++.4 diff --git a/examples/reax/VOH/param.qeq b/examples/reaxff/VOH/param.qeq similarity index 100% rename from examples/reax/VOH/param.qeq rename to examples/reaxff/VOH/param.qeq diff --git a/examples/reax/ZnOH2/README b/examples/reaxff/ZnOH2/README similarity index 100% rename from examples/reax/ZnOH2/README rename to examples/reaxff/ZnOH2/README diff --git a/examples/reax/ZnOH2/data.ZnOH2 b/examples/reaxff/ZnOH2/data.ZnOH2 similarity index 100% rename from examples/reax/ZnOH2/data.ZnOH2 rename to examples/reaxff/ZnOH2/data.ZnOH2 diff --git a/examples/reax/ZnOH2/ffield.reax.ZnOH b/examples/reaxff/ZnOH2/ffield.reax.ZnOH similarity index 100% rename from examples/reax/ZnOH2/ffield.reax.ZnOH rename to examples/reaxff/ZnOH2/ffield.reax.ZnOH diff --git a/examples/reax/ZnOH2/in.ZnOH2 b/examples/reaxff/ZnOH2/in.ZnOH2 similarity index 100% rename from examples/reax/ZnOH2/in.ZnOH2 rename to examples/reaxff/ZnOH2/in.ZnOH2 diff --git a/examples/reax/ZnOH2/lmp_control b/examples/reaxff/ZnOH2/lmp_control similarity index 100% rename from examples/reax/ZnOH2/lmp_control rename to examples/reaxff/ZnOH2/lmp_control diff --git a/examples/reax/ZnOH2/log.8Mar18.ZnOH2.g++.1 b/examples/reaxff/ZnOH2/log.8Mar18.ZnOH2.g++.1 similarity index 100% rename from examples/reax/ZnOH2/log.8Mar18.ZnOH2.g++.1 rename to examples/reaxff/ZnOH2/log.8Mar18.ZnOH2.g++.1 diff --git a/examples/reax/ZnOH2/log.8Mar18.ZnOH2.g++.4 b/examples/reaxff/ZnOH2/log.8Mar18.ZnOH2.g++.4 similarity index 100% rename from examples/reax/ZnOH2/log.8Mar18.ZnOH2.g++.4 rename to examples/reaxff/ZnOH2/log.8Mar18.ZnOH2.g++.4 diff --git a/examples/reax/ZnOH2/param.qeq b/examples/reaxff/ZnOH2/param.qeq similarity index 100% rename from examples/reax/ZnOH2/param.qeq rename to examples/reaxff/ZnOH2/param.qeq diff --git a/examples/reax/ci-reaxFF/CH4.dat b/examples/reaxff/ci-reaxFF/CH4.dat similarity index 100% rename from examples/reax/ci-reaxFF/CH4.dat rename to examples/reaxff/ci-reaxFF/CH4.dat diff --git a/examples/reax/ci-reaxFF/ci-reaxFF_ZBL.dat b/examples/reaxff/ci-reaxFF/ci-reaxFF_ZBL.dat similarity index 100% rename from examples/reax/ci-reaxFF/ci-reaxFF_ZBL.dat rename to examples/reaxff/ci-reaxFF/ci-reaxFF_ZBL.dat diff --git a/examples/reax/ci-reaxFF/control b/examples/reaxff/ci-reaxFF/control similarity index 100% rename from examples/reax/ci-reaxFF/control rename to examples/reaxff/ci-reaxFF/control diff --git a/examples/reax/ci-reaxFF/ffield.ci-reax.CH b/examples/reaxff/ci-reaxFF/ffield.ci-reax.CH similarity index 100% rename from examples/reax/ci-reaxFF/ffield.ci-reax.CH rename to examples/reaxff/ci-reaxFF/ffield.ci-reax.CH diff --git a/examples/reax/ci-reaxFF/in.ci-reax.CH b/examples/reaxff/ci-reaxFF/in.ci-reax.CH similarity index 100% rename from examples/reax/ci-reaxFF/in.ci-reax.CH rename to examples/reaxff/ci-reaxFF/in.ci-reax.CH diff --git a/examples/reax/ci-reaxFF/log.8Mar18.ci-reax.CH.g++.1 b/examples/reaxff/ci-reaxFF/log.8Mar18.ci-reax.CH.g++.1 similarity index 100% rename from examples/reax/ci-reaxFF/log.8Mar18.ci-reax.CH.g++.1 rename to examples/reaxff/ci-reaxFF/log.8Mar18.ci-reax.CH.g++.1 diff --git a/examples/reax/ci-reaxFF/log.8Mar18.ci-reax.CH.g++.4 b/examples/reaxff/ci-reaxFF/log.8Mar18.ci-reax.CH.g++.4 similarity index 100% rename from examples/reax/ci-reaxFF/log.8Mar18.ci-reax.CH.g++.4 rename to examples/reaxff/ci-reaxFF/log.8Mar18.ci-reax.CH.g++.4 diff --git a/examples/reax/control.reax_c.rdx b/examples/reaxff/control.reax_c.rdx similarity index 100% rename from examples/reax/control.reax_c.rdx rename to examples/reaxff/control.reax_c.rdx diff --git a/examples/reax/control.reax_c.tatb b/examples/reaxff/control.reax_c.tatb similarity index 100% rename from examples/reax/control.reax_c.tatb rename to examples/reaxff/control.reax_c.tatb diff --git a/examples/reax/data.rdx b/examples/reaxff/data.rdx similarity index 100% rename from examples/reax/data.rdx rename to examples/reaxff/data.rdx diff --git a/examples/reax/data.tatb b/examples/reaxff/data.tatb similarity index 100% rename from examples/reax/data.tatb rename to examples/reaxff/data.tatb diff --git a/examples/reax/ffield.reax b/examples/reaxff/ffield.reax similarity index 100% rename from examples/reax/ffield.reax rename to examples/reaxff/ffield.reax diff --git a/examples/reax/in.reaxc.rdx b/examples/reaxff/in.reaxc.rdx similarity index 100% rename from examples/reax/in.reaxc.rdx rename to examples/reaxff/in.reaxc.rdx diff --git a/examples/reax/in.reaxc.rdx-shielded b/examples/reaxff/in.reaxc.rdx-shielded similarity index 100% rename from examples/reax/in.reaxc.rdx-shielded rename to examples/reaxff/in.reaxc.rdx-shielded diff --git a/examples/reax/in.reaxc.tatb b/examples/reaxff/in.reaxc.tatb similarity index 100% rename from examples/reax/in.reaxc.tatb rename to examples/reaxff/in.reaxc.tatb diff --git a/examples/reax/in.reaxc.tatb-shielded b/examples/reaxff/in.reaxc.tatb-shielded similarity index 100% rename from examples/reax/in.reaxc.tatb-shielded rename to examples/reaxff/in.reaxc.tatb-shielded diff --git a/examples/reax/log.21Apr21.reaxc.rdx-shielded.g++.1 b/examples/reaxff/log.21Apr21.reaxc.rdx-shielded.g++.1 similarity index 100% rename from examples/reax/log.21Apr21.reaxc.rdx-shielded.g++.1 rename to examples/reaxff/log.21Apr21.reaxc.rdx-shielded.g++.1 diff --git a/examples/reax/log.21Apr21.reaxc.rdx-shielded.g++.4 b/examples/reaxff/log.21Apr21.reaxc.rdx-shielded.g++.4 similarity index 100% rename from examples/reax/log.21Apr21.reaxc.rdx-shielded.g++.4 rename to examples/reaxff/log.21Apr21.reaxc.rdx-shielded.g++.4 diff --git a/examples/reax/log.21Apr21.reaxc.rdx.g++.1 b/examples/reaxff/log.21Apr21.reaxc.rdx.g++.1 similarity index 100% rename from examples/reax/log.21Apr21.reaxc.rdx.g++.1 rename to examples/reaxff/log.21Apr21.reaxc.rdx.g++.1 diff --git a/examples/reax/log.21Apr21.reaxc.rdx.g++.4 b/examples/reaxff/log.21Apr21.reaxc.rdx.g++.4 similarity index 100% rename from examples/reax/log.21Apr21.reaxc.rdx.g++.4 rename to examples/reaxff/log.21Apr21.reaxc.rdx.g++.4 diff --git a/examples/reax/log.21Apr21.reaxc.tatb-shielded.g++.1 b/examples/reaxff/log.21Apr21.reaxc.tatb-shielded.g++.1 similarity index 100% rename from examples/reax/log.21Apr21.reaxc.tatb-shielded.g++.1 rename to examples/reaxff/log.21Apr21.reaxc.tatb-shielded.g++.1 diff --git a/examples/reax/log.21Apr21.reaxc.tatb-shielded.g++.4 b/examples/reaxff/log.21Apr21.reaxc.tatb-shielded.g++.4 similarity index 100% rename from examples/reax/log.21Apr21.reaxc.tatb-shielded.g++.4 rename to examples/reaxff/log.21Apr21.reaxc.tatb-shielded.g++.4 diff --git a/examples/reax/log.21Apr21.reaxc.tatb.g++.1 b/examples/reaxff/log.21Apr21.reaxc.tatb.g++.1 similarity index 100% rename from examples/reax/log.21Apr21.reaxc.tatb.g++.1 rename to examples/reaxff/log.21Apr21.reaxc.tatb.g++.1 diff --git a/examples/reax/log.21Apr21.reaxc.tatb.g++.4 b/examples/reaxff/log.21Apr21.reaxc.tatb.g++.4 similarity index 100% rename from examples/reax/log.21Apr21.reaxc.tatb.g++.4 rename to examples/reaxff/log.21Apr21.reaxc.tatb.g++.4 diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp similarity index 87% rename from src/KOKKOS/fix_qeq_reax_kokkos.cpp rename to src/KOKKOS/fix_qeq_reaxff_kokkos.cpp index f389808cf3..77bd013ad4 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp @@ -17,7 +17,7 @@ Kamesh Arumugam (NVIDIA) ------------------------------------------------------------------------- */ -#include "fix_qeq_reax_kokkos.h" +#include "fix_qeq_reaxff_kokkos.h" #include "atom.h" #include "atom_kokkos.h" @@ -43,9 +43,9 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ template -FixQEqReaxKokkos:: -FixQEqReaxKokkos(LAMMPS *lmp, int narg, char **arg) : - FixQEqReax(lmp, narg, arg) +FixQEqReaxFFKokkos:: +FixQEqReaxFFKokkos(LAMMPS *lmp, int narg, char **arg) : + FixQEqReaxFF(lmp, narg, arg) { kokkosable = 1; forward_comm_device = 1; @@ -69,7 +69,7 @@ FixQEqReaxKokkos(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ template -FixQEqReaxKokkos::~FixQEqReaxKokkos() +FixQEqReaxFFKokkos::~FixQEqReaxFFKokkos() { if (copymode) return; @@ -80,11 +80,11 @@ FixQEqReaxKokkos::~FixQEqReaxKokkos() /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::init() +void FixQEqReaxFFKokkos::init() { atomKK->sync(execution_space,Q_MASK); - FixQEqReax::init(); + FixQEqReaxFF::init(); neighflag = lmp->kokkos->neighflag_qeq; int irequest = neighbor->nrequest - 1; @@ -110,7 +110,7 @@ void FixQEqReaxKokkos::init() int ntypes = atom->ntypes; k_params = Kokkos::DualView - ("FixQEqReax::params",ntypes+1); + ("FixQEqReaxFF::params",ntypes+1); params = k_params.template view(); for (int n = 1; n <= ntypes; n++) { @@ -131,7 +131,7 @@ void FixQEqReaxKokkos::init() /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::init_shielding_k() +void FixQEqReaxFFKokkos::init_shielding_k() { int i,j; int ntypes = atom->ntypes; @@ -159,7 +159,7 @@ void FixQEqReaxKokkos::init_shielding_k() /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::init_hist() +void FixQEqReaxFFKokkos::init_hist() { k_s_hist.clear_sync_state(); k_t_hist.clear_sync_state(); @@ -174,7 +174,7 @@ void FixQEqReaxKokkos::init_hist() /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::setup_pre_force(int vflag) +void FixQEqReaxFFKokkos::setup_pre_force(int vflag) { //neighbor->build_one(list); @@ -184,7 +184,7 @@ void FixQEqReaxKokkos::setup_pre_force(int vflag) /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::pre_force(int /*vflag*/) +void FixQEqReaxFFKokkos::pre_force(int /*vflag*/) { if (update->ntimestep % nevery) return; @@ -228,10 +228,10 @@ void FixQEqReaxKokkos::pre_force(int /*vflag*/) if (execution_space == Host) { // CPU if (neighflag == FULL) { - FixQEqReaxKokkosComputeHFunctor computeH_functor(this); + FixQEqReaxFFKokkosComputeHFunctor computeH_functor(this); Kokkos::parallel_scan(inum,computeH_functor); } else { // HALF and HALFTHREAD are the same - FixQEqReaxKokkosComputeHFunctor computeH_functor(this); + FixQEqReaxFFKokkosComputeHFunctor computeH_functor(this); Kokkos::parallel_scan(inum,computeH_functor); } } else { // GPU, use teams @@ -244,11 +244,11 @@ void FixQEqReaxKokkos::pre_force(int /*vflag*/) Kokkos::TeamPolicy policy(num_teams, atoms_per_team, vector_length); if (neighflag == FULL) { - FixQEqReaxKokkosComputeHFunctor computeH_functor( + FixQEqReaxFFKokkosComputeHFunctor computeH_functor( this, atoms_per_team, vector_length); Kokkos::parallel_for(policy, computeH_functor); } else { // HALF and HALFTHREAD are the same - FixQEqReaxKokkosComputeHFunctor computeH_functor( + FixQEqReaxFFKokkosComputeHFunctor computeH_functor( this, atoms_per_team, vector_length); Kokkos::parallel_for(policy, computeH_functor); } @@ -258,7 +258,7 @@ void FixQEqReaxKokkos::pre_force(int /*vflag*/) k_s_hist.template sync(); k_t_hist.template sync(); - FixQEqReaxKokkosMatVecFunctor matvec_functor(this); + FixQEqReaxFFKokkosMatVecFunctor matvec_functor(this); Kokkos::parallel_for(inum,matvec_functor); // comm->forward_comm_fix(this); //Dist_vector(s); @@ -313,7 +313,7 @@ void FixQEqReaxKokkos::pre_force(int /*vflag*/) template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::num_neigh_item(int ii, int &maxneigh) const +void FixQEqReaxFFKokkos::num_neigh_item(int ii, int &maxneigh) const { const int i = d_ilist[ii]; maxneigh += d_numneigh[i]; @@ -322,7 +322,7 @@ void FixQEqReaxKokkos::num_neigh_item(int ii, int &maxneigh) const /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::allocate_matrix() +void FixQEqReaxFFKokkos::allocate_matrix() { const int inum = list->inum; @@ -331,7 +331,7 @@ void FixQEqReaxKokkos::allocate_matrix() // determine the total space for the H matrix m_cap = 0; - FixQEqReaxKokkosNumNeighFunctor neigh_functor(this); + FixQEqReaxFFKokkosNumNeighFunctor neigh_functor(this); Kokkos::parallel_reduce(inum,neigh_functor,m_cap); d_firstnbr = typename AT::t_int_1d("qeq/kk:firstnbr",nmax); @@ -343,7 +343,7 @@ void FixQEqReaxKokkos::allocate_matrix() /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::allocate_array() +void FixQEqReaxFFKokkos::allocate_array() { if (atom->nmax > nmax) { nmax = atom->nmax; @@ -377,7 +377,7 @@ void FixQEqReaxKokkos::allocate_array() // init_storage - FixQEqReaxKokkosZeroFunctor zero_functor(this); + FixQEqReaxFFKokkosZeroFunctor zero_functor(this); Kokkos::parallel_for(ignum,zero_functor); } @@ -385,7 +385,7 @@ void FixQEqReaxKokkos::allocate_array() template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::zero_item(int ii) const +void FixQEqReaxFFKokkos::zero_item(int ii) const { const int i = d_ilist[ii]; const int itype = type(i); @@ -409,7 +409,7 @@ void FixQEqReaxKokkos::zero_item(int ii) const template template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::compute_h_item(int ii, int &m_fill, const bool &final) const +void FixQEqReaxFFKokkos::compute_h_item(int ii, int &m_fill, const bool &final) const { const int i = d_ilist[ii]; int j,jj,jtype; @@ -477,7 +477,7 @@ void FixQEqReaxKokkos::compute_h_item(int ii, int &m_fill, const boo template template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::compute_h_team( +void FixQEqReaxFFKokkos::compute_h_team( const typename Kokkos::TeamPolicy::member_type &team, int atoms_per_team, int vector_length) const { @@ -682,7 +682,7 @@ void FixQEqReaxKokkos::compute_h_team( template KOKKOS_INLINE_FUNCTION -double FixQEqReaxKokkos::calculate_H_k(const F_FLOAT &r, const F_FLOAT &shld) const +double FixQEqReaxFFKokkos::calculate_H_k(const F_FLOAT &r, const F_FLOAT &shld) const { F_FLOAT taper, denom; @@ -704,7 +704,7 @@ double FixQEqReaxKokkos::calculate_H_k(const F_FLOAT &r, const F_FLO template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::matvec_item(int ii) const +void FixQEqReaxFFKokkos::matvec_item(int ii) const { const int i = d_ilist[ii]; const int itype = type(i); @@ -722,7 +722,7 @@ void FixQEqReaxKokkos::matvec_item(int ii) const /* ---------------------------------------------------------------------- */ template -int FixQEqReaxKokkos::cg_solve1() +int FixQEqReaxFFKokkos::cg_solve1() // b = b_s, x = s; { const int inum = list->inum; @@ -733,15 +733,15 @@ int FixQEqReaxKokkos::cg_solve1() else teamsize = 128; // sparse_matvec(&H, x, q); - FixQEqReaxKokkosSparse12Functor sparse12_functor(this); + FixQEqReaxFFKokkosSparse12Functor sparse12_functor(this); Kokkos::parallel_for(inum,sparse12_functor); if (neighflag != FULL) { Kokkos::parallel_for(Kokkos::RangePolicy(inum,ignum),*this); if (neighflag == HALF) { - FixQEqReaxKokkosSparse13Functor sparse13_functor(this); + FixQEqReaxFFKokkosSparse13Functor sparse13_functor(this); Kokkos::parallel_for(inum,sparse13_functor); } else if (neighflag == HALFTHREAD) { - FixQEqReaxKokkosSparse13Functor sparse13_functor(this); + FixQEqReaxFFKokkosSparse13Functor sparse13_functor(this); Kokkos::parallel_for(inum,sparse13_functor); } if (need_dup) @@ -760,7 +760,7 @@ int FixQEqReaxKokkos::cg_solve1() // preconditioning: d[j] = r[j] * Hdia_inv[j]; // b_norm = parallel_norm(b, nn); F_FLOAT my_norm = 0.0; - FixQEqReaxKokkosNorm1Functor norm1_functor(this); + FixQEqReaxFFKokkosNorm1Functor norm1_functor(this); Kokkos::parallel_reduce(inum,norm1_functor,my_norm); F_FLOAT norm_sqr = 0.0; MPI_Allreduce(&my_norm, &norm_sqr, 1, MPI_DOUBLE, MPI_SUM, world); @@ -768,7 +768,7 @@ int FixQEqReaxKokkos::cg_solve1() // sig_new = parallel_dot(r, d, nn); F_FLOAT my_dot = 0.0; - FixQEqReaxKokkosDot1Functor dot1_functor(this); + FixQEqReaxFFKokkosDot1Functor dot1_functor(this); Kokkos::parallel_reduce(inum,dot1_functor,my_dot); F_FLOAT dot_sqr = 0.0; MPI_Allreduce(&my_dot, &dot_sqr, 1, MPI_DOUBLE, MPI_SUM, world); @@ -784,17 +784,17 @@ int FixQEqReaxKokkos::cg_solve1() k_d.template sync(); // sparse_matvec(&H, d, q); - FixQEqReaxKokkosSparse22Functor sparse22_functor(this); + FixQEqReaxFFKokkosSparse22Functor sparse22_functor(this); Kokkos::parallel_for(inum,sparse22_functor); if (neighflag != FULL) { Kokkos::parallel_for(Kokkos::RangePolicy(inum,ignum),*this); if (need_dup) dup_o.reset_except(d_o); if (neighflag == HALF) { - FixQEqReaxKokkosSparse23Functor sparse23_functor(this); + FixQEqReaxFFKokkosSparse23Functor sparse23_functor(this); Kokkos::parallel_for(inum,sparse23_functor); } else if (neighflag == HALFTHREAD) { - FixQEqReaxKokkosSparse23Functor sparse23_functor(this); + FixQEqReaxFFKokkosSparse23Functor sparse23_functor(this); Kokkos::parallel_for(inum,sparse23_functor); } if (need_dup) @@ -811,7 +811,7 @@ int FixQEqReaxKokkos::cg_solve1() // tmp = parallel_dot(d, q, nn); my_dot = dot_sqr = 0.0; - FixQEqReaxKokkosDot2Functor dot2_functor(this); + FixQEqReaxFFKokkosDot2Functor dot2_functor(this); Kokkos::parallel_reduce(inum,dot2_functor,my_dot); MPI_Allreduce(&my_dot, &dot_sqr, 1, MPI_DOUBLE, MPI_SUM, world); tmp = dot_sqr; @@ -823,11 +823,11 @@ int FixQEqReaxKokkos::cg_solve1() // vector_add(s, alpha, d, nn); // vector_add(r, -alpha, q, nn); my_dot = dot_sqr = 0.0; - FixQEqReaxKokkosPrecon1Functor precon1_functor(this); + FixQEqReaxFFKokkosPrecon1Functor precon1_functor(this); Kokkos::parallel_for(inum,precon1_functor); // preconditioning: p[j] = r[j] * Hdia_inv[j]; // sig_new = parallel_dot(r, p, nn); - FixQEqReaxKokkosPreconFunctor precon_functor(this); + FixQEqReaxFFKokkosPreconFunctor precon_functor(this); Kokkos::parallel_reduce(inum,precon_functor,my_dot); MPI_Allreduce(&my_dot, &dot_sqr, 1, MPI_DOUBLE, MPI_SUM, world); sig_new = dot_sqr; @@ -835,12 +835,12 @@ int FixQEqReaxKokkos::cg_solve1() beta = sig_new / sig_old; // vector_sum(d, 1., p, beta, d, nn); - FixQEqReaxKokkosVecSum2Functor vecsum2_functor(this); + FixQEqReaxFFKokkosVecSum2Functor vecsum2_functor(this); Kokkos::parallel_for(inum,vecsum2_functor); } if ((loop >= imax) && maxwarn && (comm->me == 0)) - error->warning(FLERR,fmt::format("Fix qeq/reax/kk cg_solve1 convergence " + error->warning(FLERR,fmt::format("Fix qeq/reaxff/kk cg_solve1 convergence " "failed after {} iterations at step {}: " "{}", loop, update->ntimestep, sqrt(sig_new)/b_norm)); @@ -850,7 +850,7 @@ int FixQEqReaxKokkos::cg_solve1() /* ---------------------------------------------------------------------- */ template -int FixQEqReaxKokkos::cg_solve2() +int FixQEqReaxFFKokkos::cg_solve2() // b = b_t, x = t; { const int inum = list->inum; @@ -861,17 +861,17 @@ int FixQEqReaxKokkos::cg_solve2() else teamsize = 128; // sparse_matvec(&H, x, q); - FixQEqReaxKokkosSparse32Functor sparse32_functor(this); + FixQEqReaxFFKokkosSparse32Functor sparse32_functor(this); Kokkos::parallel_for(inum,sparse32_functor); if (neighflag != FULL) { Kokkos::parallel_for(Kokkos::RangePolicy(inum,ignum),*this); if (need_dup) dup_o.reset_except(d_o); if (neighflag == HALF) { - FixQEqReaxKokkosSparse33Functor sparse33_functor(this); + FixQEqReaxFFKokkosSparse33Functor sparse33_functor(this); Kokkos::parallel_for(inum,sparse33_functor); } else if (neighflag == HALFTHREAD) { - FixQEqReaxKokkosSparse33Functor sparse33_functor(this); + FixQEqReaxFFKokkosSparse33Functor sparse33_functor(this); Kokkos::parallel_for(inum,sparse33_functor); } if (need_dup) @@ -890,7 +890,7 @@ int FixQEqReaxKokkos::cg_solve2() // preconditioning: d[j] = r[j] * Hdia_inv[j]; // b_norm = parallel_norm(b, nn); F_FLOAT my_norm = 0.0; - FixQEqReaxKokkosNorm2Functor norm2_functor(this); + FixQEqReaxFFKokkosNorm2Functor norm2_functor(this); Kokkos::parallel_reduce(inum,norm2_functor,my_norm); F_FLOAT norm_sqr = 0.0; MPI_Allreduce(&my_norm, &norm_sqr, 1, MPI_DOUBLE, MPI_SUM, world); @@ -898,7 +898,7 @@ int FixQEqReaxKokkos::cg_solve2() // sig_new = parallel_dot(r, d, nn); F_FLOAT my_dot = 0.0; - FixQEqReaxKokkosDot1Functor dot1_functor(this); + FixQEqReaxFFKokkosDot1Functor dot1_functor(this); Kokkos::parallel_reduce(inum,dot1_functor,my_dot); F_FLOAT dot_sqr = 0.0; MPI_Allreduce(&my_dot, &dot_sqr, 1, MPI_DOUBLE, MPI_SUM, world); @@ -914,17 +914,17 @@ int FixQEqReaxKokkos::cg_solve2() k_d.template sync(); // sparse_matvec(&H, d, q); - FixQEqReaxKokkosSparse22Functor sparse22_functor(this); + FixQEqReaxFFKokkosSparse22Functor sparse22_functor(this); Kokkos::parallel_for(inum,sparse22_functor); if (neighflag != FULL) { Kokkos::parallel_for(Kokkos::RangePolicy(inum,ignum),*this); if (need_dup) dup_o.reset_except(d_o); if (neighflag == HALF) { - FixQEqReaxKokkosSparse23Functor sparse23_functor(this); + FixQEqReaxFFKokkosSparse23Functor sparse23_functor(this); Kokkos::parallel_for(inum,sparse23_functor); } else if (neighflag == HALFTHREAD) { - FixQEqReaxKokkosSparse23Functor sparse23_functor(this); + FixQEqReaxFFKokkosSparse23Functor sparse23_functor(this); Kokkos::parallel_for(inum,sparse23_functor); } if (need_dup) @@ -941,7 +941,7 @@ int FixQEqReaxKokkos::cg_solve2() // tmp = parallel_dot(d, q, nn); my_dot = dot_sqr = 0.0; - FixQEqReaxKokkosDot2Functor dot2_functor(this); + FixQEqReaxFFKokkosDot2Functor dot2_functor(this); Kokkos::parallel_reduce(inum,dot2_functor,my_dot); MPI_Allreduce(&my_dot, &dot_sqr, 1, MPI_DOUBLE, MPI_SUM, world); tmp = dot_sqr; @@ -953,11 +953,11 @@ int FixQEqReaxKokkos::cg_solve2() // vector_add(t, alpha, d, nn); // vector_add(r, -alpha, q, nn); my_dot = dot_sqr = 0.0; - FixQEqReaxKokkosPrecon2Functor precon2_functor(this); + FixQEqReaxFFKokkosPrecon2Functor precon2_functor(this); Kokkos::parallel_for(inum,precon2_functor); // preconditioning: p[j] = r[j] * Hdia_inv[j]; // sig_new = parallel_dot(r, p, nn); - FixQEqReaxKokkosPreconFunctor precon_functor(this); + FixQEqReaxFFKokkosPreconFunctor precon_functor(this); Kokkos::parallel_reduce(inum,precon_functor,my_dot); MPI_Allreduce(&my_dot, &dot_sqr, 1, MPI_DOUBLE, MPI_SUM, world); sig_new = dot_sqr; @@ -965,12 +965,12 @@ int FixQEqReaxKokkos::cg_solve2() beta = sig_new / sig_old; // vector_sum(d, 1., p, beta, d, nn); - FixQEqReaxKokkosVecSum2Functor vecsum2_functor(this); + FixQEqReaxFFKokkosVecSum2Functor vecsum2_functor(this); Kokkos::parallel_for(inum,vecsum2_functor); } if ((loop >= imax) && maxwarn && (comm->me == 0)) - error->warning(FLERR,fmt::format("Fix qeq/reax/kk cg_solve2 convergence " + error->warning(FLERR,fmt::format("Fix qeq/reaxff/kk cg_solve2 convergence " "failed after {} iterations at step {}: " "{}", loop, update->ntimestep, sqrt(sig_new)/b_norm)); @@ -980,21 +980,21 @@ int FixQEqReaxKokkos::cg_solve2() /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::calculate_q() +void FixQEqReaxFFKokkos::calculate_q() { F_FLOAT sum, sum_all; const int inum = list->inum; // s_sum = parallel_vector_acc(s, nn); sum = sum_all = 0.0; - FixQEqReaxKokkosVecAcc1Functor vecacc1_functor(this); + FixQEqReaxFFKokkosVecAcc1Functor vecacc1_functor(this); Kokkos::parallel_reduce(inum,vecacc1_functor,sum); MPI_Allreduce(&sum, &sum_all, 1, MPI_DOUBLE, MPI_SUM, world); const F_FLOAT s_sum = sum_all; // t_sum = parallel_vector_acc(t, nn); sum = sum_all = 0.0; - FixQEqReaxKokkosVecAcc2Functor vecacc2_functor(this); + FixQEqReaxFFKokkosVecAcc2Functor vecacc2_functor(this); Kokkos::parallel_reduce(inum,vecacc2_functor,sum); MPI_Allreduce(&sum, &sum_all, 1, MPI_DOUBLE, MPI_SUM, world); const F_FLOAT t_sum = sum_all; @@ -1003,7 +1003,7 @@ void FixQEqReaxKokkos::calculate_q() delta = s_sum/t_sum; // q[i] = s[i] - u * t[i]; - FixQEqReaxKokkosCalculateQFunctor calculateQ_functor(this); + FixQEqReaxFFKokkosCalculateQFunctor calculateQ_functor(this); Kokkos::parallel_for(inum,calculateQ_functor); atomKK->modified(execution_space,Q_MASK); @@ -1016,7 +1016,7 @@ void FixQEqReaxKokkos::calculate_q() template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::sparse12_item(int ii) const +void FixQEqReaxFFKokkos::sparse12_item(int ii) const { const int i = d_ilist[ii]; const int itype = type(i); @@ -1030,7 +1030,7 @@ void FixQEqReaxKokkos::sparse12_item(int ii) const template template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::sparse13_item(int ii) const +void FixQEqReaxFFKokkos::sparse13_item(int ii) const { // The q array is duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_o = ScatterViewHelper::value,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); @@ -1052,7 +1052,7 @@ void FixQEqReaxKokkos::sparse13_item(int ii) const template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::operator() (TagSparseMatvec1, const membertype1 &team) const +void FixQEqReaxFFKokkos::operator() (TagSparseMatvec1, const membertype1 &team) const { const int i = d_ilist[team.league_rank()]; if (mask[i] & groupbit) { @@ -1069,7 +1069,7 @@ void FixQEqReaxKokkos::operator() (TagSparseMatvec1, const membertyp template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::sparse22_item(int ii) const +void FixQEqReaxFFKokkos::sparse22_item(int ii) const { const int i = d_ilist[ii]; const int itype = type(i); @@ -1083,7 +1083,7 @@ void FixQEqReaxKokkos::sparse22_item(int ii) const template template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::sparse23_item(int ii) const +void FixQEqReaxFFKokkos::sparse23_item(int ii) const { // The q array is duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_o = ScatterViewHelper::value,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); @@ -1105,7 +1105,7 @@ void FixQEqReaxKokkos::sparse23_item(int ii) const template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::operator() (TagSparseMatvec2, const membertype2 &team) const +void FixQEqReaxFFKokkos::operator() (TagSparseMatvec2, const membertype2 &team) const { const int i = d_ilist[team.league_rank()]; if (mask[i] & groupbit) { @@ -1120,7 +1120,7 @@ void FixQEqReaxKokkos::operator() (TagSparseMatvec2, const membertyp template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::operator() (TagZeroQGhosts, const int &i) const +void FixQEqReaxFFKokkos::operator() (TagZeroQGhosts, const int &i) const { if (mask[i] & groupbit) d_o[i] = 0.0; @@ -1130,7 +1130,7 @@ void FixQEqReaxKokkos::operator() (TagZeroQGhosts, const int &i) con template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::sparse32_item(int ii) const +void FixQEqReaxFFKokkos::sparse32_item(int ii) const { const int i = d_ilist[ii]; const int itype = type(i); @@ -1143,7 +1143,7 @@ void FixQEqReaxKokkos::sparse32_item(int ii) const template template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::sparse33_item(int ii) const +void FixQEqReaxFFKokkos::sparse33_item(int ii) const { // The q array is duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_o = ScatterViewHelper::value,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); @@ -1165,7 +1165,7 @@ void FixQEqReaxKokkos::sparse33_item(int ii) const template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::operator() (TagSparseMatvec3, const membertype3 &team) const +void FixQEqReaxFFKokkos::operator() (TagSparseMatvec3, const membertype3 &team) const { const int i = d_ilist[team.league_rank()]; if (mask[i] & groupbit) { @@ -1182,7 +1182,7 @@ void FixQEqReaxKokkos::operator() (TagSparseMatvec3, const membertyp template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::vecsum2_item(int ii) const +void FixQEqReaxFFKokkos::vecsum2_item(int ii) const { const int i = d_ilist[ii]; if (mask[i] & groupbit) @@ -1193,7 +1193,7 @@ void FixQEqReaxKokkos::vecsum2_item(int ii) const template KOKKOS_INLINE_FUNCTION -double FixQEqReaxKokkos::norm1_item(int ii) const +double FixQEqReaxFFKokkos::norm1_item(int ii) const { F_FLOAT tmp = 0; const int i = d_ilist[ii]; @@ -1209,7 +1209,7 @@ double FixQEqReaxKokkos::norm1_item(int ii) const template KOKKOS_INLINE_FUNCTION -double FixQEqReaxKokkos::norm2_item(int ii) const +double FixQEqReaxFFKokkos::norm2_item(int ii) const { F_FLOAT tmp = 0; const int i = d_ilist[ii]; @@ -1225,7 +1225,7 @@ double FixQEqReaxKokkos::norm2_item(int ii) const template KOKKOS_INLINE_FUNCTION -double FixQEqReaxKokkos::dot1_item(int ii) const +double FixQEqReaxFFKokkos::dot1_item(int ii) const { F_FLOAT tmp = 0.0; const int i = d_ilist[ii]; @@ -1238,7 +1238,7 @@ double FixQEqReaxKokkos::dot1_item(int ii) const template KOKKOS_INLINE_FUNCTION -double FixQEqReaxKokkos::dot2_item(int ii) const +double FixQEqReaxFFKokkos::dot2_item(int ii) const { double tmp = 0.0; const int i = d_ilist[ii]; @@ -1252,7 +1252,7 @@ double FixQEqReaxKokkos::dot2_item(int ii) const template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::precon1_item(int ii) const +void FixQEqReaxFFKokkos::precon1_item(int ii) const { const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1265,7 +1265,7 @@ void FixQEqReaxKokkos::precon1_item(int ii) const template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::precon2_item(int ii) const +void FixQEqReaxFFKokkos::precon2_item(int ii) const { const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1278,7 +1278,7 @@ void FixQEqReaxKokkos::precon2_item(int ii) const template KOKKOS_INLINE_FUNCTION -double FixQEqReaxKokkos::precon_item(int ii) const +double FixQEqReaxFFKokkos::precon_item(int ii) const { F_FLOAT tmp = 0.0; const int i = d_ilist[ii]; @@ -1293,7 +1293,7 @@ double FixQEqReaxKokkos::precon_item(int ii) const template KOKKOS_INLINE_FUNCTION -double FixQEqReaxKokkos::vecacc1_item(int ii) const +double FixQEqReaxFFKokkos::vecacc1_item(int ii) const { F_FLOAT tmp = 0.0; const int i = d_ilist[ii]; @@ -1306,7 +1306,7 @@ double FixQEqReaxKokkos::vecacc1_item(int ii) const template KOKKOS_INLINE_FUNCTION -double FixQEqReaxKokkos::vecacc2_item(int ii) const +double FixQEqReaxFFKokkos::vecacc2_item(int ii) const { F_FLOAT tmp = 0.0; const int i = d_ilist[ii]; @@ -1320,7 +1320,7 @@ double FixQEqReaxKokkos::vecacc2_item(int ii) const template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::calculate_q_item(int ii) const +void FixQEqReaxFFKokkos::calculate_q_item(int ii) const { const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1339,20 +1339,20 @@ void FixQEqReaxKokkos::calculate_q_item(int ii) const /* ---------------------------------------------------------------------- */ template -int FixQEqReaxKokkos::pack_forward_comm_fix_kokkos(int n, DAT::tdual_int_2d k_sendlist, +int FixQEqReaxFFKokkos::pack_forward_comm_fix_kokkos(int n, DAT::tdual_int_2d k_sendlist, int iswap_in, DAT::tdual_xfloat_1d &k_buf, int /*pbc_flag*/, int * /*pbc*/) { d_sendlist = k_sendlist.view(); iswap = iswap_in; d_buf = k_buf.view(); - Kokkos::parallel_for(Kokkos::RangePolicy(0,n),*this); + Kokkos::parallel_for(Kokkos::RangePolicy(0,n),*this); return n; } template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::operator()(TagFixQEqReaxPackForwardComm, const int &i) const { +void FixQEqReaxFFKokkos::operator()(TagFixQEqReaxFFPackForwardComm, const int &i) const { int j = d_sendlist(iswap, i); if (pack_flag == 1) @@ -1368,11 +1368,11 @@ void FixQEqReaxKokkos::operator()(TagFixQEqReaxPackForwardComm, cons /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::unpack_forward_comm_fix_kokkos(int n, int first_in, DAT::tdual_xfloat_1d &buf) +void FixQEqReaxFFKokkos::unpack_forward_comm_fix_kokkos(int n, int first_in, DAT::tdual_xfloat_1d &buf) { first = first_in; d_buf = buf.view(); - Kokkos::parallel_for(Kokkos::RangePolicy(0,n),*this); + Kokkos::parallel_for(Kokkos::RangePolicy(0,n),*this); if (pack_flag == 4) atomKK->modified(execution_space,Q_MASK); // needed for auto_sync @@ -1380,7 +1380,7 @@ void FixQEqReaxKokkos::unpack_forward_comm_fix_kokkos(int n, int fir template KOKKOS_INLINE_FUNCTION -void FixQEqReaxKokkos::operator()(TagFixQEqReaxUnpackForwardComm, const int &i) const { +void FixQEqReaxFFKokkos::operator()(TagFixQEqReaxFFUnpackForwardComm, const int &i) const { if (pack_flag == 1) d_d[i + first] = d_buf[i]; else if (pack_flag == 2) @@ -1395,7 +1395,7 @@ void FixQEqReaxKokkos::operator()(TagFixQEqReaxUnpackForwardComm, co /* ---------------------------------------------------------------------- */ template -int FixQEqReaxKokkos::pack_forward_comm(int n, int *list, double *buf, +int FixQEqReaxFFKokkos::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/) { int m; @@ -1420,7 +1420,7 @@ int FixQEqReaxKokkos::pack_forward_comm(int n, int *list, double *bu /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::unpack_forward_comm(int n, int first, double *buf) +void FixQEqReaxFFKokkos::unpack_forward_comm(int n, int first, double *buf) { int i, m; @@ -1446,7 +1446,7 @@ void FixQEqReaxKokkos::unpack_forward_comm(int n, int first, double /* ---------------------------------------------------------------------- */ template -int FixQEqReaxKokkos::pack_reverse_comm(int n, int first, double *buf) +int FixQEqReaxFFKokkos::pack_reverse_comm(int n, int first, double *buf) { k_o.sync_host(); @@ -1460,7 +1460,7 @@ int FixQEqReaxKokkos::pack_reverse_comm(int n, int first, double *bu /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::unpack_reverse_comm(int n, int *list, double *buf) +void FixQEqReaxFFKokkos::unpack_reverse_comm(int n, int *list, double *buf) { k_o.sync_host(); @@ -1474,7 +1474,7 @@ void FixQEqReaxKokkos::unpack_reverse_comm(int n, int *list, double /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::cleanup_copy() +void FixQEqReaxFFKokkos::cleanup_copy() { id = style = nullptr; } @@ -1484,7 +1484,7 @@ void FixQEqReaxKokkos::cleanup_copy() ------------------------------------------------------------------------- */ template -double FixQEqReaxKokkos::memory_usage() +double FixQEqReaxFFKokkos::memory_usage() { double bytes; @@ -1502,7 +1502,7 @@ double FixQEqReaxKokkos::memory_usage() ------------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::grow_arrays(int nmax) +void FixQEqReaxFFKokkos::grow_arrays(int nmax) { k_s_hist.template sync(); k_t_hist.template sync(); @@ -1525,7 +1525,7 @@ void FixQEqReaxKokkos::grow_arrays(int nmax) ------------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::copy_arrays(int i, int j, int /*delflag*/) +void FixQEqReaxFFKokkos::copy_arrays(int i, int j, int /*delflag*/) { k_s_hist.template sync(); k_t_hist.template sync(); @@ -1544,7 +1544,7 @@ void FixQEqReaxKokkos::copy_arrays(int i, int j, int /*delflag*/) ------------------------------------------------------------------------- */ template -int FixQEqReaxKokkos::pack_exchange(int i, double *buf) +int FixQEqReaxFFKokkos::pack_exchange(int i, double *buf) { k_s_hist.template sync(); k_t_hist.template sync(); @@ -1559,7 +1559,7 @@ int FixQEqReaxKokkos::pack_exchange(int i, double *buf) ------------------------------------------------------------------------- */ template -int FixQEqReaxKokkos::unpack_exchange(int nlocal, double *buf) +int FixQEqReaxFFKokkos::unpack_exchange(int nlocal, double *buf) { k_s_hist.template sync(); k_t_hist.template sync(); @@ -1576,8 +1576,8 @@ int FixQEqReaxKokkos::unpack_exchange(int nlocal, double *buf) /* ---------------------------------------------------------------------- */ namespace LAMMPS_NS { -template class FixQEqReaxKokkos; +template class FixQEqReaxFFKokkos; #ifdef LMP_KOKKOS_GPU -template class FixQEqReaxKokkos; +template class FixQEqReaxFFKokkos; #endif } diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.h b/src/KOKKOS/fix_qeq_reaxff_kokkos.h similarity index 75% rename from src/KOKKOS/fix_qeq_reax_kokkos.h rename to src/KOKKOS/fix_qeq_reaxff_kokkos.h index 8485c68122..71c0808b0f 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.h +++ b/src/KOKKOS/fix_qeq_reaxff_kokkos.h @@ -14,16 +14,19 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(qeq/reax/kk,FixQEqReaxKokkos); -FixStyle(qeq/reax/kk/device,FixQEqReaxKokkos); -FixStyle(qeq/reax/kk/host,FixQEqReaxKokkos); +FixStyle(qeq/reaxff/kk,FixQEqReaxFFKokkos); +FixStyle(qeq/reaxff/kk/device,FixQEqReaxFFKokkos); +FixStyle(qeq/reaxff/kk/host,FixQEqReaxFFKokkos); +FixStyle(qeq/reax/kk,FixQEqReaxFFKokkos); +FixStyle(qeq/reax/kk/device,FixQEqReaxFFKokkos); +FixStyle(qeq/reax/kk/host,FixQEqReaxFFKokkos); // clang-format on #else -#ifndef LMP_FIX_QEQ_REAX_KOKKOS_H -#define LMP_FIX_QEQ_REAX_KOKKOS_H +#ifndef LMP_FIX_QEQ_REAXFF_KOKKOS_H +#define LMP_FIX_QEQ_REAXFF_KOKKOS_H -#include "fix_qeq_reax.h" +#include "fix_qeq_reaxff.h" #include "kokkos_type.h" #include "neigh_list.h" #include "neigh_list_kokkos.h" @@ -35,16 +38,16 @@ struct TagSparseMatvec1 {}; struct TagSparseMatvec2 {}; struct TagSparseMatvec3 {}; struct TagZeroQGhosts{}; -struct TagFixQEqReaxPackForwardComm {}; -struct TagFixQEqReaxUnpackForwardComm {}; +struct TagFixQEqReaxFFPackForwardComm {}; +struct TagFixQEqReaxFFUnpackForwardComm {}; template -class FixQEqReaxKokkos : public FixQEqReax, public KokkosBase { +class FixQEqReaxFFKokkos : public FixQEqReaxFF, public KokkosBase { public: typedef DeviceType device_type; typedef ArrayTypes AT; - FixQEqReaxKokkos(class LAMMPS *, int, char **); - ~FixQEqReaxKokkos(); + FixQEqReaxFFKokkos(class LAMMPS *, int, char **); + ~FixQEqReaxFFKokkos(); void cleanup_copy(); void init(); @@ -141,10 +144,10 @@ class FixQEqReaxKokkos : public FixQEqReax, public KokkosBase { double calculate_H_k(const F_FLOAT &r, const F_FLOAT &shld) const; KOKKOS_INLINE_FUNCTION - void operator()(TagFixQEqReaxPackForwardComm, const int&) const; + void operator()(TagFixQEqReaxFFPackForwardComm, const int&) const; KOKKOS_INLINE_FUNCTION - void operator()(TagFixQEqReaxUnpackForwardComm, const int&) const; + void operator()(TagFixQEqReaxFFUnpackForwardComm, const int&) const; struct params_qeq{ KOKKOS_INLINE_FUNCTION @@ -241,11 +244,11 @@ class FixQEqReaxKokkos : public FixQEqReax, public KokkosBase { }; template -struct FixQEqReaxKokkosNumNeighFunctor { +struct FixQEqReaxFFKokkosNumNeighFunctor { typedef DeviceType device_type ; typedef int value_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosNumNeighFunctor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosNumNeighFunctor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -255,10 +258,10 @@ struct FixQEqReaxKokkosNumNeighFunctor { }; template -struct FixQEqReaxKokkosMatVecFunctor { +struct FixQEqReaxFFKokkosMatVecFunctor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosMatVecFunctor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosMatVecFunctor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -268,17 +271,17 @@ struct FixQEqReaxKokkosMatVecFunctor { }; template -struct FixQEqReaxKokkosComputeHFunctor { +struct FixQEqReaxFFKokkosComputeHFunctor { int atoms_per_team, vector_length; typedef int value_type; typedef Kokkos::ScratchMemorySpace scratch_space; - FixQEqReaxKokkos c; + FixQEqReaxFFKokkos c; - FixQEqReaxKokkosComputeHFunctor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkosComputeHFunctor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; - FixQEqReaxKokkosComputeHFunctor(FixQEqReaxKokkos *c_ptr, + FixQEqReaxFFKokkosComputeHFunctor(FixQEqReaxFFKokkos *c_ptr, int _atoms_per_team, int _vector_length) : atoms_per_team(_atoms_per_team), vector_length(_vector_length), c(*c_ptr) { c.cleanup_copy(); @@ -315,10 +318,10 @@ struct FixQEqReaxKokkosComputeHFunctor { }; template -struct FixQEqReaxKokkosZeroFunctor { +struct FixQEqReaxFFKokkosZeroFunctor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosZeroFunctor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosZeroFunctor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -328,10 +331,10 @@ struct FixQEqReaxKokkosZeroFunctor { }; template -struct FixQEqReaxKokkosSparse12Functor { +struct FixQEqReaxFFKokkosSparse12Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosSparse12Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosSparse12Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -341,10 +344,10 @@ struct FixQEqReaxKokkosSparse12Functor { }; template -struct FixQEqReaxKokkosSparse13Functor { +struct FixQEqReaxFFKokkosSparse13Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosSparse13Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosSparse13Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -354,10 +357,10 @@ struct FixQEqReaxKokkosSparse13Functor { }; template -struct FixQEqReaxKokkosSparse22Functor { +struct FixQEqReaxFFKokkosSparse22Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosSparse22Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosSparse22Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -367,10 +370,10 @@ struct FixQEqReaxKokkosSparse22Functor { }; template -struct FixQEqReaxKokkosSparse23Functor { +struct FixQEqReaxFFKokkosSparse23Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosSparse23Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosSparse23Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -380,10 +383,10 @@ struct FixQEqReaxKokkosSparse23Functor { }; template -struct FixQEqReaxKokkosSparse32Functor { +struct FixQEqReaxFFKokkosSparse32Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosSparse32Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosSparse32Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -393,10 +396,10 @@ struct FixQEqReaxKokkosSparse32Functor { }; template -struct FixQEqReaxKokkosSparse33Functor { +struct FixQEqReaxFFKokkosSparse33Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosSparse33Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosSparse33Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -406,10 +409,10 @@ struct FixQEqReaxKokkosSparse33Functor { }; template -struct FixQEqReaxKokkosVecSum2Functor { +struct FixQEqReaxFFKokkosVecSum2Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosVecSum2Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosVecSum2Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -419,11 +422,11 @@ struct FixQEqReaxKokkosVecSum2Functor { }; template -struct FixQEqReaxKokkosNorm1Functor { +struct FixQEqReaxFFKokkosNorm1Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; + FixQEqReaxFFKokkos c; typedef double value_type; - FixQEqReaxKokkosNorm1Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkosNorm1Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -433,11 +436,11 @@ struct FixQEqReaxKokkosNorm1Functor { }; template -struct FixQEqReaxKokkosNorm2Functor { +struct FixQEqReaxFFKokkosNorm2Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; + FixQEqReaxFFKokkos c; typedef double value_type; - FixQEqReaxKokkosNorm2Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkosNorm2Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -447,11 +450,11 @@ struct FixQEqReaxKokkosNorm2Functor { }; template -struct FixQEqReaxKokkosDot1Functor { +struct FixQEqReaxFFKokkosDot1Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; + FixQEqReaxFFKokkos c; typedef double value_type; - FixQEqReaxKokkosDot1Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkosDot1Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -461,11 +464,11 @@ struct FixQEqReaxKokkosDot1Functor { }; template -struct FixQEqReaxKokkosDot2Functor { +struct FixQEqReaxFFKokkosDot2Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; + FixQEqReaxFFKokkos c; typedef double value_type; - FixQEqReaxKokkosDot2Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkosDot2Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -475,10 +478,10 @@ struct FixQEqReaxKokkosDot2Functor { }; template -struct FixQEqReaxKokkosPrecon1Functor { +struct FixQEqReaxFFKokkosPrecon1Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosPrecon1Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosPrecon1Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -488,10 +491,10 @@ struct FixQEqReaxKokkosPrecon1Functor { }; template -struct FixQEqReaxKokkosPrecon2Functor { +struct FixQEqReaxFFKokkosPrecon2Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosPrecon2Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosPrecon2Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -501,11 +504,11 @@ struct FixQEqReaxKokkosPrecon2Functor { }; template -struct FixQEqReaxKokkosPreconFunctor { +struct FixQEqReaxFFKokkosPreconFunctor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; + FixQEqReaxFFKokkos c; typedef double value_type; - FixQEqReaxKokkosPreconFunctor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkosPreconFunctor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -515,11 +518,11 @@ struct FixQEqReaxKokkosPreconFunctor { }; template -struct FixQEqReaxKokkosVecAcc1Functor { +struct FixQEqReaxFFKokkosVecAcc1Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; + FixQEqReaxFFKokkos c; typedef double value_type; - FixQEqReaxKokkosVecAcc1Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkosVecAcc1Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -529,11 +532,11 @@ struct FixQEqReaxKokkosVecAcc1Functor { }; template -struct FixQEqReaxKokkosVecAcc2Functor { +struct FixQEqReaxFFKokkosVecAcc2Functor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; + FixQEqReaxFFKokkos c; typedef double value_type; - FixQEqReaxKokkosVecAcc2Functor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkosVecAcc2Functor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION @@ -543,10 +546,10 @@ struct FixQEqReaxKokkosVecAcc2Functor { }; template -struct FixQEqReaxKokkosCalculateQFunctor { +struct FixQEqReaxFFKokkosCalculateQFunctor { typedef DeviceType device_type ; - FixQEqReaxKokkos c; - FixQEqReaxKokkosCalculateQFunctor(FixQEqReaxKokkos* c_ptr):c(*c_ptr) { + FixQEqReaxFFKokkos c; + FixQEqReaxFFKokkosCalculateQFunctor(FixQEqReaxFFKokkos* c_ptr):c(*c_ptr) { c.cleanup_copy(); }; KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp b/src/KOKKOS/fix_reaxff_bonds_kokkos.cpp similarity index 69% rename from src/KOKKOS/fix_reaxc_bonds_kokkos.cpp rename to src/KOKKOS/fix_reaxff_bonds_kokkos.cpp index 3da59ce972..2fc7d4639d 100644 --- a/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp +++ b/src/KOKKOS/fix_reaxff_bonds_kokkos.cpp @@ -16,22 +16,22 @@ Contributing author: Stan Moore (Sandia) ------------------------------------------------------------------------- */ -#include "fix_reaxc_bonds_kokkos.h" +#include "fix_reaxff_bonds_kokkos.h" #include "atom.h" #include "atom_masks.h" #include "error.h" #include "force.h" #include "memory_kokkos.h" -#include "pair_reaxc_kokkos.h" +#include "pair_reaxff_kokkos.h" using namespace LAMMPS_NS; using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixReaxCBondsKokkos::FixReaxCBondsKokkos(LAMMPS *lmp, int narg, char **arg) : - FixReaxCBonds(lmp, narg, arg) +FixReaxFFBondsKokkos::FixReaxFFBondsKokkos(LAMMPS *lmp, int narg, char **arg) : + FixReaxFFBonds(lmp, narg, arg) { kokkosable = 1; atomKK = (AtomKokkos *) atom; @@ -42,25 +42,25 @@ FixReaxCBondsKokkos::FixReaxCBondsKokkos(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -FixReaxCBondsKokkos::~FixReaxCBondsKokkos() +FixReaxFFBondsKokkos::~FixReaxFFBondsKokkos() { } /* ---------------------------------------------------------------------- */ -void FixReaxCBondsKokkos::init() +void FixReaxFFBondsKokkos::init() { - Pair *pair_kk = force->pair_match("reax/c/kk",0); - if (pair_kk == nullptr) error->all(FLERR,"Cannot use fix reax/c/bonds without " - "pair_style reax/c/kk"); + Pair *pair_kk = force->pair_match("^reax../kk",0); + if (pair_kk == nullptr) error->all(FLERR,"Cannot use fix reaxff/bonds without " + "pair_style reaxff/kk"); - FixReaxCBonds::init(); + FixReaxFFBonds::init(); } /* ---------------------------------------------------------------------- */ -void FixReaxCBondsKokkos::Output_ReaxC_Bonds(bigint /*ntimestep*/, FILE * /*fp*/) +void FixReaxFFBondsKokkos::Output_ReaxFF_Bonds() { int nbuf_local; @@ -72,23 +72,23 @@ void FixReaxCBondsKokkos::Output_ReaxC_Bonds(bigint /*ntimestep*/, FILE * /*fp*/ int nlocal_tot = static_cast (atom->natoms); numbonds = 0; - if (reaxc->execution_space == Device) - ((PairReaxCKokkos*) reaxc)->FindBond(numbonds); + if (reaxff->execution_space == Device) + ((PairReaxFFKokkos*) reaxff)->FindBond(numbonds); else - ((PairReaxCKokkos*) reaxc)->FindBond(numbonds); + ((PairReaxFFKokkos*) reaxff)->FindBond(numbonds); // allocate a temporary buffer for the snapshot info MPI_Allreduce(&numbonds,&numbonds_max,1,MPI_INT,MPI_MAX,world); MPI_Allreduce(&nlocal,&nlocal_max,1,MPI_INT,MPI_MAX,world); nbuf = 1+(numbonds_max*2+10)*nlocal_max; - memoryKK->create_kokkos(k_buf,buf,nbuf,"reax/c/bonds:buf"); + memoryKK->create_kokkos(k_buf,buf,nbuf,"reaxff/bonds:buf"); // Pass information to buffer - if (reaxc->execution_space == Device) - ((PairReaxCKokkos*) reaxc)->PackBondBuffer(k_buf,nbuf_local); + if (reaxff->execution_space == Device) + ((PairReaxFFKokkos*) reaxff)->PackBondBuffer(k_buf,nbuf_local); else - ((PairReaxCKokkos*) reaxc)->PackBondBuffer(k_buf,nbuf_local); + ((PairReaxFFKokkos*) reaxff)->PackBondBuffer(k_buf,nbuf_local); buf[0] = nlocal; // Receive information from buffer for output @@ -99,12 +99,12 @@ void FixReaxCBondsKokkos::Output_ReaxC_Bonds(bigint /*ntimestep*/, FILE * /*fp*/ /* ---------------------------------------------------------------------- */ -double FixReaxCBondsKokkos::memory_usage() +double FixReaxFFBondsKokkos::memory_usage() { double bytes; bytes = nbuf*sizeof(double); - // These are accounted for in PairReaxCKokkos: + // These are accounted for in PairReaxFFKokkos: //bytes += nmax*sizeof(int); //bytes += 1.0*nmax*MAXREAXBOND*sizeof(double); //bytes += 1.0*nmax*MAXREAXBOND*sizeof(int); diff --git a/src/KOKKOS/fix_reaxc_bonds_kokkos.h b/src/KOKKOS/fix_reaxff_bonds_kokkos.h similarity index 59% rename from src/KOKKOS/fix_reaxc_bonds_kokkos.h rename to src/KOKKOS/fix_reaxff_bonds_kokkos.h index 8c1bb9bef9..b1203e472d 100644 --- a/src/KOKKOS/fix_reaxc_bonds_kokkos.h +++ b/src/KOKKOS/fix_reaxff_bonds_kokkos.h @@ -14,29 +14,32 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(reax/c/bonds/kk,FixReaxCBondsKokkos); -FixStyle(reax/c/bonds/kk/device,FixReaxCBondsKokkos); -FixStyle(reax/c/bonds/kk/host,FixReaxCBondsKokkos); +FixStyle(reaxff/bonds/kk,FixReaxFFBondsKokkos); +FixStyle(reaxff/bonds/kk/device,FixReaxFFBondsKokkos); +FixStyle(reaxff/bonds/kk/host,FixReaxFFBondsKokkos); +FixStyle(reax/c/bonds/kk,FixReaxFFBondsKokkos); +FixStyle(reax/c/bonds/kk/device,FixReaxFFBondsKokkos); +FixStyle(reax/c/bonds/kk/host,FixReaxFFBondsKokkos); // clang-format on #else -#ifndef LMP_FIX_REAXC_BONDS_KOKKOS_H -#define LMP_FIX_REAXC_BONDS_KOKKOS_H +#ifndef LMP_FIX_REAXFF_BONDS_KOKKOS_H +#define LMP_FIX_REAXFF_BONDS_KOKKOS_H -#include "fix_reaxc_bonds.h" +#include "fix_reaxff_bonds.h" #include "kokkos_type.h" namespace LAMMPS_NS { -class FixReaxCBondsKokkos : public FixReaxCBonds { +class FixReaxFFBondsKokkos : public FixReaxFFBonds { public: - FixReaxCBondsKokkos(class LAMMPS *, int, char **); - virtual ~FixReaxCBondsKokkos(); + FixReaxFFBondsKokkos(class LAMMPS *, int, char **); + virtual ~FixReaxFFBondsKokkos(); void init(); private: int nbuf; - void Output_ReaxC_Bonds(bigint, FILE *); + void Output_ReaxFF_Bonds() double memory_usage(); }; } diff --git a/src/KOKKOS/fix_reaxc_species_kokkos.cpp b/src/KOKKOS/fix_reaxff_species_kokkos.cpp similarity index 83% rename from src/KOKKOS/fix_reaxc_species_kokkos.cpp rename to src/KOKKOS/fix_reaxff_species_kokkos.cpp index 9d01164b6f..d3d913eda8 100644 --- a/src/KOKKOS/fix_reaxc_species_kokkos.cpp +++ b/src/KOKKOS/fix_reaxff_species_kokkos.cpp @@ -16,7 +16,7 @@ Contributing authors: Stan Moore (Sandia) ------------------------------------------------------------------------- */ -#include "fix_reaxc_species_kokkos.h" +#include "fix_reaxff_species_kokkos.h" #include "atom.h" #include "atom_masks.h" @@ -29,7 +29,7 @@ #include "neigh_request.h" #include "fix_ave_atom.h" -#include "pair_reaxc_kokkos.h" +#include "pair_reaxff_kokkos.h" #include "reaxff_defs.h" using namespace LAMMPS_NS; @@ -37,8 +37,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixReaxCSpeciesKokkos::FixReaxCSpeciesKokkos(LAMMPS *lmp, int narg, char **arg) : - FixReaxCSpecies(lmp, narg, arg) +FixReaxFFSpeciesKokkos::FixReaxFFSpeciesKokkos(LAMMPS *lmp, int narg, char **arg) : + FixReaxFFSpecies(lmp, narg, arg) { kokkosable = 1; atomKK = (AtomKokkos *) atom; @@ -51,25 +51,25 @@ FixReaxCSpeciesKokkos::FixReaxCSpeciesKokkos(LAMMPS *lmp, int narg, char **arg) /* ---------------------------------------------------------------------- */ -FixReaxCSpeciesKokkos::~FixReaxCSpeciesKokkos() +FixReaxFFSpeciesKokkos::~FixReaxFFSpeciesKokkos() { } /* ---------------------------------------------------------------------- */ -void FixReaxCSpeciesKokkos::init() +void FixReaxFFSpeciesKokkos::init() { - Pair* pair_kk = force->pair_match("reax/c/kk",0); - if (pair_kk == nullptr) error->all(FLERR,"Cannot use fix reax/c/species/kk without " - "pair_style reax/c/kk"); + Pair* pair_kk = force->pair_match("^reax../kk",0); + if (pair_kk == nullptr) error->all(FLERR,"Cannot use fix reaxff/species/kk without " + "pair_style reaxff/kk"); - FixReaxCSpecies::init(); + FixReaxFFSpecies::init(); } /* ---------------------------------------------------------------------- */ -void FixReaxCSpeciesKokkos::FindMolecule() +void FixReaxFFSpeciesKokkos::FindMolecule() { int i,j,ii,jj,inum,itype,jtype,loop,looptot; int change,done,anychange; @@ -77,14 +77,14 @@ void FixReaxCSpeciesKokkos::FindMolecule() double bo_tmp,bo_cut; double **spec_atom = f_SPECBOND->array_atom; - inum = reaxc->list->inum; + inum = reaxff->list->inum; typename ArrayTypes::t_int_1d ilist; - if (reaxc->execution_space == Host) { - NeighListKokkos* k_list = static_cast*>(reaxc->list); + if (reaxff->execution_space == Host) { + NeighListKokkos* k_list = static_cast*>(reaxff->list); k_list->k_ilist.sync(); ilist = k_list->k_ilist.h_view; } else { - NeighListKokkos* k_list = static_cast*>(reaxc->list); + NeighListKokkos* k_list = static_cast*>(reaxff->list); k_list->k_ilist.sync(); ilist = k_list->k_ilist.h_view; } @@ -116,7 +116,7 @@ void FixReaxCSpeciesKokkos::FindMolecule() itype = atom->type[i]; for (jj = 0; jj < MAXSPECBOND; jj++) { - j = reaxc->tmpid[i][jj]; + j = reaxff->tmpid[i][jj]; if ((j == 0) && (j < i)) continue; if (!(mask[j] & groupbit)) continue; diff --git a/src/KOKKOS/fix_reaxc_species_kokkos.h b/src/KOKKOS/fix_reaxff_species_kokkos.h similarity index 58% rename from src/KOKKOS/fix_reaxc_species_kokkos.h rename to src/KOKKOS/fix_reaxff_species_kokkos.h index 1a5f204132..ad9d02319d 100644 --- a/src/KOKKOS/fix_reaxc_species_kokkos.h +++ b/src/KOKKOS/fix_reaxff_species_kokkos.h @@ -14,25 +14,28 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(reax/c/species/kk,FixReaxCSpeciesKokkos); -FixStyle(reax/c/species/kk/device,FixReaxCSpeciesKokkos); -FixStyle(reax/c/species/kk/host,FixReaxCSpeciesKokkos); +FixStyle(reaxff/species/kk,FixReaxFFSpeciesKokkos); +FixStyle(reaxff/species/kk/device,FixReaxFFSpeciesKokkos); +FixStyle(reaxff/species/kk/host,FixReaxFFSpeciesKokkos); +FixStyle(reax/c/species/kk,FixReaxFFSpeciesKokkos); +FixStyle(reax/c/species/kk/device,FixReaxFFSpeciesKokkos); +FixStyle(reax/c/species/kk/host,FixReaxFFSpeciesKokkos); // clang-format on #else -#ifndef LMP_FIX_REAXC_SPECIES_KOKKOS_H -#define LMP_FIX_REAXC_SPECIES_KOKKOS_H +#ifndef LMP_FIX_REAXFF_SPECIES_KOKKOS_H +#define LMP_FIX_REAXFF_SPECIES_KOKKOS_H -#include "fix_reaxc_species.h" +#include "fix_reaxff_species.h" #define BUFLEN 1000 namespace LAMMPS_NS { -class FixReaxCSpeciesKokkos : public FixReaxCSpecies { +class FixReaxFFSpeciesKokkos : public FixReaxFFSpecies { public: - FixReaxCSpeciesKokkos(class LAMMPS *, int, char **); - virtual ~FixReaxCSpeciesKokkos(); + FixReaxFFSpeciesKokkos(class LAMMPS *, int, char **); + virtual ~FixReaxFFSpeciesKokkos(); void init(); private: diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxff_kokkos.cpp similarity index 91% rename from src/KOKKOS/pair_reaxc_kokkos.cpp rename to src/KOKKOS/pair_reaxff_kokkos.cpp index 266a8b09f9..6e49b5081c 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxff_kokkos.cpp @@ -16,7 +16,7 @@ Contributing author: Ray Shan (SNL), Stan Moore (SNL) ------------------------------------------------------------------------- */ -#include "pair_reaxc_kokkos.h" +#include "pair_reaxff_kokkos.h" #include "atom_kokkos.h" #include "atom_masks.h" @@ -44,7 +44,7 @@ using namespace MathConst; using namespace MathSpecial; template -PairReaxCKokkos::PairReaxCKokkos(LAMMPS *lmp) : PairReaxC(lmp) +PairReaxFFKokkos::PairReaxFFKokkos(LAMMPS *lmp) : PairReaxFF(lmp) { respa_enable = 0; @@ -73,7 +73,7 @@ PairReaxCKokkos::PairReaxCKokkos(LAMMPS *lmp) : PairReaxC(lmp) /* ---------------------------------------------------------------------- */ template -PairReaxCKokkos::~PairReaxCKokkos() +PairReaxFFKokkos::~PairReaxFFKokkos() { if (copymode) return; @@ -100,28 +100,28 @@ PairReaxCKokkos::~PairReaxCKokkos() /* ---------------------------------------------------------------------- */ template -void PairReaxCKokkos::allocate() +void PairReaxFFKokkos::allocate() { int n = atom->ntypes; k_params_sing = Kokkos::DualView - ("PairReaxC::params_sing",n+1); + ("PairReaxFF::params_sing",n+1); paramssing = k_params_sing.template view(); k_params_twbp = Kokkos::DualView - ("PairReaxC::params_twbp",n+1,n+1); + ("PairReaxFF::params_twbp",n+1,n+1); paramstwbp = k_params_twbp.template view(); k_params_thbp = Kokkos::DualView - ("PairReaxC::params_thbp",n+1,n+1,n+1); + ("PairReaxFF::params_thbp",n+1,n+1,n+1); paramsthbp = k_params_thbp.template view(); k_params_fbp = Kokkos::DualView - ("PairReaxC::params_fbp",n+1,n+1,n+1,n+1); + ("PairReaxFF::params_fbp",n+1,n+1,n+1,n+1); paramsfbp = k_params_fbp.template view(); k_params_hbp = Kokkos::DualView - ("PairReaxC::params_hbp",n+1,n+1,n+1); + ("PairReaxFF::params_hbp",n+1,n+1,n+1); paramshbp = k_params_hbp.template view(); k_tap = DAT::tdual_ffloat_1d("pair:tap",8); @@ -135,9 +135,9 @@ void PairReaxCKokkos::allocate() ------------------------------------------------------------------------- */ template -void PairReaxCKokkos::init_style() +void PairReaxFFKokkos::init_style() { - PairReaxC::init_style(); + PairReaxFF::init_style(); if (fix_reax) modify->delete_fix(fix_id); // not needed in the Kokkos version fix_reax = nullptr; @@ -157,7 +157,7 @@ void PairReaxCKokkos::init_style() neighbor->requests[irequest]->half = 1; neighbor->requests[irequest]->ghost = 1; } else { - error->all(FLERR,"Must use half neighbor list with pair style reax/c/kk"); + error->all(FLERR,"Must use half neighbor list with pair style reaxff/kk"); } allocate(); @@ -168,7 +168,7 @@ void PairReaxCKokkos::init_style() /* ---------------------------------------------------------------------- */ template -void PairReaxCKokkos::setup() +void PairReaxFFKokkos::setup() { int i,j,k,m; int n = atom->ntypes; @@ -335,7 +335,7 @@ void PairReaxCKokkos::setup() /* ---------------------------------------------------------------------- */ template -void PairReaxCKokkos::init_md() +void PairReaxFFKokkos::init_md() { // init_taper() F_FLOAT d1, d7, swa, swa2, swa3, swb, swb2, swb3; @@ -430,7 +430,7 @@ void PairReaxCKokkos::init_md() /* ---------------------------------------------------------------------- */ template -int PairReaxCKokkos::Init_Lookup_Tables() +int PairReaxFFKokkos::Init_Lookup_Tables() { int i, j, r; int num_atom_types; @@ -538,7 +538,7 @@ int PairReaxCKokkos::Init_Lookup_Tables() /* ---------------------------------------------------------------------- */ template -void PairReaxCKokkos::Deallocate_Lookup_Tables() +void PairReaxFFKokkos::Deallocate_Lookup_Tables() { int i, j; int ntypes; @@ -567,7 +567,7 @@ void PairReaxCKokkos::Deallocate_Lookup_Tables() /* ---------------------------------------------------------------------- */ template -void PairReaxCKokkos::LR_vdW_Coulomb(int i, int j, double r_ij, LR_data *lr) +void PairReaxFFKokkos::LR_vdW_Coulomb(int i, int j, double r_ij, LR_data *lr) { double p_vdW1 = api->system->reax_param.gp.l[28]; double p_vdW1i = 1.0 / p_vdW1; @@ -663,7 +663,7 @@ void PairReaxCKokkos::LR_vdW_Coulomb(int i, int j, double r_ij, LR_d /* ---------------------------------------------------------------------- */ template -void PairReaxCKokkos::compute(int eflag_in, int vflag_in) +void PairReaxFFKokkos::compute(int eflag_in, int vflag_in) { copymode = 1; @@ -724,14 +724,14 @@ void PairReaxCKokkos::compute(int eflag_in, int vflag_in) // Polarization (self) if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } else { //if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } ev_all += ev; pvector[13] = ev.ecoul; @@ -740,26 +740,26 @@ void PairReaxCKokkos::compute(int eflag_in, int vflag_in) if (api->control->tabulate) { if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } else if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } } else { if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } else if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } } ev_all += ev; @@ -853,34 +853,34 @@ void PairReaxCKokkos::compute(int eflag_in, int vflag_in) // Bond energy if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; pvector[0] = ev.evdwl; } else { //if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; pvector[0] = ev.evdwl; } // Multi-body corrections if (neighflag == HALF) { - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } else { //if (neighflag == HALFTHREAD) { - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } pvector[2] = ev.ereax[0]; @@ -891,15 +891,15 @@ void PairReaxCKokkos::compute(int eflag_in, int vflag_in) // Angular if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } else { //if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } pvector[4] = ev.ereax[3]; @@ -910,15 +910,15 @@ void PairReaxCKokkos::compute(int eflag_in, int vflag_in) // Torsion if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } else { //if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } pvector[8] = ev.ereax[6]; @@ -929,15 +929,15 @@ void PairReaxCKokkos::compute(int eflag_in, int vflag_in) if (cut_hbsq > 0.0) { if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } else { //if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } } @@ -969,9 +969,9 @@ void PairReaxCKokkos::compute(int eflag_in, int vflag_in) //} if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,ignum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,ignum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,ignum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,ignum),*this); ev_all += ev; pvector[0] += ev.evdwl; } else { //if (neighflag == HALFTHREAD) { @@ -985,9 +985,9 @@ void PairReaxCKokkos::compute(int eflag_in, int vflag_in) //} if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,ignum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,ignum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,ignum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,ignum),*this); ev_all += ev; pvector[0] += ev.evdwl; } @@ -1049,7 +1049,7 @@ void PairReaxCKokkos::compute(int eflag_in, int vflag_in) template template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputePolar, const int &ii, EV_FLOAT_REAX& ev) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputePolar, const int &ii, EV_FLOAT_REAX& ev) const { const int i = d_ilist[ii]; const int itype = type(i); @@ -1067,9 +1067,9 @@ void PairReaxCKokkos::operator()(PairReaxComputePolar template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputePolar, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputePolar, const int &ii) const { EV_FLOAT_REAX ev; - this->template operator()(PairReaxComputePolar(), ii, ev); + this->template operator()(PairReaxFFomputePolar(), ii, ev); } @@ -1078,7 +1078,7 @@ void PairReaxCKokkos::operator()(PairReaxComputePolar template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeLJCoulomb, const int &ii, EV_FLOAT_REAX& ev) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeLJCoulomb, const int &ii, EV_FLOAT_REAX& ev) const { // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial @@ -1220,9 +1220,9 @@ void PairReaxCKokkos::operator()(PairReaxComputeLJCoulomb template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeLJCoulomb, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeLJCoulomb, const int &ii) const { EV_FLOAT_REAX ev; - this->template operator()(PairReaxComputeLJCoulomb(), ii, ev); + this->template operator()(PairReaxFFomputeLJCoulomb(), ii, ev); } /* ---------------------------------------------------------------------- */ @@ -1230,7 +1230,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeLJCoulomb template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeTabulatedLJCoulomb, const int &ii, EV_FLOAT_REAX& ev) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeTabulatedLJCoulomb, const int &ii, EV_FLOAT_REAX& ev) const { // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial @@ -1327,84 +1327,84 @@ void PairReaxCKokkos::operator()(PairReaxComputeTabulatedLJCoulomb template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeTabulatedLJCoulomb, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeTabulatedLJCoulomb, const int &ii) const { EV_FLOAT_REAX ev; - this->template operator()(PairReaxComputeTabulatedLJCoulomb(), ii, ev); + this->template operator()(PairReaxFFomputeTabulatedLJCoulomb(), ii, ev); } /* ---------------------------------------------------------------------- */ template -void PairReaxCKokkos::allocate_array() +void PairReaxFFKokkos::allocate_array() { if (cut_hbsq > 0.0) { - d_hb_first = typename AT::t_int_1d("reax/c/kk:hb_first",nmax); - d_hb_num = typename AT::t_int_1d("reax/c/kk:hb_num",nmax); - d_hb_list = typename AT::t_int_1d("reax/c/kk:hb_list",nmax*maxhb); + d_hb_first = typename AT::t_int_1d("reaxff/kk:hb_first",nmax); + d_hb_num = typename AT::t_int_1d("reaxff/kk:hb_num",nmax); + d_hb_list = typename AT::t_int_1d("reaxff/kk:hb_list",nmax*maxhb); } - d_bo_first = typename AT::t_int_1d("reax/c/kk:bo_first",nmax); - d_bo_num = typename AT::t_int_1d("reax/c/kk:bo_num",nmax); - d_bo_list = typename AT::t_int_1d("reax/c/kk:bo_list",nmax*maxbo); + d_bo_first = typename AT::t_int_1d("reaxff/kk:bo_first",nmax); + d_bo_num = typename AT::t_int_1d("reaxff/kk:bo_num",nmax); + d_bo_list = typename AT::t_int_1d("reaxff/kk:bo_list",nmax*maxbo); - d_BO = typename AT::t_ffloat_2d_dl("reax/c/kk:BO",nmax,maxbo); - d_BO_s = typename AT::t_ffloat_2d_dl("reax/c/kk:BO",nmax,maxbo); - d_BO_pi = typename AT::t_ffloat_2d_dl("reax/c/kk:BO_pi",nmax,maxbo); - d_BO_pi2 = typename AT::t_ffloat_2d_dl("reax/c/kk:BO_pi2",nmax,maxbo); + d_BO = typename AT::t_ffloat_2d_dl("reaxff/kk:BO",nmax,maxbo); + d_BO_s = typename AT::t_ffloat_2d_dl("reaxff/kk:BO",nmax,maxbo); + d_BO_pi = typename AT::t_ffloat_2d_dl("reaxff/kk:BO_pi",nmax,maxbo); + d_BO_pi2 = typename AT::t_ffloat_2d_dl("reaxff/kk:BO_pi2",nmax,maxbo); - d_dln_BOp_pix = typename AT::t_ffloat_2d_dl("reax/c/kk:d_dln_BOp_pix",nmax,maxbo); - d_dln_BOp_piy = typename AT::t_ffloat_2d_dl("reax/c/kk:d_dln_BOp_piy",nmax,maxbo); - d_dln_BOp_piz = typename AT::t_ffloat_2d_dl("reax/c/kk:d_dln_BOp_piz",nmax,maxbo); + d_dln_BOp_pix = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_pix",nmax,maxbo); + d_dln_BOp_piy = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_piy",nmax,maxbo); + d_dln_BOp_piz = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_piz",nmax,maxbo); - d_dln_BOp_pi2x = typename AT::t_ffloat_2d_dl("reax/c/kk:d_dln_BOp_pi2x",nmax,maxbo); - d_dln_BOp_pi2y = typename AT::t_ffloat_2d_dl("reax/c/kk:d_dln_BOp_pi2y",nmax,maxbo); - d_dln_BOp_pi2z = typename AT::t_ffloat_2d_dl("reax/c/kk:d_dln_BOp_pi2z",nmax,maxbo); + d_dln_BOp_pi2x = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_pi2x",nmax,maxbo); + d_dln_BOp_pi2y = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_pi2y",nmax,maxbo); + d_dln_BOp_pi2z = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_pi2z",nmax,maxbo); - d_C1dbo = typename AT::t_ffloat_2d_dl("reax/c/kk:d_C1dbo",nmax,maxbo); - d_C2dbo = typename AT::t_ffloat_2d_dl("reax/c/kk:d_C2dbo",nmax,maxbo); - d_C3dbo = typename AT::t_ffloat_2d_dl("reax/c/kk:d_C3dbo",nmax,maxbo); + d_C1dbo = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C1dbo",nmax,maxbo); + d_C2dbo = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C2dbo",nmax,maxbo); + d_C3dbo = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C3dbo",nmax,maxbo); - d_C1dbopi = typename AT::t_ffloat_2d_dl("reax/c/kk:d_C1dbopi",nmax,maxbo); - d_C2dbopi = typename AT::t_ffloat_2d_dl("reax/c/kk:d_C2dbopi",nmax,maxbo); - d_C3dbopi = typename AT::t_ffloat_2d_dl("reax/c/kk:d_C3dbopi",nmax,maxbo); - d_C4dbopi = typename AT::t_ffloat_2d_dl("reax/c/kk:d_C4dbopi",nmax,maxbo); + d_C1dbopi = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C1dbopi",nmax,maxbo); + d_C2dbopi = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C2dbopi",nmax,maxbo); + d_C3dbopi = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C3dbopi",nmax,maxbo); + d_C4dbopi = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C4dbopi",nmax,maxbo); - d_C1dbopi2 = typename AT::t_ffloat_2d_dl("reax/c/kk:d_C1dbopi2",nmax,maxbo); - d_C2dbopi2 = typename AT::t_ffloat_2d_dl("reax/c/kk:d_C2dbopi2",nmax,maxbo); - d_C3dbopi2 = typename AT::t_ffloat_2d_dl("reax/c/kk:d_C3dbopi2",nmax,maxbo); - d_C4dbopi2 = typename AT::t_ffloat_2d_dl("reax/c/kk:d_C4dbopi2",nmax,maxbo); + d_C1dbopi2 = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C1dbopi2",nmax,maxbo); + d_C2dbopi2 = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C2dbopi2",nmax,maxbo); + d_C3dbopi2 = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C3dbopi2",nmax,maxbo); + d_C4dbopi2 = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C4dbopi2",nmax,maxbo); - d_dBOpx = typename AT::t_ffloat_2d_dl("reax/c/kk:dBOpx",nmax,maxbo); - d_dBOpy = typename AT::t_ffloat_2d_dl("reax/c/kk:dBOpy",nmax,maxbo); - d_dBOpz = typename AT::t_ffloat_2d_dl("reax/c/kk:dBOpz",nmax,maxbo); + d_dBOpx = typename AT::t_ffloat_2d_dl("reaxff/kk:dBOpx",nmax,maxbo); + d_dBOpy = typename AT::t_ffloat_2d_dl("reaxff/kk:dBOpy",nmax,maxbo); + d_dBOpz = typename AT::t_ffloat_2d_dl("reaxff/kk:dBOpz",nmax,maxbo); - d_dDeltap_self = typename AT::t_ffloat_2d_dl("reax/c/kk:dDeltap_self",nmax,3); - d_Deltap_boc = typename AT::t_ffloat_1d("reax/c/kk:Deltap_boc",nmax); - d_Deltap = typename AT::t_ffloat_1d("reax/c/kk:Deltap",nmax); - d_total_bo = typename AT::t_ffloat_1d("reax/c/kk:total_bo",nmax); + d_dDeltap_self = typename AT::t_ffloat_2d_dl("reaxff/kk:dDeltap_self",nmax,3); + d_Deltap_boc = typename AT::t_ffloat_1d("reaxff/kk:Deltap_boc",nmax); + d_Deltap = typename AT::t_ffloat_1d("reaxff/kk:Deltap",nmax); + d_total_bo = typename AT::t_ffloat_1d("reaxff/kk:total_bo",nmax); - d_Cdbo = typename AT::t_ffloat_2d_dl("reax/c/kk:Cdbo",nmax,3*maxbo); - d_Cdbopi = typename AT::t_ffloat_2d_dl("reax/c/kk:Cdbopi",nmax,3*maxbo); - d_Cdbopi2 = typename AT::t_ffloat_2d_dl("reax/c/kk:Cdbopi2",nmax,3*maxbo); + d_Cdbo = typename AT::t_ffloat_2d_dl("reaxff/kk:Cdbo",nmax,3*maxbo); + d_Cdbopi = typename AT::t_ffloat_2d_dl("reaxff/kk:Cdbopi",nmax,3*maxbo); + d_Cdbopi2 = typename AT::t_ffloat_2d_dl("reaxff/kk:Cdbopi2",nmax,3*maxbo); - d_Delta = typename AT::t_ffloat_1d("reax/c/kk:Delta",nmax); - d_Delta_boc = typename AT::t_ffloat_1d("reax/c/kk:Delta_boc",nmax); - d_dDelta_lp = typename AT::t_ffloat_1d("reax/c/kk:dDelta_lp",nmax); - d_Delta_lp = typename AT::t_ffloat_1d("reax/c/kk:Delta_lp",nmax); - d_Delta_lp_temp = typename AT::t_ffloat_1d("reax/c/kk:Delta_lp_temp",nmax); - d_CdDelta = typename AT::t_ffloat_1d("reax/c/kk:CdDelta",nmax); - d_sum_ovun = typename AT::t_ffloat_2d_dl("reax/c/kk:sum_ovun",nmax,3); + d_Delta = typename AT::t_ffloat_1d("reaxff/kk:Delta",nmax); + d_Delta_boc = typename AT::t_ffloat_1d("reaxff/kk:Delta_boc",nmax); + d_dDelta_lp = typename AT::t_ffloat_1d("reaxff/kk:dDelta_lp",nmax); + d_Delta_lp = typename AT::t_ffloat_1d("reaxff/kk:Delta_lp",nmax); + d_Delta_lp_temp = typename AT::t_ffloat_1d("reaxff/kk:Delta_lp_temp",nmax); + d_CdDelta = typename AT::t_ffloat_1d("reaxff/kk:CdDelta",nmax); + d_sum_ovun = typename AT::t_ffloat_2d_dl("reaxff/kk:sum_ovun",nmax,3); - // FixReaxCBonds - d_abo = typename AT::t_ffloat_2d("reax/c/kk:abo",nmax,maxbo); - d_neighid = typename AT::t_tagint_2d("reax/c/kk:neighid",nmax,maxbo); - d_numneigh_bonds = typename AT::t_int_1d("reax/c/kk:numneigh_bonds",nmax); + // FixReaxFFBonds + d_abo = typename AT::t_ffloat_2d("reaxff/kk:abo",nmax,maxbo); + d_neighid = typename AT::t_tagint_2d("reaxff/kk:neighid",nmax,maxbo); + d_numneigh_bonds = typename AT::t_int_1d("reaxff/kk:numneigh_bonds",nmax); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxZero, const int &n) const { +void PairReaxFFKokkos::operator()(PairReaxZero, const int &n) const { d_total_bo(n) = 0.0; d_CdDelta(n) = 0.0; d_bo_num(n) = 0.0; @@ -1415,13 +1415,13 @@ void PairReaxCKokkos::operator()(PairReaxZero, const int &n) const { template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxZeroEAtom, const int &i) const { +void PairReaxFFKokkos::operator()(PairReaxZeroEAtom, const int &i) const { d_eatom(i) = 0.0; } template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxZeroVAtom, const int &i) const { +void PairReaxFFKokkos::operator()(PairReaxZeroVAtom, const int &i) const { d_vatom(i,0) = 0.0; d_vatom(i,1) = 0.0; d_vatom(i,2) = 0.0; @@ -1434,7 +1434,7 @@ void PairReaxCKokkos::operator()(PairReaxZeroVAtom, const int &i) co template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxBuildListsFull, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxBuildListsFull, const int &ii) const { if (d_resize_bo() || d_resize_hb()) return; @@ -1592,7 +1592,7 @@ void PairReaxCKokkos::operator()(PairReaxBuildListsFull, const int & template template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxBuildListsHalf, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxBuildListsHalf, const int &ii) const { if (d_resize_bo() || d_resize_hb()) return; @@ -1805,7 +1805,7 @@ void PairReaxCKokkos::operator()(PairReaxBuildListsHalf, template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxBondOrder1, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxBondOrder1, const int &ii) const { const int i = d_ilist[ii]; const int itype = type(i); @@ -1819,7 +1819,7 @@ void PairReaxCKokkos::operator()(PairReaxBondOrder1, const int &ii) template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxBondOrder2, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxBondOrder2, const int &ii) const { F_FLOAT exp_p1i, exp_p2i, exp_p1j, exp_p2j, f1, f2, f3, u1_ij, u1_ji, Cf1A_ij, Cf1B_ij, Cf1_ij, Cf1_ji; F_FLOAT f4, f5, exp_f4, exp_f5, f4f5, Cf45_ij, Cf45_ji; @@ -1953,7 +1953,7 @@ void PairReaxCKokkos::operator()(PairReaxBondOrder2, const int &ii) template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxBondOrder3, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxBondOrder3, const int &ii) const { // bot part of BO() const int i = d_ilist[ii]; @@ -1989,7 +1989,7 @@ void PairReaxCKokkos::operator()(PairReaxBondOrder3, const int &ii) template template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeMulti1, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeMulti1, const int &ii) const { const int i = d_ilist[ii]; const int itype = type(i); @@ -2023,7 +2023,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeMulti1 template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeMulti2, const int &ii, EV_FLOAT_REAX& ev) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeMulti2, const int &ii, EV_FLOAT_REAX& ev) const { auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); auto a_CdDelta = v_CdDelta.template access::value>(); @@ -2164,9 +2164,9 @@ void PairReaxCKokkos::operator()(PairReaxComputeMulti2 template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeMulti2, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeMulti2, const int &ii) const { EV_FLOAT_REAX ev; - this->template operator()(PairReaxComputeMulti2(), ii, ev); + this->template operator()(PairReaxFFomputeMulti2(), ii, ev); } @@ -2175,7 +2175,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeMulti2 template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeAngular, const int &ii, EV_FLOAT_REAX& ev) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeAngular, const int &ii, EV_FLOAT_REAX& ev) const { auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); auto a_f = v_f.template access::value>(); @@ -2476,9 +2476,9 @@ void PairReaxCKokkos::operator()(PairReaxComputeAngular template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeAngular, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeAngular, const int &ii) const { EV_FLOAT_REAX ev; - this->template operator()(PairReaxComputeAngular(), ii, ev); + this->template operator()(PairReaxFFomputeAngular(), ii, ev); } @@ -2487,7 +2487,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeAngular template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeTorsion, const int &ii, EV_FLOAT_REAX& ev) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeTorsion, const int &ii, EV_FLOAT_REAX& ev) const { auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); auto a_f = v_f.template access::value>(); @@ -2497,7 +2497,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeTorsion::value,Kokkos::MemoryTraits::value> > a_Cdbo = d_Cdbo; //auto a_Cdbo = dup_Cdbo.template access::value>(); - // in reaxc_torsion_angles: j = i, k = j, i = k; + // in reaxff_torsion_angles: j = i, k = j, i = k; F_FLOAT Delta_i, Delta_j, bo_ij, bo_ik, bo_jl, BOA_ij, BOA_ik, BOA_jl; F_FLOAT p_tor1, p_cot1, V1, V2, V3; @@ -2851,9 +2851,9 @@ void PairReaxCKokkos::operator()(PairReaxComputeTorsion template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeTorsion, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeTorsion, const int &ii) const { EV_FLOAT_REAX ev; - this->template operator()(PairReaxComputeTorsion(), ii, ev); + this->template operator()(PairReaxFFomputeTorsion(), ii, ev); } @@ -2862,7 +2862,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeTorsion template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeHydrogen, const int &ii, EV_FLOAT_REAX& ev) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeHydrogen, const int &ii, EV_FLOAT_REAX& ev) const { auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); auto a_f = v_f.template access::value>(); @@ -2998,9 +2998,9 @@ void PairReaxCKokkos::operator()(PairReaxComputeHydrogen template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeHydrogen, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeHydrogen, const int &ii) const { EV_FLOAT_REAX ev; - this->template operator()(PairReaxComputeHydrogen(), ii, ev); + this->template operator()(PairReaxFFomputeHydrogen(), ii, ev); } @@ -3009,7 +3009,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeHydrogen template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxUpdateBond, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxUpdateBond, const int &ii) const { Kokkos::View::value,Kokkos::MemoryTraits::value> > a_Cdbo = d_Cdbo; Kokkos::View::value,Kokkos::MemoryTraits::value> > a_Cdbopi = d_Cdbopi; @@ -3061,7 +3061,7 @@ void PairReaxCKokkos::operator()(PairReaxUpdateBond, cons template template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeBond1, const int &ii, EV_FLOAT_REAX& ev) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeBond1, const int &ii, EV_FLOAT_REAX& ev) const { auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); @@ -3168,9 +3168,9 @@ void PairReaxCKokkos::operator()(PairReaxComputeBond1 template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeBond1, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeBond1, const int &ii) const { EV_FLOAT_REAX ev; - this->template operator()(PairReaxComputeBond1(), ii, ev); + this->template operator()(PairReaxFFomputeBond1(), ii, ev); } @@ -3179,7 +3179,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeBond1 template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeBond2, const int &ii, EV_FLOAT_REAX& ev) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeBond2, const int &ii, EV_FLOAT_REAX& ev) const { auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); auto a_f = v_f.template access::value>(); @@ -3369,9 +3369,9 @@ void PairReaxCKokkos::operator()(PairReaxComputeBond2 template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxComputeBond2, const int &ii) const { +void PairReaxFFKokkos::operator()(PairReaxFFomputeBond2, const int &ii) const { EV_FLOAT_REAX ev; - this->template operator()(PairReaxComputeBond2(), ii, ev); + this->template operator()(PairReaxFFomputeBond2(), ii, ev); } @@ -3380,7 +3380,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeBond2 template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::ev_tally(EV_FLOAT_REAX &ev, const int &i, const int &j, +void PairReaxFFKokkos::ev_tally(EV_FLOAT_REAX &ev, const int &i, const int &j, const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const { @@ -3439,7 +3439,7 @@ void PairReaxCKokkos::ev_tally(EV_FLOAT_REAX &ev, const int &i, cons template template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::e_tally(EV_FLOAT_REAX & /*ev*/, const int &i, const int &j, +void PairReaxFFKokkos::e_tally(EV_FLOAT_REAX & /*ev*/, const int &i, const int &j, const F_FLOAT &epair) const { @@ -3461,7 +3461,7 @@ void PairReaxCKokkos::e_tally(EV_FLOAT_REAX & /*ev*/, const int &i, template template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::e_tally_single(EV_FLOAT_REAX & /*ev*/, const int &i, +void PairReaxFFKokkos::e_tally_single(EV_FLOAT_REAX & /*ev*/, const int &i, const F_FLOAT &epair) const { // The eatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial @@ -3476,7 +3476,7 @@ void PairReaxCKokkos::e_tally_single(EV_FLOAT_REAX & /*ev*/, const i template template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::v_tally(EV_FLOAT_REAX &ev, const int &i, +void PairReaxFFKokkos::v_tally(EV_FLOAT_REAX &ev, const int &i, F_FLOAT *fi, F_FLOAT *drij) const { @@ -3512,7 +3512,7 @@ void PairReaxCKokkos::v_tally(EV_FLOAT_REAX &ev, const int &i, template template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::v_tally3(EV_FLOAT_REAX &ev, const int &i, const int &j, const int &k, +void PairReaxFFKokkos::v_tally3(EV_FLOAT_REAX &ev, const int &i, const int &j, const int &k, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drij, F_FLOAT *drik) const { @@ -3554,7 +3554,7 @@ void PairReaxCKokkos::v_tally3(EV_FLOAT_REAX &ev, const int &i, cons template template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::v_tally4(EV_FLOAT_REAX &ev, const int &i, const int &j, const int &k, +void PairReaxFFKokkos::v_tally4(EV_FLOAT_REAX &ev, const int &i, const int &j, const int &k, const int &l, F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *dril, F_FLOAT *drjl, F_FLOAT *drkl) const { @@ -3598,7 +3598,7 @@ void PairReaxCKokkos::v_tally4(EV_FLOAT_REAX &ev, const int &i, cons template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::v_tally3_atom(EV_FLOAT_REAX &ev, const int &i, const int & /*j*/, +void PairReaxFFKokkos::v_tally3_atom(EV_FLOAT_REAX &ev, const int &i, const int & /*j*/, const int & /*k*/, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const { @@ -3634,7 +3634,7 @@ void PairReaxCKokkos::v_tally3_atom(EV_FLOAT_REAX &ev, const int &i, ------------------------------------------------------------------------- */ template -void PairReaxCKokkos::ev_setup(int eflag, int vflag, int) +void PairReaxFFKokkos::ev_setup(int eflag, int vflag, int) { int i; @@ -3689,7 +3689,7 @@ void PairReaxCKokkos::ev_setup(int eflag, int vflag, int) /* ---------------------------------------------------------------------- */ template -double PairReaxCKokkos::memory_usage() +double PairReaxFFKokkos::memory_usage() { double bytes = 0.0; @@ -3703,13 +3703,13 @@ double PairReaxCKokkos::memory_usage() bytes += (double)nmax*17*sizeof(F_FLOAT); bytes += (double)maxbo*nmax*34*sizeof(F_FLOAT); - // FixReaxCSpecies + // FixReaxFFSpecies if (fixspecies_flag) { bytes += (double)MAXSPECBOND*nmax*sizeof(tagint); bytes += (double)MAXSPECBOND*nmax*sizeof(F_FLOAT); } - // FixReaxCBonds + // FixReaxFFBonds bytes += (double)maxbo*nmax*sizeof(tagint); bytes += (double)maxbo*nmax*sizeof(F_FLOAT); bytes += (double)nmax*sizeof(int); @@ -3720,7 +3720,7 @@ double PairReaxCKokkos::memory_usage() /* ---------------------------------------------------------------------- */ template -void PairReaxCKokkos::FindBond(int &numbonds) +void PairReaxFFKokkos::FindBond(int &numbonds) { copymode = 1; Kokkos::parallel_for(Kokkos::RangePolicy(0,nmax),*this); @@ -3735,14 +3735,14 @@ void PairReaxCKokkos::FindBond(int &numbonds) d_ilist = k_list->d_ilist; numbonds = 0; - PairReaxCKokkosFindBondFunctor find_bond_functor(this); + PairReaxFFKokkosFindBondFunctor find_bond_functor(this); Kokkos::parallel_reduce(inum,find_bond_functor,numbonds); copymode = 0; } template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxFindBondZero, const int &i) const { +void PairReaxFFKokkos::operator()(PairReaxFindBondZero, const int &i) const { d_numneigh_bonds[i] = 0; for (int j = 0; j < maxbo; j++) { d_neighid(i,j) = 0; @@ -3752,7 +3752,7 @@ void PairReaxCKokkos::operator()(PairReaxFindBondZero, const int &i) template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::calculate_find_bond_item(int ii, int &numbonds) const +void PairReaxFFKokkos::calculate_find_bond_item(int ii, int &numbonds) const { const int i = d_ilist[ii]; int nj = 0; @@ -3779,7 +3779,7 @@ void PairReaxCKokkos::calculate_find_bond_item(int ii, int &numbonds /* ---------------------------------------------------------------------- */ template -void PairReaxCKokkos::PackBondBuffer(DAT::tdual_ffloat_1d k_buf, int &nbuf_local) +void PairReaxFFKokkos::PackBondBuffer(DAT::tdual_ffloat_1d k_buf, int &nbuf_local) { d_buf = k_buf.view(); k_params_sing.template sync(); @@ -3793,7 +3793,7 @@ void PairReaxCKokkos::PackBondBuffer(DAT::tdual_ffloat_1d k_buf, int copymode = 1; nlocal = atomKK->nlocal; - PairReaxCKokkosPackBondBufferFunctor pack_bond_buffer_functor(this); + PairReaxFFKokkosPackBondBufferFunctor pack_bond_buffer_functor(this); Kokkos::parallel_scan(nlocal,pack_bond_buffer_functor); copymode = 0; @@ -3807,7 +3807,7 @@ void PairReaxCKokkos::PackBondBuffer(DAT::tdual_ffloat_1d k_buf, int template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::pack_bond_buffer_item(int i, int &j, const bool &final) const +void PairReaxFFKokkos::pack_bond_buffer_item(int i, int &j, const bool &final) const { if (i == 0) j += 2; @@ -3849,7 +3849,7 @@ void PairReaxCKokkos::pack_bond_buffer_item(int i, int &j, const boo /* ---------------------------------------------------------------------- */ template -void PairReaxCKokkos::FindBondSpecies() +void PairReaxFFKokkos::FindBondSpecies() { if (nmax > (int)k_tmpid.extent(0)) { @@ -3877,12 +3877,12 @@ void PairReaxCKokkos::FindBondSpecies() k_error_flag.sync(); if (k_error_flag.h_view()) - error->all(FLERR,"Increase MAXSPECBOND in reaxc_defs.h"); + error->all(FLERR,"Increase MAXSPECBOND in reaxff_defs.h"); } template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxFindBondSpeciesZero, const int &i) const { +void PairReaxFFKokkos::operator()(PairReaxFindBondSpeciesZero, const int &i) const { for (int j = 0; j < MAXSPECBOND; j++) { k_tmpbo.view()(i,j) = 0.0; k_tmpid.view()(i,j) = 0; @@ -3891,7 +3891,7 @@ void PairReaxCKokkos::operator()(PairReaxFindBondSpeciesZero, const template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::operator()(PairReaxFindBondSpecies, const int &i) const { +void PairReaxFFKokkos::operator()(PairReaxFindBondSpecies, const int &i) const { int nj = 0; const int j_start = d_bo_first[i]; @@ -3913,8 +3913,8 @@ void PairReaxCKokkos::operator()(PairReaxFindBondSpecies, const int } } -template class PairReaxCKokkos; +template class PairReaxFFKokkos; #ifdef LMP_KOKKOS_GPU -template class PairReaxCKokkos; +template class PairReaxFFKokkos; #endif } diff --git a/src/KOKKOS/pair_reaxc_kokkos.h b/src/KOKKOS/pair_reaxff_kokkos.h similarity index 86% rename from src/KOKKOS/pair_reaxc_kokkos.h rename to src/KOKKOS/pair_reaxff_kokkos.h index d7457f54fd..08f0911292 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.h +++ b/src/KOKKOS/pair_reaxff_kokkos.h @@ -15,9 +15,12 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(reax/c/kk,PairReaxCKokkos); -PairStyle(reax/c/kk/device,PairReaxCKokkos); -PairStyle(reax/c/kk/host,PairReaxCKokkos); +PairStyle(reaxff/kk,PairReaxFFKokkos); +PairStyle(reaxff/kk/device,PairReaxFFKokkos); +PairStyle(reaxff/kk/host,PairReaxFFKokkos); +PairStyle(reax/c/kk,PairReaxFFKokkos); +PairStyle(reax/c/kk/device,PairReaxFFKokkos); +PairStyle(reax/c/kk/host,PairReaxFFKokkos); // clang-format on #else @@ -25,7 +28,7 @@ PairStyle(reax/c/kk/host,PairReaxCKokkos); #define LMP_PAIR_REAXC_KOKKOS_H #include "pair_kokkos.h" -#include "pair_reaxc.h" +#include "pair_reaxff.h" #include "neigh_list_kokkos.h" #define C_ele 332.06371 @@ -53,13 +56,13 @@ struct LR_lookup_table_kk }; template -struct PairReaxComputePolar{}; +struct PairReaxFFomputePolar{}; template -struct PairReaxComputeLJCoulomb{}; +struct PairReaxFFomputeLJCoulomb{}; template -struct PairReaxComputeTabulatedLJCoulomb{}; +struct PairReaxFFomputeTabulatedLJCoulomb{}; struct PairReaxBuildListsFull{}; @@ -82,25 +85,25 @@ template struct PairReaxUpdateBond{}; template -struct PairReaxComputeBond1{}; +struct PairReaxFFomputeBond1{}; template -struct PairReaxComputeBond2{}; +struct PairReaxFFomputeBond2{}; template -struct PairReaxComputeMulti1{}; +struct PairReaxFFomputeMulti1{}; template -struct PairReaxComputeMulti2{}; +struct PairReaxFFomputeMulti2{}; template -struct PairReaxComputeAngular{}; +struct PairReaxFFomputeAngular{}; template -struct PairReaxComputeTorsion{}; +struct PairReaxFFomputeTorsion{}; template -struct PairReaxComputeHydrogen{}; +struct PairReaxFFomputeHydrogen{}; struct PairReaxFindBondZero{}; @@ -110,7 +113,7 @@ struct PairReaxFindBondSpecies{}; template -class PairReaxCKokkos : public PairReaxC { +class PairReaxFFKokkos : public PairReaxFF { public: enum {EnabledNeighFlags=FULL|HALF|HALFTHREAD}; enum {COUL_FLAG=1}; @@ -118,8 +121,8 @@ class PairReaxCKokkos : public PairReaxC { typedef ArrayTypes AT; typedef EV_FLOAT_REAX value_type; - PairReaxCKokkos(class LAMMPS *); - virtual ~PairReaxCKokkos(); + PairReaxFFKokkos(class LAMMPS *); + virtual ~PairReaxFFKokkos(); void ev_setup(int, int, int alloc = 1); void compute(int, int); @@ -131,27 +134,27 @@ class PairReaxCKokkos : public PairReaxC { template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputePolar, const int&, EV_FLOAT_REAX&) const; + void operator()(PairReaxFFomputePolar, const int&, EV_FLOAT_REAX&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputePolar, const int&) const; + void operator()(PairReaxFFomputePolar, const int&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeLJCoulomb, const int&, EV_FLOAT_REAX&) const; + void operator()(PairReaxFFomputeLJCoulomb, const int&, EV_FLOAT_REAX&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeLJCoulomb, const int&) const; + void operator()(PairReaxFFomputeLJCoulomb, const int&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeTabulatedLJCoulomb, const int&, EV_FLOAT_REAX&) const; + void operator()(PairReaxFFomputeTabulatedLJCoulomb, const int&, EV_FLOAT_REAX&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeTabulatedLJCoulomb, const int&) const; + void operator()(PairReaxFFomputeTabulatedLJCoulomb, const int&) const; KOKKOS_INLINE_FUNCTION void operator()(PairReaxBuildListsFull, const int&) const; @@ -184,55 +187,55 @@ class PairReaxCKokkos : public PairReaxC { template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeBond1, const int&, EV_FLOAT_REAX&) const; + void operator()(PairReaxFFomputeBond1, const int&, EV_FLOAT_REAX&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeBond1, const int&) const; + void operator()(PairReaxFFomputeBond1, const int&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeBond2, const int&, EV_FLOAT_REAX&) const; + void operator()(PairReaxFFomputeBond2, const int&, EV_FLOAT_REAX&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeBond2, const int&) const; + void operator()(PairReaxFFomputeBond2, const int&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeMulti1, const int&) const; + void operator()(PairReaxFFomputeMulti1, const int&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeMulti2, const int&, EV_FLOAT_REAX&) const; + void operator()(PairReaxFFomputeMulti2, const int&, EV_FLOAT_REAX&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeMulti2, const int&) const; + void operator()(PairReaxFFomputeMulti2, const int&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeAngular, const int&, EV_FLOAT_REAX&) const; + void operator()(PairReaxFFomputeAngular, const int&, EV_FLOAT_REAX&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeAngular, const int&) const; + void operator()(PairReaxFFomputeAngular, const int&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeTorsion, const int&, EV_FLOAT_REAX&) const; + void operator()(PairReaxFFomputeTorsion, const int&, EV_FLOAT_REAX&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeTorsion, const int&) const; + void operator()(PairReaxFFomputeTorsion, const int&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeHydrogen, const int&, EV_FLOAT_REAX&) const; + void operator()(PairReaxFFomputeHydrogen, const int&, EV_FLOAT_REAX&) const; template KOKKOS_INLINE_FUNCTION - void operator()(PairReaxComputeHydrogen, const int&) const; + void operator()(PairReaxFFomputeHydrogen, const int&) const; KOKKOS_INLINE_FUNCTION void operator()(PairReaxFindBondZero, const int&) const; @@ -433,7 +436,7 @@ class PairReaxCKokkos : public PairReaxC { int vdwflag, lgflag; F_FLOAT gp[39], p_boc1, p_boc2; - friend void pair_virial_fdotr_compute(PairReaxCKokkos*); + friend void pair_virial_fdotr_compute(PairReaxFFKokkos*); int bocnt,hbcnt,enobondsflag; @@ -458,11 +461,11 @@ class PairReaxCKokkos : public PairReaxC { }; template -struct PairReaxCKokkosFindBondFunctor { +struct PairReaxFFKokkosFindBondFunctor { typedef DeviceType device_type; typedef int value_type; - PairReaxCKokkos c; - PairReaxCKokkosFindBondFunctor(PairReaxCKokkos* c_ptr):c(*c_ptr) {}; + PairReaxFFKokkos c; + PairReaxFFKokkosFindBondFunctor(PairReaxFFKokkos* c_ptr):c(*c_ptr) {}; KOKKOS_INLINE_FUNCTION void join(volatile int &dst, @@ -477,11 +480,11 @@ struct PairReaxCKokkosFindBondFunctor { }; template -struct PairReaxCKokkosPackBondBufferFunctor { +struct PairReaxFFKokkosPackBondBufferFunctor { typedef DeviceType device_type; typedef int value_type; - PairReaxCKokkos c; - PairReaxCKokkosPackBondBufferFunctor(PairReaxCKokkos* c_ptr):c(*c_ptr) {}; + PairReaxFFKokkos c; + PairReaxFFKokkosPackBondBufferFunctor(PairReaxFFKokkos* c_ptr):c(*c_ptr) {}; KOKKOS_INLINE_FUNCTION void operator()(const int ii, int &j, const bool &final) const { diff --git a/src/OPENMP/fix_qeq_reax_omp.cpp b/src/OPENMP/fix_qeq_reaxff_omp.cpp similarity index 92% rename from src/OPENMP/fix_qeq_reax_omp.cpp rename to src/OPENMP/fix_qeq_reaxff_omp.cpp index 4cdab8a6fa..89b75bfe7a 100644 --- a/src/OPENMP/fix_qeq_reax_omp.cpp +++ b/src/OPENMP/fix_qeq_reaxff_omp.cpp @@ -18,11 +18,11 @@ Hybrid & sub-group capabilities added by Ray Shan (Materials Design) - OpenMP based threading support for fix qeq/reax/omp added + OpenMP based threading support for fix qeq/reaxff/omp added by Hasan Metin Aktulga (MSU), Chris Knight (ALCF), Paul Coffman (ALCF), Kurt O'Hearn (MSU), Ray Shan (Materials Design), Wei Jiang (ALCF) - Integration of the pair_style reax/c/omp into the OPENMP package + Integration of the pair_style reaxff/omp into the OPENMP package by Axel Kohlmeyer (Temple U.) Please cite the related publication: @@ -32,7 +32,7 @@ High Performance Computing Applications, to appear. ------------------------------------------------------------------------- */ -#include "fix_qeq_reax_omp.h" +#include "fix_qeq_reaxff_omp.h" #include "atom.h" #include "comm.h" @@ -41,7 +41,7 @@ #include "neigh_list.h" #include "update.h" -#include "pair_reaxc.h" +#include "pair_reaxff.h" #include "reaxff_defs.h" #include @@ -55,8 +55,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixQEqReaxOMP::FixQEqReaxOMP(LAMMPS *lmp, int narg, char **arg) : - FixQEqReax(lmp, narg, arg) +FixQEqReaxFFOMP::FixQEqReaxFFOMP(LAMMPS *lmp, int narg, char **arg) : + FixQEqReaxFF(lmp, narg, arg) { b_temp = nullptr; @@ -69,14 +69,14 @@ FixQEqReaxOMP::FixQEqReaxOMP(LAMMPS *lmp, int narg, char **arg) : aspc_b = nullptr; } -FixQEqReaxOMP::~FixQEqReaxOMP() +FixQEqReaxFFOMP::~FixQEqReaxFFOMP() { memory->destroy(b_temp); } /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::post_constructor() +void FixQEqReaxFFOMP::post_constructor() { grow_arrays(atom->nmax); for (int i = 0; i < atom->nmax; i++) @@ -88,34 +88,34 @@ void FixQEqReaxOMP::post_constructor() /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::allocate_storage() +void FixQEqReaxFFOMP::allocate_storage() { - FixQEqReax::allocate_storage(); + FixQEqReaxFF::allocate_storage(); // dual CG support int size = nmax; if (dual_enabled) size*= 2; - memory->create(b_temp, comm->nthreads, size, "qeq/reax/omp:b_temp"); + memory->create(b_temp, comm->nthreads, size, "qeq/reaxff/omp:b_temp"); } /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::deallocate_storage() +void FixQEqReaxFFOMP::deallocate_storage() { memory->destroy(b_temp); - FixQEqReax::deallocate_storage(); + FixQEqReaxFF::deallocate_storage(); } /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::init() +void FixQEqReaxFFOMP::init() { - FixQEqReax::init(); + FixQEqReaxFF::init(); // APSC setup if (do_aspc) { - memory->create(aspc_b, aspc_order_max+2, "qeq/reax/aspc_b"); + memory->create(aspc_b, aspc_order_max+2, "qeq/reaxff/aspc_b"); // Calculate damping factor double o = double(aspc_order); @@ -144,7 +144,7 @@ void FixQEqReaxOMP::init() /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::compute_H() +void FixQEqReaxFFOMP::compute_H() { double SMALL = 0.0001; @@ -224,13 +224,13 @@ void FixQEqReaxOMP::compute_H() } // omp if (m_fill >= H.m) - error->all(FLERR,fmt::format("Fix qeq/reax: H matrix size has been " + error->all(FLERR,fmt::format("Fix qeq/reaxff: H matrix size has been " "exceeded: m_fill={} H.m={}\n", m_fill, H.m)); } /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::init_storage() +void FixQEqReaxFFOMP::init_storage() { #if defined(_OPENMP) #pragma omp parallel for schedule(static) @@ -247,18 +247,18 @@ void FixQEqReaxOMP::init_storage() /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::pre_force(int /* vflag */) +void FixQEqReaxFFOMP::pre_force(int /* vflag */) { if (update->ntimestep % nevery) return; int n = atom->nlocal; - if (reaxc) { - nn = reaxc->list->inum; - NN = reaxc->list->inum + reaxc->list->gnum; - ilist = reaxc->list->ilist; - numneigh = reaxc->list->numneigh; - firstneigh = reaxc->list->firstneigh; + if (reaxff) { + nn = reaxff->list->inum; + NN = reaxff->list->inum + reaxff->list->gnum; + ilist = reaxff->list->ilist; + numneigh = reaxff->list->numneigh; + firstneigh = reaxff->list->firstneigh; } else { nn = list->inum; NN = list->inum + list->gnum; @@ -289,7 +289,7 @@ void FixQEqReaxOMP::pre_force(int /* vflag */) /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::init_matvec() +void FixQEqReaxFFOMP::init_matvec() { /* fill-in H matrix */ compute_H(); @@ -363,7 +363,7 @@ void FixQEqReaxOMP::init_matvec() /* ---------------------------------------------------------------------- */ -int FixQEqReaxOMP::CG(double *b, double *x) +int FixQEqReaxFFOMP::CG(double *b, double *x) { int i; double alpha, beta, b_norm; @@ -464,7 +464,7 @@ int FixQEqReaxOMP::CG(double *b, double *x) } if ((i >= imax) && maxwarn && (comm->me == 0)) - error->warning(FLERR,fmt::format("Fix qeq/reax/omp CG convergence failed " + error->warning(FLERR,fmt::format("Fix qeq/reaxff/omp CG convergence failed " "after {} iterations at step {}", i,update->ntimestep)); return i; @@ -472,7 +472,7 @@ int FixQEqReaxOMP::CG(double *b, double *x) /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::sparse_matvec(sparse_matrix *A, double *x, double *b) +void FixQEqReaxFFOMP::sparse_matvec(sparse_matrix *A, double *x, double *b) { #if defined(_OPENMP) #pragma omp parallel default(shared) @@ -539,7 +539,7 @@ void FixQEqReaxOMP::sparse_matvec(sparse_matrix *A, double *x, double *b) /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::calculate_Q() +void FixQEqReaxFFOMP::calculate_Q() { int i; double *q = atom->q; @@ -592,7 +592,7 @@ void FixQEqReaxOMP::calculate_Q() /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::vector_sum(double* dest, double c, double* v, +void FixQEqReaxFFOMP::vector_sum(double* dest, double c, double* v, double d, double* y, int k) { int i; @@ -608,7 +608,7 @@ void FixQEqReaxOMP::vector_sum(double* dest, double c, double* v, /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::vector_add(double* dest, double c, double* v, int k) +void FixQEqReaxFFOMP::vector_add(double* dest, double c, double* v, int k) { int i; @@ -627,7 +627,7 @@ void FixQEqReaxOMP::vector_add(double* dest, double c, double* v, int k) /* dual CG support */ /* ---------------------------------------------------------------------- */ -int FixQEqReaxOMP::dual_CG(double *b1, double *b2, double *x1, double *x2) +int FixQEqReaxFFOMP::dual_CG(double *b1, double *b2, double *x1, double *x2) { int i; double alpha_s, alpha_t, beta_s, beta_t, b_norm_s, b_norm_t; @@ -791,7 +791,7 @@ int FixQEqReaxOMP::dual_CG(double *b1, double *b2, double *x1, double *x2) } if ((i >= imax) && maxwarn && (comm->me == 0)) - error->warning(FLERR,fmt::format("Fix qeq/reax/omp CG convergence failed " + error->warning(FLERR,fmt::format("Fix qeq/reaxff/omp CG convergence failed " "after {} iterations at step {}", i,update->ntimestep)); return matvecs_s + matvecs_t; @@ -799,7 +799,7 @@ int FixQEqReaxOMP::dual_CG(double *b1, double *b2, double *x1, double *x2) /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::dual_sparse_matvec(sparse_matrix *A, double *x1, double *x2, double *b) +void FixQEqReaxFFOMP::dual_sparse_matvec(sparse_matrix *A, double *x1, double *x2, double *b) { #if defined(_OPENMP) #pragma omp parallel default(shared) @@ -890,7 +890,7 @@ void FixQEqReaxOMP::dual_sparse_matvec(sparse_matrix *A, double *x1, double *x2, /* ---------------------------------------------------------------------- */ -void FixQEqReaxOMP::dual_sparse_matvec(sparse_matrix *A, double *x, double *b) +void FixQEqReaxFFOMP::dual_sparse_matvec(sparse_matrix *A, double *x, double *b) { #if defined(_OPENMP) #pragma omp parallel default(shared) diff --git a/src/OPENMP/fix_qeq_reax_omp.h b/src/OPENMP/fix_qeq_reaxff_omp.h similarity index 84% rename from src/OPENMP/fix_qeq_reax_omp.h rename to src/OPENMP/fix_qeq_reaxff_omp.h index 62855a6f78..b99034edf0 100644 --- a/src/OPENMP/fix_qeq_reax_omp.h +++ b/src/OPENMP/fix_qeq_reaxff_omp.h @@ -13,22 +13,23 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(qeq/reax/omp,FixQEqReaxOMP); +FixStyle(qeq/reaxff/omp,FixQEqReaxFFOMP); +FixStyle(qeq/reax/omp,FixQEqReaxFFOMP); // clang-format on #else -#ifndef LMP_FIX_QEQ_REAX_OMP_H -#define LMP_FIX_QEQ_REAX_OMP_H +#ifndef LMP_FIX_QEQ_REAXFF_OMP_H +#define LMP_FIX_QEQ_REAXFF_OMP_H -#include "fix_qeq_reax.h" +#include "fix_qeq_reaxff.h" namespace LAMMPS_NS { -class FixQEqReaxOMP : public FixQEqReax { +class FixQEqReaxFFOMP : public FixQEqReaxFF { public: - FixQEqReaxOMP(class LAMMPS *, int, char **); - ~FixQEqReaxOMP(); + FixQEqReaxFFOMP(class LAMMPS *, int, char **); + ~FixQEqReaxFFOMP(); virtual void init(); virtual void init_storage(); virtual void pre_force(int); diff --git a/src/OPENMP/pair_reaxc_omp.cpp b/src/OPENMP/pair_reaxff_omp.cpp similarity index 88% rename from src/OPENMP/pair_reaxc_omp.cpp rename to src/OPENMP/pair_reaxff_omp.cpp index b65c9a391f..48fa9e8312 100644 --- a/src/OPENMP/pair_reaxc_omp.cpp +++ b/src/OPENMP/pair_reaxff_omp.cpp @@ -17,14 +17,14 @@ Hasan Metin Aktulga, Michigan State University, hma@cse.msu.edu Per-atom energy/virial added by Ray Shan (Materials Design, Inc.) - Fix reax/c/bonds and fix reax/c/species for pair_style reax/c added + Fix reaxff/bonds and fix reaxff/species for pair_style reaxff added by Ray Shan (Materials Design) - OpenMP based threading support for pair_style reax/c/omp added + OpenMP based threading support for pair_style reaxff/omp added by Hasan Metin Aktulga (MSU), Chris Knight (ALCF), Paul Coffman (ALCF), Kurt O'Hearn (MSU), Ray Shan (Materials Design), Wei Jiang (ALCF) - Integration of the pair_style reax/c/omp into the OPENMP package + Integration of the pair_style reaxff/omp into the OPENMP package by Axel Kohlmeyer (Temple U.) Please cite the related publication: @@ -34,13 +34,13 @@ High Performance Computing Applications, to appear. ------------------------------------------------------------------------- */ -#include "pair_reaxc_omp.h" +#include "pair_reaxff_omp.h" #include "atom.h" #include "citeme.h" #include "comm.h" #include "error.h" -#include "fix_reaxc.h" +#include "fix_reaxff.h" #include "force.h" #include "memory.h" #include "modify.h" @@ -62,8 +62,8 @@ using namespace LAMMPS_NS; using namespace ReaxFF; -static const char cite_pair_reax_c_omp[] = - "pair reax/c/omp and fix qeq/reax/omp command:\n\n" +static const char cite_pair_reaxff_omp[] = + "pair reaxff/omp and fix qeq/reaxff/omp command:\n\n" "@Article{Aktulga17,\n" " author = {H. M. Aktulga, C. Knight, P. Coffman, K. A. OHearn, T. R. Shan, W. Jiang},\n" " title = {Optimizing the performance of reactive molecular dynamics simulations for multi-core architectures},\n" @@ -73,9 +73,9 @@ static const char cite_pair_reax_c_omp[] = /* ---------------------------------------------------------------------- */ -PairReaxCOMP::PairReaxCOMP(LAMMPS *lmp) : PairReaxC(lmp), ThrOMP(lmp, THR_PAIR) +PairReaxFFOMP::PairReaxFFOMP(LAMMPS *lmp) : PairReaxFF(lmp), ThrOMP(lmp, THR_PAIR) { - if (lmp->citeme) lmp->citeme->add(cite_pair_reax_c_omp); + if (lmp->citeme) lmp->citeme->add(cite_pair_reaxff_omp); suffix_flag |= Suffix::OMP; api->system->pair_ptr = this; @@ -86,7 +86,7 @@ PairReaxCOMP::PairReaxCOMP(LAMMPS *lmp) : PairReaxC(lmp), ThrOMP(lmp, THR_PAIR) /* ---------------------------------------------------------------------- */ -PairReaxCOMP::~PairReaxCOMP() +PairReaxFFOMP::~PairReaxFFOMP() { if (setup_flag) { reax_list * bonds = api->lists+BONDS; @@ -98,15 +98,15 @@ PairReaxCOMP::~PairReaxCOMP() /* ---------------------------------------------------------------------- */ -void PairReaxCOMP::init_style() +void PairReaxFFOMP::init_style() { if (!atom->q_flag) - error->all(FLERR,"Pair style reax/c/omp requires atom attribute q"); + error->all(FLERR,"Pair style reaxff/omp requires atom attribute q"); bool have_qeq = ((modify->find_fix_by_style("^qeq/reax") != -1) || (modify->find_fix_by_style("^qeq/shielded") != -1)); if (!have_qeq && qeqflag == 1) - error->all(FLERR,"Pair reax/c requires use of fix qeq/reax or qeq/shielded"); + error->all(FLERR,"Pair reaxff/omp requires use of fix qeq/reaxff or qeq/shielded"); api->system->n = atom->nlocal; // my atoms api->system->N = atom->nlocal + atom->nghost; // mine + ghosts @@ -114,14 +114,14 @@ void PairReaxCOMP::init_style() api->system->wsize = comm->nprocs; if (atom->tag_enable == 0) - error->all(FLERR,"Pair style reax/c/omp requires atom IDs"); + error->all(FLERR,"Pair style reaxff/omp requires atom IDs"); if (force->newton_pair == 0) - error->all(FLERR,"Pair style reax/c/omp requires newton pair on"); + error->all(FLERR,"Pair style reaxff/omp requires newton pair on"); // because system->bigN is an int, we cannot have more atoms than MAXSMALLINT if (atom->natoms > MAXSMALLINT) - error->all(FLERR,"Too many atoms for pair style reax/c/omp"); + error->all(FLERR,"Too many atoms for pair style reaxff/omp"); // need a half neighbor list w/ Newton off and ghost neighbors // built whenever re-neighboring occurs @@ -135,9 +135,9 @@ void PairReaxCOMP::init_style() error->warning(FLERR,"Total cutoff < 2*bond cutoff. May need to use an " "increased neighbor list skin."); - if (fix_reax == nullptr) { - modify->add_fix(fmt::format("{} all REAXC",fix_id)); - fix_reax = (FixReaxC *) modify->fix[modify->nfix-1]; + if (fix_reaxff == nullptr) { + modify->add_fix(fmt::format("{} all REAXFF",fix_id)); + fix_reaxff = (FixReaxFF *) modify->fix[modify->nfix-1]; } api->control->nthreads = comm->nthreads; @@ -145,7 +145,7 @@ void PairReaxCOMP::init_style() /* ---------------------------------------------------------------------- */ -void PairReaxCOMP::setup() +void PairReaxFFOMP::setup() { int oldN; int mincap = api->system->mincap; @@ -166,8 +166,8 @@ void PairReaxCOMP::setup() setup_flag = 1; - int *num_bonds = fix_reax->num_bonds; - int *num_hbonds = fix_reax->num_hbonds; + int *num_bonds = fix_reaxff->num_bonds; + int *num_hbonds = fix_reaxff->num_hbonds; // determine the local and total capacity @@ -183,7 +183,7 @@ void PairReaxCOMP::setup() int num_nbrs = estimate_reax_lists(); if (num_nbrs < 0) - error->all(FLERR,"Too many neighbors for pair style reax/c"); + error->all(FLERR,"Too many neighbors for pair style reaxff"); Make_List(api->system->total_cap,num_nbrs,TYP_FAR_NEIGHBOR,api->lists+FAR_NBRS); (api->lists+FAR_NBRS)->error_ptr=error; @@ -219,16 +219,16 @@ void PairReaxCOMP::setup() /* ---------------------------------------------------------------------- */ -void PairReaxCOMP::compute(int eflag, int vflag) +void PairReaxFFOMP::compute(int eflag, int vflag) { double evdwl,ecoul; // communicate num_bonds once every reneighboring // 2 num arrays stored by fix, grab ptr to them - if (neighbor->ago == 0) comm->forward_comm_fix(fix_reax); - int *num_bonds = fix_reax->num_bonds; - int *num_hbonds = fix_reax->num_hbonds; + if (neighbor->ago == 0) comm->forward_comm_fix(fix_reaxff); + int *num_bonds = fix_reaxff->num_bonds; + int *num_hbonds = fix_reaxff->num_hbonds; evdwl = ecoul = 0.0; ev_init(eflag,vflag); @@ -304,7 +304,7 @@ void PairReaxCOMP::compute(int eflag, int vflag) api->data->step = update->ntimestep; - // populate tmpid and tmpbo arrays for fix reax/c/species + // populate tmpid and tmpbo arrays for fix reaxff/species if (fixspecies_flag) { if (api->system->N > nmax) { @@ -330,10 +330,10 @@ void PairReaxCOMP::compute(int eflag, int vflag) /* ---------------------------------------------------------------------- */ -void PairReaxCOMP::write_reax_atoms() +void PairReaxFFOMP::write_reax_atoms() { - int *num_bonds = fix_reax->num_bonds; - int *num_hbonds = fix_reax->num_hbonds; + int *num_bonds = fix_reaxff->num_bonds; + int *num_hbonds = fix_reaxff->num_hbonds; if (api->system->N > api->system->total_cap) error->all(FLERR,"Too many ghost atoms"); @@ -355,7 +355,7 @@ void PairReaxCOMP::write_reax_atoms() /* ---------------------------------------------------------------------- */ -int PairReaxCOMP::estimate_reax_lists() +int PairReaxFFOMP::estimate_reax_lists() { int i; int *ilist = list->ilist; @@ -384,7 +384,7 @@ int PairReaxCOMP::estimate_reax_lists() /* ---------------------------------------------------------------------- */ -int PairReaxCOMP::write_reax_lists() +int PairReaxFFOMP::write_reax_lists() { int itr_i, itr_j, i, j, num_mynbrs; int *jlist; @@ -450,7 +450,7 @@ int PairReaxCOMP::write_reax_lists() /* ---------------------------------------------------------------------- */ -void PairReaxCOMP::read_reax_forces(int /* vflag */) +void PairReaxFFOMP::read_reax_forces(int /* vflag */) { #if defined(_OPENMP) #pragma omp parallel for schedule(static) default(shared) @@ -468,7 +468,7 @@ void PairReaxCOMP::read_reax_forces(int /* vflag */) /* ---------------------------------------------------------------------- */ -void PairReaxCOMP::FindBond() +void PairReaxFFOMP::FindBond() { const double bo_cut = 0.10; @@ -492,7 +492,7 @@ void PairReaxCOMP::FindBond() tmpid[i][nj] = j; tmpbo[i][nj] = bo_tmp; nj ++; - if (nj > MAXSPECBOND) error->all(FLERR,"Increase MAXSPECBOND in fix_reaxc_species.h"); + if (nj > MAXSPECBOND) error->all(FLERR,"Increase MAXSPECBOND in fix_reaxff_species.h"); } } } diff --git a/src/OPENMP/pair_reaxc_omp.h b/src/OPENMP/pair_reaxff_omp.h similarity index 92% rename from src/OPENMP/pair_reaxc_omp.h rename to src/OPENMP/pair_reaxff_omp.h index 81d1c35b0e..cced5861be 100644 --- a/src/OPENMP/pair_reaxc_omp.h +++ b/src/OPENMP/pair_reaxff_omp.h @@ -13,22 +13,23 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(reax/c/omp,PairReaxCOMP); +PairStyle(reaxff/omp,PairReaxFFOMP); +PairStyle(reax/c/omp,PairReaxFFOMP); // clang-format on #else -#ifndef LMP_PAIR_REAXC_OMP_H -#define LMP_PAIR_REAXC_OMP_H +#ifndef LMP_PAIR_REAXFF_OMP_H +#define LMP_PAIR_REAXFF_OMP_H -#include "pair_reaxc.h" +#include "pair_reaxff.h" #include "thr_omp.h" namespace LAMMPS_NS { -class PairReaxCOMP : public PairReaxC, public ThrOMP { +class PairReaxFFOMP : public PairReaxFF, public ThrOMP { public: - PairReaxCOMP(class LAMMPS *); - ~PairReaxCOMP(); + PairReaxFFOMP(class LAMMPS *); + ~PairReaxFFOMP(); virtual void compute(int, int); virtual void init_style(); @@ -120,7 +121,7 @@ class PairReaxCOMP : public PairReaxC, public ThrOMP { E: Too many ghost atoms Number of ghost atoms has increased too much during simulation and has exceeded -the size of reax/c arrays. Increase safe_zone and min_cap in pair_style reax/c +the size of reaxff arrays. Increase safe_zone and min_cap in pair_style reaxff command */ diff --git a/src/OPENMP/reaxc_bond_orders_omp.cpp b/src/OPENMP/reaxff_bond_orders_omp.cpp similarity index 98% rename from src/OPENMP/reaxc_bond_orders_omp.cpp rename to src/OPENMP/reaxff_bond_orders_omp.cpp index 3e419792d9..2fe68280d1 100644 --- a/src/OPENMP/reaxc_bond_orders_omp.cpp +++ b/src/OPENMP/reaxff_bond_orders_omp.cpp @@ -29,7 +29,7 @@ #include "reaxff_omp.h" #include "fix_omp.h" -#include "pair_reaxc_omp.h" +#include "pair_reaxff_omp.h" #include "reaxff_api.h" #include @@ -45,7 +45,7 @@ namespace ReaxFF { dbond_coefficients coef; int pk, k, j; - PairReaxCOMP *pair_reax_ptr = static_cast(system->pair_ptr); + PairReaxFFOMP *pair_reax_ptr = static_cast(system->pair_ptr); int tid = get_tid(); ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); @@ -173,7 +173,7 @@ namespace ReaxFF { j = nbr_pj->nbr; rr2 = 1.0 / SQR(nbr_pj->d); - // Top portion of BOp() moved to reaxc_forces_omp.cpp::Init_Forces_noQEq_OMP() + // Top portion of BOp() moved to reaxff_forces_omp.cpp::Init_Forces_noQEq_OMP() /* Initially BO values are the uncorrected ones, page 1 */ diff --git a/src/OPENMP/reaxc_bonds_omp.cpp b/src/OPENMP/reaxff_bonds_omp.cpp similarity index 97% rename from src/OPENMP/reaxc_bonds_omp.cpp rename to src/OPENMP/reaxff_bonds_omp.cpp index 784af432cc..1a97f2a6af 100644 --- a/src/OPENMP/reaxc_bonds_omp.cpp +++ b/src/OPENMP/reaxff_bonds_omp.cpp @@ -28,7 +28,7 @@ #include "reaxff_omp.h" #include "fix_omp.h" -#include "pair_reaxc_omp.h" +#include "pair_reaxff_omp.h" #include "reaxff_api.h" #include @@ -67,8 +67,8 @@ namespace ReaxFF { int tid = get_tid(); long reductionOffset = (system->N * tid); - class PairReaxCOMP *pair_reax_ptr; - pair_reax_ptr = static_cast(system->pair_ptr); + class PairReaxFFOMP *pair_reax_ptr; + pair_reax_ptr = static_cast(system->pair_ptr); class ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); pair_reax_ptr->ev_setup_thr_proxy(system->pair_ptr->eflag_either, diff --git a/src/OPENMP/reaxc_forces_omp.cpp b/src/OPENMP/reaxff_forces_omp.cpp similarity index 99% rename from src/OPENMP/reaxc_forces_omp.cpp rename to src/OPENMP/reaxff_forces_omp.cpp index 26f36f1357..77106a5e44 100644 --- a/src/OPENMP/reaxc_forces_omp.cpp +++ b/src/OPENMP/reaxff_forces_omp.cpp @@ -31,7 +31,7 @@ #include "error.h" #include "fix_omp.h" -#include "pair_reaxc_omp.h" +#include "pair_reaxff_omp.h" #include "reaxff_api.h" @@ -90,8 +90,8 @@ namespace ReaxFF { int tid = get_tid(); bond_order_data *bo_jk; - class PairReaxCOMP *pair_reax_ptr; - pair_reax_ptr = static_cast(system->pair_ptr); + class PairReaxFFOMP *pair_reax_ptr; + pair_reax_ptr = static_cast(system->pair_ptr); class ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); pair_reax_ptr->ev_setup_thr_proxy(0, 1, natoms, system->pair_ptr->eatom, diff --git a/src/OPENMP/reaxc_hydrogen_bonds_omp.cpp b/src/OPENMP/reaxff_hydrogen_bonds_omp.cpp similarity index 98% rename from src/OPENMP/reaxc_hydrogen_bonds_omp.cpp rename to src/OPENMP/reaxff_hydrogen_bonds_omp.cpp index 1b174aef81..64bbbf56b1 100644 --- a/src/OPENMP/reaxc_hydrogen_bonds_omp.cpp +++ b/src/OPENMP/reaxff_hydrogen_bonds_omp.cpp @@ -30,7 +30,7 @@ #include "reaxff_omp.h" #include "fix_omp.h" -#include "pair_reaxc_omp.h" +#include "pair_reaxff_omp.h" #include "reaxff_api.h" @@ -87,8 +87,8 @@ namespace ReaxFF { long reductionOffset = (system->N * tid); - class PairReaxCOMP *pair_reax_ptr; - pair_reax_ptr = static_cast(system->pair_ptr); + class PairReaxFFOMP *pair_reax_ptr; + pair_reax_ptr = static_cast(system->pair_ptr); class ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); diff --git a/src/OPENMP/reaxc_init_md_omp.cpp b/src/OPENMP/reaxff_init_md_omp.cpp similarity index 100% rename from src/OPENMP/reaxc_init_md_omp.cpp rename to src/OPENMP/reaxff_init_md_omp.cpp diff --git a/src/OPENMP/reaxc_multi_body_omp.cpp b/src/OPENMP/reaxff_multi_body_omp.cpp similarity index 98% rename from src/OPENMP/reaxc_multi_body_omp.cpp rename to src/OPENMP/reaxff_multi_body_omp.cpp index 6b7a7c76f4..17b93d7487 100644 --- a/src/OPENMP/reaxc_multi_body_omp.cpp +++ b/src/OPENMP/reaxff_multi_body_omp.cpp @@ -30,7 +30,7 @@ #include "reaxff_omp.h" #include "fix_omp.h" -#include "pair_reaxc_omp.h" +#include "pair_reaxff_omp.h" #include "reaxff_api.h" @@ -84,8 +84,8 @@ namespace ReaxFF { int tid = get_tid(); long reductionOffset = (system->N * tid); - class PairReaxCOMP *pair_reax_ptr; - pair_reax_ptr = static_cast(system->pair_ptr); + class PairReaxFFOMP *pair_reax_ptr; + pair_reax_ptr = static_cast(system->pair_ptr); class ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); #if defined(_OPENMP) diff --git a/src/OPENMP/reaxc_nonbonded_omp.cpp b/src/OPENMP/reaxff_nonbonded_omp.cpp similarity index 97% rename from src/OPENMP/reaxc_nonbonded_omp.cpp rename to src/OPENMP/reaxff_nonbonded_omp.cpp index 595731b005..a57542f550 100644 --- a/src/OPENMP/reaxc_nonbonded_omp.cpp +++ b/src/OPENMP/reaxff_nonbonded_omp.cpp @@ -29,7 +29,7 @@ #include "reaxff_omp.h" -#include "pair_reaxc_omp.h" +#include "pair_reaxff_omp.h" #include "reaxff_api.h" #include @@ -72,8 +72,8 @@ namespace ReaxFF { long reductionOffset = (system->N * tid); - class PairReaxCOMP *pair_reax_ptr; - pair_reax_ptr = static_cast(system->pair_ptr); + class PairReaxFFOMP *pair_reax_ptr; + pair_reax_ptr = static_cast(system->pair_ptr); class ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); e_core = 0; @@ -254,8 +254,8 @@ namespace ReaxFF { long froffset = (system->N * tid); LR_lookup_table ** & LR = system->LR; - class PairReaxCOMP *pair_reax_ptr; - pair_reax_ptr = static_cast(system->pair_ptr); + class PairReaxFFOMP *pair_reax_ptr; + pair_reax_ptr = static_cast(system->pair_ptr); class ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); #if defined(_OPENMP) diff --git a/src/OPENMP/reaxc_torsion_angles_omp.cpp b/src/OPENMP/reaxff_torsion_angles_omp.cpp similarity index 99% rename from src/OPENMP/reaxc_torsion_angles_omp.cpp rename to src/OPENMP/reaxff_torsion_angles_omp.cpp index 83f49e96de..648603b143 100644 --- a/src/OPENMP/reaxc_torsion_angles_omp.cpp +++ b/src/OPENMP/reaxff_torsion_angles_omp.cpp @@ -30,7 +30,7 @@ #include "reaxff_omp.h" #include "fix_omp.h" -#include "pair_reaxc_omp.h" +#include "pair_reaxff_omp.h" #include "reaxff_api.h" #include @@ -100,8 +100,8 @@ namespace ReaxFF { int tid = get_tid(); long reductionOffset = (system->N * tid); - class PairReaxCOMP *pair_reax_ptr; - pair_reax_ptr = static_cast(system->pair_ptr); + class PairReaxFFOMP *pair_reax_ptr; + pair_reax_ptr = static_cast(system->pair_ptr); class ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); #if defined(_OPENMP) diff --git a/src/OPENMP/reaxc_valence_angles_omp.cpp b/src/OPENMP/reaxff_valence_angles_omp.cpp similarity index 99% rename from src/OPENMP/reaxc_valence_angles_omp.cpp rename to src/OPENMP/reaxff_valence_angles_omp.cpp index ed457c96fe..423b6336df 100644 --- a/src/OPENMP/reaxc_valence_angles_omp.cpp +++ b/src/OPENMP/reaxff_valence_angles_omp.cpp @@ -31,7 +31,7 @@ #include "error.h" #include "fix_omp.h" -#include "pair_reaxc_omp.h" +#include "pair_reaxff_omp.h" #include "reaxff_api.h" #include @@ -154,8 +154,8 @@ namespace ReaxFF { int tid = get_tid(); long reductionOffset = (system->N * tid); - class PairReaxCOMP *pair_reax_ptr; - pair_reax_ptr = static_cast(system->pair_ptr); + class PairReaxFFOMP *pair_reax_ptr; + pair_reax_ptr = static_cast(system->pair_ptr); class ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); // Run through a minimal for (jpair_match("^reax/c",0); - if (pair == nullptr) error->all(FLERR,"No pair reax/c for fix qeq/shielded"); + Pair *pair = force->pair_match("^reax..",0); + if (pair == nullptr) error->all(FLERR,"No pair reaxff for fix qeq/shielded"); int tmp; chi = (double *) pair->extract("chi",tmp); eta = (double *) pair->extract("eta",tmp); gamma = (double *) pair->extract("gamma",tmp); if (chi == nullptr || eta == nullptr || gamma == nullptr) - error->all(FLERR, - "Fix qeq/slater could not extract params from pair reax/c"); + error->all(FLERR, "Fix qeq/shielded could not extract params from pair reaxff"); } diff --git a/src/REAXFF/README b/src/REAXFF/README index 485a56785e..528b782932 100644 --- a/src/REAXFF/README +++ b/src/REAXFF/README @@ -4,16 +4,6 @@ represent the contributions of chemical bonding to the potential energy. It was originally developed by Adri van Duin and the Goddard group at CalTech. -The REAXFF version of ReaxFF (pair_style reax/c), implemented in -C, should give identical or very similar results to pair_style reax, -which is a ReaxFF implementation on top of a Fortran library, a -version of which library was originally authored by Adri van Duin. - -The reax/c version should be somewhat faster and more scalable, -particularly with respect to the charge equilibration calculation. It -should also be easier to build and use since there are no complicating -issues with Fortran memory allocation or linking to a Fortran library. - For technical details about this implementation of ReaxFF, see this paper: @@ -21,7 +11,7 @@ Parallel and Scalable Reactive Molecular Dynamics: Numerical Methods and Algorithmic Techniques, H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama, Parallel Computing, in press (2011). -See the doc page for the pair_style reax/c command for details +See the doc page for the pair_style reaxff command for details of how to use it in LAMMPS. The person who created this package is Hasan Metin Aktulga (hmaktulga diff --git a/src/REAXFF/compute_spec_atom.cpp b/src/REAXFF/compute_spec_atom.cpp index 1381f2cf96..66886cd1e2 100644 --- a/src/REAXFF/compute_spec_atom.cpp +++ b/src/REAXFF/compute_spec_atom.cpp @@ -13,13 +13,15 @@ ------------------------------------------------------------------------- */ #include "compute_spec_atom.h" -#include + #include "atom.h" -#include "update.h" +#include "error.h" #include "force.h" #include "memory.h" -#include "error.h" -#include "pair_reaxc.h" +#include "pair_reaxff.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -30,15 +32,15 @@ enum{KEYWORD,COMPUTE,FIX,VARIABLE}; ComputeSpecAtom::ComputeSpecAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg) { - if (narg < 4) error->all(FLERR,"Illegal compute reax/c/atom command"); + if (narg < 4) error->all(FLERR,"Illegal compute spec/atom command"); peratom_flag = 1; nvalues = narg - 3; if (nvalues == 1) size_peratom_cols = 0; else size_peratom_cols = nvalues; - // Initiate reaxc - reaxc = (PairReaxC *) force->pair_match("reax/c",0); + // get reference to ReaxFF pair style + reaxff = (PairReaxFF *) force->pair_match("^reax..",0); pack_choice = new FnPtrPack[nvalues]; @@ -64,7 +66,7 @@ ComputeSpecAtom::ComputeSpecAtom(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"vz") == 0) { pack_choice[i] = &ComputeSpecAtom::pack_vz; - // from pair_reaxc + // from pair_reaxff } else if (strcmp(arg[iarg],"abo01") == 0) { pack_choice[i] = &ComputeSpecAtom::pack_abo01; } else if (strcmp(arg[iarg],"abo02") == 0) { @@ -114,7 +116,7 @@ ComputeSpecAtom::ComputeSpecAtom(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"abo24") == 0) { pack_choice[i] = &ComputeSpecAtom::pack_abo24; - } else error->all(FLERR,"Invalid keyword in compute reax/c/atom command"); + } else error->all(FLERR,"Invalid keyword in compute spec/atom command"); } nmax = 0; @@ -310,7 +312,7 @@ void ComputeSpecAtom::pack_abo01(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][0]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][0]; else buf[n] = 0.0; n += nvalues; } @@ -324,7 +326,7 @@ void ComputeSpecAtom::pack_abo02(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][1]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][1]; else buf[n] = 0.0; n += nvalues; } @@ -338,7 +340,7 @@ void ComputeSpecAtom::pack_abo03(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][2]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][2]; else buf[n] = 0.0; n += nvalues; } @@ -352,7 +354,7 @@ void ComputeSpecAtom::pack_abo04(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][3]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][3]; else buf[n] = 0.0; n += nvalues; } @@ -366,7 +368,7 @@ void ComputeSpecAtom::pack_abo05(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][4]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][4]; else buf[n] = 0.0; n += nvalues; } @@ -380,7 +382,7 @@ void ComputeSpecAtom::pack_abo06(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][5]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][5]; else buf[n] = 0.0; n += nvalues; } @@ -394,7 +396,7 @@ void ComputeSpecAtom::pack_abo07(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][6]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][6]; else buf[n] = 0.0; n += nvalues; } @@ -408,7 +410,7 @@ void ComputeSpecAtom::pack_abo08(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][7]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][7]; else buf[n] = 0.0; n += nvalues; } @@ -422,7 +424,7 @@ void ComputeSpecAtom::pack_abo09(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][8]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][8]; else buf[n] = 0.0; n += nvalues; } @@ -436,7 +438,7 @@ void ComputeSpecAtom::pack_abo10(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][9]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][9]; else buf[n] = 0.0; n += nvalues; } @@ -450,7 +452,7 @@ void ComputeSpecAtom::pack_abo11(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][10]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][10]; else buf[n] = 0.0; n += nvalues; } @@ -464,7 +466,7 @@ void ComputeSpecAtom::pack_abo12(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][11]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][11]; else buf[n] = 0.0; n += nvalues; } @@ -478,7 +480,7 @@ void ComputeSpecAtom::pack_abo13(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][12]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][12]; else buf[n] = 0.0; n += nvalues; } @@ -492,7 +494,7 @@ void ComputeSpecAtom::pack_abo14(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][13]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][13]; else buf[n] = 0.0; n += nvalues; } @@ -506,7 +508,7 @@ void ComputeSpecAtom::pack_abo15(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][14]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][14]; else buf[n] = 0.0; n += nvalues; } @@ -520,7 +522,7 @@ void ComputeSpecAtom::pack_abo16(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][15]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][15]; else buf[n] = 0.0; n += nvalues; } @@ -534,7 +536,7 @@ void ComputeSpecAtom::pack_abo17(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][16]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][16]; else buf[n] = 0.0; n += nvalues; } @@ -548,7 +550,7 @@ void ComputeSpecAtom::pack_abo18(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][17]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][17]; else buf[n] = 0.0; n += nvalues; } @@ -562,7 +564,7 @@ void ComputeSpecAtom::pack_abo19(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][18]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][18]; else buf[n] = 0.0; n += nvalues; } @@ -576,7 +578,7 @@ void ComputeSpecAtom::pack_abo20(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][19]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][19]; else buf[n] = 0.0; n += nvalues; } @@ -590,7 +592,7 @@ void ComputeSpecAtom::pack_abo21(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][20]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][20]; else buf[n] = 0.0; n += nvalues; } @@ -604,7 +606,7 @@ void ComputeSpecAtom::pack_abo22(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][21]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][21]; else buf[n] = 0.0; n += nvalues; } @@ -618,7 +620,7 @@ void ComputeSpecAtom::pack_abo23(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][22]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][22]; else buf[n] = 0.0; n += nvalues; } @@ -632,7 +634,7 @@ void ComputeSpecAtom::pack_abo24(int n) int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) buf[n] = reaxc->tmpbo[i][23]; + if (mask[i] & groupbit) buf[n] = reaxff->tmpbo[i][23]; else buf[n] = 0.0; n += nvalues; } diff --git a/src/REAXFF/compute_spec_atom.h b/src/REAXFF/compute_spec_atom.h index ce4ce5b1cc..61dd63e272 100644 --- a/src/REAXFF/compute_spec_atom.h +++ b/src/REAXFF/compute_spec_atom.h @@ -75,7 +75,7 @@ class ComputeSpecAtom : public Compute { void pack_abo23(int); void pack_abo24(int); - class PairReaxC *reaxc; + class PairReaxFF *reaxff; }; } diff --git a/src/REAXFF/fix_qeq_reax.cpp b/src/REAXFF/fix_qeq_reaxff.cpp similarity index 83% rename from src/REAXFF/fix_qeq_reax.cpp rename to src/REAXFF/fix_qeq_reaxff.cpp index 2591813534..fd197a156a 100644 --- a/src/REAXFF/fix_qeq_reax.cpp +++ b/src/REAXFF/fix_qeq_reaxff.cpp @@ -19,7 +19,7 @@ Hybrid and sub-group capabilities: Ray Shan (Sandia) ------------------------------------------------------------------------- */ -#include "fix_qeq_reax.h" +#include "fix_qeq_reaxff.h" #include "atom.h" #include "citeme.h" @@ -37,7 +37,7 @@ #include "tokenizer.h" #include "update.h" -#include "pair_reaxc.h" +#include "pair_reaxff.h" #include "reaxff_api.h" #include @@ -57,8 +57,8 @@ public: #define SQR(x) ((x)*(x)) #define CUBE(x) ((x)*(x)*(x)) -static const char cite_fix_qeq_reax[] = - "fix qeq/reax command:\n\n" +static const char cite_fix_qeq_reaxff[] = + "fix qeq/reaxff command:\n\n" "@Article{Aktulga12,\n" " author = {H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama},\n" " title = {Parallel reactive molecular dynamics: Numerical methods and algorithmic techniques},\n" @@ -70,7 +70,7 @@ static const char cite_fix_qeq_reax[] = /* ---------------------------------------------------------------------- */ -FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : +FixQEqReaxFF::FixQEqReaxFF(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), matvecs(0), pertype_option(nullptr) { scalar_flag = 1; @@ -78,10 +78,10 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : imax = 200; maxwarn = 1; - if ((narg < 8) || (narg > 12)) error->all(FLERR,"Illegal fix qeq/reax command"); + if ((narg < 8) || (narg > 12)) error->all(FLERR,"Illegal fix qeq/reaxff command"); nevery = utils::inumeric(FLERR,arg[3],false,lmp); - if (nevery <= 0) error->all(FLERR,"Illegal fix qeq/reax command"); + if (nevery <= 0) error->all(FLERR,"Illegal fix qeq/reaxff command"); swa = utils::numeric(FLERR,arg[4],false,lmp); swb = utils::numeric(FLERR,arg[5],false,lmp); @@ -99,10 +99,10 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg],"nowarn") == 0) maxwarn = 0; else if (strcmp(arg[iarg],"maxiter") == 0) { if (iarg+1 > narg-1) - error->all(FLERR,"Illegal fix qeq/reax command"); + error->all(FLERR,"Illegal fix qeq/reaxff command"); imax = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg++; - } else error->all(FLERR,"Illegal fix qeq/reax command"); + } else error->all(FLERR,"Illegal fix qeq/reaxff command"); iarg++; } shld = nullptr; @@ -144,7 +144,7 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - reaxc = (PairReaxC *) force->pair_match("^reax/c",0); + reaxff = (PairReaxFF *) force->pair_match("^reax..",0); s_hist = t_hist = nullptr; atom->add_callback(Atom::GROW); @@ -152,7 +152,7 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -FixQEqReax::~FixQEqReax() +FixQEqReaxFF::~FixQEqReaxFF() { if (copymode) return; @@ -179,9 +179,9 @@ FixQEqReax::~FixQEqReax() /* ---------------------------------------------------------------------- */ -void FixQEqReax::post_constructor() +void FixQEqReaxFF::post_constructor() { - if (lmp->citeme) lmp->citeme->add(cite_fix_qeq_reax); + if (lmp->citeme) lmp->citeme->add(cite_fix_qeq_reaxff); grow_arrays(atom->nmax); for (int i = 0; i < atom->nmax; i++) @@ -190,12 +190,12 @@ void FixQEqReax::post_constructor() pertype_parameters(pertype_option); if (dual_enabled) - error->all(FLERR,"Dual keyword only supported with fix qeq/reax/omp"); + error->all(FLERR,"Dual keyword only supported with fix qeq/reaxff/omp"); } /* ---------------------------------------------------------------------- */ -int FixQEqReax::setmask() +int FixQEqReaxFF::setmask() { int mask = 0; mask |= PRE_FORCE; @@ -206,47 +206,47 @@ int FixQEqReax::setmask() /* ---------------------------------------------------------------------- */ -void FixQEqReax::pertype_parameters(char *arg) +void FixQEqReaxFF::pertype_parameters(char *arg) { - if (strcmp(arg,"reax/c") == 0) { + // match either new keyword "reaxff" or old keyword "reax/c" + if (utils::strmatch(arg,"^reax..$")) { reaxflag = 1; - Pair *pair = force->pair_match("^reax/c",0); - if (!pair) error->all(FLERR,"No reax/c pair style for fix qeq/reax"); + Pair *pair = force->pair_match("^reax..",0); + if (!pair) error->all(FLERR,"No reaxff pair style for fix qeq/reaxff"); int tmp; chi = (double *) pair->extract("chi",tmp); eta = (double *) pair->extract("eta",tmp); gamma = (double *) pair->extract("gamma",tmp); if (chi == nullptr || eta == nullptr || gamma == nullptr) - error->all(FLERR, - "Fix qeq/reax could not extract params from pair reax/c"); + error->all(FLERR, "Fix qeq/reaxff could not extract params from pair reaxff"); return; } reaxflag = 0; const int ntypes = atom->ntypes; - memory->create(chi,ntypes+1,"qeq/reax:chi"); - memory->create(eta,ntypes+1,"qeq/reax:eta"); - memory->create(gamma,ntypes+1,"qeq/reax:gamma"); + memory->create(chi,ntypes+1,"qeq/reaxff:chi"); + memory->create(eta,ntypes+1,"qeq/reaxff:eta"); + memory->create(gamma,ntypes+1,"qeq/reaxff:gamma"); if (comm->me == 0) { chi[0] = eta[0] = gamma[0] = 0.0; try { - TextFileReader reader(arg,"qeq/reax parameter"); + TextFileReader reader(arg,"qeq/reaxff parameter"); reader.ignore_comments = false; for (int i = 1; i <= ntypes; i++) { const char *line = reader.next_line(); if (!line) - throw parser_error("Invalid param file for fix qeq/reax"); + throw parser_error("Invalid param file for fix qeq/reaxff"); ValueTokenizer values(line); if (values.count() != 4) - throw parser_error("Fix qeq/reax: Incorrect format of param file"); + throw parser_error("Fix qeq/reaxff: Incorrect format of param file"); int itype = values.next_int(); if ((itype < 1) || (itype > ntypes)) - throw parser_error("Fix qeq/reax: invalid atom type in param file"); + throw parser_error("Fix qeq/reaxff: invalid atom type in param file"); chi[itype] = values.next_double(); eta[itype] = values.next_double(); @@ -264,7 +264,7 @@ void FixQEqReax::pertype_parameters(char *arg) /* ---------------------------------------------------------------------- */ -void FixQEqReax::allocate_storage() +void FixQEqReaxFF::allocate_storage() { nmax = atom->nmax; @@ -289,7 +289,7 @@ void FixQEqReax::allocate_storage() /* ---------------------------------------------------------------------- */ -void FixQEqReax::deallocate_storage() +void FixQEqReaxFF::deallocate_storage() { memory->destroy(s); memory->destroy(t); @@ -308,7 +308,7 @@ void FixQEqReax::deallocate_storage() /* ---------------------------------------------------------------------- */ -void FixQEqReax::reallocate_storage() +void FixQEqReaxFF::reallocate_storage() { deallocate_storage(); allocate_storage(); @@ -317,7 +317,7 @@ void FixQEqReax::reallocate_storage() /* ---------------------------------------------------------------------- */ -void FixQEqReax::allocate_matrix() +void FixQEqReaxFF::allocate_matrix() { int i,ii,n,m; @@ -325,8 +325,8 @@ void FixQEqReax::allocate_matrix() double safezone; if (reaxflag) { - mincap = reaxc->api->system->mincap; - safezone = reaxc->api->system->safezone; + mincap = reaxff->api->system->mincap; + safezone = reaxff->api->system->safezone; } else { mincap = REAX_MIN_CAP; safezone = REAX_SAFE_ZONE; @@ -354,7 +354,7 @@ void FixQEqReax::allocate_matrix() /* ---------------------------------------------------------------------- */ -void FixQEqReax::deallocate_matrix() +void FixQEqReaxFF::deallocate_matrix() { memory->destroy(H.firstnbr); memory->destroy(H.numnbrs); @@ -364,7 +364,7 @@ void FixQEqReax::deallocate_matrix() /* ---------------------------------------------------------------------- */ -void FixQEqReax::reallocate_matrix() +void FixQEqReaxFF::reallocate_matrix() { deallocate_matrix(); allocate_matrix(); @@ -372,13 +372,13 @@ void FixQEqReax::reallocate_matrix() /* ---------------------------------------------------------------------- */ -void FixQEqReax::init() +void FixQEqReaxFF::init() { if (!atom->q_flag) - error->all(FLERR,"Fix qeq/reax requires atom attribute q"); + error->all(FLERR,"Fix qeq/reaxff requires atom attribute q"); if (group->count(igroup) == 0) - error->all(FLERR,"Fix qeq/reax group has no atoms"); + error->all(FLERR,"Fix qeq/reaxff group has no atoms"); // need a half neighbor list w/ Newton off and ghost neighbors // built whenever re-neighboring occurs @@ -398,21 +398,21 @@ void FixQEqReax::init() /* ---------------------------------------------------------------------- */ -double FixQEqReax::compute_scalar() +double FixQEqReaxFF::compute_scalar() { return matvecs/2.0; } /* ---------------------------------------------------------------------- */ -void FixQEqReax::init_list(int /*id*/, NeighList *ptr) +void FixQEqReaxFF::init_list(int /*id*/, NeighList *ptr) { list = ptr; } /* ---------------------------------------------------------------------- */ -void FixQEqReax::init_shielding() +void FixQEqReaxFF::init_shielding() { int i,j; int ntypes; @@ -428,16 +428,16 @@ void FixQEqReax::init_shielding() /* ---------------------------------------------------------------------- */ -void FixQEqReax::init_taper() +void FixQEqReaxFF::init_taper() { double d7, swa2, swa3, swb2, swb3; if (fabs(swa) > 0.01 && comm->me == 0) - error->warning(FLERR,"Fix qeq/reax has non-zero lower Taper radius cutoff"); + error->warning(FLERR,"Fix qeq/reaxff has non-zero lower Taper radius cutoff"); if (swb < 0) - error->all(FLERR, "Fix qeq/reax has negative upper Taper radius cutoff"); + error->all(FLERR, "Fix qeq/reaxff has negative upper Taper radius cutoff"); else if (swb < 5 && comm->me == 0) - error->warning(FLERR,"Fix qeq/reax has very low Taper radius cutoff"); + error->warning(FLERR,"Fix qeq/reaxff has very low Taper radius cutoff"); d7 = pow(swb - swa, 7); swa2 = SQR(swa); @@ -458,14 +458,14 @@ void FixQEqReax::init_taper() /* ---------------------------------------------------------------------- */ -void FixQEqReax::setup_pre_force(int vflag) +void FixQEqReaxFF::setup_pre_force(int vflag) { - if (reaxc) { - nn = reaxc->list->inum; - NN = reaxc->list->inum + reaxc->list->gnum; - ilist = reaxc->list->ilist; - numneigh = reaxc->list->numneigh; - firstneigh = reaxc->list->firstneigh; + if (reaxff) { + nn = reaxff->list->inum; + NN = reaxff->list->inum + reaxff->list->gnum; + ilist = reaxff->list->ilist; + numneigh = reaxff->list->numneigh; + firstneigh = reaxff->list->firstneigh; } else { nn = list->inum; NN = list->inum + list->gnum; @@ -487,7 +487,7 @@ void FixQEqReax::setup_pre_force(int vflag) /* ---------------------------------------------------------------------- */ -void FixQEqReax::setup_pre_force_respa(int vflag, int ilevel) +void FixQEqReaxFF::setup_pre_force_respa(int vflag, int ilevel) { if (ilevel < nlevels_respa-1) return; setup_pre_force(vflag); @@ -495,21 +495,21 @@ void FixQEqReax::setup_pre_force_respa(int vflag, int ilevel) /* ---------------------------------------------------------------------- */ -void FixQEqReax::min_setup_pre_force(int vflag) +void FixQEqReaxFF::min_setup_pre_force(int vflag) { setup_pre_force(vflag); } /* ---------------------------------------------------------------------- */ -void FixQEqReax::init_storage() +void FixQEqReaxFF::init_storage() { int NN; int *ilist; - if (reaxc) { - NN = reaxc->list->inum + reaxc->list->gnum; - ilist = reaxc->list->ilist; + if (reaxff) { + NN = reaxff->list->inum + reaxff->list->gnum; + ilist = reaxff->list->ilist; } else { NN = list->inum + list->gnum; ilist = list->ilist; @@ -530,18 +530,18 @@ void FixQEqReax::init_storage() /* ---------------------------------------------------------------------- */ -void FixQEqReax::pre_force(int /*vflag*/) +void FixQEqReaxFF::pre_force(int /*vflag*/) { if (update->ntimestep % nevery) return; int n = atom->nlocal; - if (reaxc) { - nn = reaxc->list->inum; - NN = reaxc->list->inum + reaxc->list->gnum; - ilist = reaxc->list->ilist; - numneigh = reaxc->list->numneigh; - firstneigh = reaxc->list->firstneigh; + if (reaxff) { + nn = reaxff->list->inum; + NN = reaxff->list->inum + reaxff->list->gnum; + ilist = reaxff->list->ilist; + numneigh = reaxff->list->numneigh; + firstneigh = reaxff->list->firstneigh; } else { nn = list->inum; NN = list->inum + list->gnum; @@ -568,21 +568,21 @@ void FixQEqReax::pre_force(int /*vflag*/) /* ---------------------------------------------------------------------- */ -void FixQEqReax::pre_force_respa(int vflag, int ilevel, int /*iloop*/) +void FixQEqReaxFF::pre_force_respa(int vflag, int ilevel, int /*iloop*/) { if (ilevel == nlevels_respa-1) pre_force(vflag); } /* ---------------------------------------------------------------------- */ -void FixQEqReax::min_pre_force(int vflag) +void FixQEqReaxFF::min_pre_force(int vflag) { pre_force(vflag); } /* ---------------------------------------------------------------------- */ -void FixQEqReax::init_matvec() +void FixQEqReaxFF::init_matvec() { /* fill-in H matrix */ compute_H(); @@ -614,7 +614,7 @@ void FixQEqReax::init_matvec() /* ---------------------------------------------------------------------- */ -void FixQEqReax::compute_H() +void FixQEqReaxFF::compute_H() { int jnum; int i, j, ii, jj, flag; @@ -670,13 +670,13 @@ void FixQEqReax::compute_H() } if (m_fill >= H.m) - error->all(FLERR,fmt::format("Fix qeq/reax: H matrix size has been " + error->all(FLERR,fmt::format("Fix qeq/reaxff H matrix size has been " "exceeded: m_fill={} H.m={}\n", m_fill, H.m)); } /* ---------------------------------------------------------------------- */ -double FixQEqReax::calculate_H(double r, double gamma) +double FixQEqReaxFF::calculate_H(double r, double gamma) { double Taper, denom; @@ -696,7 +696,7 @@ double FixQEqReax::calculate_H(double r, double gamma) /* ---------------------------------------------------------------------- */ -int FixQEqReax::CG(double *b, double *x) +int FixQEqReaxFF::CG(double *b, double *x) { int i, j; double tmp, alpha, beta, b_norm; @@ -745,7 +745,7 @@ int FixQEqReax::CG(double *b, double *x) } if ((i >= imax) && maxwarn && (comm->me == 0)) - error->warning(FLERR,fmt::format("Fix qeq/reax CG convergence failed " + error->warning(FLERR,fmt::format("Fix qeq/reaxff CG convergence failed " "after {} iterations at step {}", i,update->ntimestep)); return i; @@ -754,7 +754,7 @@ int FixQEqReax::CG(double *b, double *x) /* ---------------------------------------------------------------------- */ -void FixQEqReax::sparse_matvec(sparse_matrix *A, double *x, double *b) +void FixQEqReaxFF::sparse_matvec(sparse_matrix *A, double *x, double *b) { int i, j, itr_j; int ii; @@ -786,7 +786,7 @@ void FixQEqReax::sparse_matvec(sparse_matrix *A, double *x, double *b) /* ---------------------------------------------------------------------- */ -void FixQEqReax::calculate_Q() +void FixQEqReaxFF::calculate_Q() { int i, k; double u, s_sum, t_sum; @@ -819,7 +819,7 @@ void FixQEqReax::calculate_Q() /* ---------------------------------------------------------------------- */ -int FixQEqReax::pack_forward_comm(int n, int *list, double *buf, +int FixQEqReaxFF::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/) { int m; @@ -846,7 +846,7 @@ int FixQEqReax::pack_forward_comm(int n, int *list, double *buf, /* ---------------------------------------------------------------------- */ -void FixQEqReax::unpack_forward_comm(int n, int first, double *buf) +void FixQEqReaxFF::unpack_forward_comm(int n, int first, double *buf) { int i, m; @@ -871,7 +871,7 @@ void FixQEqReax::unpack_forward_comm(int n, int first, double *buf) /* ---------------------------------------------------------------------- */ -int FixQEqReax::pack_reverse_comm(int n, int first, double *buf) +int FixQEqReaxFF::pack_reverse_comm(int n, int first, double *buf) { int i, m; if (pack_flag == 5) { @@ -891,7 +891,7 @@ int FixQEqReax::pack_reverse_comm(int n, int first, double *buf) /* ---------------------------------------------------------------------- */ -void FixQEqReax::unpack_reverse_comm(int n, int *list, double *buf) +void FixQEqReaxFF::unpack_reverse_comm(int n, int *list, double *buf) { if (pack_flag == 5) { int m = 0; @@ -909,7 +909,7 @@ void FixQEqReax::unpack_reverse_comm(int n, int *list, double *buf) memory usage of local atom-based arrays ------------------------------------------------------------------------- */ -double FixQEqReax::memory_usage() +double FixQEqReaxFF::memory_usage() { double bytes; @@ -929,7 +929,7 @@ double FixQEqReax::memory_usage() allocate fictitious charge arrays ------------------------------------------------------------------------- */ -void FixQEqReax::grow_arrays(int nmax) +void FixQEqReaxFF::grow_arrays(int nmax) { memory->grow(s_hist,nmax,nprev,"qeq:s_hist"); memory->grow(t_hist,nmax,nprev,"qeq:t_hist"); @@ -939,7 +939,7 @@ void FixQEqReax::grow_arrays(int nmax) copy values within fictitious charge arrays ------------------------------------------------------------------------- */ -void FixQEqReax::copy_arrays(int i, int j, int /*delflag*/) +void FixQEqReaxFF::copy_arrays(int i, int j, int /*delflag*/) { for (int m = 0; m < nprev; m++) { s_hist[j][m] = s_hist[i][m]; @@ -951,7 +951,7 @@ void FixQEqReax::copy_arrays(int i, int j, int /*delflag*/) pack values in local atom-based array for exchange with another proc ------------------------------------------------------------------------- */ -int FixQEqReax::pack_exchange(int i, double *buf) +int FixQEqReaxFF::pack_exchange(int i, double *buf) { for (int m = 0; m < nprev; m++) buf[m] = s_hist[i][m]; for (int m = 0; m < nprev; m++) buf[nprev+m] = t_hist[i][m]; @@ -962,7 +962,7 @@ int FixQEqReax::pack_exchange(int i, double *buf) unpack values in local atom-based array from exchange with another proc ------------------------------------------------------------------------- */ -int FixQEqReax::unpack_exchange(int nlocal, double *buf) +int FixQEqReaxFF::unpack_exchange(int nlocal, double *buf) { for (int m = 0; m < nprev; m++) s_hist[nlocal][m] = buf[m]; for (int m = 0; m < nprev; m++) t_hist[nlocal][m] = buf[nprev+m]; @@ -971,7 +971,7 @@ int FixQEqReax::unpack_exchange(int nlocal, double *buf) /* ---------------------------------------------------------------------- */ -double FixQEqReax::parallel_norm(double *v, int n) +double FixQEqReaxFF::parallel_norm(double *v, int n) { int i; double my_sum, norm_sqr; @@ -993,7 +993,7 @@ double FixQEqReax::parallel_norm(double *v, int n) /* ---------------------------------------------------------------------- */ -double FixQEqReax::parallel_dot(double *v1, double *v2, int n) +double FixQEqReaxFF::parallel_dot(double *v1, double *v2, int n) { int i; double my_dot, res; @@ -1015,7 +1015,7 @@ double FixQEqReax::parallel_dot(double *v1, double *v2, int n) /* ---------------------------------------------------------------------- */ -double FixQEqReax::parallel_vector_acc(double *v, int n) +double FixQEqReaxFF::parallel_vector_acc(double *v, int n) { int i; double my_acc, res; @@ -1037,7 +1037,7 @@ double FixQEqReax::parallel_vector_acc(double *v, int n) /* ---------------------------------------------------------------------- */ -void FixQEqReax::vector_sum(double* dest, double c, double* v, +void FixQEqReaxFF::vector_sum(double* dest, double c, double* v, double d, double* y, int k) { int kk; @@ -1051,7 +1051,7 @@ void FixQEqReax::vector_sum(double* dest, double c, double* v, /* ---------------------------------------------------------------------- */ -void FixQEqReax::vector_add(double* dest, double c, double* v, int k) +void FixQEqReaxFF::vector_add(double* dest, double c, double* v, int k) { int kk; diff --git a/src/REAXFF/fix_qeq_reax.h b/src/REAXFF/fix_qeq_reaxff.h similarity index 94% rename from src/REAXFF/fix_qeq_reax.h rename to src/REAXFF/fix_qeq_reaxff.h index cf05096fe6..b787bb9c7a 100644 --- a/src/REAXFF/fix_qeq_reax.h +++ b/src/REAXFF/fix_qeq_reaxff.h @@ -24,21 +24,22 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(qeq/reax,FixQEqReax); +FixStyle(qeq/reaxff,FixQEqReaxFF); +FixStyle(qeq/reax,FixQEqReaxFF); // clang-format on #else -#ifndef LMP_FIX_QEQ_REAX_H -#define LMP_FIX_QEQ_REAX_H +#ifndef LMP_FIX_QEQ_REAXFF_H +#define LMP_FIX_QEQ_REAXFF_H #include "fix.h" namespace LAMMPS_NS { -class FixQEqReax : public Fix { +class FixQEqReaxFF : public Fix { public: - FixQEqReax(class LAMMPS *, int, char **); - ~FixQEqReax(); + FixQEqReaxFF(class LAMMPS *, int, char **); + ~FixQEqReaxFF(); int setmask(); virtual void post_constructor(); virtual void init(); @@ -63,7 +64,7 @@ class FixQEqReax : public Fix { int pack_flag; int nlevels_respa; class NeighList *list; - class PairReaxC *reaxc; + class PairReaxFF *reaxff; int *ilist, *jlist, *numneigh, **firstneigh; double swa, swb; // lower/upper Taper cutoff radius diff --git a/src/REAXFF/fix_reaxc.cpp b/src/REAXFF/fix_reaxff.cpp similarity index 87% rename from src/REAXFF/fix_reaxc.cpp rename to src/REAXFF/fix_reaxff.cpp index 2b39ef5a0e..bd95dbcb38 100644 --- a/src/REAXFF/fix_reaxc.cpp +++ b/src/REAXFF/fix_reaxff.cpp @@ -22,7 +22,7 @@ Algorithmic Techniques", Parallel Computing, in press. ------------------------------------------------------------------------- */ -#include "fix_reaxc.h" +#include "fix_reaxff.h" #include "atom.h" #include "memory.h" @@ -35,7 +35,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixReaxC::FixReaxC(LAMMPS *lmp,int narg, char **arg) : +FixReaxFF::FixReaxFF(LAMMPS *lmp,int narg, char **arg) : Fix(lmp, narg, arg) { // perform initial allocation of atom-based arrays @@ -57,7 +57,7 @@ FixReaxC::FixReaxC(LAMMPS *lmp,int narg, char **arg) : /* ---------------------------------------------------------------------- */ -FixReaxC::~FixReaxC() +FixReaxFF::~FixReaxFF() { // unregister this fix so atom class doesn't invoke it any more @@ -71,7 +71,7 @@ FixReaxC::~FixReaxC() /* ---------------------------------------------------------------------- */ -int FixReaxC::setmask() +int FixReaxFF::setmask() { int mask = 0; return mask; @@ -81,7 +81,7 @@ int FixReaxC::setmask() memory usage of local atom-based arrays ------------------------------------------------------------------------- */ -double FixReaxC::memory_usage() +double FixReaxFF::memory_usage() { int nmax = atom->nmax; double bytes = (double)nmax * 2 * sizeof(int); @@ -92,10 +92,10 @@ double FixReaxC::memory_usage() allocate local atom-based arrays ------------------------------------------------------------------------- */ -void FixReaxC::grow_arrays(int nmax) +void FixReaxFF::grow_arrays(int nmax) { - memory->grow(num_bonds,nmax,"reaxc:num_bonds"); - memory->grow(num_hbonds,nmax,"reaxc:num_hbonds"); + memory->grow(num_bonds,nmax,"reaxff:num_bonds"); + memory->grow(num_hbonds,nmax,"reaxff:num_hbonds"); for (int i = oldnmax; i < nmax; i++) { num_hbonds[i] = MIN_REAX_HBONDS; num_bonds[i] = MIN_REAX_BONDS; @@ -107,7 +107,7 @@ void FixReaxC::grow_arrays(int nmax) copy values within local atom-based arrays ------------------------------------------------------------------------- */ -void FixReaxC::copy_arrays(int i, int j, int /*delflag*/) +void FixReaxFF::copy_arrays(int i, int j, int /*delflag*/) { num_bonds[j] = num_bonds[i]; num_hbonds[j] = num_hbonds[i]; @@ -117,7 +117,7 @@ void FixReaxC::copy_arrays(int i, int j, int /*delflag*/) pack values in local atom-based arrays for exchange with another proc ------------------------------------------------------------------------- */ -int FixReaxC::pack_exchange(int i, double *buf) +int FixReaxFF::pack_exchange(int i, double *buf) { buf[0] = num_bonds[i]; buf[1] = num_hbonds[i]; @@ -128,7 +128,7 @@ int FixReaxC::pack_exchange(int i, double *buf) unpack values in local atom-based arrays from exchange with another proc ------------------------------------------------------------------------- */ -int FixReaxC::unpack_exchange(int nlocal, double *buf) +int FixReaxFF::unpack_exchange(int nlocal, double *buf) { num_bonds[nlocal] = static_cast (buf[0]); num_hbonds[nlocal] = static_cast (buf[1]); @@ -137,7 +137,7 @@ int FixReaxC::unpack_exchange(int nlocal, double *buf) /* ---------------------------------------------------------------------- */ -int FixReaxC::pack_forward_comm(int n, int *list, double *buf, +int FixReaxFF::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/) { int i,j,m; @@ -152,7 +152,7 @@ int FixReaxC::pack_forward_comm(int n, int *list, double *buf, /* ---------------------------------------------------------------------- */ -void FixReaxC::unpack_forward_comm(int n, int first, double *buf) +void FixReaxFF::unpack_forward_comm(int n, int first, double *buf) { int i,m,last; diff --git a/src/REAXFF/fix_reaxc.h b/src/REAXFF/fix_reaxff.h similarity index 89% rename from src/REAXFF/fix_reaxc.h rename to src/REAXFF/fix_reaxff.h index 6347f30c23..0b18f6d118 100644 --- a/src/REAXFF/fix_reaxc.h +++ b/src/REAXFF/fix_reaxff.h @@ -24,24 +24,24 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(REAXC,FixReaxC); +FixStyle(REAXFF,FixReaxFF); // clang-format on #else -#ifndef LMP_FIX_REAXC_H -#define LMP_FIX_REAXC_H +#ifndef LMP_FIX_REAXFF_H +#define LMP_FIX_REAXFF_H #include "fix.h" namespace LAMMPS_NS { -class FixReaxC : public Fix { - friend class PairReaxC; - friend class PairReaxCOMP; +class FixReaxFF : public Fix { + friend class PairReaxFF; + friend class PairReaxFFOMP; public: - FixReaxC(class LAMMPS *,int, char **); - ~FixReaxC(); + FixReaxFF(class LAMMPS *,int, char **); + ~FixReaxFF(); int setmask(); double memory_usage(); diff --git a/src/REAXFF/fix_reaxc_bonds.cpp b/src/REAXFF/fix_reaxff_bonds.cpp similarity index 79% rename from src/REAXFF/fix_reaxc_bonds.cpp rename to src/REAXFF/fix_reaxff_bonds.cpp index 0ef3c351e6..f13056c5b6 100644 --- a/src/REAXFF/fix_reaxc_bonds.cpp +++ b/src/REAXFF/fix_reaxff_bonds.cpp @@ -16,7 +16,7 @@ Contributing author: Ray Shan (Sandia, tnshan@sandia.gov) ------------------------------------------------------------------------- */ -#include "fix_reaxc_bonds.h" +#include "fix_reaxff_bonds.h" #include "atom.h" #include "error.h" @@ -25,7 +25,7 @@ #include "neigh_list.h" #include "update.h" -#include "pair_reaxc.h" +#include "pair_reaxff.h" #include "reaxff_api.h" #include @@ -36,10 +36,10 @@ using namespace ReaxFF; /* ---------------------------------------------------------------------- */ -FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) : +FixReaxFFBonds::FixReaxFFBonds(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { - if (narg != 5) error->all(FLERR,"Illegal fix reax/c/bonds command"); + if (narg != 5) error->all(FLERR,"Illegal fix reaxff/bonds command"); MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); @@ -49,7 +49,7 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) : nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) - error->all(FLERR,"Illegal fix reax/c/bonds command"); + error->all(FLERR,"Illegal fix reaxff/bonds command"); if (me == 0) { char *suffix = strrchr(arg[4],'.'); @@ -67,12 +67,12 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) : } else fp = fopen(arg[4],"w"); if (!fp) - error->one(FLERR,fmt::format("Cannot open fix reax/c/bonds file {}: " + error->one(FLERR,fmt::format("Cannot open fix reaxff/bonds file {}: " "{}",arg[4],utils::getsyserror())); } if (atom->tag_consecutive() == 0) - error->all(FLERR,"Atom IDs must be consecutive for fix reax/c bonds"); + error->all(FLERR,"Atom IDs must be consecutive for fix reaxff bonds"); abo = nullptr; neighid = nullptr; @@ -83,7 +83,7 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -FixReaxCBonds::~FixReaxCBonds() +FixReaxFFBonds::~FixReaxFFBonds() { MPI_Comm_rank(world,&me); @@ -94,7 +94,7 @@ FixReaxCBonds::~FixReaxCBonds() /* ---------------------------------------------------------------------- */ -int FixReaxCBonds::setmask() +int FixReaxFFBonds::setmask() { int mask = 0; mask |= END_OF_STEP; @@ -103,32 +103,31 @@ int FixReaxCBonds::setmask() /* ---------------------------------------------------------------------- */ -void FixReaxCBonds::setup(int /*vflag*/) +void FixReaxFFBonds::setup(int /*vflag*/) { end_of_step(); } /* ---------------------------------------------------------------------- */ -void FixReaxCBonds::init() +void FixReaxFFBonds::init() { - reaxc = (PairReaxC *) force->pair_match("reax/c",0); - if (reaxc == nullptr) error->all(FLERR,"Cannot use fix reax/c/bonds without " - "pair_style reax/c, reax/c/kk, or reax/c/omp"); - + reaxff = (PairReaxFF *) force->pair_match("^reax..",0); + if (reaxff == nullptr) error->all(FLERR,"Cannot use fix reaxff/bonds without " + "pair_style reaxff, reaxff/kk, or reaxff/omp"); } /* ---------------------------------------------------------------------- */ -void FixReaxCBonds::end_of_step() +void FixReaxFFBonds::end_of_step() { - Output_ReaxC_Bonds(update->ntimestep,fp); + Output_ReaxFF_Bonds(); if (me == 0) fflush(fp); } /* ---------------------------------------------------------------------- */ -void FixReaxCBonds::Output_ReaxC_Bonds(bigint /*ntimestep*/, FILE * /*fp*/) +void FixReaxFFBonds::Output_ReaxFF_Bonds() { int i, j; @@ -152,16 +151,14 @@ void FixReaxCBonds::Output_ReaxC_Bonds(bigint /*ntimestep*/, FILE * /*fp*/) abo[i][j] = 0.0; } } - numbonds = 0; - - FindBond(lists, numbonds); + numbonds = FindBond(); // allocate a temporary buffer for the snapshot info MPI_Allreduce(&numbonds,&numbonds_max,1,MPI_INT,MPI_MAX,world); MPI_Allreduce(&nlocal,&nlocal_max,1,MPI_INT,MPI_MAX,world); nbuf = 1+(numbonds_max*2+10)*nlocal_max; - memory->create(buf,nbuf,"reax/c/bonds:buf"); + memory->create(buf,nbuf,"reaxff/bonds:buf"); for (i = 0; i < nbuf; i ++) buf[i] = 0.0; // Pass information to buffer @@ -176,26 +173,27 @@ void FixReaxCBonds::Output_ReaxC_Bonds(bigint /*ntimestep*/, FILE * /*fp*/) /* ---------------------------------------------------------------------- */ -void FixReaxCBonds::FindBond(struct _reax_list * /*lists*/, int &numbonds) +int FixReaxFFBonds::FindBond() { int *ilist, i, ii, inum; int j, pj, nj; tagint jtag; double bo_tmp,bo_cut; - inum = reaxc->list->inum; - ilist = reaxc->list->ilist; + inum = reaxff->list->inum; + ilist = reaxff->list->ilist; bond_data *bo_ij; - bo_cut = reaxc->api->control->bg_cut; + bo_cut = reaxff->api->control->bg_cut; tagint *tag = atom->tag; + int numbonds = 0; for (ii = 0; ii < inum; ii++) { i = ilist[ii]; nj = 0; - for (pj = Start_Index(i, reaxc->api->lists); pj < End_Index(i, reaxc->api->lists); ++pj) { - bo_ij = &(reaxc->api->lists->select.bond_list[pj]); + for (pj = Start_Index(i, reaxff->api->lists); pj < End_Index(i, reaxff->api->lists); ++pj) { + bo_ij = &(reaxff->api->lists->select.bond_list[pj]); j = bo_ij->nbr; jtag = tag[j]; bo_tmp = bo_ij->bo_data.BO; @@ -209,11 +207,11 @@ void FixReaxCBonds::FindBond(struct _reax_list * /*lists*/, int &numbonds) numneigh[i] = nj; if (nj > numbonds) numbonds = nj; } - + return numbonds; } /* ---------------------------------------------------------------------- */ -void FixReaxCBonds::PassBuffer(double *buf, int &nbuf_local) +void FixReaxFFBonds::PassBuffer(double *buf, int &nbuf_local) { int i, j, k, numbonds; int nlocal = atom->nlocal; @@ -223,8 +221,8 @@ void FixReaxCBonds::PassBuffer(double *buf, int &nbuf_local) for (i = 0; i < nlocal; i++) { buf[j-1] = atom->tag[i]; buf[j+0] = atom->type[i]; - buf[j+1] = reaxc->api->workspace->total_bond_order[i]; - buf[j+2] = reaxc->api->workspace->nlp[i]; + buf[j+1] = reaxff->api->workspace->total_bond_order[i]; + buf[j+2] = reaxff->api->workspace->nlp[i]; buf[j+3] = atom->q[i]; buf[j+4] = numneigh[i]; numbonds = nint(buf[j+4]); @@ -248,7 +246,7 @@ void FixReaxCBonds::PassBuffer(double *buf, int &nbuf_local) /* ---------------------------------------------------------------------- */ -void FixReaxCBonds::RecvBuffer(double *buf, int nbuf, int nbuf_local, +void FixReaxFFBonds::RecvBuffer(double *buf, int nbuf, int nbuf_local, int natoms, int maxnum) { int i, j, k, itype; @@ -258,7 +256,7 @@ void FixReaxCBonds::RecvBuffer(double *buf, int nbuf, int nbuf_local, bigint ntimestep = update->ntimestep; double sbotmp, nlptmp, avqtmp, abotmp; - double cutof3 = reaxc->api->control->bg_cut; + double cutof3 = reaxff->api->control->bg_cut; MPI_Request irequest, irequest2; if (me == 0) { @@ -320,7 +318,7 @@ void FixReaxCBonds::RecvBuffer(double *buf, int nbuf, int nbuf_local, /* ---------------------------------------------------------------------- */ -int FixReaxCBonds::nint(const double &r) +int FixReaxFFBonds::nint(const double &r) { int i = 0; if (r>0.0) i = static_cast(r+0.5); @@ -330,7 +328,7 @@ int FixReaxCBonds::nint(const double &r) /* ---------------------------------------------------------------------- */ -void FixReaxCBonds::destroy() +void FixReaxFFBonds::destroy() { memory->destroy(abo); memory->destroy(neighid); @@ -339,16 +337,16 @@ void FixReaxCBonds::destroy() /* ---------------------------------------------------------------------- */ -void FixReaxCBonds::allocate() +void FixReaxFFBonds::allocate() { - memory->create(abo,nmax,MAXREAXBOND,"reax/c/bonds:abo"); - memory->create(neighid,nmax,MAXREAXBOND,"reax/c/bonds:neighid"); - memory->create(numneigh,nmax,"reax/c/bonds:numneigh"); + memory->create(abo,nmax,MAXREAXBOND,"reaxff/bonds:abo"); + memory->create(neighid,nmax,MAXREAXBOND,"reaxff/bonds:neighid"); + memory->create(numneigh,nmax,"reaxff/bonds:numneigh"); } /* ---------------------------------------------------------------------- */ -double FixReaxCBonds::memory_usage() +double FixReaxFFBonds::memory_usage() { double bytes; diff --git a/src/REAXFF/fix_reaxc_bonds.h b/src/REAXFF/fix_reaxff_bonds.h similarity index 82% rename from src/REAXFF/fix_reaxc_bonds.h rename to src/REAXFF/fix_reaxff_bonds.h index fbca39fa95..ceb763b205 100644 --- a/src/REAXFF/fix_reaxc_bonds.h +++ b/src/REAXFF/fix_reaxff_bonds.h @@ -14,7 +14,8 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(reax/c/bonds,FixReaxCBonds); +FixStyle(reaxff/bonds,FixReaxFFBonds); +FixStyle(reax/c/bonds,FixReaxFFBonds); // clang-format on #else @@ -25,10 +26,10 @@ FixStyle(reax/c/bonds,FixReaxCBonds); namespace LAMMPS_NS { -class FixReaxCBonds : public Fix { +class FixReaxFFBonds : public Fix { public: - FixReaxCBonds(class LAMMPS *, int, char **); - virtual ~FixReaxCBonds(); + FixReaxFFBonds(class LAMMPS *, int, char **); + virtual ~FixReaxFFBonds(); int setmask(); virtual void init(); void setup(int); @@ -43,8 +44,8 @@ class FixReaxCBonds : public Fix { void allocate(); void destroy(); - virtual void Output_ReaxC_Bonds(bigint, FILE *); - void FindBond(struct _reax_list*, int &); + virtual void Output_ReaxFF_Bonds(); + int FindBond(); void PassBuffer(double *, int &); void RecvBuffer(double *, int, int, int, int); int nint(const double &); @@ -52,7 +53,7 @@ class FixReaxCBonds : public Fix { bigint nvalid, nextvalid(); struct _reax_list *lists; - class PairReaxC *reaxc; + class PairReaxFF *reaxff; class NeighList *list; }; } diff --git a/src/REAXFF/fix_reaxc_species.cpp b/src/REAXFF/fix_reaxff_species.cpp similarity index 85% rename from src/REAXFF/fix_reaxc_species.cpp rename to src/REAXFF/fix_reaxff_species.cpp index da1307ac79..53746b968b 100644 --- a/src/REAXFF/fix_reaxc_species.cpp +++ b/src/REAXFF/fix_reaxff_species.cpp @@ -17,7 +17,7 @@ Oleg Sergeev (VNIIA, sergeev@vniia.ru) ------------------------------------------------------------------------- */ -#include "fix_reaxc_species.h" +#include "fix_reaxff_species.h" #include "atom.h" #include "comm.h" @@ -31,7 +31,7 @@ #include "neighbor.h" #include "update.h" -#include "pair_reaxc.h" +#include "pair_reaxff.h" #include "reaxff_defs.h" #include @@ -41,10 +41,10 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : +FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { - if (narg < 7) error->all(FLERR,"Illegal fix reax/c/species command"); + if (narg < 7) error->all(FLERR,"Illegal fix reaxff/species command"); force_reneighbor = 0; @@ -69,9 +69,9 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : comm_forward = 4; if (nevery <= 0 || nrepeat <= 0 || nfreq <= 0) - error->all(FLERR,"Illegal fix reax/c/species command"); + error->all(FLERR,"Illegal fix reaxff/species command"); if (nfreq % nevery || nrepeat*nevery > nfreq) - error->all(FLERR,"Illegal fix reax/c/species command"); + error->all(FLERR,"Illegal fix reaxff/species command"); // Neighbor lists must stay unchanged during averaging of bonds, // but may be updated when no averaging is performed. @@ -96,11 +96,11 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : } if (me == 0 && rene_flag) { - error->warning(FLERR,"Resetting reneighboring criteria for fix reax/c/species"); + error->warning(FLERR,"Resetting reneighboring criteria for fix reaxff/species"); } tmparg = nullptr; - memory->create(tmparg,4,4,"reax/c/species:tmparg"); + memory->create(tmparg,4,4,"reaxff/species:tmparg"); strcpy(tmparg[0],arg[3]); strcpy(tmparg[1],arg[4]); strcpy(tmparg[2],arg[5]); @@ -121,7 +121,7 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : } else fp = fopen(arg[6],"w"); if (!fp) - error->one(FLERR,fmt::format("Cannot open fix reax/c/species file {}: " + error->one(FLERR,fmt::format("Cannot open fix reaxff/species file {}: " "{}",arg[6],utils::getsyserror())); } @@ -129,8 +129,8 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : clusterID = nullptr; int ntmp = 1; - memory->create(x0,ntmp,"reax/c/species:x0"); - memory->create(clusterID,ntmp,"reax/c/species:clusterID"); + memory->create(x0,ntmp,"reaxff/species:x0"); + memory->create(clusterID,ntmp,"reaxff/species:clusterID"); vector_atom = clusterID; BOCut = nullptr; @@ -149,7 +149,7 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : double bo_cut; bg_cut = 0.30; n = ntypes+1; - memory->create(BOCut,n,n,"reax/c/species:BOCut"); + memory->create(BOCut,n,n,"reaxff/species:BOCut"); for (i = 1; i < n; i ++) for (j = 1; j < n; j ++) BOCut[i][j] = bg_cut; @@ -168,16 +168,16 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : // set BO cutoff if (strcmp(arg[iarg],"cutoff") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix reax/c/species command"); + if (iarg+4 > narg) error->all(FLERR,"Illegal fix reaxff/species command"); itype = atoi(arg[iarg+1]); jtype = atoi(arg[iarg+2]); bo_cut = atof(arg[iarg+3]); if (itype > ntypes || jtype > ntypes) - error->all(FLERR,"Illegal fix reax/c/species command"); + error->all(FLERR,"Illegal fix reaxff/species command"); if (itype <= 0 || jtype <= 0) - error->all(FLERR,"Illegal fix reax/c/species command"); + error->all(FLERR,"Illegal fix reaxff/species command"); if (bo_cut > 1.0 || bo_cut < 0.0) - error->all(FLERR,"Illegal fix reax/c/species command"); + error->all(FLERR,"Illegal fix reaxff/species command"); BOCut[itype][jtype] = bo_cut; BOCut[jtype][itype] = bo_cut; @@ -185,7 +185,7 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : // modify element type names } else if (strcmp(arg[iarg],"element") == 0) { - if (iarg+ntypes+1 > narg) error->all(FLERR,"Illegal fix reax/c/species command"); + if (iarg+ntypes+1 > narg) error->all(FLERR,"Illegal fix reaxff/species command"); eletype = (char**) malloc(ntypes*sizeof(char*)); int len; @@ -199,11 +199,11 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : // position of molecules } else if (strcmp(arg[iarg],"position") == 0) { - if (iarg+3 > narg) error->all(FLERR,"Illegal fix reax/c/species command"); + if (iarg+3 > narg) error->all(FLERR,"Illegal fix reaxff/species command"); posflag = 1; posfreq = atoi(arg[iarg+1]); if (posfreq < nfreq || (posfreq%nfreq != 0)) - error->all(FLERR,"Illegal fix reax/c/species command"); + error->all(FLERR,"Illegal fix reaxff/species command"); filepos = new char[255]; strcpy(filepos,arg[iarg+2]); @@ -212,17 +212,17 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : } else { if (me == 0) { pos = fopen(filepos, "w"); - if (pos == nullptr) error->one(FLERR,"Cannot open fix reax/c/species position file"); + if (pos == nullptr) error->one(FLERR,"Cannot open fix reaxff/species position file"); } singlepos_opened = 1; multipos = 0; } iarg += 3; - } else error->all(FLERR,"Illegal fix reax/c/species command"); + } else error->all(FLERR,"Illegal fix reaxff/species command"); } if (!eleflag) { - memory->create(ele,ntypes+1,"reax/c/species:ele"); + memory->create(ele,ntypes+1,"reaxff/species:ele"); ele[0]='C'; if (ntypes > 1) ele[1]='H'; @@ -239,7 +239,7 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -FixReaxCSpecies::~FixReaxCSpecies() +FixReaxFFSpecies::~FixReaxFFSpecies() { memory->destroy(ele); memory->destroy(BOCut); @@ -265,7 +265,7 @@ FixReaxCSpecies::~FixReaxCSpecies() /* ---------------------------------------------------------------------- */ -int FixReaxCSpecies::setmask() +int FixReaxFFSpecies::setmask() { int mask = 0; mask |= POST_INTEGRATE; @@ -274,27 +274,27 @@ int FixReaxCSpecies::setmask() /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::setup(int /*vflag*/) +void FixReaxFFSpecies::setup(int /*vflag*/) { ntotal = static_cast (atom->natoms); if (Name == nullptr) - memory->create(Name,ntypes,"reax/c/species:Name"); + memory->create(Name,ntypes,"reaxff/species:Name"); post_integrate(); } /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::init() +void FixReaxFFSpecies::init() { if (atom->tag_enable == 0) - error->all(FLERR,"Cannot use fix reax/c/species unless atoms have IDs"); + error->all(FLERR,"Cannot use fix reaxff/species unless atoms have IDs"); - reaxc = (PairReaxC *) force->pair_match("reax/c",0); - if (reaxc == nullptr) error->all(FLERR,"Cannot use fix reax/c/species without " - "pair_style reax/c, reax/c/kk, or reax/c/omp"); + reaxff = (PairReaxFF *) force->pair_match("^reax..",0); + if (reaxff == nullptr) error->all(FLERR,"Cannot use fix reaxff/species without " + "pair_style reaxff, reaxff/kk, or reaxff/omp"); - reaxc->fixspecies_flag = 1; + reaxff->fixspecies_flag = 1; // reset next output timestep if not yet set or timestep has been reset if (nvalid != update->ntimestep) @@ -303,9 +303,9 @@ void FixReaxCSpecies::init() // check if this fix has been called twice int count = 0; for (int i = 0; i < modify->nfix; i++) - if (strcmp(modify->fix[i]->style,"reax/c/species") == 0) count++; + if (strcmp(modify->fix[i]->style,"reaxff/species") == 0) count++; if (count > 1 && comm->me == 0) - error->warning(FLERR,"More than one fix reax/c/species"); + error->warning(FLERR,"More than one fix reaxff/species"); if (!setupflag) { // create a compute to store properties @@ -321,7 +321,7 @@ void FixReaxCSpecies::init() /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::create_compute() +void FixReaxFFSpecies::create_compute() { int narg; char **args; @@ -368,7 +368,7 @@ void FixReaxCSpecies::create_compute() /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::create_fix() +void FixReaxFFSpecies::create_fix() { int narg; char **args; @@ -420,22 +420,22 @@ void FixReaxCSpecies::create_fix() /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::init_list(int /*id*/, NeighList *ptr) +void FixReaxFFSpecies::init_list(int /*id*/, NeighList *ptr) { list = ptr; } /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::post_integrate() +void FixReaxFFSpecies::post_integrate() { - Output_ReaxC_Bonds(update->ntimestep,fp); + Output_ReaxFF_Bonds(update->ntimestep,fp); if (me == 0) fflush(fp); } /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::Output_ReaxC_Bonds(bigint ntimestep, FILE * /*fp*/) +void FixReaxFFSpecies::Output_ReaxFF_Bonds(bigint ntimestep, FILE * /*fp*/) { int Nmole, Nspec; @@ -451,8 +451,8 @@ void FixReaxCSpecies::Output_ReaxC_Bonds(bigint ntimestep, FILE * /*fp*/) nmax = atom->nmax; memory->destroy(x0); memory->destroy(clusterID); - memory->create(x0,nmax,"reax/c/species:x0"); - memory->create(clusterID,nmax,"reax/c/species:clusterID"); + memory->create(x0,nmax,"reaxff/species:x0"); + memory->create(clusterID,nmax,"reaxff/species:clusterID"); vector_atom = clusterID; } @@ -484,7 +484,7 @@ void FixReaxCSpecies::Output_ReaxC_Bonds(bigint ntimestep, FILE * /*fp*/) /* ---------------------------------------------------------------------- */ -AtomCoord FixReaxCSpecies::chAnchor(AtomCoord in1, AtomCoord in2) +AtomCoord FixReaxFFSpecies::chAnchor(AtomCoord in1, AtomCoord in2) { if (in1.x < in2.x) return in1; @@ -501,7 +501,7 @@ AtomCoord FixReaxCSpecies::chAnchor(AtomCoord in1, AtomCoord in2) /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::FindMolecule () +void FixReaxFFSpecies::FindMolecule () { int i,j,ii,jj,inum,itype,jtype,loop,looptot; int change,done,anychange; @@ -510,8 +510,8 @@ void FixReaxCSpecies::FindMolecule () double bo_tmp,bo_cut; double **spec_atom = f_SPECBOND->array_atom; - inum = reaxc->list->inum; - ilist = reaxc->list->ilist; + inum = reaxff->list->inum; + ilist = reaxff->list->ilist; for (ii = 0; ii < inum; ii++) { i = ilist[ii]; @@ -540,7 +540,7 @@ void FixReaxCSpecies::FindMolecule () itype = atom->type[i]; for (jj = 0; jj < MAXSPECBOND; jj++) { - j = reaxc->tmpid[i][jj]; + j = reaxff->tmpid[i][jj]; if ((j == 0) || (j < i)) continue; if (!(mask[j] & groupbit)) continue; @@ -575,7 +575,7 @@ void FixReaxCSpecies::FindMolecule () /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::SortMolecule(int &Nmole) +void FixReaxFFSpecies::SortMolecule(int &Nmole) { memory->destroy(molmap); molmap = nullptr; @@ -595,16 +595,16 @@ void FixReaxCSpecies::SortMolecule(int &Nmole) MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); if (flagall && me == 0) error->warning(FLERR,"Atom with cluster ID = 0 included in " - "fix reax/c/species group"); + "fix reaxff/species group"); MPI_Allreduce(&lo,&idlo,1,MPI_INT,MPI_MIN,world); MPI_Allreduce(&hi,&idhi,1,MPI_INT,MPI_MAX,world); if (idlo == ntotal) if (me == 0) error->warning(FLERR,"Atom with cluster ID = maxmol " - "included in fix reax/c/species group"); + "included in fix reaxff/species group"); int nlen = idhi - idlo + 1; - memory->create(molmap,nlen,"reax/c/species:molmap"); + memory->create(molmap,nlen,"reaxff/species:molmap"); for (n = 0; n < nlen; n++) molmap[n] = 0; for (n = 0; n < nlocal; n++) { @@ -613,7 +613,7 @@ void FixReaxCSpecies::SortMolecule(int &Nmole) } int *molmapall; - memory->create(molmapall,nlen,"reax/c/species:molmapall"); + memory->create(molmapall,nlen,"reaxff/species:molmapall"); MPI_Allreduce(molmap,molmapall,nlen,MPI_INT,MPI_MAX,world); Nmole = 0; @@ -646,7 +646,7 @@ void FixReaxCSpecies::SortMolecule(int &Nmole) /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::FindSpecies(int Nmole, int &Nspec) +void FixReaxFFSpecies::FindSpecies(int Nmole, int &Nspec) { int k, l, m, n, itype, cid; int flag_identity, flag_mol, flag_spec; @@ -656,16 +656,16 @@ void FixReaxCSpecies::FindSpecies(int Nmole, int &Nspec) memory->destroy(MolName); MolName = nullptr; - memory->create(MolName,Nmole*(ntypes+1),"reax/c/species:MolName"); + memory->create(MolName,Nmole*(ntypes+1),"reaxff/species:MolName"); memory->destroy(NMol); NMol = nullptr; - memory->create(NMol,Nmole,"reax/c/species:NMol"); + memory->create(NMol,Nmole,"reaxff/species:NMol"); for (m = 0; m < Nmole; m ++) NMol[m] = 1; - memory->create(Nameall,ntypes,"reax/c/species:Nameall"); - memory->create(NMolall,Nmole,"reax/c/species:NMolall"); + memory->create(Nameall,ntypes,"reaxff/species:Nameall"); + memory->create(NMolall,Nmole,"reaxff/species:NMolall"); for (m = 1, Nspec = 0; m <= Nmole; m ++) { for (n = 0; n < ntypes; n ++) Name[n] = 0; @@ -705,16 +705,16 @@ void FixReaxCSpecies::FindSpecies(int Nmole, int &Nspec) memory->destroy(nd); nd = nullptr; - memory->create(nd,Nspec,"reax/c/species:nd"); + memory->create(nd,Nspec,"reaxff/species:nd"); memory->destroy(MolType); MolType = nullptr; - memory->create(MolType,Nspec*(ntypes+2),"reax/c/species:MolType"); + memory->create(MolType,Nspec*(ntypes+2),"reaxff/species:MolType"); } /* ---------------------------------------------------------------------- */ -int FixReaxCSpecies::CheckExistence(int id, int ntypes) +int FixReaxFFSpecies::CheckExistence(int id, int ntypes) { int i, j, molid, flag; @@ -735,7 +735,7 @@ int FixReaxCSpecies::CheckExistence(int id, int ntypes) /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::WriteFormulas(int Nmole, int Nspec) +void FixReaxFFSpecies::WriteFormulas(int Nmole, int Nspec) { int i, j, itemp; bigint ntimestep = update->ntimestep; @@ -771,7 +771,7 @@ void FixReaxCSpecies::WriteFormulas(int Nmole, int Nspec) /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::OpenPos() +void FixReaxFFSpecies::OpenPos() { char *filecurrent; bigint ntimestep = update->ntimestep; @@ -792,7 +792,7 @@ void FixReaxCSpecies::OpenPos() if (me == 0) { pos = fopen(filecurrent, "w"); - if (pos == nullptr) error->one(FLERR,"Cannot open fix reax/c/species position file"); + if (pos == nullptr) error->one(FLERR,"Cannot open fix reaxff/species position file"); } else pos = nullptr; multipos_opened = 1; @@ -801,7 +801,7 @@ void FixReaxCSpecies::OpenPos() /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::WritePos(int Nmole, int Nspec) +void FixReaxFFSpecies::WritePos(int Nmole, int Nspec) { int i, itype, cid; int count, count_tmp, m, n, k; @@ -831,7 +831,7 @@ void FixReaxCSpecies::WritePos(int Nmole, int Nspec) } Nameall = nullptr; - memory->create(Nameall,ntypes,"reax/c/species:Nameall"); + memory->create(Nameall,ntypes,"reaxff/species:Nameall"); for (m = 1; m <= Nmole; m ++) { @@ -916,7 +916,7 @@ void FixReaxCSpecies::WritePos(int Nmole, int Nspec) /* ---------------------------------------------------------------------- */ -double FixReaxCSpecies::compute_vector(int n) +double FixReaxFFSpecies::compute_vector(int n) { if (n == 0) return vector_nmole; @@ -928,7 +928,7 @@ double FixReaxCSpecies::compute_vector(int n) /* ---------------------------------------------------------------------- */ -int FixReaxCSpecies::nint(const double &r) +int FixReaxFFSpecies::nint(const double &r) { int i = 0; if (r>0.0) i = static_cast(r+0.5); @@ -938,7 +938,7 @@ int FixReaxCSpecies::nint(const double &r) /* ---------------------------------------------------------------------- */ -int FixReaxCSpecies::pack_forward_comm(int n, int *list, double *buf, +int FixReaxFFSpecies::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/) { int i,j,m; @@ -957,7 +957,7 @@ int FixReaxCSpecies::pack_forward_comm(int n, int *list, double *buf, /* ---------------------------------------------------------------------- */ -void FixReaxCSpecies::unpack_forward_comm(int n, int first, double *buf) +void FixReaxFFSpecies::unpack_forward_comm(int n, int first, double *buf) { int i,m,last; @@ -974,7 +974,7 @@ void FixReaxCSpecies::unpack_forward_comm(int n, int first, double *buf) /* ---------------------------------------------------------------------- */ -double FixReaxCSpecies::memory_usage() +double FixReaxFFSpecies::memory_usage() { double bytes; diff --git a/src/REAXFF/fix_reaxc_species.h b/src/REAXFF/fix_reaxff_species.h similarity index 87% rename from src/REAXFF/fix_reaxc_species.h rename to src/REAXFF/fix_reaxff_species.h index 225e0bcf24..1957c1f8b1 100644 --- a/src/REAXFF/fix_reaxc_species.h +++ b/src/REAXFF/fix_reaxff_species.h @@ -14,7 +14,8 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(reax/c/species,FixReaxCSpecies); +FixStyle(reaxff/species,FixReaxFFSpecies); +FixStyle(reax/c/species,FixReaxFFSpecies); // clang-format on #else @@ -31,10 +32,10 @@ typedef struct { double x, y, z; } AtomCoord; -class FixReaxCSpecies : public Fix { +class FixReaxFFSpecies : public Fix { public: - FixReaxCSpecies(class LAMMPS *, int, char **); - virtual ~FixReaxCSpecies(); + FixReaxFFSpecies(class LAMMPS *, int, char **); + virtual ~FixReaxFFSpecies(); int setmask(); virtual void init(); void init_list(int, class NeighList *); @@ -59,7 +60,7 @@ class FixReaxCSpecies : public Fix { int singlepos_opened, multipos_opened; char *ele, **eletype, *filepos; - void Output_ReaxC_Bonds(bigint, FILE *); + void Output_ReaxFF_Bonds(bigint, FILE *); void create_compute(); void create_fix(); AtomCoord chAnchor(AtomCoord, AtomCoord); @@ -80,7 +81,7 @@ class FixReaxCSpecies : public Fix { class NeighList *list; class FixAveAtom *f_SPECBOND; - class PairReaxC *reaxc; + class PairReaxFF *reaxff; }; } diff --git a/src/REAXFF/pair_reaxc.cpp b/src/REAXFF/pair_reaxff.cpp similarity index 88% rename from src/REAXFF/pair_reaxc.cpp rename to src/REAXFF/pair_reaxff.cpp index 389b7d9e13..0aea45b9cd 100644 --- a/src/REAXFF/pair_reaxc.cpp +++ b/src/REAXFF/pair_reaxff.cpp @@ -17,18 +17,18 @@ Hasan Metin Aktulga, Michigan State University, hma@cse.msu.edu Per-atom energy/virial added by Ray Shan (Sandia) - Fix reax/c/bonds and fix reax/c/species for pair_style reax/c added by + Fix reaxff/bonds and fix reaxff/species for pair_style reaxff added by Ray Shan (Sandia) Hybrid and hybrid/overlay compatibility added by Ray Shan (Sandia) ------------------------------------------------------------------------- */ -#include "pair_reaxc.h" +#include "pair_reaxff.h" #include "atom.h" #include "citeme.h" #include "comm.h" #include "error.h" -#include "fix_reaxc.h" +#include "fix_reaxff.h" #include "force.h" #include "memory.h" #include "modify.h" @@ -47,7 +47,7 @@ using namespace LAMMPS_NS; using namespace ReaxFF; static const char cite_pair_reax_c[] = - "pair reax/c command:\n\n" + "pair reaxff command:\n\n" "@Article{Aktulga12,\n" " author = {H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama},\n" " title = {Parallel reactive molecular dynamics: Numerical methods and algorithmic techniques},\n" @@ -59,7 +59,7 @@ static const char cite_pair_reax_c[] = /* ---------------------------------------------------------------------- */ -PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp) +PairReaxFF::PairReaxFF(LAMMPS *lmp) : Pair(lmp) { if (lmp->citeme) lmp->citeme->add(cite_pair_reax_c); @@ -70,7 +70,7 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp) centroidstressflag = CENTROID_NOTAVAIL; ghostneigh = 1; - fix_id = utils::strdup("REAXC_" + std::to_string(instance_me)); + fix_id = utils::strdup("REAXFF_" + std::to_string(instance_me)); api = new API; @@ -102,7 +102,7 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp) api->system->omp_active = 0; - fix_reax = nullptr; + fix_reaxff = nullptr; tmpid = nullptr; tmpbo = nullptr; @@ -117,11 +117,11 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp) /* ---------------------------------------------------------------------- */ -PairReaxC::~PairReaxC() +PairReaxFF::~PairReaxFF() { if (copymode) return; - if (fix_reax) modify->delete_fix(fix_id); + if (fix_reaxff) modify->delete_fix(fix_id); delete[] fix_id; if (setup_flag) { @@ -166,7 +166,7 @@ PairReaxC::~PairReaxC() /* ---------------------------------------------------------------------- */ -void PairReaxC::allocate() +void PairReaxFF::allocate() { allocated = 1; int n = atom->ntypes; @@ -183,7 +183,7 @@ void PairReaxC::allocate() /* ---------------------------------------------------------------------- */ -void PairReaxC::settings(int narg, char **arg) +void PairReaxFF::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal pair_style command"); @@ -226,49 +226,49 @@ void PairReaxC::settings(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"checkqeq") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reaxff command"); if (strcmp(arg[iarg+1],"yes") == 0) qeqflag = 1; else if (strcmp(arg[iarg+1],"no") == 0) qeqflag = 0; - else error->all(FLERR,"Illegal pair_style reax/c command"); + else error->all(FLERR,"Illegal pair_style reaxff command"); iarg += 2; } else if (strcmp(arg[iarg],"enobonds") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reaxff command"); if (strcmp(arg[iarg+1],"yes") == 0) api->control->enobondsflag = 1; else if (strcmp(arg[iarg+1],"no") == 0) api->control->enobondsflag = 0; - else error->all(FLERR,"Illegal pair_style reax/c command"); + else error->all(FLERR,"Illegal pair_style reaxff command"); iarg += 2; } else if (strcmp(arg[iarg],"lgvdw") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reaxff command"); if (strcmp(arg[iarg+1],"yes") == 0) api->control->lgflag = 1; else if (strcmp(arg[iarg+1],"no") == 0) api->control->lgflag = 0; - else error->all(FLERR,"Illegal pair_style reax/c command"); + else error->all(FLERR,"Illegal pair_style reaxff command"); iarg += 2; } else if (strcmp(arg[iarg],"safezone") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reaxff command"); api->system->safezone = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (api->system->safezone < 0.0) - error->all(FLERR,"Illegal pair_style reax/c safezone command"); + error->all(FLERR,"Illegal pair_style reaxff safezone command"); api->system->saferzone = api->system->safezone*1.2 + 0.2; iarg += 2; } else if (strcmp(arg[iarg],"mincap") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reaxff command"); api->system->mincap = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (api->system->mincap < 0) - error->all(FLERR,"Illegal pair_style reax/c mincap command"); + error->all(FLERR,"Illegal pair_style reaxff mincap command"); iarg += 2; } else if (strcmp(arg[iarg],"minhbonds") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reaxff command"); api->system->minhbonds = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (api->system->minhbonds < 0) - error->all(FLERR,"Illegal pair_style reax/c minhbonds command"); + error->all(FLERR,"Illegal pair_style reaxff minhbonds command"); iarg += 2; - } else error->all(FLERR,"Illegal pair_style reax/c command"); + } else error->all(FLERR,"Illegal pair_style reaxff command"); } } /* ---------------------------------------------------------------------- */ -void PairReaxC::coeff(int nargs, char **args) +void PairReaxFF::coeff(int nargs, char **args) { if (!allocated) allocate(); @@ -331,15 +331,15 @@ void PairReaxC::coeff(int nargs, char **args) /* ---------------------------------------------------------------------- */ -void PairReaxC::init_style() +void PairReaxFF::init_style() { if (!atom->q_flag) - error->all(FLERR,"Pair style reax/c requires atom attribute q"); + error->all(FLERR,"Pair style reaxff requires atom attribute q"); bool have_qeq = ((modify->find_fix_by_style("^qeq/reax") != -1) || (modify->find_fix_by_style("^qeq/shielded") != -1)); if (!have_qeq && qeqflag == 1) - error->all(FLERR,"Pair reax/c requires use of fix qeq/reax or qeq/shielded"); + error->all(FLERR,"Pair reaxff requires use of fix qeq/reaxff or qeq/shielded"); api->system->n = atom->nlocal; // my atoms api->system->N = atom->nlocal + atom->nghost; // mine + ghosts @@ -347,14 +347,14 @@ void PairReaxC::init_style() api->system->wsize = comm->nprocs; if (atom->tag_enable == 0) - error->all(FLERR,"Pair style reax/c requires atom IDs"); + error->all(FLERR,"Pair style reaxff requires atom IDs"); if (force->newton_pair == 0) - error->all(FLERR,"Pair style reax/c requires newton pair on"); + error->all(FLERR,"Pair style reaxff requires newton pair on"); // because system->bigN is an int, we cannot have more atoms than MAXSMALLINT if (atom->natoms > MAXSMALLINT) - error->all(FLERR,"Too many atoms for pair style reax/c"); + error->all(FLERR,"Too many atoms for pair style reaxff"); // need a half neighbor list w/ Newton off and ghost neighbors // built whenever re-neighboring occurs @@ -368,15 +368,15 @@ void PairReaxC::init_style() error->warning(FLERR,"Total cutoff < 2*bond cutoff. May need to use an " "increased neighbor list skin."); - if (fix_reax == nullptr) { - modify->add_fix(fmt::format("{} all REAXC",fix_id)); - fix_reax = (FixReaxC *) modify->fix[modify->nfix-1]; + if (fix_reaxff == nullptr) { + modify->add_fix(fmt::format("{} all REAXFF",fix_id)); + fix_reaxff = (FixReaxFF *) modify->fix[modify->nfix-1]; } } /* ---------------------------------------------------------------------- */ -void PairReaxC::setup() +void PairReaxFF::setup() { int oldN; int mincap = api->system->mincap; @@ -391,8 +391,8 @@ void PairReaxC::setup() setup_flag = 1; - int *num_bonds = fix_reax->num_bonds; - int *num_hbonds = fix_reax->num_hbonds; + int *num_bonds = fix_reaxff->num_bonds; + int *num_hbonds = fix_reaxff->num_hbonds; // determine the local and total capacity @@ -408,7 +408,7 @@ void PairReaxC::setup() int num_nbrs = estimate_reax_lists(); if (num_nbrs < 0) - error->all(FLERR,"Too many neighbors for pair style reax/c"); + error->all(FLERR,"Too many neighbors for pair style reaxff"); Make_List(api->system->total_cap,num_nbrs,TYP_FAR_NEIGHBOR,api->lists+FAR_NBRS); (api->lists+FAR_NBRS)->error_ptr=error; @@ -440,7 +440,7 @@ void PairReaxC::setup() /* ---------------------------------------------------------------------- */ -double PairReaxC::init_one(int i, int j) +double PairReaxFF::init_one(int i, int j) { if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); @@ -450,16 +450,16 @@ double PairReaxC::init_one(int i, int j) /* ---------------------------------------------------------------------- */ -void PairReaxC::compute(int eflag, int vflag) +void PairReaxFF::compute(int eflag, int vflag) { double evdwl,ecoul; // communicate num_bonds once every reneighboring // 2 num arrays stored by fix, grab ptr to them - if (neighbor->ago == 0) comm->forward_comm_fix(fix_reax); - int *num_bonds = fix_reax->num_bonds; - int *num_hbonds = fix_reax->num_hbonds; + if (neighbor->ago == 0) comm->forward_comm_fix(fix_reaxff); + int *num_bonds = fix_reaxff->num_bonds; + int *num_hbonds = fix_reaxff->num_hbonds; evdwl = ecoul = 0.0; ev_init(eflag,vflag); @@ -528,7 +528,7 @@ void PairReaxC::compute(int eflag, int vflag) api->data->step = update->ntimestep; - // populate tmpid and tmpbo arrays for fix reax/c/species + // populate tmpid and tmpbo arrays for fix reaxff/species int i, j; if (fixspecies_flag) { @@ -552,10 +552,10 @@ void PairReaxC::compute(int eflag, int vflag) /* ---------------------------------------------------------------------- */ -void PairReaxC::write_reax_atoms() +void PairReaxFF::write_reax_atoms() { - int *num_bonds = fix_reax->num_bonds; - int *num_hbonds = fix_reax->num_hbonds; + int *num_bonds = fix_reaxff->num_bonds; + int *num_hbonds = fix_reaxff->num_hbonds; if (api->system->N > api->system->total_cap) error->all(FLERR,"Too many ghost atoms"); @@ -574,7 +574,7 @@ void PairReaxC::write_reax_atoms() /* ---------------------------------------------------------------------- */ -void PairReaxC::get_distance(rvec xj, rvec xi, double *d_sqr, rvec *dvec) +void PairReaxFF::get_distance(rvec xj, rvec xi, double *d_sqr, rvec *dvec) { (*dvec)[0] = xj[0] - xi[0]; (*dvec)[1] = xj[1] - xi[1]; @@ -584,7 +584,7 @@ void PairReaxC::get_distance(rvec xj, rvec xi, double *d_sqr, rvec *dvec) /* ---------------------------------------------------------------------- */ -void PairReaxC::set_far_nbr(far_neighbor_data *fdest, +void PairReaxFF::set_far_nbr(far_neighbor_data *fdest, int j, double d, rvec dvec) { fdest->nbr = j; @@ -595,7 +595,7 @@ void PairReaxC::set_far_nbr(far_neighbor_data *fdest, /* ---------------------------------------------------------------------- */ -int PairReaxC::estimate_reax_lists() +int PairReaxFF::estimate_reax_lists() { int itr_i, itr_j, i, j; int num_nbrs, num_marked; @@ -641,7 +641,7 @@ int PairReaxC::estimate_reax_lists() /* ---------------------------------------------------------------------- */ -int PairReaxC::write_reax_lists() +int PairReaxFF::write_reax_lists() { int itr_i, itr_j, i, j; int num_nbrs; @@ -697,7 +697,7 @@ int PairReaxC::write_reax_lists() /* ---------------------------------------------------------------------- */ -void PairReaxC::read_reax_forces(int /*vflag*/) +void PairReaxFF::read_reax_forces(int /*vflag*/) { for (int i = 0; i < api->system->N; ++i) { api->system->my_atoms[i].f[0] = api->workspace->f[i][0]; @@ -713,7 +713,7 @@ void PairReaxC::read_reax_forces(int /*vflag*/) /* ---------------------------------------------------------------------- */ -void *PairReaxC::extract(const char *str, int &dim) +void *PairReaxFF::extract(const char *str, int &dim) { dim = 1; if (strcmp(str,"chi") == 0 && chi) { @@ -739,7 +739,7 @@ void *PairReaxC::extract(const char *str, int &dim) /* ---------------------------------------------------------------------- */ -double PairReaxC::memory_usage() +double PairReaxFF::memory_usage() { double bytes = 0.0; @@ -747,12 +747,12 @@ double PairReaxC::memory_usage() bytes += (double)1.0 * api->system->N * sizeof(int); bytes += (double)1.0 * api->system->N * sizeof(double); - // From reaxc_allocate: BO + // From reaxff_allocate: BO bytes += (double)1.0 * api->system->total_cap * sizeof(reax_atom); bytes += (double)19.0 * api->system->total_cap * sizeof(double); bytes += (double)3.0 * api->system->total_cap * sizeof(int); - // From reaxc_lists + // From reaxff_lists bytes += (double)2.0 * api->lists->n * sizeof(int); bytes += (double)api->lists->num_intrs * sizeof(three_body_interaction_data); bytes += (double)api->lists->num_intrs * sizeof(bond_data); @@ -767,7 +767,7 @@ double PairReaxC::memory_usage() /* ---------------------------------------------------------------------- */ -void PairReaxC::FindBond() +void PairReaxFF::FindBond() { int i, j, pj, nj; double bo_tmp, bo_cut; @@ -788,7 +788,7 @@ void PairReaxC::FindBond() tmpid[i][nj] = j; tmpbo[i][nj] = bo_tmp; nj ++; - if (nj > MAXSPECBOND) error->all(FLERR,"Increase MAXSPECBOND in reaxc_defs.h"); + if (nj > MAXSPECBOND) error->all(FLERR,"Increase MAXSPECBOND in reaxff_defs.h"); } } } diff --git a/src/REAXFF/pair_reaxc.h b/src/REAXFF/pair_reaxff.h similarity index 88% rename from src/REAXFF/pair_reaxc.h rename to src/REAXFF/pair_reaxff.h index 36f5bf61d5..f9f3b636c3 100644 --- a/src/REAXFF/pair_reaxc.h +++ b/src/REAXFF/pair_reaxff.h @@ -24,12 +24,13 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(reax/c,PairReaxC); +PairStyle(reaxff,PairReaxFF); +PairStyle(reax/c,PairReaxFF); // clang-format on #else -#ifndef LMP_PAIR_REAXC_H -#define LMP_PAIR_REAXC_H +#ifndef LMP_PAIR_REAXFF_H +#define LMP_PAIR_REAXFF_H #include "pair.h" @@ -40,10 +41,10 @@ namespace ReaxFF { namespace LAMMPS_NS { -class PairReaxC : public Pair { +class PairReaxFF : public Pair { public: - PairReaxC(class LAMMPS *); - ~PairReaxC(); + PairReaxFF(class LAMMPS *); + ~PairReaxFF(); void compute(int, int); void settings(int, char **); void coeff(int, char **); @@ -60,7 +61,7 @@ class PairReaxC : public Pair { protected: char *fix_id; double cutmax; - class FixReaxC *fix_reax; + class FixReaxFF *fix_reaxff; double *chi,*eta,*gamma; int qeqflag; @@ -93,7 +94,7 @@ protected: E: Too many ghost atoms Number of ghost atoms has increased too much during simulation and has exceeded -the size of reax/c arrays. Increase safe_zone and min_cap in pair_style reax/c +the size of reaxff arrays. Increase safe_zone and min_cap in pair_style reaxff command */ diff --git a/src/REAXFF/reaxc_allocate.cpp b/src/REAXFF/reaxff_allocate.cpp similarity index 100% rename from src/REAXFF/reaxc_allocate.cpp rename to src/REAXFF/reaxff_allocate.cpp diff --git a/src/REAXFF/reaxc_bond_orders.cpp b/src/REAXFF/reaxff_bond_orders.cpp similarity index 100% rename from src/REAXFF/reaxc_bond_orders.cpp rename to src/REAXFF/reaxff_bond_orders.cpp diff --git a/src/REAXFF/reaxc_bonds.cpp b/src/REAXFF/reaxff_bonds.cpp similarity index 100% rename from src/REAXFF/reaxc_bonds.cpp rename to src/REAXFF/reaxff_bonds.cpp diff --git a/src/REAXFF/reaxc_control.cpp b/src/REAXFF/reaxff_control.cpp similarity index 100% rename from src/REAXFF/reaxc_control.cpp rename to src/REAXFF/reaxff_control.cpp diff --git a/src/REAXFF/reaxff_defs.h b/src/REAXFF/reaxff_defs.h index 868f6e22c2..c6df5de0ea 100644 --- a/src/REAXFF/reaxff_defs.h +++ b/src/REAXFF/reaxff_defs.h @@ -50,8 +50,8 @@ #define DANGER_ZONE 0.90 #define LOOSE_ZONE 0.75 -#define MAXREAXBOND 24 /* used in fix_reaxc_bonds.cpp and pair_reaxc.cpp */ -#define MAXSPECBOND 24 /* used in fix_reaxc_species.cpp and pair_reaxc.cpp */ +#define MAXREAXBOND 24 /* used in fix_reaxff_bonds.cpp and pair_reaxff.cpp */ +#define MAXSPECBOND 24 /* used in fix_reaxff_species.cpp and pair_reaxff.cpp */ #define REAX_MAX_3BODY_PARAM 5 #define REAX_MAX_4BODY_PARAM 5 diff --git a/src/REAXFF/reaxc_ffield.cpp b/src/REAXFF/reaxff_ffield.cpp similarity index 100% rename from src/REAXFF/reaxc_ffield.cpp rename to src/REAXFF/reaxff_ffield.cpp diff --git a/src/REAXFF/reaxc_forces.cpp b/src/REAXFF/reaxff_forces.cpp similarity index 100% rename from src/REAXFF/reaxc_forces.cpp rename to src/REAXFF/reaxff_forces.cpp diff --git a/src/REAXFF/reaxc_hydrogen_bonds.cpp b/src/REAXFF/reaxff_hydrogen_bonds.cpp similarity index 100% rename from src/REAXFF/reaxc_hydrogen_bonds.cpp rename to src/REAXFF/reaxff_hydrogen_bonds.cpp diff --git a/src/REAXFF/reaxc_init_md.cpp b/src/REAXFF/reaxff_init_md.cpp similarity index 100% rename from src/REAXFF/reaxc_init_md.cpp rename to src/REAXFF/reaxff_init_md.cpp diff --git a/src/REAXFF/reaxc_list.cpp b/src/REAXFF/reaxff_list.cpp similarity index 100% rename from src/REAXFF/reaxc_list.cpp rename to src/REAXFF/reaxff_list.cpp diff --git a/src/REAXFF/reaxc_lookup.cpp b/src/REAXFF/reaxff_lookup.cpp similarity index 100% rename from src/REAXFF/reaxc_lookup.cpp rename to src/REAXFF/reaxff_lookup.cpp diff --git a/src/REAXFF/reaxc_multi_body.cpp b/src/REAXFF/reaxff_multi_body.cpp similarity index 100% rename from src/REAXFF/reaxc_multi_body.cpp rename to src/REAXFF/reaxff_multi_body.cpp diff --git a/src/REAXFF/reaxc_nonbonded.cpp b/src/REAXFF/reaxff_nonbonded.cpp similarity index 100% rename from src/REAXFF/reaxc_nonbonded.cpp rename to src/REAXFF/reaxff_nonbonded.cpp diff --git a/src/REAXFF/reaxc_reset_tools.cpp b/src/REAXFF/reaxff_reset_tools.cpp similarity index 100% rename from src/REAXFF/reaxc_reset_tools.cpp rename to src/REAXFF/reaxff_reset_tools.cpp diff --git a/src/REAXFF/reaxc_tool_box.cpp b/src/REAXFF/reaxff_tool_box.cpp similarity index 100% rename from src/REAXFF/reaxc_tool_box.cpp rename to src/REAXFF/reaxff_tool_box.cpp diff --git a/src/REAXFF/reaxc_torsion_angles.cpp b/src/REAXFF/reaxff_torsion_angles.cpp similarity index 100% rename from src/REAXFF/reaxc_torsion_angles.cpp rename to src/REAXFF/reaxff_torsion_angles.cpp diff --git a/src/REAXFF/reaxc_valence_angles.cpp b/src/REAXFF/reaxff_valence_angles.cpp similarity index 100% rename from src/REAXFF/reaxc_valence_angles.cpp rename to src/REAXFF/reaxff_valence_angles.cpp diff --git a/tools/README b/tools/README index 0f6f36e78a..eb329e27cd 100644 --- a/tools/README +++ b/tools/README @@ -43,7 +43,6 @@ phonon post-process output of the fix phonon command polybond Python tool for programmable polymer bonding pymol_asphere convert LAMMPS output of ellipsoids to PyMol format python Python scripts for post-processing LAMMPS output -reax Tools for analyzing output of ReaxFF simulations replica tool to reorder LAMMPS replica trajectories according to temperature singularity Singularity container descriptions suitable for LAMMPS development smd convert Smooth Mach Dynamics triangles to VTK diff --git a/tools/reax/Cutoff.dic b/tools/reax/Cutoff.dic deleted file mode 100644 index 7c52b74468..0000000000 --- a/tools/reax/Cutoff.dic +++ /dev/null @@ -1,14 +0,0 @@ -# Interesting name. This file contains -# the bond-order cut off for each -# pair of ReaxFF elements -C N 0.3 -C C 0.55 -C O 0.65 -C H 0.4 -O O 0.65 -N O 0.40 -O H 0.4 -H H 0.55 -H N 0.55 -N N 0.55 -# diff --git a/tools/reax/README.txt b/tools/reax/README.txt deleted file mode 100644 index 3c9fe4506b..0000000000 --- a/tools/reax/README.txt +++ /dev/null @@ -1,10 +0,0 @@ -=== ReaxFF tools === -=============================== - -The programs in this folder can be used to analyze the -output of simulations using the ReaxFF potentials; - -reaxc_bond.pl: reads the bonding information in the - .trj file produced by pair_style reax/c and - outputs molecule counts for each frame. - diff --git a/tools/reax/reaxc_bond.pl b/tools/reax/reaxc_bond.pl deleted file mode 100755 index cc0fd8f238..0000000000 --- a/tools/reax/reaxc_bond.pl +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/perl -use Getopt::Long; -Getopt::Long::Configure ('bundling'); - -################################################################# -# # -# This script is designed to take the bond information from a # -# Lammps/reaxc *.trj file and output a molecular fraction file # -# for each frame. # -# # -# written by Mike Russo, PSU # -# modified by Aidan Thompson, 5/12/2011 # -# # -# The required .trj file is generated by running LAMMPS # -# with pair_style reax/c and the following settings in # -# the corresponding reax/c control file # -# write_freq 25 ! write trajectory after so many steps -# traj_compress 0 ! 0: no compression 1: uses zlib to compress trajectory output -# traj_title TATB ! (no white spaces) -# atom_info 0 ! 0: no atom info, 1: print basic atom info in the trajectory file -# atom_forces 0 ! 0: basic atom format, 1: print force on each atom in the trajectory file -# atom_velocities 0 ! 0: basic atom format, 1: print the velocity of each atom in the trajectory file -# bond_info 1 ! 0: do not print bonds, 1: print bonds in the trajectory file -# angle_info 0 ! 0: do not print angles, 1: print angles in the trajectory file -# # -################################################################# - -################################################################# -# Setting up some default variables, and options for the user # -# to input. # -################################################################# -$in_file = "bonds.trj"; -@test = qw(C H O N); -GetOptions ('f|file=s' => \$in_file, 'a|atoms=s' => \@atoms, 'h|help' => \$help); -if($help) { - print "Options for this program:\n-f --file for input file default= bonds.trj\n-a --atoms atom types (in correct order and input separately) default= @test\n"; - exit; -} -open INPUT, "<$in_file" or die "Cannot open $in_file: $!"; -open OUTPUT, ">frac.dat" or die "Cannot open output file: $!"; - -if(@atoms) { - @test = @atoms; -} - -print "Input for this run:\n Input file = $in_file\n Atom types = @test\n"; -################################################################# - -################################################################# -# Main loop of the script. Goes through each frames bond list. # -################################################################# -$i = 0; -$section = 0; -$at_count = -1; -while() { - if(/chars_to_skip_section/) { - $section++; - &bonds if($section > 2); - next; - } - next if($section <= 0); #skipping the header section - next if(/\s*[A-Za-z]/); #skip text lines - - split; - if ($section == 1) { - $q = $_[0]; - $temp = $_[1]; - $q--; - $at_type[$q] = $temp; - next; - } - - $_[0]--; - $_[1]--; -# Add i-j and j-i entries - push @{$list[$_[0]]}, $_[1]; - push @{$list[$_[1]]}, $_[0]; - $at_count++ if($section == 2); -} -$section++; -&bonds; -close(INPUT); -################################################################# - -################################################################# -# Subroutine bonds: Uses the bond information to generate a # -# count for each species, put them into molecules, and then # -# count the number of each molecule type. # -################################################################# -sub bonds { - $flag = (); - $k = 0; - for(0..$#list) { - if($flag[$_] == 0) { - push @{$full_list[$k]}, $_; - foreach $atom (@{$full_list[$k]}) { - for($o = 0; $o <= $#{$list[$atom]}; $o++) { - unless(grep /^$list[$atom][$o]$/, @{$full_list[$k]}) { - push @{$full_list[$k]}, $list[$atom][$o]; - $flag[$list[$atom][$o]] = 1; - } - } - } - } else { - next; - } - $k++; - } - -### Output section ### - $frame = $section - 2; - open OUTPUT2, ">temp_$frame.dat" or die "Cannot open temp file: $!"; - print OUTPUT2 "Frame # $frame\n"; - for($m = 0; $m < $k; $m++) { #cycle through each molecule - foreach $atom ((@{$full_list[$m]})) { #for each atom in this molecule - ${"$test[$at_type[$atom]]"} += 1; #Create variable named C,H,O, etc and set it to count - } - print OUTPUT2 "Mol $m = "; - foreach $atom (@test) { - print OUTPUT2 "$atom${$atom}" if(${$atom} > 0); - } - print OUTPUT2 "\n"; - for($r = 0; $r <= $#test; $r++) { - ${"$test[$r]"} = 0; - } - } - - close (OUTPUT2); #close the temp file as output - open INPUT3, ") { - next if(/Frame/); - split; - push @mol_list, $_[3] unless(grep /^$_[3]$/, @mol_list); - ${"$_[3]"}++; - } - print OUTPUT "Frame # $frame\n"; - foreach $mol (@mol_list) { - printf OUTPUT "%4d %s\n", ${"$mol"}, $mol; - ${"$mol"} = 0; - } - @mol_list = (); -### - -### Cleanup between frames ### - for(0..$at_count) { - @{$full_list[$_]} = (); - @{$list[$_]} = (); - } -### -} -################################################################# -