Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8934d03
warnings should only be printed on MPI rank 0
akohlmey Feb 26, 2026
3911b91
avoid getting stuck in region restricted MC moves and improve errors
akohlmey Feb 26, 2026
fe09513
use PPM format images instead of PNG for better compatibility
akohlmey Feb 26, 2026
f647ba8
Fix set structure mismatch for box
jtclemm Feb 26, 2026
2ea3383
suggest to check for overlapping atoms also for NaN and Inf values
akohlmey Feb 26, 2026
efcdca2
Merge branch 'collected-small-fixes' of github.com:akohlmey/lammps in…
akohlmey Feb 26, 2026
744a5fe
Merge branch 'sllod-ref-update' of github.com:ssande7/lammps into col…
akohlmey Feb 26, 2026
84ede49
Merge remote-tracking branch 'github/develop' into collected-small-fixes
akohlmey Feb 26, 2026
fa415a3
don't print last line for group bitmask lookup errors
akohlmey Feb 27, 2026
79f401e
re-apply clang-format
akohlmey Feb 27, 2026
d3c2578
improve error message
akohlmey Feb 27, 2026
06fc47e
must clamp hi/lo values of regions to box boundaries in case they wer…
akohlmey Feb 27, 2026
6e15c1d
add color style "atom" to the body particle visualization
akohlmey Feb 27, 2026
7858b25
tweak lighting for triangles of body particles
akohlmey Feb 27, 2026
f29e03e
add support for entering colors as hex numbers
akohlmey Feb 28, 2026
6e4e4f1
add missing references
akohlmey Feb 28, 2026
7cb6469
improve error message
akohlmey Feb 28, 2026
abc3b7e
Merge branch 'develop' into collected-small-fixes
akohlmey Mar 2, 2026
dc41a50
improve visualization now that we have a smarter selection
akohlmey Mar 2, 2026
8f09a28
improve peptide example with added imported image showing hbond defin…
akohlmey Mar 2, 2026
b1deefd
fix incorrect bond opacity lookup for bonds constrained with fix shake
akohlmey Mar 3, 2026
a97698a
cleaner version of bond opacity bugfix
akohlmey Mar 3, 2026
b602118
add a preset for compiling a library for use with LAMMPS-GUI
akohlmey Mar 3, 2026
8b45cee
this is no longer needed
akohlmey Mar 4, 2026
1279e33
some more updates for the LAMMPS-GUI custom LAMMPS library build
akohlmey Mar 4, 2026
f562372
use new feature, so we can color bodies by atom properties also from …
akohlmey Mar 4, 2026
320f26b
flush small values for stress or global scalars or vectors to zero to…
akohlmey Mar 5, 2026
fc17747
Merge pull request #4898 from akohlmey/collected-small-fixes
akohlmey Mar 5, 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
74 changes: 74 additions & 0 deletions cmake/presets/lammps-gui.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
set(WIN_PACKAGES
AMOEBA
ASPHERE
BODY
BPM
BROWNIAN
CG-DNA
CG-SPICA
CLASS2
COLLOID
COLVARS
CORESHELL
DIELECTRIC
DIFFRACTION
DIPOLE
DPD-BASIC
DPD-MESO
DPD-REACT
DPD-SMOOTH
DRUDE
EFF
EXTRA-COMMAND
EXTRA-COMPUTE
EXTRA-DUMP
EXTRA-FIX
EXTRA-MOLECULE
EXTRA-PAIR
FEP
GRAPHICS
GRANULAR
INTERLAYER
KSPACE
LEPTON
MACHDYN
MANYBODY
MC
MEAM
MISC
ML-IAP
ML-POD
ML-SNAP
ML-UF3
MOFFF
MOLECULE
OPENMP
OPT
ORIENT
PERI
PHONON
QEQ
QTB
REACTION
REAXFF
RHEO
RIGID
SHOCK
SPH
SPIN
SRD
TALLY
UEF
YAFF)

foreach(PKG ${WIN_PACKAGES})
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
endforeach()

set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "" FORCE)
set(USE_INTERNAL_LINALG ON CACHE BOOL "" FORCE)
set(FFT KISS CACHE STRING "" FORCE)
set(BUILD_MPI OFF CACHE BOOL "" FORCE)
set(BUILD_TOOLS OFF CACHE BOOL "" FORCE)
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/lammps-installer")
23 changes: 18 additions & 5 deletions doc/src/Errors_details.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,24 @@ contacts or bad geometries (for the given force styles in use) leading
to forces that can no longer be represented as numbers. Those will show
as "NaN" or "Inf". On most machines, the program will continue, but
there is no way to recover from it and those NaN or Inf values will
propagate. So-called :doc:`"soft-core" potentials <pair_fep_soft>` or
the :doc:`"soft" repulsive-only pair style <pair_soft>` are less prone
for this behavior (depending on the settings in use) and can be used at
the beginning of a simulation. Also, single precision numbers can
overflow much faster, so for the GPU, KOKKOS, or INTEL package it may be
propagate.

If the "NaN" or "Inf" appears in the first simulation step, the most
common cause is overlapping atoms. Note that when atoms are *very*
close, this cannot be seen when visualizing the geometry, since the
atoms are effectively sitting on top of each other. A good test is to
insert a command like :doc:`delete_atoms 0.1 all all <delete_atoms>` and
then monitor the output to see how many atoms are deleted, if any. A
non-zero number would be an indication of overlapping atoms. Note that
atoms can also overlap through periodic boundaries when the box
dimensions are too small (e.g. determined by min/max position of atoms
without padding).

So-called :doc:`"soft-core" potentials <pair_fep_soft>` or the
:doc:`"soft" repulsive-only pair style <pair_soft>` are less prone for
this behavior (depending on the settings in use) and can be used at the
beginning of a simulation. Also, single precision numbers can overflow
much faster, so for the GPU, KOKKOS, or INTEL package it may be
beneficial to run with double precision initially before switching to
mixed or single precision for faster execution when the system has
relaxed.
Expand Down
2 changes: 2 additions & 0 deletions doc/src/Packages_details.rst
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ particle models including ellipsoids, 2d lines, and 3d triangles.
* :doc:`pair_style gayberne <pair_gayberne>`
* :doc:`pair_style resquared <pair_resquared>`
* :doc:`pair_style ylz <pair_ylz>`
* :doc:`pair_style line/lj <pair_line_lj>`
* :doc:`pair_style tri/lj <pair_tri_lj>`
* `doc/PDF/pair_gayberne_extra.pdf <PDF/pair_gayberne_extra.pdf>`_
* `doc/PDF/pair_resquared_extra.pdf <PDF/pair_resquared_extra.pdf>`_
* ``examples/ASPHERE``
Expand Down
67 changes: 44 additions & 23 deletions doc/src/dump_image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Syntax
level = mesh refinement level, value between 1 (low resolution) and 6 (ultra high resolution)
width = diameter of wireframe edges (distance units) (ignored for triangles)
*body* = color bflag1 bflag2
color = *type* or *index*
color = *type* or *index* or *atom*
bflag1,bflag2 = 2 numeric flags to affect how bodies are drawn
*compute* = computeID color cflag1 cflag2
computeID = ID of computes that generates objects to draw
Expand Down Expand Up @@ -181,9 +181,10 @@ Syntax
color = name of color for simulation box lines and processor subdomain lines
*subboxtrans* arg = transparency
transparency = transparency for simulation subbox lines (value between 0 (invisible) and 1 (fully opaque))
*color* args = name R G B
*color* args = name R G B *or* name hex
name = name of color
R,G,B = red/green/blue numeric values from 0.0 to 1.0
hex = 24-bit RGB color in hexadecimal
*ccolor* args = computeID color
computeID = ID of the compute
color = name of color for image objects provided by this compute when using "const" color style
Expand Down Expand Up @@ -218,6 +219,7 @@ Examples

labelmap atom 1 C 2 H 3 O 4 N
dump_modify 1 acolor C gray acolor H white acolor O red acolor N blue
dump_modify 1 color gray80 0.8 0.8 0.8 color gray20 0x333333

Description
"""""""""""
Expand Down Expand Up @@ -585,25 +587,34 @@ is used to define body particles with internal state
body style. If this keyword is not used, such particles will be drawn
as spheres, the same as if they were regular atoms.

The :doc:`Howto body <Howto_body>` page describes the body styles
LAMMPS currently supports, and provides more details as to the kind of
body particles they represent and how they are drawn by this dump
image command. For all the body styles, individual atoms can be
either a body particle or a usual point (non-body) particle. Non-body
particles will be drawn the same way they would be as a regular atom.
The *bflag1* and *bflag2* settings are numerical values which are
passed to the body style to affect how the drawing of a body particle
is done. See the :doc:`Howto body <Howto_body>` page for a
description of what these parameters mean for each body style.
The :doc:`Howto body <Howto_body>` page describes the body styles LAMMPS
currently supports, and provides more details as to the kind of body
particles they represent and how they are drawn by this dump image
command. For all the body styles, individual atoms can be either a body
particle or a usual point (non-body) particle. Non-body particles will
be drawn the same way they would be as a regular atom. The *bflag1* and
*bflag2* settings are numerical values which are passed to the body
style to affect how the drawing of a body particle is done. See the
:doc:`Howto body <Howto_body>` page for a description of what these
parameters mean for each body style.

.. versionchanged:: 11Feb2026

The there are currently two supported settings for the *color* value:
*type*, or *index*. With the *type* setting the body particles will be
colored according to the atom type of the particle. With the *index*
setting the coloring follows the body index instead. For both settings,
the value (type or index) is mapped to the colors of atom types. The
list of colors is by default as follows:
added *index* color style

.. versionchanged:: TBD

added *atom* color style

The there are currently three supported settings for the *color* value:
*type*, *index*, or *atom*. With the *atom* setting, the color follows
the coloring selected for coloring atoms (including using color maps).
With the *type* setting the body particles will be colored according to
the atom type of the particle. With the *index* setting the coloring
follows the body index instead. For both settings, the value (type or
index) is mapped to the colors of atom types thus the coloring style for
atoms **must** be set to *type*. The list of colors is by default as
follows:

* type 1 = red
* type 2 = green
Expand All @@ -614,9 +625,9 @@ list of colors is by default as follows:

and repeats itself for types > 6. This list can by changed with the
:doc:`dump_modify acolor <dump_image>` command. If more different
colors than atom types are desired, the number of atom types must be
increased when using either the :doc:`create_box <create_box>` or the
:doc:`read_data <read_data>` command.
colors than atom types are desired, the *number of atom types* must be
*increased* correspondingly when using either the :doc:`create_box
<create_box>` or the :doc:`read_data <read_data>` command.

----------

Expand Down Expand Up @@ -1125,12 +1136,22 @@ dump_modify color option.

----------

.. versionchanged:: TBD

add support for entering colors in hexadecimal

The *color* keyword allows definition of a new color name, in addition
to the 140-predefined colors (see below), and associates three
red/green/blue RGB values with that color name. The color name can
then be used with any other dump_modify keyword that takes a color
name as a value. The RGB values should each be floating point values
between 0.0 and 1.0 inclusive.
name as a value. The RGB values should be either specified as three
floating point values between 0.0 and 1.0 inclusive or as a single
24-bit hexadecimal number. The following two commands are equivalent.

.. code-block:: LAMMPS

dump_modify 1 color mygray 0.431 0.498 0.502
dump_modify 1 color mygray 0x6e7f80

When a color name is converted to RGB values, the user-defined color
names are searched first, then the 140 pre-defined color names. This
Expand Down
3 changes: 2 additions & 1 deletion examples/GRAPHICS/README
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Here is a list of the inputs and which graphics features they demonstrate

- in.peptide-hbonds: peptide with surrounding water molecules
visualize donated and accepted hydrogen bonds
https://youtube.com/shorts/1QEjIITapwQ
overlay graphics from image without background
https://youtube.com/shorts/Q6KBE08AG8c

- in.obstacle-lines trajectory lines with obstacle flow example
https://youtu.be/9HEsGaOsdik
Binary file added examples/GRAPHICS/hbond-diagram.tga
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/GRAPHICS/in.breakable
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fix labels all graphics/labels 500 text "LAMMPS Tutorial 2 - Stretching CNT usi
text "Atoms with bonds 1: $(c_count[1]) 2: $(c_count[2]) 3: $(c_count[3]) 4: $(c_count[4])" &
32.5 7.5 5.0 size 24 fontcolor white backcolor silver

dump viz all image 500 breakable.*.png c_nbond type size 1600 300 zoom 12.5 shiny 0.2 autobond 1.8 0.4 &
dump viz all image 500 breakable.*.ppm c_nbond type size 1600 300 zoom 12.5 shiny 0.2 autobond 1.8 0.4 &
adiam 0.8 box no 0.01 view 0 90 fsaa yes ssao yes 1325123 0.6 axes yes 0.5 0.1 &
fix arrows const 0 0 fix labels const 0 0 fix vel const 0 0

Expand Down
4 changes: 2 additions & 2 deletions examples/GRAPHICS/in.cubes-and-pyramids
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ thermo 1000
variable progress equal step/v_steps
fix pbar all graphics/objects ${out} progbar 3 4 y 24.0 12.0 -1.4 30.0 0.5 v_progress 10

dump 2 all image ${out} cubes-and-pyramids.*.png type type size 600 600 shiny 0.4 &
dump 2 all image ${out} cubes-and-pyramids.*.ppm type type size 600 600 shiny 0.4 &
box yes 0.025 axes no 0.5 0.1 zoom 1.5 view 80 0 fsaa yes ssao yes 315123 0.4 &
body type 0.2 3 fix pbar type 0 0
body atom 0.2 3 fix pbar type 0 0
# set cylinder diameter--^ ^-- set viz style (1 only faces, 2 cylinders, 3 both)
dump_modify 2 pad 6 backcolor darkgray backcolor2 gray boxcolor white &
acolor 1 steelblue acolor 2 orange acolor 3 slategray acolor 4 red
Expand Down
84 changes: 42 additions & 42 deletions examples/GRAPHICS/in.obstacle-lines
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
# 2d LJ obstacle flow

dimension 2
boundary p s p
dimension 2
boundary p s p

atom_style atomic
neighbor 0.3 bin
neigh_modify delay 5
atom_style atomic
neighbor 0.3 bin
neigh_modify delay 5

# create geometry

lattice hex 0.7
region box block 0 40 0 10 -0.25 0.25
create_box 4 box
create_atoms 1 box
lattice hex 0.7
region box block 0 40 0 10 -0.25 0.25
create_box 4 box
create_atoms 1 box

mass * 1.0
mass * 1.0

# LJ potentials

pair_style lj/cut 1.12246
pair_coeff * * 1.0 1.0 1.12246
pair_style lj/cut 1.12246
pair_coeff * * 1.0 1.0 1.12246

# define groups

region 1 block INF INF INF 1.25 INF INF
group lower region 1
region 2 block INF INF 8.75 INF INF INF
group upper region 2
group boundary union lower upper
group flow subtract all boundary
region 1 block INF INF INF 1.25 INF INF
group lower region 1
region 2 block INF INF 8.75 INF INF INF
group upper region 2
group boundary union lower upper
group flow subtract all boundary

set group lower type 2
set group upper type 3
set group lower type 2
set group upper type 3

# initial velocities

compute mobile flow temp
velocity flow create 1.0 482748 temp mobile
fix 1 all nve
fix 2 flow temp/rescale 200 1.0 1.0 0.02 1.0
fix_modify 2 temp mobile
compute mobile flow temp
velocity flow create 1.0 482748 temp mobile
fix 1 all nve
fix 2 flow temp/rescale 200 1.0 1.0 0.02 1.0
fix_modify 2 temp mobile

# Poiselle flow

velocity boundary set 0.0 0.0 0.0
fix 3 lower setforce 0.0 0.0 0.0
fix 4 upper setforce 0.0 NULL 0.0
fix 5 upper aveforce 0.0 -0.5 0.0
fix 6 flow addforce 1.0 0.0 0.0
velocity boundary set 0.0 0.0 0.0
fix 3 lower setforce 0.0 0.0 0.0
fix 4 upper setforce 0.0 NULL 0.0
fix 5 upper aveforce 0.0 -0.5 0.0
fix 6 flow addforce 1.0 0.0 0.0

# 2 obstacles

region void1 sphere 10 4 0 3
delete_atoms region void1
region void2 sphere 20 7 0 3
delete_atoms region void2
region void1 sphere 10 4 0 3
delete_atoms region void1
region void2 sphere 20 7 0 3
delete_atoms region void2

fix 7 flow indent 100 sphere 10 4 0 4
fix 8 flow indent 100 sphere 20 7 0 4
fix 9 all enforce2d
fix 7 flow indent 100 sphere 10 4 0 4
fix 8 flow indent 100 sphere 20 7 0 4
fix 9 all enforce2d

# Run

timestep 0.003
thermo 1000
thermo_modify temp mobile
timestep 0.003
thermo 1000
thermo_modify temp mobile

# select atoms to trace and assign atom type 4 so they have a different color (yellow)
region trace block 2 3 1.25 8.75 INF INF
Expand All @@ -74,8 +74,8 @@ set group trace type 4
# create trajectory lines by averaging positions over 10 MD steps each 10 steps apart
fix lines trace graphics/lines 10 10 100 25
# visualize the trace in silver with a diameter of 0.6 which is half of that of the atoms
dump viz all image 100 obstacle-*.png type type size 800 600 zoom 2.5 center s 0.50 0.7 0 &
dump viz all image 100 obstacle-*.ppm type type size 800 600 zoom 2.5 center s 0.50 0.7 0 &
shiny 0.5 fsaa yes box no 0.025 fix lines const 1 0.6
dump_modify viz pad 6 backcolor darkgray adiam * 1.2 fcolor lines silver

run 30000
run 30000
Loading