Add fix graphics/lines command to create trajectory lines#4876
Merged
Conversation
Contributor
There was a problem hiding this comment.
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/lineswith 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 |
…no averaging is done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds a new
fix graphics/linescommand that computes a history of averaged atom positions and provides this information as a list of graphics objects that can be visualized withdump imageas 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/atomandfix STORE/ATOMto do the heavy lifting of collecting the data. One particular challenge is that since both, this fix andfix ave/atomare run duringmodify->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 thefix ave/atominstance and then calling it explicitly in end_of_step(). This needs special care when restarting.Post Submission Checklist