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 fbe56e99a1..5b29fb6047 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -164,6 +164,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) @@ -198,7 +214,6 @@ 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 @@ -495,6 +510,14 @@ if(PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR BUILD_T endif() endif() +find_package(CURL QUIET COMPONENTS HTTP HTTPS) +option(WITH_CURL "Enable libcurl support" ${CURL_FOUND}) +if(WITH_CURL) + find_package(CURL REQUIRED COMPONENTS HTTP HTTPS) + target_compile_definitions(lammps PRIVATE -DLAMMPS_CURL) + target_link_libraries(lammps PRIVATE CURL::libcurl) +endif() + # tweak jpeg library names to avoid linker errors with MinGW cross-compilation set(JPEG_NAMES libjpeg libjpeg-62) find_package(JPEG QUIET) @@ -872,7 +895,7 @@ endif() include(Testing) include(CodeCoverage) include(CodingStandard) -find_package(ClangFormat 8.0) +find_package(ClangFormat 11.0) if(ClangFormat_FOUND) add_custom_target(format-src @@ -1049,9 +1072,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/FindClangFormat.cmake b/cmake/Modules/FindClangFormat.cmake index 3f0257f34f..24fad5b6a8 100644 --- a/cmake/Modules/FindClangFormat.cmake +++ b/cmake/Modules/FindClangFormat.cmake @@ -1,5 +1,8 @@ # Find clang-format find_program(ClangFormat_EXECUTABLE NAMES clang-format + clang-format-20.0 + clang-format-19.0 + clang-format-18.0 clang-format-17.0 clang-format-16.0 clang-format-15.0 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/COLVARS.cmake b/cmake/Modules/Packages/COLVARS.cmake index 745c1de026..b943a0345e 100644 --- a/cmake/Modules/Packages/COLVARS.cmake +++ b/cmake/Modules/Packages/COLVARS.cmake @@ -24,6 +24,12 @@ target_include_directories(colvars PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/colvars) target_include_directories(colvars PRIVATE ${LAMMPS_SOURCE_DIR}) target_link_libraries(lammps PRIVATE colvars) +if(BUILD_OMP) + # Enable OpenMP for Colvars as well + target_compile_options(colvars PRIVATE ${OpenMP_CXX_FLAGS}) + target_link_libraries(colvars PRIVATE OpenMP::OpenMP_CXX) +endif() + if(COLVARS_DEBUG) # Need to export the define publicly to be valid in interface code target_compile_definitions(colvars PUBLIC -DCOLVARS_DEBUG) diff --git a/cmake/Modules/Packages/RHEO.cmake b/cmake/Modules/Packages/RHEO.cmake index be8c22877b..7639acd8bc 100644 --- a/cmake/Modules/Packages/RHEO.cmake +++ b/cmake/Modules/Packages/RHEO.cmake @@ -1,2 +1,2 @@ -find_package(GSL 2.7 REQUIRED) +find_package(GSL 2.6 REQUIRED) target_link_libraries(lammps PRIVATE GSL::gsl) 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/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 8e103b089a..e95c5b97d9 100644 --- a/doc/src/Build_development.rst +++ b/doc/src/Build_development.rst @@ -153,7 +153,12 @@ development headers to compile (if those are not found locally a recent version of that library will be downloaded and compiled along with LAMMPS and the test programs) and will download and compile a specific version of the `GoogleTest `_ C++ -test framework that is used to implement the tests. +test framework that is used to implement the tests. Those unit tests +may be combined with memory access and leak checking with valgrind +(see below for how to enable it). In that case, running so-called +death tests will create a lot of false positives and thus they can be +disabled by configuring compilation with the additional setting +``-D SKIP_DEATH_TESTS=on``. .. admonition:: Software version and LAMMPS configuration requirements :class: note diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 4802c67420..eae247d66a 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -639,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 diff --git a/doc/src/Build_settings.rst b/doc/src/Build_settings.rst index 34100871ce..2abe6c4678 100644 --- a/doc/src/Build_settings.rst +++ b/doc/src/Build_settings.rst @@ -8,7 +8,8 @@ explains how to do this for building both with CMake and make. * `FFT library`_ for use with the :doc:`kspace_style pppm ` command * `Size of LAMMPS integer types and size limits`_ * `Read or write compressed files`_ -* `Output of JPG, PNG, and move files` via the :doc:`dump image ` or :doc:`dump movie ` commands +* `Output of JPEG, PNG, and movie files`_ via the :doc:`dump image ` or :doc:`dump movie ` commands +* `Support for downloading files`_ * `Memory allocation alignment`_ * `Workaround for long long integers`_ * `Exception handling when using LAMMPS as a library`_ to capture errors @@ -19,7 +20,7 @@ explains how to do this for building both with CMake and make. .. _cxx11: C++11 standard compliance ------------------------------------------- +------------------------- A C++11 standard compatible compiler is a requirement for compiling LAMMPS. LAMMPS version 3 March 2020 is the last version compatible with the previous @@ -31,12 +32,16 @@ flags to enable C++11 compliance. Example for GNU c++ 4.8.x: CCFLAGS = -g -O3 -std=c++11 +Individual packages may require compliance with a later C++ standard +like C++14 or C++17. These requirements will be documented with the +:doc:`individual packages `. + ---------- .. _fft: FFT library ---------------------- +----------- When the KSPACE package is included in a LAMMPS build, the :doc:`kspace_style pppm ` command performs 3d FFTs which @@ -341,8 +346,8 @@ in whichever ``lib/gpu/Makefile`` is used must be the same as above. .. _graphics: -Output of JPG, PNG, and movie files --------------------------------------------------- +Output of JPEG, PNG, and movie files +------------------------------------ The :doc:`dump image ` command has options to output JPEG or PNG image files. Likewise, the :doc:`dump movie ` command @@ -356,9 +361,9 @@ requires the following settings: .. code-block:: bash -D WITH_JPEG=value # yes or no - # default = yes if CMake finds JPEG files, else no + # default = yes if CMake finds JPEG development files, else no -D WITH_PNG=value # yes or no - # default = yes if CMake finds PNG and ZLIB files, else no + # default = yes if CMake finds PNG and ZLIB development files, else no -D WITH_FFMPEG=value # yes or no # default = yes if CMake can find ffmpeg, else no @@ -414,8 +419,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:: @@ -446,12 +451,58 @@ during a run. available using a compression library instead, which is what the :ref:`COMPRESS package ` enables. +-------------------------------------------------- + +.. _libcurl: + +Support for downloading files +----------------------------- + +.. versionadded:: TBD + +The :doc:`geturl command ` command uses the `the libcurl library +`_ to download files. This requires that +LAMMPS is compiled accordingly which needs the following settings: + +.. tabs:: + + .. tab:: CMake build + + .. code-block:: bash + + -D WITH_CURL=value # yes or no + # default = yes if CMake finds CURL development files, else no + + Usually these settings are all that is needed. If CMake cannot + find the graphics header, library, executable files, you can set + these variables: + + .. code-block:: bash + + -D CURL_INCLUDE_DIR=path # path to folder which contains curl.h header file + -D CURL_LIBRARY=path # path to libcurls.a (.so) file + + .. tab:: Traditional make + + .. code-block:: make + + LMP_INC = -DLAMMPS_CURL + + CURL_INC = -I/usr/local/include # path to curl folder with curl.h + CURL_PATH = -L/usr/lib # paths to libcurl.a(.so) if make cannot find it + CURL_LIB = -lcurl # library names + + As with CMake, you do not need to set ``CURL_INC`` or ``CURL_PATH``, + if make can find the libcurl header and library files in their + default system locations. You must specify ``CURL_LIB`` with a + paths or linker flags to link to libcurl. + ---------- .. _align: Memory allocation alignment ---------------------------------------- +--------------------------- This setting enables the use of the "posix_memalign()" call instead of "malloc()" when LAMMPS allocates large chunks of memory. Vector diff --git a/doc/src/Commands_all.rst b/doc/src/Commands_all.rst index 4a035f5b41..cb31369501 100644 --- a/doc/src/Commands_all.rst +++ b/doc/src/Commands_all.rst @@ -54,6 +54,7 @@ table above. * :doc:`echo ` * :doc:`fix ` * :doc:`fix_modify ` + * :doc:`geturl ` * :doc:`group ` * :doc:`if ` * :doc:`improper_coeff ` diff --git a/doc/src/Commands_bond.rst b/doc/src/Commands_bond.rst index eec6f7acf1..2664b74076 100644 --- a/doc/src/Commands_bond.rst +++ b/doc/src/Commands_bond.rst @@ -73,7 +73,7 @@ OPT. * :doc:`none ` * :doc:`zero ` - * :doc:`hybrid ` + * :doc:`hybrid (k) ` * * * @@ -101,7 +101,7 @@ OPT. * :doc:`mesocnt ` * :doc:`mm3 ` * :doc:`quartic (o) ` - * :doc:`spica (o) ` + * :doc:`spica (ko) ` * :doc:`table (o) ` .. _dihedral: @@ -119,7 +119,7 @@ OPT. * :doc:`none ` * :doc:`zero ` - * :doc:`hybrid ` + * :doc:`hybrid (k) ` * * * @@ -157,7 +157,7 @@ OPT. * :doc:`none ` * :doc:`zero ` - * :doc:`hybrid ` + * :doc:`hybrid (k) ` * * * diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index a1b2a78fdb..9cf0495c8e 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -195,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) ` 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/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_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 6faac96ce9..85f0210f99 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,123 @@ 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 +^^^^^^^^^^^^^^^^ + +For Linux with x86\_64 CPU there are currently two variants. The first +is compiled on Ubuntu 20.04LTS, is using some wrapper scripts, and +should be compatible with more recent Linux distributions. 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. + +The second variant uses `flatpak `_ and +requires the flatpak management and runtime software to be installed. +After downloading the ``LAMMPS-GUI-Linux-x86_64-GUI-.tar.gz`` +flatpak bundle, you can install it with ``flatpak install --user +LAMMPS-GUI-Linux-x86_64-GUI-.tar.gz``. After installation, +LAMMPS-GUI should be integrated into your desktop environment under +"Applications > Science" but also can be launched from the console with +``flatpak run org.lammps.lammps-gui``. The flatpak bundle also includes +the console LAMMPS executable ``lmp`` which can be launched to run +simulations with, for example: ``flatpak run --command=lmp +org.lammps.lammps-gui -in in.melt``. + + +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 +145,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 +202,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