Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
260 commits
Select commit Hold shift + click to select a range
b049e99
unwrap some lines
akohlmey Dec 20, 2025
3f1347b
cosmetic
akohlmey Dec 20, 2025
fbdcccf
refactor dump image support in body style rounded polygon
akohlmey Dec 20, 2025
1a24ba6
update docs
akohlmey Dec 20, 2025
af6d9fb
small corrections
akohlmey Dec 20, 2025
6349bcc
shift triangles when displaying both edges and faces so they are flush
akohlmey Dec 20, 2025
63c5498
remove dead code
akohlmey Dec 20, 2025
065e604
silence compiler warnings
akohlmey Dec 20, 2025
a227b73
Merge branch 'collected-small-fixes' into visualize-body-faces
akohlmey Dec 20, 2025
436cd81
refactor ellipsoid construction for more code sharing and less redund…
akohlmey Dec 21, 2025
b26882c
fix off-by-one bug
akohlmey Dec 21, 2025
1de1ff4
fix indexing bug
akohlmey Dec 21, 2025
b054068
add support for rendering ellipsoids
akohlmey Dec 21, 2025
edc18bd
add docs for ellipsoid support in dump image
akohlmey Dec 21, 2025
eeb2651
spelling
akohlmey Dec 21, 2025
854636e
use upper case for constants
akohlmey Dec 21, 2025
9f24836
make docs consistent
akohlmey Dec 21, 2025
13b8248
since we removed std::move() we can move back to consistent ordering
akohlmey Dec 21, 2025
528c13f
small grammar fix
akohlmey Dec 21, 2025
a3b47b4
make handling of color and opacity consistent and document dump_modif…
akohlmey Dec 21, 2025
c4f3052
increment numerical version for development branch so it is larger th…
akohlmey Dec 21, 2025
f083d87
bug fix from Trung
akohlmey Dec 21, 2025
b9456ae
work around test failures due to incrementing numeric version for dev…
akohlmey Dec 21, 2025
d39af7c
ensure the progress bar indicator not of zero length to avoid artifacts
akohlmey Dec 22, 2025
4c648be
make documentation of color and transparency for wall fixes consistent
akohlmey Dec 22, 2025
6a7cb17
fix argument parsing bug
akohlmey Dec 22, 2025
30ff2af
lower resolution for fewer rounding artifacts
akohlmey Dec 22, 2025
db22615
change order of triangle corners for correct orientation of the surfa…
akohlmey Dec 22, 2025
868db28
draw an uncapped cylinder on top of the tiled object for a smoother o…
akohlmey Dec 22, 2025
6a20f22
add a small overlap when placing triangles on cones and cylinder surf…
akohlmey Dec 22, 2025
eedb9aa
add arrow graphics object and refactor vector functions
akohlmey Dec 22, 2025
83891f2
correct small documentation issues
akohlmey Dec 22, 2025
d830a6a
remove dead code
akohlmey Dec 22, 2025
8576771
improve image quality for ellipsoids and reduce artifacts when using …
akohlmey Dec 22, 2025
2e1dabc
make formatting consistent and add some comments
akohlmey Dec 22, 2025
7bfb1ee
skip the complexity of creating triangle mesh for real spheres
akohlmey Dec 22, 2025
7b67f07
fix typo
akohlmey Dec 22, 2025
1e2da66
add first prototype implementation of fix graphics/arrows
akohlmey Dec 23, 2025
ec0528e
update some docs
akohlmey Dec 23, 2025
f613e65
simplify
akohlmey Dec 23, 2025
7d5b0f4
implementation graphics/arrows for forces and velocities successfully…
akohlmey Dec 23, 2025
2940a4f
simplify
akohlmey Dec 23, 2025
71ce5c3
sync with docs
akohlmey Dec 23, 2025
f11a424
add support for atom- and equal-style variables to fix graphics/arrows
akohlmey Dec 23, 2025
2782f66
create better error message when using uninitialized data for variabl…
akohlmey Dec 23, 2025
7e1858f
revert incorrect changes
akohlmey Dec 23, 2025
b0ff736
avoid out-of-range access in more places
akohlmey Dec 23, 2025
99b498e
add optional *autoscale* keyword and document it
akohlmey Dec 23, 2025
7be5f45
add per-chunk arrows feature
akohlmey Dec 23, 2025
71df13d
implement corrections based on suggestions from GitHub Copilot
akohlmey Dec 23, 2025
182814e
add option to compute com/chunk to wrap the computed center of mass b…
akohlmey Dec 23, 2025
11d4af5
consolidate various ellipsoid construction functions into a single cl…
akohlmey Dec 24, 2025
22c9f66
refactor ArrowObj class to avoid excessive inline functions
akohlmey Dec 24, 2025
ac3a128
move abstract graphics object classes to ImageObjects namespace and s…
akohlmey Dec 24, 2025
2bfea9b
add ConeObj class refactor some others move a few definitions to header
akohlmey Dec 24, 2025
9060ad4
add comments and draw fewer cylinders for wireframe to reproduce prev…
akohlmey Dec 24, 2025
228920c
use ConeObj and combine handling visualization of "cone" and "cylinde…
akohlmey Dec 24, 2025
fe19b3a
combine processing of block and prism regions
akohlmey Dec 24, 2025
29e352f
enable and apply clang-format for code processing fixes and regions
akohlmey Dec 24, 2025
48ccfd8
make construct() functions real C++ constructors
akohlmey Dec 24, 2025
f070c73
remove unused constants
akohlmey Dec 24, 2025
48d6064
fix issues reported by GitHub Copilot
akohlmey Dec 24, 2025
eb92a7b
fix typo
akohlmey Dec 24, 2025
7ea2d51
Merge branch 'add-fix-graphics-arrows' into graphics-howto-and-region…
akohlmey Dec 24, 2025
87ccfae
make refine() a standalone local function so it can be reused
akohlmey Dec 24, 2025
32b8f79
add support for rendering plane regions. create oversize mesh and ski…
akohlmey Dec 24, 2025
da476c6
use a more regular mesh for planes
akohlmey Dec 25, 2025
3c54841
cosmetic changes. avoid "magic numbers". improve / correct comments.
akohlmey Dec 25, 2025
2e47657
reduce pixel gap artifacts for high resoluting triangle meshes
akohlmey Dec 25, 2025
3fbf441
apply some LAMMPS programming style conventions
akohlmey Dec 25, 2025
13d147b
do not increase size of the final ellipsoid object when using frame a…
akohlmey Dec 25, 2025
16ca6d7
reorder and make more compact. make use of temporary object more expl…
akohlmey Dec 25, 2025
d04fde0
use different triangle mesh resolution for wireframe and filled ellip…
akohlmey Dec 25, 2025
dcce1b3
use box bounds for triclinic cells to select which triangles to draw …
akohlmey Dec 25, 2025
d94eef9
improve comments
akohlmey Dec 25, 2025
6ce8b98
make minimum value for progress percentage small enough so it won't show
akohlmey Dec 25, 2025
90781be
also accept timestep 0 as valid step for fix graphics objects, needed…
akohlmey Dec 26, 2025
adae228
make local table of contents truly local
akohlmey Dec 26, 2025
3781393
add a few more dump image example images
akohlmey Dec 26, 2025
9518b11
move some dump image doc sections to Howto_viz.rst and update
akohlmey Dec 26, 2025
870993b
apply header section numbers for one more level
akohlmey Dec 27, 2025
c3c1de5
discuss computational cost and transparency
akohlmey Dec 27, 2025
45fc14a
discuss transparency. move list of fixes to howto
akohlmey Dec 27, 2025
6bad7f4
small tweaks
akohlmey Dec 27, 2025
f3b3156
add section about automatic bonds
akohlmey Dec 28, 2025
47915d3
add discussions about body and ellipsoid particles
akohlmey Dec 28, 2025
e7c0821
add support for (dynamic) groups to the image() function of fix reaxf…
akohlmey Dec 28, 2025
11c9775
small update
akohlmey Dec 28, 2025
9563ae0
update section on visualizing implicit bonds
akohlmey Dec 28, 2025
c9541ab
small tweaks
akohlmey Dec 28, 2025
1c5c2f5
change normal for triangles representing planes to have the correct c…
akohlmey Dec 29, 2025
1f8a0c8
must use Region::match() instead of Region::inside() for checking points
akohlmey Dec 29, 2025
012b92a
add details on visualizing regions (not yet complete)
akohlmey Dec 29, 2025
8bcc73c
expand macros to further reduce redundancy
akohlmey Dec 29, 2025
51a2ea2
temporarily turn off a region's openflag for draw style points.
akohlmey Dec 29, 2025
83f5176
add more info about visualizing regions and include pictures
akohlmey Dec 29, 2025
b4da007
fix missing length initialization for cylinder regions
akohlmey Dec 29, 2025
912389a
use double resolution for filled and transparent draw styles
akohlmey Dec 29, 2025
d185161
small corrections and updates
akohlmey Dec 29, 2025
a1062a0
undo triangle overlap hack as it creates too many artifacts
akohlmey Dec 29, 2025
9fb04e7
adjust triangle normals
akohlmey Dec 29, 2025
243d447
swap order of bottom and tip in input command as this is more "natural"
akohlmey Dec 29, 2025
04c1cae
correctly process arrow ratio
akohlmey Dec 29, 2025
c9f5cd4
update example for fix graphics
akohlmey Dec 29, 2025
766ee49
more docs for fix graphics objects
akohlmey Dec 29, 2025
972a5e6
small tweak for 2d systems
akohlmey Dec 29, 2025
f71f4c0
completed visualization Howto for now
akohlmey Dec 29, 2025
bfc05e0
highlight continuation character '&'
akohlmey Dec 29, 2025
d0aa4eb
add one more example image
akohlmey Dec 30, 2025
15b59a2
add prototype files for fix graphics/surface extracted from fix graphics
akohlmey Dec 30, 2025
4960d68
update phrasing
akohlmey Dec 30, 2025
52d4951
revise template code to have argument parsing implemented
akohlmey Dec 30, 2025
16ce5c4
minimal working version
akohlmey Dec 31, 2025
7ee88da
improved implementation: can use compute/fix/variable data, gaussian …
akohlmey Jan 1, 2026
4924a05
adjust some settings
akohlmey Jan 1, 2026
da69dab
one more tweak for choice of grid sizes
akohlmey Jan 1, 2026
1f63fbd
fix typo in marching cubes algorithm leading to artifacts
akohlmey Jan 1, 2026
95e2e93
always allocate table of element names. we may use them elsewhere
akohlmey Jan 1, 2026
f323d3b
always use global dump_modify selected opacity for fixes
akohlmey Jan 1, 2026
45486f8
re-introduce hack to minimize pixel gaps in triangle meshes at high r…
akohlmey Jan 1, 2026
3fb04bb
add fix graphics/surface to list of fixes with graphics
akohlmey Jan 1, 2026
f8f2e82
pre-compute CUTVAL to make it really a constant for compilers that do…
akohlmey Jan 1, 2026
3f62cb7
replace image of peptide example
akohlmey Jan 1, 2026
82b503a
rename fix graphics/surface to fix graphics/isosurface and move to sr…
akohlmey Jan 1, 2026
097dbc0
add support for output to STL files
akohlmey Jan 1, 2026
ce70648
add file format compatibility check and correct error message
akohlmey Jan 1, 2026
d4f1097
change colors for sodium and potassium to be more in line with common…
akohlmey Jan 2, 2026
9e4ca8b
add option to create a vertical color gradient as background for dump…
akohlmey Jan 2, 2026
2897dcb
add two examples for using isosurfaces including an option to show ho…
akohlmey Jan 2, 2026
bffcc30
alway initialize the element to color mapping so it can be used not o…
akohlmey Jan 2, 2026
f650747
always control the transparency of graphics from fixes with dump_modi…
akohlmey Jan 2, 2026
a4d04c4
document the simplified transparency handling and apply some other su…
akohlmey Jan 2, 2026
dd778b6
commit temporary changes
akohlmey Jan 3, 2026
972adf7
correct comment
akohlmey Jan 3, 2026
21a5603
add fix graphics/periodic command to add periodic images of atoms and…
akohlmey Jan 3, 2026
763be92
make fix sphere object inherid diameter from atom type if radius is n…
akohlmey Jan 3, 2026
348ee3d
add documentation for fix graphics/periodic
akohlmey Jan 3, 2026
4ebb4c7
fix typos
akohlmey Jan 3, 2026
04503f5
fix typo
akohlmey Jan 3, 2026
519b6c8
correct/complete syntax overview
akohlmey Jan 3, 2026
fa97ed5
add a draw_pixmap() method that scales and draws a pixmap at a given …
akohlmey Jan 4, 2026
763442e
add axis labels from scaled bitmaps using the newly added draw_pixmap…
akohlmey Jan 4, 2026
569daf7
update comments and rearrange code for readability. correct code for …
akohlmey Jan 4, 2026
2262917
handle pixmaps as Fix::image() object
akohlmey Jan 4, 2026
6374ec7
small improvements
akohlmey Jan 4, 2026
e91831b
add partial implementation of fix graphics/labels
akohlmey Jan 4, 2026
d42030c
update documentation
akohlmey Jan 4, 2026
b3a466b
include LAMMPS version info as comment in NetPBM pixmap files
akohlmey Jan 4, 2026
01648e3
add support for reading NetPBM files as ASCII text in addition to binary
akohlmey Jan 4, 2026
4769dd7
support reading position and size/scale from equal-style variables
akohlmey Jan 4, 2026
fd19492
small corrections
akohlmey Jan 4, 2026
0fb776f
select between file formats based on file extension
akohlmey Jan 4, 2026
4570c67
add support for reading PNG format images
akohlmey Jan 4, 2026
b81ee93
add support for text labels
akohlmey Jan 5, 2026
ad4d10d
fix memory and file pointer leak
akohlmey Jan 5, 2026
ddf8078
add a colored frame and some tricks to have consistent horizontal and…
akohlmey Jan 5, 2026
2be7809
fix bugs
akohlmey Jan 5, 2026
bd66065
support \$ escape from variable expansion
akohlmey Jan 5, 2026
510c9a6
add test case for backslash escape for variable expansion
akohlmey Jan 5, 2026
fd37245
add URL to gitlab repo and fix include guard typo
akohlmey Jan 5, 2026
529dab4
Allow text sizes larger than 64 by rasterizing the font at size 128 a…
akohlmey Jan 5, 2026
ec8a186
Merge branch 'graphics-howto-and-region-refactor' into combined-graph…
akohlmey Jan 6, 2026
2c0726c
Merge branch 'add-fix-graphics-surface' into combined-graphics-changes
akohlmey Jan 6, 2026
e565dbe
Merge branch 'add-fix-graphics-periodic' into combined-graphics-changes
akohlmey Jan 6, 2026
1574524
Merge branch 'add-fix-graphics-label' into combined-graphics-changes
akohlmey Jan 6, 2026
ddb1af9
rename fix graphics to fix graphics/objects for consistency with the …
akohlmey Jan 6, 2026
c6f0512
rename fix graphics in input example
akohlmey Jan 6, 2026
0fa7719
move dump image/movie and fix graphics/* and support classes to new G…
akohlmey Jan 7, 2026
ec15024
move sans font data to a separate include file
akohlmey Jan 7, 2026
9290860
use the Vera font requiring less than 6% memory of the FreeSans font
akohlmey Jan 7, 2026
b6e7b71
the vera font needs less extra space for the frame
akohlmey Jan 7, 2026
74c3b9d
reducing triangle overlap some more to reduce artifacts
akohlmey Jan 7, 2026
5e010b3
complete list of cython generated files
akohlmey Jan 8, 2026
5ac8e56
move region2vmd command to GRAPHICS package
akohlmey Jan 8, 2026
8b87453
discuss colors and provide examples for some standard cases
akohlmey Jan 8, 2026
b34685b
use a simpler, more representative example for the continuous color map
akohlmey Jan 8, 2026
dd12b0b
add alternate ArrowObj::draw() function using bottom and tip positions
akohlmey Jan 8, 2026
23b63bb
change axes display to use arrows instead of cylinders, improve label…
akohlmey Jan 8, 2026
6df3ddf
add support to pass a cone object from a fix to dump image
akohlmey Jan 8, 2026
356074c
apply clang-format
akohlmey Jan 8, 2026
4730371
render a spherical indenter as a circle in 2d
akohlmey Jan 8, 2026
074b75c
add visualization for a conical indenter
akohlmey Jan 8, 2026
707cddd
update image
akohlmey Jan 8, 2026
2e2f50c
add dump image support to fix wall/srd
akohlmey Jan 8, 2026
9dac47f
use FixWall::update_image_plane() instead of use a copy
akohlmey Jan 8, 2026
ac3851d
don't try to allocate data for wall graphics if there are no walls
akohlmey Jan 8, 2026
7130287
move cone side/cap constants to graphics.h
akohlmey Jan 8, 2026
790ab5f
avoid accessing colortype array out of bounds
akohlmey Jan 8, 2026
0b6243e
add support for coloring body particles by body index. check for vali…
akohlmey Jan 8, 2026
fa568a1
add dump image support to fix wall/body/polygon and remove zcylinder …
akohlmey Jan 8, 2026
6afc581
reject pixels with an invalid depth buffer (and thus would disallow o…
akohlmey Jan 8, 2026
744515f
dont draw z axis with 2d systems, some more small tweaks to axes disp…
akohlmey Jan 8, 2026
9c87693
update docs for expanded dump image support
akohlmey Jan 8, 2026
6521ad0
correct reference
akohlmey Jan 9, 2026
ad55fcf
correct normals for wall plane triangles in z-direction
akohlmey Jan 9, 2026
fda1c60
simplify
akohlmey Jan 9, 2026
f36f49d
add dump image support to fix wall/body/polyhedron and some refactoring
akohlmey Jan 9, 2026
d04337d
improve error messages
akohlmey Jan 9, 2026
37f61a4
tweak setting to reduce occasional single pixel gaps between triangles
akohlmey Jan 9, 2026
18053c3
exit draw routines early when there is nothing (left) to draw
akohlmey Jan 9, 2026
2482dad
remove triangle hack again as it is ineffective now
akohlmey Jan 9, 2026
ea6f6e9
coding style
akohlmey Jan 9, 2026
f11597a
update docs
akohlmey Jan 9, 2026
d36bac4
Correct Python_EXECUTABLE
EiPiFun Jan 9, 2026
61494e6
implement fixes suggested by static code analysis
akohlmey Jan 10, 2026
6c05fe2
a few more fixes from static code analysis
akohlmey Jan 10, 2026
683745e
initialize communicated dummy variable
akohlmey Jan 10, 2026
197da47
flag C-library required setjmp() calls for not triggering linter actions
akohlmey Jan 10, 2026
375ac8b
remove support for font options we cannot use
akohlmey Jan 10, 2026
6bee6df
remove dead code
akohlmey Jan 10, 2026
ef9f62f
remove obsolete doxygen configuration option
akohlmey Jan 10, 2026
ea94f58
update URL due to expired SSL certificate
akohlmey Jan 10, 2026
6d943c0
Revert "Correct Python_EXECUTABLE"
akohlmey Jan 11, 2026
b0f715f
use macros to reduce redundant code when parsing and processing varia…
akohlmey Jan 12, 2026
f3aea1d
add support for drawing (truncated) cone objects
akohlmey Jan 12, 2026
e65eeed
remove obsolete note
akohlmey Jan 13, 2026
b71e8a8
fix copy-n-modify bug in set image command
akohlmey Jan 13, 2026
bc4d008
use macro to reduce redundant code while processing variables as argu…
akohlmey Jan 13, 2026
1974f0c
apply clang-format
akohlmey Jan 13, 2026
d236cf9
add platform function to get a (relative) modification time stamp of …
akohlmey Jan 13, 2026
31c0ab0
increase numeric version for development and maintenance branch by 1
akohlmey Jan 13, 2026
169d9fd
support re-reading image file if it has been modified, improve info m…
akohlmey Jan 13, 2026
5f34c5a
update docs for re-reading image files and include commented example
akohlmey Jan 13, 2026
4e7bf9e
increase delay between file modifications
akohlmey Jan 13, 2026
1cb6d4c
correct indentation for correct numbering
akohlmey Jan 13, 2026
c4e7ffd
update for the inclusion of GRAPHICS in the basic packages list
akohlmey Jan 13, 2026
3b9790f
fix bugs
akohlmey Jan 14, 2026
737127f
add NONE flag for accessing an object that has not been set.
akohlmey Jan 14, 2026
51a06c5
avoid memory corruption and copying string without terminating null byte
akohlmey Jan 14, 2026
e00c694
replace pointless use of realloc with malloc
akohlmey Jan 14, 2026
1c8e983
convert SSFN error handling to use exceptions
akohlmey Jan 14, 2026
cec7315
remove unused SSFN functions
akohlmey Jan 14, 2026
439b6ed
convert SSFN C-style library to ScalableFont C++ class wrapper
akohlmey Jan 14, 2026
2b88169
whitespace
akohlmey Jan 14, 2026
3dfe44a
remove dead code
akohlmey Jan 14, 2026
1e7e2e6
some rewrites and add sections about using LAMMPS-GUI for prototyping
akohlmey Jan 14, 2026
fccee7c
include image with labels and arrows
akohlmey Jan 15, 2026
5317e57
update viz howto and body particles images
akohlmey Jan 15, 2026
e856c47
stop with an error when trying to change color and transparency for f…
akohlmey Jan 15, 2026
06f49b7
start examples/GRAPHICS folder with complete visualization inputs as …
akohlmey Jan 15, 2026
6122d2b
add section about CMake build targets and mention /fast targets
akohlmey Jan 15, 2026
73d2fa5
spelling
akohlmey Jan 15, 2026
3f3cc17
improve error messages
akohlmey Jan 15, 2026
e898a33
fix typo
akohlmey Jan 15, 2026
a54731f
improve error handling for color maps including error pointer
akohlmey Jan 16, 2026
636f881
a few more error message improvements
akohlmey Jan 16, 2026
3fabf1a
add new example input deck
akohlmey Jan 16, 2026
5ca36af
remove unused class member
akohlmey Jan 16, 2026
0b1feb8
add extract() API to Dump class, so we can get hold of the image clas…
akohlmey Jan 16, 2026
50e46be
Merge pull request #4828 from akohlmey/combined-graphics-changes
akohlmey Jan 16, 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
36 changes: 2 additions & 34 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ set(STANDARD_PACKAGES
EXTRA-MOLECULE
EXTRA-PAIR
FEP
GRAPHICS
GRANULAR
H5MD
INTERLAYER
Expand Down Expand Up @@ -533,29 +534,6 @@ if(PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR PKG_RHEO OR BUILD_TOOLS)
endif()
endif()

# tweak jpeg library names to avoid linker errors with MinGW cross-compilation
set(JPEG_NAMES libjpeg libjpeg-62)
find_package(JPEG QUIET)
option(WITH_JPEG "Enable JPEG support" ${JPEG_FOUND})
if(WITH_JPEG)
find_package(JPEG REQUIRED)
target_compile_definitions(lammps PRIVATE -DLAMMPS_JPEG)
target_link_libraries(lammps PRIVATE JPEG::JPEG)
endif()

find_package(PNG QUIET)
find_package(ZLIB QUIET)
if(PNG_FOUND AND ZLIB_FOUND)
option(WITH_PNG "Enable PNG support" ON)
else()
option(WITH_PNG "Enable PNG support" OFF)
endif()
if(WITH_PNG)
find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
target_link_libraries(lammps PRIVATE PNG::PNG ZLIB::ZLIB)
target_compile_definitions(lammps PRIVATE -DLAMMPS_PNG)
endif()

find_program(GZIP_EXECUTABLE gzip)
find_package_handle_standard_args(GZIP REQUIRED_VARS GZIP_EXECUTABLE)
Expand All @@ -568,16 +546,6 @@ if(WITH_GZIP)
endif()
endif()

find_program(FFMPEG_EXECUTABLE ffmpeg)
find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_EXECUTABLE)
option(WITH_FFMPEG "Enable FFMPEG support" ${FFMPEG_FOUND})
if(WITH_FFMPEG)
if(FFMPEG_FOUND OR ((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING))
target_compile_definitions(lammps PRIVATE -DLAMMPS_FFMPEG)
else()
message(FATAL_ERROR "ffmpeg executable not found")
endif()
endif()

if(BUILD_SHARED_LIBS)
set(CONFIGURE_REQUEST_PIC "--with-pic")
Expand All @@ -589,7 +557,7 @@ else()
set(CUDA_REQUEST_PIC)
endif()

foreach(PKG_WITH_INCL KSPACE PYTHON ML-IAP VORONOI COLVARS ML-HDNNP MDI MOLFILE NETCDF
foreach(PKG_WITH_INCL GRAPHICS KSPACE PYTHON ML-IAP VORONOI COLVARS ML-HDNNP MDI MOLFILE NETCDF
PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM COMPRESS ML-PACE LEPTON EXTRA-COMMAND)
if(PKG_${PKG_WITH_INCL})
include(Packages/${PKG_WITH_INCL})
Expand Down
34 changes: 34 additions & 0 deletions cmake/Modules/Packages/GRAPHICS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# tweak jpeg library names to avoid linker errors with MinGW cross-compilation
set(JPEG_NAMES libjpeg libjpeg-62)
find_package(JPEG QUIET)
option(WITH_JPEG "Enable JPEG support" ${JPEG_FOUND})
if(WITH_JPEG)
find_package(JPEG REQUIRED)
target_compile_definitions(lammps PRIVATE -DLAMMPS_JPEG)
target_link_libraries(lammps PRIVATE JPEG::JPEG)
endif()

find_package(PNG QUIET)
find_package(ZLIB QUIET)
if(PNG_FOUND AND ZLIB_FOUND)
option(WITH_PNG "Enable PNG support" ON)
else()
option(WITH_PNG "Enable PNG support" OFF)
endif()
if(WITH_PNG)
find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
target_link_libraries(lammps PRIVATE PNG::PNG ZLIB::ZLIB)
target_compile_definitions(lammps PRIVATE -DLAMMPS_PNG)
endif()

find_program(FFMPEG_EXECUTABLE ffmpeg)
find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_EXECUTABLE)
option(WITH_FFMPEG "Enable FFMPEG support" ${FFMPEG_FOUND})
if(WITH_FFMPEG)
if(FFMPEG_FOUND OR ((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING))
target_compile_definitions(lammps PRIVATE -DLAMMPS_FFMPEG)
else()
message(FATAL_ERROR "ffmpeg executable not found")
endif()
endif()
1 change: 1 addition & 0 deletions cmake/presets/all_off.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set(ALL_PACKAGES
EXTRA-PAIR
FEP
GPU
GRAPHICS
GRANULAR
H5MD
INTEL
Expand Down
1 change: 1 addition & 0 deletions cmake/presets/all_on.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ set(ALL_PACKAGES
EXTRA-PAIR
FEP
GPU
GRAPHICS
GRANULAR
H5MD
INTEL
Expand Down
2 changes: 1 addition & 1 deletion cmake/presets/basic.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# preset that turns on just a few, frequently used packages
# this will be compiled quickly and handle a lot of common inputs.

set(ALL_PACKAGES KSPACE MANYBODY MOLECULE RIGID)
set(ALL_PACKAGES GRAPHICS KSPACE MANYBODY MOLECULE RIGID)

foreach(PKG ${ALL_PACKAGES})
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
Expand Down
1 change: 1 addition & 0 deletions cmake/presets/mingw-cross.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ set(WIN_PACKAGES
EXTRA-PAIR
FEP
GPU
GRAPHICS
GRANULAR
INTERLAYER
KSPACE
Expand Down
1 change: 1 addition & 0 deletions cmake/presets/most.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ set(ALL_PACKAGES
EXTRA-MOLECULE
EXTRA-PAIR
FEP
GRAPHICS
GRANULAR
INTERLAYER
KSPACE
Expand Down
1 change: 1 addition & 0 deletions cmake/presets/windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ set(WIN_PACKAGES
EXTRA-MOLECULE
EXTRA-PAIR
FEP
GRAPHICS
GRANULAR
INTERLAYER
KSPACE
Expand Down
1 change: 0 additions & 1 deletion doc/doxygen/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ PROJECT_LOGO = lammps-logo.png
CREATE_SUBDIRS = NO
ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
OUTPUT_TEXT_DIRECTION = LTR

BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
Expand Down
2 changes: 1 addition & 1 deletion doc/src/Bibliography.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Bibliography
A Caro, DA Crowson, M Caro; Phys Rev Lett, 95, 075702 (2005)

**(CasP)**
CasP webpage: http://www.casp-program.org/
CasP webpage: https://lief.if.ufrgs.br/pub/CasP/

**(Cawkwell2012)**
A.\ M. N. Niklasson, M. J. Cawkwell, Phys. Rev. B, 86 (17), 174308 (2012).
Expand Down
38 changes: 37 additions & 1 deletion doc/src/Build_cmake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,42 @@ for IDEs like Eclipse, CodeBlocks, or Kate can be selected using the ``-G``
command-line flag. A list of available generator settings for your
specific CMake version is given when running ``cmake --help``.

.. _cmake_targets:

Build targets
^^^^^^^^^^^^^

The LAMMPS CMake files are set up to have multiple "targets", one for
each component that is set up to be built. If you do not provide an
explicit target when building, the target "all" is assumed. This should
build all configured targets and include re-running CMake to update the
build files when files have changed or new files were added which could
require updates in the build process. The most important individual
targets are "lammps" to build the LAMMPS library and "lmp" to build the
LAMMPS executable. If you want to selectively want to update only one
of them you can use the command:

.. code-block:: bash
cmake --build build --target lmp
Especially, when programming LAMMPS and you are making just local
changes, or only want to make certain that the code still compiles
and links, you may want to skip may of the extra steps that are
run by default and then append "/fast" to the target. Example:

.. code-block:: bash
cmake --build build --target lammps/fast
Note that this speeds up the build by skipping a lot of checks for
dependencies, and avoiding to re-run CMake, so you may occasionally need
to compile without the "/fast" suffix or use the "all" (= default)
target to update everything.

Some custom targets, e.g. "install-python" are explicitly excluded
from the "all" target and must be built individually.

.. _cmake_multiconfig:

Multi-configuration build systems
Expand All @@ -241,7 +277,7 @@ Multi-configuration build systems
Throughout this manual, it is mostly assumed that LAMMPS is being built
on a Unix-like operating system with "make" as the underlying "builder",
since this is the most common case. In this case the build
"configuration" is chose using ``-D CMAKE_BUILD_TYPE=<configuration>``
"configuration" is chosen using ``-D CMAKE_BUILD_TYPE=<configuration>``
with ``<configuration>`` being one of "Release", "Debug",
"RelWithDebInfo", or "MinSizeRel". Some build tools, however, can also
use or even require having a so-called multi-configuration build system
Expand Down
1 change: 1 addition & 0 deletions doc/src/Build_development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The build procedures in LAMMPS offers a few extra options which are
useful during development, testing or debugging.

.. contents::
:local:

----------

Expand Down
78 changes: 78 additions & 0 deletions doc/src/Build_extras.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ This is the list of packages that may require additional steps.
* :ref:`COLVARS <colvar>`
* :ref:`COMPRESS <compress>`
* :ref:`ELECTRODE <electrode>`
* :ref:`GRAPHICS <graphics>`
* :ref:`GPU <gpu>`
* :ref:`H5MD <h5md>`
* :ref:`INTEL <intel>`
Expand Down Expand Up @@ -110,6 +111,83 @@ versions use an incompatible API and thus LAMMPS will fail to compile.

----------

.. _graphics:

GRAPHICS package
----------------

.. versionadded:: TBD

*dump image*\ , *dump_movie* and supporting classes were moved to form
the new GRAPHICS package together with several *fix graphics/...* styles.

The :doc:`dump image <dump_image>` command has options to output JPEG or
PNG image files in addition to the default PPM format, and the :doc:`fix
graphics/labels <fix_graphics_labels>` can read images in JPEG or PNG
format in addition to PPM format files. Likewise, the :doc:`dump movie
<dump_image>` command outputs movie files in a variety of movie formats.
Using these additional options requires the following settings:

.. tabs::

.. tab:: CMake build

.. code-block:: bash

-D WITH_JPEG=value # yes or 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 development files,
# else no
-D WITH_FFMPEG=value # yes or no
# default = yes if CMake can find ffmpeg, 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 JPEG_INCLUDE_DIR=path # path to jpeglib.h header file
-D JPEG_LIBRARY=path # path to libjpeg.a (.so) file
-D PNG_INCLUDE_DIR=path # path to png.h header file
-D PNG_LIBRARY=path # path to libpng.a (.so) file
-D ZLIB_INCLUDE_DIR=path # path to zlib.h header file
-D ZLIB_LIBRARY=path # path to libz.a (.so) file
-D FFMPEG_EXECUTABLE=path # path to ffmpeg executable

.. tab:: Traditional make

.. code-block:: make

LMP_INC = -DLAMMPS_JPEG -DLAMMPS_PNG -DLAMMPS_FFMPEG <other LMP_INC settings>

JPG_INC = -I/usr/local/include # path to jpeglib.h, png.h, zlib.h headers
# if make cannot find them
JPG_PATH = -L/usr/lib # paths to libjpeg.a, libpng.a, libz.a (.so)
# files if make cannot find them
JPG_LIB = -ljpeg -lpng -lz # library names

As with CMake, you do not need to set ``JPG_INC`` or ``JPG_PATH``,
if make can find the graphics header and library files in their
default system locations. You must specify ``JPG_LIB`` with a
list of graphics libraries to include in the link. You must make
certain that the ffmpeg executable (or ffmpeg.exe on Windows) is
in a directory where LAMMPS can find it at runtime; that is
usually a directory list in your ``PATH`` environment variable.

Using ``ffmpeg`` to output movie files requires that your machine
supports the "popen" function in the standard runtime library.

.. note::

On some clusters with high-speed networks, using the fork()
library call (required by popen()) can interfere with the fast
communication library and lead to simulations using ffmpeg to hang or
crash.

----------

.. _gpu:

GPU package
Expand Down
6 changes: 3 additions & 3 deletions doc/src/Build_package.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ other files dependent on that package are also excluded.
however, if you downloaded a tarball, 3 packages (KSPACE, MANYBODY,
MOLECULE) were pre-installed via the traditional make procedure in
the ``src`` directory. That is no longer the case, so that CMake
will build as-is without needing to first uninstall those
packages. You can quickly include those packages (plus RIGID) by
will build as-is without needing to first uninstall those packages.
You can quickly include those packages (plus RIGID and GRAPHICS) by
using the "basic" preset with CMake or ``make yes-basic`` with
traditional make as discussed below.

Expand All @@ -174,7 +174,7 @@ make a copy of one of them and modify it to suit your needs.

.. code-block:: bash

# enable just a few core packages
# enable just a few core packages (MOLECULE, KSPACE, MANYBODY, RIGID, GRAPHICS)
cmake -C ../cmake/presets/basic.cmake [OPTIONS] ../cmake

# enable most packages
Expand Down
Loading