Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
15689ae
recover compiling SCAFACOS package on Ubuntu 22.04LTS
akohlmey Jan 20, 2026
35dfe3b
modernize error handling in fix brownian/* and fix broken checks
akohlmey Jan 20, 2026
3199d6b
add VMD workflow example
akohlmey Jan 20, 2026
9b40817
replace non-ASCII characters and rewrap
akohlmey Jan 20, 2026
4a17805
own a few more files
akohlmey Jan 20, 2026
a8554a9
apply C++ move semantics to avoid copy of temporary variable
akohlmey Jan 20, 2026
161efca
use raw string literals for regex patterns
akohlmey Jan 20, 2026
ca3ccb6
use nested namespace
akohlmey Jan 20, 2026
28a4798
use const references where possible to avoid copies
akohlmey Jan 20, 2026
0bc87ee
check for out-of-range numerical atom types
akohlmey Jan 20, 2026
fcce8f5
apply clang-format
akohlmey Jan 20, 2026
842dbbd
add unit tests for typelabel inference
akohlmey Jan 20, 2026
497acb0
simplify by using Tokenizer class
akohlmey Jan 20, 2026
97ace6b
silence warning
akohlmey Jan 20, 2026
2f6e762
add links to YouTube videos of the GRAPHICS examples simulations
akohlmey Jan 20, 2026
ba162ae
update release steps docs. mention special settings for online manual…
akohlmey Jan 20, 2026
222e4ac
Initial draft of LabelMap docs by GitHub Copilot
Copilot Jan 20, 2026
53d54dc
revise and condense the AI drafted docs
akohlmey Jan 20, 2026
b2c546e
better headers and remove some more redundancies
akohlmey Jan 21, 2026
e25a69f
rename over loaded LabelMap::find() to find_type() and find_label() f…
akohlmey Jan 21, 2026
12cc9ea
remove some more redundancy, rephrase for clarity, correct formatting
akohlmey Jan 21, 2026
18181aa
add tests for mapping types to labels, use raw string constants
akohlmey Jan 21, 2026
4f48be3
fix typo
akohlmey Jan 21, 2026
c255e9e
add overload to Image::draw_pixmap() to support image coordinate system
akohlmey Jan 22, 2026
c8a547b
support using image coordinates with fix graphics/labels
akohlmey Jan 22, 2026
6a7911f
add support for reading compressed and uncompressed 8-bit RGB .TGA fi…
akohlmey Jan 22, 2026
b56fbfc
support creating vertical text labels in addition to horizontal ones
akohlmey Jan 22, 2026
43dcdf5
clarify description of the "basis" keyword and add an example
akohlmey Jan 23, 2026
63dd28f
provide access to colormap range
akohlmey Jan 23, 2026
4b6d511
add minimal implementation of a color scale label
akohlmey Jan 23, 2026
ff370b7
fix initialization and always update color scale, even without variab…
akohlmey Jan 23, 2026
140e640
avoid uninitialized data access
akohlmey Jan 23, 2026
59abd51
added support for tics
akohlmey Jan 23, 2026
930bcf9
must scale the length by 2 for consistency
akohlmey Jan 23, 2026
660f539
small updates, follow LAMMPS' coding style more closely
akohlmey Jan 23, 2026
56bb6a4
add docs for colorscale
akohlmey Jan 23, 2026
1e1f663
address some issues spotted by GitHub copilot
akohlmey Jan 24, 2026
58fe50f
implement corrections suggested by GitHub Copilot
akohlmey Jan 24, 2026
c462f82
fix typo
akohlmey Jan 25, 2026
0d13e9d
add examples with images using colormap legends to showcase color map…
akohlmey Jan 25, 2026
4346804
add note about dynamics color maps
akohlmey Jan 25, 2026
a0492b1
check if dump exists and print warning for dynamics color map
akohlmey Jan 25, 2026
08fa09f
avoid segfault when using dump_modify to change bond properties while…
akohlmey Jan 25, 2026
7119ead
bugfix from PR #4852. Also fix same bug in fix neb/spin
akohlmey Jan 26, 2026
8f681a3
Add fences to fix race condition
stanmoore1 Jan 26, 2026
90ac9c1
Temporarily disable atom sorting on device for atom_style hybrid/kk t…
stanmoore1 Jan 26, 2026
1e7cdf1
Merge branch 'develop' of github.com:lammps/lammps into kk_bugfixes
stanmoore1 Jan 27, 2026
7826635
document missing length keyword. clarify the order of overlapping labels
akohlmey Jan 27, 2026
beb2b58
Merge pull request #4856 from stanmoore1/kk_bugfixes
akohlmey Jan 27, 2026
cf01646
Merge pull request #4845 from akohlmey/collected-small-changes
akohlmey Jan 27, 2026
81453fa
Merge pull request #4848 from akohlmey/graphics-updates
akohlmey Jan 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@

# docs
/doc/* @akohlmey
/doc/src/Howto_viz.rst @akohlmey
/doc/src/Howto_spc.rst @akohlmey
/doc/src/Howto_tip*.rst @akohlmey
/examples/GRAPHICS/ @akohlmey
/examples/plugin/ @akohlmey
/examples/PACKAGES/pace/plugin/ @akohlmey

Expand Down
34 changes: 27 additions & 7 deletions .github/release_steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,26 @@ gh release upload patch_4Feb2025 LAMMPS-Win10-64bit-GUI-4Feb2025.exe
The symbolic link is used to have a consistent naming scheme for the packages
attached to the GitHub release page.

#### LAMMPS Online Manual

Creating the online docs requires setting some environment variables to have
the extra box at the bottom of the navigation bar included that allows to
switch between release, stable, and develop branch versions of the manual.
Also the search box should use Google search instead of the javascript search.

``` sh
cd lammps-release
make -C doc clean
make -C doc upgrade
env LAMMPS_WEBSITE_BUILD=1 LAMMPS_WEBSITE_BUILD_VERSION=release LAMMPS_WEBSITE_BASEURL="https://docs.lammps.org/" \
make -C doc html WEB_SEARCH=YES
make -C doc pdf
mv doc/Manual.pdf doc/html
rsync -arpv doc/html/ www.lammps.org:/var/www/lammps/docs/release-new

Then log into www.lammps.org and move the current folder away and
the new folder in its place and update permissions.

#### Clean up:

``` sh
Expand Down Expand Up @@ -243,6 +263,7 @@ and installed (e.g. to `$HOME/.local`) as static libraries only:
- jpeg
- zlib
- png
- voro++ (for VORONOI package)
- Qt (for LAMMPS-GUI)

When configuring LAMMPS the `cmake/presets/clang.cmake` should be used
Expand Down Expand Up @@ -298,8 +319,8 @@ Check out the LAMMPS website repo
https://github.com/lammps/lammps-website.git and edit the file
`src/download.txt` for the new release. Test translation with `make
html` and review `html/download.html` Then add and commit to git and
push the changes to GitHub. The Temple Jenkis cluster will
automatically update https://www.lammps.org/download.html accordingly.
push the changes to GitHub. A cron job will automatically update
https://www.lammps.org/ accordingly if there are changes.

Also notify Steve of the release so he can update `src/bug.txt` on the
website from the available release notes.
Expand Down Expand Up @@ -373,11 +394,10 @@ git tag -s -m 'Update 2 for Stable LAMMPS version 29 August 2024' stable_29Aug20
git push [email protected]:lammps/lammps.git --tags maintenance stable
```

Associate draft release notes with new tag and publish as "latest release".

On https://ci.lammps.org/ go to "dev", "stable" and manually execute
the "update\_release" task. This will update https://docs.lammps.org/stable
and prepare a stable tarball.
Associate draft release notes with new tag and prepare and upload
various source and binary packages. Publish as "latest release"
only when all uploads are complete as they cannot be changed after
they are published since we are creating "immutable" releases now.

### Build and upload binary packages and source tarball to GitHub

Expand Down
5 changes: 4 additions & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ endif()

# do not include the (obsolete) MPI C++ bindings which makes for leaner object files
# and avoids namespace conflicts. Put this early to increase its visbility.
set(MPI_CXX_SKIP_MPICXX TRUE CACHE BOOL "Skip MPI C++ Bindings" FORCE)
# do not apply when compiling SCAFACOS since it uses the obsolete bindings
if (NOT PKG_SCAFACOS)
set(MPI_CXX_SKIP_MPICXX TRUE CACHE BOOL "Skip MPI C++ Bindings" FORCE)
endif()

########################################################################
# User input options #
Expand Down
8 changes: 6 additions & 2 deletions cmake/Modules/Packages/SCAFACOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ enable_language(C)

find_package(GSL REQUIRED)
find_package(PkgConfig QUIET)
find_package(MPI REQUIRED)
find_package(MPI REQUIRED COMPONENTS C MPICXX CXX Fortran)
set(DOWNLOAD_SCAFACOS_DEFAULT ON)
if(PKG_CONFIG_FOUND)
pkg_check_modules(SCAFACOS QUIET scafacos)
Expand All @@ -19,6 +19,8 @@ if(DOWNLOAD_SCAFACOS)
mark_as_advanced(SCAFACOS_URL)
mark_as_advanced(SCAFACOS_MD5)
GetFallbackURL(SCAFACOS_URL SCAFACOS_FALLBACK)
set(SCAFACOS_CXX_FLAGS "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}} ${CMAKE_CXX_FLAGS}")
set(SCAFACOS_C_FLAGS "${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}} ${CMAKE_C_FLAGS}")

include(ExternalProject)
ExternalProject_Add(scafacos_build
Expand All @@ -32,6 +34,8 @@ if(DOWNLOAD_SCAFACOS)
CXX=${CMAKE_MPI_CXX_COMPILER}
CC=${CMAKE_MPI_C_COMPILER}
F77=
CFLAGS=${SCAFACOS_C_FLAGS}
CXXFLAGS=${SCAFACOS_CXX_FLAGS}
BUILD_BYPRODUCTS
<INSTALL_DIR>/lib/libfcs.a
<INSTALL_DIR>/lib/libfcs_direct.a
Expand All @@ -55,7 +59,7 @@ if(DOWNLOAD_SCAFACOS)
set_target_properties(LAMMPS::SCAFACOS PROPERTIES
IMPORTED_LOCATION "${INSTALL_DIR}/lib/libfcs.a"
INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include"
INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/libfcs.a;${INSTALL_DIR}/lib/libfcs_direct.a;${INSTALL_DIR}/lib/libfcs_ewald.a;${INSTALL_DIR}/lib/libfcs_fmm.a;${INSTALL_DIR}/lib/libfcs_p2nfft.a;${INSTALL_DIR}/lib/libfcs_p3m.a;GSL::gsl;${INSTALL_DIR}/lib/libfcs_near.a;${INSTALL_DIR}/lib/libfcs_gridsort.a;${INSTALL_DIR}/lib/libfcs_resort.a;${INSTALL_DIR}/lib/libfcs_redist.a;${INSTALL_DIR}/lib/libfcs_common.a;${INSTALL_DIR}/lib/libfcs_pnfft.a;${INSTALL_DIR}/lib/libfcs_pfft.a;${INSTALL_DIR}/lib/libfcs_fftw3_mpi.a;${INSTALL_DIR}/lib/libfcs_fftw3.a;MPI::MPI_Fortran;MPI::MPI_C")
INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/libfcs.a;${INSTALL_DIR}/lib/libfcs_direct.a;${INSTALL_DIR}/lib/libfcs_ewald.a;${INSTALL_DIR}/lib/libfcs_fmm.a;${INSTALL_DIR}/lib/libfcs_p2nfft.a;${INSTALL_DIR}/lib/libfcs_p3m.a;GSL::gsl;${INSTALL_DIR}/lib/libfcs_near.a;${INSTALL_DIR}/lib/libfcs_gridsort.a;${INSTALL_DIR}/lib/libfcs_resort.a;${INSTALL_DIR}/lib/libfcs_redist.a;${INSTALL_DIR}/lib/libfcs_common.a;${INSTALL_DIR}/lib/libfcs_pnfft.a;${INSTALL_DIR}/lib/libfcs_pfft.a;${INSTALL_DIR}/lib/libfcs_fftw3_mpi.a;${INSTALL_DIR}/lib/libfcs_fftw3.a;MPI::MPI_CXX;MPI::MPI_Fortran;MPI::MPI_C;${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}")
target_link_libraries(lammps PRIVATE LAMMPS::SCAFACOS)
add_dependencies(LAMMPS::SCAFACOS scafacos_build)
else()
Expand Down
2 changes: 2 additions & 0 deletions doc/doxygen/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ INPUT = @LAMMPS_SOURCE_DIR@/utils.cpp \
@LAMMPS_SOURCE_DIR@/text_file_reader.h \
@LAMMPS_SOURCE_DIR@/potential_file_reader.cpp \
@LAMMPS_SOURCE_DIR@/potential_file_reader.h \
@LAMMPS_SOURCE_DIR@/label_map.cpp \
@LAMMPS_SOURCE_DIR@/label_map.h \
@LAMMPS_SOURCE_DIR@/my_page.cpp \
@LAMMPS_SOURCE_DIR@/my_page.h \
@LAMMPS_SOURCE_DIR@/my_pool_chunk.cpp \
Expand Down
136 changes: 136 additions & 0 deletions doc/src/Developer_utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,142 @@ A file that would be parsed by the reader code fragment looks like this:

----------

Type label support
------------------

Overview
^^^^^^^^

The :cpp:class:`LabelMap <LAMMPS_NS::LabelMap>` class provides a two way
mapping between symbolic type labels in input and output files and
numeric types as they are used by LAMMPS internally. Instead of
changing the numeric types in files to satisfy the requirements from
LAMMPS for a given application, the symbolic types can remain and only
the label map needs to be adjusted. When following the convention that
the labels for bonded interactions are created by joining the
constituent atom types with hyphens, this can significantly improve
readability, maintainability, and re-usability of inputs and reduces the
chance of errors.

The LabelMap class also provides automatic type inference for bonded
interactions based on their constituent atom types. For instance, based
on the atom type labels, the corresponding bond, angle, dihedral, or
improper types can be inferred provided the corresponding type labels
follow the convention that they are composed of the symbolic atom types
connected by hyphens.

Integration with utils namespace
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Several utility functions in the ``utils`` namespace work with type labels and
interact with the LabelMap class:

* :cpp:func:`utils::is_type() <LAMMPS_NS::utils::is_type>` - Validates whether
a string is a valid type label.

* :cpp:func:`utils::expand_type() <LAMMPS_NS::utils::expand_type>` - Converts
a type label string to its numeric equivalent using the LabelMap.

* :cpp:func:`utils::bounds_typelabel() <LAMMPS_NS::utils::bounds_typelabel>` -
Extended version of ``utils::bounds()`` that accepts type labels in addition
to numeric ranges. Uses ``expand_type()`` internally to convert labels to
numeric bounds before processing.

These functions enable seamless integration of type labels throughout LAMMPS,
allowing commands that accept type specifications to work with both numeric
indices and symbolic labels. Below are some code examples.

Finding types from labels and vice versa
""""""""""""""""""""""""""""""""""""""""

.. code-block:: c++

#include "label_map.h"
#include "atom.h"

// assuming this code is used inside a class that is derived from LAMMPS_NS::Pointers
LabelMap *lmap = atom->lmap;

// Forward lookup: Get numeric type from label
int ctype = lmap->find_type("C", Atom::ATOM); // Returns atom type for "C"
int htype = lmap->find_type("H", Atom::ATOM); // Returns atom type for "H"
int missing = lmap->find_type("X", Atom::ATOM); // Returns -1 (not found)

// Reverse lookup: Get label from numeric type
const std::string &label1 = lmap->find_label(1, Atom::ATOM); // Returns label for type 1
const std::string &label2 = lmap->find_label(2, Atom::BOND); // Returns bond label for type 2

// Check if all types have labels
bool complete = lmap->is_complete(Atom::ATOM); // Returns true if all atom types labeled

Inferring bonded types from atom types
""""""""""""""""""""""""""""""""""""""

.. code-block:: c++

#include "label_map.h"
#include "atom.h"

LabelMap *lmap = atom->lmap;

// Assume we have: labelmap atom 1 C 2 H 3 N
// And: labelmap bond 1 C-H 2 C-C 3 C-N

// Infer bond type from numeric atom types
int bt1 = lmap->infer_bondtype(1, 2); // Returns 1 (C-H bond)
int bt2 = lmap->infer_bondtype(1, 1); // Returns 2 (C-C bond)
int bt3 = lmap->infer_bondtype(3, 1); // Returns 3 (C-N bond, symmetric match)

// Infer bond type from atom type labels (handles symmetry automatically)
int bt4 = lmap->infer_bondtype({"C", "H"}); // Returns 1 (C-H)
int bt5 = lmap->infer_bondtype({"H", "C"}); // Returns 1 (symmetric match)
int bt6 = lmap->infer_bondtype({"C", "N"}); // Returns 3 (C-N)

Validating and expanding type labels
""""""""""""""""""""""""""""""""""""

.. code-block:: c++

#include "utils.h"
#include "lammps.h"

using namespace LAMMPS_NS;

LAMMPS *lmp = /* ... */;

// Validate type label strings
int result1 = utils::is_type("C"); // Returns 1 (valid label)
int result2 = utils::is_type("123"); // Returns 0 (numeric type)
int result3 = utils::is_type("*"); // Returns -1 (invalid - starts with *)
int result4 = utils::is_type("C H"); // Returns -1 (invalid - contains whitespace)

// Convert type label to numeric string
char *numstr = utils::expand_type(FLERR, "C", Atom::ATOM, lmp);
if (numstr) {
// Use the numeric type string
delete[] numstr; // Must delete after use
}

// Convert type label to integer
int type = utils::expand_type_int(FLERR, "C", Atom::ATOM, lmp, true);
// The 'true' argument enables range verification

// Use bounds_typelabel for ranges with label support
int lo, hi;
utils::bounds_typelabel(FLERR, "C:H", 1, 10, lo, hi, lmp, Atom::ATOM);
// Expands "C:H" to numeric range, e.g., "1:2" -> lo=1, hi=2

----------

LabelMap class reference
^^^^^^^^^^^^^^^^^^^^^^^^

.. doxygenclass:: LAMMPS_NS::LabelMap
:project: progguide
:members:

----------

Memory pool classes
-------------------

Expand Down
77 changes: 77 additions & 0 deletions doc/src/Howto_viz.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,83 @@ rarely needed these days.

------------------------

Basic workflow for loading LAMMPS trajectories in VMD
=====================================================

VMD can read native LAMMPS dump files (in text format not binary) and
several other dump styles. The native LAMMPS format is preferred since
it contains simulation box information. VMD does not support reading
data files directly, but `the TopoTools plugin
<https://www.ks.uiuc.edu/Research/vmd/plugins/topotools/>`_ does. This
step is usually necessary, since the LAMMPS dump files do not contain
information about the molecular topology and elements and that
information can be obtained from the data file. There also is the
`pbctools plugin
<https://www.ks.uiuc.edu/Research/vmd/plugins/pbctools/>`_ that can be
used for "repairing" bonds that are broken because one of its atom
passed through a periodic boundary. Because of using the plugins, the
following commands need to be typed into the VMD console to read a
trajectory. The following commands are based on the ``peptide`` example
to which the command ``dump 1 all atom 10 dump.peptide`` was added.
Note the use of the group "all" in contrast to the commented out dump
commands that use the group "peptide". This is to match the number of
atoms in the data file. VMD does not support cases where the number of
atoms change or you are trying to read in a subset of a system unless
*all* files contain the same subset.

.. code-block:: Tcl

# load data file including its coordinates
topo readlammpsdata data.peptide full
# atom style full is the default ^^^^ and can be omitted

# try to infer missing atom properties from available information
topo guessatom lammps data

# now add one of more dump files
mol addfile dump.peptide type lammpstrj waitfor all
# we tell VMD which file type ^^^^^^^^^ if the filename does not end in .lammpstrj

# jump to the first frame with the data file coordinates
animate goto 0
# if needed use the following command to try and repair broken bonds
# pbc join fragment -now

# unwrap the entire trajectory to repair all broken bonds
# this is faster and more accurate than running `pbc join` for all frames
pbc unwrap -all
pbc wrap -all -compound fragment -orthorhombic
# remove for triclinic box ^^^^^^^^^^^^^

# delete the coordinate frame from the data file
animate delete beg 0 end 0 top
# write out the topology information without coordinates to a PSF file
animate write psf peptide.psf top
# and the processed trajectory data to a DCD file for future use
animate write dcd peptide.dcd top waitfor all

###############################################################
# the steps up to this line only need to be run once
###############################################################
# set visualization defaults
display perspective orthographic
mol default style Licorice
mol default material Diffuse
display backgroundgradient on

# delete molecule and load psf and dcd file
mol delete top
mol new peptide.psf
mol addfile peptide.dcd waitfor all
pbc box

To automate this process, you can also save these commands to a file,
e.g. ``peptide.vmd`` and then load this file from the VMD "File" menu
with "Load Visualization State..." or type in the command console
``play peptide.vmd``.

------------------------

Advanced graphics features in the *dump image* command
======================================================

Expand Down
8 changes: 4 additions & 4 deletions doc/src/Manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ The manual is organized into three parts:

.. _user_documentation:

************
**********
User Guide
************
**********

.. toctree::
:maxdepth: 2
Expand All @@ -106,9 +106,9 @@ User Guide

.. _programmer_documentation:

******************
****************
Programmer Guide
******************
****************

.. toctree::
:maxdepth: 2
Expand Down
Loading