Skip to content

Add fix graphics/lines command to create trajectory lines#4876

Merged
akohlmey merged 14 commits into
lammps:developfrom
akohlmey:add-fix-graphics-lines
Feb 9, 2026
Merged

Add fix graphics/lines command to create trajectory lines#4876
akohlmey merged 14 commits into
lammps:developfrom
akohlmey:add-fix-graphics-lines

Conversation

@akohlmey

@akohlmey akohlmey commented Feb 6, 2026

Copy link
Copy Markdown
Member

Summary

This pull request adds a new fix graphics/lines command that computes a history of averaged atom positions and provides this information as a list of graphics objects that can be visualized with dump image as a chain of connected cylinders.

Related Issue(s)

#4844

Author(s)

Axel Kohlmeyer, Temple U

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Artificial Intelligence (AI) Tools Usage

By submitting this pull request, I confirm that I did NOT use any AI tools to generate
all or parts of the code and modifications in this pull request.

Backward Compatibility

N/A

Implementation Notes

Internally, this uses instances of compute property/atom, fix ave/atom and fix STORE/ATOM to do the heavy lifting of collecting the data. One particular challenge is that since both, this fix and fix ave/atom are run during modify->end_of_step(), their order needs to be reversed internally after creating both, so that the up-to-date averaged data can be used. This is currently achieved by clearing the bit for end_of_step() of the fix ave/atom instance and then calling it explicitly in end_of_step(). This needs special care when restarting.

Post Submission Checklist

  • The feature or features in this pull request is complete
  • Licensing information is complete
  • Corresponding author information is complete
  • The source code follows the LAMMPS formatting guidelines
  • Suitable new documentation files and/or updates to the existing docs are included
  • The added/updated documentation is integrated and tested with the documentation build system
  • The feature has been verified to work with the conventional build system
  • The feature has been verified to work with the CMake based build system

lines-end

lines

@akohlmey
akohlmey requested a review from Copilot February 6, 2026 11:11
@akohlmey akohlmey moved this to Ready for Review or Merge in LAMMPS Pull Requests Feb 6, 2026
@akohlmey
akohlmey marked this pull request as ready for review February 6, 2026 11:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new fix graphics/lines command to the GRAPHICS package that creates trajectory line visualizations in dump image output. The fix computes a history of averaged atom positions and renders them as chains of connected cylinders, similar to trajectory lines in visualization tools like OVITO. The implementation uses internal instances of compute property/atom, fix ave/atom, and fix STORE/ATOM to manage the data collection and storage, with special handling to ensure the fix ave/atom is called at the correct time during end_of_step processing.

Changes:

  • Adds new fix style fix graphics/lines with position history tracking and cylinder-based trajectory visualization
  • Includes comprehensive documentation with examples, restart support, and integration with dump image
  • Updates .gitignore, false-positives spelling list, and cross-references in other GRAPHICS fix documentation

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/GRAPHICS/fix_graphics_lines.h Header file declaring the FixGraphicsLines class with internal fix/compute management
src/GRAPHICS/fix_graphics_lines.cpp Implementation with position averaging, history storage, and graphics object generation
src/.gitignore Adds fix_graphics_lines.cpp and .h to gitignore for traditional build system
doc/utils/sphinx-config/false_positives.txt Adds "Nlength" to spelling exceptions
doc/src/fix_graphics_lines.rst New documentation file with syntax, examples, and detailed description
doc/src/fix_graphics_periodic.rst Adds cross-reference to fix graphics/lines
doc/src/fix_graphics_objects.rst Adds cross-reference to fix graphics/lines
doc/src/fix_graphics_labels.rst Adds cross-reference to fix graphics/lines
doc/src/fix_graphics_isosurface.rst Adds cross-reference to fix graphics/lines
doc/src/fix.rst Adds fix graphics/lines to the main fix command list
doc/src/Howto_viz.rst Adds fix graphics/lines to visualization how-to guide
doc/src/Commands_fix.rst Adds fix graphics/lines to alphabetical command list

Comment thread src/GRAPHICS/fix_graphics_lines.cpp
Comment thread doc/src/fix_graphics_lines.rst Outdated
Comment thread src/GRAPHICS/fix_graphics_lines.cpp Outdated
Comment thread src/GRAPHICS/fix_graphics_lines.cpp
Comment thread src/GRAPHICS/fix_graphics_lines.cpp
Comment thread src/GRAPHICS/fix_graphics_lines.cpp

@athomps athomps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I approve.

@akohlmey
akohlmey merged commit cc267c8 into lammps:develop Feb 9, 2026
14 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for Review or Merge to Done in LAMMPS Pull Requests Feb 9, 2026
@akohlmey
akohlmey deleted the add-fix-graphics-lines branch February 9, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

3 participants