Add new fix graphics/isosurface command#4823
Merged
akohlmey merged 137 commits intolammps:developfrom Jan 16, 2026
Merged
Conversation
9 tasks
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/isosurfacecommand which allows to add an isosurface visualization of per-atom data todump image. The isosurface can be created at different grid resolutions and with either a wireframe grid or a triangle mesh.In addition and "backcolor2" option was added to
dump_modifyfordump_imagein order to enable having a linear vertical color gradient as background (see attached image below).Related Issue(s)
This pull request is based on PR #4820, which in turn is based on PR #4819 which is based on #4817 which extends #4812. It thus contains the changes from all of them and thus has to be merged after #4820. After merging of the earlier pull requests, the list of changes will be reduced and this pull request will become easier to review.
Author(s)
Axel Kohlmeyer, Temple U
The marching cubes implementation uses tables available from multiple public domain sources.
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
The isosurface computation is parallelized with MPI using the domain decomposition. Each MPI rank computes its own triangulated surface on a grid that slightly extends beyond the processes subdomain. However, triangles that are outside the subdomain are ignored to avoid bogus surfaces at the subdomain boundaries. Also, ghost atoms can contribute to the property density grid where the contribution is inside the local grid. For that purpose, the per-atom data is copied from the local atoms to a local array and then a forward communication is performed to make the data available on ghost atoms.
For high grid resolutions, the distribution of the per-atom data to the grid can take considerable time and therefore this step has been parallelized with OpenMP.
Post Submission Checklist