Files
lammps/doc/html/Modify_contribute.html
2025-01-13 14:55:48 +00:00

290 lines
19 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>3.2. Submitting new features for inclusion in LAMMPS &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinx-design.min.css" type="text/css" />
<link rel="stylesheet" href="_static/css/lammps.css" type="text/css" />
<link rel="shortcut icon" href="_static/lammps.ico"/>
<link rel="canonical" href="https://docs.lammps.org/Modify_contribute.html" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=5929fcd5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/design-tabs.js?v=f930bc37"></script>
<script async="async" src="_static/mathjax/es5/tex-mml-chtml.js?v=cadf963e"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="3.3. Requirements for contributions to LAMMPS" href="Modify_requirements.html" />
<link rel="prev" title="3.1. Overview" href="Modify_overview.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="Manual.html">
<img src="_static/lammps-logo.png" class="logo" alt="Logo"/>
</a>
<div class="lammps_version">Version: <b>19 Nov 2024</b></div>
<div class="lammps_release">git info: </div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">User Guide</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="Intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Install.html">2. Install LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Build.html">3. Build LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Run_head.html">4. Run LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Commands.html">5. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Packages.html">6. Optional packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Speed.html">7. Accelerate performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Howto.html">8. Howto discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Examples.html">9. Example scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="Tools.html">10. Auxiliary tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Errors.html">11. Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Programmer Guide</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="Library.html">1. LAMMPS Library Interfaces</a></li>
<li class="toctree-l1"><a class="reference internal" href="Python_head.html">2. Use Python with LAMMPS</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="Modify.html">3. Modifying &amp; extending LAMMPS</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="Modify_overview.html">3.1. Overview</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">3.2. Submitting new features for inclusion in LAMMPS</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#communication-with-the-lammps-developers">3.2.1. Communication with the LAMMPS developers</a></li>
<li class="toctree-l3"><a class="reference internal" href="#time-and-effort-required">3.2.2. Time and effort required</a></li>
<li class="toctree-l3"><a class="reference internal" href="#submission-procedure">3.2.3. Submission procedure</a></li>
<li class="toctree-l3"><a class="reference internal" href="#external-contributions">3.2.4. External contributions</a></li>
<li class="toctree-l3"><a class="reference internal" href="#location-of-files-individual-files-and-packages">3.2.5. Location of files: individual files and packages</a></li>
<li class="toctree-l3"><a class="reference internal" href="#changes-to-core-lammps-files">3.2.6. Changes to core LAMMPS files</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="Modify_requirements.html">3.3. Requirements for contributions to LAMMPS</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_style.html">3.4. LAMMPS programming style</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_atom.html">3.5. Atom styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_pair.html">3.6. Pair styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_bond.html">3.7. Bond, angle, dihedral, improper styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_compute.html">3.8. Compute styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_fix.html">3.9. Fix styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_command.html">3.10. Input script command style</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_dump.html">3.11. Dump styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_kspace.html">3.12. Kspace styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_min.html">3.13. Minimization styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_region.html">3.14. Region styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_body.html">3.15. Body styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_gran_sub_mod.html">3.16. Granular Sub-Model styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_thermo.html">3.17. Thermodynamic output options</a></li>
<li class="toctree-l2"><a class="reference internal" href="Modify_variable.html">3.18. Variable options</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Developer.html">4. Information for Developers</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Command Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="commands_list.html">Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="fixes.html">Fix Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="computes.html">Compute Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="pairs.html">Pair Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="bonds.html">Bond Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="angles.html">Angle Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="dihedrals.html">Dihedral Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="impropers.html">Improper Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="dumps.html">Dump Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="fix_modify_atc_commands.html">fix_modify AtC commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Bibliography.html">Bibliography</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="Manual.html">LAMMPS</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content style-external-links">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="Modify.html"><span class="section-number">3. </span>Modifying &amp; extending LAMMPS</a></li>
<li class="breadcrumb-item active"><span class="section-number">3.2. </span>Submitting new features for inclusion in LAMMPS</li>
<li class="wy-breadcrumbs-aside">
<a href="https://www.lammps.org"><img src="_static/lammps-logo.png" width="64" height="16" alt="LAMMPS Homepage"></a> | <a href="Commands_all.html">Commands</a>
</li>
</ul><div class="rst-breadcrumbs-buttons" role="navigation" aria-label="Sequential page navigation">
<a href="Modify_overview.html" class="btn btn-neutral float-left" title="3.1. Overview" accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="Modify_requirements.html" class="btn btn-neutral float-right" title="3.3. Requirements for contributions to LAMMPS" accesskey="n">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<p><span class="math notranslate nohighlight">\(\renewcommand{\AA}{\text{Å}}\)</span></p>
<section id="submitting-new-features-for-inclusion-in-lammps">
<h1><span class="section-number">3.2. </span>Submitting new features for inclusion in LAMMPS<a class="headerlink" href="#submitting-new-features-for-inclusion-in-lammps" title="Link to this heading"></a></h1>
<p>We encourage LAMMPS users to submit new features they write for LAMMPS
to be included in the LAMMPS distribution and thus become easily
accessible to all LAMMPS users. The LAMMPS source code is managed
with git and public development is hosted on <a class="reference external" href="https://github.com/lammps/lammps">GitHub</a>. You can monitor the repository
to be notified of releases, follow the ongoing development, and
comment on topics of interest to you.</p>
<p>This section contains general information regarding the preparation
and submission of new features to LAMMPS. If you are new to
development in LAMMPS, we recommend you read one of the tutorials on
developing a new <a class="reference internal" href="Developer_write_pair.html"><span class="doc">pair style</span></a> or <a class="reference internal" href="Developer_write_fix.html"><span class="doc">fix
style</span></a> which provide a friendly introduction to
what LAMMPS development entails and common vocabulary used on this
section.</p>
<section id="communication-with-the-lammps-developers">
<h2><span class="section-number">3.2.1. </span>Communication with the LAMMPS developers<a class="headerlink" href="#communication-with-the-lammps-developers" title="Link to this heading"></a></h2>
<p>For any larger modifications or programming project, you are
encouraged to contact the LAMMPS developers ahead of time to discuss
implementation strategies. That will make it easier to integrate your
contribution and typically results in less work for everyone involved.
You are also encouraged to search through the list of <a class="reference external" href="https://github.com/lammps/lammps/issues">open issues on
GitHub</a> and submit a new
issue for a planned feature, to avoid duplicating work (and possibly
being scooped).</p>
<p>For informal communication with the LAMMPS developers, you may ask to
join the <a class="reference external" href="https://lammps.slack.com">LAMMPS developers on Slack</a>.
This slack work space is by invitation only. For access, please send
an e-mail to <code class="docutils literal notranslate"><span class="pre">slack&#64;lammps.org</span></code> explaining what part of LAMMPS you
are working on. Only discussions related to LAMMPS development are
tolerated in that work space, so this is <strong>NOT</strong> for people looking
for help with compiling, installing, or using LAMMPS. Please post a
message to the <a class="reference external" href="https://www.lammps.org/forum.html">LAMMPS forum</a> for
those purposes.</p>
</section>
<section id="time-and-effort-required">
<h2><span class="section-number">3.2.2. </span>Time and effort required<a class="headerlink" href="#time-and-effort-required" title="Link to this heading"></a></h2>
<p>How quickly your contribution will be integrated can vary widely. It
depends largely on how much effort is required by the LAMMPS
developers to integrate and test it, if any and what kind of changes
to the core code are required, how quickly you can address them, and
how much interest the contribution is to the larger LAMMPS
community. This process can be streamlined by following the
<a class="reference internal" href="Modify_requirements.html"><span class="doc">requirements</span></a> and <a class="reference internal" href="Modify_style.html"><span class="doc">style
guidelines</span></a>. A small, modular, well written
contribution may be integrated within hours, but a complex change that
requires a re-design of a core functionality in LAMMPS can take months
before inclusion (though this is rare).</p>
</section>
<section id="submission-procedure">
<h2><span class="section-number">3.2.3. </span>Submission procedure<a class="headerlink" href="#submission-procedure" title="Link to this heading"></a></h2>
<p>All changes to LAMMPS (including those from LAMMPS developers) are
integrated via pull requests on GitHub and cannot be merged without
passing the automated testing and an approving review by a LAMMPS core
developer. Before submitting your contribution, you should therefore
first ensure that your added or modified code compiles and works
correctly with the latest development version of LAMMPS and contains
all bug fixes from it.</p>
<p>Once you have prepared everything, see the <a class="reference internal" href="Howto_github.html"><span class="doc">LAMMPS GitHub
Tutorial</span></a> page for instructions on how to submit your
changes or new files through a GitHub pull request. If you are unable
or unwilling to submit via GitHub yourself, you may also send patch
files or full files to the <a class="reference external" href="https://www.lammps.org/authors.html">LAMMPS developers</a> and ask them to submit a pull
request on GitHub on your behalf. If this is the case, create a
gzipped tar file of all new or changed files or a corresponding patch
file using diff -u or diff -c format and compress it with gzip.
Please only use gzip compression, as this works well and is available
on all platforms. This mode of submission may delay the integration
as it depends more on the LAMMPS developers.</p>
</section>
<section id="external-contributions">
<h2><span class="section-number">3.2.4. </span>External contributions<a class="headerlink" href="#external-contributions" title="Link to this heading"></a></h2>
<p>If you prefer to do so, you can also develop and support your add-on
feature <strong>without</strong> having it included in the LAMMPS distribution, for
example as a download from a website of your own. See the <a class="reference external" href="https://www.lammps.org/external.html">External
LAMMPS packages and tools</a>
page of the LAMMPS website for examples of groups that do this. We
are happy to advertise your package and website from that page.
Simply email the <a class="reference external" href="https://www.lammps.org/authors.html">developers</a>
with info about your package, and we will post it there. We recommend
naming external packages USER-&lt;name&gt; so they can be easily
distinguished from packages in the LAMMPS distribution which do not
have the USER- prefix.</p>
</section>
<section id="location-of-files-individual-files-and-packages">
<h2><span class="section-number">3.2.5. </span>Location of files: individual files and packages<a class="headerlink" href="#location-of-files-individual-files-and-packages" title="Link to this heading"></a></h2>
<p>We rarely accept new styles in the core src folder. Thus, please
review the list of <a class="reference internal" href="Packages_details.html"><span class="doc">available Packages</span></a> to see
if your contribution should be added to one of them. It should fit
into the general purpose of that package. If it does not fit well, it
may be added to one of the EXTRA- packages or the MISC package.</p>
<p>However, if your project includes many related features that are not
covered by one of the existing packages or is dependent on a library
(bundled or external), it is best to create a new package with its own
directory (with a name like FOO). In addition to your new files, the
directory should contain a README text file containing your name and
contact information and a brief description of what your new package
does.</p>
</section>
<section id="changes-to-core-lammps-files">
<h2><span class="section-number">3.2.6. </span>Changes to core LAMMPS files<a class="headerlink" href="#changes-to-core-lammps-files" title="Link to this heading"></a></h2>
<p>If designed correctly, most additions do not require any changes to
the core code of LAMMPS; they are simply add-on files that are
compiled with the rest of LAMMPS. To make those styles work, you may
need some trivial changes to the core code. An example of a trivial
change is making a parent-class method “virtual” when you derive a new
child class from it. If your features involve more substantive
changes to the core LAMMPS files, it is particularly encouraged that
you communicate with the LAMMPS developers early in development.</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="Modify_overview.html" class="btn btn-neutral float-left" title="3.1. Overview" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="Modify_requirements.html" class="btn btn-neutral float-right" title="3.3. Requirements for contributions to LAMMPS" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2003-2025 Sandia Corporation.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(false);
});
</script>
</body>
</html>