diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 59a937faba..d1617cbb25 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -50,6 +50,7 @@ src/PTM/* @pmla src/QMMM/* @akohlmey src/REACTION/* @jrgissing src/REAXFF/* @hasanmetin @stanmoore1 +src/RHEO/* @jtclemm src/SCAFACOS/* @rhalver src/SNAP/* @athomps src/SPIN/* @julient31 diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 217d25e476..735dbe2f83 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -169,6 +169,22 @@ if(MSVC) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() +# warn about potentially problematic GCC compiler versions +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (CMAKE_CXX_STANDARD GREATER_EQUAL 17) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) + message(WARNING "Using ${CMAKE_CXX_COMPILER_ID} compiler version ${CMAKE_CXX_COMPILER_VERSION} " + "with C++17 is not recommended. Please use ${CMAKE_CXX_COMPILER_ID} compiler version 9.x or later") + endif() + endif() + if (CMAKE_CXX_STANDARD GREATER_EQUAL 11) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + message(WARNING "Using ${CMAKE_CXX_COMPILER_ID} compiler version ${CMAKE_CXX_COMPILER_VERSION} " + "with C++11 is not recommended. Please use ${CMAKE_CXX_COMPILER_ID} compiler version 5.x or later") + endif() + endif() +endif() + # export all symbols when building a .dll file on windows if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND BUILD_SHARED_LIBS) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) @@ -203,13 +219,12 @@ set(LAMMPS_BINARY lmp${LAMMPS_MACHINE}) option(BUILD_SHARED_LIBS "Build shared library" OFF) option(CMAKE_POSITION_INDEPENDENT_CODE "Create object compatible with shared libraries" ON) option(BUILD_TOOLS "Build and install LAMMPS tools (msi2lmp, binary2txt, chain)" OFF) -option(BUILD_LAMMPS_SHELL "Build and install the LAMMPS shell" OFF) option(BUILD_LAMMPS_GUI "Build and install the LAMMPS GUI" OFF) # Support using clang-tidy for C++ files with selected options set(ENABLE_CLANG_TIDY OFF CACHE BOOL "Include clang-tidy processing when compiling") if(ENABLE_CLANG_TIDY) - set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=-*,performance-trivially-destructible,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-member-init,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-boolean-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,modernize-use-override,modernize-use-bool-literals,modernize-use-emplace,modernize-return-braced-init-list,modernize-use-equals-default,modernize-use-equals-delete,modernize-replace-random-shuffle,modernize-deprecated-headers,modernize-use-nullptr,modernize-use-noexcept,modernize-redundant-void-arg;-fix;-header-filter=.*,header-filter=library.h,header-filter=fmt/*.h" CACHE STRING "clang-tidy settings") + set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=-*,performance-trivially-destructible,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-member-init,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-boolean-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-qualified-auto,misc-unused-parameters,modernize-deprecated-ios-base-aliases,modernize-loop-convert,modernize-shrink-to-fit,modernize-use-auto,modernize-use-using,modernize-use-override,modernize-use-bool-literals,modernize-use-emplace,modernize-return-braced-init-list,modernize-use-equals-default,modernize-use-equals-delete,modernize-replace-random-shuffle,modernize-deprecated-headers,modernize-use-nullptr,modernize-use-noexcept,modernize-redundant-void-arg;-fix;-header-filter=.*,header-filter=library.h,header-filter=fmt/*.h" CACHE STRING "clang-tidy settings") else() unset(CMAKE_CXX_CLANG_TIDY CACHE) endif() @@ -311,6 +326,7 @@ set(STANDARD_PACKAGES REACTION REAXFF REPLICA + RHEO RIGID SCAFACOS SHOCK @@ -415,6 +431,7 @@ pkg_depends(CG-DNA ASPHERE) pkg_depends(ELECTRODE KSPACE) pkg_depends(EXTRA-MOLECULE MOLECULE) pkg_depends(MESONT MOLECULE) +pkg_depends(RHEO BPM) # detect if we may enable OpenMP support by default set(BUILD_OMP_DEFAULT OFF) @@ -555,7 +572,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) + PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM COMPRESS ML-PACE LEPTON RHEO) if(PKG_${PKG_WITH_INCL}) include(Packages/${PKG_WITH_INCL}) endif() @@ -945,6 +962,7 @@ message(STATUS "<<< Compilers and Flags: >>> -- C++ Compiler: ${CMAKE_CXX_COMPILER} Type: ${CMAKE_CXX_COMPILER_ID} Version: ${CMAKE_CXX_COMPILER_VERSION} + C++ Standard: ${CMAKE_CXX_STANDARD} C++ Flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTYPE}} Defines: ${DEFINES}") get_target_property(OPTIONS lammps COMPILE_OPTIONS) @@ -1051,9 +1069,6 @@ endif() if(BUILD_TOOLS) message(STATUS "<<< Building Tools >>>") endif() -if(BUILD_LAMMPS_SHELL) - message(STATUS "<<< Building LAMMPS Shell >>>") -endif() if(BUILD_LAMMPS_GUI) message(STATUS "<<< Building LAMMPS GUI >>>") if(LAMMPS_GUI_USE_PLUGIN) diff --git a/cmake/Modules/LAMMPSUtils.cmake b/cmake/Modules/LAMMPSUtils.cmake index 2ec9d1b706..223577fe31 100644 --- a/cmake/Modules/LAMMPSUtils.cmake +++ b/cmake/Modules/LAMMPSUtils.cmake @@ -32,7 +32,13 @@ function(check_omp_h_include) set(CMAKE_REQUIRED_INCLUDES ${OpenMP_CXX_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LINK_OPTIONS ${OpenMP_CXX_FLAGS}) set(CMAKE_REQUIRED_LIBRARIES ${OpenMP_CXX_LIBRARIES}) - check_include_file_cxx(omp.h _have_omp_h) + # there are all kinds of problems with finding omp.h + # for Clang and derived compilers so we pretend it is there. + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(_have_omp_h TRUE) + else() + check_include_file_cxx(omp.h _have_omp_h) + endif() else() set(_have_omp_h FALSE) endif() diff --git a/cmake/Modules/Packages/ML-QUIP.cmake b/cmake/Modules/Packages/ML-QUIP.cmake index 5cb5a0967e..9106ff54ef 100644 --- a/cmake/Modules/Packages/ML-QUIP.cmake +++ b/cmake/Modules/Packages/ML-QUIP.cmake @@ -27,7 +27,7 @@ if(DOWNLOAD_QUIP) else() message(FATAL_ERROR "The ${CMAKE_Fortran_COMPILER_ID} Fortran compiler is not (yet) supported for building QUIP") endif() - set(temp "${temp}CFLAGS += -fPIC \nCPLUSPLUSFLAGS += -fPIC\nAR_ADD=src\n") + set(temp "${temp}CFLAGS += -fPIC -Wno-return-mismatch \nCPLUSPLUSFLAGS += -fPIC -Wno-return-mismatch\nAR_ADD=src\n") set(temp "${temp}MATH_LINKOPTS=") foreach(flag ${BLAS_LIBRARIES}) set(temp "${temp} ${flag}") diff --git a/cmake/Modules/Packages/RHEO.cmake b/cmake/Modules/Packages/RHEO.cmake new file mode 100644 index 0000000000..7639acd8bc --- /dev/null +++ b/cmake/Modules/Packages/RHEO.cmake @@ -0,0 +1,2 @@ +find_package(GSL 2.6 REQUIRED) +target_link_libraries(lammps PRIVATE GSL::gsl) diff --git a/cmake/Modules/Testing.cmake b/cmake/Modules/Testing.cmake index ff595d3c8f..a72ce17e1b 100644 --- a/cmake/Modules/Testing.cmake +++ b/cmake/Modules/Testing.cmake @@ -102,9 +102,9 @@ endif() ####################################### # select code sanitizer options ####################################### -set(ENABLE_SANITIZER "none" CACHE STRING "Select a code sanitizer option (none (default), address, leak, thread, undefined)") +set(ENABLE_SANITIZER "none" CACHE STRING "Select a code sanitizer option (none (default), address, hwaddress, leak, thread, undefined)") mark_as_advanced(ENABLE_SANITIZER) -set(ENABLE_SANITIZER_VALUES none address leak thread undefined) +set(ENABLE_SANITIZER_VALUES none address hwaddress leak thread undefined) set_property(CACHE ENABLE_SANITIZER PROPERTY STRINGS ${ENABLE_SANITIZER_VALUES}) validate_option(ENABLE_SANITIZER ENABLE_SANITIZER_VALUES) string(TOLOWER ${ENABLE_SANITIZER} ENABLE_SANITIZER) diff --git a/cmake/Modules/Tools.cmake b/cmake/Modules/Tools.cmake index 133301c3d4..94e077d51e 100644 --- a/cmake/Modules/Tools.cmake +++ b/cmake/Modules/Tools.cmake @@ -37,37 +37,6 @@ if(BUILD_TOOLS) add_subdirectory(${LAMMPS_TOOLS_DIR}/phonon ${CMAKE_BINARY_DIR}/phana_build) endif() -find_package(PkgConfig QUIET) -if(BUILD_LAMMPS_SHELL) - if(NOT PkgConfig_FOUND) - message(FATAL_ERROR "Must have pkg-config installed for building LAMMPS shell") - endif() - find_package(PkgConfig REQUIRED) - pkg_check_modules(READLINE IMPORTED_TARGET REQUIRED readline) - - # include resource compiler to embed icons into the executable on Windows - if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - enable_language(RC) - set(ICON_RC_FILE ${LAMMPS_TOOLS_DIR}/lammps-shell/lmpicons.rc) - endif() - - add_executable(lammps-shell ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.cpp ${ICON_RC_FILE}) - target_include_directories(lammps-shell PRIVATE ${LAMMPS_TOOLS_DIR}/lammps-shell) - target_link_libraries(lammps-shell PRIVATE lammps PkgConfig::READLINE) - - # workaround for broken readline pkg-config file on FreeBSD - if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - target_include_directories(lammps-shell PRIVATE /usr/local/include) - endif() - if(CMAKE_SYSTEM_NAME STREQUAL "LinuxMUSL") - pkg_check_modules(TERMCAP IMPORTED_TARGET REQUIRED termcap) - target_link_libraries(lammps-shell PRIVATE lammps PkgConfig::TERMCAP) - endif() - install(TARGETS lammps-shell EXPORT LAMMPS_Targets DESTINATION ${CMAKE_INSTALL_BINDIR}) - install(DIRECTORY ${LAMMPS_TOOLS_DIR}/lammps-shell/icons DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/) - install(FILES ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications/) -endif() - if(BUILD_LAMMPS_GUI) get_filename_component(LAMMPS_GUI_DIR ${LAMMPS_SOURCE_DIR}/../tools/lammps-gui ABSOLUTE) get_filename_component(LAMMPS_GUI_BIN ${CMAKE_BINARY_DIR}/lammps-gui-build ABSOLUTE) diff --git a/cmake/presets/all_off.cmake b/cmake/presets/all_off.cmake index 1ed5c0acd7..f2f5782480 100644 --- a/cmake/presets/all_off.cmake +++ b/cmake/presets/all_off.cmake @@ -82,6 +82,7 @@ set(ALL_PACKAGES REACTION REAXFF REPLICA + RHEO RIGID SCAFACOS SHOCK diff --git a/cmake/presets/all_on.cmake b/cmake/presets/all_on.cmake index c4345470e5..8dc4632138 100644 --- a/cmake/presets/all_on.cmake +++ b/cmake/presets/all_on.cmake @@ -84,6 +84,7 @@ set(ALL_PACKAGES REACTION REAXFF REPLICA + RHEO RIGID SCAFACOS SHOCK diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 5f40c487e8..100ce13632 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -33,7 +33,6 @@ set(WIN_PACKAGES FEP GPU GRANULAR - INTEL INTERLAYER KSPACE LEPTON diff --git a/doc/src/Build_basics.rst b/doc/src/Build_basics.rst index 233b825d01..45678938ef 100644 --- a/doc/src/Build_basics.rst +++ b/doc/src/Build_basics.rst @@ -489,8 +489,7 @@ using CMake or Make. .. code-block:: bash -D BUILD_TOOLS=value # yes or no (default). Build binary2txt, chain.x, micelle2d.x, msi2lmp, phana, stl_bin2txt - -D BUILD_LAMMPS_SHELL=value # yes or no (default). Build lammps-shell - -D BUILD_LAMMPS_GUI=value # yes or no (default). Build lammps-gui + -D BUILD_LAMMPS_GUI=value # yes or no (default). Build LAMMPS-GUI The generated binaries will also become part of the LAMMPS installation (see below). @@ -505,8 +504,9 @@ using CMake or Make. make chain # build only chain tool make micelle2d # build only micelle2d tool - cd lammps/tools/lammps-shell - make # build LAMMPS shell + .. note:: + + Building the LAMMPS-GUI *requires* building LAMMPS with CMake. ---------- diff --git a/doc/src/Build_development.rst b/doc/src/Build_development.rst index 4d8bf0d07f..8e103b089a 100644 --- a/doc/src/Build_development.rst +++ b/doc/src/Build_development.rst @@ -88,8 +88,8 @@ on recording all commands required to do the compilation. .. _sanitizer: -Address, Undefined Behavior, and Thread Sanitizer Support (CMake only) ----------------------------------------------------------------------- +Address, Leak, Undefined Behavior, and Thread Sanitizer Support (CMake only) +---------------------------------------------------------------------------- Compilers such as GCC and Clang support generating instrumented binaries which use different sanitizer libraries to detect problems in the code @@ -110,6 +110,7 @@ compilation and linking stages. This is done through setting the -D ENABLE_SANITIZER=none # no sanitizer active (default) -D ENABLE_SANITIZER=address # enable address sanitizer / memory leak checker + -D ENABLE_SANITIZER=hwaddress # enable hardware assisted address sanitizer / memory leak checker -D ENABLE_SANITIZER=leak # enable memory leak checker (only) -D ENABLE_SANITIZER=undefined # enable undefined behavior sanitizer -D ENABLE_SANITIZER=thread # enable thread sanitizer diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index f1526d2934..7fd2290653 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -59,6 +59,7 @@ This is the list of packages that may require additional steps. * :ref:`POEMS ` * :ref:`PYTHON ` * :ref:`QMMM ` + * :ref:`RHEO ` * :ref:`SCAFACOS ` * :ref:`VORONOI ` * :ref:`VTK ` @@ -638,6 +639,9 @@ They must be specified in uppercase. * - AMD_GFX1100 - GPU - AMD GPU RX7900XTX + * - AMD_GFX1103 + - GPU + - AMD Phoenix APU with Radeon 740M/760M/780M/880M/890M * - INTEL_GEN - GPU - SPIR64-based devices, e.g. Intel GPUs, using JIT @@ -1576,10 +1580,11 @@ folder and then load this plugin at runtime with the :doc:`plugin command ` is installed in locations + that are accessible in your environment. There are then two + additional variables that control the manner in which PLUMED is + obtained and linked into LAMMPS. .. code-block:: bash @@ -2050,6 +2055,36 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to ---------- +.. _rheo: + +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. + +.. 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 + + .. 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. + +---------- + .. _scafacos: SCAFACOS package diff --git a/doc/src/Build_link.rst b/doc/src/Build_link.rst index 3800e41e21..efd6691d30 100644 --- a/doc/src/Build_link.rst +++ b/doc/src/Build_link.rst @@ -45,8 +45,8 @@ executable code from the library is copied into the calling executable. .. code-block:: bash - mpicc -c -O $(pkgconf liblammps --cflags) caller.c - mpicxx -o caller caller.o -$(pkgconf liblammps --libs) + mpicc -c -O $(pkg-config --cflags liblammps) caller.c + mpicxx -o caller caller.o -$(pkg-config --libs liblammps) .. tab:: Traditional make @@ -155,8 +155,8 @@ POEMS package installed becomes: .. code-block:: bash - mpicc -c -O $(pkgconf liblammps --cflags) caller.c - mpicxx -o caller caller.o -$(pkgconf --libs) + mpicc -c -O $(pkg-config --cflags liblammps) caller.c + mpicxx -o caller caller.o -$(pkg-config --libs liblammps) .. tab:: Traditional make diff --git a/doc/src/Build_package.rst b/doc/src/Build_package.rst index 63ccac534d..b70a1ca4d1 100644 --- a/doc/src/Build_package.rst +++ b/doc/src/Build_package.rst @@ -62,6 +62,7 @@ packages: * :ref:`POEMS ` * :ref:`PYTHON ` * :ref:`QMMM ` + * :ref:`RHEO ` * :ref:`SCAFACOS ` * :ref:`VORONOI ` * :ref:`VTK ` diff --git a/doc/src/Build_settings.rst b/doc/src/Build_settings.rst index 34100871ce..b6aa6e4114 100644 --- a/doc/src/Build_settings.rst +++ b/doc/src/Build_settings.rst @@ -414,8 +414,8 @@ Read or write compressed files If this option is enabled, large files can be read or written with compression by ``gzip`` or similar tools by several LAMMPS commands, including :doc:`read_data `, :doc:`rerun `, and -:doc:`dump `. Supported compression tools are currently -``gzip``, ``bzip2``, ``zstd``, and ``lzma``. +:doc:`dump `. Supported compression tools and algorithms are currently +``gzip``, ``bzip2``, ``zstd``, ``xz``, ``lz4``, and ``lzma`` (via xz). .. tabs:: diff --git a/doc/src/Commands_bond.rst b/doc/src/Commands_bond.rst index 73235cf3c6..2664b74076 100644 --- a/doc/src/Commands_bond.rst +++ b/doc/src/Commands_bond.rst @@ -54,6 +54,7 @@ OPT. * :doc:`oxdna2/fene ` * :doc:`oxrna2/fene ` * :doc:`quartic (o) ` + * :doc:`rheo/shell ` * :doc:`special ` * :doc:`table (o) ` @@ -72,7 +73,7 @@ OPT. * :doc:`none ` * :doc:`zero ` - * :doc:`hybrid ` + * :doc:`hybrid (k) ` * * * @@ -100,7 +101,7 @@ OPT. * :doc:`mesocnt ` * :doc:`mm3 ` * :doc:`quartic (o) ` - * :doc:`spica (o) ` + * :doc:`spica (ko) ` * :doc:`table (o) ` .. _dihedral: @@ -118,7 +119,7 @@ OPT. * :doc:`none ` * :doc:`zero ` - * :doc:`hybrid ` + * :doc:`hybrid (k) ` * * * @@ -156,7 +157,7 @@ OPT. * :doc:`none ` * :doc:`zero ` - * :doc:`hybrid ` + * :doc:`hybrid (k) ` * * * diff --git a/doc/src/Commands_compute.rst b/doc/src/Commands_compute.rst index 2e8f291c77..e5ec34fc22 100644 --- a/doc/src/Commands_compute.rst +++ b/doc/src/Commands_compute.rst @@ -126,6 +126,7 @@ KOKKOS, o = OPENMP, t = OPT. * :doc:`reduce ` * :doc:`reduce/chunk ` * :doc:`reduce/region ` + * :doc:`rheo/property/atom ` * :doc:`rigid/local ` * :doc:`saed ` * :doc:`slcsa/atom ` diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index a7648218fa..4350a98b31 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -28,6 +28,7 @@ OPT. * :doc:`adapt ` * :doc:`adapt/fep ` * :doc:`addforce ` + * :doc:`add/heat ` * :doc:`addtorque ` * :doc:`alchemy ` * :doc:`amoeba/bitorsion ` @@ -204,6 +205,11 @@ OPT. * :doc:`reaxff/species (k) ` * :doc:`recenter ` * :doc:`restrain ` + * :doc:`rheo ` + * :doc:`rheo/oxidation ` + * :doc:`rheo/pressure ` + * :doc:`rheo/thermal ` + * :doc:`rheo/viscosity ` * :doc:`rhok ` * :doc:`rigid (o) ` * :doc:`rigid/meso ` diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index f83f2539a3..9cf0495c8e 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -35,6 +35,10 @@ OPT. * * * + * + * + * + * * :doc:`adp (ko) ` * :doc:`agni (o) ` * :doc:`aip/water/2dm (t) ` @@ -191,7 +195,7 @@ OPT. * :doc:`lj/mdf ` * :doc:`lj/relres (o) ` * :doc:`lj/spica (gko) ` - * :doc:`lj/spica/coul/long (go) ` + * :doc:`lj/spica/coul/long (gko) ` * :doc:`lj/spica/coul/msm (o) ` * :doc:`lj/sf/dipole/sf (go) ` * :doc:`lj/smooth (go) ` @@ -260,6 +264,8 @@ OPT. * :doc:`rebo (io) ` * :doc:`rebomos (o) ` * :doc:`resquared (go) ` + * :doc:`rheo ` + * :doc:`rheo/solid ` * :doc:`saip/metal (t) ` * :doc:`sdpd/taitwater/isothermal ` * :doc:`smatb ` diff --git a/doc/src/Commands_removed.rst b/doc/src/Commands_removed.rst index 4955bc6f0b..f902a61515 100644 --- a/doc/src/Commands_removed.rst +++ b/doc/src/Commands_removed.rst @@ -8,6 +8,18 @@ stop LAMMPS and print a suitable error message in most cases, when a style/command is used that has been removed or will replace the command with the direct alternative (if available) and print a warning. +restart2data tool +----------------- + +.. versionchanged:: 23Nov2013 + +The functionality of the restart2data tool has been folded into the +LAMMPS executable directly instead of having a separate tool. A +combination of the commands :doc:`read_restart ` and +:doc:`write_data ` can be used to the same effect. For +added convenience this conversion can also be triggered by +:doc:`command line flags ` + Fix ave/spatial and fix ave/spatial/sphere ------------------------------------------ @@ -151,17 +163,16 @@ and allow running LAMMPS with GPU acceleration. i-PI tool --------- -.. versionchanged:: 27June2024 +.. versionchanged:: 27Jun2024 The i-PI tool has been removed from the LAMMPS distribution. Instead, instructions to install i-PI from PyPI via pip are provided. -restart2data tool ------------------ +LAMMPS shell +------------ + +.. versionchanged:: TBD + +The LAMMPS shell has been removed from the LAMMPS distribution. Users +are encouraged to use the :ref:`LAMMPS-GUI ` tool instead. -The functionality of the restart2data tool has been folded into the -LAMMPS executable directly instead of having a separate tool. A -combination of the commands :doc:`read_restart ` and -:doc:`write_data ` can be used to the same effect. For -added convenience this conversion can also be triggered by -:doc:`command line flags ` diff --git a/doc/src/Developer_write_pair.rst b/doc/src/Developer_write_pair.rst index d70f8ec50b..c286b9e1dd 100644 --- a/doc/src/Developer_write_pair.rst +++ b/doc/src/Developer_write_pair.rst @@ -50,6 +50,30 @@ We are looking at the following cases: - `Case 3: a potential requiring communication`_ - `Case 4: potentials without a compute() function`_ +Package and build system considerations +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In general, new pair styles should be added to the :ref:`EXTRA-PAIR +package ` unless they are an accelerated pair style and +then they should be added to the corresponding accelerator package +(:ref:`GPU `, :ref:`INTEL `, :ref:`KOKKOS +`, :ref:`OPENMP `, :ref:`OPT `). If +you feel that your contribution should be added to a different package, +please consult with the LAMMPS developers first. + +The contributed code needs to support the :doc:`traditional GNU make +build process ` **and** the :doc:`CMake build process +`. For the GNU make process and if the package has an +``Install.sh`` file, most likely that file needs to be updated to +correctly copy the sources when installing the package and properly +delete them when uninstalling. This is particularly important when +added a new pair style that is a derived class from an existing pair +style in a package, so that its installation depends on the the +installation status of the package of the derived class. For the CMake +process, it is sometimes necessary to make changes to the package +specific CMake scripting in ``cmake/Modules/Packages``. + + ---- Case 1: a pairwise additive model diff --git a/doc/src/Examples.rst b/doc/src/Examples.rst index c5da4a498b..3d2103fd6f 100644 --- a/doc/src/Examples.rst +++ b/doc/src/Examples.rst @@ -134,6 +134,8 @@ Lowercase directories +-------------+------------------------------------------------------------------+ | rerun | use of rerun and read_dump commands | +-------------+------------------------------------------------------------------+ +| rheo | RHEO simulations of fluid flows and phase transitions | ++-------------+------------------------------------------------------------------+ | rigid | rigid bodies modeled as independent or coupled | +-------------+------------------------------------------------------------------+ | shear | sideways shear applied to 2d solid, with and without a void | diff --git a/doc/src/Fortran.rst b/doc/src/Fortran.rst index cea70dd3af..3b12ff2117 100644 --- a/doc/src/Fortran.rst +++ b/doc/src/Fortran.rst @@ -2327,7 +2327,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type retrieved via :f:func:`get_last_error_message`. This allows to restart a calculation or delete and recreate the LAMMPS instance when a C++ exception occurs. One application of using exceptions this way - is the :ref:`lammps_shell`. + is the :ref:`lammps_gui`. :to: :cpp:func:`lammps_config_has_exceptions` :r has_exceptions: diff --git a/doc/src/Howto.rst b/doc/src/Howto.rst index 85c98bd6de..5a63e2b1c4 100644 --- a/doc/src/Howto.rst +++ b/doc/src/Howto.rst @@ -89,6 +89,7 @@ Packages howto Howto_drude2 Howto_peri Howto_manifold + Howto_rheo Howto_spins Tutorials howto diff --git a/doc/src/Howto_chunk.rst b/doc/src/Howto_chunk.rst index 858e8241d1..f8655b745d 100644 --- a/doc/src/Howto_chunk.rst +++ b/doc/src/Howto_chunk.rst @@ -1,7 +1,7 @@ Use chunks to calculate system properties ========================================= -In LAMMS, "chunks" are collections of atoms, as defined by the +In LAMMPS, "chunks" are collections of atoms, as defined by the :doc:`compute chunk/atom ` command, which assigns each atom to a chunk ID (or to no chunk at all). The number of chunks and the assignment of chunk IDs to atoms can be static or change over @@ -148,14 +148,14 @@ Example calculations with chunks Here are examples using chunk commands to calculate various properties: -(1) Average velocity in each of 1000 2d spatial bins: +1. Average velocity in each of 1000 2d spatial bins: .. code-block:: LAMMPS compute cc1 all chunk/atom bin/2d x 0.0 0.1 y lower 0.01 units reduced fix 1 all ave/chunk 100 10 1000 cc1 vx vy file tmp.out -(2) Temperature in each spatial bin, after subtracting a flow +2. Temperature in each spatial bin, after subtracting a flow velocity: .. code-block:: LAMMPS @@ -164,7 +164,7 @@ velocity: compute vbias all temp/profile 1 0 0 y 10 fix 1 all ave/chunk 100 10 1000 cc1 temp bias vbias file tmp.out -(3) Center of mass of each molecule: +3. Center of mass of each molecule: .. code-block:: LAMMPS @@ -172,7 +172,7 @@ velocity: compute myChunk all com/chunk cc1 fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector -(4) Total force on each molecule and ave/max across all molecules: +4. Total force on each molecule and ave/max across all molecules: .. code-block:: LAMMPS @@ -183,7 +183,7 @@ velocity: thermo 1000 thermo_style custom step temp v_xave v_xmax -(5) Histogram of cluster sizes: +5. Histogram of cluster sizes: .. code-block:: LAMMPS @@ -192,16 +192,16 @@ velocity: compute size all property/chunk cc1 count fix 1 all ave/histo 100 1 100 0 20 20 c_size mode vector ave running beyond ignore file tmp.histo -(6) An example for using a per-chunk value to apply per-atom forces to +6. An example for using a per-chunk value to apply per-atom forces to compress individual polymer chains (molecules) in a mixture, is explained on the :doc:`compute chunk/spread/atom ` command doc page. -(7) An example for using one set of per-chunk values for molecule +7. An example for using one set of per-chunk values for molecule chunks, to create a second set of micelle-scale chunks (clustered molecules, due to hydrophobicity), is explained on the :doc:`compute reduce/chunk ` command doc page. -(8) An example for using one set of per-chunk values (dipole moment +8. An example for using one set of per-chunk values (dipole moment vectors) for molecule chunks, spreading the values to each atom in each chunk, then defining a second set of chunks as spatial bins, and using the :doc:`fix ave/chunk ` command to calculate an diff --git a/doc/src/Howto_cmake.rst b/doc/src/Howto_cmake.rst index 8b710d1065..55e5b171a6 100644 --- a/doc/src/Howto_cmake.rst +++ b/doc/src/Howto_cmake.rst @@ -339,8 +339,6 @@ Some common LAMMPS specific variables - build LAMMPS with OpenMP support (default: ``on`` if compiler supports OpenMP fully, else ``off``) * - ``BUILD_TOOLS`` - compile some additional executables from the ``tools`` folder (default: ``off``) - * - ``BUILD_LAMMPS_SHELL`` - - compile the LAMMPS shell from the ``tools/lammps-shell`` folder (default: ``off``) * - ``BUILD_DOC`` - include building the HTML format documentation for packaging/installing (default: ``off``) * - ``CMAKE_TUNE_FLAGS`` diff --git a/doc/src/Howto_lammps_gui.rst b/doc/src/Howto_lammps_gui.rst index 165ed84d95..1283bcfa5a 100644 --- a/doc/src/Howto_lammps_gui.rst +++ b/doc/src/Howto_lammps_gui.rst @@ -1,11 +1,11 @@ -Using the LAMMPS GUI -==================== +Using LAMMPS-GUI +================ -This document describes **LAMMPS GUI version 1.5**. +This document describes **LAMMPS-GUI version 1.6**. ----- -LAMMPS GUI is a graphical text editor customized for editing LAMMPS +LAMMPS-GUI is a graphical text editor customized for editing LAMMPS input files that is linked to the :ref:`LAMMPS library ` and thus can run LAMMPS directly using the contents of the editor's text buffer as input. It can retrieve and display information from LAMMPS @@ -16,58 +16,107 @@ to the online LAMMPS documentation for known LAMMPS commands and styles. .. note:: - Pre-compiled, ready-to-use LAMMPS GUI executables for Linux (Ubuntu - 20.04LTS or later and compatible), macOS (version 11 aka Big Sur or - later), and Windows (version 10 or later) :ref:`are available - ` for download. They may be linked to a - development version of LAMMPS in case they need features not yet - available in a released version. Serial LAMMPS executables of the - same LAMMPS version are included as well. The source code for the - LAMMPS GUI is included in the LAMMPS source code and can be found in - the ``tools/lammps-gui`` folder. It can be compiled alongside LAMMPS - when :doc:`compiling with CMake `. + Pre-compiled, ready-to-use LAMMPS-GUI executables for Linux x86\_64 + (Ubuntu 20.04LTS or later and compatible), macOS (version 11 aka Big + Sur or later), and Windows (version 10 or later) :ref:`are available + ` for download. None-MPI LAMMPS executables for + running LAMMPS from the command line and :doc:`some LAMMPS tools ` + are also included. -LAMMPS GUI tries to provide an experience similar to what people -traditionally would do to run LAMMPS using a command line window: + The source code for LAMMPS-GUI is included in the LAMMPS source code + distribution and can be found in the ``tools/lammps-gui`` folder. It + can be compiled alongside LAMMPS when :doc:`compiling with CMake + `. -- editing inputs with a text editor -- run LAMMPS on the input with selected command line flags -- and then use or extract data from the created files and visualize it +LAMMPS-GUI tries to provide an experience similar to what people +traditionally would have running LAMMPS using a command line window +and the console LAMMPS executable but just rolled into a single executable: + +- writing & editing LAMMPS input files with a text editor +- run LAMMPS on those input file with selected command line flags +- use or extract data from the created files and visualize it with + either a molecular visualization program or a plotting program That procedure is quite effective for people proficient in using the command line, as that allows them to use tools for the individual steps -which they are most comfortable with. It is often required when running -LAMMPS on high-performance computing facilities. +that they are most comfortable with. It is often *required* to adopt +this workflow when running LAMMPS simulations on high-performance +computing facilities. -The main benefit of using the LAMMPS GUI application instead is that -many basic tasks can be done directly from the GUI without switching to -a text console window or using external programs, let alone writing -scripts to extract data from the generated output. It also integrates -well with graphical desktop environments. +The main benefit of using LAMMPS-GUI is that many basic tasks can be +done directly from the GUI without switching to a text console window or +using external programs, let alone writing scripts to extract data from +the generated output. It also integrates well with graphical desktop +environments where the `.lmp` filename extension can be registered with +LAMMPS-GUI as the executable to launch when double clicking on such +files. Also, LAMMPS-GUI has support for drag-n-drop, i.e. an input +file can be selected and then moved and dropped on the LAMMPS-GUI +executable, and LAMMPS-GUI will launch and read the file into its +buffer. -LAMMPS GUI thus makes it easier for beginners to get started running +LAMMPS-GUI thus makes it easier for beginners to get started running simple LAMMPS simulations. It is very suitable for tutorials on LAMMPS since you only need to learn how to use a single program for most tasks -and thus time can be saved and people can focus on learning LAMMPS. It -is also designed to keep the barrier low when you decide to switch to a -full featured, standalone programming editor and more sophisticated -visualization and analysis tools and run LAMMPS from a command line. +and thus time can be saved and people can focus on learning LAMMPS. +The tutorials at https://lammpstutorials.github.io/ were specifically +updated for use with LAMMPS-GUI. + +Another design goal is to keep the barrier low when replacing part of +the functionality of LAMMPS-GUI with external tools. The following text provides a detailed tour of the features and -functionality of the LAMMPS GUI. - -Suggestions for new features and reports of bugs are always welcome. -You can use the :doc:`the same channels as for LAMMPS itself -` for that purpose. +functionality of LAMMPS-GUI. Suggestions for new features and +reports of bugs are always welcome. You can use the :doc:`the same +channels as for LAMMPS itself ` for that purpose. ----- -Main window ------------ +Installing Pre-compiled LAMMPS-GUI Packages +------------------------------------------- -When LAMMPS GUI starts, it will show a main window with either an -empty buffer or the contents of a loaded file. In the latter case it -may look like the following: +LAMMPS-GUI is available as pre-compiled binary packages for Linux +x86\_64, macOS 11 and later, and Windows 10 and later. Alternately, it +can be compiled from source. + +Windows 10 and later +^^^^^^^^^^^^^^^^^^^^ + +After downloading the ``LAMMPS-Win10-64bit-GUI-.exe`` installer +package, you need to execute it, and start the installation process. +Since those packages are currently unsigned, you have to enable "Developer Mode" +in the Windows System Settings to run the installer. + +MacOS 11 and later +^^^^^^^^^^^^^^^^^^ + +After downloading the ``LAMMPS-macOS-multiarch-GUI-.dmg`` +installer package, you need to double-click it and then, in the window +that opens, drag the app bundle as indicated into the "Applications" +folder. The follow the instructions in the "README.txt" file to +get access to the other included executables. + +Linux on x86\_64 +^^^^^^^^^^^^^^^^ + +After downloading and unpacking the +``LAMMPS-Linux-x86_64-GUI-.tar.gz`` package. You can switch +into the "LAMMPS_GUI" folder and execute "./lammps-gui" directly. + +Compiling from Source +^^^^^^^^^^^^^^^^^^^^^ + +There also are instructions for :ref:`compiling LAMMPS-GUI from source +code ` available elsewhere in the manual. +Compilation from source *requires* using CMake. + +----- + +Starting LAMMPS-GUI +------------------- + +When LAMMPS-GUI starts, it shows the main window, labeled *Editor*, with +either an empty buffer or the contents of the file used as argument. In +the latter case it may look like the following: .. image:: JPG/lammps-gui-main.png :align: center @@ -80,32 +129,41 @@ the LAMMPS input file syntax. The status bar shows the status of LAMMPS execution on the left (e.g. "Ready." when idle) and the current working directory on the right. The name of the current file in the buffer is shown in the window title; the word `*modified*` is added if -the buffer edits have not yet saved to a file. The size of the main -window will be stored when exiting and restored when starting again. +the buffer edits have not yet saved to a file. The geometry of the main +window is stored when exiting and restored when starting again. Opening Files ^^^^^^^^^^^^^ -The LAMMPS GUI application will try to open the first command line -argument as a LAMMPS input script, further arguments are ignored. -When no argument is given, LAMMPS GUI will start with an empty buffer. -Files can also be opened via the ``File`` menu or by drag-and-drop of -a file from a graphical file manager into the editor window. Only one -file can be open at a time, so opening a new file with a filled buffer -will close the buffer. If the buffer has unsaved modifications, you -will be asked to either cancel the operation, discard the changes, or -save them. +The LAMMPS-GUI application can be launched without command line arguments +and then starts with an empty buffer in the *Editor* window. If arguments +are given LAMMPS will use first command line argument as the file name for +the *Editor* buffer and reads its contents into the buffer, if the file +exists. All further arguments are ignored. Files can also be opened via +the ``File`` menu, the `Ctrl-O` (`Command-O` on macOS) keyboard shortcut +or by drag-and-drop of a file from a graphical file manager into the editor +window. If a file extension (e.g. ``.lmp``) has been registered with the +graphical environment to launch LAMMPS-GUI, an existing input file can +be launched with LAMMPS-GUI through double clicking. + +Only one file can be edited at a time, so opening a new file with a +filled buffer closes that buffer. If the buffer has unsaved +modifications, you are asked to either cancel the operation, discard the +changes, or save them. A buffer with modifications can be saved any +time from the "File" menu, by the keyboard shortcut `Ctrl-S` +(`Command-S` on macOS), or by clicking on the "Save" button at the very +left in the status bar. Running LAMMPS ^^^^^^^^^^^^^^ -From within the LAMMPS GUI main window LAMMPS can be started either from +From within the LAMMPS-GUI main window LAMMPS can be started either from the ``Run`` menu using the ``Run LAMMPS from Editor Buffer`` entry, by the keyboard shortcut `Ctrl-Enter` (`Command-Enter` on macOS), or by clicking on the green "Run" button in the status bar. All of these -operations will cause LAMMPS to process the entire input script, which -may contain multiple :doc:`run ` or :doc:`minimize ` -commands. +operations causes LAMMPS to process the entire input script in the +editor buffer, which may contain multiple :doc:`run ` or +:doc:`minimize ` commands. LAMMPS runs in a separate thread, so the GUI stays responsive and is able to interact with the running calculation and access data it @@ -128,33 +186,30 @@ before LAMMPS can be run from a file. While LAMMPS is running, the contents of the status bar change. On the left side there is a text indicating that LAMMPS is running, which -will also show the number of active threads, if thread-parallel +also indicates the number of active threads, when thread-parallel acceleration was selected in the ``Preferences`` dialog. On the right side, a progress bar is shown that displays the estimated progress for -the current :doc:`run command `. +the current :doc:`run ` or :doc:`minimize ` command. -Also, the line number of the currently executed command will be -highlighted in green. - -.. image:: JPG/lammps-gui-run-highlight.png - :align: center - :scale: 75% +Also, the line number of the currently executed command is highlighted +in green. If an error occurs (in the example below the command :doc:`label