Logo
Version: latest
git info: 30Mar2026-316-gee93998fe5

User Guide

  • 1. Introduction
  • 2. Install LAMMPS
  • 3. Build LAMMPS
  • 4. Run LAMMPS
  • 5. Errors
  • 6. Commands
  • 7. Accelerate performance
  • 8. Optional packages
  • 9. Auxiliary tools
  • 10. Howto discussions
  • 11. Example scripts

Programmer Guide

  • 1. LAMMPS Library Interfaces
  • 2. Use Python with LAMMPS
  • 3. Modifying & extending LAMMPS
  • 4. Information for Developers
    • 4.1. Source files
    • 4.2. Class topology
    • 4.3. Code design
    • 4.4. Parallel algorithms
    • 4.5. Accessing per-atom data
    • 4.6. Communication patterns
    • 4.7. How a timestep works
    • 4.8. Writing new styles
      • 4.8.1. Writing new pair styles
      • 4.8.2. Package and build system considerations
      • 4.8.3. Case 1: a pairwise additive model
      • 4.8.4. Case 2: a many-body potential
      • 4.8.5. Case 3: a potential requiring communication
      • 4.8.6. Case 4: potentials without a compute() function
      • 4.8.7. Writing new bond, angle, dihedral, and improper styles
      • 4.8.8. Case 1: Implementing a bond style
      • 4.8.9. Case 2: Implementing an angle style
      • 4.8.10. Case 3: Implementing a dihedral style
      • 4.8.11. Case 4: Implementing an improper style
      • 4.8.12. Writing a new fix style
      • 4.8.13. Writing new compute styles
      • 4.8.14. Case 1: A global scalar compute
      • 4.8.15. Case 2: A per-atom compute
      • 4.8.16. Notes on flags and output types
      • 4.8.17. Writing a new command style
      • 4.8.18. Case 1: Implementing the geturl command
    • 4.9. Notes for developers and code maintainers
    • 4.10. Notes for updating code written for older LAMMPS versions
    • 4.11. Writing plugins
    • 4.12. Adding tests for unit testing
    • 4.13. C++ base classes
    • 4.14. Platform abstraction functions
    • 4.15. Utility functions
    • 4.16. Special Math functions
    • 4.17. Tokenizer classes
    • 4.18. Argument parsing classes
    • 4.19. Safe pointer classes
    • 4.20. File reader classes
    • 4.21. Type label support
    • 4.22. Memory pool classes
    • 4.23. Eigensolver functions
    • 4.24. Communication buffer coding with ubuf
    • 4.25. Internal Styles
    • 4.26. Use of distributed grids within style classes

Command Reference

  • Commands
  • Fix Styles
  • Compute Styles
  • Pair Styles
  • Bond Styles
  • Angle Styles
  • Dihedral Styles
  • Improper Styles
  • Dump Styles
  • Bibliography
Index
LAMMPS
  • 4. Information for Developers
  • 4.8. Writing new styles
  • LAMMPS Homepage | Commands
Previous Next

\(\renewcommand{\AA}{\text{Å}}\)

4.8. Writing new styles

The Modifying & extending LAMMPS section of the manual gives an overview of how LAMMPS can be extended by writing new classes that derive from existing parent classes in LAMMPS. Here, some specific coding details are provided for writing code for LAMMPS.

  • 4.8.1. Writing new pair styles
  • 4.8.2. Package and build system considerations
  • 4.8.3. Case 1: a pairwise additive model
  • 4.8.4. Case 2: a many-body potential
  • 4.8.5. Case 3: a potential requiring communication
  • 4.8.6. Case 4: potentials without a compute() function
  • 4.8.7. Writing new bond, angle, dihedral, and improper styles
  • 4.8.8. Case 1: Implementing a bond style
  • 4.8.9. Case 2: Implementing an angle style
  • 4.8.10. Case 3: Implementing a dihedral style
  • 4.8.11. Case 4: Implementing an improper style
  • 4.8.12. Writing a new fix style
  • 4.8.13. Writing new compute styles
  • 4.8.14. Case 1: A global scalar compute
  • 4.8.15. Case 2: A per-atom compute
  • 4.8.16. Notes on flags and output types
  • 4.8.17. Writing a new command style
  • 4.8.18. Case 1: Implementing the geturl command
Previous Next

© Copyright 2003-2026 Sandia Corporation.

Built with Sphinx using a theme provided by Read the Docs.
Version latest
LAMMPS Branch:
develop
stable
release
Downloads:
PDF
Source
Git Info:
30Mar2026-316-gee93998fe5