From 796bc28f94a23496b6a980a6215433043e486abf Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Fri, 8 Jul 2022 16:54:01 +0900 Subject: [PATCH 01/15] changed rstfile names, style names, and description about FF for SPICA --- doc/src/Commands_bond.rst | 2 +- doc/src/Commands_pair.rst | 6 +- doc/src/Errors_messages.rst | 8 +- doc/src/Packages_details.rst | 21 +++-- doc/src/Packages_list.rst | 8 +- doc/src/{angle_sdk.rst => angle_spica.rst} | 37 ++++---- doc/src/angle_style.rst | 2 +- doc/src/{pair_sdk.rst => pair_spica.rst} | 99 ++++++++++++--------- doc/src/pair_style.rst | 6 +- doc/utils/check-styles.py | 11 +-- doc/utils/sphinx-config/false_positives.txt | 8 ++ 11 files changed, 118 insertions(+), 90 deletions(-) rename doc/src/{angle_sdk.rst => angle_spica.rst} (52%) rename doc/src/{pair_sdk.rst => pair_spica.rst} (58%) diff --git a/doc/src/Commands_bond.rst b/doc/src/Commands_bond.rst index 28c0882c56..013109430b 100644 --- a/doc/src/Commands_bond.rst +++ b/doc/src/Commands_bond.rst @@ -92,7 +92,7 @@ OPT. * :doc:`harmonic (iko) ` * :doc:`mm3 ` * :doc:`quartic (o) ` - * :doc:`sdk (o) ` + * :doc:`spica (o) ` * :doc:`table (o) ` .. _dihedral: diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index 11334ea2d1..4e7b18ce7d 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -179,9 +179,9 @@ OPT. * :doc:`lj/long/tip4p/long (o) ` * :doc:`lj/mdf ` * :doc:`lj/relres (o) ` - * :doc:`lj/sdk (gko) ` - * :doc:`lj/sdk/coul/long (go) ` - * :doc:`lj/sdk/coul/msm (o) ` + * :doc:`lj/spica (gko) ` + * :doc:`lj/spica/coul/long (go) ` + * :doc:`lj/spica/coul/msm (o) ` * :doc:`lj/sf/dipole/sf (go) ` * :doc:`lj/smooth (go) ` * :doc:`lj/smooth/linear (o) ` diff --git a/doc/src/Errors_messages.rst b/doc/src/Errors_messages.rst index 4e216828d3..86afdafe70 100644 --- a/doc/src/Errors_messages.rst +++ b/doc/src/Errors_messages.rst @@ -1291,7 +1291,7 @@ Doc page with :doc:`WARNING messages ` *Cannot use chosen neighbor list style with lj/gromacs/kk* Self-explanatory. -*Cannot use chosen neighbor list style with lj/sdk/kk* +*Cannot use chosen neighbor list style with lj/spica/kk* That style is not supported by Kokkos. *Cannot use chosen neighbor list style with pair eam/kk* @@ -1659,10 +1659,10 @@ Doc page with :doc:`WARNING messages ` *Cannot use newton pair with lj/gromacs/gpu pair style* Self-explanatory. -*Cannot use newton pair with lj/sdk/coul/long/gpu pair style* +*Cannot use newton pair with lj/spica/coul/long/gpu pair style* Self-explanatory. -*Cannot use newton pair with lj/sdk/gpu pair style* +*Cannot use newton pair with lj/spica/gpu pair style* Self-explanatory. *Cannot use newton pair with lj96/cut/gpu pair style* @@ -6782,7 +6782,7 @@ keyword to allow for additional bonds to be formed This is because the computation of constraint forces within a water molecule adds forces to atoms owned by other processors. -*Pair style lj/sdk/coul/long/gpu requires atom attribute q* +*Pair style lj/spica/coul/long/gpu requires atom attribute q* The atom style defined does not have this attribute. *Pair style nb3b/harmonic requires atom IDs* diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index 59922bd939..24a8cc11b9 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -35,7 +35,7 @@ page gives those details. * :ref:`BPM ` * :ref:`BROWNIAN ` * :ref:`CG-DNA ` - * :ref:`CG-SDK ` + * :ref:`CG-SPICA ` * :ref:`CLASS2 ` * :ref:`COLLOID ` * :ref:`COLVARS ` @@ -365,27 +365,26 @@ The CG-DNA package requires that also the `MOLECULE `_ and ---------- -.. _PKG-CG-SDK: +.. _PKG-CG-SPICA: -CG-SDK package +CG-SPICA package ------------------ **Contents:** Several pair styles and an angle style which implement the -coarse-grained SDK model of Shinoda, DeVane, and Klein which enables -simulation of ionic liquids, electrolytes, lipids and charged amino -acids. +coarse-grained SPICA (formerly called SDK) model which enables +simulation of biological or soft material systems. **Author:** Axel Kohlmeyer (Temple U). **Supporting info:** -* src/CG-SDK: filenames -> commands -* src/CG-SDK/README -* :doc:`pair_style lj/sdk/\* ` -* :doc:`angle_style sdk ` -* examples/PACKAGES/cgsdk +* src/CG-SPICA: filenames -> commands +* src/CG-SPICA/README +* :doc:`pair_style lj/spica/\* ` +* :doc:`angle_style spica ` +* examples/PACKAGES/cgspica * https://www.lammps.org/pictures.html#cg ---------- diff --git a/doc/src/Packages_list.rst b/doc/src/Packages_list.rst index 3cd19e6e03..eb511cd139 100644 --- a/doc/src/Packages_list.rst +++ b/doc/src/Packages_list.rst @@ -73,10 +73,10 @@ whether an extra library is needed to build and use the package: - src/CG-DNA/README - PACKAGES/cgdna - no - * - :ref:`CG-SDK ` - - SDK coarse-graining model - - :doc:`pair_style lj/sdk ` - - PACKAGES/cgsdk + * - :ref:`CG-SPICA ` + - SPICA (SDK) coarse-graining model + - :doc:`pair_style lj/spica ` + - PACKAGES/cgspica - no * - :ref:`CLASS2 ` - class 2 force fields diff --git a/doc/src/angle_sdk.rst b/doc/src/angle_spica.rst similarity index 52% rename from doc/src/angle_sdk.rst rename to doc/src/angle_spica.rst index 50f4a5b360..4162ce5608 100644 --- a/doc/src/angle_sdk.rst +++ b/doc/src/angle_spica.rst @@ -1,32 +1,32 @@ -.. index:: angle_style sdk -.. index:: angle_style sdk/omp +.. index:: angle_style spica +.. index:: angle_style spica/omp -angle_style sdk command -======================= +angle_style spica command +========================= -Accelerator Variants: *sdk/omp* +Accelerator Variants: *spica/omp* Syntax """""" .. code-block:: LAMMPS - angle_style sdk + angle_style spica - angle_style sdk/omp + angle_style spica/omp Examples """""""" .. code-block:: LAMMPS - angle_style sdk + angle_style spica angle_coeff 1 300.0 107.0 Description """"""""""" -The *sdk* angle style is a combination of the harmonic angle potential, +The *spica* angle style is a combination of the harmonic angle potential, .. math:: @@ -34,10 +34,10 @@ The *sdk* angle style is a combination of the harmonic angle potential, where :math:`\theta_0` is the equilibrium value of the angle and :math:`K` a prefactor, with the *repulsive* part of the non-bonded -*lj/sdk* pair style between the atoms 1 and 3. This angle potential is -intended for coarse grained MD simulations with the CMM parameterization -using the :doc:`pair_style lj/sdk `. Relative to the -pair_style *lj/sdk*, however, the energy is shifted by +*lj/spica* pair style between the atoms 1 and 3. This angle potential is +intended for coarse grained MD simulations with the SPICA (formerly called SDK) parameterization +using the :doc:`pair_style lj/spica `. Relative to the +pair_style *lj/spica*, however, the energy is shifted by :math:`\epsilon`, to avoid sudden jumps. Note that the usual 1/2 factor is included in :math:`K`. @@ -51,9 +51,12 @@ The following coefficients must be defined for each angle type via the radians internally; hence :math:`K` is effectively energy per radian\^2. -The required *lj/sdk* parameters are extracted automatically from the +The required *lj/spica* parameters are extracted automatically from the pair_style. +Style *sdk*, the original implementation of style *spica*, is available +for backward compatibility. + ---------- .. include:: accel_styles.rst @@ -64,14 +67,14 @@ Restrictions """""""""""" This angle style can only be used if LAMMPS was built with the -CG-SDK package. See the :doc:`Build package ` doc +CG-SPICA package. See the :doc:`Build package ` doc page for more info. Related commands """""""""""""""" -:doc:`angle_coeff `, :doc:`angle_style harmonic `, :doc:`pair_style lj/sdk `, -:doc:`pair_style lj/sdk/coul/long ` +:doc:`angle_coeff `, :doc:`angle_style harmonic `, :doc:`pair_style lj/spica `, +:doc:`pair_style lj/spica/coul/long ` Default """"""" diff --git a/doc/src/angle_style.rst b/doc/src/angle_style.rst index c7001cff18..a0917f1b66 100644 --- a/doc/src/angle_style.rst +++ b/doc/src/angle_style.rst @@ -91,7 +91,7 @@ of (g,i,k,o,t) to indicate which accelerated styles exist. * :doc:`harmonic ` - harmonic angle * :doc:`mm3 ` - anharmonic angle * :doc:`quartic ` - angle with cubic and quartic terms -* :doc:`sdk ` - harmonic angle with repulsive SDK pair style between 1-3 atoms +* :doc:`spica ` - harmonic angle with repulsive SPICA pair style between 1-3 atoms * :doc:`table ` - tabulated by angle ---------- diff --git a/doc/src/pair_sdk.rst b/doc/src/pair_spica.rst similarity index 58% rename from doc/src/pair_sdk.rst rename to doc/src/pair_spica.rst index f389079e15..9bd6ee069c 100644 --- a/doc/src/pair_sdk.rst +++ b/doc/src/pair_spica.rst @@ -1,27 +1,27 @@ -.. index:: pair_style lj/sdk -.. index:: pair_style lj/sdk/gpu -.. index:: pair_style lj/sdk/kk -.. index:: pair_style lj/sdk/omp -.. index:: pair_style lj/sdk/coul/long -.. index:: pair_style lj/sdk/coul/long/gpu -.. index:: pair_style lj/sdk/coul/long/omp -.. index:: pair_style lj/sdk/coul/msm -.. index:: pair_style lj/sdk/coul/msm/omp +.. index:: pair_style lj/spica +.. index:: pair_style lj/spica/gpu +.. index:: pair_style lj/spica/kk +.. index:: pair_style lj/spica/omp +.. index:: pair_style lj/spica/coul/long +.. index:: pair_style lj/spica/coul/long/gpu +.. index:: pair_style lj/spica/coul/long/omp +.. index:: pair_style lj/spica/coul/msm +.. index:: pair_style lj/spica/coul/msm/omp -pair_style lj/sdk command -========================= +pair_style lj/spica command +=========================== -Accelerator Variants: *lj/sdk/gpu*, *lj/sdk/kk*, *lj/sdk/omp* +Accelerator Variants: *lj/spica/gpu*, *lj/spica/kk*, *lj/spica/omp* -pair_style lj/sdk/coul/long command -=================================== +pair_style lj/spica/coul/long command +===================================== -Accelerator Variants: *lj/sdk/coul/long/gpu*, *lj/sdk/coul/long/omp* +Accelerator Variants: *lj/spica/coul/long/gpu*, *lj/spica/coul/long/omp* -pair_style lj/sdk/coul/msm command -================================== +pair_style lj/spica/coul/msm command +==================================== -Accelerator Variants: *lj/sdk/coul/msm/omp* +Accelerator Variants: *lj/spica/coul/msm/omp* Syntax """""" @@ -30,14 +30,14 @@ Syntax pair_style style args -* style = *lj/sdk* or *lj/sdk/coul/long* +* style = *lj/spica* or *lj/spica/coul/long* * args = list of arguments for a particular style .. parsed-literal:: - *lj/sdk* args = cutoff + *lj/spica* args = cutoff cutoff = global cutoff for Lennard Jones interactions (distance units) - *lj/sdk/coul/long* args = cutoff (cutoff2) + *lj/spica/coul/long* args = cutoff (cutoff2) cutoff = global cutoff for LJ (and Coulombic if only 1 arg) (distance units) cutoff2 = global cutoff for Coulombic (optional) (distance units) @@ -46,21 +46,21 @@ Examples .. code-block:: LAMMPS - pair_style lj/sdk 2.5 + pair_style lj/spica 2.5 pair_coeff 1 1 lj12_6 1 1.1 2.8 - pair_style lj/sdk/coul/long 10.0 - pair_style lj/sdk/coul/long 10.0 12.0 + pair_style lj/spica/coul/long 10.0 + pair_style lj/spica/coul/long 10.0 12.0 pair_coeff 1 1 lj9_6 100.0 3.5 12.0 - pair_style lj/sdk/coul/msm 10.0 - pair_style lj/sdk/coul/msm 10.0 12.0 + pair_style lj/spica/coul/msm 10.0 + pair_style lj/spica/coul/msm 10.0 12.0 pair_coeff 1 1 lj9_6 100.0 3.5 12.0 Description """"""""""" -The *lj/sdk* styles compute a 9/6, 12/4, or 12/6 Lennard-Jones potential, +The *lj/spica* styles compute a 9/6, 12/4, 12/5, or 12/6 Lennard-Jones potential, given by .. math:: @@ -71,14 +71,19 @@ given by E = & \frac{3\sqrt{3}}{2} \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^4 \right] \qquad r < r_c \\ + E = & \frac{12}{7}\left(\frac{12}{5}\right)^{\left(\frac{5}{7}\right)} \epsilon + \left[ \left(\frac{\sigma}{r}\right)^{12} - + \left(\frac{\sigma}{r}\right)^5 \right] + \qquad r < r_c \\ E = & 4 \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^6 \right] \qquad r < r_c -as required for the SDK Coarse-grained MD parameterization discussed in -:ref:`(Shinoda) ` and :ref:`(DeVane) `. Rc is the cutoff. +as required for the SPICA (formerly called SDK) and the pSPICA Coarse-grained MD parameterization discussed in +:ref:`(Shinoda) `, :ref:`(DeVane) `, :ref:`(Seo) `, and :ref:`(Miyazaki) `. +Rc is the cutoff. -Style *lj/sdk/coul/long* computes the adds Coulombic interactions +Style *lj/spica/coul/long* computes the adds Coulombic interactions with an additional damping factor applied so it can be used in conjunction with the :doc:`kspace_style ` command and its *ewald* or *pppm* or *pppm/cg* option. The Coulombic cutoff @@ -92,7 +97,7 @@ above, or in the data file or restart files read by the :doc:`read_data ` or :doc:`read_restart ` commands, or by mixing as described below: -* cg_type (lj9_6, lj12_4, or lj12_6) +* cg_type (lj9_6, lj12_4, lj12_5, or lj12_6) * epsilon (energy units) * sigma (distance units) * cutoff1 (distance units) @@ -108,11 +113,15 @@ and Coulombic interactions for this type pair. If both coefficients are specified, they are used as the LJ and Coulombic cutoffs for this type pair. -For *lj/sdk/coul/long* and *lj/sdk/coul/msm* only the LJ cutoff can be +For *lj/spica/coul/long* and *lj/spica/coul/msm* only the LJ cutoff can be specified since a Coulombic cutoff cannot be specified for an individual I,J type pair. All type pairs use the same global Coulombic cutoff specified in the pair_style command. +The original implementation of the above styles are +style *lj/sdk*, *lj/sdk/coul/long*, and *lj/sdk/coul/msm*, +and available for backward compatibility. + ---------- .. include:: accel_styles.rst @@ -123,24 +132,24 @@ Mixing, shift, table, tail correction, restart, rRESPA info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" For atom type pairs I,J and I != J, the epsilon and sigma coefficients -and cutoff distance for all of the lj/sdk pair styles *cannot* be mixed, +and cutoff distance for all of the lj/spica pair styles *cannot* be mixed, since different pairs may have different exponents. So all parameters for all pairs have to be specified explicitly through the "pair_coeff" command. Defining then in a data file is also not supported, due to limitations of that file format. -All of the lj/sdk pair styles support the +All of the lj/spica pair styles support the :doc:`pair_modify ` shift option for the energy of the Lennard-Jones portion of the pair interaction. -The *lj/sdk/coul/long* pair styles support the +The *lj/spica/coul/long* pair styles support the :doc:`pair_modify ` table option since they can tabulate the short-range portion of the long-range Coulombic interaction. -All of the lj/sdk pair styles write their information to :doc:`binary restart files `, so pair_style and pair_coeff commands do +All of the lj/spica pair styles write their information to :doc:`binary restart files `, so pair_style and pair_coeff commands do not need to be specified in an input script that reads a restart file. -The lj/sdk and lj/cut/coul/long pair styles do not support +The lj/spica and lj/cut/coul/long pair styles do not support the use of the *inner*, *middle*, and *outer* keywords of the :doc:`run_style respa ` command. ---------- @@ -148,8 +157,8 @@ the use of the *inner*, *middle*, and *outer* keywords of the :doc:`run_style re Restrictions """""""""""" -All of the lj/sdk pair styles are part of the CG-SDK package. The -*lj/sdk/coul/long* style also requires the KSPACE package to be built +All of the lj/spica pair styles are part of the CG-SPICA package. The +*lj/spica/coul/long* style also requires the KSPACE package to be built (which is enabled by default). They are only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. @@ -157,7 +166,7 @@ doc page for more info. Related commands """""""""""""""" -:doc:`pair_coeff `, :doc:`angle_style sdk ` +:doc:`pair_coeff `, :doc:`angle_style spica ` Default """"""" @@ -168,8 +177,16 @@ none .. _Shinoda3: -**(Shinoda)** Shinoda, DeVane, Klein, Mol Sim, 33, 27 (2007). +**(Shinoda)** Shinoda, DeVane, Klein, Mol Sim, 33, 27-36 (2007). .. _DeVane: **(DeVane)** Shinoda, DeVane, Klein, Soft Matter, 4, 2453-2462 (2008). + +.. _Seo: + +**(Seo)** Seo, Shinoda, J Chem Theory Comput, 15, 762-774 (2019). + +.. _Miyazaki: + +**(Miyazaki)** Miyazaki, Okazaki, Shinoda, J Chem Theory Comput, 16, 782-793 (2020). diff --git a/doc/src/pair_style.rst b/doc/src/pair_style.rst index 7e9414cee9..3b8bc979b4 100644 --- a/doc/src/pair_style.rst +++ b/doc/src/pair_style.rst @@ -258,9 +258,9 @@ accelerated styles exist. * :doc:`lj/long/tip4p/long ` - long-range LJ and long-range Coulomb for TIP4P water * :doc:`lj/mdf ` - LJ potential with a taper function * :doc:`lj/relres ` - LJ using multiscale Relative Resolution (RelRes) methodology :ref:`(Chaimovich) `. -* :doc:`lj/sdk ` - LJ for SDK coarse-graining -* :doc:`lj/sdk/coul/long ` - LJ for SDK coarse-graining with long-range Coulomb -* :doc:`lj/sdk/coul/msm ` - LJ for SDK coarse-graining with long-range Coulomb via MSM +* :doc:`lj/spica ` - LJ for SPICA coarse-graining +* :doc:`lj/spica/coul/long ` - LJ for SPICA coarse-graining with long-range Coulomb +* :doc:`lj/spica/coul/msm ` - LJ for SPICA coarse-graining with long-range Coulomb via MSM * :doc:`lj/sf/dipole/sf ` - LJ with dipole interaction with shifted forces * :doc:`lj/smooth ` - smoothed Lennard-Jones potential * :doc:`lj/smooth/linear ` - linear smoothed LJ potential diff --git a/doc/utils/check-styles.py b/doc/utils/check-styles.py index 9633c1080f..47d3dd5e3b 100755 --- a/doc/utils/check-styles.py +++ b/doc/utils/check-styles.py @@ -254,8 +254,9 @@ for command_type, entries in index.items(): print("Total number of style index entries:", total_index) +skip_angle = ('sdk') skip_fix = ('python', 'NEIGH_HISTORY/omp','acks2/reax','qeq/reax','reax/c/bonds','reax/c/species') -skip_pair = ('meam/c','lj/sf','reax/c') +skip_pair = ('meam/c','lj/sf','reax/c','lj/sdk','lj/sdk/coul/long','lj/sdk/coul/msm') skip_compute = ('pressure/cylinder') counter = 0 @@ -269,8 +270,8 @@ counter += check_style('Commands_pair.rst', doc_dir, ":doc:`(.+) `",pair 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:`(.+) `",angle,'Angle',skip=skip_angle,suffix=True) +counter += check_style('angle_style.rst', doc_dir, ":doc:`(.+) ` -",angle,'Angle',skip=skip_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) @@ -284,12 +285,12 @@ counter = 0 counter += check_style_index("compute", compute, index["compute"], skip=['pressure/cylinder']) counter += check_style_index("fix", fix, index["fix"], skip=['python','acks2/reax','qeq/reax','reax/c/bonds','reax/c/species']) -counter += check_style_index("angle_style", angle, index["angle_style"]) +counter += check_style_index("angle_style", angle, index["angle_style"], skip=['sdk']) 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','reax/c']) +counter += check_style_index("pair_style", pair, index["pair_style"], skip=['meam/c','lj/sf','reax/c','lj/sdk','lj/sdk/coul/long','lj/sdk/coul/msm']) if counter: print(f"Found {counter} issue(s) with style index") diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 77a1da6643..dc51ce2ac5 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -421,6 +421,8 @@ CGDNA cgs cgsdk CGSDK +cgspica +CGSPICA Chaimovich Chalopin Champaign @@ -2076,6 +2078,7 @@ Mishin Mishra mistyped mistyrose +Miyazaki Mj mK mkdir @@ -2471,6 +2474,7 @@ ohenrich ok Okabe Okamoto +Okazaki O'Keefe OKeefe oldlace @@ -2729,6 +2733,7 @@ pscrozi pseudodynamics pseudopotential pSp +pSPICA Pstart Pstop pstyle @@ -3087,6 +3092,7 @@ semiaxes semimetals Semin Sensable +Seo Sep seqdep Serpico @@ -3197,6 +3203,8 @@ Spellmeyer Speybroeck sph SPH +spica +SPICA Spickermann splined spparks From 20182a194f16558cbb487700997ac3ee979773ce Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Fri, 8 Jul 2022 17:01:56 +0900 Subject: [PATCH 02/15] changed a package name CG-SDK to CG-SPICA in files for cmake. --- cmake/CMakeLists.txt | 2 +- cmake/presets/all_off.cmake | 2 +- cmake/presets/all_on.cmake | 2 +- cmake/presets/mingw-cross.cmake | 2 +- cmake/presets/most.cmake | 2 +- cmake/presets/windows.cmake | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index b0b8bfd363..bc594dab7b 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -202,7 +202,7 @@ set(STANDARD_PACKAGES BPM BROWNIAN CG-DNA - CG-SDK + CG-SPICA CLASS2 COLLOID COLVARS diff --git a/cmake/presets/all_off.cmake b/cmake/presets/all_off.cmake index 895f26845f..3b62c9538b 100644 --- a/cmake/presets/all_off.cmake +++ b/cmake/presets/all_off.cmake @@ -11,7 +11,7 @@ set(ALL_PACKAGES BPM BROWNIAN CG-DNA - CG-SDK + CG-SPICA CLASS2 COLLOID COLVARS diff --git a/cmake/presets/all_on.cmake b/cmake/presets/all_on.cmake index 90b0f02c4b..ac4f6e389d 100644 --- a/cmake/presets/all_on.cmake +++ b/cmake/presets/all_on.cmake @@ -13,7 +13,7 @@ set(ALL_PACKAGES BPM BROWNIAN CG-DNA - CG-SDK + CG-SPICA CLASS2 COLLOID COLVARS diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 13cfee9018..fcc2072807 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -7,7 +7,7 @@ set(WIN_PACKAGES BPM BROWNIAN CG-DNA - CG-SDK + CG-SPICA CLASS2 COLLOID COLVARS diff --git a/cmake/presets/most.cmake b/cmake/presets/most.cmake index 5e408f17cf..77ab8d4a9f 100644 --- a/cmake/presets/most.cmake +++ b/cmake/presets/most.cmake @@ -9,7 +9,7 @@ set(ALL_PACKAGES BPM BROWNIAN CG-DNA - CG-SDK + CG-SPICA CLASS2 COLLOID COLVARS diff --git a/cmake/presets/windows.cmake b/cmake/presets/windows.cmake index ce5387cef9..323323b991 100644 --- a/cmake/presets/windows.cmake +++ b/cmake/presets/windows.cmake @@ -5,7 +5,7 @@ set(WIN_PACKAGES BPM BROWNIAN CG-DNA - CG-SDK + CG-SPICA CLASS2 COLLOID COLVARS From c71e1cd4709ba2aab21989c9ec1b96eb8df67030 Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Fri, 8 Jul 2022 17:16:15 +0900 Subject: [PATCH 03/15] changed lammps inputs in examples for SPICA --- examples/PACKAGES/{cgsdk => cgspica}/README | 11 ++++++----- .../{cgsdk => cgspica}/peg-verlet/data.pegc12e8.gz | Bin .../{cgsdk => cgspica}/peg-verlet/in.pegc12e8 | 2 +- .../{cgsdk => cgspica}/peg-verlet/in.pegc12e8-angle | 4 ++-- .../peg-verlet/log.27Nov18.pegc12e8-angle.g++.1 | 0 .../peg-verlet/log.27Nov18.pegc12e8-angle.g++.4 | 0 .../peg-verlet/log.27Nov18.pegc12e8.g++.1 | 0 .../peg-verlet/log.27Nov18.pegc12e8.g++.4 | 0 .../{cgsdk => cgspica}/sds-monolayer/data.sds.gz | Bin .../{cgsdk => cgspica}/sds-monolayer/in.sds-hybrid | 4 ++-- .../{cgsdk => cgspica}/sds-monolayer/in.sds-regular | 4 ++-- .../sds-monolayer/log.27Nov18.sds-hybrid.g++.1 | 0 .../sds-monolayer/log.27Nov18.sds-hybrid.g++.4 | 0 .../sds-monolayer/log.27Nov18.sds-regular.g++.1 | 0 .../sds-monolayer/log.27Nov18.sds-regular.g++.4 | 0 15 files changed, 13 insertions(+), 12 deletions(-) rename examples/PACKAGES/{cgsdk => cgspica}/README (60%) rename examples/PACKAGES/{cgsdk => cgspica}/peg-verlet/data.pegc12e8.gz (100%) rename examples/PACKAGES/{cgsdk => cgspica}/peg-verlet/in.pegc12e8 (93%) rename examples/PACKAGES/{cgsdk => cgspica}/peg-verlet/in.pegc12e8-angle (87%) rename examples/PACKAGES/{cgsdk => cgspica}/peg-verlet/log.27Nov18.pegc12e8-angle.g++.1 (100%) rename examples/PACKAGES/{cgsdk => cgspica}/peg-verlet/log.27Nov18.pegc12e8-angle.g++.4 (100%) rename examples/PACKAGES/{cgsdk => cgspica}/peg-verlet/log.27Nov18.pegc12e8.g++.1 (100%) rename examples/PACKAGES/{cgsdk => cgspica}/peg-verlet/log.27Nov18.pegc12e8.g++.4 (100%) rename examples/PACKAGES/{cgsdk => cgspica}/sds-monolayer/data.sds.gz (100%) rename examples/PACKAGES/{cgsdk => cgspica}/sds-monolayer/in.sds-hybrid (91%) rename examples/PACKAGES/{cgsdk => cgspica}/sds-monolayer/in.sds-regular (91%) rename examples/PACKAGES/{cgsdk => cgspica}/sds-monolayer/log.27Nov18.sds-hybrid.g++.1 (100%) rename examples/PACKAGES/{cgsdk => cgspica}/sds-monolayer/log.27Nov18.sds-hybrid.g++.4 (100%) rename examples/PACKAGES/{cgsdk => cgspica}/sds-monolayer/log.27Nov18.sds-regular.g++.1 (100%) rename examples/PACKAGES/{cgsdk => cgspica}/sds-monolayer/log.27Nov18.sds-regular.g++.4 (100%) diff --git a/examples/PACKAGES/cgsdk/README b/examples/PACKAGES/cgspica/README similarity index 60% rename from examples/PACKAGES/cgsdk/README rename to examples/PACKAGES/cgspica/README index 09b9b0a8ea..448bdda2a7 100644 --- a/examples/PACKAGES/cgsdk/README +++ b/examples/PACKAGES/cgspica/README @@ -1,7 +1,8 @@ -LAMMPS CG-SDK example problems +LAMMPS CG-SPICA example problems -Each of these sub-directories contains a sample problem for the SDK -coarse grained MD potentials that you can run with LAMMPS. +Each of these sub-directories contains a sample problem for +the SPICA (formerly called SDK) coarse grained MD potentials +that you can run with LAMMPS. These are the two sample systems @@ -9,11 +10,11 @@ peg-verlet: coarse grained PEG surfactant/water mixture lamella verlet version this example uses the plain LJ term only, no charges. two variants are provided regular harmonic angles and - the SDK variant that includes 1-3 LJ repulsion. + the SPICA variant that includes 1-3 LJ repulsion. sds-monolayer: coarse grained SDS surfactant monolayers at water/vapor interface. - this example uses the SDK LJ term with coulomb and shows + this example uses the SPICA LJ term with coulomb and shows how to use the combined coulomb style vs. hybrid/overlay with possible optimizations due to the small number of charged particles in this system diff --git a/examples/PACKAGES/cgsdk/peg-verlet/data.pegc12e8.gz b/examples/PACKAGES/cgspica/peg-verlet/data.pegc12e8.gz similarity index 100% rename from examples/PACKAGES/cgsdk/peg-verlet/data.pegc12e8.gz rename to examples/PACKAGES/cgspica/peg-verlet/data.pegc12e8.gz diff --git a/examples/PACKAGES/cgsdk/peg-verlet/in.pegc12e8 b/examples/PACKAGES/cgspica/peg-verlet/in.pegc12e8 similarity index 93% rename from examples/PACKAGES/cgsdk/peg-verlet/in.pegc12e8 rename to examples/PACKAGES/cgspica/peg-verlet/in.pegc12e8 index b8e71b849f..037c1334a7 100644 --- a/examples/PACKAGES/cgsdk/peg-verlet/in.pegc12e8 +++ b/examples/PACKAGES/cgspica/peg-verlet/in.pegc12e8 @@ -9,7 +9,7 @@ atom_style angle processors * * 1 # read topology and force field -pair_style lj/sdk 15.0 +pair_style lj/sdk 15.0 # compatible with "lj/spica" bond_style harmonic angle_style harmonic special_bonds lj/coul 0.0 0.0 1.0 diff --git a/examples/PACKAGES/cgsdk/peg-verlet/in.pegc12e8-angle b/examples/PACKAGES/cgspica/peg-verlet/in.pegc12e8-angle similarity index 87% rename from examples/PACKAGES/cgsdk/peg-verlet/in.pegc12e8-angle rename to examples/PACKAGES/cgspica/peg-verlet/in.pegc12e8-angle index 32773f4950..35b5fcdeb7 100644 --- a/examples/PACKAGES/cgsdk/peg-verlet/in.pegc12e8-angle +++ b/examples/PACKAGES/cgspica/peg-verlet/in.pegc12e8-angle @@ -9,9 +9,9 @@ atom_style angle processors * * 1 # read topology and force field -pair_style lj/sdk 15.0 +pair_style lj/sdk 15.0 # compatible with "lj/spica" bond_style harmonic -angle_style sdk +angle_style sdk # compatible with "spica" special_bonds lj/coul 0.0 0.0 1.0 read_data data.pegc12e8.gz diff --git a/examples/PACKAGES/cgsdk/peg-verlet/log.27Nov18.pegc12e8-angle.g++.1 b/examples/PACKAGES/cgspica/peg-verlet/log.27Nov18.pegc12e8-angle.g++.1 similarity index 100% rename from examples/PACKAGES/cgsdk/peg-verlet/log.27Nov18.pegc12e8-angle.g++.1 rename to examples/PACKAGES/cgspica/peg-verlet/log.27Nov18.pegc12e8-angle.g++.1 diff --git a/examples/PACKAGES/cgsdk/peg-verlet/log.27Nov18.pegc12e8-angle.g++.4 b/examples/PACKAGES/cgspica/peg-verlet/log.27Nov18.pegc12e8-angle.g++.4 similarity index 100% rename from examples/PACKAGES/cgsdk/peg-verlet/log.27Nov18.pegc12e8-angle.g++.4 rename to examples/PACKAGES/cgspica/peg-verlet/log.27Nov18.pegc12e8-angle.g++.4 diff --git a/examples/PACKAGES/cgsdk/peg-verlet/log.27Nov18.pegc12e8.g++.1 b/examples/PACKAGES/cgspica/peg-verlet/log.27Nov18.pegc12e8.g++.1 similarity index 100% rename from examples/PACKAGES/cgsdk/peg-verlet/log.27Nov18.pegc12e8.g++.1 rename to examples/PACKAGES/cgspica/peg-verlet/log.27Nov18.pegc12e8.g++.1 diff --git a/examples/PACKAGES/cgsdk/peg-verlet/log.27Nov18.pegc12e8.g++.4 b/examples/PACKAGES/cgspica/peg-verlet/log.27Nov18.pegc12e8.g++.4 similarity index 100% rename from examples/PACKAGES/cgsdk/peg-verlet/log.27Nov18.pegc12e8.g++.4 rename to examples/PACKAGES/cgspica/peg-verlet/log.27Nov18.pegc12e8.g++.4 diff --git a/examples/PACKAGES/cgsdk/sds-monolayer/data.sds.gz b/examples/PACKAGES/cgspica/sds-monolayer/data.sds.gz similarity index 100% rename from examples/PACKAGES/cgsdk/sds-monolayer/data.sds.gz rename to examples/PACKAGES/cgspica/sds-monolayer/data.sds.gz diff --git a/examples/PACKAGES/cgsdk/sds-monolayer/in.sds-hybrid b/examples/PACKAGES/cgspica/sds-monolayer/in.sds-hybrid similarity index 91% rename from examples/PACKAGES/cgsdk/sds-monolayer/in.sds-hybrid rename to examples/PACKAGES/cgspica/sds-monolayer/in.sds-hybrid index eb3eca9c96..9fc1416635 100644 --- a/examples/PACKAGES/cgsdk/sds-monolayer/in.sds-hybrid +++ b/examples/PACKAGES/cgspica/sds-monolayer/in.sds-hybrid @@ -5,9 +5,9 @@ dimension 3 atom_style full processors * * 1 -pair_style hybrid/overlay lj/sdk 15.0 coul/long 26.5 +pair_style hybrid/overlay lj/sdk 15.0 coul/long 26.5 # "lj/sdk" is compatible with "lj/spica" bond_style harmonic -angle_style sdk +angle_style sdk # compatible with "spica" special_bonds lj/coul 0.0 0.0 1.0 read_data data.sds.gz diff --git a/examples/PACKAGES/cgsdk/sds-monolayer/in.sds-regular b/examples/PACKAGES/cgspica/sds-monolayer/in.sds-regular similarity index 91% rename from examples/PACKAGES/cgsdk/sds-monolayer/in.sds-regular rename to examples/PACKAGES/cgspica/sds-monolayer/in.sds-regular index 217c15697e..e64882aaa0 100644 --- a/examples/PACKAGES/cgsdk/sds-monolayer/in.sds-regular +++ b/examples/PACKAGES/cgspica/sds-monolayer/in.sds-regular @@ -5,9 +5,9 @@ dimension 3 atom_style full processors * * 1 -pair_style lj/sdk/coul/long 15.0 +pair_style lj/sdk/coul/long 15.0 # compatible with "lj/spica/coul/long" bond_style harmonic -angle_style sdk +angle_style sdk # compatible with "spica" special_bonds lj/coul 0.0 0.0 1.0 read_data data.sds.gz diff --git a/examples/PACKAGES/cgsdk/sds-monolayer/log.27Nov18.sds-hybrid.g++.1 b/examples/PACKAGES/cgspica/sds-monolayer/log.27Nov18.sds-hybrid.g++.1 similarity index 100% rename from examples/PACKAGES/cgsdk/sds-monolayer/log.27Nov18.sds-hybrid.g++.1 rename to examples/PACKAGES/cgspica/sds-monolayer/log.27Nov18.sds-hybrid.g++.1 diff --git a/examples/PACKAGES/cgsdk/sds-monolayer/log.27Nov18.sds-hybrid.g++.4 b/examples/PACKAGES/cgspica/sds-monolayer/log.27Nov18.sds-hybrid.g++.4 similarity index 100% rename from examples/PACKAGES/cgsdk/sds-monolayer/log.27Nov18.sds-hybrid.g++.4 rename to examples/PACKAGES/cgspica/sds-monolayer/log.27Nov18.sds-hybrid.g++.4 diff --git a/examples/PACKAGES/cgsdk/sds-monolayer/log.27Nov18.sds-regular.g++.1 b/examples/PACKAGES/cgspica/sds-monolayer/log.27Nov18.sds-regular.g++.1 similarity index 100% rename from examples/PACKAGES/cgsdk/sds-monolayer/log.27Nov18.sds-regular.g++.1 rename to examples/PACKAGES/cgspica/sds-monolayer/log.27Nov18.sds-regular.g++.1 diff --git a/examples/PACKAGES/cgsdk/sds-monolayer/log.27Nov18.sds-regular.g++.4 b/examples/PACKAGES/cgspica/sds-monolayer/log.27Nov18.sds-regular.g++.4 similarity index 100% rename from examples/PACKAGES/cgsdk/sds-monolayer/log.27Nov18.sds-regular.g++.4 rename to examples/PACKAGES/cgspica/sds-monolayer/log.27Nov18.sds-regular.g++.4 From fc741e0df6586f4d7cac8fcb72e92d53a3917093 Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Fri, 8 Jul 2022 17:28:50 +0900 Subject: [PATCH 04/15] changed names of files, and added a lj12-5 function type. --- lib/gpu/{lal_lj_sdk.cpp => lal_lj_spica.cpp} | 36 +++++++++---------- lib/gpu/{lal_lj_sdk.cu => lal_lj_spica.cu} | 14 +++++--- lib/gpu/{lal_lj_sdk.h => lal_lj_spica.h} | 6 ++-- ...al_lj_sdk_ext.cpp => lal_lj_spica_ext.cpp} | 18 +++++----- ..._lj_sdk_long.cpp => lal_lj_spica_long.cpp} | 14 ++++---- ...al_lj_sdk_long.cu => lal_lj_spica_long.cu} | 14 +++++--- ...{lal_lj_sdk_long.h => lal_lj_spica_long.h} | 4 +-- ...long_ext.cpp => lal_lj_spica_long_ext.cpp} | 18 +++++----- 8 files changed, 68 insertions(+), 56 deletions(-) rename lib/gpu/{lal_lj_sdk.cpp => lal_lj_spica.cpp} (81%) rename lib/gpu/{lal_lj_sdk.cu => lal_lj_spica.cu} (93%) rename lib/gpu/{lal_lj_sdk.h => lal_lj_spica.h} (95%) rename lib/gpu/{lal_lj_sdk_ext.cpp => lal_lj_spica_ext.cpp} (89%) rename lib/gpu/{lal_lj_sdk_long.cpp => lal_lj_spica_long.cpp} (94%) rename lib/gpu/{lal_lj_sdk_long.cu => lal_lj_spica_long.cu} (94%) rename lib/gpu/{lal_lj_sdk_long.h => lal_lj_spica_long.h} (96%) rename lib/gpu/{lal_lj_sdk_long_ext.cpp => lal_lj_spica_long_ext.cpp} (90%) diff --git a/lib/gpu/lal_lj_sdk.cpp b/lib/gpu/lal_lj_spica.cpp similarity index 81% rename from lib/gpu/lal_lj_sdk.cpp rename to lib/gpu/lal_lj_spica.cpp index 0da094c953..8ba13853a6 100644 --- a/lib/gpu/lal_lj_sdk.cpp +++ b/lib/gpu/lal_lj_spica.cpp @@ -1,9 +1,9 @@ /*************************************************************************** - lj_sdk.cpp + lj_spica.cpp ------------------- W. Michael Brown (ORNL) - Class for acceleration of the lj/sdk/cut pair style + Class for acceleration of the lj/spica/cut pair style __________________________________________________________________________ This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) @@ -14,14 +14,14 @@ ***************************************************************************/ #if defined(USE_OPENCL) -#include "lj_sdk_cl.h" +#include "lj_spica_cl.h" #elif defined(USE_CUDART) -const char *lj_sdk=0; +const char *lj_spica=0; #else -#include "lj_sdk_cubin.h" +#include "lj_spica_cubin.h" #endif -#include "lal_lj_sdk.h" +#include "lal_lj_spica.h" #include namespace LAMMPS_AL { #define CGCMMT CGCMM @@ -53,33 +53,33 @@ int CGCMMT::init(const int ntypes, double **host_cutsq, const double gpu_split, FILE *_screen) { int success; success=this->init_atomic(nlocal,nall,max_nbors,maxspecial,cell_size,gpu_split, - _screen,lj_sdk,"k_lj_sdk"); + _screen,lj_spica,"k_lj_spica"); if (success!=0) return success; // If atom type constants fit in shared memory use fast kernel - int sdk_types=ntypes; + int spica_types=ntypes; shared_types=false; int max_shared_types=this->device->max_shared_types(); - if (sdk_types<=max_shared_types && this->_block_size>=max_shared_types) { - sdk_types=max_shared_types; + if (spica_types<=max_shared_types && this->_block_size>=max_shared_types) { + spica_types=max_shared_types; shared_types=true; } - _sdk_types=sdk_types; + _spica_types=spica_types; // Allocate a host write buffer for data initialization - UCL_H_Vec host_write(sdk_types*sdk_types*32,*(this->ucl_device), + UCL_H_Vec host_write(spica_types*spica_types*32,*(this->ucl_device), UCL_WRITE_ONLY); - for (int i=0; iucl_device),UCL_READ_ONLY); - this->atom->type_pack4(ntypes,sdk_types,lj1,host_write,host_cutsq, + lj1.alloc(spica_types*spica_types,*(this->ucl_device),UCL_READ_ONLY); + this->atom->type_pack4(ntypes,spica_types,lj1,host_write,host_cutsq, host_cg_type,host_lj1,host_lj2); - lj3.alloc(sdk_types*sdk_types,*(this->ucl_device),UCL_READ_ONLY); - this->atom->type_pack4(ntypes,sdk_types,lj3,host_write,host_lj3,host_lj4, + lj3.alloc(spica_types*spica_types,*(this->ucl_device),UCL_READ_ONLY); + this->atom->type_pack4(ntypes,spica_types,lj3,host_write,host_lj3,host_lj4, host_offset); UCL_H_Vec dview; @@ -132,7 +132,7 @@ int CGCMMT::loop(const int eflag, const int vflag) { } else { this->k_pair.set_size(GX,BX); this->k_pair.run(&this->atom->x, &lj1, &lj3, - &_sdk_types, &sp_lj, &this->nbor->dev_nbor, + &_spica_types, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom); diff --git a/lib/gpu/lal_lj_sdk.cu b/lib/gpu/lal_lj_spica.cu similarity index 93% rename from lib/gpu/lal_lj_sdk.cu rename to lib/gpu/lal_lj_spica.cu index 1bd9a93d5e..bae8bd57fa 100644 --- a/lib/gpu/lal_lj_sdk.cu +++ b/lib/gpu/lal_lj_spica.cu @@ -1,9 +1,9 @@ // ************************************************************************** -// lj_sdk.cu +// lj_spica.cu // ------------------- // W. Michael Brown (ORNL) // -// Device code for acceleration of the lj/sdk pair style +// Device code for acceleration of the lj/spica pair style // // __________________________________________________________________________ // This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) @@ -24,7 +24,7 @@ _texture_2d( pos_tex,int4); #define pos_tex x_ #endif -__kernel void k_lj_sdk(const __global numtyp4 *restrict x_, +__kernel void k_lj_spica(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict lj1, const __global numtyp4 *restrict lj3, const int lj_types, @@ -91,6 +91,9 @@ __kernel void k_lj_sdk(const __global numtyp4 *restrict x_, } else if (lj1[mtype].y == 1) { inv2=r2inv*ucl_sqrt(r2inv); inv1=inv2*inv2; + } else if (lj1[mtype].y == 4) { + inv1=r2inv*r2inv*ucl_sqrt(r2inv); + inv2=inv1*r2inv; } else { inv1=r2inv*r2inv*r2inv; inv2=inv1; @@ -119,7 +122,7 @@ __kernel void k_lj_sdk(const __global numtyp4 *restrict x_, ans,engv); } -__kernel void k_lj_sdk_fast(const __global numtyp4 *restrict x_, +__kernel void k_lj_spica_fast(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict lj1_in, const __global numtyp4 *restrict lj3_in, const __global numtyp *restrict sp_lj_in, @@ -192,6 +195,9 @@ __kernel void k_lj_sdk_fast(const __global numtyp4 *restrict x_, } else if (lj1[mtype].y == (numtyp)1) { inv2=r2inv*ucl_sqrt(r2inv); inv1=inv2*inv2; + } else if (lj1[mtype].y == (numtyp)4) { + inv1=r2inv*r2inv*ucl_sqrt(r2inv); + inv2=inv1*r2inv; } else { inv1=r2inv*r2inv*r2inv; inv2=inv1; diff --git a/lib/gpu/lal_lj_sdk.h b/lib/gpu/lal_lj_spica.h similarity index 95% rename from lib/gpu/lal_lj_sdk.h rename to lib/gpu/lal_lj_spica.h index 043bafdda8..ed6e5ab096 100644 --- a/lib/gpu/lal_lj_sdk.h +++ b/lib/gpu/lal_lj_spica.h @@ -1,9 +1,9 @@ /*************************************************************************** - lj_sdk.h + lj_spica.h ------------------- W. Michael Brown (ORNL) - Class for acceleration of the lj/sdk pair style + Class for acceleration of the lj/spica pair style __________________________________________________________________________ This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) @@ -67,7 +67,7 @@ class CGCMM : public BaseAtomic { bool shared_types; /// Number of atom types - int _sdk_types; + int _spica_types; private: bool _allocated; diff --git a/lib/gpu/lal_lj_sdk_ext.cpp b/lib/gpu/lal_lj_spica_ext.cpp similarity index 89% rename from lib/gpu/lal_lj_sdk_ext.cpp rename to lib/gpu/lal_lj_spica_ext.cpp index 4497233861..1467c1806a 100644 --- a/lib/gpu/lal_lj_sdk_ext.cpp +++ b/lib/gpu/lal_lj_spica_ext.cpp @@ -1,9 +1,9 @@ /*************************************************************************** - lj_sdk.h + lj_spica.h ------------------- W. Michael Brown (ORNL) - Functions for LAMMPS access to lj/sdk pair acceleration routines + Functions for LAMMPS access to lj/spica pair acceleration routines __________________________________________________________________________ This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) @@ -17,7 +17,7 @@ #include #include -#include "lal_lj_sdk.h" +#include "lal_lj_spica.h" using namespace std; using namespace LAMMPS_AL; @@ -27,7 +27,7 @@ static CGCMM CMMMF; // --------------------------------------------------------------------------- // Allocate memory on host and device and copy constants to device // --------------------------------------------------------------------------- -int sdk_gpu_init(const int ntypes, double **cutsq, int **cg_types, +int spica_gpu_init(const int ntypes, double **cutsq, int **cg_types, double **host_lj1, double **host_lj2, double **host_lj3, double **host_lj4, double **offset, double *special_lj, const int inum, const int nall, const int max_nbors, @@ -42,7 +42,7 @@ int sdk_gpu_init(const int ntypes, double **cutsq, int **cg_types, int gpu_rank=CMMMF.device->gpu_rank(); int procs_per_gpu=CMMMF.device->procs_per_gpu(); - CMMMF.device->init_message(screen,"lj/sdk",first_gpu,last_gpu); + CMMMF.device->init_message(screen,"lj/spica",first_gpu,last_gpu); bool message=false; if (CMMMF.device->replica_me()==0 && screen) @@ -89,11 +89,11 @@ int sdk_gpu_init(const int ntypes, double **cutsq, int **cg_types, return init_ok; } -void sdk_gpu_clear() { +void spica_gpu_clear() { CMMMF.clear(); } -int** sdk_gpu_compute_n(const int ago, const int inum_full, +int** spica_gpu_compute_n(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, double *sublo, double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, @@ -105,7 +105,7 @@ int** sdk_gpu_compute_n(const int ago, const int inum_full, vatom, host_start, ilist, jnum, cpu_time, success); } -void sdk_gpu_compute(const int ago, const int inum_full, const int nall, +void spica_gpu_compute(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, @@ -114,7 +114,7 @@ void sdk_gpu_compute(const int ago, const int inum_full, const int nall, firstneigh,eflag,vflag,eatom,vatom,host_start,cpu_time,success); } -double sdk_gpu_bytes() { +double spica_gpu_bytes() { return CMMMF.host_memory_usage(); } diff --git a/lib/gpu/lal_lj_sdk_long.cpp b/lib/gpu/lal_lj_spica_long.cpp similarity index 94% rename from lib/gpu/lal_lj_sdk_long.cpp rename to lib/gpu/lal_lj_spica_long.cpp index d78e8d84da..3a2c6c693a 100644 --- a/lib/gpu/lal_lj_sdk_long.cpp +++ b/lib/gpu/lal_lj_spica_long.cpp @@ -1,9 +1,9 @@ /*************************************************************************** - lj_sdk_long.cpp + lj_spica_long.cpp ------------------- W. Michael Brown (ORNL) - Class for acceleration of the lj/sdk/coul/long pair style + Class for acceleration of the lj/spica/coul/long pair style __________________________________________________________________________ This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) @@ -14,14 +14,14 @@ ***************************************************************************/ #if defined(USE_OPENCL) -#include "lj_sdk_long_cl.h" +#include "lj_spica_long_cl.h" #elif defined(USE_CUDART) -const char *lj_sdk_long=0; +const char *lj_spica_long=0; #else -#include "lj_sdk_long_cubin.h" +#include "lj_spica_long_cubin.h" #endif -#include "lal_lj_sdk_long.h" +#include "lal_lj_spica_long.h" #include namespace LAMMPS_AL { #define CGCMMLongT CGCMMLong @@ -58,7 +58,7 @@ int CGCMMLongT::init(const int ntypes, double **host_cutsq, const double g_ewald) { int success; success=this->init_atomic(nlocal,nall,max_nbors,maxspecial,cell_size,gpu_split, - _screen,lj_sdk_long,"k_lj_sdk_long"); + _screen,lj_spica_long,"k_lj_spica_long"); if (success!=0) return success; diff --git a/lib/gpu/lal_lj_sdk_long.cu b/lib/gpu/lal_lj_spica_long.cu similarity index 94% rename from lib/gpu/lal_lj_sdk_long.cu rename to lib/gpu/lal_lj_spica_long.cu index 3972ed2076..12da967f2e 100644 --- a/lib/gpu/lal_lj_sdk_long.cu +++ b/lib/gpu/lal_lj_spica_long.cu @@ -1,9 +1,9 @@ // ************************************************************************** -// lj_sdk_long.cu +// lj_spica_long.cu // ------------------- // W. Michael Brown (ORNL) // -// Device code for acceleration of the lj/sdk/coul/long pair style +// Device code for acceleration of the lj/spica/coul/long pair style // // __________________________________________________________________________ // This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) @@ -29,7 +29,7 @@ _texture( q_tex,int2); #define q_tex q_ #endif -__kernel void k_lj_sdk_long(const __global numtyp4 *restrict x_, +__kernel void k_lj_spica_long(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict lj1, const __global numtyp4 *restrict lj3, const int lj_types, @@ -107,6 +107,9 @@ __kernel void k_lj_sdk_long(const __global numtyp4 *restrict x_, } else if (lj3[mtype].x == (numtyp)1) { inv2=r2inv*ucl_rsqrt(rsq); inv1=inv2*inv2; + } else if (lj3[mtype].x == (numtyp)4) { + inv1=r2inv*r2inv*ucl_rsqrt(rsq); + inv2=inv1*r2inv; } else { inv1=r2inv*r2inv*r2inv; inv2=inv1; @@ -157,7 +160,7 @@ __kernel void k_lj_sdk_long(const __global numtyp4 *restrict x_, vflag,ans,engv); } -__kernel void k_lj_sdk_long_fast(const __global numtyp4 *restrict x_, +__kernel void k_lj_spica_long_fast(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict lj1_in, const __global numtyp4 *restrict lj3_in, const __global numtyp *restrict sp_lj_in, @@ -236,6 +239,9 @@ __kernel void k_lj_sdk_long_fast(const __global numtyp4 *restrict x_, } else if (lj3[mtype].x == (numtyp)1) { inv2=r2inv*ucl_rsqrt(rsq); inv1=inv2*inv2; + } else if (lj3[mtype].x == (numtyp)4) { + inv1=r2inv*r2inv*ucl_rsqrt(rsq); + inv2=inv1*r2inv; } else { inv1=r2inv*r2inv*r2inv; inv2=inv1; diff --git a/lib/gpu/lal_lj_sdk_long.h b/lib/gpu/lal_lj_spica_long.h similarity index 96% rename from lib/gpu/lal_lj_sdk_long.h rename to lib/gpu/lal_lj_spica_long.h index 102b007b59..2b598168c1 100644 --- a/lib/gpu/lal_lj_sdk_long.h +++ b/lib/gpu/lal_lj_spica_long.h @@ -1,9 +1,9 @@ /*************************************************************************** - lj_sdk_long.h + lj_spica_long.h ------------------- W. Michael Brown (ORNL) - Class for acceleration of the lj/sdk/coul/long pair style + Class for acceleration of the lj/spica/coul/long pair style __________________________________________________________________________ This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) diff --git a/lib/gpu/lal_lj_sdk_long_ext.cpp b/lib/gpu/lal_lj_spica_long_ext.cpp similarity index 90% rename from lib/gpu/lal_lj_sdk_long_ext.cpp rename to lib/gpu/lal_lj_spica_long_ext.cpp index 3170ac8b52..293801391f 100644 --- a/lib/gpu/lal_lj_sdk_long_ext.cpp +++ b/lib/gpu/lal_lj_spica_long_ext.cpp @@ -1,9 +1,9 @@ /*************************************************************************** - lj_sdk_long.h + lj_spica_long.h ------------------- W. Michael Brown (ORNL) - Functions for LAMMPS access to lj/sdk/coul/long acceleration functions + Functions for LAMMPS access to lj/spica/coul/long acceleration functions __________________________________________________________________________ This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) @@ -17,7 +17,7 @@ #include #include -#include "lal_lj_sdk_long.h" +#include "lal_lj_spica_long.h" using namespace std; using namespace LAMMPS_AL; @@ -27,7 +27,7 @@ static CGCMMLong CMMLMF; // --------------------------------------------------------------------------- // Allocate memory on host and device and copy constants to device // --------------------------------------------------------------------------- -int sdkl_gpu_init(const int ntypes, double **cutsq, int **cg_type, +int spical_gpu_init(const int ntypes, double **cutsq, int **cg_type, double **host_lj1, double **host_lj2, double **host_lj3, double **host_lj4, double **offset, double *special_lj, const int inum, const int nall, const int max_nbors, @@ -44,7 +44,7 @@ int sdkl_gpu_init(const int ntypes, double **cutsq, int **cg_type, int gpu_rank=CMMLMF.device->gpu_rank(); int procs_per_gpu=CMMLMF.device->procs_per_gpu(); - CMMLMF.device->init_message(screen,"lj/sdk/coul/long",first_gpu,last_gpu); + CMMLMF.device->init_message(screen,"lj/spica/coul/long",first_gpu,last_gpu); bool message=false; if (CMMLMF.device->replica_me()==0 && screen) @@ -93,11 +93,11 @@ int sdkl_gpu_init(const int ntypes, double **cutsq, int **cg_type, return init_ok; } -void sdkl_gpu_clear() { +void spical_gpu_clear() { CMMLMF.clear(); } -int** sdkl_gpu_compute_n(const int ago, const int inum_full, +int** spical_gpu_compute_n(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, double *sublo, double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, @@ -111,7 +111,7 @@ int** sdkl_gpu_compute_n(const int ago, const int inum_full, host_q,boxlo,prd); } -void sdkl_gpu_compute(const int ago, const int inum_full, const int nall, +void spical_gpu_compute(const int ago, const int inum_full, const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, @@ -122,7 +122,7 @@ void sdkl_gpu_compute(const int ago, const int inum_full, const int nall, host_q,nlocal,boxlo,prd); } -double sdkl_gpu_bytes() { +double spical_gpu_bytes() { return CMMLMF.host_memory_usage(); } From 763aa632d995fc0e94fdd0a72f1cfa0e95d42b41 Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Fri, 8 Jul 2022 17:36:34 +0900 Subject: [PATCH 05/15] changed 'sdk' to 'spica' --- src/Depend.sh | 4 ++-- src/Makefile | 4 ++-- src/pair.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Depend.sh b/src/Depend.sh index 98f3e5de4f..5ac56f60a7 100755 --- a/src/Depend.sh +++ b/src/Depend.sh @@ -106,7 +106,7 @@ if (test $1 = "INTERLAYER") then fi if (test $1 = "KSPACE") then - depend CG-SDK + depend CG-SPICA depend CORESHELL depend DIELECTRIC depend GPU @@ -167,7 +167,7 @@ if (test $1 = "ML-SNAP") then depend ML-IAP fi -if (test $1 = "CG-SDK") then +if (test $1 = "CG-SPICA") then depend GPU depend KOKKOS depend OPENMP diff --git a/src/Makefile b/src/Makefile index 649a1ad002..60f2ab65c3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -57,7 +57,7 @@ PACKAGE = \ bpm \ brownian \ cg-dna \ - cg-sdk \ + cg-spica \ class2 \ colloid \ colvars \ @@ -152,7 +152,7 @@ PACKMOST = \ bpm \ brownian \ cg-dna \ - cg-sdk \ + cg-spica \ class2 \ colloid \ coreshell \ diff --git a/src/pair.h b/src/pair.h index 5bad9e14a3..4b8c6efd88 100644 --- a/src/pair.h +++ b/src/pair.h @@ -19,8 +19,8 @@ namespace LAMMPS_NS { class Pair : protected Pointers { - friend class AngleSDK; - friend class AngleSDKOMP; + friend class AngleSPICA; + friend class AngleSPICAOMP; friend class BondQuartic; friend class BondQuarticOMP; friend class DihedralCharmm; From 311596fb4f3a986c2b5600da640651271b9e32eb Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Fri, 8 Jul 2022 17:55:15 +0900 Subject: [PATCH 06/15] changed CG-SDK to CG-SPICA and added a lj12-5 function type. --- src/CG-SDK/README | 39 ----------- src/{CG-SDK => CG-SPICA}/Install.sh | 18 ++--- src/CG-SPICA/README | 58 ++++++++++++++++ .../angle_spica.cpp} | 53 +++++++++------ .../angle_sdk.h => CG-SPICA/angle_spica.h} | 15 ++-- .../lj_spica_common.h} | 21 +++--- .../pair_lj_spica.cpp} | 62 ++++++++++------- .../pair_lj_spica.h} | 15 ++-- .../pair_lj_spica_coul_long.cpp} | 68 +++++++++++-------- .../pair_lj_spica_coul_long.h} | 15 ++-- .../pair_lj_spica_coul_msm.cpp} | 33 ++++++--- .../pair_lj_spica_coul_msm.h} | 13 ++-- 12 files changed, 244 insertions(+), 166 deletions(-) delete mode 100644 src/CG-SDK/README rename src/{CG-SDK => CG-SPICA}/Install.sh (66%) create mode 100644 src/CG-SPICA/README rename src/{CG-SDK/angle_sdk.cpp => CG-SPICA/angle_spica.cpp} (90%) rename src/{CG-SDK/angle_sdk.h => CG-SPICA/angle_spica.h} (85%) rename src/{CG-SDK/lj_sdk_common.h => CG-SPICA/lj_spica_common.h} (77%) rename src/{CG-SDK/pair_lj_sdk.cpp => CG-SPICA/pair_lj_spica.cpp} (90%) rename src/{CG-SDK/pair_lj_sdk.h => CG-SPICA/pair_lj_spica.h} (88%) rename src/{CG-SDK/pair_lj_sdk_coul_long.cpp => CG-SPICA/pair_lj_spica_coul_long.cpp} (90%) rename src/{CG-SDK/pair_lj_sdk_coul_long.h => CG-SPICA/pair_lj_spica_coul_long.h} (85%) rename src/{CG-SDK/pair_lj_sdk_coul_msm.cpp => CG-SPICA/pair_lj_spica_coul_msm.cpp} (90%) rename src/{CG-SDK/pair_lj_sdk_coul_msm.h => CG-SPICA/pair_lj_spica_coul_msm.h} (80%) diff --git a/src/CG-SDK/README b/src/CG-SDK/README deleted file mode 100644 index c6bd90531e..0000000000 --- a/src/CG-SDK/README +++ /dev/null @@ -1,39 +0,0 @@ -This package implements 4 commands which can be used in a LAMMPS input -script: - -pair_style lj/sdk -pair_style lj/sdk/coul/long -pair_style lj/sdk/coul/msm -angle_style sdk - -These styles allow coarse grained MD simulations with the -parametrization of Shinoda, DeVane, Klein, Mol Sim, 33, 27 (2007) -(SDK), with extensions to simulate ionic liquids, electrolytes, -lipids and charged amino acids. - -See the doc pages for these commands for details. - -There are example scripts for using this package in -examples/PACKAGES/cgsdk - -This is the second generation implementation reducing the the clutter -of the previous version. For many systems with long range -electrostatics, it will be faster to use pair_style hybrid/overlay -with lj/sdk and coul/long instead of the combined lj/sdk/coul/long -style, since the number of charged atom types is usually small. -To exploit this property, the use of the kspace_style pppm/cg is -recommended over regular pppm. - -The person who created this package is Axel Kohlmeyer at Temple U -(akohlmey at gmail.com). Contact him directly if you have questions. - ---------------------------------- - -Thanks for contributions, support and testing goes to - -Wataru Shinoda (Nagoya University) -Russell DeVane (Procter & Gamble) -Michael L. Klein (Temple University, Philadelphia) -Balasubramanian Sundaram (JNCASR, Bangalore) - -version: 1.0 / 2017-04-26 diff --git a/src/CG-SDK/Install.sh b/src/CG-SPICA/Install.sh similarity index 66% rename from src/CG-SDK/Install.sh rename to src/CG-SPICA/Install.sh index 8e2432343d..f8477c6e0c 100755 --- a/src/CG-SDK/Install.sh +++ b/src/CG-SPICA/Install.sh @@ -28,12 +28,12 @@ action () { # list of files with optional dependcies -action angle_sdk.cpp -action angle_sdk.h -action lj_sdk_common.h -action pair_lj_sdk.cpp -action pair_lj_sdk.h -action pair_lj_sdk_coul_long.cpp pppm.cpp -action pair_lj_sdk_coul_long.h pppm.cpp -action pair_lj_sdk_coul_msm.cpp msm.cpp -action pair_lj_sdk_coul_msm.h msm.cpp +action angle_spica.cpp +action angle_spica.h +action lj_spica_common.h +action pair_lj_spica.cpp +action pair_lj_spica.h +action pair_lj_spica_coul_long.cpp pppm.cpp +action pair_lj_spica_coul_long.h pppm.cpp +action pair_lj_spica_coul_msm.cpp msm.cpp +action pair_lj_spica_coul_msm.h msm.cpp diff --git a/src/CG-SPICA/README b/src/CG-SPICA/README new file mode 100644 index 0000000000..621ee18a39 --- /dev/null +++ b/src/CG-SPICA/README @@ -0,0 +1,58 @@ +This package implements 4 commands which can be used in a LAMMPS input +script: + +pair_style lj/spica +pair_style lj/spica/coul/long +pair_style lj/spica/coul/msm +angle_style spica + +These styles allow coarse grained MD simulations with the +parametrization of the SPICA (formerly called SDK) and the pSPICA +force fields, to simulate biological or soft material systems. +For details about the force fields using this implementation, +see the following papers: + SDK - Shinoda, DeVane, Klein, Mol Sim, 33, 27 (2007). + SPICA - Seo, Shinoda, J Chem Theory Comput, 15, 762 (2019). + pSPICA - Miyazaki, Okazaki, Shinoda, J Chem Theory Comput, 16, 782 (2020). +Summary information on these force fields can be found at this web site: +https://www.spica-ff.org + +See the doc pages for these commands for details. + +There are example scripts for using this package in +examples/PACKAGES/cgspica + +This is the third generation implementation (version 2.0) changing style +names and adding a new function type. The following pair and angle styles +are available for backward compatibility: + pair_style lj/sdk + pair_style lj/sdk/coul/long + pair_style lj/sdk/coul/msm + angle_style sdk + +The second generation implementation (version 1.0) is to reduce the clutter +of the previous version. For many systems with long range +electrostatics, it will be faster to use pair_style hybrid/overlay +with lj/spica and coul/long instead of the combined lj/spica/coul/long +style, since the number of charged atom types is usually small. +To exploit this property, the use of the kspace_style pppm/cg is +recommended over regular pppm. + +The person who created this package is Axel Kohlmeyer at Temple U +(akohlmey at gmail.com). Contact him directly if you have questions. + +The person who added a new function type (LJ12_5) to this package is +Yusuke Miyazaki at Okayama U (ymiyazaki93 at gmail.com). Contact him +if you have questions about his code. + +--------------------------------- + +Thanks for contributions, support and testing goes to + +Wataru Shinoda (Okayama University) +Russell DeVane (Procter & Gamble) +Michael L. Klein (Temple University, Philadelphia) +Balasubramanian Sundaram (JNCASR, Bangalore) + +version: 1.0 / 2017-04-26 +version: 2.0 / 2022-07-08 diff --git a/src/CG-SDK/angle_sdk.cpp b/src/CG-SPICA/angle_spica.cpp similarity index 90% rename from src/CG-SDK/angle_sdk.cpp rename to src/CG-SPICA/angle_spica.cpp index 5e649d7846..d25779d60c 100644 --- a/src/CG-SDK/angle_sdk.cpp +++ b/src/CG-SPICA/angle_spica.cpp @@ -16,10 +16,10 @@ Contributing author: Axel Kohlmeyer (Temple U) Variant of the harmonic angle potential for use with the - lj/sdk potential for coarse grained MD simulations. + lj/spica potential for coarse grained MD simulations. ------------------------------------------------------------------------- */ -#include "angle_sdk.h" +#include "angle_spica.h" #include #include "atom.h" @@ -33,21 +33,21 @@ #include "error.h" -#include "lj_sdk_common.h" +#include "lj_spica_common.h" using namespace LAMMPS_NS; using namespace MathConst; -using namespace LJSDKParms; +using namespace LJSPICAParms; #define SMALL 0.001 /* ---------------------------------------------------------------------- */ -AngleSDK::AngleSDK(LAMMPS *lmp) : Angle(lmp) { repflag = 0;} +AngleSPICA::AngleSPICA(LAMMPS *lmp) : Angle(lmp) { repflag = 0;} /* ---------------------------------------------------------------------- */ -AngleSDK::~AngleSDK() +AngleSPICA::~AngleSPICA() { if (allocated) { memory->destroy(setflag); @@ -61,7 +61,7 @@ AngleSDK::~AngleSDK() /* ---------------------------------------------------------------------- */ -void AngleSDK::compute(int eflag, int vflag) +void AngleSPICA::compute(int eflag, int vflag) { int i1,i2,i3,n,type; double delx1,dely1,delz1,delx2,dely2,delz2,delx3,dely3,delz3; @@ -158,6 +158,13 @@ void AngleSDK::compute(int eflag, int vflag) f13 = r6inv*(lj1[type1][type3]*r6inv - lj2[type1][type3]); if (eflag) e13 = r6inv*(lj3[type1][type3]*r6inv - lj4[type1][type3]); + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv*r2inv*sqrt(r2inv); + const double r7inv = r5inv*r2inv; + + f13 = r5inv*(lj1[type1][type3]*r7inv - lj2[type1][type3]); + if (eflag) e13 = r5inv*(lj3[type1][type3]*r7inv - lj4[type1][type3]); } // make sure energy is 0.0 at the cutoff. @@ -217,7 +224,7 @@ void AngleSDK::compute(int eflag, int vflag) /* ---------------------------------------------------------------------- */ -void AngleSDK::allocate() +void AngleSPICA::allocate() { allocated = 1; int n = atom->nangletypes; @@ -234,7 +241,7 @@ void AngleSDK::allocate() set coeffs for one or more types ------------------------------------------------------------------------- */ -void AngleSDK::coeff(int narg, char **arg) +void AngleSPICA::coeff(int narg, char **arg) { if ((narg < 3) || (narg > 6)) error->all(FLERR,"Incorrect args for angle coefficients"); @@ -278,21 +285,21 @@ void AngleSDK::coeff(int narg, char **arg) error check and initialize all values needed for force computation ------------------------------------------------------------------------- */ -void AngleSDK::init_style() +void AngleSPICA::init_style() { - // make sure we use an SDK pair_style and that we need the 1-3 repulsion + // make sure we use an SPICA pair_style and that we need the 1-3 repulsion repflag = 0; for (int i = 1; i <= atom->nangletypes; i++) if (repscale[i] > 0.0) repflag = 1; - // set up pointers to access SDK LJ parameters for 1-3 interactions + // set up pointers to access SPICA LJ parameters for 1-3 interactions if (repflag) { int itmp; if (force->pair == nullptr) - error->all(FLERR,"Angle style SDK requires use of a compatible with Pair style"); + error->all(FLERR,"Angle style SPICA requires use of a compatible with Pair style"); lj1 = (double **) force->pair->extract("lj1",itmp); lj2 = (double **) force->pair->extract("lj2",itmp); @@ -303,13 +310,13 @@ void AngleSDK::init_style() emin = (double **) force->pair->extract("emin",itmp); if (!lj1 || !lj2 || !lj3 || !lj4 || !lj_type || !rminsq || !emin) - error->all(FLERR,"Angle style SDK is incompatible with Pair style"); + error->all(FLERR,"Angle style SPICA is incompatible with Pair style"); } } /* ---------------------------------------------------------------------- */ -double AngleSDK::equilibrium_angle(int i) +double AngleSPICA::equilibrium_angle(int i) { return theta0[i]; } @@ -318,7 +325,7 @@ double AngleSDK::equilibrium_angle(int i) proc 0 writes out coeffs to restart file ------------------------------------------------------------------------- */ -void AngleSDK::write_restart(FILE *fp) +void AngleSPICA::write_restart(FILE *fp) { fwrite(&k[1],sizeof(double),atom->nangletypes,fp); fwrite(&theta0[1],sizeof(double),atom->nangletypes,fp); @@ -329,7 +336,7 @@ void AngleSDK::write_restart(FILE *fp) proc 0 reads coeffs from restart file, bcasts them ------------------------------------------------------------------------- */ -void AngleSDK::read_restart(FILE *fp) +void AngleSPICA::read_restart(FILE *fp) { allocate(); @@ -349,7 +356,7 @@ void AngleSDK::read_restart(FILE *fp) proc 0 writes to data file ------------------------------------------------------------------------- */ -void AngleSDK::write_data(FILE *fp) +void AngleSPICA::write_data(FILE *fp) { for (int i = 1; i <= atom->nangletypes; i++) fprintf(fp,"%d %g %g\n",i,k[i],theta0[i]/MY_PI*180.0); @@ -357,7 +364,7 @@ void AngleSDK::write_data(FILE *fp) /* ---------------------------------------------------------------------- */ -void AngleSDK::ev_tally13(int i, int j, int nlocal, int newton_bond, +void AngleSPICA::ev_tally13(int i, int j, int nlocal, int newton_bond, double evdwl, double fpair, double delx, double dely, double delz) { @@ -439,7 +446,7 @@ void AngleSDK::ev_tally13(int i, int j, int nlocal, int newton_bond, /* ---------------------------------------------------------------------- */ -double AngleSDK::single(int type, int i1, int i2, int i3) +double AngleSPICA::single(int type, int i1, int i2, int i3) { double **x = atom->x; @@ -493,6 +500,12 @@ double AngleSDK::single(int type, int i1, int i2, int i3) const double r6inv = r2inv*r2inv*r2inv; e13 = r6inv*(lj3[type1][type3]*r6inv - lj4[type1][type3]); + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv*r2inv*sqrt(r2inv); + const double r7inv = r5inv*r2inv; + + e13 = r5inv*(lj3[type1][type3]*r7inv - lj4[type1][type3]); } // make sure energy is 0.0 at the cutoff. diff --git a/src/CG-SDK/angle_sdk.h b/src/CG-SPICA/angle_spica.h similarity index 85% rename from src/CG-SDK/angle_sdk.h rename to src/CG-SPICA/angle_spica.h index 0db35444bf..e270ee5de5 100644 --- a/src/CG-SDK/angle_sdk.h +++ b/src/CG-SPICA/angle_spica.h @@ -13,21 +13,22 @@ #ifdef ANGLE_CLASS // clang-format off -AngleStyle(sdk,AngleSDK); +AngleStyle(spica,AngleSPICA); +AngleStyle(sdk,AngleSPICA); // clang-format on #else -#ifndef LMP_ANGLE_SDK_H -#define LMP_ANGLE_SDK_H +#ifndef LMP_ANGLE_SPICA_H +#define LMP_ANGLE_SPICA_H #include "angle.h" namespace LAMMPS_NS { -class AngleSDK : public Angle { +class AngleSPICA : public Angle { public: - AngleSDK(class LAMMPS *); - ~AngleSDK() override; + AngleSPICA(class LAMMPS *); + ~AngleSPICA() override; void compute(int, int) override; void coeff(int, char **) override; void init_style() override; @@ -42,7 +43,7 @@ class AngleSDK : public Angle { // scaling factor for repulsive 1-3 interaction double *repscale; - // parameters from SDK pair style + // parameters from SPICA pair style int **lj_type; double **lj1, **lj2, **lj3, **lj4; double **rminsq, **emin; diff --git a/src/CG-SDK/lj_sdk_common.h b/src/CG-SPICA/lj_spica_common.h similarity index 77% rename from src/CG-SDK/lj_sdk_common.h rename to src/CG-SPICA/lj_spica_common.h index 1157b89521..656b5dedb6 100644 --- a/src/CG-SDK/lj_sdk_common.h +++ b/src/CG-SPICA/lj_spica_common.h @@ -14,20 +14,21 @@ /* ---------------------------------------------------------------------- Common data for the Shinoda, DeVane, Klein (SDK) coarse grain model Contributing author: Axel Kohlmeyer (Temple U) + Contributing author (added LJ12_5) : Yusuke Miyazaki (Okayama U) ------------------------------------------------------------------------- */ -#ifndef LMP_LJ_SDK_COMMON_H -#define LMP_LJ_SDK_COMMON_H +#ifndef LMP_LJ_SPICA_COMMON_H +#define LMP_LJ_SPICA_COMMON_H #include namespace LAMMPS_NS { -namespace LJSDKParms { +namespace LJSPICAParms { // LJ type flags. list of supported LJ exponent combinations - enum { LJ_NOT_SET = 0, LJ9_6, LJ12_4, LJ12_6, NUM_LJ_TYPES }; + enum { LJ_NOT_SET = 0, LJ9_6, LJ12_4, LJ12_6, LJ12_5, NUM_LJ_TYPES }; -#if defined(LMP_NEED_SDK_FIND_LJ_TYPE) +#if defined(LMP_NEED_SPICA_FIND_LJ_TYPE) static int find_lj_type(const char *label, const char *const *const list) { for (int i = 0; i < NUM_LJ_TYPES; ++i) @@ -38,11 +39,11 @@ namespace LJSDKParms { #endif // clang-format off - static const char *const lj_type_list[] = {"none", "lj9_6", "lj12_4", "lj12_6"}; - static constexpr double lj_prefact[] = {0.0, 6.75, 2.59807621135332, 4.0}; - static constexpr double lj_pow1[] = {0.0, 9.00, 12.0, 12.0}; - static constexpr double lj_pow2[] = {0.0, 6.00, 4.0, 6.0}; + static const char *const lj_type_list[] = {"none", "lj9_6", "lj12_4", "lj12_6", "lj12_5"}; + static constexpr double lj_prefact[] = {0.0, 6.75, 2.59807621135332, 4.0, 3.20377984125109}; + static constexpr double lj_pow1[] = {0.0, 9.00, 12.0, 12.0, 12.0}; + static constexpr double lj_pow2[] = {0.0, 6.00, 4.0, 6.0, 5.0}; // clang-format on -} // namespace LJSDKParms +} // namespace LJSPICAParms } // namespace LAMMPS_NS #endif diff --git a/src/CG-SDK/pair_lj_sdk.cpp b/src/CG-SPICA/pair_lj_spica.cpp similarity index 90% rename from src/CG-SDK/pair_lj_sdk.cpp rename to src/CG-SPICA/pair_lj_spica.cpp index 597c1d59c4..6a14d12146 100644 --- a/src/CG-SDK/pair_lj_sdk.cpp +++ b/src/CG-SPICA/pair_lj_spica.cpp @@ -17,7 +17,7 @@ This style is a simplified re-implementation of the CG/CMM pair style ------------------------------------------------------------------------- */ -#include "pair_lj_sdk.h" +#include "pair_lj_spica.h" #include #include @@ -29,15 +29,15 @@ #include "error.h" -#define LMP_NEED_SDK_FIND_LJ_TYPE 1 -#include "lj_sdk_common.h" +#define LMP_NEED_SPICA_FIND_LJ_TYPE 1 +#include "lj_spica_common.h" using namespace LAMMPS_NS; -using namespace LJSDKParms; +using namespace LJSPICAParms; /* ---------------------------------------------------------------------- */ -PairLJSDK::PairLJSDK(LAMMPS *lmp) : Pair(lmp) +PairLJSPICA::PairLJSPICA(LAMMPS *lmp) : Pair(lmp) { respa_enable = 0; single_enable = 1; @@ -46,7 +46,7 @@ PairLJSDK::PairLJSDK(LAMMPS *lmp) : Pair(lmp) /* ---------------------------------------------------------------------- */ -PairLJSDK::~PairLJSDK() +PairLJSPICA::~PairLJSPICA() { if (copymode) return; @@ -73,7 +73,7 @@ PairLJSDK::~PairLJSDK() /* ---------------------------------------------------------------------- */ -void PairLJSDK::compute(int eflag, int vflag) +void PairLJSPICA::compute(int eflag, int vflag) { ev_init(eflag,vflag); @@ -96,7 +96,7 @@ void PairLJSDK::compute(int eflag, int vflag) /* ---------------------------------------------------------------------- */ template -void PairLJSDK::eval() +void PairLJSPICA::eval() { int i,j,ii,jj,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair; @@ -170,6 +170,16 @@ void PairLJSDK::eval() if (EFLAG) evdwl = r6inv*(lj3[itype][jtype]*r6inv - lj4[itype][jtype]) - offset[itype][jtype]; + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv*r2inv*sqrt(r2inv); + const double r7inv = r5inv*r2inv; + forcelj = r5inv*(lj1[itype][jtype]*r7inv + - lj2[itype][jtype]); + if (EFLAG) + evdwl = r5inv*(lj3[itype][jtype]*r7inv + - lj4[itype][jtype]) - offset[itype][jtype]; + } else continue; fpair = factor_lj*forcelj*r2inv; @@ -198,7 +208,7 @@ void PairLJSDK::eval() allocate all arrays ------------------------------------------------------------------------- */ -void PairLJSDK::allocate() +void PairLJSPICA::allocate() { allocated = 1; int n = atom->ntypes; @@ -233,7 +243,7 @@ void PairLJSDK::allocate() global settings ------------------------------------------------------------------------- */ -void PairLJSDK::settings(int narg, char **arg) +void PairLJSPICA::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); @@ -253,7 +263,7 @@ void PairLJSDK::settings(int narg, char **arg) set coeffs for one or more type pairs ------------------------------------------------------------------------- */ -void PairLJSDK::coeff(int narg, char **arg) +void PairLJSPICA::coeff(int narg, char **arg) { if (narg < 5 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients"); if (!allocated) allocate(); @@ -291,10 +301,10 @@ void PairLJSDK::coeff(int narg, char **arg) init for one type pair i,j and corresponding j,i ------------------------------------------------------------------------- */ -double PairLJSDK::init_one(int i, int j) +double PairLJSPICA::init_one(int i, int j) { if (setflag[i][j] == 0) - error->all(FLERR,"No mixing support for lj/sdk. " + error->all(FLERR,"No mixing support for lj/spica. " "Coefficients for all pairs need to be set explicitly."); const int ljt = lj_type[i][j]; @@ -321,7 +331,7 @@ double PairLJSDK::init_one(int i, int j) offset[j][i] = offset[i][j]; lj_type[j][i] = lj_type[i][j]; - // compute derived parameters for SDK angle potential + // compute derived parameters for SPICA angle potential const double eps = epsilon[i][j]; const double sig = sigma[i][j]; @@ -338,7 +348,7 @@ double PairLJSDK::init_one(int i, int j) // count total # of atoms of type I and J via Allreduce if (tail_flag) - error->all(FLERR,"Tail flag not supported by lj/sdk pair style"); + error->all(FLERR,"Tail flag not supported by lj/spica pair style"); return cut[i][j]; } @@ -347,7 +357,7 @@ double PairLJSDK::init_one(int i, int j) proc 0 writes to restart file ------------------------------------------------------------------------- */ -void PairLJSDK::write_restart(FILE *fp) +void PairLJSPICA::write_restart(FILE *fp) { write_restart_settings(fp); @@ -368,7 +378,7 @@ void PairLJSDK::write_restart(FILE *fp) proc 0 reads from restart file, bcasts ------------------------------------------------------------------------- */ -void PairLJSDK::read_restart(FILE *fp) +void PairLJSPICA::read_restart(FILE *fp) { read_restart_settings(fp); allocate(); @@ -398,7 +408,7 @@ void PairLJSDK::read_restart(FILE *fp) proc 0 writes to restart file ------------------------------------------------------------------------- */ -void PairLJSDK::write_restart_settings(FILE *fp) +void PairLJSPICA::write_restart_settings(FILE *fp) { fwrite(&cut_global,sizeof(double),1,fp); fwrite(&offset_flag,sizeof(int),1,fp); @@ -410,7 +420,7 @@ void PairLJSDK::write_restart_settings(FILE *fp) proc 0 reads from restart file, bcasts ------------------------------------------------------------------------- */ -void PairLJSDK::read_restart_settings(FILE *fp) +void PairLJSPICA::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { @@ -426,12 +436,12 @@ void PairLJSDK::read_restart_settings(FILE *fp) } /* ---------------------------------------------------------------------- - lj/sdk does not support per atom type output with mixing + lj/spica does not support per atom type output with mixing ------------------------------------------------------------------------- */ -void PairLJSDK::write_data(FILE *) +void PairLJSPICA::write_data(FILE *) { - error->one(FLERR, "Pair style lj/sdk requires using " + error->one(FLERR, "Pair style lj/spica requires using " "write_data with the 'pair ij' option"); } @@ -439,7 +449,7 @@ void PairLJSDK::write_data(FILE *) proc 0 writes all pairs to data file ------------------------------------------------------------------------- */ -void PairLJSDK::write_data_all(FILE *fp) +void PairLJSPICA::write_data_all(FILE *fp) { for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) @@ -449,7 +459,7 @@ void PairLJSDK::write_data_all(FILE *fp) /* ---------------------------------------------------------------------- */ -double PairLJSDK::single(int, int, int itype, int jtype, double rsq, +double PairLJSPICA::single(int, int, int itype, int jtype, double rsq, double, double factor_lj, double &fforce) { @@ -475,7 +485,7 @@ double PairLJSDK::single(int, int, int itype, int jtype, double rsq, /* ---------------------------------------------------------------------- */ -void *PairLJSDK::extract(const char *str, int &dim) +void *PairLJSPICA::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; @@ -492,7 +502,7 @@ void *PairLJSDK::extract(const char *str, int &dim) /* ---------------------------------------------------------------------- */ -double PairLJSDK::memory_usage() +double PairLJSPICA::memory_usage() { double bytes = Pair::memory_usage(); int n = atom->ntypes; diff --git a/src/CG-SDK/pair_lj_sdk.h b/src/CG-SPICA/pair_lj_spica.h similarity index 88% rename from src/CG-SDK/pair_lj_sdk.h rename to src/CG-SPICA/pair_lj_spica.h index 28cef78d44..6c016ccd7c 100644 --- a/src/CG-SDK/pair_lj_sdk.h +++ b/src/CG-SPICA/pair_lj_spica.h @@ -17,21 +17,22 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(lj/sdk,PairLJSDK); +PairStyle(lj/spica,PairLJSPICA); +PairStyle(lj/sdk,PairLJSPICA); // clang-format on #else -#ifndef LMP_PAIR_LJ_SDK_H -#define LMP_PAIR_LJ_SDK_H +#ifndef LMP_PAIR_LJ_SPICA_H +#define LMP_PAIR_LJ_SPICA_H #include "pair.h" namespace LAMMPS_NS { -class PairLJSDK : public Pair { +class PairLJSPICA : public Pair { public: - PairLJSDK(LAMMPS *); - ~PairLJSDK() override; + PairLJSPICA(LAMMPS *); + ~PairLJSPICA() override; void compute(int, int) override; void settings(int, char **) override; void coeff(int, char **) override; @@ -54,7 +55,7 @@ class PairLJSDK : public Pair { double **lj1, **lj2, **lj3, **lj4, **offset; // cutoff and offset for minimum of LJ potential - // to be used in SDK angle potential, which + // to be used in SPICA angle potential, which // uses only the repulsive part of the potential double **rminsq, **emin; diff --git a/src/CG-SDK/pair_lj_sdk_coul_long.cpp b/src/CG-SPICA/pair_lj_spica_coul_long.cpp similarity index 90% rename from src/CG-SDK/pair_lj_sdk_coul_long.cpp rename to src/CG-SPICA/pair_lj_spica_coul_long.cpp index e1d79789b8..416561c3a1 100644 --- a/src/CG-SDK/pair_lj_sdk_coul_long.cpp +++ b/src/CG-SPICA/pair_lj_spica_coul_long.cpp @@ -16,7 +16,7 @@ This style is a simplified re-implementation of the CG/CMM pair style ------------------------------------------------------------------------- */ -#include "pair_lj_sdk_coul_long.h" +#include "pair_lj_spica_coul_long.h" #include "atom.h" #include "comm.h" @@ -30,11 +30,11 @@ #include #include -#define LMP_NEED_SDK_FIND_LJ_TYPE 1 -#include "lj_sdk_common.h" +#define LMP_NEED_SPICA_FIND_LJ_TYPE 1 +#include "lj_spica_common.h" using namespace LAMMPS_NS; -using namespace LJSDKParms; +using namespace LJSPICAParms; #define EWALD_F 1.12837917 #define EWALD_P 0.3275911 @@ -46,7 +46,7 @@ using namespace LJSDKParms; /* ---------------------------------------------------------------------- */ -PairLJSDKCoulLong::PairLJSDKCoulLong(LAMMPS *lmp) : Pair(lmp) +PairLJSPICACoulLong::PairLJSPICACoulLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; respa_enable = 0; @@ -56,7 +56,7 @@ PairLJSDKCoulLong::PairLJSDKCoulLong(LAMMPS *lmp) : Pair(lmp) /* ---------------------------------------------------------------------- */ -PairLJSDKCoulLong::~PairLJSDKCoulLong() +PairLJSPICACoulLong::~PairLJSPICACoulLong() { if (allocated) { memory->destroy(setflag); @@ -83,7 +83,7 @@ PairLJSDKCoulLong::~PairLJSDKCoulLong() /* ---------------------------------------------------------------------- */ -void PairLJSDKCoulLong::compute(int eflag, int vflag) +void PairLJSPICACoulLong::compute(int eflag, int vflag) { ev_init(eflag, vflag); @@ -111,7 +111,7 @@ void PairLJSDKCoulLong::compute(int eflag, int vflag) /* ---------------------------------------------------------------------- */ -template void PairLJSDKCoulLong::eval() +template void PairLJSPICACoulLong::eval() { int i, ii, j, jj, jtype, itable; double qtmp, xtmp, ytmp, ztmp, delx, dely, delz, evdwl, ecoul, fpair; @@ -223,6 +223,14 @@ template void PairLJSDKCoulLong::eval() if (EFLAG) evdwl = r6inv * (lj3[itype][jtype] * r6inv - lj4[itype][jtype]) - offset[itype][jtype]; + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv * r2inv * sqrt(r2inv); + const double r7inv = r5inv * r2inv; + forcelj = r5inv * (lj1[itype][jtype] * r7inv - lj2[itype][jtype]); + if (EFLAG) + evdwl = + r5inv * (lj3[itype][jtype] * r7inv - lj4[itype][jtype]) - offset[itype][jtype]; } forcelj *= factor_lj; if (EFLAG) evdwl *= factor_lj; @@ -252,7 +260,7 @@ template void PairLJSDKCoulLong::eval() allocate all arrays ------------------------------------------------------------------------- */ -void PairLJSDKCoulLong::allocate() +void PairLJSPICACoulLong::allocate() { allocated = 1; int np1 = atom->ntypes + 1; @@ -288,7 +296,7 @@ void PairLJSDKCoulLong::allocate() global settings ------------------------------------------------------------------------- */ -void PairLJSDKCoulLong::settings(int narg, char **arg) +void PairLJSPICACoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR, "Illegal pair_style command"); @@ -312,7 +320,7 @@ void PairLJSDKCoulLong::settings(int narg, char **arg) set coeffs for one or more type pairs ------------------------------------------------------------------------- */ -void PairLJSDKCoulLong::coeff(int narg, char **arg) +void PairLJSPICACoulLong::coeff(int narg, char **arg) { if (narg < 5 || narg > 6) error->all(FLERR, "Incorrect args for pair coefficients"); if (!allocated) allocate(); @@ -349,7 +357,7 @@ void PairLJSDKCoulLong::coeff(int narg, char **arg) init specific to this pair style ------------------------------------------------------------------------- */ -void PairLJSDKCoulLong::init_style() +void PairLJSPICACoulLong::init_style() { if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/coul/long requires atom attribute q"); @@ -371,11 +379,11 @@ void PairLJSDKCoulLong::init_style() init for one type pair i,j and corresponding j,i ------------------------------------------------------------------------- */ -double PairLJSDKCoulLong::init_one(int i, int j) +double PairLJSPICACoulLong::init_one(int i, int j) { if (setflag[i][j] == 0) error->all(FLERR, - "No mixing support for lj/sdk/coul/long. " + "No mixing support for lj/spica/coul/long. " "Coefficients for all pairs need to be set explicitly."); const int ljt = lj_type[i][j]; @@ -406,7 +414,7 @@ double PairLJSDKCoulLong::init_one(int i, int j) offset[j][i] = offset[i][j]; lj_type[j][i] = lj_type[i][j]; - // compute LJ derived parameters for SDK angle potential (LJ only!) + // compute LJ derived parameters for SPICA angle potential (LJ only!) const double eps = epsilon[i][j]; const double sig = sigma[i][j]; @@ -422,7 +430,7 @@ double PairLJSDKCoulLong::init_one(int i, int j) // compute I,J contribution to long-range tail correction // count total # of atoms of type I and J via Allreduce - if (tail_flag) error->all(FLERR, "Tail flag not supported by lj/sdk/coul/long pair style"); + if (tail_flag) error->all(FLERR, "Tail flag not supported by lj/spica/coul/long pair style"); return cut; } @@ -431,7 +439,7 @@ double PairLJSDKCoulLong::init_one(int i, int j) proc 0 writes to restart file ------------------------------------------------------------------------- */ -void PairLJSDKCoulLong::write_restart(FILE *fp) +void PairLJSPICACoulLong::write_restart(FILE *fp) { write_restart_settings(fp); @@ -452,7 +460,7 @@ void PairLJSDKCoulLong::write_restart(FILE *fp) proc 0 reads from restart file, bcasts ------------------------------------------------------------------------- */ -void PairLJSDKCoulLong::read_restart(FILE *fp) +void PairLJSPICACoulLong::read_restart(FILE *fp) { read_restart_settings(fp); allocate(); @@ -482,7 +490,7 @@ void PairLJSDKCoulLong::read_restart(FILE *fp) proc 0 writes to restart file ------------------------------------------------------------------------- */ -void PairLJSDKCoulLong::write_restart_settings(FILE *fp) +void PairLJSPICACoulLong::write_restart_settings(FILE *fp) { fwrite(&cut_lj_global, sizeof(double), 1, fp); fwrite(&cut_coul, sizeof(double), 1, fp); @@ -497,7 +505,7 @@ void PairLJSDKCoulLong::write_restart_settings(FILE *fp) proc 0 reads from restart file, bcasts ------------------------------------------------------------------------- */ -void PairLJSDKCoulLong::read_restart_settings(FILE *fp) +void PairLJSPICACoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { utils::sfread(FLERR, &cut_lj_global, sizeof(double), 1, fp, nullptr, error); @@ -518,13 +526,13 @@ void PairLJSDKCoulLong::read_restart_settings(FILE *fp) } /* ---------------------------------------------------------------------- - lj/sdk does not support per atom type output with mixing + lj/spica does not support per atom type output with mixing ------------------------------------------------------------------------- */ -void PairLJSDKCoulLong::write_data(FILE *) +void PairLJSPICACoulLong::write_data(FILE *) { error->one(FLERR, - "Pair style lj/sdk/coul/* requires using " + "Pair style lj/spica/coul/* requires using " "write_data with the 'pair ij' option"); } @@ -532,7 +540,7 @@ void PairLJSDKCoulLong::write_data(FILE *) proc 0 writes all pairs to data file ------------------------------------------------------------------------- */ -void PairLJSDKCoulLong::write_data_all(FILE *fp) +void PairLJSPICACoulLong::write_data_all(FILE *fp) { for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) @@ -542,7 +550,7 @@ void PairLJSDKCoulLong::write_data_all(FILE *fp) /* ---------------------------------------------------------------------- */ -double PairLJSDKCoulLong::single(int i, int j, int itype, int jtype, double rsq, double factor_coul, +double PairLJSPICACoulLong::single(int i, int j, int itype, int jtype, double rsq, double factor_coul, double factor_lj, double &fforce) { double r2inv, r, grij, expm2, t, erfc, prefactor; @@ -605,6 +613,12 @@ double PairLJSDKCoulLong::single(int i, int j, int itype, int jtype, double rsq, const double r6inv = r2inv * r2inv * r2inv; forcelj = r6inv * (lj1[itype][jtype] * r6inv - lj2[itype][jtype]); philj = r6inv * (lj3[itype][jtype] * r6inv - lj4[itype][jtype]) - offset[itype][jtype]; + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv * r2inv * sqrt(r2inv); + const double r7inv = r5inv * r2inv; + forcelj = r5inv * (lj1[itype][jtype] * r7inv - lj2[itype][jtype]); + philj = r5inv * (lj3[itype][jtype] * r7inv - lj4[itype][jtype]) - offset[itype][jtype]; } forcelj *= factor_lj; philj *= factor_lj; @@ -617,7 +631,7 @@ double PairLJSDKCoulLong::single(int i, int j, int itype, int jtype, double rsq, /* ---------------------------------------------------------------------- */ -void *PairLJSDKCoulLong::extract(const char *str, int &dim) +void *PairLJSPICACoulLong::extract(const char *str, int &dim) { dim = 2; if (strcmp(str, "epsilon") == 0) return (void *) epsilon; @@ -637,7 +651,7 @@ void *PairLJSDKCoulLong::extract(const char *str, int &dim) /* ---------------------------------------------------------------------- */ -double PairLJSDKCoulLong::memory_usage() +double PairLJSPICACoulLong::memory_usage() { double bytes = Pair::memory_usage(); int n = atom->ntypes; diff --git a/src/CG-SDK/pair_lj_sdk_coul_long.h b/src/CG-SPICA/pair_lj_spica_coul_long.h similarity index 85% rename from src/CG-SDK/pair_lj_sdk_coul_long.h rename to src/CG-SPICA/pair_lj_spica_coul_long.h index 6a81a921b5..dce60e5e77 100644 --- a/src/CG-SDK/pair_lj_sdk_coul_long.h +++ b/src/CG-SPICA/pair_lj_spica_coul_long.h @@ -17,21 +17,22 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(lj/sdk/coul/long,PairLJSDKCoulLong); +PairStyle(lj/spica/coul/long,PairLJSPICACoulLong); +PairStyle(lj/sdk/coul/long,PairLJSPICACoulLong); // clang-format on #else -#ifndef LMP_PAIR_LJ_SDK_COUL_LONG_H -#define LMP_PAIR_LJ_SDK_COUL_LONG_H +#ifndef LMP_PAIR_LJ_SPICA_COUL_LONG_H +#define LMP_PAIR_LJ_SPICA_COUL_LONG_H #include "pair.h" namespace LAMMPS_NS { -class PairLJSDKCoulLong : public Pair { +class PairLJSPICACoulLong : public Pair { public: - PairLJSDKCoulLong(class LAMMPS *); - ~PairLJSDKCoulLong() override; + PairLJSPICACoulLong(class LAMMPS *); + ~PairLJSPICACoulLong() override; void compute(int, int) override; void settings(int, char **) override; void coeff(int, char **) override; @@ -55,7 +56,7 @@ class PairLJSDKCoulLong : public Pair { int **lj_type; // cutoff and offset for minimum of LJ potential - // to be used in SDK angle potential, which + // to be used in SPICA angle potential, which // uses only the repulsive part of the potential double **rminsq, **emin; diff --git a/src/CG-SDK/pair_lj_sdk_coul_msm.cpp b/src/CG-SPICA/pair_lj_spica_coul_msm.cpp similarity index 90% rename from src/CG-SDK/pair_lj_sdk_coul_msm.cpp rename to src/CG-SPICA/pair_lj_spica_coul_msm.cpp index fb7a1fdddc..536c01595c 100644 --- a/src/CG-SDK/pair_lj_sdk_coul_msm.cpp +++ b/src/CG-SPICA/pair_lj_spica_coul_msm.cpp @@ -17,7 +17,7 @@ This style is a simplified re-implementation of the CG/CMM pair style ------------------------------------------------------------------------- */ -#include "pair_lj_sdk_coul_msm.h" +#include "pair_lj_spica_coul_msm.h" #include "atom.h" #include "error.h" @@ -28,14 +28,14 @@ #include #include -#include "lj_sdk_common.h" +#include "lj_spica_common.h" using namespace LAMMPS_NS; -using namespace LJSDKParms; +using namespace LJSPICAParms; /* ---------------------------------------------------------------------- */ -PairLJSDKCoulMSM::PairLJSDKCoulMSM(LAMMPS *lmp) : PairLJSDKCoulLong(lmp) +PairLJSPICACoulMSM::PairLJSPICACoulMSM(LAMMPS *lmp) : PairLJSPICACoulLong(lmp) { ewaldflag = pppmflag = 0; msmflag = 1; @@ -45,7 +45,7 @@ PairLJSDKCoulMSM::PairLJSDKCoulMSM(LAMMPS *lmp) : PairLJSDKCoulLong(lmp) /* ---------------------------------------------------------------------- */ -void PairLJSDKCoulMSM::compute(int eflag, int vflag) +void PairLJSPICACoulMSM::compute(int eflag, int vflag) { if (force->kspace->scalar_pressure_flag) error->all(FLERR,"Must use 'kspace_modify pressure/scalar no' with Pair style"); @@ -71,7 +71,7 @@ void PairLJSDKCoulMSM::compute(int eflag, int vflag) /* ---------------------------------------------------------------------- */ template -void PairLJSDKCoulMSM::eval_msm() +void PairLJSPICACoulMSM::eval_msm() { int i,ii,j,jj,jtype,itable; double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair; @@ -187,6 +187,15 @@ void PairLJSDKCoulMSM::eval_msm() if (EFLAG) evdwl = r6inv*(lj3[itype][jtype]*r6inv - lj4[itype][jtype]) - offset[itype][jtype]; + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv*r2inv*sqrt(r2inv); + const double r7inv = r5inv*r2inv; + forcelj = r5inv*(lj1[itype][jtype]*r7inv + - lj2[itype][jtype]); + if (EFLAG) + evdwl = r5inv*(lj3[itype][jtype]*r7inv + - lj4[itype][jtype]) - offset[itype][jtype]; } forcelj *= factor_lj; if (EFLAG) evdwl *= factor_lj; @@ -215,7 +224,7 @@ void PairLJSDKCoulMSM::eval_msm() /* ---------------------------------------------------------------------- */ -double PairLJSDKCoulMSM::single(int i, int j, int itype, int jtype, +double PairLJSPICACoulMSM::single(int i, int j, int itype, int jtype, double rsq, double factor_coul, double factor_lj, double &fforce) @@ -283,6 +292,14 @@ double PairLJSDKCoulMSM::single(int i, int j, int itype, int jtype, - lj2[itype][jtype]); philj = r6inv*(lj3[itype][jtype]*r6inv - lj4[itype][jtype]) - offset[itype][jtype]; + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv*r2inv*sqrt(r2inv); + const double r7inv = r5inv*r2inv; + forcelj = r5inv*(lj1[itype][jtype]*r7inv + - lj2[itype][jtype]); + philj = r5inv*(lj3[itype][jtype]*r7inv + - lj4[itype][jtype]) - offset[itype][jtype]; } forcelj *= factor_lj; philj *= factor_lj; @@ -295,7 +312,7 @@ double PairLJSDKCoulMSM::single(int i, int j, int itype, int jtype, /* ---------------------------------------------------------------------- */ -void *PairLJSDKCoulMSM::extract(const char *str, int &dim) +void *PairLJSPICACoulMSM::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; diff --git a/src/CG-SDK/pair_lj_sdk_coul_msm.h b/src/CG-SPICA/pair_lj_spica_coul_msm.h similarity index 80% rename from src/CG-SDK/pair_lj_sdk_coul_msm.h rename to src/CG-SPICA/pair_lj_spica_coul_msm.h index 1b43f39ec9..be43b5ba52 100644 --- a/src/CG-SDK/pair_lj_sdk_coul_msm.h +++ b/src/CG-SPICA/pair_lj_spica_coul_msm.h @@ -17,20 +17,21 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(lj/sdk/coul/msm,PairLJSDKCoulMSM); +PairStyle(lj/spica/coul/msm,PairLJSPICACoulMSM); +PairStyle(lj/sdk/coul/msm,PairLJSPICACoulMSM); // clang-format on #else -#ifndef LMP_PAIR_LJ_SDK_COUL_MSM_H -#define LMP_PAIR_LJ_SDK_COUL_MSM_H +#ifndef LMP_PAIR_LJ_SPICA_COUL_MSM_H +#define LMP_PAIR_LJ_SPICA_COUL_MSM_H -#include "pair_lj_sdk_coul_long.h" +#include "pair_lj_spica_coul_long.h" namespace LAMMPS_NS { -class PairLJSDKCoulMSM : public PairLJSDKCoulLong { +class PairLJSPICACoulMSM : public PairLJSPICACoulLong { public: - PairLJSDKCoulMSM(class LAMMPS *); + PairLJSPICACoulMSM(class LAMMPS *); void compute(int, int) override; double single(int, int, int, int, double, double, double, double &) override; void *extract(const char *, int &) override; From 116098022f331fca72bccec50f7a0123a7dd3e46 Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Fri, 8 Jul 2022 18:04:04 +0900 Subject: [PATCH 07/15] changed file names and added a lj12-5 function type in GPU pkg. --- src/GPU/Install.sh | 8 +-- ...pu.cpp => pair_lj_spica_coul_long_gpu.cpp} | 50 +++++++++++-------- ...ng_gpu.h => pair_lj_spica_coul_long_gpu.h} | 15 +++--- ...r_lj_sdk_gpu.cpp => pair_lj_spica_gpu.cpp} | 45 ++++++++++------- ...{pair_lj_sdk_gpu.h => pair_lj_spica_gpu.h} | 15 +++--- 5 files changed, 75 insertions(+), 58 deletions(-) rename src/GPU/{pair_lj_sdk_coul_long_gpu.cpp => pair_lj_spica_coul_long_gpu.cpp} (86%) rename src/GPU/{pair_lj_sdk_coul_long_gpu.h => pair_lj_spica_coul_long_gpu.h} (73%) rename src/GPU/{pair_lj_sdk_gpu.cpp => pair_lj_spica_gpu.cpp} (83%) rename src/GPU/{pair_lj_sdk_gpu.h => pair_lj_spica_gpu.h} (79%) diff --git a/src/GPU/Install.sh b/src/GPU/Install.sh index f13e87d317..1768ec024f 100755 --- a/src/GPU/Install.sh +++ b/src/GPU/Install.sh @@ -121,10 +121,10 @@ action pair_lj_expand_coul_long_gpu.cpp pair_lj_expand_coul_long.cpp action pair_lj_expand_coul_long_gpu.h pair_lj_expand_coul_long.cpp action pair_lj_gromacs_gpu.cpp pair_lj_gromacs.cpp action pair_lj_gromacs_gpu.h pair_lj_gromacs.h -action pair_lj_sdk_coul_long_gpu.cpp pair_lj_sdk_coul_long.cpp -action pair_lj_sdk_coul_long_gpu.h pair_lj_sdk_coul_long.cpp -action pair_lj_sdk_gpu.cpp pair_lj_sdk.cpp -action pair_lj_sdk_gpu.h pair_lj_sdk.cpp +action pair_lj_spica_coul_long_gpu.cpp pair_lj_spica_coul_long.cpp +action pair_lj_spica_coul_long_gpu.h pair_lj_spica_coul_long.cpp +action pair_lj_spica_gpu.cpp pair_lj_spica.cpp +action pair_lj_spica_gpu.h pair_lj_spica.cpp action pair_mie_cut_gpu.cpp pair_mie_cut.cpp action pair_mie_cut_gpu.h pair_mie_cut.h action pair_morse_gpu.cpp diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp b/src/GPU/pair_lj_spica_coul_long_gpu.cpp similarity index 86% rename from src/GPU/pair_lj_sdk_coul_long_gpu.cpp rename to src/GPU/pair_lj_spica_coul_long_gpu.cpp index 8638f3d21d..9c72fe5ed3 100644 --- a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_spica_coul_long_gpu.cpp @@ -15,7 +15,7 @@ Contributing author: Mike Brown (SNL) ------------------------------------------------------------------------- */ -#include "pair_lj_sdk_coul_long_gpu.h" +#include "pair_lj_spica_coul_long_gpu.h" #include "atom.h" #include "domain.h" @@ -41,34 +41,34 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition -int sdkl_gpu_init(const int ntypes, double **cutsq, int **lj_type, double **host_lj1, +int spical_gpu_init(const int ntypes, double **cutsq, int **lj_type, double **host_lj1, double **host_lj2, double **host_lj3, double **host_lj4, double **offset, double *special_lj, const int nlocal, const int nall, const int max_nbors, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen, double **host_cut_ljsq, double host_cut_coulsq, double *host_special_coul, const double qqrd2e, const double g_ewald); -void sdkl_gpu_clear(); -int **sdkl_gpu_compute_n(const int ago, const int inum, const int nall, double **host_x, +void spical_gpu_clear(); +int **spical_gpu_compute_n(const int ago, const int inum, const int nall, double **host_x, int *host_type, double *sublo, double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success, double *host_q, double *boxlo, double *prd); -void sdkl_gpu_compute(const int ago, const int inum, const int nall, double **host_x, +void spical_gpu_compute(const int ago, const int inum, const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, const double cpu_time, bool &success, double *host_q, const int nlocal, double *boxlo, double *prd); -double sdkl_gpu_bytes(); +double spical_gpu_bytes(); -#include "lj_sdk_common.h" +#include "lj_spica_common.h" -using namespace LJSDKParms; +using namespace LJSPICAParms; /* ---------------------------------------------------------------------- */ -PairLJSDKCoulLongGPU::PairLJSDKCoulLongGPU(LAMMPS *lmp) : - PairLJSDKCoulLong(lmp), gpu_mode(GPU_FORCE) +PairLJSPICACoulLongGPU::PairLJSPICACoulLongGPU(LAMMPS *lmp) : + PairLJSPICACoulLong(lmp), gpu_mode(GPU_FORCE) { respa_enable = 0; reinitflag = 0; @@ -81,14 +81,14 @@ PairLJSDKCoulLongGPU::PairLJSDKCoulLongGPU(LAMMPS *lmp) : free all arrays ------------------------------------------------------------------------- */ -PairLJSDKCoulLongGPU::~PairLJSDKCoulLongGPU() +PairLJSPICACoulLongGPU::~PairLJSPICACoulLongGPU() { - sdkl_gpu_clear(); + spical_gpu_clear(); } /* ---------------------------------------------------------------------- */ -void PairLJSDKCoulLongGPU::compute(int eflag, int vflag) +void PairLJSPICACoulLongGPU::compute(int eflag, int vflag) { ev_init(eflag, vflag); @@ -110,7 +110,7 @@ void PairLJSDKCoulLongGPU::compute(int eflag, int vflag) domain->bbox(domain->sublo_lamda, domain->subhi_lamda, sublo, subhi); } inum = atom->nlocal; - firstneigh = sdkl_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, sublo, subhi, + firstneigh = spical_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, sublo, subhi, atom->tag, atom->nspecial, atom->special, eflag, vflag, eflag_atom, vflag_atom, host_start, &ilist, &numneigh, cpu_time, success, atom->q, domain->boxlo, domain->prd); @@ -119,7 +119,7 @@ void PairLJSDKCoulLongGPU::compute(int eflag, int vflag) ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - sdkl_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type, ilist, numneigh, firstneigh, + spical_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type, ilist, numneigh, firstneigh, eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, success, atom->q, atom->nlocal, domain->boxlo, domain->prd); } @@ -142,9 +142,9 @@ void PairLJSDKCoulLongGPU::compute(int eflag, int vflag) init specific to this pair style ------------------------------------------------------------------------- */ -void PairLJSDKCoulLongGPU::init_style() +void PairLJSPICACoulLongGPU::init_style() { - if (!atom->q_flag) error->all(FLERR, "Pair style lj/sdk/coul/long/gpu requires atom attribute q"); + if (!atom->q_flag) error->all(FLERR, "Pair style lj/spica/coul/long/gpu requires atom attribute q"); // Repeat cutsq calculation because done after call to init_style double maxcut = -1.0; @@ -177,7 +177,7 @@ void PairLJSDKCoulLongGPU::init_style() if (atom->molecular != Atom::ATOMIC) maxspecial = atom->maxspecial; int mnf = 5e-2 * neighbor->oneatom; int success = - sdkl_gpu_init(atom->ntypes + 1, cutsq, lj_type, lj1, lj2, lj3, lj4, offset, force->special_lj, + spical_gpu_init(atom->ntypes + 1, cutsq, lj_type, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, atom->nlocal + atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald); GPU_EXTRA::check_flag(success, error, world); @@ -187,15 +187,15 @@ void PairLJSDKCoulLongGPU::init_style() /* ---------------------------------------------------------------------- */ -double PairLJSDKCoulLongGPU::memory_usage() +double PairLJSPICACoulLongGPU::memory_usage() { double bytes = Pair::memory_usage(); - return bytes + sdkl_gpu_bytes(); + return bytes + spical_gpu_bytes(); } /* ---------------------------------------------------------------------- */ template -void PairLJSDKCoulLongGPU::cpu_compute(int start, int inum, int *ilist, int *numneigh, +void PairLJSPICACoulLongGPU::cpu_compute(int start, int inum, int *ilist, int *numneigh, int **firstneigh) { int i, j, ii, jj; @@ -307,6 +307,14 @@ void PairLJSDKCoulLongGPU::cpu_compute(int start, int inum, int *ilist, int *num if (EFLAG) evdwl = r6inv * (lj3[itype][jtype] * r6inv - lj4[itype][jtype]) - offset[itype][jtype]; + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv * r2inv * sqrt(r2inv); + const double r7inv = r5inv * r2inv; + forcelj = r5inv * (lj1[itype][jtype] * r7inv - lj2[itype][jtype]); + if (EFLAG) + evdwl = + r5inv * (lj3[itype][jtype] * r7inv - lj4[itype][jtype]) - offset[itype][jtype]; } if (EFLAG) evdwl *= factor_lj; diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.h b/src/GPU/pair_lj_spica_coul_long_gpu.h similarity index 73% rename from src/GPU/pair_lj_sdk_coul_long_gpu.h rename to src/GPU/pair_lj_spica_coul_long_gpu.h index 02cac49d0b..3fd267fe5a 100644 --- a/src/GPU/pair_lj_sdk_coul_long_gpu.h +++ b/src/GPU/pair_lj_spica_coul_long_gpu.h @@ -13,21 +13,22 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(lj/sdk/coul/long/gpu,PairLJSDKCoulLongGPU); +PairStyle(lj/spica/coul/long/gpu,PairLJSPICACoulLongGPU); +PairStyle(lj/sdk/coul/long/gpu,PairLJSPICACoulLongGPU); // clang-format on #else -#ifndef LMP_PAIR_LJ_SDK_COUL_LONG_GPU_H -#define LMP_PAIR_LJ_SDK_COUL_LONG_GPU_H +#ifndef LMP_PAIR_LJ_SPICA_COUL_LONG_GPU_H +#define LMP_PAIR_LJ_SPICA_COUL_LONG_GPU_H -#include "pair_lj_sdk_coul_long.h" +#include "pair_lj_spica_coul_long.h" namespace LAMMPS_NS { -class PairLJSDKCoulLongGPU : public PairLJSDKCoulLong { +class PairLJSPICACoulLongGPU : public PairLJSPICACoulLong { public: - PairLJSDKCoulLongGPU(LAMMPS *lmp); - ~PairLJSDKCoulLongGPU() override; + PairLJSPICACoulLongGPU(LAMMPS *lmp); + ~PairLJSPICACoulLongGPU() override; template void cpu_compute(int, int, int *, int *, int **); void compute(int, int) override; void init_style() override; diff --git a/src/GPU/pair_lj_sdk_gpu.cpp b/src/GPU/pair_lj_spica_gpu.cpp similarity index 83% rename from src/GPU/pair_lj_sdk_gpu.cpp rename to src/GPU/pair_lj_spica_gpu.cpp index 21e079e06f..394480428c 100644 --- a/src/GPU/pair_lj_sdk_gpu.cpp +++ b/src/GPU/pair_lj_spica_gpu.cpp @@ -15,7 +15,7 @@ Contributing author: Mike Brown (SNL) ------------------------------------------------------------------------- */ -#include "pair_lj_sdk_gpu.h" +#include "pair_lj_spica_gpu.h" #include "atom.h" #include "domain.h" @@ -32,29 +32,29 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition -int sdk_gpu_init(const int ntypes, double **cutsq, int **cg_types, double **host_lj1, +int spica_gpu_init(const int ntypes, double **cutsq, int **cg_types, double **host_lj1, double **host_lj2, double **host_lj3, double **host_lj4, double **offset, double *special_lj, const int nlocal, const int nall, const int max_nbors, const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen); -void sdk_gpu_clear(); -int **sdk_gpu_compute_n(const int ago, const int inum, const int nall, double **host_x, +void spica_gpu_clear(); +int **spica_gpu_compute_n(const int ago, const int inum, const int nall, double **host_x, int *host_type, double *sublo, double *subhi, tagint *tag, int **nspecial, tagint **special, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, int **ilist, int **jnum, const double cpu_time, bool &success); -void sdk_gpu_compute(const int ago, const int inum, const int nall, double **host_x, int *host_type, +void spica_gpu_compute(const int ago, const int inum, const int nall, double **host_x, int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, const bool vflag, const bool eatom, const bool vatom, int &host_start, const double cpu_time, bool &success); -double sdk_gpu_bytes(); +double spica_gpu_bytes(); -#include "lj_sdk_common.h" +#include "lj_spica_common.h" -using namespace LJSDKParms; +using namespace LJSPICAParms; /* ---------------------------------------------------------------------- */ -PairLJSDKGPU::PairLJSDKGPU(LAMMPS *lmp) : PairLJSDK(lmp), gpu_mode(GPU_FORCE) +PairLJSPICAGPU::PairLJSPICAGPU(LAMMPS *lmp) : PairLJSPICA(lmp), gpu_mode(GPU_FORCE) { respa_enable = 0; reinitflag = 0; @@ -67,14 +67,14 @@ PairLJSDKGPU::PairLJSDKGPU(LAMMPS *lmp) : PairLJSDK(lmp), gpu_mode(GPU_FORCE) free all arrays ------------------------------------------------------------------------- */ -PairLJSDKGPU::~PairLJSDKGPU() +PairLJSPICAGPU::~PairLJSPICAGPU() { - sdk_gpu_clear(); + spica_gpu_clear(); } /* ---------------------------------------------------------------------- */ -void PairLJSDKGPU::compute(int eflag, int vflag) +void PairLJSPICAGPU::compute(int eflag, int vflag) { ev_init(eflag, vflag); @@ -97,7 +97,7 @@ void PairLJSDKGPU::compute(int eflag, int vflag) } inum = atom->nlocal; firstneigh = - sdk_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, sublo, subhi, atom->tag, + spica_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, sublo, subhi, atom->tag, atom->nspecial, atom->special, eflag, vflag, eflag_atom, vflag_atom, host_start, &ilist, &numneigh, cpu_time, success); } else { @@ -105,7 +105,7 @@ void PairLJSDKGPU::compute(int eflag, int vflag) ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - sdk_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type, ilist, numneigh, firstneigh, + spica_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type, ilist, numneigh, firstneigh, eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, success); } if (!success) error->one(FLERR, "Insufficient memory on accelerator"); @@ -127,7 +127,7 @@ void PairLJSDKGPU::compute(int eflag, int vflag) init specific to this pair style ------------------------------------------------------------------------- */ -void PairLJSDKGPU::init_style() +void PairLJSPICAGPU::init_style() { // Repeat cutsq calculation because done after call to init_style @@ -149,7 +149,7 @@ void PairLJSDKGPU::init_style() int maxspecial = 0; if (atom->molecular != Atom::ATOMIC) maxspecial = atom->maxspecial; int mnf = 5e-2 * neighbor->oneatom; - int success = sdk_gpu_init(atom->ntypes + 1, cutsq, lj_type, lj1, lj2, lj3, lj4, offset, + int success = spica_gpu_init(atom->ntypes + 1, cutsq, lj_type, lj1, lj2, lj3, lj4, offset, force->special_lj, atom->nlocal, atom->nlocal + atom->nghost, mnf, maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success, error, world); @@ -159,15 +159,15 @@ void PairLJSDKGPU::init_style() /* ---------------------------------------------------------------------- */ -double PairLJSDKGPU::memory_usage() +double PairLJSPICAGPU::memory_usage() { double bytes = Pair::memory_usage(); - return bytes + sdk_gpu_bytes(); + return bytes + spica_gpu_bytes(); } /* ---------------------------------------------------------------------- */ template -void PairLJSDKGPU::cpu_compute(int start, int inum, int *ilist, int *numneigh, int **firstneigh) +void PairLJSPICAGPU::cpu_compute(int start, int inum, int *ilist, int *numneigh, int **firstneigh) { int i, j, ii, jj, jtype; double xtmp, ytmp, ztmp, delx, dely, delz, evdwl, fpair; @@ -228,6 +228,13 @@ void PairLJSDKGPU::cpu_compute(int start, int inum, int *ilist, int *numneigh, i forcelj = r6inv * (lj1[itype][jtype] * r6inv - lj2[itype][jtype]); if (EFLAG) evdwl = r6inv * (lj3[itype][jtype] * r6inv - lj4[itype][jtype]) - offset[itype][jtype]; + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv * r2inv * sqrt(r2inv); + const double r7inv = r5inv * r2inv; + forcelj = r5inv * (lj1[itype][jtype] * r7inv - lj2[itype][jtype]); + if (EFLAG) + evdwl = r5inv * (lj3[itype][jtype] * r7inv - lj4[itype][jtype]) - offset[itype][jtype]; } else continue; diff --git a/src/GPU/pair_lj_sdk_gpu.h b/src/GPU/pair_lj_spica_gpu.h similarity index 79% rename from src/GPU/pair_lj_sdk_gpu.h rename to src/GPU/pair_lj_spica_gpu.h index 529349ed0d..e8953d90da 100644 --- a/src/GPU/pair_lj_sdk_gpu.h +++ b/src/GPU/pair_lj_spica_gpu.h @@ -13,21 +13,22 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(lj/sdk/gpu,PairLJSDKGPU); +PairStyle(lj/spica/gpu,PairLJSPICAGPU); +PairStyle(lj/sdk/gpu,PairLJSPICAGPU); // clang-format on #else -#ifndef LMP_PAIR_LJ_SDK_GPU_H -#define LMP_PAIR_LJ_SDK_GPU_H +#ifndef LMP_PAIR_LJ_SPICA_GPU_H +#define LMP_PAIR_LJ_SPICA_GPU_H -#include "pair_lj_sdk.h" +#include "pair_lj_spica.h" namespace LAMMPS_NS { -class PairLJSDKGPU : public PairLJSDK { +class PairLJSPICAGPU : public PairLJSPICA { public: - PairLJSDKGPU(LAMMPS *lmp); - ~PairLJSDKGPU() override; + PairLJSPICAGPU(LAMMPS *lmp); + ~PairLJSPICAGPU() override; template void cpu_compute(int, int, int *, int *, int **); void compute(int, int) override; void init_style() override; From 60b189672ee7bd2a767165cfd706b94f7bc2617a Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Fri, 8 Jul 2022 18:09:37 +0900 Subject: [PATCH 08/15] changed file names and added a lj12-5 function type in KOKKOS pkg. --- src/KOKKOS/Install.sh | 4 +- ...dk_kokkos.cpp => pair_lj_spica_kokkos.cpp} | 57 +++++++++++-------- ...lj_sdk_kokkos.h => pair_lj_spica_kokkos.h} | 43 +++++++------- 3 files changed, 59 insertions(+), 45 deletions(-) rename src/KOKKOS/{pair_lj_sdk_kokkos.cpp => pair_lj_spica_kokkos.cpp} (84%) rename src/KOKKOS/{pair_lj_sdk_kokkos.h => pair_lj_spica_kokkos.h} (65%) diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index 314205ea3e..8b83555b8c 100755 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -292,8 +292,8 @@ action pair_lj_gromacs_coul_gromacs_kokkos.cpp pair_lj_gromacs_coul_gromacs.cpp action pair_lj_gromacs_coul_gromacs_kokkos.h pair_lj_gromacs_coul_gromacs.h action pair_lj_gromacs_kokkos.cpp pair_lj_gromacs.cpp action pair_lj_gromacs_kokkos.h pair_lj_gromacs.h -action pair_lj_sdk_kokkos.cpp pair_lj_sdk.cpp -action pair_lj_sdk_kokkos.h pair_lj_sdk.h +action pair_lj_spica_kokkos.cpp pair_lj_spica.cpp +action pair_lj_spica_kokkos.h pair_lj_spica.h action pair_meam_kokkos.cpp pair_meam.cpp action pair_meam_kokkos.h pair_meam.h action pair_morse_kokkos.cpp diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.cpp b/src/KOKKOS/pair_lj_spica_kokkos.cpp similarity index 84% rename from src/KOKKOS/pair_lj_sdk_kokkos.cpp rename to src/KOKKOS/pair_lj_spica_kokkos.cpp index aed03f157d..4e77edb200 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.cpp +++ b/src/KOKKOS/pair_lj_spica_kokkos.cpp @@ -12,7 +12,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "pair_lj_sdk_kokkos.h" +#include "pair_lj_spica_kokkos.h" #include "atom_kokkos.h" #include "atom_masks.h" @@ -26,13 +26,13 @@ #include "respa.h" #include "update.h" -#include "lj_sdk_common.h" +#include "lj_spica_common.h" #include #include using namespace LAMMPS_NS; -using namespace LJSDKParms; +using namespace LJSPICAParms; #define KOKKOS_CUDA_MAX_THREADS 256 #define KOKKOS_CUDA_MIN_BLOCKS 8 @@ -40,7 +40,7 @@ using namespace LJSDKParms; /* ---------------------------------------------------------------------- */ template -PairLJSDKKokkos::PairLJSDKKokkos(LAMMPS *lmp) : PairLJSDK(lmp) +PairLJSPICAKokkos::PairLJSPICAKokkos(LAMMPS *lmp) : PairLJSPICA(lmp) { respa_enable = 0; @@ -54,7 +54,7 @@ PairLJSDKKokkos::PairLJSDKKokkos(LAMMPS *lmp) : PairLJSDK(lmp) /* ---------------------------------------------------------------------- */ template -PairLJSDKKokkos::~PairLJSDKKokkos() +PairLJSPICAKokkos::~PairLJSPICAKokkos() { if (copymode) return; @@ -68,7 +68,7 @@ PairLJSDKKokkos::~PairLJSDKKokkos() /* ---------------------------------------------------------------------- */ template -void PairLJSDKKokkos::compute(int eflag_in, int vflag_in) +void PairLJSPICAKokkos::compute(int eflag_in, int vflag_in) { eflag = eflag_in; vflag = vflag_in; @@ -112,7 +112,7 @@ void PairLJSDKKokkos::compute(int eflag_in, int vflag_in) // loop over neighbors of my atoms - EV_FLOAT ev = pair_compute,void >(this,(NeighListKokkos*)list); + EV_FLOAT ev = pair_compute,void >(this,(NeighListKokkos*)list); if (eflag) eng_vdwl += ev.evdwl; if (vflag_global) { @@ -141,7 +141,7 @@ void PairLJSDKKokkos::compute(int eflag_in, int vflag_in) template template KOKKOS_INLINE_FUNCTION -F_FLOAT PairLJSDKKokkos:: +F_FLOAT PairLJSPICAKokkos:: compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { (void) i; (void) j; @@ -167,19 +167,25 @@ compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, c const double r6inv = r2inv*r2inv*r2inv; return r6inv*(lj_1*r6inv - lj_2) * r2inv; + } else if (ljt == LJ12_5) { + + const F_FLOAT r5inv = r2inv*r2inv*sqrt(r2inv); + const F_FLOAT r7inv = r5inv*r2inv; + return r5inv*(lj_1*r7inv - lj_2) * r2inv; + } - if (ljt!=LJ12_4 && ljt!=LJ9_6 && ljt!=LJ12_6) return 0.0;*/ + if (ljt!=LJ12_4 && ljt!=LJ9_6 && ljt!=LJ12_6 && ljt!=LJ12_5) return 0.0;*/ const F_FLOAT r4inv=r2inv*r2inv; const F_FLOAT r6inv=r2inv*r4inv; - const F_FLOAT a = ljt==LJ12_4?r4inv:r6inv; - const F_FLOAT b = ljt==LJ12_4?r4inv:(ljt==LJ9_6?1.0/sqrt(r2inv):r2inv); + const F_FLOAT a = ljt==LJ12_4?r4inv:(ljt==LJ12_5?r4inv*sqrt(r2inv):r6inv); + const F_FLOAT b = ljt==LJ12_4?r4inv:(ljt==LJ9_6?1.0/sqrt(r2inv):(ljt==LJ12_5?r2inv*sqrt(r2inv):r2inv)); return a* ( lj_1*r6inv*b - lj_2 * r2inv); } template template KOKKOS_INLINE_FUNCTION -F_FLOAT PairLJSDKKokkos:: +F_FLOAT PairLJSPICAKokkos:: compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { (void) i; (void) j; @@ -203,6 +209,11 @@ compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, c } else if (ljt == LJ12_6) { const double r6inv = r2inv*r2inv*r2inv; return r6inv*(lj_3*r6inv - lj_4) - offset; + + } else if (ljt == LJ12_5) { + const F_FLOAT r5inv = r2inv*r2inv*sqrt(r2inv); + const F_FLOAT r7inv = r5inv*r2inv; + return r5inv*(lj_3*r7inv - lj_4) - offset; } else return 0.0; } @@ -212,15 +223,15 @@ compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, c ------------------------------------------------------------------------- */ template -void PairLJSDKKokkos::allocate() +void PairLJSPICAKokkos::allocate() { - PairLJSDK::allocate(); + PairLJSPICA::allocate(); int n = atom->ntypes; memory->destroy(cutsq); memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); - k_params = Kokkos::DualView("PairLJSDK::params",n+1,n+1); + k_params = Kokkos::DualView("PairLJSPICA::params",n+1,n+1); params = k_params.template view(); } @@ -229,11 +240,11 @@ void PairLJSDKKokkos::allocate() ------------------------------------------------------------------------- */ template -void PairLJSDKKokkos::settings(int narg, char **arg) +void PairLJSPICAKokkos::settings(int narg, char **arg) { if (narg > 2) error->all(FLERR,"Illegal pair_style command"); - PairLJSDK::settings(1,arg); + PairLJSPICA::settings(1,arg); } /* ---------------------------------------------------------------------- @@ -241,9 +252,9 @@ void PairLJSDKKokkos::settings(int narg, char **arg) ------------------------------------------------------------------------- */ template -void PairLJSDKKokkos::init_style() +void PairLJSPICAKokkos::init_style() { - PairLJSDK::init_style(); + PairLJSPICA::init_style(); // error if rRESPA with inner levels @@ -270,9 +281,9 @@ void PairLJSDKKokkos::init_style() ------------------------------------------------------------------------- */ template -double PairLJSDKKokkos::init_one(int i, int j) +double PairLJSPICAKokkos::init_one(int i, int j) { - double cutone = PairLJSDK::init_one(i,j); + double cutone = PairLJSPICA::init_one(i,j); k_params.h_view(i,j).lj1 = lj1[i][j]; k_params.h_view(i,j).lj2 = lj2[i][j]; @@ -297,9 +308,9 @@ double PairLJSDKKokkos::init_one(int i, int j) namespace LAMMPS_NS { -template class PairLJSDKKokkos; +template class PairLJSPICAKokkos; #ifdef LMP_KOKKOS_GPU -template class PairLJSDKKokkos; +template class PairLJSPICAKokkos; #endif } diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.h b/src/KOKKOS/pair_lj_spica_kokkos.h similarity index 65% rename from src/KOKKOS/pair_lj_sdk_kokkos.h rename to src/KOKKOS/pair_lj_spica_kokkos.h index edc42c7f6a..ba6c996df4 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.h +++ b/src/KOKKOS/pair_lj_spica_kokkos.h @@ -13,31 +13,34 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(lj/sdk/kk,PairLJSDKKokkos); -PairStyle(lj/sdk/kk/device,PairLJSDKKokkos); -PairStyle(lj/sdk/kk/host,PairLJSDKKokkos); +PairStyle(lj/spica/kk,PairLJSPICAKokkos); +PairStyle(lj/spica/kk/device,PairLJSPICAKokkos); +PairStyle(lj/spica/kk/host,PairLJSPICAKokkos); +PairStyle(lj/sdk/kk,PairLJSPICAKokkos); +PairStyle(lj/sdk/kk/device,PairLJSPICAKokkos); +PairStyle(lj/sdk/kk/host,PairLJSPICAKokkos); // clang-format on #else // clang-format off -#ifndef LMP_PAIR_LJ_SDK_KOKKOS_H -#define LMP_PAIR_LJ_SDK_KOKKOS_H +#ifndef LMP_PAIR_LJ_SPICA_KOKKOS_H +#define LMP_PAIR_LJ_SPICA_KOKKOS_H #include "pair_kokkos.h" -#include "pair_lj_sdk.h" +#include "pair_lj_spica.h" #include "neigh_list_kokkos.h" namespace LAMMPS_NS { template -class PairLJSDKKokkos : public PairLJSDK { +class PairLJSPICAKokkos : public PairLJSPICA { public: enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; typedef DeviceType device_type; typedef ArrayTypes AT; - PairLJSDKKokkos(class LAMMPS *); - ~PairLJSDKKokkos() override; + PairLJSPICAKokkos(class LAMMPS *); + ~PairLJSPICAKokkos() override; void compute(int, int) override; @@ -95,17 +98,17 @@ class PairLJSDKKokkos : public PairLJSDK { int nlocal,nall,eflag,vflag; void allocate() override; - friend struct PairComputeFunctor; - friend struct PairComputeFunctor; - friend struct PairComputeFunctor; - friend struct PairComputeFunctor; - friend struct PairComputeFunctor; - friend struct PairComputeFunctor; - friend EV_FLOAT pair_compute_neighlist(PairLJSDKKokkos*,NeighListKokkos*); - friend EV_FLOAT pair_compute_neighlist(PairLJSDKKokkos*,NeighListKokkos*); - friend EV_FLOAT pair_compute_neighlist(PairLJSDKKokkos*,NeighListKokkos*); - friend EV_FLOAT pair_compute(PairLJSDKKokkos*,NeighListKokkos*); - friend void pair_virial_fdotr_compute(PairLJSDKKokkos*); + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend EV_FLOAT pair_compute_neighlist(PairLJSPICAKokkos*,NeighListKokkos*); + friend EV_FLOAT pair_compute_neighlist(PairLJSPICAKokkos*,NeighListKokkos*); + friend EV_FLOAT pair_compute_neighlist(PairLJSPICAKokkos*,NeighListKokkos*); + friend EV_FLOAT pair_compute(PairLJSPICAKokkos*,NeighListKokkos*); + friend void pair_virial_fdotr_compute(PairLJSPICAKokkos*); }; } From 07633622e66269741af662a9179d24fdfe36694e Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Fri, 8 Jul 2022 18:18:39 +0900 Subject: [PATCH 09/15] changed file names and added a lj12-5 function type in OPENMP pkg. --- ...{angle_sdk_omp.cpp => angle_spica_omp.cpp} | 21 ++++++++++----- .../{angle_sdk_omp.h => angle_spica_omp.h} | 13 ++++----- ...mp.cpp => pair_lj_spica_coul_long_omp.cpp} | 27 ++++++++++++------- ...ng_omp.h => pair_lj_spica_coul_long_omp.h} | 13 ++++----- ...omp.cpp => pair_lj_spica_coul_msm_omp.cpp} | 27 ++++++++++++------- ...msm_omp.h => pair_lj_spica_coul_msm_omp.h} | 13 ++++----- ...r_lj_sdk_omp.cpp => pair_lj_spica_omp.cpp} | 27 ++++++++++++------- ...{pair_lj_sdk_omp.h => pair_lj_spica_omp.h} | 13 ++++----- src/OPENMP/thr_omp.cpp | 2 +- 9 files changed, 97 insertions(+), 59 deletions(-) rename src/OPENMP/{angle_sdk_omp.cpp => angle_spica_omp.cpp} (91%) rename src/OPENMP/{angle_sdk_omp.h => angle_spica_omp.h} (82%) rename src/OPENMP/{pair_lj_sdk_coul_long_omp.cpp => pair_lj_spica_coul_long_omp.cpp} (89%) rename src/OPENMP/{pair_lj_sdk_coul_long_omp.h => pair_lj_spica_coul_long_omp.h} (77%) rename src/OPENMP/{pair_lj_sdk_coul_msm_omp.cpp => pair_lj_spica_coul_msm_omp.cpp} (89%) rename src/OPENMP/{pair_lj_sdk_coul_msm_omp.h => pair_lj_spica_coul_msm_omp.h} (77%) rename src/OPENMP/{pair_lj_sdk_omp.cpp => pair_lj_spica_omp.cpp} (87%) rename src/OPENMP/{pair_lj_sdk_omp.h => pair_lj_spica_omp.h} (81%) diff --git a/src/OPENMP/angle_sdk_omp.cpp b/src/OPENMP/angle_spica_omp.cpp similarity index 91% rename from src/OPENMP/angle_sdk_omp.cpp rename to src/OPENMP/angle_spica_omp.cpp index e82121959b..f6198eab50 100644 --- a/src/OPENMP/angle_sdk_omp.cpp +++ b/src/OPENMP/angle_spica_omp.cpp @@ -17,32 +17,32 @@ ------------------------------------------------------------------------- */ #include "omp_compat.h" -#include "angle_sdk_omp.h" +#include "angle_spica_omp.h" #include #include "atom.h" #include "neighbor.h" #include "comm.h" #include "force.h" -#include "lj_sdk_common.h" +#include "lj_spica_common.h" #include "suffix.h" using namespace LAMMPS_NS; -using namespace LJSDKParms; +using namespace LJSPICAParms; #define SMALL 0.001 /* ---------------------------------------------------------------------- */ -AngleSDKOMP::AngleSDKOMP(class LAMMPS *lmp) - : AngleSDK(lmp), ThrOMP(lmp,THR_ANGLE) +AngleSPICAOMP::AngleSPICAOMP(class LAMMPS *lmp) + : AngleSPICA(lmp), ThrOMP(lmp,THR_ANGLE) { suffix_flag |= Suffix::OMP; } /* ---------------------------------------------------------------------- */ -void AngleSDKOMP::compute(int eflag, int vflag) +void AngleSPICAOMP::compute(int eflag, int vflag) { ev_init(eflag,vflag); @@ -81,7 +81,7 @@ void AngleSDKOMP::compute(int eflag, int vflag) } template -void AngleSDKOMP::eval(int nfrom, int nto, ThrData * const thr) +void AngleSPICAOMP::eval(int nfrom, int nto, ThrData * const thr) { int i1,i2,i3,n,type; double delx1,dely1,delz1,delx2,dely2,delz2,delx3,dely3,delz3; @@ -171,6 +171,13 @@ void AngleSDKOMP::eval(int nfrom, int nto, ThrData * const thr) f13 = r6inv*(lj1[type1][type3]*r6inv - lj2[type1][type3]); if (EFLAG) e13 = r6inv*(lj3[type1][type3]*r6inv - lj4[type1][type3]); + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv*r2inv*sqrt(r2inv); + const double r7inv = r5inv*r2inv; + + f13 = r5inv*(lj1[type1][type3]*r7inv - lj2[type1][type3]); + if (EFLAG) e13 = r5inv*(lj3[type1][type3]*r7inv - lj4[type1][type3]); } // make sure energy is 0.0 at the cutoff. diff --git a/src/OPENMP/angle_sdk_omp.h b/src/OPENMP/angle_spica_omp.h similarity index 82% rename from src/OPENMP/angle_sdk_omp.h rename to src/OPENMP/angle_spica_omp.h index c4d12787f9..a6186c3f5e 100644 --- a/src/OPENMP/angle_sdk_omp.h +++ b/src/OPENMP/angle_spica_omp.h @@ -17,22 +17,23 @@ #ifdef ANGLE_CLASS // clang-format off -AngleStyle(sdk/omp,AngleSDKOMP); +AngleStyle(spica/omp,AngleSPICAOMP); +AngleStyle(sdk/omp,AngleSPICAOMP); // clang-format on #else -#ifndef LMP_ANGLE_SDK_OMP_H -#define LMP_ANGLE_SDK_OMP_H +#ifndef LMP_ANGLE_SPICA_OMP_H +#define LMP_ANGLE_SPICA_OMP_H -#include "angle_sdk.h" +#include "angle_spica.h" #include "thr_omp.h" namespace LAMMPS_NS { -class AngleSDKOMP : public AngleSDK, public ThrOMP { +class AngleSPICAOMP : public AngleSPICA, public ThrOMP { public: - AngleSDKOMP(class LAMMPS *lmp); + AngleSPICAOMP(class LAMMPS *lmp); void compute(int, int) override; private: diff --git a/src/OPENMP/pair_lj_sdk_coul_long_omp.cpp b/src/OPENMP/pair_lj_spica_coul_long_omp.cpp similarity index 89% rename from src/OPENMP/pair_lj_sdk_coul_long_omp.cpp rename to src/OPENMP/pair_lj_spica_coul_long_omp.cpp index fff5d17b13..a0c90d872c 100644 --- a/src/OPENMP/pair_lj_sdk_coul_long_omp.cpp +++ b/src/OPENMP/pair_lj_spica_coul_long_omp.cpp @@ -13,8 +13,8 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "pair_lj_sdk_coul_long_omp.h" -#include "lj_sdk_common.h" +#include "pair_lj_spica_coul_long_omp.h" +#include "lj_spica_common.h" #include "atom.h" #include "comm.h" @@ -26,11 +26,11 @@ #include "omp_compat.h" using namespace LAMMPS_NS; -using namespace LJSDKParms; +using namespace LJSPICAParms; /* ---------------------------------------------------------------------- */ -PairLJSDKCoulLongOMP::PairLJSDKCoulLongOMP(LAMMPS *lmp) : - PairLJSDKCoulLong(lmp), ThrOMP(lmp, THR_PAIR) +PairLJSPICACoulLongOMP::PairLJSPICACoulLongOMP(LAMMPS *lmp) : + PairLJSPICACoulLong(lmp), ThrOMP(lmp, THR_PAIR) { suffix_flag |= Suffix::OMP; respa_enable = 0; @@ -38,7 +38,7 @@ PairLJSDKCoulLongOMP::PairLJSDKCoulLongOMP(LAMMPS *lmp) : /* ---------------------------------------------------------------------- */ -void PairLJSDKCoulLongOMP::compute(int eflag, int vflag) +void PairLJSPICACoulLongOMP::compute(int eflag, int vflag) { ev_init(eflag,vflag); @@ -78,7 +78,7 @@ void PairLJSDKCoulLongOMP::compute(int eflag, int vflag) /* ---------------------------------------------------------------------- */ template -void PairLJSDKCoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr) +void PairLJSPICACoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr) { const auto * _noalias const x = (dbl3_t *) atom->x[0]; @@ -195,6 +195,15 @@ void PairLJSDKCoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr) if (EFLAG) evdwl = r6inv*(lj3[itype][jtype]*r6inv - lj4[itype][jtype]) - offset[itype][jtype]; + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv*r2inv*sqrt(r2inv); + const double r7inv = r5inv*r2inv; + forcelj = r5inv*(lj1[itype][jtype]*r7inv + - lj2[itype][jtype]); + if (EFLAG) + evdwl = r5inv*(lj3[itype][jtype]*r7inv + - lj4[itype][jtype]) - offset[itype][jtype]; } if (sbindex) { @@ -228,10 +237,10 @@ void PairLJSDKCoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr) /* ---------------------------------------------------------------------- */ -double PairLJSDKCoulLongOMP::memory_usage() +double PairLJSPICACoulLongOMP::memory_usage() { double bytes = memory_usage_thr(); - bytes += PairLJSDKCoulLong::memory_usage(); + bytes += PairLJSPICACoulLong::memory_usage(); return bytes; } diff --git a/src/OPENMP/pair_lj_sdk_coul_long_omp.h b/src/OPENMP/pair_lj_spica_coul_long_omp.h similarity index 77% rename from src/OPENMP/pair_lj_sdk_coul_long_omp.h rename to src/OPENMP/pair_lj_spica_coul_long_omp.h index d19139de26..0cc7c588cd 100644 --- a/src/OPENMP/pair_lj_sdk_coul_long_omp.h +++ b/src/OPENMP/pair_lj_spica_coul_long_omp.h @@ -17,22 +17,23 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(lj/sdk/coul/long/omp,PairLJSDKCoulLongOMP); +PairStyle(lj/spica/coul/long/omp,PairLJSPICACoulLongOMP); +PairStyle(lj/sdk/coul/long/omp,PairLJSPICACoulLongOMP); // clang-format on #else -#ifndef LMP_PAIR_LJ_SDK_COUL_LONG_OMP_H -#define LMP_PAIR_LJ_SDK_COUL_LONG_OMP_H +#ifndef LMP_PAIR_LJ_SPICA_COUL_LONG_OMP_H +#define LMP_PAIR_LJ_SPICA_COUL_LONG_OMP_H -#include "pair_lj_sdk_coul_long.h" +#include "pair_lj_spica_coul_long.h" #include "thr_omp.h" namespace LAMMPS_NS { -class PairLJSDKCoulLongOMP : public PairLJSDKCoulLong, public ThrOMP { +class PairLJSPICACoulLongOMP : public PairLJSPICACoulLong, public ThrOMP { public: - PairLJSDKCoulLongOMP(class LAMMPS *); + PairLJSPICACoulLongOMP(class LAMMPS *); void compute(int, int) override; double memory_usage() override; diff --git a/src/OPENMP/pair_lj_sdk_coul_msm_omp.cpp b/src/OPENMP/pair_lj_spica_coul_msm_omp.cpp similarity index 89% rename from src/OPENMP/pair_lj_sdk_coul_msm_omp.cpp rename to src/OPENMP/pair_lj_spica_coul_msm_omp.cpp index 53c058fba1..b353361abe 100644 --- a/src/OPENMP/pair_lj_sdk_coul_msm_omp.cpp +++ b/src/OPENMP/pair_lj_spica_coul_msm_omp.cpp @@ -14,8 +14,8 @@ This style is a simplified re-implementation of the CG/CMM pair style ------------------------------------------------------------------------- */ -#include "pair_lj_sdk_coul_msm_omp.h" -#include "lj_sdk_common.h" +#include "pair_lj_spica_coul_msm_omp.h" +#include "lj_spica_common.h" #include "atom.h" #include "comm.h" @@ -29,11 +29,11 @@ #include "omp_compat.h" using namespace LAMMPS_NS; -using namespace LJSDKParms; +using namespace LJSPICAParms; /* ---------------------------------------------------------------------- */ -PairLJSDKCoulMSMOMP::PairLJSDKCoulMSMOMP(LAMMPS *lmp) : - PairLJSDKCoulMSM(lmp), ThrOMP(lmp, THR_PAIR) +PairLJSPICACoulMSMOMP::PairLJSPICACoulMSMOMP(LAMMPS *lmp) : + PairLJSPICACoulMSM(lmp), ThrOMP(lmp, THR_PAIR) { suffix_flag |= Suffix::OMP; respa_enable = 0; @@ -41,7 +41,7 @@ PairLJSDKCoulMSMOMP::PairLJSDKCoulMSMOMP(LAMMPS *lmp) : /* ---------------------------------------------------------------------- */ -void PairLJSDKCoulMSMOMP::compute(int eflag, int vflag) +void PairLJSPICACoulMSMOMP::compute(int eflag, int vflag) { if (force->kspace->scalar_pressure_flag) error->all(FLERR,"Must use 'kspace_modify pressure/scalar no' " @@ -85,7 +85,7 @@ void PairLJSDKCoulMSMOMP::compute(int eflag, int vflag) /* ---------------------------------------------------------------------- */ template -void PairLJSDKCoulMSMOMP::eval_msm_thr(int iifrom, int iito, ThrData * const thr) +void PairLJSPICACoulMSMOMP::eval_msm_thr(int iifrom, int iito, ThrData * const thr) { const double * const * const x = atom->x; @@ -194,6 +194,15 @@ void PairLJSDKCoulMSMOMP::eval_msm_thr(int iifrom, int iito, ThrData * const thr if (EFLAG) evdwl = r6inv*(lj3[itype][jtype]*r6inv - lj4[itype][jtype]) - offset[itype][jtype]; + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv*r2inv*sqrt(r2inv); + const double r7inv = r5inv*r2inv; + forcelj = r5inv*(lj1[itype][jtype]*r7inv + - lj2[itype][jtype]); + if (EFLAG) + evdwl = r5inv*(lj3[itype][jtype]*r7inv + - lj4[itype][jtype]) - offset[itype][jtype]; } if (sbindex) { @@ -227,10 +236,10 @@ void PairLJSDKCoulMSMOMP::eval_msm_thr(int iifrom, int iito, ThrData * const thr /* ---------------------------------------------------------------------- */ -double PairLJSDKCoulMSMOMP::memory_usage() +double PairLJSPICACoulMSMOMP::memory_usage() { double bytes = memory_usage_thr(); - bytes += PairLJSDKCoulMSM::memory_usage(); + bytes += PairLJSPICACoulMSM::memory_usage(); return bytes; } diff --git a/src/OPENMP/pair_lj_sdk_coul_msm_omp.h b/src/OPENMP/pair_lj_spica_coul_msm_omp.h similarity index 77% rename from src/OPENMP/pair_lj_sdk_coul_msm_omp.h rename to src/OPENMP/pair_lj_spica_coul_msm_omp.h index 9bcde691d0..b84bf35db8 100644 --- a/src/OPENMP/pair_lj_sdk_coul_msm_omp.h +++ b/src/OPENMP/pair_lj_spica_coul_msm_omp.h @@ -17,22 +17,23 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(lj/sdk/coul/msm/omp,PairLJSDKCoulMSMOMP); +PairStyle(lj/spica/coul/msm/omp,PairLJSPICACoulMSMOMP); +PairStyle(lj/sdk/coul/msm/omp,PairLJSPICACoulMSMOMP); // clang-format on #else -#ifndef LMP_PAIR_LJ_SDK_COUL_MSM_OMP_H -#define LMP_PAIR_LJ_SDK_COUL_MSM_OMP_H +#ifndef LMP_PAIR_LJ_SPICA_COUL_MSM_OMP_H +#define LMP_PAIR_LJ_SPICA_COUL_MSM_OMP_H -#include "pair_lj_sdk_coul_msm.h" +#include "pair_lj_spica_coul_msm.h" #include "thr_omp.h" namespace LAMMPS_NS { -class PairLJSDKCoulMSMOMP : public PairLJSDKCoulMSM, public ThrOMP { +class PairLJSPICACoulMSMOMP : public PairLJSPICACoulMSM, public ThrOMP { public: - PairLJSDKCoulMSMOMP(class LAMMPS *); + PairLJSPICACoulMSMOMP(class LAMMPS *); void compute(int, int) override; double memory_usage() override; diff --git a/src/OPENMP/pair_lj_sdk_omp.cpp b/src/OPENMP/pair_lj_spica_omp.cpp similarity index 87% rename from src/OPENMP/pair_lj_sdk_omp.cpp rename to src/OPENMP/pair_lj_spica_omp.cpp index 909bb73fc8..054c5b7d44 100644 --- a/src/OPENMP/pair_lj_sdk_omp.cpp +++ b/src/OPENMP/pair_lj_spica_omp.cpp @@ -14,8 +14,8 @@ This style is a simplified re-implementation of the CG/CMM pair style ------------------------------------------------------------------------- */ -#include "pair_lj_sdk_omp.h" -#include "lj_sdk_common.h" +#include "pair_lj_spica_omp.h" +#include "lj_spica_common.h" #include "atom.h" #include "comm.h" @@ -27,12 +27,12 @@ #include "omp_compat.h" using namespace LAMMPS_NS; -using namespace LJSDKParms; +using namespace LJSPICAParms; /* ---------------------------------------------------------------------- */ -PairLJSDKOMP::PairLJSDKOMP(LAMMPS *lmp) : - PairLJSDK(lmp), ThrOMP(lmp, THR_PAIR) +PairLJSPICAOMP::PairLJSPICAOMP(LAMMPS *lmp) : + PairLJSPICA(lmp), ThrOMP(lmp, THR_PAIR) { suffix_flag |= Suffix::OMP; respa_enable = 0; @@ -40,7 +40,7 @@ PairLJSDKOMP::PairLJSDKOMP(LAMMPS *lmp) : /* ---------------------------------------------------------------------- */ -void PairLJSDKOMP::compute(int eflag, int vflag) +void PairLJSPICAOMP::compute(int eflag, int vflag) { ev_init(eflag,vflag); @@ -80,7 +80,7 @@ void PairLJSDKOMP::compute(int eflag, int vflag) /* ---------------------------------------------------------------------- */ template -void PairLJSDKOMP::eval_thr(int iifrom, int iito, ThrData * const thr) +void PairLJSPICAOMP::eval_thr(int iifrom, int iito, ThrData * const thr) { int i,j,ii,jj,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair; @@ -153,6 +153,15 @@ void PairLJSDKOMP::eval_thr(int iifrom, int iito, ThrData * const thr) if (EFLAG) evdwl = r6inv*(lj3[itype][jtype]*r6inv - lj4[itype][jtype]) - offset[itype][jtype]; + + } else if (ljt == LJ12_5) { + const double r5inv = r2inv*r2inv*sqrt(r2inv); + const double r7inv = r5inv*r2inv; + forcelj = r5inv*(lj1[itype][jtype]*r7inv + - lj2[itype][jtype]); + if (EFLAG) + evdwl = r5inv*(lj3[itype][jtype]*r7inv + - lj4[itype][jtype]) - offset[itype][jtype]; } else continue; fpair = factor_lj*forcelj*r2inv; @@ -179,10 +188,10 @@ void PairLJSDKOMP::eval_thr(int iifrom, int iito, ThrData * const thr) /* ---------------------------------------------------------------------- */ -double PairLJSDKOMP::memory_usage() +double PairLJSPICAOMP::memory_usage() { double bytes = memory_usage_thr(); - bytes += PairLJSDK::memory_usage(); + bytes += PairLJSPICA::memory_usage(); return bytes; } diff --git a/src/OPENMP/pair_lj_sdk_omp.h b/src/OPENMP/pair_lj_spica_omp.h similarity index 81% rename from src/OPENMP/pair_lj_sdk_omp.h rename to src/OPENMP/pair_lj_spica_omp.h index 1ef27f6fb6..34a5b357dd 100644 --- a/src/OPENMP/pair_lj_sdk_omp.h +++ b/src/OPENMP/pair_lj_spica_omp.h @@ -17,22 +17,23 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(lj/sdk/omp,PairLJSDKOMP); +PairStyle(lj/spica/omp,PairLJSPICAOMP); +PairStyle(lj/sdk/omp,PairLJSPICAOMP); // clang-format on #else -#ifndef LMP_PAIR_LJ_SDK_OMP_H -#define LMP_PAIR_LJ_SDK_OMP_H +#ifndef LMP_PAIR_LJ_SPICA_OMP_H +#define LMP_PAIR_LJ_SPICA_OMP_H -#include "pair_lj_sdk.h" +#include "pair_lj_spica.h" #include "thr_omp.h" namespace LAMMPS_NS { -class PairLJSDKOMP : public PairLJSDK, public ThrOMP { +class PairLJSPICAOMP : public PairLJSPICA, public ThrOMP { public: - PairLJSDKOMP(class LAMMPS *); + PairLJSPICAOMP(class LAMMPS *); void compute(int, int) override; double memory_usage() override; diff --git a/src/OPENMP/thr_omp.cpp b/src/OPENMP/thr_omp.cpp index 01f12ed17d..95392b17a4 100644 --- a/src/OPENMP/thr_omp.cpp +++ b/src/OPENMP/thr_omp.cpp @@ -1042,7 +1042,7 @@ void ThrOMP::ev_tally_thr(Angle * const angle, const int i, const int j, const i } /* ---------------------------------------------------------------------- - tally energy and virial from 1-3 repulsion of SDK angle into accumulators + tally energy and virial from 1-3 repulsion of SPICA angle into accumulators ------------------------------------------------------------------------- */ void ThrOMP::ev_tally13_thr(Angle * const angle, const int i1, const int i3, From b5e70ebc81b88c5ea850fdbb47df36fff1323cf7 Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Fri, 8 Jul 2022 18:23:10 +0900 Subject: [PATCH 10/15] added a FF name SPICA to tools/kate/lammps.xml and tools/moltemplate/README.txt --- tools/kate/lammps.xml | 7 +++++++ tools/moltemplate/README.txt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/kate/lammps.xml b/tools/kate/lammps.xml index 0d8ba0fda4..d97b5cc8d3 100644 --- a/tools/kate/lammps.xml +++ b/tools/kate/lammps.xml @@ -394,6 +394,8 @@ edip eff/cut gauss/cut + lj/spica + lj/spica/coul/long lj/sdk lj/sdk/coul/long lj/sf @@ -517,6 +519,10 @@ lj/gromacs/coul/gromacs/omp lj/gromacs/cuda lj/gromacs/omp + lj/spica/gpu + lj/spica/omp + lj/spica/coul/long/gpu + lj/spica/coul/long/omp lj/sdk/gpu lj/sdk/omp lj/sdk/coul/long/gpu @@ -596,6 +602,7 @@ table + spica sdk cosine/shift cosine/shift/exp diff --git a/tools/moltemplate/README.txt b/tools/moltemplate/README.txt index 97f68a85de..c33554b14d 100644 --- a/tools/moltemplate/README.txt +++ b/tools/moltemplate/README.txt @@ -9,7 +9,7 @@ cross-platform, text-based molecule and topology builder for LAMMPS. Moltemplate was originally conceived for building custom coarse-grained molecular models, but it has since been generalized for all-atom simulations as well. It currently supports the OPLS, COMPASS, AMBER(GAFF,GAFF2), -MARTINI, SDK, LOPLS(2015), and TraPPE(1998) force fields, and includes +MARTINI, SPICA(SDK), LOPLS(2015), and TraPPE(1998) force fields, and includes (New force fields and examples are added continually through user contributions). From 099992f9c2a2c91f1c588371c7bf26d8e1d817c8 Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Fri, 8 Jul 2022 18:41:50 +0900 Subject: [PATCH 11/15] changed file and style names for lj/spica in unittest/force-styles/tests. --- .../tests/{mol-pair-lj_sdk.yaml => mol-pair-lj_spica.yaml} | 4 ++-- ...lj_sdk_coul_long.yaml => mol-pair-lj_spica_coul_long.yaml} | 4 ++-- ...r-lj_sdk_coul_msm.yaml => mol-pair-lj_spica_coul_msm.yaml} | 4 ++-- ...l_msm_table.yaml => mol-pair-lj_spica_coul_msm_table.yaml} | 4 ++-- ..._sdk_coul_table.yaml => mol-pair-lj_spica_coul_table.yaml} | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) rename unittest/force-styles/tests/{mol-pair-lj_sdk.yaml => mol-pair-lj_spica.yaml} (99%) rename unittest/force-styles/tests/{mol-pair-lj_sdk_coul_long.yaml => mol-pair-lj_spica_coul_long.yaml} (98%) rename unittest/force-styles/tests/{mol-pair-lj_sdk_coul_msm.yaml => mol-pair-lj_spica_coul_msm.yaml} (98%) rename unittest/force-styles/tests/{mol-pair-lj_sdk_coul_msm_table.yaml => mol-pair-lj_spica_coul_msm_table.yaml} (98%) rename unittest/force-styles/tests/{mol-pair-lj_sdk_coul_table.yaml => mol-pair-lj_spica_coul_table.yaml} (98%) diff --git a/unittest/force-styles/tests/mol-pair-lj_sdk.yaml b/unittest/force-styles/tests/mol-pair-lj_spica.yaml similarity index 99% rename from unittest/force-styles/tests/mol-pair-lj_sdk.yaml rename to unittest/force-styles/tests/mol-pair-lj_spica.yaml index 74f8b1d80d..10d0602934 100644 --- a/unittest/force-styles/tests/mol-pair-lj_sdk.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_spica.yaml @@ -5,12 +5,12 @@ epsilon: 5e-14 skip_tests: prerequisites: ! | atom full - pair lj/sdk + pair lj/spica pre_commands: ! | variable write_data_pair index ij post_commands: ! "" input_file: in.fourmol -pair_style: lj/sdk 8.0 +pair_style: lj/spica 8.0 pair_coeff: ! | 1 1 lj9_6 0.02 2.5 1 2 lj9_6 0.01 1.58114 diff --git a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_long.yaml b/unittest/force-styles/tests/mol-pair-lj_spica_coul_long.yaml similarity index 98% rename from unittest/force-styles/tests/mol-pair-lj_sdk_coul_long.yaml rename to unittest/force-styles/tests/mol-pair-lj_spica_coul_long.yaml index 8decb35c5b..7f03b7b063 100644 --- a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_long.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_spica_coul_long.yaml @@ -5,7 +5,7 @@ epsilon: 5e-14 skip_tests: prerequisites: ! | atom full - pair lj/sdk/coul/long + pair lj/spica/coul/long kspace ewald pre_commands: ! | variable write_data_pair index ij @@ -15,7 +15,7 @@ post_commands: ! | kspace_modify gewald 0.3 kspace_modify compute no input_file: in.fourmol -pair_style: lj/sdk/coul/long 8.0 +pair_style: lj/spica/coul/long 8.0 pair_coeff: ! | 1 1 lj9_6 0.02 2.5 1 2 lj9_6 0.01 1.58114 diff --git a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm.yaml b/unittest/force-styles/tests/mol-pair-lj_spica_coul_msm.yaml similarity index 98% rename from unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm.yaml rename to unittest/force-styles/tests/mol-pair-lj_spica_coul_msm.yaml index e0e0629d10..64ec316de4 100644 --- a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_spica_coul_msm.yaml @@ -5,7 +5,7 @@ epsilon: 5e-14 skip_tests: prerequisites: ! | atom full - pair lj/sdk/coul/long + pair lj/spica/coul/long kspace ewald pre_commands: ! | variable write_data_pair index ij @@ -16,7 +16,7 @@ post_commands: ! | kspace_modify cutoff/adjust no kspace_modify pressure/scalar no # required for OPENMP with msm input_file: in.fourmol -pair_style: lj/sdk/coul/msm 12.0 +pair_style: lj/spica/coul/msm 12.0 pair_coeff: ! | 1 1 lj9_6 0.02 2.5 1 2 lj9_6 0.01 1.58114 diff --git a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm_table.yaml b/unittest/force-styles/tests/mol-pair-lj_spica_coul_msm_table.yaml similarity index 98% rename from unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm_table.yaml rename to unittest/force-styles/tests/mol-pair-lj_spica_coul_msm_table.yaml index 035838fc1d..e7448e8337 100644 --- a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_msm_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_spica_coul_msm_table.yaml @@ -5,7 +5,7 @@ epsilon: 5e-14 skip_tests: gpu prerequisites: ! | atom full - pair lj/sdk/coul/long + pair lj/spica/coul/long kspace ewald pre_commands: ! | variable write_data_pair index ij @@ -16,7 +16,7 @@ post_commands: ! | kspace_modify cutoff/adjust no kspace_modify pressure/scalar no # required for OPENMP with msm input_file: in.fourmol -pair_style: lj/sdk/coul/msm 12.0 +pair_style: lj/spica/coul/msm 12.0 pair_coeff: ! | 1 1 lj9_6 0.02 2.5 1 2 lj9_6 0.01 1.58114 diff --git a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_table.yaml b/unittest/force-styles/tests/mol-pair-lj_spica_coul_table.yaml similarity index 98% rename from unittest/force-styles/tests/mol-pair-lj_sdk_coul_table.yaml rename to unittest/force-styles/tests/mol-pair-lj_spica_coul_table.yaml index 108460d616..3d1468b16c 100644 --- a/unittest/force-styles/tests/mol-pair-lj_sdk_coul_table.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_spica_coul_table.yaml @@ -5,7 +5,7 @@ epsilon: 5e-14 skip_tests: gpu prerequisites: ! | atom full - pair lj/sdk/coul/long + pair lj/spica/coul/long kspace ewald pre_commands: ! | variable write_data_pair index ij @@ -15,7 +15,7 @@ post_commands: ! | kspace_modify gewald 0.3 kspace_modify compute no input_file: in.fourmol -pair_style: lj/sdk/coul/long 8.0 +pair_style: lj/spica/coul/long 8.0 pair_coeff: ! | 1 1 lj9_6 0.02 2.5 1 2 lj9_6 0.01 1.58114 From ec45c57181afc032879e0fb1cd4965f30e613aeb Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Fri, 8 Jul 2022 22:00:34 +0900 Subject: [PATCH 12/15] changed reference paper info. --- src/CG-SPICA/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CG-SPICA/README b/src/CG-SPICA/README index 621ee18a39..cbef4ef2c9 100644 --- a/src/CG-SPICA/README +++ b/src/CG-SPICA/README @@ -11,9 +11,9 @@ parametrization of the SPICA (formerly called SDK) and the pSPICA force fields, to simulate biological or soft material systems. For details about the force fields using this implementation, see the following papers: - SDK - Shinoda, DeVane, Klein, Mol Sim, 33, 27 (2007). - SPICA - Seo, Shinoda, J Chem Theory Comput, 15, 762 (2019). - pSPICA - Miyazaki, Okazaki, Shinoda, J Chem Theory Comput, 16, 782 (2020). + SDK - Shinoda, DeVane, Klein, Mol Sim, 33, 27-36 (2007). + SPICA - Seo, Shinoda, J Chem Theory Comput, 15, 762-774 (2019). + pSPICA - Miyazaki, Okazaki, Shinoda, J Chem Theory Comput, 16, 782-793 (2020). Summary information on these force fields can be found at this web site: https://www.spica-ff.org From aa11935e88d0776e71bfae8fb4055a4711ce5ff9 Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Mon, 11 Jul 2022 11:38:31 +0900 Subject: [PATCH 13/15] updated .gitignore and Purge.list, and author info, and added URL to the SPICA web. --- doc/src/Packages_details.rst | 5 ++++- doc/src/pair_spica.rst | 1 + src/.gitignore | 18 +++++++++--------- src/CG-SPICA/README | 11 ++++------- src/Purge.list | 24 ++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 17 deletions(-) diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index 24a8cc11b9..d1b69740ce 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -376,7 +376,9 @@ Several pair styles and an angle style which implement the coarse-grained SPICA (formerly called SDK) model which enables simulation of biological or soft material systems. -**Author:** Axel Kohlmeyer (Temple U). +**Original Author:** Axel Kohlmeyer (Temple U). + +**Maintainers:** Yusuke Miyazaki and Wataru Shinoda (Okayama U). **Supporting info:** @@ -386,6 +388,7 @@ simulation of biological or soft material systems. * :doc:`angle_style spica ` * examples/PACKAGES/cgspica * https://www.lammps.org/pictures.html#cg +* https://www.spica-ff.org/ ---------- diff --git a/doc/src/pair_spica.rst b/doc/src/pair_spica.rst index 9bd6ee069c..eac44ad0f2 100644 --- a/doc/src/pair_spica.rst +++ b/doc/src/pair_spica.rst @@ -82,6 +82,7 @@ given by as required for the SPICA (formerly called SDK) and the pSPICA Coarse-grained MD parameterization discussed in :ref:`(Shinoda) `, :ref:`(DeVane) `, :ref:`(Seo) `, and :ref:`(Miyazaki) `. Rc is the cutoff. +Summary information on these force fields can be found at https://www.spica-ff.org Style *lj/spica/coul/long* computes the adds Coulombic interactions with an additional damping factor applied so it can be used in diff --git a/src/.gitignore b/src/.gitignore index 4c1cf49b3b..b783a07892 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -409,8 +409,8 @@ /angle_mm3.h /angle_quartic.cpp /angle_quartic.h -/angle_sdk.cpp -/angle_sdk.h +/angle_spica.cpp +/angle_spica.h /angle_table.cpp /angle_table.h /atom_vec_angle.cpp @@ -990,7 +990,7 @@ /improper_umbrella.h /interlayer_taper.h /kissfft.h -/lj_sdk_common.h +/lj_spica_common.h /math_complex.h /math_vector.h /message.cpp @@ -1218,12 +1218,12 @@ /pair_lj_long_tip4p_long.h /pair_lj_cut_tgpu.cpp /pair_lj_cut_tgpu.h -/pair_lj_sdk.cpp -/pair_lj_sdk.h -/pair_lj_sdk_coul_long.cpp -/pair_lj_sdk_coul_long.h -/pair_lj_sdk_coul_msm.cpp -/pair_lj_sdk_coul_msm.h +/pair_lj_spica.cpp +/pair_lj_spica.h +/pair_lj_spica_coul_long.cpp +/pair_lj_spica_coul_long.h +/pair_lj_spica_coul_msm.cpp +/pair_lj_spica_coul_msm.h /pair_lj_sf_dipole_sf.cpp /pair_lj_sf_dipole_sf.h /pair_lj_switch3_coulgauss_long.cpp diff --git a/src/CG-SPICA/README b/src/CG-SPICA/README index cbef4ef2c9..1ba2274e57 100644 --- a/src/CG-SPICA/README +++ b/src/CG-SPICA/README @@ -38,18 +38,15 @@ style, since the number of charged atom types is usually small. To exploit this property, the use of the kspace_style pppm/cg is recommended over regular pppm. -The person who created this package is Axel Kohlmeyer at Temple U -(akohlmey at gmail.com). Contact him directly if you have questions. - -The person who added a new function type (LJ12_5) to this package is -Yusuke Miyazaki at Okayama U (ymiyazaki93 at gmail.com). Contact him -if you have questions about his code. +Original Author: Axel Kohlmeyer (akohlmey at gmail.com) at Temple U . +Maintainers : Yusuke Miyazaki (ymiyazaki93 at gmail.com) and + Wataru Shinoda (shinoda at okayama-u.ac.jp) at Okayama U. +Contact them if you have questions about his code. --------------------------------- Thanks for contributions, support and testing goes to -Wataru Shinoda (Okayama University) Russell DeVane (Procter & Gamble) Michael L. Klein (Temple University, Philadelphia) Balasubramanian Sundaram (JNCASR, Bangalore) diff --git a/src/Purge.list b/src/Purge.list index a2fa9f1165..5b838be535 100644 --- a/src/Purge.list +++ b/src/Purge.list @@ -51,6 +51,30 @@ lmpinstalledpkgs.h lmpgitversion.h mliap_model_python_couple.cpp mliap_model_python_couple.h +# renamed on 11 July 2022 +lj_sdk_common.h +angle_sdk.cpp +pair_lj_sdk.cpp +pair_lj_sdk_coul_msm.cpp +pair_lj_sdk_coul_long.h +pair_lj_sdk_coul_msm.h +angle_sdk.h +pair_lj_sdk.h +pair_lj_sdk_coul_long.cpp +pair_lj_sdk_kokkos.h +pair_lj_sdk_kokkos.cpp +pair_lj_sdk_gpu.cpp +pair_lj_sdk_gpu.h +pair_lj_sdk_coul_long_gpu.cpp +pair_lj_sdk_coul_long_gpu.h +pair_lj_sdk_omp.h +pair_lj_sdk_coul_msm_omp.cpp +pair_lj_sdk_coul_long_omp.h +angle_sdk_omp.cpp +pair_lj_sdk_omp.cpp +pair_lj_sdk_coul_msm_omp.h +pair_lj_sdk_coul_long_omp.cpp +angle_sdk_omp.h # removed on 8 April 2022 fix_client_md.cpp fix_client_md.h From 35afe94ec1a13231b695adece214d1500da9f00d Mon Sep 17 00:00:00 2001 From: yskmiyazaki Date: Mon, 11 Jul 2022 11:52:45 +0900 Subject: [PATCH 14/15] fixed a line in CG-SPICA/README --- src/CG-SPICA/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CG-SPICA/README b/src/CG-SPICA/README index 1ba2274e57..50f56ce5e8 100644 --- a/src/CG-SPICA/README +++ b/src/CG-SPICA/README @@ -41,7 +41,7 @@ recommended over regular pppm. Original Author: Axel Kohlmeyer (akohlmey at gmail.com) at Temple U . Maintainers : Yusuke Miyazaki (ymiyazaki93 at gmail.com) and Wataru Shinoda (shinoda at okayama-u.ac.jp) at Okayama U. -Contact them if you have questions about his code. +Contact them if you have questions. --------------------------------- From 897d9de2ed1557c29e5a3b0fbf326a27cba222a6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 15 Jul 2022 12:16:15 -0400 Subject: [PATCH 15/15] whitespace --- doc/src/pair_spica.rst | 10 +++++----- src/CG-SPICA/README | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/src/pair_spica.rst b/doc/src/pair_spica.rst index eac44ad0f2..74a069d8a2 100644 --- a/doc/src/pair_spica.rst +++ b/doc/src/pair_spica.rst @@ -71,7 +71,7 @@ given by E = & \frac{3\sqrt{3}}{2} \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^4 \right] \qquad r < r_c \\ - E = & \frac{12}{7}\left(\frac{12}{5}\right)^{\left(\frac{5}{7}\right)} \epsilon + E = & \frac{12}{7}\left(\frac{12}{5}\right)^{\left(\frac{5}{7}\right)} \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^5 \right] \qquad r < r_c \\ @@ -79,8 +79,8 @@ given by \left(\frac{\sigma}{r}\right)^6 \right] \qquad r < r_c -as required for the SPICA (formerly called SDK) and the pSPICA Coarse-grained MD parameterization discussed in -:ref:`(Shinoda) `, :ref:`(DeVane) `, :ref:`(Seo) `, and :ref:`(Miyazaki) `. +as required for the SPICA (formerly called SDK) and the pSPICA Coarse-grained MD parameterization discussed in +:ref:`(Shinoda) `, :ref:`(DeVane) `, :ref:`(Seo) `, and :ref:`(Miyazaki) `. Rc is the cutoff. Summary information on these force fields can be found at https://www.spica-ff.org @@ -119,8 +119,8 @@ specified since a Coulombic cutoff cannot be specified for an individual I,J type pair. All type pairs use the same global Coulombic cutoff specified in the pair_style command. -The original implementation of the above styles are -style *lj/sdk*, *lj/sdk/coul/long*, and *lj/sdk/coul/msm*, +The original implementation of the above styles are +style *lj/sdk*, *lj/sdk/coul/long*, and *lj/sdk/coul/msm*, and available for backward compatibility. ---------- diff --git a/src/CG-SPICA/README b/src/CG-SPICA/README index 50f56ce5e8..8a84a735a8 100644 --- a/src/CG-SPICA/README +++ b/src/CG-SPICA/README @@ -38,9 +38,9 @@ style, since the number of charged atom types is usually small. To exploit this property, the use of the kspace_style pppm/cg is recommended over regular pppm. -Original Author: Axel Kohlmeyer (akohlmey at gmail.com) at Temple U . -Maintainers : Yusuke Miyazaki (ymiyazaki93 at gmail.com) and - Wataru Shinoda (shinoda at okayama-u.ac.jp) at Okayama U. +Original Author: Axel Kohlmeyer (akohlmey at gmail.com) at Temple U . +Maintainers : Yusuke Miyazaki (ymiyazaki93 at gmail.com) and + Wataru Shinoda (shinoda at okayama-u.ac.jp) at Okayama U. Contact them if you have questions. ---------------------------------