Skip to content

Add new fix graphics/isosurface command#4823

Merged
akohlmey merged 137 commits intolammps:developfrom
akohlmey:add-fix-graphics-surface
Jan 16, 2026
Merged

Add new fix graphics/isosurface command#4823
akohlmey merged 137 commits intolammps:developfrom
akohlmey:add-fix-graphics-surface

Conversation

@akohlmey
Copy link
Member

@akohlmey akohlmey commented Jan 1, 2026

Summary

This pull request adds a new fix graphics/isosurface command which allows to add an isosurface visualization of per-atom data to dump 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_modify for dump_image in 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

  • 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

image-000000220 myimage4-000000000

This comment was marked as resolved.

@akohlmey akohlmey changed the title Add new fix graphics/surface command Add new fix graphics/isosurface command Jan 1, 2026
@akohlmey akohlmey marked this pull request as ready for review January 1, 2026 23:45
@akohlmey akohlmey moved this from In Progress to Ready for Review or Merge in LAMMPS Pull Requests Jan 2, 2026
@akohlmey akohlmey mentioned this pull request Jan 6, 2026
9 tasks
@akohlmey akohlmey added this to the Feature Release January 2026 milestone Jan 14, 2026
@akohlmey akohlmey merged commit 2c0726c into lammps:develop Jan 16, 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 Jan 16, 2026
@akohlmey akohlmey deleted the add-fix-graphics-surface branch January 16, 2026 17:34
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.

1 participant