diff --git a/.github/workflows/check-vla.yml b/.github/workflows/check-vla.yml index 26f23cc33f..ab89018a3d 100644 --- a/.github/workflows/check-vla.yml +++ b/.github/workflows/check-vla.yml @@ -27,9 +27,9 @@ jobs: - name: Install extra packages run: | + sudo apt-get update sudo apt-get install -y ccache \ libeigen3-dev \ - libgsl-dev \ libcurl4-openssl-dev \ mold \ mpi-default-bin \ diff --git a/.github/workflows/compile-msvc.yml b/.github/workflows/compile-msvc.yml index 03af27788b..7560bc0549 100644 --- a/.github/workflows/compile-msvc.yml +++ b/.github/workflows/compile-msvc.yml @@ -11,6 +11,10 @@ on: workflow_dispatch: +concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{github.event_name == 'pull_request'}} + jobs: build: name: Windows Compilation Test diff --git a/.github/workflows/full-regression.yml b/.github/workflows/full-regression.yml index 73e1803bb6..a6b5353b9b 100644 --- a/.github/workflows/full-regression.yml +++ b/.github/workflows/full-regression.yml @@ -30,8 +30,9 @@ jobs: - name: Install extra packages run: | + sudo apt-get update sudo apt-get install -y ccache ninja-build libeigen3-dev \ - libgsl-dev libcurl4-openssl-dev python3-dev \ + libcurl4-openssl-dev python3-dev \ mpi-default-bin mpi-default-dev - name: Create Build Environment diff --git a/.github/workflows/quick-regression.yml b/.github/workflows/quick-regression.yml index 985177b2c1..88794bfa0a 100644 --- a/.github/workflows/quick-regression.yml +++ b/.github/workflows/quick-regression.yml @@ -8,6 +8,10 @@ on: workflow_dispatch: +concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{github.event_name == 'pull_request'}} + jobs: build: name: Build LAMMPS @@ -30,8 +34,9 @@ jobs: - name: Install extra packages run: | + sudo apt-get update sudo apt-get install -y ccache ninja-build libeigen3-dev \ - libgsl-dev libcurl4-openssl-dev python3-dev \ + libcurl4-openssl-dev python3-dev \ mpi-default-bin mpi-default-dev - name: Create Build Environment diff --git a/.github/workflows/style-check.yml b/.github/workflows/style-check.yml new file mode 100644 index 0000000000..7be2c4fc46 --- /dev/null +++ b/.github/workflows/style-check.yml @@ -0,0 +1,37 @@ +# GitHub action to run checks from tools/coding_standard +name: "Check for Programming Style Conformance" + +on: + push: + branches: + - develop + pull_request: + branches: + - develop + + workflow_dispatch: + +concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{github.event_name == 'pull_request'}} + +jobs: + build: + name: Programming Style Conformance + if: ${{ github.repository == 'lammps/lammps' }} + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Run Tests + working-directory: src + shell: bash + run: | + make check-whitespace + make check-permissions + make check-homepage + make check-errordocs diff --git a/.github/workflows/unittest-linux.yml b/.github/workflows/unittest-linux.yml index 366db25a99..ce98fcea35 100644 --- a/.github/workflows/unittest-linux.yml +++ b/.github/workflows/unittest-linux.yml @@ -11,6 +11,10 @@ on: workflow_dispatch: +concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{github.event_name == 'pull_request'}} + jobs: build: name: Linux Unit Test @@ -27,9 +31,9 @@ jobs: - name: Install extra packages run: | + sudo apt-get update sudo apt-get install -y ccache \ libeigen3-dev \ - libgsl-dev \ libcurl4-openssl-dev \ mold \ ninja-build \ diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index b0bc4b2727..0d478a9d6b 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -11,6 +11,10 @@ on: workflow_dispatch: +concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{github.event_name == 'pull_request'}} + jobs: build: name: MacOS Unit Test diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 9ec3996c64..a8a447e2d8 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -518,7 +518,7 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_STANDARD GREATER_EQUA PROPERTIES COMPILE_OPTIONS "-std=c++14") endif() -if(PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR BUILD_TOOLS) +if(PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR PKG_RHEO OR BUILD_TOOLS) enable_language(C) if (NOT USE_INTERNAL_LINALG) find_package(LAPACK) @@ -593,7 +593,7 @@ else() endif() foreach(PKG_WITH_INCL KSPACE PYTHON ML-IAP VORONOI COLVARS ML-HDNNP MDI MOLFILE NETCDF - PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM COMPRESS ML-PACE LEPTON RHEO EXTRA-COMMAND) + PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM COMPRESS ML-PACE LEPTON EXTRA-COMMAND) if(PKG_${PKG_WITH_INCL}) include(Packages/${PKG_WITH_INCL}) endif() diff --git a/cmake/Modules/Packages/KOKKOS.cmake b/cmake/Modules/Packages/KOKKOS.cmake index bf0a18d324..adb3abab6b 100644 --- a/cmake/Modules/Packages/KOKKOS.cmake +++ b/cmake/Modules/Packages/KOKKOS.cmake @@ -8,8 +8,24 @@ endif() ######################################################################## # consistency checks and Kokkos options/settings required by LAMMPS if(Kokkos_ENABLE_CUDA) - message(STATUS "KOKKOS: Enabling CUDA LAMBDA function support") - set(Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "" FORCE) + option(Kokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC "CUDA asynchronous malloc support" OFF) + mark_as_advanced(Kokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC) + if(Kokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC) + message(STATUS "KOKKOS: CUDA malloc async support enabled") + else() + message(STATUS "KOKKOS: CUDA malloc async support disabled") + endif() +endif() +if(Kokkos_ENABLE_HIP) + option(Kokkos_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS "Enable multiple kernel instantiations with HIP" ON) + mark_as_advanced(Kokkos_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS) + option(Kokkos_ENABLE_ROCTHRUST "Use RoCThrust library" ON) + mark_as_advanced(Kokkos_ENABLE_ROCTHRUST) + + if(Kokkos_ARCH_AMD_GFX942 OR Kokkos_ARCH_AMD_GFX940) + option(Kokkos_ENABLE_IMPL_HIP_UNIFIED_MEMORY "Enable unified memory with HIP" ON) + mark_as_advanced(Kokkos_ENABLE_IMPL_HIP_UNIFIED_MEMORY) + endif() endif() # Adding OpenMP compiler flags without the checks done for # BUILD_OMP can result in compile failures. Enforce consistency. @@ -18,6 +34,15 @@ if(Kokkos_ENABLE_OPENMP) message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP") endif() endif() + +if(Kokkos_ENABLE_SERIAL) + if(NOT (Kokkos_ENABLE_OPENMP OR Kokkos_ENABLE_THREADS OR + Kokkos_ENABLE_CUDA OR Kokkos_ENABLE_HIP OR Kokkos_ENABLE_SYCL + OR Kokkos_ENABLE_OPENMPTARGET)) + option(Kokkos_ENABLE_ATOMICS_BYPASS "Disable atomics for Kokkos Serial Backend" ON) + mark_as_advanced(Kokkos_ENABLE_ATOMICS_BYPASS) + endif() +endif() ######################################################################## option(EXTERNAL_KOKKOS "Build against external kokkos library" OFF) @@ -45,8 +70,8 @@ if(DOWNLOAD_KOKKOS) list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}") list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") include(ExternalProject) - set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/4.3.01.tar.gz" CACHE STRING "URL for KOKKOS tarball") - set(KOKKOS_MD5 "243de871b3dc2cf3990c1c404032df83" CACHE STRING "MD5 checksum of KOKKOS tarball") + set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/4.4.01.tar.gz" CACHE STRING "URL for KOKKOS tarball") + set(KOKKOS_MD5 "de6ee80d00b6212b02bfb7f1e71a8392" CACHE STRING "MD5 checksum of KOKKOS tarball") mark_as_advanced(KOKKOS_URL) mark_as_advanced(KOKKOS_MD5) GetFallbackURL(KOKKOS_URL KOKKOS_FALLBACK) @@ -71,7 +96,7 @@ if(DOWNLOAD_KOKKOS) add_dependencies(LAMMPS::KOKKOSCORE kokkos_build) add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build) elseif(EXTERNAL_KOKKOS) - find_package(Kokkos 4.3.01 REQUIRED CONFIG) + find_package(Kokkos 4.4.01 REQUIRED CONFIG) target_link_libraries(lammps PRIVATE Kokkos::kokkos) else() set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos) diff --git a/cmake/Modules/Packages/RHEO.cmake b/cmake/Modules/Packages/RHEO.cmake deleted file mode 100644 index 7639acd8bc..0000000000 --- a/cmake/Modules/Packages/RHEO.cmake +++ /dev/null @@ -1,2 +0,0 @@ -find_package(GSL 2.6 REQUIRED) -target_link_libraries(lammps PRIVATE GSL::gsl) diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 100ce13632..413744b078 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -67,6 +67,7 @@ set(WIN_PACKAGES REACTION REAXFF REPLICA + RHEO RIGID SHOCK SMTBQ diff --git a/cmake/presets/most.cmake b/cmake/presets/most.cmake index d01642f94d..05282eebdd 100644 --- a/cmake/presets/most.cmake +++ b/cmake/presets/most.cmake @@ -60,6 +60,7 @@ set(ALL_PACKAGES REACTION REAXFF REPLICA + RHEO RIGID SHOCK SPH diff --git a/cmake/presets/windows.cmake b/cmake/presets/windows.cmake index 403d40efa4..71241c559c 100644 --- a/cmake/presets/windows.cmake +++ b/cmake/presets/windows.cmake @@ -60,6 +60,7 @@ set(WIN_PACKAGES REACTION REAXFF REPLICA + RHEO RIGID SHOCK SMTBQ diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index ac7edc7678..8465bea829 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -2251,28 +2251,38 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to RHEO package ------------ -To build with this package you must have the `GNU Scientific Library -(GSL) ` installed in locations that -are accessible in your environment. The GSL library should be at least -version 2.7. +This package depends on the BPM package. .. tabs:: .. tab:: CMake build - If CMake cannot find the GSL library or include files, you can set: - .. code-block:: bash - -D GSL_ROOT_DIR=path # path to root of GSL installation + -D PKG_RHEO=yes # enable the package itself + -D PKG_BPM=yes # the RHEO package requires BPM + -D USE_INTERNAL_LINALG=value # prefer internal LAPACK if true + + Some features in the RHEO package are dependent on code in the BPM + package so the latter one *must* be enabled as well. + + The RHEO package also requires LAPACK (and BLAS) and CMake + can identify their locations and pass that info to the RHEO + build script. But on some systems this may cause problems when + linking or the dependency is not desired. By using the setting + ``-D USE_INTERNAL_LINALG=yes`` when running the CMake + configuration, you will select compiling and linking the bundled + linear algebra library and work around the limitations. .. tab:: Traditional make - LAMMPS will try to auto-detect the GSL compiler and linker flags - from the corresponding ``pkg-config`` file (``gsl.pc``), otherwise - you can edit the file ``lib/rheo/Makefile.lammps`` - to specify the paths and library names where indicated by comments. - This must be done **before** the package is installed. + The RHEO package requires LAPACK (and BLAS) which can be either + a system provided library or the bundled "linalg" library. This + is a subset of LAPACK translated to C++. For that, one of the + provided ``Makefile.lammps.`` files needs to be copied + to ``Makefile.lammps`` and edited as needed. The default file + uses the bundled "linalg" library, which can be built by + ``make lib-linalg args='-m serial'`` in the ``src`` folder. ---------- diff --git a/doc/src/Build_settings.rst b/doc/src/Build_settings.rst index 2787560be5..e4a53ddee7 100644 --- a/doc/src/Build_settings.rst +++ b/doc/src/Build_settings.rst @@ -229,8 +229,7 @@ can be used with the Intel or GNU compiler (see the ``FFT_LIB`` setting above). The NVIDIA Performance Libraries (NVPL) FFT library is optimized for NVIDIA -Grace Armv9.0 architecture. You can download it from -`https://docs.nvidia.com/nvpl/`_. +Grace Armv9.0 architecture. You can download it from https://docs.nvidia.com/nvpl/ The cuFFT and hipFFT FFT libraries are packaged with NVIDIA's CUDA and AMD's HIP installations, respectively. These FFT libraries require the diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index d9febcc289..232a209613 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -178,6 +178,7 @@ OPT. * :doc:`python/move ` * :doc:`qbmsst ` * :doc:`qeq/comb (o) ` + * :doc:`qeq/ctip ` * :doc:`qeq/dynamic ` * :doc:`qeq/fire ` * :doc:`qeq/point ` diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index dfed8f7485..a55c9568e3 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -59,6 +59,7 @@ OPT. * :doc:`comb (o) ` * :doc:`comb3 ` * :doc:`cosine/squared ` + * :doc:`coul/ctip ` * :doc:`coul/cut (gko) ` * :doc:`coul/cut/dielectric ` * :doc:`coul/cut/global (o) ` diff --git a/doc/src/Intro_authors.rst b/doc/src/Intro_authors.rst index 78c8506421..84470ba3a0 100644 --- a/doc/src/Intro_authors.rst +++ b/doc/src/Intro_authors.rst @@ -56,7 +56,7 @@ lammps.org". General questions about LAMMPS should be posted in the - SNL - jmgoff at sandia.gov - machine learned potentials, QEq solvers, Python - * - Megan McCarthy + * - Meg McCarthy - SNL - megmcca at sandia.gov - alloys, micro-structure, machine learned potentials @@ -67,7 +67,7 @@ lammps.org". General questions about LAMMPS should be posted in the * - `Trung Nguyen `_ - U Chicago - ndactrung at gmail.com - - soft matter, GPU package + - soft matter, GPU package, DIELECTRIC package, regression testing .. _rb: https://rbberger.github.io/ .. _gc: https://enthalpiste.fr/ diff --git a/doc/src/Run_windows.rst b/doc/src/Run_windows.rst index 0c0a07f4c7..8c2eac2bc6 100644 --- a/doc/src/Run_windows.rst +++ b/doc/src/Run_windows.rst @@ -3,71 +3,70 @@ Running LAMMPS on Windows To run a serial (non-MPI) executable, follow these steps: -* Get a command prompt by going to Start->Run... , - then typing "cmd". -* Move to the directory where you have your input script, +* Install a LAMMPS installer package from https://packages.lammps.org/windows.html +* Open the "Command Prompt" or "Terminal" app. +* Change to the directory where you have your input script, (e.g. by typing: cd "Documents"). -* At the command prompt, type "lmp -in in.file", where - in.file is the name of your LAMMPS input script. +* At the command prompt, type "lmp -in in.file.lmp", where + ``in.file.lmp`` is the name of your LAMMPS input script. Note that the serial executable includes support for multi-threading -parallelization from the styles in the OPENMP packages. To run with -4 threads, you can type this: +parallelization from the styles in the OPENMP and KOKKOS packages. +To run with 4 threads, you can type this: .. code-block:: bash - lmp -in in.lj -pk omp 4 -sf omp + lmp -in in.lj.lmp -pk omp 4 -sf omp + lmp -in in.lj.lmp -k on t 4 -sf kk + +Alternately, you can also install a package with LAMMPS-GUI included and +open the LAMMPS-GUI app (the package includes the command line version +of LAMMPS as well) and open the input file in the GUI and run it from +there. For details on LAMMPS-GUI, see :doc:`Howto_lammps_gui`. ---------- -For the MPI executable, which allows you to run LAMMPS under Windows -in parallel, follow these steps. +For the MS-MPI executables, which allow you to run LAMMPS under Windows +in parallel using MPI rather than multi-threading, follow these steps. -Download and install a compatible MPI library binary package: - -* for 32-bit Windows: `mpich2-1.4.1p1-win-ia32.msi `_ -* for 64-bit Windows: `mpich2-1.4.1p1-win-x86-64.msi `_ - -The LAMMPS Windows installer packages will automatically adjust your -path for the default location of this MPI package. After the -installation of the MPICH2 software, it needs to be integrated into -the system. For this you need to start a Command Prompt in -*Administrator Mode* (right click on the icon and select it). Change -into the MPICH2 installation directory, then into the subdirectory -**bin** and execute **smpd.exe -install**\ . Exit the command window. - -* Get a new, regular command prompt by going to Start->Run... , - then typing "cmd". -* Move to the directory where you have your input file - (e.g. by typing: cd "Documents"). +Download and install the MS-MPI runtime package ``msmpisetup.exe`` from +https://www.microsoft.com/en-us/download/details.aspx?id=105289 (Note +that the ``msmpisdk.msi`` is **only** required for **compilation** of +LAMMPS from source on Windows using Microsoft Visual Studio). After +installation of MS-MPI perform a reboot. Then you can run the executable in serial like in the example above or in parallel using MPI with one of the following commands: .. code-block:: bash - mpiexec -localonly 4 lmp -in in.file - mpiexec -np 4 lmp -in in.file + mpiexec -localonly 4 lmp -in in.file.lmp + mpiexec -np 4 lmp -in in.file.lmp -where in.file is the name of your LAMMPS input script. For the latter -case, you may be prompted to enter the password that you set during -installation of the MPI library software. +where ``in.file.lmp`` is the name of your LAMMPS input script. For the +latter case, you may be prompted to enter the password that you set +during installation of the MPI library software. In this mode, output may not immediately show up on the screen, so if your input script takes a long time to execute, you may need to be patient before the output shows up. -The parallel executable can also run on a single processor by typing -something like this: +Note that the parallel executable also includes OpenMP multi-threading +through both the OPENMP and the KOKKOS package, which can be combined +with MPI using something like: .. code-block:: bash - lmp -in in.lj + mpiexec -localonly 2 lmp -in in.lj.lmp -pk omp 2 -sf omp + mpiexec -localonly 2 lmp -in in.lj.lmp -kokkos on t 2 -sf kk -Note that the parallel executable also includes OpenMP -multi-threading, which can be combined with MPI using something like: - -.. code-block:: bash - - mpiexec -localonly 2 lmp -in in.lj -pk omp 2 -sf omp +------------- +MPI parallelization will work for *all* functionality in LAMMPS and in +many cases the MPI parallelization is more efficient than +multi-threading since LAMMPS was designed from ground up for MPI +parallelization using domain decomposition. Multi-threading is only +available for selected styles and implemented on top of the MPI +parallelization. Multi-threading is most useful for systems with large +load imbalances when using domain decomposition and a smaller number +of threads (<= 8). diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 4919c226fd..ee52be224e 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -357,6 +357,7 @@ accelerated styles exist. * :doc:`python/move ` - move particles using a Python function during a simulation run * :doc:`qbmsst ` - quantum bath multi-scale shock technique time integrator * :doc:`qeq/comb ` - charge equilibration for COMB potential +* :doc:`qeq/ctip ` - charge equilibration for CTIP potential * :doc:`qeq/dynamic ` - charge equilibration via dynamic method * :doc:`qeq/fire ` - charge equilibration via FIRE minimizer * :doc:`qeq/point ` - charge equilibration via point method diff --git a/doc/src/fix_adapt.rst b/doc/src/fix_adapt.rst index 03aef12a6c..7eaf1081f3 100644 --- a/doc/src/fix_adapt.rst +++ b/doc/src/fix_adapt.rst @@ -319,25 +319,34 @@ all types from 1 to :math:`N`. A leading asterisk means all types from :math:`N` (inclusive). A middle asterisk means all types from m to n (inclusive). -Currently *bond* does not support bond_style hybrid nor bond_style -hybrid/overlay as bond styles. The bond styles that currently work -with fix_adapt are +If :doc:`bond_style hybrid ` is used, *bstyle* should be a +sub-style name. The bond styles that currently work with fix adapt are: -+------------------------------------+------------+------------+ -| :doc:`class2 ` | r0 | type bonds | -+------------------------------------+------------+------------+ -| :doc:`fene ` | k,r0 | type bonds | -+------------------------------------+------------+------------+ -| :doc:`fene/nm ` | k,r0 | type bonds | -+------------------------------------+------------+------------+ -| :doc:`gromos ` | k,r0 | type bonds | -+------------------------------------+------------+------------+ -| :doc:`harmonic ` | k,r0 | type bonds | -+------------------------------------+------------+------------+ -| :doc:`morse ` | r0 | type bonds | -+------------------------------------+------------+------------+ -| :doc:`nonlinear ` | epsilon,r0 | type bonds | -+------------------------------------+------------+------------+ ++-----------------------------------------------------+---------------------------+------------+ +| :doc:`class2 ` | r0 | type bonds | ++-----------------------------------------------------+---------------------------+------------+ +| :doc:`fene ` | k,r0 | type bonds | ++-----------------------------------------------------+---------------------------+------------+ +| :doc:`fene/expand ` | k,r0,epsilon,sigma,shift | type bonds | ++-----------------------------------------------------+---------------------------+------------+ +| :doc:`fene/nm ` | k,r0 | type bonds | ++-----------------------------------------------------+---------------------------+------------+ +| :doc:`gromos ` | k,r0 | type bonds | ++-----------------------------------------------------+---------------------------+------------+ +| :doc:`harmonic ` | k,r0 | type bonds | ++-----------------------------------------------------+---------------------------+------------+ +| :doc:`harmonic/restrain ` | k | type bonds | ++-----------------------------------------------------+---------------------------+------------+ +| :doc:`harmonic/shift ` | k,r0,r1 | type bonds | ++-----------------------------------------------------+---------------------------+------------+ +| :doc:`harmonic/shift/cut ` | k,r0,r1 | type bonds | ++-----------------------------------------------------+---------------------------+------------+ +| :doc:`mm3 ` | k,r0 | type bonds | ++-----------------------------------------------------+---------------------------+------------+ +| :doc:`morse ` | r0 | type bonds | ++-----------------------------------------------------+---------------------------+------------+ +| :doc:`nonlinear ` | epsilon,r0 | type bonds | ++-----------------------------------------------------+---------------------------+------------+ ---------- @@ -357,15 +366,34 @@ all types from 1 to :math:`N`. A leading asterisk means all types from :math:`N` (inclusive). A middle asterisk means all types from m to n (inclusive). -Currently *angle* does not support angle_style hybrid nor angle_style -hybrid/overlay as angle styles. The angle styles that currently work -with fix_adapt are +If :doc:`angle_style hybrid ` is used, *astyle* should be a +sub-style name. The angle styles that currently work with fix adapt are: -+------------------------------------+----------+-------------+ -| :doc:`harmonic ` | k,theta0 | type angles | -+------------------------------------+----------+-------------+ -| :doc:`cosine ` | k | type angles | -+------------------------------------+----------+-------------+ ++--------------------------------------------------------------------+-----------------+-------------+ +| :doc:`harmonic ` | k,theta0 | type angles | ++--------------------------------------------------------------------+-----------------+-------------+ +| :doc:`charmm ` | k,theta0 | type angles | ++--------------------------------------------------------------------+-----------------+-------------+ +| :doc:`class2 ` | k2,k3,k4,theta0 | type angles | ++--------------------------------------------------------------------+-----------------+-------------+ +| :doc:`cosine ` | k | type angles | ++--------------------------------------------------------------------+-----------------+-------------+ +| :doc:`cosine/periodic ` | k,b,n | type angles | ++--------------------------------------------------------------------+-----------------+-------------+ +| :doc:`cosine/squared/restricted ` | k,theta0 | type angles | ++--------------------------------------------------------------------+-----------------+-------------+ +| :doc:`dipole ` | k,gamma0 | type angles | ++--------------------------------------------------------------------+-----------------+-------------+ +| :doc:`fourier ` | k,c0,c1,c2 | type angles | ++--------------------------------------------------------------------+-----------------+-------------+ +| :doc:`fourier/simple ` | k,c,n | type angles | ++--------------------------------------------------------------------+-----------------+-------------+ +| :doc:`mm3 ` | k,theta0 | type angles | ++--------------------------------------------------------------------+-----------------+-------------+ +| :doc:`quartic ` | k2,k3,k4,theta0 | type angles | ++--------------------------------------------------------------------+-----------------+-------------+ +| :doc:`spica ` | k,theta0 | type angles | ++--------------------------------------------------------------------+-----------------+-------------+ Note that internally, theta0 is stored in radians, so the variable this fix uses to reset theta0 needs to generate values in radians. diff --git a/doc/src/fix_gcmc.rst b/doc/src/fix_gcmc.rst index e6037af586..beb36fbafd 100644 --- a/doc/src/fix_gcmc.rst +++ b/doc/src/fix_gcmc.rst @@ -50,8 +50,8 @@ Syntax *intra_energy* value = intramolecular energy (energy units) *tfac_insert* value = scale up/down temperature of inserted atoms (unitless) *overlap_cutoff* value = maximum pair distance for overlap rejection (distance units) - *max* value = Maximum number of molecules allowed in the system - *min* value = Minimum number of molecules allowed in the system + *max* value = Maximum number of atoms allowed in the fix group (and region) + *min* value = Minimum number of atoms allowed in the fix group (and region) Examples """""""" @@ -380,10 +380,11 @@ an infinite positive energy to all new configurations that place any pair of atoms closer than the specified overlap cutoff distance. The *max* and *min* keywords allow for the restriction of the number of -atoms in the simulation. They automatically reject all insertion or -deletion moves that would take the system beyond the set boundaries. -Should the system already be beyond the boundary, only moves that bring -the system closer to the bounds may be accepted. +atoms in the fix group (and region in case the *region* keyword is +used). They automatically reject all insertion or deletion moves that +would take the system beyond the set boundaries. Should the system +already be beyond the boundary, only moves that bring the system closer +to the bounds may be accepted. The *group* keyword adds all inserted atoms to the :doc:`group ` of the group-ID value. The *grouptype* keyword adds all inserted atoms diff --git a/doc/src/fix_qeq.rst b/doc/src/fix_qeq.rst index f353e9a998..fd317666d0 100644 --- a/doc/src/fix_qeq.rst +++ b/doc/src/fix_qeq.rst @@ -1,6 +1,7 @@ .. index:: fix qeq/point .. index:: fix qeq/shielded .. index:: fix qeq/slater +.. index:: fix qeq/ctip .. index:: fix qeq/dynamic .. index:: fix qeq/fire @@ -13,6 +14,9 @@ fix qeq/shielded command fix qeq/slater command ====================== +fix qeq/ctip command +==================== + fix qeq/dynamic command ======================= @@ -27,18 +31,20 @@ Syntax fix ID group-ID style Nevery cutoff tolerance maxiter qfile keyword ... * ID, group-ID are documented in :doc:`fix ` command -* style = *qeq/point* or *qeq/shielded* or *qeq/slater* or *qeq/dynamic* or *qeq/fire* +* style = *qeq/point* or *qeq/shielded* or *qeq/slater* or *qeq/ctip* or *qeq/dynamic* or *qeq/fire* * Nevery = perform charge equilibration every this many steps * cutoff = global cutoff for charge-charge interactions (distance unit) * tolerance = precision to which charges will be equilibrated * maxiter = maximum iterations to perform charge equilibration -* qfile = a filename with QEq parameters or *coul/streitz* or *reaxff* +* qfile = a filename with QEq parameters or *coul/streitz* or *coul/ctip* or *reaxff* * zero or more keyword/value pairs may be appended -* keyword = *alpha* or *qdamp* or *qstep* or *warn* +* keyword = *alpha* or *cdamp* or *maxrepeat* or *qdamp* or *qstep* or *warn* .. parsed-literal:: *alpha* value = Slater type orbital exponent (qeq/slater only) + *cdamp* value = damping parameter for Coulomb interactions (qeq/ctip only) + *maxrepeat* value = number of equilibration cycles allowed to ensure no atoms cross charge bounds (qeq/ctip only) *qdamp* value = damping factor for damped dynamics charge solver (qeq/dynamic and qeq/fire only) *qstep* value = time step size for damped dynamics charge solver (qeq/dynamic and qeq/fire only) *warn* value = do (=yes) or do not (=no) print a warning when the maximum number of iterations is reached @@ -51,6 +57,7 @@ Examples fix 1 all qeq/point 1 10 1.0e-6 200 param.qeq1 fix 1 qeq qeq/shielded 1 8 1.0e-6 100 param.qeq2 fix 1 all qeq/slater 5 10 1.0e-6 100 params alpha 0.2 + fix 1 all qeq/ctip 1 12 1.0e-8 100 coul/ctip cdamp 0.30 maxrepeat 10 fix 1 qeq qeq/dynamic 1 12 1.0e-3 100 my_qeq fix 1 all qeq/fire 1 10 1.0e-3 100 my_qeq qdamp 0.2 qstep 0.1 @@ -103,7 +110,7 @@ equalizes the derivative of energy with respect to charge of all the atoms) by adjusting the partial charge on individual atoms based on interactions with their neighbors within *cutoff*\ . It requires a few parameters in the appropriate units for each atom type which are read -from a file specified by *qfile*\ . The file has the following format +from a file specified by *qfile*\ . The file has the following format: .. parsed-literal:: @@ -112,20 +119,32 @@ from a file specified by *qfile*\ . The file has the following format ... Ntype chi eta gamma zeta qcore +except for fix style *qeq/ctip* where the format is: + +.. parsed-literal:: + + 1 chi eta gamma zeta qcore qmin qmax omega + 2 chi eta gamma zeta qcore qmin qmax omega + ... + Ntype chi eta gamma zeta qcore qmin qmax omega + There have to be parameters given for every atom type. Wildcard entries are possible using the same type range syntax as for "coeff" commands (i.e., n\*m, n\*, \*m, \*). Later entries will overwrite previous ones. -Empty lines or any text following the pound sign (#) are ignored. -Each line starts with the atom type followed by five parameters. -Only a subset of the parameters is used by each QEq style as described -below, thus the others can be set to 0.0 if desired, but all five -entries per line are required. +Empty lines or any text following the pound sign (#) are ignored. Each +line starts with the atom type followed by eight parameters. Only a +subset of the parameters is used by each QEq style as described below, +thus the others can be set to 0.0 if desired, but all eight entries per +line are required. * *chi* = electronegativity in energy units * *eta* = self-Coulomb potential in energy units * *gamma* = shielded Coulomb constant defined by :ref:`ReaxFF force field ` in distance units * *zeta* = Slater type orbital exponent defined by the :ref:`Streitz-Mintmire ` potential in reverse distance units * *qcore* = charge of the nucleus defined by the :ref:`Streitz-Mintmire potential ` potential in charge units +* *qmin* = lower bound on the allowed charge defined by the :ref:`CTIP ` potential in charge units +* *qmax* = upper bound on the allowed charge defined by the :ref:`CTIP ` potential in charge units +* *omega* = penalty parameter used to enforce charge bounds defined by the :ref:`CTIP ` potential in energy units The fix qeq styles will print a warning if the charges are not equilibrated within *tolerance* by *maxiter* steps, unless the @@ -171,6 +190,22 @@ on atoms via the matrix inversion method. A tolerance of 1.0e-6 is usually a good number. Keyword *alpha* can be used to change the Slater type orbital exponent. +.. versionadded:: TBD + +The *qeq/ctip* style describes partial charges on atoms in the same way +as style *qeq/shielded* but also enables the definition of charge +bounds. Only the *chi*, *eta*, *gamma*, *qmin*, *qmax*, and *omega* +parameters from the *qfile* file are used. When using the string +*coul/ctip* as filename, these parameters are extracted directly from an +active *coul/ctip* pair style. This style solves partial charges on +atoms via the matrix inversion method. Keyword *cdamp* can be used to +change the damping parameter used to calculate Coulomb interactions. +Keyword *maxrepeat* can be used to adjust the number of equilibration +cycles allowed to ensure no atoms have crossed the charge bounds. A +value of 10 is usually a good choice. A tolerance between 1.0e-6 and +1.0e-8 is usually a good choice but should be checked in conjunction +with the timestep for adequate energy conservation during dynamic runs. + The *qeq/dynamic* style describes partial charges on atoms as point charges that interact through 1/r, but the extended Lagrangian method is used to solve partial charges on atoms. Only the *chi* and *eta* @@ -186,7 +221,7 @@ minimization algorithm to solve for equilibrium charges. Keyword *qdamp* can be used to change the damping factor, while keyword *qstep* can be used to change the time step size. -Note that *qeq/point*, *qeq/shielded*, and *qeq/slater* describe +Note that *qeq/point*, *qeq/shielded*, *qeq/slater*, and *qeq/ctip* describe different charge models, whereas the matrix inversion method and the extended Lagrangian method (\ *qeq/dynamic* and *qeq/fire*\ ) are different solvers. @@ -266,6 +301,11 @@ Chemistry, 95, 3358-3363 (1991). **(Streitz-Mintmire)** F. H. Streitz, J. W. Mintmire, Physical Review B, 50, 16, 11996 (1994) +.. _CTIP1: + +**(CTIP)** G. Plummer, J. P. Tavenner, M. I. Mendelev, Z. Wu, J. W. Lawson, +in preparation + .. _vanDuin: **(ReaxFF)** A. C. T. van Duin, S. Dasgupta, F. Lorant, W. A. Goddard III, J diff --git a/doc/src/pair_coul.rst b/doc/src/pair_coul.rst index e8f09515b0..cccdd46694 100644 --- a/doc/src/pair_coul.rst +++ b/doc/src/pair_coul.rst @@ -4,6 +4,7 @@ .. index:: pair_style coul/cut/omp .. index:: pair_style coul/cut/global .. index:: pair_style coul/cut/global/omp +.. index:: pair_style coul/ctip .. index:: pair_style coul/debye .. index:: pair_style coul/debye/gpu .. index:: pair_style coul/debye/kk @@ -38,6 +39,9 @@ pair_style coul/cut/global command Accelerator Variants: *coul/cut/omp* +pair_style coul/ctip command +============================ + pair_style coul/debye command ============================= @@ -79,7 +83,6 @@ pair_style tip4p/long command Accelerator Variants: *tip4p/long/omp* - Syntax """""" @@ -87,6 +90,7 @@ Syntax pair_style coul/cut cutoff pair_style coul/cut/global cutoff + pair_style coul/ctip alpha cutoff pair_style coul/debye kappa cutoff pair_style coul/dsf alpha cutoff pair_style coul/exclude cutoff @@ -116,6 +120,9 @@ Examples pair_coeff * * pair_coeff 2 2 3.5 + pair_style coul/ctip 0.30 12.0 + pair_coeff * * NiO.ctip Ni O + pair_style coul/debye 1.4 3.0 pair_coeff * * pair_coeff 2 2 3.5 @@ -173,6 +180,32 @@ coulomb styles in :doc:`hybrid pair styles `. ---------- +.. versionadded:: TBD + +Style *coul/ctip* computes the Coulomb interations as described in +:ref:`Plummer `. It uses the the damped shifted model as in +style *coul/dsf* but is further extended to the second derivative of +the potential and incorporates empirical charge shielding meant to +approximate the more expensive Coulomb integrals used in style *coul/streitz*. +More details can be found in the referenced paper. Like the style *coul/streitz*, +style *coul/ctip* is a variable charge potential and must be hybridized +with a short-range potential via the :doc:`pair_style hybrid/overlay ` +command. Charge equilibration must be performed with the :doc:`fix qeq/ctip +` command. For example: + +.. code-block:: LAMMPS + + pair_style hybrid/overlay eam/fs coul/ctip 0.30 12.0 + pair_coeff * * eam/fs NiO.eam.fs Ni O + pair_coeff * * coul/ctip NiO.ctip Ni O + fix 1 all qeq/ctip 1 12.0 1.0e-8 100 coul/ctip cdamp 0.30 maxrepeat 10 + +See the examples/ctip directory for an example input script using the CTIP +potential. An Ni-O CTIP and EAM/FS parametrization are included for use with +the example. + +---------- + Style *coul/debye* adds an additional exp() damping factor to the Coulombic term, given by @@ -399,16 +432,18 @@ Restrictions """""""""""" The *coul/long*, *coul/msm*, *coul/streitz*, and *tip4p/long* styles are -part of the KSPACE package. The *coul/cut/global*, *coul/exclude* styles are -part of the EXTRA-PAIR package. The *tip4p/cut* style is part of the MOLECULE -package. A pair style is only enabled if LAMMPS was built with its -corresponding package. See the :doc:`Build package ` -doc page for more info. +part of the KSPACE package. The *coul/cut/global*, *coul/exclude*, and +*coul/ctip* styles are part of the EXTRA-PAIR package. The *tip4p/cut* +style is part of the MOLECULE package. A pair style is only enabled if +LAMMPS was built with its corresponding package. See the +:doc:`Build package ` page for more info. Related commands """""""""""""""" -:doc:`pair_coeff `, :doc:`pair_style, hybrid/overlay `, :doc:`kspace_style ` +:doc:`pair_coeff `, +:doc:`pair_style hybrid/overlay `, +:doc:`kspace_style ` Default """"""" @@ -432,6 +467,11 @@ Phys, 110, 8254 (1999). **(Streitz)** F. H. Streitz, J. W. Mintmire, Phys Rev B, 50, 11996-12003 (1994). +.. _Plummer1: + +**(Plummer)** G. Plummer, J. P. Tavenner, M. I. Mendelev, Z. Wu, J. W. Lawson, +in preparation + .. _Jorgensen3: **(Jorgensen)** Jorgensen, Chandrasekhar, Madura, Impey, Klein, J Chem diff --git a/doc/src/pair_style.rst b/doc/src/pair_style.rst index 51350c86a4..fc2ed2b9a9 100644 --- a/doc/src/pair_style.rst +++ b/doc/src/pair_style.rst @@ -151,6 +151,7 @@ accelerated styles exist. * :doc:`comb ` - charge-optimized many-body (COMB) potential * :doc:`comb3 ` - charge-optimized many-body (COMB3) potential * :doc:`cosine/squared ` - Cooke-Kremer-Deserno membrane model potential +* :doc:`coul/ctip ` - Charge Transfer Interatomic (Coulomb) Potential * :doc:`coul/cut ` - cutoff Coulomb potential * :doc:`coul/cut/dielectric ` - * :doc:`coul/cut/global ` - cutoff Coulomb potential diff --git a/doc/src/read_dump.rst b/doc/src/read_dump.rst index 59d6cca78d..7f0e5bee42 100644 --- a/doc/src/read_dump.rst +++ b/doc/src/read_dump.rst @@ -115,10 +115,11 @@ to tell LAMMPS how many parallel files exist, via its specified The format of the dump file is selected through the *format* keyword. If specified, it must be the last keyword used, since all remaining -arguments are passed on to the dump reader. The *native* format is -for native LAMMPS dump files, written with a :doc:`dump atom ` -or :doc:`dump custom ` command. The *xyz* format is for generic XYZ -formatted dump files. These formats take no additional values. +arguments are passed on to the dump reader. The *native* format is for +native LAMMPS dump files, written with a :doc:`dump atom ` or +:doc:`dump custom ` command. The *xyz* format is for generic XYZ +formatted dump files (see details below). These formats take no +additional values. The *molfile* format supports reading data through using the `VMD `_ molfile plugin interface. This dump reader format is only available, @@ -230,23 +231,39 @@ will then have a label corresponding to the fix-ID rather than "x" or "xs". The *label* keyword can also be used to specify new column labels for fields *id* and *type*\ . -For dump files in *xyz* format, only the *x*, *y*, and *z* fields are -supported. The dump file does not store atom IDs, so these are -assigned consecutively to the atoms as they appear in the dump file, -starting from 1. Thus you should ensure that order of atoms is -consistent from snapshot to snapshot in the XYZ dump file. See -the :doc:`dump_modify sort ` command if the XYZ dump file -was written by LAMMPS. +For dump files in *xyz* format, only the *type*, *x*, *y*, and *z* +fields are supported. There are many variants of the XYZ file format. +LAMMPS will read the number of atoms from the first line of each frame, +ignore the second (title) line, and then read one line for each atom in the format: + +.. parsed-literal:: + +