Page MenuHomec4science

No OneTemporary

File Metadata

Created
Wed, Jun 18, 08:30
This file is larger than 256 KB, so syntax highlighting was skipped.
This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
diff --git a/doc/Manual.html b/doc/Manual.html
index 576e8ea8a..6e78a39a3 100644
--- a/doc/Manual.html
+++ b/doc/Manual.html
@@ -1,471 +1,471 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LAMMPS Documentation &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<link rel="next" title="1. Introduction" href="Section_intro.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="#" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="#">LAMMPS</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="#">Docs</a> &raquo;</li>
<li>LAMMPS Documentation</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
<div class="rst-footer-buttons" style="margin-bottom: 1em" role="navigation" aria-label="footer navigation">
<a href="Section_intro.html" class="btn btn-neutral float-right" title="1. Introduction" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
</div>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<H1></H1><div class="section" id="lammps-documentation">
<h1>LAMMPS-ICMS Documentation<a class="headerlink" href="#lammps-documentation" title="Permalink to this headline">¶</a></h1>
-<div class="section" id="dec-2015-version">
-<h2>19 Dec 2015 version<a class="headerlink" href="#dec-2015-version" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="jan-2016-version">
+<h2>22 Jan 2016 version<a class="headerlink" href="#jan-2016-version" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="version-info">
<h2>Version info:<a class="headerlink" href="#version-info" title="Permalink to this headline">¶</a></h2>
<p>The LAMMPS &#8220;version&#8221; is the date when it was released, such as 1 May
2010. LAMMPS is updated continuously. Whenever we fix a bug or add a
feature, we release it immediately, and post a notice on <a class="reference external" href="http://lammps.sandia.gov/bug.html">this page of the WWW site</a>. Each dated copy of LAMMPS contains all the
features and bug-fixes up to and including that version date. The
version date is printed to the screen and logfile every time you run
LAMMPS. It is also in the file src/version.h and in the LAMMPS
directory name created when you unpack a tarball, and at the top of
the first page of the manual (this page).</p>
<p>LAMMPS-ICMS is an experimental variant of LAMMPS with additional
features made available for testing before they will be submitted
for inclusion into the official LAMMPS tree. The source code is
based on the official LAMMPS svn repository mirror at the Institute
for Computational Molecular Science at Temple University and generally
kept up-to-date as much as possible. Sometimes, e.g. when additional
development work is needed to adapt the upstream changes into
LAMMPS-ICMS it can take longer until synchronization; and occasionally,
e.g. in case of the rewrite of the multi-threading support, the
development will be halted except for important bugfixes until
all features of LAMMPS-ICMS fully compatible with the upstream
version or replaced by alternate implementations.</p>
<ul class="simple">
<li>If you browse the HTML doc pages on the LAMMPS WWW site, they always
describe the most current version of LAMMPS.</li>
<li>If you browse the HTML doc pages included in your tarball, they
describe the version you have, however, not all new features in
LAMMPS-ICMS are documented immediately.</li>
<li>The <a class="reference external" href="Manual.pdf">PDF file</a> on the WWW site or in the tarball is updated
about once per month. This is because it is large, and we don&#8217;t want
it to be part of every patch.</li>
<li>There is also a <a class="reference external" href="Developer.pdf">Developer.pdf</a> file in the doc
directory, which describes the internal structure and algorithms of
LAMMPS.</li>
</ul>
<p>LAMMPS stands for Large-scale Atomic/Molecular Massively Parallel
Simulator.</p>
<p>LAMMPS is a classical molecular dynamics simulation code designed to
run efficiently on parallel computers. It was developed at Sandia
National Laboratories, a US Department of Energy facility, with
funding from the DOE. It is an open-source code, distributed freely
under the terms of the GNU Public License (GPL).</p>
<p>The primary developers of LAMMPS are <a class="reference external" href="http://www.sandia.gov/~sjplimp">Steve Plimpton</a>, Aidan
Thompson, and Paul Crozier who can be contacted at
sjplimp,athomps,pscrozi at sandia.gov. The <a class="reference external" href="http://lammps.sandia.gov">LAMMPS WWW Site</a> at
<a class="reference external" href="http://lammps.sandia.gov">http://lammps.sandia.gov</a> has more information about the code and its
uses.</p>
<hr class="docutils" />
<p>The LAMMPS documentation is organized into the following sections. If
you find errors or omissions in this manual or have suggestions for
useful information to add, please send an email to the developers so
we can improve the LAMMPS documentation.</p>
<p>Once you are familiar with LAMMPS, you may want to bookmark <a class="reference internal" href="Section_commands.html#comm"><span>this page</span></a> at Section_commands.html#comm since
it gives quick access to documentation for all LAMMPS commands.</p>
<p><a class="reference external" href="Manual.pdf">PDF file</a> of the entire manual, generated by
<a class="reference external" href="http://freecode.com/projects/htmldoc">htmldoc</a></p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Section_intro.html#what-is-lammps">1.1. What is LAMMPS</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_intro.html#lammps-features">1.2. LAMMPS features</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_intro.html#lammps-non-features">1.3. LAMMPS non-features</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_intro.html#open-source-distribution">1.4. Open source distribution</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_intro.html#acknowledgments-and-citations">1.5. Acknowledgments and citations</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Section_start.html#what-s-in-the-lammps-distribution">2.1. What&#8217;s in the LAMMPS distribution</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_start.html#making-lammps">2.2. Making LAMMPS</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_start.html#making-lammps-with-optional-packages">2.3. Making LAMMPS with optional packages</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_start.html#building-lammps-via-the-make-py-tool">2.4. Building LAMMPS via the Make.py tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_start.html#building-lammps-as-a-library">2.5. Building LAMMPS as a library</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_start.html#running-lammps">2.6. Running LAMMPS</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_start.html#command-line-options">2.7. Command-line options</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_start.html#lammps-screen-output">2.8. LAMMPS screen output</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_start.html#tips-for-users-of-previous-lammps-versions">2.9. Tips for users of previous LAMMPS versions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#lammps-input-script">3.1. LAMMPS input script</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#parsing-rules">3.2. Parsing rules</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#input-script-structure">3.3. Input script structure</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#commands-listed-by-category">3.4. Commands listed by category</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#individual-commands">3.5. Individual commands</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#fix-styles">3.6. Fix styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#compute-styles">3.7. Compute styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#pair-style-potentials">3.8. Pair_style potentials</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#bond-style-potentials">3.9. Bond_style potentials</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#angle-style-potentials">3.10. Angle_style potentials</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#dihedral-style-potentials">3.11. Dihedral_style potentials</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#improper-style-potentials">3.12. Improper_style potentials</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_commands.html#kspace-solvers">3.13. Kspace solvers</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#standard-packages">4.1. Standard packages</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#build-instructions-for-compress-package">4.2. Build instructions for COMPRESS package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#build-instructions-for-gpu-package">4.3. Build instructions for GPU package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#build-instructions-for-kim-package">4.4. Build instructions for KIM package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#build-instructions-for-kokkos-package">4.5. Build instructions for KOKKOS package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#build-instructions-for-kspace-package">4.6. Build instructions for KSPACE package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#build-instructions-for-meam-package">4.7. Build instructions for MEAM package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#build-instructions-for-poems-package">4.8. Build instructions for POEMS package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#build-instructions-for-python-package">4.9. Build instructions for PYTHON package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#build-instructions-for-reax-package">4.10. Build instructions for REAX package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#build-instructions-for-voronoi-package">4.11. Build instructions for VORONOI package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#build-instructions-for-xtc-package">4.12. Build instructions for XTC package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-packages">4.13. User packages</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-atc-package">4.14. USER-ATC package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-awpmd-package">4.15. USER-AWPMD package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-cg-cmm-package">4.16. USER-CG-CMM package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-colvars-package">4.17. USER-COLVARS package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-cuda-package">4.18. USER-CUDA package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-diffraction-package">4.19. USER-DIFFRACTION package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-drude-package">4.20. USER-DRUDE package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-eff-package">4.21. USER-EFF package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-fep-package">4.22. USER-FEP package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-h5md-package">4.23. USER-H5MD package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-intel-package">4.24. USER-INTEL package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-lb-package">4.25. USER-LB package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-mgpt-package">4.26. USER-MGPT package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-misc-package">4.27. USER-MISC package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-molfile-package">4.28. USER-MOLFILE package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-omp-package">4.29. USER-OMP package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-phonon-package">4.30. USER-PHONON package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-qmmm-package">4.31. USER-QMMM package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-qtb-package">4.32. USER-QTB package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-reaxc-package">4.33. USER-REAXC package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-smd-package">4.34. USER-SMD package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-smtbq-package">4.35. USER-SMTBQ package</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_packages.html#user-sph-package">4.36. USER-SPH package</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Section_accelerate.html#measuring-performance">5.1. Measuring performance</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_accelerate.html#general-strategies">5.2. General strategies</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_accelerate.html#packages-with-optimized-styles">5.3. Packages with optimized styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_accelerate.html#comparison-of-various-accelerator-packages">5.4. Comparison of various accelerator packages</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#restarting-a-simulation">6.1. Restarting a simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#d-simulations">6.2. 2d simulations</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#charmm-amber-and-dreiding-force-fields">6.3. CHARMM, AMBER, and DREIDING force fields</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#running-multiple-simulations-from-one-input-script">6.4. Running multiple simulations from one input script</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#multi-replica-simulations">6.5. Multi-replica simulations</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#granular-models">6.6. Granular models</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#tip3p-water-model">6.7. TIP3P water model</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#tip4p-water-model">6.8. TIP4P water model</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#spc-water-model">6.9. SPC water model</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#coupling-lammps-to-other-codes">6.10. Coupling LAMMPS to other codes</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#visualizing-lammps-snapshots">6.11. Visualizing LAMMPS snapshots</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#triclinic-non-orthogonal-simulation-boxes">6.12. Triclinic (non-orthogonal) simulation boxes</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#nemd-simulations">6.13. NEMD simulations</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#finite-size-spherical-and-aspherical-particles">6.14. Finite-size spherical and aspherical particles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#output-from-lammps-thermo-dumps-computes-fixes-variables">6.15. Output from LAMMPS (thermo, dumps, computes, fixes, variables)</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#thermostatting-barostatting-and-computing-temperature">6.16. Thermostatting, barostatting, and computing temperature</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#walls">6.17. Walls</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#elastic-constants">6.18. Elastic constants</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#library-interface-to-lammps">6.19. Library interface to LAMMPS</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#calculating-thermal-conductivity">6.20. Calculating thermal conductivity</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#calculating-viscosity">6.21. Calculating viscosity</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#calculating-a-diffusion-coefficient">6.22. Calculating a diffusion coefficient</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#using-chunks-to-calculate-system-properties">6.23. Using chunks to calculate system properties</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#setting-parameters-for-the-kspace-style-pppm-disp-command">6.24. Setting parameters for the <code class="docutils literal"><span class="pre">kspace_style</span> <span class="pre">pppm/disp</span></code> command</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#polarizable-models">6.25. Polarizable models</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#adiabatic-core-shell-model">6.26. Adiabatic core/shell model</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_howto.html#drude-induced-dipoles">6.27. Drude induced dipoles</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#amber2lmp-tool">9.1. amber2lmp tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#binary2txt-tool">9.2. binary2txt tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#ch2lmp-tool">9.3. ch2lmp tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#chain-tool">9.4. chain tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#colvars-tools">9.5. colvars tools</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#createatoms-tool">9.6. createatoms tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#data2xmovie-tool">9.7. data2xmovie tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#eam-database-tool">9.8. eam database tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#eam-generate-tool">9.9. eam generate tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#eff-tool">9.10. eff tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#emacs-tool">9.11. emacs tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#fep-tool">9.12. fep tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#i-pi-tool">9.13. i-pi tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#ipp-tool">9.14. ipp tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#kate-tool">9.15. kate tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#lmp2arc-tool">9.16. lmp2arc tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#lmp2cfg-tool">9.17. lmp2cfg tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#lmp2vmd-tool">9.18. lmp2vmd tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#matlab-tool">9.19. matlab tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#micelle2d-tool">9.20. micelle2d tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#moltemplate-tool">9.21. moltemplate tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#msi2lmp-tool">9.22. msi2lmp tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#phonon-tool">9.23. phonon tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#polymer-bonding-tool">9.24. polymer bonding tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#pymol-asphere-tool">9.25. pymol_asphere tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#python-tool">9.26. python tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#reax-tool">9.27. reax tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#restart2data-tool">9.28. restart2data tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#vim-tool">9.29. vim tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#xmgrace-tool">9.30. xmgrace tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_tools.html#xmovie-tool">9.31. xmovie tool</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#atom-styles">10.1. Atom styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#bond-angle-dihedral-improper-potentials">10.2. Bond, angle, dihedral, improper potentials</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#compute-styles">10.3. Compute styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#dump-styles">10.4. Dump styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#dump-custom-output-options">10.5. Dump custom output options</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#fix-styles">10.6. Fix styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#input-script-commands">10.7. Input script commands</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#kspace-computations">10.8. Kspace computations</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#minimization-styles">10.9. Minimization styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#pairwise-potentials">10.10. Pairwise potentials</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#region-styles">10.11. Region styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#body-styles">10.12. Body styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#thermodynamic-output-options">10.13. Thermodynamic output options</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#variable-options">10.14. Variable options</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_modify.html#submitting-new-features-for-inclusion-in-lammps">10.15. Submitting new features for inclusion in LAMMPS</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Section_python.html#overview-of-running-lammps-from-python">11.1. Overview of running LAMMPS from Python</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_python.html#overview-of-using-python-from-a-lammps-script">11.2. Overview of using Python from a LAMMPS script</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_python.html#building-lammps-as-a-shared-library">11.3. Building LAMMPS as a shared library</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_python.html#installing-the-python-wrapper-into-python">11.4. Installing the Python wrapper into Python</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_python.html#extending-python-with-mpi-to-run-in-parallel">11.5. Extending Python with MPI to run in parallel</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_python.html#testing-the-python-lammps-interface">11.6. Testing the Python-LAMMPS interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_python.html#using-lammps-from-python">11.7. Using LAMMPS from Python</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_python.html#example-python-scripts-that-use-lammps">11.8. Example Python scripts that use LAMMPS</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Section_errors.html#common-problems">12.1. Common problems</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_errors.html#reporting-bugs">12.2. Reporting bugs</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_errors.html#error-warning-messages">12.3. Error &amp; warning messages</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_errors.html#error">12.4. Errors:</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_errors.html#warnings">12.5. Warnings:</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Section_history.html#coming-attractions">13.1. Coming attractions</a></li>
<li class="toctree-l2"><a class="reference internal" href="Section_history.html#past-versions">13.2. Past versions</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
<ul class="simple">
<li><a class="reference internal" href="genindex.html"><span>Index</span></a></li>
<li><a class="reference internal" href="search.html"><span>Search Page</span></a></li>
</ul>
</BODY></div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="Section_intro.html" class="btn btn-neutral float-right" title="1. Introduction" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/Manual.txt b/doc/Manual.txt
index f8e4297d2..5d0af215b 100644
--- a/doc/Manual.txt
+++ b/doc/Manual.txt
@@ -1,319 +1,319 @@
<!-- HTML_ONLY -->
<HEAD>
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
-<META NAME="docnumber" CONTENT="19 Dec 2015 version">
+<META NAME="docnumber" CONTENT="22 Jan 2016 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
<BODY>
<!-- END_HTML_ONLY -->
"LAMMPS WWW Site"_lws - "LAMMPS-ICMS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
<H1></H1>
LAMMPS-ICMS Documentation :c,h3
-19 Dec 2015 version :c,h4
+22 Jan 2016 version :c,h4
Version info: :h4
The LAMMPS "version" is the date when it was released, such as 1 May
2010. LAMMPS is updated continuously. Whenever we fix a bug or add a
feature, we release it immediately, and post a notice on "this page of
the WWW site"_bug. Each dated copy of LAMMPS contains all the
features and bug-fixes up to and including that version date. The
version date is printed to the screen and logfile every time you run
LAMMPS. It is also in the file src/version.h and in the LAMMPS
directory name created when you unpack a tarball, and at the top of
the first page of the manual (this page).
LAMMPS-ICMS is an experimental variant of LAMMPS with additional
features made available for testing before they will be submitted
for inclusion into the official LAMMPS tree. The source code is
based on the official LAMMPS svn repository mirror at the Institute
for Computational Molecular Science at Temple University and generally
kept up-to-date as much as possible. Sometimes, e.g. when additional
development work is needed to adapt the upstream changes into
LAMMPS-ICMS it can take longer until synchronization; and occasionally,
e.g. in case of the rewrite of the multi-threading support, the
development will be halted except for important bugfixes until
all features of LAMMPS-ICMS fully compatible with the upstream
version or replaced by alternate implementations.
If you browse the HTML doc pages on the LAMMPS WWW site, they always
describe the most current version of upstream LAMMPS, but may be
missing some new features in LAMMPS-ICMS. :ulb,l
If you browse the HTML doc pages included in your tarball, they
describe the version you have, however, not all new features in
LAMMPS-ICMS are documented immediately. :l
The "PDF file"_Manual.pdf on the WWW site or in the tarball is updated
about once per month. This is because it is large, and we don't want
it to be part of every patch. :l
There is also a "Developer.pdf"_Developer.pdf file in the doc
directory, which describes the internal structure and algorithms of
LAMMPS. :ule,l
LAMMPS stands for Large-scale Atomic/Molecular Massively Parallel
Simulator.
LAMMPS is a classical molecular dynamics simulation code designed to
run efficiently on parallel computers. It was developed at Sandia
National Laboratories, a US Department of Energy facility, with
funding from the DOE. It is an open-source code, distributed freely
under the terms of the GNU Public License (GPL).
The primary developers of LAMMPS are "Steve Plimpton"_sjp, Aidan
Thompson, and Paul Crozier who can be contacted at
sjplimp,athomps,pscrozi at sandia.gov. The "LAMMPS WWW Site"_lws at
http://lammps.sandia.gov has more information about the code and its
uses.
:link(bug,http://lammps.sandia.gov/bug.html)
:link(sjp,http://www.sandia.gov/~sjplimp)
:line
The LAMMPS documentation is organized into the following sections. If
you find errors or omissions in this manual or have suggestions for
useful information to add, please send an email to the developers so
we can improve the LAMMPS documentation.
Once you are familiar with LAMMPS, you may want to bookmark "this
page"_Section_commands.html#comm at Section_commands.html#comm since
it gives quick access to documentation for all LAMMPS commands.
"PDF file"_Manual.pdf of the entire manual, generated by
"htmldoc"_http://freecode.com/projects/htmldoc
<!-- RST
.. toctree::
:maxdepth: 2
:numbered:
Section_intro
Section_start
Section_commands
Section_packages
Section_accelerate
Section_howto
Section_example
Section_perf
Section_tools
Section_modify
Section_python
Section_errors
Section_history
Indices and tables
==================
* :ref:`genindex`
* :ref:`search`
END_RST -->
<!-- HTML_ONLY -->
"Introduction"_Section_intro.html :olb,l
1.1 "What is LAMMPS"_intro_1 :ulb,b
1.2 "LAMMPS features"_intro_2 :b
1.3 "LAMMPS non-features"_intro_3 :b
1.4 "Open source distribution"_intro_4 :b
1.5 "Acknowledgments and citations"_intro_5 :ule,b
"Getting started"_Section_start.html :l
2.1 "What's in the LAMMPS distribution"_start_1 :ulb,b
2.2 "Making LAMMPS"_start_2 :b
2.3 "Making LAMMPS with optional packages"_start_3 :b
2.4 "Building LAMMPS via the Make.py script"_start_4 :b
2.5 "Building LAMMPS as a library"_start_5 :b
2.6 "Running LAMMPS"_start_6 :b
2.7 "Command-line options"_start_7 :b
2.8 "Screen output"_start_8 :b
2.9 "Tips for users of previous versions"_start_9 :ule,b
"Commands"_Section_commands.html :l
3.1 "LAMMPS input script"_cmd_1 :ulb,b
3.2 "Parsing rules"_cmd_2 :b
3.3 "Input script structure"_cmd_3 :b
3.4 "Commands listed by category"_cmd_4 :b
3.5 "Commands listed alphabetically"_cmd_5 :ule,b
"Packages"_Section_packages.html :l
4.1 "Standard packages"_pkg_1 :ulb,b
4.2 "User packages"_pkg_2 :ule,b
"Accelerating LAMMPS performance"_Section_accelerate.html :l
5.1 "Measuring performance"_acc_1 :ulb,b
5.2 "Algorithms and code options to boost performace"_acc_2 :b
5.3 "Accelerator packages with optimized styles"_acc_3 :b
5.3.1 "USER-CUDA package"_accelerate_cuda.html :ulb,b
5.3.2 "GPU package"_accelerate_gpu.html :b
5.3.3 "USER-INTEL package"_accelerate_intel.html :b
5.3.4 "KOKKOS package"_accelerate_kokkos.html :b
5.3.5 "USER-OMP package"_accelerate_omp.html :b
5.3.6 "OPT package"_accelerate_opt.html :ule,b
5.4 "Comparison of various accelerator packages"_acc_4 :ule,b
"How-to discussions"_Section_howto.html :l
6.1 "Restarting a simulation"_howto_1 :ulb,b
6.2 "2d simulations"_howto_2 :b
6.3 "CHARMM and AMBER force fields"_howto_3 :b
6.4 "Running multiple simulations from one input script"_howto_4 :b
6.5 "Multi-replica simulations"_howto_5 :b
6.6 "Granular models"_howto_6 :b
6.7 "TIP3P water model"_howto_7 :b
6.8 "TIP4P water model"_howto_8 :b
6.9 "SPC water model"_howto_9 :b
6.10 "Coupling LAMMPS to other codes"_howto_10 :b
6.11 "Visualizing LAMMPS snapshots"_howto_11 :b
6.12 "Triclinic (non-orthogonal) simulation boxes"_howto_12 :b
6.13 "NEMD simulations"_howto_13 :b
6.14 "Finite-size spherical and aspherical particles"_howto_14 :b
6.15 "Output from LAMMPS (thermo, dumps, computes, fixes, variables)"_howto_15 :b
6.16 "Thermostatting, barostatting, and compute temperature"_howto_16 :b
6.17 "Walls"_howto_17 :b
6.18 "Elastic constants"_howto_18 :b
6.19 "Library interface to LAMMPS"_howto_19 :b
6.20 "Calculating thermal conductivity"_howto_20 :b
6.21 "Calculating viscosity"_howto_21 :b
6.22 "Calculating a diffusion coefficient"_howto_22 :b
6.23 "Using chunks to calculate system properties"_howto_23 :b
6.24 "Setting parameters for pppm/disp"_howto_24 :b
6.25 "Polarizable models"_howto_25 :b
6.26 "Adiabatic core/shell model"_howto_26 :b
6.27 "Drude induced dipoles"_howto_27 :ule,b
"Example problems"_Section_example.html :l
"Performance & scalability"_Section_perf.html :l
"Additional tools"_Section_tools.html :l
"Modifying & extending LAMMPS"_Section_modify.html :l
10.1 "Atom styles"_mod_1 :ulb,b
10.2 "Bond, angle, dihedral, improper potentials"_mod_2 :b
10.3 "Compute styles"_mod_3 :b
10.4 "Dump styles"_mod_4 :b
10.5 "Dump custom output options"_mod_5 :b
10.6 "Fix styles"_mod_6 :b
10.7 "Input script commands"_mod_7 :b
10.8 "Kspace computations"_mod_8 :b
10.9 "Minimization styles"_mod_9 :b
10.10 "Pairwise potentials"_mod_10 :b
10.11 "Region styles"_mod_11 :b
10.12 "Body styles"_mod_12 :b
10.13 "Thermodynamic output options"_mod_13 :b
10.14 "Variable options"_mod_14 :b
10.15 "Submitting new features for inclusion in LAMMPS"_mod_15 :ule,b
"Python interface"_Section_python.html :l
11.1 "Overview of running LAMMPS from Python"_py_1 :ulb,b
11.2 "Overview of using Python from a LAMMPS script"_py_2 :b
11.3 "Building LAMMPS as a shared library"_py_3 :b
11.4 "Installing the Python wrapper into Python"_py_4 :b
11.5 "Extending Python with MPI to run in parallel"_py_5 :b
11.6 "Testing the Python-LAMMPS interface"_py_6 :b
11.7 "Using LAMMPS from Python"_py_7 :b
11.8 "Example Python scripts that use LAMMPS"_py_8 :ule,b
"Errors"_Section_errors.html :l
12.1 "Common problems"_err_1 :ulb,b
12.2 "Reporting bugs"_err_2 :b
12.3 "Error & warning messages"_err_3 :ule,b
"Future and history"_Section_history.html :l
13.1 "Coming attractions"_hist_1 :ulb,b
13.2 "Past versions"_hist_2 :ule,b
:ole
:link(intro_1,Section_intro.html#intro_1)
:link(intro_2,Section_intro.html#intro_2)
:link(intro_3,Section_intro.html#intro_3)
:link(intro_4,Section_intro.html#intro_4)
:link(intro_5,Section_intro.html#intro_5)
:link(start_1,Section_start.html#start_1)
:link(start_2,Section_start.html#start_2)
:link(start_3,Section_start.html#start_3)
:link(start_4,Section_start.html#start_4)
:link(start_5,Section_start.html#start_5)
:link(start_6,Section_start.html#start_6)
:link(start_7,Section_start.html#start_7)
:link(start_8,Section_start.html#start_8)
:link(start_9,Section_start.html#start_9)
:link(cmd_1,Section_commands.html#cmd_1)
:link(cmd_2,Section_commands.html#cmd_2)
:link(cmd_3,Section_commands.html#cmd_3)
:link(cmd_4,Section_commands.html#cmd_4)
:link(cmd_5,Section_commands.html#cmd_5)
:link(pkg_1,Section_packages.html#pkg_1)
:link(pkg_2,Section_packages.html#pkg_2)
:link(acc_1,Section_accelerate.html#acc_1)
:link(acc_2,Section_accelerate.html#acc_2)
:link(acc_3,Section_accelerate.html#acc_3)
:link(acc_4,Section_accelerate.html#acc_4)
:link(howto_1,Section_howto.html#howto_1)
:link(howto_2,Section_howto.html#howto_2)
:link(howto_3,Section_howto.html#howto_3)
:link(howto_4,Section_howto.html#howto_4)
:link(howto_5,Section_howto.html#howto_5)
:link(howto_6,Section_howto.html#howto_6)
:link(howto_7,Section_howto.html#howto_7)
:link(howto_8,Section_howto.html#howto_8)
:link(howto_9,Section_howto.html#howto_9)
:link(howto_10,Section_howto.html#howto_10)
:link(howto_11,Section_howto.html#howto_11)
:link(howto_12,Section_howto.html#howto_12)
:link(howto_13,Section_howto.html#howto_13)
:link(howto_14,Section_howto.html#howto_14)
:link(howto_15,Section_howto.html#howto_15)
:link(howto_16,Section_howto.html#howto_16)
:link(howto_17,Section_howto.html#howto_17)
:link(howto_18,Section_howto.html#howto_18)
:link(howto_19,Section_howto.html#howto_19)
:link(howto_20,Section_howto.html#howto_20)
:link(howto_21,Section_howto.html#howto_21)
:link(howto_22,Section_howto.html#howto_22)
:link(howto_23,Section_howto.html#howto_23)
:link(howto_24,Section_howto.html#howto_24)
:link(howto_25,Section_howto.html#howto_25)
:link(howto_26,Section_howto.html#howto_26)
:link(howto_27,Section_howto.html#howto_27)
:link(mod_1,Section_modify.html#mod_1)
:link(mod_2,Section_modify.html#mod_2)
:link(mod_3,Section_modify.html#mod_3)
:link(mod_4,Section_modify.html#mod_4)
:link(mod_5,Section_modify.html#mod_5)
:link(mod_6,Section_modify.html#mod_6)
:link(mod_7,Section_modify.html#mod_7)
:link(mod_8,Section_modify.html#mod_8)
:link(mod_9,Section_modify.html#mod_9)
:link(mod_10,Section_modify.html#mod_10)
:link(mod_11,Section_modify.html#mod_11)
:link(mod_12,Section_modify.html#mod_12)
:link(mod_13,Section_modify.html#mod_13)
:link(mod_14,Section_modify.html#mod_14)
:link(mod_15,Section_modify.html#mod_15)
:link(py_1,Section_python.html#py_1)
:link(py_2,Section_python.html#py_2)
:link(py_3,Section_python.html#py_3)
:link(py_4,Section_python.html#py_4)
:link(py_5,Section_python.html#py_5)
:link(py_6,Section_python.html#py_6)
:link(err_1,Section_errors.html#err_1)
:link(err_2,Section_errors.html#err_2)
:link(err_3,Section_errors.html#err_3)
:link(hist_1,Section_history.html#hist_1)
:link(hist_2,Section_history.html#hist_2)
<!-- END_HTML_ONLY -->
</BODY>
diff --git a/doc/Section_commands.html b/doc/Section_commands.html
index df5bf412b..f71b6c4d3 100644
--- a/doc/Section_commands.html
+++ b/doc/Section_commands.html
@@ -1,1536 +1,1536 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3. Commands &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<link rel="next" title="4. Packages" href="Section_packages.html"/>
<link rel="prev" title="2. Getting Started" href="Section_start.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">3. Commands</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#lammps-input-script">3.1. LAMMPS input script</a></li>
<li class="toctree-l2"><a class="reference internal" href="#parsing-rules">3.2. Parsing rules</a></li>
<li class="toctree-l2"><a class="reference internal" href="#input-script-structure">3.3. Input script structure</a></li>
<li class="toctree-l2"><a class="reference internal" href="#commands-listed-by-category">3.4. Commands listed by category</a></li>
<li class="toctree-l2"><a class="reference internal" href="#individual-commands">3.5. Individual commands</a></li>
<li class="toctree-l2"><a class="reference internal" href="#fix-styles">3.6. Fix styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="#compute-styles">3.7. Compute styles</a></li>
<li class="toctree-l2"><a class="reference internal" href="#pair-style-potentials">3.8. Pair_style potentials</a></li>
<li class="toctree-l2"><a class="reference internal" href="#bond-style-potentials">3.9. Bond_style potentials</a></li>
<li class="toctree-l2"><a class="reference internal" href="#angle-style-potentials">3.10. Angle_style potentials</a></li>
<li class="toctree-l2"><a class="reference internal" href="#dihedral-style-potentials">3.11. Dihedral_style potentials</a></li>
<li class="toctree-l2"><a class="reference internal" href="#improper-style-potentials">3.12. Improper_style potentials</a></li>
<li class="toctree-l2"><a class="reference internal" href="#kspace-solvers">3.13. Kspace solvers</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>3. Commands</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
<div class="rst-footer-buttons" style="margin-bottom: 1em" role="navigation" aria-label="footer navigation">
<a href="Section_packages.html" class="btn btn-neutral float-right" title="4. Packages" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="Section_start.html" class="btn btn-neutral" title="2. Getting Started" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="commands">
<h1>3. Commands<a class="headerlink" href="#commands" title="Permalink to this headline">¶</a></h1>
<p>This section describes how a LAMMPS input script is formatted and the
input script commands used to define a LAMMPS simulation.</p>
<div class="line-block">
<div class="line">3.1 <a class="reference internal" href="#cmd-1"><span>LAMMPS input script</span></a></div>
<div class="line">3.2 <a class="reference internal" href="#cmd-2"><span>Parsing rules</span></a></div>
<div class="line">3.3 <a class="reference internal" href="#cmd-3"><span>Input script structure</span></a></div>
<div class="line">3.4 <a class="reference internal" href="#cmd-4"><span>Commands listed by category</span></a></div>
<div class="line">3.5 <a class="reference internal" href="#cmd-5"><span>Commands listed alphabetically</span></a></div>
<div class="line"><br /></div>
</div>
<div class="section" id="lammps-input-script">
<span id="cmd-1"></span><h2>3.1. LAMMPS input script<a class="headerlink" href="#lammps-input-script" title="Permalink to this headline">¶</a></h2>
<p>LAMMPS executes by reading commands from a input script (text file),
one line at a time. When the input script ends, LAMMPS exits. Each
command causes LAMMPS to take some action. It may set an internal
variable, read in a file, or run a simulation. Most commands have
default settings, which means you only need to use the command if you
wish to change the default.</p>
<p>In many cases, the ordering of commands in an input script is not
important. However the following rules apply:</p>
<p>(1) LAMMPS does not read your entire input script and then perform a
simulation with all the settings. Rather, the input script is read
one line at a time and each command takes effect when it is read.
Thus this sequence of commands:</p>
<div class="highlight-python"><div class="highlight"><pre>timestep 0.5
run 100
run 100
</pre></div>
</div>
<p>does something different than this sequence:</p>
<div class="highlight-python"><div class="highlight"><pre>run 100
timestep 0.5
run 100
</pre></div>
</div>
<p>In the first case, the specified timestep (0.5 fmsec) is used for two
simulations of 100 timesteps each. In the 2nd case, the default
timestep (1.0 fmsec) is used for the 1st 100 step simulation and a 0.5
fmsec timestep is used for the 2nd one.</p>
<p>(2) Some commands are only valid when they follow other commands. For
example you cannot set the temperature of a group of atoms until atoms
have been defined and a group command is used to define which atoms
belong to the group.</p>
<p>(3) Sometimes command B will use values that can be set by command A.
This means command A must precede command B in the input script if it
is to have the desired effect. For example, the
<a class="reference internal" href="read_data.html"><em>read_data</em></a> command initializes the system by setting
up the simulation box and assigning atoms to processors. If default
values are not desired, the <a class="reference internal" href="processors.html"><em>processors</em></a> and
<a class="reference internal" href="boundary.html"><em>boundary</em></a> commands need to be used before read_data to
tell LAMMPS how to map processors to the simulation box.</p>
<p>Many input script errors are detected by LAMMPS and an ERROR or
WARNING message is printed. <a class="reference internal" href="Section_errors.html"><em>This section</em></a> gives
more information on what errors mean. The documentation for each
command lists restrictions on how the command can be used.</p>
<hr class="docutils" />
</div>
<div class="section" id="parsing-rules">
<span id="cmd-2"></span><h2>3.2. Parsing rules<a class="headerlink" href="#parsing-rules" title="Permalink to this headline">¶</a></h2>
<p>Each non-blank line in the input script is treated as a command.
LAMMPS commands are case sensitive. Command names are lower-case, as
are specified command arguments. Upper case letters may be used in
file names or user-chosen ID strings.</p>
<p>Here is how each line in the input script is parsed by LAMMPS:</p>
<p>(1) If the last printable character on the line is a &#8220;&amp;&#8221; character,
the command is assumed to continue on the next line. The next line is
concatenated to the previous line by removing the &#8220;&amp;&#8221; character and
line break. This allows long commands to be continued across two or
more lines. See the discussion of triple quotes in (6) for how to
continue a command across multiple line without using &#8220;&amp;&#8221; characters.</p>
<p>(2) All characters from the first &#8220;#&#8221; character onward are treated as
comment and discarded. See an exception in (6). Note that a
comment after a trailing &#8220;&amp;&#8221; character will prevent the command from
continuing on the next line. Also note that for multi-line commands a
single leading &#8220;#&#8221; will comment out the entire command.</p>
<p>(3) The line is searched repeatedly for $ characters, which indicate
variables that are replaced with a text string. See an exception in
(6).</p>
<p>If the $ is followed by curly brackets, then the variable name is the
text inside the curly brackets. If no curly brackets follow the $,
then the variable name is the single character immediately following
the $. Thus ${myTemp} and $x refer to variable names &#8220;myTemp&#8221; and
&#8220;x&#8221;.</p>
<p>How the variable is converted to a text string depends on what style
of variable it is; see the <a class="reference external" href="variable">variable</a> doc page for details.
It can be a variable that stores multiple text strings, and return one
of them. The returned text string can be multiple &#8220;words&#8221; (space
separated) which will then be interpreted as multiple arguments in the
input command. The variable can also store a numeric formula which
will be evaluated and its numeric result returned as a string.</p>
<p>As a special case, if the $ is followed by parenthesis, then the text
inside the parenthesis is treated as an &#8220;immediate&#8221; variable and
evaluated as an <a class="reference internal" href="variable.html"><em>equal-style variable</em></a>. This is a way
to use numeric formulas in an input script without having to assign
them to variable names. For example, these 3 input script lines:</p>
<div class="highlight-python"><div class="highlight"><pre>variable X equal (xlo+xhi)/2+sqrt(v_area)
region 1 block $X 2 INF INF EDGE EDGE
variable X delete
</pre></div>
</div>
<p>can be replaced by</p>
<div class="highlight-python"><div class="highlight"><pre>region 1 block $((xlo+xhi)/2+sqrt(v_area)) 2 INF INF EDGE EDGE
</pre></div>
</div>
<p>so that you do not have to define (or discard) a temporary variable X.</p>
<p>Note that neither the curly-bracket or immediate form of variables can
contain nested $ characters for other variables to substitute for.
Thus you cannot do this:</p>
<div class="highlight-python"><div class="highlight"><pre>variable a equal 2
variable b2 equal 4
print &quot;B2 = ${b$a}&quot;
</pre></div>
</div>
<p>Nor can you specify this $($x-1.0) for an immediate variable, but
you could use $(v_x-1.0), since the latter is valid syntax for an
<a class="reference internal" href="variable.html"><em>equal-style variable</em></a>.</p>
<p>See the <a class="reference internal" href="variable.html"><em>variable</em></a> command for more details of how
strings are assigned to variables and evaluated, and how they can be
used in input script commands.</p>
<p>(4) The line is broken into &#8220;words&#8221; separated by whitespace (tabs,
spaces). Note that words can thus contain letters, digits,
underscores, or punctuation characters.</p>
<p>(5) The first word is the command name. All successive words in the
line are arguments.</p>
<p>(6) If you want text with spaces to be treated as a single argument,
it can be enclosed in either single or double or triple quotes. A
long single argument enclosed in single or double quotes can span
multiple lines if the &#8220;&amp;&#8221; character is used, as described above. When
the lines are concatenated together (and the &#8220;&amp;&#8221; characters and line
breaks removed), the text will become a single line. If you want
multiple lines of an argument to retain their line breaks, the text
can be enclosed in triple quotes, in which case &#8220;&amp;&#8221; characters are not
needed. For example:</p>
<div class="highlight-python"><div class="highlight"><pre>print &quot;Volume = $v&quot;
print &#39;Volume = $v&#39;
if &quot;${steps} &gt; 1000&quot; then quit
variable a string &quot;red green blue &amp;
purple orange cyan&quot;
print &quot;&quot;&quot;
System volume = $v
System temperature = $t
&quot;&quot;&quot;
</pre></div>
</div>
<p>In each case, the single, double, or triple quotes are removed when
the single argument they enclose is stored internally.</p>
<p>See the <a class="reference internal" href="dump_modify.html"><em>dump modify format</em></a>, <a class="reference internal" href="print.html"><em>print</em></a>,
<a class="reference internal" href="if.html"><em>if</em></a>, and <a class="reference internal" href="python.html"><em>python</em></a> commands for examples.</p>
<p>A &#8220;#&#8221; or &#8220;$&#8221; character that is between quotes will not be treated as a
comment indicator in (2) or substituted for as a variable in (3).</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If the argument is itself a command that requires a quoted
argument (e.g. using a <a class="reference internal" href="print.html"><em>print</em></a> command as part of an
<a class="reference internal" href="if.html"><em>if</em></a> or <a class="reference internal" href="run.html"><em>run every</em></a> command), then single, double, or
triple quotes can be nested in the usual manner. See the doc pages
for those commands for examples. Only one of level of nesting is
allowed, but that should be sufficient for most use cases.</p>
</div>
<hr class="docutils" />
</div>
<div class="section" id="input-script-structure">
<span id="cmd-3"></span><h2>3.3. Input script structure<a class="headerlink" href="#input-script-structure" title="Permalink to this headline">¶</a></h2>
<p>This section describes the structure of a typical LAMMPS input script.
The &#8220;examples&#8221; directory in the LAMMPS distribution contains many
sample input scripts; the corresponding problems are discussed in
<a class="reference internal" href="Section_example.html"><em>Section_example</em></a>, and animated on the <a class="reference external" href="http://lammps.sandia.gov">LAMMPS WWW Site</a>.</p>
<p>A LAMMPS input script typically has 4 parts:</p>
<ol class="arabic simple">
<li>Initialization</li>
<li>Atom definition</li>
<li>Settings</li>
<li>Run a simulation</li>
</ol>
<p>The last 2 parts can be repeated as many times as desired. I.e. run a
simulation, change some settings, run some more, etc. Each of the 4
parts is now described in more detail. Remember that almost all the
commands need only be used if a non-default value is desired.</p>
<ol class="arabic simple">
<li>Initialization</li>
</ol>
<p>Set parameters that need to be defined before atoms are created or
read-in from a file.</p>
<p>The relevant commands are <a class="reference internal" href="units.html"><em>units</em></a>,
<a class="reference internal" href="dimension.html"><em>dimension</em></a>, <a class="reference internal" href="newton.html"><em>newton</em></a>,
<a class="reference internal" href="processors.html"><em>processors</em></a>, <a class="reference internal" href="boundary.html"><em>boundary</em></a>,
<a class="reference internal" href="atom_style.html"><em>atom_style</em></a>, <a class="reference internal" href="atom_modify.html"><em>atom_modify</em></a>.</p>
<p>If force-field parameters appear in the files that will be read, these
commands tell LAMMPS what kinds of force fields are being used:
<a class="reference internal" href="pair_style.html"><em>pair_style</em></a>, <a class="reference internal" href="bond_style.html"><em>bond_style</em></a>,
<a class="reference internal" href="angle_style.html"><em>angle_style</em></a>, <a class="reference internal" href="dihedral_style.html"><em>dihedral_style</em></a>,
<a class="reference internal" href="improper_style.html"><em>improper_style</em></a>.</p>
<ol class="arabic simple" start="2">
<li>Atom definition</li>
</ol>
<p>There are 3 ways to define atoms in LAMMPS. Read them in from a data
or restart file via the <a class="reference internal" href="read_data.html"><em>read_data</em></a> or
<a class="reference internal" href="read_restart.html"><em>read_restart</em></a> commands. These files can contain
molecular topology information. Or create atoms on a lattice (with no
molecular topology), using these commands: <a class="reference internal" href="lattice.html"><em>lattice</em></a>,
<a class="reference internal" href="region.html"><em>region</em></a>, <a class="reference internal" href="create_box.html"><em>create_box</em></a>,
<a class="reference internal" href="create_atoms.html"><em>create_atoms</em></a>. The entire set of atoms can be
duplicated to make a larger simulation using the
<a class="reference internal" href="replicate.html"><em>replicate</em></a> command.</p>
<ol class="arabic simple" start="3">
<li>Settings</li>
</ol>
<p>Once atoms and molecular topology are defined, a variety of settings
can be specified: force field coefficients, simulation parameters,
output options, etc.</p>
<p>Force field coefficients are set by these commands (they can also be
set in the read-in files): <a class="reference internal" href="pair_coeff.html"><em>pair_coeff</em></a>,
<a class="reference internal" href="bond_coeff.html"><em>bond_coeff</em></a>, <a class="reference internal" href="angle_coeff.html"><em>angle_coeff</em></a>,
<a class="reference internal" href="dihedral_coeff.html"><em>dihedral_coeff</em></a>,
<a class="reference internal" href="improper_coeff.html"><em>improper_coeff</em></a>,
<a class="reference internal" href="kspace_style.html"><em>kspace_style</em></a>, <a class="reference internal" href="dielectric.html"><em>dielectric</em></a>,
<a class="reference internal" href="special_bonds.html"><em>special_bonds</em></a>.</p>
<p>Various simulation parameters are set by these commands:
<a class="reference internal" href="neighbor.html"><em>neighbor</em></a>, <a class="reference internal" href="neigh_modify.html"><em>neigh_modify</em></a>,
<a class="reference internal" href="group.html"><em>group</em></a>, <a class="reference internal" href="timestep.html"><em>timestep</em></a>,
<a class="reference internal" href="reset_timestep.html"><em>reset_timestep</em></a>, <a class="reference internal" href="run_style.html"><em>run_style</em></a>,
<a class="reference internal" href="min_style.html"><em>min_style</em></a>, <a class="reference internal" href="min_modify.html"><em>min_modify</em></a>.</p>
<p>Fixes impose a variety of boundary conditions, time integration, and
diagnostic options. The <a class="reference internal" href="fix.html"><em>fix</em></a> command comes in many flavors.</p>
<p>Various computations can be specified for execution during a
simulation using the <a class="reference internal" href="compute.html"><em>compute</em></a>,
<a class="reference internal" href="compute_modify.html"><em>compute_modify</em></a>, and <a class="reference internal" href="variable.html"><em>variable</em></a>
commands.</p>
<p>Output options are set by the <a class="reference internal" href="thermo.html"><em>thermo</em></a>, <a class="reference internal" href="dump.html"><em>dump</em></a>,
and <a class="reference internal" href="restart.html"><em>restart</em></a> commands.</p>
<ol class="arabic simple" start="4">
<li>Run a simulation</li>
</ol>
<p>A molecular dynamics simulation is run using the <a class="reference internal" href="run.html"><em>run</em></a>
command. Energy minimization (molecular statics) is performed using
the <a class="reference internal" href="minimize.html"><em>minimize</em></a> command. A parallel tempering
(replica-exchange) simulation can be run using the
<a class="reference internal" href="temper.html"><em>temper</em></a> command.</p>
<hr class="docutils" />
</div>
<div class="section" id="commands-listed-by-category">
<span id="cmd-4"></span><h2>3.4. Commands listed by category<a class="headerlink" href="#commands-listed-by-category" title="Permalink to this headline">¶</a></h2>
<p>This section lists all LAMMPS commands, grouped by category. The
<a class="reference internal" href="#cmd-5"><span>next section</span></a> lists the same commands alphabetically. Note
that some style options for some commands are part of specific LAMMPS
packages, which means they cannot be used unless the package was
included when LAMMPS was built. Not all packages are included in a
default LAMMPS build. These dependencies are listed as Restrictions
in the command&#8217;s documentation.</p>
<p>Initialization:</p>
<p><a class="reference internal" href="atom_modify.html"><em>atom_modify</em></a>, <a class="reference internal" href="atom_style.html"><em>atom_style</em></a>,
<a class="reference internal" href="boundary.html"><em>boundary</em></a>, <a class="reference internal" href="dimension.html"><em>dimension</em></a>,
<a class="reference internal" href="newton.html"><em>newton</em></a>, <a class="reference internal" href="processors.html"><em>processors</em></a>, <a class="reference internal" href="units.html"><em>units</em></a></p>
<p>Atom definition:</p>
<p><a class="reference internal" href="create_atoms.html"><em>create_atoms</em></a>, <a class="reference internal" href="create_box.html"><em>create_box</em></a>,
<a class="reference internal" href="lattice.html"><em>lattice</em></a>, <a class="reference internal" href="read_data.html"><em>read_data</em></a>,
<a class="reference internal" href="read_dump.html"><em>read_dump</em></a>, <a class="reference internal" href="read_restart.html"><em>read_restart</em></a>,
<a class="reference internal" href="region.html"><em>region</em></a>, <a class="reference internal" href="replicate.html"><em>replicate</em></a></p>
<p>Force fields:</p>
<p><a class="reference internal" href="angle_coeff.html"><em>angle_coeff</em></a>, <a class="reference internal" href="angle_style.html"><em>angle_style</em></a>,
<a class="reference internal" href="bond_coeff.html"><em>bond_coeff</em></a>, <a class="reference internal" href="bond_style.html"><em>bond_style</em></a>,
<a class="reference internal" href="dielectric.html"><em>dielectric</em></a>, <a class="reference internal" href="dihedral_coeff.html"><em>dihedral_coeff</em></a>,
<a class="reference internal" href="dihedral_style.html"><em>dihedral_style</em></a>,
<a class="reference internal" href="improper_coeff.html"><em>improper_coeff</em></a>,
<a class="reference internal" href="improper_style.html"><em>improper_style</em></a>,
<a class="reference internal" href="kspace_modify.html"><em>kspace_modify</em></a>, <a class="reference internal" href="kspace_style.html"><em>kspace_style</em></a>,
<a class="reference internal" href="pair_coeff.html"><em>pair_coeff</em></a>, <a class="reference internal" href="pair_modify.html"><em>pair_modify</em></a>,
<a class="reference internal" href="pair_style.html"><em>pair_style</em></a>, <a class="reference internal" href="pair_write.html"><em>pair_write</em></a>,
<a class="reference internal" href="special_bonds.html"><em>special_bonds</em></a></p>
<p>Settings:</p>
<p><a class="reference internal" href="comm_style.html"><em>comm_style</em></a>, <a class="reference internal" href="group.html"><em>group</em></a>, <a class="reference internal" href="mass.html"><em>mass</em></a>,
<a class="reference internal" href="min_modify.html"><em>min_modify</em></a>, <a class="reference internal" href="min_style.html"><em>min_style</em></a>,
<a class="reference internal" href="neigh_modify.html"><em>neigh_modify</em></a>, <a class="reference internal" href="neighbor.html"><em>neighbor</em></a>,
<a class="reference internal" href="reset_timestep.html"><em>reset_timestep</em></a>, <a class="reference internal" href="run_style.html"><em>run_style</em></a>,
<a class="reference internal" href="set.html"><em>set</em></a>, <a class="reference internal" href="timestep.html"><em>timestep</em></a>, <a class="reference internal" href="velocity.html"><em>velocity</em></a></p>
<p>Fixes:</p>
<p><a class="reference internal" href="fix.html"><em>fix</em></a>, <a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a>, <a class="reference internal" href="unfix.html"><em>unfix</em></a></p>
<p>Computes:</p>
<p><a class="reference internal" href="compute.html"><em>compute</em></a>, <a class="reference internal" href="compute_modify.html"><em>compute_modify</em></a>,
<a class="reference internal" href="uncompute.html"><em>uncompute</em></a></p>
<p>Output:</p>
<p><a class="reference internal" href="dump.html"><em>dump</em></a>, <a class="reference internal" href="dump_image.html"><em>dump image</em></a>,
<a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a>, <a class="reference internal" href="dump_image.html"><em>dump movie</em></a>,
<a class="reference internal" href="restart.html"><em>restart</em></a>, <a class="reference internal" href="thermo.html"><em>thermo</em></a>,
<a class="reference internal" href="thermo_modify.html"><em>thermo_modify</em></a>, <a class="reference internal" href="thermo_style.html"><em>thermo_style</em></a>,
<a class="reference internal" href="undump.html"><em>undump</em></a>, <a class="reference internal" href="write_data.html"><em>write_data</em></a>,
<a class="reference internal" href="write_dump.html"><em>write_dump</em></a>, <a class="reference internal" href="write_restart.html"><em>write_restart</em></a></p>
<p>Actions:</p>
<p><a class="reference internal" href="delete_atoms.html"><em>delete_atoms</em></a>, <a class="reference internal" href="delete_bonds.html"><em>delete_bonds</em></a>,
<a class="reference internal" href="displace_atoms.html"><em>displace_atoms</em></a>, <a class="reference internal" href="change_box.html"><em>change_box</em></a>,
<a class="reference internal" href="minimize.html"><em>minimize</em></a>, <a class="reference internal" href="neb.html"><em>neb</em></a> <a class="reference internal" href="prd.html"><em>prd</em></a>,
<a class="reference internal" href="rerun.html"><em>rerun</em></a>, <a class="reference internal" href="run.html"><em>run</em></a>, <a class="reference internal" href="temper.html"><em>temper</em></a></p>
<p>Miscellaneous:</p>
<p><a class="reference internal" href="clear.html"><em>clear</em></a>, <a class="reference internal" href="echo.html"><em>echo</em></a>, <a class="reference internal" href="if.html"><em>if</em></a>,
<a class="reference internal" href="include.html"><em>include</em></a>, <a class="reference internal" href="jump.html"><em>jump</em></a>, <a class="reference internal" href="label.html"><em>label</em></a>,
<a class="reference internal" href="log.html"><em>log</em></a>, <a class="reference internal" href="next.html"><em>next</em></a>, <a class="reference internal" href="print.html"><em>print</em></a>,
<a class="reference internal" href="shell.html"><em>shell</em></a>, <a class="reference internal" href="variable.html"><em>variable</em></a></p>
<hr class="docutils" />
</div>
<div class="section" id="individual-commands">
<span id="comm"></span><span id="cmd-5"></span><h2>3.5. Individual commands<a class="headerlink" href="#individual-commands" title="Permalink to this headline">¶</a></h2>
<p>This section lists all LAMMPS commands alphabetically, with a separate
listing below of styles within certain commands. The <a class="reference internal" href="#cmd-4"><span>previous section</span></a> lists the same commands, grouped by category. Note
that some style options for some commands are part of specific LAMMPS
packages, which means they cannot be used unless the package was
included when LAMMPS was built. Not all packages are included in a
default LAMMPS build. These dependencies are listed as Restrictions
in the command&#8217;s documentation.</p>
<table border="1" class="docutils">
<colgroup>
<col width="17%" />
<col width="15%" />
<col width="17%" />
<col width="17%" />
<col width="17%" />
<col width="17%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="angle_coeff.html"><em>angle_coeff</em></a></td>
<td><a class="reference internal" href="angle_style.html"><em>angle_style</em></a></td>
<td><a class="reference internal" href="atom_modify.html"><em>atom_modify</em></a></td>
<td><a class="reference internal" href="atom_style.html"><em>atom_style</em></a></td>
<td><a class="reference internal" href="balance.html"><em>balance</em></a></td>
<td><a class="reference internal" href="bond_coeff.html"><em>bond_coeff</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="bond_style.html"><em>bond_style</em></a></td>
<td><a class="reference internal" href="boundary.html"><em>boundary</em></a></td>
<td><a class="reference internal" href="box.html"><em>box</em></a></td>
<td><a class="reference internal" href="change_box.html"><em>change_box</em></a></td>
<td><a class="reference internal" href="clear.html"><em>clear</em></a></td>
<td><a class="reference internal" href="comm_modify.html"><em>comm_modify</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="comm_style.html"><em>comm_style</em></a></td>
<td><a class="reference internal" href="compute.html"><em>compute</em></a></td>
<td><a class="reference internal" href="compute_modify.html"><em>compute_modify</em></a></td>
<td><a class="reference internal" href="create_atoms.html"><em>create_atoms</em></a></td>
<td><a class="reference internal" href="create_bonds.html"><em>create_bonds</em></a></td>
<td><a class="reference internal" href="create_box.html"><em>create_box</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="delete_atoms.html"><em>delete_atoms</em></a></td>
<td><a class="reference internal" href="delete_bonds.html"><em>delete_bonds</em></a></td>
<td><a class="reference internal" href="dielectric.html"><em>dielectric</em></a></td>
<td><a class="reference internal" href="dihedral_coeff.html"><em>dihedral_coeff</em></a></td>
<td><a class="reference internal" href="dihedral_style.html"><em>dihedral_style</em></a></td>
<td><a class="reference internal" href="dimension.html"><em>dimension</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="displace_atoms.html"><em>displace_atoms</em></a></td>
<td><a class="reference internal" href="dump.html"><em>dump</em></a></td>
<td><a class="reference internal" href="dump_image.html"><em>dump image</em></a></td>
<td><a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a></td>
<td><a class="reference internal" href="dump_image.html"><em>dump movie</em></a></td>
<td><a class="reference internal" href="echo.html"><em>echo</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="fix.html"><em>fix</em></a></td>
<td><a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a></td>
<td><a class="reference internal" href="group.html"><em>group</em></a></td>
<td><a class="reference internal" href="if.html"><em>if</em></a></td>
<td><a class="reference internal" href="info.html"><em>info</em></a></td>
<td><a class="reference internal" href="improper_coeff.html"><em>improper_coeff</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="improper_style.html"><em>improper_style</em></a></td>
<td><a class="reference internal" href="include.html"><em>include</em></a></td>
<td><a class="reference internal" href="jump.html"><em>jump</em></a></td>
<td><a class="reference internal" href="kspace_modify.html"><em>kspace_modify</em></a></td>
<td><a class="reference internal" href="kspace_style.html"><em>kspace_style</em></a></td>
<td><a class="reference internal" href="label.html"><em>label</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="lattice.html"><em>lattice</em></a></td>
<td><a class="reference internal" href="log.html"><em>log</em></a></td>
<td><a class="reference internal" href="mass.html"><em>mass</em></a></td>
<td><a class="reference internal" href="minimize.html"><em>minimize</em></a></td>
<td><a class="reference internal" href="min_modify.html"><em>min_modify</em></a></td>
<td><a class="reference internal" href="min_style.html"><em>min_style</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="molecule.html"><em>molecule</em></a></td>
<td><a class="reference internal" href="neb.html"><em>neb</em></a></td>
<td><a class="reference internal" href="neigh_modify.html"><em>neigh_modify</em></a></td>
<td><a class="reference internal" href="neighbor.html"><em>neighbor</em></a></td>
<td><a class="reference internal" href="newton.html"><em>newton</em></a></td>
<td><a class="reference internal" href="next.html"><em>next</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="package.html"><em>package</em></a></td>
<td><a class="reference internal" href="pair_coeff.html"><em>pair_coeff</em></a></td>
<td><a class="reference internal" href="pair_modify.html"><em>pair_modify</em></a></td>
<td><a class="reference internal" href="pair_style.html"><em>pair_style</em></a></td>
<td><a class="reference internal" href="pair_write.html"><em>pair_write</em></a></td>
<td><a class="reference internal" href="partition.html"><em>partition</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="prd.html"><em>prd</em></a></td>
<td><a class="reference internal" href="print.html"><em>print</em></a></td>
<td><a class="reference internal" href="processors.html"><em>processors</em></a></td>
<td><a class="reference internal" href="python.html"><em>python</em></a></td>
<td><a class="reference internal" href="quit.html"><em>quit</em></a></td>
<td><a class="reference internal" href="read_data.html"><em>read_data</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="read_dump.html"><em>read_dump</em></a></td>
<td><a class="reference internal" href="read_restart.html"><em>read_restart</em></a></td>
<td><a class="reference internal" href="region.html"><em>region</em></a></td>
<td><a class="reference internal" href="replicate.html"><em>replicate</em></a></td>
<td><a class="reference internal" href="rerun.html"><em>rerun</em></a></td>
<td><a class="reference internal" href="reset_timestep.html"><em>reset_timestep</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="restart.html"><em>restart</em></a></td>
<td><a class="reference internal" href="run.html"><em>run</em></a></td>
<td><a class="reference internal" href="run_style.html"><em>run_style</em></a></td>
<td><a class="reference internal" href="set.html"><em>set</em></a></td>
<td><a class="reference internal" href="shell.html"><em>shell</em></a></td>
<td><a class="reference internal" href="special_bonds.html"><em>special_bonds</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="suffix.html"><em>suffix</em></a></td>
<td><a class="reference internal" href="tad.html"><em>tad</em></a></td>
<td><a class="reference internal" href="temper.html"><em>temper</em></a></td>
<td><a class="reference internal" href="thermo.html"><em>thermo</em></a></td>
<td><a class="reference internal" href="thermo_modify.html"><em>thermo_modify</em></a></td>
<td><a class="reference internal" href="thermo_style.html"><em>thermo_style</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="timer.html"><em>timer</em></a></td>
<td><a class="reference internal" href="timestep.html"><em>timestep</em></a></td>
<td><a class="reference internal" href="uncompute.html"><em>uncompute</em></a></td>
<td><a class="reference internal" href="undump.html"><em>undump</em></a></td>
<td><a class="reference internal" href="unfix.html"><em>unfix</em></a></td>
<td><a class="reference internal" href="units.html"><em>units</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="variable.html"><em>variable</em></a></td>
<td><a class="reference internal" href="velocity.html"><em>velocity</em></a></td>
<td><a class="reference internal" href="write_data.html"><em>write_data</em></a></td>
<td><a class="reference internal" href="write_dump.html"><em>write_dump</em></a></td>
<td><a class="reference internal" href="write_restart.html"><em>write_restart</em></a></td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>These are additional commands in USER packages, which can be used if
<a class="reference internal" href="Section_start.html#start-3"><span>LAMMPS is built with the appropriate package</span></a>.</p>
<table border="1" class="docutils">
<colgroup>
<col width="100%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="group2ndx.html"><em>group2ndx</em></a></td>
</tr>
</tbody>
</table>
</div>
<hr class="docutils" />
<div class="section" id="fix-styles">
<h2>3.6. Fix styles<a class="headerlink" href="#fix-styles" title="Permalink to this headline">¶</a></h2>
<p>See the <a class="reference internal" href="fix.html"><em>fix</em></a> command for one-line descriptions of each style
or click on the style itself for a full description. Some of the
styles have accelerated versions, which can be used if LAMMPS is built
with the <a class="reference internal" href="Section_accelerate.html"><em>appropriate accelerated package</em></a>.
This is indicated by additional letters in parenthesis: c = USER-CUDA,
g = GPU, i = USER-INTEL, k = KOKKOS, o = USER-OMP, t = OPT.</p>
<table border="1" class="docutils">
<colgroup>
-<col width="16%" />
<col width="11%" />
-<col width="12%" />
+<col width="15%" />
+<col width="11%" />
+<col width="11%" />
<col width="13%" />
-<col width="10%" />
-<col width="12%" />
+<col width="11%" />
<col width="15%" />
<col width="12%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="fix_adapt.html"><em>adapt</em></a></td>
<td><a class="reference internal" href="fix_addforce.html"><em>addforce (c)</em></a></td>
<td><a class="reference internal" href="fix_append_atoms.html"><em>append/atoms</em></a></td>
<td><a class="reference internal" href="fix_atom_swap.html"><em>atom/swap</em></a></td>
<td><a class="reference internal" href="fix_aveforce.html"><em>aveforce (c)</em></a></td>
<td><a class="reference internal" href="fix_ave_atom.html"><em>ave/atom</em></a></td>
<td><a class="reference internal" href="fix_ave_chunk.html"><em>ave/chunk</em></a></td>
<td><a class="reference internal" href="fix_ave_correlate.html"><em>ave/correlate</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="fix_ave_histo.html"><em>ave/histo</em></a></td>
<td><a class="reference internal" href="fix_ave_histo.html"><em>ave/histo/weight</em></a></td>
<td><a class="reference internal" href="fix_ave_spatial.html"><em>ave/spatial</em></a></td>
<td><a class="reference internal" href="fix_ave_time.html"><em>ave/time</em></a></td>
<td><a class="reference internal" href="fix_balance.html"><em>balance</em></a></td>
<td><a class="reference internal" href="fix_bond_break.html"><em>bond/break</em></a></td>
<td><a class="reference internal" href="fix_bond_create.html"><em>bond/create</em></a></td>
<td><a class="reference internal" href="fix_bond_swap.html"><em>bond/swap</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="fix_box_relax.html"><em>box/relax</em></a></td>
<td><a class="reference internal" href="fix_deform.html"><em>deform (k)</em></a></td>
<td><a class="reference internal" href="fix_deposit.html"><em>deposit</em></a></td>
<td><a class="reference internal" href="fix_drag.html"><em>drag</em></a></td>
<td><a class="reference internal" href="fix_dt_reset.html"><em>dt/reset</em></a></td>
<td><a class="reference internal" href="fix_efield.html"><em>efield</em></a></td>
<td><a class="reference internal" href="fix_enforce2d.html"><em>enforce2d (c)</em></a></td>
<td><a class="reference internal" href="fix_evaporate.html"><em>evaporate</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="fix_external.html"><em>external</em></a></td>
<td><a class="reference internal" href="fix_freeze.html"><em>freeze (c)</em></a></td>
<td><a class="reference internal" href="fix_gcmc.html"><em>gcmc</em></a></td>
<td><a class="reference internal" href="fix_gld.html"><em>gld</em></a></td>
<td><a class="reference internal" href="fix_gravity.html"><em>gravity (co)</em></a></td>
<td><a class="reference internal" href="fix_heat.html"><em>heat</em></a></td>
<td><a class="reference internal" href="fix_indent.html"><em>indent</em></a></td>
<td><a class="reference internal" href="fix_langevin.html"><em>langevin (k)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="fix_lineforce.html"><em>lineforce</em></a></td>
<td><a class="reference internal" href="fix_momentum.html"><em>momentum</em></a></td>
<td><a class="reference internal" href="fix_move.html"><em>move</em></a></td>
<td><a class="reference internal" href="fix_msst.html"><em>msst</em></a></td>
<td><a class="reference internal" href="fix_neb.html"><em>neb</em></a></td>
<td><a class="reference internal" href="fix_nh.html"><em>nph (ko)</em></a></td>
<td><a class="reference internal" href="fix_nphug.html"><em>nphug (o)</em></a></td>
<td><a class="reference internal" href="fix_nph_asphere.html"><em>nph/asphere (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="fix_nph_sphere.html"><em>nph/sphere (o)</em></a></td>
<td><a class="reference internal" href="fix_nh.html"><em>npt (ckio)</em></a></td>
<td><a class="reference internal" href="fix_npt_asphere.html"><em>npt/asphere (o)</em></a></td>
<td><a class="reference internal" href="fix_npt_sphere.html"><em>npt/sphere (o)</em></a></td>
<td><a class="reference internal" href="fix_nve.html"><em>nve (ckio)</em></a></td>
<td><a class="reference internal" href="fix_nve_asphere.html"><em>nve/asphere (i)</em></a></td>
<td><a class="reference internal" href="fix_nve_asphere_noforce.html"><em>nve/asphere/noforce</em></a></td>
<td><a class="reference internal" href="fix_nve_body.html"><em>nve/body</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="fix_nve_limit.html"><em>nve/limit</em></a></td>
<td><a class="reference internal" href="fix_nve_line.html"><em>nve/line</em></a></td>
<td><a class="reference internal" href="fix_nve_noforce.html"><em>nve/noforce</em></a></td>
<td><a class="reference internal" href="fix_nve_sphere.html"><em>nve/sphere (o)</em></a></td>
<td><a class="reference internal" href="fix_nve_tri.html"><em>nve/tri</em></a></td>
<td><a class="reference internal" href="fix_nh.html"><em>nvt (cko)</em></a></td>
<td><a class="reference internal" href="fix_nvt_asphere.html"><em>nvt/asphere (o)</em></a></td>
<td><a class="reference internal" href="fix_nvt_sllod.html"><em>nvt/sllod (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="fix_nvt_sphere.html"><em>nvt/sphere (o)</em></a></td>
<td><a class="reference internal" href="fix_oneway.html"><em>oneway</em></a></td>
<td><a class="reference internal" href="fix_orient_fcc.html"><em>orient/fcc</em></a></td>
<td><a class="reference internal" href="fix_planeforce.html"><em>planeforce</em></a></td>
<td><a class="reference internal" href="fix_poems.html"><em>poems</em></a></td>
<td><a class="reference internal" href="fix_pour.html"><em>pour</em></a></td>
<td><a class="reference internal" href="fix_press_berendsen.html"><em>press/berendsen</em></a></td>
<td><a class="reference internal" href="fix_print.html"><em>print</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="fix_property_atom.html"><em>property/atom</em></a></td>
<td><a class="reference internal" href="fix_qeq_comb.html"><em>qeq/comb (o)</em></a></td>
<td><a class="reference internal" href="fix_qeq.html"><em>qeq/dynamic</em></a></td>
+<td><a class="reference internal" href="fix_qeq.html"><em>qeq/fire</em></a></td>
<td><a class="reference internal" href="fix_qeq.html"><em>qeq/point</em></a></td>
<td><a class="reference internal" href="fix_qeq.html"><em>qeq/shielded</em></a></td>
<td><a class="reference internal" href="fix_qeq.html"><em>qeq/slater</em></a></td>
<td><a class="reference internal" href="fix_reax_bonds.html"><em>reax/bonds</em></a></td>
-<td><a class="reference internal" href="fix_recenter.html"><em>recenter</em></a></td>
</tr>
-<tr class="row-even"><td><a class="reference internal" href="fix_restrain.html"><em>restrain</em></a></td>
+<tr class="row-even"><td><a class="reference internal" href="fix_recenter.html"><em>recenter</em></a></td>
+<td><a class="reference internal" href="fix_restrain.html"><em>restrain</em></a></td>
<td><a class="reference internal" href="fix_rigid.html"><em>rigid (o)</em></a></td>
<td><a class="reference internal" href="fix_rigid.html"><em>rigid/nph (o)</em></a></td>
<td><a class="reference internal" href="fix_rigid.html"><em>rigid/npt (o)</em></a></td>
<td><a class="reference internal" href="fix_rigid.html"><em>rigid/nve (o)</em></a></td>
<td><a class="reference internal" href="fix_rigid.html"><em>rigid/nvt (o)</em></a></td>
<td><a class="reference internal" href="fix_rigid.html"><em>rigid/small (o)</em></a></td>
-<td><a class="reference internal" href="fix_rigid.html"><em>rigid/small/nph</em></a></td>
</tr>
-<tr class="row-odd"><td><a class="reference internal" href="fix_rigid.html"><em>rigid/small/npt</em></a></td>
+<tr class="row-odd"><td><a class="reference internal" href="fix_rigid.html"><em>rigid/small/nph</em></a></td>
+<td><a class="reference internal" href="fix_rigid.html"><em>rigid/small/npt</em></a></td>
<td><a class="reference internal" href="fix_rigid.html"><em>rigid/small/nve</em></a></td>
<td><a class="reference internal" href="fix_rigid.html"><em>rigid/small/nvt</em></a></td>
<td><a class="reference internal" href="fix_setforce.html"><em>setforce (ck)</em></a></td>
<td><a class="reference internal" href="fix_shake.html"><em>shake (c)</em></a></td>
<td><a class="reference internal" href="fix_spring.html"><em>spring</em></a></td>
<td><a class="reference internal" href="fix_spring_rg.html"><em>spring/rg</em></a></td>
-<td><a class="reference internal" href="fix_spring_self.html"><em>spring/self</em></a></td>
</tr>
-<tr class="row-even"><td><a class="reference internal" href="fix_srd.html"><em>srd</em></a></td>
+<tr class="row-even"><td><a class="reference internal" href="fix_spring_self.html"><em>spring/self</em></a></td>
+<td><a class="reference internal" href="fix_srd.html"><em>srd</em></a></td>
<td><a class="reference internal" href="fix_store_force.html"><em>store/force</em></a></td>
<td><a class="reference internal" href="fix_store_state.html"><em>store/state</em></a></td>
<td><a class="reference internal" href="fix_temp_berendsen.html"><em>temp/berendsen (c)</em></a></td>
<td><a class="reference internal" href="fix_temp_csvr.html"><em>temp/csld</em></a></td>
<td><a class="reference internal" href="fix_temp_csvr.html"><em>temp/csvr</em></a></td>
<td><a class="reference internal" href="fix_temp_rescale.html"><em>temp/rescale (c)</em></a></td>
-<td><a class="reference internal" href="fix_tfmc.html"><em>tfmc</em></a></td>
</tr>
-<tr class="row-odd"><td><a class="reference internal" href="fix_thermal_conductivity.html"><em>thermal/conductivity</em></a></td>
+<tr class="row-odd"><td><a class="reference internal" href="fix_tfmc.html"><em>tfmc</em></a></td>
+<td><a class="reference internal" href="fix_thermal_conductivity.html"><em>thermal/conductivity</em></a></td>
<td><a class="reference internal" href="fix_tmd.html"><em>tmd</em></a></td>
<td><a class="reference internal" href="fix_ttm.html"><em>ttm</em></a></td>
<td><a class="reference internal" href="fix_tune_kspace.html"><em>tune/kspace</em></a></td>
<td><a class="reference internal" href="fix_vector.html"><em>vector</em></a></td>
<td><a class="reference internal" href="fix_viscosity.html"><em>viscosity</em></a></td>
<td><a class="reference internal" href="fix_viscous.html"><em>viscous (c)</em></a></td>
-<td><a class="reference internal" href="fix_wall.html"><em>wall/colloid</em></a></td>
</tr>
-<tr class="row-even"><td><a class="reference internal" href="fix_wall_gran.html"><em>wall/gran</em></a></td>
+<tr class="row-even"><td><a class="reference internal" href="fix_wall.html"><em>wall/colloid</em></a></td>
+<td><a class="reference internal" href="fix_wall_gran.html"><em>wall/gran</em></a></td>
<td><a class="reference internal" href="fix_wall.html"><em>wall/harmonic</em></a></td>
<td><a class="reference internal" href="fix_wall.html"><em>wall/lj1043</em></a></td>
<td><a class="reference internal" href="fix_wall.html"><em>wall/lj126</em></a></td>
<td><a class="reference internal" href="fix_wall.html"><em>wall/lj93</em></a></td>
<td><a class="reference internal" href="fix_wall_piston.html"><em>wall/piston</em></a></td>
<td><a class="reference internal" href="fix_wall_reflect.html"><em>wall/reflect (k)</em></a></td>
-<td><a class="reference internal" href="fix_wall_region.html"><em>wall/region</em></a></td>
</tr>
-<tr class="row-odd"><td><a class="reference internal" href="fix_wall_srd.html"><em>wall/srd</em></a></td>
-<td>&nbsp;</td>
+<tr class="row-odd"><td><a class="reference internal" href="fix_wall_region.html"><em>wall/region</em></a></td>
+<td><a class="reference internal" href="fix_wall_srd.html"><em>wall/srd</em></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>These are additional fix styles in USER packages, which can be used if
<a class="reference internal" href="Section_start.html#start-3"><span>LAMMPS is built with the appropriate package</span></a>.</p>
<table border="1" class="docutils">
<colgroup>
<col width="14%" />
<col width="15%" />
<col width="15%" />
<col width="20%" />
<col width="14%" />
<col width="22%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="fix_adapt_fep.html"><em>adapt/fep</em></a></td>
<td><a class="reference internal" href="fix_addtorque.html"><em>addtorque</em></a></td>
<td><a class="reference internal" href="fix_atc.html"><em>atc</em></a></td>
<td><a class="reference internal" href="fix_ave_correlate_long.html"><em>ave/correlate/long</em></a></td>
<td><a class="reference internal" href="fix_ave_spatial_sphere.html"><em>ave/spatial/sphere</em></a></td>
<td><a class="reference internal" href="fix_drude.html"><em>drude</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="fix_drude_transform.html"><em>drude/transform/direct</em></a></td>
<td><a class="reference internal" href="fix_drude_transform.html"><em>drude/transform/reverse</em></a></td>
<td><a class="reference internal" href="fix_colvars.html"><em>colvars</em></a></td>
<td><a class="reference internal" href="fix_gle.html"><em>gle</em></a></td>
<td><a class="reference internal" href="fix_imd.html"><em>imd</em></a></td>
<td><a class="reference internal" href="fix_ipi.html"><em>ipi</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="fix_langevin_drude.html"><em>langevin/drude</em></a></td>
<td><a class="reference internal" href="fix_langevin_eff.html"><em>langevin/eff</em></a></td>
<td><a class="reference internal" href="fix_lb_fluid.html"><em>lb/fluid</em></a></td>
<td><a class="reference internal" href="fix_lb_momentum.html"><em>lb/momentum</em></a></td>
<td><a class="reference internal" href="fix_lb_pc.html"><em>lb/pc</em></a></td>
<td><a class="reference internal" href="fix_lb_rigid_pc_sphere.html"><em>lb/rigid/pc/sphere</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="fix_lb_viscous.html"><em>lb/viscous</em></a></td>
<td><a class="reference internal" href="fix_meso.html"><em>meso</em></a></td>
<td><a class="reference internal" href="fix_meso_stationary.html"><em>meso/stationary</em></a></td>
<td><a class="reference internal" href="fix_nh_eff.html"><em>nph/eff</em></a></td>
<td><a class="reference internal" href="fix_nh_eff.html"><em>npt/eff</em></a></td>
<td><a class="reference internal" href="fix_nve_eff.html"><em>nve/eff</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="fix_nh_eff.html"><em>nvt/eff</em></a></td>
<td><a class="reference internal" href="fix_nvt_sllod_eff.html"><em>nvt/sllod/eff</em></a></td>
<td><a class="reference internal" href="fix_phonon.html"><em>phonon</em></a></td>
<td><a class="reference internal" href="fix_pimd.html"><em>pimd</em></a></td>
<td><a class="reference internal" href="fix_qbmsst.html"><em>qbmsst</em></a></td>
<td><a class="reference internal" href="fix_qeq_reax.html"><em>qeq/reax</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="fix_qmmm.html"><em>qmmm</em></a></td>
<td><a class="reference internal" href="fix_qtb.html"><em>qtb</em></a></td>
<td><a class="reference internal" href="fix_reax_bonds.html"><em>reax/c/bonds</em></a></td>
<td><a class="reference internal" href="fix_reaxc_species.html"><em>reax/c/species</em></a></td>
<td><a class="reference internal" href="fix_saed_vtk.html"><em>saed/vtk</em></a></td>
<td><a class="reference internal" href="fix_smd.html"><em>smd</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="fix_smd_adjust_dt.html"><em>smd/adjust/dt</em></a></td>
<td><a class="reference internal" href="fix_smd_integrate_tlsph.html"><em>smd/integrate/tlsph</em></a></td>
<td><a class="reference internal" href="fix_smd_integrate_ulsph.html"><em>smd/integrate/ulsph</em></a></td>
<td><a class="reference internal" href="fix_smd_move_triangulated_surface.html"><em>smd/move/triangulated/surface</em></a></td>
<td><a class="reference internal" href="fix_smd_setvel.html"><em>smd/setvel</em></a></td>
<td><a class="reference internal" href="fix_smd_tlsph_reference_configuration.html"><em>smd/tlsph/reference/configuration</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="fix_smd_wall_surface.html"><em>smd/wall/surface</em></a></td>
<td><a class="reference internal" href="fix_temp_rescale_eff.html"><em>temp/rescale/eff</em></a></td>
<td><a class="reference internal" href="fix_ti_rs.html"><em>ti/rs</em></a></td>
<td><a class="reference internal" href="fix_ti_spring.html"><em>ti/spring</em></a></td>
<td><a class="reference internal" href="fix_ttm.html"><em>ttm/mod</em></a></td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<hr class="docutils" />
<div class="section" id="compute-styles">
<h2>3.7. Compute styles<a class="headerlink" href="#compute-styles" title="Permalink to this headline">¶</a></h2>
<p>See the <a class="reference internal" href="compute.html"><em>compute</em></a> command for one-line descriptions of
each style or click on the style itself for a full description. Some
of the styles have accelerated versions, which can be used if LAMMPS
is built with the <a class="reference internal" href="Section_accelerate.html"><em>appropriate accelerated package</em></a>. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.</p>
<table border="1" class="docutils">
<colgroup>
<col width="16%" />
<col width="19%" />
<col width="16%" />
<col width="15%" />
<col width="16%" />
<col width="17%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="compute_angle_local.html"><em>angle/local</em></a></td>
<td><a class="reference internal" href="compute_angmom_chunk.html"><em>angmom/chunk</em></a></td>
<td><a class="reference internal" href="compute_body_local.html"><em>body/local</em></a></td>
<td><a class="reference internal" href="compute_bond_local.html"><em>bond/local</em></a></td>
<td><a class="reference internal" href="compute_centro_atom.html"><em>centro/atom</em></a></td>
<td><a class="reference internal" href="compute_chunk_atom.html"><em>chunk/atom</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="compute_cluster_atom.html"><em>cluster/atom</em></a></td>
<td><a class="reference internal" href="compute_cna_atom.html"><em>cna/atom</em></a></td>
<td><a class="reference internal" href="compute_com.html"><em>com</em></a></td>
<td><a class="reference internal" href="compute_com_chunk.html"><em>com/chunk</em></a></td>
<td><a class="reference internal" href="compute_contact_atom.html"><em>contact/atom</em></a></td>
<td><a class="reference internal" href="compute_coord_atom.html"><em>coord/atom</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="compute_damage_atom.html"><em>damage/atom</em></a></td>
<td><a class="reference internal" href="compute_dihedral_local.html"><em>dihedral/local</em></a></td>
<td><a class="reference internal" href="compute_dilatation_atom.html"><em>dilatation/atom</em></a></td>
<td><a class="reference internal" href="compute_displace_atom.html"><em>displace/atom</em></a></td>
<td><a class="reference internal" href="compute_erotate_asphere.html"><em>erotate/asphere</em></a></td>
<td><a class="reference internal" href="compute_erotate_rigid.html"><em>erotate/rigid</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="compute_erotate_sphere.html"><em>erotate/sphere</em></a></td>
<td><a class="reference internal" href="compute_erotate_sphere_atom.html"><em>erotate/sphere/atom</em></a></td>
<td><a class="reference internal" href="compute_event_displace.html"><em>event/displace</em></a></td>
<td><a class="reference internal" href="compute_group_group.html"><em>group/group</em></a></td>
<td><a class="reference internal" href="compute_gyration.html"><em>gyration</em></a></td>
<td><a class="reference internal" href="compute_gyration_chunk.html"><em>gyration/chunk</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="compute_heat_flux.html"><em>heat/flux</em></a></td>
<td><a class="reference internal" href="compute_hexorder_atom.html"><em>hexorder/atom</em></a></td>
<td><a class="reference internal" href="compute_improper_local.html"><em>improper/local</em></a></td>
<td><a class="reference internal" href="compute_inertia_chunk.html"><em>inertia/chunk</em></a></td>
<td><a class="reference internal" href="compute_ke.html"><em>ke</em></a></td>
<td><a class="reference internal" href="compute_ke_atom.html"><em>ke/atom</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="compute_ke_rigid.html"><em>ke/rigid</em></a></td>
<td><a class="reference internal" href="compute_msd.html"><em>msd</em></a></td>
<td><a class="reference internal" href="compute_msd_chunk.html"><em>msd/chunk</em></a></td>
<td><a class="reference internal" href="compute_msd_nongauss.html"><em>msd/nongauss</em></a></td>
<td><a class="reference internal" href="compute_omega_chunk.html"><em>omega/chunk</em></a></td>
<td><a class="reference internal" href="compute_orientorder_atom.html"><em>orientorder/atom</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="compute_pair.html"><em>pair</em></a></td>
<td><a class="reference internal" href="compute_pair_local.html"><em>pair/local</em></a></td>
<td><a class="reference internal" href="compute_pe.html"><em>pe (c)</em></a></td>
<td><a class="reference internal" href="compute_pe_atom.html"><em>pe/atom</em></a></td>
<td><a class="reference internal" href="compute_plasticity_atom.html"><em>plasticity/atom</em></a></td>
<td><a class="reference internal" href="compute_pressure.html"><em>pressure (c)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="compute_property_atom.html"><em>property/atom</em></a></td>
<td><a class="reference internal" href="compute_property_local.html"><em>property/local</em></a></td>
<td><a class="reference internal" href="compute_property_chunk.html"><em>property/chunk</em></a></td>
<td><a class="reference internal" href="compute_rdf.html"><em>rdf</em></a></td>
<td><a class="reference internal" href="compute_reduce.html"><em>reduce</em></a></td>
<td><a class="reference internal" href="compute_reduce.html"><em>reduce/region</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="compute_slice.html"><em>slice</em></a></td>
<td><a class="reference internal" href="compute_sna_atom.html"><em>sna/atom</em></a></td>
<td><a class="reference internal" href="compute_sna_atom.html"><em>snad/atom</em></a></td>
<td><a class="reference internal" href="compute_sna_atom.html"><em>snav/atom</em></a></td>
<td><a class="reference internal" href="compute_stress_atom.html"><em>stress/atom</em></a></td>
<td><a class="reference internal" href="compute_temp.html"><em>temp (ck)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="compute_temp_asphere.html"><em>temp/asphere</em></a></td>
<td><a class="reference internal" href="compute_temp_chunk.html"><em>temp/chunk</em></a></td>
<td><a class="reference internal" href="compute_temp_com.html"><em>temp/com</em></a></td>
<td><a class="reference internal" href="compute_temp_deform.html"><em>temp/deform</em></a></td>
<td><a class="reference internal" href="compute_temp_partial.html"><em>temp/partial (c)</em></a></td>
<td><a class="reference internal" href="compute_temp_profile.html"><em>temp/profile</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="compute_temp_ramp.html"><em>temp/ramp</em></a></td>
<td><a class="reference internal" href="compute_temp_region.html"><em>temp/region</em></a></td>
<td><a class="reference internal" href="compute_temp_sphere.html"><em>temp/sphere</em></a></td>
<td><a class="reference internal" href="compute_ti.html"><em>ti</em></a></td>
<td><a class="reference internal" href="compute_torque_chunk.html"><em>torque/chunk</em></a></td>
<td><a class="reference internal" href="compute_vacf.html"><em>vacf</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="compute_vcm_chunk.html"><em>vcm/chunk</em></a></td>
<td><a class="reference internal" href="compute_voronoi_atom.html"><em>voronoi/atom</em></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>These are additional compute styles in USER packages, which can be
used if <a class="reference internal" href="Section_start.html#start-3"><span>LAMMPS is built with the appropriate package</span></a>.</p>
<table border="1" class="docutils">
<colgroup>
<col width="17%" />
<col width="15%" />
<col width="19%" />
<col width="16%" />
<col width="15%" />
<col width="18%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="compute_ackland_atom.html"><em>ackland/atom</em></a></td>
<td><a class="reference internal" href="compute_basal_atom.html"><em>basal/atom</em></a></td>
<td><a class="reference internal" href="compute_fep.html"><em>fep</em></a></td>
<td><a class="reference internal" href="compute_tally.html"><em>force/tally</em></a></td>
<td><a class="reference internal" href="compute_tally.html"><em>heat/flux/tally</em></a></td>
<td><a class="reference internal" href="compute_ke_eff.html"><em>ke/eff</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="compute_ke_atom_eff.html"><em>ke/atom/eff</em></a></td>
<td><a class="reference internal" href="compute_meso_e_atom.html"><em>meso_e/atom</em></a></td>
<td><a class="reference internal" href="compute_meso_rho_atom.html"><em>meso_rho/atom</em></a></td>
<td><a class="reference internal" href="compute_meso_t_atom.html"><em>meso_t/atom</em></a></td>
<td><a class="reference internal" href="compute_tally.html"><em>pe/tally</em></a></td>
<td><a class="reference internal" href="compute_saed.html"><em>saed</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="compute_smd_contact_radius.html"><em>smd/contact/radius</em></a></td>
<td><a class="reference internal" href="compute_smd_damage.html"><em>smd/damage</em></a></td>
<td><a class="reference internal" href="compute_smd_hourglass_error.html"><em>smd/hourglass/error</em></a></td>
<td><a class="reference internal" href="compute_smd_internal_energy.html"><em>smd/internal/energy</em></a></td>
<td><a class="reference internal" href="compute_smd_plastic_strain.html"><em>smd/plastic/strain</em></a></td>
<td><a class="reference internal" href="compute_smd_plastic_strain_rate.html"><em>smd/plastic/strain/rate</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="compute_smd_rho.html"><em>smd/rho</em></a></td>
<td><a class="reference internal" href="compute_smd_tlsph_defgrad.html"><em>smd/tlsph/defgrad</em></a></td>
<td><a class="reference internal" href="compute_smd_tlsph_dt.html"><em>smd/tlsph/dt</em></a></td>
<td><a class="reference internal" href="compute_smd_tlsph_num_neighs.html"><em>smd/tlsph/num/neighs</em></a></td>
<td><a class="reference internal" href="compute_smd_tlsph_shape.html"><em>smd/tlsph/shape</em></a></td>
<td><a class="reference internal" href="compute_smd_tlsph_strain.html"><em>smd/tlsph/strain</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="compute_smd_tlsph_strain_rate.html"><em>smd/tlsph/strain/rate</em></a></td>
<td><a class="reference internal" href="compute_smd_tlsph_stress.html"><em>smd/tlsph/stress</em></a></td>
<td><a class="reference internal" href="compute_smd_triangle_mesh_vertices.html"><em>smd/triangle/mesh/vertices</em></a></td>
<td><a class="reference internal" href="compute_smd_ulsph_num_neighs.html"><em>smd/ulsph/num/neighs</em></a></td>
<td><a class="reference internal" href="compute_smd_ulsph_strain.html"><em>smd/ulsph/strain</em></a></td>
<td><a class="reference internal" href="compute_smd_ulsph_strain_rate.html"><em>smd/ulsph/strain/rate</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="compute_smd_ulsph_stress.html"><em>smd/ulsph/stress</em></a></td>
<td><a class="reference internal" href="compute_smd_vol.html"><em>smd/vol</em></a></td>
<td><a class="reference internal" href="compute_tally.html"><em>stress/tally</em></a></td>
<td><a class="reference internal" href="compute_temp_drude.html"><em>temp/drude</em></a></td>
<td><a class="reference internal" href="compute_temp_eff.html"><em>temp/eff</em></a></td>
<td><a class="reference internal" href="compute_temp_deform_eff.html"><em>temp/deform/eff</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="compute_temp_region_eff.html"><em>temp/region/eff</em></a></td>
<td><a class="reference internal" href="compute_temp_rotate.html"><em>temp/rotate</em></a></td>
<td><a class="reference internal" href="compute_xrd.html"><em>xrd</em></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<hr class="docutils" />
<div class="section" id="pair-style-potentials">
<h2>3.8. Pair_style potentials<a class="headerlink" href="#pair-style-potentials" title="Permalink to this headline">¶</a></h2>
<p>See the <a class="reference internal" href="pair_style.html"><em>pair_style</em></a> command for an overview of pair
potentials. Click on the style itself for a full description. Many
of the styles have accelerated versions, which can be used if LAMMPS
is built with the <a class="reference internal" href="Section_accelerate.html"><em>appropriate accelerated package</em></a>. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.</p>
<table border="1" class="docutils">
<colgroup>
<col width="24%" />
<col width="25%" />
<col width="27%" />
<col width="24%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="pair_none.html"><em>none</em></a></td>
<td><a class="reference internal" href="pair_hybrid.html"><em>hybrid</em></a></td>
<td><a class="reference internal" href="pair_hybrid.html"><em>hybrid/overlay</em></a></td>
<td><a class="reference internal" href="pair_adp.html"><em>adp (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_airebo.html"><em>airebo (o)</em></a></td>
<td><a class="reference internal" href="pair_beck.html"><em>beck (go)</em></a></td>
<td><a class="reference internal" href="pair_body.html"><em>body</em></a></td>
<td><a class="reference internal" href="pair_bop.html"><em>bop</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_born.html"><em>born (go)</em></a></td>
<td><a class="reference internal" href="pair_born.html"><em>born/coul/long (cgo)</em></a></td>
<td><a class="reference internal" href="pair_born.html"><em>born/coul/long/cs</em></a></td>
<td><a class="reference internal" href="pair_born.html"><em>born/coul/msm (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_born.html"><em>born/coul/wolf (go)</em></a></td>
<td><a class="reference internal" href="pair_brownian.html"><em>brownian (o)</em></a></td>
<td><a class="reference internal" href="pair_brownian.html"><em>brownian/poly (o)</em></a></td>
<td><a class="reference internal" href="pair_buck.html"><em>buck (cgkio)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_buck.html"><em>buck/coul/cut (cgkio)</em></a></td>
<td><a class="reference internal" href="pair_buck.html"><em>buck/coul/long (cgkio)</em></a></td>
<td><a class="reference internal" href="pair_buck.html"><em>buck/coul/long/cs</em></a></td>
<td><a class="reference internal" href="pair_buck.html"><em>buck/coul/msm (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_buck_long.html"><em>buck/long/coul/long (o)</em></a></td>
<td><a class="reference internal" href="pair_colloid.html"><em>colloid (go)</em></a></td>
<td><a class="reference internal" href="pair_comb.html"><em>comb (o)</em></a></td>
<td><a class="reference internal" href="pair_comb.html"><em>comb3</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_coul.html"><em>coul/cut (gko)</em></a></td>
<td><a class="reference internal" href="pair_coul.html"><em>coul/debye (gko)</em></a></td>
<td><a class="reference internal" href="pair_coul.html"><em>coul/dsf (gko)</em></a></td>
<td><a class="reference internal" href="pair_coul.html"><em>coul/long (gko)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_coul.html"><em>coul/long/cs</em></a></td>
<td><a class="reference internal" href="pair_coul.html"><em>coul/msm</em></a></td>
<td><a class="reference internal" href="pair_coul.html"><em>coul/streitz</em></a></td>
<td><a class="reference internal" href="pair_coul.html"><em>coul/wolf (ko)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_dpd.html"><em>dpd (o)</em></a></td>
<td><a class="reference internal" href="pair_dpd.html"><em>dpd/tstat (o)</em></a></td>
<td><a class="reference internal" href="pair_dsmc.html"><em>dsmc</em></a></td>
<td><a class="reference internal" href="pair_eam.html"><em>eam (cgkot)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_eam.html"><em>eam/alloy (cgkot)</em></a></td>
<td><a class="reference internal" href="pair_eam.html"><em>eam/fs (cgkot)</em></a></td>
<td><a class="reference internal" href="pair_eim.html"><em>eim (o)</em></a></td>
<td><a class="reference internal" href="pair_gauss.html"><em>gauss (go)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_gayberne.html"><em>gayberne (gio)</em></a></td>
<td><a class="reference internal" href="pair_gran.html"><em>gran/hertz/history (o)</em></a></td>
<td><a class="reference internal" href="pair_gran.html"><em>gran/hooke (co)</em></a></td>
<td><a class="reference internal" href="pair_gran.html"><em>gran/hooke/history (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_hbond_dreiding.html"><em>hbond/dreiding/lj (o)</em></a></td>
<td><a class="reference internal" href="pair_hbond_dreiding.html"><em>hbond/dreiding/morse (o)</em></a></td>
<td><a class="reference internal" href="pair_kim.html"><em>kim</em></a></td>
<td><a class="reference internal" href="pair_lcbop.html"><em>lcbop</em></a></td>
</tr>
-<tr class="row-odd"><td><a class="reference internal" href="pair_line_lj.html"><em>line/lj (o)</em></a></td>
+<tr class="row-odd"><td><a class="reference internal" href="pair_line_lj.html"><em>line/lj</em></a></td>
<td><a class="reference internal" href="pair_charmm.html"><em>lj/charmm/coul/charmm (cko)</em></a></td>
<td><a class="reference internal" href="pair_charmm.html"><em>lj/charmm/coul/charmm/implicit (cko)</em></a></td>
<td><a class="reference internal" href="pair_charmm.html"><em>lj/charmm/coul/long (cgiko)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_charmm.html"><em>lj/charmm/coul/msm</em></a></td>
<td><a class="reference internal" href="pair_class2.html"><em>lj/class2 (cgko)</em></a></td>
<td><a class="reference internal" href="pair_class2.html"><em>lj/class2/coul/cut (cko)</em></a></td>
<td><a class="reference internal" href="pair_class2.html"><em>lj/class2/coul/long (cgko)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_lj_cubic.html"><em>lj/cubic (go)</em></a></td>
<td><a class="reference internal" href="pair_lj.html"><em>lj/cut (cgikot)</em></a></td>
<td><a class="reference internal" href="pair_lj.html"><em>lj/cut/coul/cut (cgko)</em></a></td>
<td><a class="reference internal" href="pair_lj.html"><em>lj/cut/coul/debye (cgko)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_lj.html"><em>lj/cut/coul/dsf (gko)</em></a></td>
<td><a class="reference internal" href="pair_lj.html"><em>lj/cut/coul/long (cgikot)</em></a></td>
<td><a class="reference internal" href="pair_lj.html"><em>lj/cut/coul/long/cs</em></a></td>
<td><a class="reference internal" href="pair_lj.html"><em>lj/cut/coul/msm (go)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_dipole.html"><em>lj/cut/dipole/cut (go)</em></a></td>
<td><a class="reference internal" href="pair_dipole.html"><em>lj/cut/dipole/long</em></a></td>
<td><a class="reference internal" href="pair_lj.html"><em>lj/cut/tip4p/cut (o)</em></a></td>
<td><a class="reference internal" href="pair_lj.html"><em>lj/cut/tip4p/long (ot)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_lj_expand.html"><em>lj/expand (cgko)</em></a></td>
<td><a class="reference internal" href="pair_gromacs.html"><em>lj/gromacs (cgko)</em></a></td>
<td><a class="reference internal" href="pair_gromacs.html"><em>lj/gromacs/coul/gromacs (cko)</em></a></td>
<td><a class="reference internal" href="pair_lj_long.html"><em>lj/long/coul/long (o)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_dipole.html"><em>lj/long/dipole/long</em></a></td>
<td><a class="reference internal" href="pair_lj_long.html"><em>lj/long/tip4p/long</em></a></td>
<td><a class="reference internal" href="pair_lj_smooth.html"><em>lj/smooth (co)</em></a></td>
<td><a class="reference internal" href="pair_lj_smooth_linear.html"><em>lj/smooth/linear (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_lj96.html"><em>lj96/cut (cgo)</em></a></td>
<td><a class="reference internal" href="pair_lubricate.html"><em>lubricate (o)</em></a></td>
<td><a class="reference internal" href="pair_lubricate.html"><em>lubricate/poly (o)</em></a></td>
<td><a class="reference internal" href="pair_lubricateU.html"><em>lubricateU</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_lubricateU.html"><em>lubricateU/poly</em></a></td>
<td><a class="reference internal" href="pair_meam.html"><em>meam (o)</em></a></td>
<td><a class="reference internal" href="pair_mie.html"><em>mie/cut (o)</em></a></td>
<td><a class="reference internal" href="pair_morse.html"><em>morse (cgot)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_nb3b_harmonic.html"><em>nb3b/harmonic (o)</em></a></td>
<td><a class="reference internal" href="pair_nm.html"><em>nm/cut (o)</em></a></td>
<td><a class="reference internal" href="pair_nm.html"><em>nm/cut/coul/cut (o)</em></a></td>
<td><a class="reference internal" href="pair_nm.html"><em>nm/cut/coul/long (o)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_peri.html"><em>peri/eps</em></a></td>
<td><a class="reference internal" href="pair_peri.html"><em>peri/lps (o)</em></a></td>
<td><a class="reference internal" href="pair_peri.html"><em>peri/pmb (o)</em></a></td>
<td><a class="reference internal" href="pair_peri.html"><em>peri/ves</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_polymorphic.html"><em>polymorphic</em></a></td>
<td><a class="reference internal" href="pair_reax.html"><em>reax</em></a></td>
<td><a class="reference internal" href="pair_airebo.html"><em>rebo (o)</em></a></td>
<td><a class="reference internal" href="pair_resquared.html"><em>resquared (go)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_snap.html"><em>snap</em></a></td>
<td><a class="reference internal" href="pair_soft.html"><em>soft (go)</em></a></td>
<td><a class="reference internal" href="pair_sw.html"><em>sw (cgkio)</em></a></td>
<td><a class="reference internal" href="pair_table.html"><em>table (gko)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_tersoff.html"><em>tersoff (cgkio)</em></a></td>
<td><a class="reference internal" href="pair_tersoff_mod.html"><em>tersoff/mod (ko)</em></a></td>
<td><a class="reference internal" href="pair_tersoff_zbl.html"><em>tersoff/zbl (ko)</em></a></td>
<td><a class="reference internal" href="pair_coul.html"><em>tip4p/cut (o)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_coul.html"><em>tip4p/long (o)</em></a></td>
-<td><a class="reference internal" href="pair_tri_lj.html"><em>tri/lj (o)</em></a></td>
+<td><a class="reference internal" href="pair_tri_lj.html"><em>tri/lj</em></a></td>
<td><a class="reference internal" href="pair_vashishta.html"><em>vashishta (o)</em></a></td>
<td><a class="reference internal" href="pair_yukawa.html"><em>yukawa (go)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_yukawa_colloid.html"><em>yukawa/colloid (go)</em></a></td>
<td><a class="reference internal" href="pair_zbl.html"><em>zbl (go)</em></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>These are additional pair styles in USER packages, which can be used
if <a class="reference internal" href="Section_start.html#start-3"><span>LAMMPS is built with the appropriate package</span></a>.</p>
<table border="1" class="docutils">
<colgroup>
<col width="25%" />
<col width="31%" />
<col width="21%" />
<col width="24%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="pair_awpmd.html"><em>awpmd/cut</em></a></td>
<td><a class="reference internal" href="pair_mdf.html"><em>buck/mdf</em></a></td>
<td><a class="reference internal" href="pair_lj_soft.html"><em>coul/cut/soft (o)</em></a></td>
<td><a class="reference internal" href="pair_coul_diel.html"><em>coul/diel (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_lj_soft.html"><em>coul/long/soft (o)</em></a></td>
<td><a class="reference internal" href="pair_eam.html"><em>eam/cd (o)</em></a></td>
<td><a class="reference internal" href="pair_edip.html"><em>edip (o)</em></a></td>
<td><a class="reference internal" href="pair_eff.html"><em>eff/cut</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_gauss.html"><em>gauss/cut</em></a></td>
<td><a class="reference internal" href="pair_mdf.html"><em>lennard/mdf</em></a></td>
<td><a class="reference internal" href="pair_list.html"><em>list</em></a></td>
<td><a class="reference internal" href="pair_charmm.html"><em>lj/charmm/coul/long/soft (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_lj_soft.html"><em>lj/cut/coul/cut/soft (o)</em></a></td>
<td><a class="reference internal" href="pair_lj_soft.html"><em>lj/cut/coul/long/soft (o)</em></a></td>
<td><a class="reference internal" href="pair_dipole.html"><em>lj/cut/dipole/sf (go)</em></a></td>
<td><a class="reference internal" href="pair_lj_soft.html"><em>lj/cut/soft (o)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_lj_soft.html"><em>lj/cut/tip4p/long/soft (o)</em></a></td>
<td><a class="reference internal" href="pair_mdf.html"><em>lj/mdf</em></a></td>
<td><a class="reference internal" href="pair_sdk.html"><em>lj/sdk (gko)</em></a></td>
<td><a class="reference internal" href="pair_sdk.html"><em>lj/sdk/coul/long (go)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_sdk.html"><em>lj/sdk/coul/msm (o)</em></a></td>
<td><a class="reference internal" href="pair_lj_sf.html"><em>lj/sf (o)</em></a></td>
<td><a class="reference internal" href="pair_meam_spline.html"><em>meam/spline</em></a></td>
<td><a class="reference internal" href="pair_meam_sw_spline.html"><em>meam/sw/spline</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_mgpt.html"><em>mgpt</em></a></td>
<td><a class="reference internal" href="pair_quip.html"><em>quip</em></a></td>
<td><a class="reference internal" href="pair_reax_c.html"><em>reax/c</em></a></td>
<td><a class="reference internal" href="pair_smd_hertz.html"><em>smd/hertz</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_smd_tlsph.html"><em>smd/tlsph</em></a></td>
<td><a class="reference internal" href="pair_smd_triangulated_surface.html"><em>smd/triangulated/surface</em></a></td>
<td><a class="reference internal" href="pair_smd_ulsph.html"><em>smd/ulsph</em></a></td>
<td><a class="reference internal" href="pair_smtbq.html"><em>smtbq</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_sph_heatconduction.html"><em>sph/heatconduction</em></a></td>
<td><a class="reference internal" href="pair_sph_idealgas.html"><em>sph/idealgas</em></a></td>
<td><a class="reference internal" href="pair_sph_lj.html"><em>sph/lj</em></a></td>
<td><a class="reference internal" href="pair_sph_rhosum.html"><em>sph/rhosum</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_sph_taitwater.html"><em>sph/taitwater</em></a></td>
<td><a class="reference internal" href="pair_sph_taitwater_morris.html"><em>sph/taitwater/morris</em></a></td>
<td><a class="reference internal" href="pair_srp.html"><em>srp</em></a></td>
<td><a class="reference internal" href="pair_tersoff.html"><em>tersoff/table (o)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_thole.html"><em>thole</em></a></td>
<td><a class="reference internal" href="pair_lj_soft.html"><em>tip4p/long/soft (o)</em></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<hr class="docutils" />
<div class="section" id="bond-style-potentials">
<h2>3.9. Bond_style potentials<a class="headerlink" href="#bond-style-potentials" title="Permalink to this headline">¶</a></h2>
<p>See the <a class="reference internal" href="bond_style.html"><em>bond_style</em></a> command for an overview of bond
potentials. Click on the style itself for a full description. Some
of the styles have accelerated versions, which can be used if LAMMPS
is built with the <a class="reference internal" href="Section_accelerate.html"><em>appropriate accelerated package</em></a>. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.</p>
<table border="1" class="docutils">
<colgroup>
<col width="28%" />
<col width="25%" />
<col width="22%" />
<col width="25%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="bond_none.html"><em>none</em></a></td>
<td><a class="reference internal" href="bond_hybrid.html"><em>hybrid</em></a></td>
<td><a class="reference internal" href="bond_class2.html"><em>class2 (o)</em></a></td>
<td><a class="reference internal" href="bond_fene.html"><em>fene (ko)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="bond_fene_expand.html"><em>fene/expand (o)</em></a></td>
<td><a class="reference internal" href="bond_harmonic.html"><em>harmonic (ko)</em></a></td>
<td><a class="reference internal" href="bond_morse.html"><em>morse (o)</em></a></td>
<td><a class="reference internal" href="bond_nonlinear.html"><em>nonlinear (o)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="bond_quartic.html"><em>quartic (o)</em></a></td>
<td><a class="reference internal" href="bond_table.html"><em>table (o)</em></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>These are additional bond styles in USER packages, which can be used
if <a class="reference internal" href="Section_start.html#start-3"><span>LAMMPS is built with the appropriate package</span></a>.</p>
<table border="1" class="docutils">
<colgroup>
<col width="46%" />
<col width="54%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="bond_harmonic_shift.html"><em>harmonic/shift (o)</em></a></td>
<td><a class="reference internal" href="bond_harmonic_shift_cut.html"><em>harmonic/shift/cut (o)</em></a></td>
</tr>
</tbody>
</table>
</div>
<hr class="docutils" />
<div class="section" id="angle-style-potentials">
<h2>3.10. Angle_style potentials<a class="headerlink" href="#angle-style-potentials" title="Permalink to this headline">¶</a></h2>
<p>See the <a class="reference internal" href="angle_style.html"><em>angle_style</em></a> command for an overview of
angle potentials. Click on the style itself for a full description.
Some of the styles have accelerated versions, which can be used if
LAMMPS is built with the <a class="reference internal" href="Section_accelerate.html"><em>appropriate accelerated package</em></a>. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.</p>
<table border="1" class="docutils">
<colgroup>
<col width="21%" />
<col width="25%" />
<col width="28%" />
<col width="27%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="angle_none.html"><em>none</em></a></td>
<td><a class="reference internal" href="angle_hybrid.html"><em>hybrid</em></a></td>
<td><a class="reference internal" href="angle_charmm.html"><em>charmm (ko)</em></a></td>
<td><a class="reference internal" href="angle_class2.html"><em>class2 (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="angle_cosine.html"><em>cosine (o)</em></a></td>
<td><a class="reference internal" href="angle_cosine_delta.html"><em>cosine/delta (o)</em></a></td>
<td><a class="reference internal" href="angle_cosine_periodic.html"><em>cosine/periodic (o)</em></a></td>
<td><a class="reference internal" href="angle_cosine_squared.html"><em>cosine/squared (o)</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="angle_harmonic.html"><em>harmonic (ko)</em></a></td>
<td><a class="reference internal" href="angle_table.html"><em>table (o)</em></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>These are additional angle styles in USER packages, which can be used
if <a class="reference internal" href="Section_start.html#start-3"><span>LAMMPS is built with the appropriate package</span></a>.</p>
<table border="1" class="docutils">
<colgroup>
<col width="29%" />
<col width="31%" />
<col width="20%" />
<col width="21%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="angle_cosine_shift.html"><em>cosine/shift (o)</em></a></td>
<td><a class="reference internal" href="angle_cosine_shift_exp.html"><em>cosine/shift/exp (o)</em></a></td>
<td><a class="reference internal" href="angle_dipole.html"><em>dipole (o)</em></a></td>
<td><a class="reference internal" href="angle_fourier.html"><em>fourier (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="angle_fourier_simple.html"><em>fourier/simple (o)</em></a></td>
<td><a class="reference internal" href="angle_quartic.html"><em>quartic (o)</em></a></td>
<td><a class="reference internal" href="angle_sdk.html"><em>sdk</em></a></td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<hr class="docutils" />
<div class="section" id="dihedral-style-potentials">
<h2>3.11. Dihedral_style potentials<a class="headerlink" href="#dihedral-style-potentials" title="Permalink to this headline">¶</a></h2>
<p>See the <a class="reference internal" href="dihedral_style.html"><em>dihedral_style</em></a> command for an overview
of dihedral potentials. Click on the style itself for a full
description. Some of the styles have accelerated versions, which can
be used if LAMMPS is built with the <a class="reference internal" href="Section_accelerate.html"><em>appropriate accelerated package</em></a>. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.</p>
<table border="1" class="docutils">
<colgroup>
<col width="25%" />
<col width="21%" />
<col width="32%" />
<col width="22%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="dihedral_none.html"><em>none</em></a></td>
<td><a class="reference internal" href="dihedral_hybrid.html"><em>hybrid</em></a></td>
<td><a class="reference internal" href="dihedral_charmm.html"><em>charmm (ko)</em></a></td>
<td><a class="reference internal" href="dihedral_class2.html"><em>class2 (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="dihedral_harmonic.html"><em>harmonic (o)</em></a></td>
<td><a class="reference internal" href="dihedral_helix.html"><em>helix (o)</em></a></td>
<td><a class="reference internal" href="dihedral_multi_harmonic.html"><em>multi/harmonic (o)</em></a></td>
<td><a class="reference internal" href="dihedral_opls.html"><em>opls (ko)</em></a></td>
</tr>
</tbody>
</table>
<p>These are additional dihedral styles in USER packages, which can be
used if <a class="reference internal" href="Section_start.html#start-3"><span>LAMMPS is built with the appropriate package</span></a>.</p>
<table border="1" class="docutils">
<colgroup>
<col width="31%" />
<col width="21%" />
<col width="24%" />
<col width="24%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="dihedral_cosine_shift_exp.html"><em>cosine/shift/exp (o)</em></a></td>
<td><a class="reference internal" href="dihedral_fourier.html"><em>fourier (o)</em></a></td>
<td><a class="reference internal" href="dihedral_nharmonic.html"><em>nharmonic (o)</em></a></td>
<td><a class="reference internal" href="dihedral_quadratic.html"><em>quadratic (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="dihedral_table.html"><em>table (o)</em></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<hr class="docutils" />
<div class="section" id="improper-style-potentials">
<h2>3.12. Improper_style potentials<a class="headerlink" href="#improper-style-potentials" title="Permalink to this headline">¶</a></h2>
<p>See the <a class="reference internal" href="improper_style.html"><em>improper_style</em></a> command for an overview
of improper potentials. Click on the style itself for a full
description. Some of the styles have accelerated versions, which can
be used if LAMMPS is built with the <a class="reference internal" href="Section_accelerate.html"><em>appropriate accelerated package</em></a>. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.</p>
<table border="1" class="docutils">
<colgroup>
<col width="27%" />
<col width="27%" />
<col width="24%" />
<col width="22%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="improper_none.html"><em>none</em></a></td>
<td><a class="reference internal" href="improper_hybrid.html"><em>hybrid</em></a></td>
<td><a class="reference internal" href="improper_class2.html"><em>class2 (o)</em></a></td>
<td><a class="reference internal" href="improper_cvff.html"><em>cvff (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="improper_harmonic.html"><em>harmonic (ko)</em></a></td>
<td><a class="reference internal" href="improper_umbrella.html"><em>umbrella (o)</em></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>These are additional improper styles in USER packages, which can be
used if <a class="reference internal" href="Section_start.html#start-3"><span>LAMMPS is built with the appropriate package</span></a>.</p>
<table border="1" class="docutils">
<colgroup>
<col width="24%" />
<col width="26%" />
<col width="27%" />
<col width="23%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="improper_cossq.html"><em>cossq (o)</em></a></td>
<td><a class="reference internal" href="improper_distance.html"><em>distance</em></a></td>
<td><a class="reference internal" href="improper_fourier.html"><em>fourier (o)</em></a></td>
<td><a class="reference internal" href="improper_ring.html"><em>ring (o)</em></a></td>
</tr>
</tbody>
</table>
</div>
<hr class="docutils" />
<div class="section" id="kspace-solvers">
<h2>3.13. Kspace solvers<a class="headerlink" href="#kspace-solvers" title="Permalink to this headline">¶</a></h2>
<p>See the <a class="reference internal" href="kspace_style.html"><em>kspace_style</em></a> command for an overview of
Kspace solvers. Click on the style itself for a full description.
Some of the styles have accelerated versions, which can be used if
LAMMPS is built with the <a class="reference internal" href="Section_accelerate.html"><em>appropriate accelerated package</em></a>. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.</p>
<table border="1" class="docutils">
<colgroup>
<col width="26%" />
<col width="24%" />
<col width="23%" />
<col width="27%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="kspace_style.html"><em>ewald (o)</em></a></td>
<td><a class="reference internal" href="kspace_style.html"><em>ewald/disp</em></a></td>
<td><a class="reference internal" href="kspace_style.html"><em>msm (o)</em></a></td>
<td><a class="reference internal" href="kspace_style.html"><em>msm/cg (o)</em></a></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="kspace_style.html"><em>pppm (cgo)</em></a></td>
<td><a class="reference internal" href="kspace_style.html"><em>pppm/cg (o)</em></a></td>
<td><a class="reference internal" href="kspace_style.html"><em>pppm/disp</em></a></td>
<td><a class="reference internal" href="kspace_style.html"><em>pppm/disp/tip4p</em></a></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="kspace_style.html"><em>pppm/tip4p (o)</em></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="Section_packages.html" class="btn btn-neutral float-right" title="4. Packages" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="Section_start.html" class="btn btn-neutral" title="2. Getting Started" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/Section_commands.txt b/doc/Section_commands.txt
index 5676da355..07f1da42c 100644
--- a/doc/Section_commands.txt
+++ b/doc/Section_commands.txt
@@ -1,1087 +1,1088 @@
"Previous Section"_Section_start.html - "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next Section"_Section_packages.html :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
3. Commands :h3
This section describes how a LAMMPS input script is formatted and the
input script commands used to define a LAMMPS simulation.
3.1 "LAMMPS input script"_#cmd_1
3.2 "Parsing rules"_#cmd_2
3.3 "Input script structure"_#cmd_3
3.4 "Commands listed by category"_#cmd_4
3.5 "Commands listed alphabetically"_#cmd_5 :all(b)
:line
:line
3.1 LAMMPS input script :link(cmd_1),h4
LAMMPS executes by reading commands from a input script (text file),
one line at a time. When the input script ends, LAMMPS exits. Each
command causes LAMMPS to take some action. It may set an internal
variable, read in a file, or run a simulation. Most commands have
default settings, which means you only need to use the command if you
wish to change the default.
In many cases, the ordering of commands in an input script is not
important. However the following rules apply:
(1) LAMMPS does not read your entire input script and then perform a
simulation with all the settings. Rather, the input script is read
one line at a time and each command takes effect when it is read.
Thus this sequence of commands:
timestep 0.5
run 100
run 100 :pre
does something different than this sequence:
run 100
timestep 0.5
run 100 :pre
In the first case, the specified timestep (0.5 fmsec) is used for two
simulations of 100 timesteps each. In the 2nd case, the default
timestep (1.0 fmsec) is used for the 1st 100 step simulation and a 0.5
fmsec timestep is used for the 2nd one.
(2) Some commands are only valid when they follow other commands. For
example you cannot set the temperature of a group of atoms until atoms
have been defined and a group command is used to define which atoms
belong to the group.
(3) Sometimes command B will use values that can be set by command A.
This means command A must precede command B in the input script if it
is to have the desired effect. For example, the
"read_data"_read_data.html command initializes the system by setting
up the simulation box and assigning atoms to processors. If default
values are not desired, the "processors"_processors.html and
"boundary"_boundary.html commands need to be used before read_data to
tell LAMMPS how to map processors to the simulation box.
Many input script errors are detected by LAMMPS and an ERROR or
WARNING message is printed. "This section"_Section_errors.html gives
more information on what errors mean. The documentation for each
command lists restrictions on how the command can be used.
:line
3.2 Parsing rules :link(cmd_2),h4
Each non-blank line in the input script is treated as a command.
LAMMPS commands are case sensitive. Command names are lower-case, as
are specified command arguments. Upper case letters may be used in
file names or user-chosen ID strings.
Here is how each line in the input script is parsed by LAMMPS:
(1) If the last printable character on the line is a "&" character,
the command is assumed to continue on the next line. The next line is
concatenated to the previous line by removing the "&" character and
line break. This allows long commands to be continued across two or
more lines. See the discussion of triple quotes in (6) for how to
continue a command across multiple line without using "&" characters.
(2) All characters from the first "#" character onward are treated as
comment and discarded. See an exception in (6). Note that a
comment after a trailing "&" character will prevent the command from
continuing on the next line. Also note that for multi-line commands a
single leading "#" will comment out the entire command.
(3) The line is searched repeatedly for $ characters, which indicate
variables that are replaced with a text string. See an exception in
(6).
If the $ is followed by curly brackets, then the variable name is the
text inside the curly brackets. If no curly brackets follow the $,
then the variable name is the single character immediately following
the $. Thus $\{myTemp\} and $x refer to variable names "myTemp" and
"x".
How the variable is converted to a text string depends on what style
of variable it is; see the "variable"_variable doc page for details.
It can be a variable that stores multiple text strings, and return one
of them. The returned text string can be multiple "words" (space
separated) which will then be interpreted as multiple arguments in the
input command. The variable can also store a numeric formula which
will be evaluated and its numeric result returned as a string.
As a special case, if the $ is followed by parenthesis, then the text
inside the parenthesis is treated as an "immediate" variable and
evaluated as an "equal-style variable"_variable.html. This is a way
to use numeric formulas in an input script without having to assign
them to variable names. For example, these 3 input script lines:
variable X equal (xlo+xhi)/2+sqrt(v_area)
region 1 block $X 2 INF INF EDGE EDGE
variable X delete :pre
can be replaced by
region 1 block $((xlo+xhi)/2+sqrt(v_area)) 2 INF INF EDGE EDGE :pre
so that you do not have to define (or discard) a temporary variable X.
Note that neither the curly-bracket or immediate form of variables can
contain nested $ characters for other variables to substitute for.
Thus you cannot do this:
variable a equal 2
variable b2 equal 4
print "B2 = $\{b$a\}" :pre
Nor can you specify this $($x-1.0) for an immediate variable, but
you could use $(v_x-1.0), since the latter is valid syntax for an
"equal-style variable"_variable.html.
See the "variable"_variable.html command for more details of how
strings are assigned to variables and evaluated, and how they can be
used in input script commands.
(4) The line is broken into "words" separated by whitespace (tabs,
spaces). Note that words can thus contain letters, digits,
underscores, or punctuation characters.
(5) The first word is the command name. All successive words in the
line are arguments.
(6) If you want text with spaces to be treated as a single argument,
it can be enclosed in either single or double or triple quotes. A
long single argument enclosed in single or double quotes can span
multiple lines if the "&" character is used, as described above. When
the lines are concatenated together (and the "&" characters and line
breaks removed), the text will become a single line. If you want
multiple lines of an argument to retain their line breaks, the text
can be enclosed in triple quotes, in which case "&" characters are not
needed. For example:
print "Volume = $v"
print 'Volume = $v'
if "$\{steps\} > 1000" then quit
variable a string "red green blue &
purple orange cyan"
print """
System volume = $v
System temperature = $t
""" :pre
In each case, the single, double, or triple quotes are removed when
the single argument they enclose is stored internally.
See the "dump modify format"_dump_modify.html, "print"_print.html,
"if"_if.html, and "python"_python.html commands for examples.
A "#" or "$" character that is between quotes will not be treated as a
comment indicator in (2) or substituted for as a variable in (3).
NOTE: If the argument is itself a command that requires a quoted
argument (e.g. using a "print"_print.html command as part of an
"if"_if.html or "run every"_run.html command), then single, double, or
triple quotes can be nested in the usual manner. See the doc pages
for those commands for examples. Only one of level of nesting is
allowed, but that should be sufficient for most use cases.
:line
3.3 Input script structure :h4,link(cmd_3)
This section describes the structure of a typical LAMMPS input script.
The "examples" directory in the LAMMPS distribution contains many
sample input scripts; the corresponding problems are discussed in
"Section_example"_Section_example.html, and animated on the "LAMMPS
WWW Site"_lws.
A LAMMPS input script typically has 4 parts:
Initialization
Atom definition
Settings
Run a simulation :ol
The last 2 parts can be repeated as many times as desired. I.e. run a
simulation, change some settings, run some more, etc. Each of the 4
parts is now described in more detail. Remember that almost all the
commands need only be used if a non-default value is desired.
(1) Initialization
Set parameters that need to be defined before atoms are created or
read-in from a file.
The relevant commands are "units"_units.html,
"dimension"_dimension.html, "newton"_newton.html,
"processors"_processors.html, "boundary"_boundary.html,
"atom_style"_atom_style.html, "atom_modify"_atom_modify.html.
If force-field parameters appear in the files that will be read, these
commands tell LAMMPS what kinds of force fields are being used:
"pair_style"_pair_style.html, "bond_style"_bond_style.html,
"angle_style"_angle_style.html, "dihedral_style"_dihedral_style.html,
"improper_style"_improper_style.html.
(2) Atom definition
There are 3 ways to define atoms in LAMMPS. Read them in from a data
or restart file via the "read_data"_read_data.html or
"read_restart"_read_restart.html commands. These files can contain
molecular topology information. Or create atoms on a lattice (with no
molecular topology), using these commands: "lattice"_lattice.html,
"region"_region.html, "create_box"_create_box.html,
"create_atoms"_create_atoms.html. The entire set of atoms can be
duplicated to make a larger simulation using the
"replicate"_replicate.html command.
(3) Settings
Once atoms and molecular topology are defined, a variety of settings
can be specified: force field coefficients, simulation parameters,
output options, etc.
Force field coefficients are set by these commands (they can also be
set in the read-in files): "pair_coeff"_pair_coeff.html,
"bond_coeff"_bond_coeff.html, "angle_coeff"_angle_coeff.html,
"dihedral_coeff"_dihedral_coeff.html,
"improper_coeff"_improper_coeff.html,
"kspace_style"_kspace_style.html, "dielectric"_dielectric.html,
"special_bonds"_special_bonds.html.
Various simulation parameters are set by these commands:
"neighbor"_neighbor.html, "neigh_modify"_neigh_modify.html,
"group"_group.html, "timestep"_timestep.html,
"reset_timestep"_reset_timestep.html, "run_style"_run_style.html,
"min_style"_min_style.html, "min_modify"_min_modify.html.
Fixes impose a variety of boundary conditions, time integration, and
diagnostic options. The "fix"_fix.html command comes in many flavors.
Various computations can be specified for execution during a
simulation using the "compute"_compute.html,
"compute_modify"_compute_modify.html, and "variable"_variable.html
commands.
Output options are set by the "thermo"_thermo.html, "dump"_dump.html,
and "restart"_restart.html commands.
(4) Run a simulation
A molecular dynamics simulation is run using the "run"_run.html
command. Energy minimization (molecular statics) is performed using
the "minimize"_minimize.html command. A parallel tempering
(replica-exchange) simulation can be run using the
"temper"_temper.html command.
:line
3.4 Commands listed by category :link(cmd_4),h4
This section lists all LAMMPS commands, grouped by category. The
"next section"_#cmd_5 lists the same commands alphabetically. Note
that some style options for some commands are part of specific LAMMPS
packages, which means they cannot be used unless the package was
included when LAMMPS was built. Not all packages are included in a
default LAMMPS build. These dependencies are listed as Restrictions
in the command's documentation.
Initialization:
"atom_modify"_atom_modify.html, "atom_style"_atom_style.html,
"boundary"_boundary.html, "dimension"_dimension.html,
"newton"_newton.html, "processors"_processors.html, "units"_units.html
Atom definition:
"create_atoms"_create_atoms.html, "create_box"_create_box.html,
"lattice"_lattice.html, "read_data"_read_data.html,
"read_dump"_read_dump.html, "read_restart"_read_restart.html,
"region"_region.html, "replicate"_replicate.html
Force fields:
"angle_coeff"_angle_coeff.html, "angle_style"_angle_style.html,
"bond_coeff"_bond_coeff.html, "bond_style"_bond_style.html,
"dielectric"_dielectric.html, "dihedral_coeff"_dihedral_coeff.html,
"dihedral_style"_dihedral_style.html,
"improper_coeff"_improper_coeff.html,
"improper_style"_improper_style.html,
"kspace_modify"_kspace_modify.html, "kspace_style"_kspace_style.html,
"pair_coeff"_pair_coeff.html, "pair_modify"_pair_modify.html,
"pair_style"_pair_style.html, "pair_write"_pair_write.html,
"special_bonds"_special_bonds.html
Settings:
"comm_style"_comm_style.html, "group"_group.html, "mass"_mass.html,
"min_modify"_min_modify.html, "min_style"_min_style.html,
"neigh_modify"_neigh_modify.html, "neighbor"_neighbor.html,
"reset_timestep"_reset_timestep.html, "run_style"_run_style.html,
"set"_set.html, "timestep"_timestep.html, "velocity"_velocity.html
Fixes:
"fix"_fix.html, "fix_modify"_fix_modify.html, "unfix"_unfix.html
Computes:
"compute"_compute.html, "compute_modify"_compute_modify.html,
"uncompute"_uncompute.html
Output:
"dump"_dump.html, "dump image"_dump_image.html,
"dump_modify"_dump_modify.html, "dump movie"_dump_image.html,
"restart"_restart.html, "thermo"_thermo.html,
"thermo_modify"_thermo_modify.html, "thermo_style"_thermo_style.html,
"undump"_undump.html, "write_data"_write_data.html,
"write_dump"_write_dump.html, "write_restart"_write_restart.html
Actions:
"delete_atoms"_delete_atoms.html, "delete_bonds"_delete_bonds.html,
"displace_atoms"_displace_atoms.html, "change_box"_change_box.html,
"minimize"_minimize.html, "neb"_neb.html "prd"_prd.html,
"rerun"_rerun.html, "run"_run.html, "temper"_temper.html
Miscellaneous:
"clear"_clear.html, "echo"_echo.html, "if"_if.html,
"include"_include.html, "jump"_jump.html, "label"_label.html,
"log"_log.html, "next"_next.html, "print"_print.html,
"shell"_shell.html, "variable"_variable.html
:line
3.5 Individual commands :h4,link(cmd_5),link(comm)
This section lists all LAMMPS commands alphabetically, with a separate
listing below of styles within certain commands. The "previous
section"_#cmd_4 lists the same commands, grouped by category. Note
that some style options for some commands are part of specific LAMMPS
packages, which means they cannot be used unless the package was
included when LAMMPS was built. Not all packages are included in a
default LAMMPS build. These dependencies are listed as Restrictions
in the command's documentation.
"angle_coeff"_angle_coeff.html,
"angle_style"_angle_style.html,
"atom_modify"_atom_modify.html,
"atom_style"_atom_style.html,
"balance"_balance.html,
"bond_coeff"_bond_coeff.html,
"bond_style"_bond_style.html,
"boundary"_boundary.html,
"box"_box.html,
"change_box"_change_box.html,
"clear"_clear.html,
"comm_modify"_comm_modify.html,
"comm_style"_comm_style.html,
"compute"_compute.html,
"compute_modify"_compute_modify.html,
"create_atoms"_create_atoms.html,
"create_bonds"_create_bonds.html,
"create_box"_create_box.html,
"delete_atoms"_delete_atoms.html,
"delete_bonds"_delete_bonds.html,
"dielectric"_dielectric.html,
"dihedral_coeff"_dihedral_coeff.html,
"dihedral_style"_dihedral_style.html,
"dimension"_dimension.html,
"displace_atoms"_displace_atoms.html,
"dump"_dump.html,
"dump image"_dump_image.html,
"dump_modify"_dump_modify.html,
"dump movie"_dump_image.html,
"echo"_echo.html,
"fix"_fix.html,
"fix_modify"_fix_modify.html,
"group"_group.html,
"if"_if.html,
"info"_info.html,
"improper_coeff"_improper_coeff.html,
"improper_style"_improper_style.html,
"include"_include.html,
"jump"_jump.html,
"kspace_modify"_kspace_modify.html,
"kspace_style"_kspace_style.html,
"label"_label.html,
"lattice"_lattice.html,
"log"_log.html,
"mass"_mass.html,
"minimize"_minimize.html,
"min_modify"_min_modify.html,
"min_style"_min_style.html,
"molecule"_molecule.html,
"neb"_neb.html,
"neigh_modify"_neigh_modify.html,
"neighbor"_neighbor.html,
"newton"_newton.html,
"next"_next.html,
"package"_package.html,
"pair_coeff"_pair_coeff.html,
"pair_modify"_pair_modify.html,
"pair_style"_pair_style.html,
"pair_write"_pair_write.html,
"partition"_partition.html,
"prd"_prd.html,
"print"_print.html,
"processors"_processors.html,
"python"_python.html,
"quit"_quit.html,
"read_data"_read_data.html,
"read_dump"_read_dump.html,
"read_restart"_read_restart.html,
"region"_region.html,
"replicate"_replicate.html,
"rerun"_rerun.html,
"reset_timestep"_reset_timestep.html,
"restart"_restart.html,
"run"_run.html,
"run_style"_run_style.html,
"set"_set.html,
"shell"_shell.html,
"special_bonds"_special_bonds.html,
"suffix"_suffix.html,
"tad"_tad.html,
"temper"_temper.html,
"thermo"_thermo.html,
"thermo_modify"_thermo_modify.html,
"thermo_style"_thermo_style.html,
"timer"_timer.html,
"timestep"_timestep.html,
"uncompute"_uncompute.html,
"undump"_undump.html,
"unfix"_unfix.html,
"units"_units.html,
"variable"_variable.html,
"velocity"_velocity.html,
"write_data"_write_data.html,
"write_dump"_write_dump.html,
"write_restart"_write_restart.html :tb(c=6,ea=c)
These are additional commands in USER packages, which can be used if
"LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"group2ndx"_group2ndx.html :tb(c=1,ea=c)
:line
Fix styles :h4
See the "fix"_fix.html command for one-line descriptions of each style
or click on the style itself for a full description. Some of the
styles have accelerated versions, which can be used if LAMMPS is built
with the "appropriate accelerated package"_Section_accelerate.html.
This is indicated by additional letters in parenthesis: c = USER-CUDA,
g = GPU, i = USER-INTEL, k = KOKKOS, o = USER-OMP, t = OPT.
"adapt"_fix_adapt.html,
"addforce (c)"_fix_addforce.html,
"append/atoms"_fix_append_atoms.html,
"atom/swap"_fix_atom_swap.html,
"aveforce (c)"_fix_aveforce.html,
"ave/atom"_fix_ave_atom.html,
"ave/chunk"_fix_ave_chunk.html,
"ave/correlate"_fix_ave_correlate.html,
"ave/histo"_fix_ave_histo.html,
"ave/histo/weight"_fix_ave_histo.html,
"ave/spatial"_fix_ave_spatial.html,
"ave/time"_fix_ave_time.html,
"balance"_fix_balance.html,
"bond/break"_fix_bond_break.html,
"bond/create"_fix_bond_create.html,
"bond/swap"_fix_bond_swap.html,
"box/relax"_fix_box_relax.html,
"deform (k)"_fix_deform.html,
"deposit"_fix_deposit.html,
"drag"_fix_drag.html,
"dt/reset"_fix_dt_reset.html,
"efield"_fix_efield.html,
"enforce2d (c)"_fix_enforce2d.html,
"evaporate"_fix_evaporate.html,
"external"_fix_external.html,
"freeze (c)"_fix_freeze.html,
"gcmc"_fix_gcmc.html,
"gld"_fix_gld.html,
"gravity (co)"_fix_gravity.html,
"heat"_fix_heat.html,
"indent"_fix_indent.html,
"langevin (k)"_fix_langevin.html,
"lineforce"_fix_lineforce.html,
"momentum"_fix_momentum.html,
"move"_fix_move.html,
"msst"_fix_msst.html,
"neb"_fix_neb.html,
"nph (ko)"_fix_nh.html,
"nphug (o)"_fix_nphug.html,
"nph/asphere (o)"_fix_nph_asphere.html,
"nph/sphere (o)"_fix_nph_sphere.html,
"npt (ckio)"_fix_nh.html,
"npt/asphere (o)"_fix_npt_asphere.html,
"npt/sphere (o)"_fix_npt_sphere.html,
"nve (ckio)"_fix_nve.html,
"nve/asphere (i)"_fix_nve_asphere.html,
"nve/asphere/noforce"_fix_nve_asphere_noforce.html,
"nve/body"_fix_nve_body.html,
"nve/limit"_fix_nve_limit.html,
"nve/line"_fix_nve_line.html,
"nve/noforce"_fix_nve_noforce.html,
"nve/sphere (o)"_fix_nve_sphere.html,
"nve/tri"_fix_nve_tri.html,
"nvt (cko)"_fix_nh.html,
"nvt/asphere (o)"_fix_nvt_asphere.html,
"nvt/sllod (o)"_fix_nvt_sllod.html,
"nvt/sphere (o)"_fix_nvt_sphere.html,
"oneway"_fix_oneway.html,
"orient/fcc"_fix_orient_fcc.html,
"planeforce"_fix_planeforce.html,
"poems"_fix_poems.html,
"pour"_fix_pour.html,
"press/berendsen"_fix_press_berendsen.html,
"print"_fix_print.html,
"property/atom"_fix_property_atom.html,
"qeq/comb (o)"_fix_qeq_comb.html,
"qeq/dynamic"_fix_qeq.html,
+"qeq/fire"_fix_qeq.html,
"qeq/point"_fix_qeq.html,
"qeq/shielded"_fix_qeq.html,
"qeq/slater"_fix_qeq.html,
"recenter"_fix_recenter.html,
"restrain"_fix_restrain.html,
"rigid (o)"_fix_rigid.html,
"rigid/nph (o)"_fix_rigid.html,
"rigid/npt (o)"_fix_rigid.html,
"rigid/nve (o)"_fix_rigid.html,
"rigid/nvt (o)"_fix_rigid.html,
"rigid/small (o)"_fix_rigid.html,
"rigid/small/nph"_fix_rigid.html,
"rigid/small/npt"_fix_rigid.html,
"rigid/small/nve"_fix_rigid.html,
"rigid/small/nvt"_fix_rigid.html,
"setforce (ck)"_fix_setforce.html,
"shake (c)"_fix_shake.html,
"spring"_fix_spring.html,
"spring/rg"_fix_spring_rg.html,
"spring/self"_fix_spring_self.html,
"srd"_fix_srd.html,
"store/force"_fix_store_force.html,
"store/state"_fix_store_state.html,
"temp/berendsen (c)"_fix_temp_berendsen.html,
"temp/csld"_fix_temp_csvr.html,
"temp/csvr"_fix_temp_csvr.html,
"temp/rescale (c)"_fix_temp_rescale.html,
"tfmc"_fix_tfmc.html,
"thermal/conductivity"_fix_thermal_conductivity.html,
"tmd"_fix_tmd.html,
"ttm"_fix_ttm.html,
"tune/kspace"_fix_tune_kspace.html,
"vector"_fix_vector.html,
"viscosity"_fix_viscosity.html,
"viscous (c)"_fix_viscous.html,
"wall/colloid"_fix_wall.html,
"wall/gran"_fix_wall_gran.html,
"wall/harmonic"_fix_wall.html,
"wall/lj1043"_fix_wall.html,
"wall/lj126"_fix_wall.html,
"wall/lj93"_fix_wall.html,
"wall/piston"_fix_wall_piston.html,
"wall/reflect (k)"_fix_wall_reflect.html,
"wall/region"_fix_wall_region.html,
"wall/srd"_fix_wall_srd.html :tb(c=8,ea=c)
These are additional fix styles in USER packages, which can be used if
"LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"adapt/fep"_fix_adapt_fep.html,
"addtorque"_fix_addtorque.html,
"atc"_fix_atc.html,
"ave/correlate/long"_fix_ave_correlate_long.html,
"ave/spatial/sphere"_fix_ave_spatial_sphere.html,
"drude"_fix_drude.html,
"drude/transform/direct"_fix_drude_transform.html,
"drude/transform/reverse"_fix_drude_transform.html,
"colvars"_fix_colvars.html,
"gle"_fix_gle.html,
"imd"_fix_imd.html,
"ipi"_fix_ipi.html,
"langevin/drude"_fix_langevin_drude.html,
"langevin/eff"_fix_langevin_eff.html,
"lb/fluid"_fix_lb_fluid.html,
"lb/momentum"_fix_lb_momentum.html,
"lb/pc"_fix_lb_pc.html,
"lb/rigid/pc/sphere"_fix_lb_rigid_pc_sphere.html,
"lb/viscous"_fix_lb_viscous.html,
"meso"_fix_meso.html,
"meso/stationary"_fix_meso_stationary.html,
"nph/eff"_fix_nh_eff.html,
"npt/eff"_fix_nh_eff.html,
"nve/eff"_fix_nve_eff.html,
"nvt/eff"_fix_nh_eff.html,
"nvt/sllod/eff"_fix_nvt_sllod_eff.html,
"phonon"_fix_phonon.html,
"pimd"_fix_pimd.html,
"qbmsst"_fix_qbmsst.html,
"qeq/reax"_fix_qeq_reax.html,
"qmmm"_fix_qmmm.html,
"qtb"_fix_qtb.html,
"reax/c/bonds"_fix_reaxc_bonds.html,
"reax/c/species"_fix_reaxc_species.html,
"saed/vtk"_fix_saed_vtk.html,
"smd"_fix_smd.html,
"smd/adjust/dt"_fix_smd_adjust_dt.html,
"smd/integrate/tlsph"_fix_smd_integrate_tlsph.html,
"smd/integrate/ulsph"_fix_smd_integrate_ulsph.html,
"smd/move/triangulated/surface"_fix_smd_move_triangulated_surface.html,
"smd/setvel"_fix_smd_setvel.html,
"smd/tlsph/reference/configuration"_fix_smd_tlsph_reference_configuration.html,
"smd/wall/surface"_fix_smd_wall_surface.html,
"temp/rescale/eff"_fix_temp_rescale_eff.html,
"ti/rs"_fix_ti_rs.html,
"ti/spring"_fix_ti_spring.html,
"ttm/mod"_fix_ttm.html :tb(c=6,ea=c)
:line
Compute styles :h4
See the "compute"_compute.html command for one-line descriptions of
each style or click on the style itself for a full description. Some
of the styles have accelerated versions, which can be used if LAMMPS
is built with the "appropriate accelerated
package"_Section_accelerate.html. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.
"angle/local"_compute_angle_local.html,
"angmom/chunk"_compute_angmom_chunk.html,
"body/local"_compute_body_local.html,
"bond/local"_compute_bond_local.html,
"centro/atom"_compute_centro_atom.html,
"chunk/atom"_compute_chunk_atom.html,
"cluster/atom"_compute_cluster_atom.html,
"cna/atom"_compute_cna_atom.html,
"com"_compute_com.html,
"com/chunk"_compute_com_chunk.html,
"contact/atom"_compute_contact_atom.html,
"coord/atom"_compute_coord_atom.html,
"damage/atom"_compute_damage_atom.html,
"dihedral/local"_compute_dihedral_local.html,
"dilatation/atom"_compute_dilatation_atom.html,
"displace/atom"_compute_displace_atom.html,
"erotate/asphere"_compute_erotate_asphere.html,
"erotate/rigid"_compute_erotate_rigid.html,
"erotate/sphere"_compute_erotate_sphere.html,
"erotate/sphere/atom"_compute_erotate_sphere_atom.html,
"event/displace"_compute_event_displace.html,
"group/group"_compute_group_group.html,
"gyration"_compute_gyration.html,
"gyration/chunk"_compute_gyration_chunk.html,
"heat/flux"_compute_heat_flux.html,
"hexorder/atom"_compute_hexorder_atom.html,
"improper/local"_compute_improper_local.html,
"inertia/chunk"_compute_inertia_chunk.html,
"ke"_compute_ke.html,
"ke/atom"_compute_ke_atom.html,
"ke/rigid"_compute_ke_rigid.html,
"msd"_compute_msd.html,
"msd/chunk"_compute_msd_chunk.html,
"msd/nongauss"_compute_msd_nongauss.html,
"omega/chunk"_compute_omega_chunk.html,
"orientorder/atom"_compute_orientorder_atom.html,
"pair"_compute_pair.html,
"pair/local"_compute_pair_local.html,
"pe (c)"_compute_pe.html,
"pe/atom"_compute_pe_atom.html,
"plasticity/atom"_compute_plasticity_atom.html,
"pressure (c)"_compute_pressure.html,
"property/atom"_compute_property_atom.html,
"property/local"_compute_property_local.html,
"property/chunk"_compute_property_chunk.html,
"rdf"_compute_rdf.html,
"reduce"_compute_reduce.html,
"reduce/region"_compute_reduce.html,
"slice"_compute_slice.html,
"sna/atom"_compute_sna_atom.html,
"snad/atom"_compute_sna_atom.html,
"snav/atom"_compute_sna_atom.html,
"stress/atom"_compute_stress_atom.html,
"temp (ck)"_compute_temp.html,
"temp/asphere"_compute_temp_asphere.html,
"temp/chunk"_compute_temp_chunk.html,
"temp/com"_compute_temp_com.html,
"temp/deform"_compute_temp_deform.html,
"temp/partial (c)"_compute_temp_partial.html,
"temp/profile"_compute_temp_profile.html,
"temp/ramp"_compute_temp_ramp.html,
"temp/region"_compute_temp_region.html,
"temp/sphere"_compute_temp_sphere.html,
"ti"_compute_ti.html,
"torque/chunk"_compute_torque_chunk.html,
"vacf"_compute_vacf.html,
"vcm/chunk"_compute_vcm_chunk.html,
"voronoi/atom"_compute_voronoi_atom.html :tb(c=6,ea=c)
These are additional compute styles in USER packages, which can be
used if "LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"ackland/atom"_compute_ackland_atom.html,
"basal/atom"_compute_basal_atom.html,
"fep"_compute_fep.html,
"force/tally"_compute_tally.html,
"heat/flux/tally"_compute_tally.html,
"ke/eff"_compute_ke_eff.html,
"ke/atom/eff"_compute_ke_atom_eff.html,
"meso_e/atom"_compute_meso_e_atom.html,
"meso_rho/atom"_compute_meso_rho_atom.html,
"meso_t/atom"_compute_meso_t_atom.html,
"pe/tally"_compute_tally.html,
"saed"_compute_saed.html,
"smd/contact/radius"_compute_smd_contact_radius.html,
"smd/damage"_compute_smd_damage.html,
"smd/hourglass/error"_compute_smd_hourglass_error.html,
"smd/internal/energy"_compute_smd_internal_energy.html,
"smd/plastic/strain"_compute_smd_plastic_strain.html,
"smd/plastic/strain/rate"_compute_smd_plastic_strain_rate.html,
"smd/rho"_compute_smd_rho.html,
"smd/tlsph/defgrad"_compute_smd_tlsph_defgrad.html,
"smd/tlsph/dt"_compute_smd_tlsph_dt.html,
"smd/tlsph/num/neighs"_compute_smd_tlsph_num_neighs.html,
"smd/tlsph/shape"_compute_smd_tlsph_shape.html,
"smd/tlsph/strain"_compute_smd_tlsph_strain.html,
"smd/tlsph/strain/rate"_compute_smd_tlsph_strain_rate.html,
"smd/tlsph/stress"_compute_smd_tlsph_stress.html,
"smd/triangle/mesh/vertices"_compute_smd_triangle_mesh_vertices.html,
"smd/ulsph/num/neighs"_compute_smd_ulsph_num_neighs.html,
"smd/ulsph/strain"_compute_smd_ulsph_strain.html,
"smd/ulsph/strain/rate"_compute_smd_ulsph_strain_rate.html,
"smd/ulsph/stress"_compute_smd_ulsph_stress.html,
"smd/vol"_compute_smd_vol.html,
"stress/tally"_compute_tally.html,
"temp/drude"_compute_temp_drude.html,
"temp/eff"_compute_temp_eff.html,
"temp/deform/eff"_compute_temp_deform_eff.html,
"temp/region/eff"_compute_temp_region_eff.html,
"temp/rotate"_compute_temp_rotate.html,
"xrd"_compute_xrd.html :tb(c=6,ea=c)
:line
Pair_style potentials :h4
See the "pair_style"_pair_style.html command for an overview of pair
potentials. Click on the style itself for a full description. Many
of the styles have accelerated versions, which can be used if LAMMPS
is built with the "appropriate accelerated
package"_Section_accelerate.html. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.
"none"_pair_none.html,
"hybrid"_pair_hybrid.html,
"hybrid/overlay"_pair_hybrid.html,
"adp (o)"_pair_adp.html,
"airebo (o)"_pair_airebo.html,
"beck (go)"_pair_beck.html,
"body"_pair_body.html,
"bop"_pair_bop.html,
"born (go)"_pair_born.html,
"born/coul/long (cgo)"_pair_born.html,
"born/coul/long/cs"_pair_born.html,
"born/coul/msm (o)"_pair_born.html,
"born/coul/wolf (go)"_pair_born.html,
"brownian (o)"_pair_brownian.html,
"brownian/poly (o)"_pair_brownian.html,
"buck (cgkio)"_pair_buck.html,
"buck/coul/cut (cgkio)"_pair_buck.html,
"buck/coul/long (cgkio)"_pair_buck.html,
"buck/coul/long/cs"_pair_buck.html,
"buck/coul/msm (o)"_pair_buck.html,
"buck/long/coul/long (o)"_pair_buck_long.html,
"colloid (go)"_pair_colloid.html,
"comb (o)"_pair_comb.html,
"comb3"_pair_comb.html,
"coul/cut (gko)"_pair_coul.html,
"coul/debye (gko)"_pair_coul.html,
"coul/dsf (gko)"_pair_coul.html,
"coul/long (gko)"_pair_coul.html,
"coul/long/cs"_pair_coul.html,
"coul/msm"_pair_coul.html,
"coul/streitz"_pair_coul.html,
"coul/wolf (ko)"_pair_coul.html,
"dpd (o)"_pair_dpd.html,
"dpd/tstat (o)"_pair_dpd.html,
"dsmc"_pair_dsmc.html,
"eam (cgkot)"_pair_eam.html,
"eam/alloy (cgkot)"_pair_eam.html,
"eam/fs (cgkot)"_pair_eam.html,
"eim (o)"_pair_eim.html,
"gauss (go)"_pair_gauss.html,
"gayberne (gio)"_pair_gayberne.html,
"gran/hertz/history (o)"_pair_gran.html,
"gran/hooke (co)"_pair_gran.html,
"gran/hooke/history (o)"_pair_gran.html,
"hbond/dreiding/lj (o)"_pair_hbond_dreiding.html,
"hbond/dreiding/morse (o)"_pair_hbond_dreiding.html,
"kim"_pair_kim.html,
"lcbop"_pair_lcbop.html,
-"line/lj (o)"_pair_line_lj.html,
+"line/lj"_pair_line_lj.html,
"lj/charmm/coul/charmm (cko)"_pair_charmm.html,
"lj/charmm/coul/charmm/implicit (cko)"_pair_charmm.html,
"lj/charmm/coul/long (cgiko)"_pair_charmm.html,
"lj/charmm/coul/msm"_pair_charmm.html,
"lj/class2 (cgko)"_pair_class2.html,
"lj/class2/coul/cut (cko)"_pair_class2.html,
"lj/class2/coul/long (cgko)"_pair_class2.html,
"lj/cubic (go)"_pair_lj_cubic.html,
"lj/cut (cgikot)"_pair_lj.html,
"lj/cut/coul/cut (cgko)"_pair_lj.html,
"lj/cut/coul/debye (cgko)"_pair_lj.html,
"lj/cut/coul/dsf (gko)"_pair_lj.html,
"lj/cut/coul/long (cgikot)"_pair_lj.html,
"lj/cut/coul/long/cs"_pair_lj.html,
"lj/cut/coul/msm (go)"_pair_lj.html,
"lj/cut/dipole/cut (go)"_pair_dipole.html,
"lj/cut/dipole/long"_pair_dipole.html,
"lj/cut/tip4p/cut (o)"_pair_lj.html,
"lj/cut/tip4p/long (ot)"_pair_lj.html,
"lj/expand (cgko)"_pair_lj_expand.html,
"lj/gromacs (cgko)"_pair_gromacs.html,
"lj/gromacs/coul/gromacs (cko)"_pair_gromacs.html,
"lj/long/coul/long (o)"_pair_lj_long.html,
"lj/long/dipole/long"_pair_dipole.html,
"lj/long/tip4p/long"_pair_lj_long.html,
"lj/smooth (co)"_pair_lj_smooth.html,
"lj/smooth/linear (o)"_pair_lj_smooth_linear.html,
"lj96/cut (cgo)"_pair_lj96.html,
"lubricate (o)"_pair_lubricate.html,
"lubricate/poly (o)"_pair_lubricate.html,
"lubricateU"_pair_lubricateU.html,
"lubricateU/poly"_pair_lubricateU.html,
"meam (o)"_pair_meam.html,
"mie/cut (o)"_pair_mie.html,
"morse (cgot)"_pair_morse.html,
"nb3b/harmonic (o)"_pair_nb3b_harmonic.html,
"nm/cut (o)"_pair_nm.html,
"nm/cut/coul/cut (o)"_pair_nm.html,
"nm/cut/coul/long (o)"_pair_nm.html,
"peri/eps"_pair_peri.html,
"peri/lps (o)"_pair_peri.html,
"peri/pmb (o)"_pair_peri.html,
"peri/ves"_pair_peri.html,
"polymorphic"_pair_polymorphic.html,
"rebo (o)"_pair_airebo.html,
"resquared (go)"_pair_resquared.html,
"snap"_pair_snap.html,
"soft (go)"_pair_soft.html,
"sw (cgkio)"_pair_sw.html,
"table (gko)"_pair_table.html,
"tersoff (cgkio)"_pair_tersoff.html,
"tersoff/mod (ko)"_pair_tersoff_mod.html,
"tersoff/zbl (ko)"_pair_tersoff_zbl.html,
"tip4p/cut (o)"_pair_coul.html,
"tip4p/long (o)"_pair_coul.html,
-"tri/lj (o)"_pair_tri_lj.html,
+"tri/lj"_pair_tri_lj.html,
"vashishta (o)"_pair_vashishta.html,
"yukawa (go)"_pair_yukawa.html,
"yukawa/colloid (go)"_pair_yukawa_colloid.html,
"zbl (go)"_pair_zbl.html :tb(c=4,ea=c)
These are additional pair styles in USER packages, which can be used
if "LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"awpmd/cut"_pair_awpmd.html,
"buck/mdf"_pair_mdf.html,
"coul/cut/soft (o)"_pair_lj_soft.html,
"coul/diel (o)"_pair_coul_diel.html,
"coul/long/soft (o)"_pair_lj_soft.html,
"eam/cd (o)"_pair_eam.html,
"edip (o)"_pair_edip.html,
"eff/cut"_pair_eff.html,
"gauss/cut"_pair_gauss.html,
"lennard/mdf"_pair_mdf.html,
"list"_pair_list.html,
"lj/charmm/coul/long/soft (o)"_pair_charmm.html,
"lj/cut/coul/cut/soft (o)"_pair_lj_soft.html,
"lj/cut/coul/long/soft (o)"_pair_lj_soft.html,
"lj/cut/dipole/sf (go)"_pair_dipole.html,
"lj/cut/soft (o)"_pair_lj_soft.html,
"lj/cut/tip4p/long/soft (o)"_pair_lj_soft.html,
"lj/mdf"_pair_mdf.html,
"lj/sdk (gko)"_pair_sdk.html,
"lj/sdk/coul/long (go)"_pair_sdk.html,
"lj/sdk/coul/msm (o)"_pair_sdk.html,
"lj/sf (o)"_pair_lj_sf.html,
"meam/spline"_pair_meam_spline.html,
"meam/sw/spline"_pair_meam_sw_spline.html,
"mgpt"_pair_mgpt.html,
"quip"_pair_quip.html,
"reax/c"_pair_reax_c.html,
"smd/hertz"_pair_smd_hertz.html,
"smd/tlsph"_pair_smd_tlsph.html,
"smd/triangulated/surface"_pair_smd_triangulated_surface.html,
"smd/ulsph"_pair_smd_ulsph.html,
"smtbq"_pair_smtbq.html,
"sph/heatconduction"_pair_sph_heatconduction.html,
"sph/idealgas"_pair_sph_idealgas.html,
"sph/lj"_pair_sph_lj.html,
"sph/rhosum"_pair_sph_rhosum.html,
"sph/taitwater"_pair_sph_taitwater.html,
"sph/taitwater/morris"_pair_sph_taitwater_morris.html,
"srp"_pair_srp.html,
"tersoff/table (o)"_pair_tersoff.html,
"thole"_pair_thole.html,
"tip4p/long/soft (o)"_pair_lj_soft.html :tb(c=4,ea=c)
:line
Bond_style potentials :h4
See the "bond_style"_bond_style.html command for an overview of bond
potentials. Click on the style itself for a full description. Some
of the styles have accelerated versions, which can be used if LAMMPS
is built with the "appropriate accelerated
package"_Section_accelerate.html. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.
"none"_bond_none.html,
"hybrid"_bond_hybrid.html,
"class2 (o)"_bond_class2.html,
"fene (ko)"_bond_fene.html,
"fene/expand (o)"_bond_fene_expand.html,
"harmonic (ko)"_bond_harmonic.html,
"morse (o)"_bond_morse.html,
"nonlinear (o)"_bond_nonlinear.html,
"quartic (o)"_bond_quartic.html,
"table (o)"_bond_table.html :tb(c=4,ea=c)
These are additional bond styles in USER packages, which can be used
if "LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"harmonic/shift (o)"_bond_harmonic_shift.html,
"harmonic/shift/cut (o)"_bond_harmonic_shift_cut.html :tb(c=4,ea=c)
:line
Angle_style potentials :h4
See the "angle_style"_angle_style.html command for an overview of
angle potentials. Click on the style itself for a full description.
Some of the styles have accelerated versions, which can be used if
LAMMPS is built with the "appropriate accelerated
package"_Section_accelerate.html. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.
"none"_angle_none.html,
"hybrid"_angle_hybrid.html,
"charmm (ko)"_angle_charmm.html,
"class2 (o)"_angle_class2.html,
"cosine (o)"_angle_cosine.html,
"cosine/delta (o)"_angle_cosine_delta.html,
"cosine/periodic (o)"_angle_cosine_periodic.html,
"cosine/squared (o)"_angle_cosine_squared.html,
"harmonic (ko)"_angle_harmonic.html,
"table (o)"_angle_table.html :tb(c=4,ea=c)
These are additional angle styles in USER packages, which can be used
if "LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"cosine/shift (o)"_angle_cosine_shift.html,
"cosine/shift/exp (o)"_angle_cosine_shift_exp.html,
"dipole (o)"_angle_dipole.html,
"fourier (o)"_angle_fourier.html,
"fourier/simple (o)"_angle_fourier_simple.html,
"quartic (o)"_angle_quartic.html,
"sdk"_angle_sdk.html :tb(c=4,ea=c)
:line
Dihedral_style potentials :h4
See the "dihedral_style"_dihedral_style.html command for an overview
of dihedral potentials. Click on the style itself for a full
description. Some of the styles have accelerated versions, which can
be used if LAMMPS is built with the "appropriate accelerated
package"_Section_accelerate.html. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.
"none"_dihedral_none.html,
"hybrid"_dihedral_hybrid.html,
"charmm (ko)"_dihedral_charmm.html,
"class2 (o)"_dihedral_class2.html,
"harmonic (o)"_dihedral_harmonic.html,
"helix (o)"_dihedral_helix.html,
"multi/harmonic (o)"_dihedral_multi_harmonic.html,
"opls (ko)"_dihedral_opls.html :tb(c=4,ea=c)
These are additional dihedral styles in USER packages, which can be
used if "LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"cosine/shift/exp (o)"_dihedral_cosine_shift_exp.html,
"fourier (o)"_dihedral_fourier.html,
"nharmonic (o)"_dihedral_nharmonic.html,
"quadratic (o)"_dihedral_quadratic.html,
"table (o)"_dihedral_table.html :tb(c=4,ea=c)
:line
Improper_style potentials :h4
See the "improper_style"_improper_style.html command for an overview
of improper potentials. Click on the style itself for a full
description. Some of the styles have accelerated versions, which can
be used if LAMMPS is built with the "appropriate accelerated
package"_Section_accelerate.html. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.
"none"_improper_none.html,
"hybrid"_improper_hybrid.html,
"class2 (o)"_improper_class2.html,
"cvff (o)"_improper_cvff.html,
"harmonic (ko)"_improper_harmonic.html,
"umbrella (o)"_improper_umbrella.html :tb(c=4,ea=c)
These are additional improper styles in USER packages, which can be
used if "LAMMPS is built with the appropriate
package"_Section_start.html#start_3.
"cossq (o)"_improper_cossq.html,
"distance"_improper_distance.html,
"fourier (o)"_improper_fourier.html,
"ring (o)"_improper_ring.html :tb(c=4,ea=c)
:line
Kspace solvers :h4
See the "kspace_style"_kspace_style.html command for an overview of
Kspace solvers. Click on the style itself for a full description.
Some of the styles have accelerated versions, which can be used if
LAMMPS is built with the "appropriate accelerated
package"_Section_accelerate.html. This is indicated by additional
letters in parenthesis: c = USER-CUDA, g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.
"ewald (o)"_kspace_style.html,
"ewald/disp"_kspace_style.html,
"msm (o)"_kspace_style.html,
"msm/cg (o)"_kspace_style.html,
"pppm (cgo)"_kspace_style.html,
"pppm/cg (o)"_kspace_style.html,
"pppm/disp"_kspace_style.html,
"pppm/disp/tip4p"_kspace_style.html,
"pppm/tip4p (o)"_kspace_style.html :tb(c=4,ea=c)
diff --git a/doc/Section_start.txt b/doc/Section_start.txt
index 8e0630493..6853bff3d 100644
--- a/doc/Section_start.txt
+++ b/doc/Section_start.txt
@@ -1,1929 +1,1930 @@
"Previous Section"_Section_intro.html - "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next Section"_Section_commands.html :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
2. Getting Started :h3
This section describes how to build and run LAMMPS, for both new and
experienced users.
2.1 "What's in the LAMMPS distribution"_#start_1
2.2 "Making LAMMPS"_#start_2
2.3 "Making LAMMPS with optional packages"_#start_3
2.4 "Building LAMMPS via the Make.py script"_#start_4
2.5 "Building LAMMPS as a library"_#start_5
2.6 "Running LAMMPS"_#start_6
2.7 "Command-line options"_#start_7
2.8 "Screen output"_#start_8
2.9 "Tips for users of previous versions"_#start_9 :all(b)
:line
:line
2.1 What's in the LAMMPS distribution :h4,link(start_1)
When you download a LAMMPS tarball you will need to unzip and untar
the downloaded file with the following commands, after placing the
tarball in an appropriate directory.
gunzip lammps*.tar.gz
tar xvf lammps*.tar :pre
This will create a LAMMPS directory containing two files and several
sub-directories:
README: text file
LICENSE: the GNU General Public License (GPL)
bench: benchmark problems
doc: documentation
examples: simple test problems
potentials: embedded atom method (EAM) potential files
src: source files
tools: pre- and post-processing tools :tb(s=:)
-Note that the "download page"_download also has links to download
+Note that the "download page"_http://lammps.sandia.gov/download.html
+also has links to download
Windows exectubles and installers, as well as pre-built executables
for a few specific Linux distributions. It also has instructions for
how to download/install LAMMPS for Macs (via Homebrew), and to
download and update LAMMPS from SVN and Git repositories, which gives
you the same files that are in the download tarball.
The Windows and Linux executables for serial or parallel only include
certain packages and bug-fixes/upgrades listed on "this
page"_http://lammps.sandia.gov/bug.html up to a certain date, as
stated on the download page. If you want an executable with
non-included packages or that is more current, then you'll need to
build LAMMPS yourself, as discussed in the next section.
Skip to the "Running LAMMPS"_#start_6 sections for info on how to
launch a LAMMPS Windows executable on a Windows box.
:line
2.2 Making LAMMPS :h4,link(start_2)
This section has the following sub-sections:
"Read this first"_#start_2_1
"Steps to build a LAMMPS executable"_#start_2_2
"Common errors that can occur when making LAMMPS"_#start_2_3
"Additional build tips"_#start_2_4
"Building for a Mac"_#start_2_5
"Building for Windows"_#start_2_6 :ul
:line
[{Read this first:}] :link(start_2_1)
If you want to avoid building LAMMPS yourself, read the preceeding
section about options available for downloading and installing
executables. Details are discussed on the "download"_download page.
Building LAMMPS can be simple or not-so-simple. If all you need are
the default packages installed in LAMMPS, and MPI is already installed
on your machine, or you just want to run LAMMPS in serial, then you
can typically use the Makefile.mpi or Makefile.serial files in
src/MAKE by typing one of these lines (from the src dir):
make mpi
make serial :pre
Note that on a facility supercomputer, there are often "modules"
loaded in your environment that provide the compilers and MPI you
should use. In this case, the "mpicxx" compile/link command in
Makefile.mpi should just work by accessing those modules.
It may be the case that one of the other Makefile.machine files in the
src/MAKE sub-directories is a better match to your system (type "make"
to see a list), you can use it as-is by typing (for example):
make stampede :pre
If any of these builds (with an existing Makefile.machine) works on
your system, then you're done!
If you want to do one of the following:
use optional LAMMPS features that require additional libraries
use optional packages that require additional libraries
use optional accelerator packages that require special compiler/linker settings
run on a specialized platform that has its own compilers, settings, or other libs to use :ul
then building LAMMPS is more complicated. You may need to find where
auxiliary libraries exist on your machine or install them if they
don't. You may need to build additional libraries that are part of
the LAMMPS package, before building LAMMPS. You may need to edit a
Makefile.machine file to make it compatible with your system.
Note that there is a Make.py tool in the src directory that automates
several of these steps, but you still have to know what you are doing.
"Section 2.4"_#start_4 below describes the tool. It is a convenient
way to work with installing/un-installing various packages, the
Makefile.machine changes required by some packages, and the auxiliary
libraries some of them use.
Please read the following sections carefully. If you are not
comfortable with makefiles, or building codes on a Unix platform, or
running an MPI job on your machine, please find a local expert to help
you. Many compilation, linking, and run problems that users have are
often not really LAMMPS issues - they are peculiar to the user's
system, compilers, libraries, etc. Such questions are better answered
by a local expert.
If you have a build problem that you are convinced is a LAMMPS issue
(e.g. the compiler complains about a line of LAMMPS source code), then
please post the issue to the "LAMMPS mail
list"_http://lammps.sandia.gov/mail.html.
If you succeed in building LAMMPS on a new kind of machine, for which
there isn't a similar machine Makefile included in the
src/MAKE/MACHINES directory, then send it to the developers and we can
include it in the LAMMPS distribution.
:line
[{Steps to build a LAMMPS executable:}] :link(start_2_2)
[Step 0]
The src directory contains the C++ source and header files for LAMMPS.
It also contains a top-level Makefile and a MAKE sub-directory with
low-level Makefile.* files for many systems and machines. See the
src/MAKE/README file for a quick overview of what files are available
and what sub-directories they are in.
The src/MAKE dir has a few files that should work as-is on many
platforms. The src/MAKE/OPTIONS dir has more that invoke additional
compiler, MPI, and other setting options commonly used by LAMMPS, to
illustrate their syntax. The src/MAKE/MACHINES dir has many more that
have been tweaked or optimized for specific machines. These files are
all good starting points if you find you need to change them for your
machine. Put any file you edit into the src/MAKE/MINE directory and
it will be never be touched by any LAMMPS updates.
>From within the src directory, type "make" or "gmake". You should see
a list of available choices from src/MAKE and all of its
sub-directories. If one of those has the options you want or is the
machine you want, you can type a command like:
make mpi
or
make serial_icc
or
gmake mac :pre
Note that the corresponding Makefile.machine can exist in src/MAKE or
any of its sub-directories. If a file with the same name appears in
multiple places (not a good idea), the order they are used is as
follows: src/MAKE/MINE, src/MAKE, src/MAKE/OPTIONS, src/MAKE/MACHINES.
This gives preference to a file you have created/edited and put in
src/MAKE/MINE.
Note that on a multi-processor or multi-core platform you can launch a
parallel make, by using the "-j" switch with the make command, which
will build LAMMPS more quickly.
If you get no errors and an executable like lmp_mpi or lmp_g++_serial
or lmp_mac is produced, then you're done; it's your lucky day.
Note that by default only a few of LAMMPS optional packages are
installed. To build LAMMPS with optional packages, see "this
section"_#start_3 below.
[Step 1]
If Step 0 did not work, you will need to create a low-level Makefile
for your machine, like Makefile.foo. You should make a copy of an
existing Makefile.* in src/MAKE or one of its sub-directories as a
starting point. The only portions of the file you need to edit are
the first line, the "compiler/linker settings" section, and the
"LAMMPS-specific settings" section. When it works, put the edited
file in src/MAKE/MINE and it will not be altered by any future LAMMPS
updates.
[Step 2]
Change the first line of Makefile.foo to list the word "foo" after the
"#", and whatever other options it will set. This is the line you
will see if you just type "make".
[Step 3]
The "compiler/linker settings" section lists compiler and linker
settings for your C++ compiler, including optimization flags. You can
use g++, the open-source GNU compiler, which is available on all Unix
systems. You can also use mpicxx which will typically be available if
MPI is installed on your system, though you should check which actual
compiler it wraps. Vendor compilers often produce faster code. On
boxes with Intel CPUs, we suggest using the Intel icc compiler, which
can be downloaded from "Intel's compiler site"_intel.
:link(intel,http://www.intel.com/software/products/noncom)
If building a C++ code on your machine requires additional libraries,
then you should list them as part of the LIB variable. You should
not need to do this if you use mpicxx.
The DEPFLAGS setting is what triggers the C++ compiler to create a
dependency list for a source file. This speeds re-compilation when
source (*.cpp) or header (*.h) files are edited. Some compilers do
not support dependency file creation, or may use a different switch
than -D. GNU g++ and Intel icc works with -D. If your compiler can't
create dependency files, then you'll need to create a Makefile.foo
patterned after Makefile.storm, which uses different rules that do not
involve dependency files. Note that when you build LAMMPS for the
first time on a new platform, a long list of *.d files will be printed
out rapidly. This is not an error; it is the Makefile doing its
normal creation of dependencies.
[Step 4]
The "system-specific settings" section has several parts. Note that
if you change any -D setting in this section, you should do a full
re-compile, after typing "make clean" (which will describe different
clean options).
The LMP_INC variable is used to include options that turn on ifdefs
within the LAMMPS code. The options that are currently recogized are:
-DLAMMPS_GZIP
-DLAMMPS_JPEG
-DLAMMPS_PNG
-DLAMMPS_FFMPEG
-DLAMMPS_MEMALIGN
-DLAMMPS_XDR
-DLAMMPS_SMALLBIG
-DLAMMPS_BIGBIG
-DLAMMPS_SMALLSMALL
-DLAMMPS_LONGLONG_TO_LONG
-DPACK_ARRAY
-DPACK_POINTER
-DPACK_MEMCPY :ul
The read_data and dump commands will read/write gzipped files if you
compile with -DLAMMPS_GZIP. It requires that your machine supports
the "popen()" function in the standard runtime library and that a gzip
executable can be found by LAMMPS during a run.
NOTE: on some clusters with high-speed networks, using the fork()
library calls (required by popen()) can interfere with the fast
communication library and lead to simulations using compressed output
or input to hang or crash. For selected operations, compressed file
I/O is also available using a compression library instead, which are
provided in the COMPRESS package. From more details about compiling
LAMMPS with packages, please see below.
If you use -DLAMMPS_JPEG, the "dump image"_dump_image.html command
will be able to write out JPEG image files. For JPEG files, you must
also link LAMMPS with a JPEG library, as described below. If you use
-DLAMMPS_PNG, the "dump image"_dump.html command will be able to write
out PNG image files. For PNG files, you must also link LAMMPS with a
PNG library, as described below. If neither of those two defines are
used, LAMMPS will only be able to write out uncompressed PPM image
files.
If you use -DLAMMPS_FFMPEG, the "dump movie"_dump_image.html command
will be available to support on-the-fly generation of rendered movies
the need to store intermediate image files. It requires that your
machines supports the "popen" function in the standard runtime library
and that an FFmpeg executable can be found by LAMMPS during the run.
NOTE: Similar to the note above, this option can conflict with
high-speed networks, because it uses popen().
Using -DLAMMPS_MEMALIGN=<bytes> enables the use of the
posix_memalign() call instead of malloc() when large chunks or memory
are allocated by LAMMPS. This can help to make more efficient use of
vector instructions of modern CPUS, since dynamically allocated memory
has to be aligned on larger than default byte boundaries (e.g. 16
bytes instead of 8 bytes on x86 type platforms) for optimal
performance.
If you use -DLAMMPS_XDR, the build will include XDR compatibility
files for doing particle dumps in XTC format. This is only necessary
if your platform does have its own XDR files available. See the
Restrictions section of the "dump"_dump.html command for details.
Use at most one of the -DLAMMPS_SMALLBIG, -DLAMMPS_BIGBIG, -D-
DLAMMPS_SMALLSMALL settings. The default is -DLAMMPS_SMALLBIG. These
settings refer to use of 4-byte (small) vs 8-byte (big) integers
within LAMMPS, as specified in src/lmptype.h. The only reason to use
the BIGBIG setting is to enable simulation of huge molecular systems
(which store bond topology info) with more than 2 billion atoms, or to
track the image flags of moving atoms that wrap around a periodic box
more than 512 times. Normally, the only reason to use SMALLSMALL is
if your machine does not support 64-bit integers, though you can use
SMALLSMALL setting if you are running in serial or on a desktop
machine or small cluster where you will never run large systems or for
long time (more than 2 billion atoms, more than 2 billion timesteps).
See the "Additional build tips"_#start_2_4 section below for more
details on these settings.
Note that two packages, USER-ATC and USER-CUDA are not currently
compatible with -DLAMMPS_BIGBIG. Also the GPU package requires the
lib/gpu library to be compiled with the same setting, or the link will
fail.
The -DLAMMPS_LONGLONG_TO_LONG setting may be needed if your system or
MPI version does not recognize "long long" data types. In this case a
"long" data type is likely already 64-bits, in which case this setting
will convert to that data type.
Using one of the -DPACK_ARRAY, -DPACK_POINTER, and -DPACK_MEMCPY
options can make for faster parallel FFTs (in the PPPM solver) on some
platforms. The -DPACK_ARRAY setting is the default. See the
"kspace_style"_kspace_style.html command for info about PPPM. See
Step 6 below for info about building LAMMPS with an FFT library.
[Step 5]
The 3 MPI variables are used to specify an MPI library to build LAMMPS
with. Note that you do not need to set these if you use the MPI
compiler mpicxx for your CC and LINK setting in the section above.
The MPI wrapper knows where to find the needed files.
If you want LAMMPS to run in parallel, you must have an MPI library
installed on your platform. If MPI is installed on your system in the
usual place (under /usr/local), you also may not need to specify these
3 variables, assuming /usr/local is in your path. On some large
parallel machines which use "modules" for their compile/link
environements, you may simply need to include the correct module in
your build environment, before building LAMMPS. Or the parallel
machine may have a vendor-provided MPI which the compiler has no
trouble finding.
Failing this, these 3 variables can be used to specify where the mpi.h
file (MPI_INC) and the MPI library file (MPI_PATH) are found and the
name of the library file (MPI_LIB).
If you are installing MPI yourself, we recommend Argonne's MPICH2
or OpenMPI. MPICH can be downloaded from the "Argonne MPI
site"_http://www.mcs.anl.gov/research/projects/mpich2/. OpenMPI can
be downloaded from the "OpenMPI site"_http://www.open-mpi.org.
Other MPI packages should also work. If you are running on a big
parallel platform, your system people or the vendor should have
already installed a version of MPI, which is likely to be faster
than a self-installed MPICH or OpenMPI, so find out how to build
and link with it. If you use MPICH or OpenMPI, you will have to
configure and build it for your platform. The MPI configure script
should have compiler options to enable you to use the same compiler
you are using for the LAMMPS build, which can avoid problems that can
arise when linking LAMMPS to the MPI library.
If you just want to run LAMMPS on a single processor, you can use the
dummy MPI library provided in src/STUBS, since you don't need a true
MPI library installed on your system. See src/MAKE/Makefile.serial
for how to specify the 3 MPI variables in this case. You will also
need to build the STUBS library for your platform before making LAMMPS
itself. Note that if you are building with src/MAKE/Makefile.serial,
e.g. by typing "make serial", then the STUBS library is built for you.
To build the STUBS library from the src directory, type "make
mpi-stubs", or from the src/STUBS dir, type "make". This should
create a libmpi_stubs.a file suitable for linking to LAMMPS. If the
build fails, you will need to edit the STUBS/Makefile for your
platform.
The file STUBS/mpi.c provides a CPU timer function called MPI_Wtime()
that calls gettimeofday() . If your system doesn't support
gettimeofday() , you'll need to insert code to call another timer.
Note that the ANSI-standard function clock() rolls over after an hour
or so, and is therefore insufficient for timing long LAMMPS
simulations.
[Step 6]
The 3 FFT variables allow you to specify an FFT library which LAMMPS
uses (for performing 1d FFTs) when running the particle-particle
particle-mesh (PPPM) option for long-range Coulombics via the
"kspace_style"_kspace_style.html command.
LAMMPS supports various open-source or vendor-supplied FFT libraries
for this purpose. If you leave these 3 variables blank, LAMMPS will
use the open-source "KISS FFT library"_http://kissfft.sf.net, which is
included in the LAMMPS distribution. This library is portable to all
platforms and for typical LAMMPS simulations is almost as fast as FFTW
or vendor optimized libraries. If you are not including the KSPACE
package in your build, you can also leave the 3 variables blank.
Otherwise, select which kinds of FFTs to use as part of the FFT_INC
setting by a switch of the form -DFFT_XXX. Recommended values for XXX
are: MKL, SCSL, FFTW2, and FFTW3. Legacy options are: INTEL, SGI,
ACML, and T3E. For backward compatability, using -DFFT_FFTW will use
the FFTW2 library. Using -DFFT_NONE will use the KISS library
described above.
You may also need to set the FFT_INC, FFT_PATH, and FFT_LIB variables,
so the compiler and linker can find the needed FFT header and library
files. Note that on some large parallel machines which use "modules"
for their compile/link environements, you may simply need to include
the correct module in your build environment. Or the parallel machine
may have a vendor-provided FFT library which the compiler has no
trouble finding.
FFTW is a fast, portable library that should also work on any
platform. You can download it from
"www.fftw.org"_http://www.fftw.org. Both the legacy version 2.1.X and
the newer 3.X versions are supported as -DFFT_FFTW2 or -DFFT_FFTW3.
Building FFTW for your box should be as simple as ./configure; make.
Note that on some platforms FFTW2 has been pre-installed, and uses
renamed files indicating the precision it was compiled with,
e.g. sfftw.h, or dfftw.h instead of fftw.h. In this case, you can
specify an additional define variable for FFT_INC called -DFFTW_SIZE,
which will select the correct include file. In this case, for FFT_LIB
you must also manually specify the correct library, namely -lsfftw or
-ldfftw.
The FFT_INC variable also allows for a -DFFT_SINGLE setting that will
use single-precision FFTs with PPPM, which can speed-up long-range
calulations, particularly in parallel or on GPUs. Fourier transform
and related PPPM operations are somewhat insensitive to floating point
truncation errors and thus do not always need to be performed in
double precision. Using the -DFFT_SINGLE setting trades off a little
accuracy for reduced memory use and parallel communication costs for
transposing 3d FFT data. Note that single precision FFTs have only
been tested with the FFTW3, FFTW2, MKL, and KISS FFT options.
[Step 7]
The 3 JPG variables allow you to specify a JPEG and/or PNG library
which LAMMPS uses when writing out JPEG or PNG files via the "dump
image"_dump_image.html command. These can be left blank if you do not
use the -DLAMMPS_JPEG or -DLAMMPS_PNG switches discussed above in Step
4, since in that case JPEG/PNG output will be disabled.
A standard JPEG library usually goes by the name libjpeg.a or
libjpeg.so and has an associated header file jpeglib.h. Whichever
JPEG library you have on your platform, you'll need to set the
appropriate JPG_INC, JPG_PATH, and JPG_LIB variables, so that the
compiler and linker can find it.
A standard PNG library usually goes by the name libpng.a or libpng.so
and has an associated header file png.h. Whichever PNG library you
have on your platform, you'll need to set the appropriate JPG_INC,
JPG_PATH, and JPG_LIB variables, so that the compiler and linker can
find it.
As before, if these header and library files are in the usual place on
your machine, you may not need to set these variables.
[Step 8]
Note that by default only a few of LAMMPS optional packages are
installed. To build LAMMPS with optional packages, see "this
section"_#start_3 below, before proceeding to Step 9.
[Step 9]
That's it. Once you have a correct Makefile.foo, and you have
pre-built any other needed libraries (e.g. MPI, FFT, etc) all you need
to do from the src directory is type something like this:
make foo
or
gmake foo :pre
You should get the executable lmp_foo when the build is complete.
:line
[{Errors that can occur when making LAMMPS:}] :link(start_2_3)
NOTE: If an error occurs when building LAMMPS, the compiler or linker
will state very explicitly what the problem is. The error message
should give you a hint as to which of the steps above has failed, and
what you need to do in order to fix it. Building a code with a
Makefile is a very logical process. The compiler and linker need to
find the appropriate files and those files need to be compatible with
LAMMPS source files. When a make fails, there is usually a very
simple reason, which you or a local expert will need to fix.
Here are two non-obvious errors that can occur:
(1) If the make command breaks immediately with errors that indicate
it can't find files with a "*" in their names, this can be because
your machine's native make doesn't support wildcard expansion in a
makefile. Try gmake instead of make. If that doesn't work, try using
a -f switch with your make command to use a pre-generated
Makefile.list which explicitly lists all the needed files, e.g.
make makelist
make -f Makefile.list linux
gmake -f Makefile.list mac :pre
The first "make" command will create a current Makefile.list with all
the file names in your src dir. The 2nd "make" command (make or
gmake) will use it to build LAMMPS. Note that you should
include/exclude any desired optional packages before using the "make
makelist" command.
(2) If you get an error that says something like 'identifier "atoll"
is undefined', then your machine does not support "long long"
integers. Try using the -DLAMMPS_LONGLONG_TO_LONG setting described
above in Step 4.
:line
[{Additional build tips:}] :link(start_2_4)
(1) Building LAMMPS for multiple platforms.
You can make LAMMPS for multiple platforms from the same src
directory. Each target creates its own object sub-directory called
Obj_target where it stores the system-specific *.o files.
(2) Cleaning up.
Typing "make clean-all" or "make clean-machine" will delete *.o object
files created when LAMMPS is built, for either all builds or for a
particular machine.
(3) Changing the LAMMPS size limits via -DLAMMPS_SMALLBIG or
-DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL
As explained above, any of these 3 settings can be specified on the
LMP_INC line in your low-level src/MAKE/Makefile.foo.
The default is -DLAMMPS_SMALLBIG which allows for systems with up to
2^63 atoms and 2^63 timesteps (about 9e18). The atom limit is for
atomic systems which do not store bond topology info and thus do not
require atom IDs. If you use atom IDs for atomic systems (which is
the default) or if you use a molecular model, which stores bond
topology info and thus requires atom IDs, the limit is 2^31 atoms
(about 2 billion). This is because the IDs are stored in 32-bit
integers.
Likewise, with this setting, the 3 image flags for each atom (see the
"dump"_dump.html doc page for a discussion) are stored in a 32-bit
integer, which means the atoms can only wrap around a periodic box (in
each dimension) at most 512 times. If atoms move through the periodic
box more than this many times, the image flags will "roll over",
e.g. from 511 to -512, which can cause diagnostics like the
mean-squared displacement, as calculated by the "compute
msd"_compute_msd.html command, to be faulty.
To allow for larger atomic systems with atom IDs or larger molecular
systems or larger image flags, compile with -DLAMMPS_BIGBIG. This
stores atom IDs and image flags in 64-bit integers. This enables
atomic or molecular systems with atom IDS of up to 2^63 atoms (about
9e18). And image flags will not "roll over" until they reach 2^20 =
1048576.
If your system does not support 8-byte integers, you will need to
compile with the -DLAMMPS_SMALLSMALL setting. This will restrict the
total number of atoms (for atomic or molecular systems) and timesteps
to 2^31 (about 2 billion). Image flags will roll over at 2^9 = 512.
Note that in src/lmptype.h there are definitions of all these data
types as well as the MPI data types associated with them. The MPI
types need to be consistent with the associated C data types, or else
LAMMPS will generate a run-time error. As far as we know, the
settings defined in src/lmptype.h are portable and work on every
current system.
In all cases, the size of problem that can be run on a per-processor
basis is limited by 4-byte integer storage to 2^31 atoms per processor
(about 2 billion). This should not normally be a limitation since such
a problem would have a huge per-processor memory footprint due to
neighbor lists and would run very slowly in terms of CPU secs/timestep.
:line
[{Building for a Mac:}] :link(start_2_5)
OS X is BSD Unix, so it should just work. See the
src/MAKE/MACHINES/Makefile.mac and Makefile.mac_mpi files.
:line
[{Building for Windows:}] :link(start_2_6)
The LAMMPS download page has an option to download both a serial and
parallel pre-built Windows executable. See the "Running
LAMMPS"_#start_6 section for instructions on running these executables
on a Windows box.
The pre-built executables hosted on the "LAMMPS download
page"_http://lammps.sandia.gov/download.html are built with a subset
of the available packages; see the download page for the list. These
are single executable files. No examples or documentation in
included. You will need to download the full source code package to
obtain those.
As an alternative, you can download "daily builds" (and some older
versions) of the installer packages from
"rpm.lammps.org/windows.html"_http://rpm.lammps.org/windows.html.
These executables are built with most optional packages and the
download includes documentation, some tools and most examples.
If you want a Windows version with specific packages included and
excluded, you can build it yourself.
One way to do this is install and use cygwin to build LAMMPS with a
standard unix style make program, just as you would on a Linux box;
see src/MAKE/MACHINES/Makefile.cygwin.
:line
2.3 Making LAMMPS with optional packages :h4,link(start_3)
This section has the following sub-sections:
"Package basics"_#start_3_1
"Including/excluding packages"_#start_3_2
"Packages that require extra libraries"_#start_3_3
"Packages that require Makefile.machine settings"_#start_3_4 :ul
Note that the following "Section 2.4"_#start_4 describes the Make.py
tool which can be used to install/un-install packages and build the
auxiliary libraries which some of them use. It can also auto-edit a
Makefile.machine to add settings needed by some packages.
:line
[{Package basics:}] :link(start_3_1)
The source code for LAMMPS is structured as a set of core files which
are always included, plus optional packages. Packages are groups of
files that enable a specific set of features. For example, force
fields for molecular systems or granular systems are in packages.
You can see the list of all packages by typing "make package" from
within the src directory of the LAMMPS distribution. This also lists
various make commands that can be used to manipulate packages.
If you use a command in a LAMMPS input script that is specific to a
particular package, you must have built LAMMPS with that package, else
you will get an error that the style is invalid or the command is
unknown. Every command's doc page specfies if it is part of a
package. You can also type
lmp_machine -h :pre
to run your executable with the optional "-h command-line
switch"_#start_7 for "help", which will simply list the styles and
commands known to your executable, and immediately exit.
There are two kinds of packages in LAMMPS, standard and user packages.
More information about the contents of standard and user packages is
given in "Section_packages"_Section_packages.html of the manual. The
difference between standard and user packages is as follows:
Standard packages, such as molecule or kspace, are supported by the
LAMMPS developers and are written in a syntax and style consistent
with the rest of LAMMPS. This means we will answer questions about
them, debug and fix them if necessary, and keep them compatible with
future changes to LAMMPS.
User packages, such as user-atc or user-omp, have been contributed by
users, and always begin with the user prefix. If they are a single
command (single file), they are typically in the user-misc package.
Otherwise, they are a a set of files grouped together which add a
specific functionality to the code.
User packages don't necessarily meet the requirements of the standard
packages. If you have problems using a feature provided in a user
package, you may need to contact the contributor directly to get help.
Information on how to submit additions you make to LAMMPS as single
files or either a standard or user-contributed package are given in
"this section"_Section_modify.html#mod_15 of the documentation.
Some packages (both standard and user) require additional auxiliary
libraries when building LAMMPS. See more details below.
:line
[{Including/excluding packages:}] :link(start_3_2)
To use (or not use) a package you must include it (or exclude it)
before building LAMMPS. From the src directory, this is typically as
simple as:
make yes-colloid
make g++ :pre
or
make no-manybody
make g++ :pre
NOTE: You should NOT include/exclude packages and build LAMMPS in a
single make command using multiple targets, e.g. make yes-colloid g++.
This is because the make procedure creates a list of source files that
will be out-of-date for the build if the package configuration changes
within the same command.
Some packages have individual files that depend on other packages
being included. LAMMPS checks for this and does the right thing.
I.e. individual files are only included if their dependencies are
already included. Likewise, if a package is excluded, other files
dependent on that package are also excluded.
If you will never run simulations that use the features in a
particular packages, there is no reason to include it in your build.
For some packages, this will keep you from having to build auxiliary
libraries (see below), and will also produce a smaller executable
which may run a bit faster.
When you download a LAMMPS tarball, these packages are pre-installed
in the src directory: KSPACE, MANYBODY,MOLECULE. When you download
LAMMPS source files from the SVN or Git repositories, no packages are
pre-installed.
Packages are included or excluded by typing "make yes-name" or "make
no-name", where "name" is the name of the package in lower-case, e.g.
name = kspace for the KSPACE package or name = user-atc for the
USER-ATC package. You can also type "make yes-standard", "make
no-standard", "make yes-std", "make no-std", "make yes-user", "make
no-user", "make yes-all" or "make no-all" to include/exclude various
sets of packages. Type "make package" to see the all of the
package-related make options.
NOTE: Inclusion/exclusion of a package works by simply moving files
back and forth between the main src directory and sub-directories with
the package name (e.g. src/KSPACE, src/USER-ATC), so that the files
are seen or not seen when LAMMPS is built. After you have included or
excluded a package, you must re-build LAMMPS.
Additional package-related make options exist to help manage LAMMPS
files that exist in both the src directory and in package
sub-directories. You do not normally need to use these commands
unless you are editing LAMMPS files or have downloaded a patch from
the LAMMPS WWW site.
Typing "make package-update" or "make pu" will overwrite src files
with files from the package sub-directories if the package has been
included. It should be used after a patch is installed, since patches
only update the files in the package sub-directory, but not the src
files. Typing "make package-overwrite" will overwrite files in the
package sub-directories with src files.
Typing "make package-status" or "make ps" will show which packages are
currently included. Of those that are included, it will list files
that are different in the src directory and package sub-directory.
Typing "make package-diff" lists all differences between these files.
Again, type "make package" to see all of the package-related make
options.
:line
[{Packages that require extra libraries:}] :link(start_3_3)
A few of the standard and user packages require additional auxiliary
libraries. Many of them are provided with LAMMPS, in which case they
must be compiled first, before LAMMPS is built, if you wish to include
that package. If you get a LAMMPS build error about a missing
library, this is likely the reason. See the
"Section_packages"_Section_packages.html doc page for a list of
packages that have these kinds of auxiliary libraries.
The lib directory in the distribution has sub-directories with package
names that correspond to the needed auxiliary libs, e.g. lib/gpu.
Each sub-directory has a README file that gives more details. Code
for most of the auxiliary libraries is included in that directory.
Examples are the USER-ATC and MEAM packages.
A few of the lib sub-directories do not include code, but do include
instructions (and sometimes scripts) that automate the process of
downloading the auxiliary library and installing it so LAMMPS can link
to it. Examples are the KIM, VORONOI, USER-MOLFILE, and USER-SMD
packages.
The lib/python directory (for the PYTHON package) contains only a
choice of Makefile.lammps.* files. This is because no auxiliary code
or libraries are needed, only the Python library and other system libs
that should already available on your system. However, the
Makefile.lammps file is needed to tell LAMMPS which libs to use and
where to find them.
For libraries with provided code, the sub-directory README file
(e.g. lib/atc/README) has instructions on how to build that library.
Typically this is done by typing something like:
make -f Makefile.g++ :pre
If one of the provided Makefiles is not appropriate for your system
you will need to edit or add one. Note that all the Makefiles have a
setting for EXTRAMAKE at the top that specifies a Makefile.lammps.*
file.
If the library build is successful, it will produce 2 files in the lib
directory:
libpackage.a
Makefile.lammps :pre
The Makefile.lammps file will be a copy of the EXTRAMAKE file setting
specified in the library Makefile.* you used.
Note that you must insure that the settings in Makefile.lammps are
appropriate for your system. If they are not, the LAMMPS build will
fail.
As explained in the lib/package/README files, the settings in
Makefile.lammps are used to specify additional system libraries and
their locations so that LAMMPS can build with the auxiliary library.
For example, if the MEAM package is used, the auxiliary library
consists of F90 code, built with a Fortran complier. To link that
library with LAMMPS (a C++ code) via whatever C++ compiler LAMMPS is
built with, typically requires additional Fortran-to-C libraries be
included in the link. Another example are the BLAS and LAPACK
libraries needed to use the USER-ATC or USER-AWPMD packages.
For libraries without provided code, the sub-directory README file has
information on where to download the library and how to build it,
e.g. lib/voronoi/README and lib/smd/README. The README files also
describe how you must either (a) create soft links, via the "ln"
command, in those directories to point to where you built or installed
the packages, or (b) check or edit the Makefile.lammps file in the
same directory to provide that information.
Some of the sub-directories, e.g. lib/voronoi, also have an install.py
script which can be used to automate the process of
downloading/building/installing the auxiliary library, and setting the
needed soft links. Type "python install.py" for further instructions.
As with the sub-directories containing library code, if the soft links
or settings in the lib/package/Makefile.lammps files are not correct,
the LAMMPS build will typically fail.
:line
[{Packages that require Makefile.machine settings}] :link(start_3_4)
A few packages require specific settings in Makefile.machine, to
either build or use the package effectively. These are the
USER-INTEL, KOKKOS, USER-OMP, and OPT packages. The details of what
flags to add or what variables to define are given on the doc pages
that describe each of these accelerator packages in detail:
"USER-INTEL package"_accelerate_intel.html
"KOKKOS package"_accelerate_kokkos.html
"USER-OMP package"_accelerate_omp.html
"OPT package"_accelerate_opt.html :ul
Here is a brief summary of what Makefile.machine changes are needed.
Note that the Make.py tool, described in the next "Section
2.4"_#start_4 can automatically add the needed info to an existing
machine Makefile, using simple command-line arguments.
In src/MAKE/OPTIONS see the following Makefiles for examples of the
changes described below:
Makefile.intel_cpu
Makefile.intel_phi
Makefile.kokkos_omp
Makefile.kokkos_cuda
Makefile.kokkos_phi
Makefile.omp :ul
For the USER-INTEL package, you have 2 choices when building. You can
build with CPU or Phi support. The latter uses Xeon Phi chips in
"offload" mode. Each of these modes requires additional settings in
your Makefile.machine for CCFLAGS and LINKFLAGS.
For CPU mode (if using an Intel compiler):
CCFLAGS: add -fopenmp, -DLAMMPS_MEMALIGN=64, -restrict, -xHost, -fno-alias, -ansi-alias, -override-limits
LINKFLAGS: add -fopenmp :ul
For Phi mode add the following in addition to the CPU mode flags:
CCFLAGS: add -DLMP_INTEL_OFFLOAD and
LINKFLAGS: add -offload :ul
And also add this to CCFLAGS:
-offload-option,mic,compiler,"-fp-model fast=2 -mGLOB_default_function_attrs=\"gather_scatter_loop_unroll=4\"" :pre
For the KOKKOS package, you have 3 choices when building. You can
build with OMP or Cuda or Phi support. Phi support uses Xeon Phi
chips in "native" mode. This can be done by setting the following
variables in your Makefile.machine:
for OMP support, set OMP = yes
for Cuda support, set OMP = yes and CUDA = yes
for Phi support, set OMP = yes and MIC = yes :ul
These can also be set as additional arguments to the make command, e.g.
make g++ OMP=yes MIC=yes :pre
Building the KOKKOS package with CUDA support requires a Makefile
machine that uses the NVIDIA "nvcc" compiler, as well as an
appropriate "arch" setting appropriate to the GPU hardware and NVIDIA
software you have on your machine. See
src/MAKE/OPTIONS/Makefile.kokkos_cuda for an example of such a machine
Makefile.
For the USER-OMP package, your Makefile.machine needs additional
settings for CCFLAGS and LINKFLAGS.
CCFLAGS: add -fopenmp and -restrict
LINKFLAGS: add -fopenmp :ul
For the OPT package, your Makefile.machine needs an additional
settings for CCFLAGS.
CCFLAGS: add -restrict :ul
:line
2.4 Building LAMMPS via the Make.py tool :h4,link(start_4)
The src directory includes a Make.py script, written in Python, which
can be used to automate various steps of the build process. It is
particularly useful for working with the accelerator packages, as well
as other packages which require auxiliary libraries to be built.
The goal of the Make.py tool is to allow any complex multi-step LAMMPS
build to be performed as a single Make.py command. And you can
archive the commands, so they can be re-invoked later via the -r
(redo) switch. If you find some LAMMPS build procedure that can't be
done in a single Make.py command, let the developers know, and we'll
see if we can augment the tool.
You can run Make.py from the src directory by typing either:
Make.py -h
python Make.py -h :pre
which will give you help info about the tool. For the former to work,
you may need to edit the first line of Make.py to point to your local
Python. And you may need to insure the script is executable:
chmod +x Make.py :pre
Here are examples of build tasks you can perform with Make.py:
Install/uninstall packages: Make.py -p no-lib kokkos omp intel
Build specific auxiliary libs: Make.py -a lib-atc lib-meam
Build libs for all installed packages: Make.py -p cuda gpu -gpu mode=double arch=31 -a lib-all
Create a Makefile from scratch with compiler and MPI settings: Make.py -m none -cc g++ -mpi mpich -a file
Augment Makefile.serial with settings for installed packages: Make.py -p intel -intel cpu -m serial -a file
Add JPG and FFTW support to Makefile.mpi: Make.py -m mpi -jpg -fft fftw -a file
Build LAMMPS with a parallel make using Makefile.mpi: Make.py -j 16 -m mpi -a exe
Build LAMMPS and libs it needs using Makefile.serial with accelerator settings: Make.py -p gpu intel -intel cpu -a lib-all file serial :tb(s=:)
The bench and examples directories give Make.py commands that can be
used to build LAMMPS with the various packages and options needed to
run all the benchmark and example input scripts. See these files for
more details:
bench/README
bench/FERMI/README
bench/KEPLER/README
bench/PHI/README
examples/README
examples/accelerate/README
examples/accelerate/make.list :ul
All of the Make.py options and syntax help can be accessed by using
the "-h" switch.
E.g. typing "Make.py -h" gives
Syntax: Make.py switch args ...
switches can be listed in any order
help switch:
-h prints help and syntax for all other specified switches
switch for actions:
-a lib-all, lib-dir, clean, file, exe or machine
list one or more actions, in any order
machine is a Makefile.machine suffix, must be last if used
one-letter switches:
-d (dir), -j (jmake), -m (makefile), -o (output),
-p (packages), -r (redo), -s (settings), -v (verbose)
switches for libs:
-atc, -awpmd, -colvars, -cuda
-gpu, -meam, -poems, -qmmm, -reax
switches for build and makefile options:
-intel, -kokkos, -cc, -mpi, -fft, -jpg, -png :pre
Using the "-h" switch with other switches and actions gives additional
info on all the other specified switches or actions. The "-h" can be
anywhere in the command-line and the other switches do not need their
arguments. E.g. type "Make.py -h -d -atc -intel" will print:
-d dir
dir = LAMMPS home dir
if -d not specified, working dir must be lammps/src :pre
-atc make=suffix lammps=suffix2
all args are optional and can be in any order
make = use Makefile.suffix (def = g++)
lammps = use Makefile.lammps.suffix2 (def = EXTRAMAKE in makefile) :pre
-intel mode
mode = cpu or phi (def = cpu)
build Intel package for CPU or Xeon Phi :pre
Note that Make.py never overwrites an existing Makefile.machine.
Instead, it creates src/MAKE/MINE/Makefile.auto, which you can save or
rename if desired. Likewise it creates an executable named
src/lmp_auto, which you can rename using the -o switch if desired.
The most recently executed Make.py commmand is saved in
src/Make.py.last. You can use the "-r" switch (for redo) to re-invoke
the last command, or you can save a sequence of one or more Make.py
commands to a file and invoke the file of commands using "-r". You
can also label the commands in the file and invoke one or more of them
by name.
A typical use of Make.py is to start with a valid Makefile.machine for
your system, that works for a vanilla LAMMPS build, i.e. when optional
packages are not installed. You can then use Make.py to add various
settings (FFT, JPG, PNG) to the Makefile.machine as well as change its
compiler and MPI options. You can also add additional packages to the
build, as well as build the needed supporting libraries.
You can also use Make.py to create a new Makefile.machine from
scratch, using the "-m none" switch, if you also specify what compiler
and MPI options to use, via the "-cc" and "-mpi" switches.
:line
2.5 Building LAMMPS as a library :h4,link(start_5)
LAMMPS can be built as either a static or shared library, which can
then be called from another application or a scripting language. See
"this section"_Section_howto.html#howto_10 for more info on coupling
LAMMPS to other codes. See "this section"_Section_python.html for
more info on wrapping and running LAMMPS from Python.
[Static library:] :h5
To build LAMMPS as a static library (*.a file on Linux), type
make foo mode=lib :pre
where foo is the machine name. This kind of library is typically used
to statically link a driver application to LAMMPS, so that you can
insure all dependencies are satisfied at compile time. This will use
the ARCHIVE and ARFLAGS settings in src/MAKE/Makefile.foo. The build
will create the file liblammps_foo.a which another application can
link to. It will also create a soft link liblammps.a, which will
point to the most recently built static library.
[Shared library:] :h5
To build LAMMPS as a shared library (*.so file on Linux), which can be
dynamically loaded, e.g. from Python, type
make foo mode=shlib :pre
where foo is the machine name. This kind of library is required when
wrapping LAMMPS with Python; see "Section_python"_Section_python.html
for details. This will use the SHFLAGS and SHLIBFLAGS settings in
src/MAKE/Makefile.foo and perform the build in the directory
Obj_shared_foo. This is so that each file can be compiled with the
-fPIC flag which is required for inclusion in a shared library. The
build will create the file liblammps_foo.so which another application
can link to dyamically. It will also create a soft link liblammps.so,
which will point to the most recently built shared library. This is
the file the Python wrapper loads by default.
Note that for a shared library to be usable by a calling program, all
the auxiliary libraries it depends on must also exist as shared
libraries. This will be the case for libraries included with LAMMPS,
such as the dummy MPI library in src/STUBS or any package libraries in
lib/packages, since they are always built as shared libraries using
the -fPIC switch. However, if a library like MPI or FFTW does not
exist as a shared library, the shared library build will generate an
error. This means you will need to install a shared library version
of the auxiliary library. The build instructions for the library
should tell you how to do this.
Here is an example of such errors when the system FFTW or provided
lib/colvars library have not been built as shared libraries:
/usr/bin/ld: /usr/local/lib/libfftw3.a(mapflags.o): relocation
R_X86_64_32 against `.rodata' can not be used when making a shared
object; recompile with -fPIC
/usr/local/lib/libfftw3.a: could not read symbols: Bad value :pre
/usr/bin/ld: ../../lib/colvars/libcolvars.a(colvarmodule.o):
relocation R_X86_64_32 against `__pthread_key_create' can not be used
when making a shared object; recompile with -fPIC
../../lib/colvars/libcolvars.a: error adding symbols: Bad value :pre
As an example, here is how to build and install the "MPICH
library"_mpich, a popular open-source version of MPI, distributed by
Argonne National Labs, as a shared library in the default
/usr/local/lib location:
:link(mpich,http://www-unix.mcs.anl.gov/mpi)
./configure --enable-shared
make
make install :pre
You may need to use "sudo make install" in place of the last line if
you do not have write privileges for /usr/local/lib. The end result
should be the file /usr/local/lib/libmpich.so.
[Additional requirement for using a shared library:] :h5
The operating system finds shared libraries to load at run-time using
the environment variable LD_LIBRARY_PATH. So you may wish to copy the
file src/liblammps.so or src/liblammps_g++.so (for example) to a place
the system can find it by default, such as /usr/local/lib, or you may
wish to add the LAMMPS src directory to LD_LIBRARY_PATH, so that the
current version of the shared library is always available to programs
that use it.
For the csh or tcsh shells, you would add something like this to your
~/.cshrc file:
setenv LD_LIBRARY_PATH $\{LD_LIBRARY_PATH\}:/home/sjplimp/lammps/src :pre
[Calling the LAMMPS library:] :h5
Either flavor of library (static or shared) allows one or more LAMMPS
objects to be instantiated from the calling program.
When used from a C++ program, all of LAMMPS is wrapped in a LAMMPS_NS
namespace; you can safely use any of its classes and methods from
within the calling code, as needed.
When used from a C or Fortran program or a scripting language like
Python, the library has a simple function-style interface, provided in
src/library.cpp and src/library.h.
See the sample codes in examples/COUPLE/simple for examples of C++ and
C and Fortran codes that invoke LAMMPS thru its library interface.
There are other examples as well in the COUPLE directory which are
discussed in "Section_howto 10"_Section_howto.html#howto_10 of the
manual. See "Section_python"_Section_python.html of the manual for a
description of the Python wrapper provided with LAMMPS that operates
through the LAMMPS library interface.
The files src/library.cpp and library.h define the C-style API for
using LAMMPS as a library. See "Section_howto
19"_Section_howto.html#howto_19 of the manual for a description of the
interface and how to extend it for your needs.
:line
2.6 Running LAMMPS :h4,link(start_6)
By default, LAMMPS runs by reading commands from standard input. Thus
if you run the LAMMPS executable by itself, e.g.
lmp_linux :pre
it will simply wait, expecting commands from the keyboard. Typically
you should put commands in an input script and use I/O redirection,
e.g.
lmp_linux < in.file :pre
For parallel environments this should also work. If it does not, use
the '-in' command-line switch, e.g.
lmp_linux -in in.file :pre
"This section"_Section_commands.html describes how input scripts are
structured and what commands they contain.
You can test LAMMPS on any of the sample inputs provided in the
examples or bench directory. Input scripts are named in.* and sample
outputs are named log.*.name.P where name is a machine and P is the
number of processors it was run on.
Here is how you might run a standard Lennard-Jones benchmark on a
Linux box, using mpirun to launch a parallel job:
cd src
make linux
cp lmp_linux ../bench
cd ../bench
mpirun -np 4 lmp_linux -in in.lj :pre
See "this page"_bench for timings for this and the other benchmarks on
various platforms. Note that some of the example scripts require
LAMMPS to be built with one or more of its optional packages.
:link(bench,http://lammps.sandia.gov/bench.html)
:line
On a Windows box, you can skip making LAMMPS and simply download an
executable, as described above, though the pre-packaged executables
include only certain packages.
To run a LAMMPS executable on a Windows machine, first decide whether
you want to download the non-MPI (serial) or the MPI (parallel)
version of the executable. Download and save the version you have
chosen.
For the non-MPI version, follow these steps:
Get a command prompt by going to Start->Run... ,
then typing "cmd". :ulb,l
Move to the directory where you have saved lmp_win_no-mpi.exe
(e.g. by typing: cd "Documents"). :l
At the command prompt, type "lmp_win_no-mpi -in in.lj", replacing in.lj
with the name of your LAMMPS input script. :l,ule
For the MPI version, which allows you to run LAMMPS under Windows on
multiple processors, follow these steps:
Download and install
"MPICH2"_http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads
for Windows. :ulb,l
You'll need to use the mpiexec.exe and smpd.exe files from the MPICH2
package. Put them in same directory (or path) as the LAMMPS Windows
executable. :l
Get a command prompt by going to Start->Run... ,
then typing "cmd". :l
Move to the directory where you have saved lmp_win_mpi.exe
(e.g. by typing: cd "Documents"). :l
Then type something like this: "mpiexec -localonly 4 lmp_win_mpi -in
in.lj", replacing in.lj with the name of your LAMMPS input script. :l
Note that you may need to provide smpd with a passphrase (it doesn't
matter what you type). :l
In this mode, output may not immediately show up on the screen, so if
your input script takes a long time to execute, you may need to be
patient before the output shows up. :l Alternatively, you can still
use this executable to run on a single processor by typing something
like: "lmp_win_mpi -in in.lj". :l,ule
:line
The screen output from LAMMPS is described in the next section. As it
runs, LAMMPS also writes a log.lammps file with the same information.
Note that this sequence of commands copies the LAMMPS executable
(lmp_linux) to the directory with the input files. This may not be
necessary, but some versions of MPI reset the working directory to
where the executable is, rather than leave it as the directory where
you launch mpirun from (if you launch lmp_linux on its own and not
under mpirun). If that happens, LAMMPS will look for additional input
files and write its output files to the executable directory, rather
than your working directory, which is probably not what you want.
If LAMMPS encounters errors in the input script or while running a
simulation it will print an ERROR message and stop or a WARNING
message and continue. See "Section_errors"_Section_errors.html for a
discussion of the various kinds of errors LAMMPS can or can't detect,
a list of all ERROR and WARNING messages, and what to do about them.
LAMMPS can run a problem on any number of processors, including a
single processor. In theory you should get identical answers on any
number of processors and on any machine. In practice, numerical
round-off can cause slight differences and eventual divergence of
molecular dynamics phase space trajectories.
LAMMPS can run as large a problem as will fit in the physical memory
of one or more processors. If you run out of memory, you must run on
more processors or setup a smaller problem.
:line
2.7 Command-line options :h4,link(start_7)
At run time, LAMMPS recognizes several optional command-line switches
which may be used in any order. Either the full word or a one-or-two
letter abbreviation can be used:
-c or -cuda
-e or -echo
-h or -help
-i or -in
-k or -kokkos
-l or -log
-nc or -nocite
-pk or -package
-p or -partition
-pl or -plog
-ps or -pscreen
-r or -restart
-ro or -reorder
-sc or -screen
-sf or -suffix
-v or -var :ul
For example, lmp_ibm might be launched as follows:
mpirun -np 16 lmp_ibm -v f tmp.out -l my.log -sc none -in in.alloy
mpirun -np 16 lmp_ibm -var f tmp.out -log my.log -screen none -in in.alloy :pre
Here are the details on the options:
-cuda on/off :pre
Explicitly enable or disable CUDA support, as provided by the
USER-CUDA package. Even if LAMMPS is built with this package, as
described above in "Section 2.3"_#start_3, this switch must be set to
enable running with the CUDA-enabled styles the package provides. If
the switch is not set (the default), LAMMPS will operate as if the
USER-CUDA package were not installed; i.e. you can run standard LAMMPS
or with the GPU package, for testing or benchmarking purposes.
-echo style :pre
Set the style of command echoing. The style can be {none} or {screen}
or {log} or {both}. Depending on the style, each command read from
the input script will be echoed to the screen and/or logfile. This
can be useful to figure out which line of your script is causing an
input error. The default value is {log}. The echo style can also be
set by using the "echo"_echo.html command in the input script itself.
-help :pre
Print a brief help summary and a list of options compiled into this
executable for each LAMMPS style (atom_style, fix, compute,
pair_style, bond_style, etc). This can tell you if the command you
want to use was included via the appropriate package at compile time.
LAMMPS will print the info and immediately exit if this switch is
used.
-in file :pre
Specify a file to use as an input script. This is an optional switch
when running LAMMPS in one-partition mode. If it is not specified,
LAMMPS reads its script from standard input, typically from a script
via I/O redirection; e.g. lmp_linux < in.run. I/O redirection should
also work in parallel, but if it does not (in the unlikely case that
an MPI implementation does not support it), then use the -in flag.
Note that this is a required switch when running LAMMPS in
multi-partition mode, since multiple processors cannot all read from
stdin.
-kokkos on/off keyword/value ... :pre
Explicitly enable or disable KOKKOS support, as provided by the KOKKOS
package. Even if LAMMPS is built with this package, as described
above in "Section 2.3"_#start_3, this switch must be set to enable
running with the KOKKOS-enabled styles the package provides. If the
switch is not set (the default), LAMMPS will operate as if the KOKKOS
package were not installed; i.e. you can run standard LAMMPS or with
the GPU or USER-CUDA or USER-OMP packages, for testing or benchmarking
purposes.
Additional optional keyword/value pairs can be specified which
determine how Kokkos will use the underlying hardware on your
platform. These settings apply to each MPI task you launch via the
"mpirun" or "mpiexec" command. You may choose to run one or more MPI
tasks per physical node. Note that if you are running on a desktop
machine, you typically have one physical node. On a cluster or
supercomputer there may be dozens or 1000s of physical nodes.
Either the full word or an abbreviation can be used for the keywords.
Note that the keywords do not use a leading minus sign. I.e. the
keyword is "t", not "-t". Also note that each of the keywords has a
default setting. Example of when to use these options and what
settings to use on different platforms is given in "Section
5.8"_Section_accelerate.html#acc_8.
d or device
g or gpus
t or threads
n or numa :ul
device Nd :pre
This option is only relevant if you built LAMMPS with CUDA=yes, you
have more than one GPU per node, and if you are running with only one
MPI task per node. The Nd setting is the ID of the GPU on the node to
run on. By default Nd = 0. If you have multiple GPUs per node, they
have consecutive IDs numbered as 0,1,2,etc. This setting allows you
to launch multiple independent jobs on the node, each with a single
MPI task per node, and assign each job to run on a different GPU.
gpus Ng Ns :pre
This option is only relevant if you built LAMMPS with CUDA=yes, you
have more than one GPU per node, and you are running with multiple MPI
tasks per node (up to one per GPU). The Ng setting is how many GPUs
you will use. The Ns setting is optional. If set, it is the ID of a
GPU to skip when assigning MPI tasks to GPUs. This may be useful if
your desktop system reserves one GPU to drive the screen and the rest
are intended for computational work like running LAMMPS. By default
Ng = 1 and Ns is not set.
Depending on which flavor of MPI you are running, LAMMPS will look for
one of these 3 environment variables
SLURM_LOCALID (various MPI variants compiled with SLURM support)
MV2_COMM_WORLD_LOCAL_RANK (Mvapich)
OMPI_COMM_WORLD_LOCAL_RANK (OpenMPI) :pre
which are initialized by the "srun", "mpirun" or "mpiexec" commands.
The environment variable setting for each MPI rank is used to assign a
unique GPU ID to the MPI task.
threads Nt :pre
This option assigns Nt number of threads to each MPI task for
performing work when Kokkos is executing in OpenMP or pthreads mode.
The default is Nt = 1, which essentially runs in MPI-only mode. If
there are Np MPI tasks per physical node, you generally want Np*Nt =
the number of physical cores per node, to use your available hardware
optimally. This also sets the number of threads used by the host when
LAMMPS is compiled with CUDA=yes.
numa Nm :pre
This option is only relevant when using pthreads with hwloc support.
In this case Nm defines the number of NUMA regions (typicaly sockets)
on a node which will be utilizied by a single MPI rank. By default Nm
= 1. If this option is used the total number of worker-threads per
MPI rank is threads*numa. Currently it is always almost better to
assign at least one MPI rank per NUMA region, and leave numa set to
its default value of 1. This is because letting a single process span
multiple NUMA regions induces a significant amount of cross NUMA data
traffic which is slow.
-log file :pre
Specify a log file for LAMMPS to write status information to. In
one-partition mode, if the switch is not used, LAMMPS writes to the
file log.lammps. If this switch is used, LAMMPS writes to the
specified file. In multi-partition mode, if the switch is not used, a
log.lammps file is created with hi-level status information. Each
partition also writes to a log.lammps.N file where N is the partition
ID. If the switch is specified in multi-partition mode, the hi-level
logfile is named "file" and each partition also logs information to a
file.N. For both one-partition and multi-partition mode, if the
specified file is "none", then no log files are created. Using a
"log"_log.html command in the input script will override this setting.
Option -plog will override the name of the partition log files file.N.
-nocite :pre
Disable writing the log.cite file which is normally written to list
references for specific cite-able features used during a LAMMPS run.
See the "citation page"_http://lammps.sandia.gov/cite.html for more
details.
-package style args .... :pre
Invoke the "package"_package.html command with style and args. The
syntax is the same as if the command appeared at the top of the input
script. For example "-package gpu 2" or "-pk gpu 2" is the same as
"package gpu 2"_package.html in the input script. The possible styles
and args are documented on the "package"_package.html doc page. This
switch can be used multiple times, e.g. to set options for the
USER-INTEL and USER-OMP packages which can be used together.
Along with the "-suffix" command-line switch, this is a convenient
mechanism for invoking accelerator packages and their options without
having to edit an input script.
-partition 8x2 4 5 ... :pre
Invoke LAMMPS in multi-partition mode. When LAMMPS is run on P
processors and this switch is not used, LAMMPS runs in one partition,
i.e. all P processors run a single simulation. If this switch is
used, the P processors are split into separate partitions and each
partition runs its own simulation. The arguments to the switch
specify the number of processors in each partition. Arguments of the
form MxN mean M partitions, each with N processors. Arguments of the
form N mean a single partition with N processors. The sum of
processors in all partitions must equal P. Thus the command
"-partition 8x2 4 5" has 10 partitions and runs on a total of 25
processors.
Running with multiple partitions can e useful for running
"multi-replica simulations"_Section_howto.html#howto_5, where each
replica runs on on one or a few processors. Note that with MPI
installed on a machine (e.g. your desktop), you can run on more
(virtual) processors than you have physical processors.
To run multiple independent simulatoins from one input script, using
multiple partitions, see "Section_howto 4"_Section_howto.html#howto_4
of the manual. World- and universe-style "variables"_variable.html
are useful in this context.
-plog file :pre
Specify the base name for the partition log files, so partition N
writes log information to file.N. If file is none, then no partition
log files are created. This overrides the filename specified in the
-log command-line option. This option is useful when working with
large numbers of partitions, allowing the partition log files to be
suppressed (-plog none) or placed in a sub-directory (-plog
replica_files/log.lammps) If this option is not used the log file for
partition N is log.lammps.N or whatever is specified by the -log
command-line option.
-pscreen file :pre
Specify the base name for the partition screen file, so partition N
writes screen information to file.N. If file is none, then no
partition screen files are created. This overrides the filename
specified in the -screen command-line option. This option is useful
when working with large numbers of partitions, allowing the partition
screen files to be suppressed (-pscreen none) or placed in a
sub-directory (-pscreen replica_files/screen). If this option is not
used the screen file for partition N is screen.N or whatever is
specified by the -screen command-line option.
-restart restartfile {remap} datafile keyword value ... :pre
Convert the restart file into a data file and immediately exit. This
is the same operation as if the following 2-line input script were
run:
read_restart restartfile {remap}
write_data datafile keyword value ... :pre
Note that the specified restartfile and datafile can have wild-card
characters ("*",%") as described by the
"read_restart"_read_restart.html and "write_data"_write_data.html
commands. But a filename such as file.* will need to be enclosed in
quotes to avoid shell expansion of the "*" character.
Note that following restartfile, the optional flag {remap} can be
used. This has the same effect as adding it to the
"read_restart"_read_restart.html command, as explained on its doc
page. This is only useful if the reading of the restart file triggers
an error that atoms have been lost. In that case, use of the remap
flag should allow the data file to still be produced.
Also note that following datafile, the same optional keyword/value
pairs can be listed as used by the "write_data"_write_data.html
command.
-reorder nth N
-reorder custom filename :pre
Reorder the processors in the MPI communicator used to instantiate
LAMMPS, in one of several ways. The original MPI communicator ranks
all P processors from 0 to P-1. The mapping of these ranks to
physical processors is done by MPI before LAMMPS begins. It may be
useful in some cases to alter the rank order. E.g. to insure that
cores within each node are ranked in a desired order. Or when using
the "run_style verlet/split"_run_style.html command with 2 partitions
to insure that a specific Kspace processor (in the 2nd partition) is
matched up with a specific set of processors in the 1st partition.
See the "Section_accelerate"_Section_accelerate.html doc pages for
more details.
If the keyword {nth} is used with a setting {N}, then it means every
Nth processor will be moved to the end of the ranking. This is useful
when using the "run_style verlet/split"_run_style.html command with 2
partitions via the -partition command-line switch. The first set of
processors will be in the first partition, the 2nd set in the 2nd
partition. The -reorder command-line switch can alter this so that
the 1st N procs in the 1st partition and one proc in the 2nd partition
will be ordered consecutively, e.g. as the cores on one physical node.
This can boost performance. For example, if you use "-reorder nth 4"
and "-partition 9 3" and you are running on 12 processors, the
processors will be reordered from
0 1 2 3 4 5 6 7 8 9 10 11 :pre
to
0 1 2 4 5 6 8 9 10 3 7 11 :pre
so that the processors in each partition will be
0 1 2 4 5 6 8 9 10
3 7 11 :pre
See the "processors" command for how to insure processors from each
partition could then be grouped optimally for quad-core nodes.
If the keyword is {custom}, then a file that specifies a permutation
of the processor ranks is also specified. The format of the reorder
file is as follows. Any number of initial blank or comment lines
(starting with a "#" character) can be present. These should be
followed by P lines of the form:
I J :pre
where P is the number of processors LAMMPS was launched with. Note
that if running in multi-partition mode (see the -partition switch
above) P is the total number of processors in all partitions. The I
and J values describe a permutation of the P processors. Every I and
J should be values from 0 to P-1 inclusive. In the set of P I values,
every proc ID should appear exactly once. Ditto for the set of P J
values. A single I,J pairing means that the physical processor with
rank I in the original MPI communicator will have rank J in the
reordered communicator.
Note that rank ordering can also be specified by many MPI
implementations, either by environment variables that specify how to
order physical processors, or by config files that specify what
physical processors to assign to each MPI rank. The -reorder switch
simply gives you a portable way to do this without relying on MPI
itself. See the "processors out"_processors command for how to output
info on the final assignment of physical processors to the LAMMPS
simulation domain.
-screen file :pre
Specify a file for LAMMPS to write its screen information to. In
one-partition mode, if the switch is not used, LAMMPS writes to the
screen. If this switch is used, LAMMPS writes to the specified file
instead and you will see no screen output. In multi-partition mode,
if the switch is not used, hi-level status information is written to
the screen. Each partition also writes to a screen.N file where N is
the partition ID. If the switch is specified in multi-partition mode,
the hi-level screen dump is named "file" and each partition also
writes screen information to a file.N. For both one-partition and
multi-partition mode, if the specified file is "none", then no screen
output is performed. Option -pscreen will override the name of the
partition screen files file.N.
-suffix style args :pre
Use variants of various styles if they exist. The specified style can
be {cuda}, {gpu}, {intel}, {kk}, {omp}, {opt}, or {hybrid}. These refer
to optional packages that LAMMPS can be built with, as described above in
"Section 2.3"_#start_3. The "cuda" style corresponds to the USER-CUDA
package, the "gpu" style to the GPU package, the "intel" style to the
USER-INTEL package, the "kk" style to the KOKKOS package, the "opt"
style to the OPT package, and the "omp" style to the USER-OMP package. The
hybrid style is the only style that accepts arguments. It allows for two
packages to be specified. The first package specified is the default and
will be used if it is available. If no style is available for the first
package, the style for the second package will be used if available. For
example, "-suffix hybrid intel omp" will use styles from the USER-INTEL
package if they are installed and available, but styles for the USER-OMP
package otherwise.
Along with the "-package" command-line switch, this is a convenient
mechanism for invoking accelerator packages and their options without
having to edit an input script.
As an example, all of the packages provide a "pair_style
lj/cut"_pair_lj.html variant, with style names lj/cut/cuda,
lj/cut/gpu, lj/cut/intel, lj/cut/kk, lj/cut/omp, and lj/cut/opt. A
variant style can be specified explicitly in your input script,
e.g. pair_style lj/cut/gpu. If the -suffix switch is used the
specified suffix (cuda,gpu,intel,kk,omp,opt) is automatically appended
whenever your input script command creates a new
"atom"_atom_style.html, "pair"_pair_style.html, "fix"_fix.html,
"compute"_compute.html, or "run"_run_style.html style. If the variant
version does not exist, the standard version is created.
For the GPU package, using this command-line switch also invokes the
default GPU settings, as if the command "package gpu 1" were used at
the top of your input script. These settings can be changed by using
the "-package gpu" command-line switch or the "package
gpu"_package.html command in your script.
For the USER-INTEL package, using this command-line switch also
invokes the default USER-INTEL settings, as if the command "package
intel 1" were used at the top of your input script. These settings
can be changed by using the "-package intel" command-line switch or
the "package intel"_package.html command in your script. If the
USER-OMP package is also installed, the hybrid style with "intel omp"
arguments can be used to make the omp suffix a second choice, if a
requested style is not available in the USER-INTEL package. It will
also invoke the default USER-OMP settings, as if the command "package
omp 0" were used at the top of your input script. These settings can
be changed by using the "-package omp" command-line switch or the
"package omp"_package.html command in your script.
For the KOKKOS package, using this command-line switch also invokes
the default KOKKOS settings, as if the command "package kokkos" were
used at the top of your input script. These settings can be changed
by using the "-package kokkos" command-line switch or the "package
kokkos"_package.html command in your script.
For the OMP package, using this command-line switch also invokes the
default OMP settings, as if the command "package omp 0" were used at
the top of your input script. These settings can be changed by using
the "-package omp" command-line switch or the "package
omp"_package.html command in your script.
The "suffix"_suffix.html command can also be used within an input
script to set a suffix, or to turn off or back on any suffix setting
made via the command line.
-var name value1 value2 ... :pre
Specify a variable that will be defined for substitution purposes when
the input script is read. This switch can be used multiple times to
define multiple variables. "Name" is the variable name which can be a
single character (referenced as $x in the input script) or a full
string (referenced as $\{abc\}). An "index-style
variable"_variable.html will be created and populated with the
subsequent values, e.g. a set of filenames. Using this command-line
option is equivalent to putting the line "variable name index value1
value2 ..." at the beginning of the input script. Defining an index
variable as a command-line argument overrides any setting for the same
index variable in the input script, since index variables cannot be
re-defined. See the "variable"_variable.html command for more info on
defining index and other kinds of variables and "this
section"_Section_commands.html#cmd_2 for more info on using variables
in input scripts.
NOTE: Currently, the command-line parser looks for arguments that
start with "-" to indicate new switches. Thus you cannot specify
multiple variable values if any of they start with a "-", e.g. a
negative numeric value. It is OK if the first value1 starts with a
"-", since it is automatically skipped.
:line
2.8 LAMMPS screen output :h4,link(start_8)
As LAMMPS reads an input script, it prints information to both the
screen and a log file about significant actions it takes to setup a
simulation. When the simulation is ready to begin, LAMMPS performs
various initializations and prints the amount of memory (in MBytes per
processor) that the simulation requires. It also prints details of
the initial thermodynamic state of the system. During the run itself,
thermodynamic information is printed periodically, every few
timesteps. When the run concludes, LAMMPS prints the final
thermodynamic state and a total run time for the simulation. It then
appends statistics about the CPU time and storage requirements for the
simulation. An example set of statistics is shown here:
Loop time of 2.81192 on 4 procs for 300 steps with 2004 atoms
Performance: 18.436 ns/day 1.302 hours/ns 106.689 timesteps/s
97.0% CPU use with 4 MPI tasks x no OpenMP threads :pre
MPI task timings breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 1.9808 | 2.0134 | 2.0318 | 1.4 | 71.60
Bond | 0.0021894 | 0.0060319 | 0.010058 | 4.7 | 0.21
Kspace | 0.3207 | 0.3366 | 0.36616 | 3.1 | 11.97
Neigh | 0.28411 | 0.28464 | 0.28516 | 0.1 | 10.12
Comm | 0.075732 | 0.077018 | 0.07883 | 0.4 | 2.74
Output | 0.00030518 | 0.00042665 | 0.00078821 | 1.0 | 0.02
Modify | 0.086606 | 0.086631 | 0.086668 | 0.0 | 3.08
Other | | 0.007178 | | | 0.26 :pre
Nlocal: 501 ave 508 max 490 min
Histogram: 1 0 0 0 0 0 1 1 0 1
Nghost: 6586.25 ave 6628 max 6548 min
Histogram: 1 0 1 0 0 0 1 0 0 1
Neighs: 177007 ave 180562 max 170212 min
Histogram: 1 0 0 0 0 0 0 1 1 1 :pre
Total # of neighbors = 708028
Ave neighs/atom = 353.307
Ave special neighs/atom = 2.34032
Neighbor list builds = 26
Dangerous builds = 0 :pre
The first section provides a global loop timing summary. The loop time
is the total wall time for the section. The {Performance} line is
provided for convenience to help predicting the number of loop
continuations required and for comparing performance with other
similar MD codes. The CPU use line provides the CPU utilzation per
MPI task; it should be close to 100% times the number of OpenMP
threads (or 1). Lower numbers correspond to delays due to file I/O or
insufficient thread utilization.
The MPI task section gives the breakdown of the CPU run time (in
seconds) into major categories:
{Pair} stands for all non-bonded force computation
{Bond} stands for bonded interactions: bonds, angles, dihedrals, impropers
{Kspace} stands for reciprocal space interactions: Ewald, PPPM, MSM
{Neigh} stands for neighbor list construction
{Comm} stands for communicating atoms and their properties
{Output} stands for writing dumps and thermo output
{Modify} stands for fixes and computes called by them
{Other} is the remaining time :ul
For each category, there is a breakdown of the least, average and most
amount of wall time a processor spent on this section. Also you have the
variation from the average time. Together these numbers allow to gauge
the amount of load imbalance in this segment of the calculation. Ideally
the difference between minimum, maximum and average is small and thus
the variation from the average close to zero. The final column shows
the percentage of the total loop time is spent in this section.
When using the "timer full"_timer.html setting, an additional column
is present that also prints the CPU utilization in percent. In
addition, when using {timer full} and the "package omp"_package.html
command are active, a similar timing summary of time spent in threaded
regions to monitor thread utilization and load balance is provided. A
new entry is the {Reduce} section, which lists the time spend in
reducing the per-thread data elements to the storage for non-threaded
computation. These thread timings are taking from the first MPI rank
only and and thus, as the breakdown for MPI tasks can change from MPI
rank to MPI rank, this breakdown can be very different for individual
ranks. Here is an example output for this section:
Thread timings breakdown (MPI rank 0):
Total threaded time 0.6846 / 90.6%
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.5127 | 0.5147 | 0.5167 | 0.3 | 75.18
Bond | 0.0043139 | 0.0046779 | 0.0050418 | 0.5 | 0.68
Kspace | 0.070572 | 0.074541 | 0.07851 | 1.5 | 10.89
Neigh | 0.084778 | 0.086969 | 0.089161 | 0.7 | 12.70
Reduce | 0.0036485 | 0.003737 | 0.0038254 | 0.1 | 0.55
The third section lists the number of owned atoms (Nlocal), ghost atoms
(Nghost), and pair-wise neighbors stored per processor. The max and min
values give the spread of these values across processors with a 10-bin
histogram showing the distribution. The total number of histogram counts
is equal to the number of processors.
The last section gives aggregate statistics for pair-wise neighbors
and special neighbors that LAMMPS keeps track of (see the
"special_bonds"_special_bonds.html command). The number of times
neighbor lists were rebuilt during the run is given as well as the
number of potentially "dangerous" rebuilds. If atom movement
triggered neighbor list rebuilding (see the
"neigh_modify"_neigh_modify.html command), then dangerous
reneighborings are those that were triggered on the first timestep
atom movement was checked for. If this count is non-zero you may wish
to reduce the delay factor to insure no force interactions are missed
by atoms moving beyond the neighbor skin distance before a rebuild
takes place.
If an energy minimization was performed via the
"minimize"_minimize.html command, additional information is printed,
e.g.
Minimization stats:
Stopping criterion = linesearch alpha is zero
Energy initial, next-to-last, final =
-6372.3765206 -8328.46998942 -8328.46998942
Force two-norm initial, final = 1059.36 5.36874
Force max component initial, final = 58.6026 1.46872
Final line search alpha, max atom move = 2.7842e-10 4.0892e-10
Iterations, force evaluations = 701 1516 :pre
The first line prints the criterion that determined the minimization
to be completed. The third line lists the initial and final energy,
as well as the energy on the next-to-last iteration. The next 2 lines
give a measure of the gradient of the energy (force on all atoms).
The 2-norm is the "length" of this force vector; the inf-norm is the
largest component. Then some information about the line search and
statistics on how many iterations and force-evaluations the minimizer
required. Multiple force evaluations are typically done at each
iteration to perform a 1d line minimization in the search direction.
If a "kspace_style"_kspace_style.html long-range Coulombics solve was
performed during the run (PPPM, Ewald), then additional information is
printed, e.g.
FFT time (% of Kspce) = 0.200313 (8.34477)
FFT Gflps 3d 1d-only = 2.31074 9.19989 :pre
The first line gives the time spent doing 3d FFTs (4 per timestep) and
the fraction it represents of the total KSpace time (listed above).
Each 3d FFT requires computation (3 sets of 1d FFTs) and communication
(transposes). The total flops performed is 5Nlog_2(N), where N is the
number of points in the 3d grid. The FFTs are timed with and without
the communication and a Gflop rate is computed. The 3d rate is with
communication; the 1d rate is without (just the 1d FFTs). Thus you
can estimate what fraction of your FFT time was spent in
communication, roughly 75% in the example above.
:line
2.9 Tips for users of previous LAMMPS versions :h4,link(start_9)
The current C++ began with a complete rewrite of LAMMPS 2001, which
was written in F90. Features of earlier versions of LAMMPS are listed
in "Section_history"_Section_history.html. The F90 and F77 versions
(2001 and 99) are also freely distributed as open-source codes; check
the "LAMMPS WWW Site"_lws for distribution information if you prefer
those versions. The 99 and 2001 versions are no longer under active
development; they do not have all the features of C++ LAMMPS.
If you are a previous user of LAMMPS 2001, these are the most
significant changes you will notice in C++ LAMMPS:
(1) The names and arguments of many input script commands have
changed. All commands are now a single word (e.g. read_data instead
of read data).
(2) All the functionality of LAMMPS 2001 is included in C++ LAMMPS,
but you may need to specify the relevant commands in different ways.
(3) The format of the data file can be streamlined for some problems.
See the "read_data"_read_data.html command for details. The data file
section "Nonbond Coeff" has been renamed to "Pair Coeff" in C++ LAMMPS.
(4) Binary restart files written by LAMMPS 2001 cannot be read by C++
LAMMPS with a "read_restart"_read_restart.html command. This is
because they were output by F90 which writes in a different binary
format than C or C++ writes or reads. Use the {restart2data} tool
provided with LAMMPS 2001 to convert the 2001 restart file to a text
data file. Then edit the data file as necessary before using the C++
LAMMPS "read_data"_read_data.html command to read it in.
(5) There are numerous small numerical changes in C++ LAMMPS that mean
you will not get identical answers when comparing to a 2001 run.
However, your initial thermodynamic energy and MD trajectory should be
close if you have setup the problem for both codes the same.
diff --git a/doc/atom_style.html b/doc/atom_style.html
index bcc303d44..f0b9b35de 100644
--- a/doc/atom_style.html
+++ b/doc/atom_style.html
@@ -1,482 +1,488 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>atom_style command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>atom_style command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="atom-style-command">
<span id="index-0"></span><h1>atom_style command<a class="headerlink" href="#atom-style-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>atom_style style args
</pre></div>
</div>
<ul class="simple">
<li>style = <em>angle</em> or <em>atomic</em> or <em>body</em> or <em>bond</em> or <em>charge</em> or <em>dipole</em> or <em>electron</em> or <em>ellipsoid</em> or <em>full</em> or <em>line</em> or <em>meso</em> or <em>molecular</em> or <em>peri</em> or <em>smd</em> or <em>sphere</em> or <em>tri</em> or <em>template</em> or <em>hybrid</em></li>
</ul>
<pre class="literal-block">
args = none for any style except <em>body</em> and <em>hybrid</em>
<em>body</em> args = bstyle bstyle-args
bstyle = style of body particles
bstyle-args = additional arguments specific to the bstyle
see the <a class="reference internal" href="body.html"><em>body</em></a> doc page for details
<em>template</em> args = template-ID
template-ID = ID of molecule template specified in a separate <a class="reference internal" href="molecule.html"><em>molecule</em></a> command
<em>hybrid</em> args = list of one or more sub-styles, each with their args
</pre>
<ul class="simple">
<li>accelerated styles (with same args) = <em>angle/cuda</em> or <em>angle/kk</em> or <em>atomic/cuda</em> or <em>atomic/kk</em> or <em>bond/kk</em> or <em>charge/cuda</em> or <em>charge/kk</em> or <em>full/cuda</em> or <em>full/kk</em> or <em>molecular/kk</em></li>
</ul>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>atom_style atomic
atom_style bond
atom_style full
atom_style full/cuda
atom_style body nparticle 2 10
atom_style hybrid charge bond
atom_style hybrid charge body nparticle 2 5
atom_style template myMols
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Define what style of atoms to use in a simulation. This determines
what attributes are associated with the atoms. This command must be
used before a simulation is setup via a <a class="reference internal" href="read_data.html"><em>read_data</em></a>,
<a class="reference internal" href="read_restart.html"><em>read_restart</em></a>, or <a class="reference internal" href="create_box.html"><em>create_box</em></a>
command.</p>
<p>Once a style is assigned, it cannot be changed, so use a style general
enough to encompass all attributes. E.g. with style <em>bond</em>, angular
terms cannot be used or added later to the model. It is OK to use a
style more general than needed, though it may be slightly inefficient.</p>
<p>The choice of style affects what quantities are stored by each atom,
what quantities are communicated between processors to enable forces
to be computed, and what quantities are listed in the data file read
by the <a class="reference internal" href="read_data.html"><em>read_data</em></a> command.</p>
<p>These are the additional attributes of each style and the typical
kinds of physical systems they are used to model. All styles store
coordinates, velocities, atom IDs and types. See the
<a class="reference internal" href="read_data.html"><em>read_data</em></a>, <a class="reference internal" href="create_atoms.html"><em>create_atoms</em></a>, and
<a class="reference internal" href="set.html"><em>set</em></a> commands for info on how to set these various
quantities.</p>
<table border="1" class="docutils">
<colgroup>
<col width="13%" />
<col width="50%" />
<col width="36%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><em>angle</em></td>
<td>bonds and angles</td>
<td>bead-spring polymers with stiffness</td>
</tr>
<tr class="row-even"><td><em>atomic</em></td>
<td>only the default values</td>
<td>coarse-grain liquids, solids, metals</td>
</tr>
<tr class="row-odd"><td><em>body</em></td>
<td>mass, inertia moments, quaternion, angular momentum</td>
<td>arbitrary bodies</td>
</tr>
<tr class="row-even"><td><em>bond</em></td>
<td>bonds</td>
<td>bead-spring polymers</td>
</tr>
<tr class="row-odd"><td><em>charge</em></td>
<td>charge</td>
<td>atomic system with charges</td>
</tr>
<tr class="row-even"><td><em>dipole</em></td>
<td>charge and dipole moment</td>
<td>system with dipolar particles</td>
</tr>
<tr class="row-odd"><td><em>electron</em></td>
<td>charge and spin and eradius</td>
<td>electronic force field</td>
</tr>
<tr class="row-even"><td><em>ellipsoid</em></td>
<td>shape, quaternion, angular momentum</td>
<td>aspherical particles</td>
</tr>
<tr class="row-odd"><td><em>full</em></td>
<td>molecular + charge</td>
<td>bio-molecules</td>
</tr>
<tr class="row-even"><td><em>line</em></td>
<td>end points, angular velocity</td>
<td>rigid bodies</td>
</tr>
<tr class="row-odd"><td><em>meso</em></td>
<td>rho, e, cv</td>
<td>SPH particles</td>
</tr>
<tr class="row-even"><td><em>molecular</em></td>
<td>bonds, angles, dihedrals, impropers</td>
<td>uncharged molecules</td>
</tr>
<tr class="row-odd"><td><em>peri</em></td>
<td>mass, volume</td>
<td>mesocopic Peridynamic models</td>
</tr>
<tr class="row-even"><td><em>smd</em></td>
<td>volume, kernel diameter, contact radius, mass</td>
<td>solid and fluid SPH particles</td>
</tr>
<tr class="row-odd"><td><em>sphere</em></td>
<td>diameter, mass, angular velocity</td>
<td>granular models</td>
</tr>
<tr class="row-even"><td><em>template</em></td>
<td>template index, template atom</td>
<td>small molecules with fixed topology</td>
</tr>
<tr class="row-odd"><td><em>tri</em></td>
<td>corner points, angular momentum</td>
<td>rigid bodies</td>
</tr>
<tr class="row-even"><td><em>wavepacket</em></td>
<td>charge, spin, eradius, etag, cs_re, cs_im</td>
<td>AWPMD</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">It is possible to add some attributes, such as a molecule ID, to
atom styles that do not have them via the <a class="reference internal" href="fix_property_atom.html"><em>fix property/atom</em></a> command. This command also
allows new custom attributes consisting of extra integer or
floating-point values to be added to atoms. See the <a class="reference internal" href="fix_property_atom.html"><em>fix property/atom</em></a> doc page for examples of cases
where this is useful and details on how to initialize, access, and
output the custom values.</p>
</div>
<p>All of the above styles define point particles, except the <em>sphere</em>,
<em>ellipsoid</em>, <em>electron</em>, <em>peri</em>, <em>wavepacket</em>, <em>line</em>, <em>tri</em>, and
<em>body</em> styles, which define finite-size particles. See <a class="reference internal" href="Section_howto.html#howto-14"><span>Section_howto 14</span></a> for an overview of using finite-size
particle models with LAMMPS.</p>
<p>All of the point-particle styles assign mass to particles on a
per-type basis, using the <a class="reference internal" href="mass.html"><em>mass</em></a> command, The finite-size
particle styles assign mass to individual particles on a per-particle
basis.</p>
<p>For the <em>sphere</em> style, the particles are spheres and each stores a
per-particle diameter and mass. If the diameter &gt; 0.0, the particle
is a finite-size sphere. If the diameter = 0.0, it is a point
particle.</p>
<p>For the <em>ellipsoid</em> style, the particles are ellipsoids and each
stores a flag which indicates whether it is a finite-size ellipsoid or
a point particle. If it is an ellipsoid, it also stores a shape
vector with the 3 diamters of the ellipsoid and a quaternion 4-vector
with its orientation.</p>
+<p>For the <em>dipole</em> style, a point dipole is defined for each point
+particle. Note that if you wish the particles to be finite-size
+spheres as in a Stockmayer potential for a dipolar fluid, so that the
+particles can rotate due to dipole-dipole interactions, then you need
+to use atom_style hybrid sphere dipole, which will assign both a
+diameter and dipole moment to each particle.</p>
<p>For the <em>electron</em> style, the particles representing electrons are 3d
Gaussians with a specified position and bandwidth or uncertainty in
position, which is represented by the eradius = electron size.</p>
<p>For the <em>peri</em> style, the particles are spherical and each stores a
per-particle mass and volume.</p>
<p>The <em>meso</em> style is for smoothed particle hydrodynamics (SPH)
particles which store a density (rho), energy (e), and heat capacity
(cv).</p>
<p>The <em>smd</em> style is for a general formulation of Smooth Particle
Hydrodynamics. Both fluids and solids can be modeled. Particles
store the mass and volume of an integration point, a kernel diameter
used for calculating the field variables (e.g. stress and deformation)
and a contact radius for calculating repulsive forces which prevent
individual physical bodies from penetretating each other.</p>
<p>The <em>wavepacket</em> style is similar to <em>electron</em>, but the electrons may
consist of several Gaussian wave packets, summed up with coefficients
cs= (cs_re,cs_im). Each of the wave packets is treated as a separate
particle in LAMMPS, wave packets belonging to the same electron must
have identical <em>etag</em> values.</p>
<p>For the <em>line</em> style, the particles are idealized line segments and
each stores a per-particle mass and length and orientation (i.e. the
end points of the line segment).</p>
<p>For the <em>tri</em> style, the particles are planar triangles and each
stores a per-particle mass and size and orientation (i.e. the corner
points of the triangle).</p>
<p>The <em>template</em> style allows molecular topolgy (bonds,angles,etc) to be
defined via a molecule template using the <a class="reference external" href="molecule.txt">molecule</a>
command. The template stores one or more molecules with a single copy
of the topology info (bonds,angles,etc) of each. Individual atoms
only store a template index and template atom to identify which
molecule and which atom-within-the-molecule they represent. Using the
<em>template</em> style instead of the <em>bond</em>, <em>angle</em>, <em>molecular</em> styles
can save memory for systems comprised of a large number of small
molecules, all of a single type (or small number of types). See the
paper by Grime and Voth, in <a class="reference internal" href="#grime"><span>(Grime)</span></a>, for examples of how this
can be advantageous for large-scale coarse-grained systems.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">When using the <em>template</em> style with a <a class="reference internal" href="molecule.html"><em>molecule template</em></a> that contains multiple molecules, you should
insure the atom types, bond types, angle_types, etc in all the
molecules are consistent. E.g. if one molecule represents H2O and
another CO2, then you probably do not want each molecule file to
define 2 atom types and a single bond type, because they will conflict
with each other when a mixture system of H2O and CO2 molecules is
defined, e.g. by the <a class="reference internal" href="read_data.html"><em>read_data</em></a> command. Rather the
H2O molecule should define atom types 1 and 2, and bond type 1. And
the CO2 molecule should define atom types 3 and 4 (or atom types 3 and
2 if a single oxygen type is desired), and bond type 2.</p>
</div>
<p>For the <em>body</em> style, the particles are arbitrary bodies with internal
attributes defined by the &#8220;style&#8221; of the bodies, which is specified by
the <em>bstyle</em> argument. Body particles can represent complex entities,
such as surface meshes of discrete points, collections of
sub-particles, deformable objects, etc.</p>
<p>The <a class="reference internal" href="body.html"><em>body</em></a> doc page descibes the body styles LAMMPS
currently supports, and provides more details as to the kind of body
particles they represent. For all styles, each body particle stores
moments of inertia and a quaternion 4-vector, so that its orientation
and position can be time integrated due to forces and torques.</p>
<p>Note that there may be additional arguments required along with the
<em>bstyle</em> specification, in the atom_style body command. These
arguments are described in the <a class="reference internal" href="body.html"><em>body</em></a> doc page.</p>
<hr class="docutils" />
<p>Typically, simulations require only a single (non-hybrid) atom style.
If some atoms in the simulation do not have all the properties defined
by a particular style, use the simplest style that defines all the
needed properties by any atom. For example, if some atoms in a
simulation are charged, but others are not, use the <em>charge</em> style.
If some atoms have bonds, but others do not, use the <em>bond</em> style.</p>
<p>The only scenario where the <em>hybrid</em> style is needed is if there is no
single style which defines all needed properties of all atoms. For
-example, if you want dipolar particles which will rotate due to
-torque, you would need to use &#8220;atom_style hybrid sphere dipole&#8221;. When
-a hybrid style is used, atoms store and communicate the union of all
-quantities implied by the individual styles.</p>
+example, as mentioned above, if you want dipolar particles which will
+rotate due to torque, you need to use &#8220;atom_style hybrid sphere
+dipole&#8221;. When a hybrid style is used, atoms store and communicate the
+union of all quantities implied by the individual styles.</p>
<p>When using the <em>hybrid</em> style, you cannot combine the <em>template</em> style
with another molecular style that stores bond,angle,etc info on a
per-atom basis.</p>
<p>LAMMPS can be extended with new atom styles as well as new body
styles; see <a class="reference internal" href="Section_modify.html"><em>this section</em></a>.</p>
<hr class="docutils" />
<p>Styles with a <em>cuda</em> or <em>kk</em> suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
<a class="reference internal" href="Section_accelerate.html"><em>Section_accelerate</em></a> of the manual. The
accelerated styles take the same arguments and should produce the same
results, except for round-off and precision issues.</p>
<p>Note that other acceleration packages in LAMMPS, specifically the GPU,
USER-INTEL, USER-OMP, and OPT packages do not use accelerated atom
styles.</p>
<p>The accelerated styles are part of the USER-CUDA and KOKKOS packages
respectively. They are only enabled if LAMMPS was built with those
packages. See the <a class="reference internal" href="Section_start.html#start-3"><span>Making LAMMPS</span></a> section
for more info.</p>
<p>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <a class="reference internal" href="Section_start.html#start-7"><span>-suffix command-line switch</span></a> when you invoke LAMMPS, or you can
use the <a class="reference internal" href="suffix.html"><em>suffix</em></a> command in your input script.</p>
<p>See <a class="reference internal" href="Section_accelerate.html"><em>Section_accelerate</em></a> of the manual for
more instructions on how to use the accelerated styles effectively.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>This command cannot be used after the simulation box is defined by a
<a class="reference internal" href="read_data.html"><em>read_data</em></a> or <a class="reference internal" href="create_box.html"><em>create_box</em></a> command.</p>
<p>The <em>angle</em>, <em>bond</em>, <em>full</em>, <em>molecular</em>, and <em>template</em> styles are
part of the MOLECULE package. The <em>line</em> and <em>tri</em> styles are part
of the ASPHERE pacakge. The <em>body</em> style is part of the BODY package.
The <em>dipole</em> style is part of the DIPOLE package. The <em>peri</em> style is
part of the PERI package for Peridynamics. The <em>electron</em> style is
part of the USER-EFF package for <a class="reference internal" href="pair_eff.html"><em>electronic force fields</em></a>. The <em>meso</em> style is part of the USER-SPH
package for smoothed particle hydrodyanmics (SPH). See <a class="reference external" href="USER/sph/SPH_LAMMPS_userguide.pdf">this PDF guide</a> to using SPH in LAMMPS. The
<em>wavepacket</em> style is part of the USER-AWPMD package for the
<a class="reference internal" href="pair_awpmd.html"><em>antisymmetrized wave packet MD method</em></a>. They are
only enabled if LAMMPS was built with that package. See the <a class="reference internal" href="Section_start.html#start-3"><span>Making LAMMPS</span></a> section for more info.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="read_data.html"><em>read_data</em></a>, <a class="reference internal" href="pair_style.html"><em>pair_style</em></a></p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<p>atom_style atomic</p>
<hr class="docutils" />
<p id="grime"><strong>(Grime)</strong> Grime and Voth, to appear in J Chem Theory &amp; Computation
(2014).</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/atom_style.txt b/doc/atom_style.txt
index 159a72b86..f25b7ee4b 100644
--- a/doc/atom_style.txt
+++ b/doc/atom_style.txt
@@ -1,269 +1,276 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
atom_style command :h3
[Syntax:]
atom_style style args :pre
style = {angle} or {atomic} or {body} or {bond} or {charge} or {dipole} or \
{electron} or {ellipsoid} or {full} or {line} or {meso} or \
{molecular} or {peri} or {smd} or {sphere} or {tri} or \
{template} or {hybrid} :ulb,l
args = none for any style except {body} and {hybrid}
{body} args = bstyle bstyle-args
bstyle = style of body particles
bstyle-args = additional arguments specific to the bstyle
see the "body"_body.html doc page for details
{template} args = template-ID
template-ID = ID of molecule template specified in a separate "molecule"_molecule.html command
{hybrid} args = list of one or more sub-styles, each with their args :pre
accelerated styles (with same args) = {angle/cuda} or {angle/kk} or {atomic/cuda} or {atomic/kk} or {bond/kk} or {charge/cuda} or {charge/kk} or {full/cuda} or {full/kk} or {molecular/kk} :l
:ule
[Examples:]
atom_style atomic
atom_style bond
atom_style full
atom_style full/cuda
atom_style body nparticle 2 10
atom_style hybrid charge bond
atom_style hybrid charge body nparticle 2 5
atom_style template myMols :pre
[Description:]
Define what style of atoms to use in a simulation. This determines
what attributes are associated with the atoms. This command must be
used before a simulation is setup via a "read_data"_read_data.html,
"read_restart"_read_restart.html, or "create_box"_create_box.html
command.
Once a style is assigned, it cannot be changed, so use a style general
enough to encompass all attributes. E.g. with style {bond}, angular
terms cannot be used or added later to the model. It is OK to use a
style more general than needed, though it may be slightly inefficient.
The choice of style affects what quantities are stored by each atom,
what quantities are communicated between processors to enable forces
to be computed, and what quantities are listed in the data file read
by the "read_data"_read_data.html command.
These are the additional attributes of each style and the typical
kinds of physical systems they are used to model. All styles store
coordinates, velocities, atom IDs and types. See the
"read_data"_read_data.html, "create_atoms"_create_atoms.html, and
"set"_set.html commands for info on how to set these various
quantities.
{angle} | bonds and angles | bead-spring polymers with stiffness |
{atomic} | only the default values | coarse-grain liquids, solids, metals |
{body} | mass, inertia moments, quaternion, angular momentum | arbitrary bodies |
{bond} | bonds | bead-spring polymers |
{charge} | charge | atomic system with charges |
{dipole} | charge and dipole moment | system with dipolar particles |
{electron} | charge and spin and eradius | electronic force field |
{ellipsoid} | shape, quaternion, angular momentum | aspherical particles |
{full} | molecular + charge | bio-molecules |
{line} | end points, angular velocity | rigid bodies |
{meso} | rho, e, cv | SPH particles |
{molecular} | bonds, angles, dihedrals, impropers | uncharged molecules |
{peri} | mass, volume | mesocopic Peridynamic models |
{smd} | volume, kernel diameter, contact radius, mass | solid and fluid SPH particles |
{sphere} | diameter, mass, angular velocity | granular models |
{template} | template index, template atom | small molecules with fixed topology |
{tri} | corner points, angular momentum | rigid bodies |
{wavepacket} | charge, spin, eradius, etag, cs_re, cs_im | AWPMD :tb(c=3,s=|)
NOTE: It is possible to add some attributes, such as a molecule ID, to
atom styles that do not have them via the "fix
property/atom"_fix_property_atom.html command. This command also
allows new custom attributes consisting of extra integer or
floating-point values to be added to atoms. See the "fix
property/atom"_fix_property_atom.html doc page for examples of cases
where this is useful and details on how to initialize, access, and
output the custom values.
All of the above styles define point particles, except the {sphere},
{ellipsoid}, {electron}, {peri}, {wavepacket}, {line}, {tri}, and
{body} styles, which define finite-size particles. See "Section_howto
14"_Section_howto.html#howto_14 for an overview of using finite-size
particle models with LAMMPS.
All of the point-particle styles assign mass to particles on a
per-type basis, using the "mass"_mass.html command, The finite-size
particle styles assign mass to individual particles on a per-particle
basis.
For the {sphere} style, the particles are spheres and each stores a
per-particle diameter and mass. If the diameter > 0.0, the particle
is a finite-size sphere. If the diameter = 0.0, it is a point
particle.
For the {ellipsoid} style, the particles are ellipsoids and each
stores a flag which indicates whether it is a finite-size ellipsoid or
a point particle. If it is an ellipsoid, it also stores a shape
vector with the 3 diamters of the ellipsoid and a quaternion 4-vector
with its orientation.
+For the {dipole} style, a point dipole is defined for each point
+particle. Note that if you wish the particles to be finite-size
+spheres as in a Stockmayer potential for a dipolar fluid, so that the
+particles can rotate due to dipole-dipole interactions, then you need
+to use atom_style hybrid sphere dipole, which will assign both a
+diameter and dipole moment to each particle.
+
For the {electron} style, the particles representing electrons are 3d
Gaussians with a specified position and bandwidth or uncertainty in
position, which is represented by the eradius = electron size.
For the {peri} style, the particles are spherical and each stores a
per-particle mass and volume.
The {meso} style is for smoothed particle hydrodynamics (SPH)
particles which store a density (rho), energy (e), and heat capacity
(cv).
The {smd} style is for a general formulation of Smooth Particle
Hydrodynamics. Both fluids and solids can be modeled. Particles
store the mass and volume of an integration point, a kernel diameter
used for calculating the field variables (e.g. stress and deformation)
and a contact radius for calculating repulsive forces which prevent
individual physical bodies from penetretating each other.
The {wavepacket} style is similar to {electron}, but the electrons may
consist of several Gaussian wave packets, summed up with coefficients
cs= (cs_re,cs_im). Each of the wave packets is treated as a separate
particle in LAMMPS, wave packets belonging to the same electron must
have identical {etag} values.
For the {line} style, the particles are idealized line segments and
each stores a per-particle mass and length and orientation (i.e. the
end points of the line segment).
For the {tri} style, the particles are planar triangles and each
stores a per-particle mass and size and orientation (i.e. the corner
points of the triangle).
The {template} style allows molecular topolgy (bonds,angles,etc) to be
defined via a molecule template using the "molecule"_molecule.txt
command. The template stores one or more molecules with a single copy
of the topology info (bonds,angles,etc) of each. Individual atoms
only store a template index and template atom to identify which
molecule and which atom-within-the-molecule they represent. Using the
{template} style instead of the {bond}, {angle}, {molecular} styles
can save memory for systems comprised of a large number of small
molecules, all of a single type (or small number of types). See the
paper by Grime and Voth, in "(Grime)"_#Grime, for examples of how this
can be advantageous for large-scale coarse-grained systems.
NOTE: When using the {template} style with a "molecule
template"_molecule.html that contains multiple molecules, you should
insure the atom types, bond types, angle_types, etc in all the
molecules are consistent. E.g. if one molecule represents H2O and
another CO2, then you probably do not want each molecule file to
define 2 atom types and a single bond type, because they will conflict
with each other when a mixture system of H2O and CO2 molecules is
defined, e.g. by the "read_data"_read_data.html command. Rather the
H2O molecule should define atom types 1 and 2, and bond type 1. And
the CO2 molecule should define atom types 3 and 4 (or atom types 3 and
2 if a single oxygen type is desired), and bond type 2.
For the {body} style, the particles are arbitrary bodies with internal
attributes defined by the "style" of the bodies, which is specified by
the {bstyle} argument. Body particles can represent complex entities,
such as surface meshes of discrete points, collections of
sub-particles, deformable objects, etc.
The "body"_body.html doc page descibes the body styles LAMMPS
currently supports, and provides more details as to the kind of body
particles they represent. For all styles, each body particle stores
moments of inertia and a quaternion 4-vector, so that its orientation
and position can be time integrated due to forces and torques.
Note that there may be additional arguments required along with the
{bstyle} specification, in the atom_style body command. These
arguments are described in the "body"_body.html doc page.
:line
Typically, simulations require only a single (non-hybrid) atom style.
If some atoms in the simulation do not have all the properties defined
by a particular style, use the simplest style that defines all the
needed properties by any atom. For example, if some atoms in a
simulation are charged, but others are not, use the {charge} style.
If some atoms have bonds, but others do not, use the {bond} style.
The only scenario where the {hybrid} style is needed is if there is no
single style which defines all needed properties of all atoms. For
-example, if you want dipolar particles which will rotate due to
-torque, you would need to use "atom_style hybrid sphere dipole". When
-a hybrid style is used, atoms store and communicate the union of all
-quantities implied by the individual styles.
+example, as mentioned above, if you want dipolar particles which will
+rotate due to torque, you need to use "atom_style hybrid sphere
+dipole". When a hybrid style is used, atoms store and communicate the
+union of all quantities implied by the individual styles.
When using the {hybrid} style, you cannot combine the {template} style
with another molecular style that stores bond,angle,etc info on a
per-atom basis.
LAMMPS can be extended with new atom styles as well as new body
styles; see "this section"_Section_modify.html.
:line
Styles with a {cuda} or {kk} suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in
"Section_accelerate"_Section_accelerate.html of the manual. The
accelerated styles take the same arguments and should produce the same
results, except for round-off and precision issues.
Note that other acceleration packages in LAMMPS, specifically the GPU,
USER-INTEL, USER-OMP, and OPT packages do not use accelerated atom
styles.
The accelerated styles are part of the USER-CUDA and KOKKOS packages
respectively. They are only enabled if LAMMPS was built with those
packages. See the "Making LAMMPS"_Section_start.html#start_3 section
for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_7 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
See "Section_accelerate"_Section_accelerate.html of the manual for
more instructions on how to use the accelerated styles effectively.
[Restrictions:]
This command cannot be used after the simulation box is defined by a
"read_data"_read_data.html or "create_box"_create_box.html command.
The {angle}, {bond}, {full}, {molecular}, and {template} styles are
part of the MOLECULE package. The {line} and {tri} styles are part
of the ASPHERE pacakge. The {body} style is part of the BODY package.
The {dipole} style is part of the DIPOLE package. The {peri} style is
part of the PERI package for Peridynamics. The {electron} style is
part of the USER-EFF package for "electronic force
fields"_pair_eff.html. The {meso} style is part of the USER-SPH
package for smoothed particle hydrodyanmics (SPH). See "this PDF
guide"_USER/sph/SPH_LAMMPS_userguide.pdf to using SPH in LAMMPS. The
{wavepacket} style is part of the USER-AWPMD package for the
"antisymmetrized wave packet MD method"_pair_awpmd.html. They are
only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"read_data"_read_data.html, "pair_style"_pair_style.html
[Default:]
atom_style atomic
:line
:link(Grime)
[(Grime)] Grime and Voth, to appear in J Chem Theory & Computation
(2014).
diff --git a/doc/body.html b/doc/body.html
index ccf77b876..8567f0b6e 100644
--- a/doc/body.html
+++ b/doc/body.html
@@ -1,452 +1,452 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Body particles &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>Body particles</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="body-particles">
<h1>Body particles<a class="headerlink" href="#body-particles" title="Permalink to this headline">¶</a></h1>
<p><strong>Overview:</strong></p>
<p>This doc page is not about a LAMMPS input script command, but about
body particles, which are generalized finite-size particles.
Individual body particles can represent complex entities, such as
surface meshes of discrete points, collections of sub-particles,
deformable objects, etc. Note that other kinds of finite-size
spherical and aspherical particles are also supported by LAMMPS, such
as spheres, ellipsoids, line segments, and triangles, but they are
simpler entities that body particles. See <a class="reference internal" href="Section_howto.html#howto-14"><span>Section_howto 14</span></a> for a general overview of all these
particle types.</p>
<p>Body particles are used via the <a class="reference internal" href="atom_style.html"><em>atom_style body</em></a>
command. It takes a body style as an argument. The current body
styles supported by LAMMPS are as follows. The name in the first
column is used as the <em>bstyle</em> argument for the <a class="reference internal" href="atom_style.html"><em>atom_style body</em></a> command.</p>
<table border="1" class="docutils">
<colgroup>
<col width="35%" />
<col width="65%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><em>nparticle</em></td>
<td>rigid body with N sub-particles</td>
</tr>
<tr class="row-even"><td><em>rounded/polygon</em></td>
<td>2d convex polygon with N vertices</td>
</tr>
</tbody>
</table>
<p>The body style determines what attributes are stored for each body and
thus how they can be used to compute pairwise body/body or
bond/non-body (point particle) interactions. More details of each
style are described below.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The rounded/polygon style listed in the table above and
described below has not yet been relesed in LAMMPS. It will be soon.</p>
</div>
<p>We hope to add more styles in the future. See <a class="reference internal" href="Section_modify.html#mod-12"><span>Section_modify 12</span></a> for details on how to add a new body
style to the code.</p>
<hr class="docutils" />
<p><strong>When to use body particles:</strong></p>
<p>You should not use body particles to model a rigid body made of
simpler particles (e.g. point, sphere, ellipsoid, line segment,
triangular particles), if the interaction between pairs of rigid
bodies is just the summation of pairwise interactions between the
simpler particles. LAMMPS already supports this kind of model via the
<a class="reference internal" href="fix_rigid.html"><em>fix rigid</em></a> command. Any of the numerous pair styles
that compute interactions between simpler particles can be used. The
<a class="reference internal" href="fix_rigid.html"><em>fix rigid</em></a> command time integrates the motion of the
rigid bodies. All of the standard LAMMPS commands for thermostatting,
adding constraints, performing output, etc will operate as expected on
the simple particles.</p>
<p>By contrast, when body particles are used, LAMMPS treats an entire
body as a single particle for purposes of computing pairwise
interactions, building neighbor lists, migrating particles between
processors, outputting particles to a dump file, etc. This means that
interactions between pairs of bodies or between a body and non-body
(point) particle need to be encoded in an appropriate pair style. If
such a pair style were to mimic the <a class="reference internal" href="fix_rigid.html"><em>fix rigid</em></a> model,
it would need to loop over the entire collection of interactions
between pairs of simple particles within the two bodies, each time a
single body/body interaction was computed.</p>
<p>Thus it only makes sense to use body particles and develop such a pair
style, when particle/particle interactions are more complex than what
the <a class="reference internal" href="fix_rigid.html"><em>fix rigid</em></a> command can already calculate. For
example, if particles have one or more of the following attributes:</p>
<ul class="simple">
<li>represented by a surface mesh</li>
<li>represented by a collection of geometric entities (e.g. planes + spheres)</li>
<li>deformable</li>
<li>internal stress that induces fragmentation</li>
</ul>
<p>then the interaction between pairs of particles is likely to be more
complex than the summation of simple sub-particle interactions. An
example is contact or frictional forces between particles with planar
sufaces that inter-penetrate.</p>
<p>These are additional LAMMPS commands that can be used with body
particles of different styles</p>
<table border="1" class="docutils">
<colgroup>
<col width="48%" />
<col width="52%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="fix_nve_body.html"><em>fix nve/body</em></a></td>
<td>integrate motion of a body particle in NVE ensemble</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="fix_nvt_body.html"><em>fix nvt/body</em></a></td>
<td>ditto for NVT ensemble</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="fix_npt_body.html"><em>fix npt/body</em></a></td>
<td>ditto for NPT ensemble</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="fix_nph_body.html"><em>fix nph/body</em></a></td>
<td>ditto for NPH ensemble</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="compute_body_local.html"><em>compute body/local</em></a></td>
<td>store sub-particle attributes of a body particle</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="compute_temp_body.html"><em>compute temp/body</em></a></td>
<td>compute temperature of body particles</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="dump.html"><em>dump local</em></a></td>
<td>output sub-particle attributes of a body particle</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="dump_image.html"><em>dump image</em></a></td>
<td>output body particle attributes as an image</td>
</tr>
</tbody>
</table>
<p>The pair styles defined for use with specific body styles are listed
in the sections below.</p>
<hr class="docutils" />
<p><strong>Specifics of body style nparticle:</strong></p>
<p>The <em>nparticle</em> body style represents body particles as a rigid body
with a variable number N of sub-particles. It is provided as a
vanillia, prototypical example of a body particle, although as
mentioned above, the <a class="reference internal" href="fix_rigid.html"><em>fix rigid</em></a> command already
duplicates its functionality.</p>
<p>The atom_style body command for this body style takes two additional
arguments:</p>
<div class="highlight-python"><div class="highlight"><pre>atom_style body nparticle Nmin Nmax
Nmin = minimum # of sub-particles in any body in the system
Nmax = maximum # of sub-particles in any body in the system
</pre></div>
</div>
<p>The Nmin and Nmax arguments are used to bound the size of data
structures used internally by each particle.</p>
<p>When the <a class="reference internal" href="read_data.html"><em>read_data</em></a> command reads a data file for this
body style, the following information must be provided for each entry
in the <em>Bodies</em> section of the data file:</p>
<div class="highlight-python"><div class="highlight"><pre>atom-ID 1 M
N
ixx iyy izz ixy ixz iyz
x1 y1 z1
...
xN yN zN
</pre></div>
</div>
<p>N is the number of sub-particles in the body particle. M = 6 + 3*N.
The integer line has a single value N. The floating point line(s)
list 6 moments of inertia followed by the coordinates of the N
sub-particles (x1 to zN) as 3N values. These values can be listed on
as many lines as you wish; see the <a class="reference internal" href="read_data.html"><em>read_data</em></a> command
for more details.</p>
<p>The 6 moments of inertia (ixx,iyy,izz,ixy,ixz,iyz) should be the
values consistent with the current orientation of the rigid body
around its center of mass. The values are with respect to the
simulation box XYZ axes, not with respect to the prinicpal axes of the
rigid body itself. LAMMPS performs the latter calculation internally.
The coordinates of each sub-particle are specified as its x,y,z
displacement from the center-of-mass of the body particle. The
center-of-mass position of the particle is specified by the x,y,z
values in the <em>Atoms</em> section of the data file, as is the total mass
of the body particle.</p>
<p>The <a class="reference internal" href="pair_body.html"><em>pair_style body</em></a> command can be used with this
body style to compute body/body and body/non-body interactions.</p>
<p>For output purposes via the <a class="reference internal" href="compute_body_local.html"><em>compute body/local</em></a> and <a class="reference internal" href="dump.html"><em>dump local</em></a>
commands, this body style produces one datum for each of the N
sub-particles in a body particle. The datum has 3 values:</p>
<div class="highlight-python"><div class="highlight"><pre>1 = x position of sub-particle
2 = y position of sub-particle
3 = z position of sub-particle
</pre></div>
</div>
<p>These values are the current position of the sub-particle within the
simulation domain, not a displacement from the center-of-mass (COM) of
the body particle itself. These values are calculated using the
current COM and orientation of the body particle.</p>
<p>For images created by the <a class="reference internal" href="dump_image.html"><em>dump image</em></a> command, if the
-<em>body</em> keyword is set to <em>yes</em>, then each body particle is drawn as a
+<em>body</em> keyword is set, then each body particle is drawn as a
collection of spheres, one for each sub-particle. The size of each
sphere is determined by the <em>bflag1</em> parameter for the <em>body</em> keyword.
The <em>bflag2</em> argument is ignored.</p>
<hr class="docutils" />
<p><strong>Specifics of body style rounded/polygon:</strong></p>
<p>The <em>rounded/polygon</em> body style represents body particles as a convex
polygon with a variable number N &gt; 2 of vertices, which can only be
used for 2d models. One example use of this body style is for 2d
discrete element models, as described in <a class="reference internal" href="pair_body_rounded_polygon.html#fraige"><span>Fraige</span></a>. Similar to
body style <em>nparticle</em>, the atom_style body command for this body
style takes two additional arguments:</p>
<div class="highlight-python"><div class="highlight"><pre>atom_style body rounded/polygon Nmin Nmax
Nmin = minimum # of vertices in any body in the system
Nmax = maximum # of vertices in any body in the system
</pre></div>
</div>
<p>The Nmin and Nmax arguments are used to bound the size of data
structures used internally by each particle.</p>
<p>When the <a class="reference internal" href="read_data.html"><em>read_data</em></a> command reads a data file for this
body style, the following information must be provided for each entry
in the <em>Bodies</em> section of the data file:</p>
<div class="highlight-python"><div class="highlight"><pre>atom-ID 1 M
N
ixx iyy izz ixy ixz iyz
x1 y1 z1
...
xN yN zN
i j j k k ...
radius
</pre></div>
</div>
<p>N is the number of vertices in the body particle. M = 6 + 3*N + 2*N +
1. The integer line has a single value N. The floating point line(s)
list 6 moments of inertia followed by the coordinates of the N
vertices (x1 to zN) as 3N values, followed by 2N vertex indices
corresponding to the end points of the N edges, followed by a single
radius value = the smallest circle encompassing the polygon. That
last value is used to facilitate the body/body contact detection.
These floating-point values can be listed on as many lines as you
wish; see the <a class="reference internal" href="read_data.html"><em>read_data</em></a> command for more details.</p>
<p>The 6 moments of inertia (ixx,iyy,izz,ixy,ixz,iyz) should be the
values consistent with the current orientation of the rigid body
around its center of mass. The values are with respect to the
simulation box XYZ axes, not with respect to the prinicpal axes of the
rigid body itself. LAMMPS performs the latter calculation internally.
The coordinates of each vertex are specified as its x,y,z displacement
from the center-of-mass of the body particle. The center-of-mass
position of the particle is specified by the x,y,z values in the
<em>Atoms</em> section of the data file.</p>
<p>For example, the following information would specify a square
particles whose edge length is sqrt(2):</p>
<div class="highlight-python"><div class="highlight"><pre>3 1 27
4
1 1 4 0 0 0
-0.7071 -0.7071 0
-0.7071 0.7071 0
0.7071 0.7071 0
0.7071 -0.7071 0
0 1 1 2 2 3 3 0
1.0
</pre></div>
</div>
<p>The <a class="reference internal" href="pair_body_rounded_polygon.html"><em>pair_style body/rounded/polygon</em></a> command
can be used with this body style to compute body/body interactions.</p>
<p>For output purposes via the <a class="reference internal" href="compute_body_local.html"><em>compute body/local</em></a> and <a class="reference internal" href="dump.html"><em>dump local</em></a>
commands, this body style produces one datum for each of the N
sub-particles in a body particle. The datum has 3 values:</p>
<div class="highlight-python"><div class="highlight"><pre>1 = x position of vertex
2 = y position of vertex
3 = z position of vertex
</pre></div>
</div>
<p>These values are the current position of the vertex within the
simulation domain, not a displacement from the center-of-mass (COM) of
the body particle itself. These values are calculated using the
current COM and orientation of the body particle.</p>
<p>For images created by the <a class="reference internal" href="dump_image.html"><em>dump image</em></a> command, if the
-<em>body</em> keyword is set to <em>yes</em>, then each body particle is drawn as a
-convex polygon consisting of N line segments. Note that the line
-segments are drawn between the N vertices, which does not correspond
-exactly to the physical extent of the body (because the <a class="reference external" href="pair_body_rounded_polygon.cpp">pair_style rounded/polygon</a> defines finite-size
+<em>body</em> keyword is set, then each body particle is drawn as a convex
+polygon consisting of N line segments. Note that the line segments
+are drawn between the N vertices, which does not correspond exactly to
+the physical extent of the body (because the <a class="reference external" href="pair_body_rounded_polygon.cpp">pair_style rounded/polygon</a> defines finite-size
spheres at those point and the line segments between the spheres are
tangent to the spheres). The drawn diameter of each line segment is
determined by the <em>bflag1</em> parameter for the <em>body</em> keyword. The
<em>bflag2</em> argument is ignored.</p>
<hr class="docutils" />
<p id="fraige"><strong>(Fraige)</strong> F. Y. Fraige, P. A. Langston, A. J. Matchett, J. Dodds,
Particuology, 6, 455 (2008).</p>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/body.txt b/doc/body.txt
index 164573065..1cf9dff77 100644
--- a/doc/body.txt
+++ b/doc/body.txt
@@ -1,270 +1,270 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
Body particles :h3
[Overview:]
This doc page is not about a LAMMPS input script command, but about
body particles, which are generalized finite-size particles.
Individual body particles can represent complex entities, such as
surface meshes of discrete points, collections of sub-particles,
deformable objects, etc. Note that other kinds of finite-size
spherical and aspherical particles are also supported by LAMMPS, such
as spheres, ellipsoids, line segments, and triangles, but they are
simpler entities that body particles. See "Section_howto
14"_Section_howto.html#howto_14 for a general overview of all these
particle types.
Body particles are used via the "atom_style body"_atom_style.html
command. It takes a body style as an argument. The current body
styles supported by LAMMPS are as follows. The name in the first
column is used as the {bstyle} argument for the "atom_style
body"_atom_style.html command.
{nparticle} | rigid body with N sub-particles |
{rounded/polygon} | 2d convex polygon with N vertices :tb(c=2,s=|)
The body style determines what attributes are stored for each body and
thus how they can be used to compute pairwise body/body or
bond/non-body (point particle) interactions. More details of each
style are described below.
NOTE: The rounded/polygon style listed in the table above and
described below has not yet been relesed in LAMMPS. It will be soon.
We hope to add more styles in the future. See "Section_modify
12"_Section_modify.html#mod_12 for details on how to add a new body
style to the code.
:line
[When to use body particles:]
You should not use body particles to model a rigid body made of
simpler particles (e.g. point, sphere, ellipsoid, line segment,
triangular particles), if the interaction between pairs of rigid
bodies is just the summation of pairwise interactions between the
simpler particles. LAMMPS already supports this kind of model via the
"fix rigid"_fix_rigid.html command. Any of the numerous pair styles
that compute interactions between simpler particles can be used. The
"fix rigid"_fix_rigid.html command time integrates the motion of the
rigid bodies. All of the standard LAMMPS commands for thermostatting,
adding constraints, performing output, etc will operate as expected on
the simple particles.
By contrast, when body particles are used, LAMMPS treats an entire
body as a single particle for purposes of computing pairwise
interactions, building neighbor lists, migrating particles between
processors, outputting particles to a dump file, etc. This means that
interactions between pairs of bodies or between a body and non-body
(point) particle need to be encoded in an appropriate pair style. If
such a pair style were to mimic the "fix rigid"_fix_rigid.html model,
it would need to loop over the entire collection of interactions
between pairs of simple particles within the two bodies, each time a
single body/body interaction was computed.
Thus it only makes sense to use body particles and develop such a pair
style, when particle/particle interactions are more complex than what
the "fix rigid"_fix_rigid.html command can already calculate. For
example, if particles have one or more of the following attributes:
represented by a surface mesh
represented by a collection of geometric entities (e.g. planes + spheres)
deformable
internal stress that induces fragmentation :ul
then the interaction between pairs of particles is likely to be more
complex than the summation of simple sub-particle interactions. An
example is contact or frictional forces between particles with planar
sufaces that inter-penetrate.
These are additional LAMMPS commands that can be used with body
particles of different styles
"fix nve/body"_fix_nve_body.html : integrate motion of a body particle in NVE ensemble
"fix nvt/body"_fix_nvt_body.html : ditto for NVT ensemble
"fix npt/body"_fix_npt_body.html : ditto for NPT ensemble
"fix nph/body"_fix_nph_body.html : ditto for NPH ensemble
"compute body/local"_compute_body_local.html : store sub-particle attributes of a body particle
"compute temp/body"_compute_temp_body.html : compute temperature of body particles
"dump local"_dump.html : output sub-particle attributes of a body particle
"dump image"_dump_image.html : output body particle attributes as an image :tb(s=:)
The pair styles defined for use with specific body styles are listed
in the sections below.
:line
[Specifics of body style nparticle:]
The {nparticle} body style represents body particles as a rigid body
with a variable number N of sub-particles. It is provided as a
vanillia, prototypical example of a body particle, although as
mentioned above, the "fix rigid"_fix_rigid.html command already
duplicates its functionality.
The atom_style body command for this body style takes two additional
arguments:
atom_style body nparticle Nmin Nmax
Nmin = minimum # of sub-particles in any body in the system
Nmax = maximum # of sub-particles in any body in the system :pre
The Nmin and Nmax arguments are used to bound the size of data
structures used internally by each particle.
When the "read_data"_read_data.html command reads a data file for this
body style, the following information must be provided for each entry
in the {Bodies} section of the data file:
atom-ID 1 M
N
ixx iyy izz ixy ixz iyz
x1 y1 z1
...
xN yN zN :pre
N is the number of sub-particles in the body particle. M = 6 + 3*N.
The integer line has a single value N. The floating point line(s)
list 6 moments of inertia followed by the coordinates of the N
sub-particles (x1 to zN) as 3N values. These values can be listed on
as many lines as you wish; see the "read_data"_read_data.html command
for more details.
The 6 moments of inertia (ixx,iyy,izz,ixy,ixz,iyz) should be the
values consistent with the current orientation of the rigid body
around its center of mass. The values are with respect to the
simulation box XYZ axes, not with respect to the prinicpal axes of the
rigid body itself. LAMMPS performs the latter calculation internally.
The coordinates of each sub-particle are specified as its x,y,z
displacement from the center-of-mass of the body particle. The
center-of-mass position of the particle is specified by the x,y,z
values in the {Atoms} section of the data file, as is the total mass
of the body particle.
The "pair_style body"_pair_body.html command can be used with this
body style to compute body/body and body/non-body interactions.
For output purposes via the "compute
body/local"_compute_body_local.html and "dump local"_dump.html
commands, this body style produces one datum for each of the N
sub-particles in a body particle. The datum has 3 values:
1 = x position of sub-particle
2 = y position of sub-particle
3 = z position of sub-particle :pre
These values are the current position of the sub-particle within the
simulation domain, not a displacement from the center-of-mass (COM) of
the body particle itself. These values are calculated using the
current COM and orientation of the body particle.
For images created by the "dump image"_dump_image.html command, if the
-{body} keyword is set to {yes}, then each body particle is drawn as a
+{body} keyword is set, then each body particle is drawn as a
collection of spheres, one for each sub-particle. The size of each
sphere is determined by the {bflag1} parameter for the {body} keyword.
The {bflag2} argument is ignored.
:line
[Specifics of body style rounded/polygon:]
The {rounded/polygon} body style represents body particles as a convex
polygon with a variable number N > 2 of vertices, which can only be
used for 2d models. One example use of this body style is for 2d
discrete element models, as described in "Fraige"_#Fraige. Similar to
body style {nparticle}, the atom_style body command for this body
style takes two additional arguments:
atom_style body rounded/polygon Nmin Nmax
Nmin = minimum # of vertices in any body in the system
Nmax = maximum # of vertices in any body in the system :pre
The Nmin and Nmax arguments are used to bound the size of data
structures used internally by each particle.
When the "read_data"_read_data.html command reads a data file for this
body style, the following information must be provided for each entry
in the {Bodies} section of the data file:
atom-ID 1 M
N
ixx iyy izz ixy ixz iyz
x1 y1 z1
...
xN yN zN
i j j k k ...
radius :pre
N is the number of vertices in the body particle. M = 6 + 3*N + 2*N +
1. The integer line has a single value N. The floating point line(s)
list 6 moments of inertia followed by the coordinates of the N
vertices (x1 to zN) as 3N values, followed by 2N vertex indices
corresponding to the end points of the N edges, followed by a single
radius value = the smallest circle encompassing the polygon. That
last value is used to facilitate the body/body contact detection.
These floating-point values can be listed on as many lines as you
wish; see the "read_data"_read_data.html command for more details.
The 6 moments of inertia (ixx,iyy,izz,ixy,ixz,iyz) should be the
values consistent with the current orientation of the rigid body
around its center of mass. The values are with respect to the
simulation box XYZ axes, not with respect to the prinicpal axes of the
rigid body itself. LAMMPS performs the latter calculation internally.
The coordinates of each vertex are specified as its x,y,z displacement
from the center-of-mass of the body particle. The center-of-mass
position of the particle is specified by the x,y,z values in the
{Atoms} section of the data file.
For example, the following information would specify a square
particles whose edge length is sqrt(2):
3 1 27
4
1 1 4 0 0 0
-0.7071 -0.7071 0
-0.7071 0.7071 0
0.7071 0.7071 0
0.7071 -0.7071 0
0 1 1 2 2 3 3 0
1.0 :pre
The "pair_style body/rounded/polygon"_pair_body_rounded_polygon.html command
can be used with this body style to compute body/body interactions.
For output purposes via the "compute
body/local"_compute_body_local.html and "dump local"_dump.html
commands, this body style produces one datum for each of the N
sub-particles in a body particle. The datum has 3 values:
1 = x position of vertex
2 = y position of vertex
3 = z position of vertex :pre
These values are the current position of the vertex within the
simulation domain, not a displacement from the center-of-mass (COM) of
the body particle itself. These values are calculated using the
current COM and orientation of the body particle.
For images created by the "dump image"_dump_image.html command, if the
-{body} keyword is set to {yes}, then each body particle is drawn as a
-convex polygon consisting of N line segments. Note that the line
-segments are drawn between the N vertices, which does not correspond
-exactly to the physical extent of the body (because the "pair_style
+{body} keyword is set, then each body particle is drawn as a convex
+polygon consisting of N line segments. Note that the line segments
+are drawn between the N vertices, which does not correspond exactly to
+the physical extent of the body (because the "pair_style
rounded/polygon"_pair_body_rounded_polygon.cpp defines finite-size
spheres at those point and the line segments between the spheres are
tangent to the spheres). The drawn diameter of each line segment is
determined by the {bflag1} parameter for the {body} keyword. The
{bflag2} argument is ignored.
:line
:link(Fraige)
[(Fraige)] F. Y. Fraige, P. A. Langston, A. J. Matchett, J. Dodds,
Particuology, 6, 455 (2008).
diff --git a/doc/compute.html b/doc/compute.html
index 551b85157..ea1f2cf2d 100644
--- a/doc/compute.html
+++ b/doc/compute.html
@@ -1,429 +1,430 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>compute command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>compute command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="compute-command">
<span id="index-0"></span><h1>compute command<a class="headerlink" href="#compute-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute ID group-ID style args
</pre></div>
</div>
<ul class="simple">
<li>ID = user-assigned name for the computation</li>
<li>group-ID = ID of the group of atoms to perform the computation on</li>
<li>style = one of a list of possible style names (see below)</li>
<li>args = arguments used by a particular style</li>
</ul>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute 1 all temp
compute newtemp flow temp/partial 1 1 0
compute 3 all ke/atom
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Define a computation that will be performed on a group of atoms.
Quantities calculated by a compute are instantaneous values, meaning
they are calculated from information about atoms on the current
timestep or iteration, though a compute may internally store some
information about a previous state of the system. Defining a compute
does not perform a computation. Instead computes are invoked by other
LAMMPS commands as needed, e.g. to calculate a temperature needed for
a thermostat fix or to generate thermodynamic or dump file output.
See this <a class="reference internal" href="Section_howto.html#howto-15"><span>howto section</span></a> for a summary of
various LAMMPS output options, many of which involve computes.</p>
<p>The ID of a compute can only contain alphanumeric characters and
underscores.</p>
<hr class="docutils" />
<p>Computes calculate one of three styles of quantities: global,
per-atom, or local. A global quantity is one or more system-wide
values, e.g. the temperature of the system. A per-atom quantity is
one or more values per atom, e.g. the kinetic energy of each atom.
Per-atom values are set to 0.0 for atoms not in the specified compute
group. Local quantities are calculated by each processor based on the
atoms it owns, but there may be zero or more per atom, e.g. a list of
bond distances. Computes that produce per-atom quantities have the
word &#8220;atom&#8221; in their style, e.g. <em>ke/atom</em>. Computes that produce
local quantities have the word &#8220;local&#8221; in their style,
e.g. <em>bond/local</em>. Styles with neither &#8220;atom&#8221; or &#8220;local&#8221; in their
style produce global quantities.</p>
<p>Note that a single compute produces either global or per-atom or local
-quantities, but never more than one of these.</p>
+quantities, but never more than one of these (with only a few
+exceptions, as documented by individual compute commands).</p>
<p>Global, per-atom, and local quantities each come in three kinds: a
single scalar value, a vector of values, or a 2d array of values. The
doc page for each compute describes the style and kind of values it
produces, e.g. a per-atom vector. Some computes produce more than one
kind of a single style, e.g. a global scalar and a global vector.</p>
<p>When a compute quantity is accessed, as in many of the output commands
discussed below, it can be referenced via the following bracket
notation, where ID is the ID of the compute:</p>
<table border="1" class="docutils">
<colgroup>
<col width="21%" />
<col width="79%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>c_ID</td>
<td>entire scalar, vector, or array</td>
</tr>
<tr class="row-even"><td>c_ID[I]</td>
<td>one element of vector, one column of array</td>
</tr>
<tr class="row-odd"><td>c_ID[I][J]</td>
<td>one element of array</td>
</tr>
</tbody>
</table>
<p>In other words, using one bracket reduces the dimension of the
quantity once (vector -&gt; scalar, array -&gt; vector). Using two brackets
reduces the dimension twice (array -&gt; scalar). Thus a command that
uses scalar compute values as input can also process elements of a
vector or array.</p>
<p>Note that commands and <a class="reference internal" href="variable.html"><em>variables</em></a> which use compute
quantities typically do not allow for all kinds, e.g. a command may
require a vector of values, not a scalar. This means there is no
ambiguity about referring to a compute quantity as c_ID even if it
produces, for example, both a scalar and vector. The doc pages for
various commands explain the details.</p>
<hr class="docutils" />
<p>In LAMMPS, the values generated by a compute can be used in several
ways:</p>
<ul class="simple">
<li>The results of computes that calculate a global temperature or
pressure can be used by fixes that do thermostatting or barostatting
or when atom velocities are created.</li>
<li>Global values can be output via the <a class="reference internal" href="thermo_style.html"><em>thermo_style custom</em></a> or <a class="reference internal" href="fix_ave_time.html"><em>fix ave/time</em></a> command.
Or the values can be referenced in a <a class="reference internal" href="variable.html"><em>variable equal</em></a> or
<a class="reference internal" href="variable.html"><em>variable atom</em></a> command.</li>
<li>Per-atom values can be output via the <a class="reference internal" href="dump.html"><em>dump custom</em></a> command
or the <a class="reference internal" href="fix_ave_spatial.html"><em>fix ave/spatial</em></a> command. Or they can be
time-averaged via the <a class="reference internal" href="fix_ave_atom.html"><em>fix ave/atom</em></a> command or
reduced by the <a class="reference internal" href="compute_reduce.html"><em>compute reduce</em></a> command. Or the
per-atom values can be referenced in an <a class="reference internal" href="variable.html"><em>atom-style variable</em></a>.</li>
<li>Local values can be reduced by the <a class="reference internal" href="compute_reduce.html"><em>compute reduce</em></a> command, or histogrammed by the <a class="reference internal" href="fix_ave_histo.html"><em>fix ave/histo</em></a> command, or output by the <a class="reference internal" href="dump.html"><em>dump local</em></a> command.</li>
</ul>
<p>The results of computes that calculate global quantities can be either
&#8220;intensive&#8221; or &#8220;extensive&#8221; values. Intensive means the value is
independent of the number of atoms in the simulation,
e.g. temperature. Extensive means the value scales with the number of
atoms in the simulation, e.g. total rotational kinetic energy.
<a class="reference internal" href="thermo_style.html"><em>Thermodynamic output</em></a> will normalize extensive
values by the number of atoms in the system, depending on the
&#8220;thermo_modify norm&#8221; setting. It will not normalize intensive values.
If a compute value is accessed in another way, e.g. by a
<a class="reference internal" href="variable.html"><em>variable</em></a>, you may want to know whether it is an
intensive or extensive value. See the doc page for individual
computes for further info.</p>
<hr class="docutils" />
<p>LAMMPS creates its own computes internally for thermodynamic output.
Three computes are always created, named &#8220;thermo_temp&#8221;,
&#8220;thermo_press&#8221;, and &#8220;thermo_pe&#8221;, as if these commands had been invoked
in the input script:</p>
<div class="highlight-python"><div class="highlight"><pre>compute thermo_temp all temp
compute thermo_press all pressure thermo_temp
compute thermo_pe all pe
</pre></div>
</div>
<p>Additional computes for other quantities are created if the thermo
style requires it. See the documentation for the
<a class="reference internal" href="thermo_style.html"><em>thermo_style</em></a> command.</p>
<p>Fixes that calculate temperature or pressure, i.e. for thermostatting
or barostatting, may also create computes. These are discussed in the
documentation for specific <a class="reference internal" href="fix.html"><em>fix</em></a> commands.</p>
<p>In all these cases, the default computes LAMMPS creates can be
replaced by computes defined by the user in the input script, as
described by the <a class="reference internal" href="thermo_modify.html"><em>thermo_modify</em></a> and <a class="reference internal" href="fix_modify.html"><em>fix modify</em></a> commands.</p>
<p>Properties of either a default or user-defined compute can be modified
via the <a class="reference internal" href="compute_modify.html"><em>compute_modify</em></a> command.</p>
<p>Computes can be deleted with the <a class="reference internal" href="uncompute.html"><em>uncompute</em></a> command.</p>
<p>Code for new computes can be added to LAMMPS (see <a class="reference internal" href="Section_modify.html"><em>this section</em></a> of the manual) and the results of their
calculations accessed in the various ways described above.</p>
<hr class="docutils" />
<p>Each compute style has its own doc page which describes its arguments
and what it does. Here is an alphabetic list of compute styles
available in LAMMPS. They are also given in more compact form in the
Compute section of <a class="reference internal" href="Section_commands.html#cmd-5"><span>this page</span></a>.</p>
<p>There are also additional compute styles (not listed here) submitted
by users which are included in the LAMMPS distribution. The list of
these with links to the individual styles are given in the compute
section of <a class="reference internal" href="Section_commands.html#cmd-5"><span>this page</span></a>.</p>
<ul class="simple">
<li><a class="reference internal" href="compute_bond_local.html"><em>angle/local</em></a> - theta and energy of each angle</li>
<li><a class="reference internal" href="compute_angmom_chunk.html"><em>angmom/chunk</em></a> - angular momentum for each chunk</li>
<li><a class="reference internal" href="compute_body_local.html"><em>body/local</em></a> - attributes of body sub-particles</li>
<li><a class="reference internal" href="compute_bond_local.html"><em>bond/local</em></a> - distance and energy of each bond</li>
<li><a class="reference internal" href="compute_centro_atom.html"><em>centro/atom</em></a> - centro-symmetry parameter for each atom</li>
<li><a class="reference internal" href="compute_chunk_atom.html"><em>chunk/atom</em></a> - assign chunk IDs to each atom</li>
<li><a class="reference internal" href="compute_cluster_atom.html"><em>cluster/atom</em></a> - cluster ID for each atom</li>
<li><a class="reference internal" href="compute_cna_atom.html"><em>cna/atom</em></a> - common neighbor analysis (CNA) for each atom</li>
<li><a class="reference internal" href="compute_com.html"><em>com</em></a> - center-of-mass of group of atoms</li>
<li><a class="reference internal" href="compute_com_chunk.html"><em>com/chunk</em></a> - center-of-mass for each chunk</li>
<li><a class="reference internal" href="compute_contact_atom.html"><em>contact/atom</em></a> - contact count for each spherical particle</li>
<li><a class="reference internal" href="compute_coord_atom.html"><em>coord/atom</em></a> - coordination number for each atom</li>
<li><a class="reference internal" href="compute_damage_atom.html"><em>damage/atom</em></a> - Peridynamic damage for each atom</li>
<li><a class="reference internal" href="compute_dihedral_local.html"><em>dihedral/local</em></a> - angle of each dihedral</li>
<li><a class="reference internal" href="compute_dilatation_atom.html"><em>dilatation/atom</em></a> - Peridynamic dilatation for each atom</li>
<li><a class="reference internal" href="compute_displace_atom.html"><em>displace/atom</em></a> - displacement of each atom</li>
<li><a class="reference internal" href="compute_erotate_asphere.html"><em>erotate/asphere</em></a> - rotational energy of aspherical particles</li>
<li><a class="reference internal" href="compute_erotate_rigid.html"><em>erotate/rigid</em></a> - rotational energy of rigid bodies</li>
<li><a class="reference internal" href="compute_erotate_sphere.html"><em>erotate/sphere</em></a> - rotational energy of spherical particles</li>
<li><a class="reference internal" href="compute_erotate_sphere.html"><em>erotate/sphere/atom</em></a> - rotational energy for each spherical particle</li>
<li><a class="reference internal" href="compute_event_displace.html"><em>event/displace</em></a> - detect event on atom displacement</li>
<li><a class="reference internal" href="compute_group_group.html"><em>group/group</em></a> - energy/force between two groups of atoms</li>
<li><a class="reference internal" href="compute_gyration.html"><em>gyration</em></a> - radius of gyration of group of atoms</li>
<li><a class="reference internal" href="compute_gyration_chunk.html"><em>gyration/chunk</em></a> - radius of gyration for each chunk</li>
<li><a class="reference internal" href="compute_heat_flux.html"><em>heat/flux</em></a> - heat flux through a group of atoms</li>
<li><a class="reference internal" href="compute_hexorder_atom.html"><em>hexorder/atom</em></a> - bond orientational order parameter q6</li>
<li><a class="reference internal" href="compute_improper_local.html"><em>improper/local</em></a> - angle of each improper</li>
<li><a class="reference internal" href="compute_inertia_chunk.html"><em>inertia/chunk</em></a> - inertia tensor for each chunk</li>
<li><a class="reference internal" href="compute_ke.html"><em>ke</em></a> - translational kinetic energy</li>
<li><a class="reference internal" href="compute_ke_atom.html"><em>ke/atom</em></a> - kinetic energy for each atom</li>
<li><a class="reference internal" href="compute_ke_rigid.html"><em>ke/rigid</em></a> - translational kinetic energy of rigid bodies</li>
<li><a class="reference internal" href="compute_msd.html"><em>msd</em></a> - mean-squared displacement of group of atoms</li>
<li><a class="reference internal" href="compute_msd_chunk.html"><em>msd/chunk</em></a> - mean-squared displacement for each chunk</li>
<li><a class="reference internal" href="compute_msd_nongauss.html"><em>msd/nongauss</em></a> - MSD and non-Gaussian parameter of group of atoms</li>
<li><a class="reference internal" href="compute_omega_chunk.html"><em>omega/chunk</em></a> - angular velocity for each chunk</li>
<li><a class="reference internal" href="compute_orientorder_atom.html"><em>orientorder/atom</em></a> - Steinhardt bond orientational order parameters Ql</li>
<li><a class="reference internal" href="compute_pair.html"><em>pair</em></a> - values computed by a pair style</li>
<li><a class="reference internal" href="compute_pair_local.html"><em>pair/local</em></a> - distance/energy/force of each pairwise interaction</li>
<li><a class="reference internal" href="compute_pe.html"><em>pe</em></a> - potential energy</li>
<li><a class="reference internal" href="compute_pe_atom.html"><em>pe/atom</em></a> - potential energy for each atom</li>
<li><a class="reference internal" href="compute_plasticity_atom.html"><em>plasticity/atom</em></a> - Peridynamic plasticity for each atom</li>
<li><a class="reference internal" href="compute_pressure.html"><em>pressure</em></a> - total pressure and pressure tensor</li>
<li><a class="reference internal" href="compute_property_atom.html"><em>property/atom</em></a> - convert atom attributes to per-atom vectors/arrays</li>
<li><a class="reference internal" href="compute_property_local.html"><em>property/local</em></a> - convert local attributes to localvectors/arrays</li>
<li><a class="reference internal" href="compute_property_chunk.html"><em>property/chunk</em></a> - extract various per-chunk attributes</li>
<li><a class="reference internal" href="compute_rdf.html"><em>rdf</em></a> - radial distribution function g(r) histogram of group of atoms</li>
<li><a class="reference internal" href="compute_reduce.html"><em>reduce</em></a> - combine per-atom quantities into a single global value</li>
<li><a class="reference internal" href="compute_reduce.html"><em>reduce/region</em></a> - same as compute reduce, within a region</li>
<li><a class="reference internal" href="compute_slice.html"><em>slice</em></a> - extract values from global vector or array</li>
<li><a class="reference internal" href="compute_sna_atom.html"><em>sna/atom</em></a> - calculate bispectrum coefficients for each atom</li>
<li><a class="reference internal" href="compute_sna_atom.html"><em>snad/atom</em></a> - derivative of bispectrum coefficients for each atom</li>
<li><a class="reference internal" href="compute_sna_atom.html"><em>snav/atom</em></a> - virial contribution from bispectrum coefficients for each atom</li>
<li><a class="reference internal" href="compute_stress_atom.html"><em>stress/atom</em></a> - stress tensor for each atom</li>
<li><a class="reference internal" href="compute_temp.html"><em>temp</em></a> - temperature of group of atoms</li>
<li><a class="reference internal" href="compute_temp_asphere.html"><em>temp/asphere</em></a> - temperature of aspherical particles</li>
<li><a class="reference internal" href="compute_temp_chunk.html"><em>temp/chunk</em></a> - temperature of each chunk</li>
<li><a class="reference internal" href="compute_temp_com.html"><em>temp/com</em></a> - temperature after subtracting center-of-mass velocity</li>
<li><a class="reference internal" href="compute_temp_deform.html"><em>temp/deform</em></a> - temperature excluding box deformation velocity</li>
<li><a class="reference internal" href="compute_temp_partial.html"><em>temp/partial</em></a> - temperature excluding one or more dimensions of velocity</li>
<li><a class="reference internal" href="compute_temp_profile.html"><em>temp/profile</em></a> - temperature excluding a binned velocity profile</li>
<li><a class="reference internal" href="compute_temp_ramp.html"><em>temp/ramp</em></a> - temperature excluding ramped velocity component</li>
<li><a class="reference internal" href="compute_temp_region.html"><em>temp/region</em></a> - temperature of a region of atoms</li>
<li><a class="reference internal" href="compute_temp_sphere.html"><em>temp/sphere</em></a> - temperature of spherical particles</li>
<li><a class="reference internal" href="compute_ti.html"><em>ti</em></a> - thermodyanmic integration free energy values</li>
<li><a class="reference internal" href="compute_torque_chunk.html"><em>torque/chunk</em></a> - torque applied on each chunk</li>
<li><a class="reference internal" href="compute_vacf.html"><em>vacf</em></a> - velocity-autocorrelation function of group of atoms</li>
<li><a class="reference internal" href="compute_vcm_chunk.html"><em>vcm/chunk</em></a> - velocity of center-of-mass for each chunk</li>
<li><a class="reference internal" href="compute_voronoi_atom.html"><em>voronoi/atom</em></a> - Voronoi volume and neighbors for each atom</li>
</ul>
<p>There are also additional compute styles submitted by users which are
included in the LAMMPS distribution. The list of these with links to
the individual styles are given in the compute section of <a class="reference internal" href="Section_commands.html#cmd-5"><span>this page</span></a>.</p>
<p>There are also additional accelerated compute styles included in the
LAMMPS distribution for faster performance on CPUs and GPUs. The list
of these with links to the individual styles are given in the pair
section of <a class="reference internal" href="Section_commands.html#cmd-5"><span>this page</span></a>.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div>none</div></blockquote>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="uncompute.html"><em>uncompute</em></a>, <a class="reference internal" href="compute_modify.html"><em>compute_modify</em></a>, <a class="reference internal" href="fix_ave_atom.html"><em>fix ave/atom</em></a>, <a class="reference internal" href="fix_ave_spatial.html"><em>fix ave/spatial</em></a>,
<a class="reference internal" href="fix_ave_time.html"><em>fix ave/time</em></a>, <a class="reference internal" href="fix_ave_histo.html"><em>fix ave/histo</em></a></p>
<p><strong>Default:</strong> none</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/compute.txt b/doc/compute.txt
index d73cc9e4b..e17d389f6 100644
--- a/doc/compute.txt
+++ b/doc/compute.txt
@@ -1,258 +1,259 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute command :h3
[Syntax:]
compute ID group-ID style args :pre
ID = user-assigned name for the computation
group-ID = ID of the group of atoms to perform the computation on
style = one of a list of possible style names (see below)
args = arguments used by a particular style :ul
[Examples:]
compute 1 all temp
compute newtemp flow temp/partial 1 1 0
compute 3 all ke/atom :pre
[Description:]
Define a computation that will be performed on a group of atoms.
Quantities calculated by a compute are instantaneous values, meaning
they are calculated from information about atoms on the current
timestep or iteration, though a compute may internally store some
information about a previous state of the system. Defining a compute
does not perform a computation. Instead computes are invoked by other
LAMMPS commands as needed, e.g. to calculate a temperature needed for
a thermostat fix or to generate thermodynamic or dump file output.
See this "howto section"_Section_howto.html#howto_15 for a summary of
various LAMMPS output options, many of which involve computes.
The ID of a compute can only contain alphanumeric characters and
underscores.
:line
Computes calculate one of three styles of quantities: global,
per-atom, or local. A global quantity is one or more system-wide
values, e.g. the temperature of the system. A per-atom quantity is
one or more values per atom, e.g. the kinetic energy of each atom.
Per-atom values are set to 0.0 for atoms not in the specified compute
group. Local quantities are calculated by each processor based on the
atoms it owns, but there may be zero or more per atom, e.g. a list of
bond distances. Computes that produce per-atom quantities have the
word "atom" in their style, e.g. {ke/atom}. Computes that produce
local quantities have the word "local" in their style,
e.g. {bond/local}. Styles with neither "atom" or "local" in their
style produce global quantities.
Note that a single compute produces either global or per-atom or local
-quantities, but never more than one of these.
+quantities, but never more than one of these (with only a few
+exceptions, as documented by individual compute commands).
Global, per-atom, and local quantities each come in three kinds: a
single scalar value, a vector of values, or a 2d array of values. The
doc page for each compute describes the style and kind of values it
produces, e.g. a per-atom vector. Some computes produce more than one
kind of a single style, e.g. a global scalar and a global vector.
When a compute quantity is accessed, as in many of the output commands
discussed below, it can be referenced via the following bracket
notation, where ID is the ID of the compute:
c_ID | entire scalar, vector, or array
c_ID\[I\] | one element of vector, one column of array
c_ID\[I\]\[J\] | one element of array :tb(s=|)
In other words, using one bracket reduces the dimension of the
quantity once (vector -> scalar, array -> vector). Using two brackets
reduces the dimension twice (array -> scalar). Thus a command that
uses scalar compute values as input can also process elements of a
vector or array.
Note that commands and "variables"_variable.html which use compute
quantities typically do not allow for all kinds, e.g. a command may
require a vector of values, not a scalar. This means there is no
ambiguity about referring to a compute quantity as c_ID even if it
produces, for example, both a scalar and vector. The doc pages for
various commands explain the details.
:line
In LAMMPS, the values generated by a compute can be used in several
ways:
The results of computes that calculate a global temperature or
pressure can be used by fixes that do thermostatting or barostatting
or when atom velocities are created. :ulb,l
Global values can be output via the "thermo_style
custom"_thermo_style.html or "fix ave/time"_fix_ave_time.html command.
Or the values can be referenced in a "variable equal"_variable.html or
"variable atom"_variable.html command. :l
Per-atom values can be output via the "dump custom"_dump.html command
or the "fix ave/spatial"_fix_ave_spatial.html command. Or they can be
time-averaged via the "fix ave/atom"_fix_ave_atom.html command or
reduced by the "compute reduce"_compute_reduce.html command. Or the
per-atom values can be referenced in an "atom-style
variable"_variable.html. :l
Local values can be reduced by the "compute
reduce"_compute_reduce.html command, or histogrammed by the "fix
ave/histo"_fix_ave_histo.html command, or output by the "dump
local"_dump.html command. :l,ule
The results of computes that calculate global quantities can be either
"intensive" or "extensive" values. Intensive means the value is
independent of the number of atoms in the simulation,
e.g. temperature. Extensive means the value scales with the number of
atoms in the simulation, e.g. total rotational kinetic energy.
"Thermodynamic output"_thermo_style.html will normalize extensive
values by the number of atoms in the system, depending on the
"thermo_modify norm" setting. It will not normalize intensive values.
If a compute value is accessed in another way, e.g. by a
"variable"_variable.html, you may want to know whether it is an
intensive or extensive value. See the doc page for individual
computes for further info.
:line
LAMMPS creates its own computes internally for thermodynamic output.
Three computes are always created, named "thermo_temp",
"thermo_press", and "thermo_pe", as if these commands had been invoked
in the input script:
compute thermo_temp all temp
compute thermo_press all pressure thermo_temp
compute thermo_pe all pe :pre
Additional computes for other quantities are created if the thermo
style requires it. See the documentation for the
"thermo_style"_thermo_style.html command.
Fixes that calculate temperature or pressure, i.e. for thermostatting
or barostatting, may also create computes. These are discussed in the
documentation for specific "fix"_fix.html commands.
In all these cases, the default computes LAMMPS creates can be
replaced by computes defined by the user in the input script, as
described by the "thermo_modify"_thermo_modify.html and "fix
modify"_fix_modify.html commands.
Properties of either a default or user-defined compute can be modified
via the "compute_modify"_compute_modify.html command.
Computes can be deleted with the "uncompute"_uncompute.html command.
Code for new computes can be added to LAMMPS (see "this
section"_Section_modify.html of the manual) and the results of their
calculations accessed in the various ways described above.
:line
Each compute style has its own doc page which describes its arguments
and what it does. Here is an alphabetic list of compute styles
available in LAMMPS. They are also given in more compact form in the
Compute section of "this page"_Section_commands.html#cmd_5.
There are also additional compute styles (not listed here) submitted
by users which are included in the LAMMPS distribution. The list of
these with links to the individual styles are given in the compute
section of "this page"_Section_commands.html#cmd_5.
"angle/local"_compute_bond_local.html - theta and energy of each angle
"angmom/chunk"_compute_angmom_chunk.html - angular momentum for each chunk
"body/local"_compute_body_local.html - attributes of body sub-particles
"bond/local"_compute_bond_local.html - distance and energy of each bond
"centro/atom"_compute_centro_atom.html - centro-symmetry parameter for each atom
"chunk/atom"_compute_chunk_atom.html - assign chunk IDs to each atom
"cluster/atom"_compute_cluster_atom.html - cluster ID for each atom
"cna/atom"_compute_cna_atom.html - common neighbor analysis (CNA) for each atom
"com"_compute_com.html - center-of-mass of group of atoms
"com/chunk"_compute_com_chunk.html - center-of-mass for each chunk
"contact/atom"_compute_contact_atom.html - contact count for each spherical particle
"coord/atom"_compute_coord_atom.html - coordination number for each atom
"damage/atom"_compute_damage_atom.html - Peridynamic damage for each atom
"dihedral/local"_compute_dihedral_local.html - angle of each dihedral
"dilatation/atom"_compute_dilatation_atom.html - Peridynamic dilatation for each atom
"displace/atom"_compute_displace_atom.html - displacement of each atom
"erotate/asphere"_compute_erotate_asphere.html - rotational energy of aspherical particles
"erotate/rigid"_compute_erotate_rigid.html - rotational energy of rigid bodies
"erotate/sphere"_compute_erotate_sphere.html - rotational energy of spherical particles
"erotate/sphere/atom"_compute_erotate_sphere.html - rotational energy for each spherical particle
"event/displace"_compute_event_displace.html - detect event on atom displacement
"group/group"_compute_group_group.html - energy/force between two groups of atoms
"gyration"_compute_gyration.html - radius of gyration of group of atoms
"gyration/chunk"_compute_gyration_chunk.html - radius of gyration for each chunk
"heat/flux"_compute_heat_flux.html - heat flux through a group of atoms
"hexorder/atom"_compute_hexorder_atom.html - bond orientational order parameter q6
"improper/local"_compute_improper_local.html - angle of each improper
"inertia/chunk"_compute_inertia_chunk.html - inertia tensor for each chunk
"ke"_compute_ke.html - translational kinetic energy
"ke/atom"_compute_ke_atom.html - kinetic energy for each atom
"ke/rigid"_compute_ke_rigid.html - translational kinetic energy of rigid bodies
"msd"_compute_msd.html - mean-squared displacement of group of atoms
"msd/chunk"_compute_msd_chunk.html - mean-squared displacement for each chunk
"msd/nongauss"_compute_msd_nongauss.html - MSD and non-Gaussian parameter of group of atoms
"omega/chunk"_compute_omega_chunk.html - angular velocity for each chunk
"orientorder/atom"_compute_orientorder_atom.html - Steinhardt bond orientational order parameters Ql
"pair"_compute_pair.html - values computed by a pair style
"pair/local"_compute_pair_local.html - distance/energy/force of each pairwise interaction
"pe"_compute_pe.html - potential energy
"pe/atom"_compute_pe_atom.html - potential energy for each atom
"plasticity/atom"_compute_plasticity_atom.html - Peridynamic plasticity for each atom
"pressure"_compute_pressure.html - total pressure and pressure tensor
"property/atom"_compute_property_atom.html - convert atom attributes to per-atom vectors/arrays
"property/local"_compute_property_local.html - convert local attributes to localvectors/arrays
"property/chunk"_compute_property_chunk.html - extract various per-chunk attributes
"rdf"_compute_rdf.html - radial distribution function g(r) histogram of group of atoms
"reduce"_compute_reduce.html - combine per-atom quantities into a single global value
"reduce/region"_compute_reduce.html - same as compute reduce, within a region
"slice"_compute_slice.html - extract values from global vector or array
"sna/atom"_compute_sna_atom.html - calculate bispectrum coefficients for each atom
"snad/atom"_compute_sna_atom.html - derivative of bispectrum coefficients for each atom
"snav/atom"_compute_sna_atom.html - virial contribution from bispectrum coefficients for each atom
"stress/atom"_compute_stress_atom.html - stress tensor for each atom
"temp"_compute_temp.html - temperature of group of atoms
"temp/asphere"_compute_temp_asphere.html - temperature of aspherical particles
"temp/chunk"_compute_temp_chunk.html - temperature of each chunk
"temp/com"_compute_temp_com.html - temperature after subtracting center-of-mass velocity
"temp/deform"_compute_temp_deform.html - temperature excluding box deformation velocity
"temp/partial"_compute_temp_partial.html - temperature excluding one or more dimensions of velocity
"temp/profile"_compute_temp_profile.html - temperature excluding a binned velocity profile
"temp/ramp"_compute_temp_ramp.html - temperature excluding ramped velocity component
"temp/region"_compute_temp_region.html - temperature of a region of atoms
"temp/sphere"_compute_temp_sphere.html - temperature of spherical particles
"ti"_compute_ti.html - thermodyanmic integration free energy values
"torque/chunk"_compute_torque_chunk.html - torque applied on each chunk
"vacf"_compute_vacf.html - velocity-autocorrelation function of group of atoms
"vcm/chunk"_compute_vcm_chunk.html - velocity of center-of-mass for each chunk
"voronoi/atom"_compute_voronoi_atom.html - Voronoi volume and neighbors for each atom :ul
There are also additional compute styles submitted by users which are
included in the LAMMPS distribution. The list of these with links to
the individual styles are given in the compute section of "this
page"_Section_commands.html#cmd_5.
There are also additional accelerated compute styles included in the
LAMMPS distribution for faster performance on CPUs and GPUs. The list
of these with links to the individual styles are given in the pair
section of "this page"_Section_commands.html#cmd_5.
[Restrictions:] none
[Related commands:]
"uncompute"_uncompute.html, "compute_modify"_compute_modify.html, "fix
ave/atom"_fix_ave_atom.html, "fix ave/spatial"_fix_ave_spatial.html,
"fix ave/time"_fix_ave_time.html, "fix ave/histo"_fix_ave_histo.html
[Default:] none
diff --git a/doc/compute_chunk_atom.html b/doc/compute_chunk_atom.html
index ac158cc46..70b562a06 100644
--- a/doc/compute_chunk_atom.html
+++ b/doc/compute_chunk_atom.html
@@ -1,753 +1,769 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>compute chunk/atom command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>compute chunk/atom command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="compute-chunk-atom-command">
<span id="index-0"></span><h1>compute chunk/atom command<a class="headerlink" href="#compute-chunk-atom-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute ID group-ID chunk/atom style args keyword values ...
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="compute.html"><em>compute</em></a> command</li>
<li>chunk/atom = style name of this compute command</li>
</ul>
<pre class="literal-block">
style = <em>bin/1d</em> or <em>bin/2d</em> or <em>bin/3d</em> or <em>bin/sphere</em> or <em>type</em> or <em>molecule</em> or <em>compute/fix/variable</em>
<em>bin/1d</em> args = dim origin delta
dim = <em>x</em> or <em>y</em> or <em>z</em>
origin = <em>lower</em> or <em>center</em> or <em>upper</em> or coordinate value (distance units)
delta = thickness of spatial bins in dim (distance units)
<em>bin/2d</em> args = dim origin delta dim origin delta
dim = <em>x</em> or <em>y</em> or <em>z</em>
origin = <em>lower</em> or <em>center</em> or <em>upper</em> or coordinate value (distance units)
delta = thickness of spatial bins in dim (distance units)
<em>bin/3d</em> args = dim origin delta dim origin delta dim origin delta
dim = <em>x</em> or <em>y</em> or <em>z</em>
origin = <em>lower</em> or <em>center</em> or <em>upper</em> or coordinate value (distance units)
delta = thickness of spatial bins in dim (distance units)
<em>bin/sphere</em> args = xorig yorig zorig rmin rmax nsbin
xorig,yorig,zorig = center point of sphere
srmin,srmax = bin from sphere radius rmin to rmax
nsbin = # of spherical shell bins between rmin and rmax
<em>bin/cylinder</em> args = dim origin delta c1 c2 rmin rmax ncbin
dim = <em>x</em> or <em>y</em> or <em>z</em> = axis of cylinder axis
origin = <em>lower</em> or <em>center</em> or <em>upper</em> or coordinate value (distance units)
delta = thickness of spatial bins in dim (distance units)
c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
crmin,crmax = bin from cylinder radius rmin to rmax (distance units)
ncbin = # of concentric circle bins between rmin and rmax
<em>type</em> args = none
<em>molecule</em> args = none
<em>compute/fix/variable</em> = c_ID, c_ID[I], f_ID, f_ID[I], v_name with no args
c_ID = per-atom vector calculated by a compute with ID
c_ID[I] = Ith column of per-atom array calculated by a compute with ID
f_ID = per-atom vector calculated by a fix with ID
f_ID[I] = Ith column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name
</pre>
<ul class="simple">
<li>zero or more keyword/values pairs may be appended</li>
-<li>keyword = <em>region</em> or <em>nchunk</em> or <em>static</em> or <em>compress</em> or <em>bound</em> or <em>discard</em> or <em>units</em></li>
+<li>keyword = <em>region</em> or <em>nchunk</em> or <em>static</em> or <em>compress</em> or <em>bound</em> or <em>discard</em> or <em>pbc</em> or <em>units</em></li>
</ul>
<pre class="literal-block">
<em>region</em> value = region-ID
region-ID = ID of region atoms must be in to be part of a chunk
<em>nchunk</em> value = <em>once</em> or <em>every</em>
once = only compute the number of chunks once
every = re-compute the number of chunks whenever invoked
<em>limit</em> values = 0 or Nc max or Nc exact
0 = no limit on the number of chunks
Nc max = limit number of chunks to be &lt;= Nc
Nc exact = set number of chunks to exactly Nc
<em>ids</em> value = <em>once</em> or <em>nfreq</em> or <em>every</em>
once = assign chunk IDs to atoms only once, they persist thereafter
nfreq = assign chunk IDs to atoms only once every Nfreq steps (if invoked by <a class="reference internal" href="fix_ave_chunk.html"><em>fix ave/chunk</em></a> which sets Nfreq)
every = assign chunk IDs to atoms whenever invoked
<em>compress</em> value = <em>yes</em> or <em>no</em>
yes = compress chunk IDs to eliminate IDs with no atoms
no = do not compress chunk IDs even if some IDs have no atoms
<em>discard</em> value = <em>yes</em> or <em>no</em> or <em>mixed</em>
yes = discard atoms with out-of-range chunk IDs by assigning a chunk ID = 0
no = keep atoms with out-of-range chunk IDs by assigning a valid chunk ID
mixed = keep or discard such atoms according to spatial binning rule
<em>bound</em> values = x/y/z lo hi
x/y/z = <em>x</em> or <em>y</em> or <em>z</em> to bound sptial bins in this dimension
lo = <em>lower</em> or coordinate value (distance units)
hi = <em>upper</em> or coordinate value (distance units)
+<em>pbc</em> value = <em>no</em> or <em>yes</em>
+ yes = use periodic distance for bin/sphere and bin/cylinder styles
<em>units</em> value = <em>box</em> or <em>lattice</em> or <em>reduced</em>
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute 1 all chunk/atom type
compute 1 all chunk/atom bin/1d z lower 0.02 units reduced
compute 1 all chunk/atom bin/2d z lower 1.0 y 0.0 2.5
compute 1 all chunk/atom molecule region sphere nchunk once ids once compress yes
compute 1 all chunk/atom bin/sphere 5 5 5 2.0 5.0 5 discard yes
compute 1 all chunk/atom bin/cylinder z lower 2 10 10 2.0 5.0 3 discard yes
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Define a computation that calculates an integer chunk ID from 1 to
Nchunk for each atom in the group. Values of chunk IDs are determined
by the <em>style</em> of chunk, which can be based on atom type or molecule
ID or spatial binning or a per-atom property or value calculated by
another <a class="reference internal" href="compute.html"><em>compute</em></a>, <a class="reference internal" href="fix.html"><em>fix</em></a>, or <a class="reference internal" href="variable.html"><em>atom-style variable</em></a>. Per-atom chunk IDs can be used by other
computes with &#8220;chunk&#8221; in their style name, such as <a class="reference internal" href="compute_com_chunk.html"><em>compute com/chunk</em></a> or <a class="reference internal" href="compute_msd_chunk.html"><em>compute msd/chunk</em></a>. Or they can be used by the <a class="reference internal" href="fix_ave_chunk.html"><em>fix ave/chunk</em></a> command to sum and time average a
variety of per-atom properties over the atoms in each chunk. Or they
can simply be accessed by any command that uses per-atom values from a
compute as input, as discussed in <a class="reference internal" href="Section_howto.html#howto-15"><span>Section_howto 15</span></a>.</p>
<p>See <a class="reference internal" href="Section_howto.html#howto-23"><span>Section_howto 23</span></a> for an overview of
how this compute can be used with a variety of other commands to
tabulate properties of a simulation. The howto section gives several
examples of input script commands that can be used to calculate
interesting properties.</p>
<p>Conceptually it is important to realize that this compute does two
simple things. First, it sets the value of <em>Nchunk</em> = the number of
chunks, which can be a constant value or change over time. Second, it
assigns each atom to a chunk via a chunk ID. Chunk IDs range from 1
to <em>Nchunk</em> inclusive; some chunks may have no atoms assigned to them.
Atoms that do not belong to any chunk are assigned a value of 0. Note
that the two operations are not always performed together. For
example, spatial bins can be setup once (which sets <em>Nchunk</em>), and
atoms assigned to those bins many times thereafter (setting their
chunk IDs).</p>
<p>All other commands in LAMMPS that use chunk IDs assume there are
<em>Nchunk</em> number of chunks, and that every atom is assigned to one of
those chunks, or not assigned to any chunk.</p>
<p>There are many options for specifying for how and when <em>Nchunk</em> is
calculated, and how and when chunk IDs are assigned to atoms. The
details depend on the chunk <em>style</em> and its <em>args</em>, as well as
optional keyword settings. They can also depend on whether a <a class="reference internal" href="fix_ave_chunk.html"><em>fix ave/chunk</em></a> command is using this compute, since
that command requires <em>Nchunk</em> to remain static across windows of
timesteps it specifies, while it accumulates per-chunk averages.</p>
<p>The details are described below.</p>
<p>The different chunk styles operate as follows. For each style, how it
calculates <em>Nchunk</em> and assigns chunk IDs to atoms is explained. Note
that using the optional keywords can change both of those actions, as
described further below where the keywords are discussed.</p>
<hr class="docutils" />
<p>The <em>binning</em> styles perform a spatial binning of atoms, and assign an
atom the chunk ID corresponding to the bin number it is in. <em>Nchunk</em>
is set to the number of bins, which can change if the simulation box
size changes.</p>
<p>The <em>bin/1d</em>, <em>bin/2d</em>, and <em>bin/3d</em> styles define bins as 1d layers
(slabs), 2d pencils, or 3d boxes. The <em>dim</em>, <em>origin</em>, and <em>delta</em>
settings are specified 1, 2, or 3 times. For 2d or 3d bins, there is
no restriction on specifying dim = x before dim = y or z, or dim = y
before dim = z. Bins in a particular <em>dim</em> have a bin size in that
dimension given by <em>delta</em>. In each dimension, bins are defined
relative to a specified <em>origin</em>, which may be the lower/upper edge of
the simulation box (in that dimension), or its center point, or a
specified coordinate value. Starting at the origin, sufficient bins
are created in both directions to completely span the simulation box
or the bounds specified by the optional <em>bounds</em> keyword.</p>
<p>For orthogonal simulation boxes, the bins are layers, pencils, or
boxes aligned with the xyz coordinate axes. For triclinic
(non-orthogonal) simulation boxes, the bin faces are parallel to the
tilted faces of the simulation box. See <a class="reference internal" href="Section_howto.html#howto-12"><span>this section</span></a> of the manual for a discussion of
the geometry of triclinic boxes in LAMMPS. As described there, a
tilted simulation box has edge vectors a,b,c. In that nomenclature,
bins in the x dimension have faces with normals in the &#8220;b&#8221; cross &#8220;c&#8221;
direction. Bins in y have faces normal to the &#8220;a&#8221; cross &#8220;c&#8221;
direction. And bins in z have faces normal to the &#8220;a&#8221; cross &#8220;b&#8221;
direction. Note that in order to define the size and position of
these bins in an unambiguous fashion, the <em>units</em> option must be set
to <em>reduced</em> when using a triclinic simulation box, as noted below.</p>
<p>The meaning of <em>origin</em> and <em>delta</em> for triclinic boxes is as follows.
Consider a triclinic box with bins that are 1d layers or slabs in the
x dimension. No matter how the box is tilted, an <em>origin</em> of 0.0
means start layers at the lower &#8220;b&#8221; cross &#8220;c&#8221; plane of the simulation
box and an <em>origin</em> of 1.0 means to start layers at the upper &#8220;b&#8221;
cross &#8220;c&#8221; face of the box. A <em>delta</em> value of 0.1 in <em>reduced</em> units
means there will be 10 layers from 0.0 to 1.0, regardless of the
current size or shape of the simulation box.</p>
<p>The <em>bin/sphere</em> style defines a set of spherical shell bins around
the origin (<em>xorig</em>,*yorig*,*zorig*), using <em>nsbin</em> bins with radii
equally spaced between <em>srmin</em> and <em>srmax</em>. This is effectively a 1d
vector of bins. For example, if <em>srmin</em> = 1.0 and <em>srmax</em> = 10.0 and
<em>nsbin</em> = 9, then the first bin spans 1.0 &lt; r &lt; 2.0, and the last bin
spans 9.0 &lt; r 10.0. The geometry of the bins is the same whether the
simulation box is orthogonal or triclinic; i.e. the spherical shells
are not tilted or scaled differently in different dimensions to
transform them into ellipsoidal shells.</p>
<p>The <em>bin/cylinder</em> style defines bins for a cylinder oriented along
the axis <em>dim</em> with the axis coordinates in the other two radial
dimensions at (<em>c1</em>,*c2*). For dim = x, c1/c2 = y/z; for dim = y,
c1/c2 = x/z; for dim = z, c1/c2 = x/y. This is effectively a 2d array
of bins. The first dimension is along the cylinder axis, the second
dimension is radially outward from the cylinder axis. The bin size
and positions along the cylinder axis are specified by the <em>origin</em>
and <em>delta</em> values, the same as for the <em>bin/1d</em>, <em>bin/2d</em>, and
<em>bin/3d</em> styles. There are <em>ncbin</em> concentric circle bins in the
radial direction from the cylinder axis with radii equally spaced
between <em>crmin</em> and <em>crmax</em>. For example, if <em>crmin</em> = 1.0 and
<em>crmax</em> = 10.0 and <em>ncbin</em> = 9, then the first bin spans 1.0 &lt; r &lt;
2.0, and the last bin spans 9.0 &lt; r 10.0. The geometry of the bins in
the radial dimensions is the same whether the simulation box is
orthogonal or triclinic; i.e. the concetric circles are not tilted or
scaled differently in the two different dimensions to transform them
into ellipses.</p>
<p>The created bins (and hence the chunk IDs) are numbered consecutively
from 1 to the number of bins = <em>Nchunk</em>. For <em>bin2d</em> and <em>bin3d</em>, the
numbering varies most rapidly in the first dimension (which could be
x, y, or z), next rapidly in the 2nd dimension, and most slowly in the
3rd dimension. For <em>bin/sphere</em>, the bin with smallest radii is chunk
1 and the bni with largest radii is chunk Nchunk = <em>ncbin</em>. For
<em>bin/cylinder</em>, the numbering varies most rapidly in the dimension
along the cylinder axis and most slowly in the radial direction.</p>
<p>Each time this compute is invoked, each atom is mapped to a bin based
on its current position. Note that between reneighboring timesteps,
atoms can move outside the current simulation box. If the box is
periodic (in that dimension) the atom is remapping into the periodic
box for purposes of binning. If the box in not periodic, the atom may
have moved outside the bounds of all bins. If an atom is not inside
any bin, the <em>discard</em> keyword is used to determine how a chunk ID is
assigned to the atom.</p>
<hr class="docutils" />
<p>The <em>type</em> style uses the atom type as the chunk ID. <em>Nchunk</em> is set
to the number of atom types defined for the simulation, e.g. via the
<a class="reference internal" href="create_box.html"><em>create_box</em></a> or <a class="reference internal" href="read_data.html"><em>read_data</em></a> commands.</p>
<hr class="docutils" />
<p>The <em>molecule</em> style uses the molecule ID of each atom as its chunk
ID. <em>Nchunk</em> is set to the largest chunk ID. Note that this excludes
molecule IDs for atoms which are not in the specified group or
optional region.</p>
<p>There is no requirement that all atoms in a particular molecule are
assigned the same chunk ID (zero or non-zero), though you probably
want that to be the case, if you wish to compute a per-molecule
property. LAMMPS will issue a warning if that is not the case, but
only the first time that <em>Nchunk</em> is calculated.</p>
<p>Note that atoms with a molecule ID = 0, which may be non-molecular
solvent atoms, have an out-of-range chunk ID. These atoms are
discarded (not assigned to any chunk) or assigned to <em>Nchunk</em>,
depending on the value of the <em>discard</em> keyword.</p>
<hr class="docutils" />
<p>The <em>compute/fix/variable</em> styles set the chunk ID of each atom based
on a quantity calculated and stored by a compute, fix, or variable.
In each case, it must be a per-atom quantity. In each case the
referenced floating point values are converted to an integer chunk ID
as follows. The floating point value is truncated (rounded down) to
an integer value. If the integer value is &lt;= 0, then a chunk ID of 0
is assigned to the atom. If the integer value is &gt; 0, it becomes the
chunk ID to the atom. <em>Nchunk</em> is set to the largest chunk ID. Note
that this excludes atoms which are not in the specified group or
optional region.</p>
<p>If the style begins with &#8220;<a href="#id1"><span class="problematic" id="id2">c_</span></a>&#8221;, a compute ID must follow which has been
previously defined in the input script. If no bracketed integer is
appended, the per-atom vector calculated by the compute is used. If a
bracketed integer is appended, the Ith column of the per-atom array
calculated by the compute is used. Users can also write code for
their own compute styles and <a class="reference internal" href="Section_modify.html"><em>add them to LAMMPS</em></a>.</p>
<p>If the style begins with &#8220;<a href="#id3"><span class="problematic" id="id4">f_</span></a>&#8221;, a fix ID must follow which has been
previously defined in the input script. If no bracketed integer is
appended, the per-atom vector calculated by the fix is used. If a
bracketed integer is appended, the Ith column of the per-atom array
calculated by the fix is used. Note that some fixes only produce
their values on certain timesteps, which must be compatible with the
timestep on which this compute accesses the fix, else an error
results. Users can also write code for their own fix styles and <a class="reference internal" href="Section_modify.html"><em>add them to LAMMPS</em></a>.</p>
<p>If a value begins with &#8220;<a href="#id5"><span class="problematic" id="id6">v_</span></a>&#8221;, a variable name for an <em>atom</em> or
<em>atomfile</em> style <a class="reference internal" href="variable.html"><em>variable</em></a> must follow which has been
previously defined in the input script. Variables of style <em>atom</em> can
reference thermodynamic keywords and various per-atom attributes, or
invoke other computes, fixes, or variables when they are evaluated, so
this is a very general means of generating per-atom quantities to
treat as a chunk ID.</p>
<p>Normally, <em>Nchunk</em> = the number of chunks, is re-calculated every time
this fix is invoked, though the value may or may not change. As
explained below, the <em>nchunk</em> keyword can be set to <em>once</em> which means
<em>Nchunk</em> will never change.</p>
<p>If a <a class="reference internal" href="fix_ave_chunk.html"><em>fix ave/chunk</em></a> command uses this compute, it
can also turn off the re-calculation of <em>Nchunk</em> for one or more
windows of timesteps. The extent of the windows, during which Nchunk
is held constant, are determined by the <em>Nevery</em>, <em>Nrepeat</em>, <em>Nfreq</em>
values and the <em>ave</em> keyword setting that are used by the <a class="reference internal" href="fix_ave_chunk.html"><em>fix ave/chunk</em></a> command.</p>
<p>Specifically, if <em>ave</em> = <em>one</em>, then for each span of <em>Nfreq</em>
timesteps, <em>Nchunk</em> is held constant between the first timestep when
averaging is done (within the Nfreq-length window), and the last
timestep when averaging is done (multiple of Nfreq). If <em>ave</em> =
<em>running</em> or <em>window</em>, then <em>Nchunk</em> is held constant forever,
starting on the first timestep when the <a class="reference internal" href="fix_ave_chunk.html"><em>fix ave/chunk</em></a> command invokes this compute.</p>
<p>Note that multiple <a class="reference internal" href="fix_ave_chunk.html"><em>fix ave/chunk</em></a> commands can use
the same compute chunk/atom compute. However, the time windows they
induce for holding <em>Nchunk</em> constant must be identical, else an error
will be generated.</p>
<p>The various optional keywords operate as follows. Note that some of
them function differently or are ignored by different chunk styles.
Some of them also have different default values, depending on
the chunk style, as listed below.</p>
<p>The <em>region</em> keyword applies to all chunk styles. If used, an atom
must be in both the specified group and the specified geometric
<a class="reference internal" href="region.html"><em>region</em></a> to be assigned to a chunk.</p>
<hr class="docutils" />
<p>The <em>nchunk</em> keyword applies to all chunk styles. It specifies how
often <em>Nchunk</em> is recalculated, which in turn can affect the chunk IDs
assigned to individual atoms.</p>
<p>If <em>nchunk</em> is set to <em>once</em>, then <em>Nchunk</em> is only calculated once,
the first time this compute is invoked. If <em>nchunk</em> is set to
<em>every</em>, then <em>Nchunk</em> is re-calculated every time the compute is
invoked. Note that, as described above, the use of this compute
by the <a class="reference internal" href="fix_ave_chunk.html"><em>fix ave/chunk</em></a> command can override
the <em>every</em> setting.</p>
<p>The default values for <em>nchunk</em> are listed below and depend on the
chunk style and other system and keyword settings. They attempt to
represent typical use cases for the various chunk styles. The
<em>nchunk</em> value can always be set explicitly if desired.</p>
<hr class="docutils" />
<p>The <em>limit</em> keyword can be used to limit the calculated value of
<em>Nchunk</em> = the number of chunks. The limit is applied each time
<em>Nchunk</em> is calculated, which also limits the chunk IDs assigned to
any atom. The <em>limit</em> keyword is used by all chunk styles except the
<em>binning</em> styles, which ignore it. This is because the number of bins
can be tailored using the <em>bound</em> keyword (described below) which
effectively limits the size of <em>Nchunk</em>.</p>
<p>If <em>limit</em> is set to <em>Nc</em> = 0, then no limit is imposed on <em>Nchunk</em>,
though the <em>compress</em> keyword can still be used to reduce <em>Nchunk</em>, as
described below.</p>
<p>If <em>Nc</em> &gt; 0, then the effect of the <em>limit</em> keyword depends on whether
the <em>compress</em> keyword is also used with a setting of <em>yes</em>, and
whether the <em>compress</em> keyword is specified before the <em>limit</em> keyword
or after.</p>
<p>In all cases, <em>Nchunk</em> is first calculated in the usual way for each
chunk style, as described above.</p>
<p>First, here is what occurs if <em>compress yes</em> is not set. If <em>limit</em>
is set to <em>Nc max</em>, then <em>Nchunk</em> is reset to the smaller of <em>Nchunk</em>
and <em>Nc</em>. If <em>limit</em> is set to <em>Nc exact</em>, then <em>Nchunk</em> is reset to
<em>Nc</em>, whether the original <em>Nchunk</em> was larger or smaller than <em>Nc</em>.
If <em>Nchunk</em> shrank due to the <em>limit</em> setting, then atom chunk IDs &gt;
<em>Nchunk</em> will be reset to 0 or <em>Nchunk</em>, depending on the setting of
the <em>discard</em> keyword. If <em>Nchunk</em> grew, there will simply be some
chunks with no atoms assigned to them.</p>
<p>If <em>compress yes</em> is set, and the <em>compress</em> keyword comes before the
<em>limit</em> keyword, the compression operation is performed first, as
described below, which resets <em>Nchunk</em>. The <em>limit</em> keyword is then
applied to the new <em>Nchunk</em> value, exactly as described in the
preceeding paragraph. Note that in this case, all atoms will end up
with chunk IDs &lt;= <em>Nc</em>, but their original values (e.g. molecule ID or
compute/fix/variable value) may have been &gt; <em>Nc</em>, because of the
compression operation.</p>
<p>If <em>compress yes</em> is set, and the <em>compress</em> keyword comes after the
<em>limit</em> keyword, then the <em>limit</em> value of <em>Nc</em> is applied first to
the uncompressed value of <em>Nchunk</em>, but only if <em>Nc</em> &lt; <em>Nchunk</em>
(whether <em>Nc max</em> or <em>Nc exact</em> is used). This effectively means all
atoms with chunk IDs &gt; <em>Nc</em> have their chunk IDs reset to 0 or <em>Nc</em>,
depending on the setting of the <em>discard</em> keyword. The compression
operation is then performed, which may shrink <em>Nchunk</em> further. If
the new <em>Nchunk</em> &lt; <em>Nc</em> and <em>limit</em> = <em>Nc exact</em> is specified, then
<em>Nchunk</em> is reset to <em>Nc</em>, which results in extra chunks with no atoms
assigned to them. Note that in this case, all atoms will end up with
chunk IDs &lt;= <em>Nc</em>, and their original values (e.g. molecule ID or
compute/fix/variable value) will also have been &lt;= <em>Nc</em>.</p>
<hr class="docutils" />
<p>The <em>ids</em> keyword applies to all chunk styles. If the setting is
<em>once</em> then the chunk IDs assigned to atoms the first time this
compute is invoked will be permanent, and never be re-computed.</p>
<p>If the setting is <em>nfreq</em> and if a <a class="reference internal" href="fix_ave_chunk.html"><em>fix ave/chunk</em></a>
command is using this compute, then in each of the <em>Nchunk</em> = constant
time windows (discussed above), the chunk ID&#8217;s assigned to atoms on
the first step of the time window will persist until the end of the
time window.</p>
<p>If the setting is <em>every</em>, which is the default, then chunk IDs are
re-calculated on any timestep this compute is invoked.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you want the persistent chunk-IDs calculated by this compute
to be continuous when running from a <a class="reference internal" href="read_restart.html"><em>restart file</em></a>,
then you should use the same ID for this compute, as in the original
run. This is so that the fix this compute creates to store per-atom
quantities will also have the same ID, and thus be initialized
correctly with chunk IDs from the restart file.</p>
</div>
<hr class="docutils" />
<p>The <em>compress</em> keyword applies to all chunk styles and affects how
<em>Nchunk</em> is calculated, which in turn affects the chunk IDs assigned
to each atom. It is useful for converting a &#8220;sparse&#8221; set of chunk IDs
(with many IDs that have no atoms assigned to them), into a &#8220;dense&#8221;
set of IDs, where every chunk has one or more atoms assigned to it.</p>
<p>Two possible use cases are as follows. If a large simulation box is
mostly empty space, then the <em>binning</em> style may produce many bins
with no atoms. If <em>compress</em> is set to <em>yes</em>, only bins with atoms
will be contribute to <em>Nchunk</em>. Likewise, the <em>molecule</em> or
<em>compute/fix/variable</em> styles may produce large <em>Nchunk</em> values. For
example, the <a class="reference internal" href="compute_cluster_atom.html"><em>compute cluster/atom</em></a> command
assigns every atom an atom ID for one of the atoms it is clustered
with. For a million-atom system with 5 clusters, there would only be
5 unique chunk IDs, but the largest chunk ID might be 1 million,
resulting in <em>Nchunk</em> = 1 million. If <em>compress</em> is set to <em>yes</em>,
<em>Nchunk</em> will be reset to 5.</p>
<p>If <em>compress</em> is set to <em>no</em>, which is the default, no compression is
done. If it is set to <em>yes</em>, all chunk IDs with no atoms are removed
from the list of chunk IDs, and the list is sorted. The remaining
chunk IDs are renumbered from 1 to <em>Nchunk</em> where <em>Nchunk</em> is the new
length of the list. The chunk IDs assigned to each atom reflect
the new renumbering from 1 to <em>Nchunk</em>.</p>
<p>The original chunk IDs (before renumbering) can be accessed by the
<a class="reference internal" href="compute_property_chunk.html"><em>compute property/chunk</em></a> command and its
<em>id</em> keyword, or by the <a class="reference internal" href="fix_ave_chunk.html"><em>fix ave/chunk</em></a> command
which outputs the original IDs as one of the columns in its global
output array. For example, using the &#8220;compute cluster/atom&#8221; command
discussed above, the original 5 unique chunk IDs might be atom IDs
(27,4982,58374,857838,1000000). After compresion, these will be
renumbered to (1,2,3,4,5). The original values (27,...,1000000) can
be output to a file by the <a class="reference internal" href="fix_ave_chunk.html"><em>fix ave/chunk</em></a> command,
or by using the <a class="reference internal" href="fix_ave_time.html"><em>fix ave/time</em></a> command in
conjunction with the <a class="reference internal" href="compute_property_chunk.html"><em>compute property/chunk</em></a> command.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The compression operation requires global communication across
all processors to share their chunk ID values. It can require large
memory on every processor to store them, even after they are
compressed, if there are are a large number of unique chunk IDs with
atoms assigned to them. It uses a STL map to find unique chunk IDs
and store them in sorted order. Each time an atom is assigned a
compressed chunk ID, it must access the STL map. All of this means
that compression can be expensive, both in memory and CPU time. The
use of the <em>limit</em> keyword in conjunction with the <em>compress</em> keyword
can affect these costs, depending on which keyword is used first. So
use this option with care.</p>
</div>
<hr class="docutils" />
<p>The <em>discard</em> keyword applies to all chunk styles. It affects what
chunk IDs are assigned to atoms that do not match one of the valid
chunk IDs from 1 to <em>Nchunk</em>. Note that it does not apply to atoms
that are not in the specified group or optionally specified region.
Those atoms are always assigned a chunk ID = 0.</p>
<p>If the calculated chunk ID for an atom is not within the range 1 to
<em>Nchunk</em> then it is a &#8220;discard&#8221; atom. Note that <em>Nchunk</em> may have
been shrunk by the <em>limit</em> keyword. Or the <em>compress</em> keyword may
have eliminated chunk IDs that were valid before the compression took
place, and are now not in the compressed list. Also note that for the
<em>molecule</em> chunk style, if new molecules are added to the system,
their chunk IDs may exceed a previously calculated <em>Nchunk</em>.
Likewise, evaluation of a compute/fix/variable on a later timestep may
return chunk IDs that are invalid for the previously calculated
<em>Nchunk</em>.</p>
<p>All the chunk styles except the <em>binning</em> styles, must use <em>discard</em>
set to either <em>yes</em> or <em>no</em>. If <em>discard</em> is set to <em>yes</em>, which is
the default, then every &#8220;discard&#8221; atom has its chunk ID set to 0. If
<em>discard</em> is set to <em>no</em>, every &#8220;discard&#8221; atom has its chunk ID set to
<em>Nchunk</em>. I.e. it becomes part of the last chunk.</p>
<p>The <em>binning</em> styles use the <em>discard</em> keyword to decide whether to
discard atoms outside the spatial domain covered by bins, or to assign
them to the bin they are nearest to.</p>
<p>For the <em>bin/1d</em>, <em>bin/2d</em>, <em>bin/3d</em> styles the details are as
follows. If <em>discard</em> is set to <em>yes</em>, an out-of-domain atom will
have its chunk ID set to 0. If <em>discard</em> is set to <em>no</em>, the atom
will have its chunk ID set to the first or last bin in that dimension.
If <em>discard</em> is set to <em>mixed</em>, which is the default, it will only
have its chunk ID set to the first or last bin if bins extend to the
simulation box boundary in that dimension. This is the case if the
<em>bound</em> keyword settings are <em>lower</em> and <em>upper</em>, which is the
default. If the <em>bound</em> keyword settings are numeric values, then the
atom will have its chunk ID set to 0 if it is outside the bounds of
any bin. Note that in this case, it is possible that the first or
last bin extends beyond the numeric <em>bounds</em> settings, depending on
the specified <em>origin</em>. If this is the case, the chunk ID of the atom
is only set to 0 if it is outside the first or last bin, not if it is
simply outside the numeric <em>bounds</em> setting.</p>
<p>For the <em>bin/sphere</em> style the details are as follows. If <em>discard</em>
is set to <em>yes</em>, an out-of-domain atom will have its chunk ID set to
0. If <em>discard</em> is set to <em>no</em> or <em>mixed</em>, the atom will have its
chunk ID set to the first or last bin, i.e. the innermost or outermost
spherical shell. If the distance of the atom from the origin is less
than <em>rmin</em>, it will be assigned to the first bin. If the distance of
the atom from the origin is greater than <em>rmax</em>, it will be assigned
to the last bin.</p>
<p>For the <em>bin/cylinder</em> style the details are as follows. If <em>discard</em>
is set to <em>yes</em>, an out-of-domain atom will have its chunk ID set to
0. If <em>discard</em> is set to <em>no</em>, the atom will have its chunk ID set
to the first or last bin in both the radial and axis dimensions. If
<em>discard</em> is set to <em>mixed</em>, which is the default, the the radial
dimension is treated the same as for <em>discard</em> = no. But for the axis
dimensinon, it will only have its chunk ID set to the first or last
bin if bins extend to the simulation box boundary in the axis
dimension. This is the case if the <em>bound</em> keyword settings are
<em>lower</em> and <em>upper</em>, which is the default. If the <em>bound</em> keyword
settings are numeric values, then the atom will have its chunk ID set
to 0 if it is outside the bounds of any bin. Note that in this case,
it is possible that the first or last bin extends beyond the numeric
<em>bounds</em> settings, depending on the specified <em>origin</em>. If this is
the case, the chunk ID of the atom is only set to 0 if it is outside
the first or last bin, not if it is simply outside the numeric
<em>bounds</em> setting.</p>
<p>If <em>discard</em> is set to <em>no</em> or <em>mixed</em>, the atom will have its
chunk ID set to the first or last bin, i.e. the innermost or outermost
spherical shell. If the distance of the atom from the origin is less
than <em>rmin</em>, it will be assigned to the first bin. If the distance of
the atom from the origin is greater than <em>rmax</em>, it will be assigned
to the last bin.</p>
<hr class="docutils" />
<p>The <em>bound</em> keyword only applies to the <em>bin/1d</em>, <em>bin/2d</em>, <em>bin/3d</em>
styles and to the axis dimension of the <em>bin/cylinder</em> style;
otherwise it is ignored. It can be used one or more times to limit
the extent of bin coverage in a specified dimension, i.e. to only bin
a portion of the box. If the <em>lo</em> setting is <em>lower</em> or the <em>hi</em>
setting is <em>upper</em>, the bin extent in that direction extends to the
box boundary. If a numeric value is used for <em>lo</em> and/or <em>hi</em>, then
the bin extent in the <em>lo</em> or <em>hi</em> direction extends only to that
value, which is assumed to be inside (or at least near) the simulation
box boundaries, though LAMMPS does not check for this. Note that
using the <em>bound</em> keyword typically reduces the total number of bins
and thus the number of chunks <em>Nchunk</em>.</p>
+<p>The <em>pbc</em> keyword only applies to the <em>bin/sphere</em> and <em>bin/cylinder</em>
+styles. If set to <em>yes</em>, the distance an atom is from the sphere
+origin or cylinder axis is calculated in a minimum image sense with
+respect to periodic dimensions, when determining which bin the atom is
+in. I.e. if x is a periodic dimension and the distance between the
+atom and the sphere center in the x dimension is greater than 0.5 *
+simulation box length in x, then a box length is subtracted to give a
+distance &lt; 0.5 * simulation box length. This allosws the sphere or
+cylinder center to be near a box edge, and atoms on the other side of
+the periodic box will still be close to the center point/axis. Note
+that with a setting of <em>yes</em>, the outer sphere or cylinder radius must
+also be &lt;= 0.5 * simulation box length in any periodic dimension
+except for the cylinder axis dimension, or an error is generated.</p>
<p>The <em>units</em> keyword only applies to the <em>binning</em> styles; otherwise it
is ignored. For the <em>bin/1d</em>, <em>bin/2d</em>, <em>bin/3d</em> styles, it
determines the meaning of the distance units used for the bin sizes
<em>delta</em> and for <em>origin</em> and <em>bounds</em> values if they are coordinate
values. For the <em>bin/sphere</em> style it determines the meaning of the
distance units used for <em>xorig</em>,*yorig*,*zorig* and the radii <em>srmin</em>
and <em>srmax</em>. For the <em>bin/cylinder</em> style it determines the meaning
of the distance units used for <em>delta</em>,*c1*,*c2* and the radii <em>crmin</em>
and <em>crmax</em>.</p>
<p>For orthogonal simulation boxes, any of the 3 options may
be used. For non-orthogonal (triclinic) simulation boxes, only the
<em>reduced</em> option may be used.</p>
<p>A <em>box</em> value selects standard distance units as defined by the
<a class="reference internal" href="units.html"><em>units</em></a> command, e.g. Angstroms for units = real or metal.
A <em>lattice</em> value means the distance units are in lattice spacings.
The <a class="reference internal" href="lattice.html"><em>lattice</em></a> command must have been previously used to
define the lattice spacing. A <em>reduced</em> value means normalized
unitless values between 0 and 1, which represent the lower and upper
faces of the simulation box respectively. Thus an <em>origin</em> value of
0.5 means the center of the box in any dimension. A <em>delta</em> value of
0.1 means 10 bins span the box in that dimension.</p>
<p>Note that for the <em>bin/sphere</em> style, the radii <em>srmin</em> and <em>srmax</em> are
scaled by the lattice spacing or reduced value of the <em>x</em> dimension.</p>
<p>Note that for the <em>bin/cylinder</em> style, the radii <em>crmin</em> and <em>crmax</em>
are scaled by the lattice spacing or reduced value of the 1st
dimension perpendicular to the cylinder axis. E.g. y for an x-axis
cylinder, x for a y-axis cylinder, and x for a z-axis cylinder.</p>
<hr class="docutils" />
<p><strong>Output info:</strong></p>
<p>This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
<a class="reference internal" href="Section_howto.html#howto-15"><span>Section_howto 15</span></a> for an overview of
LAMMPS output options.</p>
<p>The per-atom vector values are unitless chunk IDs, ranging from 1 to
<em>Nchunk</em> (inclusive) for atoms assigned to chunks, and 0 for atoms not
belonging to a chunk.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>Even if the <em>nchunk</em> keyword is set to <em>once</em>, the chunk IDs assigned
to each atom are not stored in a restart files. This means you cannot
expect those assignments to persist in a restarted simulation.
Instead you must re-specify this command and assign atoms to chunks when
the restarted simulation begins.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="fix_ave_chunk.html"><em>fix ave/chunk</em></a></p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<p>The option defaults are as follows:</p>
<ul class="simple">
<li>region = none</li>
<li>nchunk = every, if compress is yes, overriding other defaults listed here</li>
<li>nchunk = once, for type style</li>
<li>nchunk = once, for mol style if region is none</li>
<li>nchunk = every, for mol style if region is set</li>
<li>nchunk = once, for binning style if the simulation box size is static or units = reduced</li>
<li>nchunk = every, for binning style if the simulation box size is dynamic and units is lattice or box</li>
<li>nchunk = every, for compute/fix/variable style</li>
<li>limit = 0</li>
<li>ids = every</li>
<li>compress = no</li>
<li>discard = yes, for all styles except binning</li>
<li>discard = mixed, for binning styles</li>
<li>bound = lower and upper in all dimensions</li>
+<li>pbc = no</li>
<li>units = lattice</li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/compute_chunk_atom.txt b/doc/compute_chunk_atom.txt
index bef333a4b..9b56c264c 100644
--- a/doc/compute_chunk_atom.txt
+++ b/doc/compute_chunk_atom.txt
@@ -1,648 +1,665 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute chunk/atom command :h3
[Syntax:]
compute ID group-ID chunk/atom style args keyword values ... :pre
ID, group-ID are documented in "compute"_compute.html command :ulb,l
chunk/atom = style name of this compute command :l
style = {bin/1d} or {bin/2d} or {bin/3d} or {bin/sphere} or {type} or {molecule} or {compute/fix/variable}
{bin/1d} args = dim origin delta
dim = {x} or {y} or {z}
origin = {lower} or {center} or {upper} or coordinate value (distance units)
delta = thickness of spatial bins in dim (distance units)
{bin/2d} args = dim origin delta dim origin delta
dim = {x} or {y} or {z}
origin = {lower} or {center} or {upper} or coordinate value (distance units)
delta = thickness of spatial bins in dim (distance units)
{bin/3d} args = dim origin delta dim origin delta dim origin delta
dim = {x} or {y} or {z}
origin = {lower} or {center} or {upper} or coordinate value (distance units)
delta = thickness of spatial bins in dim (distance units)
{bin/sphere} args = xorig yorig zorig rmin rmax nsbin
xorig,yorig,zorig = center point of sphere
srmin,srmax = bin from sphere radius rmin to rmax
nsbin = # of spherical shell bins between rmin and rmax
{bin/cylinder} args = dim origin delta c1 c2 rmin rmax ncbin
dim = {x} or {y} or {z} = axis of cylinder axis
origin = {lower} or {center} or {upper} or coordinate value (distance units)
delta = thickness of spatial bins in dim (distance units)
c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
crmin,crmax = bin from cylinder radius rmin to rmax (distance units)
ncbin = # of concentric circle bins between rmin and rmax
{type} args = none
{molecule} args = none
{compute/fix/variable} = c_ID, c_ID\[I\], f_ID, f_ID\[I\], v_name with no args
c_ID = per-atom vector calculated by a compute with ID
c_ID\[I\] = Ith column of per-atom array calculated by a compute with ID
f_ID = per-atom vector calculated by a fix with ID
f_ID\[I\] = Ith column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name :pre
zero or more keyword/values pairs may be appended :l
-keyword = {region} or {nchunk} or {static} or {compress} or {bound} or {discard} or {units} :l
+keyword = {region} or {nchunk} or {static} or {compress} or {bound} or {discard} or {pbc} or {units} :l
{region} value = region-ID
region-ID = ID of region atoms must be in to be part of a chunk
{nchunk} value = {once} or {every}
once = only compute the number of chunks once
every = re-compute the number of chunks whenever invoked
{limit} values = 0 or Nc max or Nc exact
0 = no limit on the number of chunks
Nc max = limit number of chunks to be <= Nc
Nc exact = set number of chunks to exactly Nc
{ids} value = {once} or {nfreq} or {every}
once = assign chunk IDs to atoms only once, they persist thereafter
nfreq = assign chunk IDs to atoms only once every Nfreq steps (if invoked by "fix ave/chunk"_fix_ave_chunk.html which sets Nfreq)
every = assign chunk IDs to atoms whenever invoked
{compress} value = {yes} or {no}
yes = compress chunk IDs to eliminate IDs with no atoms
no = do not compress chunk IDs even if some IDs have no atoms
{discard} value = {yes} or {no} or {mixed}
yes = discard atoms with out-of-range chunk IDs by assigning a chunk ID = 0
no = keep atoms with out-of-range chunk IDs by assigning a valid chunk ID
mixed = keep or discard such atoms according to spatial binning rule
{bound} values = x/y/z lo hi
x/y/z = {x} or {y} or {z} to bound sptial bins in this dimension
lo = {lower} or coordinate value (distance units)
hi = {upper} or coordinate value (distance units)
+ {pbc} value = {no} or {yes}
+ yes = use periodic distance for bin/sphere and bin/cylinder styles
{units} value = {box} or {lattice} or {reduced} :pre
:ule
[Examples:]
compute 1 all chunk/atom type
compute 1 all chunk/atom bin/1d z lower 0.02 units reduced
compute 1 all chunk/atom bin/2d z lower 1.0 y 0.0 2.5
compute 1 all chunk/atom molecule region sphere nchunk once ids once compress yes
compute 1 all chunk/atom bin/sphere 5 5 5 2.0 5.0 5 discard yes
compute 1 all chunk/atom bin/cylinder z lower 2 10 10 2.0 5.0 3 discard yes :pre
[Description:]
Define a computation that calculates an integer chunk ID from 1 to
Nchunk for each atom in the group. Values of chunk IDs are determined
by the {style} of chunk, which can be based on atom type or molecule
ID or spatial binning or a per-atom property or value calculated by
another "compute"_compute.html, "fix"_fix.html, or "atom-style
variable"_variable.html. Per-atom chunk IDs can be used by other
computes with "chunk" in their style name, such as "compute
com/chunk"_compute_com_chunk.html or "compute
msd/chunk"_compute_msd_chunk.html. Or they can be used by the "fix
ave/chunk"_fix_ave_chunk.html command to sum and time average a
variety of per-atom properties over the atoms in each chunk. Or they
can simply be accessed by any command that uses per-atom values from a
compute as input, as discussed in "Section_howto
15"_Section_howto.html#howto_15.
See "Section_howto 23"_Section_howto.html#howto_23 for an overview of
how this compute can be used with a variety of other commands to
tabulate properties of a simulation. The howto section gives several
examples of input script commands that can be used to calculate
interesting properties.
Conceptually it is important to realize that this compute does two
simple things. First, it sets the value of {Nchunk} = the number of
chunks, which can be a constant value or change over time. Second, it
assigns each atom to a chunk via a chunk ID. Chunk IDs range from 1
to {Nchunk} inclusive; some chunks may have no atoms assigned to them.
Atoms that do not belong to any chunk are assigned a value of 0. Note
that the two operations are not always performed together. For
example, spatial bins can be setup once (which sets {Nchunk}), and
atoms assigned to those bins many times thereafter (setting their
chunk IDs).
All other commands in LAMMPS that use chunk IDs assume there are
{Nchunk} number of chunks, and that every atom is assigned to one of
those chunks, or not assigned to any chunk.
There are many options for specifying for how and when {Nchunk} is
calculated, and how and when chunk IDs are assigned to atoms. The
details depend on the chunk {style} and its {args}, as well as
optional keyword settings. They can also depend on whether a "fix
ave/chunk"_fix_ave_chunk.html command is using this compute, since
that command requires {Nchunk} to remain static across windows of
timesteps it specifies, while it accumulates per-chunk averages.
The details are described below.
:line
:line
The different chunk styles operate as follows. For each style, how it
calculates {Nchunk} and assigns chunk IDs to atoms is explained. Note
that using the optional keywords can change both of those actions, as
described further below where the keywords are discussed.
:line
The {binning} styles perform a spatial binning of atoms, and assign an
atom the chunk ID corresponding to the bin number it is in. {Nchunk}
is set to the number of bins, which can change if the simulation box
size changes.
The {bin/1d}, {bin/2d}, and {bin/3d} styles define bins as 1d layers
(slabs), 2d pencils, or 3d boxes. The {dim}, {origin}, and {delta}
settings are specified 1, 2, or 3 times. For 2d or 3d bins, there is
no restriction on specifying dim = x before dim = y or z, or dim = y
before dim = z. Bins in a particular {dim} have a bin size in that
dimension given by {delta}. In each dimension, bins are defined
relative to a specified {origin}, which may be the lower/upper edge of
the simulation box (in that dimension), or its center point, or a
specified coordinate value. Starting at the origin, sufficient bins
are created in both directions to completely span the simulation box
or the bounds specified by the optional {bounds} keyword.
For orthogonal simulation boxes, the bins are layers, pencils, or
boxes aligned with the xyz coordinate axes. For triclinic
(non-orthogonal) simulation boxes, the bin faces are parallel to the
tilted faces of the simulation box. See "this
section"_Section_howto.html#howto_12 of the manual for a discussion of
the geometry of triclinic boxes in LAMMPS. As described there, a
tilted simulation box has edge vectors a,b,c. In that nomenclature,
bins in the x dimension have faces with normals in the "b" cross "c"
direction. Bins in y have faces normal to the "a" cross "c"
direction. And bins in z have faces normal to the "a" cross "b"
direction. Note that in order to define the size and position of
these bins in an unambiguous fashion, the {units} option must be set
to {reduced} when using a triclinic simulation box, as noted below.
The meaning of {origin} and {delta} for triclinic boxes is as follows.
Consider a triclinic box with bins that are 1d layers or slabs in the
x dimension. No matter how the box is tilted, an {origin} of 0.0
means start layers at the lower "b" cross "c" plane of the simulation
box and an {origin} of 1.0 means to start layers at the upper "b"
cross "c" face of the box. A {delta} value of 0.1 in {reduced} units
means there will be 10 layers from 0.0 to 1.0, regardless of the
current size or shape of the simulation box.
The {bin/sphere} style defines a set of spherical shell bins around
the origin ({xorig},{yorig},{zorig}), using {nsbin} bins with radii
equally spaced between {srmin} and {srmax}. This is effectively a 1d
vector of bins. For example, if {srmin} = 1.0 and {srmax} = 10.0 and
{nsbin} = 9, then the first bin spans 1.0 < r < 2.0, and the last bin
spans 9.0 < r 10.0. The geometry of the bins is the same whether the
simulation box is orthogonal or triclinic; i.e. the spherical shells
are not tilted or scaled differently in different dimensions to
transform them into ellipsoidal shells.
The {bin/cylinder} style defines bins for a cylinder oriented along
the axis {dim} with the axis coordinates in the other two radial
dimensions at ({c1},{c2}). For dim = x, c1/c2 = y/z; for dim = y,
c1/c2 = x/z; for dim = z, c1/c2 = x/y. This is effectively a 2d array
of bins. The first dimension is along the cylinder axis, the second
dimension is radially outward from the cylinder axis. The bin size
and positions along the cylinder axis are specified by the {origin}
and {delta} values, the same as for the {bin/1d}, {bin/2d}, and
{bin/3d} styles. There are {ncbin} concentric circle bins in the
radial direction from the cylinder axis with radii equally spaced
between {crmin} and {crmax}. For example, if {crmin} = 1.0 and
{crmax} = 10.0 and {ncbin} = 9, then the first bin spans 1.0 < r <
2.0, and the last bin spans 9.0 < r 10.0. The geometry of the bins in
the radial dimensions is the same whether the simulation box is
orthogonal or triclinic; i.e. the concetric circles are not tilted or
scaled differently in the two different dimensions to transform them
into ellipses.
The created bins (and hence the chunk IDs) are numbered consecutively
from 1 to the number of bins = {Nchunk}. For {bin2d} and {bin3d}, the
numbering varies most rapidly in the first dimension (which could be
x, y, or z), next rapidly in the 2nd dimension, and most slowly in the
3rd dimension. For {bin/sphere}, the bin with smallest radii is chunk
1 and the bni with largest radii is chunk Nchunk = {ncbin}. For
{bin/cylinder}, the numbering varies most rapidly in the dimension
along the cylinder axis and most slowly in the radial direction.
Each time this compute is invoked, each atom is mapped to a bin based
on its current position. Note that between reneighboring timesteps,
atoms can move outside the current simulation box. If the box is
periodic (in that dimension) the atom is remapping into the periodic
box for purposes of binning. If the box in not periodic, the atom may
have moved outside the bounds of all bins. If an atom is not inside
any bin, the {discard} keyword is used to determine how a chunk ID is
assigned to the atom.
:line
The {type} style uses the atom type as the chunk ID. {Nchunk} is set
to the number of atom types defined for the simulation, e.g. via the
"create_box"_create_box.html or "read_data"_read_data.html commands.
:line
The {molecule} style uses the molecule ID of each atom as its chunk
ID. {Nchunk} is set to the largest chunk ID. Note that this excludes
molecule IDs for atoms which are not in the specified group or
optional region.
There is no requirement that all atoms in a particular molecule are
assigned the same chunk ID (zero or non-zero), though you probably
want that to be the case, if you wish to compute a per-molecule
property. LAMMPS will issue a warning if that is not the case, but
only the first time that {Nchunk} is calculated.
Note that atoms with a molecule ID = 0, which may be non-molecular
solvent atoms, have an out-of-range chunk ID. These atoms are
discarded (not assigned to any chunk) or assigned to {Nchunk},
depending on the value of the {discard} keyword.
:line
The {compute/fix/variable} styles set the chunk ID of each atom based
on a quantity calculated and stored by a compute, fix, or variable.
In each case, it must be a per-atom quantity. In each case the
referenced floating point values are converted to an integer chunk ID
as follows. The floating point value is truncated (rounded down) to
an integer value. If the integer value is <= 0, then a chunk ID of 0
is assigned to the atom. If the integer value is > 0, it becomes the
chunk ID to the atom. {Nchunk} is set to the largest chunk ID. Note
that this excludes atoms which are not in the specified group or
optional region.
If the style begins with "c_", a compute ID must follow which has been
previously defined in the input script. If no bracketed integer is
appended, the per-atom vector calculated by the compute is used. If a
bracketed integer is appended, the Ith column of the per-atom array
calculated by the compute is used. Users can also write code for
their own compute styles and "add them to LAMMPS"_Section_modify.html.
If the style begins with "f_", a fix ID must follow which has been
previously defined in the input script. If no bracketed integer is
appended, the per-atom vector calculated by the fix is used. If a
bracketed integer is appended, the Ith column of the per-atom array
calculated by the fix is used. Note that some fixes only produce
their values on certain timesteps, which must be compatible with the
timestep on which this compute accesses the fix, else an error
results. Users can also write code for their own fix styles and "add
them to LAMMPS"_Section_modify.html.
If a value begins with "v_", a variable name for an {atom} or
{atomfile} style "variable"_variable.html must follow which has been
previously defined in the input script. Variables of style {atom} can
reference thermodynamic keywords and various per-atom attributes, or
invoke other computes, fixes, or variables when they are evaluated, so
this is a very general means of generating per-atom quantities to
treat as a chunk ID.
:line
:line
Normally, {Nchunk} = the number of chunks, is re-calculated every time
this fix is invoked, though the value may or may not change. As
explained below, the {nchunk} keyword can be set to {once} which means
{Nchunk} will never change.
If a "fix ave/chunk"_fix_ave_chunk.html command uses this compute, it
can also turn off the re-calculation of {Nchunk} for one or more
windows of timesteps. The extent of the windows, during which Nchunk
is held constant, are determined by the {Nevery}, {Nrepeat}, {Nfreq}
values and the {ave} keyword setting that are used by the "fix
ave/chunk"_fix_ave_chunk.html command.
Specifically, if {ave} = {one}, then for each span of {Nfreq}
timesteps, {Nchunk} is held constant between the first timestep when
averaging is done (within the Nfreq-length window), and the last
timestep when averaging is done (multiple of Nfreq). If {ave} =
{running} or {window}, then {Nchunk} is held constant forever,
starting on the first timestep when the "fix
ave/chunk"_fix_ave_chunk.html command invokes this compute.
Note that multiple "fix ave/chunk"_fix_ave_chunk.html commands can use
the same compute chunk/atom compute. However, the time windows they
induce for holding {Nchunk} constant must be identical, else an error
will be generated.
:line
:line
The various optional keywords operate as follows. Note that some of
them function differently or are ignored by different chunk styles.
Some of them also have different default values, depending on
the chunk style, as listed below.
The {region} keyword applies to all chunk styles. If used, an atom
must be in both the specified group and the specified geometric
"region"_region.html to be assigned to a chunk.
:line
The {nchunk} keyword applies to all chunk styles. It specifies how
often {Nchunk} is recalculated, which in turn can affect the chunk IDs
assigned to individual atoms.
If {nchunk} is set to {once}, then {Nchunk} is only calculated once,
the first time this compute is invoked. If {nchunk} is set to
{every}, then {Nchunk} is re-calculated every time the compute is
invoked. Note that, as described above, the use of this compute
by the "fix ave/chunk"_fix_ave_chunk.html command can override
the {every} setting.
The default values for {nchunk} are listed below and depend on the
chunk style and other system and keyword settings. They attempt to
represent typical use cases for the various chunk styles. The
{nchunk} value can always be set explicitly if desired.
:line
The {limit} keyword can be used to limit the calculated value of
{Nchunk} = the number of chunks. The limit is applied each time
{Nchunk} is calculated, which also limits the chunk IDs assigned to
any atom. The {limit} keyword is used by all chunk styles except the
{binning} styles, which ignore it. This is because the number of bins
can be tailored using the {bound} keyword (described below) which
effectively limits the size of {Nchunk}.
If {limit} is set to {Nc} = 0, then no limit is imposed on {Nchunk},
though the {compress} keyword can still be used to reduce {Nchunk}, as
described below.
If {Nc} > 0, then the effect of the {limit} keyword depends on whether
the {compress} keyword is also used with a setting of {yes}, and
whether the {compress} keyword is specified before the {limit} keyword
or after.
In all cases, {Nchunk} is first calculated in the usual way for each
chunk style, as described above.
First, here is what occurs if {compress yes} is not set. If {limit}
is set to {Nc max}, then {Nchunk} is reset to the smaller of {Nchunk}
and {Nc}. If {limit} is set to {Nc exact}, then {Nchunk} is reset to
{Nc}, whether the original {Nchunk} was larger or smaller than {Nc}.
If {Nchunk} shrank due to the {limit} setting, then atom chunk IDs >
{Nchunk} will be reset to 0 or {Nchunk}, depending on the setting of
the {discard} keyword. If {Nchunk} grew, there will simply be some
chunks with no atoms assigned to them.
If {compress yes} is set, and the {compress} keyword comes before the
{limit} keyword, the compression operation is performed first, as
described below, which resets {Nchunk}. The {limit} keyword is then
applied to the new {Nchunk} value, exactly as described in the
preceeding paragraph. Note that in this case, all atoms will end up
with chunk IDs <= {Nc}, but their original values (e.g. molecule ID or
compute/fix/variable value) may have been > {Nc}, because of the
compression operation.
If {compress yes} is set, and the {compress} keyword comes after the
{limit} keyword, then the {limit} value of {Nc} is applied first to
the uncompressed value of {Nchunk}, but only if {Nc} < {Nchunk}
(whether {Nc max} or {Nc exact} is used). This effectively means all
atoms with chunk IDs > {Nc} have their chunk IDs reset to 0 or {Nc},
depending on the setting of the {discard} keyword. The compression
operation is then performed, which may shrink {Nchunk} further. If
the new {Nchunk} < {Nc} and {limit} = {Nc exact} is specified, then
{Nchunk} is reset to {Nc}, which results in extra chunks with no atoms
assigned to them. Note that in this case, all atoms will end up with
chunk IDs <= {Nc}, and their original values (e.g. molecule ID or
compute/fix/variable value) will also have been <= {Nc}.
:line
The {ids} keyword applies to all chunk styles. If the setting is
{once} then the chunk IDs assigned to atoms the first time this
compute is invoked will be permanent, and never be re-computed.
If the setting is {nfreq} and if a "fix ave/chunk"_fix_ave_chunk.html
command is using this compute, then in each of the {Nchunk} = constant
time windows (discussed above), the chunk ID's assigned to atoms on
the first step of the time window will persist until the end of the
time window.
If the setting is {every}, which is the default, then chunk IDs are
re-calculated on any timestep this compute is invoked.
NOTE: If you want the persistent chunk-IDs calculated by this compute
to be continuous when running from a "restart file"_read_restart.html,
then you should use the same ID for this compute, as in the original
run. This is so that the fix this compute creates to store per-atom
quantities will also have the same ID, and thus be initialized
correctly with chunk IDs from the restart file.
:line
The {compress} keyword applies to all chunk styles and affects how
{Nchunk} is calculated, which in turn affects the chunk IDs assigned
to each atom. It is useful for converting a "sparse" set of chunk IDs
(with many IDs that have no atoms assigned to them), into a "dense"
set of IDs, where every chunk has one or more atoms assigned to it.
Two possible use cases are as follows. If a large simulation box is
mostly empty space, then the {binning} style may produce many bins
with no atoms. If {compress} is set to {yes}, only bins with atoms
will be contribute to {Nchunk}. Likewise, the {molecule} or
{compute/fix/variable} styles may produce large {Nchunk} values. For
example, the "compute cluster/atom"_compute_cluster_atom.html command
assigns every atom an atom ID for one of the atoms it is clustered
with. For a million-atom system with 5 clusters, there would only be
5 unique chunk IDs, but the largest chunk ID might be 1 million,
resulting in {Nchunk} = 1 million. If {compress} is set to {yes},
{Nchunk} will be reset to 5.
If {compress} is set to {no}, which is the default, no compression is
done. If it is set to {yes}, all chunk IDs with no atoms are removed
from the list of chunk IDs, and the list is sorted. The remaining
chunk IDs are renumbered from 1 to {Nchunk} where {Nchunk} is the new
length of the list. The chunk IDs assigned to each atom reflect
the new renumbering from 1 to {Nchunk}.
The original chunk IDs (before renumbering) can be accessed by the
"compute property/chunk"_compute_property_chunk.html command and its
{id} keyword, or by the "fix ave/chunk"_fix_ave_chunk.html command
which outputs the original IDs as one of the columns in its global
output array. For example, using the "compute cluster/atom" command
discussed above, the original 5 unique chunk IDs might be atom IDs
(27,4982,58374,857838,1000000). After compresion, these will be
renumbered to (1,2,3,4,5). The original values (27,...,1000000) can
be output to a file by the "fix ave/chunk"_fix_ave_chunk.html command,
or by using the "fix ave/time"_fix_ave_time.html command in
conjunction with the "compute
property/chunk"_compute_property_chunk.html command.
NOTE: The compression operation requires global communication across
all processors to share their chunk ID values. It can require large
memory on every processor to store them, even after they are
compressed, if there are are a large number of unique chunk IDs with
atoms assigned to them. It uses a STL map to find unique chunk IDs
and store them in sorted order. Each time an atom is assigned a
compressed chunk ID, it must access the STL map. All of this means
that compression can be expensive, both in memory and CPU time. The
use of the {limit} keyword in conjunction with the {compress} keyword
can affect these costs, depending on which keyword is used first. So
use this option with care.
:line
The {discard} keyword applies to all chunk styles. It affects what
chunk IDs are assigned to atoms that do not match one of the valid
chunk IDs from 1 to {Nchunk}. Note that it does not apply to atoms
that are not in the specified group or optionally specified region.
Those atoms are always assigned a chunk ID = 0.
If the calculated chunk ID for an atom is not within the range 1 to
{Nchunk} then it is a "discard" atom. Note that {Nchunk} may have
been shrunk by the {limit} keyword. Or the {compress} keyword may
have eliminated chunk IDs that were valid before the compression took
place, and are now not in the compressed list. Also note that for the
{molecule} chunk style, if new molecules are added to the system,
their chunk IDs may exceed a previously calculated {Nchunk}.
Likewise, evaluation of a compute/fix/variable on a later timestep may
return chunk IDs that are invalid for the previously calculated
{Nchunk}.
All the chunk styles except the {binning} styles, must use {discard}
set to either {yes} or {no}. If {discard} is set to {yes}, which is
the default, then every "discard" atom has its chunk ID set to 0. If
{discard} is set to {no}, every "discard" atom has its chunk ID set to
{Nchunk}. I.e. it becomes part of the last chunk.
The {binning} styles use the {discard} keyword to decide whether to
discard atoms outside the spatial domain covered by bins, or to assign
them to the bin they are nearest to.
For the {bin/1d}, {bin/2d}, {bin/3d} styles the details are as
follows. If {discard} is set to {yes}, an out-of-domain atom will
have its chunk ID set to 0. If {discard} is set to {no}, the atom
will have its chunk ID set to the first or last bin in that dimension.
If {discard} is set to {mixed}, which is the default, it will only
have its chunk ID set to the first or last bin if bins extend to the
simulation box boundary in that dimension. This is the case if the
{bound} keyword settings are {lower} and {upper}, which is the
default. If the {bound} keyword settings are numeric values, then the
atom will have its chunk ID set to 0 if it is outside the bounds of
any bin. Note that in this case, it is possible that the first or
last bin extends beyond the numeric {bounds} settings, depending on
the specified {origin}. If this is the case, the chunk ID of the atom
is only set to 0 if it is outside the first or last bin, not if it is
simply outside the numeric {bounds} setting.
For the {bin/sphere} style the details are as follows. If {discard}
is set to {yes}, an out-of-domain atom will have its chunk ID set to
0. If {discard} is set to {no} or {mixed}, the atom will have its
chunk ID set to the first or last bin, i.e. the innermost or outermost
spherical shell. If the distance of the atom from the origin is less
than {rmin}, it will be assigned to the first bin. If the distance of
the atom from the origin is greater than {rmax}, it will be assigned
to the last bin.
For the {bin/cylinder} style the details are as follows. If {discard}
is set to {yes}, an out-of-domain atom will have its chunk ID set to
0. If {discard} is set to {no}, the atom will have its chunk ID set
to the first or last bin in both the radial and axis dimensions. If
{discard} is set to {mixed}, which is the default, the the radial
dimension is treated the same as for {discard} = no. But for the axis
dimensinon, it will only have its chunk ID set to the first or last
bin if bins extend to the simulation box boundary in the axis
dimension. This is the case if the {bound} keyword settings are
{lower} and {upper}, which is the default. If the {bound} keyword
settings are numeric values, then the atom will have its chunk ID set
to 0 if it is outside the bounds of any bin. Note that in this case,
it is possible that the first or last bin extends beyond the numeric
{bounds} settings, depending on the specified {origin}. If this is
the case, the chunk ID of the atom is only set to 0 if it is outside
the first or last bin, not if it is simply outside the numeric
{bounds} setting.
If {discard} is set to {no} or {mixed}, the atom will have its
chunk ID set to the first or last bin, i.e. the innermost or outermost
spherical shell. If the distance of the atom from the origin is less
than {rmin}, it will be assigned to the first bin. If the distance of
the atom from the origin is greater than {rmax}, it will be assigned
to the last bin.
:line
The {bound} keyword only applies to the {bin/1d}, {bin/2d}, {bin/3d}
styles and to the axis dimension of the {bin/cylinder} style;
otherwise it is ignored. It can be used one or more times to limit
the extent of bin coverage in a specified dimension, i.e. to only bin
a portion of the box. If the {lo} setting is {lower} or the {hi}
setting is {upper}, the bin extent in that direction extends to the
box boundary. If a numeric value is used for {lo} and/or {hi}, then
the bin extent in the {lo} or {hi} direction extends only to that
value, which is assumed to be inside (or at least near) the simulation
box boundaries, though LAMMPS does not check for this. Note that
using the {bound} keyword typically reduces the total number of bins
and thus the number of chunks {Nchunk}.
+The {pbc} keyword only applies to the {bin/sphere} and {bin/cylinder}
+styles. If set to {yes}, the distance an atom is from the sphere
+origin or cylinder axis is calculated in a minimum image sense with
+respect to periodic dimensions, when determining which bin the atom is
+in. I.e. if x is a periodic dimension and the distance between the
+atom and the sphere center in the x dimension is greater than 0.5 *
+simulation box length in x, then a box length is subtracted to give a
+distance < 0.5 * simulation box length. This allosws the sphere or
+cylinder center to be near a box edge, and atoms on the other side of
+the periodic box will still be close to the center point/axis. Note
+that with a setting of {yes}, the outer sphere or cylinder radius must
+also be <= 0.5 * simulation box length in any periodic dimension
+except for the cylinder axis dimension, or an error is generated.
+
The {units} keyword only applies to the {binning} styles; otherwise it
is ignored. For the {bin/1d}, {bin/2d}, {bin/3d} styles, it
determines the meaning of the distance units used for the bin sizes
{delta} and for {origin} and {bounds} values if they are coordinate
values. For the {bin/sphere} style it determines the meaning of the
distance units used for {xorig},{yorig},{zorig} and the radii {srmin}
and {srmax}. For the {bin/cylinder} style it determines the meaning
of the distance units used for {delta},{c1},{c2} and the radii {crmin}
and {crmax}.
For orthogonal simulation boxes, any of the 3 options may
be used. For non-orthogonal (triclinic) simulation boxes, only the
{reduced} option may be used.
A {box} value selects standard distance units as defined by the
"units"_units.html command, e.g. Angstroms for units = real or metal.
A {lattice} value means the distance units are in lattice spacings.
The "lattice"_lattice.html command must have been previously used to
define the lattice spacing. A {reduced} value means normalized
unitless values between 0 and 1, which represent the lower and upper
faces of the simulation box respectively. Thus an {origin} value of
0.5 means the center of the box in any dimension. A {delta} value of
0.1 means 10 bins span the box in that dimension.
Note that for the {bin/sphere} style, the radii {srmin} and {srmax} are
scaled by the lattice spacing or reduced value of the {x} dimension.
Note that for the {bin/cylinder} style, the radii {crmin} and {crmax}
are scaled by the lattice spacing or reduced value of the 1st
dimension perpendicular to the cylinder axis. E.g. y for an x-axis
cylinder, x for a y-axis cylinder, and x for a z-axis cylinder.
:line
[Output info:]
This compute calculates a per-atom vector, which can be accessed by
any command that uses per-atom values from a compute as input. See
"Section_howto 15"_Section_howto.html#howto_15 for an overview of
LAMMPS output options.
The per-atom vector values are unitless chunk IDs, ranging from 1 to
{Nchunk} (inclusive) for atoms assigned to chunks, and 0 for atoms not
belonging to a chunk.
[Restrictions:]
Even if the {nchunk} keyword is set to {once}, the chunk IDs assigned
to each atom are not stored in a restart files. This means you cannot
expect those assignments to persist in a restarted simulation.
Instead you must re-specify this command and assign atoms to chunks when
the restarted simulation begins.
[Related commands:]
"fix ave/chunk"_fix_ave_chunk.html
[Default:]
The option defaults are as follows:
region = none
nchunk = every, if compress is yes, overriding other defaults listed here
nchunk = once, for type style
nchunk = once, for mol style if region is none
nchunk = every, for mol style if region is set
nchunk = once, for binning style if the simulation box size is static or units = reduced
nchunk = every, for binning style if the simulation box size is dynamic and units is lattice or box
nchunk = every, for compute/fix/variable style
limit = 0
ids = every
compress = no
discard = yes, for all styles except binning
discard = mixed, for binning styles
bound = lower and upper in all dimensions
+pbc = no
units = lattice :ul
diff --git a/doc/compute_msd.html b/doc/compute_msd.html
index 96c28c8ea..7354b36b8 100644
--- a/doc/compute_msd.html
+++ b/doc/compute_msd.html
@@ -1,299 +1,297 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>compute msd command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>compute msd command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="compute-msd-command">
<span id="index-0"></span><h1>compute msd command<a class="headerlink" href="#compute-msd-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute ID group-ID msd keyword values ...
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="compute.html"><em>compute</em></a> command</li>
<li>msd = style name of this compute command</li>
<li>zero or more keyword/value pairs may be appended</li>
<li>keyword = <em>com</em> or <em>average</em></li>
</ul>
<pre class="literal-block">
<em>com</em> value = <em>yes</em> or <em>no</em>
<em>average</em> value = <em>yes</em> or <em>no</em>
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute 1 all msd
compute 1 upper msd com yes average yes
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Define a computation that calculates the mean-squared displacement
(MSD) of the group of atoms, including all effects due to atoms
passing thru periodic boundaries. For computation of the non-Gaussian
parameter of mean-squared displacement, see the <a class="reference internal" href="compute_msd_nongauss.html"><em>compute msd/nongauss</em></a> command.</p>
<p>A vector of four quantites is calculated by this compute. The first 3
elements of the vector are the squared dx,dy,dz displacements, summed
and averaged over atoms in the group. The 4th element is the total
squared displacement, i.e. (dx*dx + dy*dy + dz*dz), summed and
averaged over atoms in the group.</p>
<p>The slope of the mean-squared displacement (MSD) versus time is
proportional to the diffusion coefficient of the diffusing atoms.</p>
<p>The displacement of an atom is from its reference position. This is
normally the original position at the time
the compute command was issued, unless the <em>average</em> keyword is set to <em>yes</em>.
The value of the displacement will be
0.0 for atoms not in the specified compute group.</p>
<p>If the <em>com</em> option is set to <em>yes</em> then the effect of any drift in
the center-of-mass of the group of atoms is subtracted out before the
displacment of each atom is calculated.</p>
<p>If the <em>average</em> option is set to <em>yes</em> then the reference position of
-an atom is based on the average position of that atom,
-corrected for center-of-mass motion if requested.
-The average position
-is a running average over all previous calls to the compute, including the
-current call. So on the first call
-it is current position, on the second call it is the arithmetic average of the
-current position and the position on the first call, and so on.
-Note that when using this option, the precise value of the mean square
-displacement will depend on the number of times the compute is
-called. So, for example, changing the frequency of thermo output may
-change the computed displacement. Also, the precise values will be
-changed if a single simulation is broken up into two parts, using
-either multiple run commands or a restart file. It only makes
-sense to use this option if the atoms are not diffusing, so that
-their average positions relative to the center of mass of the system
-are stationary. The most common case is crystalline solids undergoing
-thermal motion.</p>
+an atom is based on the average position of that atom, corrected for
+center-of-mass motion if requested. The average position is a running
+average over all previous calls to the compute, including the current
+call. So on the first call it is current position, on the second call
+it is the arithmetic average of the current position and the position
+on the first call, and so on. Note that when using this option, the
+precise value of the mean square displacement will depend on the
+number of times the compute is called. So, for example, changing the
+frequency of thermo output may change the computed displacement. Also,
+the precise values will be changed if a single simulation is broken up
+into two parts, using either multiple run commands or a restart
+file. It only makes sense to use this option if the atoms are not
+diffusing, so that their average positions relative to the center of
+mass of the system are stationary. The most common case is crystalline
+solids undergoing thermal motion.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Initial coordinates are stored in &#8220;unwrapped&#8221; form, by using the
image flags associated with each atom. See the <a class="reference internal" href="dump.html"><em>dump custom</em></a> command for a discussion of &#8220;unwrapped&#8221; coordinates.
See the Atoms section of the <a class="reference internal" href="read_data.html"><em>read_data</em></a> command for a
discussion of image flags and how they are set for each atom. You can
reset the image flags (e.g. to 0) before invoking this compute by
using the <a class="reference internal" href="set.html"><em>set image</em></a> command.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you want the quantities calculated by this compute to be
continuous when running from a <a class="reference internal" href="read_restart.html"><em>restart file</em></a>, then
you should use the same ID for this compute, as in the original run.
This is so that the fix this compute creates to store per-atom
quantities will also have the same ID, and thus be initialized
correctly with atom reference positions from the restart file. When
<em>average</em> is set to yes, then the atom reference positions are
restored correctly, but not the number of samples used obtain them. As
a result, the reference positions from the restart file are combined
with subsequent positions as if they were from a single sample,
instead of many, which will change the values of msd somewhat.</p>
</div>
<p><strong>Output info:</strong></p>
<p>This compute calculates a global vector of length 4, which can be
accessed by indices 1-4 by any command that uses global vector values
from a compute as input. See <a class="reference internal" href="Section_howto.html#howto-15"><span>this section</span></a> for an overview of LAMMPS output
options.</p>
<p>The vector values are &#8220;intensive&#8221;. The vector values will be in
distance^2 <a class="reference internal" href="units.html"><em>units</em></a>.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div>none</div></blockquote>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="compute_msd_nongauss.html"><em>compute msd/nongauss</em></a>, <a class="reference internal" href="compute_displace_atom.html"><em>compute displace_atom</em></a>, <a class="reference internal" href="fix_store_state.html"><em>fix store/state</em></a>, <a class="reference internal" href="compute_msd_chunk.html"><em>compute msd/chunk</em></a></p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<p>The option default are com = no, average = no.</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/compute_msd.txt b/doc/compute_msd.txt
index 6eb057229..88bf423df 100644
--- a/doc/compute_msd.txt
+++ b/doc/compute_msd.txt
@@ -1,116 +1,114 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute msd command :h3
[Syntax:]
compute ID group-ID msd keyword values ... :pre
ID, group-ID are documented in "compute"_compute.html command :ulb,l
msd = style name of this compute command :l
zero or more keyword/value pairs may be appended :l
keyword = {com} or {average} :l
{com} value = {yes} or {no}
{average} value = {yes} or {no} :pre
:ule
[Examples:]
compute 1 all msd
compute 1 upper msd com yes average yes :pre
[Description:]
Define a computation that calculates the mean-squared displacement
(MSD) of the group of atoms, including all effects due to atoms
passing thru periodic boundaries. For computation of the non-Gaussian
parameter of mean-squared displacement, see the "compute
msd/nongauss"_compute_msd_nongauss.html command.
A vector of four quantites is calculated by this compute. The first 3
elements of the vector are the squared dx,dy,dz displacements, summed
and averaged over atoms in the group. The 4th element is the total
squared displacement, i.e. (dx*dx + dy*dy + dz*dz), summed and
averaged over atoms in the group.
The slope of the mean-squared displacement (MSD) versus time is
proportional to the diffusion coefficient of the diffusing atoms.
The displacement of an atom is from its reference position. This is
normally the original position at the time
the compute command was issued, unless the {average} keyword is set to {yes}.
The value of the displacement will be
0.0 for atoms not in the specified compute group.
If the {com} option is set to {yes} then the effect of any drift in
the center-of-mass of the group of atoms is subtracted out before the
displacment of each atom is calculated.
-If the {average} option is set to {yes} then the reference position of
-an atom is based on the average position of that atom,
-corrected for center-of-mass motion if requested.
-The average position
-is a running average over all previous calls to the compute, including the
-current call. So on the first call
-it is current position, on the second call it is the arithmetic average of the
-current position and the position on the first call, and so on.
-Note that when using this option, the precise value of the mean square
-displacement will depend on the number of times the compute is
-called. So, for example, changing the frequency of thermo output may
-change the computed displacement. Also, the precise values will be
-changed if a single simulation is broken up into two parts, using
-either multiple run commands or a restart file. It only makes
-sense to use this option if the atoms are not diffusing, so that
-their average positions relative to the center of mass of the system
-are stationary. The most common case is crystalline solids undergoing
-thermal motion.
+If the {average} option is set to {yes} then the reference position of
+an atom is based on the average position of that atom, corrected for
+center-of-mass motion if requested. The average position is a running
+average over all previous calls to the compute, including the current
+call. So on the first call it is current position, on the second call
+it is the arithmetic average of the current position and the position
+on the first call, and so on. Note that when using this option, the
+precise value of the mean square displacement will depend on the
+number of times the compute is called. So, for example, changing the
+frequency of thermo output may change the computed displacement. Also,
+the precise values will be changed if a single simulation is broken up
+into two parts, using either multiple run commands or a restart
+file. It only makes sense to use this option if the atoms are not
+diffusing, so that their average positions relative to the center of
+mass of the system are stationary. The most common case is crystalline
+solids undergoing thermal motion.
NOTE: Initial coordinates are stored in "unwrapped" form, by using the
image flags associated with each atom. See the "dump
custom"_dump.html command for a discussion of "unwrapped" coordinates.
See the Atoms section of the "read_data"_read_data.html command for a
discussion of image flags and how they are set for each atom. You can
reset the image flags (e.g. to 0) before invoking this compute by
using the "set image"_set.html command.
NOTE: If you want the quantities calculated by this compute to be
continuous when running from a "restart file"_read_restart.html, then
you should use the same ID for this compute, as in the original run.
This is so that the fix this compute creates to store per-atom
quantities will also have the same ID, and thus be initialized
correctly with atom reference positions from the restart file. When
{average} is set to yes, then the atom reference positions are
restored correctly, but not the number of samples used obtain them. As
a result, the reference positions from the restart file are combined
with subsequent positions as if they were from a single sample,
instead of many, which will change the values of msd somewhat.
[Output info:]
This compute calculates a global vector of length 4, which can be
accessed by indices 1-4 by any command that uses global vector values
from a compute as input. See "this
section"_Section_howto.html#howto_15 for an overview of LAMMPS output
options.
The vector values are "intensive". The vector values will be in
distance^2 "units"_units.html.
[Restrictions:] none
[Related commands:]
"compute msd/nongauss"_compute_msd_nongauss.html, "compute
displace_atom"_compute_displace_atom.html, "fix
store/state"_fix_store_state.html, "compute
msd/chunk"_compute_msd_chunk.html
[Default:]
The option default are com = no, average = no.
diff --git a/doc/compute_msd_chunk.html b/doc/compute_msd_chunk.html
index d574bbf71..4ace7db50 100644
--- a/doc/compute_msd_chunk.html
+++ b/doc/compute_msd_chunk.html
@@ -1,303 +1,305 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>compute msd/chunk command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>compute msd/chunk command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="compute-msd-chunk-command">
<span id="index-0"></span><h1>compute msd/chunk command<a class="headerlink" href="#compute-msd-chunk-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute ID group-ID msd/chunk chunkID
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="compute.html"><em>compute</em></a> command</li>
<li>msd/chunk = style name of this compute command</li>
<li>chunkID = ID of <a class="reference internal" href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> command</li>
</ul>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute 1 all msd/chunk molchunk
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Define a computation that calculates the mean-squared displacement
(MSD) for multiple chunks of atoms.</p>
<p>In LAMMPS, chunks are collections of atoms defined by a <a class="reference internal" href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> command, which assigns each atom
to a single chunk (or no chunk). The ID for this command is specified
as chunkID. For example, a single chunk could be the atoms in a
molecule or atoms in a spatial bin. See the <a class="reference internal" href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> doc page and &#8220;<a class="reference internal" href="Section_howto.html#howto-23"><span>Section_howto 23</span></a> for details of how chunks can be
defined and examples of how they can be used to measure properties of
a system.</p>
<p>Four quantites are calculated by this compute for each chunk. The
first 3 quantities are the squared dx,dy,dz displacements of the
center-of-mass. The 4th component is the total squared displacement,
i.e. (dx*dx + dy*dy + dz*dz) of the center-of-mass. These
calculations include all effects due to atoms passing thru periodic
boundaries.</p>
<p>Note that only atoms in the specified group contribute to the
calculation. The <a class="reference internal" href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> command
defines its own group; atoms will have a chunk ID = 0 if they are not
in that group, signifying they are not assigned to a chunk, and will
thus also not contribute to this calculation. You can specify the
&#8220;all&#8221; group for this command if you simply want to include atoms with
non-zero chunk IDs.</p>
<p>The slope of the mean-squared displacement (MSD) versus time is
proportional to the diffusion coefficient of the diffusing chunks.</p>
<p>The displacement of the center-of-mass of the chunk is from its
original center-of-mass position, calculated on the timestep this
compute command was first invoked.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The number of chunks <em>Nchunk</em> calculated by the <a class="reference internal" href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> command must remain constant each
time this compute is invoked, so that the displacement for each chunk
from its original position can be computed consistently. If <em>Nchunk</em>
does not remain constant, an error will be generated. If needed, you
can enforce a constant <em>Nchunk</em> by using the <em>nchunk once</em> or <em>ids
once</em> options when specifying the <a class="reference internal" href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> command.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This compute stores the original position (of the
center-of-mass) of each chunk. When a displacement is calculated on a
later timestep, it is assumed that the same atoms are assigned to the
same chunk ID. However LAMMPS has no simple way to insure this is the
case, though you can use the <em>ids once</em> option when specifying the
<a class="reference internal" href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> command. Note that if
this is not the case, the MSD calculation does not have a sensible
meaning.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The initial coordinates of the atoms in each chunk are stored in
&#8220;unwrapped&#8221; form, by using the image flags associated with each atom.
See the <a class="reference internal" href="dump.html"><em>dump custom</em></a> command for a discussion of
&#8220;unwrapped&#8221; coordinates. See the Atoms section of the
<a class="reference internal" href="read_data.html"><em>read_data</em></a> command for a discussion of image flags and
how they are set for each atom. You can reset the image flags
(e.g. to 0) before invoking this compute by using the <a class="reference internal" href="set.html"><em>set image</em></a> command.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
-<p class="last">Unlike the <a class="reference internal" href="compute_msd.html"><em>compute msd</em></a> command, this compute
-does not store the initial center-of-mass coorindates of its molecules
-in a restart file. Thus you cannot continue the MSD per chunk
-calculation of this compute when running from a <a class="reference internal" href="read_restart.html"><em>restart file</em></a>.</p>
+<p class="last">If you want the quantities calculated by this compute to be
+continuous when running from a <a class="reference internal" href="read_restart.html"><em>restart file</em></a>, then
+you should use the same ID for this compute, as in the original run.
+This is so that the fix this compute creates to store per-chunk
+quantities will also have the same ID, and thus be initialized
+correctly with chunk reference positions from the restart file.</p>
</div>
<p>The simplest way to output the results of the compute com/msd
calculation to a file is to use the <a class="reference internal" href="fix_ave_time.html"><em>fix ave/time</em></a>
command, for example:</p>
<div class="highlight-python"><div class="highlight"><pre>compute cc1 all chunk/atom molecule
compute myChunk all com/msd cc1
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector
</pre></div>
</div>
<p><strong>Output info:</strong></p>
<p>This compute calculates a global array where the number of rows = the
number of chunks <em>Nchunk</em> as calculated by the specified <a class="reference internal" href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> command. The number of columns =
4 for dx,dy,dz and the total displacement. These values can be
accessed by any command that uses global array values from a compute
as input. See <a class="reference internal" href="Section_howto.html#howto-15"><span>this section</span></a> for an
overview of LAMMPS output options.</p>
<p>The array values are &#8220;intensive&#8221;. The array values will be in
distance^2 <a class="reference internal" href="units.html"><em>units</em></a>.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div>none</div></blockquote>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="compute_msd.html"><em>compute msd</em></a></p>
<p><strong>Default:</strong> none</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/compute_msd_chunk.txt b/doc/compute_msd_chunk.txt
index 7c4b66402..d5a453ac1 100644
--- a/doc/compute_msd_chunk.txt
+++ b/doc/compute_msd_chunk.txt
@@ -1,120 +1,121 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute msd/chunk command :h3
[Syntax:]
compute ID group-ID msd/chunk chunkID :pre
ID, group-ID are documented in "compute"_compute.html command
msd/chunk = style name of this compute command
chunkID = ID of "compute chunk/atom"_compute_chunk_atom.html command :ul
[Examples:]
compute 1 all msd/chunk molchunk :pre
[Description:]
Define a computation that calculates the mean-squared displacement
(MSD) for multiple chunks of atoms.
In LAMMPS, chunks are collections of atoms defined by a "compute
chunk/atom"_compute_chunk_atom.html command, which assigns each atom
to a single chunk (or no chunk). The ID for this command is specified
as chunkID. For example, a single chunk could be the atoms in a
molecule or atoms in a spatial bin. See the "compute
chunk/atom"_compute_chunk_atom.html doc page and ""Section_howto
23"_Section_howto.html#howto_23 for details of how chunks can be
defined and examples of how they can be used to measure properties of
a system.
Four quantites are calculated by this compute for each chunk. The
first 3 quantities are the squared dx,dy,dz displacements of the
center-of-mass. The 4th component is the total squared displacement,
i.e. (dx*dx + dy*dy + dz*dz) of the center-of-mass. These
calculations include all effects due to atoms passing thru periodic
boundaries.
Note that only atoms in the specified group contribute to the
calculation. The "compute chunk/atom"_compute_chunk_atom.html command
defines its own group; atoms will have a chunk ID = 0 if they are not
in that group, signifying they are not assigned to a chunk, and will
thus also not contribute to this calculation. You can specify the
"all" group for this command if you simply want to include atoms with
non-zero chunk IDs.
The slope of the mean-squared displacement (MSD) versus time is
proportional to the diffusion coefficient of the diffusing chunks.
The displacement of the center-of-mass of the chunk is from its
original center-of-mass position, calculated on the timestep this
compute command was first invoked.
NOTE: The number of chunks {Nchunk} calculated by the "compute
chunk/atom"_compute_chunk_atom.html command must remain constant each
time this compute is invoked, so that the displacement for each chunk
from its original position can be computed consistently. If {Nchunk}
does not remain constant, an error will be generated. If needed, you
can enforce a constant {Nchunk} by using the {nchunk once} or {ids
once} options when specifying the "compute
chunk/atom"_compute_chunk_atom.html command.
NOTE: This compute stores the original position (of the
center-of-mass) of each chunk. When a displacement is calculated on a
later timestep, it is assumed that the same atoms are assigned to the
same chunk ID. However LAMMPS has no simple way to insure this is the
case, though you can use the {ids once} option when specifying the
"compute chunk/atom"_compute_chunk_atom.html command. Note that if
this is not the case, the MSD calculation does not have a sensible
meaning.
NOTE: The initial coordinates of the atoms in each chunk are stored in
"unwrapped" form, by using the image flags associated with each atom.
See the "dump custom"_dump.html command for a discussion of
"unwrapped" coordinates. See the Atoms section of the
"read_data"_read_data.html command for a discussion of image flags and
how they are set for each atom. You can reset the image flags
(e.g. to 0) before invoking this compute by using the "set
image"_set.html command.
-NOTE: Unlike the "compute msd"_compute_msd.html command, this compute
-does not store the initial center-of-mass coorindates of its molecules
-in a restart file. Thus you cannot continue the MSD per chunk
-calculation of this compute when running from a "restart
-file"_read_restart.html.
+NOTE: If you want the quantities calculated by this compute to be
+continuous when running from a "restart file"_read_restart.html, then
+you should use the same ID for this compute, as in the original run.
+This is so that the fix this compute creates to store per-chunk
+quantities will also have the same ID, and thus be initialized
+correctly with chunk reference positions from the restart file.
The simplest way to output the results of the compute com/msd
calculation to a file is to use the "fix ave/time"_fix_ave_time.html
command, for example:
compute cc1 all chunk/atom molecule
compute myChunk all com/msd cc1
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
[Output info:]
This compute calculates a global array where the number of rows = the
number of chunks {Nchunk} as calculated by the specified "compute
chunk/atom"_compute_chunk_atom.html command. The number of columns =
4 for dx,dy,dz and the total displacement. These values can be
accessed by any command that uses global array values from a compute
as input. See "this section"_Section_howto.html#howto_15 for an
overview of LAMMPS output options.
The array values are "intensive". The array values will be in
distance^2 "units"_units.html.
[Restrictions:] none
[Related commands:]
"compute msd"_compute_msd.html
[Default:] none
diff --git a/doc/compute_saed.html b/doc/compute_saed.html
index e035fe161..f73f77b76 100644
--- a/doc/compute_saed.html
+++ b/doc/compute_saed.html
@@ -1,364 +1,367 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>compute saed command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>compute saed command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="compute-saed-command">
<span id="index-0"></span><h1>compute saed command<a class="headerlink" href="#compute-saed-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute ID group-ID saed lambda type1 type2 ... typeN keyword value ...
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="compute.html"><em>compute</em></a> command</li>
<li>saed = style name of this compute command</li>
<li>lambda = wavelength of incident radiation (length units)</li>
<li>type1 type2 ... typeN = chemical symbol of each atom type (see valid options below)</li>
<li>zero or more keyword/value pairs may be appended</li>
<li>keyword = <em>Kmax</em> or <em>Zone</em> or <em>dR_Ewald</em> or <em>c</em> or <em>manual</em> or <em>echo</em></li>
</ul>
<pre class="literal-block">
<em>Kmax</em> value = Maximum distance explored from reciprocal space origin
(inverse length units)
<em>Zone</em> values = z1 z2 z3
z1,z2,z3 = Zone axis of incident radiation. If z1=z2=z3=0 all
reciprocal space will be meshed up to <em>Kmax</em>
<em>dR_Ewald</em> value = Thickness of Ewald sphere slice intercepting
reciprocal space (inverse length units)
<em>c</em> values = c1 c2 c3
c1,c2,c3 = parameters to adjust the spacing of the reciprocal
lattice nodes in the h, k, and l directions respectively
<em>manual</em> = flag to use manual spacing of reciprocal lattice points
based on the values of the <em>c</em> parameters
<em>echo</em> = flag to provide extra output for debugging purposes
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute 1 all saed 0.0251 Al O Kmax 1.70 Zone 0 0 1 dR_Ewald 0.01 c 0.5 0.5 0.5
compute 2 all saed 0.0251 Ni Kmax 1.70 Zone 0 0 0 c 0.05 0.05 0.05 manual echo
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>fix saed/vtk 1 1 1 c_1 file Al2O3_001.saed
fix saed/vtk 1 1 1 c_2 file Ni_000.saed
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Define a computation that calculates electron diffraction intensity as
described in <a class="reference internal" href="fix_saed_vtk.html#coleman"><span>(Coleman)</span></a> on a mesh of reciprocal lattice nodes
defined by the entire simulation domain (or manually) using simulated
radiation of wavelength lambda.</p>
<p>The electron diffraction intensity I at each reciprocal lattice point
is computed from the structure factor F using the equations:</p>
<img alt="_images/compute_saed1.jpg" class="align-center" src="_images/compute_saed1.jpg" />
<img alt="_images/compute_saed2.jpg" class="align-center" src="_images/compute_saed2.jpg" />
<p>Here, K is the location of the reciprocal lattice node, rj is the
position of each atom, fj are atomic scattering factors.</p>
<p>Diffraction intensities are calculated on a three-dimensional mesh of
reciprocal lattice nodes. The mesh spacing is defined either (a) by
the entire simulation domain or (b) manually using selected values as
shown in the 2D diagram below.</p>
<a data-lightbox="group-default"
href="_images/saed_mesh.jpg"
class=""
title=""
data-title=""
><img src="_images/saed_mesh.jpg"
class="align-center"
width="25%"
height="auto"
alt=""/>
</a><p>For a mesh defined by the simulation domain, a rectilinear grid is
constructed with spacing <a href="#id1"><span class="problematic" id="id2">*</span></a>c**inv(A) along each reciprocal lattice
axis. Where A are the vectors corresponding to the edges of the
simulation cell. If one or two directions has non-periodic boundary
conditions, then the spacing in these directions is defined from the
average of the (inversed) box lengths with periodic boundary conditions.
Meshes defined by the simulation domain must contain at least one periodic
boundary.</p>
<p>If the <em>manual</em> flag is included, the mesh of reciprocal lattice nodes
will defined using the <em>c</em> values for the spacing along each reciprocal
lattice axis. Note that manual mapping of the reciprocal space mesh is
good for comparing diffraction results from multiple simulations; however
it can reduce the likelihood that Bragg reflections will be satisfied
unless small spacing parameters &lt;0.05 Angstrom^(-1) are implemented.
Meshes with manual spacing do not require a periodic boundary.</p>
<p>The limits of the reciprocal lattice mesh are determined by the use of
the <em>Kmax</em>, <em>Zone</em>, and <em>dR_Ewald</em> parameters. The rectilinear mesh
created about the origin of reciprocal space is terminated at the
boundary of a sphere of radius <em>Kmax</em> centered at the origin. If
<em>Zone</em> parameters z1=z2=z3=0 are used, diffraction intensities are
-computed throughout the entire spherical volume - note this can greatly
-increase the cost of computation. Otherwise, <em>Zone</em> parameters will
-denote the z1=h, z2=k, and z3=l (in a global since) zone axis of an
-intersecting Ewald sphere. Diffraction intensities will only be
-computed at the intersection of the reciprocal lattice mesh and a
-<em>dR_Ewald</em> thick surface of the Ewald sphere. See the example 3D
-intestiety data and the intersection of a [010] zone axis in the below image.</p>
+computed throughout the entire spherical volume - note this can
+greatly increase the cost of computation. Otherwise, <em>Zone</em>
+parameters will denote the z1=h, z2=k, and z3=l (in a global since)
+zone axis of an intersecting Ewald sphere. Diffraction intensities
+will only be computed at the intersection of the reciprocal lattice
+mesh and a <em>dR_Ewald</em> thick surface of the Ewald sphere. See the
+example 3D intestiety data and the intersection of a [010] zone axis
+in the below image.</p>
<a data-lightbox="group-default"
href="_images/saed_ewald_intersect.jpg"
class=""
title=""
data-title=""
><img src="_images/saed_ewald_intersect.jpg"
class="align-center"
width="25%"
height="auto"
alt=""/>
</a><p>The atomic scattering factors, fj, accounts for the reduction in
diffraction intensity due to Compton scattering. Compute saed uses
analytical approximations of the atomic scattering factors that vary
for each atom type (type1 type2 ... typeN) and angle of diffraction.
The analytic approximation is computed using the formula
<a class="reference internal" href="#brown"><span>(Brown)</span></a>:</p>
<img alt="_images/compute_saed3.jpg" class="align-center" src="_images/compute_saed3.jpg" />
<p>Coefficients parameterized by <a class="reference internal" href="#fox"><span>(Fox)</span></a> are assigned for each
atom type designating the chemical symbol and charge of each atom
type. Valid chemical symbols for compute saed are:</p>
<dl class="docutils">
<dt>H: He: Li: Be: B:</dt>
<dd><blockquote class="first">
<div>C: N: O: F: Ne:</div></blockquote>
<dl class="docutils">
<dt>Na: Mg: Al: Si: P:</dt>
<dd>S: Cl: Ar: K: Ca:</dd>
</dl>
<p class="last">Sc: Ti: V: Cr: Mn:
Fe: Co: Ni: Cu: Zn:
Ga: Ge: As: Se: Br:
Kr: Rb: Sr: Y: Zr:
Nb: Mo: Tc: Ru: Rh:
Pd: Ag: Cd: In: Sn:
Sb: Te: I: Xe: Cs:
Ba: La: Ce: Pr: Nd:
Pm: Sm: Eu: Gd: Tb:
Dy: Ho: Er: Tm: Yb:
Lu: Hf: Ta: W: Re:
Os: Ir: Pt: Au: Hg:
Tl: Pb: Bi: Po: At:
Rn: Fr: Ra: Ac: Th:
Pa: U: Np: Pu: Am:
Cm: Bk: Cf:tb(c=5,s=:)</p>
</dd>
</dl>
<p>If the <em>echo</em> keyword is specified, compute saed will provide extra
reporting information to the screen.</p>
<p><strong>Output info:</strong></p>
<p>This compute calculates a global vector. The length of the vector is
the number of reciprocal lattice nodes that are explored by the mesh.
The entries of the global vector are the computed diffraction
intensities as described above.</p>
<p>The vector can be accessed by any command that uses global values
from a compute as input. See <a class="reference internal" href="Section_howto.html#howto-15"><span>this section</span></a> for an overview of LAMMPS output
options.</p>
<p>All array values calculated by this compute are &#8220;intensive&#8221;.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
+<p>This compute is part of the USER-DIFFRACTION package. It is only
+enabled if LAMMPS was built with that package. See the <a class="reference internal" href="Section_start.html#start-3"><span>Making LAMMPS</span></a> section for more info.</p>
<p>The compute_saed command does not work for triclinic cells.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="fix_saed_vtk.html"><em>fix saed_vtk</em></a>, <a class="reference internal" href="compute_xrd.html"><em>compute xrd</em></a></p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<p>The option defaults are Kmax = 1.70, Zone 1 0 0, c 1 1 1, dR_Ewald =
0.01.</p>
<hr class="docutils" />
<p id="coleman"><strong>(Coleman)</strong> Coleman, Spearot, Capolungo, MSMSE, 21, 055020
(2013).</p>
<p id="brown"><strong>(Brown)</strong> Brown et al. International Tables for Crystallography
Volume C: Mathematical and Chemical Tables, 554-95 (2004).</p>
<p id="fox"><strong>(Fox)</strong> Fox, O&#8217;Keefe, Tabbernor, Acta Crystallogr. A, 45, 786-93
(1989).</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/compute_saed.txt b/doc/compute_saed.txt
index 1eef9de42..45b7df3f3 100644
--- a/doc/compute_saed.txt
+++ b/doc/compute_saed.txt
@@ -1,177 +1,182 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute saed command :h3
[Syntax:]
compute ID group-ID saed lambda type1 type2 ... typeN keyword value ... :pre
ID, group-ID are documented in "compute"_compute.html command :ulb,l
saed = style name of this compute command :l
lambda = wavelength of incident radiation (length units) :l
type1 type2 ... typeN = chemical symbol of each atom type (see valid options below) :l
zero or more keyword/value pairs may be appended :l
keyword = {Kmax} or {Zone} or {dR_Ewald} or {c} or {manual} or {echo} :l
{Kmax} value = Maximum distance explored from reciprocal space origin
(inverse length units)
{Zone} values = z1 z2 z3
z1,z2,z3 = Zone axis of incident radiation. If z1=z2=z3=0 all
reciprocal space will be meshed up to {Kmax}
{dR_Ewald} value = Thickness of Ewald sphere slice intercepting
reciprocal space (inverse length units)
{c} values = c1 c2 c3
c1,c2,c3 = parameters to adjust the spacing of the reciprocal
lattice nodes in the h, k, and l directions respectively
{manual} = flag to use manual spacing of reciprocal lattice points
based on the values of the {c} parameters
{echo} = flag to provide extra output for debugging purposes :pre
:ule
[Examples:]
compute 1 all saed 0.0251 Al O Kmax 1.70 Zone 0 0 1 dR_Ewald 0.01 c 0.5 0.5 0.5
compute 2 all saed 0.0251 Ni Kmax 1.70 Zone 0 0 0 c 0.05 0.05 0.05 manual echo :pre
fix saed/vtk 1 1 1 c_1 file Al2O3_001.saed
fix saed/vtk 1 1 1 c_2 file Ni_000.saed :pre
[Description:]
Define a computation that calculates electron diffraction intensity as
described in "(Coleman)"_#Coleman on a mesh of reciprocal lattice nodes
defined by the entire simulation domain (or manually) using simulated
radiation of wavelength lambda.
The electron diffraction intensity I at each reciprocal lattice point
is computed from the structure factor F using the equations:
:c,image(Eqs/compute_saed1.jpg)
:c,image(Eqs/compute_saed2.jpg)
Here, K is the location of the reciprocal lattice node, rj is the
position of each atom, fj are atomic scattering factors.
Diffraction intensities are calculated on a three-dimensional mesh of
reciprocal lattice nodes. The mesh spacing is defined either (a) by
the entire simulation domain or (b) manually using selected values as
shown in the 2D diagram below.
:c,image(JPG/saed_mesh_small.jpg,JPG/saed_mesh.jpg)
For a mesh defined by the simulation domain, a rectilinear grid is
constructed with spacing {c}*inv(A) along each reciprocal lattice
axis. Where A are the vectors corresponding to the edges of the
simulation cell. If one or two directions has non-periodic boundary
conditions, then the spacing in these directions is defined from the
average of the (inversed) box lengths with periodic boundary conditions.
Meshes defined by the simulation domain must contain at least one periodic
boundary.
If the {manual} flag is included, the mesh of reciprocal lattice nodes
will defined using the {c} values for the spacing along each reciprocal
lattice axis. Note that manual mapping of the reciprocal space mesh is
good for comparing diffraction results from multiple simulations; however
it can reduce the likelihood that Bragg reflections will be satisfied
unless small spacing parameters <0.05 Angstrom^(-1) are implemented.
Meshes with manual spacing do not require a periodic boundary.
-The limits of the reciprocal lattice mesh are determined by the use of
-the {Kmax}, {Zone}, and {dR_Ewald} parameters. The rectilinear mesh
-created about the origin of reciprocal space is terminated at the
-boundary of a sphere of radius {Kmax} centered at the origin. If
-{Zone} parameters z1=z2=z3=0 are used, diffraction intensities are
-computed throughout the entire spherical volume - note this can greatly
-increase the cost of computation. Otherwise, {Zone} parameters will
-denote the z1=h, z2=k, and z3=l (in a global since) zone axis of an
-intersecting Ewald sphere. Diffraction intensities will only be
-computed at the intersection of the reciprocal lattice mesh and a
-{dR_Ewald} thick surface of the Ewald sphere. See the example 3D
-intestiety data and the intersection of a \[010\] zone axis in the below image.
+The limits of the reciprocal lattice mesh are determined by the use of
+the {Kmax}, {Zone}, and {dR_Ewald} parameters. The rectilinear mesh
+created about the origin of reciprocal space is terminated at the
+boundary of a sphere of radius {Kmax} centered at the origin. If
+{Zone} parameters z1=z2=z3=0 are used, diffraction intensities are
+computed throughout the entire spherical volume - note this can
+greatly increase the cost of computation. Otherwise, {Zone}
+parameters will denote the z1=h, z2=k, and z3=l (in a global since)
+zone axis of an intersecting Ewald sphere. Diffraction intensities
+will only be computed at the intersection of the reciprocal lattice
+mesh and a {dR_Ewald} thick surface of the Ewald sphere. See the
+example 3D intestiety data and the intersection of a \[010\] zone axis
+in the below image.
:c,image(JPG/saed_ewald_intersect_small.jpg,JPG/saed_ewald_intersect.jpg)
The atomic scattering factors, fj, accounts for the reduction in
diffraction intensity due to Compton scattering. Compute saed uses
analytical approximations of the atomic scattering factors that vary
for each atom type (type1 type2 ... typeN) and angle of diffraction.
The analytic approximation is computed using the formula
"(Brown)"_#Brown:
:c,image(Eqs/compute_saed3.jpg)
Coefficients parameterized by "(Fox)"_#Fox are assigned for each
atom type designating the chemical symbol and charge of each atom
type. Valid chemical symbols for compute saed are:
H: He: Li: Be: B:
C: N: O: F: Ne:
Na: Mg: Al: Si: P:
S: Cl: Ar: K: Ca:
Sc: Ti: V: Cr: Mn:
Fe: Co: Ni: Cu: Zn:
Ga: Ge: As: Se: Br:
Kr: Rb: Sr: Y: Zr:
Nb: Mo: Tc: Ru: Rh:
Pd: Ag: Cd: In: Sn:
Sb: Te: I: Xe: Cs:
Ba: La: Ce: Pr: Nd:
Pm: Sm: Eu: Gd: Tb:
Dy: Ho: Er: Tm: Yb:
Lu: Hf: Ta: W: Re:
Os: Ir: Pt: Au: Hg:
Tl: Pb: Bi: Po: At:
Rn: Fr: Ra: Ac: Th:
Pa: U: Np: Pu: Am:
Cm: Bk: Cf:tb(c=5,s=:)
If the {echo} keyword is specified, compute saed will provide extra
reporting information to the screen.
[Output info:]
This compute calculates a global vector. The length of the vector is
the number of reciprocal lattice nodes that are explored by the mesh.
The entries of the global vector are the computed diffraction
intensities as described above.
The vector can be accessed by any command that uses global values
from a compute as input. See "this
section"_Section_howto.html#howto_15 for an overview of LAMMPS output
options.
All array values calculated by this compute are "intensive".
[Restrictions:]
+This compute is part of the USER-DIFFRACTION package. It is only
+enabled if LAMMPS was built with that package. See the "Making
+LAMMPS"_Section_start.html#start_3 section for more info.
+
The compute_saed command does not work for triclinic cells.
[Related commands:]
"fix saed_vtk"_fix_saed_vtk.html, "compute xrd"_compute_xrd.html
[Default:]
The option defaults are Kmax = 1.70, Zone 1 0 0, c 1 1 1, dR_Ewald =
0.01.
:line
:link(Coleman)
[(Coleman)] Coleman, Spearot, Capolungo, MSMSE, 21, 055020
(2013).
:link(Brown)
[(Brown)] Brown et al. International Tables for Crystallography
Volume C: Mathematical and Chemical Tables, 554-95 (2004).
:link(Fox)
[(Fox)] Fox, O'Keefe, Tabbernor, Acta Crystallogr. A, 45, 786-93
(1989).
diff --git a/doc/compute_voronoi_atom.html b/doc/compute_voronoi_atom.html
index aa76aec14..f3e06fbeb 100644
--- a/doc/compute_voronoi_atom.html
+++ b/doc/compute_voronoi_atom.html
@@ -1,348 +1,397 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>compute voronoi/atom command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>compute voronoi/atom command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="compute-voronoi-atom-command">
<span id="index-0"></span><h1>compute voronoi/atom command<a class="headerlink" href="#compute-voronoi-atom-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute ID group-ID voronoi/atom keyword arg ...
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="compute.html"><em>compute</em></a> command</li>
<li>voronoi/atom = style name of this compute command</li>
<li>zero or more keyword/value pairs may be appended</li>
-<li>keyword = <em>only_group</em> or <em>surface</em> or <em>radius</em> or <em>edge_histo</em> or <em>edge_threshold</em> or <em>face_threshold</em></li>
+<li>keyword = <em>only_group</em> or <em>surface</em> or <em>radius</em> or <em>edge_histo</em> or <em>edge_threshold</em>
+or <em>face_threshold</em> or <em>neighbors</em> or <em>peratom</em></li>
</ul>
<pre class="literal-block">
<em>only_group</em> = no arg
<em>occupation</em> = no arg
<em>surface</em> arg = sgroup-ID
sgroup-ID = compute the dividing surface between group-ID and sgroup-ID
this keyword adds a third column to the compute output
<em>radius</em> arg = v_r
v_r = radius atom style variable for a poly-disperse Voronoi tessellation
<em>edge_histo</em> arg = maxedge
maxedge = maximum number of Voronoi cell edges to be accounted in the histogram
<em>edge_threshold</em> arg = minlength
minlength = minimum length for an edge to be counted
<em>face_threshold</em> arg = minarea
minarea = minimum area for a face to be counted
+<em>neighbors</em> value = <em>yes</em> or <em>no</em> = store list of all neighbors or no
+<em>peratom</em> value = <em>yes</em> or <em>no</em> = per-atom quantities accessible or no
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute 1 all voronoi/atom
compute 2 precipitate voronoi/atom surface matrix
compute 3b precipitate voronoi/atom radius v_r
compute 4 solute voronoi/atom only_group
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>compute 5 defects voronoi/atom occupation
</pre></div>
</div>
+<p>compute 6 all voronoi/atom neighbors yes</p>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Define a computation that calculates the Voronoi tessellation of the
atoms in the simulation box. The tessellation is calculated using all
atoms in the simulation, but non-zero values are only stored for atoms
in the group.</p>
-<p>By default two quantities per atom are calculated by this compute.
+<p>By default two per-atom quantities are calculated by this compute.
The first is the volume of the Voronoi cell around each atom. Any
point in an atom&#8217;s Voronoi cell is closer to that atom than any other.
-The second is the number of faces of the Voronoi cell, which is also
-the number of nearest neighbors of the atom in the middle of the cell.</p>
+The second is the number of faces of the Voronoi cell. This is
+equal to the number of nearest neighbors of the central atom,
+plus any exterior faces (see note below). If the <em>peratom</em> keyword
+is set to &#8220;no&#8221;, the per-atom quantities are still calculated,
+but they are not accessible.</p>
<hr class="docutils" />
<p>If the <em>only_group</em> keyword is specified the tessellation is performed
only with respect to the atoms contained in the compute group. This is
equivalent to deleting all atoms not contained in the group prior to
evaluating the tessellation.</p>
<p>If the <em>surface</em> keyword is specified a third quantity per atom is
computed: the Voronoi cell surface of the given atom. <em>surface</em> takes
a group ID as an argument. If a group other than <em>all</em> is specified,
only the Voronoi cell facets facing a neighbor atom from the specified
group are counted towards the surface area.</p>
<p>In the example above, a precipitate embedded in a matrix, only atoms
at the surface of the precipitate will have non-zero surface area, and
only the outward facing facets of the Voronoi cells are counted (the
hull of the precipitate). The total surface area of the precipitate
can be obtained by running a &#8220;reduce sum&#8221; compute on c_2[3]</p>
<p>If the <em>radius</em> keyword is specified with an atom style variable as
the argument, a poly-disperse Voronoi tessellation is
performed. Examples for radius variables are</p>
<div class="highlight-python"><div class="highlight"><pre>variable r1 atom (type==1)*0.1+(type==2)*0.4
compute radius all property/atom radius
variable r2 atom c_radius
</pre></div>
</div>
<p>Here v_r1 specifies a per-type radius of 0.1 units for type 1 atoms
and 0.4 units for type 2 atoms, and v_r2 accesses the radius property
present in atom_style sphere for granular models.</p>
<p>The <em>edge_histo</em> keyword activates the compilation of a histogram of
number of edges on the faces of the Voronoi cells in the compute
-group. The argument maxedge of the this keyword is the largest number
+group. The argument <em>maxedge</em> of the this keyword is the largest number
of edges on a single Voronoi cell face expected to occur in the
sample. This keyword adds the generation of a global vector with
-maxedge+1 entries. The last entry in the vector contains the number of
-faces with with more than maxedge edges. Since the polygon with the
+<em>maxedge*+1 entries. The last entry in the vector contains the number of
+faces with with more than *maxedge</em> edges. Since the polygon with the
smallest amount of edges is a triangle, entries 1 and 2 of the vector
will always be zero.</p>
<p>The <em>edge_threshold</em> and <em>face_threshold</em> keywords allow the
suppression of edges below a given minimum length and faces below a
given minimum area. Ultra short edges and ultra small faces can occur
as artifacts of the Voronoi tessellation. These keywords will affect
the neighbor count and edge histogram outputs.</p>
<p>If the <em>occupation</em> keyword is specified the tessellation is only
performed for the first invocation of the compute and then stored.
For all following invocations of the compute the number of atoms in
each Voronoi cell in the stored tessellation is counted. In this mode
the compute returns a per-atom array with 2 columns. The first column
is the number of atoms currently in the Voronoi volume defined by this
atom at the time of the first invocation of the compute (note that the
atom may have moved significantly). The second column contains the
total number of atoms sharing the Voronoi cell of the stored
tessellation at the location of the current atom. Numbers in column
one can be any positive integer including zero, while column two
values will always be greater than zero. Column one data can be used
to locate vacancies (the coordinates are given by the atom coordinates
at the time step when the compute was first invoked), while column two
data can be used to identify interstitial atoms.</p>
+<p>If the <em>neighbors</em> value is set to yes, then
+this compute creates a local array with 3 columns. There
+is one row for each face of each Voronoi cell. The
+3 columns are the atom ID of the atom that owns the cell,
+the atom ID of the atom in the neighboring cell
+(or zero if the face is external), and the area of the face.
+The array can be accessed by any command that
+uses local values from a compute as input. See <a class="reference internal" href="Section_howto.html#howto-15"><span>this section</span></a> for an overview of LAMMPS output
+options. More specifically, the array can be accessed by a
+<a class="reference internal" href="dump.html"><em>dump local</em></a> command to write a file containing
+all the Voronoi neighbors in a system:</p>
+<div class="highlight-python"><div class="highlight"><pre>compute 6 all voronoi/atom neighbors yes
+dump d2 all local 1 dump.neighbors index c_6[1] c_6[2] c_6[3]
+</pre></div>
+</div>
+<p>If the <em>face_threshold</em> keyword is used, then only faces
+with areas greater than the threshold are stored.</p>
<hr class="docutils" />
<p>The Voronoi calculation is performed by the freely available <a class="reference external" href="http://math.lbl.gov/voro++">Voro++ package</a>, written by Chris Rycroft at UC Berkeley and LBL,
which must be installed on your system when building LAMMPS for use
with this compute. See instructions on obtaining and installing the
Voro++ software in the src/VORONOI/README file.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The calculation of Voronoi volumes is performed by each
processor for the atoms it owns, and includes the effect of ghost
atoms stored by the processor. This assumes that the Voronoi cells of
owned atoms are not affected by atoms beyond the ghost atom cut-off
distance. This is usually a good assumption for liquid and solid
systems, but may lead to underestimation of Voronoi volumes in low
density systems. By default, the set of ghost atoms stored by each
processor is determined by the cutoff used for
<a class="reference internal" href="pair_style.html"><em>pair_style</em></a> interactions. The cutoff can be set
-explicitly via the <a class="reference internal" href="comm_modify.html"><em>comm_modify cutoff</em></a> command.</p>
+explicitly via the <a class="reference internal" href="comm_modify.html"><em>comm_modify cutoff</em></a> command. The
+Voronoi cells for atoms adjacent to empty regions will extend into
+those regions up to the communication cutoff in x, y, or z. In that
+situation, an exterior face is created at the cutoff distance normal
+to the x, y, or z direction. For triclinic systems, the exterior face
+is parallel to the corresponding reciprocal lattice vector.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
-<p class="last">The Voro++ package performs its calculation in 3d. This should
-still work for a 2d LAMMPS simulation, to effectively compute Voronoi
-&#8220;areas&#8221;, so long as the z-dimension of the box is roughly the same (or
-smaller) compared to the separation of the atoms. Typical values for
-the z box dimensions in a 2d LAMMPS model are -0.5 to 0.5, which
-satisfies the criterion for most <a class="reference internal" href="units.html"><em>units</em></a> systems. Note
-that you define the z extent of the simulation box for 2d simulations
-when using the <a class="reference internal" href="create_box.html"><em>create_box</em></a> or
-<a class="reference internal" href="read_data.html"><em>read_data</em></a> commands.</p>
+<p class="last">The Voro++ package performs its calculation in 3d. This will
+still work for a 2d LAMMPS simulation, provided all the atoms have the
+same z coordinate. The Voronoi cell of each atom will be a columnar
+polyhedron with constant cross-sectional area along the z direction
+and two exterior faces at the top and bottom of the simulation box. If
+the atoms do not all have the same z coordinate, then the columnar
+cells will be accordingly distorted. The cross-sectional area of each
+Voronoi cell can be obtained by dividing its volume by the z extent of
+the simulation box. Note that you define the z extent of the
+simulation box for 2d simulations when using the
+<a class="reference internal" href="create_box.html"><em>create_box</em></a> or <a class="reference internal" href="read_data.html"><em>read_data</em></a> commands.</p>
</div>
<p><strong>Output info:</strong></p>
-<p>This compute calculates a per-atom array with 2 columns. In regular
-dynamic tessellation mode the first column is the Voronoi volume, the
-second is the neighbor count, as described above (read above for the
-output data in case the <em>occupation</em> keyword is specified).
-These values can be accessed by any command that
-uses per-atom values from a compute as input. See <a class="reference internal" href="Section_howto.html#howto-15"><span>Section_howto 15</span></a> for an overview of LAMMPS output
-options.</p>
-<p>The Voronoi cell volume will be in distance <a class="reference internal" href="units.html"><em>units</em></a> cubed.</p>
+<p>By default, this compute calculates a per-atom array with 2
+columns. In regular dynamic tessellation mode the first column is the
+Voronoi volume, the second is the neighbor count, as described above
+(read above for the output data in case the <em>occupation</em> keyword is
+specified). These values can be accessed by any command that uses
+per-atom values from a compute as input. See <a class="reference internal" href="Section_howto.html#howto-15"><span>Section_howto 15</span></a> for an overview of LAMMPS output
+options. If the <em>peratom</em> keyword is set to &#8220;no&#8221;, the per-atom array
+is still created, but it is not accessible.</p>
+<p>If the <em>edge_histo</em> keyword is used, then this compute generates a
+global vector of length <a href="#id1"><span class="problematic" id="id2">*</span></a>maxedge*+1, containing a histogram of the
+number of edges per face.</p>
+<p>If the <em>neighbors</em> value is set to yes, then this compute calculates a
+local array with 3 columns. There is one row for each face of each
+Voronoi cell.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Some LAMMPS commands such as the <a class="reference internal" href="compute_reduce.html"><em>compute reduce</em></a> command can accept either a per-atom or
+local quantity. If this compute produces both quantities, the command
+may access the per-atom quantity, even if you want to access the local
+quantity. This effect can be eliminated by using the <em>peratom</em>
+keyword to turn off the production of the per-atom quantities. For
+the default value <em>yes</em> both quantities are produced. For the value
+<em>no</em>, only the local array is produced.</p>
+</div>
+<p>The Voronoi cell volume will be in distance <a class="reference internal" href="units.html"><em>units</em></a> cubed.
+The Voronoi face area will be in distance <a class="reference internal" href="units.html"><em>units</em></a> squared.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>This compute is part of the VORONOI package. It is only enabled if
LAMMPS was built with that package. See the <a class="reference internal" href="Section_start.html#start-3"><span>Making LAMMPS</span></a> section for more info.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
-<p><a class="reference internal" href="dump.html"><em>dump custom</em></a></p>
-<p><strong>Default:</strong> none</p>
+<p><a class="reference internal" href="dump.html"><em>dump custom</em></a>, <a class="reference internal" href="dump.html"><em>dump local</em></a></p>
+<p><strong>Default:</strong> <em>neighbors</em> no, <em>peratom</em> yes</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/compute_voronoi_atom.txt b/doc/compute_voronoi_atom.txt
index e39b97fe9..15fda36c5 100644
--- a/doc/compute_voronoi_atom.txt
+++ b/doc/compute_voronoi_atom.txt
@@ -1,172 +1,224 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute voronoi/atom command :h3
[Syntax:]
compute ID group-ID voronoi/atom keyword arg ... :pre
ID, group-ID are documented in "compute"_compute.html command :ulb,l
voronoi/atom = style name of this compute command :l
zero or more keyword/value pairs may be appended :l
-keyword = {only_group} or {surface} or {radius} or {edge_histo} or {edge_threshold} or {face_threshold} :l
+keyword = {only_group} or {surface} or {radius} or {edge_histo} or {edge_threshold}
+or {face_threshold} or {neighbors} or {peratom} :l
{only_group} = no arg
{occupation} = no arg
{surface} arg = sgroup-ID
sgroup-ID = compute the dividing surface between group-ID and sgroup-ID
this keyword adds a third column to the compute output
{radius} arg = v_r
v_r = radius atom style variable for a poly-disperse Voronoi tessellation
{edge_histo} arg = maxedge
maxedge = maximum number of Voronoi cell edges to be accounted in the histogram
{edge_threshold} arg = minlength
minlength = minimum length for an edge to be counted
{face_threshold} arg = minarea
- minarea = minimum area for a face to be counted :pre
+ minarea = minimum area for a face to be counted
+ {neighbors} value = {yes} or {no} = store list of all neighbors or no
+ {peratom} value = {yes} or {no} = per-atom quantities accessible or no :pre
:ule
[Examples:]
compute 1 all voronoi/atom
compute 2 precipitate voronoi/atom surface matrix
compute 3b precipitate voronoi/atom radius v_r
compute 4 solute voronoi/atom only_group :pre
compute 5 defects voronoi/atom occupation :pre
+compute 6 all voronoi/atom neighbors yes
[Description:]
Define a computation that calculates the Voronoi tessellation of the
atoms in the simulation box. The tessellation is calculated using all
atoms in the simulation, but non-zero values are only stored for atoms
in the group.
-By default two quantities per atom are calculated by this compute.
+By default two per-atom quantities are calculated by this compute.
The first is the volume of the Voronoi cell around each atom. Any
point in an atom's Voronoi cell is closer to that atom than any other.
-The second is the number of faces of the Voronoi cell, which is also
-the number of nearest neighbors of the atom in the middle of the cell.
+The second is the number of faces of the Voronoi cell. This is
+equal to the number of nearest neighbors of the central atom,
+plus any exterior faces (see note below). If the {peratom} keyword
+is set to "no", the per-atom quantities are still calculated,
+but they are not accessible.
:line
If the {only_group} keyword is specified the tessellation is performed
only with respect to the atoms contained in the compute group. This is
equivalent to deleting all atoms not contained in the group prior to
evaluating the tessellation.
If the {surface} keyword is specified a third quantity per atom is
computed: the Voronoi cell surface of the given atom. {surface} takes
a group ID as an argument. If a group other than {all} is specified,
only the Voronoi cell facets facing a neighbor atom from the specified
group are counted towards the surface area.
In the example above, a precipitate embedded in a matrix, only atoms
at the surface of the precipitate will have non-zero surface area, and
only the outward facing facets of the Voronoi cells are counted (the
hull of the precipitate). The total surface area of the precipitate
can be obtained by running a "reduce sum" compute on c_2\[3\]
If the {radius} keyword is specified with an atom style variable as
the argument, a poly-disperse Voronoi tessellation is
performed. Examples for radius variables are
variable r1 atom (type==1)*0.1+(type==2)*0.4
compute radius all property/atom radius
variable r2 atom c_radius :pre
Here v_r1 specifies a per-type radius of 0.1 units for type 1 atoms
and 0.4 units for type 2 atoms, and v_r2 accesses the radius property
present in atom_style sphere for granular models.
The {edge_histo} keyword activates the compilation of a histogram of
number of edges on the faces of the Voronoi cells in the compute
-group. The argument maxedge of the this keyword is the largest number
+group. The argument {maxedge} of the this keyword is the largest number
of edges on a single Voronoi cell face expected to occur in the
sample. This keyword adds the generation of a global vector with
-maxedge+1 entries. The last entry in the vector contains the number of
-faces with with more than maxedge edges. Since the polygon with the
+{maxedge}+1 entries. The last entry in the vector contains the number of
+faces with with more than {maxedge} edges. Since the polygon with the
smallest amount of edges is a triangle, entries 1 and 2 of the vector
will always be zero.
The {edge_threshold} and {face_threshold} keywords allow the
suppression of edges below a given minimum length and faces below a
given minimum area. Ultra short edges and ultra small faces can occur
as artifacts of the Voronoi tessellation. These keywords will affect
the neighbor count and edge histogram outputs.
If the {occupation} keyword is specified the tessellation is only
performed for the first invocation of the compute and then stored.
For all following invocations of the compute the number of atoms in
each Voronoi cell in the stored tessellation is counted. In this mode
the compute returns a per-atom array with 2 columns. The first column
is the number of atoms currently in the Voronoi volume defined by this
atom at the time of the first invocation of the compute (note that the
atom may have moved significantly). The second column contains the
total number of atoms sharing the Voronoi cell of the stored
tessellation at the location of the current atom. Numbers in column
one can be any positive integer including zero, while column two
values will always be greater than zero. Column one data can be used
to locate vacancies (the coordinates are given by the atom coordinates
at the time step when the compute was first invoked), while column two
data can be used to identify interstitial atoms.
+If the {neighbors} value is set to yes, then
+this compute creates a local array with 3 columns. There
+is one row for each face of each Voronoi cell. The
+3 columns are the atom ID of the atom that owns the cell,
+the atom ID of the atom in the neighboring cell
+(or zero if the face is external), and the area of the face.
+The array can be accessed by any command that
+uses local values from a compute as input. See "this
+section"_Section_howto.html#howto_15 for an overview of LAMMPS output
+options. More specifically, the array can be accessed by a
+"dump local"_dump.html command to write a file containing
+all the Voronoi neighbors in a system:
+
+compute 6 all voronoi/atom neighbors yes
+dump d2 all local 1 dump.neighbors index c_6\[1\] c_6\[2\] c_6\[3\] :pre
+
+If the {face_threshold} keyword is used, then only faces
+with areas greater than the threshold are stored.
+
:line
The Voronoi calculation is performed by the freely available "Voro++
package"_voronoi, written by Chris Rycroft at UC Berkeley and LBL,
which must be installed on your system when building LAMMPS for use
with this compute. See instructions on obtaining and installing the
Voro++ software in the src/VORONOI/README file.
:link(voronoi,http://math.lbl.gov/voro++)
NOTE: The calculation of Voronoi volumes is performed by each
processor for the atoms it owns, and includes the effect of ghost
atoms stored by the processor. This assumes that the Voronoi cells of
owned atoms are not affected by atoms beyond the ghost atom cut-off
distance. This is usually a good assumption for liquid and solid
systems, but may lead to underestimation of Voronoi volumes in low
density systems. By default, the set of ghost atoms stored by each
processor is determined by the cutoff used for
"pair_style"_pair_style.html interactions. The cutoff can be set
-explicitly via the "comm_modify cutoff"_comm_modify.html command.
-
-NOTE: The Voro++ package performs its calculation in 3d. This should
-still work for a 2d LAMMPS simulation, to effectively compute Voronoi
-"areas", so long as the z-dimension of the box is roughly the same (or
-smaller) compared to the separation of the atoms. Typical values for
-the z box dimensions in a 2d LAMMPS model are -0.5 to 0.5, which
-satisfies the criterion for most "units"_units.html systems. Note
-that you define the z extent of the simulation box for 2d simulations
-when using the "create_box"_create_box.html or
-"read_data"_read_data.html commands.
+explicitly via the "comm_modify cutoff"_comm_modify.html command. The
+Voronoi cells for atoms adjacent to empty regions will extend into
+those regions up to the communication cutoff in x, y, or z. In that
+situation, an exterior face is created at the cutoff distance normal
+to the x, y, or z direction. For triclinic systems, the exterior face
+is parallel to the corresponding reciprocal lattice vector.
+
+NOTE: The Voro++ package performs its calculation in 3d. This will
+still work for a 2d LAMMPS simulation, provided all the atoms have the
+same z coordinate. The Voronoi cell of each atom will be a columnar
+polyhedron with constant cross-sectional area along the z direction
+and two exterior faces at the top and bottom of the simulation box. If
+the atoms do not all have the same z coordinate, then the columnar
+cells will be accordingly distorted. The cross-sectional area of each
+Voronoi cell can be obtained by dividing its volume by the z extent of
+the simulation box. Note that you define the z extent of the
+simulation box for 2d simulations when using the
+"create_box"_create_box.html or "read_data"_read_data.html commands.
[Output info:]
-This compute calculates a per-atom array with 2 columns. In regular
-dynamic tessellation mode the first column is the Voronoi volume, the
-second is the neighbor count, as described above (read above for the
-output data in case the {occupation} keyword is specified).
-These values can be accessed by any command that
-uses per-atom values from a compute as input. See "Section_howto
+By default, this compute calculates a per-atom array with 2
+columns. In regular dynamic tessellation mode the first column is the
+Voronoi volume, the second is the neighbor count, as described above
+(read above for the output data in case the {occupation} keyword is
+specified). These values can be accessed by any command that uses
+per-atom values from a compute as input. See "Section_howto
15"_Section_howto.html#howto_15 for an overview of LAMMPS output
-options.
+options. If the {peratom} keyword is set to "no", the per-atom array
+is still created, but it is not accessible.
+
+If the {edge_histo} keyword is used, then this compute generates a
+global vector of length {maxedge}+1, containing a histogram of the
+number of edges per face.
+
+If the {neighbors} value is set to yes, then this compute calculates a
+local array with 3 columns. There is one row for each face of each
+Voronoi cell.
+
+NOTE: Some LAMMPS commands such as the "compute
+reduce"_compute_reduce.html command can accept either a per-atom or
+local quantity. If this compute produces both quantities, the command
+may access the per-atom quantity, even if you want to access the local
+quantity. This effect can be eliminated by using the {peratom}
+keyword to turn off the production of the per-atom quantities. For
+the default value {yes} both quantities are produced. For the value
+{no}, only the local array is produced.
The Voronoi cell volume will be in distance "units"_units.html cubed.
+The Voronoi face area will be in distance "units"_units.html squared.
[Restrictions:]
This compute is part of the VORONOI package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
-"dump custom"_dump.html
+"dump custom"_dump.html, "dump local"_dump.html
-[Default:] none
+[Default:] {neighbors} no, {peratom} yes
diff --git a/doc/compute_xrd.html b/doc/compute_xrd.html
index 0a3b327b6..1207b657d 100644
--- a/doc/compute_xrd.html
+++ b/doc/compute_xrd.html
@@ -1,390 +1,392 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>compute xrd command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>compute xrd command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="compute-xrd-command">
<span id="index-0"></span><h1>compute xrd command<a class="headerlink" href="#compute-xrd-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute ID group-ID xrd lambda type1 type2 ... typeN keyword value ...
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="compute.html"><em>compute</em></a> command</li>
<li>xrd = style name of this compute command</li>
<li>lambda = wavelength of incident radiation (length units)</li>
<li>type1 type2 ... typeN = chemical symbol of each atom type (see valid options below)</li>
<li>zero or more keyword/value pairs may be appended</li>
<li>keyword = <em>2Theta</em> or <em>c</em> or <em>LP</em> or <em>manual</em> or <em>echo</em></li>
</ul>
<pre class="literal-block">
<em>2Theta</em> values = Min2Theta Max2Theta
Min2Theta,Max2Theta = minimum and maximum 2 theta range to explore
(radians or degrees)
<em>c</em> values = c1 c2 c3
c1,c2,c3 = parameters to adjust the spacing of the reciprocal
lattice nodes in the h, k, and l directions respectively
<em>LP</em> value = switch to apply Lorentz-polarization factor
0/1 = off/on
<em>manual</em> = flag to use manual spacing of reciprocal lattice points
based on the values of the <em>c</em> parameters
<em>echo</em> = flag to provide extra output for debugging purposes
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>compute 1 all xrd 1.541838 Al O 2Theta 0.087 0.87 c 1 1 1 LP 1 echo
compute 2 all xrd 1.541838 Al O 2Theta 10 100 c 0.05 0.05 0.05 LP 1 manual
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>fix 1 all ave/histo/weight 1 1 1 0.087 0.87 250 c_1[1] c_1[2] mode vector file Rad2Theta.xrd
fix 2 all ave/histo/weight 1 1 1 10 100 250 c_2[1] c_2[2] mode vector file Deg2Theta.xrd
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Define a computation that calculates x-ray diffraction intensity as described
in <a class="reference internal" href="fix_saed_vtk.html#coleman"><span>(Coleman)</span></a> on a mesh of reciprocal lattice nodes defined
by the entire simulation domain (or manually) using a simulated radiation
of wavelength lambda.</p>
<p>The x-ray diffraction intensity, I, at each reciprocal lattice point, k,
is computed from the structure factor, F, using the equations:</p>
<img alt="_images/compute_xrd1.jpg" class="align-center" src="_images/compute_xrd1.jpg" />
<img alt="_images/compute_xrd2.jpg" class="align-center" src="_images/compute_xrd2.jpg" />
<img alt="_images/compute_xrd3.jpg" class="align-center" src="_images/compute_xrd3.jpg" />
<img alt="_images/compute_xrd4.jpg" class="align-center" src="_images/compute_xrd4.jpg" />
<p>Here, K is the location of the reciprocal lattice node, rj is the
position of each atom, fj are atomic scattering factors, LP is the
Lorentz-polarization factor, and theta is the scattering angle of
diffraction. The Lorentz-polarization factor can be turned off using
the optional <em>LP</em> keyword.</p>
<p>Diffraction intensities are calculated on a three-dimensional mesh of
reciprocal lattice nodes. The mesh spacing is defined either (a)
by the entire simulation domain or (b) manually using selected values as
shown in the 2D diagram below.</p>
<a data-lightbox="group-default"
href="_images/xrd_mesh.jpg"
class=""
title=""
data-title=""
><img src="_images/xrd_mesh.jpg"
class="align-center"
width="25%"
height="auto"
alt=""/>
</a><p>For a mesh defined by the simulation domain, a rectilinear grid is
constructed with spacing <a href="#id1"><span class="problematic" id="id2">*</span></a>c**inv(A) along each reciprocal lattice
axis. Where A are the vectors corresponding to the edges of the
simulation cell. If one or two directions has non-periodic boundary
conditions, then the spacing in these directions is defined from the
average of the (inversed) box lengths with periodic boundary conditions.
Meshes defined by the simulation domain must contain at least one periodic
boundary.</p>
<p>If the <em>manual</em> flag is included, the mesh of reciprocal lattice nodes
will defined using the <em>c</em> values for the spacing along each
reciprocal lattice axis. Note that manual mapping of the reciprocal
space mesh is good for comparing diffraction results from multiple
simulations; however it can reduce the likelihood that Bragg
reflections will be satisfied unless small spacing parameters (&lt; 0.05
Angstrom^(-1)) are implemented. Meshes with manual spacing do not
require a periodic boundary.</p>
<p>The limits of the reciprocal lattice mesh are determined by range of
scattering angles explored. The <em>2Theta</em> parameters allows the user
to reduce the scattering angle range to only the region of interest
which reduces the cost of the computation.</p>
<p>The atomic scattering factors, fj, accounts for the reduction in
diffraction intensity due to Compton scattering. Compute xrd uses
analytical approximations of the atomic scattering factors that vary
for each atom type (type1 type2 ... typeN) and angle of diffraction.
The analytic approximation is computed using the formula
<a class="reference internal" href="#colliex"><span>(Colliex)</span></a>:</p>
<img alt="_images/compute_xrd5.jpg" class="align-center" src="_images/compute_xrd5.jpg" />
<p>Coefficients parameterized by <a class="reference internal" href="#peng"><span>(Peng)</span></a> are assigned for each
atom type designating the chemical symbol and charge of each atom
type. Valid chemical symbols for compute xrd are:</p>
<dl class="docutils">
<dt>H: He1-: He: Li: Li1+:</dt>
<dd><blockquote class="first">
<div><blockquote>
<div><dl class="docutils">
<dt>Be: Be2+: B: C: Cval:</dt>
<dd>N: O: O1-: F: F1-:</dd>
</dl>
<p>Ne: Na: Na1+: Mg: Mg2+:
Al: Al3+: Si: Sival: Si4+:</p>
<blockquote>
<div>P: S: Cl: Cl1-: Ar:
K: Ca: Ca2+: Sc: Sc3+:</div></blockquote>
<p>Ti: Ti2+: Ti3+: Ti4+: V:</p>
</div></blockquote>
<p>V2+: V3+: V5+: Cr: Cr2+:</p>
</div></blockquote>
<dl class="docutils">
<dt>Cr3+: Mn: Mn2+: Mn3+: Mn4+:</dt>
<dd>Fe: Fe2+: Fe3+: Co: Co2+:
Co: Ni: Ni2+: Ni3+: Cu:</dd>
</dl>
<p>Cu1+: Cu2+: Zn: Zn2+: Ga:
Ga3+: Ge: Ge4+: As: Se:</p>
<blockquote>
<div>Br: Br1-: Kr: Rb: Rb1+:
Sr: Sr2+: Y: Y3+: Zr:</div></blockquote>
<p>Zr4+: Nb: Nb3+: Nb5+: Mo:
Mo3+: Mo5+: Mo6+: Tc: Ru:
Ru3+: Ru4+: Rh: Rh3+: Rh4+:</p>
<blockquote>
<div>Pd: Pd2+: Pd4+: Ag: Ag1+:</div></blockquote>
<dl class="docutils">
<dt>Ag2+: Cd: Cd2+: In: In3+:</dt>
<dd>Sn: Sn2+: Sn4+: Sb: Sb3+:</dd>
<dt>Sb5+: Te: I: I1-: Xe:</dt>
<dd>Cs: Cs1+: Ba: Ba2+: La:</dd>
</dl>
<p>La3+: Ce: Ce3+: Ce4+: Pr:
Pr3+: Pr4+: Nd: Nd3+: Pm:
Pm3+: Sm: Sm3+: Eu: Eu2+:
Eu3+: Gd: Gd3+: Tb: Tb3+:</p>
<blockquote>
<div>Dy: Dy3+: Ho: Ho3+: Er:</div></blockquote>
<p>Er3+: Tm: Tm3+: Yb: Yb2+:
Yb3+: Lu: Lu3+: Hf: Hf4+:</p>
<blockquote>
<div>Ta: Ta5+: W: W6+: Re:
Os: Os4+: Ir: Ir3+: Ir4+:
Pt: Pt2+: Pt4+: Au: Au1+:</div></blockquote>
<p>Au3+: Hg: Hg1+: Hg2+: Tl:
Tl1+: Tl3+: Pb: Pb2+: Pb4+:</p>
<blockquote>
<div>Bi: Bi3+: Bi5+: Po: At:
Rn: Fr: Ra: Ra2+: Ac:</div></blockquote>
<dl class="docutils">
<dt>Ac3+: Th: Th4+: Pa: U:</dt>
<dd>U3+: U4+: U6+: Np: Np3+:</dd>
</dl>
<p class="last">Np4+: Np6+: Pu: Pu3+: Pu4+:
Pu6+: Am: Cm: Bk: Cf:tb(c=5,s=:)</p>
</dd>
</dl>
<p>If the <em>echo</em> keyword is specified, compute xrd will provide extra
reporting information to the screen.</p>
<p><strong>Output info:</strong></p>
<p>This compute calculates a global array. The number of rows in the
array is the number of reciprocal lattice nodes that are explored
which by the mesh. The global array has 2 columns.</p>
<p>The first column contains the diffraction angle in the units (radians
or degrees) provided with the <em>2Theta</em> values. The second column contains
the computed diffraction intensities as described above.</p>
-<p>The array can be accessed by any command that uses global values
-from a compute as input. See <a class="reference internal" href="Section_howto.html#howto-15"><span>this section</span></a> for an overview of LAMMPS output
-options.</p>
+<p>The array can be accessed by any command that uses global values from
+a compute as input. See <a class="reference internal" href="Section_howto.html#howto-15"><span>this section</span></a>
+for an overview of LAMMPS output options.</p>
<p>All array values calculated by this compute are &#8220;intensive&#8221;.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
+<p>This compute is part of the USER-DIFFRACTION package. It is only
+enabled if LAMMPS was built with that package. See the <a class="reference internal" href="Section_start.html#start-3"><span>Making LAMMPS</span></a> section for more info.</p>
<p>The compute_xrd command does not work for triclinic cells.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="fix_ave_histo.html"><em>fix ave/histo</em></a>,
<a class="reference internal" href="compute_saed.html"><em>compute saed</em></a></p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<p>The option defaults are 2Theta = 1 179 (degrees), c = 1 1 1, LP = 1,
no manual flag, no echo flag.</p>
<hr class="docutils" />
<p id="coleman"><strong>(Coleman)</strong> Coleman, Spearot, Capolungo, MSMSE, 21, 055020
(2013).</p>
<p id="colliex"><strong>(Colliex)</strong> Colliex et al. International Tables for Crystallography
Volume C: Mathematical and Chemical Tables, 249-429 (2004).</p>
<p id="peng"><strong>(Peng)</strong> Peng, Ren, Dudarev, Whelan, Acta Crystallogr. A, 52, 257-76
(1996).</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/compute_xrd.txt b/doc/compute_xrd.txt
index a59f2201d..61b86c557 100644
--- a/doc/compute_xrd.txt
+++ b/doc/compute_xrd.txt
@@ -1,200 +1,204 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute xrd command :h3
[Syntax:]
compute ID group-ID xrd lambda type1 type2 ... typeN keyword value ... :pre
ID, group-ID are documented in "compute"_compute.html command :ulb,l
xrd = style name of this compute command :l
lambda = wavelength of incident radiation (length units) :l
type1 type2 ... typeN = chemical symbol of each atom type (see valid options below) :l
zero or more keyword/value pairs may be appended :l
keyword = {2Theta} or {c} or {LP} or {manual} or {echo} :l
{2Theta} values = Min2Theta Max2Theta
Min2Theta,Max2Theta = minimum and maximum 2 theta range to explore
(radians or degrees)
{c} values = c1 c2 c3
c1,c2,c3 = parameters to adjust the spacing of the reciprocal
lattice nodes in the h, k, and l directions respectively
{LP} value = switch to apply Lorentz-polarization factor
0/1 = off/on
{manual} = flag to use manual spacing of reciprocal lattice points
based on the values of the {c} parameters
{echo} = flag to provide extra output for debugging purposes :pre
:ule
[Examples:]
compute 1 all xrd 1.541838 Al O 2Theta 0.087 0.87 c 1 1 1 LP 1 echo
compute 2 all xrd 1.541838 Al O 2Theta 10 100 c 0.05 0.05 0.05 LP 1 manual :pre
fix 1 all ave/histo/weight 1 1 1 0.087 0.87 250 c_1\[1\] c_1\[2\] mode vector file Rad2Theta.xrd
fix 2 all ave/histo/weight 1 1 1 10 100 250 c_2\[1\] c_2\[2\] mode vector file Deg2Theta.xrd :pre
:pre
[Description:]
Define a computation that calculates x-ray diffraction intensity as described
in "(Coleman)"_#Coleman on a mesh of reciprocal lattice nodes defined
by the entire simulation domain (or manually) using a simulated radiation
of wavelength lambda.
The x-ray diffraction intensity, I, at each reciprocal lattice point, k,
is computed from the structure factor, F, using the equations:
:c,image(Eqs/compute_xrd1.jpg)
:c,image(Eqs/compute_xrd2.jpg)
:c,image(Eqs/compute_xrd3.jpg)
:c,image(Eqs/compute_xrd4.jpg)
Here, K is the location of the reciprocal lattice node, rj is the
position of each atom, fj are atomic scattering factors, LP is the
Lorentz-polarization factor, and theta is the scattering angle of
diffraction. The Lorentz-polarization factor can be turned off using
the optional {LP} keyword.
Diffraction intensities are calculated on a three-dimensional mesh of
reciprocal lattice nodes. The mesh spacing is defined either (a)
by the entire simulation domain or (b) manually using selected values as
shown in the 2D diagram below.
:c,image(JPG/xrd_mesh_small.jpg,JPG/xrd_mesh.jpg)
For a mesh defined by the simulation domain, a rectilinear grid is
constructed with spacing {c}*inv(A) along each reciprocal lattice
axis. Where A are the vectors corresponding to the edges of the
simulation cell. If one or two directions has non-periodic boundary
conditions, then the spacing in these directions is defined from the
average of the (inversed) box lengths with periodic boundary conditions.
Meshes defined by the simulation domain must contain at least one periodic
boundary.
If the {manual} flag is included, the mesh of reciprocal lattice nodes
will defined using the {c} values for the spacing along each
reciprocal lattice axis. Note that manual mapping of the reciprocal
space mesh is good for comparing diffraction results from multiple
simulations; however it can reduce the likelihood that Bragg
reflections will be satisfied unless small spacing parameters (< 0.05
Angstrom^(-1)) are implemented. Meshes with manual spacing do not
require a periodic boundary.
The limits of the reciprocal lattice mesh are determined by range of
scattering angles explored. The {2Theta} parameters allows the user
to reduce the scattering angle range to only the region of interest
which reduces the cost of the computation.
The atomic scattering factors, fj, accounts for the reduction in
diffraction intensity due to Compton scattering. Compute xrd uses
analytical approximations of the atomic scattering factors that vary
for each atom type (type1 type2 ... typeN) and angle of diffraction.
The analytic approximation is computed using the formula
"(Colliex)"_#Colliex:
:c,image(Eqs/compute_xrd5.jpg)
Coefficients parameterized by "(Peng)"_#Peng are assigned for each
atom type designating the chemical symbol and charge of each atom
type. Valid chemical symbols for compute xrd are:
H: He1-: He: Li: Li1+:
Be: Be2+: B: C: Cval:
N: O: O1-: F: F1-:
Ne: Na: Na1+: Mg: Mg2+:
Al: Al3+: Si: Sival: Si4+:
P: S: Cl: Cl1-: Ar:
K: Ca: Ca2+: Sc: Sc3+:
Ti: Ti2+: Ti3+: Ti4+: V:
V2+: V3+: V5+: Cr: Cr2+:
Cr3+: Mn: Mn2+: Mn3+: Mn4+:
Fe: Fe2+: Fe3+: Co: Co2+:
Co: Ni: Ni2+: Ni3+: Cu:
Cu1+: Cu2+: Zn: Zn2+: Ga:
Ga3+: Ge: Ge4+: As: Se:
Br: Br1-: Kr: Rb: Rb1+:
Sr: Sr2+: Y: Y3+: Zr:
Zr4+: Nb: Nb3+: Nb5+: Mo:
Mo3+: Mo5+: Mo6+: Tc: Ru:
Ru3+: Ru4+: Rh: Rh3+: Rh4+:
Pd: Pd2+: Pd4+: Ag: Ag1+:
Ag2+: Cd: Cd2+: In: In3+:
Sn: Sn2+: Sn4+: Sb: Sb3+:
Sb5+: Te: I: I1-: Xe:
Cs: Cs1+: Ba: Ba2+: La:
La3+: Ce: Ce3+: Ce4+: Pr:
Pr3+: Pr4+: Nd: Nd3+: Pm:
Pm3+: Sm: Sm3+: Eu: Eu2+:
Eu3+: Gd: Gd3+: Tb: Tb3+:
Dy: Dy3+: Ho: Ho3+: Er:
Er3+: Tm: Tm3+: Yb: Yb2+:
Yb3+: Lu: Lu3+: Hf: Hf4+:
Ta: Ta5+: W: W6+: Re:
Os: Os4+: Ir: Ir3+: Ir4+:
Pt: Pt2+: Pt4+: Au: Au1+:
Au3+: Hg: Hg1+: Hg2+: Tl:
Tl1+: Tl3+: Pb: Pb2+: Pb4+:
Bi: Bi3+: Bi5+: Po: At:
Rn: Fr: Ra: Ra2+: Ac:
Ac3+: Th: Th4+: Pa: U:
U3+: U4+: U6+: Np: Np3+:
Np4+: Np6+: Pu: Pu3+: Pu4+:
Pu6+: Am: Cm: Bk: Cf:tb(c=5,s=:)
If the {echo} keyword is specified, compute xrd will provide extra
reporting information to the screen.
[Output info:]
This compute calculates a global array. The number of rows in the
array is the number of reciprocal lattice nodes that are explored
which by the mesh. The global array has 2 columns.
The first column contains the diffraction angle in the units (radians
or degrees) provided with the {2Theta} values. The second column contains
the computed diffraction intensities as described above.
-The array can be accessed by any command that uses global values
-from a compute as input. See "this section"_Section_howto.html#howto_15 for an overview of LAMMPS output
-options.
+The array can be accessed by any command that uses global values from
+a compute as input. See "this section"_Section_howto.html#howto_15
+for an overview of LAMMPS output options.
All array values calculated by this compute are "intensive".
[Restrictions:]
+This compute is part of the USER-DIFFRACTION package. It is only
+enabled if LAMMPS was built with that package. See the "Making
+LAMMPS"_Section_start.html#start_3 section for more info.
+
The compute_xrd command does not work for triclinic cells.
[Related commands:]
"fix ave/histo"_fix_ave_histo.html,
"compute saed"_compute_saed.html
[Default:]
The option defaults are 2Theta = 1 179 (degrees), c = 1 1 1, LP = 1,
no manual flag, no echo flag.
:line
:link(Coleman)
[(Coleman)] Coleman, Spearot, Capolungo, MSMSE, 21, 055020
(2013).
:link(Colliex)
[(Colliex)] Colliex et al. International Tables for Crystallography
Volume C: Mathematical and Chemical Tables, 249-429 (2004).
:link(Peng)
[(Peng)] Peng, Ren, Dudarev, Whelan, Acta Crystallogr. A, 52, 257-76
(1996).
diff --git a/doc/delete_bonds.html b/doc/delete_bonds.html
index 48266c162..9eded4610 100644
--- a/doc/delete_bonds.html
+++ b/doc/delete_bonds.html
@@ -1,328 +1,333 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>delete_bonds command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>delete_bonds command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="delete-bonds-command">
<span id="index-0"></span><h1>delete_bonds command<a class="headerlink" href="#delete-bonds-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>delete_bonds group-ID style arg keyword ...
</pre></div>
</div>
<ul>
<li><p class="first">group-ID = group ID</p>
</li>
<li><dl class="first docutils">
<dt>style = <em>multi</em> or <em>atom</em> or <em>bond</em> or <em>angle</em> or <em>dihedral</em> or</dt>
<dd><p class="first last"><em>improper</em> or <em>stats</em></p>
</dd>
</dl>
</li>
</ul>
<pre class="literal-block">
<em>multi</em> arg = none
<em>atom</em> arg = an atom type or range of types (see below)
<em>bond</em> arg = a bond type or range of types (see below)
<em>angle</em> arg = an angle type or range of types (see below)
<em>dihedral</em> arg = a dihedral type or range of types (see below)
<em>improper</em> arg = an improper type or range of types (see below)
<em>stats</em> arg = none
</pre>
<ul class="simple">
<li>zero or more keywords may be appended</li>
<li>keyword = <em>any</em> or <em>undo</em> or <em>remove</em> or <em>special</em></li>
</ul>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>delete_bonds frozen multi remove
delete_bonds all atom 4 special
delete_bonds all bond 0*3 special
delete_bonds all stats
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Turn off (or on) molecular topology interactions, i.e. bonds, angles,
dihedrals, impropers. This command is useful for deleting
interactions that have been previously turned off by bond-breaking
potentials. It is also useful for turning off topology interactions
between frozen or rigid atoms. Pairwise interactions can be turned
off via the <a class="reference internal" href="neigh_modify.html"><em>neigh_modify exclude</em></a> command. The
<a class="reference internal" href="fix_shake.html"><em>fix shake</em></a> command also effectively turns off certain
bond and angle interactions.</p>
<p>For all styles, by default, an interaction is only turned off (or on)
if all the atoms involved are in the specified group. See the <em>any</em>
keyword to change the behavior.</p>
<p>Several of the styles (<em>atom</em>, <em>bond</em>, <em>angle</em>, <em>dihedral</em>,
<em>improper</em>) take a <em>type</em> as an argument. The specified <em>type</em> should
be an integer from 0 to N, where N is the number of relevant types
(atom types, bond types, etc). A value of 0 is only relevant for
style <em>bond</em>; see details below. In all cases, a wildcard asterisk
can be used in place of or in conjunction with the <em>type</em> argument to
specify a range of types. This takes the form &#8220;*&#8221; or &#8220;<em>n&#8221; or &#8220;n</em>&#8221; or
&#8220;m*n&#8221;. If N = the number of types, then an asterisk with no numeric
values means all types from 0 to N. A leading asterisk means all
types from 0 to n (inclusive). A trailing asterisk means all types
from n to N (inclusive). A middle asterisk means all types from m to
n (inclusive). Note that it is fine to include a type of 0 for
non-bond styles; it will simply be ignored.</p>
<p>For style <em>multi</em> all bond, angle, dihedral, and improper interactions
of any type, involving atoms in the group, are turned off.</p>
<p>Style <em>atom</em> is the same as style <em>multi</em> except that in addition, one
or more of the atoms involved in the bond, angle, dihedral, or
improper interaction must also be of the specified atom type.</p>
<p>For style <em>bond</em>, only bonds are candidates for turn-off, and the bond
must also be of the specified type. Styles <em>angle</em>, <em>dihedral</em>, and
<em>improper</em> are treated similarly.</p>
<p>For style <em>bond</em>, you can set the type to 0 to delete bonds that have
been previously broken by a bond-breaking potential (which sets the
bond type to 0 when a bond is broken); e.g. see the <a class="reference internal" href="bond_style.html"><em>bond_style quartic</em></a> command.</p>
<p>For style <em>stats</em> no interactions are turned off (or on); the status
of all interactions in the specified group is simply reported. This
is useful for diagnostic purposes if bonds have been turned off by a
bond-breaking potential during a previous run.</p>
<p>The default behavior of the delete_bonds command is to turn off
interactions by toggling their type to a negative value, but not to
permanently remove the interaction. E.g. a bond_type of 2 is set to
-2. The neighbor list creation routines will not include such an
interaction in their interaction lists. The default is also to not
alter the list of 1-2, 1-3, 1-4 neighbors computed by the
<a class="reference internal" href="special_bonds.html"><em>special_bonds</em></a> command and used to weight pairwise
force and energy calculations. This means that pairwise computations
will proceed as if the bond (or angle, etc) were still turned on.</p>
<p>Several keywords can be appended to the argument list to alter the
default behaviors.</p>
<p>The <em>any</em> keyword changes the requirement that all atoms in the bond
(angle, etc) must be in the specified group in order to turn-off the
interaction. Instead, if any of the atoms in the interaction are in
the specified group, it will be turned off (or on if the <em>undo</em>
keyword is used).</p>
<p>The <em>undo</em> keyword inverts the delete_bonds command so that the
specified bonds, angles, etc are turned on if they are currently
turned off. This means a negative value is toggled to positive. For
example, for style <em>angle</em>, if <em>type</em> is specified as 2, then all
angles with current type = -2, are reset to type = 2. Note that the
<a class="reference internal" href="fix_shake.html"><em>fix shake</em></a> command also sets bond and angle types
negative, so this option should not be used on those interactions.</p>
<p>The <em>remove</em> keyword is invoked at the end of the delete_bonds
operation. It causes turned-off bonds (angles, etc) to be removed
from each atom&#8217;s data structure and then adjusts the global bond
(angle, etc) counts accordingly. Removal is a permanent change;
removed bonds cannot be turned back on via the <em>undo</em> keyword.
Removal does not alter the pairwise 1-2, 1-3, 1-4 weighting list.</p>
<p>The <em>special</em> keyword is invoked at the end of the delete_bonds
operation, after (optional) removal. It re-computes the pairwise 1-2,
1-3, 1-4 weighting list. The weighting list computation treats
turned-off bonds the same as turned-on. Thus, turned-off bonds must
be removed if you wish to change the weighting list.</p>
<p>Note that the choice of <em>remove</em> and <em>special</em> options affects how
1-2, 1-3, 1-4 pairwise interactions will be computed across bonds that
have been modified by the delete_bonds command.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
-<p>This command requires inter-processor communication to coordinate the
-deleting of bonds. This means that your system must be ready to
-perform a simulation before using this command (force fields setup,
-atom masses set, etc).</p>
+<p>This command requires inter-processor communication to acquire ghost
+atoms, to coordinate the deleting of bonds, angles, etc between atoms
+shared by multiple processors. This means that your system must be
+ready to perform a simulation before using this command (force fields
+setup, atom masses set, etc). Just as would be needed to run
+dynamics, the force field you define should define a cutoff
+(e.g. through a <a class="reference internal" href="pair_style.html"><em>pair_style</em></a> command) which is long
+enough for a processor to acquire the ghost atoms its needs to compute
+bond, angle, etc interactions.</p>
<p>If deleted bonds (angles, etc) are removed but the 1-2, 1-3, 1-4
weighting list is not recomputed, this can cause a later <a class="reference internal" href="fix_shake.html"><em>fix shake</em></a> command to fail due to an atom&#8217;s bonds being
inconsistent with the weighting list. This should only happen if the
group used in the fix command includes both atoms in the bond, in
which case you probably should be recomputing the weighting list.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="neigh_modify.html"><em>neigh_modify</em></a> exclude,
<a class="reference internal" href="special_bonds.html"><em>special_bonds</em></a>, <a class="reference internal" href="fix_shake.html"><em>fix shake</em></a></p>
<p><strong>Default:</strong> none</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/delete_bonds.txt b/doc/delete_bonds.txt
index ceec0695b..ddd03626b 100644
--- a/doc/delete_bonds.txt
+++ b/doc/delete_bonds.txt
@@ -1,149 +1,154 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
delete_bonds command :h3
[Syntax:]
delete_bonds group-ID style arg keyword ... :pre
group-ID = group ID :ulb,l
style = {multi} or {atom} or {bond} or {angle} or {dihedral} or
{improper} or {stats} :l
{multi} arg = none
{atom} arg = an atom type or range of types (see below)
{bond} arg = a bond type or range of types (see below)
{angle} arg = an angle type or range of types (see below)
{dihedral} arg = a dihedral type or range of types (see below)
{improper} arg = an improper type or range of types (see below)
{stats} arg = none :pre
zero or more keywords may be appended :l
keyword = {any} or {undo} or {remove} or {special} :l
:ule
[Examples:]
delete_bonds frozen multi remove
delete_bonds all atom 4 special
delete_bonds all bond 0*3 special
delete_bonds all stats :pre
[Description:]
Turn off (or on) molecular topology interactions, i.e. bonds, angles,
dihedrals, impropers. This command is useful for deleting
interactions that have been previously turned off by bond-breaking
potentials. It is also useful for turning off topology interactions
between frozen or rigid atoms. Pairwise interactions can be turned
off via the "neigh_modify exclude"_neigh_modify.html command. The
"fix shake"_fix_shake.html command also effectively turns off certain
bond and angle interactions.
For all styles, by default, an interaction is only turned off (or on)
if all the atoms involved are in the specified group. See the {any}
keyword to change the behavior.
Several of the styles ({atom}, {bond}, {angle}, {dihedral},
{improper}) take a {type} as an argument. The specified {type} should
be an integer from 0 to N, where N is the number of relevant types
(atom types, bond types, etc). A value of 0 is only relevant for
style {bond}; see details below. In all cases, a wildcard asterisk
can be used in place of or in conjunction with the {type} argument to
specify a range of types. This takes the form "*" or "*n" or "n*" or
"m*n". If N = the number of types, then an asterisk with no numeric
values means all types from 0 to N. A leading asterisk means all
types from 0 to n (inclusive). A trailing asterisk means all types
from n to N (inclusive). A middle asterisk means all types from m to
n (inclusive). Note that it is fine to include a type of 0 for
non-bond styles; it will simply be ignored.
For style {multi} all bond, angle, dihedral, and improper interactions
of any type, involving atoms in the group, are turned off.
Style {atom} is the same as style {multi} except that in addition, one
or more of the atoms involved in the bond, angle, dihedral, or
improper interaction must also be of the specified atom type.
For style {bond}, only bonds are candidates for turn-off, and the bond
must also be of the specified type. Styles {angle}, {dihedral}, and
{improper} are treated similarly.
For style {bond}, you can set the type to 0 to delete bonds that have
been previously broken by a bond-breaking potential (which sets the
bond type to 0 when a bond is broken); e.g. see the "bond_style
quartic"_bond_style.html command.
For style {stats} no interactions are turned off (or on); the status
of all interactions in the specified group is simply reported. This
is useful for diagnostic purposes if bonds have been turned off by a
bond-breaking potential during a previous run.
The default behavior of the delete_bonds command is to turn off
interactions by toggling their type to a negative value, but not to
permanently remove the interaction. E.g. a bond_type of 2 is set to
-2. The neighbor list creation routines will not include such an
interaction in their interaction lists. The default is also to not
alter the list of 1-2, 1-3, 1-4 neighbors computed by the
"special_bonds"_special_bonds.html command and used to weight pairwise
force and energy calculations. This means that pairwise computations
will proceed as if the bond (or angle, etc) were still turned on.
Several keywords can be appended to the argument list to alter the
default behaviors.
The {any} keyword changes the requirement that all atoms in the bond
(angle, etc) must be in the specified group in order to turn-off the
interaction. Instead, if any of the atoms in the interaction are in
the specified group, it will be turned off (or on if the {undo}
keyword is used).
The {undo} keyword inverts the delete_bonds command so that the
specified bonds, angles, etc are turned on if they are currently
turned off. This means a negative value is toggled to positive. For
example, for style {angle}, if {type} is specified as 2, then all
angles with current type = -2, are reset to type = 2. Note that the
"fix shake"_fix_shake.html command also sets bond and angle types
negative, so this option should not be used on those interactions.
The {remove} keyword is invoked at the end of the delete_bonds
operation. It causes turned-off bonds (angles, etc) to be removed
from each atom's data structure and then adjusts the global bond
(angle, etc) counts accordingly. Removal is a permanent change;
removed bonds cannot be turned back on via the {undo} keyword.
Removal does not alter the pairwise 1-2, 1-3, 1-4 weighting list.
The {special} keyword is invoked at the end of the delete_bonds
operation, after (optional) removal. It re-computes the pairwise 1-2,
1-3, 1-4 weighting list. The weighting list computation treats
turned-off bonds the same as turned-on. Thus, turned-off bonds must
be removed if you wish to change the weighting list.
Note that the choice of {remove} and {special} options affects how
1-2, 1-3, 1-4 pairwise interactions will be computed across bonds that
have been modified by the delete_bonds command.
[Restrictions:]
-This command requires inter-processor communication to coordinate the
-deleting of bonds. This means that your system must be ready to
-perform a simulation before using this command (force fields setup,
-atom masses set, etc).
+This command requires inter-processor communication to acquire ghost
+atoms, to coordinate the deleting of bonds, angles, etc between atoms
+shared by multiple processors. This means that your system must be
+ready to perform a simulation before using this command (force fields
+setup, atom masses set, etc). Just as would be needed to run
+dynamics, the force field you define should define a cutoff
+(e.g. through a "pair_style"_pair_style.html command) which is long
+enough for a processor to acquire the ghost atoms its needs to compute
+bond, angle, etc interactions.
If deleted bonds (angles, etc) are removed but the 1-2, 1-3, 1-4
weighting list is not recomputed, this can cause a later "fix
shake"_fix_shake.html command to fail due to an atom's bonds being
inconsistent with the weighting list. This should only happen if the
group used in the fix command includes both atoms in the bond, in
which case you probably should be recomputing the weighting list.
[Related commands:]
"neigh_modify"_neigh_modify.html exclude,
"special_bonds"_special_bonds.html, "fix shake"_fix_shake.html
[Default:] none
diff --git a/doc/displace_atoms.html b/doc/displace_atoms.html
index 727f55007..86c82fbf2 100644
--- a/doc/displace_atoms.html
+++ b/doc/displace_atoms.html
@@ -1,323 +1,327 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>displace_atoms command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>displace_atoms command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="displace-atoms-command">
<span id="index-0"></span><h1>displace_atoms command<a class="headerlink" href="#displace-atoms-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>displace_atoms group-ID style args keyword value ...
</pre></div>
</div>
<ul class="simple">
<li>group-ID = ID of group of atoms to displace</li>
<li>style = <em>move</em> or <em>ramp</em> or <em>random</em> or <em>rotate</em></li>
</ul>
<pre class="literal-block">
<em>move</em> args = delx dely delz
delx,dely,delz = distance to displace in each dimension (distance units)
any of delx,dely,delz can be a variable (see below)
<em>ramp</em> args = ddim dlo dhi dim clo chi
ddim = <em>x</em> or <em>y</em> or <em>z</em>
dlo,dhi = displacement distance between dlo and dhi (distance units)
dim = <em>x</em> or <em>y</em> or <em>z</em>
clo,chi = lower and upper bound of domain to displace (distance units)
<em>random</em> args = dx dy dz seed
dx,dy,dz = random displacement magnitude in each dimension (distance units)
seed = random # seed (positive integer)
<em>rotate</em> args = Px Py Pz Rx Ry Rz theta
Px,Py,Pz = origin point of axis of rotation (distance units)
Rx,Ry,Rz = axis of rotation vector
theta = angle of rotation (degrees)
</pre>
<ul class="simple">
<li>zero or more keyword/value pairs may be appended</li>
</ul>
<pre class="literal-block">
keyword = <em>units</em>
value = <em>box</em> or <em>lattice</em>
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>displace_atoms top move 0 -5 0 units box
displace_atoms flow ramp x 0.0 5.0 y 2.0 20.5
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Displace a group of atoms. This can be used to move atoms a large
distance before beginning a simulation or to randomize atoms initially
on a lattice. For example, in a shear simulation, an initial strain
can be imposed on the system. Or two groups of atoms can be brought
into closer proximity.</p>
<p>The <em>move</em> style displaces the group of atoms by the specified 3d
displacement vector. Any of the 3 quantities defining the vector
components can be specified as an equal-style or atom-style
<a class="reference internal" href="variable.html"><em>variable</em></a>. If the value is a variable, it should be
specified as v_name, where name is the variable name. In this case,
the variable will be evaluated, and its value(s) used for the
displacement(s). The scale factor implied by the <em>units</em> keyword will
also be applied to the variable result.</p>
<p>Equal-style variables can specify formulas with various mathematical
functions, and include <a class="reference internal" href="thermo_style.html"><em>thermo_style</em></a> command
keywords for the simulation box parameters and timestep and elapsed
time. Atom-style variables can specify the same formulas as
equal-style variables but can also include per-atom values, such as
atom coordinates or per-atom values read from a file. Note that if
the variable references other <a class="reference internal" href="compute.html"><em>compute</em></a> or <a class="reference internal" href="fix.html"><em>fix</em></a>
commands, those values must be up-to-date for the current timestep.
See the &#8220;Variable Accuracy&#8221; section of the <a class="reference internal" href="variable.html"><em>variable</em></a>
doc page for more details.</p>
<p>The <em>ramp</em> style displaces atoms a variable amount in one dimension
depending on the atom&#8217;s coordinate in a (possibly) different
dimension. For example, the second example command displaces atoms in
the x-direction an amount between 0.0 and 5.0 distance units. Each
atom&#8217;s displacement depends on the fractional distance its y
coordinate is between 2.0 and 20.5. Atoms with y-coordinates outside
those bounds will be moved the minimum (0.0) or maximum (5.0) amount.</p>
<p>The <em>random</em> style independently moves each atom in the group by a
random displacement, uniformly sampled from a value between -dx and
+dx in the x dimension, and similarly for y and z. Random numbers are
used in such a way that the displacement of a particular atom is the
same, regardless of how many processors are being used.</p>
<p>The <em>rotate</em> style rotates each atom in the group by the angle <em>theta</em>
around a rotation axis <em>R</em> = (Rx,Ry,Rz) that goes thru a point <em>P</em> =
(Px,Py,Pz). The direction of rotation for the atoms around the
rotation axis is consistent with the right-hand rule: if your
-right-hand&#8217;s thumb points along <em>R</em>, then your fingers wrap around the
+right-hand thumb points along <em>R</em>, then your fingers wrap around the
axis in the direction of positive theta.</p>
+<p>If the defined <a class="reference internal" href="atom_style.html"><em>atom_style</em></a> assigns an orientation to
+each atom (<a class="reference internal" href="atom_style.html"><em>atom styles</em></a> ellipsoid, line, tri, body),
+then that property is also updated appropriately to correspond to the
+atom&#8217;s rotation.</p>
<p>Distance units for displacements and the origin point of the <em>rotate</em>
style are determined by the setting of <em>box</em> or <em>lattice</em> for the
<em>units</em> keyword. <em>Box</em> means distance units as defined by the
<a class="reference internal" href="units.html"><em>units</em></a> command - e.g. Angstroms for <em>real</em> units.
<em>Lattice</em> means distance units are in lattice spacings. The
<a class="reference internal" href="lattice.html"><em>lattice</em></a> command must have been previously used to
define the lattice spacing.</p>
<hr class="docutils" />
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Care should be taken not to move atoms on top of other atoms.
After the move, atoms are remapped into the periodic simulation box if
needed, and any shrink-wrap boundary conditions (see the
<a class="reference internal" href="boundary.html"><em>boundary</em></a> command) are enforced which may change the
box size. Other than this effect, this command does not change the
size or shape of the simulation box. See the
<a class="reference internal" href="change_box.html"><em>change_box</em></a> command if that effect is desired.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Atoms can be moved arbitrarily long distances by this command.
If the simulation box is non-periodic and shrink-wrapped (see the
<a class="reference internal" href="boundary.html"><em>boundary</em></a> command), this can change its size or shape.
This is not a problem, except that the mapping of processors to the
simulation box is not changed by this command from its initial 3d
configuration; see the <a class="reference internal" href="processors.html"><em>processors</em></a> command. Thus, if
the box size/shape changes dramatically, the mapping of processors to
the simulation box may not end up as optimal as the initial mapping
attempted to be.</p>
</div>
</div>
<hr class="docutils" />
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>You cannot rotate around any rotation vector except the z-axis for a
2d simulation.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="lattice.html"><em>lattice</em></a>, <a class="reference internal" href="change_box.html"><em>change_box</em></a>,
<a class="reference internal" href="fix_move.html"><em>fix_move</em></a></p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<p>The option defaults are units = lattice.</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/displace_atoms.txt b/doc/displace_atoms.txt
index 3bb1f1a2d..2df01ccf6 100644
--- a/doc/displace_atoms.txt
+++ b/doc/displace_atoms.txt
@@ -1,134 +1,139 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
displace_atoms command :h3
[Syntax:]
displace_atoms group-ID style args keyword value ... :pre
group-ID = ID of group of atoms to displace :ulb,l
style = {move} or {ramp} or {random} or {rotate} :l
{move} args = delx dely delz
delx,dely,delz = distance to displace in each dimension (distance units)
any of delx,dely,delz can be a variable (see below)
{ramp} args = ddim dlo dhi dim clo chi
ddim = {x} or {y} or {z}
dlo,dhi = displacement distance between dlo and dhi (distance units)
dim = {x} or {y} or {z}
clo,chi = lower and upper bound of domain to displace (distance units)
{random} args = dx dy dz seed
dx,dy,dz = random displacement magnitude in each dimension (distance units)
seed = random # seed (positive integer)
{rotate} args = Px Py Pz Rx Ry Rz theta
Px,Py,Pz = origin point of axis of rotation (distance units)
Rx,Ry,Rz = axis of rotation vector
theta = angle of rotation (degrees) :pre
zero or more keyword/value pairs may be appended :l
keyword = {units}
value = {box} or {lattice} :pre
:ule
[Examples:]
displace_atoms top move 0 -5 0 units box
displace_atoms flow ramp x 0.0 5.0 y 2.0 20.5 :pre
[Description:]
Displace a group of atoms. This can be used to move atoms a large
distance before beginning a simulation or to randomize atoms initially
on a lattice. For example, in a shear simulation, an initial strain
can be imposed on the system. Or two groups of atoms can be brought
into closer proximity.
The {move} style displaces the group of atoms by the specified 3d
displacement vector. Any of the 3 quantities defining the vector
components can be specified as an equal-style or atom-style
"variable"_variable.html. If the value is a variable, it should be
specified as v_name, where name is the variable name. In this case,
the variable will be evaluated, and its value(s) used for the
displacement(s). The scale factor implied by the {units} keyword will
also be applied to the variable result.
Equal-style variables can specify formulas with various mathematical
functions, and include "thermo_style"_thermo_style.html command
keywords for the simulation box parameters and timestep and elapsed
time. Atom-style variables can specify the same formulas as
equal-style variables but can also include per-atom values, such as
atom coordinates or per-atom values read from a file. Note that if
the variable references other "compute"_compute.html or "fix"_fix.html
commands, those values must be up-to-date for the current timestep.
See the "Variable Accuracy" section of the "variable"_variable.html
doc page for more details.
The {ramp} style displaces atoms a variable amount in one dimension
depending on the atom's coordinate in a (possibly) different
dimension. For example, the second example command displaces atoms in
the x-direction an amount between 0.0 and 5.0 distance units. Each
atom's displacement depends on the fractional distance its y
coordinate is between 2.0 and 20.5. Atoms with y-coordinates outside
those bounds will be moved the minimum (0.0) or maximum (5.0) amount.
The {random} style independently moves each atom in the group by a
random displacement, uniformly sampled from a value between -dx and
+dx in the x dimension, and similarly for y and z. Random numbers are
used in such a way that the displacement of a particular atom is the
same, regardless of how many processors are being used.
The {rotate} style rotates each atom in the group by the angle {theta}
around a rotation axis {R} = (Rx,Ry,Rz) that goes thru a point {P} =
(Px,Py,Pz). The direction of rotation for the atoms around the
rotation axis is consistent with the right-hand rule: if your
-right-hand's thumb points along {R}, then your fingers wrap around the
+right-hand thumb points along {R}, then your fingers wrap around the
axis in the direction of positive theta.
+If the defined "atom_style"_atom_style.html assigns an orientation to
+each atom ("atom styles"_atom_style.html ellipsoid, line, tri, body),
+then that property is also updated appropriately to correspond to the
+atom's rotation.
+
Distance units for displacements and the origin point of the {rotate}
style are determined by the setting of {box} or {lattice} for the
{units} keyword. {Box} means distance units as defined by the
"units"_units.html command - e.g. Angstroms for {real} units.
{Lattice} means distance units are in lattice spacings. The
"lattice"_lattice.html command must have been previously used to
define the lattice spacing.
:line
NOTE: Care should be taken not to move atoms on top of other atoms.
After the move, atoms are remapped into the periodic simulation box if
needed, and any shrink-wrap boundary conditions (see the
"boundary"_boundary.html command) are enforced which may change the
box size. Other than this effect, this command does not change the
size or shape of the simulation box. See the
"change_box"_change_box.html command if that effect is desired.
NOTE: Atoms can be moved arbitrarily long distances by this command.
If the simulation box is non-periodic and shrink-wrapped (see the
"boundary"_boundary.html command), this can change its size or shape.
This is not a problem, except that the mapping of processors to the
simulation box is not changed by this command from its initial 3d
configuration; see the "processors"_processors.html command. Thus, if
the box size/shape changes dramatically, the mapping of processors to
the simulation box may not end up as optimal as the initial mapping
attempted to be.
:line
[Restrictions:]
You cannot rotate around any rotation vector except the z-axis for a
2d simulation.
[Related commands:]
"lattice"_lattice.html, "change_box"_change_box.html,
"fix_move"_fix_move.html
[Default:]
The option defaults are units = lattice.
diff --git a/doc/dump_image.html b/doc/dump_image.html
index 8a2f4a918..05e17d0ac 100644
--- a/doc/dump_image.html
+++ b/doc/dump_image.html
@@ -1,727 +1,774 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>dump image command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>dump image command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="dump-image-command">
<span id="index-0"></span><h1>dump image command<a class="headerlink" href="#dump-image-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="dump-movie-command">
<h1>dump movie command<a class="headerlink" href="#dump-movie-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>dump ID group-ID style N file color diameter keyword value ...
</pre></div>
</div>
<ul class="simple">
<li>ID = user-assigned name for the dump</li>
<li>group-ID = ID of the group of atoms to be imaged</li>
<li>style = <em>image</em> or <em>movie</em> = style of dump command (other styles <em>atom</em> or <em>cfg</em> or <em>dcd</em> or <em>xtc</em> or <em>xyz</em> or <em>local</em> or <em>custom</em> are discussed on the <a class="reference internal" href="dump.html"><em>dump</em></a> doc page)</li>
<li>N = dump every this many timesteps</li>
<li>file = name of file to write image to</li>
<li>color = atom attribute that determines color of each atom</li>
<li>diameter = atom attribute that determines size of each atom</li>
<li>zero or more keyword/value pairs may be appended</li>
-<li>keyword = <em>adiam</em> or <em>atom</em> or <em>body</em> or <em>bond</em> or <em>size</em> or <em>view</em> or <em>center</em> or <em>up</em> or <em>zoom</em> or <em>persp</em> or <em>box</em> or <em>axes</em> or <em>subbox</em> or <em>shiny</em> or <em>ssao</em></li>
+<li>keyword = <em>atom</em> or <em>adiam</em> or <em>bond</em> or <em>line</em> or <em>tri</em> or <em>body</em> or <em>size</em> or <em>view</em> or <em>center</em> or <em>up</em> or <em>zoom</em> or <em>persp</em> or <em>box</em> or <em>axes</em> or <em>subbox</em> or <em>shiny</em> or <em>ssao</em></li>
</ul>
<pre class="literal-block">
-<em>adiam</em> value = number = numeric value for atom diameter (distance units)
<em>atom</em> = yes/no = do or do not draw atoms
-<em>body</em> = yes/no bflag1 bflag2
- yes/no = do or do not draw atoms as bodies
- bflag1,bflag2 = 2 numeric flags to affect how bodies are drawn
+<em>adiam</em> size = numeric value for atom diameter (distance units)
<em>bond</em> values = color width = color and width of bonds
color = <em>atom</em> or <em>type</em> or <em>none</em>
width = number or <em>atom</em> or <em>type</em> or <em>none</em>
number = numeric value for bond width (distance units)
+<em>line</em> = color width
+ color = <em>type</em>
+ width = numeric value for line width (distance units)
+<em>tri</em> = color
+ color = <em>type</em>
+<em>body</em> = color bflag1 bflag2
+ color = <em>type</em>
+ bflag1,bflag2 = 2 numeric flags to affect how bodies are drawn
<em>size</em> values = width height = size of images
width = width of image in # of pixels
height = height of image in # of pixels
<em>view</em> values = theta phi = view of simulation box
theta = view angle from +z axis (degrees)
phi = azimuthal view angle (degrees)
theta or phi can be a variable (see below)
<em>center</em> values = flag Cx Cy Cz = center point of image
flag = &quot;s&quot; for static, &quot;d&quot; for dynamic
Cx,Cy,Cz = center point of image as fraction of box dimension (0.5 = center of box)
Cx,Cy,Cz can be variables (see below)
<em>up</em> values = Ux Uy Uz = direction that is &quot;up&quot; in image
Ux,Uy,Uz = components of up vector
Ux,Uy,Uz can be variables (see below)
<em>zoom</em> value = zfactor = size that simulation box appears in image
zfactor = scale image size by factor &gt; 1 to enlarge, factor &lt; 1 to shrink
zfactor can be a variable (see below)
<em>persp</em> value = pfactor = amount of &quot;perspective&quot; in image
pfactor = amount of perspective (0 = none, &lt; 1 = some, &gt; 1 = highly skewed)
pfactor can be a variable (see below)
<em>box</em> values = yes/no diam = draw outline of simulation box
yes/no = do or do not draw simulation box lines
diam = diameter of box lines as fraction of shortest box length
<em>axes</em> values = yes/no length diam = draw xyz axes
yes/no = do or do not draw xyz axes lines next to simulation box
length = length of axes lines as fraction of respective box lengths
diam = diameter of axes lines as fraction of shortest box length
<em>subbox</em> values = yes/no diam = draw outline of processor sub-domains
yes/no = do or do not draw sub-domain lines
diam = diameter of sub-domain lines as fraction of shortest box length
<em>shiny</em> value = sfactor = shinyness of spheres and cylinders
sfactor = shinyness of spheres and cylinders from 0.0 to 1.0
<em>ssao</em> value = yes/no seed dfactor = SSAO depth shading
yes/no = turn depth shading on/off
seed = random # seed (positive integer)
dfactor = strength of shading from 0.0 to 1.0
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>dump d0 all image 100 dump.*.jpg type type
dump d1 mobile image 500 snap.*.png element element ssao yes 4539 0.6
dump d2 all image 200 img-*.ppm type type zoom 2.5 adiam 1.5 size 1280 720
dump m0 all movie 1000 movie.mpg type type size 640 480
dump m1 all movie 1000 movie.avi type type size 640 480
dump m2 all movie 100 movie.m4v type type zoom 1.8 adiam v_value size 1280 720
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Dump a high-quality rendered image of the atom configuration every N
timesteps and save the images either as a sequence of JPEG or PNG or
PPM files, or as a single movie file. The options for this command as
well as the <a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a> command control what is
included in the image or movie and how it appears. A series of such
images can easily be manually converted into an animated movie of your
simulation or the process can be automated without writing the
intermediate files using the dump movie style; see further details
below. Other dump styles store snapshots of numerical data asociated
with atoms in various formats, as discussed on the <a class="reference internal" href="dump.html"><em>dump</em></a>
doc page.</p>
<p>Note that a set of images or a movie can be made after a simulation
has been run, using the <a class="reference internal" href="rerun.html"><em>rerun</em></a> command to read snapshots
from an existing dump file, and using these dump commands in the rerun
script to generate the images/movie.</p>
<p>Here are two sample images, rendered as 1024x1024 JPEG files. Click
to see the full-size images:</p>
<DIV ALIGN=center><a data-lightbox="group-default"
href="_images/dump1.jpg"
class=""
title=""
data-title=""
><img src="_images/dump1.jpg"
class=""
width="25%"
height="auto"
alt=""/>
</a><a data-lightbox="group-default"
href="_images/dump2.jpg"
class=""
title=""
data-title=""
><img src="_images/dump2.jpg"
class=""
width="25%"
height="auto"
alt=""/>
</a></DIV><p>Only atoms in the specified group are rendered in the image. The
<a class="reference internal" href="dump_modify.html"><em>dump_modify region and thresh</em></a> commands can also
alter what atoms are included in the image.
The filename suffix determines whether a JPEG, PNG, or PPM file is
created with the <em>image</em> dump style. If the suffix is &#8221;.jpg&#8221; or
&#8221;.jpeg&#8221;, then a JPEG format file is created, if the suffix is &#8221;.png&#8221;,
then a PNG format is created, else a PPM (aka NETPBM) format file is
created. The JPEG and PNG files are binary; PPM has a text mode
header followed by binary data. JPEG images have lossy compression;
PNG has lossless compression; and PPM files are uncompressed but can
be compressed with gzip, if LAMMPS has been compiled with
-DLAMMPS_GZIP and a &#8221;.gz&#8221; suffix is used.</p>
<p>Similarly, the format of the resulting movie is chosen with the
<em>movie</em> dump style. This is handled by the underlying FFmpeg converter
and thus details have to be looked up in the FFmpeg documentation.
Typical examples are: .avi, .mpg, .m4v, .mp4, .mkv, .flv, .mov, .gif
Additional settings of the movie compression like bitrate and
framerate can be set using the <a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a> command.</p>
<p>To write out JPEG and PNG format files, you must build LAMMPS with
support for the corresponding JPEG or PNG library. To convert images
into movies, LAMMPS has to be compiled with the -DLAMMPS_FFMPEG
flag. See <a class="reference internal" href="Section_start.html#start-2-4"><span>this section</span></a> of the manual
for instructions on how to do this.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Because periodic boundary conditions are enforced only on
timesteps when neighbor lists are rebuilt, the coordinates of an atom
in the image may be slightly outside the simulation box.</p>
</div>
<hr class="docutils" />
<p>Dumps are performed on timesteps that are a multiple of N (including
timestep 0) and on the last timestep of a minimization if the
minimization converges. Note that this means a dump will not be
performed on the initial timestep after the dump command is invoked,
if the current timestep is not a multiple of N. This behavior can be
changed via the <a class="reference internal" href="dump_modify.html"><em>dump_modify first</em></a> command, which
can be useful if the dump command is invoked after a minimization
ended on an arbitrary timestep. N can be changed between runs by
using the <a class="reference internal" href="dump_modify.html"><em>dump_modify every</em></a> command.</p>
<p>Dump <em>image</em> filenames must contain a wildcard character &#8220;*&#8221;, so that
one image file per snapshot is written. The &#8220;*&#8221; character is replaced
with the timestep value. For example, tmp.dump.*.jpg becomes
tmp.dump.0.jpg, tmp.dump.10000.jpg, tmp.dump.20000.jpg, etc. Note
that the <a class="reference internal" href="dump_modify.html"><em>dump_modify pad</em></a> command can be used to
insure all timestep numbers are the same length (e.g. 00010), which
can make it easier to convert a series of images into a movie in the
correct ordering.</p>
<p>Dump <em>movie</em> filenames on the other hand, must not have any wildcard
character since only one file combining all images into a single
movie will be written by the movie encoder.</p>
<hr class="docutils" />
<p>The <em>color</em> and <em>diameter</em> settings determine the color and size of
atoms rendered in the image. They can be any atom attribute defined
for the <a class="reference internal" href="dump.html"><em>dump custom</em></a> command, including <em>type</em> and
<em>element</em>. This includes per-atom quantities calculated by a
<a class="reference internal" href="compute.html"><em>compute</em></a>, <a class="reference internal" href="fix.html"><em>fix</em></a>, or <a class="reference internal" href="variable.html"><em>variable</em></a>,
which are prefixed by &#8220;<a href="#id9"><span class="problematic" id="id10">c_</span></a>&#8221;, &#8220;<a href="#id11"><span class="problematic" id="id12">f_</span></a>&#8221;, or &#8220;<a href="#id13"><span class="problematic" id="id14">v_</span></a>&#8221; respectively. Note that the
<em>diameter</em> setting can be overridden with a numeric value applied to
all atoms by the optional <em>adiam</em> keyword.</p>
<p>If <em>type</em> is specified for the <em>color</em> setting, then the color of each
atom is determined by its atom type. By default the mapping of types
to colors is as follows:</p>
<ul class="simple">
<li>type 1 = red</li>
<li>type 2 = green</li>
<li>type 3 = blue</li>
<li>type 4 = yellow</li>
<li>type 5 = aqua</li>
<li>type 6 = cyan</li>
</ul>
<p>and repeats itself for types &gt; 6. This mapping can be changed by the
<a class="reference internal" href="dump_modify.html"><em>dump_modify acolor</em></a> command.</p>
<p>If <em>type</em> is specified for the <em>diameter</em> setting then the diameter of
each atom is determined by its atom type. By default all types have
diameter 1.0. This mapping can be changed by the <a class="reference internal" href="dump_modify.html"><em>dump_modify adiam</em></a> command.</p>
<p>If <em>element</em> is specified for the <em>color</em> and/or <em>diameter</em> setting,
then the color and/or diameter of each atom is determined by which
element it is, which in turn is specified by the element-to-type
mapping specified by the &#8220;dump_modify element&#8221; command. By default
every atom type is C (carbon). Every element has a color and diameter
associated with it, which is the same as the colors and sizes used by
the <a class="reference external" href="http://mt.seas.upenn.edu/Archive/Graphics/A">AtomEye</a> visualization package.</p>
<p>If other atom attributes are used for the <em>color</em> or <em>diameter</em>
settings, they are interpreted in the following way.</p>
<p>If &#8220;vx&#8221;, for example, is used as the <em>color</em> setting, then the color
of the atom will depend on the x-component of its velocity. The
association of a per-atom value with a specific color is determined by
a &#8220;color map&#8221;, which can be specified via the
<a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a> command. The basic idea is that the
atom-attribute will be within a range of values, and every value
within the range is mapped to a specific color. Depending on how the
color map is defined, that mapping can take place via interpolation so
that a value of -3.2 is halfway between &#8220;red&#8221; and &#8220;blue&#8221;, or
discretely so that the value of -3.2 is &#8220;orange&#8221;.</p>
<p>If &#8220;vx&#8221;, for example, is used as the <em>diameter</em> setting, then the atom
will be rendered using the x-component of its velocity as the
diameter. If the per-atom value &lt;= 0.0, them the atom will not be
drawn. Note that finite-size spherical particles, as defined by
<a class="reference internal" href="atom_style.html"><em>atom_style sphere</em></a> define a per-particle radius or
diameter, which can be used as the <em>diameter</em> setting.</p>
<hr class="docutils" />
<p>The various kewords listed above control how the image is rendered.
As listed below, all of the keywords have defaults, most of which you
will likely not need to change. The <a class="reference internal" href="dump_modify.html"><em>dump modify</em></a>
also has options specific to the dump image style, particularly for
assigning colors to atoms, bonds, and other image features.</p>
<hr class="docutils" />
-<p>The <em>adiam</em> keyword allows you to override the <em>diameter</em> setting to a
-per-atom attribute with a specified numeric value. All atoms will be
-drawn with that diameter, e.g. 1.5, which is in whatever distance
-<a class="reference internal" href="units.html"><em>units</em></a> the input script defines, e.g. Angstroms.</p>
-<p>The <em>atom</em> keyword allow you to turn off the drawing of all atoms,
-if the specified value is <em>no</em>.</p>
-<p>The <em>body</em> keyword can be used when <a class="reference internal" href="atom_style.html"><em>atom_style body</em></a>
-is used to define body particles with internal state
-(e.g. sub-particles). The <a class="reference internal" href="body.html"><em>body</em></a> doc page descibes the body
-styles LAMMPS currently supports, and provides more details as to the
-kind of body particles they represent and how they are drawn by this
-dump image command. For all the body styles, individual atoms can be
-either a body particle or a usual point (non-body) particle. If the
-<em>body</em> keyword is set to <em>yes</em>, then atoms which are body particles
-are drawn by the method defined by the body style. Non-body particles
-the same way they would be if the <em>body</em> keyword is <em>no</em>, i.e. as
-spheres. The <em>bflag1</em> and <em>bflag2</em> settings are numerical values
-which are passed to the body style to affect how the drawing of a body
-particle is done. See the <a class="reference internal" href="body.html"><em>body</em></a> doc page for a description
-of what these parameters mean for each body style.</p>
+<p>The <em>atom</em> keyword allow you to turn off the drawing of all atoms, if
+the specified value is <em>no</em>. Note that this will not turn off the
+drawing of particles that are represented as lines, triangles, or
+bodies, as discussed below. These particles can be drawn separately
+if the <em>line</em>, <em>tri</em>, or <em>body</em> keywords are used.</p>
+<p>The <em>adiam</em> keyword allows you to override the <em>diameter</em> setting to
+set a single numeric <em>size</em>. All atoms will be drawn with that
+diameter, e.g. 1.5, which is in whatever distance <a class="reference internal" href="units.html"><em>units</em></a>
+the input script defines, e.g. Angstroms.</p>
<p>The <em>bond</em> keyword allows to you to alter how bonds are drawn. A bond
is only drawn if both atoms in the bond are being drawn due to being
in the specified group and due to other selection criteria
(e.g. region, threshhold settings of the
<a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a> command). By default, bonds are drawn
if they are defined in the input data file as read by the
<a class="reference internal" href="read_data.html"><em>read_data</em></a> command. Using <em>none</em> for both the bond
<em>color</em> and <em>width</em> value will turn off the drawing of all bonds.</p>
<p>If <em>atom</em> is specified for the bond <em>color</em> value, then each bond is
drawn in 2 halves, with the color of each half being the color of the
atom at that end of the bond.</p>
<p>If <em>type</em> is specified for the <em>color</em> value, then the color of each
bond is determined by its bond type. By default the mapping of bond
types to colors is as follows:</p>
<ul class="simple">
<li>type 1 = red</li>
<li>type 2 = green</li>
<li>type 3 = blue</li>
<li>type 4 = yellow</li>
<li>type 5 = aqua</li>
<li>type 6 = cyan</li>
</ul>
<p>and repeats itself for bond types &gt; 6. This mapping can be changed by
the <a class="reference internal" href="dump_modify.html"><em>dump_modify bcolor</em></a> command.</p>
<p>The bond <em>width</em> value can be a numeric value or <em>atom</em> or <em>type</em> (or
<em>none</em> as indicated above).</p>
<p>If a numeric value is specified, then all bonds will be drawn as
cylinders with that diameter, e.g. 1.0, which is in whatever distance
<a class="reference internal" href="units.html"><em>units</em></a> the input script defines, e.g. Angstroms.</p>
<p>If <em>atom</em> is specified for the <em>width</em> value, then each bond
will be drawn with a width corresponding to the minimum diameter
of the 2 atoms in the bond.</p>
<p>If <em>type</em> is specified for the <em>width</em> value then the diameter of each
bond is determined by its bond type. By default all types have
diameter 0.5. This mapping can be changed by the <a class="reference internal" href="dump_modify.html"><em>dump_modify bdiam</em></a> command.</p>
+<p>The <em>line</em> keyword can be used when <a class="reference internal" href="atom_style.html"><em>atom_style line</em></a>
+is used to define particles as line segments, and will draw them as
+lines. If this keyword is not used, such particles will be drawn as
+spheres, the same as if they were regular atoms. The only setting
+currently allowed for the <em>color</em> value is <em>type</em>, which will color
+the lines according to the atom type of the particle. By default the
+mapping of types to colors is as follows:</p>
+<ul class="simple">
+<li>type 1 = red</li>
+<li>type 2 = green</li>
+<li>type 3 = blue</li>
+<li>type 4 = yellow</li>
+<li>type 5 = aqua</li>
+<li>type 6 = cyan</li>
+</ul>
+<p>and repeats itself for types &gt; 6. There is not yet an option to
+change this via the <a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a> command.</p>
+<p>The line <em>width</em> can only be a numeric value, which specifies that all
+lines will be drawn as cylinders with that diameter, e.g. 1.0, which
+is in whatever distance <a class="reference internal" href="units.html"><em>units</em></a> the input script defines,
+e.g. Angstroms.</p>
+<p>The <em>tri</em> keyword can be used when <a class="reference internal" href="atom_style.html"><em>atom_style tri</em></a> is
+used to define particles as triangles, and will draw them as
+triangles. If this keyword is not used, such particles will be drawn
+as spheres, the same as if they were regular atoms. The only setting
+currently allowed for the <em>color</em> value is <em>type</em>, which will color
+the triangles according to the atom type of the particle. By default
+the mapping of types to colors is as follows:</p>
+<ul class="simple">
+<li>type 1 = red</li>
+<li>type 2 = green</li>
+<li>type 3 = blue</li>
+<li>type 4 = yellow</li>
+<li>type 5 = aqua</li>
+<li>type 6 = cyan</li>
+</ul>
+<p>and repeats itself for types &gt; 6. There is not yet an option to
+change this via the <a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a> command.</p>
+<p>The <em>body</em> keyword can be used when <a class="reference internal" href="atom_style.html"><em>atom_style body</em></a>
+is used to define body particles with internal state
+(e.g. sub-particles), and will drawn them in a manner specific to the
+body style. If this keyword is not used, such particles will be drawn
+as spheres, the same as if they were regular atoms.</p>
+<p>The <a class="reference internal" href="body.html"><em>body</em></a> doc page descibes the body styles LAMMPS
+currently supports, and provides more details as to the kind of body
+particles they represent and how they are drawn by this dump image
+command. For all the body styles, individual atoms can be either a
+body particle or a usual point (non-body) particle. Non-body
+particles will be drawn the same way they would be as a regular atom.
+The <em>bflag1</em> and <em>bflag2</em> settings are numerical values which are
+passed to the body style to affect how the drawing of a body particle
+is done. See the <a class="reference internal" href="body.html"><em>body</em></a> doc page for a description of what
+these parameters mean for each body style.</p>
<hr class="docutils" />
<p>The <em>size</em> keyword sets the width and height of the created images,
i.e. the number of pixels in each direction.</p>
<hr class="docutils" />
<p>The <em>view</em>, <em>center</em>, <em>up</em>, <em>zoom</em>, and <em>persp</em> values determine how
3d simulation space is mapped to the 2d plane of the image. Basically
they control how the simulation box appears in the image.</p>
<p>All of the <em>view</em>, <em>center</em>, <em>up</em>, <em>zoom</em>, and <em>persp</em> values can be
specified as numeric quantities, whose meaning is explained below.
Any of them can also be specified as an <a class="reference internal" href="variable.html"><em>equal-style variable</em></a>, by using v_name as the value, where &#8220;name&#8221; is
the variable name. In this case the variable will be evaluated on the
timestep each image is created to create a new value. If the
equal-style variable is time-dependent, this is a means of changing
the way the simulation box appears from image to image, effectively
doing a pan or fly-by view of your simulation.</p>
<p>The <em>view</em> keyword determines the viewpoint from which the simulation
box is viewed, looking towards the <em>center</em> point. The <em>theta</em> value
is the vertical angle from the +z axis, and must be an angle from 0 to
180 degrees. The <em>phi</em> value is an azimuthal angle around the z axis
and can be positive or negative. A value of 0.0 is a view along the
+x axis, towards the <em>center</em> point. If <em>theta</em> or <em>phi</em> are
specified via variables, then the variable values should be in
degrees.</p>
<p>The <em>center</em> keyword determines the point in simulation space that
will be at the center of the image. <em>Cx</em>, <em>Cy</em>, and <em>Cz</em> are
speficied as fractions of the box dimensions, so that (0.5,0.5,0.5) is
the center of the simulation box. These values do not have to be
between 0.0 and 1.0, if you want the simulation box to be offset from
the center of the image. Note, however, that if you choose strange
values for <em>Cx</em>, <em>Cy</em>, or <em>Cz</em> you may get a blank image. Internally,
<em>Cx</em>, <em>Cy</em>, and <em>Cz</em> are converted into a point in simulation space.
If <em>flag</em> is set to &#8220;s&#8221; for static, then this conversion is done once,
at the time the dump command is issued. If <em>flag</em> is set to &#8220;d&#8221; for
dynamic then the conversion is performed every time a new image is
created. If the box size or shape is changing, this will adjust the
center point in simulation space.</p>
<p>The <em>up</em> keyword determines what direction in simulation space will be
&#8220;up&#8221; in the image. Internally it is stored as a vector that is in the
plane perpendicular to the view vector implied by the <em>theta</em> and
<em>pni</em> values, and which is also in the plane defined by the view
vector and user-specified up vector. Thus this internal vector is
computed from the user-specified <em>up</em> vector as</p>
<div class="highlight-python"><div class="highlight"><pre>up_internal = view cross (up cross view)
</pre></div>
</div>
<p>This means the only restriction on the specified <em>up</em> vector is that
it cannot be parallel to the <em>view</em> vector, implied by the <em>theta</em> and
<em>phi</em> values.</p>
<p>The <em>zoom</em> keyword scales the size of the simulation box as it appears
in the image. The default <em>zfactor</em> value of 1 should display an
image mostly filled by the atoms in the simulation box. A <em>zfactor</em> &gt;
1 will make the simulation box larger; a <em>zfactor</em> &lt; 1 will make it
smaller. <em>Zfactor</em> must be a value &gt; 0.0.</p>
<p>The <em>persp</em> keyword determines how much depth perspective is present
in the image. Depth perspective makes lines that are parallel in
simulation space appear non-parallel in the image. A <em>pfactor</em> value
of 0.0 means that parallel lines will meet at infininty (1.0/pfactor),
which is an orthographic rendering with no persepctive. A <em>pfactor</em>
value between 0.0 and 1.0 will introduce more perspective. A <em>pfactor</em>
value &gt; 1 will create a highly skewed image with a large amount of
perspective.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The <em>persp</em> keyword is not yet supported as an option.</p>
</div>
<hr class="docutils" />
<p>The <em>box</em> keyword determines if and how the simulation box boundaries
are rendered as thin cylinders in the image. If <em>no</em> is set, then the
box boundaries are not drawn and the <em>diam</em> setting is ignored. If
<em>yes</em> is set, the 12 edges of the box are drawn, with a diameter that
is a fraction of the shortest box length in x,y,z (for 3d) or x,y (for
2d). The color of the box boundaries can be set with the <a class="reference internal" href="dump_modify.html"><em>dump_modify boxcolor</em></a> command.</p>
<p>The <em>axes</em> keyword determines if and how the coordinate axes are
rendered as thin cylinders in the image. If <em>no</em> is set, then the
axes are not drawn and the <em>length</em> and <em>diam</em> settings are ignored.
If <em>yes</em> is set, 3 thin cylinders are drawn to represent the x,y,z
axes in colors red,green,blue. The origin of these cylinders will be
offset from the lower left corner of the box by 10%. The <em>length</em>
setting determines how long the cylinders will be as a fraction of the
respective box lengths. The <em>diam</em> setting determines their thickness
as a fraction of the shortest box length in x,y,z (for 3d) or x,y (for
2d).</p>
<p>The <em>subbox</em> keyword determines if and how processor sub-domain
boundaries are rendered as thin cylinders in the image. If <em>no</em> is
set (default), then the sub-domain boundaries are not drawn and the
<em>diam</em> setting is ignored. If <em>yes</em> is set, the 12 edges of each
processor sub-domain are drawn, with a diameter that is a fraction of
the shortest box length in x,y,z (for 3d) or x,y (for 2d). The color
of the sub-domain boundaries can be set with the <a class="reference internal" href="dump_modify.html"><em>dump_modify boxcolor</em></a> command.</p>
<hr class="docutils" />
<p>The <em>shiny</em> keyword determines how shiny the objects rendered in the
image will appear. The <em>sfactor</em> value must be a value 0.0 &lt;=
<em>sfactor</em> &lt;= 1.0, where <em>sfactor</em> = 1 is a highly reflective surface
and <em>sfactor</em> = 0 is a rough non-shiny surface.</p>
<p>The <em>ssao</em> keyword turns on/off a screen space ambient occlusion
(SSAO) model for depth shading. If <em>yes</em> is set, then atoms further
away from the viewer are darkened via a randomized process, which is
perceived as depth. The calculation of this effect can increase the
cost of computing the image by roughly 2x. The strength of the effect
can be scaled by the <em>dfactor</em> parameter. If <em>no</em> is set, no depth
shading is performed.</p>
<hr class="docutils" />
<p>A series of JPEG, PNG, or PPM images can be converted into a movie
file and then played as a movie using commonly available tools. Using
dump style <em>movie</em> automates this step and avoids the intermediate
step of writing (many) image snapshot file. But LAMMPS has to be
compiled with -DLAMMPS_FFMPEG and an FFmpeg executable have to be
installed.</p>
<p>To manually convert JPEG, PNG or PPM files into an animated GIF or
MPEG or other movie file you can use:</p>
<ul class="simple">
<li><ol class="first loweralpha">
<li>Use the ImageMagick convert program.</li>
</ol>
</li>
</ul>
<div class="highlight-python"><div class="highlight"><pre>% convert *.jpg foo.gif
% convert -loop 1 *.ppm foo.mpg
</pre></div>
</div>
<p>Animated GIF files from ImageMagick are unoptimized. You can use a
program like gifsicle to optimize and massively shrink them.
MPEG files created by ImageMagick are in MPEG-1 format with rather
inefficient compression and low quality.</p>
<ul class="simple">
<li><ol class="first loweralpha" start="2">
<li>Use QuickTime.</li>
</ol>
</li>
</ul>
<p>Select &#8220;Open Image Sequence&#8221; under the File menu Load the images into
QuickTime to animate them Select &#8220;Export&#8221; under the File menu Save the
movie as a QuickTime movie (<a href="#id7"><span class="problematic" id="id8">*</span></a>.mov) or in another format. QuickTime
can generate very high quality and efficiently compressed movie
files. Some of the supported formats require to buy a license and some
are not readable on all platforms until specific runtime libraries are
installed.</p>
<ul class="simple">
<li><ol class="first loweralpha" start="3">
<li>Use FFmpeg</li>
</ol>
</li>
</ul>
<p>FFmpeg is a command line tool that is available on many platforms and
allows extremely flexible encoding and decoding of movies.</p>
<div class="highlight-python"><div class="highlight"><pre>cat snap.*.jpg | ffmpeg -y -f image2pipe -c:v mjpeg -i - -b:v 2000k movie.m4v
cat snap.*.ppm | ffmpeg -y -f image2pipe -c:v ppm -i - -b:v 2400k movie.avi
</pre></div>
</div>
<p>Frontends for FFmpeg exist for multiple platforms. For more
information see the <a class="reference external" href="http://www.ffmpeg.org/">FFmpeg homepage</a></p>
<hr class="docutils" />
<p>Play the movie:</p>
<ul class="simple">
<li><ol class="first loweralpha">
<li>Use your browser to view an animated GIF movie.</li>
</ol>
</li>
</ul>
<p>Select &#8220;Open File&#8221; under the File menu
Load the animated GIF file</p>
<ul class="simple">
<li>b) Use the freely available mplayer or ffplay tool to view a
movie. Both are available for multiple OSes and support a large
variety of file formats and decoders.</li>
</ul>
<div class="highlight-python"><div class="highlight"><pre>% mplayer foo.mpg
% ffplay bar.avi
</pre></div>
</div>
<ul class="simple">
<li>c) Use the <a class="reference external" href="http://www.sandia.gov/~sjplimp/pizza.html">Pizza.py</a>
<a class="reference external" href="http://www.sandia.gov/~sjplimp/pizza/doc/animate.html">animate tool</a>,
which works directly on a series of image files.</li>
</ul>
<div class="highlight-python"><div class="highlight"><pre><span class="n">a</span> <span class="o">=</span> <span class="n">animate</span><span class="p">(</span><span class="s">&quot;foo*.jpg&quot;</span><span class="p">)</span>
</pre></div>
</div>
<ul class="simple">
<li>d) QuickTime and other Windows- or MacOS-based media players can
obviously play movie files directly. Similarly for corresponding tools
bundled with Linux desktop environments. However, due to licensing
issues with some file formats, the formats may require installing
additional libraries, purchasing a license, or may not be
supported.</li>
</ul>
<hr class="docutils" />
<p>See <a class="reference internal" href="Section_modify.html"><em>Section_modify</em></a> of the manual for information
on how to add new compute and fix styles to LAMMPS to calculate
per-atom quantities which could then be output into dump files.</p>
</div>
<hr class="docutils" />
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>To write JPEG images, you must use the -DLAMMPS_JPEG switch when
building LAMMPS and link with a JPEG library. To write PNG images, you
must use the -DLAMMPS_PNG switch when building LAMMPS and link with a
PNG library.</p>
<p>To write <em>movie</em> dumps, you must use the -DLAMMPS_FFMPEG switch when
building LAMMPS and have the FFmpeg executable available on the
machine where LAMMPS is being run. Typically it&#8217;s name is lowercase,
i.e. ffmpeg.</p>
<p>See the <a class="reference internal" href="Section_start.html#start-2-4"><span>Making LAMMPS</span></a> section of the
documentation for details on how to compile with optional switches.</p>
<p>Note that since FFmpeg is run as an external program via a pipe,
LAMMPS has limited control over its execution and no knowledge about
errors and warnings printed by it. Those warnings and error messages
will be printed to the screen only. Due to the way image data is
communicated to FFmpeg, it will often print the message</p>
<div class="highlight-python"><div class="highlight"><pre>pipe:: Input/output error
</pre></div>
</div>
<p>which can be safely ignored. Other warnings
and errors have to be addressed according to the FFmpeg documentation.
One known issue is that certain movie file formats (e.g. MPEG level 1
and 2 format streams) have video bandwith limits that can be crossed
when rendering too large of image sizes. Typical warnings look like
this:</p>
<div class="highlight-python"><div class="highlight"><pre>[mpeg @ 0x98b5e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x98b5e0] buffer underflow st=0 bufi=281407 size=285018
[mpeg @ 0x98b5e0] buffer underflow st=0 bufi=283448 size=285018
</pre></div>
</div>
<p>In this case it is recommended to either reduce the size of the image
or encode in a different format that is also supported by your copy of
FFmpeg, and which does not have this limitation (e.g. .avi, .mkv,
mp4).</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="dump.html"><em>dump</em></a>, <a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a>, <a class="reference internal" href="undump.html"><em>undump</em></a></p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<p>The defaults for the keywords are as follows:</p>
<ul class="simple">
<li>adiam = not specified (use diameter setting)</li>
<li>atom = yes</li>
<li>bond = none none (if no bonds in system)</li>
<li>bond = atom 0.5 (if bonds in system)</li>
<li>size = 512 512</li>
<li>view = 60 30 (for 3d)</li>
<li>view = 0 0 (for 2d)</li>
<li>center = s 0.5 0.5 0.5</li>
<li>up = 0 0 1 (for 3d)</li>
<li>up = 0 1 0 (for 2d)</li>
<li>zoom = 1.0</li>
<li>persp = 0.0</li>
<li>box = yes 0.02</li>
<li>axes = no 0.0 0.0</li>
<li>subbox no 0.0</li>
<li>shiny = 1.0</li>
<li>ssao = no</li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/dump_image.txt b/doc/dump_image.txt
index f671e747d..497bc46d7 100644
--- a/doc/dump_image.txt
+++ b/doc/dump_image.txt
@@ -1,568 +1,619 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
dump image command :h3
dump movie command :h3
[Syntax:]
dump ID group-ID style N file color diameter keyword value ... :pre
ID = user-assigned name for the dump :ulb,l
group-ID = ID of the group of atoms to be imaged :l
style = {image} or {movie} = style of dump command (other styles {atom} or {cfg} or {dcd} or {xtc} or {xyz} or {local} or {custom} are discussed on the "dump"_dump.html doc page) :l
N = dump every this many timesteps :l
file = name of file to write image to :l
color = atom attribute that determines color of each atom :l
diameter = atom attribute that determines size of each atom :l
zero or more keyword/value pairs may be appended :l
-keyword = {adiam} or {atom} or {body} or {bond} or {size} or {view} or {center} or {up} or {zoom} or {persp} or {box} or {axes} or {subbox} or {shiny} or {ssao} :l
- {adiam} value = number = numeric value for atom diameter (distance units)
+keyword = {atom} or {adiam} or {bond} or {line} or {tri} or {body} or {size} or {view} or {center} or {up} or {zoom} or {persp} or {box} or {axes} or {subbox} or {shiny} or {ssao} :l
{atom} = yes/no = do or do not draw atoms
- {body} = yes/no bflag1 bflag2
- yes/no = do or do not draw atoms as bodies
- bflag1,bflag2 = 2 numeric flags to affect how bodies are drawn
+ {adiam} size = numeric value for atom diameter (distance units)
{bond} values = color width = color and width of bonds
color = {atom} or {type} or {none}
width = number or {atom} or {type} or {none}
number = numeric value for bond width (distance units)
+ {line} = color width
+ color = {type}
+ width = numeric value for line width (distance units)
+ {tri} = color
+ color = {type}
+ {body} = color bflag1 bflag2
+ color = {type}
+ bflag1,bflag2 = 2 numeric flags to affect how bodies are drawn
{size} values = width height = size of images
width = width of image in # of pixels
height = height of image in # of pixels
{view} values = theta phi = view of simulation box
theta = view angle from +z axis (degrees)
phi = azimuthal view angle (degrees)
theta or phi can be a variable (see below)
{center} values = flag Cx Cy Cz = center point of image
flag = "s" for static, "d" for dynamic
Cx,Cy,Cz = center point of image as fraction of box dimension (0.5 = center of box)
Cx,Cy,Cz can be variables (see below)
{up} values = Ux Uy Uz = direction that is "up" in image
Ux,Uy,Uz = components of up vector
Ux,Uy,Uz can be variables (see below)
{zoom} value = zfactor = size that simulation box appears in image
zfactor = scale image size by factor > 1 to enlarge, factor < 1 to shrink
zfactor can be a variable (see below)
{persp} value = pfactor = amount of "perspective" in image
pfactor = amount of perspective (0 = none, < 1 = some, > 1 = highly skewed)
pfactor can be a variable (see below)
{box} values = yes/no diam = draw outline of simulation box
yes/no = do or do not draw simulation box lines
diam = diameter of box lines as fraction of shortest box length
{axes} values = yes/no length diam = draw xyz axes
yes/no = do or do not draw xyz axes lines next to simulation box
length = length of axes lines as fraction of respective box lengths
diam = diameter of axes lines as fraction of shortest box length
{subbox} values = yes/no diam = draw outline of processor sub-domains
yes/no = do or do not draw sub-domain lines
diam = diameter of sub-domain lines as fraction of shortest box length
{shiny} value = sfactor = shinyness of spheres and cylinders
sfactor = shinyness of spheres and cylinders from 0.0 to 1.0
{ssao} value = yes/no seed dfactor = SSAO depth shading
yes/no = turn depth shading on/off
seed = random # seed (positive integer)
dfactor = strength of shading from 0.0 to 1.0 :pre
:ule
[Examples:]
dump d0 all image 100 dump.*.jpg type type
dump d1 mobile image 500 snap.*.png element element ssao yes 4539 0.6
dump d2 all image 200 img-*.ppm type type zoom 2.5 adiam 1.5 size 1280 720
dump m0 all movie 1000 movie.mpg type type size 640 480
dump m1 all movie 1000 movie.avi type type size 640 480
dump m2 all movie 100 movie.m4v type type zoom 1.8 adiam v_value size 1280 720 :pre
[Description:]
Dump a high-quality rendered image of the atom configuration every N
timesteps and save the images either as a sequence of JPEG or PNG or
PPM files, or as a single movie file. The options for this command as
well as the "dump_modify"_dump_modify.html command control what is
included in the image or movie and how it appears. A series of such
images can easily be manually converted into an animated movie of your
simulation or the process can be automated without writing the
intermediate files using the dump movie style; see further details
below. Other dump styles store snapshots of numerical data asociated
with atoms in various formats, as discussed on the "dump"_dump.html
doc page.
Note that a set of images or a movie can be made after a simulation
has been run, using the "rerun"_rerun.html command to read snapshots
from an existing dump file, and using these dump commands in the rerun
script to generate the images/movie.
Here are two sample images, rendered as 1024x1024 JPEG files. Click
to see the full-size images:
<DIV ALIGN=center>
:image(JPG/dump1_small.jpg,JPG/dump1.jpg)
:image(JPG/dump2_small.jpg,JPG/dump2.jpg)
</DIV>
Only atoms in the specified group are rendered in the image. The
"dump_modify region and thresh"_dump_modify.html commands can also
alter what atoms are included in the image.\
The filename suffix determines whether a JPEG, PNG, or PPM file is
created with the {image} dump style. If the suffix is ".jpg" or
".jpeg", then a JPEG format file is created, if the suffix is ".png",
then a PNG format is created, else a PPM (aka NETPBM) format file is
created. The JPEG and PNG files are binary; PPM has a text mode
header followed by binary data. JPEG images have lossy compression;
PNG has lossless compression; and PPM files are uncompressed but can
be compressed with gzip, if LAMMPS has been compiled with
-DLAMMPS_GZIP and a ".gz" suffix is used.
Similarly, the format of the resulting movie is chosen with the
{movie} dump style. This is handled by the underlying FFmpeg converter
and thus details have to be looked up in the FFmpeg documentation.
Typical examples are: .avi, .mpg, .m4v, .mp4, .mkv, .flv, .mov, .gif
Additional settings of the movie compression like bitrate and
framerate can be set using the "dump_modify"_dump_modify.html command.
To write out JPEG and PNG format files, you must build LAMMPS with
support for the corresponding JPEG or PNG library. To convert images
into movies, LAMMPS has to be compiled with the -DLAMMPS_FFMPEG
flag. See "this section"_Section_start.html#start_2_4 of the manual
for instructions on how to do this.
NOTE: Because periodic boundary conditions are enforced only on
timesteps when neighbor lists are rebuilt, the coordinates of an atom
in the image may be slightly outside the simulation box.
:line
Dumps are performed on timesteps that are a multiple of N (including
timestep 0) and on the last timestep of a minimization if the
minimization converges. Note that this means a dump will not be
performed on the initial timestep after the dump command is invoked,
if the current timestep is not a multiple of N. This behavior can be
changed via the "dump_modify first"_dump_modify.html command, which
can be useful if the dump command is invoked after a minimization
ended on an arbitrary timestep. N can be changed between runs by
using the "dump_modify every"_dump_modify.html command.
Dump {image} filenames must contain a wildcard character "*", so that
one image file per snapshot is written. The "*" character is replaced
with the timestep value. For example, tmp.dump.*.jpg becomes
tmp.dump.0.jpg, tmp.dump.10000.jpg, tmp.dump.20000.jpg, etc. Note
that the "dump_modify pad"_dump_modify.html command can be used to
insure all timestep numbers are the same length (e.g. 00010), which
can make it easier to convert a series of images into a movie in the
correct ordering.
Dump {movie} filenames on the other hand, must not have any wildcard
character since only one file combining all images into a single
movie will be written by the movie encoder.
:line
The {color} and {diameter} settings determine the color and size of
atoms rendered in the image. They can be any atom attribute defined
for the "dump custom"_dump.html command, including {type} and
{element}. This includes per-atom quantities calculated by a
"compute"_compute.html, "fix"_fix.html, or "variable"_variable.html,
which are prefixed by "c_", "f_", or "v_" respectively. Note that the
{diameter} setting can be overridden with a numeric value applied to
all atoms by the optional {adiam} keyword.
If {type} is specified for the {color} setting, then the color of each
atom is determined by its atom type. By default the mapping of types
to colors is as follows:
type 1 = red
type 2 = green
type 3 = blue
type 4 = yellow
type 5 = aqua
type 6 = cyan :ul
and repeats itself for types > 6. This mapping can be changed by the
"dump_modify acolor"_dump_modify.html command.
If {type} is specified for the {diameter} setting then the diameter of
each atom is determined by its atom type. By default all types have
diameter 1.0. This mapping can be changed by the "dump_modify
adiam"_dump_modify.html command.
If {element} is specified for the {color} and/or {diameter} setting,
then the color and/or diameter of each atom is determined by which
element it is, which in turn is specified by the element-to-type
mapping specified by the "dump_modify element" command. By default
every atom type is C (carbon). Every element has a color and diameter
associated with it, which is the same as the colors and sizes used by
the "AtomEye"_atomeye visualization package.
:link(atomeye,http://mt.seas.upenn.edu/Archive/Graphics/A)
If other atom attributes are used for the {color} or {diameter}
settings, they are interpreted in the following way.
If "vx", for example, is used as the {color} setting, then the color
of the atom will depend on the x-component of its velocity. The
association of a per-atom value with a specific color is determined by
a "color map", which can be specified via the
"dump_modify"_dump_modify.html command. The basic idea is that the
atom-attribute will be within a range of values, and every value
within the range is mapped to a specific color. Depending on how the
color map is defined, that mapping can take place via interpolation so
that a value of -3.2 is halfway between "red" and "blue", or
discretely so that the value of -3.2 is "orange".
If "vx", for example, is used as the {diameter} setting, then the atom
will be rendered using the x-component of its velocity as the
diameter. If the per-atom value <= 0.0, them the atom will not be
drawn. Note that finite-size spherical particles, as defined by
"atom_style sphere"_atom_style.html define a per-particle radius or
diameter, which can be used as the {diameter} setting.
:line
The various kewords listed above control how the image is rendered.
As listed below, all of the keywords have defaults, most of which you
will likely not need to change. The "dump modify"_dump_modify.html
also has options specific to the dump image style, particularly for
assigning colors to atoms, bonds, and other image features.
:line
-The {adiam} keyword allows you to override the {diameter} setting to a
-per-atom attribute with a specified numeric value. All atoms will be
-drawn with that diameter, e.g. 1.5, which is in whatever distance
-"units"_units.html the input script defines, e.g. Angstroms.
+The {atom} keyword allow you to turn off the drawing of all atoms, if
+the specified value is {no}. Note that this will not turn off the
+drawing of particles that are represented as lines, triangles, or
+bodies, as discussed below. These particles can be drawn separately
+if the {line}, {tri}, or {body} keywords are used.
-The {atom} keyword allow you to turn off the drawing of all atoms,
-if the specified value is {no}.
-
-The {body} keyword can be used when "atom_style body"_atom_style.html
-is used to define body particles with internal state
-(e.g. sub-particles). The "body"_body.html doc page descibes the body
-styles LAMMPS currently supports, and provides more details as to the
-kind of body particles they represent and how they are drawn by this
-dump image command. For all the body styles, individual atoms can be
-either a body particle or a usual point (non-body) particle. If the
-{body} keyword is set to {yes}, then atoms which are body particles
-are drawn by the method defined by the body style. Non-body particles
-the same way they would be if the {body} keyword is {no}, i.e. as
-spheres. The {bflag1} and {bflag2} settings are numerical values
-which are passed to the body style to affect how the drawing of a body
-particle is done. See the "body"_body.html doc page for a description
-of what these parameters mean for each body style.
+The {adiam} keyword allows you to override the {diameter} setting to
+set a single numeric {size}. All atoms will be drawn with that
+diameter, e.g. 1.5, which is in whatever distance "units"_units.html
+the input script defines, e.g. Angstroms.
The {bond} keyword allows to you to alter how bonds are drawn. A bond
is only drawn if both atoms in the bond are being drawn due to being
in the specified group and due to other selection criteria
(e.g. region, threshhold settings of the
"dump_modify"_dump_modify.html command). By default, bonds are drawn
if they are defined in the input data file as read by the
"read_data"_read_data.html command. Using {none} for both the bond
{color} and {width} value will turn off the drawing of all bonds.
If {atom} is specified for the bond {color} value, then each bond is
drawn in 2 halves, with the color of each half being the color of the
atom at that end of the bond.
If {type} is specified for the {color} value, then the color of each
bond is determined by its bond type. By default the mapping of bond
types to colors is as follows:
type 1 = red
type 2 = green
type 3 = blue
type 4 = yellow
type 5 = aqua
type 6 = cyan :ul
and repeats itself for bond types > 6. This mapping can be changed by
the "dump_modify bcolor"_dump_modify.html command.
The bond {width} value can be a numeric value or {atom} or {type} (or
{none} as indicated above).
If a numeric value is specified, then all bonds will be drawn as
cylinders with that diameter, e.g. 1.0, which is in whatever distance
"units"_units.html the input script defines, e.g. Angstroms.
If {atom} is specified for the {width} value, then each bond
will be drawn with a width corresponding to the minimum diameter
of the 2 atoms in the bond.
If {type} is specified for the {width} value then the diameter of each
bond is determined by its bond type. By default all types have
diameter 0.5. This mapping can be changed by the "dump_modify
bdiam"_dump_modify.html command.
+The {line} keyword can be used when "atom_style line"_atom_style.html
+is used to define particles as line segments, and will draw them as
+lines. If this keyword is not used, such particles will be drawn as
+spheres, the same as if they were regular atoms. The only setting
+currently allowed for the {color} value is {type}, which will color
+the lines according to the atom type of the particle. By default the
+mapping of types to colors is as follows:
+
+type 1 = red
+type 2 = green
+type 3 = blue
+type 4 = yellow
+type 5 = aqua
+type 6 = cyan :ul
+
+and repeats itself for types > 6. There is not yet an option to
+change this via the "dump_modify"_dump_modify.html command.
+
+The line {width} can only be a numeric value, which specifies that all
+lines will be drawn as cylinders with that diameter, e.g. 1.0, which
+is in whatever distance "units"_units.html the input script defines,
+e.g. Angstroms.
+
+The {tri} keyword can be used when "atom_style tri"_atom_style.html is
+used to define particles as triangles, and will draw them as
+triangles. If this keyword is not used, such particles will be drawn
+as spheres, the same as if they were regular atoms. The only setting
+currently allowed for the {color} value is {type}, which will color
+the triangles according to the atom type of the particle. By default
+the mapping of types to colors is as follows:
+
+type 1 = red
+type 2 = green
+type 3 = blue
+type 4 = yellow
+type 5 = aqua
+type 6 = cyan :ul
+
+and repeats itself for types > 6. There is not yet an option to
+change this via the "dump_modify"_dump_modify.html command.
+
+The {body} keyword can be used when "atom_style body"_atom_style.html
+is used to define body particles with internal state
+(e.g. sub-particles), and will drawn them in a manner specific to the
+body style. If this keyword is not used, such particles will be drawn
+as spheres, the same as if they were regular atoms.
+
+The "body"_body.html doc page descibes the body styles LAMMPS
+currently supports, and provides more details as to the kind of body
+particles they represent and how they are drawn by this dump image
+command. For all the body styles, individual atoms can be either a
+body particle or a usual point (non-body) particle. Non-body
+particles will be drawn the same way they would be as a regular atom.
+The {bflag1} and {bflag2} settings are numerical values which are
+passed to the body style to affect how the drawing of a body particle
+is done. See the "body"_body.html doc page for a description of what
+these parameters mean for each body style.
+
:line
The {size} keyword sets the width and height of the created images,
i.e. the number of pixels in each direction.
:line
The {view}, {center}, {up}, {zoom}, and {persp} values determine how
3d simulation space is mapped to the 2d plane of the image. Basically
they control how the simulation box appears in the image.
All of the {view}, {center}, {up}, {zoom}, and {persp} values can be
specified as numeric quantities, whose meaning is explained below.
Any of them can also be specified as an "equal-style
variable"_variable.html, by using v_name as the value, where "name" is
the variable name. In this case the variable will be evaluated on the
timestep each image is created to create a new value. If the
equal-style variable is time-dependent, this is a means of changing
the way the simulation box appears from image to image, effectively
doing a pan or fly-by view of your simulation.
The {view} keyword determines the viewpoint from which the simulation
box is viewed, looking towards the {center} point. The {theta} value
is the vertical angle from the +z axis, and must be an angle from 0 to
180 degrees. The {phi} value is an azimuthal angle around the z axis
and can be positive or negative. A value of 0.0 is a view along the
+x axis, towards the {center} point. If {theta} or {phi} are
specified via variables, then the variable values should be in
degrees.
The {center} keyword determines the point in simulation space that
will be at the center of the image. {Cx}, {Cy}, and {Cz} are
speficied as fractions of the box dimensions, so that (0.5,0.5,0.5) is
the center of the simulation box. These values do not have to be
between 0.0 and 1.0, if you want the simulation box to be offset from
the center of the image. Note, however, that if you choose strange
values for {Cx}, {Cy}, or {Cz} you may get a blank image. Internally,
{Cx}, {Cy}, and {Cz} are converted into a point in simulation space.
If {flag} is set to "s" for static, then this conversion is done once,
at the time the dump command is issued. If {flag} is set to "d" for
dynamic then the conversion is performed every time a new image is
created. If the box size or shape is changing, this will adjust the
center point in simulation space.
The {up} keyword determines what direction in simulation space will be
"up" in the image. Internally it is stored as a vector that is in the
plane perpendicular to the view vector implied by the {theta} and
{pni} values, and which is also in the plane defined by the view
vector and user-specified up vector. Thus this internal vector is
computed from the user-specified {up} vector as
up_internal = view cross (up cross view) :pre
This means the only restriction on the specified {up} vector is that
it cannot be parallel to the {view} vector, implied by the {theta} and
{phi} values.
The {zoom} keyword scales the size of the simulation box as it appears
in the image. The default {zfactor} value of 1 should display an
image mostly filled by the atoms in the simulation box. A {zfactor} >
1 will make the simulation box larger; a {zfactor} < 1 will make it
smaller. {Zfactor} must be a value > 0.0.
The {persp} keyword determines how much depth perspective is present
in the image. Depth perspective makes lines that are parallel in
simulation space appear non-parallel in the image. A {pfactor} value
of 0.0 means that parallel lines will meet at infininty (1.0/pfactor),
which is an orthographic rendering with no persepctive. A {pfactor}
value between 0.0 and 1.0 will introduce more perspective. A {pfactor}
value > 1 will create a highly skewed image with a large amount of
perspective.
NOTE: The {persp} keyword is not yet supported as an option.
:line
The {box} keyword determines if and how the simulation box boundaries
are rendered as thin cylinders in the image. If {no} is set, then the
box boundaries are not drawn and the {diam} setting is ignored. If
{yes} is set, the 12 edges of the box are drawn, with a diameter that
is a fraction of the shortest box length in x,y,z (for 3d) or x,y (for
2d). The color of the box boundaries can be set with the "dump_modify
boxcolor"_dump_modify.html command.
The {axes} keyword determines if and how the coordinate axes are
rendered as thin cylinders in the image. If {no} is set, then the
axes are not drawn and the {length} and {diam} settings are ignored.
If {yes} is set, 3 thin cylinders are drawn to represent the x,y,z
axes in colors red,green,blue. The origin of these cylinders will be
offset from the lower left corner of the box by 10%. The {length}
setting determines how long the cylinders will be as a fraction of the
respective box lengths. The {diam} setting determines their thickness
as a fraction of the shortest box length in x,y,z (for 3d) or x,y (for
2d).
The {subbox} keyword determines if and how processor sub-domain
boundaries are rendered as thin cylinders in the image. If {no} is
set (default), then the sub-domain boundaries are not drawn and the
{diam} setting is ignored. If {yes} is set, the 12 edges of each
processor sub-domain are drawn, with a diameter that is a fraction of
the shortest box length in x,y,z (for 3d) or x,y (for 2d). The color
of the sub-domain boundaries can be set with the "dump_modify
boxcolor"_dump_modify.html command.
:line
The {shiny} keyword determines how shiny the objects rendered in the
image will appear. The {sfactor} value must be a value 0.0 <=
{sfactor} <= 1.0, where {sfactor} = 1 is a highly reflective surface
and {sfactor} = 0 is a rough non-shiny surface.
The {ssao} keyword turns on/off a screen space ambient occlusion
(SSAO) model for depth shading. If {yes} is set, then atoms further
away from the viewer are darkened via a randomized process, which is
perceived as depth. The calculation of this effect can increase the
cost of computing the image by roughly 2x. The strength of the effect
can be scaled by the {dfactor} parameter. If {no} is set, no depth
shading is performed.
:line
A series of JPEG, PNG, or PPM images can be converted into a movie
file and then played as a movie using commonly available tools. Using
dump style {movie} automates this step and avoids the intermediate
step of writing (many) image snapshot file. But LAMMPS has to be
compiled with -DLAMMPS_FFMPEG and an FFmpeg executable have to be
installed.
To manually convert JPEG, PNG or PPM files into an animated GIF or
MPEG or other movie file you can use:
a) Use the ImageMagick convert program. :ulb,l
% convert *.jpg foo.gif
% convert -loop 1 *.ppm foo.mpg :pre
Animated GIF files from ImageMagick are unoptimized. You can use a
program like gifsicle to optimize and massively shrink them.
MPEG files created by ImageMagick are in MPEG-1 format with rather
inefficient compression and low quality.
b) Use QuickTime. :l
Select "Open Image Sequence" under the File menu Load the images into
QuickTime to animate them Select "Export" under the File menu Save the
movie as a QuickTime movie (*.mov) or in another format. QuickTime
can generate very high quality and efficiently compressed movie
files. Some of the supported formats require to buy a license and some
are not readable on all platforms until specific runtime libraries are
installed.
c) Use FFmpeg :l
FFmpeg is a command line tool that is available on many platforms and
allows extremely flexible encoding and decoding of movies.
cat snap.*.jpg | ffmpeg -y -f image2pipe -c:v mjpeg -i - -b:v 2000k movie.m4v
cat snap.*.ppm | ffmpeg -y -f image2pipe -c:v ppm -i - -b:v 2400k movie.avi :pre
Frontends for FFmpeg exist for multiple platforms. For more
information see the "FFmpeg homepage"_http://www.ffmpeg.org/
:ule
:line
Play the movie:
a) Use your browser to view an animated GIF movie. :ulb,l
Select "Open File" under the File menu
Load the animated GIF file
b) Use the freely available mplayer or ffplay tool to view a
movie. Both are available for multiple OSes and support a large
variety of file formats and decoders. :l
% mplayer foo.mpg
% ffplay bar.avi :pre
c) Use the "Pizza.py"_http://www.sandia.gov/~sjplimp/pizza.html
"animate tool"_http://www.sandia.gov/~sjplimp/pizza/doc/animate.html,
which works directly on a series of image files. :l
a = animate("foo*.jpg") :pre
d) QuickTime and other Windows- or MacOS-based media players can
obviously play movie files directly. Similarly for corresponding tools
bundled with Linux desktop environments. However, due to licensing
issues with some file formats, the formats may require installing
additional libraries, purchasing a license, or may not be
supported. :ule,l
:line
See "Section_modify"_Section_modify.html of the manual for information
on how to add new compute and fix styles to LAMMPS to calculate
per-atom quantities which could then be output into dump files.
:line
[Restrictions:]
To write JPEG images, you must use the -DLAMMPS_JPEG switch when
building LAMMPS and link with a JPEG library. To write PNG images, you
must use the -DLAMMPS_PNG switch when building LAMMPS and link with a
PNG library.
To write {movie} dumps, you must use the -DLAMMPS_FFMPEG switch when
building LAMMPS and have the FFmpeg executable available on the
machine where LAMMPS is being run. Typically it's name is lowercase,
i.e. ffmpeg.
See the "Making LAMMPS"_Section_start.html#start_2_4 section of the
documentation for details on how to compile with optional switches.
Note that since FFmpeg is run as an external program via a pipe,
LAMMPS has limited control over its execution and no knowledge about
errors and warnings printed by it. Those warnings and error messages
will be printed to the screen only. Due to the way image data is
communicated to FFmpeg, it will often print the message
pipe:: Input/output error :pre
which can be safely ignored. Other warnings
and errors have to be addressed according to the FFmpeg documentation.
One known issue is that certain movie file formats (e.g. MPEG level 1
and 2 format streams) have video bandwith limits that can be crossed
when rendering too large of image sizes. Typical warnings look like
this:
\[mpeg @ 0x98b5e0\] packet too large, ignoring buffer limits to mux it
\[mpeg @ 0x98b5e0\] buffer underflow st=0 bufi=281407 size=285018
\[mpeg @ 0x98b5e0\] buffer underflow st=0 bufi=283448 size=285018 :pre
In this case it is recommended to either reduce the size of the image
or encode in a different format that is also supported by your copy of
FFmpeg, and which does not have this limitation (e.g. .avi, .mkv,
mp4).
[Related commands:]
"dump"_dump.html, "dump_modify"_dump_modify.html, "undump"_undump.html
[Default:]
The defaults for the keywords are as follows:
adiam = not specified (use diameter setting)
atom = yes
bond = none none (if no bonds in system)
bond = atom 0.5 (if bonds in system)
size = 512 512
view = 60 30 (for 3d)
view = 0 0 (for 2d)
center = s 0.5 0.5 0.5
up = 0 0 1 (for 3d)
up = 0 1 0 (for 2d)
zoom = 1.0
persp = 0.0
box = yes 0.02
axes = no 0.0 0.0
subbox no 0.0
shiny = 1.0
ssao = no :ul
diff --git a/doc/fix_move.html b/doc/fix_move.html
index c26861551..337955c92 100644
--- a/doc/fix_move.html
+++ b/doc/fix_move.html
@@ -1,404 +1,408 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>fix move command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>fix move command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="fix-move-command">
<span id="index-0"></span><h1>fix move command<a class="headerlink" href="#fix-move-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix ID group-ID move style args keyword values ...
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="fix.html"><em>fix</em></a> command</li>
<li>move = style name of this fix command</li>
<li>style = <em>linear</em> or <em>wiggle</em> or <em>rotate</em> or <em>variable</em></li>
</ul>
<pre class="literal-block">
<em>linear</em> args = Vx Vy Vz
Vx,Vy,Vz = components of velocity vector (velocity units), any component can be specified as NULL
<em>wiggle</em> args = Ax Ay Az period
Ax,Ay,Az = components of amplitude vector (distance units), any component can be specified as NULL
period = period of oscillation (time units)
<em>rotate</em> args = Px Py Pz Rx Ry Rz period
Px,Py,Pz = origin point of axis of rotation (distance units)
Rx,Ry,Rz = axis of rotation vector
period = period of rotation (time units)
<em>variable</em> args = v_dx v_dy v_dz v_vx v_vy v_vz
v_dx,v_dy,v_dz = 3 variable names that calculate x,y,z displacement as function of time, any component can be specified as NULL
v_vx,v_vy,v_vz = 3 variable names that calculate x,y,z velocity as function of time, any component can be specified as NULL
</pre>
<ul class="simple">
<li>zero or more keyword/value pairs may be appended</li>
<li>keyword = <em>units</em></li>
</ul>
<pre class="literal-block">
<em>units</em> value = <em>box</em> or <em>lattice</em>
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix 1 boundary move wiggle 3.0 0.0 0.0 1.0 units box
fix 2 boundary move rotate 0.0 0.0 0.0 0.0 0.0 1.0 5.0
fix 2 boundary move variable v_myx v_myy NULL v_VX v_VY NULL
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Perform updates of position and velocity for atoms in the group each
timestep using the specified settings or formulas, without regard to
forces on the atoms. This can be useful for boundary or other atoms,
whose movement can influence nearby atoms.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The atoms affected by this fix should not normally be time
integrated by other fixes (e.g. <a class="reference internal" href="fix_nve.html"><em>fix nve</em></a>, <a class="reference internal" href="fix_nh.html"><em>fix nvt</em></a>), since that will change their positions and
velocities twice.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">As atoms move due to this fix, they will pass thru periodic
boundaries and be remapped to the other side of the simulation box,
just as they would during normal time integration (e.g. via the <a class="reference internal" href="fix_nve.html"><em>fix nve</em></a> command). It is up to you to decide whether
periodic boundaries are appropriate with the kind of atom motion you
are prescribing with this fix.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">As dicsussed below, atoms are moved relative to their initial
position at the time the fix is specified. These initial coordinates
are stored by the fix in &#8220;unwrapped&#8221; form, by using the image flags
associated with each atom. See the <a class="reference internal" href="dump.html"><em>dump custom</em></a> command
for a discussion of &#8220;unwrapped&#8221; coordinates. See the Atoms section of
the <a class="reference internal" href="read_data.html"><em>read_data</em></a> command for a discussion of image flags
and how they are set for each atom. You can reset the image flags
(e.g. to 0) before invoking this fix by using the <a class="reference internal" href="set.html"><em>set image</em></a>
command.</p>
</div>
<hr class="docutils" />
<p>The <em>linear</em> style moves atoms at a constant velocity, so that their
position <em>X</em> = (x,y,z) as a function of time is given in vector
notation as</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">X</span><span class="p">(</span><span class="n">t</span><span class="p">)</span> <span class="o">=</span> <span class="n">X0</span> <span class="o">+</span> <span class="n">V</span> <span class="o">*</span> <span class="n">delta</span>
</pre></div>
</div>
<p>where <em>X0</em> = (x0,y0,z0) is their position at the time the fix is
specified, <em>V</em> is the specified velocity vector with components
(Vx,Vy,Vz), and <em>delta</em> is the time elapsed since the fix was
specified. This style also sets the velocity of each atom to V =
(Vx,Vy,Vz). If any of the velocity components is specified as NULL,
then the position and velocity of that component is time integrated
the same as the <a class="reference internal" href="fix_nve.html"><em>fix nve</em></a> command would perform, using
the corresponding force component on the atom.</p>
<p>Note that the <em>linear</em> style is identical to using the <em>variable</em>
style with an <a class="reference internal" href="variable.html"><em>equal-style variable</em></a> that uses the
vdisplace() function. E.g.</p>
<div class="highlight-python"><div class="highlight"><pre>variable V equal 10.0
variable x equal vdisplace(0.0,$V)
fix 1 boundary move variable v_x NULL NULL v_V NULL NULL
</pre></div>
</div>
<p>The <em>wiggle</em> style moves atoms in an oscillatory fashion, so that
their position <em>X</em> = (x,y,z) as a function of time is given in vector
notation as</p>
<div class="highlight-python"><div class="highlight"><pre>X(t) = X0 + A sin(omega*delta)
</pre></div>
</div>
<p>where <em>X0</em> = (x0,y0,z0) is their position at the time the fix is
specified, <em>A</em> is the specified amplitude vector with components
(Ax,Ay,Az), <em>omega</em> is 2 PI / <em>period</em>, and <em>delta</em> is the time
elapsed since the fix was specified. This style also sets the
velocity of each atom to the time derivative of this expression. If
any of the amplitude components is specified as NULL, then the
position and velocity of that component is time integrated the same as
the <a class="reference internal" href="fix_nve.html"><em>fix nve</em></a> command would perform, using the
corresponding force component on the atom.</p>
<p>Note that the <em>wiggle</em> style is identical to using the <em>variable</em>
style with <a class="reference internal" href="variable.html"><em>equal-style variables</em></a> that use the
swiggle() and cwiggle() functions. E.g.</p>
<div class="highlight-python"><div class="highlight"><pre>variable A equal 10.0
variable T equal 5.0
variable omega equal 2.0*PI/$T
variable x equal swiggle(0.0,$A,$T)
variable v equal v_omega*($A-cwiggle(0.0,$A,$T))
fix 1 boundary move variable v_x NULL NULL v_v NULL NULL
</pre></div>
</div>
<p>The <em>rotate</em> style rotates atoms around a rotation axis <em>R</em> =
(Rx,Ry,Rz) that goes thru a point <em>P</em> = (Px,Py,Pz). The <em>period</em> of
-the rotation is also specified. This style also sets the velocity of
-each atom to (omega cross Rperp) where omega is its angular velocity
-around the rotation axis and Rperp is a perpendicular vector from the
-rotation axis to the atom. If the defined
-<a class="reference internal" href="atom_style.html"><em>atom_style</em></a> assigns an angular velocity to each atom,
-then each atom&#8217;s angular velocity is also set to omega. Note that the
-direction of rotation for the atoms around the rotation axis is
-consistent with the right-hand rule: if your right-hand&#8217;s thumb points
-along <em>R</em>, then your fingers wrap around the axis in the direction of
-rotation.</p>
+the rotation is also specified. The direction of rotation for the
+atoms around the rotation axis is consistent with the right-hand rule:
+if your right-hand thumb points along <em>R</em>, then your fingers wrap
+around the axis in the direction of rotation.</p>
+<p>This style also sets the velocity of each atom to (omega cross Rperp)
+where omega is its angular velocity around the rotation axis and Rperp
+is a perpendicular vector from the rotation axis to the atom. If the
+defined <a class="reference internal" href="atom_style.html"><em>atom_style</em></a> assigns an angular velocity or
+angular moementum or orientation to each atom (<a class="reference internal" href="atom_style.html"><em>atom styles</em></a> sphere, ellipsoid, line, tri, body), then
+those properties are also updated appropriately to correspond to the
+atom&#8217;s motion and rotation over time.</p>
<p>The <em>variable</em> style allows the position and velocity components of
each atom to be set by formulas specified via the
<a class="reference internal" href="variable.html"><em>variable</em></a> command. Each of the 6 variables is
specified as an argument to the fix as v_name, where name is the
variable name that is defined elsewhere in the input script.</p>
<p>Each variable must be of either the <em>equal</em> or <em>atom</em> style.
<em>Equal</em>-style variables compute a single numeric quantity, that can be
a function of the timestep as well as of other simulation values.
<em>Atom</em>-style variables compute a numeric quantity for each atom, that
can be a function per-atom quantities, such as the atom&#8217;s position, as
well as of the timestep and other simulation values. Note that this
fix stores the original coordinates of each atom (see note below) so
that per-atom quantity can be used in an atom-style variable formula.
See the <a class="reference internal" href="variable.html"><em>variable</em></a> command for details.</p>
<p>The first 3 variables (v_dx,v_dy,v_dz) specified for the <em>variable</em>
style are used to calculate a displacement from the atom&#8217;s original
position at the time the fix was specified. The second 3 variables
(v_vx,v_vy,v_vz) specified are used to compute a velocity for each
atom.</p>
<p>Any of the 6 variables can be specified as NULL. If both the
displacement and velocity variables for a particular x,y,z component
are specified as NULL, then the position and velocity of that
component is time integrated the same as the <a class="reference internal" href="fix_nve.html"><em>fix nve</em></a>
command would perform, using the corresponding force component on the
atom. If only the velocity variable for a component is specified as
NULL, then the displacement variable will be used to set the position
of the atom, and its velocity component will not be changed. If only
the displacement variable for a component is specified as NULL, then
the velocity variable will be used to set the velocity of the atom,
and the position of the atom will be time integrated using that
velocity.</p>
<p>The <em>units</em> keyword determines the meaning of the distance units used
to define the <em>linear</em> velocity and <em>wiggle</em> amplitude and <em>rotate</em>
origin. This setting is ignored for the <em>variable</em> style. A <em>box</em>
value selects standard units as defined by the <a class="reference internal" href="units.html"><em>units</em></a>
command, e.g. velocity in Angstroms/fmsec and amplitude and position
in Angstroms for units = real. A <em>lattice</em> value means the velocity
units are in lattice spacings per time and the amplitude and position
are in lattice spacings. The <a class="reference internal" href="lattice.html"><em>lattice</em></a> command must have
been previously used to define the lattice spacing. Each of these 3
quantities may be dependent on the x,y,z dimension, since the lattice
spacings can be different in x,y,z.</p>
</div>
<hr class="docutils" />
<div class="section" id="restart-fix-modify-output-run-start-stop-minimize-info">
<h2>Restart, fix_modify, output, run start/stop, minimize info<a class="headerlink" href="#restart-fix-modify-output-run-start-stop-minimize-info" title="Permalink to this headline">¶</a></h2>
<p>This fix writes the original coordinates of moving atoms to <a class="reference internal" href="restart.html"><em>binary restart files</em></a>, as well as the initial timestep, so that
the motion can be continuous in a restarted simulation. See the
<a class="reference internal" href="read_restart.html"><em>read_restart</em></a> command for info on how to re-specify
a fix in an input script that reads a restart file, so that the
operation of the fix continues in an uninterrupted fashion.</p>
-<p>IMPORTANNT NOTE: Because the move positions are a function of the
-current timestep and the initial timestep, you cannot reset the
-timestep to a different value after reading a restart file, if you
-expect a fix move command to work in an uninterrupted fashion.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Because the move positions are a function of the current
+timestep and the initial timestep, you cannot reset the timestep to a
+different value after reading a restart file, if you expect a fix move
+command to work in an uninterrupted fashion.</p>
+</div>
<p>None of the <a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a> options are relevant to this
fix.</p>
<p>This fix produces a per-atom array which can be accessed by various
<a class="reference internal" href="Section_howto.html#howto-15"><span>output commands</span></a>. The number of columns
for each atom is 3, and the columns store the original unwrapped x,y,z
coords of each atom. The per-atom values can be accessed on any
timestep.</p>
<p>No parameter of this fix can be used with the <em>start/stop</em> keywords of
the <a class="reference internal" href="run.html"><em>run</em></a> command. This fix is not invoked during <a class="reference internal" href="minimize.html"><em>energy minimization</em></a>.</p>
<p>For <a class="reference internal" href="run_style.html"><em>rRESPA time integration</em></a>, this fix adjusts the
position and velocity of atoms on the outermost rRESPA level.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div>none</div></blockquote>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="fix_nve.html"><em>fix nve</em></a>, <a class="reference internal" href="displace_atoms.html"><em>displace_atoms</em></a></p>
<p><strong>Default:</strong> none</p>
<p>The option default is units = lattice.</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/fix_move.txt b/doc/fix_move.txt
index 2d2b9121c..89bd37bf0 100644
--- a/doc/fix_move.txt
+++ b/doc/fix_move.txt
@@ -1,223 +1,226 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
fix move command :h3
[Syntax:]
fix ID group-ID move style args keyword values ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
move = style name of this fix command :l
style = {linear} or {wiggle} or {rotate} or {variable} :l
{linear} args = Vx Vy Vz
Vx,Vy,Vz = components of velocity vector (velocity units), any component can be specified as NULL
{wiggle} args = Ax Ay Az period
Ax,Ay,Az = components of amplitude vector (distance units), any component can be specified as NULL
period = period of oscillation (time units)
{rotate} args = Px Py Pz Rx Ry Rz period
Px,Py,Pz = origin point of axis of rotation (distance units)
Rx,Ry,Rz = axis of rotation vector
period = period of rotation (time units)
{variable} args = v_dx v_dy v_dz v_vx v_vy v_vz
v_dx,v_dy,v_dz = 3 variable names that calculate x,y,z displacement as function of time, any component can be specified as NULL
v_vx,v_vy,v_vz = 3 variable names that calculate x,y,z velocity as function of time, any component can be specified as NULL :pre
zero or more keyword/value pairs may be appended :l
keyword = {units} :l
{units} value = {box} or {lattice} :pre
:ule
[Examples:]
fix 1 boundary move wiggle 3.0 0.0 0.0 1.0 units box
fix 2 boundary move rotate 0.0 0.0 0.0 0.0 0.0 1.0 5.0
fix 2 boundary move variable v_myx v_myy NULL v_VX v_VY NULL :pre
[Description:]
Perform updates of position and velocity for atoms in the group each
timestep using the specified settings or formulas, without regard to
forces on the atoms. This can be useful for boundary or other atoms,
whose movement can influence nearby atoms.
NOTE: The atoms affected by this fix should not normally be time
integrated by other fixes (e.g. "fix nve"_fix_nve.html, "fix
nvt"_fix_nh.html), since that will change their positions and
velocities twice.
NOTE: As atoms move due to this fix, they will pass thru periodic
boundaries and be remapped to the other side of the simulation box,
just as they would during normal time integration (e.g. via the "fix
nve"_fix_nve.html command). It is up to you to decide whether
periodic boundaries are appropriate with the kind of atom motion you
are prescribing with this fix.
NOTE: As dicsussed below, atoms are moved relative to their initial
position at the time the fix is specified. These initial coordinates
are stored by the fix in "unwrapped" form, by using the image flags
associated with each atom. See the "dump custom"_dump.html command
for a discussion of "unwrapped" coordinates. See the Atoms section of
the "read_data"_read_data.html command for a discussion of image flags
and how they are set for each atom. You can reset the image flags
(e.g. to 0) before invoking this fix by using the "set image"_set.html
command.
:line
The {linear} style moves atoms at a constant velocity, so that their
position {X} = (x,y,z) as a function of time is given in vector
notation as
X(t) = X0 + V * delta :pre
where {X0} = (x0,y0,z0) is their position at the time the fix is
specified, {V} is the specified velocity vector with components
(Vx,Vy,Vz), and {delta} is the time elapsed since the fix was
specified. This style also sets the velocity of each atom to V =
(Vx,Vy,Vz). If any of the velocity components is specified as NULL,
then the position and velocity of that component is time integrated
the same as the "fix nve"_fix_nve.html command would perform, using
the corresponding force component on the atom.
Note that the {linear} style is identical to using the {variable}
style with an "equal-style variable"_variable.html that uses the
vdisplace() function. E.g.
variable V equal 10.0
variable x equal vdisplace(0.0,$V)
fix 1 boundary move variable v_x NULL NULL v_V NULL NULL :pre
The {wiggle} style moves atoms in an oscillatory fashion, so that
their position {X} = (x,y,z) as a function of time is given in vector
notation as
X(t) = X0 + A sin(omega*delta) :pre
where {X0} = (x0,y0,z0) is their position at the time the fix is
specified, {A} is the specified amplitude vector with components
(Ax,Ay,Az), {omega} is 2 PI / {period}, and {delta} is the time
elapsed since the fix was specified. This style also sets the
velocity of each atom to the time derivative of this expression. If
any of the amplitude components is specified as NULL, then the
position and velocity of that component is time integrated the same as
the "fix nve"_fix_nve.html command would perform, using the
corresponding force component on the atom.
Note that the {wiggle} style is identical to using the {variable}
style with "equal-style variables"_variable.html that use the
swiggle() and cwiggle() functions. E.g.
variable A equal 10.0
variable T equal 5.0
variable omega equal 2.0*PI/$T
variable x equal swiggle(0.0,$A,$T)
variable v equal v_omega*($A-cwiggle(0.0,$A,$T))
fix 1 boundary move variable v_x NULL NULL v_v NULL NULL :pre
The {rotate} style rotates atoms around a rotation axis {R} =
(Rx,Ry,Rz) that goes thru a point {P} = (Px,Py,Pz). The {period} of
-the rotation is also specified. This style also sets the velocity of
-each atom to (omega cross Rperp) where omega is its angular velocity
-around the rotation axis and Rperp is a perpendicular vector from the
-rotation axis to the atom. If the defined
-"atom_style"_atom_style.html assigns an angular velocity to each atom,
-then each atom's angular velocity is also set to omega. Note that the
-direction of rotation for the atoms around the rotation axis is
-consistent with the right-hand rule: if your right-hand's thumb points
-along {R}, then your fingers wrap around the axis in the direction of
-rotation.
+the rotation is also specified. The direction of rotation for the
+atoms around the rotation axis is consistent with the right-hand rule:
+if your right-hand thumb points along {R}, then your fingers wrap
+around the axis in the direction of rotation.
+
+This style also sets the velocity of each atom to (omega cross Rperp)
+where omega is its angular velocity around the rotation axis and Rperp
+is a perpendicular vector from the rotation axis to the atom. If the
+defined "atom_style"_atom_style.html assigns an angular velocity or
+angular moementum or orientation to each atom ("atom
+styles"_atom_style.html sphere, ellipsoid, line, tri, body), then
+those properties are also updated appropriately to correspond to the
+atom's motion and rotation over time.
The {variable} style allows the position and velocity components of
each atom to be set by formulas specified via the
"variable"_variable.html command. Each of the 6 variables is
specified as an argument to the fix as v_name, where name is the
variable name that is defined elsewhere in the input script.
Each variable must be of either the {equal} or {atom} style.
{Equal}-style variables compute a single numeric quantity, that can be
a function of the timestep as well as of other simulation values.
{Atom}-style variables compute a numeric quantity for each atom, that
can be a function per-atom quantities, such as the atom's position, as
well as of the timestep and other simulation values. Note that this
fix stores the original coordinates of each atom (see note below) so
that per-atom quantity can be used in an atom-style variable formula.
See the "variable"_variable.html command for details.
The first 3 variables (v_dx,v_dy,v_dz) specified for the {variable}
style are used to calculate a displacement from the atom's original
position at the time the fix was specified. The second 3 variables
(v_vx,v_vy,v_vz) specified are used to compute a velocity for each
atom.
Any of the 6 variables can be specified as NULL. If both the
displacement and velocity variables for a particular x,y,z component
are specified as NULL, then the position and velocity of that
component is time integrated the same as the "fix nve"_fix_nve.html
command would perform, using the corresponding force component on the
atom. If only the velocity variable for a component is specified as
NULL, then the displacement variable will be used to set the position
of the atom, and its velocity component will not be changed. If only
the displacement variable for a component is specified as NULL, then
the velocity variable will be used to set the velocity of the atom,
and the position of the atom will be time integrated using that
velocity.
The {units} keyword determines the meaning of the distance units used
to define the {linear} velocity and {wiggle} amplitude and {rotate}
origin. This setting is ignored for the {variable} style. A {box}
value selects standard units as defined by the "units"_units.html
command, e.g. velocity in Angstroms/fmsec and amplitude and position
in Angstroms for units = real. A {lattice} value means the velocity
units are in lattice spacings per time and the amplitude and position
are in lattice spacings. The "lattice"_lattice.html command must have
been previously used to define the lattice spacing. Each of these 3
quantities may be dependent on the x,y,z dimension, since the lattice
spacings can be different in x,y,z.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
This fix writes the original coordinates of moving atoms to "binary
restart files"_restart.html, as well as the initial timestep, so that
the motion can be continuous in a restarted simulation. See the
"read_restart"_read_restart.html command for info on how to re-specify
a fix in an input script that reads a restart file, so that the
operation of the fix continues in an uninterrupted fashion.
-IMPORTANNT NOTE: Because the move positions are a function of the
-current timestep and the initial timestep, you cannot reset the
-timestep to a different value after reading a restart file, if you
-expect a fix move command to work in an uninterrupted fashion.
+NOTE: Because the move positions are a function of the current
+timestep and the initial timestep, you cannot reset the timestep to a
+different value after reading a restart file, if you expect a fix move
+command to work in an uninterrupted fashion.
None of the "fix_modify"_fix_modify.html options are relevant to this
fix.
This fix produces a per-atom array which can be accessed by various
"output commands"_Section_howto.html#howto_15. The number of columns
for each atom is 3, and the columns store the original unwrapped x,y,z
coords of each atom. The per-atom values can be accessed on any
timestep.
No parameter of this fix can be used with the {start/stop} keywords of
the "run"_run.html command. This fix is not invoked during "energy
minimization"_minimize.html.
For "rRESPA time integration"_run_style.html, this fix adjusts the
position and velocity of atoms on the outermost rRESPA level.
[Restrictions:] none
[Related commands:]
"fix nve"_fix_nve.html, "displace_atoms"_displace_atoms.html
[Default:] none
The option default is units = lattice.
diff --git a/doc/fix_nh.html b/doc/fix_nh.html
index 1b3f27671..72f9488ef 100644
--- a/doc/fix_nh.html
+++ b/doc/fix_nh.html
@@ -1,755 +1,785 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>fix nvt command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>fix nvt command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="fix-nvt-command">
<span id="index-0"></span><h1>fix nvt command<a class="headerlink" href="#fix-nvt-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-nvt-cuda-command">
<h1>fix nvt/cuda command<a class="headerlink" href="#fix-nvt-cuda-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-nvt-kk-command">
<h1>fix nvt/kk command<a class="headerlink" href="#fix-nvt-kk-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-nvt-omp-command">
<h1>fix nvt/omp command<a class="headerlink" href="#fix-nvt-omp-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-npt-command">
<h1>fix npt command<a class="headerlink" href="#fix-npt-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-npt-cuda-command">
<h1>fix npt/cuda command<a class="headerlink" href="#fix-npt-cuda-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-npt-intel-command">
<h1>fix npt/intel command<a class="headerlink" href="#fix-npt-intel-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-npt-kk-command">
<h1>fix npt/kk command<a class="headerlink" href="#fix-npt-kk-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-npt-omp-command">
<h1>fix npt/omp command<a class="headerlink" href="#fix-npt-omp-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-nph-command">
<h1>fix nph command<a class="headerlink" href="#fix-nph-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-nph-kk-command">
<h1>fix nph/kk command<a class="headerlink" href="#fix-nph-kk-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-nph-omp-command">
<h1>fix nph/omp command<a class="headerlink" href="#fix-nph-omp-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix ID group-ID style_name keyword value ...
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="fix.html"><em>fix</em></a> command</li>
<li>style_name = <em>nvt</em> or <em>npt</em> or <em>nph</em></li>
<li>one or more keyword/value pairs may be appended</li>
</ul>
<pre class="literal-block">
-keyword = <em>temp</em> or <em>iso</em> or <em>aniso</em> or <em>tri</em> or <em>x</em> or <em>y</em> or <em>z</em> or <em>xy</em> or <em>yz</em> or <em>xz</em> or <em>couple</em> or <em>tchain</em> or <em>pchain</em> or <em>mtk</em> or <em>tloop</em> or <em>ploop</em> or <em>nreset</em> or <em>drag</em> or <em>dilate</em> or <em>scalexy</em> or <em>scaleyz</em> or <em>scalexz</em> or <em>flip</em> or <em>fixedpoint</em>
+keyword = <em>temp</em> or <em>iso</em> or <em>aniso</em> or <em>tri</em> or <em>x</em> or <em>y</em> or <em>z</em> or <em>xy</em> or <em>yz</em> or <em>xz</em> or <em>couple</em> or <em>tchain</em> or <em>pchain</em> or <em>mtk</em> or <em>tloop</em> or <em>ploop</em> or <em>nreset</em> or <em>drag</em> or <em>dilate</em> or <em>scalexy</em> or <em>scaleyz</em> or <em>scalexz</em> or <em>flip</em> or <em>fixedpoint</em> or <em>update</em>
<em>temp</em> values = Tstart Tstop Tdamp
Tstart,Tstop = external temperature at start/end of run
Tdamp = temperature damping parameter (time units)
<em>iso</em> or <em>aniso</em> or <em>tri</em> values = Pstart Pstop Pdamp
Pstart,Pstop = scalar external pressure at start/end of run (pressure units)
Pdamp = pressure damping parameter (time units)
<em>x</em> or <em>y</em> or <em>z</em> or <em>xy</em> or <em>yz</em> or <em>xz</em> values = Pstart Pstop Pdamp
Pstart,Pstop = external stress tensor component at start/end of run (pressure units)
Pdamp = stress damping parameter (time units)
<em>couple</em> = <em>none</em> or <em>xyz</em> or <em>xy</em> or <em>yz</em> or <em>xz</em>
<em>tchain</em> value = N
N = length of thermostat chain (1 = single thermostat)
<em>pchain</em> values = N
N length of thermostat chain on barostat (0 = no thermostat)
<em>mtk</em> value = <em>yes</em> or <em>no</em> = add in MTK adjustment term or not
<em>tloop</em> value = M
M = number of sub-cycles to perform on thermostat
<em>ploop</em> value = M
M = number of sub-cycles to perform on barostat thermostat
<em>nreset</em> value = reset reference cell every this many timesteps
<em>drag</em> value = Df
Df = drag factor added to barostat/thermostat (0.0 = no drag)
<em>dilate</em> value = dilate-group-ID
dilate-group-ID = only dilate atoms in this group due to barostat volume changes
<em>scalexy</em> value = <em>yes</em> or <em>no</em> = scale xy with ly
<em>scaleyz</em> value = <em>yes</em> or <em>no</em> = scale yz with lz
<em>scalexz</em> value = <em>yes</em> or <em>no</em> = scale xz with lz
<em>flip</em> value = <em>yes</em> or <em>no</em> = allow or disallow box flips when it becomes highly skewed
<em>fixedpoint</em> values = x y z
x,y,z = perform barostat dilation/contraction around this point (distance units)
+ <em>update</em> value = <em>dipole</em> update dipole orientation (only for sphere variants)
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix 1 all nvt temp 300.0 300.0 100.0
fix 1 water npt temp 300.0 300.0 100.0 iso 0.0 0.0 1000.0
fix 2 jello npt temp 300.0 300.0 100.0 tri 5.0 5.0 1000.0
fix 2 ice nph x 1.0 1.0 0.5 y 2.0 2.0 0.5 z 3.0 3.0 0.5 yz 0.1 0.1 0.5 xz 0.2 0.2 0.5 xy 0.3 0.3 0.5 nreset 1000
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>These commands perform time integration on Nose-Hoover style
non-Hamiltonian equations of motion which are designed to generate
positions and velocities sampled from the canonical (nvt),
isothermal-isobaric (npt), and isenthalpic (nph) ensembles. This
updates the position and velocity for atoms in the group each
timestep.</p>
<p>The thermostatting and barostatting is achieved by adding some dynamic
variables which are coupled to the particle velocities
(thermostatting) and simulation domain dimensions (barostatting). In
addition to basic thermostatting and barostatting, these fixes can
also create a chain of thermostats coupled to the particle thermostat,
and another chain of thermostats coupled to the barostat
variables. The barostat can be coupled to the overall box volume, or
to individual dimensions, including the <em>xy</em>, <em>xz</em> and <em>yz</em> tilt
dimensions. The external pressure of the barostat can be specified as
either a scalar pressure (isobaric ensemble) or as components of a
symmetric stress tensor (constant stress ensemble). When used
correctly, the time-averaged temperature and stress tensor of the
particles will match the target values specified by Tstart/Tstop and
Pstart/Pstop.</p>
<p>The equations of motion used are those of Shinoda et al in
<a class="reference internal" href="pair_sdk.html#shinoda"><span>(Shinoda)</span></a>, which combine the hydrostatic equations of
Martyna, Tobias and Klein in <a class="reference internal" href="fix_rigid.html#martyna"><span>(Martyna)</span></a> with the strain
energy proposed by Parrinello and Rahman in
<a class="reference internal" href="fix_nh_eff.html#parrinello"><span>(Parrinello)</span></a>. The time integration schemes closely
follow the time-reversible measure-preserving Verlet and rRESPA
integrators derived by Tuckerman et al in <a class="reference internal" href="run_style.html#tuckerman"><span>(Tuckerman)</span></a>.</p>
<hr class="docutils" />
<p>The thermostat parameters for fix styles <em>nvt</em> and <em>npt</em> is specified
using the <em>temp</em> keyword. Other thermostat-related keywords are
<em>tchain</em>, <em>tloop</em> and <em>drag</em>, which are discussed below.</p>
<p>The thermostat is applied to only the translational degrees of freedom
for the particles. The translational degrees of freedom can also have
a bias velocity removed before thermostatting takes place; see the
description below. The desired temperature at each timestep is a
ramped value during the run from <em>Tstart</em> to <em>Tstop</em>. The <em>Tdamp</em>
parameter is specified in time units and determines how rapidly the
temperature is relaxed. For example, a value of 10.0 means to relax
the temperature in a timespan of (roughly) 10 time units (e.g. tau or
fmsec or psec - see the <a class="reference internal" href="units.html"><em>units</em></a> command). The atoms in the
fix group are the only ones whose velocities and positions are updated
by the velocity/position update portion of the integration.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">A Nose-Hoover thermostat will not work well for arbitrary values
of <em>Tdamp</em>. If <em>Tdamp</em> is too small, the temperature can fluctuate
wildly; if it is too large, the temperature will take a very long time
to equilibrate. A good choice for many models is a <em>Tdamp</em> of around
100 timesteps. Note that this is NOT the same as 100 time units for
most <a class="reference internal" href="units.html"><em>units</em></a> settings.</p>
</div>
<hr class="docutils" />
<p>The barostat parameters for fix styles <em>npt</em> and <em>nph</em> is specified
using one or more of the <em>iso</em>, <em>aniso</em>, <em>tri</em>, <em>x</em>, <em>y</em>, <em>z</em>, <em>xy</em>,
<em>xz</em>, <em>yz</em>, and <em>couple</em> keywords. These keywords give you the
ability to specify all 6 components of an external stress tensor, and
to couple various of these components together so that the dimensions
they represent are varied together during a constant-pressure
simulation.</p>
<p>Other barostat-related keywords are <em>pchain</em>, <em>mtk</em>, <em>ploop</em>,
<em>nreset</em>, <em>drag</em>, and <em>dilate</em>, which are discussed below.</p>
<p>Orthogonal simulation boxes have 3 adjustable dimensions (x,y,z).
Triclinic (non-orthogonal) simulation boxes have 6 adjustable
dimensions (x,y,z,xy,xz,yz). The <a class="reference internal" href="create_box.html"><em>create_box</em></a>, <a class="reference internal" href="read_data.html"><em>read data</em></a>, and <a class="reference internal" href="read_restart.html"><em>read_restart</em></a> commands
specify whether the simulation box is orthogonal or non-orthogonal
(triclinic) and explain the meaning of the xy,xz,yz tilt factors.</p>
<p>The target pressures for each of the 6 components of the stress tensor
can be specified independently via the <em>x</em>, <em>y</em>, <em>z</em>, <em>xy</em>, <em>xz</em>, <em>yz</em>
keywords, which correspond to the 6 simulation box dimensions. For
each component, the external pressure or tensor component at each
timestep is a ramped value during the run from <em>Pstart</em> to <em>Pstop</em>.
If a target pressure is specified for a component, then the
corresponding box dimension will change during a simulation. For
example, if the <em>y</em> keyword is used, the y-box length will change. If
the <em>xy</em> keyword is used, the xy tilt factor will change. A box
dimension will not change if that component is not specified, although
you have the option to change that dimension via the <a class="reference internal" href="fix_deform.html"><em>fix deform</em></a> command.</p>
<p>Note that in order to use the <em>xy</em>, <em>xz</em>, or <em>yz</em> keywords, the
simulation box must be triclinic, even if its initial tilt factors are
0.0.</p>
<p>For all barostat keywords, the <em>Pdamp</em> parameter operates like the
<em>Tdamp</em> parameter, determining the time scale on which pressure is
relaxed. For example, a value of 10.0 means to relax the pressure in
a timespan of (roughly) 10 time units (e.g. tau or fmsec or psec - see
the <a class="reference internal" href="units.html"><em>units</em></a> command).</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">A Nose-Hoover barostat will not work well for arbitrary values
of <em>Pdamp</em>. If <em>Pdamp</em> is too small, the pressure and volume can
fluctuate wildly; if it is too large, the pressure will take a very
long time to equilibrate. A good choice for many models is a <em>Pdamp</em>
of around 1000 timesteps. Note that this is NOT the same as 1000 time
units for most <a class="reference internal" href="units.html"><em>units</em></a> settings.</p>
</div>
<p>Regardless of what atoms are in the fix group (the only atoms which
are time integrated), a global pressure or stress tensor is computed
for all atoms. Similarly, when the size of the simulation box is
changed, all atoms are re-scaled to new positions, unless the keyword
<em>dilate</em> is specified with a <em>dilate-group-ID</em> for a group that
represents a subset of the atoms. This can be useful, for example, to
leave the coordinates of atoms in a solid substrate unchanged and
controlling the pressure of a surrounding fluid. This option should
be used with care, since it can be unphysical to dilate some atoms and
not others, because it can introduce large, instantaneous
displacements between a pair of atoms (one dilated, one not) that are
far from the dilation origin. Also note that for atoms not in the fix
group, a separate time integration fix like <a class="reference internal" href="fix_nve.html"><em>fix nve</em></a> or
<a class="reference internal" href=""><em>fix nvt</em></a> can be used on them, independent of whether they
are dilated or not.</p>
<hr class="docutils" />
<p>The <em>couple</em> keyword allows two or three of the diagonal components of
the pressure tensor to be &#8220;coupled&#8221; together. The value specified
with the keyword determines which are coupled. For example, <em>xz</em>
means the <em>Pxx</em> and <em>Pzz</em> components of the stress tensor are coupled.
<em>Xyz</em> means all 3 diagonal components are coupled. Coupling means two
things: the instantaneous stress will be computed as an average of the
corresponding diagonal components, and the coupled box dimensions will
be changed together in lockstep, meaning coupled dimensions will be
dilated or contracted by the same percentage every timestep. The
<em>Pstart</em>, <em>Pstop</em>, <em>Pdamp</em> parameters for any coupled dimensions must
be identical. <em>Couple xyz</em> can be used for a 2d simulation; the <em>z</em>
dimension is simply ignored.</p>
<hr class="docutils" />
<p>The <em>iso</em>, <em>aniso</em>, and <em>tri</em> keywords are simply shortcuts that are
equivalent to specifying several other keywords together.</p>
<p>The keyword <em>iso</em> means couple all 3 diagonal components together when
pressure is computed (hydrostatic pressure), and dilate/contract the
dimensions together. Using &#8220;iso Pstart Pstop Pdamp&#8221; is the same as
specifying these 4 keywords:</p>
<div class="highlight-python"><div class="highlight"><pre>x Pstart Pstop Pdamp
y Pstart Pstop Pdamp
z Pstart Pstop Pdamp
couple xyz
</pre></div>
</div>
<p>The keyword <em>aniso</em> means <em>x</em>, <em>y</em>, and <em>z</em> dimensions are controlled
independently using the <em>Pxx</em>, <em>Pyy</em>, and <em>Pzz</em> components of the
stress tensor as the driving forces, and the specified scalar external
pressure. Using &#8220;aniso Pstart Pstop Pdamp&#8221; is the same as specifying
these 4 keywords:</p>
<div class="highlight-python"><div class="highlight"><pre>x Pstart Pstop Pdamp
y Pstart Pstop Pdamp
z Pstart Pstop Pdamp
couple none
</pre></div>
</div>
<p>The keyword <em>tri</em> means <em>x</em>, <em>y</em>, <em>z</em>, <em>xy</em>, <em>xz</em>, and <em>yz</em> dimensions
are controlled independently using their individual stress components
as the driving forces, and the specified scalar pressure as the
external normal stress. Using &#8220;tri Pstart Pstop Pdamp&#8221; is the same as
specifying these 7 keywords:</p>
<div class="highlight-python"><div class="highlight"><pre>x Pstart Pstop Pdamp
y Pstart Pstop Pdamp
z Pstart Pstop Pdamp
xy 0.0 0.0 Pdamp
yz 0.0 0.0 Pdamp
xz 0.0 0.0 Pdamp
couple none
</pre></div>
</div>
<hr class="docutils" />
<p>In some cases (e.g. for solids) the pressure (volume) and/or
temperature of the system can oscillate undesirably when a Nose/Hoover
barostat and thermostat is applied. The optional <em>drag</em> keyword will
damp these oscillations, although it alters the Nose/Hoover equations.
A value of 0.0 (no drag) leaves the Nose/Hoover formalism unchanged.
A non-zero value adds a drag term; the larger the value specified, the
greater the damping effect. Performing a short run and monitoring the
pressure and temperature is the best way to determine if the drag term
is working. Typically a value between 0.2 to 2.0 is sufficient to
damp oscillations after a few periods. Note that use of the drag
keyword will interfere with energy conservation and will also change
the distribution of positions and velocities so that they do not
correspond to the nominal NVT, NPT, or NPH ensembles.</p>
<p>An alternative way to control initial oscillations is to use chain
thermostats. The keyword <em>tchain</em> determines the number of thermostats
in the particle thermostat. A value of 1 corresponds to the original
Nose-Hoover thermostat. The keyword <em>pchain</em> specifies the number of
thermostats in the chain thermostatting the barostat degrees of
freedom. A value of 0 corresponds to no thermostatting of the
barostat variables.</p>
<p>The <em>mtk</em> keyword controls whether or not the correction terms due to
Martyna, Tuckerman, and Klein are included in the equations of motion
<a class="reference internal" href="fix_rigid.html#martyna"><span>(Martyna)</span></a>. Specifying <em>no</em> reproduces the original
Hoover barostat, whose volume probability distribution function
differs from the true NPT and NPH ensembles by a factor of 1/V. Hence
using <em>yes</em> is more correct, but in many cases the difference is
negligible.</p>
<p>The keyword <em>tloop</em> can be used to improve the accuracy of integration
scheme at little extra cost. The initial and final updates of the
thermostat variables are broken up into <em>tloop</em> substeps, each of
length <em>dt</em>/<em>tloop</em>. This corresponds to using a first-order
Suzuki-Yoshida scheme <a class="reference internal" href="run_style.html#tuckerman"><span>(Tuckerman)</span></a>. The keyword <em>ploop</em>
does the same thing for the barostat thermostat.</p>
<p>The keyword <em>nreset</em> controls how often the reference dimensions used
to define the strain energy are reset. If this keyword is not used,
or is given a value of zero, then the reference dimensions are set to
those of the initial simulation domain and are never changed. If the
simulation domain changes significantly during the simulation, then
the final average pressure tensor will differ significantly from the
specified values of the external stress tensor. A value of <em>nstep</em>
means that every <em>nstep</em> timesteps, the reference dimensions are set
to those of the current simulation domain.</p>
<p>The <em>scaleyz</em>, <em>scalexz</em>, and <em>scalexy</em> keywords control whether or
not the corresponding tilt factors are scaled with the associated box
dimensions when barostatting triclinic periodic cells. The default
values <em>yes</em> will turn on scaling, which corresponds to adjusting the
linear dimensions of the cell while preserving its shape. Choosing
<em>no</em> ensures that the tilt factors are not scaled with the box
dimensions. See below for restrictions and default values in different
situations. In older versions of LAMMPS, scaling of tilt factors was
not performed. The old behavior can be recovered by setting all three
scale keywords to <em>no</em>.</p>
<p>The <em>flip</em> keyword allows the tilt factors for a triclinic box to
exceed half the distance of the parallel box length, as discussed
below. If the <em>flip</em> value is set to <em>yes</em>, the bound is enforced by
flipping the box when it is exceeded. If the <em>flip</em> value is set to
<em>no</em>, the tilt will continue to change without flipping. Note that if
applied stress induces large deformations (e.g. in a liquid), this
means the box shape can tilt dramatically and LAMMPS will run less
efficiently, due to the large volume of communication needed to
acquire ghost atoms around a processor&#8217;s irregular-shaped sub-domain.
For extreme values of tilt, LAMMPS may also lose atoms and generate an
error.</p>
<p>The <em>fixedpoint</em> keyword specifies the fixed point for barostat volume
changes. By default, it is the center of the box. Whatever point is
chosen will not move during the simulation. For example, if the lower
periodic boundaries pass through (0,0,0), and this point is provided
to <em>fixedpoint</em>, then the lower periodic boundaries will remain at
(0,0,0), while the upper periodic boundaries will move twice as
far. In all cases, the particle trajectories are unaffected by the
chosen value, except for a time-dependent constant translation of
positions.</p>
+<p>If the <em>update</em> keyword is used with the <em>dipole</em> value, then the
+orientation of the dipole moment of each particle is also updated
+during the time integration. This option should be used for models
+where a dipole moment is assigned to finite-size particles,
+e.g. spheroids via use of the <a class="reference internal" href="atom_style.html"><em>atom_style hybrid sphere dipole</em></a> command.</p>
<hr class="docutils" />
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Using a barostat coupled to tilt dimensions <em>xy</em>, <em>xz</em>, <em>yz</em> can
sometimes result in arbitrarily large values of the tilt dimensions,
i.e. a dramatically deformed simulation box. LAMMPS allows the tilt
factors to grow a small amount beyond the normal limit of half the box
length (0.6 times the box length), and then performs a box &#8220;flip&#8221; to
an equivalent periodic cell. See the discussion of the <em>flip</em> keyword
above, to allow this bound to be exceeded, if desired.</p>
</div>
<p>The flip operation is described in more detail in the doc page for
<a class="reference internal" href="fix_deform.html"><em>fix deform</em></a>. Both the barostat dynamics and the atom
trajectories are unaffected by this operation. However, if a tilt
factor is incremented by a large amount (1.5 times the box length) on
a single timestep, LAMMPS can not accomodate this event and will
terminate the simulation with an error. This error typically indicates
that there is something badly wrong with how the simulation was
constructed, such as specifying values of <em>Pstart</em> that are too far
from the current stress value, or specifying a timestep that is too
large. Triclinic barostatting should be used with care. This also is
true for other barostat styles, although they tend to be more
forgiving of insults. In particular, it is important to recognize that
equilibrium liquids can not support a shear stress and that
equilibrium solids can not support shear stresses that exceed the
yield stress.</p>
<p>One exception to this rule is if the 1st dimension in the tilt factor
(x for xy) is non-periodic. In that case, the limits on the tilt
factor are not enforced, since flipping the box in that dimension does
not change the atom positions due to non-periodicity. In this mode,
if you tilt the system to extreme angles, the simulation will simply
become inefficient due to the highly skewed simulation box.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Unlike the <a class="reference internal" href="fix_temp_berendsen.html"><em>fix temp/berendsen</em></a> command
which performs thermostatting but NO time integration, these fixes
perform thermostatting/barostatting AND time integration. Thus you
should not use any other time integration fix, such as <a class="reference internal" href="fix_nve.html"><em>fix nve</em></a> on atoms to which this fix is applied. Likewise,
fix nvt and fix npt should not normally be used on atoms that also
have their temperature controlled by another fix - e.g. by <a class="reference internal" href=""><em>fix langevin</em></a> or <a class="reference internal" href="fix_temp_rescale.html"><em>fix temp/rescale</em></a>
commands.</p>
</div>
<p>See <a class="reference internal" href="Section_howto.html#howto-16"><span>this howto section</span></a> of the manual for
a discussion of different ways to compute temperature and perform
thermostatting and barostatting.</p>
<hr class="docutils" />
<p>These fixes compute a temperature and pressure each timestep. To do
this, the fix creates its own computes of style &#8220;temp&#8221; and &#8220;pressure&#8221;,
as if one of these two sets of commands had been issued:</p>
<div class="highlight-python"><div class="highlight"><pre>compute fix-ID_temp group-ID temp
compute fix-ID_press group-ID pressure fix-ID_temp
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>compute fix-ID_temp all temp
compute fix-ID_press all pressure fix-ID_temp
</pre></div>
</div>
<p>See the <a class="reference internal" href="compute_temp.html"><em>compute temp</em></a> and <a class="reference internal" href="compute_pressure.html"><em>compute pressure</em></a> commands for details. Note that the
IDs of the new computes are the fix-ID + underscore + &#8220;temp&#8221; or fix_ID
+ underscore + &#8220;press&#8221;. For fix nvt, the group for the new computes
is the same as the fix group. For fix nph and fix npt, the group for
the new computes is &#8220;all&#8221; since pressure is computed for the entire
system.</p>
<p>Note that these are NOT the computes used by thermodynamic output (see
the <a class="reference internal" href="thermo_style.html"><em>thermo_style</em></a> command) with ID = <em>thermo_temp</em>
and <em>thermo_press</em>. This means you can change the attributes of this
fix&#8217;s temperature or pressure via the
<a class="reference internal" href="compute_modify.html"><em>compute_modify</em></a> command or print this temperature
or pressure during thermodynamic output via the <a class="reference internal" href="thermo_style.html"><em>thermo_style custom</em></a> command using the appropriate compute-ID.
It also means that changing attributes of <em>thermo_temp</em> or
<em>thermo_press</em> will have no effect on this fix.</p>
<p>Like other fixes that perform thermostatting, fix nvt and fix npt can
be used with <a class="reference internal" href="compute.html"><em>compute commands</em></a> that calculate a
temperature after removing a &#8220;bias&#8221; from the atom velocities.
E.g. removing the center-of-mass velocity from a group of atoms or
only calculating temperature on the x-component of velocity or only
calculating temperature for atoms in a geometric region. This is not
done by default, but only if the <a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a> command
is used to assign a temperature compute to this fix that includes such
a bias term. See the doc pages for individual <a class="reference internal" href="compute.html"><em>compute commands</em></a> to determine which ones include a bias. In
this case, the thermostat works in the following manner: the current
temperature is calculated taking the bias into account, bias is
removed from each atom, thermostatting is performed on the remaining
thermal degrees of freedom, and the bias is added back in.</p>
<hr class="docutils" />
<p>These fixes can be used with either the <em>verlet</em> or <em>respa</em>
<a class="reference internal" href="run_style.html"><em>integrators</em></a>. When using one of the barostat fixes
with <em>respa</em>, LAMMPS uses an integrator constructed
according to the following factorization of the Liouville propagator
(for two rRESPA levels):</p>
<img alt="_images/fix_nh1.jpg" class="align-center" src="_images/fix_nh1.jpg" />
<p>This factorization differs somewhat from that of Tuckerman et al, in
that the barostat is only updated at the outermost rRESPA level,
whereas Tuckerman&#8217;s factorization requires splitting the pressure into
pieces corresponding to the forces computed at each rRESPA level. In
theory, the latter method will exhibit better numerical stability. In
practice, because Pdamp is normally chosen to be a large multiple of
the outermost rRESPA timestep, the barostat dynamics are not the
limiting factor for numerical stability. Both factorizations are
time-reversible and can be shown to preserve the phase space measure
of the underlying non-Hamiltonian equations of motion.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">This implementation has been shown to conserve linear momentum
+up to machine precision under NVT dynamics. Under NPT dynamics,
+for a system with zero initial total linear momentum, the total
+momentum fluctuates close to zero. It may occasionally undergo brief
+excursions to non-negligible values, before returning close to zero.
+Over long simulations, this has the effect of causing the center-of-mass
+to undergo a slow random walk. This can be mitigated by resetting
+the momentum at infrequent intervals using the
+<a class="reference internal" href="fix_momentum.html"><em>fix momentum</em></a> command.</p>
+</div>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">This implementation has been shown to conserve linear momentum
+up to machine precision under NVT dynamics. Under NPT dynamics,
+for a system with zero initial total linear momentum, the total
+momentum fluctuates close to zero. It may occasionally undergo brief
+excursions to non-negligible values, before returning close to zero.
+Over long simulations, this has the effect of causing the center-of-mass
+to undergo a slow random walk. This can be mitigated by resetting
+the momentum at infrequent intervals using the
+<a class="reference internal" href="fix_momentum.html"><em>fix momentum</em></a> command.</p>
+</div>
<hr class="docutils" />
<p>The fix npt and fix nph commands can be used with rigid bodies or
mixtures of rigid bodies and non-rigid particles (e.g. solvent). But
there are also <a class="reference internal" href="fix_rigid.html"><em>fix rigid/npt</em></a> and <a class="reference internal" href="fix_rigid.html"><em>fix rigid/nph</em></a> commands, which are typically a more natural
choice. See the doc page for those commands for more discussion of
the various ways to do this.</p>
<hr class="docutils" />
<p>Styles with a <em>cuda</em>, <em>gpu</em>, <em>intel</em>, <em>kk</em>, <em>omp</em>, or <em>opt</em> suffix are
functionally the same as the corresponding style without the suffix.
They have been optimized to run faster, depending on your available
hardware, as discussed in <a class="reference internal" href="Section_accelerate.html"><em>Section_accelerate</em></a>
of the manual. The accelerated styles take the same arguments and
should produce the same results, except for round-off and precision
issues.</p>
<p>These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL,
KOKKOS, USER-OMP and OPT packages, respectively. They are only
enabled if LAMMPS was built with those packages. See the <a class="reference internal" href="Section_start.html#start-3"><span>Making LAMMPS</span></a> section for more info.</p>
<p>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <a class="reference internal" href="Section_start.html#start-7"><span>-suffix command-line switch</span></a> when you invoke LAMMPS, or you can
use the <a class="reference internal" href="suffix.html"><em>suffix</em></a> command in your input script.</p>
<p>See <a class="reference internal" href="Section_accelerate.html"><em>Section_accelerate</em></a> of the manual for
more instructions on how to use the accelerated styles effectively.</p>
</div>
<hr class="docutils" />
<div class="section" id="restart-fix-modify-output-run-start-stop-minimize-info">
<h2>Restart, fix_modify, output, run start/stop, minimize info<a class="headerlink" href="#restart-fix-modify-output-run-start-stop-minimize-info" title="Permalink to this headline">¶</a></h2>
<p>These fixes writes the state of all the thermostat and barostat
variables to <a class="reference internal" href="restart.html"><em>binary restart files</em></a>. See the
<a class="reference internal" href="read_restart.html"><em>read_restart</em></a> command for info on how to re-specify
a fix in an input script that reads a restart file, so that the
operation of the fix continues in an uninterrupted fashion.</p>
<p>The <a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a> <em>temp</em> and <em>press</em> options are
supported by these fixes. You can use them to assign a
<a class="reference internal" href="compute.html"><em>compute</em></a> you have defined to this fix which will be used
in its thermostatting or barostatting procedure, as described above.
If you do this, note that the kinetic energy derived from the compute
temperature should be consistent with the virial term computed using
all atoms for the pressure. LAMMPS will warn you if you choose to
compute temperature on a subset of atoms.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If both the <em>temp</em> and <em>press</em> keywords are used in a single
thermo_modify command (or in two separate commands), then the order in
which the keywords are specified is important. Note that a <a class="reference internal" href="compute_pressure.html"><em>pressure compute</em></a> defines its own temperature compute as
an argument when it is specified. The <em>temp</em> keyword will override
this (for the pressure compute being used by fix npt), but only if the
<em>temp</em> keyword comes after the <em>press</em> keyword. If the <em>temp</em> keyword
comes before the <em>press</em> keyword, then the new pressure compute
specified by the <em>press</em> keyword will be unaffected by the <em>temp</em>
setting.</p>
</div>
<p>The <a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a> <em>energy</em> option is supported by these
fixes to add the energy change induced by Nose/Hoover thermostatting
and barostatting to the system&#8217;s potential energy as part of
<a class="reference internal" href="thermo_style.html"><em>thermodynamic output</em></a>.</p>
<p>These fixes compute a global scalar and a global vector of quantities,
which can be accessed by various <a class="reference internal" href="Section_howto.html#howto-15"><span>output commands</span></a>. The scalar value calculated by
these fixes is &#8220;extensive&#8221;; the vector values are &#8220;intensive&#8221;.</p>
<p>The scalar is the cumulative energy change due to the fix.</p>
<p>The vector stores internal Nose/Hoover thermostat and barostat
variables. The number and meaning of the vector values depends on
which fix is used and the settings for keywords <em>tchain</em> and <em>pchain</em>,
which specify the number of Nose/Hoover chains for the thermostat and
barostat. If no thermostatting is done, then <em>tchain</em> is 0. If no
barostatting is done, then <em>pchain</em> is 0. In the following list,
&#8220;ndof&#8221; is 0, 1, 3, or 6, and is the number of degrees of freedom in
the barostat. Its value is 0 if no barostat is used, else its value
is 6 if any off-diagonal stress tensor component is barostatted, else
its value is 1 if <em>couple xyz</em> is used or <em>couple xy</em> for a 2d
simulation, otherwise its value is 3.</p>
<p>The order of values in the global vector and their meaning is as
follows. The notation means there are tchain values for eta, followed
by tchain for eta_dot, followed by ndof for omega, etc:</p>
<ul class="simple">
<li>eta[tchain] = particle thermostat displacements (unitless)</li>
<li>eta_dot[tchain] = particle thermostat velocities (1/time units)</li>
<li>omega[ndof] = barostat displacements (unitless)</li>
<li>omega_dot[ndof] = barostat velocities (1/time units)</li>
<li>etap[pchain] = barostat thermostat displacements (unitless)</li>
<li>etap_dot[pchain] = barostat thermostat velocities (1/time units)</li>
<li>PE_eta[tchain] = potential energy of each particle thermostat displacement (energy units)</li>
<li>KE_eta_dot[tchain] = kinetic energy of each particle thermostat velocity (energy units)</li>
<li>PE_omega[ndof] = potential energy of each barostat displacement (energy units)</li>
<li>KE_omega_dot[ndof] = kinetic energy of each barostat velocity (energy units)</li>
<li>PE_etap[pchain] = potential energy of each barostat thermostat displacement (energy units)</li>
<li>KE_etap_dot[pchain] = kinetic energy of each barostat thermostat velocity (energy units)</li>
<li>PE_strain[1] = scalar strain energy (energy units)</li>
</ul>
<p>These fixes can ramp their external temperature and pressure over
multiple runs, using the <em>start</em> and <em>stop</em> keywords of the
<a class="reference internal" href="run.html"><em>run</em></a> command. See the <a class="reference internal" href="run.html"><em>run</em></a> command for details of
how to do this.</p>
<p>These fixes are not invoked during <a class="reference internal" href="minimize.html"><em>energy minimization</em></a>.</p>
</div>
<hr class="docutils" />
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p><em>X</em>, <em>y</em>, <em>z</em> cannot be barostatted if the associated dimension is not
periodic. <em>Xy</em>, <em>xz</em>, and <em>yz</em> can only be barostatted if the
simulation domain is triclinic and the 2nd dimension in the keyword
(<em>y</em> dimension in <em>xy</em>) is periodic. <em>Z</em>, <em>xz</em>, and <em>yz</em>, cannot be
barostatted for 2D simulations. The <a class="reference internal" href="create_box.html"><em>create_box</em></a>,
<a class="reference internal" href="read_data.html"><em>read data</em></a>, and <a class="reference internal" href="read_restart.html"><em>read_restart</em></a>
commands specify whether the simulation box is orthogonal or
non-orthogonal (triclinic) and explain the meaning of the xy,xz,yz
tilt factors.</p>
<p>For the <em>temp</em> keyword, the final Tstop cannot be 0.0 since it would
make the external T = 0.0 at some timestep during the simulation which
is not allowed in the Nose/Hoover formulation.</p>
<p>The <em>scaleyz yes</em> and <em>scalexz yes</em> keyword/value pairs can not be used
for 2D simulations. <em>scaleyz yes</em>, <em>scalexz yes</em>, and <em>scalexy yes</em> options
can only be used if the 2nd dimension in the keyword is periodic,
and if the tilt factor is not coupled to the barostat via keywords
<em>tri</em>, <em>yz</em>, <em>xz</em>, and <em>xy</em>.</p>
<p>These fixes can be used with dynamic groups as defined by the
<a class="reference internal" href="group.html"><em>group</em></a> command. Likewise they can be used with groups to
which atoms are added or deleted over time, e.g. a deposition
simulation. However, the conservation properties of the thermostat
and barostat are defined for systems with a static set of atoms. You
may observe odd behavior if the atoms in a group vary dramatically
over time or the atom count becomes very small.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="fix_nve.html"><em>fix nve</em></a>, <a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a>,
<a class="reference internal" href="run_style.html"><em>run_style</em></a></p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<p>The keyword defaults are tchain = 3, pchain = 3, mtk = yes, tloop =
ploop = 1, nreset = 0, drag = 0.0, dilate = all, couple = none,
scaleyz = scalexz = scalexy = yes if periodic in 2nd dimension and
not coupled to barostat, otherwise no.</p>
<hr class="docutils" />
<p id="martyna"><strong>(Martyna)</strong> Martyna, Tobias and Klein, J Chem Phys, 101, 4177 (1994).</p>
<p id="parrinello"><strong>(Parrinello)</strong> Parrinello and Rahman, J Appl Phys, 52, 7182 (1981).</p>
<p id="tuckerman"><strong>(Tuckerman)</strong> Tuckerman, Alejandre, Lopez-Rendon, Jochim, and
Martyna, J Phys A: Math Gen, 39, 5629 (2006).</p>
<p id="shinoda"><strong>(Shinoda)</strong> Shinoda, Shiga, and Mikami, Phys Rev B, 69, 134103 (2004).</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/fix_nh.txt b/doc/fix_nh.txt
index 1cd9f0dc9..be5e77975 100644
--- a/doc/fix_nh.txt
+++ b/doc/fix_nh.txt
@@ -1,612 +1,640 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
fix nvt command :h3
fix nvt/cuda command :h3
fix nvt/kk command :h3
fix nvt/omp command :h3
fix npt command :h3
fix npt/cuda command :h3
fix npt/intel command :h3
fix npt/kk command :h3
fix npt/omp command :h3
fix nph command :h3
fix nph/kk command :h3
fix nph/omp command :h3
[Syntax:]
fix ID group-ID style_name keyword value ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
style_name = {nvt} or {npt} or {nph} :l
one or more keyword/value pairs may be appended :l
-keyword = {temp} or {iso} or {aniso} or {tri} or {x} or {y} or {z} or {xy} or {yz} or {xz} or {couple} or {tchain} or {pchain} or {mtk} or {tloop} or {ploop} or {nreset} or {drag} or {dilate} or {scalexy} or {scaleyz} or {scalexz} or {flip} or {fixedpoint}
+keyword = {temp} or {iso} or {aniso} or {tri} or {x} or {y} or {z} or {xy} or {yz} or {xz} or {couple} or {tchain} or {pchain} or {mtk} or {tloop} or {ploop} or {nreset} or {drag} or {dilate} or {scalexy} or {scaleyz} or {scalexz} or {flip} or {fixedpoint} or {update}
{temp} values = Tstart Tstop Tdamp
Tstart,Tstop = external temperature at start/end of run
Tdamp = temperature damping parameter (time units)
{iso} or {aniso} or {tri} values = Pstart Pstop Pdamp
Pstart,Pstop = scalar external pressure at start/end of run (pressure units)
Pdamp = pressure damping parameter (time units)
{x} or {y} or {z} or {xy} or {yz} or {xz} values = Pstart Pstop Pdamp
Pstart,Pstop = external stress tensor component at start/end of run (pressure units)
Pdamp = stress damping parameter (time units)
{couple} = {none} or {xyz} or {xy} or {yz} or {xz}
{tchain} value = N
N = length of thermostat chain (1 = single thermostat)
{pchain} values = N
N length of thermostat chain on barostat (0 = no thermostat)
{mtk} value = {yes} or {no} = add in MTK adjustment term or not
{tloop} value = M
M = number of sub-cycles to perform on thermostat
{ploop} value = M
M = number of sub-cycles to perform on barostat thermostat
{nreset} value = reset reference cell every this many timesteps
{drag} value = Df
Df = drag factor added to barostat/thermostat (0.0 = no drag)
{dilate} value = dilate-group-ID
dilate-group-ID = only dilate atoms in this group due to barostat volume changes
{scalexy} value = {yes} or {no} = scale xy with ly
{scaleyz} value = {yes} or {no} = scale yz with lz
{scalexz} value = {yes} or {no} = scale xz with lz
{flip} value = {yes} or {no} = allow or disallow box flips when it becomes highly skewed
{fixedpoint} values = x y z
- x,y,z = perform barostat dilation/contraction around this point (distance units) :pre
-
+ x,y,z = perform barostat dilation/contraction around this point (distance units)
+ {update} value = {dipole} update dipole orientation (only for sphere variants) :pre
+
:ule
[Examples:]
fix 1 all nvt temp 300.0 300.0 100.0
fix 1 water npt temp 300.0 300.0 100.0 iso 0.0 0.0 1000.0
fix 2 jello npt temp 300.0 300.0 100.0 tri 5.0 5.0 1000.0
fix 2 ice nph x 1.0 1.0 0.5 y 2.0 2.0 0.5 z 3.0 3.0 0.5 yz 0.1 0.1 0.5 xz 0.2 0.2 0.5 xy 0.3 0.3 0.5 nreset 1000 :pre
[Description:]
These commands perform time integration on Nose-Hoover style
non-Hamiltonian equations of motion which are designed to generate
positions and velocities sampled from the canonical (nvt),
isothermal-isobaric (npt), and isenthalpic (nph) ensembles. This
updates the position and velocity for atoms in the group each
timestep.
The thermostatting and barostatting is achieved by adding some dynamic
variables which are coupled to the particle velocities
(thermostatting) and simulation domain dimensions (barostatting). In
addition to basic thermostatting and barostatting, these fixes can
also create a chain of thermostats coupled to the particle thermostat,
and another chain of thermostats coupled to the barostat
variables. The barostat can be coupled to the overall box volume, or
to individual dimensions, including the {xy}, {xz} and {yz} tilt
dimensions. The external pressure of the barostat can be specified as
either a scalar pressure (isobaric ensemble) or as components of a
symmetric stress tensor (constant stress ensemble). When used
correctly, the time-averaged temperature and stress tensor of the
particles will match the target values specified by Tstart/Tstop and
Pstart/Pstop.
The equations of motion used are those of Shinoda et al in
"(Shinoda)"_#Shinoda, which combine the hydrostatic equations of
Martyna, Tobias and Klein in "(Martyna)"_#Martyna with the strain
energy proposed by Parrinello and Rahman in
"(Parrinello)"_#Parrinello. The time integration schemes closely
follow the time-reversible measure-preserving Verlet and rRESPA
integrators derived by Tuckerman et al in "(Tuckerman)"_#Tuckerman.
:line
The thermostat parameters for fix styles {nvt} and {npt} is specified
using the {temp} keyword. Other thermostat-related keywords are
{tchain}, {tloop} and {drag}, which are discussed below.
The thermostat is applied to only the translational degrees of freedom
for the particles. The translational degrees of freedom can also have
a bias velocity removed before thermostatting takes place; see the
description below. The desired temperature at each timestep is a
ramped value during the run from {Tstart} to {Tstop}. The {Tdamp}
parameter is specified in time units and determines how rapidly the
temperature is relaxed. For example, a value of 10.0 means to relax
the temperature in a timespan of (roughly) 10 time units (e.g. tau or
fmsec or psec - see the "units"_units.html command). The atoms in the
fix group are the only ones whose velocities and positions are updated
by the velocity/position update portion of the integration.
NOTE: A Nose-Hoover thermostat will not work well for arbitrary values
of {Tdamp}. If {Tdamp} is too small, the temperature can fluctuate
wildly; if it is too large, the temperature will take a very long time
to equilibrate. A good choice for many models is a {Tdamp} of around
100 timesteps. Note that this is NOT the same as 100 time units for
most "units"_units.html settings.
:line
The barostat parameters for fix styles {npt} and {nph} is specified
using one or more of the {iso}, {aniso}, {tri}, {x}, {y}, {z}, {xy},
{xz}, {yz}, and {couple} keywords. These keywords give you the
ability to specify all 6 components of an external stress tensor, and
to couple various of these components together so that the dimensions
they represent are varied together during a constant-pressure
simulation.
Other barostat-related keywords are {pchain}, {mtk}, {ploop},
{nreset}, {drag}, and {dilate}, which are discussed below.
Orthogonal simulation boxes have 3 adjustable dimensions (x,y,z).
Triclinic (non-orthogonal) simulation boxes have 6 adjustable
dimensions (x,y,z,xy,xz,yz). The "create_box"_create_box.html, "read
data"_read_data.html, and "read_restart"_read_restart.html commands
specify whether the simulation box is orthogonal or non-orthogonal
(triclinic) and explain the meaning of the xy,xz,yz tilt factors.
The target pressures for each of the 6 components of the stress tensor
can be specified independently via the {x}, {y}, {z}, {xy}, {xz}, {yz}
keywords, which correspond to the 6 simulation box dimensions. For
each component, the external pressure or tensor component at each
timestep is a ramped value during the run from {Pstart} to {Pstop}.
If a target pressure is specified for a component, then the
corresponding box dimension will change during a simulation. For
example, if the {y} keyword is used, the y-box length will change. If
the {xy} keyword is used, the xy tilt factor will change. A box
dimension will not change if that component is not specified, although
you have the option to change that dimension via the "fix
deform"_fix_deform.html command.
Note that in order to use the {xy}, {xz}, or {yz} keywords, the
simulation box must be triclinic, even if its initial tilt factors are
0.0.
For all barostat keywords, the {Pdamp} parameter operates like the
{Tdamp} parameter, determining the time scale on which pressure is
relaxed. For example, a value of 10.0 means to relax the pressure in
a timespan of (roughly) 10 time units (e.g. tau or fmsec or psec - see
the "units"_units.html command).
NOTE: A Nose-Hoover barostat will not work well for arbitrary values
of {Pdamp}. If {Pdamp} is too small, the pressure and volume can
fluctuate wildly; if it is too large, the pressure will take a very
long time to equilibrate. A good choice for many models is a {Pdamp}
of around 1000 timesteps. Note that this is NOT the same as 1000 time
units for most "units"_units.html settings.
Regardless of what atoms are in the fix group (the only atoms which
are time integrated), a global pressure or stress tensor is computed
for all atoms. Similarly, when the size of the simulation box is
changed, all atoms are re-scaled to new positions, unless the keyword
{dilate} is specified with a {dilate-group-ID} for a group that
represents a subset of the atoms. This can be useful, for example, to
leave the coordinates of atoms in a solid substrate unchanged and
controlling the pressure of a surrounding fluid. This option should
be used with care, since it can be unphysical to dilate some atoms and
not others, because it can introduce large, instantaneous
displacements between a pair of atoms (one dilated, one not) that are
far from the dilation origin. Also note that for atoms not in the fix
group, a separate time integration fix like "fix nve"_fix_nve.html or
"fix nvt"_fix_nh.html can be used on them, independent of whether they
are dilated or not.
:line
The {couple} keyword allows two or three of the diagonal components of
the pressure tensor to be "coupled" together. The value specified
with the keyword determines which are coupled. For example, {xz}
means the {Pxx} and {Pzz} components of the stress tensor are coupled.
{Xyz} means all 3 diagonal components are coupled. Coupling means two
things: the instantaneous stress will be computed as an average of the
corresponding diagonal components, and the coupled box dimensions will
be changed together in lockstep, meaning coupled dimensions will be
dilated or contracted by the same percentage every timestep. The
{Pstart}, {Pstop}, {Pdamp} parameters for any coupled dimensions must
be identical. {Couple xyz} can be used for a 2d simulation; the {z}
dimension is simply ignored.
:line
The {iso}, {aniso}, and {tri} keywords are simply shortcuts that are
equivalent to specifying several other keywords together.
The keyword {iso} means couple all 3 diagonal components together when
pressure is computed (hydrostatic pressure), and dilate/contract the
dimensions together. Using "iso Pstart Pstop Pdamp" is the same as
specifying these 4 keywords:
x Pstart Pstop Pdamp
y Pstart Pstop Pdamp
z Pstart Pstop Pdamp
couple xyz :pre
The keyword {aniso} means {x}, {y}, and {z} dimensions are controlled
independently using the {Pxx}, {Pyy}, and {Pzz} components of the
stress tensor as the driving forces, and the specified scalar external
pressure. Using "aniso Pstart Pstop Pdamp" is the same as specifying
these 4 keywords:
x Pstart Pstop Pdamp
y Pstart Pstop Pdamp
z Pstart Pstop Pdamp
couple none :pre
The keyword {tri} means {x}, {y}, {z}, {xy}, {xz}, and {yz} dimensions
are controlled independently using their individual stress components
as the driving forces, and the specified scalar pressure as the
external normal stress. Using "tri Pstart Pstop Pdamp" is the same as
specifying these 7 keywords:
x Pstart Pstop Pdamp
y Pstart Pstop Pdamp
z Pstart Pstop Pdamp
xy 0.0 0.0 Pdamp
yz 0.0 0.0 Pdamp
xz 0.0 0.0 Pdamp
couple none :pre
:line
In some cases (e.g. for solids) the pressure (volume) and/or
temperature of the system can oscillate undesirably when a Nose/Hoover
barostat and thermostat is applied. The optional {drag} keyword will
damp these oscillations, although it alters the Nose/Hoover equations.
A value of 0.0 (no drag) leaves the Nose/Hoover formalism unchanged.
A non-zero value adds a drag term; the larger the value specified, the
greater the damping effect. Performing a short run and monitoring the
pressure and temperature is the best way to determine if the drag term
is working. Typically a value between 0.2 to 2.0 is sufficient to
damp oscillations after a few periods. Note that use of the drag
keyword will interfere with energy conservation and will also change
the distribution of positions and velocities so that they do not
correspond to the nominal NVT, NPT, or NPH ensembles.
An alternative way to control initial oscillations is to use chain
thermostats. The keyword {tchain} determines the number of thermostats
in the particle thermostat. A value of 1 corresponds to the original
Nose-Hoover thermostat. The keyword {pchain} specifies the number of
thermostats in the chain thermostatting the barostat degrees of
freedom. A value of 0 corresponds to no thermostatting of the
barostat variables.
The {mtk} keyword controls whether or not the correction terms due to
Martyna, Tuckerman, and Klein are included in the equations of motion
"(Martyna)"_#Martyna. Specifying {no} reproduces the original
Hoover barostat, whose volume probability distribution function
differs from the true NPT and NPH ensembles by a factor of 1/V. Hence
using {yes} is more correct, but in many cases the difference is
negligible.
The keyword {tloop} can be used to improve the accuracy of integration
scheme at little extra cost. The initial and final updates of the
thermostat variables are broken up into {tloop} substeps, each of
length {dt}/{tloop}. This corresponds to using a first-order
Suzuki-Yoshida scheme "(Tuckerman)"_#Tuckerman. The keyword {ploop}
does the same thing for the barostat thermostat.
The keyword {nreset} controls how often the reference dimensions used
to define the strain energy are reset. If this keyword is not used,
or is given a value of zero, then the reference dimensions are set to
those of the initial simulation domain and are never changed. If the
simulation domain changes significantly during the simulation, then
the final average pressure tensor will differ significantly from the
specified values of the external stress tensor. A value of {nstep}
means that every {nstep} timesteps, the reference dimensions are set
to those of the current simulation domain.
The {scaleyz}, {scalexz}, and {scalexy} keywords control whether or
not the corresponding tilt factors are scaled with the associated box
dimensions when barostatting triclinic periodic cells. The default
values {yes} will turn on scaling, which corresponds to adjusting the
linear dimensions of the cell while preserving its shape. Choosing
{no} ensures that the tilt factors are not scaled with the box
dimensions. See below for restrictions and default values in different
situations. In older versions of LAMMPS, scaling of tilt factors was
not performed. The old behavior can be recovered by setting all three
scale keywords to {no}.
The {flip} keyword allows the tilt factors for a triclinic box to
exceed half the distance of the parallel box length, as discussed
below. If the {flip} value is set to {yes}, the bound is enforced by
flipping the box when it is exceeded. If the {flip} value is set to
{no}, the tilt will continue to change without flipping. Note that if
applied stress induces large deformations (e.g. in a liquid), this
means the box shape can tilt dramatically and LAMMPS will run less
efficiently, due to the large volume of communication needed to
acquire ghost atoms around a processor's irregular-shaped sub-domain.
For extreme values of tilt, LAMMPS may also lose atoms and generate an
error.
The {fixedpoint} keyword specifies the fixed point for barostat volume
changes. By default, it is the center of the box. Whatever point is
chosen will not move during the simulation. For example, if the lower
periodic boundaries pass through (0,0,0), and this point is provided
to {fixedpoint}, then the lower periodic boundaries will remain at
(0,0,0), while the upper periodic boundaries will move twice as
far. In all cases, the particle trajectories are unaffected by the
chosen value, except for a time-dependent constant translation of
positions.
+If the {update} keyword is used with the {dipole} value, then the
+orientation of the dipole moment of each particle is also updated
+during the time integration. This option should be used for models
+where a dipole moment is assigned to finite-size particles,
+e.g. spheroids via use of the "atom_style hybrid sphere
+dipole"_atom_style.html command.
+
:line
NOTE: Using a barostat coupled to tilt dimensions {xy}, {xz}, {yz} can
sometimes result in arbitrarily large values of the tilt dimensions,
i.e. a dramatically deformed simulation box. LAMMPS allows the tilt
factors to grow a small amount beyond the normal limit of half the box
length (0.6 times the box length), and then performs a box "flip" to
an equivalent periodic cell. See the discussion of the {flip} keyword
above, to allow this bound to be exceeded, if desired.
The flip operation is described in more detail in the doc page for
"fix deform"_fix_deform.html. Both the barostat dynamics and the atom
trajectories are unaffected by this operation. However, if a tilt
factor is incremented by a large amount (1.5 times the box length) on
a single timestep, LAMMPS can not accomodate this event and will
terminate the simulation with an error. This error typically indicates
that there is something badly wrong with how the simulation was
constructed, such as specifying values of {Pstart} that are too far
from the current stress value, or specifying a timestep that is too
large. Triclinic barostatting should be used with care. This also is
true for other barostat styles, although they tend to be more
forgiving of insults. In particular, it is important to recognize that
equilibrium liquids can not support a shear stress and that
equilibrium solids can not support shear stresses that exceed the
yield stress.
One exception to this rule is if the 1st dimension in the tilt factor
(x for xy) is non-periodic. In that case, the limits on the tilt
factor are not enforced, since flipping the box in that dimension does
not change the atom positions due to non-periodicity. In this mode,
if you tilt the system to extreme angles, the simulation will simply
become inefficient due to the highly skewed simulation box.
NOTE: Unlike the "fix temp/berendsen"_fix_temp_berendsen.html command
which performs thermostatting but NO time integration, these fixes
perform thermostatting/barostatting AND time integration. Thus you
should not use any other time integration fix, such as "fix
nve"_fix_nve.html on atoms to which this fix is applied. Likewise,
fix nvt and fix npt should not normally be used on atoms that also
have their temperature controlled by another fix - e.g. by "fix
langevin"_fix_nh.html or "fix temp/rescale"_fix_temp_rescale.html
commands.
See "this howto section"_Section_howto.html#howto_16 of the manual for
a discussion of different ways to compute temperature and perform
thermostatting and barostatting.
:line
These fixes compute a temperature and pressure each timestep. To do
this, the fix creates its own computes of style "temp" and "pressure",
as if one of these two sets of commands had been issued:
compute fix-ID_temp group-ID temp
compute fix-ID_press group-ID pressure fix-ID_temp :pre
compute fix-ID_temp all temp
compute fix-ID_press all pressure fix-ID_temp :pre
See the "compute temp"_compute_temp.html and "compute
pressure"_compute_pressure.html commands for details. Note that the
IDs of the new computes are the fix-ID + underscore + "temp" or fix_ID
+ underscore + "press". For fix nvt, the group for the new computes
is the same as the fix group. For fix nph and fix npt, the group for
the new computes is "all" since pressure is computed for the entire
system.
Note that these are NOT the computes used by thermodynamic output (see
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}
and {thermo_press}. This means you can change the attributes of this
fix's temperature or pressure via the
"compute_modify"_compute_modify.html command or print this temperature
or pressure during thermodynamic output via the "thermo_style
custom"_thermo_style.html command using the appropriate compute-ID.
It also means that changing attributes of {thermo_temp} or
{thermo_press} will have no effect on this fix.
Like other fixes that perform thermostatting, fix nvt and fix npt can
be used with "compute commands"_compute.html that calculate a
temperature after removing a "bias" from the atom velocities.
E.g. removing the center-of-mass velocity from a group of atoms or
only calculating temperature on the x-component of velocity or only
calculating temperature for atoms in a geometric region. This is not
done by default, but only if the "fix_modify"_fix_modify.html command
is used to assign a temperature compute to this fix that includes such
a bias term. See the doc pages for individual "compute
commands"_compute.html to determine which ones include a bias. In
this case, the thermostat works in the following manner: the current
temperature is calculated taking the bias into account, bias is
removed from each atom, thermostatting is performed on the remaining
thermal degrees of freedom, and the bias is added back in.
:line
These fixes can be used with either the {verlet} or {respa}
"integrators"_run_style.html. When using one of the barostat fixes
with {respa}, LAMMPS uses an integrator constructed
according to the following factorization of the Liouville propagator
(for two rRESPA levels):
:c,image(Eqs/fix_nh1.jpg)
This factorization differs somewhat from that of Tuckerman et al, in
that the barostat is only updated at the outermost rRESPA level,
whereas Tuckerman's factorization requires splitting the pressure into
pieces corresponding to the forces computed at each rRESPA level. In
theory, the latter method will exhibit better numerical stability. In
practice, because Pdamp is normally chosen to be a large multiple of
the outermost rRESPA timestep, the barostat dynamics are not the
limiting factor for numerical stability. Both factorizations are
time-reversible and can be shown to preserve the phase space measure
of the underlying non-Hamiltonian equations of motion.
+NOTE: This implementation has been shown to conserve linear momentum
+up to machine precision under NVT dynamics. Under NPT dynamics,
+for a system with zero initial total linear momentum, the total
+momentum fluctuates close to zero. It may occasionally undergo brief
+excursions to non-negligible values, before returning close to zero.
+Over long simulations, this has the effect of causing the center-of-mass
+to undergo a slow random walk. This can be mitigated by resetting
+the momentum at infrequent intervals using the
+"fix momentum"_fix_momentum.html command.
+
+NOTE: This implementation has been shown to conserve linear momentum
+up to machine precision under NVT dynamics. Under NPT dynamics,
+for a system with zero initial total linear momentum, the total
+momentum fluctuates close to zero. It may occasionally undergo brief
+excursions to non-negligible values, before returning close to zero.
+Over long simulations, this has the effect of causing the center-of-mass
+to undergo a slow random walk. This can be mitigated by resetting
+the momentum at infrequent intervals using the
+"fix momentum"_fix_momentum.html command.
+
:line
The fix npt and fix nph commands can be used with rigid bodies or
mixtures of rigid bodies and non-rigid particles (e.g. solvent). But
there are also "fix rigid/npt"_fix_rigid.html and "fix
rigid/nph"_fix_rigid.html commands, which are typically a more natural
choice. See the doc page for those commands for more discussion of
the various ways to do this.
:line
Styles with a {cuda}, {gpu}, {intel}, {kk}, {omp}, or {opt} suffix are
functionally the same as the corresponding style without the suffix.
They have been optimized to run faster, depending on your available
hardware, as discussed in "Section_accelerate"_Section_accelerate.html
of the manual. The accelerated styles take the same arguments and
should produce the same results, except for round-off and precision
issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL,
KOKKOS, USER-OMP and OPT packages, respectively. They are only
enabled if LAMMPS was built with those packages. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_7 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
See "Section_accelerate"_Section_accelerate.html of the manual for
more instructions on how to use the accelerated styles effectively.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
These fixes writes the state of all the thermostat and barostat
variables to "binary restart files"_restart.html. See the
"read_restart"_read_restart.html command for info on how to re-specify
a fix in an input script that reads a restart file, so that the
operation of the fix continues in an uninterrupted fashion.
The "fix_modify"_fix_modify.html {temp} and {press} options are
supported by these fixes. You can use them to assign a
"compute"_compute.html you have defined to this fix which will be used
in its thermostatting or barostatting procedure, as described above.
If you do this, note that the kinetic energy derived from the compute
temperature should be consistent with the virial term computed using
all atoms for the pressure. LAMMPS will warn you if you choose to
compute temperature on a subset of atoms.
NOTE: If both the {temp} and {press} keywords are used in a single
thermo_modify command (or in two separate commands), then the order in
which the keywords are specified is important. Note that a "pressure
compute"_compute_pressure.html defines its own temperature compute as
an argument when it is specified. The {temp} keyword will override
this (for the pressure compute being used by fix npt), but only if the
{temp} keyword comes after the {press} keyword. If the {temp} keyword
comes before the {press} keyword, then the new pressure compute
specified by the {press} keyword will be unaffected by the {temp}
setting.
The "fix_modify"_fix_modify.html {energy} option is supported by these
fixes to add the energy change induced by Nose/Hoover thermostatting
and barostatting to the system's potential energy as part of
"thermodynamic output"_thermo_style.html.
These fixes compute a global scalar and a global vector of quantities,
which can be accessed by various "output
commands"_Section_howto.html#howto_15. The scalar value calculated by
these fixes is "extensive"; the vector values are "intensive".
The scalar is the cumulative energy change due to the fix.
The vector stores internal Nose/Hoover thermostat and barostat
variables. The number and meaning of the vector values depends on
which fix is used and the settings for keywords {tchain} and {pchain},
which specify the number of Nose/Hoover chains for the thermostat and
barostat. If no thermostatting is done, then {tchain} is 0. If no
barostatting is done, then {pchain} is 0. In the following list,
"ndof" is 0, 1, 3, or 6, and is the number of degrees of freedom in
the barostat. Its value is 0 if no barostat is used, else its value
is 6 if any off-diagonal stress tensor component is barostatted, else
its value is 1 if {couple xyz} is used or {couple xy} for a 2d
simulation, otherwise its value is 3.
The order of values in the global vector and their meaning is as
follows. The notation means there are tchain values for eta, followed
by tchain for eta_dot, followed by ndof for omega, etc:
eta\[tchain\] = particle thermostat displacements (unitless)
eta_dot\[tchain\] = particle thermostat velocities (1/time units)
omega\[ndof\] = barostat displacements (unitless)
omega_dot\[ndof\] = barostat velocities (1/time units)
etap\[pchain\] = barostat thermostat displacements (unitless)
etap_dot\[pchain\] = barostat thermostat velocities (1/time units)
PE_eta\[tchain\] = potential energy of each particle thermostat displacement (energy units)
KE_eta_dot\[tchain\] = kinetic energy of each particle thermostat velocity (energy units)
PE_omega\[ndof\] = potential energy of each barostat displacement (energy units)
KE_omega_dot\[ndof\] = kinetic energy of each barostat velocity (energy units)
PE_etap\[pchain\] = potential energy of each barostat thermostat displacement (energy units)
KE_etap_dot\[pchain\] = kinetic energy of each barostat thermostat velocity (energy units)
PE_strain\[1\] = scalar strain energy (energy units) :ul
These fixes can ramp their external temperature and pressure over
multiple runs, using the {start} and {stop} keywords of the
"run"_run.html command. See the "run"_run.html command for details of
how to do this.
These fixes are not invoked during "energy
minimization"_minimize.html.
:line
[Restrictions:]
{X}, {y}, {z} cannot be barostatted if the associated dimension is not
periodic. {Xy}, {xz}, and {yz} can only be barostatted if the
simulation domain is triclinic and the 2nd dimension in the keyword
({y} dimension in {xy}) is periodic. {Z}, {xz}, and {yz}, cannot be
barostatted for 2D simulations. The "create_box"_create_box.html,
"read data"_read_data.html, and "read_restart"_read_restart.html
commands specify whether the simulation box is orthogonal or
non-orthogonal (triclinic) and explain the meaning of the xy,xz,yz
tilt factors.
For the {temp} keyword, the final Tstop cannot be 0.0 since it would
make the external T = 0.0 at some timestep during the simulation which
is not allowed in the Nose/Hoover formulation.
The {scaleyz yes} and {scalexz yes} keyword/value pairs can not be used
for 2D simulations. {scaleyz yes}, {scalexz yes}, and {scalexy yes} options
can only be used if the 2nd dimension in the keyword is periodic,
and if the tilt factor is not coupled to the barostat via keywords
{tri}, {yz}, {xz}, and {xy}.
These fixes can be used with dynamic groups as defined by the
"group"_group.html command. Likewise they can be used with groups to
which atoms are added or deleted over time, e.g. a deposition
simulation. However, the conservation properties of the thermostat
and barostat are defined for systems with a static set of atoms. You
may observe odd behavior if the atoms in a group vary dramatically
over time or the atom count becomes very small.
[Related commands:]
"fix nve"_fix_nve.html, "fix_modify"_fix_modify.html,
"run_style"_run_style.html
[Default:]
The keyword defaults are tchain = 3, pchain = 3, mtk = yes, tloop =
ploop = 1, nreset = 0, drag = 0.0, dilate = all, couple = none,
scaleyz = scalexz = scalexy = yes if periodic in 2nd dimension and
not coupled to barostat, otherwise no.
:line
:link(Martyna)
[(Martyna)] Martyna, Tobias and Klein, J Chem Phys, 101, 4177 (1994).
:link(Parrinello)
[(Parrinello)] Parrinello and Rahman, J Appl Phys, 52, 7182 (1981).
:link(Tuckerman)
[(Tuckerman)] Tuckerman, Alejandre, Lopez-Rendon, Jochim, and
Martyna, J Phys A: Math Gen, 39, 5629 (2006).
:link(Shinoda)
[(Shinoda)] Shinoda, Shiga, and Mikami, Phys Rev B, 69, 134103 (2004).
diff --git a/doc/fix_nve_sphere.html b/doc/fix_nve_sphere.html
index cab18f270..7ab768601 100644
--- a/doc/fix_nve_sphere.html
+++ b/doc/fix_nve_sphere.html
@@ -1,273 +1,273 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>fix nve/sphere command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>fix nve/sphere command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="fix-nve-sphere-command">
<span id="index-0"></span><h1>fix nve/sphere command<a class="headerlink" href="#fix-nve-sphere-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-nve-sphere-omp-command">
<h1>fix nve/sphere/omp command<a class="headerlink" href="#fix-nve-sphere-omp-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix ID group-ID nve/sphere
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="fix.html"><em>fix</em></a> command</li>
<li>nve/sphere = style name of this fix command</li>
<li>zero or more keyword/value pairs may be appended</li>
<li>keyword = <em>update</em></li>
</ul>
<pre class="literal-block">
<em>update</em> value = <em>dipole</em>
dipole = update orientation of dipole moment during integration
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix 1 all nve/sphere
fix 1 all nve/sphere update dipole
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Perform constant NVE integration to update position, velocity, and
angular velocity for finite-size spherical particles in the group each
timestep. V is volume; E is energy. This creates a system trajectory
consistent with the microcanonical ensemble.</p>
<p>This fix differs from the <a class="reference internal" href="fix_nve.html"><em>fix nve</em></a> command, which
assumes point particles and only updates their position and velocity.</p>
<p>If the <em>update</em> keyword is used with the <em>dipole</em> value, then the
orientation of the dipole moment of each particle is also updated
during the time integration. This option should be used for models
-where a dipole moment is assigned to particles via use of the
-<a class="reference internal" href="atom_style.html"><em>atom_style dipole</em></a> command.</p>
+where a dipole moment is assigned to finite-size particles,
+e.g. spheroids via use of the <a class="reference internal" href="atom_style.html"><em>atom_style hybrid sphere dipole</em></a> command.</p>
<hr class="docutils" />
<p>Styles with a <em>cuda</em>, <em>gpu</em>, <em>intel</em>, <em>kk</em>, <em>omp</em>, or <em>opt</em> suffix are
functionally the same as the corresponding style without the suffix.
They have been optimized to run faster, depending on your available
hardware, as discussed in <a class="reference internal" href="Section_accelerate.html"><em>Section_accelerate</em></a>
of the manual. The accelerated styles take the same arguments and
should produce the same results, except for round-off and precision
issues.</p>
<p>These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL,
KOKKOS, USER-OMP and OPT packages, respectively. They are only
enabled if LAMMPS was built with those packages. See the <a class="reference internal" href="Section_start.html#start-3"><span>Making LAMMPS</span></a> section for more info.</p>
<p>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <a class="reference internal" href="Section_start.html#start-7"><span>-suffix command-line switch</span></a> when you invoke LAMMPS, or you can
use the <a class="reference internal" href="suffix.html"><em>suffix</em></a> command in your input script.</p>
<p>See <a class="reference internal" href="Section_accelerate.html"><em>Section_accelerate</em></a> of the manual for
more instructions on how to use the accelerated styles effectively.</p>
</div>
<hr class="docutils" />
<div class="section" id="restart-fix-modify-output-run-start-stop-minimize-info">
<h2>Restart, fix_modify, output, run start/stop, minimize info<a class="headerlink" href="#restart-fix-modify-output-run-start-stop-minimize-info" title="Permalink to this headline">¶</a></h2>
<p>No information about this fix is written to <a class="reference internal" href="restart.html"><em>binary restart files</em></a>. None of the <a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a> options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various <a class="reference internal" href="Section_howto.html#howto-15"><span>output commands</span></a>. No parameter of this fix can
be used with the <em>start/stop</em> keywords of the <a class="reference internal" href="run.html"><em>run</em></a> command.
This fix is not invoked during <a class="reference internal" href="minimize.html"><em>energy minimization</em></a>.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>This fix requires that atoms store torque and angular velocity (omega)
and a radius as defined by the <a class="reference internal" href="atom_style.html"><em>atom_style sphere</em></a>
command. If the <em>dipole</em> keyword is used, then they must also store a
dipole moment as defined by the <a class="reference internal" href="atom_style.html"><em>atom_style dipole</em></a>
command.</p>
<p>All particles in the group must be finite-size spheres. They cannot
be point particles.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="fix_nve.html"><em>fix nve</em></a>, <a class="reference internal" href="fix_nve_asphere.html"><em>fix nve/asphere</em></a></p>
<p><strong>Default:</strong> none</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/fix_nve_sphere.txt b/doc/fix_nve_sphere.txt
index 9aecc0e0a..cdc7eced3 100644
--- a/doc/fix_nve_sphere.txt
+++ b/doc/fix_nve_sphere.txt
@@ -1,95 +1,96 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
fix nve/sphere command :h3
fix nve/sphere/omp command :h3
[Syntax:]
fix ID group-ID nve/sphere :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
nve/sphere = style name of this fix command :l
zero or more keyword/value pairs may be appended :l
keyword = {update} :l
{update} value = {dipole}
dipole = update orientation of dipole moment during integration :pre
:ule
[Examples:]
fix 1 all nve/sphere
fix 1 all nve/sphere update dipole :pre
[Description:]
Perform constant NVE integration to update position, velocity, and
angular velocity for finite-size spherical particles in the group each
timestep. V is volume; E is energy. This creates a system trajectory
consistent with the microcanonical ensemble.
This fix differs from the "fix nve"_fix_nve.html command, which
assumes point particles and only updates their position and velocity.
If the {update} keyword is used with the {dipole} value, then the
orientation of the dipole moment of each particle is also updated
during the time integration. This option should be used for models
-where a dipole moment is assigned to particles via use of the
-"atom_style dipole"_atom_style.html command.
+where a dipole moment is assigned to finite-size particles,
+e.g. spheroids via use of the "atom_style hybrid sphere
+dipole"_atom_style.html command.
:line
Styles with a {cuda}, {gpu}, {intel}, {kk}, {omp}, or {opt} suffix are
functionally the same as the corresponding style without the suffix.
They have been optimized to run faster, depending on your available
hardware, as discussed in "Section_accelerate"_Section_accelerate.html
of the manual. The accelerated styles take the same arguments and
should produce the same results, except for round-off and precision
issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL,
KOKKOS, USER-OMP and OPT packages, respectively. They are only
enabled if LAMMPS was built with those packages. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_7 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
See "Section_accelerate"_Section_accelerate.html of the manual for
more instructions on how to use the accelerated styles effectively.
:line
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various "output
commands"_Section_howto.html#howto_15. No parameter of this fix can
be used with the {start/stop} keywords of the "run"_run.html command.
This fix is not invoked during "energy minimization"_minimize.html.
[Restrictions:]
This fix requires that atoms store torque and angular velocity (omega)
and a radius as defined by the "atom_style sphere"_atom_style.html
command. If the {dipole} keyword is used, then they must also store a
dipole moment as defined by the "atom_style dipole"_atom_style.html
command.
All particles in the group must be finite-size spheres. They cannot
be point particles.
[Related commands:]
"fix nve"_fix_nve.html, "fix nve/asphere"_fix_nve_asphere.html
[Default:] none
diff --git a/doc/fix_qeq.html b/doc/fix_qeq.html
index ce1f09f5c..40a9a74f6 100644
--- a/doc/fix_qeq.html
+++ b/doc/fix_qeq.html
@@ -1,369 +1,389 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>fix qeq/point command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>fix qeq/point command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="fix-qeq-point-command">
<span id="index-0"></span><h1>fix qeq/point command<a class="headerlink" href="#fix-qeq-point-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-qeq-shielded-command">
<h1>fix qeq/shielded command<a class="headerlink" href="#fix-qeq-shielded-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-qeq-slater-command">
<h1>fix qeq/slater command<a class="headerlink" href="#fix-qeq-slater-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="fix-qeq-dynamic-command">
<h1>fix qeq/dynamic command<a class="headerlink" href="#fix-qeq-dynamic-command" title="Permalink to this headline">¶</a></h1>
+</div>
+<div class="section" id="fix-qeq-fire-command">
+<h1>fix qeq/fire command<a class="headerlink" href="#fix-qeq-fire-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
-<div class="highlight-python"><div class="highlight"><pre>fix ID group-ID style Nevery cutoff tolerance maxiter qfile
+<div class="highlight-python"><div class="highlight"><pre>fix ID group-ID style Nevery cutoff tolerance maxiter qfile keyword ...
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="fix.html"><em>fix</em></a> command</li>
-<li>style = <em>qeq/point</em> or <em>qeq/shielded</em> or <em>qeq/slater</em> or <em>qeq/dynamic</em></li>
+<li>style = <em>qeq/point</em> or <em>qeq/shielded</em> or <em>qeq/slater</em> or <em>qeq/dynamic</em> or <em>qeq/fire</em></li>
<li>Nevery = perform charge equilibration every this many steps</li>
<li>cutoff = global cutoff for charge-charge interactions (distance unit)</li>
<li>tolerance = precision to which charges will be equilibrated</li>
<li>maxiter = maximum iterations to perform charge equilibration</li>
<li>qfile = a filename with QEq parameters</li>
+<li>zero or more keyword/value pairs may be appended</li>
+<li>keyword = <em>alpha</em> or <em>qdamp</em> or <em>qstep</em></li>
</ul>
+<pre class="literal-block">
+<em>alpha</em> value = Slater type orbital exponent (qeq/slater only)
+<em>qdamp</em> value = damping factor for damped dynamics charge solver (qeq/dynamic and qeq/fire only)
+<em>qstep</em> value = time step size for damped dynamics charge solver (qeq/dynamic and qeq/fire only)
+</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix 1 all qeq/point 1 10 1.0e-6 200 param.qeq1
fix 1 qeq qeq/shielded 1 8 1.0e-6 100 param.qeq2
-fix 1 all qeq/slater 5 10 1.0e-6 100 params
+fix 1 all qeq/slater 5 10 1.0e-6 100 params alpha 0.2
fix 1 qeq qeq/dynamic 1 12 1.0e-3 100 my_qeq
+fix 1 all qeq/fire 1 10 1.0e-3 100 my_qeq qdamp 0.2 qstep 0.1
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Perform the charge equilibration (QEq) method as described in <a class="reference internal" href="fix_qeq_reax.html#rappe"><span>(Rappe and Goddard)</span></a> and formulated in <a class="reference internal" href="neb.html#nakano"><span>(Nakano)</span></a> (also known
as the matrix inversion method) and in <a class="reference internal" href="pair_smtbq.html#rick"><span>(Rick and Stuart)</span></a> (also
known as the extended Lagrangian method) based on the
electronegativity equilization principle.</p>
<p>These fixes can be used with any <a class="reference internal" href="pair_style.html"><em>pair style</em></a> in
LAMMPS, so long as per-atom charges are defined. The most typical
use-case is in conjunction with a <a class="reference internal" href="pair_style.html"><em>pair style</em></a> that
performs charge equilibration periodically (e.g. every timestep), such
-as the ReaxFF or Streitz-Mintmire potential (the latter is not yet
-implemented in LAMMPS). But these fixes can also be used with
+as the ReaxFF or Streitz-Mintmire potential.
+But these fixes can also be used with
potentials that normally assume per-atom charges are fixed, e.g. a
<a class="reference internal" href="pair_buck.html"><em>Buckingham</em></a> or <a class="reference internal" href="pair_lj.html"><em>LJ/Coulombic</em></a> potential.</p>
<p>Because the charge equilibration calculation is effectively
independent of the pair style, these fixes can also be used to perform
a one-time assignment of charges to atoms. For example, you could
define the QEq fix, perform a zero-timestep run via the <a class="reference internal" href="run.html"><em>run</em></a>
command without any pair style defined which would set per-atom
charges (based on the current atom configuration), then remove the fix
via the <a class="reference internal" href="unfix.html"><em>unfix</em></a> command before performing further dynamics.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Computing and using charge values different from published
values defined for a fixed-charge potential like Buckingham or CHARMM
or AMBER, can have a strong effect on energies and forces, and
produces a different model than the published versions.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The <a class="reference internal" href="fix_qeq_comb.html"><em>fix qeq/comb</em></a> command must still be used
to perform charge equliibration with the <a class="reference internal" href="pair_comb.html"><em>COMB potential</em></a>. The <a class="reference internal" href="fix_qeq_reax.html"><em>fix qeq/reax</em></a>
command can be used to perform charge equilibration with the <a class="reference internal" href="pair_reax_c.html"><em>ReaxFF force field</em></a>, although fix qeq/shielded yields the
same results as fix qeq/reax if <em>Nevery</em>, <em>cutoff</em>, and <em>tolerance</em>
are the same. Eventually the fix qeq/reax command will be deprecated.</p>
</div>
<p>The QEq method minimizes the electrostatic energy of the system (or
equalizes the derivative of energy with respect to charge of all the
atoms) by adjusting the partial charge on individual atoms based on
interactions with their neighbors within <em>cutoff</em>. It reqires a few
parameters, in <em>metal</em> units, for each atom type which provided in a
file specified by <em>qfile</em>. The file has the following format</p>
<div class="highlight-python"><div class="highlight"><pre>1 chi eta gamma zeta qcore
2 chi eta gamma zeta qcore
...
Ntype chi eta gamma zeta qcore
</pre></div>
</div>
<p>There is one line per atom type with the following parameters.
Only a subset of the parameters is used by each QEq style as descibed
below, thus the others can be set to 0.0 if desired.</p>
<ul class="simple">
<li><em>chi</em> = electronegativity in energy units</li>
<li><em>eta</em> = self-Coulomb potential in energy units</li>
<li><em>gamma</em> = shielded Coulomb constant defined by <a class="reference internal" href="#vanduin"><span>ReaxFF force field</span></a> in distance units</li>
<li><em>zeta</em> = Slater type orbital exponent defined by the <a class="reference internal" href="pair_coul.html#streitz"><span>Streitz-Mintmire</span></a> potential in reverse distance units</li>
<li><em>qcore</em> = charge of the nucleus defined by the <a class="reference internal" href="pair_coul.html#streitz"><span>Streitz-Mintmire potential</span></a> potential in charge units</li>
</ul>
<p>The <em>qeq/point</em> style describes partial charges on atoms as point
charges. Interaction between a pair of charged particles is 1/r,
which is the simplest description of the interaction between charges.
Only the <em>chi</em> and <em>eta</em> parameters from the <em>qfile</em> file are used.
Note that Coulomb catastrophe can occur if repulsion between the pair
of charged particles is too weak. This style solves partial charges
on atoms via the matrix inversion method. A tolerance of 1.0e-6 is
usually a good number.</p>
<p>The <em>qeq/shielded</em> style describes partial charges on atoms also as
point charges, but uses a shielded Coulomb potential to describe the
interaction between a pair of charged particles. Interaction through
the shielded Coulomb is given by equation (13) of the <a class="reference internal" href="#vanduin"><span>ReaxFF force field</span></a> paper. The shielding accounts for charge overlap
between charged particles at small separation. This style is the same
as <a class="reference internal" href="fix_qeq_reax.html"><em>fix qeq/reax</em></a>, and can be used with <a class="reference internal" href="pair_reax_c.html"><em>pair_style reax/c</em></a>. Only the <em>chi</em>, <em>eta</em>, and <em>gamma</em>
parameters from the <em>qfile</em> file are used. This style solves partial
charges on atoms via the matrix inversion method. A tolerance of
1.0e-6 is usually a good number.</p>
<p>The <em>qeq/slater</em> style describes partial charges on atoms as spherical
charge densities centered around atoms via the Slater 1*s* orbital, so
that the interaction between a pair of charged particles is the
product of two Slater 1*s* orbitals. The expression for the Slater
1*s* orbital is given under equation (6) of the
<a class="reference internal" href="pair_coul.html#streitz"><span>Streitz-Mintmire</span></a> paper. Only the <em>chi</em>, <em>eta</em>, <em>zeta</em>, and
<em>qcore</em> parameters from the <em>qfile</em> file are used. This style solves
partial charges on atoms via the matrix inversion method. A tolerance
-of 1.0e-6 is usually a good number.</p>
+of 1.0e-6 is usually a good number. Keyword <em>alpha</em> can be used to
+change the Slater type orbital exponent.</p>
<p>The <em>qeq/dynamic</em> style describes partial charges on atoms as point
charges that interact through 1/r, but the extended Lagrangian method
is used to solve partial charges on atoms. Only the <em>chi</em> and <em>eta</em>
parameters from the <em>qfile</em> file are used. Note that Coulomb
catastrophe can occur if repulsion between the pair of charged
particles is too weak. A tolerance of 1.0e-3 is usually a good
-number.</p>
+number. Keyword <em>qdamp</em> can be used to change the damping factor, while
+keyword <em>qstep</em> can be used to change the time step size.</p>
+<p>The <a class="reference internal" href="#shan"><span>*qeq/fire*</span></a> style describes the same charge model and charge
+solver as the <em>qeq/dynamic</em> style, but employs a FIRE minimization
+algorithm to solve for equilibrium charges.
+Keyword <em>qdamp</em> can be used to change the damping factor, while
+keyword <em>qstep</em> can be used to change the time step size.</p>
<p>Note that <em>qeq/point</em>, <em>qeq/shielded</em>, and <em>qeq/slater</em> describe
different charge models, whereas the matrix inversion method and the
-extended Lagrangian method (<em>qeq/dynamic</em>) are different solvers.</p>
-<p>Note that the <em>qeq/point</em> and the <em>qeq/dynamic</em> styles both describe
+extended Lagrangian method (<em>qeq/dynamic</em> and <em>qeq/fire</em>) are
+different solvers.</p>
+<p>Note that <em>qeq/point</em>, <em>qeq/dynamic</em> and <em>qeq/fire</em> styles all describe
charges as point charges that interact through 1/r relationship, but
-solve partial charges on atoms using different solvers. Styles
-<em>qeq/point</em> and the <em>qeq/dynamic</em> should yield comparable results if
+solve partial charges on atoms using different solvers. These three
+styles should yield comparable results if
the QEq parameters and <em>Nevery</em>, <em>cutoff</em>, and <em>tolerance</em> are the
-same. Style <em>qeq/point</em> is typically faster, but <em>qeq/dynamic</em> scales
-better on larger sizes.</p>
+same. Style <em>qeq/point</em> is typically faster, <em>qeq/dynamic</em> scales
+better on larger sizes, and <em>qeq/fire</em> is faster than <em>qeq/dynamic</em>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">To avoid the evaluation of the derivative of charge with respect
to position, which is typically ill-defined, the system should have a
zero net charge.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Developing QEq parameters (chi, eta, gamma, zeta, and qcore) is
-an &#8220;art&#8221;. Charges on atoms are not guaranteed to equilibrate with
+non-trivial. Charges on atoms are not guaranteed to equilibrate with
arbitrary choices of these parameters. We do not develop these QEq
paramters. See the examples/qeq directory for some examples.</p>
</div>
</div>
<div class="section" id="restart-fix-modify-output-run-start-stop-minimize-info">
<h2>Restart, fix_modify, output, run start/stop, minimize info<a class="headerlink" href="#restart-fix-modify-output-run-start-stop-minimize-info" title="Permalink to this headline">¶</a></h2>
<p>No information about these fixes is written to <a class="reference internal" href="restart.html"><em>binary restart files</em></a>. No global scalar or vector or per-atom
quantities are stored by these fixes for access by various <a class="reference internal" href="Section_howto.html#howto-15"><span>output commands</span></a>. No parameter of these fixes
can be used with the <em>start/stop</em> keywords of the <a class="reference internal" href="run.html"><em>run</em></a>
command.</p>
<p>Thexe fixes are invoked during <a class="reference internal" href="minimize.html"><em>energy minimization</em></a>.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>These fixes are part of the QEQ package. They are only enabled if
LAMMPS was built with that package. See the <a class="reference internal" href="Section_start.html#start-3"><span>Making LAMMPS</span></a> section for more info.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="fix_qeq_reax.html"><em>fix qeq/reax</em></a>, <a class="reference internal" href="fix_qeq_comb.html"><em>fix qeq/comb</em></a></p>
<p><strong>Default:</strong> none</p>
<hr class="docutils" />
<p id="rappe"><strong>(Rappe and Goddard)</strong> A. K. Rappe and W. A. Goddard III, J Physical
Chemistry, 95, 3358-3363 (1991).</p>
<p id="nakano"><strong>(Nakano)</strong> A. Nakano, Computer Physics Communications, 104, 59-69 (1997).</p>
<p id="rick"><strong>(Rick and Stuart)</strong> S. W. Rick, S. J. Stuart, B. J. Berne, J Chemical Physics
101, 16141 (1994).</p>
<p id="streitz"><strong>(Streitz-Mintmire)</strong> F. H. Streitz, J. W. Mintmire, Physical Review B, 50,
16, 11996 (1994)</p>
<p id="vanduin"><strong>(ReaxFF)</strong> A. C. T. van Duin, S. Dasgupta, F. Lorant, W. A. Goddard III, J
Physical Chemistry, 105, 9396-9049 (2001)</p>
+<p id="shan"><strong>(QEq/Fire)</strong> T.-R. Shan, A. P. Thompson, S. J. Plimpton, in preparation</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/fix_qeq.txt b/doc/fix_qeq.txt
index a413c80b1..daa22f331 100644
--- a/doc/fix_qeq.txt
+++ b/doc/fix_qeq.txt
@@ -1,195 +1,217 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
fix qeq/point command :h3
fix qeq/shielded command :h3
fix qeq/slater command :h3
fix qeq/dynamic command :h3
+fix qeq/fire command :h3
[Syntax:]
-fix ID group-ID style Nevery cutoff tolerance maxiter qfile :pre
+fix ID group-ID style Nevery cutoff tolerance maxiter qfile keyword ... :pre
-ID, group-ID are documented in "fix"_fix.html command
-style = {qeq/point} or {qeq/shielded} or {qeq/slater} or {qeq/dynamic}
-Nevery = perform charge equilibration every this many steps
-cutoff = global cutoff for charge-charge interactions (distance unit)
-tolerance = precision to which charges will be equilibrated
-maxiter = maximum iterations to perform charge equilibration
-qfile = a filename with QEq parameters :ul
+ID, group-ID are documented in "fix"_fix.html command :ulb,l
+style = {qeq/point} or {qeq/shielded} or {qeq/slater} or {qeq/dynamic} or {qeq/fire} :l
+Nevery = perform charge equilibration every this many steps :l
+cutoff = global cutoff for charge-charge interactions (distance unit) :l
+tolerance = precision to which charges will be equilibrated :l
+maxiter = maximum iterations to perform charge equilibration :l
+qfile = a filename with QEq parameters :l
+
+zero or more keyword/value pairs may be appended :l
+keyword = {alpha} or {qdamp} or {qstep} :l
+ {alpha} value = Slater type orbital exponent (qeq/slater only)
+ {qdamp} value = damping factor for damped dynamics charge solver (qeq/dynamic and qeq/fire only)
+ {qstep} value = time step size for damped dynamics charge solver (qeq/dynamic and qeq/fire only) :pre
+
+:ule
[Examples:]
fix 1 all qeq/point 1 10 1.0e-6 200 param.qeq1
fix 1 qeq qeq/shielded 1 8 1.0e-6 100 param.qeq2
-fix 1 all qeq/slater 5 10 1.0e-6 100 params
-fix 1 qeq qeq/dynamic 1 12 1.0e-3 100 my_qeq :pre
+fix 1 all qeq/slater 5 10 1.0e-6 100 params alpha 0.2
+fix 1 qeq qeq/dynamic 1 12 1.0e-3 100 my_qeq
+fix 1 all qeq/fire 1 10 1.0e-3 100 my_qeq qdamp 0.2 qstep 0.1 :pre
[Description:]
Perform the charge equilibration (QEq) method as described in "(Rappe
and Goddard)"_#Rappe and formulated in "(Nakano)"_#Nakano (also known
as the matrix inversion method) and in "(Rick and Stuart)"_#Rick (also
known as the extended Lagrangian method) based on the
electronegativity equilization principle.
These fixes can be used with any "pair style"_pair_style.html in
LAMMPS, so long as per-atom charges are defined. The most typical
use-case is in conjunction with a "pair style"_pair_style.html that
performs charge equilibration periodically (e.g. every timestep), such
-as the ReaxFF or Streitz-Mintmire potential (the latter is not yet
-implemented in LAMMPS). But these fixes can also be used with
+as the ReaxFF or Streitz-Mintmire potential.
+But these fixes can also be used with
potentials that normally assume per-atom charges are fixed, e.g. a
"Buckingham"_pair_buck.html or "LJ/Coulombic"_pair_lj.html potential.
Because the charge equilibration calculation is effectively
independent of the pair style, these fixes can also be used to perform
a one-time assignment of charges to atoms. For example, you could
define the QEq fix, perform a zero-timestep run via the "run"_run.html
command without any pair style defined which would set per-atom
charges (based on the current atom configuration), then remove the fix
via the "unfix"_unfix.html command before performing further dynamics.
NOTE: Computing and using charge values different from published
values defined for a fixed-charge potential like Buckingham or CHARMM
or AMBER, can have a strong effect on energies and forces, and
produces a different model than the published versions.
NOTE: The "fix qeq/comb"_fix_qeq_comb.html command must still be used
to perform charge equliibration with the "COMB
potential"_pair_comb.html. The "fix qeq/reax"_fix_qeq_reax.html
command can be used to perform charge equilibration with the "ReaxFF
force field"_pair_reax_c.html, although fix qeq/shielded yields the
same results as fix qeq/reax if {Nevery}, {cutoff}, and {tolerance}
are the same. Eventually the fix qeq/reax command will be deprecated.
The QEq method minimizes the electrostatic energy of the system (or
equalizes the derivative of energy with respect to charge of all the
atoms) by adjusting the partial charge on individual atoms based on
interactions with their neighbors within {cutoff}. It reqires a few
parameters, in {metal} units, for each atom type which provided in a
file specified by {qfile}. The file has the following format
1 chi eta gamma zeta qcore
2 chi eta gamma zeta qcore
...
Ntype chi eta gamma zeta qcore :pre
There is one line per atom type with the following parameters.
Only a subset of the parameters is used by each QEq style as descibed
below, thus the others can be set to 0.0 if desired.
{chi} = electronegativity in energy units
{eta} = self-Coulomb potential in energy units
{gamma} = shielded Coulomb constant defined by "ReaxFF force field"_#vanDuin in distance units
{zeta} = Slater type orbital exponent defined by the "Streitz-Mintmire"_#Streitz potential in reverse distance units
{qcore} = charge of the nucleus defined by the "Streitz-Mintmire potential"_#Streitz potential in charge units :ul
The {qeq/point} style describes partial charges on atoms as point
charges. Interaction between a pair of charged particles is 1/r,
which is the simplest description of the interaction between charges.
Only the {chi} and {eta} parameters from the {qfile} file are used.
Note that Coulomb catastrophe can occur if repulsion between the pair
of charged particles is too weak. This style solves partial charges
on atoms via the matrix inversion method. A tolerance of 1.0e-6 is
usually a good number.
The {qeq/shielded} style describes partial charges on atoms also as
point charges, but uses a shielded Coulomb potential to describe the
interaction between a pair of charged particles. Interaction through
the shielded Coulomb is given by equation (13) of the "ReaxFF force
field"_#vanDuin paper. The shielding accounts for charge overlap
between charged particles at small separation. This style is the same
as "fix qeq/reax"_fix_qeq_reax.html, and can be used with "pair_style
reax/c"_pair_reax_c.html. Only the {chi}, {eta}, and {gamma}
parameters from the {qfile} file are used. This style solves partial
charges on atoms via the matrix inversion method. A tolerance of
1.0e-6 is usually a good number.
The {qeq/slater} style describes partial charges on atoms as spherical
charge densities centered around atoms via the Slater 1{s} orbital, so
that the interaction between a pair of charged particles is the
product of two Slater 1{s} orbitals. The expression for the Slater
1{s} orbital is given under equation (6) of the
"Streitz-Mintmire"_#Streitz paper. Only the {chi}, {eta}, {zeta}, and
{qcore} parameters from the {qfile} file are used. This style solves
partial charges on atoms via the matrix inversion method. A tolerance
-of 1.0e-6 is usually a good number.
+of 1.0e-6 is usually a good number. Keyword {alpha} can be used to
+change the Slater type orbital exponent.
The {qeq/dynamic} style describes partial charges on atoms as point
charges that interact through 1/r, but the extended Lagrangian method
is used to solve partial charges on atoms. Only the {chi} and {eta}
parameters from the {qfile} file are used. Note that Coulomb
catastrophe can occur if repulsion between the pair of charged
particles is too weak. A tolerance of 1.0e-3 is usually a good
-number.
+number. Keyword {qdamp} can be used to change the damping factor, while
+keyword {qstep} can be used to change the time step size.
+
+The "{qeq/fire}"_#Shan style describes the same charge model and charge
+solver as the {qeq/dynamic} style, but employs a FIRE minimization
+algorithm to solve for equilibrium charges.
+Keyword {qdamp} can be used to change the damping factor, while
+keyword {qstep} can be used to change the time step size.
Note that {qeq/point}, {qeq/shielded}, and {qeq/slater} describe
different charge models, whereas the matrix inversion method and the
-extended Lagrangian method ({qeq/dynamic}) are different solvers.
+extended Lagrangian method ({qeq/dynamic} and {qeq/fire}) are
+different solvers.
-Note that the {qeq/point} and the {qeq/dynamic} styles both describe
+Note that {qeq/point}, {qeq/dynamic} and {qeq/fire} styles all describe
charges as point charges that interact through 1/r relationship, but
-solve partial charges on atoms using different solvers. Styles
-{qeq/point} and the {qeq/dynamic} should yield comparable results if
+solve partial charges on atoms using different solvers. These three
+styles should yield comparable results if
the QEq parameters and {Nevery}, {cutoff}, and {tolerance} are the
-same. Style {qeq/point} is typically faster, but {qeq/dynamic} scales
-better on larger sizes.
+same. Style {qeq/point} is typically faster, {qeq/dynamic} scales
+better on larger sizes, and {qeq/fire} is faster than {qeq/dynamic}.
NOTE: To avoid the evaluation of the derivative of charge with respect
to position, which is typically ill-defined, the system should have a
zero net charge.
NOTE: Developing QEq parameters (chi, eta, gamma, zeta, and qcore) is
-an "art". Charges on atoms are not guaranteed to equilibrate with
+non-trivial. Charges on atoms are not guaranteed to equilibrate with
arbitrary choices of these parameters. We do not develop these QEq
paramters. See the examples/qeq directory for some examples.
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about these fixes is written to "binary restart
files"_restart.html. No global scalar or vector or per-atom
quantities are stored by these fixes for access by various "output
commands"_Section_howto.html#howto_15. No parameter of these fixes
can be used with the {start/stop} keywords of the "run"_run.html
command.
Thexe fixes are invoked during "energy minimization"_minimize.html.
[Restrictions:]
These fixes are part of the QEQ package. They are only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"fix qeq/reax"_fix_qeq_reax.html, "fix qeq/comb"_fix_qeq_comb.html
[Default:] none
:line
:link(Rappe)
[(Rappe and Goddard)] A. K. Rappe and W. A. Goddard III, J Physical
Chemistry, 95, 3358-3363 (1991).
:link(Nakano)
[(Nakano)] A. Nakano, Computer Physics Communications, 104, 59-69 (1997).
:link(Rick)
[(Rick and Stuart)] S. W. Rick, S. J. Stuart, B. J. Berne, J Chemical Physics
101, 16141 (1994).
:link(Streitz)
[(Streitz-Mintmire)] F. H. Streitz, J. W. Mintmire, Physical Review B, 50,
16, 11996 (1994)
:link(vanDuin)
[(ReaxFF)] A. C. T. van Duin, S. Dasgupta, F. Lorant, W. A. Goddard III, J
Physical Chemistry, 105, 9396-9049 (2001)
+
+:link(Shan)
+[(QEq/Fire)] T.-R. Shan, A. P. Thompson, S. J. Plimpton, in preparation
diff --git a/doc/fix_store_state.html b/doc/fix_store_state.html
index b70fe8fec..e96eb5e76 100644
--- a/doc/fix_store_state.html
+++ b/doc/fix_store_state.html
@@ -1,316 +1,316 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>fix store/state command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>fix store/state command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="fix-store-state-command">
<span id="index-0"></span><h1>fix store/state command<a class="headerlink" href="#fix-store-state-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix ID group-ID store/state N input1 input2 ... keyword value ...
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="fix.html"><em>fix</em></a> command</li>
<li>store/state = style name of this fix command</li>
<li>N = store atom attributes every N steps, N = 0 for initial store only</li>
<li>input = one or more atom attributes</li>
</ul>
<div class="highlight-python"><div class="highlight"><pre>possible attributes = id, mol, type, mass,
- x, y, z, xs, ys, zs, xu, yu, zu, ix, iy, iz,
+ x, y, z, xs, ys, zs, xu, yu, zu, xsu, ysu, zsu, ix, iy, iz,
vx, vy, vz, fx, fy, fz,
- q, mux, muy, muz,
- radius, omegax, omegay, omegaz,
+ q, mux, muy, muz, mu,
+ radius, diameter, omegax, omegay, omegaz,
angmomx, angmomy, angmomz, tqx, tqy, tqz,
c_ID, c_ID[N], f_ID, f_ID[N], v_name,
d_name, i_name
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>id = atom ID
mol = molecule ID
type = atom type
mass = atom mass
x,y,z = unscaled atom coordinates
xs,ys,zs = scaled atom coordinates
xu,yu,zu = unwrapped atom coordinates
+xsu,ysu,zsu = scaled unwrapped atom coordinates
ix,iy,iz = box image that the atom is in
vx,vy,vz = atom velocities
fx,fy,fz = forces on atoms
q = atom charge
mux,muy,muz = orientation of dipolar atom
-radius = radius of spherical particle
+mu = magnitued of dipole moment of atom
+radius,diameter = radius.diameter of spherical particle
omegax,omegay,omegaz = angular velocity of spherical particle
angmomx,angmomy,angmomz = angular momentum of aspherical particle
tqx,tqy,tqz = torque on finite-size particles
c_ID = per-atom vector calculated by a compute with ID
c_ID[I] = Ith column of per-atom array calculated by a compute with ID
f_ID = per-atom vector calculated by a fix with ID
f_ID[I] = Ith column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name
d_name = per-atom floating point vector name, managed by fix property/atom
i_name = per-atom integer vector name, managed by fix property/atom
</pre></div>
</div>
<ul class="simple">
<li>zero or more keyword/value pairs may be appended</li>
<li>keyword = <em>com</em></li>
</ul>
<pre class="literal-block">
<em>com</em> value = <em>yes</em> or <em>no</em>
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix 1 all store/state 0 x y z
fix 1 all store/state 0 xu yu zu com yes
fix 2 all store/state 1000 vx vy vz
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Define a fix that stores attributes for each atom in the group at the
time the fix is defined. If <em>N</em> is 0, then the values are never
updated, so this is a way of archiving an atom attribute at a given
time for future use in a calculation or output. See the discussion of
<a class="reference internal" href="Section_howto.html#howto-15"><span>output commands</span></a> that take fixes as
-inputs. And see for example, the <a class="reference internal" href="compute_reduce.html"><em>compute reduce</em></a>, <a class="reference internal" href="fix_ave_atom.html"><em>fix ave/atom</em></a>, <a class="reference internal" href="fix_ave_histo.html"><em>fix ave/histo</em></a>, <a class="reference internal" href="fix_ave_spatial.html"><em>fix ave/spatial</em></a>,
-and <a class="reference internal" href="variable.html"><em>atom-style variable</em></a> commands.</p>
+inputs.</p>
<p>If <em>N</em> is not zero, then the attributes will be updated every <em>N</em>
steps.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Actually, only atom attributes specified by keywords like <em>xu</em>
-or <em>vy</em> are initially stored immediately at the point in your input
-script when the fix is defined. Attributes specified by a compute,
-fix, or variable are not initially stored until the first run
+or <em>vy</em> or <em>radius</em> are initially stored immediately at the point in
+your input script when the fix is defined. Attributes specified by a
+compute, fix, or variable are not initially stored until the first run
following the fix definition begins. This is because calculating
those attributes may require quantities that are not defined in
between runs.</p>
</div>
<p>The list of possible attributes is the same as that used by the <a class="reference internal" href="dump.html"><em>dump custom</em></a> command, which describes their meaning.</p>
<p>If the <em>com</em> keyword is set to <em>yes</em> then the <em>xu</em>, <em>yu</em>, and <em>zu</em>
inputs store the position of each atom relative to the center-of-mass
-of the group of atoms, instead of storing the absolute position. This
-option is used by the <a class="reference internal" href="compute_msd.html"><em>compute msd</em></a> command.</p>
+of the group of atoms, instead of storing the absolute position.</p>
<p>The requested values are stored in a per-atom vector or array as
discussed below. Zeroes are stored for atoms not in the specified
group.</p>
</div>
<div class="section" id="restart-fix-modify-output-run-start-stop-minimize-info">
<h2>Restart, fix_modify, output, run start/stop, minimize info<a class="headerlink" href="#restart-fix-modify-output-run-start-stop-minimize-info" title="Permalink to this headline">¶</a></h2>
<p>This fix writes the per-atom values it stores to <a class="reference internal" href="restart.html"><em>binary restart files</em></a>, so that the values can be restored when a
simulation is restarted. See the <a class="reference internal" href="read_restart.html"><em>read_restart</em></a>
command for info on how to re-specify a fix in an input script that
reads a restart file, so that the operation of the fix continues in an
uninterrupted fashion.</p>
<p>None of the <a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a> options are relevant to this
fix.</p>
<p>If a single input is specified, this fix produces a per-atom vector.
If multiple inputs are specified, a per-atom array is produced where
the number of columns for each atom is the number of inputs. These
can be accessed by various <a class="reference internal" href="Section_howto.html#howto-15"><span>output commands</span></a>. The per-atom values be
accessed on any timestep.</p>
<p>No parameter of this fix can be used with the <em>start/stop</em> keywords of
the <a class="reference internal" href="run.html"><em>run</em></a> command. This fix is not invoked during <a class="reference internal" href="minimize.html"><em>energy minimization</em></a>.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div>none</div></blockquote>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="dump.html"><em>dump custom</em></a>, <a class="reference internal" href="compute_property_atom.html"><em>compute property/atom</em></a>,
<a class="reference internal" href="fix_property_atom.html"><em>fix property/atom</em></a>, <a class="reference internal" href="variable.html"><em>variable</em></a></p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<p>The option default is com = no.</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/fix_store_state.txt b/doc/fix_store_state.txt
index 8c37ee8b1..6521f078b 100644
--- a/doc/fix_store_state.txt
+++ b/doc/fix_store_state.txt
@@ -1,131 +1,129 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
fix store/state command :h3
[Syntax:]
fix ID group-ID store/state N input1 input2 ... keyword value ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l
store/state = style name of this fix command :l
N = store atom attributes every N steps, N = 0 for initial store only :l
input = one or more atom attributes :l
possible attributes = id, mol, type, mass,
- x, y, z, xs, ys, zs, xu, yu, zu, ix, iy, iz,
+ x, y, z, xs, ys, zs, xu, yu, zu, xsu, ysu, zsu, ix, iy, iz,
vx, vy, vz, fx, fy, fz,
- q, mux, muy, muz,
- radius, omegax, omegay, omegaz,
+ q, mux, muy, muz, mu,
+ radius, diameter, omegax, omegay, omegaz,
angmomx, angmomy, angmomz, tqx, tqy, tqz,
c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name,
d_name, i_name :pre
id = atom ID
mol = molecule ID
type = atom type
mass = atom mass
x,y,z = unscaled atom coordinates
xs,ys,zs = scaled atom coordinates
xu,yu,zu = unwrapped atom coordinates
+ xsu,ysu,zsu = scaled unwrapped atom coordinates
ix,iy,iz = box image that the atom is in
vx,vy,vz = atom velocities
fx,fy,fz = forces on atoms
q = atom charge
mux,muy,muz = orientation of dipolar atom
- radius = radius of spherical particle
+ mu = magnitued of dipole moment of atom
+ radius,diameter = radius.diameter of spherical particle
omegax,omegay,omegaz = angular velocity of spherical particle
angmomx,angmomy,angmomz = angular momentum of aspherical particle
tqx,tqy,tqz = torque on finite-size particles
c_ID = per-atom vector calculated by a compute with ID
c_ID\[I\] = Ith column of per-atom array calculated by a compute with ID
f_ID = per-atom vector calculated by a fix with ID
f_ID\[I\] = Ith column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name
d_name = per-atom floating point vector name, managed by fix property/atom
i_name = per-atom integer vector name, managed by fix property/atom :pre
zero or more keyword/value pairs may be appended :l
keyword = {com} :l
{com} value = {yes} or {no} :pre
:ule
[Examples:]
fix 1 all store/state 0 x y z
fix 1 all store/state 0 xu yu zu com yes
fix 2 all store/state 1000 vx vy vz :pre
[Description:]
Define a fix that stores attributes for each atom in the group at the
time the fix is defined. If {N} is 0, then the values are never
updated, so this is a way of archiving an atom attribute at a given
time for future use in a calculation or output. See the discussion of
"output commands"_Section_howto.html#howto_15 that take fixes as
-inputs. And see for example, the "compute
-reduce"_compute_reduce.html, "fix ave/atom"_fix_ave_atom.html, "fix
-ave/histo"_fix_ave_histo.html, "fix ave/spatial"_fix_ave_spatial.html,
-and "atom-style variable"_variable.html commands.
+inputs.
If {N} is not zero, then the attributes will be updated every {N}
steps.
NOTE: Actually, only atom attributes specified by keywords like {xu}
-or {vy} are initially stored immediately at the point in your input
-script when the fix is defined. Attributes specified by a compute,
-fix, or variable are not initially stored until the first run
+or {vy} or {radius} are initially stored immediately at the point in
+your input script when the fix is defined. Attributes specified by a
+compute, fix, or variable are not initially stored until the first run
following the fix definition begins. This is because calculating
those attributes may require quantities that are not defined in
between runs.
The list of possible attributes is the same as that used by the "dump
custom"_dump.html command, which describes their meaning.
If the {com} keyword is set to {yes} then the {xu}, {yu}, and {zu}
inputs store the position of each atom relative to the center-of-mass
-of the group of atoms, instead of storing the absolute position. This
-option is used by the "compute msd"_compute_msd.html command.
+of the group of atoms, instead of storing the absolute position.
The requested values are stored in a per-atom vector or array as
discussed below. Zeroes are stored for atoms not in the specified
group.
[Restart, fix_modify, output, run start/stop, minimize info:]
This fix writes the per-atom values it stores to "binary restart
files"_restart.html, so that the values can be restored when a
simulation is restarted. See the "read_restart"_read_restart.html
command for info on how to re-specify a fix in an input script that
reads a restart file, so that the operation of the fix continues in an
uninterrupted fashion.
None of the "fix_modify"_fix_modify.html options are relevant to this
fix.
If a single input is specified, this fix produces a per-atom vector.
If multiple inputs are specified, a per-atom array is produced where
the number of columns for each atom is the number of inputs. These
can be accessed by various "output
commands"_Section_howto.html#howto_15. The per-atom values be
accessed on any timestep.
No parameter of this fix can be used with the {start/stop} keywords of
the "run"_run.html command. This fix is not invoked during "energy
minimization"_minimize.html.
[Restrictions:] none
[Related commands:]
"dump custom"_dump.html, "compute
property/atom"_compute_property_atom.html,
"fix property/atom"_fix_property_atom.html, "variable"_variable.html
[Default:]
The option default is com = no.
diff --git a/doc/group2ndx.txt b/doc/group2ndx.txt
index d40d4399f..208d1fc85 100644
--- a/doc/group2ndx.txt
+++ b/doc/group2ndx.txt
@@ -1,51 +1,64 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
group2ndx command :h3
+ndx2group command :h3
[Syntax:]
-group2ndx file group-ID ... :pre
+group2ndx file group-ID ...
+ndx2group file group-ID ... :pre
-file = name of index file to write out :ulb,l
+file = name of index file to write out or read in :ulb,l
zero or more group IDs may be appended :l
:ule
[Examples:]
group2ndx allindex.ndx
-group2ndx someindex.ndx upper lower mobile :pre
+group2ndx someindex.ndx upper lower mobile
+ndx2group someindex.ndx
+ndx2group someindex.ndx mobile :pre
[Description:]
-Write a Gromacs style index file in text format that associates atom IDs
-with the corresponding group definitions. This index file can be used
-with in combination with Gromacs analysis tools or to import group
-definitions into the "fix colvars"_fix_colvars.html input file.
+Write or read a Gromacs style index file in text format that associates
+atom IDs with the corresponding group definitions. This index file can be
+used with in combination with Gromacs analysis tools or to import group
+definitions into the "fix colvars"_fix_colvars.html input file. It can
+also be used to save and restore group definitions for static groups.
+The {group2ndx} command will write group definitions to an index file.
Without specifying any group IDs, all groups will be written to the index
file. When specifying group IDs, only those groups will be written to the
index file. In order to follow the Gromacs conventions, the group {all}
will be renamed to {System} in the index file.
+The {ndx2group} command will create of update group definitions from those
+stored in an index file. Without specifying any group IDs, all groups except
+{System} will be read from the index file and the corresponding groups
+recreated. If a group of the same name already exists, it will be completely
+reset. When specifying group IDs, those groups, if present, will be read
+from the index file and restored.
+
:line
[Restrictions:]
This command requires that atoms have atom IDs, since this is the
information that is written to the index file.
-This fix is part of the USER-COLVARS package. It is only enabled if
-LAMMPS was built with that package. See the "Making
+These commands are part of the USER-COLVARS package. They are only
+enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
"group"_group.html, "dump"_dump.html, "fix colvars"_fix_colvars.html
[Default:] none
diff --git a/doc/pair_beck.html b/doc/pair_beck.html
index f58e89837..81cf482da 100644
--- a/doc/pair_beck.html
+++ b/doc/pair_beck.html
@@ -1,282 +1,282 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pair_style beck command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>pair_style beck command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="pair-style-beck-command">
<span id="index-0"></span><h1>pair_style beck command<a class="headerlink" href="#pair-style-beck-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="pair-style-beck-gpu-command">
<h1>pair_style beck/gpu command<a class="headerlink" href="#pair-style-beck-gpu-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="pair-style-beck-omp-command">
<h1>pair_style beck/omp command<a class="headerlink" href="#pair-style-beck-omp-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>pair_style beck Rc
</pre></div>
</div>
<ul class="simple">
<li>Rc = cutoff for interactions (distance units)</li>
</ul>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>pair_style beck 8.0
pair_coeff * * 399.671876712 0.0000867636112694 0.675 4.390 0.0003746
pair_coeff 1 1 399.671876712 0.0000867636112694 0.675 4.390 0.0003746 6.0
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Style <em>beck</em> computes interactions based on the potential by
<a class="reference internal" href="#beck"><span>(Beck)</span></a>, originally designed for simulation of Helium. It
includes truncation at a cutoff distance Rc.</p>
<img alt="_images/pair_beck.jpg" class="align-center" src="_images/pair_beck.jpg" />
<p>The following coefficients must be defined for each pair of atoms
types via the <a class="reference internal" href="pair_coeff.html"><em>pair_coeff</em></a> command as in the examples
above, or in the data file or restart files read by the
<a class="reference internal" href="read_data.html"><em>read_data</em></a> or <a class="reference internal" href="read_restart.html"><em>read_restart</em></a>
commands.</p>
<ul class="simple">
<li>A (energy units)</li>
<li>B (energy-distance^6 units)</li>
<li>a (distance units)</li>
<li>alpha (1/distance units)</li>
<li>beta (1/distance^6 units)</li>
<li>cutoff (distance units)</li>
</ul>
<p>The last coefficient is optional. If not specified, the global cutoff
Rc is used.</p>
<hr class="docutils" />
<p>Styles with a <em>cuda</em>, <em>gpu</em>, <em>intel</em>, <em>kk</em>, <em>omp</em>, or <em>opt</em> suffix are
functionally the same as the corresponding style without the suffix.
They have been optimized to run faster, depending on your available
hardware, as discussed in <a class="reference internal" href="Section_accelerate.html"><em>Section_accelerate</em></a>
of the manual. The accelerated styles take the same arguments and
should produce the same results, except for round-off and precision
issues.</p>
<p>These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL,
KOKKOS, USER-OMP and OPT packages, respectively. They are only
enabled if LAMMPS was built with those packages. See the <a class="reference internal" href="Section_start.html#start-3"><span>Making LAMMPS</span></a> section for more info.</p>
<p>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <a class="reference internal" href="Section_start.html#start-7"><span>-suffix command-line switch</span></a> when you invoke LAMMPS, or you can
use the <a class="reference internal" href="suffix.html"><em>suffix</em></a> command in your input script.</p>
<p>See <a class="reference internal" href="Section_accelerate.html"><em>Section_accelerate</em></a> of the manual for
more instructions on how to use the accelerated styles effectively.</p>
<hr class="docutils" />
<p><strong>Mixing, shift, table, tail correction, restart, rRESPA info</strong>:</p>
<p>For atom type pairs I,J and I != J, coeffiecients must be specified.
-No default miture rules are used.</p>
+No default mixing rules are used.</p>
<p>This pair style does not support the <a class="reference internal" href="pair_modify.html"><em>pair_modify</em></a> shift
option for the energy of the pair interaction.</p>
<p>The <a class="reference internal" href="pair_modify.html"><em>pair_modify</em></a> table option is not relevant
for this pair style.</p>
<p>This pair style does not support the <a class="reference internal" href="pair_modify.html"><em>pair_modify</em></a>
tail option for adding long-range tail corrections.</p>
<p>This pair style writes its information to <a class="reference internal" href="restart.html"><em>binary restart files</em></a>, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.</p>
<p>This pair style can only be used via the <em>pair</em> keyword of the
<a class="reference internal" href="run_style.html"><em>run_style respa</em></a> command. It does not support the
<em>inner</em>, <em>middle</em>, <em>outer</em> keywords.</p>
</div>
<hr class="docutils" />
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div>none</div></blockquote>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="pair_coeff.html"><em>pair_coeff</em></a></p>
<p><strong>Default:</strong> none</p>
<hr class="docutils" />
<p id="beck"><strong>(Beck)</strong> Beck, Molecular Physics, 14, 311 (1968).</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/pair_beck.txt b/doc/pair_beck.txt
index b3ae94bdf..1b2309ef7 100644
--- a/doc/pair_beck.txt
+++ b/doc/pair_beck.txt
@@ -1,109 +1,109 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
pair_style beck command :h3
pair_style beck/gpu command :h3
pair_style beck/omp command :h3
[Syntax:]
pair_style beck Rc :pre
Rc = cutoff for interactions (distance units) :ul
[Examples:]
pair_style beck 8.0
pair_coeff * * 399.671876712 0.0000867636112694 0.675 4.390 0.0003746
pair_coeff 1 1 399.671876712 0.0000867636112694 0.675 4.390 0.0003746 6.0 :pre
[Description:]
Style {beck} computes interactions based on the potential by
"(Beck)"_#Beck, originally designed for simulation of Helium. It
includes truncation at a cutoff distance Rc.
:c,image(Eqs/pair_beck.jpg)
The following coefficients must be defined for each pair of atoms
types via the "pair_coeff"_pair_coeff.html command as in the examples
above, or in the data file or restart files read by the
"read_data"_read_data.html or "read_restart"_read_restart.html
commands.
A (energy units)
B (energy-distance^6 units)
a (distance units)
alpha (1/distance units)
beta (1/distance^6 units)
cutoff (distance units) :ul
The last coefficient is optional. If not specified, the global cutoff
Rc is used.
:line
Styles with a {cuda}, {gpu}, {intel}, {kk}, {omp}, or {opt} suffix are
functionally the same as the corresponding style without the suffix.
They have been optimized to run faster, depending on your available
hardware, as discussed in "Section_accelerate"_Section_accelerate.html
of the manual. The accelerated styles take the same arguments and
should produce the same results, except for round-off and precision
issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL,
KOKKOS, USER-OMP and OPT packages, respectively. They are only
enabled if LAMMPS was built with those packages. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Section_start.html#start_7 when you invoke LAMMPS, or you can
use the "suffix"_suffix.html command in your input script.
See "Section_accelerate"_Section_accelerate.html of the manual for
more instructions on how to use the accelerated styles effectively.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, coeffiecients must be specified.
-No default miture rules are used.
+No default mixing rules are used.
This pair style does not support the "pair_modify"_pair_modify.html shift
option for the energy of the pair interaction.
The "pair_modify"_pair_modify.html table option is not relevant
for this pair style.
This pair style does not support the "pair_modify"_pair_modify.html
tail option for adding long-range tail corrections.
This pair style writes its information to "binary restart
files"_restart.html, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
This pair style can only be used via the {pair} keyword of the
"run_style respa"_run_style.html command. It does not support the
{inner}, {middle}, {outer} keywords.
:line
[Restrictions:] none
[Related commands:]
"pair_coeff"_pair_coeff.html
[Default:] none
:line
:link(Beck)
[(Beck)] Beck, Molecular Physics, 14, 311 (1968).
diff --git a/doc/pair_line_lj.html b/doc/pair_line_lj.html
index 114a88a87..18723f4b6 100644
--- a/doc/pair_line_lj.html
+++ b/doc/pair_line_lj.html
@@ -1,302 +1,315 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pair_style line/lj command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>pair_style line/lj command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="pair-style-line-lj-command">
<span id="index-0"></span><h1>pair_style line/lj command<a class="headerlink" href="#pair-style-line-lj-command" title="Permalink to this headline">¶</a></h1>
-</div>
-<div class="section" id="pair-style-line-lj-omp-command">
-<h1>pair_style line/lj/omp command<a class="headerlink" href="#pair-style-line-lj-omp-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>pair_style line/lj cutoff
</pre></div>
</div>
<p>cutoff = global cutoff for interactions (distance units)</p>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>pair_style line/lj 3.0
-pair_coeff * * 1.0 1.0
-pair_coeff 1 1 1.0 1.5 2.5
+pair_coeff * * 1.0 1.0 1.0 0.8 1.12
+pair_coeff 1 2 1.0 2.0 1.0 1.5 1.12 5.0
+pair_coeff 1 2 1.0 0.0 1.0 1.0 2.5
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Style <em>line/lj</em> treats particles which are line segments as a set of
small spherical particles that tile the line segment length as
explained below. Interactions between two line segments, each with N1
and N2 spherical particles, are calculated as the pairwise sum of
N1*N2 Lennard-Jones interactions. Interactions between a line segment
with N spherical particles and a point particle are treated as the
pairwise sum of N Lennard-Jones interactions. See the <a class="reference internal" href="pair_lj.html"><em>pair_style lj/cut</em></a> doc page for the definition of Lennard-Jones
interactions.</p>
-<p>The cutoff distance for an interaction between 2 line segments, or
-between a line segment and a point particle, is calculated from the
-position of the line segment (its center), not between pairs of
-individual spheres comprising the line segment. Thus an interaction
-is either calculated in its entirety or not at all.</p>
-<p>The set of non-overlapping spherical particles that represent a line
-segment, for purposes of this pair style, are generated in the
-following manner. Their size is a function of the line segment length
-and the specified sigma for that particle type. If a line segment has
-a length L and is of type I, then the number of spheres N that
-represent the segment is calculated as N = L/sigma_II, rounded up to
-an integer value. Thus if L is not evenly divisibly by sigam_II, N is
-incremented to include one extra sphere. In this case, the spheres
-must be slightly smaller than sigma_II so as not to overlap, so a new
-sigma-prime is chosen as the sphere diameter, such that L/N =
-sigma-prime. Thus the line segment interacts with other segments or
-point particles as a collection of N spheres of diameter sigma-prime,
-evenly spaced along the line segment, so as to exactly cover its
-length.</p>
-<p>The LJ interaction between 2 spheres on different line segments of
-types I,J is computed with an arithmetic mixing of the sigma values of
-the 2 spheres and using the specified epsilon value for I,J atom
-types. Note that because the sigma values for line segment spheres is
-computed using only sigma_II values, specific to the line segment&#8217;s
-type, this means that any specified sigma_IJ values (for I != J) are
-effectively ignored.</p>
+<p>The set of non-overlapping spherical sub-particles that represent a
+line segment are generated in the following manner. Their size is a
+function of the line segment length and the specified sub-particle
+size for that particle type. If a line segment has a length L and is
+of type I, then the number of spheres N that represent the segment is
+calculated as N = L/sizeI, rounded up to an integer value. Thus if L
+is not evenly divisibly by sizeI, N is incremented to include one
+extra sphere. The centers of the spheres are spaced equally along the
+line segment. Imagine N+1 equally-space points, which include the 2
+end points of the segment. The sphere centers are halfway between
+each pair of points.</p>
+<p>The LJ interaction between 2 spheres on different line segments (or a
+sphere on a line segment and a point particles) is computed with
+sub-particle epsilon, sigma, and cutoff values that are set by the
+pair_coeff command, as described below. If the distance bewteen the 2
+spheres is greater than the sub-particle cutoff, there is no
+interaction. This means that some pairs of sub-particles on 2 line
+segments may interact, but others may not.</p>
+<p>For purposes of creating the neighbor list for pairs of interacting
+line segments or lines/point particles, a regular particle-particle
+cutoff is used, as defined by the <em>cutoff</em> setting above in the
+pair_style command or overridden with an optional argument in the
+pair_coeff command for a type pair as discussed below. The distance
+between the centers of 2 line segments, or the center of a line
+segment and a point particle, must be less than this distance (plus
+the neighbor skin; see the <a class="reference external" href="neighbor">neighbor</a> command), for the pair
+of particles to be included in the neighbor list.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">This means that a too-short value for the <em>cutoff</em> setting can
+exclude a pair of particles from the neighbor list even if pairs of
+their sub-particle spheres would interact, based on the sub-particle
+cutoff specified in the pair_coeff command. E.g. sub-particles at the
+ends of the line segments that are close to each other. Which may not
+be what you want, since it means the ends of 2 line segments could
+pass through each other. It is up to you to specify a <em>cutoff</em>
+setting that is consistent with the length of the line segments you
+are using and the sub-particle cutoff settings.</p>
+</div>
<p>For style <em>line/lj</em>, the following coefficients must be defined for
-each pair of atoms types via the <a class="reference internal" href="pair_coeff.html"><em>pair_coeff</em></a> command
+each pair of atom types via the <a class="reference internal" href="pair_coeff.html"><em>pair_coeff</em></a> command
as in the examples above, or in the data file or restart files read by
the <a class="reference internal" href="read_data.html"><em>read_data</em></a> or <a class="reference internal" href="read_restart.html"><em>read_restart</em></a>
commands:</p>
<ul class="simple">
+<li>sizeI (distance units)</li>
+<li>sizeJ (distance units)</li>
<li>epsilon (energy units)</li>
<li>sigma (distance units)</li>
+<li>subcutoff (distance units)</li>
<li>cutoff (distance units)</li>
</ul>
-<p>The last coefficient is optional. If not specified, the global cutoff
-is used.</p>
-<hr class="docutils" />
-<p>Styles with a <em>cuda</em>, <em>gpu</em>, <em>intel</em>, <em>kk</em>, <em>omp</em>, or <em>opt</em> suffix are
-functionally the same as the corresponding style without the suffix.
-They have been optimized to run faster, depending on your available
-hardware, as discussed in <a class="reference internal" href="Section_accelerate.html"><em>Section_accelerate</em></a>
-of the manual. The accelerated styles take the same arguments and
-should produce the same results, except for round-off and precision
-issues.</p>
-<p>These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL,
-KOKKOS, USER-OMP and OPT packages, respectively. They are only
-enabled if LAMMPS was built with those packages. See the <a class="reference internal" href="Section_start.html#start-3"><span>Making LAMMPS</span></a> section for more info.</p>
-<p>You can specify the accelerated styles explicitly in your input script
-by including their suffix, or you can use the <a class="reference internal" href="Section_start.html#start-7"><span>-suffix command-line switch</span></a> when you invoke LAMMPS, or you can
-use the <a class="reference internal" href="suffix.html"><em>suffix</em></a> command in your input script.</p>
-<p>See <a class="reference internal" href="Section_accelerate.html"><em>Section_accelerate</em></a> of the manual for
-more instructions on how to use the accelerated styles effectively.</p>
+<p>The <em>sizeI</em> and <em>sizeJ</em> coefficients are the sub-particle sizes for
+line particles of type I and type J. They are used to define the N
+sub-particles per segment as described above. These coefficients are
+actually stored on a per-type basis. Thus if there are multiple
+pair_coeff commmands that involve type I, as either the first or
+second atom type, you should use consistent values for sizeI or sizeJ
+in all of them. If you do not do this, the last value specified for
+sizeI will apply to all segments of type I. If typeI or typeJ refers
+to point particles, the corresponding sizeI or sizeJ is ignored; it
+can be set to 0.0.</p>
+<p>The <em>epsilon</em>, <em>sigma</em>, and <em>subcutoff</em> coefficients are used to
+compute an LJ interactions between a pair of sub-particles on 2 line
+segments (of type I and J), or between a sub particle/point particle
+pair. As discussed above, the <em>subcutoff</em> and <em>cutoff</em> params are
+different. The latter is only used for building the neighbor list
+when the distance between centers of two line segments or one segment
+and a point particle is calculated.</p>
+<p>The <em>cutoff</em> coefficient is optional. If not specified, the global
+cutoff is used.</p>
<hr class="docutils" />
<p><strong>Mixing, shift, table, tail correction, restart, rRESPA info</strong>:</p>
-<p>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
-and cutoff distance for all of this pair style can be mixed. The
-default mix value is <em>geometric</em>. See the &#8220;pair_modify&#8221; command for
-details.</p>
+<p>For atom type pairs I,J and I != J, coeffiecients must be specified.
+No default mixing rules are used.</p>
<p>This pair style does not support the <a class="reference internal" href="pair_modify.html"><em>pair_modify</em></a>
shift, table, and tail options.</p>
<p>This pair style does not write its information to <a class="reference internal" href="restart.html"><em>binary restart files</em></a>.</p>
<p>This pair style can only be used via the <em>pair</em> keyword of the
<a class="reference internal" href="run_style.html"><em>run_style respa</em></a> command. It does not support the
<em>inner</em>, <em>middle</em>, <em>outer</em> keywords.</p>
</div>
<hr class="docutils" />
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>This style is part of the ASPHERE package. It is only enabled if
LAMMPS was built with that package. See the <span class="xref std std-ref">Making LAMMPS</span> section for more info.</p>
<p>Defining particles to be line segments so they participate in
line/line or line/particle interactions requires the use the
<a class="reference internal" href="atom_style.html"><em>atom_style line</em></a> command.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="pair_coeff.html"><em>pair_coeff</em></a>, <a class="reference internal" href="pair_tri_lj.html"><em>pair_style tri/lj</em></a></p>
<p><strong>Default:</strong> none</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/pair_line_lj.txt b/doc/pair_line_lj.txt
index c467a9876..3e91e97c2 100644
--- a/doc/pair_line_lj.txt
+++ b/doc/pair_line_lj.txt
@@ -1,136 +1,144 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
pair_style line/lj command :h3
-pair_style line/lj/omp command :h3
[Syntax:]
pair_style line/lj cutoff :pre
cutoff = global cutoff for interactions (distance units)
[Examples:]
pair_style line/lj 3.0
-pair_coeff * * 1.0 1.0
-pair_coeff 1 1 1.0 1.5 2.5 :pre
+pair_coeff * * 1.0 1.0 1.0 0.8 1.12
+pair_coeff 1 2 1.0 2.0 1.0 1.5 1.12 5.0
+pair_coeff 1 2 1.0 0.0 1.0 1.0 2.5 :pre
[Description:]
Style {line/lj} treats particles which are line segments as a set of
small spherical particles that tile the line segment length as
explained below. Interactions between two line segments, each with N1
and N2 spherical particles, are calculated as the pairwise sum of
N1*N2 Lennard-Jones interactions. Interactions between a line segment
with N spherical particles and a point particle are treated as the
pairwise sum of N Lennard-Jones interactions. See the "pair_style
lj/cut"_pair_lj.html doc page for the definition of Lennard-Jones
interactions.
-The cutoff distance for an interaction between 2 line segments, or
-between a line segment and a point particle, is calculated from the
-position of the line segment (its center), not between pairs of
-individual spheres comprising the line segment. Thus an interaction
-is either calculated in its entirety or not at all.
-
-The set of non-overlapping spherical particles that represent a line
-segment, for purposes of this pair style, are generated in the
-following manner. Their size is a function of the line segment length
-and the specified sigma for that particle type. If a line segment has
-a length L and is of type I, then the number of spheres N that
-represent the segment is calculated as N = L/sigma_II, rounded up to
-an integer value. Thus if L is not evenly divisibly by sigam_II, N is
-incremented to include one extra sphere. In this case, the spheres
-must be slightly smaller than sigma_II so as not to overlap, so a new
-sigma-prime is chosen as the sphere diameter, such that L/N =
-sigma-prime. Thus the line segment interacts with other segments or
-point particles as a collection of N spheres of diameter sigma-prime,
-evenly spaced along the line segment, so as to exactly cover its
-length.
-
-The LJ interaction between 2 spheres on different line segments of
-types I,J is computed with an arithmetic mixing of the sigma values of
-the 2 spheres and using the specified epsilon value for I,J atom
-types. Note that because the sigma values for line segment spheres is
-computed using only sigma_II values, specific to the line segment's
-type, this means that any specified sigma_IJ values (for I != J) are
-effectively ignored.
+The set of non-overlapping spherical sub-particles that represent a
+line segment are generated in the following manner. Their size is a
+function of the line segment length and the specified sub-particle
+size for that particle type. If a line segment has a length L and is
+of type I, then the number of spheres N that represent the segment is
+calculated as N = L/sizeI, rounded up to an integer value. Thus if L
+is not evenly divisibly by sizeI, N is incremented to include one
+extra sphere. The centers of the spheres are spaced equally along the
+line segment. Imagine N+1 equally-space points, which include the 2
+end points of the segment. The sphere centers are halfway between
+each pair of points.
+
+The LJ interaction between 2 spheres on different line segments (or a
+sphere on a line segment and a point particles) is computed with
+sub-particle epsilon, sigma, and cutoff values that are set by the
+pair_coeff command, as described below. If the distance bewteen the 2
+spheres is greater than the sub-particle cutoff, there is no
+interaction. This means that some pairs of sub-particles on 2 line
+segments may interact, but others may not.
+
+For purposes of creating the neighbor list for pairs of interacting
+line segments or lines/point particles, a regular particle-particle
+cutoff is used, as defined by the {cutoff} setting above in the
+pair_style command or overridden with an optional argument in the
+pair_coeff command for a type pair as discussed below. The distance
+between the centers of 2 line segments, or the center of a line
+segment and a point particle, must be less than this distance (plus
+the neighbor skin; see the "neighbor"_neighbor command), for the pair
+of particles to be included in the neighbor list.
+
+NOTE: This means that a too-short value for the {cutoff} setting can
+exclude a pair of particles from the neighbor list even if pairs of
+their sub-particle spheres would interact, based on the sub-particle
+cutoff specified in the pair_coeff command. E.g. sub-particles at the
+ends of the line segments that are close to each other. Which may not
+be what you want, since it means the ends of 2 line segments could
+pass through each other. It is up to you to specify a {cutoff}
+setting that is consistent with the length of the line segments you
+are using and the sub-particle cutoff settings.
For style {line/lj}, the following coefficients must be defined for
-each pair of atoms types via the "pair_coeff"_pair_coeff.html command
+each pair of atom types via the "pair_coeff"_pair_coeff.html command
as in the examples above, or in the data file or restart files read by
the "read_data"_read_data.html or "read_restart"_read_restart.html
commands:
+sizeI (distance units)
+sizeJ (distance units)
epsilon (energy units)
sigma (distance units)
+subcutoff (distance units)
cutoff (distance units) :ul
-The last coefficient is optional. If not specified, the global cutoff
-is used.
-
-:line
-
-Styles with a {cuda}, {gpu}, {intel}, {kk}, {omp}, or {opt} suffix are
-functionally the same as the corresponding style without the suffix.
-They have been optimized to run faster, depending on your available
-hardware, as discussed in "Section_accelerate"_Section_accelerate.html
-of the manual. The accelerated styles take the same arguments and
-should produce the same results, except for round-off and precision
-issues.
-
-These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL,
-KOKKOS, USER-OMP and OPT packages, respectively. They are only
-enabled if LAMMPS was built with those packages. See the "Making
-LAMMPS"_Section_start.html#start_3 section for more info.
-
-You can specify the accelerated styles explicitly in your input script
-by including their suffix, or you can use the "-suffix command-line
-switch"_Section_start.html#start_7 when you invoke LAMMPS, or you can
-use the "suffix"_suffix.html command in your input script.
-
-See "Section_accelerate"_Section_accelerate.html of the manual for
-more instructions on how to use the accelerated styles effectively.
+The {sizeI} and {sizeJ} coefficients are the sub-particle sizes for
+line particles of type I and type J. They are used to define the N
+sub-particles per segment as described above. These coefficients are
+actually stored on a per-type basis. Thus if there are multiple
+pair_coeff commmands that involve type I, as either the first or
+second atom type, you should use consistent values for sizeI or sizeJ
+in all of them. If you do not do this, the last value specified for
+sizeI will apply to all segments of type I. If typeI or typeJ refers
+to point particles, the corresponding sizeI or sizeJ is ignored; it
+can be set to 0.0.
+
+The {epsilon}, {sigma}, and {subcutoff} coefficients are used to
+compute an LJ interactions between a pair of sub-particles on 2 line
+segments (of type I and J), or between a sub particle/point particle
+pair. As discussed above, the {subcutoff} and {cutoff} params are
+different. The latter is only used for building the neighbor list
+when the distance between centers of two line segments or one segment
+and a point particle is calculated.
+
+The {cutoff} coefficient is optional. If not specified, the global
+cutoff is used.
:line
[Mixing, shift, table, tail correction, restart, rRESPA info]:
-For atom type pairs I,J and I != J, the epsilon and sigma coefficients
-and cutoff distance for all of this pair style can be mixed. The
-default mix value is {geometric}. See the "pair_modify" command for
-details.
+For atom type pairs I,J and I != J, coeffiecients must be specified.
+No default mixing rules are used.
This pair style does not support the "pair_modify"_pair_modify.html
shift, table, and tail options.
This pair style does not write its information to "binary restart
files"_restart.html.
This pair style can only be used via the {pair} keyword of the
"run_style respa"_run_style.html command. It does not support the
{inner}, {middle}, {outer} keywords.
:line
[Restrictions:]
This style is part of the ASPHERE package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#2_3 section for more info.
Defining particles to be line segments so they participate in
line/line or line/particle interactions requires the use the
"atom_style line"_atom_style.html command.
[Related commands:]
"pair_coeff"_pair_coeff.html, "pair_style tri/lj"_pair_tri_lj.html
[Default:] none
diff --git a/doc/pair_tri_lj.html b/doc/pair_tri_lj.html
index eca9db8de..819622a37 100644
--- a/doc/pair_tri_lj.html
+++ b/doc/pair_tri_lj.html
@@ -1,305 +1,286 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pair_style tri/lj command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>pair_style tri/lj command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="pair-style-tri-lj-command">
<span id="index-0"></span><h1>pair_style tri/lj command<a class="headerlink" href="#pair-style-tri-lj-command" title="Permalink to this headline">¶</a></h1>
-</div>
-<div class="section" id="pair-style-tri-lj-omp-command">
-<h1>pair_style tri/lj/omp command<a class="headerlink" href="#pair-style-tri-lj-omp-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>pair_style tri/lj cutoff
</pre></div>
</div>
<p>cutoff = global cutoff for interactions (distance units)</p>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>pair_style tri/lj 3.0
pair_coeff * * 1.0 1.0
pair_coeff 1 1 1.0 1.5 2.5
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Style <em>tri/lj</em> treats particles which are triangles as a set of small
spherical particles that tile the triangle surface as explained below.
Interactions between two triangles, each with N1 and N2 spherical
particles, are calculated as the pairwise sum of N1*N2 Lennard-Jones
interactions. Interactions between a triangle with N spherical
particles and a point particle are treated as the pairwise sum of N
Lennard-Jones interactions. See the <a class="reference internal" href="pair_lj.html"><em>pair_style lj/cut</em></a>
doc page for the definition of Lennard-Jones interactions.</p>
<p>The cutoff distance for an interaction between 2 triangles, or between
a triangle and a point particle, is calculated from the position of
the triangle (its centroid), not between pairs of individual spheres
comprising the triangle. Thus an interaction is either calculated in
its entirety or not at all.</p>
<p>The set of non-overlapping spherical particles that represent a
triangle, for purposes of this pair style, are generated in the
following manner. Assume the triangle is of type I, and sigma_II has
been specified. We want a set of spheres with centers in the plane of
the triangle, none of them larger in diameter than sigma_II, which
completely cover the triangle&#8217;s area, but with minimial overlap and a
minimal total number of spheres. This is done in a recursive manner.
Place a sphere at the centroid of the original triangle. Calculate
what diameter it must have to just cover all 3 corner points of the
triangle. If that diameter is equal to or smaller than sigma_II, then
include a sphere of the calculated diameter in the set of covering
spheres. It the diameter is larger than sigma_II, then split the
triangle into 2 triangles by bisecting its longest side. Repeat the
process on each sub-triangle, recursing as far as needed to generate a
set of covering spheres. When finished, the original criteria are
met, and the set of covering spheres shoule be near minimal in number
and overlap, at least for input triangles with a reasonable
aspect-ratio.</p>
<p>The LJ interaction between 2 spheres on different triangles of types
I,J is computed with an arithmetic mixing of the sigma values of the 2
spheres and using the specified epsilon value for I,J atom types.
Note that because the sigma values for triangles spheres is computed
using only sigma_II values, specific to the triangles&#8217;s type, this
means that any specified sigma_IJ values (for I != J) are effectively
ignored.</p>
<p>For style <em>tri/lj</em>, the following coefficients must be defined for
each pair of atoms types via the <a class="reference internal" href="pair_coeff.html"><em>pair_coeff</em></a> command
as in the examples above, or in the data file or restart files read by
the <a class="reference internal" href="read_data.html"><em>read_data</em></a> or <a class="reference internal" href="read_restart.html"><em>read_restart</em></a>
commands:</p>
<ul class="simple">
<li>epsilon (energy units)</li>
<li>sigma (distance units)</li>
<li>cutoff (distance units)</li>
</ul>
<p>The last coefficient is optional. If not specified, the global cutoff
is used.</p>
<hr class="docutils" />
-<p>Styles with a <em>cuda</em>, <em>gpu</em>, <em>intel</em>, <em>kk</em>, <em>omp</em>, or <em>opt</em> suffix are
-functionally the same as the corresponding style without the suffix.
-They have been optimized to run faster, depending on your available
-hardware, as discussed in <a class="reference internal" href="Section_accelerate.html"><em>Section_accelerate</em></a>
-of the manual. The accelerated styles take the same arguments and
-should produce the same results, except for round-off and precision
-issues.</p>
-<p>These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL,
-KOKKOS, USER-OMP and OPT packages, respectively. They are only
-enabled if LAMMPS was built with those packages. See the <a class="reference internal" href="Section_start.html#start-3"><span>Making LAMMPS</span></a> section for more info.</p>
-<p>You can specify the accelerated styles explicitly in your input script
-by including their suffix, or you can use the <a class="reference internal" href="Section_start.html#start-7"><span>-suffix command-line switch</span></a> when you invoke LAMMPS, or you can
-use the <a class="reference internal" href="suffix.html"><em>suffix</em></a> command in your input script.</p>
-<p>See <a class="reference internal" href="Section_accelerate.html"><em>Section_accelerate</em></a> of the manual for
-more instructions on how to use the accelerated styles effectively.</p>
-<hr class="docutils" />
<p><strong>Mixing, shift, table, tail correction, restart, rRESPA info</strong>:</p>
<p>For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of this pair style can be mixed. The
default mix value is <em>geometric</em>. See the &#8220;pair_modify&#8221; command for
details.</p>
<p>This pair style does not support the <a class="reference internal" href="pair_modify.html"><em>pair_modify</em></a>
shift, table, and tail options.</p>
<p>This pair style does not write its information to <a class="reference internal" href="restart.html"><em>binary restart files</em></a>.</p>
<p>This pair style can only be used via the <em>pair</em> keyword of the
<a class="reference internal" href="run_style.html"><em>run_style respa</em></a> command. It does not support the
<em>inner</em>, <em>middle</em>, <em>outer</em> keywords.</p>
</div>
<hr class="docutils" />
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>This style is part of the ASPHERE package. It is only enabled if
LAMMPS was built with that package. See the <span class="xref std std-ref">Making LAMMPS</span> section for more info.</p>
<p>Defining particles to be triangles so they participate in tri/tri or
tri/particle interactions requires the use the <a class="reference internal" href="atom_style.html"><em>atom_style tri</em></a> command.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="pair_coeff.html"><em>pair_coeff</em></a>, <a class="reference internal" href="pair_line_lj.html"><em>pair_style line/lj</em></a></p>
<p><strong>Default:</strong> none</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/pair_tri_lj.txt b/doc/pair_tri_lj.txt
index 19106a604..cfc64c52f 100644
--- a/doc/pair_tri_lj.txt
+++ b/doc/pair_tri_lj.txt
@@ -1,139 +1,115 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
pair_style tri/lj command :h3
-pair_style tri/lj/omp command :h3
[Syntax:]
pair_style tri/lj cutoff :pre
cutoff = global cutoff for interactions (distance units)
[Examples:]
pair_style tri/lj 3.0
pair_coeff * * 1.0 1.0
pair_coeff 1 1 1.0 1.5 2.5 :pre
[Description:]
Style {tri/lj} treats particles which are triangles as a set of small
spherical particles that tile the triangle surface as explained below.
Interactions between two triangles, each with N1 and N2 spherical
particles, are calculated as the pairwise sum of N1*N2 Lennard-Jones
interactions. Interactions between a triangle with N spherical
particles and a point particle are treated as the pairwise sum of N
Lennard-Jones interactions. See the "pair_style lj/cut"_pair_lj.html
doc page for the definition of Lennard-Jones interactions.
The cutoff distance for an interaction between 2 triangles, or between
a triangle and a point particle, is calculated from the position of
the triangle (its centroid), not between pairs of individual spheres
comprising the triangle. Thus an interaction is either calculated in
its entirety or not at all.
The set of non-overlapping spherical particles that represent a
triangle, for purposes of this pair style, are generated in the
following manner. Assume the triangle is of type I, and sigma_II has
been specified. We want a set of spheres with centers in the plane of
the triangle, none of them larger in diameter than sigma_II, which
completely cover the triangle's area, but with minimial overlap and a
minimal total number of spheres. This is done in a recursive manner.
Place a sphere at the centroid of the original triangle. Calculate
what diameter it must have to just cover all 3 corner points of the
triangle. If that diameter is equal to or smaller than sigma_II, then
include a sphere of the calculated diameter in the set of covering
spheres. It the diameter is larger than sigma_II, then split the
triangle into 2 triangles by bisecting its longest side. Repeat the
process on each sub-triangle, recursing as far as needed to generate a
set of covering spheres. When finished, the original criteria are
met, and the set of covering spheres shoule be near minimal in number
and overlap, at least for input triangles with a reasonable
aspect-ratio.
The LJ interaction between 2 spheres on different triangles of types
I,J is computed with an arithmetic mixing of the sigma values of the 2
spheres and using the specified epsilon value for I,J atom types.
Note that because the sigma values for triangles spheres is computed
using only sigma_II values, specific to the triangles's type, this
means that any specified sigma_IJ values (for I != J) are effectively
ignored.
For style {tri/lj}, the following coefficients must be defined for
each pair of atoms types via the "pair_coeff"_pair_coeff.html command
as in the examples above, or in the data file or restart files read by
the "read_data"_read_data.html or "read_restart"_read_restart.html
commands:
epsilon (energy units)
sigma (distance units)
cutoff (distance units) :ul
The last coefficient is optional. If not specified, the global cutoff
is used.
:line
-Styles with a {cuda}, {gpu}, {intel}, {kk}, {omp}, or {opt} suffix are
-functionally the same as the corresponding style without the suffix.
-They have been optimized to run faster, depending on your available
-hardware, as discussed in "Section_accelerate"_Section_accelerate.html
-of the manual. The accelerated styles take the same arguments and
-should produce the same results, except for round-off and precision
-issues.
-
-These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL,
-KOKKOS, USER-OMP and OPT packages, respectively. They are only
-enabled if LAMMPS was built with those packages. See the "Making
-LAMMPS"_Section_start.html#start_3 section for more info.
-
-You can specify the accelerated styles explicitly in your input script
-by including their suffix, or you can use the "-suffix command-line
-switch"_Section_start.html#start_7 when you invoke LAMMPS, or you can
-use the "suffix"_suffix.html command in your input script.
-
-See "Section_accelerate"_Section_accelerate.html of the manual for
-more instructions on how to use the accelerated styles effectively.
-
-:line
-
[Mixing, shift, table, tail correction, restart, rRESPA info]:
For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distance for all of this pair style can be mixed. The
default mix value is {geometric}. See the "pair_modify" command for
details.
This pair style does not support the "pair_modify"_pair_modify.html
shift, table, and tail options.
This pair style does not write its information to "binary restart
files"_restart.html.
This pair style can only be used via the {pair} keyword of the
"run_style respa"_run_style.html command. It does not support the
{inner}, {middle}, {outer} keywords.
:line
[Restrictions:]
This style is part of the ASPHERE package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#2_3 section for more info.
Defining particles to be triangles so they participate in tri/tri or
tri/particle interactions requires the use the "atom_style
tri"_atom_style.html command.
[Related commands:]
"pair_coeff"_pair_coeff.html, "pair_style line/lj"_pair_line_lj.html
[Default:] none
diff --git a/doc/searchindex.js b/doc/searchindex.js
index 17d1faefd..d098c6fe7 100644
--- a/doc/searchindex.js
+++ b/doc/searchindex.js
@@ -1 +1 @@
-Search.setIndex({envversion:47,filenames:["Manual","Section_accelerate","Section_commands","Section_errors","Section_example","Section_history","Section_howto","Section_intro","Section_modify","Section_packages","Section_perf","Section_python","Section_start","Section_tools","accelerate_cuda","accelerate_gpu","accelerate_intel","accelerate_kokkos","accelerate_omp","accelerate_opt","angle_charmm","angle_class2","angle_coeff","angle_cosine","angle_cosine_delta","angle_cosine_periodic","angle_cosine_shift","angle_cosine_shift_exp","angle_cosine_squared","angle_dipole","angle_fourier","angle_fourier_simple","angle_harmonic","angle_hybrid","angle_none","angle_quartic","angle_sdk","angle_style","angle_table","atom_modify","atom_style","balance","body","bond_class2","bond_coeff","bond_fene","bond_fene_expand","bond_harmonic","bond_harmonic_shift","bond_harmonic_shift_cut","bond_hybrid","bond_morse","bond_none","bond_nonlinear","bond_quartic","bond_style","bond_table","boundary","box","change_box","clear","comm_modify","comm_style","compute","compute_ackland_atom","compute_angle_local","compute_angmom_chunk","compute_basal_atom","compute_body_local","compute_bond_local","compute_centro_atom","compute_chunk_atom","compute_cluster_atom","compute_cna_atom","compute_com","compute_com_chunk","compute_contact_atom","compute_coord_atom","compute_damage_atom","compute_dihedral_local","compute_dilatation_atom","compute_displace_atom","compute_erotate_asphere","compute_erotate_rigid","compute_erotate_sphere","compute_erotate_sphere_atom","compute_event_displace","compute_fep","compute_group_group","compute_gyration","compute_gyration_chunk","compute_heat_flux","compute_hexorder_atom","compute_improper_local","compute_inertia_chunk","compute_ke","compute_ke_atom","compute_ke_atom_eff","compute_ke_eff","compute_ke_rigid","compute_meso_e_atom","compute_meso_rho_atom","compute_meso_t_atom","compute_modify","compute_msd","compute_msd_chunk","compute_msd_nongauss","compute_omega_chunk","compute_orientorder_atom","compute_pair","compute_pair_local","compute_pe","compute_pe_atom","compute_plasticity_atom","compute_pressure","compute_property_atom","compute_property_chunk","compute_property_local","compute_rdf","compute_reduce","compute_saed","compute_slice","compute_smd_contact_radius","compute_smd_damage","compute_smd_hourglass_error","compute_smd_internal_energy","compute_smd_plastic_strain","compute_smd_plastic_strain_rate","compute_smd_rho","compute_smd_tlsph_defgrad","compute_smd_tlsph_dt","compute_smd_tlsph_num_neighs","compute_smd_tlsph_shape","compute_smd_tlsph_strain","compute_smd_tlsph_strain_rate","compute_smd_tlsph_stress","compute_smd_triangle_mesh_vertices","compute_smd_ulsph_num_neighs","compute_smd_ulsph_strain","compute_smd_ulsph_strain_rate","compute_smd_ulsph_stress","compute_smd_vol","compute_sna_atom","compute_stress_atom","compute_tally","compute_temp","compute_temp_asphere","compute_temp_body","compute_temp_chunk","compute_temp_com","compute_temp_cs","compute_temp_deform","compute_temp_deform_eff","compute_temp_drude","compute_temp_eff","compute_temp_partial","compute_temp_profile","compute_temp_ramp","compute_temp_region","compute_temp_region_eff","compute_temp_rotate","compute_temp_sphere","compute_ti","compute_torque_chunk","compute_vacf","compute_vcm_chunk","compute_voronoi_atom","compute_xrd","create_atoms","create_bonds","create_box","delete_atoms","delete_bonds","dielectric","dihedral_charmm","dihedral_class2","dihedral_coeff","dihedral_cosine_shift_exp","dihedral_fourier","dihedral_harmonic","dihedral_helix","dihedral_hybrid","dihedral_multi_harmonic","dihedral_nharmonic","dihedral_none","dihedral_opls","dihedral_quadratic","dihedral_style","dihedral_table","dimension","displace_atoms","dump","dump_h5md","dump_image","dump_modify","dump_molfile","echo","fix","fix_adapt","fix_adapt_fep","fix_addforce","fix_addtorque","fix_append_atoms","fix_atc","fix_atom_swap","fix_ave_atom","fix_ave_chunk","fix_ave_correlate","fix_ave_correlate_long","fix_ave_histo","fix_ave_spatial","fix_ave_spatial_sphere","fix_ave_time","fix_aveforce","fix_balance","fix_bond_break","fix_bond_create","fix_bond_swap","fix_box_relax","fix_colvars","fix_deform","fix_deposit","fix_drag","fix_drude","fix_drude_transform","fix_dt_reset","fix_efield","fix_enforce2d","fix_evaporate","fix_external","fix_freeze","fix_gcmc","fix_gld","fix_gle","fix_gravity","fix_heat","fix_imd","fix_indent","fix_ipi","fix_langevin","fix_langevin_drude","fix_langevin_eff","fix_lb_fluid","fix_lb_momentum","fix_lb_pc","fix_lb_rigid_pc_sphere","fix_lb_viscous","fix_lineforce","fix_meso","fix_meso_stationary","fix_modify","fix_momentum","fix_move","fix_msst","fix_neb","fix_nh","fix_nh_eff","fix_nph_asphere","fix_nph_body","fix_nph_sphere","fix_nphug","fix_npt_asphere","fix_npt_body","fix_npt_sphere","fix_nve","fix_nve_asphere","fix_nve_asphere_noforce","fix_nve_body","fix_nve_eff","fix_nve_limit","fix_nve_line","fix_nve_noforce","fix_nve_sphere","fix_nve_tri","fix_nvt_asphere","fix_nvt_body","fix_nvt_sllod","fix_nvt_sllod_eff","fix_nvt_sphere","fix_oneway","fix_orient_fcc","fix_phonon","fix_pimd","fix_planeforce","fix_poems","fix_pour","fix_press_berendsen","fix_print","fix_property_atom","fix_qbmsst","fix_qeq","fix_qeq_comb","fix_qeq_reax","fix_qmmm","fix_qtb","fix_reax_bonds","fix_reaxc_species","fix_recenter","fix_restrain","fix_rigid","fix_saed_vtk","fix_setforce","fix_shake","fix_smd","fix_smd_adjust_dt","fix_smd_integrate_tlsph","fix_smd_integrate_ulsph","fix_smd_move_triangulated_surface","fix_smd_setvel","fix_smd_tlsph_reference_configuration","fix_smd_wall_surface","fix_spring","fix_spring_rg","fix_spring_self","fix_srd","fix_store_force","fix_store_state","fix_temp_berendsen","fix_temp_csvr","fix_temp_rescale","fix_temp_rescale_eff","fix_tfmc","fix_thermal_conductivity","fix_ti_rs","fix_ti_spring","fix_tmd","fix_ttm","fix_tune_kspace","fix_vector","fix_viscosity","fix_viscous","fix_wall","fix_wall_gran","fix_wall_piston","fix_wall_reflect","fix_wall_region","fix_wall_srd","group","group2ndx","if","improper_class2","improper_coeff","improper_cossq","improper_cvff","improper_distance","improper_fourier","improper_harmonic","improper_hybrid","improper_none","improper_ring","improper_style","improper_umbrella","include","info","jump","kspace_modify","kspace_style","label","lattice","log","mass","min_modify","min_style","minimize","molecule","neb","neigh_modify","neighbor","newton","next","package","pair_adp","pair_airebo","pair_awpmd","pair_beck","pair_body","pair_body_rounded_polygon","pair_bop","pair_born","pair_brownian","pair_buck","pair_buck_long","pair_charmm","pair_class2","pair_coeff","pair_colloid","pair_comb","pair_coul","pair_coul_diel","pair_cs","pair_dipole","pair_dpd","pair_dsmc","pair_eam","pair_edip","pair_eff","pair_eim","pair_gauss","pair_gayberne","pair_gran","pair_gromacs","pair_hbond_dreiding","pair_hybrid","pair_kim","pair_lcbop","pair_line_lj","pair_list","pair_lj","pair_lj96","pair_lj_cubic","pair_lj_expand","pair_lj_long","pair_lj_sf","pair_lj_smooth","pair_lj_smooth_linear","pair_lj_soft","pair_lubricate","pair_lubricateU","pair_mdf","pair_meam","pair_meam_spline","pair_meam_sw_spline","pair_mgpt","pair_mie","pair_modify","pair_morse","pair_nb3b_harmonic","pair_nm","pair_none","pair_peri","pair_polymorphic","pair_quip","pair_reax","pair_reax_c","pair_resquared","pair_sdk","pair_smd_hertz","pair_smd_tlsph","pair_smd_triangulated_surface","pair_smd_ulsph","pair_smtbq","pair_snap","pair_soft","pair_sph_heatconduction","pair_sph_idealgas","pair_sph_lj","pair_sph_rhosum","pair_sph_taitwater","pair_sph_taitwater_morris","pair_srp","pair_style","pair_sw","pair_table","pair_tersoff","pair_tersoff_mod","pair_tersoff_zbl","pair_thole","pair_tri_lj","pair_vashishta","pair_write","pair_yukawa","pair_yukawa_colloid","pair_zbl","partition","prd","print","processors","python","quit","read_data","read_dump","read_restart","region","replicate","rerun","reset_timestep","restart","run","run_style","set","shell","special_bonds","suffix","tad","temper","thermo","thermo_modify","thermo_style","timer","timestep","tutorial_drude","uncompute","undump","unfix","units","variable","velocity","write_data","write_dump","write_restart"],objects:{},objnames:{},objtypes:{},terms:{"00a":323,"00b":323,"02214e23":91,"03275e":494,"0892e":12,"0b1":11,"0e20":[339,472,495],"0e4":[253,332,399],"0e5":253,"0x98b5e0":193,"100k":1,"1024x1024":193,"10e":389,"10f":3,"10g":495,"10th":[464,470,483],"10x":[3,362,363,365,366,377],"10x10x10":156,"10x20x20":358,"11e":10,"15g":[194,495],"16g":[206,212],"16x":1,"18986e":363,"18e":10,"1_12":358,"1_3":358,"1_6":358,"1_prop":6,"1st":[2,6,8,12,20,22,38,44,56,57,58,60,71,87,162,174,176,188,198,199,206,207,208,209,210,211,212,216,220,255,287,297,325,337,341,360,366,371,372,377,384,386,393,395,396,403,404,413,414,419,420,421,426,430,441,451,452,453,454,455,458,463,469,477,478,481,495],"1x2x2":466,"2000k":193,"20x":377,"23899e":363,"2400k":193,"256k":10,"25x":10,"298k":388,"2_3":358,"2k_ss":395,"2nd":[2,3,6,11,12,15,17,38,45,46,56,57,60,71,77,88,150,157,188,194,206,207,208,209,210,211,212,216,218,220,255,299,303,311,337,340,347,354,363,364,365,366,370,372,386,395,401,402,419,441,450,451,452,453,454,455,458,469,476,478,481,495],"2pi":188,"2theta":167,"2x1x2":466,"2x2x1":466,"2x2x2":466,"2x4x10":466,"2x5":395,"300k":[233,299,496],"32k":10,"3419e":253,"3806504e":[6,91],"38e":10,"3n_k":232,"3nk":289,"3nkb":294,"3rd":[15,17,20,38,56,71,106,116,188,206,207,209,210,211,212,216,299,300,337,364,368,370,386,395,401,402,441,451,452,453,454,455,458,469,476,481,495],"3x3":[91,358],"4857990943e":395,"4_94":11,"4th":[6,38,56,81,104,105,118,164,174,188,194,311,337,356,369,371,372,377,393,396,403,419,426,430,441,451,452,453,455,458,469,476,481,484,499],"4x10":354,"4x2x10":466,"4x6x10":466,"50k":1,"53xx":18,"54xx":18,"55e":10,"5_1":377,"5_12":358,"5_6":358,"5kx":[200,226],"5nlog_2":12,"5th":[118,363,486],"6021765e":494,"6863e22":429,"6x6":6,"72360e":253,"7797e":253,"7842e":12,"8032044e":494,"8706e":440,"8706q":440,"8730m":440,"8730n":440,"8e12":208,"8x1":6,"8x2":[6,12],"948q":440,"9e18":[12,39],"9e9":429,"9jan09":[332,399],"9th":365,"__main__":467,"__pthread_key_cr":12,"_compute_group_group":144,"_compute_heat_flux":144,"_compute_t":8,"_j1m1m1":142,"_j2m2m2":142,"_serial":12,"abstract":17,"boolean":[3,337,339],"break":[],"byte":[3,12,208,486],"case":[1,2,3,6,8,9,11,12,13,15,16,17,18,39,40,41,45,46,59,61,63,71,73,104,105,110,116,118,119,145,146,147,148,149,151,154,155,156,157,158,160,161,162,166,168,170,171,172,174,190,191,192,193,194,200,201,205,206,207,209,210,211,212,213,214,216,218,220,224,226,228,231,234,235,237,238,239,240,242,253,255,256,257,258,259,260,261,262,263,274,275,276,278,280,281,286,288,289,290,291,298,299,301,303,305,306,308,311,314,317,318,319,321,322,326,328,329,331,332,334,335,336,337,339,354,355,356,358,360,362,363,364,365,367,369,370,372,382,385,387,389,393,395,398,399,401,402,403,405,415,416,417,419,422,424,426,430,433,436,438,442,449,452,453,455,462,464,467,469,471,472,476,477,479,481,483,485,486,487,488,490,494,495,496,498,499],"catch":[1,3,467],"char":[6,8,440],"class":[1,3,5,6,7,8,9,11,12,13,22,37,44,55,176,187,229,288,341,350,383,402,432,433,450,458,467,469],"default":[],"export":[193,384],"final":[3,5,6,7,8,11,12,17,41,59,87,143,194,205,206,207,209,210,211,212,214,218,220,231,254,255,260,289,293,299,300,303,323,325,326,333,339,363,365,371,372,377,393,396,403,415,419,426,430,431,451,452,453,455,458,464,477,483,490,495,497],"float":[3,6,8,12,40,42,71,115,191,194,206,212,236,288,300,316,395,437,439,467,469,479,486,495],"function":[],"import":[1,2,3,6,11,17,71,106,168,179,197,218,231,234,239,240,255,294,317,318,319,321,326,336,338,415,422,467,469,478,486,490],"int":[3,6,8,11,102,229,231,239,241,294,326,486],"long":[],"new":[],"null":[3,6,91,92,108,114,143,168,197,213,219,222,225,252,288,297,301,303,307,308,311,312,332,371,372,386,393,396,399,402,403,404,419,420,421,426,430,432,433,441,451,453,454,455,458,469,472,477,479,496],"public":[0,7,8,12,229,238,396,431,440],"return":[2,3,6,8,11,14,15,16,17,18,19,41,71,110,119,136,137,141,166,168,194,206,210,211,220,229,339,352,354,399,466,467,468,476,479,485,495],"short":[1,3,6,7,13,16,166,255,299,314,327,356,366,367,370,372,377,378,380,381,382,386,387,389,395,402,407,411,415,418,419,424,427,435,440,452,456,464,467,477,479,483,490],"static":[],"switch":[1,3,6,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,43,45,46,47,48,49,51,53,54,56,91,111,114,142,145,155,167,174,175,177,178,179,180,182,183,185,186,188,193,196,200,204,213,220,227,230,234,238,239,242,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,291,299,301,302,317,319,323,324,330,334,340,342,343,345,346,349,351,352,354,356,359,365,369,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,396,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,420,422,425,426,427,429,432,434,435,442,451,452,453,454,455,457,458,460,461,462,463,464,466,469,471,472,476,478,482,484,495,497,499],"throw":486,"true":[6,12,13,17,110,117,191,206,214,216,220,255,256,280,281,282,286,299,321,325,337,339,370,395,399,440,451,467,471,479,495],"try":[1,3,8,12,17,19,206,236,242,322,323,324,329,467,495],"var":[3,11,12,168,337,354,480,495],"void":[4,6,7,8,41,171,214,229,472],"while":[1,3,9,10,11,12,13,14,18,71,106,142,151,166,179,191,195,204,211,218,220,224,232,233,238,239,240,242,255,276,289,294,296,327,356,363,370,377,388,393,433,453,455,458,464,467,478,483,490],a10:339,a123:339,a12:434,a2m:[6,91],a_0:[242,326,377],a_0_real:242,a_1:326,a_2:326,a_3:326,a_4:326,a_c:385,a_cc:385,a_f:455,a_i:[],a_ij:377,a_j:[],a_pi:377,a_sigma:377,a_ss:385,aacut:281,aat:175,aatom1:117,aatom2:117,aatom3:117,ab_23_cd:339,abbrevi:12,abc:[3,12,339,467,495],abf:219,abf_integr:13,abi:195,abil:[3,9,218,255,286,299,395],abl:[3,8,11,12,39,86,191,195,217,226,230,322,329,370,467,495,498],ablat:326,about:[0,1,3,4,6,8,9,10,11,12,13,17,39,41,42,61,63,78,110,117,118,120,162,168,191,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,222,224,225,226,227,228,229,230,231,234,235,236,237,239,240,241,242,243,244,245,246,247,248,249,251,254,260,264,265,266,267,268,269,270,271,272,273,279,280,281,283,284,285,286,287,288,290,291,292,293,294,295,296,297,298,299,300,301,302,311,312,314,315,317,318,319,320,321,322,323,324,325,326,328,329,330,331,333,334,335,336,337,353,356,362,363,365,370,375,376,382,387,402,429,433,461,467,470,471,476,477,479,484,488,495,497,499],abov:[1,2,6,7,8,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,38,40,41,42,43,44,45,46,47,48,49,50,51,53,54,56,57,63,64,68,70,71,72,73,76,77,86,87,89,90,91,94,95,97,98,114,116,118,120,142,143,145,146,147,148,149,150,151,154,155,156,157,158,160,161,162,166,167,168,170,171,174,175,176,177,178,179,180,181,182,183,185,186,188,191,192,193,194,197,198,199,200,201,206,207,209,210,211,212,214,217,218,220,221,226,229,231,235,237,239,240,241,245,254,255,260,282,285,287,292,298,299,303,311,314,317,318,319,320,337,339,340,341,342,343,344,345,346,347,349,351,356,358,360,364,365,369,370,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,417,418,419,422,423,424,425,427,429,430,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,456,457,458,460,461,462,463,464,465,466,467,469,470,471,472,473,476,477,478,479,480,483,484,487,490,495,496,498,499],abscissa:452,absenc:201,absent:490,absolut:[3,194,204,219,220,224,303,316,355,356,363,399,407,470],absorb:326,absoult:356,ac3:167,academ:231,acc:321,acceler:[],accelri:[6,13],accept:[7,12,87,168,194,204,217,220,231,321,381,411,477,484],acceptor:401,access:[0,3,6,7,8,9,11,12,16,40,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,85,88,89,90,91,92,93,94,96,97,100,101,102,104,105,106,107,108,109,110,112,113,114,115,116,117,119,120,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,155,156,157,158,159,160,161,163,164,165,166,167,197,198,199,200,201,202,203,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,222,225,226,227,228,229,230,231,232,233,234,235,236,237,239,241,242,243,244,245,246,247,248,249,251,252,253,254,255,260,264,265,266,267,268,269,270,271,272,273,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,308,311,312,313,314,315,316,317,318,319,320,322,323,324,325,326,328,329,330,331,332,333,334,335,336,355,370,397,399,401,402,419,432,433,442,466,467,470,475,487,495],accidenti:349,accler:16,accommod:202,accomod:255,accompani:8,accomplish:[16,220,243,271],accord:[6,64,71,123,129,132,150,193,204,215,216,242,255,281,289,303,305,323,324,326,331,332,334,335,336,366,370,395,399,410,413,430,437,439,440,442,444,445,447,448,449,478,483,495],accordingli:[11,14,146,147,161,172,366,416,417,449],account:[3,6,9,87,120,150,166,167,176,187,207,209,225,236,237,239,255,261,262,263,274,275,276,278,280,284,290,299,300,302,311,312,313,314,317,318,319,322,326,329,345,364,387,399,407,411,416,417,419,422,440,466,483,496],accuml:[3,299,322,329],accumul:[1,6,8,15,71,144,197,207,208,239,299,303,328,353,370,475,494],accur:[1,3,6,15,17,38,41,56,151,214,253,294,299,302,314,322,329,335,337,356,377,395,398,399,424,434,450,452,453,455,483,488,495],accuraci:[1,3,6,12,41,190,191,194,214,233,255,291,302,327,337,355,356,362,395,424,432,433,452,459,478,483,488,490,495,498],accuractli:488,ach:355,achiev:[1,3,6,16,17,18,29,41,214,231,233,255,256,281,282,289,355,402,478],achiv:18,acid:9,ackland1:393,ackland2:393,ackland:[],acknowledg:[],acml:12,aco:495,acolor:[193,194],acoust:281,acquir:[3,6,58,61,62,171,216,218,220,255,428,474,490],across:[1,2,3,6,9,12,13,15,41,57,61,65,68,69,71,79,93,109,110,117,119,156,170,172,206,209,210,211,214,225,235,299,300,304,322,326,329,335,339,365,370,464,469,472,473,477,486,488],act:[3,6,110,153,224,234,237,238,239,240,242,245,254,299,308,321,323,324,326,335,336,337,363,379,390,398,399,401,434,449],acta:[120,167,371],actinid:[9,422],action:[2,6,11,12,71,232,237,324,490],activ:[5,8,11,12,13,14,55,59,87,166,219,232,236,239,245,254,279,299,306,325,353,415,450,463,492,495],actual:[1,3,6,8,12,56,62,124,151,191,194,198,199,213,215,216,224,239,240,276,280,286,294,303,314,316,317,318,319,321,327,336,337,355,366,398,400,410,416,417,449,466,467,478,479,487,495],adam:[355,356],adapt:[],add:[0,1,3,5,6,7,8,9,11,12,13,14,15,16,17,18,19,40,42,71,87,91,103,116,119,121,166,168,169,191,192,193,197,198,199,200,201,203,205,206,207,209,210,211,212,216,219,224,226,229,233,234,235,237,239,241,242,246,253,254,255,256,257,258,259,260,261,262,263,274,275,276,277,278,280,288,298,299,301,302,311,313,317,319,320,324,325,326,328,330,331,335,337,356,358,362,364,372,378,380,383,387,395,402,407,419,424,427,433,435,467,469,470,475,477,479,481,488,490],add_molecul:203,add_speci:203,add_to_nodeset:203,addforc:[],addit:[],addition:[6,8,16,141,314,336,398,434],addres:9,address:[7,8,11,193,238],addtorqu:[],adequ:[314,327,355,365,478],adher:29,adhikari:242,adiabat:[],adiam:[193,194],adjac:[39,168,365,424,452,453,483,484],adjiman:423,adjust:[2,3,6,16,17,41,59,120,146,147,148,151,152,155,156,161,162,167,172,191,193,206,214,218,220,236,239,243,247,251,252,255,256,260,276,280,283,285,286,289,290,291,292,297,299,306,314,318,322,327,329,330,331,333,334,336,355,356,363,365,370,372,392,416,417,440,455,479,496],adjust_dt:[],adjust_radiu:306,adjust_radius_factor:306,admiss:260,adof:[148,206],adopt:[298,490],adp:[],adri:[9,295,432,433],adust:162,advanc:[3,236,377,464,475],advantag:[1,6,8,11,14,18,39,40,41,214,370,394,478,483],advect:[3,6,314],advertis:8,advis:[365,431],afer:3,affect:[1,6,10,14,15,16,17,40,60,61,71,88,119,143,152,166,172,193,194,199,206,207,209,210,211,212,215,216,217,218,220,221,229,235,237,239,245,252,256,257,258,259,261,262,263,269,274,275,276,278,299,300,312,326,336,349,355,361,362,363,365,366,367,370,395,416,417,424,466,467,469,471,472,474,477,479],affin:[16,17,18,220,370,386],afil:233,aforement:18,afresh:[287,477,495],afshar:391,after:[2,3,5,6,8,9,11,12,15,21,22,33,39,40,41,44,50,57,58,59,61,63,71,146,147,148,149,150,151,152,155,156,157,158,160,161,168,169,171,172,175,176,181,190,191,192,193,194,195,197,198,199,203,204,206,207,214,215,216,217,218,220,224,231,242,243,244,245,246,251,252,253,255,261,262,263,269,274,275,276,278,281,285,289,297,299,302,310,315,317,318,319,321,322,323,324,325,329,331,333,337,340,341,347,354,360,361,363,364,366,368,369,370,371,372,377,384,386,393,394,395,396,402,403,404,415,416,417,419,420,421,422,426,430,432,433,440,441,451,453,454,455,458,464,466,468,469,470,471,472,474,475,477,479,481,483,486,487,490,494,495,496,497,498,499],afterrun:477,afterward:3,afterword:41,ag1:167,ag2:167,again:[6,11,12,16,17,62,142,148,154,162,191,194,220,235,285,340,354,365,416,417,464,466,467,469,471,476,483,485,495,497],against:[11,12,13,64,221,365,432,433],aggreg:[6,12,65,68,69,79,93,110,117,235,251,297,299,312,464,496],aggress:[235,483],agilio:[9,13],agre:[3,8,188,363,372,404,433],agreement:[5,7],ahd:401,ahead:333,aidan:[0,5,7,9,13,358],aij:13,aim:6,airebo:[],ajaramil:[7,9,13],aka:193,akohlmei:[7,9,13,195,236],aktulga:[7,9,292,433],al2o3:440,al2o3_001:[120,300],al3:167,ala:[242,440],alain:9,alat:[280,419],alb:[430,453,455],albeit:298,albert:9,alchem:[87,162],alcohol:329,alcu:[371,377],alcu_eam:430,alderton:390,alejandr:[255,256],alessandro:13,algebra:422,algorithm:[0,1,6,7,8,9,41,61,194,203,214,217,220,242,244,245,269,282,299,302,321,322,326,329,334,361,362,363,367,370,395,417,422,437,439,464,466,483],alia:[12,16],alias:[1,356],aliceblu:194,align:[6,12,29,41,71,170,188,210,214,237,358,469,472,490],alkali:395,all:[0,1,2,3,5,6,7,8,9,11,12,13,14,15,16,17,18,22,33,37,39,40,41,42,44,50,54,55,57,59,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,156,161,162,163,164,165,166,167,168,169,170,171,172,174,176,181,187,188,191,192,193,194,195,197,198,199,200,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,223,224,225,226,227,228,229,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,248,250,251,253,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,272,273,274,275,276,277,278,279,280,281,282,284,285,286,287,288,289,290,291,292,294,295,296,297,298,299,300,301,302,303,304,305,306,310,311,313,314,315,316,317,318,321,322,323,324,325,326,327,328,329,331,332,333,334,335,336,337,338,339,340,341,345,350,353,354,355,356,357,358,360,363,364,365,366,367,369,370,371,372,373,375,376,377,378,380,381,382,383,384,386,387,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,411,415,416,417,418,419,420,421,422,423,424,425,426,427,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,461,462,463,464,466,467,468,469,470,471,472,473,474,476,477,478,479,480,481,482,483,484,486,487,488,490,494,495,496,497,498,499],allen:[29,87,390,398],allentildeslei:87,allign:3,allindex:338,alloc:[3,5,6,8,9,11,12,60,229,328,364,366,370,428,433,469,477],allocat:3,alloi:[],allow:[1,2,3,6,8,9,11,12,13,14,15,16,17,18,22,37,39,40,41,55,57,58,59,61,62,63,77,92,108,110,144,146,147,148,161,166,167,168,170,176,187,188,191,193,194,195,197,198,200,202,203,204,206,207,208,209,210,211,212,214,216,217,218,219,220,221,225,226,229,231,232,233,234,236,239,242,245,246,250,252,255,256,280,284,286,287,288,289,293,299,300,302,303,305,306,310,314,321,322,323,324,326,327,328,329,330,331,337,339,341,350,355,356,358,363,364,365,366,369,370,373,377,378,379,380,381,382,387,393,395,399,400,401,402,407,411,416,417,422,424,430,433,434,437,439,440,449,459,461,464,467,469,471,472,473,474,475,476,479,481,482,483,486,487,495,496],almost:[2,3,12,60,237,289,326,356,367,370,449],alo:387,alon:[6,7,217,295,432,433,467],alond:13,along:[6,8,9,12,29,40,71,87,120,167,168,190,191,193,206,217,237,242,243,247,252,254,289,299,302,303,307,311,312,321,325,326,332,335,337,358,361,362,363,365,387,390,399,402,405,407,411,419,432,433,452,469,472,479,480,495],alonso:[420,421],alpha:[6,12,51,198,242,281,289,294,363,371,374,378,387,391,393,394,396,401,406,407,419,425,429,454,456,487,490],alpha_:[],alpha_c:415,alpha_i:441,alpha_ialpha_j:[],alpha_lj:415,alphabet:[2,3,22,37,44,55,63,176,187,197,341,350,364,384,450,469],alphanumer:[3,63,197,288,296,339,364,495],alreadi:[3,7,8,9,12,16,17,18,42,168,169,171,192,202,206,210,211,214,216,220,246,287,289,314,337,364,365,391,400,402,409,417,449,459,462,465,469,470,474,479,495],also:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,22,29,36,37,38,39,40,41,42,44,54,55,56,58,59,61,63,66,71,72,73,75,77,81,87,89,90,92,94,104,105,106,107,108,109,114,116,118,119,121,142,143,144,145,146,147,148,149,150,151,152,154,155,156,157,158,160,161,162,163,164,165,166,168,169,170,171,172,174,176,187,188,189,190,191,192,193,194,195,197,198,199,200,202,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,226,229,230,231,232,233,235,236,239,240,241,242,252,253,255,256,257,258,259,260,261,262,263,268,271,272,274,275,276,277,278,280,281,282,284,285,286,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,307,308,311,312,314,317,318,319,320,321,325,326,327,328,330,332,335,337,339,341,347,350,353,355,356,358,359,360,363,364,365,366,367,369,370,377,381,382,384,388,389,390,391,393,394,395,398,399,401,402,403,411,415,416,419,422,424,426,428,429,430,431,434,435,437,444,445,447,448,450,451,452,453,454,455,456,458,464,466,467,468,469,470,471,472,473,474,476,477,478,479,481,482,483,484,487,488,489,490,491,493,494,495,496,497,499],alter:[3,6,8,9,11,12,41,59,145,146,147,148,149,151,154,155,156,157,160,161,168,172,191,193,195,198,199,206,215,216,217,218,220,254,255,294,297,299,301,308,314,322,329,336,362,365,402,469,474,476,479,495,496,499],altern:[1,6,8,11,12,17,18,91,168,191,197,207,220,236,240,255,288,299,321,322,329,342,346,355,362,363,371,372,387,393,394,396,404,407,415,419,420,421,426,430,431,441,451,453,455,458,467,469,470,482,484,487],although:[29,42,188,245,255,286,290,299,321,354,476,490,499],aluminum:462,alwai:[0,6,11,12,17,18,54,57,63,71,166,194,206,207,208,210,211,212,216,219,231,233,237,291,294,299,314,331,335,336,340,355,356,361,363,364,366,367,370,380,383,393,410,422,432,433,440,442,452,453,455,462,464,469,470,472,474,481,483,486,490,495,496],amap:194,amatrix:233,amaz:11,amazingli:13,amber2lmp:[],amber:[],ambient:193,ambigu:[3,63,197,495],amd:[17,370,422],amend:11,amino:9,amit:9,among:[16,143,204,242],amorph:[168,454],amount:[1,3,6,12,59,88,117,166,170,190,193,204,208,218,219,231,235,239,255,280,286,299,306,314,319,322,327,329,337,355,370,391,428,469,472],amplitud:[220,252,307,332,349,472,495],amu:231,amzallag:440,analag:[6,495],analalog:6,analog:[6,108,142,170,188,399],analys:[7,474],analysi:[7,9,13,63,64,73,195,295,296,304,338,422,441,469,479],analyt:[1,3,9,13,120,162,167,302,355,377,403,404,409,422,430],analyz:[6,8,13,365,422],andersen:302,anderson:[284,391],andr:[7,9,13],andrew:13,andzelm:449,ang:280,angl:[],angle1:298,angle2:298,angle_coeff:[],angle_cosineshift:27,angle_cosineshiftexp:[26,177],angle_cutof:401,angle_cutoff:401,angle_hybrid:29,angle_info:433,angle_styl:[],angle_typ:40,angleangl:[3,340,347,469],angleangletors:[3,175,469],anglecoeff:3,angletors:[3,175,181,469],angletyp:216,angmom:[],angmomi:[115,191,316],angmomx:[115,191,316],angmomz:[115,191,316],angstrom:[6,10,59,71,120,157,167,168,190,191,193,194,202,210,211,220,221,231,236,237,252,292,297,331,333,334,336,356,358,361,367,371,372,382,393,415,419,426,431,432,433,455,462,472,478,494,496],angular:[3,6,29,40,61,63,66,82,83,84,85,107,115,142,146,147,160,161,168,191,197,239,245,251,252,257,258,259,261,262,263,265,266,267,270,272,273,274,275,278,297,299,302,307,316,371,377,386,399,416,417,419,422,430,450,453,454,469,479,495,496],angularm:266,anharmon:[27,53,177,294,483],ani:[1,3,6,7,8,9,10,11,12,13,14,15,16,17,22,29,38,39,40,41,42,44,55,56,58,59,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,171,172,174,176,188,190,191,192,193,194,197,200,201,202,204,206,207,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,226,228,231,234,235,237,239,242,245,251,252,255,260,280,282,284,285,286,288,290,291,292,294,296,297,299,301,302,303,307,308,311,313,314,315,316,325,326,331,332,333,334,335,336,337,338,339,341,354,355,356,358,360,361,363,364,365,367,368,369,370,372,377,381,382,386,387,390,391,393,394,396,398,402,403,404,405,411,422,424,430,432,433,434,441,449,450,451,452,453,454,455,456,457,458,463,464,466,467,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,487,488,490,491,493,494,495,496,497,498,499],anihil:415,anim:[2,4,7,11,13,193,365],anion:[396,440],aniso:[3,218,220,255,256,257,258,259,260,261,262,263,286,299],anisotrop:[239,398,434],ann:423,annot:[7,451,453,454,455,458,469],annual:[464,483],anoth:[1,3,4,6,7,8,11,12,17,29,40,63,71,72,87,118,121,192,193,197,198,204,206,209,210,211,212,217,220,221,232,235,239,240,245,255,256,260,285,288,299,300,317,318,319,326,336,339,361,363,365,366,369,387,391,395,396,398,401,402,406,407,415,432,434,442,449,453,454,455,463,464,467,470,476,478,490,495,499],ansi:[12,16],answer:[3,4,8,12,299,367,368],anthoni:324,antiquewhit:194,antisymmetr:[9,40,373],antisymmetri:395,antonelli:[323,324],antonio:429,anymor:324,anyon:7,anyparticl:86,anyth:[8,11,168,220,238,451,453,455,480],anywai:[171,370,490,497],anywher:[12,168,384,419,441,495],aoff:[364,469],aparam:[87,198,199],apart:[3,169,245,311,366,375,442,469,478],aperiod:281,api:[11,12,195,403,467],appar:3,appear:[2,3,6,11,12,13,39,40,41,72,77,87,92,108,110,117,118,142,151,168,169,171,191,193,194,206,210,211,214,218,221,224,231,236,285,296,297,325,337,339,340,355,363,364,365,385,393,419,424,440,452,458,465,466,467,469,470,471,474,476,490,495,499],append:[],appendix:[29,390,440],appl:[218,255,256,458],appli:[2,3,4,5,6,8,9,12,17,18,29,33,41,50,57,59,61,63,71,72,87,88,106,118,142,143,148,154,156,158,162,167,168,170,174,176,181,187,190,191,193,194,197,198,199,200,201,203,206,213,214,218,219,220,222,225,226,229,230,231,232,233,234,236,237,239,240,241,242,246,255,256,260,261,262,263,269,274,275,278,279,280,282,286,289,297,298,299,301,302,303,304,307,311,312,313,315,317,318,319,320,322,324,325,326,329,337,355,358,363,364,365,375,378,380,382,387,390,395,399,400,401,402,404,407,413,417,422,424,427,432,435,436,437,438,439,449,456,461,469,470,472,473,474,478,479,481,486,490,495,496,497,498],applic:[1,6,9,12,17,195,203,217,221,222,229,231,233,236,280,285,298,303,311,322,329,355,370,455,479,490],applyt:3,appopri:17,approach:[6,7,9,14,191,203,232,281,282,294,299,321,322,324,326,329,355,377,387,389,392,398,402,422,434,436,438,449,459],appropri:[1,2,3,6,8,11,12,13,15,17,33,38,42,50,56,61,73,88,91,118,119,146,147,148,176,181,187,188,191,194,206,207,210,211,212,217,218,220,229,230,233,242,250,252,253,255,257,258,259,260,261,262,263,274,275,276,278,282,285,286,289,294,299,314,317,318,319,322,329,331,332,334,335,336,347,356,365,372,377,381,385,386,387,394,399,402,404,411,415,422,431,432,433,451,452,453,454,455,458,459,469,470,471,473,474,482,483,486,495,496],approri:234,approxim:[6,9,120,124,167,231,233,242,282,300,302,321,355,361,362,363,379,389,395,398,416,417,422,424,431,434,440,461,483,490],april:11,aprpopri:464,apu:[416,417],aqua:[193,194],aquamarin:194,ar_therm:203,ar_ttm:203,ara:13,arbitrari:[6,40,58,118,191,193,195,219,220,234,255,282,290,451,467,480,495],arbitrarili:[11,59,118,142,190,218,255,387,495],arcco:3,arch:[1,12,14,15,17],architect:353,architectur:[16,370,422],archiv:[6,7,11,12,316,384,476],arcsin:3,area:[6,41,91,114,118,166,214,220,242,322,329,392,399,429,457,466,479],aren:[118,288,339],arflag:12,arg:[3,11,12,22,40,41,44,55,59,63,71,87,119,156,162,166,168,171,172,176,190,191,192,194,197,198,199,200,202,204,206,207,208,209,210,211,212,213,214,215,216,219,220,221,226,229,231,234,235,236,237,245,252,257,258,259,285,298,299,300,301,304,307,308,310,321,324,331,332,333,334,336,337,341,353,365,370,378,379,380,382,383,384,389,390,395,400,402,407,411,415,416,417,418,427,435,437,439,450,466,467,469,472,474,476,478,480,482,487,488,495,496,498,499],argon:231,argonn:12,argument:[2,3,6,8,11,12,17,20,21,22,23,24,25,26,27,28,29,30,31,32,35,38,40,41,42,43,44,45,46,47,48,49,51,53,54,56,59,63,73,87,91,108,111,114,118,142,143,145,150,155,156,157,162,166,168,169,170,172,174,175,176,177,178,179,180,182,183,185,186,188,191,194,197,198,199,200,202,205,206,207,208,209,210,211,212,213,214,218,219,220,227,229,230,231,233,234,238,239,245,252,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,284,285,287,291,296,299,300,301,302,314,317,319,326,328,330,332,334,337,339,340,341,342,343,345,346,347,349,351,353,354,356,357,358,360,365,369,370,371,372,374,375,376,377,378,379,380,381,382,383,384,385,386,387,389,390,391,393,394,396,397,398,399,400,401,402,403,404,405,407,408,409,410,411,412,413,414,415,416,418,419,420,421,424,425,426,427,429,430,432,433,434,435,440,441,442,450,451,452,453,454,455,456,457,458,460,461,462,463,464,465,466,467,468,469,470,472,474,477,478,479,480,484,486,487,495,496,498],aris:[12,461],arithmet:[3,6,104,355,382,385,405,410,424,456,457],arkansa:9,arl:9,armv8:17,arnold:355,around:[1,3,4,6,12,42,57,58,59,66,70,71,72,73,77,118,142,146,163,166,168,170,190,193,194,201,202,218,220,221,237,252,255,288,290,294,299,307,311,314,331,332,335,354,364,440,469,472,479,480,490,495],aroung:3,arrai:[],arrang:142,arrheniu:483,art:[9,290,464,483],artefact:233,articl:[6,440],articul:[7,284],artifact:[88,166,490],artifici:[253,289,444,445,447],arun:13,arxiv:[142,192,441],ascend:[41,194,236,245,299,474],asci:7,ascii:[13,300,325,365,393,396,419,469],ash:[416,417],asid:[8,168,419],asin:495,ask:[3,11],askari:429,askoos:13,asoci:193,aspect:[6,7,59,220,231,398,434,457,469,479,483],aspect_ratio:300,asper:4,aspher:[],asq:[416,417],assembl:4,assign:[1,2,3,6,7,11,12,14,15,17,18,33,39,40,41,50,57,59,61,63,66,71,72,75,90,94,105,107,112,115,116,120,142,143,148,163,165,167,168,171,181,191,192,193,194,195,197,198,199,202,206,209,214,216,217,218,221,223,231,236,239,240,241,242,252,255,257,258,259,260,261,262,263,272,274,275,276,277,278,282,285,286,288,290,296,299,300,317,318,319,320,337,347,356,358,360,364,365,369,370,377,393,396,398,401,402,433,434,462,466,467,469,470,471,472,473,478,479,484,487,495,496],assignemnt:[6,478],assing:288,assist:[7,253],associ:[3,5,6,8,9,12,22,37,39,40,44,55,59,66,74,75,81,87,89,90,94,100,102,104,105,107,132,163,176,187,191,193,194,198,199,200,204,218,220,226,229,231,232,238,242,252,255,284,294,298,299,300,312,314,338,339,341,350,358,363,365,369,370,384,387,391,392,393,395,401,402,404,407,411,436,438,449,450,452,467,470,477,489,490,492,495],associd:67,assum:[2,3,4,6,11,12,16,17,18,39,59,67,71,88,97,103,105,145,146,147,148,149,150,151,153,154,155,156,157,158,160,161,162,166,168,171,194,198,199,204,206,207,209,210,211,212,218,220,228,236,238,242,245,257,258,259,261,262,263,265,267,270,272,273,274,275,278,280,281,285,286,287,290,299,301,303,311,322,325,326,331,334,337,344,355,356,364,365,370,376,377,379,381,384,385,392,395,401,402,406,411,416,417,457,464,466,467,469,471,474,479,483,486,487,490,496],assumpt:[166,236,371,424],astar:419,astart:442,asterisk:[22,44,61,77,87,118,162,172,176,194,198,199,245,299,341,360,384,401,449,463,466,479,494],astop:[363,442],asu:393,asub:419,asubrama:13,asymmetr:[129,334,377,393],asynchron:[15,16],atan2:495,atan:495,atc:[],atc_fe_output:203,athomp:[0,7,9,13],atm2pa:6,atmospher:494,atol:12,atom1:[284,298,364,469],atom2:[284,298,364,469],atom3:[284,298,364,469],atom4:[298,364,469],atom:[],atom_element_map:203,atom_forc:433,atom_info:433,atom_modifi:[],atom_styl:[],atom_vec:8,atom_vec_atom:8,atom_vec_electron:8,atom_veloc:433,atom_weight:203,atomey:[6,7,11,13,191,193,194],atomfil:[3,71,288,337,369,479,495],atomic_charg:203,atomic_numb:430,atomid:469,atomist:[6,203,321,422],atomperbin:3,atomt:194,atomvec:8,attach:[6,211,282,303,311,469],attatch:324,attempt:[3,6,41,59,71,190,204,214,215,216,217,221,231,285,286,314,334,355,359,365,402,467,484,487,495],attend:203,attent:[15,18],attogram:494,attrac:419,attract:[],attribut:[3,6,7,8,11,39,40,42,58,63,71,87,115,116,117,119,146,162,191,193,194,197,198,199,205,206,209,210,211,217,218,255,257,258,259,260,261,262,263,265,266,274,275,276,278,286,299,300,316,317,318,319,358,364,377,395,402,469,470,471,479,487,495],atw:[416,417],atwat:454,atwt:419,atyp:[117,162,216,387,407,411,415],au1:167,au3:167,aug:[],augment:[12,115,218,288,419],augt1:419,auo:296,auoh:296,author:[3,8,9,13,192,393,394,490],auto:[6,8,11,12,91,164,197,207,208,303,328,355,364,370,466],autocorrel:[63,91,239],autom:[12,193],automag:7,automat:[3,6,12,14,15,16,17,18,19,36,130,188,202,208,231,233,242,299,303,327,355,370,386,393,402,419,422,436,437,438,439,462,469,482,490,495],auxiliari:[1,6,9,11,12,13,191,281,299,470,474,497],avail:[1,3,5,6,7,8,9,11,12,13,15,16,17,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,43,45,46,47,48,49,51,53,54,56,61,63,87,111,114,115,142,145,155,166,174,175,177,178,179,180,182,183,185,186,188,191,193,197,200,206,209,210,211,212,213,218,219,220,227,230,232,234,236,239,255,256,257,258,259,260,261,262,263,264,265,272,274,275,276,278,291,293,299,300,301,302,317,319,324,330,334,340,342,343,345,346,349,351,353,356,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,395,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,417,419,420,424,425,426,427,429,430,432,433,434,435,441,442,451,452,453,454,455,457,458,460,461,462,470,472,478,482,495],availab:[],ave_chunk:6,aveforc:[],avendano:423,averag:[3,6,7,12,15,41,63,64,71,87,91,92,104,106,118,120,144,148,156,164,167,191,194,197,199,203,205,206,207,208,209,210,211,212,213,214,218,231,233,235,239,245,255,256,260,281,286,289,295,296,299,300,303,340,372,395,419,456,470,474,487,490,495],averi:314,avesq:119,avg:12,avi:193,avoid:[1,3,6,12,36,39,59,168,169,188,193,202,207,209,212,224,231,233,240,280,282,290,294,299,300,328,335,368,377,395,415,419,433,452,471,477,478,490],awai:[3,6,61,118,191,193,206,217,221,234,237,254,280,303,311,325,331,366,387,407,411,474],awar:[370,394,466],awpmd:[],axel:[7,9,13,18],axi:[3,6,41,71,92,120,132,146,167,168,170,190,193,206,214,231,234,237,252,285,307,311,326,332,345,351,358,469,472,479],axial:260,azimuth:[193,234],azur:194,b_k:441,ba2:167,babadi:434,back:[1,6,7,11,12,13,14,15,17,149,150,151,155,156,157,158,160,168,172,191,194,195,198,199,219,224,229,236,237,239,240,255,261,262,263,274,275,276,278,297,299,317,318,319,323,324,333,334,336,354,355,356,365,399,467,469,470,471,472,473,476,482,483,495,496],backbon:[217,302,349],backcolor:[194,498],backend:17,background:[9,87,88,114,143,194,214,220,239,314,322,326,329,365,385,416,417,419],backtrack:[361,363],backward:[9,12,195,365,483,495],baczewski:232,bad:[3,12,59,61,237,365,469,474,486],badli:[3,218,255],bal:321,balanc:[],balasubramanian:277,ball:[142,416,417],ballenegg:355,bammann:203,band:[4,6,7,9,142,197,254,362,365,377,422,440],bandwidth:[1,10,18,40],bandwith:193,bar:[87,193,494],barashev:393,bare:[224,238,240],barost:[224,490],barostat:[],barostt:6,barr:386,barrat:294,barrett:67,barrier:[3,4,6,254,351,365,386,397,483],bartel:281,bartok2010:441,bartok2013:441,bartok:[9,142,431,441],bartok_2010:431,bartok_phd:431,bary:494,barycent:310,basal:[],base:[3,4,6,8,9,11,12,13,14,15,20,63,64,71,78,87,91,104,113,120,148,150,167,168,170,191,192,193,194,197,203,210,211,214,215,216,220,221,225,231,236,239,243,245,269,281,282,288,290,292,299,300,303,304,314,321,356,370,372,374,377,391,395,398,401,402,403,407,416,420,421,427,429,430,440,451,454,455,458,464,466,469,470,471,473,476,479,480,483,484,487,494,495,496,499],bash:384,bashford:[6,20,174,382,481],basi:[3,6,12,40,142,148,168,202,239,241,281,314,331,358,479,495],basic:[6,7,8,12,17,41,115,143,193,194,203,214,255,256,280,335,371,373,422,463,471,490],basin:[86,365,464,483],bask:[393,419,430],bath:[9,289,294],batom1:[69,117,119,191,194],batom2:[69,117,119,191,194],bayli:[6,174,481],bb13:175,bcc:[3,4,7,64,70,73,358,419,421],bcolor:[3,193,194],bdiam:[3,193,194],be2:167,bead:[5,7,10,13,40,45,46,160,201,217,282,449],beam:221,bear:[6,232],becau:13,becaus:[0,1,3,6,8,12,16,17,18,40,41,42,59,64,71,72,77,92,108,118,130,142,148,153,158,168,169,170,174,191,192,193,194,195,200,206,214,215,216,217,218,220,226,230,231,232,233,238,239,240,241,252,255,256,269,276,285,289,290,294,299,311,316,321,322,325,326,329,333,334,335,336,337,343,355,361,363,365,366,369,370,376,382,384,387,389,391,395,396,398,399,400,401,402,405,406,415,416,417,419,424,434,449,450,456,457,466,467,469,471,472,473,476,478,479,481,483,490,495,496,497,499],beck:[],becker:[371,393],beckman:236,becom:[1,2,3,6,7,8,18,39,41,54,57,59,71,170,191,193,194,214,215,216,217,220,231,233,242,254,255,296,297,317,318,331,332,334,335,336,355,356,361,365,372,385,387,393,395,398,407,424,430,434,451,458,461,469,470,472,479,495],been:[1,2,3,6,7,8,9,11,12,13,16,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,41,42,43,45,46,47,48,49,51,53,54,56,57,59,60,63,65,69,71,87,111,114,115,116,117,119,121,145,146,147,148,149,150,151,155,156,157,158,160,161,169,170,171,172,174,175,177,178,179,180,182,183,185,186,188,190,191,193,194,195,200,202,204,205,206,207,209,210,211,212,213,214,217,218,219,220,221,227,230,231,234,236,237,239,240,242,243,244,245,246,250,252,253,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,284,285,286,289,291,293,296,297,299,301,302,310,315,317,318,319,326,327,328,330,331,332,333,334,336,337,340,342,343,345,346,349,351,354,355,356,363,366,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,392,393,394,395,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,417,420,421,422,425,426,427,429,432,433,434,435,442,449,451,452,453,454,455,457,458,460,461,462,464,466,467,469,470,471,472,473,475,479,483,486,487,495,496,497,498],befor:[1,2,3,6,8,9,12,14,17,22,29,39,40,41,44,59,66,71,74,75,81,89,90,94,104,105,106,107,116,148,151,156,157,163,168,169,171,172,176,189,190,194,198,199,200,201,202,204,206,209,210,211,212,213,214,218,223,224,230,231,236,238,239,240,242,245,252,255,261,262,263,274,275,278,281,288,289,290,293,294,299,300,301,315,317,318,319,325,331,332,333,337,341,360,361,363,365,370,396,399,415,419,422,450,459,464,466,467,470,471,472,473,474,476,477,479,483,486,487,490,495,496,497,498,499],began:[5,12],begin:[3,8,12,38,39,56,71,119,121,169,188,190,191,194,198,199,203,205,206,207,209,210,211,212,214,220,269,284,297,300,314,316,319,328,333,336,337,352,354,355,356,357,359,362,364,365,366,369,370,393,422,424,430,437,439,440,442,449,452,462,464,469,476,483,485,487,494,495,497],behalf:3,behav:[3,27,177,362,363],behavior:[3,172,188,191,193,195,217,218,221,231,232,233,236,239,240,241,255,285,289,294,314,317,318,326,362,377,395,419,462,463,471,475,495,497],behaviour:[6,239],behind:[8,238,253,289,314,355],beig:194,belak:7,believ:11,bellott:[6,20,174,382,481],bellow:345,belong:[2,3,40,71,122,171,204,206,210,231,245,299,337,364,436,469],below:[1,2,3,5,6,8,9,11,12,15,16,17,22,38,39,41,42,44,54,56,59,60,63,65,68,69,71,77,79,91,93,114,115,118,119,120,142,143,148,154,156,162,166,167,168,171,172,174,176,187,188,190,191,193,194,197,198,200,201,203,206,207,208,209,210,211,213,214,216,217,218,220,221,226,229,231,234,235,237,239,240,245,252,253,255,260,261,262,263,274,275,278,280,285,288,289,290,297,298,299,301,302,308,311,314,315,316,317,318,319,322,323,324,326,329,331,332,337,339,341,353,355,358,360,361,363,364,365,367,370,371,372,373,377,378,379,382,383,384,385,387,390,393,395,396,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,417,418,419,423,424,429,432,433,434,435,441,442,449,450,452,457,458,460,461,462,463,464,467,469,470,471,472,474,476,477,479,481,482,483,485,486,487,489,490,495,496,499],bench:[1,6,11,12],benchmark:[1,7,10,11,12,13,14,15,16,17,18,41,214,355,482],beneath:221,benedict:422,benefici:[61,367],benefit:[1,232,478],bennet:87,beowulf:7,berardi:[398,434],beraun:326,berendsen:[],berensen:299,berkelei:166,berkowitz:355,berlin:[7,9,303],bern:[3,282,290,291,386,398,440,450,478],bernendsen:6,beryllium:395,besid:[8,301,472],best:[1,6,8,14,15,16,17,18,19,255,276,277,298,299,370,377,387,407,411,424,452,470,478,483],beta:[6,9,281,289,371,374,393,394,396,419,453,454,455,487,495],beta_:377,beta_k:441,beta_pi:377,beta_sigma:377,beta_t:454,better:[3,6,7,8,12,14,16,27,142,177,199,214,231,242,255,269,290,297,299,314,356,365,370,453],betwe:375,between:[],beutler:415,bewteen:[110,207,314,322,329,402,466],beyon:478,beyond:[3,5,6,12,17,61,71,87,166,191,194,209,210,231,255,355,367,397,413,424,483,487,495],bflag1:[42,193],bflag2:[42,193],bgq:[17,422],bi3:167,bi5:167,bia:[3,6,8,114,143,146,147,148,149,150,151,155,156,157,158,160,161,206,219,220,231,239,240,255,261,262,263,274,275,276,278,294,317,318,319,321,496],bias:[6,9,219,496],biaxial:146,biersack:[419,450,455,462],big:[3,4,12,191,289,294,314,366,385],bigbig:[3,12],bigint:[3,229],bilay:[4,10,311],bilayer1:311,bilayer2:311,bill:7,billion:[3,7,10,12,39,231,477],bin2d:71,bin3d:71,bin:[3,6,11,12,39,63,66,71,75,90,94,105,107,116,118,148,156,163,165,191,194,206,209,210,211,281,289,294,314,366,367,370,392,428,470,498],binari:[3,6,7,9,12,13,16,33,37,50,55,181,187,191,192,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,227,228,229,230,231,232,233,234,235,236,237,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336,347,350,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,425,427,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,460,461,462,470,471,476,497,499],binary2txt:[],binchunk:206,bind:[9,17,18,192,210,377,440],binsiz:[39,194,366,370],binstyl:156,bio:[40,366],biolog:[6,7],biologi:180,biomolecul:[284,299,355,356,382],biomolecular:478,biophys:236,biosym:13,bird:392,bisect:[41,214,457],bisector:[6,387,407,411],bispectrum:[63,142,441],bisqu:194,bit:[3,11,12,17,39,229,240,424,452,477,490],bitmap:[3,452,459],bitrat:[193,194],bitzek:362,bkgd_dyn:419,bla:12,black:194,blais:[9,13],blanchedalmond:194,blank:[2,3,12,38,56,109,188,193,284,299,364,365,377,394,419,426,441,451,452,453,454,455,458,466,467,469,495],blast:326,blend:419,block:[2,3,6,91,142,168,170,171,285,335,358,370,377,395,430,441,472,483,490],blocksiz:370,blow:[3,269,331,335,442],blown:3,blue:[2,193,194,217],bluegen:[191,355,422],blueviolet:194,bni:71,board:[356,390],bodi:[],body_nparticl:8,bodyflag:469,bodyforc:242,bodyforcei:242,bodyforcex:242,bodyforcez:242,bodystyl:[245,299],boff:[364,469],bogaert:321,bogu:[3,151,218],bogusz:88,bohr:[393,395,422,455,494],boltzmann:[6,7,9,87,91,114,145,148,149,150,151,154,155,156,157,158,160,206,217,239,242,243,244,245,246,260,330,391,484,494],bond:[],bond_coeff:[],bond_graph_cutoff:433,bond_harmon:[8,48,49],bond_harmonicshift:49,bond_info:433,bond_interact:203,bond_styl:[],bond_typ:172,bondangl:[3,21,33,469],bondbond13:[3,175,469],bondbond:[3,21,33,469],bondchk:433,bondcoeff:3,bondtyp:[215,216,364],bonu:[3,497],book:461,bookkeep:424,bookmark:0,boost:[1,3,12,64,366],bop:[],border:[3,7,16,61,326,496],boresch:87,boreschkarplu:87,born:[],boron:395,borrow:303,bose:294,botero:[7,9,13,395],both:[1,3,6,7,8,9,11,12,14,15,16,17,27,37,39,40,54,55,57,59,61,62,63,68,69,71,83,87,88,110,115,117,118,130,144,146,147,148,153,156,158,161,168,170,171,172,177,187,188,191,193,196,197,198,199,204,206,207,210,211,212,215,216,217,218,219,220,225,231,233,235,237,239,240,242,243,251,252,255,256,261,262,263,269,274,275,278,284,288,289,290,296,299,302,303,311,314,318,322,323,324,326,329,331,332,334,335,336,339,340,350,356,360,363,364,365,366,368,370,372,377,378,379,380,381,382,383,385,390,391,393,394,395,398,399,401,402,403,407,409,411,412,413,415,416,417,422,423,424,427,434,435,451,453,454,455,458,464,466,467,469,470,471,472,476,481,486,487,490,495,497,498,499],bottleneck:[1,3,467,488],bottom:[8,9,151,194,220,230,242,276,322,329,358,481],bottomwal:213,bounc:[3,314],bound:[3,6,17,26,27,41,42,57,59,71,157,170,177,190,191,194,209,210,214,220,221,225,231,240,255,285,314,331,332,333,334,335,336,355,363,395,469,472,483,490,495,496],boundar:3,boundari:[],boundary_dynam:203,boundary_faceset:203,boundary_integr:203,bount:11,bourgogn:9,box:[],boxcolor:[193,194],boxxlo:11,bpa:370,bpclermont:[9,13],bptype:449,br1:167,bracket:[2,3,6,41,63,71,119,121,197,205,206,207,209,210,211,212,214,328,487,495],bragg:[120,167],branc:11,branch:11,branicio2009:458,branicio:[73,458],breakabl:[7,44,55],breakag:[78,215],breakdown:[1,12,15,88,109,432,433,464,483],brennan:449,brenner:[372,450],brick:[3,41,61,62,156,170,214,469,471,473,495],brief:[1,5,6,7,8,12,238,372,377,433,483],briefli:[6,10,282,386,440],brilliantov:399,bristol:[5,7],brittl:429,broader:467,broadli:8,broken:[2,54,65,69,70,78,104,109,117,172,215,255,377,471,481,488,497],brook:6,brought:190,brown:[7,9,13,15,16,120,143,194],brownain:379,brownian:[],brownw:7,brows:0,browser:[4,193],bryantsev:401,bsd:12,bstyle:[40,42],btype:[69,117,169,191,387,407,411,415,449],buc:380,buck:[],buckingham:[7,198,199,290,356,378,380,381,389,418,450],buckplusattr:440,buffer:[3,8,193,194,486],bufi:193,bug:[],bui:193,build:[],builder:[7,13],built:[1,2,3,4,6,8,9,11,12,13,14,15,16,17,20,21,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,40,43,45,46,47,48,49,50,51,53,54,55,56,64,67,78,80,83,86,87,97,98,99,100,101,102,106,111,113,114,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,144,145,146,147,152,154,155,159,160,162,166,174,175,177,178,179,180,181,182,183,185,186,187,188,191,192,195,197,200,201,202,204,208,213,215,216,217,219,220,221,226,227,228,230,231,232,233,234,236,238,239,241,242,243,244,245,246,248,249,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,270,272,273,274,275,276,277,278,280,281,282,284,285,288,289,290,291,292,293,294,295,296,299,301,302,303,304,305,306,307,308,310,314,317,319,320,321,322,323,324,326,327,329,330,332,333,334,338,339,340,342,343,344,345,346,347,349,350,351,356,365,366,367,370,371,372,374,375,376,377,378,379,380,381,382,383,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,425,426,427,428,429,430,431,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462,464,467,470,472,478,482,483,484],bulatov:[420,421],bulk:[4,6,10,70,242,280,286,388,419,422,424,429,436,438,440,473],bullet:7,bump:239,bunch:8,bundl:[9,193,195],burlywood:194,bussi1:318,bussi2:318,bussi:[233,318],buyl:[9,192],bybe:9,bypass:6,c1060:14,c11:[207,419],c12:207,c13:207,c1n:207,c2050:14,c21:207,c22:207,c23:207,c2n:207,c31:207,c32:207,c33:207,c34:207,c3n:207,c41:207,c42:207,c43:207,c44:207,c_0:[326,447,448],c_1:[68,69,119,120,167,191,194,232,288,300,337],c_2:[69,119,120,164,166,167,191,300,328,337],c_3:[119,300],c_cluster:6,c_cstherm:6,c_dist:119,c_doubl:11,c_e:326,c_flux:91,c_forc:119,c_gauss:397,c_hb:401,c_id:[6,63,71,87,119,121,191,205,206,207,208,209,210,211,212,300,316,328,487,495],c_ij:6,c_ijkl:6,c_index:119,c_k:232,c_ke:322,c_msdmol:121,c_my_stress:205,c_mycentro:[206,210],c_mychunk1:116,c_mychunk2:116,c_mychunk:[6,66,75,90,94,105,107,148,163,165],c_mycom:209,c_mycomput:206,c_myf:[191,498],c_myrdf:[118,212],c_mytemp:[8,207,208,209,212,328,487,495],c_n:376,c_n_k:232,c_p:143,c_pe:112,c_peratom:[112,143],c_pi:377,c_press:119,c_prop:6,c_radiu:166,c_reax:[432,433],c_sa:300,c_sigma:377,c_size:6,c_stress:191,c_tatom:[],c_tdrude:[224,240,490],c_thermo_press:[8,207,208,209,212],c_thermo_temp:212,c_xrd:209,ca2:167,cach:[17,39,424,482],cacul:302,cadetblu:194,cai:490,calcforc:242,calclat:91,calcluat:[106,112,114,143,387],calcualt:[91,206],calcul:[],caldwel:[6,174,481],calhoun:282,call:[],callabl:[3,11],callback:[3,8,11,144,197,229,467],caller:3,calori:494,caltech:[6,7,9,13,395],calucl:6,calul:[11,12,148,356],cambridg:[9,431],campa:281,can:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,185,186,187,188,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,349,350,351,352,353,354,355,356,358,359,360,361,363,364,365,366,367,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,476,477,478,479,480,481,482,483,484,485,486,487,488,490,494,495,496,497,498,499],cancel:[197,299,496],candid:[172,204,231],cannot:[1,2,3,6,11,12,13,15,16,17,39,40,41,54,57,58,59,68,71,82,84,88,105,119,121,144,146,148,169,171,172,190,191,192,193,194,205,206,207,209,210,211,212,214,217,218,220,221,231,232,233,239,240,241,245,252,255,257,259,261,263,265,266,267,272,274,278,285,286,289,294,296,299,300,301,304,314,322,326,328,329,331,332,335,336,337,339,355,358,363,365,368,369,370,380,381,383,393,398,400,407,411,413,415,424,427,432,434,435,436,438,449,450,452,464,466,467,469,470,472,473,475,478,479,481,483,486,494,495],canon:[197,204,231,233,255,256,274,275,276,277,278,282,318,321,324,422,429],cao1:282,cao2:282,cao:282,capabl:[5,7,9,11,14,17,18,333,339,356,370,372,383],capac:[9,40,102,154,294,326,444,469,479],capit:[223,469],capolungo:[120,167,300],captur:[6,327,372,381,395,399,411,419,490],carbid:387,carbon:[7,193,349,372,386,404,419],card:[12,14,16,22,44,77,87,118,176,198,199,299,341,360,384,401,463,471,476,497,499],care:[3,6,59,71,168,171,190,206,210,211,215,216,221,233,238,242,255,285,299,321,375,467,469,472,473,478,479],carefulli:[11,12,54,296,337,402,404,474],carlo:[6,7,9,197,204,217,231,299,321,392,450],caro:[204,393],carpent:[7,13],carri:[16,248,288,326,399,433],cart:[3,466],carter:[9,17],cartesian:[3,62,371,466],carv:171,cascad:[225,326],cash:7,cast:[233,495],cat:[15,193],catastroph:290,cate:242,categori:[],cation:[396,440],cauchi:[135,140],caus:[1,2,3,6,8,12,16,17,168,170,171,172,191,194,202,218,225,231,269,280,297,299,302,331,333,334,335,336,339,354,356,363,365,369,401,407,413,416,417,424,463,467,468,469,470,473,474,476,477,495,499],caution:[1,356],cautiou:[215,216],cautious:372,caveat:[372,478],cbecker:[371,393],cc1:[6,14,66,75,90,94,105,107,116,148,163,165,206,210],cc2:14,ccc:[394,451,453,455,458],ccflag:[12,16,17,18,19,191],ccm6:393,ccsi:[394,451,453,455,458],ccu:377,cd2:167,cdeam:393,cdennist:9,cdll:11,cdof:[6,148,206],cdte:377,cdte_bop:377,cdtese:377,cdzn:377,cdznte:377,ce3:167,ce4:167,ceas:362,ceil:495,cell:[3,6,59,88,118,120,166,167,168,191,202,218,219,231,236,253,255,256,260,281,289,292,326,355,356,358,392,395,422,487],cella:[6,487],cellalpha:[6,487],cellb:[6,487],cellbeta:[6,487],cellc:[6,487],cellgamma:[6,487],center:[3,6,25,42,63,66,71,74,75,86,89,90,99,104,105,106,116,118,120,148,149,150,153,156,160,163,165,168,193,194,197,198,199,201,206,209,210,211,218,220,221,222,224,231,232,237,239,240,245,251,255,261,262,263,274,275,276,278,281,285,290,296,297,299,300,303,311,312,314,316,317,318,319,321,322,324,331,335,340,358,364,375,376,394,395,398,399,405,416,417,419,420,421,451,453,454,455,457,458,472,479,490,495],centimet:494,central:[3,61,70,76,77,92,108,118,124,142,245,280,302,312,344,364,422,426,432,433,458,469],centro:[],centroid:[3,282,457,479],cerda:355,ceriotti2:233,ceriotti:[13,233,238],certain:[1,2,3,6,8,12,17,39,71,115,119,121,172,191,193,205,206,207,209,210,211,212,217,229,230,299,301,315,328,339,347,354,366,402,424,433,456,471,475,490,495],certainli:237,cerutti:356,cfg:[3,6,7,13,191,192,193,194,195],cfile:433,cfl:[130,304],cfor:303,cg_type:435,cgiko:2,cgikot:2,cgkio:2,cgko:2,cgkot:2,cgo:2,cgot:2,ch2:302,ch2lmp:[],ch3:302,ch5md:192,chain3:366,chain:[],challeng:[6,303],chalopin:294,champaign:[236,355,356,416],chan:422,chandler:[371,393],chandrasekhar:[6,407],chang:[1,2,3,6,8,9,11,12,14,15,16,17,39,40,41,46,55,57,59,62,71,80,87,104,118,128,130,150,151,152,168,169,170,172,188,190,191,192,193,194,195,197,198,199,200,201,203,204,210,211,213,214,215,216,217,218,219,220,221,225,226,228,230,231,233,235,236,237,239,241,242,243,245,251,252,253,255,256,257,258,259,260,261,262,263,269,274,275,276,277,278,280,281,285,286,288,289,293,296,297,298,299,301,302,303,314,317,318,319,320,322,323,324,325,326,327,329,332,335,337,356,361,363,365,368,370,391,395,399,402,416,417,419,422,424,432,433,440,449,450,464,465,466,467,469,470,471,472,473,474,475,477,478,479,480,481,484,487,491,493,494,495,496,497],change_box:[],changeabl:191,channel:[4,200],chapter:[282,356],charact:[2,3,6,12,38,41,56,63,188,191,193,194,195,197,214,288,296,339,364,369,395,406,430,432,433,440,452,466,467,471,476,477,495,497,498,499],character:[6,67,70,108,118,142,441,464,483],characterist:[240,314,323,376],charg:[1,3,4,5,6,7,9,11,15,40,87,88,115,120,167,168,191,195,197,198,199,204,221,226,231,288,290,291,292,296,316,329,355,356,364,378,380,386,387,389,390,393,395,396,402,407,411,415,427,432,433,440,450,455,456,458,459,461,462,469,470,474,479,481,490,494,495],charmm2lammp:13,charmm:[],chartreus:194,cheap:314,cheaper:[225,398,434],check:[3,6,8,11,12,15,17,39,41,71,91,188,204,210,214,215,216,221,228,231,237,238,298,302,314,322,324,329,337,339,354,363,364,365,366,367,370,392,403,406,424,433,464,466,467,469,477,483,486,487,495],checkf:188,checkqeq:433,checku:188,chem:[6,13,20,21,25,39,40,43,45,46,87,88,108,114,143,174,175,185,208,219,224,232,233,240,242,254,255,256,276,277,282,286,289,291,299,303,314,317,318,321,322,323,324,331,340,349,351,355,356,362,365,372,378,382,383,386,387,388,390,391,395,397,398,400,401,407,411,412,415,419,423,424,427,440,449,456,478,481,483,490],chemic:[9,120,162,167,191,203,204,231,290,295,296,321,356,432,433,445],chemistri:[9,289,290,292,377,395,432,433],chen:326,cheng:386,chenoweth:[432,433],chenoweth_2008:[432,433],chi:[93,157,190,280,290,292,396,398,496],chiefli:431,child:8,chip:[7,12,17,18,370,482],chipot:219,chiral:349,chmod:[11,12],cho:419,chocol:[7,194],choic:[3,6,12,15,16,18,40,41,54,87,143,146,147,161,172,188,206,210,211,214,217,220,221,233,239,242,253,255,282,290,299,321,350,356,361,362,365,367,370,402,415,424,428,469,478,479,482,483,489,490,494],choos:[1,3,6,7,8,12,16,17,18,29,39,54,87,119,158,159,193,215,216,217,218,221,228,239,242,253,255,257,258,259,260,261,262,263,286,314,318,332,355,356,362,459,464,466,478,484],chose:[453,455],chosen:[2,3,6,12,17,142,168,171,180,188,193,199,204,218,221,228,231,232,240,242,253,255,260,282,285,296,314,318,321,322,327,329,330,336,356,357,362,370,395,399,405,406,409,435,453,464,478,483,490],chri:166,christian:[7,9,14,17],christoph:7,chunk:[],chunkid:[66,75,90,94,105,107,116,148,163,165,206],chute:[4,10,234],ciccotti:302,cieplak:[6,174,481],cii:207,cij:207,circl:[42,71,310],circular:[3,6,146,189],circumst:18,circumv:[92,108,294],citat:[],cite:[3,7,8,12,239,440],ckio:2,cko:2,cl1:167,clarendon:[29,390],clarifi:[7,453,455],clariti:339,clark:427,class2:[],classic:[0,3,5,6,7,8,9,229,282,289,294,326,351,395],classifi:[9,450,458],claus:467,clean:[6,12,14,15,17,477],cleanli:[468,498],clear:[],clearli:7,clebsch:142,clermont:[9,13],clever:473,click:[2,11,22,37,44,55,168,176,187,193,236,341,350,365,384,450],client:[236,238],climb:[254,365,483],clinic:[7,13],clo:[157,190,496],clock:[12,464,483],clockwis:332,close:[3,6,11,12,13,39,41,67,143,171,191,216,217,218,233,240,242,255,276,299,302,332,335,354,356,359,361,362,365,370,372,377,387,388,419,424,436,438,455,473,479,490,492],closer:[3,41,118,166,190,191,214,218,222,323,365],closest:[216,280,299,329,398,434,449,459],cloud:[440,490],clovertown:18,clsuter:72,clump1:[284,299],clump2:[284,299],clump3:[284,299],clump:299,cluster:[],clutter:[3,9],cmap:469,cmatrix:233,cmax:419,cmd:[11,12,282,480],cmdarg:11,cmin:419,cmm:[],cn1:207,cn2:207,cna:[],cnn:207,cnr:[9,13],cnt:[402,473],co2:[40,167,302,364],coars:[7,9,29,36,40,54,180,284,299,314,400,435,481],coarser:[356,495],coarsest:142,code:[],coeff:[3,7,8,12,21,22,33,44,50,174,175,176,181,340,341,347,384,402,406,424,437,439,442,469],coeffcient:469,coeffici:[],coefficienct:391,coefficient0:393,coefficient1:393,coeffieci:[6,374],coeffincientn:393,coexist:[9,231,395],cohes:[6,396,419],coincid:[124,335,382,416,417,464],colberg:192,cold:[6,153,231,235,366,490],coldest:322,coleman8:9,coleman:[9,120,167,300],colin:9,collabor:[7,8,9,15],collect:[3,6,7,8,9,13,40,42,66,75,83,90,94,99,105,107,116,148,156,163,165,168,191,194,206,219,245,251,284,294,297,299,337,355,364,366,385,405,469,476,482,488,499],collid:[225,314,336],colliex:167,collinear:[3,284],collis:[3,242,314,332,336,392,399,462],colllis:314,colloid:[],colombo:39,colon:[195,337,470],color1:194,color2:194,color:[3,9,41,191,193,194,214,232,289,294],column:[3,6,9,12,13,42,63,65,66,67,68,69,71,75,77,79,81,90,92,93,94,105,107,108,110,112,115,116,117,118,119,121,142,143,148,156,163,165,166,167,188,191,194,197,205,206,207,209,210,211,212,245,252,253,289,299,315,316,326,336,397,401,432,433,470,484,486,495],colvar:[],colvarmodul:12,com:[],comamnd:220,comand:217,comannd:370,comb3:[],comb:[],comb_1:291,comb_2:291,combiant:388,combin:[3,6,7,9,11,13,36,40,63,65,69,79,87,93,104,110,117,146,147,161,191,193,203,209,236,245,255,282,288,318,327,335,338,340,355,356,358,362,370,385,387,388,395,396,402,414,415,441,451,453,455,458,461,472,477,482,490,495],come:[],comfort:[12,13],comm:[0,3,11,12,61,73,192,236,238,239,356,365,370,391,424,429,452,471],comm_modifi:[],comm_modift:61,comm_styl:[],comm_world:11,command:[],comment:[2,7,11,12,38,56,174,188,191,240,299,326,364,365,371,393,394,396,406,419,426,433,440,441,451,452,453,454,455,458,466,467,469,490,495],commerci:7,commmand:[3,6,12,59,109,277,463,464,466,483,498],common:[],commonli:[3,6,12,17,25,57,59,106,108,170,191,193,195,351,400,409,441,453,455,469,472,481],commun:[1,3,6,7,8,10,11,12,14,15,16,18,40,41,58,61,62,71,171,172,193,194,214,215,216,218,219,220,236,238,242,244,245,246,255,281,288,290,291,292,299,314,326,337,353,355,366,367,368,370,392,428,466,467,478,479,495,497,499],communc:355,comp:[7,192,238,239,302,356,365,395,424,429,434,448,452,454],compact:[63,197,384,450],compani:[5,7],compar:[1,3,4,6,8,12,17,39,86,112,120,151,166,167,176,187,194,224,290,337,339,355,356,363,365,419,440,464,483,484,490,494],comparison:[],comparison_of_nvidia_graphics_processing_unit:14,compass:[7,21,22,37,43,44,55,175,176,187,340,341,350,383,450],compat:[3,5,7,8,9,11,12,13,17,18,41,71,119,121,179,191,195,199,205,206,207,209,210,211,212,214,281,293,318,321,328,331,334,355,370,403,422,424,452,466,467,495],compens:[6,215,216,297,366,395],compet:325,competit:356,compil:[3,7,8,9,10,12,13,14,15,16,17,18,19,166,191,192,193,195,236,325,356,370,422,469,470,474,495],compl:17,complain:[12,17],complement:419,complementari:[7,387,407],complet:[3,6,9,11,12,15,41,59,71,194,210,214,219,245,282,285,288,314,325,327,339,354,365,370,396,437,439,457,464,469,474,477,481,483,486,490,495],complex:[6,8,11,12,13,25,40,42,62,92,108,142,144,156,168,169,242,310,335,353,365,395,422,452,467,469,472,495],compli:[321,325],complic:[6,7,9,12,13,204,231,467],complier:12,compon:[3,6,8,12,61,63,66,67,73,81,88,89,90,91,92,94,95,98,105,106,107,108,109,110,111,112,114,115,119,129,132,133,134,135,138,139,140,142,143,145,146,147,148,149,150,151,152,153,154,155,156,157,158,160,161,163,164,165,190,191,193,194,200,201,205,206,207,208,209,210,211,212,213,217,218,220,221,226,229,234,238,239,242,245,247,251,252,254,255,256,260,261,262,263,274,275,276,278,279,281,282,283,286,297,299,301,302,303,307,308,311,314,317,318,319,321,328,329,334,335,336,355,358,362,363,364,365,370,376,391,395,399,416,417,437,439,440,441,469,470,479,487,495,496],componenet:6,composit:[6,204,242,393],compound:[386,395,396,458],compres:[71,116,206],compress:[],compris:[40,335,405,434,457],compton:[120,167],comptu:3,compuat:356,comput:[],computation:[3,6,215,216,326,377],computational:490,compute_arrai:8,compute_fep:[199,415],compute_group_group:231,compute_inn:8,compute_ke_atom:8,compute_loc:8,compute_modifi:[],compute_peratom:8,compute_sa:[120,300],compute_scalar:8,compute_temp:8,compute_ti:199,compute_vector:8,compute_xrd:167,concaten:[2,3,498],concav:335,concentr:[71,393],concept:[6,148,158,206,478],conceptu:[3,6,71,156,218,220,365,387,402,419,474],concern:[6,73,87,192,232],concetr:71,concis:[11,325],conclud:12,concret:8,concurr:[9,16,356,495],conden:[326,453,455],condens:[6,150,326,372,389,393,407,458],condit:[],conducit:6,conduct:[],cone:472,confer:422,confid:[3,483],config:[12,191,466],configfil:219,configur:[1,2,6,12,15,17,38,59,124,170,188,190,191,193,197,218,219,220,221,225,231,238,239,269,282,290,325,353,363,365,372,377,394,419,422,451,453,455,458,464,469,471,472,483],confin:[469,483],conflict:[3,12,40,424,467],conform:[3,6,13,59,217,218,254,298,303,325,349,365,395,481],confus:[3,458],conjuct:391,conjug:[7,8,239,362,395,432,433],conjunct:[6,7,71,86,87,116,151,156,162,168,172,194,198,199,239,242,246,269,285,286,290,291,292,294,299,314,322,329,334,355,356,365,378,380,384,387,391,395,401,407,424,427,435,456,469,472,476,490,499],connect:[3,6,87,153,171,217,236,284,299,302,311,365,388,399,449,455,466,467,473,490],conput:3,consecut:[3,11,12,39,71,168,194,198,199,221,236,237,387,407,411,464,470,472],consequ:[1,6,204,326,406,483],conserv:[3,29,197,204,217,224,225,232,235,239,241,242,246,251,253,255,269,299,302,317,318,322,329,330,334,365,390,391,399,413,440,478,483],consid:[6,9,70,71,78,87,117,150,153,154,171,191,194,198,199,205,207,210,214,216,217,221,243,256,281,299,321,322,325,326,329,356,384,395,402,433,434,440,449,464,465,467,470,471,472,474,477,479,487,490,495],consider:[6,8,239,240,317,318,319,370,478],consist:[3,6,8,9,11,12,40,42,65,69,79,93,105,110,113,114,117,148,151,153,168,180,190,195,200,201,206,220,221,224,226,229,232,239,240,241,252,255,257,258,259,260,261,262,263,264,265,267,268,269,270,272,273,274,275,276,277,278,286,289,294,296,298,299,317,318,319,320,330,355,356,358,364,365,370,372,377,379,385,387,395,398,402,416,417,419,422,424,434,437,439,440,452,459,467,469,470,471,472,473,474,481,490,495],consistent_fe_initi:203,consit:299,constant:[],constitu:[3,6,245,299,331,335,385,434],constitut:[437,439],constrain:[3,6,8,145,146,147,148,149,151,154,155,156,157,158,160,161,197,206,221,231,232,237,245,249,284,285,297,299,302,312,322,329,363,364,395,474,481,490],constraint:[],construct:[6,8,12,14,38,54,56,61,64,67,70,72,73,77,92,108,120,142,167,218,255,281,298,335,366,370,390,422,424,449,451,452,472,473,488,495],constructor:[8,11],consult:433,consum:[1,294,428,495],consumpt:353,contact:[],contact_stiff:[436,438],contain:[0,1,2,3,4,6,8,9,11,12,13,17,18,19,38,40,41,56,63,87,91,118,120,142,148,156,166,167,168,170,174,176,187,188,191,193,194,195,197,198,199,203,205,206,207,209,210,211,212,214,219,221,226,233,237,238,239,242,253,269,280,281,284,285,287,289,292,296,299,300,304,314,321,325,326,335,336,339,354,356,364,365,368,369,371,372,373,377,386,387,390,393,394,395,402,403,419,422,426,430,431,432,433,441,451,452,453,454,455,456,458,464,465,466,467,469,470,471,472,474,476,478,481,483,486,487,490,495,497,499],content:[12,18,433,485,487],context:[3,6,8,12,17,118,119,194,215,216,221,284,296,330,362,461,469,476,485,494,495,496],contibut:70,contigu:466,contin:16,continu:[0,2,3,5,6,9,12,13,14,41,71,81,104,105,164,194,197,198,199,204,206,207,208,209,210,211,212,214,217,218,219,220,221,231,232,233,235,236,237,239,240,241,247,252,253,255,257,258,259,260,261,262,263,274,275,276,277,278,283,285,288,289,299,300,303,313,314,316,323,324,326,332,335,339,354,369,370,377,391,392,409,412,432,433,434,437,439,454,464,467,469,471,472,477,483,486,487,495,497],continuum:[6,7,9,203,326,437,439],contour_integr:203,contract:[59,218,220,255,286,299],contradictori:3,contrain:302,contraint:269,contrari:[233,240],contrast:[1,6,42,55,64,150,153,220,337,437,439,461,498],contrib:326,contribut:[3,5,6,7,8,9,12,13,17,63,66,68,70,71,74,75,77,80,84,87,88,89,90,91,94,103,105,107,109,110,111,112,114,116,119,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,199,204,205,206,207,209,210,211,212,218,231,239,242,245,246,250,256,276,277,284,285,293,296,299,300,302,328,355,363,365,373,391,392,393,395,402,416,417,422,424,432,433,440,481,487,490],contributor:12,control:[3,5,6,7,8,9,11,13,16,27,29,41,87,91,124,142,177,191,193,197,203,204,214,218,219,220,235,236,239,240,255,257,258,259,260,261,262,263,286,291,299,305,306,317,318,319,326,330,353,355,367,395,398,422,432,433,436,438,451,455,464,466,478,484,485],control_typ:203,controlfil:433,convect:91,conveni:[6,12,29,191,195,212,300,358,441,495],convent:[3,8,9,29,179,186,187,194,298,311,338,393,395,495],converg:[3,6,41,88,191,193,195,200,214,217,218,226,229,260,289,291,294,298,302,361,362,363,365,386,387,407,440,464,476,483],convers:[3,8,142,193,194,204,207,286,355,387,388,389,395,407,411,415,427,467,483,494],convert:[2,3,4,5,6,7,8,12,13,20,21,24,28,32,35,36,59,63,71,91,168,175,191,193,194,212,253,337,340,342,346,349,358,365,371,393,422,453,455,462,467,469,470,471,476,486,490,494,495,497,499],convex:[42,335,376],convinc:[7,12],cook:9,cooki:7,cool:[7,158,235,297],cooordin:191,cooper:[5,7],coord123:116,coord1:[3,116,206,210,211],coord2:[3,116,206,210,211],coord3:[3,116,206,210,211],coord:[],coordb:440,coordbb:440,coordiat:363,coordin:[1,3,4,6,7,8,11,13,14,15,17,40,41,42,59,61,62,63,66,68,71,74,75,77,81,87,89,90,94,104,105,107,115,116,118,136,142,151,157,163,165,166,168,172,190,191,192,193,194,195,197,200,205,206,209,210,211,214,215,216,217,218,219,220,221,224,226,227,229,231,234,235,236,237,238,239,240,252,254,255,257,258,259,261,262,263,276,279,280,281,284,285,286,296,297,299,301,302,303,308,311,312,313,314,316,324,325,326,333,334,336,337,358,363,364,365,370,371,372,375,376,394,440,464,469,470,471,472,474,477,479,483,490,495,496],coordn:[116,206],coorind:105,copi:[0,3,4,8,11,12,15,17,40,121,193,326,365,384,432,467],copper:462,coproccesor:16,coprocessor:[1,4,7,9,16,17,370,482],coproprocessor:17,copy_arrai:8,copyright:[7,8,284],coral:194,core:[],core_shel:150,coreshel:[6,9,380,387,389],cornel:[6,174,481],corner123i:115,corner123x:115,corner123z:115,corner1i:115,corner1x:115,corner1z:115,corner2i:115,corner2x:115,corner2z:115,corner3i:115,corner3x:115,corner3z:115,corner:[3,6,40,115,193,335,336,358,457,469],cornflowerblu:194,cornsilk:194,corpor:16,corr:386,correct:[3,6,9,11,12,16,17,59,87,88,103,104,112,118,150,155,162,193,220,231,233,239,255,256,276,284,286,289,325,331,335,355,365,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,389,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,457,458,460,461,462,469,484,487,490],correction_max_iter:203,correctli:[3,8,9,11,17,71,81,103,104,145,146,147,149,151,153,154,155,156,157,160,161,164,191,194,200,221,226,229,240,249,255,256,292,299,302,311,313,332,335,365,366,370,389,417,422,466,467,469,479,494,496],correl:[],correspond:[1,2,6,8,11,12,14,20,21,22,23,24,25,26,27,28,29,30,31,32,35,38,40,42,43,44,45,46,47,48,49,51,53,54,56,70,71,87,97,98,111,114,115,116,117,120,121,129,132,133,134,135,136,138,139,140,142,145,146,155,162,167,174,175,176,177,178,179,180,182,183,185,186,188,191,193,194,198,199,200,206,208,209,210,211,213,216,218,220,227,229,230,234,239,242,243,251,252,253,255,257,258,259,260,261,262,263,264,265,269,272,274,275,276,278,281,282,286,291,299,301,302,317,319,321,330,331,332,334,335,336,338,340,341,342,343,345,346,349,351,356,360,362,364,365,371,372,374,378,379,380,381,382,383,384,385,386,387,390,391,393,394,395,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,419,420,422,424,425,426,427,429,430,432,433,434,435,440,441,442,451,452,453,454,455,457,458,460,461,462,464,466,467,469,470,472,482,483,484,486,487,490,495],correspondingli:[416,417,478],cosin:[],cosineshift:27,cosmo:[233,238],cossq:[],cost:[1,6,10,11,12,17,39,41,71,111,120,143,167,193,194,206,210,211,214,215,216,228,255,291,326,355,356,368,387,407,411,422,424,451,466,478],costheta0:[451,453,455,458],costheta:430,costli:[11,88,233,366],couett:4,coul:[],could:[2,3,6,9,11,12,17,33,41,50,59,66,71,75,87,90,94,105,107,111,114,116,148,158,163,165,181,191,193,194,198,199,206,207,210,214,220,229,238,288,289,290,294,297,299,301,314,315,321,325,326,327,331,335,337,339,347,352,354,361,363,366,370,373,397,401,402,432,433,465,466,467,469,471,473,476,477,485,490,495,496],coulomb:[3,5,6,7,8,9,10,12,14,15,18,72,88,109,110,118,143,169,173,290,292,327,355,356,363,370,378,380,381,382,383,386,387,388,389,390,395,399,400,402,407,411,415,418,424,427,432,433,435,440,450,455,456,458,461,474,481,487,490,494],coulommb:6,cound:3,count:[1,3,6,8,10,11,12,16,41,63,68,77,91,116,118,119,156,166,172,200,201,204,206,209,210,211,213,214,221,226,228,231,237,255,269,285,302,317,318,335,356,363,364,365,367,370,397,401,424,487,495],counter:[332,464,475,477,483],counteract:231,counterbal:235,counterbalanc:29,counterpart:[191,299,464],counterproduct:18,coupl:[],courant:304,cours:[3,8,128,130,162,191,198,199,232,298,311,325,331,333,334,336,337,356,416,442,466,469,482,490,495,497],courtesi:358,cov:440,coval:[6,29,395,419,440,490],covari:233,cover:[6,71,188,194,203,242,395,405,457],coverag:[71,210],cpc:238,cpp:[1,3,6,8,9,11,12,13,87,191,198,199,229,302],cpu:[1,3,4,9,10,12,14,15,16,17,18,63,71,194,208,224,240,327,353,356,370,384,450,464,482,483,486,487,488,495],cpuremain:487,cr2:167,cr3:167,crack:[4,366],crada:[5,7],crai:[5,7,13,18,191],crash:[3,12,366,490],craympi:370,creat:[],create_atom:[],create_bond:[],create_box:[],create_elementset:203,create_faceset:203,create_group:192,create_nodeset:203,createatom:[],creation:[],crimson:194,critchlei:284,criteria:[3,118,169,193,194,215,216,217,250,363,429,457,471,474,495],criterion:[12,41,123,166,168,171,204,214,217,231,269,291,304,332,337,363,365,386,395,399,440,474,483,484],criterioni:483,critic:[6,48,49,253,321,326,363],crmax:71,crmin:71,cross:[3,12,22,71,89,146,176,191,193,205,210,216,220,252,254,276,299,307,311,313,322,329,341,358,365,382,391,392,393,400,401,402,407,409,411,430,435,437,439,453,455,462,469,473,479,497],crossov:1,crossterm:469,crozier:[0,7,13],crucial:289,crystal:[4,6,13,73,108,280,281,324,358,366,473,487,490],crystallin:[6,104,281,358,454,490],crystallis:321,crystallogr:[120,167],crystallograph:[358,487],crystallographi:[120,167,358],cs1:167,cs_chunk:6,cs_im:[40,469],cs_re:[40,469],csanyi:[142,431,441],cscl:419,csequ:6,csh:[11,12,384],cshrc:[11,12],csic:[394,451,453,455,458],csinfo:6,csisi:[394,451,453,455,458],csld:[],cst:393,cstherm:6,cstyle:466,csvr:[],ctcm:[371,393],ctemp_cor:224,cterm:303,ctr:9,ctype:11,cu1:167,cu2:167,cu3au:419,cube:[6,41,166,171,214,224,335,358,490],cubic:[],cuda:[],cuda_arch:15,cuda_get:15,cuda_hom:15,cuda_prec:15,cufft:14,cuh:377,cummul:[3,6,212,215,216,217,219,228,233,239,241,314,317,318,319,320,322,329,401,487],cumul:[6,204,206,209,210,211,225,231,239,253,255,260,269,299,300,365],curli:2,current:[0,1,3,5,6,7,8,9,11,12,13,15,16,17,18,40,41,42,59,61,63,71,73,81,87,103,104,110,118,119,132,143,148,156,158,164,166,169,172,190,191,192,193,194,195,198,199,203,206,210,211,212,214,215,216,217,218,219,220,221,225,226,229,231,233,236,237,239,245,252,255,256,261,262,263,269,274,275,276,278,284,290,291,293,296,297,298,299,302,303,304,305,306,307,308,310,312,313,314,317,318,319,325,326,329,330,331,332,333,334,336,337,339,353,354,355,356,359,360,362,363,364,365,370,376,377,384,386,390,393,395,396,399,402,403,406,416,417,419,420,421,424,430,432,433,436,437,438,439,442,453,455,456,459,464,465,466,467,469,470,471,472,473,475,476,477,479,481,483,484,486,487,495,496,497,498,499],curv:[6,168,231,281],curvatur:[398,434,462],custom:[],cut0:467,cut1:478,cut2:478,cut:[],cuthi:[280,292],cutinn:[379,416,417],cutlo:[280,292],cutmax:430,cutoff1:[383,390,407,411,415,418,427,435],cutoff2:[378,380,381,383,389,390,407,411,415,418,427,435],cutoff:[3,6,10,16,18,39,45,46,54,55,61,70,72,73,77,87,92,108,110,117,118,142,166,169,171,216,217,222,280,289,290,292,294,296,299,314,327,331,335,337,353,355,356,363,366,367,368,370,371,372,373,374,375,376,377,378,379,380,381,382,383,385,387,388,389,390,391,392,393,394,395,396,397,398,400,401,402,403,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,432,433,434,435,440,441,442,443,444,445,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,467,471,474,478,490,495],cutoff_glob:376,cutoff_inn:376,cutoffa:394,cutoffc:394,cuu3:393,cval:167,cvd:321,cvel:303,cvff:[],cwiggl:[3,252,331,334,336,495],cyan:[2,193,194],cycl:[3,231,253,255,256,260],cyclic:[3,188],cygwin:12,cylind:[3,4,71,193,206,237,285,332,335,472],cylindr:[6,237,311,332],cypress:370,cyrot:377,cyrstal:281,d3q15:242,d3q19:242,d_double_doubl:15,d_e:326,d_flag2:288,d_flag:288,d_name:[115,191,288,316,479],d_single_doubl:15,d_single_singl:15,d_sx:288,d_sy:288,d_sz:288,daan:324,dai:12,daili:12,daivi:276,damag:[],dammak:294,damp:[3,6,197,202,239,240,241,246,255,256,260,286,289,294,299,317,318,330,332,333,362,363,365,378,380,382,387,390,395,399,407,415,427,435,450,456,483,490],damp_com:240,damp_drud:240,dampen:[299,490],dampflag:[332,399],dan:17,danger:[3,12,231,337,391,487],dangl:171,daniel:9,darden:[356,390],darkblu:194,darkcyan:194,darken:193,darkgoldenrod:194,darkgrai:194,darkgreen:194,darkkhaki:194,darkmagenta:194,darkolivegreen:194,darkorang:194,darkorchid:194,darkr:194,darksalmon:194,darkseagreen:194,darkslateblu:194,darkslategrai:194,darkturquois:194,darkviolet:194,dasgupta:290,dash:[399,486],dat:[6,91,188,203,465],data2xmovi:[],data:[],data_atom:8,data_atom_hybrid:8,data_bodi:8,data_vel:8,data_vel_hybrid:8,databas:[],datafil:[12,13,300],dataset:300,datatyp:3,date:[0,6,12,13,190,432,433,495],datom1:117,datom2:117,datom3:117,datom4:117,datum:[3,6,42,65,68,69,79,93,110,117,191,207],davenport:418,davi:331,david:[9,19,355,356,453,455],daw:[393,430],dbg:14,dcd:[3,6,7,191,192,193,194,195,282,470,474],ddim:190,deactiv:415,dealt:238,debug:[6,7,11,12,13,14,17,120,124,167,168,282,287,353,355,370,403,424,459,467,468,476,479,486,495],deby:[],decai:[92,387,462],decid:[3,6,12,16,71,252,288,299,327,484],decipher:358,declar:192,declin:314,decod:193,decompos:[87,441],decomposit:[3,5,7,18,62,203,282],decoupl:[6,490],decreas:[3,191,200,201,208,217,220,226,229,231,239,325,355],decrement:303,deepli:352,deeppink:194,deepskyblu:194,def:[12,13,467],defaul:61,defect:[6,70,166,422],defgrad:2,defin:[2,3,5,6,7,8,11,12,17,20,21,22,23,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,51,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,174,175,176,177,178,179,180,182,183,185,186,187,188,189,190,191,192,193,194,197,198,199,200,201,202,203,204,205,206,207,209,210,211,212,213,214,215,216,217,218,220,221,224,225,226,229,230,231,234,237,238,239,240,241,242,250,252,254,255,256,257,258,259,260,261,262,263,265,266,267,270,272,273,274,275,276,277,278,280,281,282,284,285,286,288,290,292,297,299,300,301,302,304,308,312,314,316,317,318,319,320,322,323,324,326,328,329,331,332,333,334,335,336,337,339,340,341,342,343,344,345,346,349,350,351,353,355,356,358,360,362,363,364,365,366,367,368,369,370,372,373,374,375,376,378,379,380,381,382,383,384,385,387,388,390,391,392,394,395,397,398,399,400,401,402,403,405,407,408,409,410,411,412,413,414,415,416,417,418,422,423,424,425,426,427,429,430,432,433,434,435,436,437,438,439,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,466,467,469,470,472,473,474,475,478,479,480,481,483,484,486,487,490,491,492,493,494,495,496],definit:[2,3,6,8,12,13,78,80,118,142,194,206,207,208,209,210,211,212,220,237,260,300,316,328,331,334,336,338,350,353,364,373,377,385,395,405,430,437,439,441,457,467,469,471,478,480,494,495],defint:487,deform:[],deg2theta:167,deg:490,degener:[3,284],degrad:[8,18,281,356,478],degre:[3,6,8,20,21,24,28,29,32,35,36,38,65,79,92,93,95,97,98,100,102,103,108,114,145,146,147,148,149,150,151,152,153,154,155,156,157,158,160,161,167,168,174,175,178,179,186,188,190,193,206,217,224,231,233,234,239,240,245,255,256,260,261,262,263,274,275,276,278,282,284,298,299,302,317,318,319,324,340,342,346,349,351,363,390,393,401,479,487,490,496],degress:[148,206],del:483,delai:[3,6,12,366,392,487],deleg:402,delet:[2,3,7,8,12,54,57,60,63,166,171,172,197,206,207,209,210,211,212,215,217,228,231,255,300,317,318,337,339,354,364,366,369,424,449,469,470,471,472,480,481,486,491,493,495,496],delete_atom:[],delete_bond:[],delete_el:203,deli:190,delimit:[467,495],deloc:[256,395,440],delr:419,delt_lo:483,delta:[],delta_1:377,delta_3:377,delta_7:377,delta_conf:3,delta_ij:[419,430],delta_mu:3,delta_pi:377,delta_r:430,delta_sigma:377,delta_ua:376,delx:190,delz:190,dem:376,demand:294,demo:11,demon:279,demonstr:[289,419],den:285,dendrim:401,denniston:[9,242,244,245,246,281],denomin:[7,173],denot:[120,224,240,281,292,294,387,400,402,433,437,439],dens:[71,217,395],densiti:[3,6,7,9,18,40,41,59,101,118,128,142,154,166,168,198,199,203,206,210,211,214,220,229,242,245,248,249,281,285,286,290,326,331,358,360,364,371,377,393,419,420,421,430,434,440,444,446,447,448,469,478,479,487,494],density_continu:439,density_summ:439,depart:[0,7],departur:[253,289],depend:[1,2,3,6,8,9,11,12,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,35,38,39,40,41,43,44,45,46,47,48,49,51,53,54,56,61,63,65,68,69,70,71,79,92,93,104,110,111,114,115,116,117,121,142,145,151,155,156,162,168,169,174,175,176,177,178,179,180,182,183,185,186,187,188,190,191,193,194,197,198,199,200,201,204,206,208,209,210,212,213,214,216,218,220,226,227,230,233,234,235,237,239,240,242,244,245,252,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,280,291,294,296,299,301,302,308,314,317,318,319,321,323,325,326,328,330,331,334,335,336,337,339,340,341,342,343,345,346,349,351,356,358,363,364,366,367,368,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,390,391,393,394,395,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,419,420,422,423,425,426,427,429,430,432,433,434,435,440,441,442,450,451,452,453,454,455,456,457,458,460,461,462,464,466,469,471,472,475,479,481,483,486,487,489,495,496],dependend:6,depflag:12,dephas:[464,483],depos:221,deposit:[],deprec:[290,432],depth:[51,146,193,326,398,434],dequidt:9,der:[87,109,385,386,415,432,433,461,490],deriv:[6,7,8,9,38,56,63,87,142,162,188,207,218,220,231,239,252,255,257,258,259,260,261,262,263,280,286,290,294,323,324,326,331,332,335,362,364,372,377,385,390,395,396,400,409,413,414,419,422,432,433,450,452,461,490],derjagin:461,derlet:280,descend:194,descent:[7,362],descib:[40,193,290],describ:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,38,39,40,41,42,56,62,63,68,70,71,73,88,112,115,118,120,132,142,143,146,147,148,152,153,156,159,161,162,166,167,168,170,171,180,185,188,191,192,197,198,199,206,207,208,209,210,211,212,214,217,218,219,220,221,223,224,232,233,236,237,238,239,240,241,242,244,245,246,250,254,255,256,260,268,277,280,282,287,288,289,290,291,292,299,303,311,314,315,316,317,318,319,320,321,322,323,324,329,331,332,334,339,355,356,358,361,362,363,364,365,369,372,373,375,376,378,379,380,382,383,384,385,386,387,390,393,395,396,398,399,400,402,407,408,409,410,411,412,413,414,415,416,417,418,419,422,423,429,430,431,432,433,434,435,440,441,442,449,450,451,452,453,454,455,456,458,460,461,462,464,466,467,469,470,471,472,473,479,482,483,486,495,496,497],descript:[],descriptor:[142,191,403],deserno:356,design:[0,3,6,7,8,9,11,13,14,15,17,120,150,153,167,203,217,223,224,255,256,280,281,300,321,326,373,374,375,376,379,382,387,389,395,415,416,417,420,421,430,433,452,478],desir:[2,3,6,7,11,12,14,15,16,33,40,50,59,71,88,91,114,119,143,150,168,181,190,206,212,218,220,229,231,232,239,240,241,245,255,276,284,285,286,287,290,294,299,302,314,317,318,319,320,325,332,347,352,355,356,358,361,363,364,365,391,393,401,416,417,451,453,455,465,466,467,469,473,478,483,484,486,487,495,496,497],desk:7,desktop:[4,6,7,10,12,193],despit:490,destabil:377,destre:349,destroi:[11,39,215,216],detail:[1,2,3,4,6,7,8,9,11,12,13,14,15,16,17,18,19,22,37,40,41,42,55,63,66,67,68,71,75,78,90,91,94,103,105,107,109,111,113,114,116,119,121,142,143,145,146,147,148,151,161,162,163,165,168,169,172,173,176,187,190,191,193,194,197,198,199,203,206,207,208,209,210,212,214,216,217,218,219,220,221,229,231,232,233,234,236,237,239,241,242,246,252,253,254,255,256,257,258,259,260,261,262,263,267,269,274,275,276,277,278,281,284,285,286,288,289,291,292,293,299,302,314,317,318,319,320,321,322,324,325,326,327,328,329,330,337,339,341,350,355,356,359,363,364,366,367,370,371,372,373,375,376,377,379,381,382,383,384,385,386,387,390,391,395,396,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,417,418,419,423,424,429,432,433,434,440,441,442,450,457,460,461,467,469,470,471,472,474,475,478,479,481,484,487,488,495,496,499],detect:[2,3,12,42,61,63,86,92,230,285,325,365,386,401,406,464,466,469,480,483,495],determ:370,determin:[1,3,6,8,9,12,15,39,40,42,51,57,58,59,61,62,68,71,87,103,109,111,114,120,121,129,143,156,157,166,167,168,190,191,193,194,195,196,200,201,202,205,206,207,208,209,210,211,212,213,214,218,220,221,224,226,231,234,235,237,239,240,245,250,252,253,255,261,262,263,274,275,276,278,280,282,286,289,296,297,298,299,300,301,304,306,308,314,317,318,319,321,327,328,331,332,333,334,335,336,337,350,355,356,358,364,366,367,370,372,373,381,386,390,392,393,397,399,402,403,411,419,422,424,433,434,440,449,452,456,461,466,469,470,472,474,476,479,483,485,486,488,494,495,496],detil:110,devan:[9,435],devanathan:455,develop:[0,3,5,6,7,8,9,11,12,14,15,16,17,18,19,42,236,260,284,289,290,293,372,377,395,421,422,440,458,471],devemi:9,deviat:[253,260,280,397],deviator:9,devic:[1,3,12,15,17,236,370],device_typ:370,devin:[291,386],devis:421,dfactor:193,dff:490,dfft_fftw2:12,dfft_fftw3:12,dfft_fftw:12,dfft_none:12,dfft_singl:[3,12,356],dfft_xxx:12,dfftw:12,dfftw_size:12,dft:[9,293,422],dhi:[59,190,220,285],dhug:[253,289],dhugoniot:[253,289],dia:419,diagnost:[],diagon:[3,6,83,142,143,144,218,255,286,299,329,437,439],diagonalstyl:441,diagram:[41,120,167,187,214,282],diallo:401,diam:[193,194,285,364],diamet:[3,6,40,42,115,168,191,193,194,198,199,239,285,299,314,330,332,364,376,385,398,399,405,409,434,457,461,469,470,479],diamond:[358,395,419],diamter:[40,285],dick:6,dicsuss:252,dictat:[204,253],did:[3,12,363,391,392,393,399,424,453,455,477],didn:3,die:18,diel:[],dielectr:[],diff:[3,6,12,164,328,355],differ:[1,2,3,4,6,7,8,9,10,11,12,14,15,16,17,18,22,37,38,39,41,42,54,55,56,61,64,68,70,71,87,92,95,97,98,122,142,145,146,147,148,149,151,154,155,156,157,158,160,161,162,168,169,171,176,187,188,190,191,193,194,197,199,202,204,206,209,214,215,216,217,218,219,220,224,230,231,232,233,234,235,236,239,240,242,252,255,256,257,258,259,261,262,263,265,267,270,272,273,274,275,278,280,282,284,286,289,290,291,294,297,299,302,303,311,312,314,317,318,319,322,323,324,326,329,330,331,332,335,339,340,350,352,354,355,356,358,359,361,362,364,365,367,368,369,370,371,372,377,381,382,384,385,386,391,393,395,398,399,400,402,405,407,408,410,411,418,419,420,421,423,424,426,430,432,433,434,435,436,437,439,440,441,442,450,451,452,453,455,457,458,461,463,464,466,467,469,471,472,473,474,477,478,479,481,483,484,486,487,488,490,494,495,496,497],differenti:[1,3,6,29,188,355,387,430,454],difficult:[218,282,370,401,478],difficulti:[92,108,302,432],diffract:[],diffus:[],digit:[2,3,194,339,422],dih_table1:188,dih_table2:188,dihedr:[],dihedral_coeff:[],dihedral_cosineshift:27,dihedral_styl:[],dihedralcoeff:3,dihedraltyp:216,dihydrid:395,dij:302,dilat:[],dim1:3,dim2:3,dim:[3,59,71,145,149,150,151,154,155,156,157,158,160,168,190,210,220,237,332,358,419,472,494,495,496],dimdim:495,dimems:281,dimens:[],dimensinon:71,dimension:[3,39,92,114,120,142,145,148,149,150,151,154,155,156,157,158,160,167,189,206,210,254,281,326,358,361,365,430,469,479],dimensionless:[106,123,124,126,129,131,133,138,142,326,356,441,461],dimentionless:137,dimer:[6,299,419],dimgrai:194,dimstr:[41,214],dinola:[286,317],dintel_offload_noaffin:16,dipol:[],dipolar:[4,29,40,191,316,490],dir1:480,dir2:480,dir:[1,3,4,8,9,11,12,253,280,289,313,430,432,433,467,480,495],dirac:142,direc:430,direct:[],directli:[3,6,8,9,11,12,87,115,142,144,191,192,193,200,226,233,237,242,281,300,318,330,332,333,334,335,358,362,370,371,372,378,380,381,387,390,393,395,407,411,424,427,435,449,467,479,480,481,487,495],directoi:14,directori:[0,1,2,3,4,6,7,8,9,11,12,13,14,15,16,17,60,195,219,238,284,290,293,310,314,323,324,365,369,371,372,377,384,386,387,393,394,396,403,404,415,419,420,421,422,426,430,431,432,433,440,441,451,453,454,455,458,467,469,470,471,480,495],disabl:[3,12,16,326,406,467,482,495],disadvantag:[6,214],disallow:[191,220,255],disappear:471,discard:[2,3,41,71,208,210,214,327,335,466,471,472],discontinu:[9,188,363,413],discourag:419,discov:[13,327],discret:[6,8,40,42,193,194,239,242,376],discuss:[],disk:[6,84,85,92,161,189,221,231,285,467],disloc:[70,422],disord:[39,70,422],disp:[],dispar:434,disperion:[390,411],dispers:[3,6,7,9,166,281,355,356,381,390,411,416,424,433,452,458],displac:[],displace_atom:[],displace_box:59,displacemet:472,displai:[11,13,22,37,44,55,176,187,191,193,341,350,384,450],dispters:3,disregard:422,dissip:[6,232,239,281,323,324,379,391,399,416,417,450],dissolut:215,dist:[6,69,91,110,119,191,282,298,392,449,464,496],distanc:[],distinct:[6,224,296,355,434],distinguish:[6,86,142,245,376,395,468],distort:371,distrbut:371,distribut:[],distro:[113,384,429,430],ditto:[8,12,14,15,16,17,18,42,117,216,462,467],div:8,divd:119,diverg:[3,12,39,299,324,471,490,497],divid:[3,6,16,41,91,114,119,128,130,143,165,166,176,187,194,206,207,209,214,220,280,322,329,334,355,363,365,396,433,440,458,478,486,495],divis:[6,242,377,405,415,466,487,495],dl_poli:[6,7],dlambda:162,dlammps_async_imd:236,dlammps_bigbig:[12,39],dlammps_ffmpeg:[3,12,193],dlammps_gzip:[3,12,191,193,325,469,470,474],dlammps_jpeg:[3,12,193],dlammps_longlong_to_long:12,dlammps_memalign:[12,16],dlammps_png:[3,12,193],dlammps_smallbig:12,dlammps_smallsmal:12,dlammps_xdr:[12,191],dlen:479,dlmp_intel_offload:[12,16],dlo:[59,190,220,285],dlopen:6,dlvo:[7,385,461],dm_lb:242,dmax:[314,361],dna:7,doc:[0,1,2,3,4,6,7,8,9,11,12,13,14,15,16,17,18,22,37,40,42,55,57,59,63,66,68,75,87,90,94,103,105,106,107,109,111,113,114,116,119,121,143,146,147,148,161,163,165,168,169,170,176,187,190,191,192,193,194,195,197,198,199,204,205,206,207,208,209,210,211,212,221,231,239,240,250,255,256,261,262,263,267,274,275,276,277,278,285,288,299,311,314,317,318,319,328,332,335,337,339,341,350,354,363,364,365,370,371,372,375,376,384,386,387,393,394,396,401,402,404,405,419,420,421,424,426,429,430,431,441,450,451,453,455,457,458,467,469,470,471,472,474,477,478,479,486,487,495,496,497,498],docuement:434,dodd:[42,376],dodgerblu:194,doe:[0,1,2,3,5,6,7,8,9,11,12,14,15,16,17,18,33,38,39,41,42,50,54,56,59,62,63,67,70,71,72,87,88,91,105,112,118,119,120,144,146,148,150,151,156,158,162,167,168,169,170,172,174,176,181,187,188,190,191,192,193,194,197,203,204,206,210,213,214,216,217,218,220,224,226,228,231,232,235,237,239,240,242,245,251,255,256,257,258,259,261,262,263,274,275,276,277,278,286,287,288,292,294,297,299,314,317,319,321,322,326,329,330,331,334,335,336,337,342,343,344,346,347,349,354,355,356,357,358,364,365,366,371,372,373,374,375,376,377,379,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,402,403,404,405,406,409,410,412,413,414,416,417,419,420,421,422,424,430,431,432,433,434,436,437,438,439,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,456,457,458,460,461,462,464,465,466,467,469,470,471,472,473,476,477,479,480,481,482,483,486,487,490,495,499],doegenomestolif:7,doesn:[3,7,8,12,168,191,204,210,211,311,364,366,370,372,386,394,404,432,433,451,453,454,455,458,469,471],dof:[3,8,114,146,147,148,161,206,299,496],dof_per_atom:[148,206],dof_per_chunk:[148,206],doff:[364,469],doi:[6,219],domain:[3,6,7,12,13,18,39,41,42,58,61,62,71,120,157,167,170,190,192,193,194,197,204,214,218,220,221,235,238,242,255,256,282,294,299,326,331,332,355,356,365,370,392,424,464,466,469,473,486],domin:[1,395,483],don:[0,8,11,12,13,118,171,200,226,240,288,335,419,440,467,469],donadio:318,done:[1,3,6,7,8,12,14,15,16,17,18,38,39,41,56,59,62,71,162,165,168,171,188,191,193,194,203,204,206,208,209,210,211,212,214,215,216,217,218,220,221,229,231,236,237,239,240,247,255,261,262,263,274,275,276,278,279,281,282,283,288,296,299,300,302,314,317,318,319,321,323,324,337,339,354,355,356,363,365,366,369,370,372,381,393,402,403,404,411,417,418,419,424,432,449,452,457,464,465,466,467,470,473,474,477,487,488,490,495,496],donor:401,dot:[143,164,200,226,234,254],doti:[377,430],doubl:[1,2,3,6,8,9,11,12,14,15,16,17,39,87,220,229,287,335,339,354,356,369,370,377,396,400,422,432,433,465,469,473,477,482,495,496],dover:203,down:[3,6,7,8,11,39,71,218,231,239,314,330,370,395,424,440,468,488],downhil:[361,362],download:[5,7,8,9,11,12,13,17,236,403,431],downsid:6,downward:296,dozen:[8,12,109,197,432,433],dpack_arrai:12,dpack_memcpi:12,dpack_point:12,dpd:[],dpde:248,dproduct:373,dr_ewald:[120,300],drag:[],dragforc:242,drai:[253,289],drain:[235,330,363],dramat:[59,190,215,216,217,218,220,255,314,317,318,356,370,424,440,466],drautz:377,draw:193,drawback:288,drawn:[42,191,193,194,232,464],drayleigh:[253,289],dreid:[],drfourth:106,drho:[115,371,393],drift:[6,104,106,232,233,239,240,251,297,314,478,486,490],drive:[11,12,201,218,220,234,255,280,286,299,333,365],driven:[6,180],driver:[6,12,14,15,197,229,236],drop:[3,194,391],droplet:402,drsquar:106,drude:[],dry:228,dsecriptor:403,dsf:[],dsmc:[],dstyle:285,dt_collis:242,dt_lb:242,dt_md:242,dt_srd:314,dtilt:[59,220],dtneb:483,dtqm:289,dtype:[117,216],dual:[16,17,314,370],dudarev:167,due:[1,3,6,9,10,12,16,17,19,40,54,57,58,61,66,70,71,74,75,81,86,88,89,90,94,103,104,105,106,107,112,118,120,128,142,143,145,146,147,149,151,154,155,156,157,158,160,161,163,167,168,171,172,191,193,197,200,201,209,213,215,216,217,218,219,220,221,226,227,228,229,232,233,236,237,239,240,241,242,245,246,247,251,252,253,254,255,260,269,280,283,285,297,298,299,301,311,313,314,315,317,318,319,320,321,323,324,326,330,331,333,334,335,337,356,361,363,365,366,367,388,391,393,397,398,402,416,417,424,430,432,434,435,449,452,453,455,459,461,462,464,466,469,470,471,478,483,486,487,488,490,495,496],duffi:326,duin:[9,290,295,432,433],duke:356,dummi:[12,29,454],dump1:474,dump2:474,dump2vtk_tri:136,dump:[],dump_atom:8,dump_custom:8,dump_h5md:192,dump_modifi:[],dumpcustom:8,dumptimestep:474,dunbrack:[6,20,174,382,481],dunweg:[239,241],duplic:[2,3,14,15,17,41,42,169,214,233,280,469,494],dupont:[5,7,13],durat:[37,55,145,146,147,149,150,151,153,154,155,156,157,160,161,187,194,206,231,294,326,350,399,450],dure:[2,3,6,8,9,12,16,17,38,39,41,56,71,87,128,130,144,150,169,172,188,191,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,222,225,226,227,228,229,230,231,232,233,234,235,236,237,239,240,241,242,243,244,245,246,247,248,249,251,252,254,255,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,307,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,356,363,365,369,370,391,415,422,424,433,452,464,465,467,469,472,474,476,477,479,481,483,484,487,488,495,498,499],dvector:8,dvlo:461,dvx:6,dx_lb:242,dy3:167,dyamic:12,dyanam:6,dyanmic:483,dynam:[],dynamo:[5,371,393,419],dyne:494,dyre:412,dysam:472,e28637:29,e_1:377,e_2:377,e_b:396,e_e:395,e_hbond:401,e_i:[6,377,396],e_j:[6,377],e_k:[377,395],e_kl:6,e_lj:[372,390],e_n:[377,395],e_nn:395,e_pr:395,e_rebo:372,e_tors:372,e_tot:422,e_vol:422,eaa:340,eaat:175,each:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,53,54,55,56,57,59,61,62,63,64,66,67,68,70,71,72,73,74,75,76,77,78,80,81,83,85,87,89,90,92,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,111,112,113,114,115,116,117,118,119,120,121,122,136,142,143,144,146,147,148,149,150,151,152,155,156,157,158,160,161,162,163,164,165,166,167,168,171,172,174,175,176,177,178,179,180,181,182,183,185,186,187,188,190,191,192,193,194,195,196,197,198,199,200,201,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,231,232,233,234,235,236,237,238,239,240,241,242,243,245,246,247,248,249,251,252,253,254,255,257,258,259,260,261,262,263,264,265,266,267,269,270,271,272,273,274,275,276,277,278,280,281,282,283,284,285,286,287,288,290,291,292,294,296,299,300,301,302,303,307,308,310,311,312,313,314,315,316,317,318,319,321,324,325,326,327,328,329,330,331,332,334,335,336,337,339,340,342,343,344,345,346,347,349,350,351,354,355,356,358,362,363,364,365,366,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,395,396,397,398,399,400,401,402,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,423,424,425,426,427,429,430,432,433,434,435,436,440,441,442,443,444,445,446,447,448,449,450,451,452,455,456,457,458,459,460,461,462,463,464,466,467,469,470,471,472,473,474,476,477,478,479,481,483,484,486,487,488,489,490,494,495,496,497,499],eacn:[41,214],eam0d:281,eam3d:281,eam:[],eam_databas:13,eam_gener:13,eangl:487,earli:[41,206,209,210,211,212,214,293,300],earlier:[7,8,12,59,194,365,399,419,424,483],earliest:483,earth:395,easi:[6,7,8,9,11,13,87,143,191,198,199,200,201,210,213,226,234,235,237,239,240,301,308,317,318,319,331,334,336,364,469,472,477,479,496],easier:[8,9,13,16,191,193,281],easili:[8,11,193,194,330,365,466,476,485,495],eastwood:[355,356],eat:175,eatom:337,eaxmpl:6,eba:21,ebb13:175,ebb:21,ebond:[224,240,486,487],ebt:175,ec_ii:419,ec_ij:419,ec_jj:419,echo:[],eco:[432,433],ecoa:[432,433],ecoul:[109,224,240,432,433,487],ecp:[395,469],edg:[2,3,6,41,42,59,71,120,166,167,170,171,192,193,202,210,237,301,331,334,335,336,337,358,376,469,472,479],edge_histo:166,edge_threshold:166,edih:487,edim:322,edip:[],edit:[3,8,12,13,14,15,16,17,18,19,490],editor:13,edu:[7,9,11,13,393,416,429,432,433],edward:[9,17],eebt:175,eff:[],effect:[1,2,3,6,8,9,11,12,14,15,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,43,45,46,47,48,49,51,53,54,56,66,71,74,75,81,89,90,94,104,105,106,107,111,114,143,145,150,155,156,163,166,172,174,175,177,178,179,180,182,183,185,186,187,188,190,191,193,194,198,199,200,203,204,207,211,212,213,215,216,217,218,220,221,227,230,231,232,233,234,235,236,237,239,240,254,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,279,280,282,285,286,288,289,290,291,294,298,299,301,302,313,314,317,318,319,321,322,324,326,329,330,331,332,333,334,335,336,337,340,342,343,345,346,349,351,355,356,358,362,363,364,365,366,371,372,374,377,378,379,380,381,382,383,385,386,387,390,391,393,394,395,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,420,422,424,425,426,427,429,434,435,436,438,440,442,450,451,452,453,454,455,457,458,460,461,462,464,466,467,471,472,474,478,479,481,487,488,494,495,497],efffect:473,efficaci:39,effici:[0,1,3,6,7,8,10,12,15,17,18,39,58,61,67,114,144,191,192,193,194,207,208,218,220,224,233,255,282,284,294,299,302,314,355,356,361,366,370,377,385,387,402,407,411,422,434,476,499],effort:[5,7,470],efftemp:[97,98,154],efi:[432,433],efield:[],eflux:235,eggebrecht:[387,440],ehb:[432,433],eigensolv:3,eigenvalu:[281,282,355],eigtol:3,eik:162,eim:[],eimp:487,einstein:[294,324],either:[1,2,3,4,6,8,9,11,12,14,15,16,17,22,33,41,44,50,59,63,71,104,109,115,118,120,142,143,148,150,151,167,168,171,176,181,188,191,192,193,194,197,205,207,209,211,212,214,217,218,219,220,221,231,237,238,242,246,252,253,255,256,260,276,280,296,299,301,302,303,311,314,321,328,332,335,339,341,353,355,356,358,362,363,367,370,377,379,385,393,402,403,405,416,417,419,422,424,428,430,449,453,455,457,464,467,469,471,472,473,476,478,481,484,486,495],ejtehadi:[385,398,434],elaplong:[198,199,237,472,487,495],elaps:[3,190,198,199,200,201,213,220,226,234,235,237,239,240,252,285,301,308,317,318,319,331,332,334,336,442,464,472,474,475,479,483,487,495],elast:[],elastic_t:4,elba:29,electr:[6,197,203,226,240,355,356,396,432,433,462,490,494],electrolyt:[9,461],electron:[3,6,7,9,13,40,97,98,115,120,152,154,159,197,203,223,224,240,241,256,268,277,292,320,326,362,364,371,373,386,390,393,395,396,419,422,430,431,440,455,458,462,469,489,490,494],electron_integr:203,electron_temperatur:203,electron_unit:395,electroneg:[6,290,291,292,386,396,440],electroneg_compon:440,electronic_dens:3,electronic_specific_heat:3,electronic_thermal_conduct:3,electrostat:[6,9,16,18,204,231,290,292,293,327,355,356,385,390,395,407,415,417,433,440,461],eleftheri:299,elem1:[396,419,441],elem2:[396,419,441],elem:440,element1:[296,371,393,440],element2:[296,371,393,440],element:[3,6,7,8,12,13,42,63,81,89,104,106,114,119,121,136,142,143,144,145,146,147,148,149,150,151,155,156,157,158,160,161,164,191,192,193,194,195,197,203,207,209,212,281,296,321,328,371,372,376,377,386,393,394,395,396,402,403,404,419,420,421,422,426,430,431,432,433,440,441,451,453,454,455,458,490,495,498],elementn:[371,393],elementset:203,elev:483,elif:[142,339],elig:[3,204,215,216,228,231,401],elimin:[3,6,71,232,239,240,299,302,323,324,464],elj:390,ellad:9,elliot:9,elliott:9,ellips:[4,6,9,71,82,146,189],ellipsoid:[3,4,6,7,13,40,42,71,82,115,132,146,168,189,191,239,257,261,265,266,274,299,314,360,363,398,417,434,450,469,479,497],ellipsoidflag:469,elong:[224,240,487],elp:[432,433],els:[3,7,8,12,71,109,118,119,121,192,193,205,206,207,209,210,211,212,231,255,299,314,326,327,328,337,339,355,402,468,480,495,498],elsewher:[8,252,314,419,431,432,433,481,487,495],elt:419,emac:[],email:[0,3,5,7,8,9,11,396],emb:[3,9,335],emb_lin_neg:419,embed:[3,5,7,11,12,13,29,88,144,166,326,371,393,396,415,419,420,421,430,450,459,467],embt:175,emi:[7,9],emil:9,emol:[432,433,487],emphas:399,empir:[203,318,372,395],emploi:[9,281,294,454],empti:[3,57,71,170,299,355,366,406,469,480,481,495],enabl:[3,6,8,9,11,12,13,14,15,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,33,35,37,38,39,40,43,45,46,47,48,49,50,51,53,54,55,56,60,61,62,64,67,78,80,83,87,97,98,99,100,101,102,106,111,113,114,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,144,145,146,147,150,152,154,155,159,160,162,166,174,175,177,178,179,180,181,182,183,185,186,187,188,191,192,194,195,197,198,199,200,201,202,204,208,211,213,215,216,217,219,220,221,226,227,228,229,230,231,232,233,234,236,237,238,239,240,241,242,243,244,245,246,248,249,251,253,255,256,257,258,259,260,261,262,263,264,265,266,267,268,270,272,273,274,275,276,277,278,280,281,282,284,285,289,290,291,292,293,294,295,296,298,299,301,302,303,304,305,306,307,308,310,311,313,314,317,319,320,321,322,323,324,326,327,329,330,331,332,333,334,335,338,340,342,343,345,346,347,349,350,351,356,363,365,369,370,371,372,374,375,376,377,378,379,380,381,382,383,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,419,420,421,422,424,425,426,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462,467,470,471,472,476,478,488,495,499],enclos:[2,6,12,170,191,287,339,419,440,465,467,477,495],encod:[13,39,42,191,193,194,288,402],encompass:[3,6,40,42,57,59,118,169,310,328,450,472],encount:[3,8,12,59,108,209,369,474,495],encourag:[7,8,293,312],end12i:115,end12x:115,end12z:115,end1i:115,end1x:115,end1z:115,end2i:115,end2x:115,end2z:115,end:[1,2,3,5,6,8,11,12,15,16,17,18,19,38,40,41,42,57,59,71,115,171,172,175,190,191,193,194,195,198,199,207,209,211,212,217,220,232,237,239,241,254,255,256,269,286,298,299,303,314,317,318,319,320,322,325,326,329,333,336,337,354,355,364,365,369,370,391,393,398,418,422,434,437,439,441,442,459,464,467,469,470,471,472,474,476,477,481,485,487,490,495,499],end_of_step:8,endbondtors:[3,175,181,469],endif:8,energet:[217,372,433],energi:[0,1,2,3,4,5,6,7,8,9,12,13,20,21,23,24,25,26,27,28,29,30,31,32,35,36,38,40,43,45,46,47,48,49,51,53,54,56,63,65,69,82,83,84,85,86,87,88,91,95,96,97,98,99,100,102,103,109,110,111,112,114,125,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,168,172,174,175,176,177,178,179,180,182,183,185,186,187,188,191,194,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,340,342,343,344,345,346,349,351,355,356,361,362,363,365,366,370,371,372,374,375,376,377,378,379,380,381,382,383,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,429,430,432,433,434,435,440,441,442,443,444,449,450,451,452,453,454,455,457,458,459,460,461,462,464,467,469,474,478,479,481,483,485,486,487,490,494,495,498],energy_compon:440,energy_update_freq:433,enforc:[6,57,58,105,190,191,192,193,195,197,204,217,220,255,279,281,291,299,302,339,355,407,466,495,496],enforce2d:[],eng:[11,65,69,110,191,229,337,339,386,421],eng_previ:339,engin:[203,220,284,303,323,393,420],engr:[432,433],enhanc:[199,203,464],enlarg:[59,193],enough:[3,40,61,86,168,169,171,214,240,285,289,294,299,327,331,332,335,366,370,387,428,469,473,474],enpub:393,enrti:[],ensembl:[],ensight:6,ensur:[3,6,142,191,204,208,218,231,232,255,304,325,356,377,392,415,451,458],enter:[57,158,396,422,458,483],enthalpi:[125,257,258,259,393,486,487,495],entir:[0,2,3,6,11,14,15,41,42,63,88,111,112,114,118,120,143,148,167,168,194,197,198,199,206,210,211,214,217,219,228,231,232,235,239,240,251,255,257,258,259,260,261,262,263,280,282,284,297,299,312,326,328,339,370,390,411,424,452,469,477,478],entireti:[405,457],entiti:[6,8,40,42,191,299],entri:[3,8,12,38,42,56,65,69,79,93,110,117,120,129,132,133,134,135,136,138,139,140,166,188,194,209,210,211,219,289,337,364,377,394,419,426,433,441,451,452,453,454,455,458,495],entropi:483,entry1:[38,56,194,384,452],entry2:194,entryn:194,enumer:[169,191],enumuer:6,env:370,environ:[1,3,6,11,12,16,17,18,193,233,238,280,370,371,377,384,386,394,395,430,453,466,480,495],epair:[109,194,397,401,432,433,487],epen:[432,433],epfl:[233,238],epp:390,epq:390,eps0:461,eps14:415,epsilon0:455,epsilon:[3,6,36,45,46,50,53,54,87,174,198,199,231,299,314,331,335,361,363,375,376,382,383,385,387,388,389,390,398,400,401,402,405,406,407,408,409,410,411,412,413,414,415,418,423,427,434,435,445,451,457,460,461,478,490,494],epsilon_0:462,epsilon_14:382,epsilon_:434,epsilon_d:388,epsilon_i:[398,424,434],epsilon_i_:434,epsilon_i_a:[398,434],epsilon_i_b:[398,434],epsilon_i_c:[398,434],epsilon_ij:424,epsilon_j:[398,424,434],epsilon_j_:434,epsilon_j_a:[398,434],epsilon_j_b:[398,434],epsilon_j_c:[398,434],epsilon_lj:434,epton:429,eqch:163,eqeq:[432,433],eqp:390,eqq:390,equal:[2,3,6,8,11,12,17,39,41,54,63,65,68,69,71,76,79,86,87,91,93,110,112,117,119,121,143,146,162,164,168,190,193,194,197,198,199,200,201,204,207,208,209,212,213,214,218,220,221,226,231,232,234,235,237,239,240,242,245,246,252,253,260,271,280,282,285,287,289,290,291,294,296,298,299,301,303,308,310,317,318,319,322,323,324,326,328,329,331,334,336,337,339,354,358,363,365,366,367,369,370,386,391,397,398,401,416,422,423,430,432,433,434,436,437,438,440,441,442,452,457,458,462,465,466,467,469,471,472,476,477,480,483,485,487,495,496],equat:[3,6,7,8,9,91,108,114,120,167,176,187,197,218,224,225,233,239,240,242,245,253,254,255,256,260,276,280,282,289,290,294,302,314,322,326,329,331,332,334,336,349,355,356,385,390,391,395,396,399,404,416,417,419,424,434,437,439,444,445,447,448,462,490],equi:256,equidist:254,equil:[3,290,359,476,499],equilater:479,equilibr:[3,4,5,6,7,9,59,91,168,197,204,207,217,218,231,253,255,256,276,277,289,290,291,292,322,323,324,329,386,387,432,433,465,479],equilibria:329,equilibribum:[215,216],equilibrium:[1,3,4,6,7,21,24,26,27,28,29,32,35,36,38,43,47,48,49,51,53,56,59,151,152,175,177,218,220,231,232,233,240,242,255,260,276,289,294,298,302,303,311,314,321,322,324,329,340,342,346,349,386,419,426,440,490],equilibrium_angl:8,equilibrium_dist:8,equilibrium_start:203,equival:[6,12,13,29,59,61,126,127,135,140,166,170,194,209,212,218,220,231,239,255,276,286,298,299,334,391,395,440,453,455,469,472,477,478,487,490],equlibrium:6,equliibr:[290,292],er3:167,eradiu:[40,115,395,469],eras:[301,323],erat:[220,417],erc:387,erfc:[387,407,424],erforc:115,erg:494,erhart:[204,393,453,455],ermscal:373,ernst:9,eror:3,eros:419,erose_form:419,erot:[],errata:[453,455],erratum:331,erron:3,error:[],erta:399,ervel:[115,469],escap:[221,490],especi:[8,11,16,156,168,197,204,214,231,289,294,297,298,370,466],espresso:[9,293],essenti:[8,11,12,27,88,130,149,150,151,154,155,156,157,158,160,177,207,260,281,330,356,372,387,407,455,474,487],essex:29,establish:[87,235],estim:[1,3,6,10,12,38,41,56,91,143,203,214,225,253,314,321,355,356,361,424,433,452,483,487],esu:494,esub:419,eta:[6,242,255,289,290,292,330,394,396,398,430,454,458,494],eta_dot:255,eta_ij:430,eta_ji:396,etag:[40,469],etail:487,etap:255,etap_dot:255,etc:[1,2,3,6,7,8,9,10,11,12,13,15,16,39,40,42,54,61,68,89,90,91,95,111,112,115,117,143,145,148,149,150,151,152,154,155,156,157,158,160,162,168,170,171,172,181,191,193,194,197,198,203,204,205,206,209,210,211,212,215,216,220,221,229,231,232,239,255,285,296,300,326,327,335,339,354,355,363,364,365,366,368,393,394,402,415,417,422,428,432,433,451,453,455,458,464,467,469,470,471,476,478,479,483,485,486,487,488,490,494,495,497,499],ethernet:18,etol:[363,365,464,483],etot0:289,etot:[6,95,97,98,112,143,154,194,224,240,253,289,486,487],eu2:167,eu3:167,euler:[363,365],eulerian:203,euqat:443,europhi:242,ev_tal:8,evalu:[2,3,9,11,12,38,56,71,87,88,91,109,119,142,144,148,158,166,168,190,191,193,194,198,199,200,201,203,205,206,207,208,209,210,211,212,213,220,226,232,234,235,237,238,239,240,281,287,290,301,304,308,317,318,319,328,331,334,336,337,339,355,356,361,363,370,422,424,430,436,438,440,452,464,465,467,471,472,474,476,477,478,479,483,485,487,495,496],evalut:[339,467],evan:[156,276],evanseck:[6,20,174,382,481],evapor:[],evaul:[8,363],evdwl:[109,432,433,487],even:[3,6,8,12,15,17,18,34,39,41,52,57,59,61,63,70,71,121,169,170,184,188,191,194,197,198,199,204,205,206,209,210,211,212,214,215,216,218,220,221,224,237,240,253,255,256,281,294,296,299,300,310,314,322,326,329,331,335,337,348,355,361,363,365,370,375,395,396,399,402,424,434,458,459,469,470,472,474,475,476,478,479,481,484,486,487,488,490,499],evenli:[3,41,143,188,214,242,405,459],event:[],eventu:[3,6,12,15,170,290,483],ever:[54,56,238,314],evera:[385,398,434,450],everi:[0,1,2,3,6,8,9,11,12,15,16,39,41,71,72,91,115,121,130,156,171,191,192,193,194,195,197,198,199,200,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,225,228,229,231,233,235,236,237,242,243,251,255,256,260,279,280,281,285,286,287,288,289,290,291,292,294,296,297,299,300,302,303,314,316,317,318,319,320,321,322,325,326,327,328,329,337,339,354,356,365,366,367,370,391,392,402,415,432,433,440,446,463,464,465,469,471,473,474,476,477,478,483,484,485,487,495,499],everyth:[8,109],everywher:[118,409],eviri:395,evolut:[233,242,282,464],evolv:[242,282,327],ewald:[2,3,5,6,7,8,12,88,112,120,143,327,355,356,363,378,380,381,387,390,395,407,411,427,435,450,452],ewald_disp:390,ewalddisp:3,exact:[22,41,44,71,124,162,171,176,214,217,232,233,239,240,241,285,294,295,314,326,341,355,384,471,476,483,495,497,499],exactli:[3,6,12,14,17,38,41,42,56,59,71,72,91,118,146,152,159,168,188,198,199,209,214,220,225,232,239,240,241,256,268,269,277,281,289,314,319,320,333,370,384,391,393,399,402,405,416,424,452,471,472,479,483,495],exager:490,examin:[6,8,9,17,217,281],examp:[467,495],exampl:[],exce:[3,6,16,17,18,41,58,71,170,205,206,209,210,211,212,214,218,220,225,228,255,281,296,300,305,306,314,363,370,469,495],exceed:[3,41,59,214,220,255,314,477],excel:395,except:[1,2,5,6,8,9,11,14,20,21,22,23,24,25,26,27,28,29,30,31,32,35,37,38,40,41,43,44,45,46,47,48,49,51,53,54,55,56,59,60,71,89,90,110,111,114,119,143,145,146,147,148,149,150,151,152,154,155,156,157,158,159,160,161,168,172,174,175,176,177,178,179,180,182,183,185,186,187,188,190,191,194,197,200,206,207,209,213,214,218,220,227,230,231,234,237,239,241,255,256,257,258,259,260,261,262,263,264,265,268,269,272,274,275,276,277,278,282,291,292,299,301,302,311,314,317,319,320,326,330,334,337,339,340,341,342,343,345,346,349,350,351,355,356,358,360,364,365,366,368,369,370,371,372,374,378,379,380,381,382,383,384,385,386,387,389,390,391,393,394,395,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,417,420,425,426,427,429,432,433,434,435,442,450,451,452,453,454,455,457,458,460,461,462,464,466,467,469,471,472,474,477,478,479,480,481,483,487,490,494,495,496,498],excess:[208,395],exchang:[2,3,6,8,9,61,62,197,203,204,231,239,291,299,322,326,329,355,370,395,484],exchange:355,excit:[9,395],exclud:[3,6,9,12,16,17,63,71,114,142,148,155,156,172,191,206,210,215,216,243,251,284,297,299,321,332,337,363,364,366,379,399,402,416,417,424,449,481],exclus:[1,3,9,12,16,87,370,386,422,424,478,488],excurs:464,exectubl:12,execut:[1,2,3,4,6,8,11,12,17,60,169,193,236,293,339,354,357,369,465,467,477,480,483,495],exempl:440,exemplari:232,exemplifi:395,exert:[6,237,240,294,333,334,335,356],exhaust:[203,369,495],exhibit:[92,255,362,395,478],exist:[3,6,7,8,11,12,13,16,37,55,59,68,70,124,168,169,187,192,193,194,197,202,213,216,218,221,231,284,285,287,337,340,342,343,344,346,350,359,364,370,402,432,449,459,465,467,469,470,471,480,481,482,495,496,497],exit:[2,3,11,12,41,57,191,214,354,369,467,468,477,486,495],exlanatori:3,exp:[],expand:[],expans:[12,142,191,480,495],expect:[1,3,8,12,13,14,15,16,17,18,19,41,42,71,103,149,160,166,188,214,226,231,233,252,280,286,288,289,294,299,337,356,366,384,419,422,424,464,467,469,471,474,478,483,495],expens:[6,10,71,194,280,284,299,326,337,355,356,366,370,467],experi:[6,13,15,17,213,221,236,245,254,286,298,299,361,365,391,424,478,483],experienc:[6,12,244,245],experiment:[231,355,370,483],expert:12,expertis:7,explain:[1,3,6,8,9,11,12,16,18,41,59,63,65,68,69,71,72,73,76,77,79,86,93,148,156,188,191,193,194,197,206,207,212,214,216,218,220,255,280,288,299,311,337,339,354,355,358,364,365,369,375,393,405,440,442,457,467,470,471,474,476,479,490,495,499],explan:[3,6,59,115,142,191,206,254,280,402,463,466,467,469,478],explanatori:[3,8,119,191,205,206,209,210,211,299,364,466,495],explantori:[3,295],explic:423,explicit:[6,9,11,22,44,77,87,115,118,162,176,198,199,220,305,306,341,360,372,373,377,382,384,393,395,406,416,456,463,466,470,473],explicitli:[3,6,8,12,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,43,45,46,47,48,49,51,53,54,56,71,111,114,145,155,158,166,168,174,175,177,178,179,180,182,183,185,186,188,191,194,200,210,213,220,227,230,232,234,239,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,288,289,291,299,301,302,317,319,320,326,330,334,340,342,343,345,346,349,351,364,370,371,372,374,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,396,397,398,399,400,401,402,405,406,407,408,409,410,411,412,413,414,415,416,420,422,424,425,426,427,429,434,435,442,443,444,445,446,447,448,450,451,452,453,454,455,456,457,458,460,461,462,469,471,472,478,479,481,482,488,490],explictli:[16,482],exploit:[9,15,17,282],explor:[120,167],expon:[3,290,292,393,398,401,415,423,435],exponenti:[87,430,451,458,462,483,495],expos:11,exposit:[203,391,392],express:[6,142,154,168,198,199,218,252,280,290,326,332,339,377,393,395,409,419,440,441,450,495],expressiont:377,extend:[],extens:[3,6,9,17,44,45,46,53,55,63,82,83,84,87,88,91,95,98,99,109,111,119,121,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,197,200,201,204,212,213,219,222,226,229,230,231,233,234,235,237,239,241,253,255,260,269,280,281,297,298,299,301,303,308,311,313,317,318,319,320,321,323,324,326,328,331,335,336,398,419,422,433,434,441,486,487],extent:[1,3,41,42,45,57,71,166,170,191,202,210,214,237,333,336,355,358,372,436,438,452,466,469,472],exterior:[3,6,335],extern:[],extra:[3,6,8,12,16,17,40,41,46,61,71,103,111,112,114,120,143,145,146,147,149,151,154,155,156,157,158,160,161,167,168,169,170,174,194,209,214,216,255,287,288,289,299,314,363,364,367,368,390,399,402,405,419,424,466,467,469,472,481,490,495],extract:[3,6,11,13,36,63,87,109,117,119,121,198,199,292,365,387,396,419,441,467,474,486],extract_atom:11,extract_comput:[11,467],extract_fix:11,extract_glob:11,extract_vari:11,extramak:[12,15],extrapol:1,extrem:[1,3,6,17,58,193,208,218,220,255,324,395,454,490],extrema:415,extrins:203,f77:[5,7,12],f90:[5,7,12],f_1:6,f_5:[164,328],f_a:[453,454,455],f_ave:119,f_c:454,f_f:455,f_fix_id:289,f_harm:324,f_i:[29,430],f_id:[6,71,119,121,191,197,205,206,207,208,209,210,211,212,250,316,328,487,495],f_ij:430,f_indent:212,f_int:323,f_j:29,f_jj:91,f_k:430,f_langevin:326,f_max:[289,294],f_msst:253,f_r:[240,453,454,455],f_sigma:377,f_solid:324,f_ss:6,f_temp:[],face:[3,6,57,59,71,156,166,170,202,210,211,331,333,334,335,336,358,398,419,434,469,472],face_threshold:166,facet:166,facil:[0,12],facilit:[6,13,42],fact:[6,8,16,233,314,324,399,440,481],factor:[1,3,6,12,18,24,28,32,35,36,39,41,46,47,57,58,59,72,87,91,103,110,117,118,120,142,162,167,170,174,185,190,191,193,194,198,199,207,214,218,220,221,231,236,239,241,242,253,255,256,260,282,286,298,302,304,306,314,318,322,329,330,331,335,346,356,358,364,370,372,373,377,378,380,382,387,388,389,391,395,399,402,406,407,419,422,424,426,427,433,435,442,451,456,466,469,472,473,478,481,483,484,487,490,494,495],factori:[3,467],factoriz:355,fail:[3,11,12,59,172,218,221,355,363,365,389,433,467],failur:[123,437,468,495],fairli:[11,424,478,483],faken:73,falcon:236,fall:[3,6,194,209,285,467,495],fals:[86,337,339,440,495],fame:8,famili:[458,466],familiar:[0,11],fan:430,far:[3,6,12,17,57,59,61,86,191,194,195,214,215,216,218,221,255,280,298,299,314,331,342,346,361,365,366,457,467,469,474,487],farago:239,farrel:[453,455],farther:191,fashion:[6,8,41,71,168,194,197,198,199,204,210,214,216,221,231,233,237,252,253,255,257,258,259,260,261,262,263,271,274,275,276,277,278,288,289,291,299,303,307,313,316,324,326,330,331,332,334,336,365,402,416,472,481,495,498],fasolino:404,fast:[6,7,9,12,13,17,39,191,266,289,327,355,356,379,416,417,422,450,452,471,476,478,487,496,499],faster:[1,6,9,10,11,12,14,15,17,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,41,43,45,46,47,48,49,51,53,54,56,61,63,106,111,114,145,155,174,175,177,178,179,180,182,183,185,186,188,191,194,200,213,214,220,227,230,234,238,239,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,286,290,291,299,301,302,314,317,319,321,323,326,330,334,340,342,343,345,346,349,351,355,356,367,368,370,371,372,374,377,378,379,380,381,382,383,384,385,386,387,390,391,393,394,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,420,425,426,427,429,434,435,442,450,451,452,453,454,455,457,458,460,461,462,464,472,478,482,490],fastest:[1,6,14,17,156,210,326,327,370,466],fatal:[3,486],fault:[70,433],faulti:12,fava:398,favor:217,favorit:7,fbmc:321,fcc:[],fcm:[271,495],fdirect:224,fdotr:403,fdti:87,fe2:167,fe3:167,fe_md_boundari:203,featu:8,featur:[],fecr:393,feedback:[7,236],feel:[7,236,237,245,280,335,337,365,424],felling:421,felt:335,femtosecond:494,fene:[],fennel:[387,407],fep:[],ferguson:[6,174,481],fermi:[1,12,15,154,370,455],fermion:[9,395],fernando:418,ferrand:[9,13],few:[1,3,4,5,6,7,9,10,11,12,13,14,18,39,195,205,206,207,209,210,211,212,240,255,285,288,290,302,328,355,363,364,365,372,440,466,469,474,478,480,488,495,497],fewer:[1,3,11,15,16,61,245,478],fewest:3,fextern:229,feynman:282,fff:467,ffield:[386,396,432,433,440],ffmpeg:[3,12,193],ffplai:193,fft:[1,3,7,12,14,15,88,111,112,143,281,355,356,478],fft_inc:[12,356],fft_lib:12,fft_path:12,fftbench:[355,488],fftw2:12,fftw3:12,fftw:[11,12],fhg:[7,9],ficiti:449,fictiti:[6,200,201,226,229,233,282,298,387,407,411,449],field1:[470,474],field2:470,field:[],fifth:[311,426],figur:[1,3,8,11,12,289,466,467],fij:390,file0:280,file1:[11,13,280,325,339,364,474,476,480],file2:[11,13,325,339,364,474,476,480],file:[],file_from:192,filen:364,filenam:[3,12,13,38,41,56,188,191,193,194,195,203,206,207,208,209,210,211,212,214,219,280,284,287,290,291,292,295,296,299,300,325,326,352,353,354,364,365,371,372,377,387,393,394,396,404,419,420,421,426,430,431,432,433,440,441,451,452,453,454,455,458,465,466,467,470,471,476,480,487,495,497,498,499],filennam:476,filep:[3,191,194,471,476,499],filepo:296,fill:[7,9,168,193,285,326,358,366,377,422,433,472],filter:[194,203],final_integr:8,final_integrate_respa:8,finchham:[6,150,389],find:[0,3,4,6,7,8,11,12,13,14,16,38,39,56,61,71,73,87,119,171,188,195,204,217,218,228,231,254,280,286,294,298,361,363,365,366,387,402,407,411,419,440,450,452,490,495],find_custom:8,fine:[16,17,172,200,226,324,366,370,495],finer:[142,168,495],finest:355,finger:[168,190,252,472],finish:[6,11,41,214,339,352,354,355,367,369,370,457,474,495,496],finit:[],finni:[7,393,450],finvers:224,fiorin:[9,219],fire:[361,362,363,365,483],firebrick:194,first:[0,1,2,3,5,6,8,9,11,12,14,15,16,17,21,38,39,41,42,45,46,54,56,57,59,61,62,71,81,88,91,104,105,106,108,114,118,119,129,132,135,136,140,143,153,156,162,164,166,167,169,170,171,175,188,191,192,193,194,195,197,198,206,207,209,210,211,212,214,217,220,231,232,237,242,252,253,254,255,280,282,287,288,289,291,296,299,302,303,311,312,314,315,316,323,324,325,326,328,332,337,339,340,347,358,363,364,365,366,369,370,371,372,375,377,378,380,382,384,386,387,393,395,396,399,400,402,403,404,406,407,411,416,417,419,421,422,424,426,430,432,433,440,441,449,451,452,453,454,455,458,462,464,465,466,467,469,470,471,474,476,478,481,482,483,486,487,490,495,496,497,499],fischer:[6,9,19,20,174,382,481],fit:[3,6,9,12,38,56,188,298,314,372,377,404,419,424,445,452,454,477,495],five:[73,154,289,364,377,420,469,483],fix:[],fix_adapt:[162,199,415],fix_atom_swap:[],fix_bal:62,fix_deposit:[3,204,285],fix_evapor:204,fix_flux:203,fix_gcmc:[204,364],fix_gl:233,fix_gld:233,fix_grav:285,fix_id:[3,218,253,255,257,258,259,260,261,262,263,286,289],fix_modifi:[],fix_mov:[190,332],fix_nh:8,fix_npt:233,fix_nvt:[204,231],fix_poem:[3,6],fix_pour:[3,221],fix_qbmsst:9,fix_qeq:[3,386],fix_rattl:302,fix_reax_bond:432,fix_rigid:[245,375],fix_saed_vtk:300,fix_setforc:8,fix_shak:302,fix_srd:3,fix_styl:260,fix_temp_rescal:320,fixedpoint:[218,255],fixextern:229,fixid:203,fji:390,flag1:[223,368],flag2:[223,368],flag:[3,8,11,12,14,15,16,17,40,66,74,75,81,86,89,90,94,104,105,107,120,163,167,171,191,193,194,195,212,217,219,223,236,239,243,245,251,252,281,288,299,311,313,314,321,325,334,337,353,356,364,368,369,370,372,401,406,419,422,449,464,466,467,469,470,471,473,474,475,479,495],flag_buck:381,flag_coul:[381,390,411],flag_lj:[390,411],flagfld:[379,416,417],flaghi:[3,379,416,417],flaglog:[379,416,417],flagn:223,flagvf:[379,416,417],flat:[6,326,331,332,336],flavor:[2,7,12],fld:[9,331,379,416,417],flen:373,flex_press:373,flexibl:[3,6,8,169,193,206,210,219,233,256,322,329,395,454,487],flip:[3,6,220,255,333,334],floor:495,flop:12,floralwhit:194,flow:[],fluctuat:[6,64,87,218,231,232,239,242,255,260,280,281,324,326,349],fluid:[],fluid_veloc:246,flush:[3,194,486],flux:[],flv:193,fly:[7,9,12,41,193,197,203,208,221,224,299,302,327,377,422,487,490],fmackai:9,fmag:222,fmass:282,fmax:[363,487],fmomentum:224,fmsec:[2,194,239,240,252,255,286,299,317,318,478,489,494,496],fname:354,fno:[12,16],fnorm:[363,487],fnpt:224,fnvt:224,foce:402,fock:373,focu:302,fogarti:[9,292,433],foil:[142,280,441],fold:[312,478],folk:7,follow:[0,1,2,3,4,6,7,8,9,11,12,13,14,15,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,35,36,38,41,42,43,45,46,47,48,49,51,53,54,56,59,63,64,70,71,73,91,92,97,98,108,115,118,119,121,142,143,146,147,148,154,156,161,164,166,168,169,174,177,178,179,180,182,183,185,186,188,191,192,193,194,197,203,204,205,206,207,208,209,210,211,212,214,219,220,221,224,225,229,231,232,233,236,238,239,240,242,245,253,255,260,261,262,263,274,275,276,278,281,282,284,287,288,289,290,292,294,296,298,299,300,302,316,317,318,319,322,323,324,325,326,328,329,337,338,342,343,344,345,346,349,351,353,358,360,363,364,365,370,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,389,390,391,392,393,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,423,424,425,426,427,429,430,431,432,433,434,435,437,439,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,456,457,458,460,461,462,464,466,467,469,470,472,474,476,477,478,481,483,484,485,490,495,496,498],foo:[4,8,11,12,191,193,229,467,480,495],foot:6,footprint:[12,370],fopenmp:[12,16,18],forc:[],force_uvm:17,forceatom:245,forcefield:[298,401],forcegroup:242,forcezero:361,ford:390,forestgreen:194,forev:71,forget:[240,490],forgiv:255,fork:[12,191],form:[2,3,6,8,12,19,22,44,54,63,66,74,75,77,81,87,89,90,92,94,104,105,107,118,142,143,162,163,172,176,194,197,198,199,216,232,233,239,241,245,252,276,281,292,294,298,299,326,331,335,340,341,344,349,360,362,364,365,372,373,377,384,393,395,397,401,402,406,418,419,421,422,426,427,430,432,433,434,440,441,442,450,452,453,454,455,461,463,466,467,469,474,479,486,490,495],formal:[6,78,80,91,232,233,239,255,282,314,322,440],format:[2,3,6,7,8,9,12,13,22,38,41,44,56,68,77,176,188,191,192,193,194,195,206,209,210,211,212,214,216,281,284,288,290,292,295,299,300,310,325,326,337,338,341,360,364,365,371,372,377,384,393,396,406,419,421,431,432,433,435,441,452,458,459,466,467,469,470,471,474,485,486,487,495,497],former:[6,12,16,39,41,194,214,326,330,377,379,475,481,495],formerli:[7,13],formul:[1,40,64,143,200,226,239,255,276,290,292,298,302,325,355,372,377,393,395,398,419,429],formula:[2,3,6,7,13,21,22,37,44,54,55,70,73,87,89,90,91,95,97,98,107,114,120,143,145,146,147,148,149,150,151,152,154,155,156,157,158,159,160,161,167,168,173,175,176,187,190,191,198,199,200,201,206,207,208,209,212,213,220,226,234,235,237,239,240,252,280,281,287,296,301,308,312,314,317,318,319,328,331,334,336,337,339,340,341,343,350,358,364,372,373,375,377,382,383,384,385,390,391,393,394,398,399,400,401,403,406,407,409,410,411,413,414,416,417,419,423,424,425,434,435,442,450,451,453,454,455,458,460,461,465,469,472,479,486,487,494,495,496],forth:[1,6,11,12,13,14,15,369,467,472,476],fortran:[3,6,9,11,12,13,229,393,402,419,432,433],fortun:8,forward:[3,8,87,354,365,370],foster:[377,429,430],foul:171,found:[3,6,9,12,73,162,191,217,219,231,236,242,281,321,327,339,354,366,384,387,390,464,470,471,486],four:[6,11,54,81,104,105,142,164,253,326,349,364,365,422,464],fourier:[],fourth:[6,106,298,311,321,382,426,440],fox:[6,120,174,448,481],fphi:[38,56,452],fpic:12,fplo:[38,56,452],fprime:452,fqdn:238,fqq:390,frac:[],fraction:[1,3,6,8,12,16,39,41,80,111,143,171,190,193,194,204,215,216,217,218,253,285,289,296,297,314,319,320,358,365,370,377,379,399,416,417,474,479],fragment:[42,236,296],fraig:[42,376],frame:[83,142,194,203,253,289,333,398],framer:[193,194],framework:[5,233,371,441],franc:9,fraunhof:9,free:[5,6,7,9,13,29,60,63,70,87,162,199,280,314,323,324,325,326,362,365,373,395,415,422,430,461,466],freedom:[3,6,8,95,97,98,100,102,103,114,145,146,147,148,149,150,151,152,153,154,155,156,157,158,160,161,206,217,224,231,233,239,240,245,255,256,260,261,262,263,274,275,276,278,282,284,299,302,317,318,319,324,363,390,487,490,496],freeli:[0,6,7,12,146,147,161,166,193],freez:[],frenkel:[231,324],freq:202,frequenc:[3,6,16,39,104,194,208,269,281,282,289,294,353,391,395,433,440,464,478,483,495,498],frequent:[3,64,67,70,72,73,77,88,92,108,142,194,215,216,228,322,329,424,476],fri:[253,289],friction:[4,5,6,10,42,197,233,239,289,294,299,326,330,332,376,399,479],friedrich:304,from:[],front:[253,289,333],frontend:[193,293],frozen:[6,114,172,230,232,240,366,397],fs2:[6,91],fscale:236,fstr:495,fstring:467,ftol:[363,365,464,483],fuchsia:194,fuction:387,fudg:302,fugac:231,fugacity_coeff:231,fulfil:6,full:[1,2,6,9,12,17,38,39,40,91,193,207,208,219,242,280,355,356,370,377,393,395,396,398,456,469,471,476,477,481,483,488,490,498],full_energi:[3,231],fuller:363,fulli:[3,6,9,78,233,238,280,363,365,387,430,431,497],fulton:393,fumi:378,func:[467,495],funcfl:393,functino:[],functionaliri:219,fund:[0,7],fundament:[314,494],funnel_flow:310,funrol:422,further:[3,6,8,12,13,61,63,71,86,106,109,118,193,194,197,206,209,210,211,212,215,221,225,242,246,282,290,300,304,314,326,328,337,356,361,363,364,365,366,371,375,386,422,440,464,483,484,495],furthermor:[27,177,395],furthest:61,futher:3,futur:[],g_ewald:3,g_ewald_6:3,g_ewald_disp:3,g_jik:430,g_p:326,ga3:167,gaa:377,gahler:362,gai:[3,398,450],gain:321,gainsboro:194,galindo:423,game:236,gamma0:29,gamma:[3,6,29,239,242,246,281,289,290,292,294,330,391,394,398,419,423,444,447,448,451,453,455,458,487],gamma_:[3,326,332],gamma_ijk:453,gamma_n:[332,399],gamma_p:[3,326],gamma_t:[332,399],gammaa:423,gammafactor:242,gammar:423,gan:[430,451,453,455,458],gan_sw:430,gan_tersoff:430,ganzenmuel:[7,9],ganzenmul:9,gao:[6,20,174,382,481],gap:[188,416,417,431,441],gap_2014_5_8_60_17_10_38_466:431,gap_exampl:431,gaseou:7,gass:231,gather:[11,477],gather_atom:11,gather_scatter_loop_unrol:12,gathert_atom:11,gauch:180,gaug:12,gauss:[],gaussian:[6,40,63,91,104,106,232,233,239,282,298,314,318,336,355,391,392,395,397,431,450,464,495,496],gave:[3,424],gaybern:[],gcc:17,gcmc:[],gcore:224,gd3:167,gdot:417,gdrude:224,ge4:167,gec:[453,455],gen:[255,256],gener:[],genom:7,gentler:[331,334,336],gentli:394,geom:[6,355,392,464,496],geometr:[3,6,7,8,42,57,59,71,158,159,168,170,191,194,200,210,211,213,214,221,226,235,255,261,262,263,274,275,276,278,299,301,308,317,318,319,335,337,355,358,365,375,376,379,383,385,387,390,395,398,400,405,407,408,409,410,411,412,413,414,415,416,417,418,423,424,434,442,456,457,460,461,469,472,479,487,495],geometri:[3,6,7,9,13,25,41,71,156,168,210,214,215,216,218,221,237,358,424,469,472],georg:[7,9],georgia:13,gerber:415,germani:[9,14],germann:[260,409,464,483],germano:398,gerolf:13,get:[],get_natom:[11,467],get_rank:11,get_siz:11,getenv:495,gettimeofdai:12,gewald:[6,355],gezelt:[387,407],gf100:14,gf104:14,gf200:14,gflop:12,gflp:12,ghost:[3,6,7,12,16,58,61,62,73,166,171,218,220,240,255,288,299,300,353,355,366,370,391,392,395,399,406,474,479,490],ghostwhit:194,ghz:10,giacomo:9,gif:[4,193],gifsicl:193,gigabit:18,gillan:441,gingold:[444,445,447],gio:2,git:[7,12],github:[13,17,219,233,238,431],give:[0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,54,71,92,108,115,148,151,155,168,191,194,200,202,206,207,209,212,218,220,233,255,276,280,281,286,294,296,299,328,355,356,363,366,367,370,372,377,392,395,401,402,419,422,424,434,453,454,455,464,466,467,469,479,483,490,496],given:[3,5,6,7,9,10,11,12,16,17,22,27,37,44,55,61,63,64,67,71,108,115,125,126,127,129,130,133,134,135,136,137,138,139,140,141,142,143,162,166,170,176,177,187,188,191,192,194,197,204,206,208,210,215,216,218,220,221,225,231,232,233,234,236,242,249,252,254,255,260,279,280,281,282,289,290,296,298,302,310,311,312,314,316,321,326,327,330,331,332,335,341,350,355,356,370,371,372,377,378,380,381,383,384,385,386,387,388,391,392,393,395,396,398,401,407,408,409,411,419,420,421,422,423,424,426,427,430,434,435,437,439,440,441,450,462,464,467,469,471,472,479,483,494,498,499],gjf:239,gjwagn:7,gko:2,gld:[],gle4md:[233,238],gle:[],glitch:3,glob:480,global:[],glosli:[356,422],glotzer:[299,391],glue:11,gmail:[7,9,13],gmake:[12,17],gmask:[3,495],gnu:[0,7,12,17],gnuplot:[11,13],goal:[5,12,39],goddard:[6,9,25,290,291,292,351,395,401,432,433,481],goe:[12,54,142,168,190,252,307,363,366,390,394,400,409,412,442,462,472,476],gold:[70,194],goldenrod:194,goldman:289,gone:3,good:[1,3,6,12,17,41,73,120,166,167,214,239,253,255,290,296,302,321,355,365,366,371,385,392,393,422,424,452,458,464,478,483,487],googl:236,gordan:142,gordon:6,gould:[6,174,481],gov:[0,7,9,13,371,393,396,494],govern:242,gpl:[0,7,8,12],gpt:[9,422],gpu1:370,gpu:[],gpuid:370,gpun:370,grab:[3,6],gracefulli:3,grad:[6,200,226,254],gradient:[6,7,8,12,13,124,129,218,226,234,235,254,276,291,322,326,361,362,365,417,433,452],gradient_correct:439,graduat:284,graft:217,grai:194,grain:[5,6,7,9,29,36,40,54,67,168,171,180,197,280,284,299,314,400,422,435,481],gram:[206,210,211,393,494],grama:[9,292,433],gran:[],grand:[3,197,204,231],granflow:5,granular:[],graph:11,graphen:473,graphic:11,grasp:5,gravit:234,graviti:[],grdient:203,great:[3,13,289],greater:[1,3,10,61,71,86,166,194,218,232,255,280,319,333,370,375,376,378,380,381,424,464,466,469,472,478,483,495,496],greathous:13,greatli:[120,483],green:[2,6,91,132,133,193,194,281,282,322,377],green_kubo:6,greenyellow:194,greffet:294,greg:[7,9],grest:[45,46,217,314,356,381,399,411,481],grew:71,grid:[3,12,41,62,120,156,167,170,214,242,294,314,326,327,353,355,356,463,466,469,471,473,478],grigera:6,grime:40,grmask:[3,495],gromac:[],gronbech:[239,355],groot:391,ground:[6,395],group1:[150,171,366],group2:[88,144,150,169,171,366],group2ndx:[],group:[],group_id:11,groupbig:314,groupid1:[245,299],groupid2:[245,299],groupid:469,groupnam:366,grouptyp:231,grow:[3,6,8,202,220,221,237,239,255,280,328,399,469,481],grow_arrai:8,grow_reset:8,growth:[6,321],grueneisen:9,gsmooth_factor:419,gstyle:[3,466],gtl:7,gtx285:14,gtx450:14,gtx460:14,gtx470:14,gtx560:14,gtx580:14,guarante:[65,69,79,93,110,117,168,171,191,225,290,354,358,479],guess:[3,191,286,470],gui:[7,11],guid:[1,17,40,78,80,100,101,102,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,197,248,249,304,305,306,307,310,327,429,437,439,443,444,445,446,447,448,479],guidelin:[1,8,14,15,16,17,18,19,355,452],guidlin:17,gullet:419,gulp:6,gumbsch:362,gunnel:422,gunsteren:[286,317,415],gunzenmul:7,gunzip:12,guo:[6,20,174,180,382,481],gwald:3,gyrat:[],gzip:[3,12,191,193,194,325,365,469,470,474],h12:398,h2o:[40,364],h5cc:192,h5md1:192,haak:[286,317],had:[3,6,11,13,59,63,191,194,195,209,212,217,218,232,233,235,239,240,241,253,255,257,258,259,260,261,262,263,274,275,276,278,285,286,314,317,318,319,326,391,392,399,449,471,475,478,484,487],hafskjold:6,half:[1,3,6,8,9,16,17,39,41,58,59,170,193,205,214,220,239,255,326,331,335,366,370,373,377,385,395,422,436,438,469,471,472,479,490],halfwai:[41,193,194],halperin:92,halsei:399,halt:[41,194,214,235,339,486],halv:193,ham:[38,56],hamak:[331,335,385,434],hamilton:70,hamiltonian:[233,255,256,318,395,478],hammond:[355,356],han:393,hand:[3,6,19,54,144,168,186,190,193,242,252,358,387,395,469,472,479,482],handl:[3,9,16,193,219,292,370,373,395,416,433,458,467,483],hang:[3,12,466,467],happen:[3,6,8,12,15,18,61,118,172,194,204,207,366,370,467,470,477],happi:8,haptic:236,hara:454,hard:[1,245,292,298,299,392,440,472],harden:[9,442],harder:[331,335,490],hardi:[203,240,355,356,490],hardwar:[1,12,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,43,45,46,47,48,49,51,53,54,56,111,114,145,155,174,175,177,178,179,180,182,183,185,186,188,200,213,220,227,230,234,239,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,291,299,301,302,317,319,330,334,340,342,343,345,346,349,351,355,356,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,420,425,426,427,429,434,435,442,451,452,453,454,455,457,458,460,461,462,472,482],hardwir:[3,17,332],hardy2:356,harm:373,harmon:[],harmonic_fix_wal:417,harpertown:18,harrison:372,hart:314,hartre:[373,393,395,422,494],hasan:9,hash:[39,469],hassl:298,hat:[6,10,254],have:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,41,42,43,45,46,47,48,49,51,53,54,56,57,59,63,64,65,66,67,69,70,71,72,73,75,77,81,86,90,91,92,94,104,105,106,107,108,111,114,115,116,117,118,132,142,143,144,145,146,147,148,149,151,155,157,160,161,163,164,165,166,168,169,170,171,172,174,175,177,178,179,180,182,183,185,186,188,190,191,192,193,194,195,200,202,204,205,206,207,210,211,212,213,214,215,216,217,218,220,221,226,227,228,230,231,232,233,234,235,236,237,239,240,241,242,245,250,252,253,255,257,258,259,260,261,262,263,264,265,269,272,274,275,276,277,278,280,282,284,285,286,288,289,290,291,294,297,299,301,302,308,310,314,315,317,318,319,320,321,325,326,327,328,330,331,332,333,334,335,336,337,338,339,340,342,343,345,346,347,349,351,355,356,358,361,362,363,364,365,366,367,370,371,372,373,374,377,378,379,380,381,382,383,385,386,387,390,391,392,393,394,396,397,398,399,400,401,402,403,405,407,408,409,410,411,412,413,414,415,416,417,419,420,421,422,424,425,426,427,429,430,432,433,434,435,439,440,442,451,452,453,454,455,457,458,460,461,462,463,464,466,467,469,470,471,472,473,474,475,476,477,478,479,481,483,484,486,487,488,490,494,495,496,497,498,499],haven:467,hayoun:294,hayr:239,hbcut:432,hbnewflag:432,hbond:[],hbond_cutoff:433,hcp:[64,67,73,358,419],hdf5:[9,192],he1:167,head:[6,21,175,340,397,401,432,433,484],header:[3,6,7,8,12,169,191,193,194,195,206,207,209,210,211,212,253,289,296,300,326,364,371,377,393,449,466,469,479,486],heal:478,heat:[],heatconduct:[],heavi:314,heavili:[41,214],heavisid:326,hecht:314,heenen:9,height:[193,221,285,365,397],heisenberg:9,held:[6,71,314,365,399],helic:180,helium:374,helix:[],hello:467,help:[3,8,12,14,15,16,17,18,19,191,218,220,253,353,377,453,455,497],henc:[1,3,13,20,21,26,32,35,36,70,71,110,148,150,158,175,206,255,292,314,330,331,335,337,340,342,346,349,356,387,397,415,430],henderson:53,hendrik:9,henin:[9,219],henkelman1:[254,365],henkelman2:[254,365],henkelman:[254,362,365],here:[1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,22,37,41,44,55,63,68,69,70,71,120,148,166,167,176,179,187,191,193,194,197,206,214,217,220,231,232,240,242,280,289,292,294,300,326,331,334,336,337,339,341,350,354,363,365,369,370,372,373,377,384,396,398,401,402,406,418,422,430,434,437,439,440,450,452,462,467,471,474,490,495],herist:327,herrmann:314,hertizian:332,hertz:[],hertzian:[6,332,399,450],hertzsch:399,hess:355,hessian:[5,362],heterogen:106,heurist:[327,470],hex:[3,168,358],hexagon:[67,92,419],hexat:92,hexord:[],hey:[112,143],hf4:167,hfo:386,hftn:[362,363,365],hg1:167,hg2:167,hgrid:314,hibb:282,hidden:[17,467],hienergi:337,hierarch:[7,478],hierarchi:[356,381,382,407,408,411,418,423,478],higdon:[9,416,417],high:[1,3,6,7,9,12,19,41,108,188,191,193,214,218,225,240,253,322,326,329,356,362,363,370,377,395,398,422,434,452,462,466,478,483,490],higher:[1,14,142,171,194,206,212,215,216,221,237,285,294,321,334,336,363,395,403,440,495],highest:[221,339,364,365,495],highli:[3,6,7,9,168,193,220,239,255,269,289,299,361,363,395,464,483],highlight:[6,7,10,13],hight:397,hilger:[355,356],hill:282,hill_height:13,him:9,hint:12,histo:[],histogram:[1,6,12,63,118,166,197,207,209,212],histor:396,histori:[],hit:[3,314,333],hmaktulga:[7,9],ho3:167,hoc:349,hocknei:[355,356],hofl:192,hoh:[6,387,407,411],hold:[6,33,59,71,181,206,220,247,283,298,299,311,363,365,399,415,461,480],holdem:298,holder2:356,holder:[355,356],hole:311,holian:[260,409],holm:[280,356],holonom:325,home:[11,12,195],homebrew:12,homepag:[193,236],homogen:[276,424],hone:282,honeydew:194,honor:195,hood:422,hook:[],hookean:399,hoomd:195,hoover:[6,7,8,158,197,224,239,240,255,256,257,258,259,260,261,262,263,274,275,276,277,278,282,286,294,299,317,318,319,324,391,490],hop:[217,365,377,440],hope:[5,13,17,41,42,214,477],hopefulli:[8,363],horizon:429,horn:6,host:[3,12,16,17,219,370],hot:[6,235,256],hotpink:194,hottest:322,hour:12,hourglass:[2,9,124],hove:419,how:[],howev:[1,2,3,6,7,9,11,12,15,16,17,36,39,41,71,88,91,105,120,142,167,188,191,193,194,207,208,212,214,217,218,221,224,231,232,233,238,239,240,241,242,245,255,280,282,285,288,289,294,299,300,314,315,317,318,321,322,326,327,328,329,330,356,358,360,361,365,370,383,385,393,394,399,402,419,422,428,430,439,451,452,455,464,466,467,470,471,477,483,486,487,490,495,496],howto:[6,63,71,145,146,147,149,151,154,155,156,157,158,160,161,197,239,240,255,286,317,318,319,387,401,407,411,496],hoyt:203,hpc:[1,15],hsw:17,htm:393,html:[0,4,8,11,12,15,144,238,397,417,478,479],htmldoc:0,htst:483,http:[0,6,7,9,11,13,14,15,219,233,236,238,371,393,416,431,432,433],htype:[387,407,411,415],hubbard:388,huge:[12,170,269,314,469,474,486],huggin:[7,378,380,450],hugh:203,hugoniostat:[4,197,260],hugoniot:[253,260,289],hull:166,hummer:355,hundr:[7,14],hura:6,hwloc:[12,17],hybrid:[],hydrat:397,hydrocarbon:[372,386,395],hydrodyanm:40,hydrodynam:[7,9,40,100,102,242,244,245,246,379,416,417,437,439,450,479],hydrogen:[3,6,7,228,294,372,377,387,395,401,407,411,415,432,433,450,469,478,490],hydrostat:[3,9,218,255,260,286,299],hynninen:[388,397],hyoungki:421,hyper:282,hyperbol:388,hyperspher:142,hyperthread:[16,17],i_0:326,i_1:430,i_csid:6,i_flag1:288,i_mpi_pin_domain:16,i_myflag1:288,i_myflag2:288,i_n:430,i_nam:[115,191,288,316,479],ialloi:419,iatom1:117,iatom2:117,iatom3:117,iatom4:117,ibar:419,ibead:282,ibm:[191,355,422],icc:[10,12,422],icm:[9,236],ico:64,icosohedr:73,ictp:13,id1:[299,365,406,469,472],id2:[299,303,311,365,406,469,472],id_press:[218,253,255,257,258,259,260,261,262,263,286],id_temp:[217,218,253,255,257,258,259,260,261,262,263,274,275,276,278,286,317,318,319],idea:[1,3,6,11,12,41,143,193,194,214,237,280,303,314,322,356,424,477,490],ideal:[6,9,12,40,73,118,124,224,231,280,358,416,444,490],idealga:[],ident:[1,3,9,12,39,40,71,142,191,194,209,218,219,232,233,239,240,252,255,280,282,286,294,296,299,356,364,365,370,378,380,387,389,393,407,409,415,426,432,433,440,441,458,462,464,467,470,483,494,495,496,498],identi:370,identif:67,identifi:[1,3,6,12,38,40,56,70,166,168,188,296,314,337,401,406,419,452,464,466,469,472,483,484,486,488],idl:[18,483],idn:[299,365],idr:495,ielement:419,ieni:13,ifdef:[8,12],iff:240,iffp:467,ignor:[3,6,11,16,41,42,61,71,83,87,99,109,121,172,191,193,194,198,199,207,208,209,210,212,214,218,219,220,221,231,234,238,239,252,255,260,266,271,286,287,288,298,299,300,314,317,318,319,325,326,328,331,335,336,337,347,357,360,364,365,370,371,383,384,385,393,394,396,398,405,406,419,426,430,434,451,452,453,454,455,457,458,464,466,469,470,474,479,481,483,486,495],ihl:314,iii:[6,9,25,290,292,351,401,481],ijj:458,ijk:[345,349,351,377,430,458,466],ijl:349,ikeshoji:6,ikj:458,ill:[148,158,206,290],illeg:3,illinoi:[236,355,356,416],illog:467,illustr:[1,6,8,11,12,16,17,18,19,280,282,365,402,467,495],ilmenau:[7,9,14],ilya:[7,9],imag:[],image2pip:193,imageint:3,imagemagick:[4,193],imagin:[311,325,377,394,402,403,420,421,426,430,451,453,454,455,458,481],imaginari:[6,92,231,282,469],imbal:[1,12,41,214,370,488],imbalanc:[41,214],imbu:314,imd:[],img:193,immedi:[0,2,3,8,12,168,215,216,221,302,310,315,316,333,466,467,469,471,483,495,498],immens:3,immers:[242,299],impact:[1,4,6,8,225,321,488],impart:[3,6,234,314,336],impei:[6,407],implement:[1,3,6,8,9,12,17,18,27,78,87,108,120,150,156,167,168,176,177,187,206,219,223,233,236,239,242,244,245,246,253,276,279,281,282,288,289,290,292,293,294,302,303,314,321,326,330,349,354,355,356,363,365,370,371,373,376,377,386,387,389,391,393,394,395,402,407,411,415,419,429,432,433,434,453,455,466,467,478,483,490,495,497],impli:[3,6,40,59,87,143,190,193,198,199,200,220,226,239,298,317,319,320,355,358,384,467],implicit:[],implicitli:8,implict:388,imporop:364,importannt:252,important:324,important_not:[],impos:[2,6,71,114,157,190,197,200,201,213,226,227,229,234,237,246,247,254,269,280,283,301,308,311,313,314,321,322,323,324,329,330,331,334,335,336,363,365,367,463,477],imposs:1,improp:[],improper_coeff:[],improper_styl:[],impropercoeff:3,impropertyp:216,imprort:98,improt:[198,199],improv:[0,1,9,16,39,41,194,214,255,281,370,401,407,422,424,433,451,454],in3:167,inaccur:[1,3,6,171,253,355],inaccuraci:335,inact:401,inappropri:168,incid:[120,167,221],includ:[],includig:[339,354],inclus:[],incom:236,incompat:[3,11,403],incomplet:[3,11,469],incompress:[256,395],inconsist:[3,172,217,470],inconveni:358,incorpor:[289,377,388],incorrect:[3,151,239,419],incorrectli:[3,358,399,495],increas:[1,3,6,10,18,38,56,57,59,111,120,143,188,191,193,194,208,215,216,217,220,231,239,286,297,298,299,322,325,329,355,356,365,370,395,398,433,452,454,467,478,483,495],increasingli:395,increment:[3,11,130,200,201,213,214,221,226,228,255,303,304,337,354,369,405,440,464,467,481,483,495],incur:[14,17,206,210,211,228,326,466],inde:151,indefatig:7,indefinit:323,indent:[],independ:[4,6,9,11,12,16,17,41,59,63,91,119,121,154,168,190,197,205,206,207,209,210,211,212,214,217,218,219,220,221,232,234,239,240,242,245,255,281,286,290,294,299,300,303,313,324,326,358,399,422,464,467,486,496],indetermin:[191,194],index:[0,3,6,8,11,12,38,39,40,56,68,69,119,121,188,191,194,205,207,236,238,282,300,326,337,338,339,360,369,424,432,433,452,459,469,484,495],indianr:194,indigo:194,indirectli:[6,495],indistinguish:239,indium:441,individu:[],induc:[],industri:7,ineffici:[3,6,40,64,67,70,72,73,77,92,108,142,156,193,220,255,281,355,367],inelig:204,inerti:417,inertia:[],inexpens:[233,478],inf:[2,3,12,329,472],infer:[3,95,97,98,162,200,201,214,215,216,226,236,284,314,322,329,358,384,396,469,481,487],infil:[3,13,299,466],infin:[3,363,474,487],infininti:193,infinit:[3,221,230,237,239,242,281,314,326,332,333,356,358,395,473,494],infinitesim:6,inflect:[388,409],influenc:[3,9,41,80,150,252,285,355,356,424,453,454,455],inform:[0,1,2,3,6,7,8,9,11,12,13,15,17,39,41,42,59,61,62,63,68,88,117,119,120,167,168,174,191,192,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,227,228,229,230,231,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,254,264,265,266,267,268,269,270,271,272,273,279,280,281,283,284,285,286,287,288,290,291,292,293,294,295,296,297,298,299,300,301,302,304,311,312,314,315,317,318,319,320,321,322,323,325,328,329,330,331,333,334,335,336,338,353,355,356,359,362,363,364,365,366,368,370,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,425,427,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,457,458,460,461,462,466,467,469,470,471,473,474,476,481,483,484,486,488,495,497,498,499],infrequ:[6,391,464,483],infti:[388,416,417],ingtegr:377,inher:[355,363,424],inherit:[6,456],inhomogen:[18,326,424],inidividu:363,init:[3,8,297,440],init_fil:326,init_list:8,init_on:8,init_styl:8,initi:[2,3,4,6,7,8,11,12,13,38,39,40,41,56,57,59,62,71,80,81,86,87,104,105,132,164,169,170,188,190,191,193,194,195,198,199,202,203,207,214,216,217,218,220,227,231,232,236,237,238,239,240,242,247,251,252,253,254,255,260,269,281,282,283,288,289,294,297,298,299,301,313,314,316,321,323,324,325,326,327,328,331,332,333,334,336,337,339,355,359,362,363,365,372,373,376,390,391,392,422,431,432,433,440,452,464,466,467,469,471,472,474,476,477,479,483,484,487,490,495,496,497,499],initial_integr:8,initial_integrate_respa:8,initialis:431,initialt:326,inlclud:11,inlcud:495,inlin:467,inner2:[382,400],inner:[3,8,16,191,237,339,354,361,362,363,365,369,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,427,429,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,459,460,461,462,478,483,495],inner_distance_cutoff:401,innergroup:245,innermost:[38,56,71,368,452,478],innernod:245,innner:413,inordin:327,inorgan:[6,458],inp:[219,339,441,458],input1:[65,68,69,79,93,110,115,116,117,119,121,316],input2:[65,68,69,79,93,110,115,116,117,119,121,316],input:[],input_doubl:3,inquir:304,insensit:12,insert:[3,5,7,8,12,59,168,197,221,231,237,285,355,441,449,467,473,490],insid:[2,3,6,8,11,71,131,137,168,191,194,205,210,211,221,222,228,231,237,242,245,285,299,314,331,333,334,335,336,337,353,358,409,467,468,469,471,472,479,483,495],insight:[6,13],instabl:[242,390,439],instal:[],instanc:[6,11,198,219,233,333,397,402,424,430,467,490],instantan:[6,63,217,218,232,233,255,260,281,286,289,294,296,299,321,475,487],instanti:[6,11,12,203,402,466],instead:[1,3,6,8,9,11,12,13,17,18,40,41,59,61,63,70,71,90,104,119,146,150,172,188,191,199,206,209,210,211,212,214,218,219,231,239,242,245,246,281,287,297,299,316,334,353,355,356,359,366,370,380,381,393,406,408,415,419,422,464,472,476,483,485,490,495],institut:[9,236,284],instruct:[],insuffici:[3,6,12],insult:255,insur:[3,6,11,12,17,39,40,61,73,103,105,168,169,188,191,193,194,200,215,216,221,226,227,228,229,231,234,239,251,287,288,297,299,314,326,331,335,336,337,339,354,364,366,370,385,398,402,428,434,452,466,467,469,470,474,477,478,486,487,495,496],int_max:3,integ:[3,6,8,11,12,39,40,42,64,68,70,71,108,115,117,119,121,142,166,168,171,172,174,178,179,183,188,190,191,193,194,204,206,210,211,215,216,217,221,223,229,231,232,233,236,239,240,241,242,281,284,285,288,289,294,299,314,316,318,321,325,326,345,355,358,379,391,392,405,419,432,433,437,439,441,464,466,467,468,469,477,478,479,483,486,495,496],integr:[],integrate_ulsph:[],intel:[],intel_cpu:[12,16],intel_phi:[12,16],intend:[3,6,8,12,13,36,208,232,431,469],intens:[1,3,6,9,63,66,74,75,86,89,90,91,94,104,105,106,107,114,116,118,119,120,121,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,163,164,165,167,197,206,207,209,210,211,212,214,215,216,217,225,228,235,245,253,255,260,296,299,300,314,322,326,328,329,486,487],intepol:495,inter:[14,18,42,61,62,148,171,172,191,217,239,241,254,291,299,355,365,377,479,490,495,497,499],interact:[1,3,6,7,8,9,10,11,12,14,15,16,17,22,29,33,37,39,42,44,50,54,55,57,61,63,65,69,72,77,79,87,88,92,93,108,109,110,112,114,117,118,124,125,126,127,129,130,131,132,133,134,135,137,138,139,140,142,143,144,146,147,161,162,166,169,170,171,172,173,174,176,180,181,187,191,197,198,199,215,216,217,230,231,236,237,239,241,245,269,280,282,284,290,292,298,299,305,306,314,315,321,326,330,331,332,335,336,341,342,343,344,346,350,355,356,363,364,365,366,367,368,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,427,429,430,433,434,435,437,439,440,441,442,449,450,451,453,454,455,456,457,458,459,460,461,462,464,467,469,471,473,474,478,479,481,486,487,490,497],interatom:[3,4,7,168,191,254,323,324,371,377,393,395,403,419,422,440,454,495],intercept:120,interchang:6,interconnect:18,interconvert:395,intereract:39,interesect:335,interest:[1,5,7,8,9,11,13,71,167,282,321,324,356,394,417,432,433,467,495],interf:370,interfac:[],interfer:[12,255,372],interg:[6,490],intergr:[478,482],interi:417,interior:[3,6,41,335,472],interlac:419,interleav:[6,168,477],intermedi:[6,12,59,193,254,280,349,365,467,468,477,481],intermix:464,intermolecular:372,intern:[0,2,3,5,6,9,11,16,20,21,24,28,32,35,36,39,40,42,63,87,100,102,120,143,148,150,167,175,188,193,194,197,198,199,203,216,220,224,236,248,249,253,255,260,281,299,303,340,342,346,349,353,363,364,443,444,452,467,469,471,474,483,486,487,494,495,496,497],internal_element_set:203,internal_quadratur:203,internet:238,interpenetr:419,interpentr:[444,445,447],interpol:[6,15,38,56,101,188,193,194,203,242,280,355,356,365,377,424,433,446,452,453],interpret:[2,6,11,193,209,399,442,464,467,483,495],interrupt:289,intersect:[3,6,120,194,335,337,472],intersert:335,interspers:363,interstiti:[166,422],intertia:[3,94],interv:[3,6,91,192,207,239,289,294,295,306,440,446,464,483,495],intestieti:120,intial:[6,370,372],intiial:[41,474],intiti:[3,313],intra:299,intra_energi:231,intramolecular:[29,231],introduc:[6,9,92,108,193,255,289,294,299,349,355,371,387,395,407,411,415,451,483,495],introduct:[],intsal:[],intuit:358,inv:[120,167,300],invalid:[3,12,71,89,171,269,365,416,417,471],invari:[108,135,140,142],invent:302,invers:[],invert:[1,6,172,281],invis:335,invoc:[166,217,370,437,439,467],invok:[1,3,6,7,8,11,12,13,14,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,41,43,45,46,47,48,49,51,53,54,56,59,63,66,71,74,75,81,87,88,89,90,94,104,105,107,111,112,113,114,119,145,155,162,163,166,168,169,171,172,174,175,177,178,179,180,182,183,185,186,188,191,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,222,223,225,226,227,228,229,230,231,232,234,235,236,237,239,240,241,242,243,244,245,246,247,248,249,251,252,254,255,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,290,291,292,293,294,295,296,297,299,300,301,302,303,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,340,342,343,345,346,349,351,354,355,356,357,358,363,365,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,396,397,398,399,400,401,402,403,405,407,408,409,410,411,412,413,414,415,416,417,420,424,425,426,427,429,434,435,437,439,441,442,451,452,453,454,455,457,458,459,460,461,462,463,466,467,468,470,472,474,477,478,480,481,483,486,487,490,495,496],invokd:3,involv:[3,6,7,8,12,63,110,117,118,119,148,172,197,204,215,231,242,284,287,292,314,355,362,363,365,375,392,398,451,453,455,465,466,472,474,478,483],ioff:[364,469],ion:[6,7,9,150,279,311,326,356,377,388,396,397,419,422,440,450,455,462,469,490],ionic:[6,9,378,380,388,395,396,427,440,490],ioniz:[9,386,395],ionocoval:9,iparam:[3,216],ipi:[],ipp:[],ir3:167,ir4:167,irregular:[6,41,58,214,218,220,255,299],irrelev:426,irrespect:[416,417],irrevers:224,is_act:495,is_avail:495,is_defin:495,isbn:461,isel:[355,356],isenthalp:[255,256,257,258,259],ismail:[355,356,381,411],isn:[3,8,11,12,235],iso:[3,218,224,240,255,256,257,258,259,260,261,262,263,286,294,299,490],isobar:[255,256,261,262,263],isodem:395,isol:[3,171,337],isomorph:282,isotherm:[231,255,256,261,262,263,286],isotrop:[6,92,239,286,355,356,379,398,416,417],isovolum:300,isralewitz:303,issu:[1,3,6,9,11,12,13,14,15,17,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,43,45,46,47,48,49,51,53,54,56,59,71,73,81,104,111,114,145,155,174,175,177,178,179,180,182,183,185,186,188,193,200,203,213,217,218,220,221,226,227,230,231,234,239,253,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,282,286,288,291,299,301,302,313,317,318,319,324,330,334,336,339,340,342,343,345,346,349,351,356,364,365,368,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,396,397,398,399,400,401,405,407,408,409,410,411,412,413,414,415,416,420,425,426,427,429,434,435,442,449,451,452,453,454,455,457,458,460,461,462,469,471,472,478,481,486,487,495,496],ital:[432,433],itali:13,item:[6,7,8,41,191,194,214],iter:[3,6,12,39,41,63,192,200,201,213,214,218,224,226,229,237,281,290,291,299,302,321,337,339,354,361,362,363,365,369,440,464,474,478,483,487,495],ith:[71,119,121,205,206,207,208,209,210,211,212,316,328,487,495],itself:[2,3,4,6,7,8,9,11,12,13,18,42,59,91,109,159,191,192,193,194,195,207,208,219,224,240,250,254,293,299,326,337,339,364,365,387,396,398,402,403,452,467,473,476,477,481,495,499],ityp:[3,117,118,168,202,216,292,459],itype1:118,itype2:118,itypen:118,ivector:8,ivori:194,ixcm:299,ixi:[42,94,299,364,495],ixx:[42,94,299,364,495],ixz:[42,94,299,364,495],iycm:299,iyi:[42,94,299,364,495],iyz:[42,94,299,364,495],izcm:299,izrailev:303,izumi:454,izz:[42,94,299,364,495],j0jt:91,j20:207,j_m:142,jac:[6,174,481],jackson:423,jacobi:3,jacobsen:362,jagreat:13,jame:[9,19],janssen:280,januari:419,jaramillo:[7,9,13,395],jarzynski:303,jatempl:9,jcc:9,jcp:331,jec:13,jeff:13,jello:255,jensen:[239,355],jeremi:[9,421],jerom:9,jewett:13,jiang:[240,490],jiao:[9,13],jiht:[7,9],jik:377,jim:7,jku:7,jmake:12,jmm:142,joannopoulo:253,job:[12,60,302,477],jochim:[255,256],john:[7,9,13,192],johnson:[9,13],join:[6,472],joint:[3,284,401],jon:[9,70],jonathan:9,jone:[1,3,6,7,9,10,12,13,45,46,64,87,109,112,197,203,286,314,331,335,356,358,363,372,375,380,381,382,383,385,390,398,400,401,402,405,406,407,408,409,411,412,414,415,418,423,424,430,434,435,445,450,457,481,490],jonsson:[73,254,362,365,440],jorgensen:[6,185,387,407,411],joul:494,journal:[162,180,203,292,356,393,422,432,433,444,445,447],jparam:[3,216],jpeg:[3,12,193],jpeglib:12,jpg:[4,8,12,191,193,194,498],jpg_inc:12,jpg_lib:12,jpg_path:12,jpl:[7,9],jth:495,jtype1:118,jtype2:118,jtype:[3,118,216,459],jtypen:118,judg:483,judici:6,julien:9,jump:[],june:195,just:[3,6,8,11,12,13,17,19,22,29,42,44,59,61,91,109,112,118,143,146,147,161,176,191,206,210,211,220,224,228,245,252,286,288,299,321,326,337,339,341,364,365,370,372,375,384,402,430,457,467,471,473,474,476,477,488,490,495,498,499],justo:394,jusufi:[388,397],jut:335,jzimmer:9,k11:91,k22:91,k33:91,k_2:344,k_4:344,k_b:[],k_d:490,k_n:376,k_na:376,k_sigma:377,k_ub:20,kadiri:67,kalia:458,kamberaj:299,kapfer:108,kappa:[6,91,322,387,407,460,461],kappa_:326,karplu:87,karttunen:242,kate:[],kayser:388,kbit:194,kboltz:314,kbp:194,kbt:294,kcal2j:91,kcal:[236,478,490,494],kde:13,ke_eta_dot:255,ke_etap_dot:255,ke_omega_dot:255,keblinski:[387,440],kecom:148,keef:120,keep:[3,7,12,59,71,186,210,216,220,237,281,297,324,329,355,363,387,415,441,464,469,475,477,483,487,495],keflag:3,kei:[6,17,59,314,458,483],keir:13,kelchner:70,kelkar:329,kelvin:494,kemper:[291,386],kepler30:17,kepler32:17,kepler35:17,kepler37:17,kepler:[1,12,14,15,17,370],kept:[6,197,260,323,324,490],kernel:[7,13,17,40,101,131,137,203,232,233,306,422,443,444,445,446,447,448,479],kernel_radiu:469,keword:193,keyboard:12,keyword:[],keywrod:395,kforc:490,khaki:194,khersonskii:142,kick:[200,201,202,226,333],kilogram:494,kim:[],kimviri:[3,403],kind:[1,2,3,6,7,8,9,11,12,17,39,40,41,42,61,62,63,73,119,121,148,191,193,197,204,206,207,209,214,217,219,223,231,234,252,299,302,314,321,336,365,367,369,377,395,432,433,459,464,468,469,474,475,482,483,490,495],kinemat:[9,416,417],kinet:[3,6,8,9,63,82,83,84,85,87,91,95,96,97,98,99,114,143,145,146,147,148,149,150,151,153,154,155,156,157,158,160,161,197,204,206,218,224,231,235,239,251,253,255,256,257,258,259,260,261,262,263,286,289,314,322,329,330,363,395,464,483,487,490],kiss:12,kjl:349,klahn:325,klapp:355,klein:[6,9,203,219,255,256,277,299,407,435],kloss:7,kmax:[3,120,300,355],knc:17,knock:326,know:[3,11,12,41,63,109,118,197,224,238,240,269,314,363,394,403,456,467,470,473,478,490],knowledg:[4,8,193,403],known:[3,12,142,193,281,290,299,323,466,483,496],kohlmey:[7,9,13,18,355,356],kokko:[],kokkos_arch:17,kokkos_cuda:[12,17],kokkos_cuda_opt:17,kokkos_debug:17,kokkos_devic:17,kokkos_omp:[12,17],kokkos_pg:17,kokkos_phi:[12,17],kokkos_use_tpl:17,kolafa:356,kollman:[6,174,481],kondor:431,kone:[323,324],kong2011:281,kong:[9,13,281],konglt:9,koning00a:323,koning00b:323,koning96:[323,324],koning97:324,koning99:323,kooser:13,koskinen:362,kosztin:303,krau:13,kremer:[45,46,481],kress:[420,421],kspace:[],kspace_modifi:[],kspace_styl:[],kspce:12,kspring:254,kstart:298,kstop:298,kth:[232,282],kub:20,kubo:[6,91,322],kumagai:454,kumar:[9,416,417],kuronen:430,kurt:284,l12:419,l_box:395,l_skin:326,la3:167,laa:9,lab:[5,7,9,12,113,429],label:[],laboratori:[0,253,289],lack:[3,253,395],lackmann:377,ladd:[276,324],lafitt:423,lag:326,lagrang:[132,133],lagrangian:[6,124,125,126,127,129,130,131,132,133,134,135,137,138,139,140,203,253,289,290,305,306,437,439,490],lagrangian_posit:[253,289],lagrangian_spe:[253,289],lai:463,lambda1:[453,454,455,458],lambda2:[453,454,455],lambda3:[453,455],lambda4:458,lambda:[87,113,120,162,167,242,300,323,324,326,371,394,415,451],lambda_fin:323,lambda_initi:323,lamda:[3,53,314],laminar:448,lamm:6,lammps2pdb:[6,13],lammps_clos:6,lammps_command:6,lammps_extract_atom:6,lammps_extract_comput:6,lammps_extract_fix:6,lammps_extract_glob:6,lammps_extract_vari:6,lammps_fil:6,lammps_gather_atom:3,lammps_get_coord:6,lammps_get_natom:6,lammps_n:[6,12],lammps_open:6,lammps_potenti:[384,386,480],lammps_put_coord:6,lammps_quest:[6,229],lammps_scatter_atom:3,lammps_set_vari:6,lammps_sppark:6,lammps_vers:6,lammpsplot:13,lammpspotenti:384,lammpstrj:[470,474,490],lammpsviri:[3,403],lamoureux:[6,224,456,490],landron:440,lane:1,lang:490,langevin:[],langevin_drud:[],langston:[42,376],languag:[6,11,12,17,467,495],lanl:9,lapack:12,laps:327,laptop:7,larg:[0,1,3,5,6,7,8,9,10,12,13,14,16,18,39,40,41,58,59,70,71,111,118,143,148,151,156,168,169,170,180,188,190,191,193,194,206,210,211,214,217,218,220,221,225,231,242,255,269,276,281,284,285,289,294,296,297,298,299,302,311,314,322,326,327,329,331,335,349,355,356,361,363,366,370,385,391,395,398,399,406,422,424,428,434,452,464,467,469,471,472,476,478,483,486,488,490,496,499],larger:[1,2,3,6,11,12,13,39,41,56,59,70,71,118,168,170,193,207,209,212,221,235,242,255,276,277,285,290,294,298,299,300,310,314,321,326,330,331,332,335,355,356,361,362,363,365,366,367,370,377,385,387,388,395,399,407,411,417,424,428,449,450,457,469,473,474,477,478,483,495],largest:[3,6,12,39,71,166,168,225,355,363,367,449,452,469,471,477,478,489,495],laroch:294,laser:326,last:[1,2,3,5,6,11,12,15,38,42,56,59,61,71,112,119,143,166,188,191,193,194,195,196,206,207,209,210,211,212,214,225,254,297,300,311,314,339,353,363,364,365,366,370,374,375,376,377,378,385,386,391,393,397,398,400,401,405,408,410,412,413,414,417,423,425,434,440,442,449,452,456,457,460,461,464,465,467,470,474,476,477,481,483,484,487,488,495],lat:419,late:5,latenc:[10,236],later:[6,9,11,12,16,17,40,59,71,105,170,172,207,221,260,276,284,303,321,337,339,355,363,364,369,370,372,377,467,469,471,473,483,486,495,497],latest:[7,206,207,208,209,210,211,212,300,471],latex:8,latgen:281,latitud:142,lattc:419,latter:[2,6,11,12,14,15,16,17,41,42,87,146,194,198,199,205,206,210,211,214,218,237,246,255,257,258,259,261,262,263,284,286,288,290,292,299,314,330,335,354,364,377,379,380,381,382,383,390,407,411,415,422,427,435,440,456,464,466,467,472,475,486,495,498],lattic:[],launch:[1,3,6,11,12,17,18,370,466,467],laupretr:349,lavend:194,lavenderblush:194,lavgevin:220,law:[6,253,368,437,439],lawngreen:194,lawrenc:9,layer:[6,9,71,197,210,322,326,329],layout:[1,3,17,170,353,466,469,478],lb_fluid:242,lbl:[7,9,166],lbnl:9,lbtype:242,lcbop:[],ld_library_path:[11,12],ldfftw:12,ldrd:7,lead:[2,3,6,12,22,25,39,41,44,59,61,77,87,118,162,166,172,176,194,198,199,209,214,221,233,242,260,289,299,302,314,321,322,329,341,349,355,360,365,370,384,387,407,411,413,422,439,463,469,479,490,495,496],least:[3,6,12,18,71,120,167,192,204,210,233,284,288,330,366,370,376,402,452,457,467,495],leav:[3,7,11,12,17,21,41,57,143,158,175,214,218,221,255,257,258,259,261,262,263,286,299,302,340,424,469,473,481],lechman:314,lectur:303,led:[3,5],lee2:419,lee:[203,419],left:[6,11,12,41,109,144,187,193,194,217,237,279,314,337,339,358,469,471,476,495,499],leftmost:[41,214],legaci:12,legal:7,lehoucq:429,leimkuhl:334,leiu:391,lemonchiffon:194,len:479,lenart:[388,397],length:[3,6,8,11,12,18,21,38,39,40,41,42,44,53,54,55,56,58,59,61,65,68,69,71,74,79,80,82,87,88,89,90,91,93,104,106,109,110,114,116,117,119,120,121,130,132,145,146,147,148,149,150,151,152,153,155,156,157,158,159,160,161,164,166,167,170,175,188,191,193,194,197,204,208,209,211,212,214,215,216,217,218,220,231,234,242,253,254,255,256,260,269,280,286,296,299,300,302,311,314,321,325,326,328,331,335,356,358,361,363,365,366,368,373,376,377,378,380,387,388,392,395,397,401,405,407,419,424,432,433,443,452,453,460,461,469,472,477,479,486,487,490,495],lengthi:231,lennard:[],lenoski:[420,421],less:[1,3,6,13,14,15,16,17,18,38,41,56,57,58,59,71,76,92,108,110,117,118,146,147,161,188,194,206,209,210,211,212,214,216,217,218,220,221,228,237,253,255,280,292,294,300,314,333,334,336,356,358,363,367,370,377,382,398,399,416,417,424,434,451,452,455,461,469,495,496],let:[1,11,12,38,56,151,179,188,207,302,314,332,370,385,452,478,482,490,497],lett:[142,156,233,240,242,253,294,303,323,324,362,377,393,395,398,415,441,490],letter:[2,9,12,41,57,59,194,214,223,224,240,282,339,369,431],leuven:9,level:[2,3,8,11,12,14,17,191,193,198,199,208,236,252,254,255,339,353,356,369,377,381,382,407,408,411,418,422,423,432,433,466,478,483,488,495],lever:449,levin:399,lewi:304,lexicon:7,lgr_po:[253,289],lgr_vel:[253,289],lgvdw:433,li1:167,liang:386,lib:[1,3,9,11,12,14,15,17,293,370,386,403,467,470],libatom:[9,431],libcolvar:12,libdir:11,libfftw3:12,libgpu:15,libjpeg:12,liblammp:[11,12],liblammps_foo:[11,12],liblammps_g:[11,12],liblammpscuda:14,libmpi:11,libmpi_stub:12,libmpich:12,libpackag:12,libpng:12,librari:[],librt:17,licens:[0,7,8,12,193],lie:[6,300],lieu:355,life:7,lifo:8,ligand:311,liggght:7,lightblu:194,lightcor:194,lightcyan:194,lightest:321,lightgoldenrodyellow:194,lightgreen:194,lightgrei:194,lightli:311,lightpink:194,lightsalmon:194,lightseagreen:194,lightskyblu:194,lightslategrai:194,lightsteelblu:194,lightweight:314,lightyellow:194,like:[3,4,6,7,8,9,11,12,14,16,17,18,39,42,54,59,152,159,193,195,200,218,219,221,224,226,236,239,240,241,253,255,256,261,262,263,268,269,274,275,276,277,278,280,286,288,289,290,294,299,300,314,316,317,318,319,320,321,322,329,330,331,334,335,336,339,355,358,362,365,370,377,385,390,391,395,396,399,401,402,412,413,419,441,452,455,460,461,466,467,469,470,471,472,474,479,484,487,488,490,495,496],likelihood:[120,167,217],likewis:[1,6,10,12,15,16,18,39,41,71,88,117,203,214,215,216,231,239,240,255,256,260,277,294,314,317,318,319,356,365,371,375,377,387,393,396,422,450,467,469,471,481,495],likhtman:208,lime:194,limegreen:194,limit:[],limit_eradiu:395,limit_veloc:[305,306],lindahl:355,line:[],linear:[],linearli:[10,119,194,220,281,331,333,334,336,364,365,367,469,495],lineflag:[6,469],lineforc:[],linen:194,linesearch:[8,12,361],ling:[9,13],lingo:[11,403],link:[5,6,7,8,9,11,12,13,14,15,17,22,37,44,55,63,176,187,193,197,216,236,240,284,293,295,303,311,341,350,373,384,419,431,432,433,450,456,467],linker:12,linkflag:[12,16,18],linux:[10,11,12,15,193,195,236],linuxamd64:470,liouvil:255,lip:13,lipid:[4,9,10,13,29,299],lipton:284,liquid:[6,7,9,29,39,40,41,59,87,92,143,154,166,214,218,220,231,255,286,289,294,321,390,422,424,427,454,478],lisal:449,lism:9,list:[],listen:[236,238],listfil:406,liter:[469,480],literatur:[6,8,419,440,451],lithium:395,littl:[1,3,12,64,255,366,464,472],littmark:[419,450,455,462],liu:[401,433],livermor:9,lj1043:[],lj126:[],lj12_4:435,lj12_6:435,lj1d:281,lj6:3,lj93:[],lj96:[],lj9_6:435,lj_flag:372,llnl:[5,7,9],lmp1:11,lmp2:11,lmp2arc:[],lmp2cfg:[],lmp2vmd:[],lmp:[11,467,490],lmp_auto:12,lmp_cuda:[14,17],lmp_foo:12,lmp_g:[6,11,12,13,17,354],lmp_gpu:15,lmp_ibm:[12,354],lmp_inc:12,lmp_intel_cpu:[],lmp_intel_phi:[],lmp_kokkos_cuda:17,lmp_kokkos_omp:17,lmp_kokkos_phi:17,lmp_linux:[4,6,12],lmp_mac:12,lmp_machin:[1,12,14,15,16,370],lmp_mpi:[12,17,18,19,282],lmp_mvapich:17,lmp_omp:[],lmp_openmpi:17,lmp_opt:[],lmp_win_mpi:12,lmp_win_no:12,lmpptr:[11,467],lmpqst:229,lmpsdata:13,lmptype:[3,12,229],load:[1,3,4,6,7,9,11,12,16,17,18,41,193,195,197,214,236,289,370,386,466,467,488],loadabl:11,loca:194,local:[],localhost:236,localized_lambda:203,localonli:12,localvector:63,locat:[3,6,8,9,11,12,27,61,118,120,166,167,177,188,191,221,222,242,313,324,335,361,384,387,396,397,407,409,411,456,466,469,470,472,479,481],lock:[3,369,495],lockstep:[218,255,286,299],log:[],logarithm:[138,139,495],logfil:[0,3,6,12,287,359,465],logfreq2:495,logfreq:[194,476,485,495],logic:[7,11,12,17,41,168,214,337,339,464,466,467,470,478,483,495],lomdahl:[260,409],london:[13,231,433],lone:[432,433],longer:[1,3,6,8,12,13,54,118,191,194,205,206,207,208,209,210,211,212,215,231,239,280,284,289,299,302,321,331,335,337,361,370,372,399,440,466,474,478,483,492],longest:[41,214,215,366,457],longitudin:311,look:[1,3,6,8,11,12,18,54,61,191,193,196,384,441,452,490,495],lookup:[3,39,188,424,452],lookup_t:300,loop:[3,4,6,7,11,12,18,39,42,65,68,69,79,88,93,110,117,118,143,193,206,210,211,215,216,225,321,337,339,354,357,363,365,366,368,369,392,422,440,464,465,467,473,474,477,478,483,488,489,495,496],loopa:[339,354,369],loopb:[339,354,369],loopmax:440,loopvar:495,lopez:[255,256],lorant:290,lorentz:167,lose:[6,58,59,170,218,220,240,255,399,469],loss:[6,494],lossi:193,lossless:193,lost:[3,12,13,57,103,221,297,304,314,424,469,470,471,478,486],lot:[18,303,355],low:[1,3,6,7,12,41,151,166,191,193,214,224,240,276,294,299,322,329,356,422,433,452,461,483,490],lower:[2,3,6,9,11,12,41,57,59,71,88,144,157,190,193,194,207,208,209,210,211,214,218,224,236,239,240,242,255,289,294,322,329,331,332,337,338,355,358,369,388,419,483,491,493,496],lowercas:193,lowest:[142,339,364,479,483,484,495],ls_:136,lsfftw:12,lsurfac:326,lu3:167,lubric:[],lubricateu:[],lubricuteu:266,lucki:12,luigi:13,lumped_lambda_solv:203,lussetti:322,lustig:[7,13],lybrand:356,lyulin:349,m4v:193,m_c:[],m_d:490,m_eff:[332,399],m_fill:3,m_i:312,m_lambdai:429,m_taubi:429,m_u:242,m_v:242,m_yield_stress:429,mac:[12,14],mac_mpi:12,mach:[9,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,304,305,306,307,310,479],machin:[1,3,4,6,7,9,10,11,12,14,15,16,17,18,19,191,193,236,327,355,361,363,368,370,422,466,471,476,477,478,496,499],mackai:[9,242,244,245,246],mackerel:[6,20,174,240,382,481,490],maco:193,macro:17,macroparticl:392,macroscop:[7,234,253,429],made:[3,6,11,12,15,16,33,41,42,50,64,169,181,191,193,195,197,198,199,204,214,221,225,236,245,285,293,297,299,324,337,347,366,370,398,399,402,432,434,442,466,473,479,482,491,493,496,497],madura:[6,407],magazin:393,magda:331,magenta:194,magic:[3,11],maginn:[162,329],magnitud:[6,70,106,110,115,144,168,190,191,194,221,222,234,235,237,239,303,311,313,314,321,332,356,363,390,399,479],mai:[0,1,2,3,6,7,8,11,12,13,14,15,16,17,18,29,38,39,40,41,56,58,59,61,63,65,68,69,71,79,86,87,88,89,90,92,93,103,104,106,108,109,110,111,112,114,115,116,117,119,120,121,142,143,146,147,148,156,157,161,162,166,167,168,169,170,171,172,187,188,190,191,192,193,194,195,197,198,199,200,202,204,206,207,208,209,210,211,212,213,214,215,216,218,220,221,224,225,226,228,231,232,233,235,236,237,239,240,241,242,243,245,250,251,252,253,255,256,260,269,272,281,282,285,286,287,288,289,291,294,296,297,298,299,300,301,302,303,305,306,308,314,316,317,318,321,322,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,353,354,355,356,358,361,362,363,364,365,366,367,368,370,373,375,377,385,391,395,399,402,403,413,415,417,419,420,421,422,424,432,433,435,441,449,452,458,462,464,465,466,467,469,470,471,472,473,474,475,476,477,478,479,481,483,486,487,490,495,496,497,499],mail:[3,7,9,12,337],main:[3,6,8,11,12,236,242,299,323,324,393,440,456,467,484],mainboard:1,mainli:[370,427],maintain:[8,9,13,39,153,216,220,276,314,327,362,371,393,478,481],major:12,make:[],makefil:[3,7,9,11,12,13,14,15,16,17,18,19,191,356,370,422,467],makelist:12,maks:399,malloc:[3,12],manag:[5,8,12,191,236,282,316,478],manbi:441,mandadapu:203,mandatori:[8,191,219],manh:377,mani:[1,2,3,4,5,6,7,8,9,12,13,14,15,16,17,18,38,39,41,42,56,61,63,68,71,88,91,103,104,118,144,148,168,169,188,190,191,192,193,194,195,197,198,199,200,204,205,206,207,208,209,210,211,212,214,215,216,217,218,220,221,228,231,232,235,236,242,243,251,253,255,256,260,269,279,280,281,285,288,290,291,292,294,296,299,300,302,314,325,326,328,337,339,355,363,365,366,368,370,384,386,392,395,397,401,402,440,441,450,452,453,455,467,469,471,473,474,476,477,478,479,481,482,483,484,488,495,496,499],manipul:[12,41,214,236,387,430,480],manner:[2,3,6,9,11,17,41,143,164,198,199,200,201,209,214,220,225,226,229,235,239,240,255,261,262,263,274,275,276,278,293,317,318,319,322,323,324,329,331,335,339,356,364,365,369,370,393,395,402,405,416,457,464,466,469,470,471,472,474,478,483],manolopoulo:238,mantissa:3,manual:[0,1,3,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,43,45,46,47,48,49,51,53,54,56,58,63,68,71,111,114,120,145,146,147,149,150,151,154,155,156,157,158,160,161,167,174,175,177,178,179,180,182,183,185,186,188,191,193,195,200,210,213,220,227,230,234,238,239,240,254,255,257,258,259,260,261,262,263,264,265,267,270,272,273,274,275,276,278,286,288,291,299,300,301,302,317,318,319,329,330,334,339,340,342,343,345,346,349,351,356,365,369,370,371,372,374,375,378,379,380,381,382,383,385,386,387,389,390,391,393,394,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,420,425,426,427,429,434,435,442,451,452,453,454,455,457,458,460,461,462,464,472,478,482,483,484,487,495],manybodi:[3,7,8,9,12,143,144,363,371,372,377,386,393,396,402,404,426,430,451,453,454,455,458,481,495],map:[2,3,11,12,17,18,39,59,64,71,120,124,142,156,167,168,190,193,194,203,210,281,298,355,356,358,365,371,372,377,386,393,394,396,402,403,404,419,420,421,424,426,430,431,432,433,440,441,449,451,452,453,454,455,458,466,469,471,483,495],map_fil:281,mapflag:12,mara:[9,440],march:419,margin:483,mari:13,mark:[400,415,437,439,440],marker:287,maroon:194,maroonmpi:11,marrink:400,marsaglia:[3,232,233,239,240,294],marseil:9,martin:[281,419],martinez:204,martyna:[255,256,299,478],mashayak:17,mask:[3,280,495],mask_direct:203,mass:[],mass_matrix:203,massdelta:302,massiv:[0,193,242,282,322,329],massless:[6,240,356,387,407,411,415,490],masstot:299,master:[3,365,464,483],mat:[67,203,386,454],match:[3,6,8,9,11,12,17,38,41,56,59,71,118,151,188,194,195,214,217,220,236,255,256,276,296,300,314,321,355,356,377,401,413,419,431,432,433,452,463,467,469,470,471,474,478,483,490,495],matchett:[42,376],mater:[73,371,421,430,440],materi:[6,7,9,59,70,126,127,171,202,203,220,231,237,253,280,286,294,322,326,332,387,393,394,395,399,403,419,420,422,429,432,433,436,437,438,439,464,469,483,490,494],material_fil:203,math:[],mathemat:[120,142,167,168,190,198,199,200,201,213,218,226,232,234,235,237,239,240,287,301,308,317,318,319,331,334,336,441,465,472,479,496],mathrm:[],mathtt:[],matlab:[],matric:[9,142,233,281,398],matrix:[3,6,9,91,166,207,218,233,281,290,355,358,422],matter:[6,9,12,39,57,59,71,150,210,326,366,372,389,393,395,419,435,440,453,455,458,462],mattson:[114,143],max2theta:167,max:[3,6,8,12,15,18,71,119,194,209,214,216,218,221,285,302,314,339,358,361,363,365,366,370,440,464,469,483,487,495],max_alpha:8,max_cell_s:392,max_group:3,max_nn:306,max_travel:307,max_vel:[305,306],max_veloc:306,maxangl:231,maxbodi:3,maxbond:[3,216],maxedg:166,maxev:[363,464,483],maxfoo:8,maxim:[321,365],maximum:[3,6,8,12,15,17,25,41,42,45,53,54,57,59,61,92,108,118,119,120,123,166,167,169,170,190,191,202,207,208,209,214,216,220,221,225,231,269,280,285,290,302,304,305,306,314,327,355,356,361,365,366,370,373,377,392,397,416,417,440,469,472,477,487,495,496],maxit:[290,363,464,483,487],maxsize_restart:8,maxwel:[17,279],maxwell50:17,maxwell52:17,maxwell53:17,maxx:430,mayb:13,mayer:[7,378,380,440,450],mayo:[6,7,13,25,351,401,481],mbt:175,mbyte:[12,294],mcdlt:[158,235],mcgraw:282,mdash:490,mdatom:231,mdf:[],mdnvt:231,mdregion:203,mdtemp:231,mdump:[41,214],meain:[],meam:[],meam_sw_splin:421,meamf:419,mean:[1,2,3,4,6,7,8,10,11,12,17,22,34,37,38,39,41,42,44,52,54,55,56,57,59,61,63,68,71,72,76,77,82,84,85,87,91,92,104,105,106,108,114,115,116,117,118,119,142,143,145,146,147,149,150,151,154,155,156,157,158,160,161,162,168,169,171,172,174,176,184,187,188,189,190,191,193,194,195,197,198,199,202,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,226,229,231,232,233,234,235,237,239,240,241,245,252,255,257,258,259,260,261,262,263,269,274,275,276,278,280,282,284,285,286,288,294,296,297,299,301,302,303,308,311,314,316,317,318,319,321,322,325,326,328,329,330,331,332,333,334,335,336,337,341,342,343,344,346,348,350,355,356,358,360,361,363,364,365,366,368,370,373,378,380,381,382,384,387,391,392,393,395,398,399,401,402,405,407,408,411,418,419,423,424,427,428,430,432,433,434,435,449,451,452,453,454,455,457,461,463,464,466,467,469,470,471,472,473,474,475,476,477,478,479,480,481,483,484,486,487,490,494,495,496,497,499],meaning:[118,126,127,129,132,136,402],meaningless:[67,321],meant:[6,299,456,473],measur:[],meaur:488,mech:429,mechan:[6,8,9,11,12,16,17,128,144,203,235,282,293,377,395,403,409,422,437,439,463,467,469],mechanic:293,mechanim:124,meck:108,media:193,medium:461,mediumaquamarin:194,mediumblu:194,mediumorchid:194,mediumpurpl:194,mediumseagreen:194,mediumslateblu:194,mediumspringgreen:194,mediumturquois:194,mediumvioletr:194,mee:321,meet:[3,12,169,193,194,216,217,327,474],mehl:371,mei:418,meloni:39,melros:[416,417],melt1:195,melt2:195,melt3:195,melt:[4,10,217,281,377,422,454],mem:15,member:[171,284,377],membran:[29,279,461],memori:[1,3,5,6,7,8,9,12,15,16,17,18,39,40,60,71,194,206,208,210,211,232,233,294,326,353,366,370,377,424,428,433,466,469],memory_usag:8,mendelev:393,mention:[1,6,7,11,42,220,235,242,260,331,358,365,372,432,433,471,495],menu:[193,236],mep:[254,365],mer:[4,10,217],meremianin:142,merg:[3,5,469],merz:[6,174,481],mescscop:429,mesh:[1,2,3,6,7,8,10,12,40,41,42,120,136,167,203,214,242,300,310,355,356,392,422],meshless:9,meso:[],meso_:[],meso_cv:479,meso_rho:[],meso_t:[],mesocop:40,mesoscal:7,mesoscop:[7,100,101,102,248],mess:[3,479],messag:[],met:[8,41,118,214,339,354,356,363,365,369,457,477],metadynam:[9,13,219],metal:[3,5,7,9,10,40,59,71,157,168,202,203,210,211,220,221,235,237,289,290,294,330,331,333,334,336,356,358,367,371,372,377,386,393,394,395,396,402,404,419,420,421,422,430,431,440,451,453,454,455,458,472,486,487,489,494],meter:[367,494],methan:[289,294],methanol:4,methin:349,method:[1,3,5,6,7,8,9,11,12,13,16,17,19,38,39,40,41,56,64,87,91,112,143,188,193,197,198,199,203,207,208,214,219,229,239,242,246,250,253,255,281,282,289,290,291,292,294,299,302,303,321,322,323,324,329,355,356,361,362,363,365,370,371,373,377,386,387,393,395,396,419,420,421,424,430,440,450,452,458,464,466,467,469,470,472,483,490],methodolog:[6,73,143,282,355],metin:[7,9],metric:[3,10,64,472,487],metropoli:[204,231,484],mezei:87,mf1:195,mf2:195,mf3:195,mg2:167,mglob_default_function_attr:12,mgoh:426,mgpt:[],miai:294,mic:[12,17],micel:[4,13,312],micelle2d:[],michael:[9,13,421],michel:13,mickel:108,micro:[3,489,494],microcanon:[264,265,267,268,270,272,273],microelast:429,micromet:494,micropor:231,microscal:416,microsec:494,microsecond:494,mid:[5,9,59,220,422,449],middl:[3,6,8,16,22,41,44,77,87,118,157,162,166,172,175,176,194,198,199,205,214,285,297,298,299,322,329,340,341,360,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,420,421,422,423,425,427,429,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,460,461,462,463,467,477,478,479,495],middlebondtors:[3,175,469],midnightblu:194,midpoint:449,mie:[],might:[3,4,6,7,8,12,14,25,71,150,229,231,233,299,440,467,477,495],migrat:[3,8,17,41,42,59,61,65,69,79,93,110,117,191,197,214,280,288,294,314,355,367,370,477,497,499],mikami:[6,255,256],mike:[7,9,13,15,16],mil:[9,393],mill:362,miller:299,million:[3,7,10,39,41,71,214],mimic:[6,42,54,240,253,285,387,397,407],mimim:[218,365],min2theta:167,min:[3,4,6,8,12,119,142,194,209,355,358,440,449,464,483,495],min_cap:3,min_cg:8,min_clearstor:8,min_dof:8,min_modifi:[],min_nn:306,min_popstor:8,min_post_forc:8,min_pre_forc:8,min_pushstor:8,min_setup:8,min_setup_pre_forc:8,min_step:8,min_stor:8,min_styl:[],minarea:166,mincap:433,mind:[7,232,281],mine:[12,88,158,159,197,337,492],minim:[],minima:[180,351],minimi:[365,457],minimizaiton:365,minimizi:294,minimum:[3,12,25,26,27,42,45,57,59,86,106,119,166,167,169,171,177,190,191,193,202,209,218,219,225,238,254,296,298,300,304,306,310,314,331,335,339,351,355,358,361,362,363,365,366,382,395,398,400,401,407,409,411,416,417,433,435,449,464,477,483,495,496],minlength:166,minmiz:[8,218],minn:9,minord:[3,355],mintcream:194,mintmir:[7,290,387,450],minu:[12,59,148,220,339,365,495],minut:[4,8],mirror:[61,333],misc:[],miscellan:[2,203],mise:[135,140],mishin:[371,450],mismatch:3,miss:[3,5,12,171,209,231,269,294,314,406,424,486,487],mistak:[3,495],mistakenli:3,mistyp:3,mistyros:194,mitchel:[6,113,150,355,356,389,429],mitchell2011:429,mitchell2011a:429,mitur:374,mivi2:294,mix:[1,3,6,9,14,15,16,71,117,150,209,210,327,355,356,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462,467,469,482,490,497],mixtur:[6,40,255,299,314,336,385,419,469],mixture_ref_t:419,mjpeg:193,mkdir:480,mkl:12,mkmk:281,mkv:193,mldivide3:3,mlpark:7,mlutipl:212,mn2:167,mn3:167,mn4:167,mo3:167,mo5:[167,422],mo6:167,mobil:[6,106,143,145,146,147,149,154,161,193,299,337,338],moccasin:194,mod:[],mode:[1,3,6,9,11,12,13,14,15,16,17,18,61,66,75,88,90,94,105,107,116,118,119,144,148,163,165,166,167,191,193,194,209,212,219,220,229,233,255,282,294,303,314,353,355,367,370,387,395,422,440,466,471,476,478,487,494,495,499],model:[],model_ar_p_mors:403,modern:[12,239,241],modest:[1,368],modif:[6,13,87,419,422,434,455,490],modifi:[],modify_param:8,modin:203,modul:[3,9,11,12,13,219,294,467],modular:8,modulo:[3,495],modulu:[286,399,419,429,436,438],mofil:470,mol1:495,mol:[3,9,71,115,168,170,171,191,194,219,221,231,236,239,285,288,299,302,310,316,390,398,435,478,479,490,495],molchunk:[66,75,90,94,105,107,148,163,165,206],mole:[204,393,494],moleclu:[215,216,221,228],molecul:[],molecular:[0,2,3,5,6,7,8,9,12,13,39,40,53,71,110,115,117,145,146,147,149,151,154,155,156,157,160,161,168,169,170,171,172,180,191,192,195,203,216,219,231,238,281,282,289,293,294,298,303,325,326,356,364,373,374,377,381,392,395,402,450,469,470,471,473,474,478,479,481,487,489,490,495],molfil:[],molfrac:[221,285],molnar:303,molp:111,moltempl:[],molybdenum:422,mom:[6,91,298,496],momementum:[146,147,257,258,261,262,265,266,267,274,275],momemtum:66,moment:[3,6,9,40,42,82,84,85,107,115,146,161,168,189,191,239,242,245,272,285,299,312,364,390,394,440,469,479,490,494],momenta:[233,266,329,395],momentum:[],momon:217,monaghan:[9,444,445,447],monitor:[3,6,12,97,98,151,218,220,221,228,236,239,253,255,285,287,289,299,302,314,363,365,390,487],mono:[73,416],monodispers:[3,332,379,399,416,417],monom:[13,54,217],monoton:[3,303,325,365,483],monoval:356,mont:[6,7,9,197,204,217,231,299,321,392,450],montalenti:[464,483],month:0,moor:[17,143],more:[0,1,2,3,4,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,58,59,61,62,63,64,65,67,68,69,70,71,72,77,78,79,80,83,86,87,88,90,92,93,97,98,99,100,101,102,103,104,106,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,150,151,152,154,155,156,157,159,160,161,162,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,185,186,187,188,190,191,192,193,194,195,197,198,199,200,201,202,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,227,228,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,270,272,273,274,275,276,277,278,280,281,282,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,301,302,303,304,305,306,307,308,310,314,316,317,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,349,350,351,353,355,356,358,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,424,425,426,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462,464,465,466,467,469,470,472,473,474,475,476,477,478,479,480,481,482,483,484,486,488,490,495,496,497,498,499],morefoo:8,moreov:[215,216],moriarti:[9,422],moriarty1:422,moriarty2:[9,422],moriarty3:422,morri:[],morriss:[156,276],mors:[],morse_f:452,mosel:362,mosi2:419,moskalev:142,most:[0,1,2,3,4,5,6,7,8,10,11,12,15,17,18,19,37,39,41,55,71,104,110,156,166,187,191,193,194,206,209,210,211,212,214,215,216,218,235,255,256,282,287,288,289,290,299,300,327,329,337,339,350,356,362,366,368,370,372,395,398,419,431,432,433,455,464,465,466,478,483,487,488,495,497],mostli:[8,9,11,13,71,170,193,366,469,478,481,495,498],motiion:6,motion:[3,6,7,9,42,86,98,104,145,146,147,149,151,153,154,155,156,157,158,160,161,220,224,233,242,245,246,252,255,256,260,276,280,282,284,294,298,299,322,326,332,335,365,390,395,416,417,472,478,490],motiv:280,mous:236,mov:193,move:[],move_tri_surf:[],movement:[3,6,12,252,321,363,487],movi:[],mp4:193,mpeg:193,mpg:193,mpi4pi:11,mpi:[],mpi_allreduc:[299,467],mpi_barri:1,mpi_cart:466,mpi_cart_cr:466,mpi_cart_get:466,mpi_cart_rank:466,mpi_cart_shift:466,mpi_comm:6,mpi_comm_world:11,mpi_fastmgpt:422,mpi_get_processor_nam:466,mpi_inc:12,mpi_lib:12,mpi_lmp_bigint:3,mpi_lmp_tagint:3,mpi_path:12,mpi_wtim:12,mpicc:11,mpich2:12,mpich:[12,14,15,16,17,18,370],mpich_icc:16,mpicxx:[12,17],mpiexec:[12,14,15,16,17,18,370],mpiio:[3,191,194,471,476,499],mpirun:[1,6,11,12,14,15,16,17,18,19,282,354,370],mplayer:193,msd:[],msi2lmp:[],msi:13,msm:[],msmse:[120,167,300],msse3:422,msst:[],mtchell2011:429,mtchell2011a:429,mtd:219,mth:[8,121,194,486],mtk:[255,256,260],mtotal:364,mu_j:29,muccioli:398,much:[1,3,6,11,39,144,191,193,208,218,289,321,366,367,370,398,434,464,467,483,488,490,495],mui:[115,191,226,316,469],mukherje:[7,9,284],mulder:325,muller:[6,91,197,322,329,423],mult:8,multi:[],multibodi:[3,61,284],multicent:395,multicor:[1,466,482],multidimension:13,multielectron:373,multilevel:[355,356],multiphys:11,multipl:[],multipli:[3,87,91,118,176,187,198,199,207,239,242,280,286,358,363,372,469,495],multiprocessor:370,multiscal:11,multisect:[41,214],multistag:87,multitud:7,mundi:277,munich:9,murdick:377,murti:454,murtola:355,must:[1,2,3,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,56,57,59,61,62,71,82,84,86,87,105,109,111,114,117,118,119,120,121,146,150,157,161,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,185,186,188,189,190,191,192,193,194,195,198,199,200,202,203,204,205,206,207,209,210,211,212,213,214,215,216,217,218,220,221,224,226,229,231,232,233,235,236,237,238,239,240,242,243,244,245,246,250,251,252,253,254,255,256,257,259,260,261,263,265,266,267,269,272,274,278,280,284,285,286,287,288,289,290,292,294,296,297,298,299,300,301,302,308,310,311,313,314,317,318,319,321,322,324,325,326,328,329,331,332,333,334,335,336,337,339,340,341,342,343,344,345,346,347,349,351,355,356,358,360,363,364,365,366,367,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,437,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,464,465,466,467,469,470,471,472,474,476,477,478,479,480,483,484,486,487,490,494,495,496,497,499],mutli:6,mutlipl:469,mutual:[3,358,488],mutut:478,muvt:231,mux:[115,191,193,226,316,469],muz:[115,191,226,316,469],mv2_comm_world_local_rank:12,mvapich2:[17,370],mvapich:12,mxn:[12,282],my_ga:231,my_one_wat:231,my_post_process:480,my_qeq:290,my_setup:480,my_swap_region:204,myblock:[221,285],mybox:170,mychunk1:116,mychunk2:116,mychunk:[6,66,75,90,94,105,107,148,163,165],mycmap:469,mycom:209,mydump:[191,194],myer:[5,7],myfil:[466,495],myfix:[204,484],myflux:91,myforc:[191,498],myhug:260,myke:91,mymol:[40,302,364],mympi:11,mymultipli:[467,495],myn:467,mype:91,mypi:495,mypress:250,myramp:143,myrdf:[118,212],myreg:358,myregion:337,myrigid:[83,99,285],mysocket:238,myspher:[194,335],mystr:339,mystress:91,mytemp:[2,103,145,146,147,149,151,152,154,156,161,250,339,354,369,486,496],myz:469,n_dephas:464,n_element:192,n_f:[289,294],n_hbond:401,n_ij:399,n_ion:326,n_k:232,na1:167,nabla:326,nacl:[4,6,419],nacl_cs_x0:6,nakano:[290,292,365,458],namd:[7,9,191,236],name1:[162,220],name2:[162,220],name:[0,1,2,3,5,6,8,9,11,12,13,33,42,50,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,181,190,191,192,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,257,258,259,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,281,282,283,284,285,286,287,288,289,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,327,328,329,330,331,332,333,334,335,336,337,338,339,347,353,354,356,357,359,364,365,369,371,372,377,380,393,394,396,398,399,402,403,404,406,419,420,421,426,430,432,433,440,441,451,453,454,455,456,458,459,466,467,469,470,471,472,476,479,482,484,485,487,490,495,496,497,498,499],namespac:[6,8,12],nan:3,nangl:[3,469],nangletyp:[364,469,479],nano:[299,489,494],nanoindent:70,nanolett:299,nanomet:[191,194,494],nanoparticl:[214,299],nanosec:494,nanosecond:494,nappli:229,narea:3,narrow:[6,188],narulkar:[453,455],nasa:7,nasr:281,natdef:3,nation:[0,7,9,12,113,429],nativ:[1,6,7,12,16,17,191,195,470],natoli:[9,19],natom1:117,natom2:117,natom:[6,11,39,364,467,469,486,487,495],nattempt:285,natur:[6,9,142,220,255,280,294,332,393,395,396,419,430,466,495],navajowhit:194,navi:[194,393],navier:242,nb3:167,nb3b:[],nb3bharmon:426,nb5:167,nbin:[118,209,210,211,322,329],nbodi:[245,299,422],nbond:[3,115,469],nbondtyp:[194,364,469,479],nbot:377,nbounc:314,nbrhood_cutoff:433,nbtype:117,nbuild:487,ncall:229,ncbin:71,nchar:194,nchunk:[3,6,66,71,75,90,94,105,107,116,148,163,165,206],ncoeff:441,ncorr:208,ncorrel:208,ncount:[206,207,208],nd3:167,ndanger:487,nden:[6,91],ndihedr:[3,469],ndihedraltyp:[364,469],ndim:210,ndirango:299,ndof:[255,260],ndoubl:469,ndp:490,ndx:338,neal:299,nearbi:[7,62,169,221,252,291,314,335,366,372,416,417,450,461,490],nearest:[3,70,71,73,92,108,166,169,242,254,280,321,335,355,406,419,440,452,495],nearli:[6,9,18,54,59,214,239,314,395,422,424,464,467,473,481],neb:[],neb_combin:365,neb_fin:365,neb_log:483,neb_step:483,neb_styl:483,necessari:[6,9,11,12,13,15,17,33,61,87,176,181,187,195,214,218,219,231,232,293,314,327,337,355,370,415,422,424,440,469,470,474,477,478,479,483,490,498],necessarili:[12,294,321,342,343,344,346,358,424,496],necessit:288,need:[1,2,3,5,6,7,8,9,11,12,13,14,15,16,17,18,33,37,38,39,40,41,42,50,54,55,56,58,61,63,64,67,70,72,73,77,82,91,92,103,105,108,111,114,130,142,143,145,146,147,148,149,151,154,155,156,157,158,160,161,168,170,174,176,181,187,188,190,191,192,193,194,198,199,200,201,203,204,206,207,208,209,210,211,212,214,215,216,218,219,220,224,226,229,230,231,235,236,238,239,240,242,248,249,255,269,281,285,286,288,294,298,299,303,310,314,322,325,326,328,329,330,331,337,347,350,355,356,364,365,366,367,370,371,372,373,374,377,378,379,380,381,382,383,385,386,387,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,460,461,464,467,469,470,471,472,474,476,477,479,481,482,483,490,495,497,498,499],needless:[6,366],neeed:9,neelov:356,neg:[3,6,12,27,46,65,69,89,103,110,117,142,143,170,172,177,179,188,193,218,220,221,232,260,280,303,311,325,329,331,336,355,362,396,410,419,450,469,472,488],neglect:[376,401,417],neglig:[6,11,87,255,451],neigh:[2,3,12,15,370],neigh_modifi:[],neighbor:[],neighborhood:[26,92,124,441],neighbour:240,neighobr:[6,387,407,411],neither:[2,3,12,41,63,203,217,220,221,372,379,395,416,417,474],nelem:441,nelement:[371,393],nelson:[92,108],nemd:[],nest:[2,339,352,369,495],net:[3,6,11,39,86,88,149,160,235,280,290,299,417,433],netpbm:193,network:[12,191,215,216,236,466],neumann:355,neutral:[3,88,231,355,387,407,440],never:[7,12,63,71,197,207,218,231,255,280,302,316,327,331,334,336,355,366,393,419,441,458,466,469,483,486,495],neveri:[3,8,71,200,205,206,207,208,209,210,211,212,215,216,217,242,243,281,290,291,292,295,296,300,322,328,329,365,440,474,483],newatom:221,newer:[12,206,419,495],newfil:[352,354],newli:[221,490,496],newlin:194,newn:299,newt:155,newtemp:[63,103],newtion:[377,422,430],newton:[],newtonian:232,newtyp:[3,216],next:[],neyt:321,nfile:[3,38,56,188,191,194,452,471,476,499],nfirst:474,nfirt:474,nfreak:300,nfreq:[39,71,205,206,207,208,209,210,211,212,214,296,300,474],nghost:[3,12],ngp:106,ngpu:370,nguyen:[15,377],nharmon:[],nhc:282,nht:299,ni2:167,ni3:167,ni_000:[120,300],nialh_jea:393,nialhjea:[384,402],nice:[6,8],nickla:421,nicola:9,nimprop:[3,469],nimpropertyp:[364,469],nine:[129,136,396,440],ninteg:469,nissila:[242,440],nist:[371,393,494],niter:[41,214],nitrid:387,niu3:[384,393,402],nkb:289,nlast:474,nlen:208,nline:364,nlocal:[3,8,11,12,229],nlog:356,nlvalu:108,nmax:42,nmin:42,nmol:469,nmpimd:282,nn2:419,nneighmaxdef:3,nnn:[92,108],no_affin:[16,370],no_gradient_correct:439,no_histori:6,no_velocity_gradi:439,noced:363,nocheck:406,nocit:12,nocoeff:497,nodal:[6,38,56,188,203,326,452],node:[1,3,12,14,15,16,17,18,41,120,124,167,192,214,236,242,326,370,406,466,482],node_area:242,node_group:203,nodeless:395,nodeset:203,nodeset_to_elementset:203,nodess:16,nof:188,noforc:[],nois:[6,232,233,239,240,241,242,289,294,299,318,326],nomenclatur:[6,71,210,358],nomin:[191,255],non:[],nonbond:[4,12,426,450],none:[],noneq:233,nonequilibrium:[9,323,324,395],nonetheless:239,nongauss:[],nongaussian:106,nonlinear:[],nonloc:[429,479],nonperiod:3,nonzero:3,noordhoek:386,nopreliminari:188,nor:[2,3,41,59,203,304,305,306,307,308,310,386,436,437,438,439,469,472],nord:[430,453,455],norder:466,nordlund:[430,453,455],norm:[6,12,63,119,197,206,210,211,300,305,306,363,365,449,486,487,494],normal:[3,6,9,10,11,12,39,41,58,61,63,67,70,71,73,88,91,103,104,114,118,119,153,156,168,169,170,188,194,197,206,207,209,210,211,214,218,220,221,230,231,235,239,240,252,255,269,280,282,283,290,294,296,297,303,314,315,317,318,319,326,331,332,335,336,340,342,343,344,346,360,362,363,365,370,376,385,386,398,399,402,422,449,462,463,464,467,469,471,472,474,475,479,483,486,487,488,490,494,495,498],norman:326,nornal:3,nose:[6,7,8,158,197,224,239,240,255,256,257,258,259,260,261,262,263,274,275,276,277,278,282,286,294,299,317,318,319,324,391,490],noskov:[456,490],noslip:[314,336],nosync:488,notabl:[5,39],notat:[6,61,63,70,142,162,197,252,255,393,458,495],note:[1,2,3,6,7,8,9,11,12,13,14,15,16,17,18,19,22,24,25,28,32,33,35,36,37,38,39,40,41,42,44,47,54,55,56,58,59,60,61,62,63,65,66,68,69,71,73,75,79,87,89,90,91,93,94,98,104,105,106,107,110,112,114,115,116,117,118,119,120,121,142,143,148,150,151,152,156,158,162,163,165,166,167,168,169,170,171,172,174,176,179,181,185,187,188,190,191,192,193,194,195,197,198,199,200,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,224,225,226,228,229,231,233,234,235,237,238,239,240,241,242,250,251,252,253,255,257,258,259,260,261,262,263,269,274,275,276,278,282,284,285,286,288,289,290,292,297,298,299,300,303,311,312,314,317,318,319,322,325,326,328,329,330,331,332,335,336,337,339,340,341,342,343,344,346,350,354,355,356,358,360,363,364,365,366,370,371,372,376,377,378,380,381,382,384,385,387,388,390,391,392,393,396,398,399,400,401,402,405,406,407,409,411,415,416,417,419,420,421,422,423,424,426,430,432,433,434,435,437,439,440,441,442,445,449,451,452,453,455,457,458,461,462,464,466,467,469,470,471,472,473,474,476,477,479,481,483,484,486,487,490,494,495,496,498,499],noth:[204,238,357,370,467,480],notic:[0,6,7,8,12,324,326,490],noutcol:8,noutput:281,noutrow:8,novemb:419,novik:13,novint:236,now:[2,3,6,9,11,12,13,46,61,62,71,191,198,199,216,232,236,237,299,332,335,356,358,376,393,395,399,432,433,442,465,470,490,496],nowait:236,nozforc:355,np3:167,np4:167,np6:167,npair:[118,207],nparticl:[3,40,42,375],npartit:487,npernod:[14,15,16,17,18,370],nph:[],nphi:[16,370],nphug:[],npoli:285,nproc:[3,11,191],npt:[],npt_aspher:[257,263,274],npt_bodi:[258,275],npt_sphere:[259,278],nrbin:[],nrecomput:392,nrepeat:[71,205,206,207,208,209,210,211,212,296,300,474],nreset:[218,255,256,260],nreset_ref:218,nrho:[371,393],nrl:393,nsall:9,nsampl:392,nsbin:71,nsbmax_most:3,nsec:489,nskip:[121,474],nsq:[3,367,428],nstart:[121,207,208,209,212,300,469,474],nstat:280,nstep:[3,13,218,255,337,446,467,470],nsteplast:467,nstop:[121,474],nswap:[322,329],ntabl:[38,56,188,452],nterm:303,nth:[12,77,118,119,191,194,209,220,474,484],ntheta:377,nthread:[3,370],ntild:281,ntpc:370,ntptask:370,ntype1:117,ntype2:117,ntype:[3,142,168,191,194,290,292,395,401,430,469,479],nuclear:[9,97,98,154,233,256,289,294,364,395,462],nuclei:[9,97,98,152,154,159,241,256,268,277,320,373,395,469],nucleu:[97,98,290,455,490],nudg:[4,6,7,197,254,362,365],nulcear:9,num:2,num_of_collis:3,numa:[1,3,12,370,466],numactl:16,number:[1,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,22,27,38,39,40,41,42,44,56,63,64,65,66,68,69,70,71,72,73,75,76,77,78,79,80,87,90,91,92,93,94,103,104,105,107,108,110,113,114,115,116,117,118,119,120,121,131,137,142,145,146,147,148,149,150,151,153,154,155,156,157,158,160,161,162,163,165,166,167,168,169,170,171,172,176,177,187,188,190,191,192,193,194,195,197,198,199,202,204,206,207,208,209,210,211,212,214,215,216,217,219,220,221,228,229,231,232,233,235,236,237,238,239,240,241,242,245,252,255,256,260,269,280,281,282,284,285,288,289,290,294,296,299,302,306,314,315,316,318,321,322,323,324,326,327,328,329,331,333,334,336,337,339,341,353,355,356,358,360,361,363,364,365,366,367,370,371,372,377,379,384,386,391,392,393,394,395,396,401,402,403,404,405,419,420,421,422,424,426,430,431,432,433,434,437,439,440,441,449,451,452,453,454,455,457,458,459,462,463,464,466,467,469,470,471,472,473,475,476,477,478,479,481,483,484,486,487,488,490,494,495,496,499],number_of_a:3,number_of_b:3,number_of_typ:[],numbond:3,numer:[1,2,3,6,9,11,12,22,38,41,42,44,56,71,77,87,108,118,162,172,176,188,191,193,194,198,199,200,202,203,206,210,212,226,232,235,239,252,255,282,299,302,326,331,333,334,336,337,341,360,363,364,384,390,402,419,424,432,433,439,452,462,463,467,468,469,476,479,485,486,487,495],numpi:11,nvalu:[206,210,211,212,467],nvaluelast:467,nvc_get_devic:15,nvcc:[1,12,17],nve:[],nve_aspher:[257,261,274],nve_bodi:[258,262,275],nve_spher:[259,263,278],nvida:17,nvidia:[1,3,9,12,14,15,17,370,482],nvt1:490,nvt2:490,nvt:[],nvt_aspher:[257,261,278],nvt_bodi:[258,262],nvt_sphere:[259,263],nvtfe:203,nwait:281,nwchem:7,nxnode:326,o_cor:150,o_shel:150,oascr:7,obei:[3,220,358,464],ober:7,obj_shared_foo:12,obj_target:12,object:[6,8,11,12,15,40,42,193,218,236,242,245,285,303,310,363,364,467,472],observ:[255,289,317,318,321,322,329],obsolet:13,obstacl:[4,237],obtain:[1,3,9,12,29,73,87,104,108,166,195,199,230,233,242,260,281,282,321,355,372,390,419,424,431,440,453,455,478],obviou:[12,462,495],obvious:[193,484,495],occ:397,occasion:[3,464],occlus:193,occup:[3,166,370,397],occur:[1,3,6,9,11,12,14,17,39,57,59,61,62,71,86,106,166,169,171,188,191,194,204,214,217,218,220,231,234,237,245,253,269,290,299,314,323,336,337,339,355,366,370,392,395,415,433,464,466,467,472,474,478,483,486,495],occurr:[349,469,483,495],oct:11,octahedr:25,octant:466,odd:[41,108,194,214,255,299,317,318,326,484],off:[1,3,6,12,14,15,17,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,37,38,39,40,43,44,45,46,47,48,49,50,51,53,54,55,56,59,61,65,69,71,109,110,111,114,115,117,142,143,145,151,155,166,167,172,174,175,176,177,178,179,180,181,182,183,185,186,187,188,191,193,194,197,200,204,212,213,216,217,220,227,230,231,232,234,236,239,240,245,255,257,258,259,260,261,262,263,264,265,269,272,274,275,276,278,284,286,287,291,299,301,302,314,317,319,329,330,331,334,335,340,341,342,343,345,346,347,349,350,351,355,356,363,365,366,368,370,371,372,374,378,379,380,381,382,383,385,386,387,389,390,391,393,394,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,417,419,420,424,425,426,427,429,433,434,435,437,439,440,442,449,450,451,452,453,454,455,457,458,460,461,462,464,465,466,469,471,472,476,478,481,482,483,488,492,494,495,497,499],offend:[3,467],offer:[6,14,18,171,362,387,440,464,478],offic:7,offload:[1,12,16,17,236,370],offset:[3,6,57,168,193,220,221,285,364,387,407,411,450,469],offsit:8,often:[1,3,6,7,12,13,14,15,16,17,18,37,55,71,162,187,193,200,209,212,214,218,229,236,255,282,300,350,358,362,363,365,366,367,370,386,391,407,453,455,464,483,490,494],ohio:421,old:[3,6,9,197,218,221,255,419,432,442,470,473,477,480,494,497],older:[3,5,12,13,17,194,206,218,255,442,495],oldlac:194,oleinik:377,olfason:[6,25,351,401,481],oliv:194,olivedrab:194,olivi:9,ollila:[242,244,245,246],olmst:[203,280],omega0:351,omega:[],omega_dot:255,omega_ijk:455,omega_ik:453,omegai:[115,191,316],omegax:[115,191,316],omegaz:[115,191,316],omgea:6,omiss:[0,7],omit:[188,194,333,381,390,411],omp:[],omp_num_thread:[3,16,18,370],omp_proc_bind:17,ompi_comm_world_local_rank:12,ompi_icc:16,on_the_fli:203,onc:[0,1,2,3,6,11,12,16,40,41,59,60,63,71,91,105,174,192,193,194,197,198,199,214,215,216,221,229,231,233,240,281,288,299,314,322,327,329,337,361,364,365,366,398,400,402,403,430,434,466,467,476,483,486,490,495],onelevel:466,onewai:[],ongo:236,oniom:[9,293],onli:[1,2,3,6,7,8,9,11,12,13,14,15,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,53,54,55,56,59,60,61,63,64,65,66,67,68,69,70,71,72,73,75,78,79,80,83,86,87,88,90,92,93,94,97,98,99,100,101,102,103,104,105,106,107,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,151,152,154,155,156,158,159,160,161,162,163,165,166,167,168,171,172,174,175,177,178,179,180,181,182,183,185,186,187,188,191,192,193,194,195,197,198,199,200,201,202,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,224,226,227,228,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,270,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,288,289,290,291,292,293,294,295,296,299,300,301,302,303,304,305,306,307,308,310,314,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,342,343,344,345,346,347,349,350,351,353,355,356,358,360,363,364,365,366,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,466,467,469,470,472,473,474,476,477,478,479,480,481,483,484,485,486,487,488,490,495,496,497],only_group:166,onn:478,onset:[289,349],ontario:9,onto:[142,170,217,221,242,449],onward:2,open:[],opencl:[1,3,7,15,370],opengl:6,openkim:9,openmp:[1,3,7,9,12,16,17,18,353,370,482],openmpi:[12,14,15,16,17,18,370],opensourc:7,oper:[],opl:[],oppelstrup2:9,oppelstrup:[9,422],oppos:[6,39,189,191,298,333,356,364,469],opposit:[6,29,70,202,239,246,280,299,329,365,387,415,456,467],opt:[],optic:146,optim:[],option:[],optionn:17,orang:[2,193,194],orbit:[290,292,377,387,395,440,450],orchid:194,order:[1,2,3,6,9,11,12,14,27,29,38,39,41,56,59,63,65,69,71,79,87,89,90,92,93,94,108,110,114,117,132,142,143,145,146,147,148,149,150,151,154,155,156,157,158,160,161,172,177,187,188,191,193,194,197,200,205,207,209,210,211,212,213,215,216,217,218,219,224,226,231,233,235,236,238,242,243,245,253,255,280,288,289,293,296,297,298,299,300,301,302,303,308,310,315,321,325,326,327,328,338,339,340,342,343,344,346,349,350,355,364,365,371,372,373,377,386,392,393,395,396,398,399,402,404,407,415,419,422,432,433,434,440,450,451,452,453,454,455,456,458,459,464,466,467,469,470,474,476,478,479,483,486,490,495,499],orderomg:3,ordinari:[113,401,429],org:[6,7,11,12,13,14,431],organ:[0,3,6,7,8,386],organis:[437,439],organometal:25,orient:[],orienti:[],orientord:[],origid:206,origin:[3,6,7,9,12,71,81,104,105,116,120,164,168,170,190,193,194,197,198,199,206,210,211,215,216,220,224,240,252,255,276,282,285,295,299,300,307,313,324,352,354,355,358,362,371,372,374,377,387,390,391,392,393,401,404,419,429,432,433,453,455,456,457,466,469,470,471,472,473,474,494,497],origin_i:211,origin_x:211,origin_z:211,orlikowski:422,ornl:[7,9,15],orsi:29,ortho:[3,59,170,469],orthogon:[],orthograph:193,orthong:59,orthongon:[59,299],orthonorm:221,orthorhomb:289,os4:167,oscil:[6,9,153,216,220,223,224,240,252,253,255,289,294,299,331,332,334,336,364,373,456,490,495],oscillatori:[252,307],oserror:11,other:[],otherswis:16,otherwis:[1,3,9,12,14,16,17,18,37,39,55,71,103,113,120,146,147,148,161,169,187,194,195,204,206,215,216,220,229,231,233,240,255,299,350,351,363,370,379,402,406,416,417,430,459,464,467,469,470,490,495],otyp:[387,407,411,415],ouml:490,our:[5,6,7,8,13,242,302,424,453,455,490],out:[1,2,3,6,7,8,11,12,13,14,18,19,21,41,64,66,71,75,90,91,94,95,98,104,105,106,107,109,116,117,145,146,147,148,149,151,152,154,155,156,157,158,160,161,163,165,171,175,191,193,194,195,197,210,214,215,216,219,227,230,231,237,239,242,247,269,281,283,284,285,294,295,296,299,311,326,335,337,338,339,340,342,346,353,354,358,361,365,369,395,402,418,450,463,464,466,467,472,473,474,476,477,478,480,483,485,486,487,491,493,495,496,497,498,499],outcom:[299,496],outer2:[382,400],outer:[3,8,16,225,237,339,354,361,363,369,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,425,427,429,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,459,460,461,462,464,477,478,483,489,495],outer_distance_cutoff:401,outermost:[38,56,71,198,199,252,255,366,452,478],outfil:[13,466],outlin:[6,193],outmost:236,outpt:[],output:[],output_frequ:203,outputss:129,outsid:[3,57,59,71,158,168,190,191,192,193,194,195,209,210,221,231,237,299,300,314,319,320,333,334,336,337,353,365,378,380,387,395,407,409,427,435,467,469,470,472,479,486,496],outuput:[],outut:6,outward:[71,166,331,335,336,469,478],over:[1,3,5,6,7,9,12,16,18,27,39,41,42,55,60,65,68,69,71,79,80,87,88,89,90,92,93,102,104,106,108,110,117,118,127,128,134,139,142,143,148,151,154,162,164,177,188,193,195,197,198,199,205,206,207,208,209,210,211,212,213,214,215,216,220,221,229,232,233,237,239,240,241,245,253,254,255,256,257,258,259,261,262,263,274,275,276,277,278,280,285,286,289,296,297,298,299,300,303,311,314,317,318,319,320,322,325,328,329,331,333,334,335,336,337,340,354,357,365,366,367,370,385,391,393,394,395,396,401,416,419,422,430,441,442,450,451,453,454,455,458,465,466,467,472,474,475,477,478,483,486,487,495,496],overal:[6,18,25,59,162,218,224,255,256,282,302,314,339,361,395,401,402,441],overalap:299,overcom:[269,314],overflow:[3,364,366],overhead:[6,11,19,41,194,206,208,210,211,214,228,288,366,367,472,488],overkil:299,overlai:[],overlaid:7,overlap:[3,13,16,62,76,168,171,188,194,202,205,206,209,210,211,212,221,225,269,285,290,296,299,300,314,332,336,355,358,361,363,364,370,391,395,399,402,405,415,436,438,442,457,469,472,478],overload:1,overrid:[3,12,14,16,17,22,44,71,154,168,176,193,194,198,199,218,225,250,255,341,355,366,384,401,402,419,424,432,466,467,479,481,486,495],overridden:[6,168,193,260,299,416,424,442,450,477,495,497],overview:[],overwrit:[11,12,22,44,176,194,206,207,208,209,210,211,212,300,341,353,359,384,419,467,470],overwritten:[287,325,353,401,402,464,465,470],own:[3,4,6,7,8,11,12,13,15,17,39,41,59,61,63,65,66,69,71,73,75,79,90,93,94,105,107,115,116,117,119,121,148,151,163,165,166,191,194,197,203,205,206,207,208,209,210,211,212,214,217,218,220,229,232,233,239,240,242,250,253,255,257,258,259,260,261,262,263,274,275,276,278,282,286,294,299,300,317,318,319,328,355,365,370,372,377,386,394,404,430,432,433,451,453,454,455,458,466,479,486,496],oxford:[29,87,390],oxid:[9,386,387,440],oxygen:[6,40,228,387,407,411,440,469],oxygen_c:150,p_e:326,p_ik:430,p_pi:377,pacakg:[3,4,9,19,40,370],pack:[5,8,67,332,370,377,419],pack_bord:8,pack_border_bodi:8,pack_border_hybrid:8,pack_border_vel:8,pack_comm:8,pack_comm_bodi:8,pack_comm_hybrid:8,pack_comm_vel:8,pack_exchang:8,pack_restart:8,pack_revers:8,pack_reverse_comm:8,pack_reverse_hybrid:8,packaag:370,packag:[],packakg:15,packet:[7,9,40,193,373,395],pad:[3,191,193,194,282,495],padua:[9,13],page:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,22,37,40,42,44,55,57,59,63,66,68,75,87,90,94,103,105,106,107,109,111,114,116,119,121,143,146,147,148,161,163,165,168,169,170,176,187,190,191,192,193,194,195,197,198,199,204,205,206,207,208,209,210,211,212,221,231,238,239,240,250,255,256,261,262,263,267,274,275,276,277,278,285,288,299,311,314,317,318,319,328,332,335,337,339,341,350,354,363,364,365,366,370,371,372,375,376,384,386,387,393,394,396,401,402,404,405,419,420,421,424,426,430,431,441,450,451,453,455,457,458,467,469,470,471,472,474,477,478,479,481,486,487,495,496,497,498],pai:[15,18],pair:[],pair_:[87,198,199],pair_airebo:404,pair_charmm:415,pair_class:8,pair_coeff:[],pair_eam:371,pair_eff:154,pair_foo:8,pair_hybrid:[402,456],pair_interact:203,pair_list:406,pair_lj:415,pair_lj_cut:8,pair_lj_soft_coul_soft:87,pair_modifi:[],pair_sph:[443,444,445,446,447,448],pair_styl:[],pair_tally_callback:8,pair_writ:[],paircoeff:3,pairfoo:8,pairij:[3,469],pairkim:3,pairstyl:8,pairwis:[],palegoldenrod:194,palegreen:194,paleturquois:194,palevioletr:194,pan:193,panagiotopoulo:[388,397],pandit:[9,292,433],papaconstantopoulo:371,papayawhip:194,paper:[3,6,7,8,9,13,39,40,64,142,156,162,180,239,242,246,254,284,290,292,299,314,322,326,329,355,362,365,372,381,387,399,401,404,409,411,429,432,433,453,455,464,483],paradyn:5,paraemt:434,paragraph:[71,156,331,358,470,471],parallel:[],parallelepip:[6,170,358,469,472],parallelipip:[170,281],paralleliz:284,param:[3,290,292,466,472],paramet:[],parameter:[120,167,372,377,386,387,393,394,395,396,404,419,420,421,430,432,433,440,451,453,454,455,458],parameter_fil:203,parameterizaion:387,parametr:[6,9,36,394,431,435],paramt:[106,290,333,434],paramter:386,paratem:415,paraview:300,parent:[3,8,337],parenthes:[38,56,188,399,452,495],parenthesi:[2,206,339,495],parinello:[6,7],pariticl:214,paritlc:3,park:[3,7,9,203,303,421,429],parmin:422,parrinello1981:218,parrinello:[218,233,253,255,256,289,318],pars:[],parser:[12,495],part:[0,1,2,3,6,7,8,9,11,12,17,20,21,23,24,25,26,27,28,29,30,31,32,35,36,37,38,40,41,43,45,46,47,48,49,51,53,54,55,56,64,67,70,71,72,78,80,83,92,97,98,99,100,101,102,104,106,109,110,111,113,114,117,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,150,152,154,155,159,160,162,166,171,174,175,177,178,179,180,182,183,185,186,187,188,191,192,194,195,197,200,201,202,204,208,211,213,214,215,216,217,218,219,220,221,223,226,227,228,229,230,231,232,233,234,236,237,238,239,240,241,242,243,244,245,246,248,249,250,253,255,256,257,258,259,260,261,262,263,264,265,266,267,268,270,272,273,274,275,276,277,278,280,281,282,284,285,289,290,291,292,293,294,295,296,298,299,301,302,303,304,305,306,307,308,310,311,313,314,317,319,320,321,322,323,324,325,326,327,329,330,331,332,333,334,335,337,338,339,340,342,343,345,346,349,350,351,355,356,363,364,365,366,370,371,372,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,419,420,421,422,425,426,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462,466,467,469,470,471,472,476,477,478,481,487,495,499],partai:[9,431],parti:9,partial:[],partic:6,particip:[216,375,376,405,457],particl:[],particleenergi:3,particleviri:3,particular:[1,3,6,8,10,12,40,63,65,69,70,71,79,93,110,115,117,118,142,168,190,191,197,202,210,214,217,231,232,237,238,242,252,255,280,285,298,299,302,321,332,337,340,356,358,361,364,370,375,377,378,380,382,383,385,389,394,395,398,400,402,407,411,415,418,426,427,434,435,450,451,453,454,455,458,464,466,469,470,471,476,477,479,487,495,496,498,499],particularli:[6,7,9,12,15,16,25,39,193,218,299,356,395],particuolog:[42,376],partilc:314,partit:[],partitoin:62,partner:[3,7,61,215,216,217,240,314,329,456,479,484,490],pascal:[9,13,494],pass:[6,7,8,11,66,74,75,81,89,90,94,104,105,106,107,163,191,193,194,195,218,219,229,231,252,253,255,288,314,331,354,366,370,402,432,449,467,469,470,474,480,495,498],passphras:12,past:[],patch:[0,12],patchi:299,patel:422,path:[3,6,7,11,12,13,15,195,238,254,282,303,314,321,326,365,371,372,377,384,393,394,396,404,419,420,421,426,430,431,432,440,441,451,453,455,458,470],pathtolammp:440,patient:12,patom1:117,patom2:117,patrick:454,pattern:[3,7,12,62,73,471],pattnaik:299,paul:[0,7,13,239,241],pauli:[9,395,440],paus:477,paves:282,payn:[142,431,441],pb2:167,pb4:167,pbc:[331,373],pchain:[255,256,260,299],pcie:1,pd2:167,pd4:167,pdamp:[255,256,260,286,299],pdb:[6,13,195],pdebuyl:9,pdf:[0,8,9,13,17,40,100,101,102,113,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,219,238,248,249,304,305,306,307,310,429,443,444,445,446,447,448,479],pdim:329,pdlammp:[78,80,429],pdlammps_ep:[113,429],pdlammps_v:429,pe_eta:255,pe_etap:255,pe_omega:255,pe_strain:255,peachei:13,peachpuff:194,peak:397,pearlman:87,peculiar:12,pedersen:356,peform:[39,291],penalti:[14,432,433],pencil:[6,71,156,210],pend:3,penetr:[42,122,436,438,479],penetret:40,peng:167,penn:13,pentium:10,peopl:[7,8,9,12],peptid:[4,9,219],per:[],peratom:[3,112,143],perceiv:193,percent:[3,12,16,218,370,451],percentag:[1,12,218,255,285,286,299],percol:216,perfect:[6,41,70,73,92,214,280,365],perfectli:[41,214,470],perfom:[6,365],perform:[],performac:1,pergamon:[419,455,462],perhap:358,peri:[],peridyma:78,peridynam:[3,4,6,7,9,40,63,78,80,113,429,450,479],perimitt:388,period:[],perioid:331,perl:[6,13],perm0:494,perman:[3,39,54,71,172,215,216,236,298,337,370,401,473,481],permeabl:279,permiss:[216,467],permit:[6,242,422],permitt:[388,455,461,462],permut:[12,394,451,453,455,458],perpendicular:[6,71,146,193,220,237,247,252,254,280,283,307,331,332,362,469],perram:[356,398],persepct:193,persist:[3,8,71,229,299,370,466,467,471,475,495],person:9,persp:[3,193],perspect:193,pertain:[384,450],perturb:[9,13,70,87,251,297,331,334,336,474],peru:194,peskin:242,pessimist:356,petersen:[314,356],pettifor:[377,450],pettifor_1:377,pettifor_2:377,pettifor_3:377,pfactor:193,pforc:467,phantom:236,pharmaceut:7,phase:[3,12,16,255,321,329,377,407,454,466],phd:431,phenol:490,phenomena:395,phi0:[186,298],phi1:175,phi2:[175,394,451],phi3:[175,394,451],phi:[1,3,4,7,9,12,16,17,79,92,108,142,187,188,193,234,281,298,343,370,371,377,393,396,419,420,421,482],phi_ij:[377,396,430],philadelphia:9,phillip:[240,391,490],phillpot:[291,386,387,440],philosoph:393,philosophi:[6,7,238],phonon:[],phophor:441,phosphid:441,phy:[6,7,13,20,21,25,39,43,45,46,64,70,73,87,88,92,108,112,114,142,143,150,156,174,175,185,192,204,208,218,219,224,232,233,238,239,240,241,242,253,254,255,256,260,276,277,281,282,286,289,291,294,299,302,303,314,317,318,321,322,323,324,326,329,331,340,349,351,355,356,362,365,372,377,378,382,383,385,386,387,388,389,390,391,393,394,395,397,398,399,400,401,404,407,409,411,412,415,416,417,418,419,421,423,424,427,429,430,434,440,441,449,451,452,453,454,455,456,458,464,478,481,483,490],physic:[3,6,9,12,14,16,17,18,40,42,53,59,122,150,162,203,220,233,239,241,242,244,245,246,253,281,290,292,325,326,356,358,365,370,372,374,381,385,393,401,402,422,431,432,433,436,444,445,447,448,464,466,478,479,484,494],physica:[416,417],physik:[7,9],pic:9,picki:8,picocoulomb:494,picogram:494,picosecond:[194,220,487,494],picosend:395,pictur:7,pie:[],piec:[3,11,142,194,255,476,499],pierr:9,pieter:13,pimd:[],pin:16,pink:194,pipe:[6,191,193],pipelin:[3,6],pisarev:326,pishevar:391,piston:[],pitera:6,pixel:193,pizza:[4,6,7,11,13,41,191,193,214],pjintv:13,pka:326,place:[3,6,7,9,11,12,33,41,50,71,87,162,168,172,181,188,191,193,194,196,197,198,199,216,217,220,231,232,233,235,238,239,240,241,243,245,246,255,261,262,263,274,275,278,285,288,297,299,317,318,319,326,331,334,336,354,384,401,450,457,466,467,470,477,479,487,495],placehold:[33,181,371,372,386,393,396,403,404,419,420,421,426,430,432,433,441,449,451,453,454,455,458],placement:[358,407],plai:[193,321],plain:[9,415,467],plan:[3,5,6,17,170,469],planar:[6,40,42,237,280,332,349,351],planck:[231,282],plane:[3,6,9,41,42,57,59,67,71,92,193,197,203,210,214,234,237,247,280,283,293,311,313,326,332,340,342,343,344,345,346,351,358,417,457,472,479],planeforc:[],plasma:[9,88,256,326,395],plastic:[],plastic_strain:[],plastic_strain_r:[],platform:[1,3,7,9,12,13,15,17,191,193,195,471,476,499],plath:[6,91,197,322,329],player:193,pleas:[0,3,7,11,12,13,203,233,242,246,281,284,295,321,337,394,396,429,437,439,440],plen:373,plimpton:[0,5,7,70,114,143,217,280,314,399,429],plo:29,plog:[3,12,478],ploop:[255,256,260],plot:[7,11,13,289,413,415,452,459],plu:[3,11,12,39,59,68,97,171,194,213,218,220,221,260,299,367,395],plug:9,plugin:[9,13,195,470],plum:194,pm3:167,pmb:[],pme:356,pmf:[219,303,311],png:[3,12,191,193],pni:193,poariz:6,poem:[],point1:469,point2:469,point3:469,point:[],point_data:300,pointer:[3,7,8,11,229,467],pois:494,poiseuil:[4,200,234],poisson:[59,220,356,399],poisson_solv:203,polak:362,polar:[6,7,108,142,150,167,203,223,386,387,407,456,490],polar_off:386,polar_on:386,polariz:[],poli:[],politano:[9,440],pollock:[7,356],polya:337,polybond:13,polychain:299,polydispers:[3,364,379,385,399,416,417,450,461],polygon:[],polym:[],polymer:7,polymorph:[],polynomi:[9,38,56,188,393,413,424,440,445,452],polytechn:284,poor:[16,17,41,214,276,277,302,370,413],poorli:[362,363],pop:[3,8],popen:12,popul:[12,294,358,392,469],popular:[12,191,394],pore:311,poros:171,porou:[242,245],port:[236,238],portabl:[7,9,12,191,192,219,432,471],portion:[1,3,9,11,12,15,16,41,54,71,88,91,109,110,112,115,143,144,158,191,194,205,206,209,210,211,212,214,218,228,242,255,257,258,259,261,262,263,291,296,297,299,300,339,354,366,370,378,380,381,382,383,387,388,390,391,395,397,398,400,401,407,411,415,418,427,434,435,455,459,468,469,474,478,479,488,495],poschel:399,posfreq:296,posit:[3,6,14,27,39,40,41,42,46,57,59,70,71,81,89,90,104,105,110,119,120,124,142,143,151,166,167,168,170,171,172,177,179,188,190,192,193,194,197,198,200,202,204,205,206,209,210,211,214,215,216,217,218,219,220,221,224,226,231,232,233,234,236,237,239,240,241,242,244,245,248,249,252,253,255,256,257,258,259,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,280,281,282,284,285,286,289,290,294,296,297,299,302,303,307,310,311,313,314,316,317,318,319,321,323,324,325,326,329,331,332,333,334,335,336,337,340,355,358,365,372,373,375,376,379,391,392,395,397,405,410,433,440,449,452,457,464,469,472,479,490,495,496],posix:236,posix_memalign:12,possibl:[1,3,6,8,9,11,12,15,38,40,41,55,59,63,70,71,87,115,117,142,143,146,147,161,190,191,192,194,197,199,203,204,210,214,215,216,217,221,223,233,240,280,293,294,296,299,310,314,316,326,327,345,354,356,363,366,367,370,392,401,419,433,437,439,440,452,458,467,473,482,483,484,487,490,495,496,498],post:[],post_forc:8,post_force_integr:8,post_force_respa:8,post_integrate_respa:8,postit:[210,211,269],postiv:86,postma:[286,317],postprocess:13,pot:[399,433],potentail:396,potenti:[],potentiel:415,potetni:402,potin:422,potpourri:9,pour:[],pourtoi:321,pow:220,powderblu:194,power7:17,power8:17,power:[3,9,11,106,142,194,294,355,370,377,467],pparam:[87,198,199],ppm:[12,191,193],ppn:[14,15,16,17,18,370],pppm:[],pppm_disp:3,pppmdisp:3,pproni:[3,232],pr3:167,pr4:167,practic:[3,12,218,255,256,281,288,458,466],prb:[453,455],prd:[],pre:[],pre_exchang:8,pre_forc:8,pre_force_respa:8,pre_neighbor:8,prec:440,prec_tim:14,prece:439,preced:[2,6,59,205,206,207,208,209,210,211,212,238,296,300,339,358,365,370,377,401,483,486,487,495],preceed:[11,12,71,156,207,331,467,495],precipit:166,precis:[1,3,9,12,13,14,15,16,17,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,43,45,46,47,48,49,51,53,54,56,104,111,114,145,155,168,174,175,177,178,179,180,182,183,185,186,188,191,194,200,206,212,213,218,220,227,230,234,239,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,290,291,292,299,301,302,317,319,330,334,340,342,343,345,346,349,351,355,356,363,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,396,397,398,399,400,401,405,407,408,409,410,411,412,413,414,415,416,420,422,425,426,427,429,432,434,435,440,442,451,452,453,454,455,457,458,460,461,462,471,472,478,479,482,487,490,494,495,496],precv:466,predefin:[186,194,337,395],predict:[1,6,10,12,269,299,370],preexponenti:483,prefactor:[24,25,28,32,35,36,162,176,187,198,199,207,331,342,346,349,363,385,397,426,434,435,442,461],prefer:[7,8,12,298,327,372],prefix:[9,11,12,193,219,281,463,466],preliminari:[38,56,188,452],prematur:363,prepar:[9,293,314,480,490],prepend:432,preprint:[142,441],preprocessor:236,prerecord:219,prescrib:[6,8,146,147,148,161,197,198,203,206,221,252,271,327],presenc:[191,215,216,242,245,416,417,422,461,497],present:[1,3,12,18,166,188,192,193,221,232,233,238,242,243,245,246,294,310,332,335,386,395,406,415,422,433,434,440,466,490],preserv:[3,59,218,220,255,302,314,336,470],press:[],pressdown:213,pressur:[],pressure_with_eviri:395,presum:[73,157,197,198,199,220,365,402,472],prevent:[2,3,6,40,122,221,230,314,325,349,355,361,363,365,370,391,402,428,444,445,447,449,467,471,477,479,490,495],previou:[],previouli:221,previous:[3,11,59,61,71,86,103,119,121,157,168,170,172,190,191,192,194,202,204,205,206,207,209,210,211,212,220,221,231,237,250,252,285,297,299,301,302,326,328,331,332,333,334,336,337,357,399,450,464,467,471,472,482,484,486,487,491,492,493,495,496],prevoiu:332,price:[6,390],primari:[0,6,9,326],primarili:[5,7,9,17,144],primaritli:[],prime:[224,240,400,405,422,453,455,466],primit:[3,6,334,335,358],princip:[3,236,440],principl:[6,9,11,236,256,290,395,403,422,451,466],prinicp:[42,299,364],print:[],printabl:2,printflag:403,printfluid:242,prior:[166,189,357,498],priori:478,prioriz:370,prism:[3,6,156,170,472],priveleg:3,privileg:[11,12,236],prob:[215,216],probab:442,probabl:[3,8,12,40,71,158,171,172,174,204,214,215,216,217,221,231,240,255,285,331,337,363,424,464,483,490],probe:495,problem:[],problemat:231,proc:[1,3,8,11,12,15,115,191,354,466],proce:[41,54,172,214,225,365,422,476,484,487],procedur:[6,12,39,41,194,204,214,231,239,240,241,255,257,258,259,260,261,262,263,274,275,276,277,278,281,317,318,319,320,323,324,363,365,372,379,470,490],proceed:[12,422],procesor:[41,466],process:[],processor:[],processsor:[41,214,466],procp1:191,procsessor:488,procssor:478,produc:[1,3,4,6,7,9,12,13,14,15,16,17,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,41,42,43,45,46,47,48,49,51,53,54,56,63,65,68,69,71,79,93,110,111,112,114,115,116,117,119,121,143,145,155,174,175,177,178,179,180,182,183,185,186,188,191,194,197,200,205,206,207,209,210,211,212,213,214,217,220,227,229,230,232,233,234,239,240,241,250,252,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,285,289,290,291,294,299,300,301,302,315,316,317,319,326,327,328,330,331,334,339,340,342,343,345,346,349,351,356,363,365,368,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,395,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,420,425,426,427,429,430,433,434,435,442,451,452,453,454,455,457,458,460,461,462,464,466,471,472,474,475,478,483,495,496],product:[6,16,17,18,142,220,276,290,327,370,373,395,433,466,495],proessor:370,prof:284,profi:157,profil:[],program:[3,4,6,7,9,11,12,13,17,144,191,193,194,195,197,219,229,236,242,293,393,467,468,480,495],programm:[13,17],progress:[1,41,214,236,253,289,362,363,365,487,490],prohibit:479,project:[6,7,13,14,362,450],promis:7,promot:377,prompt:[8,11,12,236,480],proni:[3,232,233],proofread:8,prop:[6,288],propag:[4,9,202,255,289,304,395,402],propens:6,proper:[217,280,419,467],properati:288,properli:[200,226,299,310,364,365,467,496],properti:[],propoerti:314,proport:[6,39,41,87,104,105,164,214,239,240,241,289,322,329,330,399],proportion:239,propos:[6,142,204,218,231,255,276,294,407,421,454,456],prospect:7,protect:314,protein:[7,10,168,297,299,312,469,477],protocol:236,proton:[455,462,494],prototyp:[10,42,429],prouduc:[212,328],prove:242,proven:276,provid:[1,3,4,6,7,8,9,11,12,13,14,15,16,17,18,29,40,42,61,67,70,120,141,144,162,167,168,192,193,195,205,206,212,217,218,219,220,229,231,236,238,242,246,253,255,281,289,290,293,294,299,303,321,323,324,327,328,339,353,355,356,361,365,370,372,377,379,384,386,387,391,394,395,399,401,404,406,415,416,419,421,422,430,431,432,433,440,441,449,450,451,453,454,455,458,466,471,477,479,482,483,487,488,495],proxim:190,psa:334,pscreen:[3,12,478],pscrozi:[0,7,13],psec:[194,220,235,239,240,255,286,299,317,318,489,494],psend:466,pseudo:[395,464,469,474],pseudodynam:321,pseudopotenti:[9,422],psf:6,psi:[396,461],psi_ij:396,pstart:[3,255,256,260,286,299],pstop:[3,255,256,260,286,299],pstyle:[87,109,198,199],psu:[432,433],psuedo:474,pt2:167,pt4:167,ptarget:218,pthread:[12,17],ptr:[6,11,229,467],ptype1:117,ptype2:117,pu3:167,pu4:167,pu6:167,publicli:5,publish:[7,242,246,290,387,419,422,453,455],pull:[303,311],puls:326,pump:[416,417],punctuat:[2,464,483],purchas:193,purdu:[9,13],pure:[11,314,402,420,421,453,455,478],purg:[3,470],purpl:[2,194],purport:11,purpos:[3,6,7,12,42,61,71,120,130,136,151,152,167,168,170,172,188,191,210,212,217,218,239,280,282,285,287,298,314,355,370,381,405,411,422,424,457,469,472,476,479,481,482,495,499],push:[3,8,200,213,220,237,254,280,297,303,363,399,442],pushd:237,put:[3,6,8,11,12,13,39,59,156,168,191,221,225,333,334,337,358,432,467,469,473],putenv:[480,495],px1:478,px2:478,pxx:[218,255,286,299,355,356,486,487],pxy:[3,6,487],pxz:[3,6,487],py1:478,py2:478,pydir:11,pyi:[218,255,286,299,355,356,487],pymol:[7,11,13],pymol_aspher:[],pympi:11,pypar:11,python:[],pythonpath:11,pyz:[3,6,487],pz1:478,pz2:478,pzz:[218,253,255,286,289,299,355,356,487],q_1:440,q_2:440,q_3:440,q_c:[],q_d:490,q_i:[396,415],q_j:415,qbmsst:[],qcore:290,qdist:[387,407,411,415],qeq1:290,qeq2:290,qeq:[],qeqal:440,qeqallparallel:440,qfile:[290,387],qin:235,qinitmod:440,qmin:362,qmmm:[],qmol:293,qout:235,qtb:[],quad:[12,18,370,466],quadrat:[],quadratur:[87,203],quadrupl:371,quadruplet:[184,187,340,342,343,344,346,348,349,350],qualifi:[3,238],qualiti:[7,9,193,194],quantic:440,quantit:[74,81,104,105,106,164,399],quantiti:[],quantum:[6,9,142,229,233,282,289,293,294,377,395,422,440,450],quantum_temperatur:289,quartic:[],quartic_spher:203,quartz:[289,294],quasi:282,quat:479,quaternion:[3,6,40,82,115,132,146,147,168,257,258,261,262,265,266,267,274,275,398,469,479],quati:[115,469],quatj:[115,469],quatk:[115,469],quatw:[115,469],queen:13,quench:[337,464,483],queri:[3,11,54,271,467,495],quest:[6,229],question:[8,9,12,13,280,337,429,495],quick:[0,9,12,14,15,16,17,18,19],quickli:[3,4,8,12,13,39,92,214,220,231,236,314,362,363,365],quickmin:[361,362,363,365,483],quicktim:[4,193],quip:[],quit:[],quot:[2,3,12,192,245,287,339,419,464,465,467,477,495],quotat:440,r10:377,r12:398,r_1:142,r_2:142,r_c:[388,390,397,455],r_cut:[377,418],r_d:490,r_e:396,r_ewald:300,r_fu:[416,417],r_i:[29,142],r_ii:142,r_ij:[29,377,395,430,462],r_ik:430,r_j:29,r_jik:430,r_m:418,r_max:211,r_me:388,r_mh:397,r_min:[211,389],r_ub:20,r_x86_64_32:12,ra2:167,rad2theta:167,rad:337,radhi:472,radial:[63,71,97,98,115,118,142,152,154,159,206,211,241,256,268,277,311,320,363,395,401,424,469,472],radian:[20,21,24,28,32,35,36,38,167,175,186,188,298,340,342,346,349,469,472,479],radiat:[120,167,326],radic:[170,469],radii:[71,76,142,217,221,385,393,398,399,416,417,422,436,438,461,472],radit:395,radiu:[2,3,6,40,42,63,71,76,84,85,89,90,115,120,122,131,132,137,142,161,166,191,193,197,211,237,242,256,259,263,268,272,277,278,292,306,310,311,312,314,316,331,332,335,337,362,376,377,379,385,395,396,399,407,415,416,417,418,419,436,438,440,441,455,461,469,472,479,495],radlo:472,rafferti:329,rahman:[6,7,218,253,255,256,289,429],rai:[9,17,167],ram:455,ramirez:208,ramp:[],ran:[3,4,6,10,11],random:[3,6,39,168,171,190,193,202,204,215,216,217,219,221,228,231,232,233,239,240,241,242,251,282,285,289,294,297,299,314,318,321,326,330,333,379,391,392,464,479,484,490,495,496],random_se:464,randomli:[168,171,204,221,231,239,285,314,336,483,484],rang:[1,3,6,7,8,9,10,12,14,15,16,18,38,39,56,61,71,72,77,88,108,110,111,112,114,118,119,123,142,143,154,162,167,169,172,173,180,188,191,193,194,203,204,216,220,221,231,233,285,300,314,315,321,322,327,329,355,356,363,366,367,370,372,374,377,378,379,380,381,382,383,385,387,388,389,390,391,392,393,395,398,400,401,402,404,407,408,409,410,411,412,413,414,415,416,417,418,419,422,423,424,425,427,430,433,434,435,440,449,450,452,455,460,461,462,463,467,478,479,487,498],rangecoulomb:[],rank:[6,11,12,236,327,353,466],rankin:260,raphson:3,rapid:[4,6,11],rapidli:[3,8,12,71,217,239,253,255,299,317,318,330,387,391],rapp:[290,291,292],rappe_and_goddard:291,rare:6,rasmol:[6,7],rasmussen:398,raster3d:[6,7],rate:[2,6,12,127,134,138,139,151,194,203,220,221,235,236,237,285,289,322,323,324,325,329,361,362,392,416,417,464,483,487],rather:[1,2,6,9,12,40,41,62,114,151,193,214,220,232,233,299,318,326,330,332,333,334,337,395,432,452,470,474,479,481,486,495],ratio:[6,10,59,87,102,142,204,214,220,239,241,314,322,329,330,355,368,398,399,434,444,457,466,469,479,483],rational:[327,481],rattl:[],rattle_debug:302,ravelo:[260,409],rayleigh:[253,289],rb1:167,rbb:440,rbg:194,rcb:[3,41,214],rcm:[89,90],rcmx:[89,90],rcmy:[89,90],rcut:61,rcutfac:[142,441],rd1:365,rdc:17,rdf:[],rdn:365,rdt:365,rdx:4,reach:[6,12,41,121,208,214,216,218,240,260,307,314,321,339,354,369,388,490,495],react:6,reactant:395,reaction:[303,312,325,336,365,395],reactiv:[9,296,372],read:[2,3,6,7,8,9,11,12,13,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37,38,40,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,59,117,166,168,169,171,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,190,191,193,194,195,196,197,203,204,217,218,220,221,231,233,236,252,253,255,257,258,259,260,261,262,263,274,275,276,277,278,281,282,284,285,287,288,292,299,302,303,307,310,313,316,324,325,326,332,340,341,342,343,344,345,346,348,349,350,351,352,354,360,364,365,369,371,372,373,374,375,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,425,427,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,457,458,459,460,461,462,464,466,469,470,471,473,474,475,476,477,479,480,481,483,495,496,497,499],read_data:[],read_dump:[],read_restart:[],read_restart_set:8,readabl:[193,364,476,499],reader:[3,13,470],readi:[11,12,169,171,172,236,479,490,497,498,499],readm:[1,4,6,8,9,11,12,13,166,191,195,293,403,422,432,433,467],real:[3,6,7,11,27,30,31,59,71,91,92,108,142,157,168,177,190,194,202,210,211,220,221,224,236,237,240,252,282,289,294,297,330,331,333,334,336,345,355,356,358,361,367,387,422,424,432,433,455,469,472,478,486,489,494,496],realist:[3,221,473],realiz:[71,197,467],realli:[1,3,8,12,114,124,143,194,237,366,402,481],realloc:3,realtim:236,reamin:[331,335],rearrang:365,reason:[3,6,7,11,12,19,39,149,160,168,206,210,211,239,286,299,323,324,327,337,364,365,370,384,388,395,396,397,417,424,457,459,473,478,496],reax:[],reax_def:3,reaxc:[],reaxff:[3,4,5,7,9,13,197,290,292,295,296,402,432,433,450,481],rebal:[41,214],rebalanc:[41,214],rebo:[],rebuild:[11,12,14,15,16,231,366,391,487],rebuilt:[3,12,191,192,193,195,366,370],recalcul:[71,87,314],receiv:[3,213,236,238,280,466],recent:[],reciproc:[6,12,120,167,281,355,378,380,381,387,390,395,407,411,427,435,483],recog:12,recoginz:3,recogn:[3,12,16,73,170,215,216,255,364,393,419,432,467,469,476,477,490],recomend:6,recommend:[7,9,12,14,16,193,194,289,324,355,395,402,416,417,422,433,434,437,439,440,478,488],recompil:[1,3,9,12,195,302],recomput:[103,130,172,225,303,392,481],reconstruct:[3,219,440],record:[195,219,303],recov:[218,255],rectangl:[41,214,358],rectangular:[7,41,62,170,214,231,358,469,471,473],rectilinear:[120,167],rector:53,recurs:[41,214,377,457],recust:41,recv:466,red:[2,10,193,194,217,282],redefin:[3,471,477,495],redirect:12,redo:12,reduc:[],reduct:[18,19,119,120,167,253,289,355],redund:396,ree:445,reed:[253,289],rees:[7,9,13],ref:[323,324,362],refactor:6,refer:[],referenc:[3,6,12,63,68,71,116,191,197,207,212,231,288,328,356,387,401,426,434,467,487,495],reflect:[],reformat:7,refresh:203,reg:472,regard:[6,59,252,302,307,429,433],regardless:[15,71,168,171,190,209,210,220,239,255,257,258,259,261,262,263,286,299,308,314,370,466,472,479],regim:[6,322,329,388,478],region:[],region_spher:8,region_styl:335,regist:[8,118,144,310,432,433],regoin:6,regress:495,regspher:168,regstrip:337,regul:6,regular:[1,3,9,41,62,88,166,170,191,204,214,231,326,356,388,466,469,471,473],reigon:495,reinhardt:[323,324],reject:[168,217,432,484],rel:[1,6,14,27,36,41,59,71,92,104,124,132,142,146,150,151,153,168,177,194,197,204,210,214,220,221,224,231,237,240,251,252,276,280,285,294,296,297,303,311,314,316,321,322,326,333,337,355,356,363,395,398,399,416,417,419,434,461,470,478,483,487,490,496],relat:[],relatic:[],relationship:[6,290,339,355,440,461,490,495],relax:[],releas:[0,5,7,8,13,215],relect:[3,424],reles:42,relev:[2,6,12,41,78,80,113,130,168,172,194,198,199,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,220,221,222,225,227,228,230,231,232,235,236,242,243,244,246,247,248,249,251,252,254,264,265,266,267,268,269,270,271,272,273,279,283,284,285,287,288,291,293,295,296,297,300,301,302,303,308,312,314,315,316,321,322,325,326,327,328,329,330,331,332,333,334,336,337,355,363,373,374,379,385,387,388,390,391,392,395,397,398,399,400,401,406,408,409,410,412,413,414,416,417,424,425,429,434,442,449,452,460,461,462,466,482,496],reli:[3,12,291,395,433,462,469,479],reloc:12,remain:[7,12,33,37,41,50,55,59,71,87,105,148,149,150,151,155,156,157,158,160,171,181,187,188,191,198,199,204,206,207,210,211,218,220,239,240,247,255,256,261,262,263,274,275,276,278,283,284,306,314,317,318,319,325,326,337,339,347,350,364,377,395,402,415,422,424,450,464,469,470,474,479,481,483,487,490,495,496],remaina:377,remaind:[168,191,221,285,314,327,455,469],remap:[3,6,12,59,61,71,151,168,190,210,220,237,252,276,355,469,470,471],remedi:[6,490],rememb:2,remov:[2,3,6,8,9,13,54,71,72,77,92,108,116,118,142,146,147,148,149,150,151,155,156,157,158,160,161,168,171,172,197,206,210,215,228,239,240,245,251,253,255,261,262,263,274,275,276,278,284,290,299,300,302,314,317,318,319,321,337,355,365,390,417,422,469,472,480,481,495,496],remove_bia:8,remove_bias_al:8,remove_molecul:203,remove_sourc:203,remove_speci:203,ren:167,renam:[12,338,480],render:[12,13,191,193,194],rendon:[255,256],reneighbor:[3,8,12,39,57,71,210,214,231,314,327,337,391,486,487],renssela:284,renumb:71,reorder:[3,12,39,466],repeat:[2,6,193,194,210,217,218,231,307,358,377,453,455,457,464,483],repeatedli:2,repel:237,repes:191,replac:[2,3,6,11,12,41,63,89,90,119,145,146,147,148,149,150,151,154,155,156,157,158,160,161,191,193,194,195,206,207,209,210,211,212,214,217,221,239,260,287,294,296,387,409,470,471,476,477,487,495,496,497,499],replic:[],replica:[],replica_fil:12,report:[],repositori:[7,12,403,431,432,433],reprens:326,repres:[1,3,6,8,9,12,15,40,41,42,59,67,71,90,115,118,180,188,191,193,206,207,208,209,210,211,212,218,224,232,234,239,242,255,282,284,286,294,299,300,303,311,326,328,335,356,365,371,377,398,405,415,416,417,419,420,421,427,430,432,433,456,457,464,466,469,479,481,484,490,495,497],represent:[3,6,8,9,57,59,136,170,191,232,233,282,326,377,395,398,422,434,469,472,490],reprocess:474,reproduc:[3,255,332,387,393,399],repul:419,repuls:[6,7,9,36,40,45,46,110,237,290,331,332,335,372,376,377,385,387,391,395,399,401,415,419,423,440,449,455,458,461,462,479],reqir:[290,292],request:[3,6,8,12,41,104,171,188,191,236,242,297,314,316,353,355,424,432,433,464,474,479,483,495,496,497],requir:[],rerun:[],rescal:[],research:[5,7,242,246,422,464,483],resembl:294,reserv:[12,236,490],reservoir:[91,231,235,239,326],reset:[],reset_atomic_reference_posit:203,reset_dt:8,reset_target:8,reset_tim:203,reset_timestep:[],resid:13,residu:236,residue1:366,resist:[6,236],resolut:[208,440,452],resolv:[218,282,314,417],resort:3,resourc:[7,371,393],respa:[3,16,225,236,255,368,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,420,421,422,423,425,427,429,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,460,461,462,477,478,489,495],respecifi:422,respect:[1,6,9,10,13,14,15,17,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,42,43,45,46,47,48,49,51,53,54,56,59,70,71,87,89,97,98,111,114,120,124,145,150,153,155,162,166,167,174,175,177,178,179,180,182,183,185,186,188,193,194,210,211,216,217,218,220,234,237,239,240,242,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,290,291,299,300,303,311,313,326,331,334,340,342,343,345,346,349,351,353,355,356,360,363,364,369,370,371,372,374,376,377,378,379,380,381,382,383,385,386,387,390,391,393,394,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,419,420,422,424,425,426,427,429,434,435,439,440,441,442,451,452,453,454,455,456,457,458,460,461,462,466,470,478,479,482,490,495,497,499],respon:9,respond:[6,7,151,220,395,429],respons:[6,7,253,322,329],resquar:[],rest:[6,8,12,288,292,298,377,417,419,486,487,490],restart1:282,restart2:282,restart2data:[],restart:[],restartfil:[12,13],restor:[3,8,60,61,104,168,198,199,288,303,311,316,486,487],restore_bia:8,restore_bias_al:8,restrain:[],restraint:[9,219,253,298,313,406],restratin:298,restrict:[],result:[1,2,3,6,7,9,11,12,13,15,16,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,41,43,45,46,47,48,49,51,53,54,56,63,64,66,67,71,75,87,90,91,94,104,105,107,111,112,114,116,117,118,119,120,121,143,145,148,151,155,162,163,165,167,168,171,174,175,177,178,179,180,182,183,185,186,188,190,191,193,194,197,200,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,224,227,230,231,232,234,239,240,242,246,253,255,257,258,259,260,261,262,263,264,265,272,274,275,276,277,278,281,282,290,291,296,297,299,301,302,314,317,319,322,323,324,326,327,328,330,331,332,334,336,339,340,342,343,345,346,349,351,355,356,365,368,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,395,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,417,419,420,422,424,425,426,427,429,433,434,435,442,451,452,453,454,455,456,457,458,460,461,462,464,466,469,471,472,473,474,478,479,480,481,483,494,495,496],resum:495,retain:[2,215,216,377,422,466],retart:[33,50,181,347],retir:432,retreiv:8,retriev:[6,8,229,420,421,495],reus:[3,481],rev:[6,13,64,70,92,108,112,142,143,156,204,233,239,241,253,255,256,260,276,281,291,294,299,303,314,318,321,323,324,329,362,377,385,386,387,390,393,394,395,398,399,404,409,416,417,418,419,421,430,434,441,451,453,454,455,458,464],revers:[2,6,8,87,179,217,237,255,279,280,290,307,322,323,329,365,415,478,490],review:[142,290,303,321,422,431,441,464,483,490],rewind:354,rewrap:191,rewrit:[5,12],rewritten:19,rezwanur:429,rfac0:[142,441],rfactor:314,rfile:299,rg0:312,rgb:194,rh3:167,rh4:167,rhaphson:3,rheolog:6,rhi:452,rho0:[419,437,439,447,448],rho0_meam:419,rho:[],rho_0:[447,448],rho_alpha_beta:393,rho_bkgd:419,rho_colloid:331,rho_e:326,rho_fin:325,rho_i:[420,421],rho_initi:325,rho_ref_meam:419,rho_wal:331,rhodo:10,rhodopsin:[1,10],rhosum:[],ribier:362,richardson:299,richi:[9,19],rick:[290,291,386,440],rick_and_stuart:291,ridg:[9,19],right:[3,6,11,12,41,144,168,186,187,190,214,217,237,242,252,279,339,358,387,469,472,479,495],rightmost:[41,214],rigid:[],rigidifi:299,rii:[89,90],rij:[92,108,215,216,280,391,449],rin:[401,412,413],ring:[],rino:[73,458],rinv:355,rirj:[332,399],rise:[],risi:[142,441],risk:[8,298,478],rix:[89,90],rjk:[215,216],rjone:[7,9,13],rlo:452,rmask:[3,495],rmass:3,rmax:[71,169,215],rmdir:480,rmin0:[142,441],rmin:[71,169,216,409],rmsd:325,rnemd:6,robert:9,robin:194,robust:[361,362,363],rock:419,rockett:430,rod:299,rodata:12,rodnei:294,roi:7,role:321,roll:12,ronchetti:108,room:[57,59],root:[11,87,89,90,192,321,325,370,393,476],rosati:39,rose:419,ross:419,rosski:282,rosybrown:194,rot:[6,91,282,298,321,496],rotat:[],rotation:108,rotaton:472,rough:[6,168,193,336],roughli:[7,10,12,41,151,166,193,208,231,239,240,254,255,269,286,299,314,317,318,321,356,365,370,436,438,471,478],round:[],rous:232,rout:[87,401,415],routin:[5,6,8,11,15,16,38,39,56,88,172,174,242,422,431,452,482],roux:[6,224,240,456,490],row:[6,65,66,68,69,75,79,90,93,94,105,107,110,116,117,118,121,148,156,163,165,167,206,207,209,210,211,212,245,299,326,328,336,395],royalblu:194,rozero:419,rperp:[252,307],rpi:284,rpm:12,rrespa:[1,3,5,7,8,16,198,199,252,255,366,371,372,373,374,375,376,378,379,380,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,420,421,423,425,427,429,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,460,461,462,478],rspace:3,rsq:[452,459],rsurfac:326,ru3:167,ru4:167,rub:20,rubia:[420,421],rudd:[424,452],rudra:[7,9],rudranarayan:[7,284],ruiz:204,rule:[],run1:[6,369,495],run2:[6,352,354,369,495],run3:[6,369,495],run4:[6,369,495],run5:[6,369,495],run6:[6,369,495],run7:[6,369,469,470,474,495],run8:[6,369,495],run:[],run_styl:[],runloop:354,runtim:[12,17,193,370],russia:9,rutherford:326,rutuparna:[453,455],ryan:9,ryckaert:[302,349],rycroft:166,rydberg:422,s00:429,s0st:6,s2050:1,s2629:393,s319:203,s_fact:304,s_i:[6,395],s_ij:6,sack:7,saddl:[254,365],saddlebrown:194,sadigh:[204,393,420,421],saed_vtk:120,safe:[12,193,224,240,370],safe_zon:3,safest:[3,314],safeti:304,safezon:433,safran:461,sagui:[356,390],sai:[1,3,12,13,194,432,433,467],said:363,sakai:454,sall:[9,440],salmon:194,salt:[388,397,419,469],salter:440,same:[1,2,3,4,6,8,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,38,39,40,41,43,44,45,46,47,48,49,50,51,53,54,56,57,59,62,63,65,69,71,72,77,79,81,82,84,85,87,88,89,90,91,92,93,95,98,104,105,106,108,110,111,112,114,115,117,118,119,142,143,144,145,146,147,148,149,150,151,154,155,156,157,158,160,161,162,164,166,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,185,186,188,189,190,191,192,193,194,197,198,199,200,203,204,206,209,210,211,212,213,214,215,216,217,218,220,221,225,226,227,230,231,232,233,234,235,236,237,238,239,240,241,242,245,252,255,257,258,259,260,261,262,263,264,265,272,274,275,276,277,278,280,281,282,284,285,286,289,290,291,292,294,295,296,297,298,299,301,302,303,308,311,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,332,333,334,335,337,339,340,341,342,343,345,346,349,351,355,356,358,359,360,364,365,366,367,368,369,370,371,372,374,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,405,406,407,408,409,410,411,412,413,414,415,416,417,419,420,423,424,425,426,427,429,430,434,435,440,442,449,450,451,452,453,454,455,457,458,460,461,462,464,466,467,469,470,471,472,474,477,478,479,480,481,482,483,487,490,494,495,496,498],sampl:[1,2,4,6,9,10,11,12,14,91,104,146,147,161,166,190,193,206,207,210,211,219,221,229,231,233,235,255,256,282,285,294,296,300,311,312,314,318,321,324,336,366,377,392,469,483],sample_frequ:203,san:429,sandia:[0,5,7,9,13,14,17,70,113,396,419,429],sandybrown:194,saniti:[298,366],satellit:[6,150],satifsi:495,satisfi:[3,12,73,120,142,166,167,218,242,260,302,334,363,366,399,483],satur:388,save:[6,8,12,19,40,59,188,193,208,217,232,233,239,240,241,285,294,326,356,366,368,377,471,474,481],sb3:167,sb5:167,sc3:167,scalabl:[],scalar:[],scale:[0,1,3,4,5,6,9,10,13,18,40,59,63,71,72,91,115,118,119,142,154,162,188,190,191,193,194,197,198,199,203,204,207,218,220,231,235,236,237,239,241,242,253,255,257,258,259,260,261,262,263,282,286,289,290,299,305,306,314,316,318,321,323,324,326,330,337,355,356,358,364,367,371,372,373,388,392,395,399,402,416,417,419,422,429,436,438,456,470,472,474,478,481,483,486,487,495,496],scale_factor:[436,438],scalegamma:242,scalexi:[3,218,255,260],scalexz:[218,255,260],scaleyz:[218,255,260],scan:[194,216,354,470],scatter:[11,120,167],scatter_atom:11,scatter_coord:11,scenario:[6,40,61,217,288,297,314,327,335,366,473,474,478,486],scf:490,schaik:415,schedul:464,schell:454,schemat:217,scheme:[6,9,18,232,233,255,282,294,302,326,355,456],schlitter1:325,schlitter2:325,schlitter:325,schmid:391,schneider:[239,241],schoen:355,schr:490,schroding:395,schroeder:[108,490],schulten:[240,303,356,490],schunk:314,schwen:9,sci:[73,334,386,421,430,440],scienc:[8,203,217,236,303,323,393,420,440,454],scientif:[142,393],scm:11,scratch:[12,41,214],screen:[],screenshot:11,scripe:11,script:[],scripta:67,scsl:12,sdk:[],sea:11,seagreen:194,seamlessli:288,search:[0,2,3,8,12,92,108,169,171,194,195,314,361,362,363,365,367,464,470,471,483,495],seashel:194,sec:[12,489,494],second:[1,3,6,9,10,11,12,16,54,57,59,61,71,88,91,104,106,108,114,135,136,140,143,144,156,162,166,167,169,170,171,190,191,194,197,198,206,207,209,210,211,212,217,231,232,237,252,254,282,296,298,299,302,303,311,312,314,323,324,326,337,355,358,362,363,365,366,370,375,377,378,380,381,386,387,393,395,396,399,400,402,406,409,419,424,426,440,451,454,455,456,458,462,464,465,466,467,469,471,476,478,482,483,487,490,494,495,496,497,499],second_mo:440,secondari:[3,180],sectinn:498,section:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,58,59,63,64,65,66,67,68,69,71,74,75,78,79,80,81,83,86,87,88,89,90,91,93,94,97,98,99,100,101,102,104,105,106,107,109,110,111,113,114,115,116,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,144,145,146,147,148,149,151,152,153,154,155,156,157,158,159,160,161,162,163,164,166,167,169,174,175,176,177,178,179,180,181,182,183,185,186,187,188,190,191,192,193,195,197,200,201,202,203,204,206,207,208,209,210,211,212,213,214,215,216,217,219,220,221,223,224,226,227,228,230,231,232,233,234,236,238,239,240,241,242,243,244,245,246,248,249,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,270,272,273,274,275,276,277,278,280,281,282,284,285,286,288,289,290,291,292,293,294,295,296,299,301,302,303,304,305,306,307,308,310,314,317,318,319,320,321,322,323,324,325,326,327,329,330,332,333,334,337,338,340,341,342,343,344,345,346,347,349,350,351,356,357,358,360,364,365,367,369,370,371,372,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,424,425,426,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,464,465,466,467,469,470,472,474,477,478,479,480,482,483,484,487,488,490,495,496],section_acceler:[9,12,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,43,45,46,47,48,49,51,53,54,56,111,114,145,155,174,175,177,178,179,180,182,183,185,186,188,200,213,220,227,230,234,239,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,291,299,301,302,317,319,330,334,340,342,343,345,346,349,351,356,371,372,374,378,380,381,382,383,385,386,387,390,391,393,394,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,420,425,426,427,429,434,435,442,451,452,453,454,455,457,458,460,461,462,472,478],section_accerl:393,section_command:[0,1,9,339],section_error:[7,12],section_exampl:[2,6],section_histori:[7,12],section_howto:[6,8,9,11,12,40,42,57,59,64,66,67,68,70,71,72,73,75,76,77,78,80,81,82,83,84,85,86,87,89,90,92,94,95,96,97,98,99,100,101,102,105,107,108,111,112,113,116,118,119,122,137,138,139,140,142,143,148,150,162,163,165,166,170,189,206,254,267,270,273,329,375,389,464,469,472,483],section_modifi:[6,7,42,191,193,487],section_packag:12,section_perf:7,section_python:[6,12],section_start:[3,4,6,9,11,359,365,463,464,478,484,487],section_tool:[6,7],see:[1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,248,249,250,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,272,273,274,275,276,277,278,280,281,282,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,301,302,303,304,305,306,307,308,310,311,313,314,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,337,338,339,340,341,342,343,344,345,346,347,349,350,351,352,355,356,358,359,360,362,363,364,365,366,367,369,370,371,372,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462,463,464,465,466,467,469,470,471,472,474,475,476,477,478,479,481,482,483,484,485,486,487,488,489,490,495,496,497,498,499],seed1:484,seed2:484,seed:[3,168,171,190,193,202,204,215,216,217,219,221,228,231,232,233,239,240,241,242,282,285,289,294,299,314,318,321,326,333,379,391,392,464,479,484,490,495,496],seed_com:240,seed_drud:240,seek:[41,214],seem:[6,218,327,362,419,478],seen:[12,242,335],segement:3,segment:[3,4,6,7,12,40,42,82,115,197,270,299,314,391,405,433,449,450,469,477,479],select:[6,12,15,59,61,71,119,120,157,162,167,168,188,193,195,202,204,210,211,220,221,228,231,236,237,252,303,313,321,322,327,329,331,333,334,336,353,355,361,365,367,370,401,406,419,440,466,470,472,478,479,483,488,495],self:[],sellerio:13,semi:[3,195,203,204,279,281,470],semiax:146,semimet:395,send:[0,3,5,7,8,11,12,194,236,466],sender:[3,466],sens:[1,3,6,7,18,39,41,42,59,104,187,191,206,209,210,211,212,214,217,220,232,233,238,239,240,241,285,289,294,300,314,321,322,326,329,337,365,387,407,411,453,454,455,464,469,474,478,481,486],sensabl:236,sensibl:105,sensit:[2,6,73,218,294,496],sent:[194,236,353],sep:[6,11,495],separ:[2,6,7,9,12,13,40,41,76,118,124,142,166,168,171,194,195,203,207,214,215,216,217,218,221,224,231,239,240,255,269,282,285,286,288,290,294,299,302,314,317,318,319,322,329,337,356,370,378,380,387,388,390,407,416,417,419,426,431,441,450,451,452,455,461,467,469,470,471,478,481,486,490,496,497,498],seper:388,sequec:495,sequenc:[2,3,12,41,59,191,193,194,195,214,233,254,337,358,365,402,430,484,495],sequenti:[59,60,194,430,470],sequestr:7,ser:281,seri:[3,4,6,9,13,18,142,191,193,194,207,212,232,233,285,369,372,398,419,422,424,434,442,452,467,476,477,486,487,495],serial:[],serial_icc:12,serious:8,serv:[6,130,170,314,449],server:[1,238,370],set:[],set_callback:229,set_energi:229,set_vari:[6,11,467],setarea:242,sete:[206,217],setenv:[11,12,384],setfl:[13,371,393],setforc:[],setgamma:242,setmask:8,settl:218,setup:[3,4,6,7,8,11,12,13,16,37,40,55,59,71,87,91,156,169,170,171,172,187,194,203,217,220,314,327,350,366,367,370,450,466,469,477,497,499],setup_pre_exchang:8,setup_pre_forc:8,setup_pre_force_respa:8,setvel:[],seven:421,seventh:[135,140],sever:[1,4,5,6,7,8,10,11,12,13,15,18,39,40,63,71,87,162,169,172,187,191,192,195,197,203,215,216,218,233,239,242,246,255,284,286,288,299,303,314,321,330,353,358,363,370,373,377,381,392,393,402,411,415,419,424,430,432,433,439,440,464,467,471,475,483,487,490,495,496],sexton:422,sfactor:[3,193,194,364],sfftw:12,sgi:12,sgmc:204,sgrid:314,sgroup:166,shade:193,shake:[],shan:[17,291,386],shanghai:[9,13],shape:[2,3,6,8,40,41,58,59,62,71,82,115,132,146,151,152,168,170,190,193,194,197,198,210,214,218,220,239,253,255,257,261,265,266,274,276,289,314,327,335,375,398,434,466,469,470,471,479],shapei:[115,469],shapex:[115,469],shapez:[115,469],shapshot:474,share:[],shared0:[],sharon:299,sharp:[335,419,455],shawn:9,shear:[3,4,5,6,7,9,59,61,151,190,218,220,242,255,276,314,329,332,399,416,417,429,437,439],sheet:473,shell:[],shen:9,shenderova:372,sheppard:362,shflag:12,shield:[],shift:[],shiftse:314,shiga:[6,255,256],shini:[193,498],shinoda:[6,9,255,256,435],shiny:193,ship:195,shlib:[11,12],shlibflag:12,shock:[4,9,197,202,253,260,289,333,409],shockvel:[253,289],shortcut:[218,255,286,299],shorter:[3,121,231,280,367,424,477],shortest:[193,367,373,478],shorthand:194,shoul:457,should:[1,2,3,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,35,38,39,40,41,42,43,44,45,46,47,48,49,51,53,54,56,59,61,70,71,73,81,83,87,91,97,98,99,103,104,111,112,114,143,145,146,147,150,151,154,155,156,158,161,164,166,168,170,172,174,175,176,177,178,179,180,182,183,185,186,188,189,190,191,193,194,198,199,200,201,204,208,213,214,215,216,217,218,220,221,223,224,226,227,228,229,230,231,232,233,234,235,237,239,240,241,242,244,245,246,247,252,255,257,258,259,260,261,262,263,264,265,269,272,274,275,276,278,280,281,282,283,284,285,286,287,289,290,291,292,293,294,295,296,297,298,299,301,302,308,311,314,315,317,318,319,320,321,322,325,326,327,329,330,331,332,333,334,335,336,337,339,340,341,342,343,345,346,349,351,356,358,359,361,363,364,365,366,367,368,370,371,372,374,375,376,378,379,380,381,382,383,384,385,386,387,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,407,408,409,410,411,412,413,414,415,416,417,419,420,422,424,425,426,427,428,429,431,432,434,435,436,438,440,442,449,451,452,453,454,455,456,457,458,460,461,462,464,465,466,467,469,470,471,472,473,474,476,477,478,479,481,485,486,487,490,495,496,497],shouldn:[3,8],show:[6,11,12,118,280,365,401,419,422,452],shown:[1,12,16,17,41,97,98,120,142,154,167,187,214,217,239,255,276,282,285,294,321,355,395,396,398,399,415,422,434,440,469],shrank:71,shrink:[3,6,41,57,59,71,170,190,191,193,198,199,202,214,220,221,237,242,280,314,333,337,355,356,363,387,407,411,424,469,470],shrunk:71,shut:[6,11,366,468],si4:167,siam:334,sic:[4,387,402,419,426,451,453,455,458],sic_tersoff:430,sicc:[394,451,453,455,458],sicg:[453,455],sicsi:[394,451,453,455,458],side1:472,side2:472,side3:472,side4:472,side:[3,8,41,57,61,158,168,204,205,214,217,221,231,237,242,252,280,285,293,311,331,335,336,337,365,387,398,399,434,457,467,469,472,479],sidewai:4,sienna:194,siepmann:329,sigam:385,sigam_ii:405,sige:[453,455],sigma0:377,sigma14:415,sigma1:377,sigma2:377,sigma:[3,6,10,45,46,50,54,87,174,191,194,198,199,231,242,280,314,330,331,335,358,367,370,372,375,376,377,378,382,383,385,390,391,392,394,395,398,400,401,405,406,407,408,409,410,411,412,413,414,415,418,423,424,434,435,445,451,457,478,494,495,496],sigma_14:382,sigma_:388,sigma_c:385,sigma_cc:[372,385],sigma_h:397,sigma_i:[396,424],sigma_ii:[405,457],sigma_ij:[405,424,457],sigma_j:424,sigma_max:392,sigma_ss:385,sign:[3,6,12,179,187,279,311,334,339,422,477,486,495],signal:468,signicantli:17,signifi:[3,66,75,90,94,105,107,116,148,163,165],signific:[7,12,18,86,232,253,256,294,314,327,395,398,419,422,424,497],significantli:[1,6,39,143,166,242,255,298,395,451],sij:207,sikandar:17,silbert:399,silent:[194,467,480],silicon:[394,419,451,469],sill:429,silver:194,sim:[9,435],similar:[5,6,7,8,9,11,12,17,18,40,41,42,46,59,68,72,87,114,117,118,143,144,168,169,191,194,197,198,199,206,208,214,229,230,232,239,245,246,256,288,289,294,298,299,318,321,331,332,334,336,356,361,362,364,372,375,377,391,393,395,399,415,416,424,429,430,439,466,471,476,478,483,485,487,490,495,496,497,499],similarli:[3,6,7,8,59,114,164,170,172,190,191,193,194,205,206,209,210,211,212,216,220,226,237,255,257,258,259,261,262,263,284,286,299,300,302,314,321,322,329,335,340,356,358,365,368,381,399,411,451,466,469,472,473,478,479,483,498],simluat:[6,39,194,314,416,470,471],simlul:[299,326],simmul:329,simpl:[],simpler:[8,11,42,194,299],simplest:[3,8,40,66,75,90,94,105,107,116,118,148,163,165,290,490],simpli:[1,3,6,8,11,12,14,17,66,71,75,88,90,94,96,105,107,115,116,121,148,163,165,171,172,194,197,198,199,206,209,210,211,212,216,218,220,224,229,238,240,245,255,282,286,297,299,300,322,328,329,355,356,358,364,365,370,381,390,402,411,419,424,466,467,474,477,484,487,494,495],simplif:395,simplifi:[204,298,422],simplist:11,simualt:356,simul:[],simulatan:370,simulation_nam:433,simulationub:440,simulatoin:[12,470],simult:370,simultan:[6,7,15,16,220],sin:[220,252,331,334,336,430,469,472,479,495],sinc:[0,1,2,3,6,8,9,10,11,12,13,15,16,21,22,33,39,41,44,54,59,61,64,67,71,73,89,90,112,118,120,146,148,158,166,170,171,173,174,176,181,191,193,194,197,198,199,200,201,204,205,206,207,208,209,210,211,212,213,214,217,218,219,220,221,225,226,231,233,235,238,239,241,242,252,255,257,258,259,260,261,262,263,266,269,276,280,282,285,287,288,294,297,299,303,313,314,322,326,327,328,329,331,332,335,336,337,338,340,341,354,356,363,364,365,366,369,370,371,372,377,380,381,382,383,385,386,390,391,392,393,394,398,399,400,402,403,404,406,407,409,410,411,412,413,414,415,416,417,418,419,420,421,422,424,427,430,431,432,433,434,435,440,441,442,451,452,453,454,455,458,462,464,466,467,469,470,472,474,477,478,479,480,481,483,487,490,494,495,496,498],sinclair:[7,393,450],sine:430,singapor:142,singh:371,singl:[1,2,3,6,7,8,9,11,12,14,15,16,17,18,40,41,42,57,59,61,63,65,66,68,69,75,77,79,87,88,90,93,94,104,105,107,110,115,116,117,118,119,121,144,148,163,165,166,168,191,193,194,195,197,202,205,206,207,209,210,211,212,214,216,217,218,221,224,228,230,235,242,245,252,255,256,260,269,282,284,285,287,298,299,300,302,304,310,314,316,326,328,331,332,334,336,337,339,355,356,361,364,365,366,367,369,370,371,372,377,382,384,386,392,393,394,395,396,399,400,401,402,403,404,419,420,421,422,426,427,430,431,432,433,434,440,441,442,451,453,454,455,458,464,465,467,469,476,477,478,479,480,481,482,483,486,495,498,499],singleel:377,singular:[415,416,417],sinnott:[291,372,386],sinusoid:[168,220,331,332,334,336],sio2:458,sio:386,sirk:[143,449],sisic:[394,451,453,455,458],sisisi:[394,451,453,454,455,458],sister:384,sit:[281,469],site:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,67,70,87,236,242,243,302,356,371,377,387,393,397,407,411,415,427,432,433,456],situat:[9,218,231,242,255,282,300,362,377],sival:167,six:[6,135,140,142,207,209,426,430],sixth:426,sixthpow:[383,424],size:[],size_restart:8,sizex:263,sjplimp:[0,7,11,12],sjtu:9,skew:[3,6,58,59,170,193,220,255,469,472],skin:[3,12,39,61,73,117,169,171,231,269,299,326,366,367,370,428,487,494],skip:[12,16,33,181,284,354,364,369,406,469,474,477,486,495],skyblu:194,slab:[3,6,71,156,210,285,311,355,356,366,424],slateblu:194,slategrai:194,slater:[],sleight:54,slepoi:419,slice:[],slider:11,slight:[3,12,326],slightli:[1,6,39,40,191,192,193,195,294,299,356,372,387,405,407,411,453,455,458,464,477,497],sligthli:390,sliozberg:449,slip:[3,197,314,330,336],sllod:[],slope:[6,104,105,322,324,329,388,495],slot:1,slow:[3,6,7,12,39,232,236,239,240,253,314,321,355,365,370,424,440,478,488,490,496],slower:[1,10,17,39,240,356,370,377],slowest:[326,466],slowli:[12,71,214,330,363,422,442,471],slurm:12,slurm_localid:12,sm3:167,small:[],smallbig:3,smaller:[1,3,6,12,16,17,39,56,59,61,71,121,166,170,191,193,194,204,221,225,231,242,281,299,314,324,339,355,356,361,370,405,424,450,457,459,469,476,478,495,499],smallest:[3,42,70,71,72,166,253,296,495],smallint:3,smallq:356,smallsmal:[3,12],smart:233,smd:[],smd_contact_radiu:479,smd_lammps_userguid:9,smd_mass_dens:479,smd_user_guid:[],smi:[3,370],smirichinski:9,smit:231,smith:427,smmoth:479,smooth:[],smoother:168,smoothli:[54,142,322,329,382,400,413,415,418,455,462],smpd:12,smtb:[9,440],smtbq:[],smulat:422,sn2:167,sn4:167,sna:[],snad:[],snap:[],snapcoeff:441,snaphot:474,snapparam:441,snapshot:[],snav:[],snb:17,snow:194,soc:401,socket:[12,17,18,238,466],soderlind:422,soft:[],softer:[331,335],softwar:[1,6,11,12,14,15,16,17,18,19,166,236,284,300],sole:[215,216,365,430,437,439],solid:[4,6,7,9,10,39,40,41,59,70,73,91,104,143,166,203,214,218,220,225,245,255,257,258,259,261,262,263,280,281,286,299,321,324,356,358,378,409,422,429,437,439,469],solut:[3,6,13,166,218,225,253,297,302,314,335,495],solv:[3,9,12,18,242,290,302,324,326,356,362,417],solvat:[4,10,168],solvent:[4,7,13,61,71,169,171,214,228,232,233,239,255,297,299,311,314,322,329,330,382,385,387,388,397,407,416,417,434,450,469,479],solver:[],some:[1,2,3,4,6,7,8,9,10,11,12,13,16,17,18,39,40,41,55,61,63,71,103,106,109,115,119,121,146,147,148,149,160,161,162,168,171,176,179,187,189,191,193,194,197,198,199,202,204,205,206,207,209,210,211,212,214,216,217,218,219,228,231,253,255,256,287,288,290,292,299,303,315,321,326,327,328,330,331,337,353,354,355,356,361,362,363,364,365,366,367,370,373,375,377,384,387,393,395,402,422,424,432,433,450,452,464,466,467,468,469,471,474,475,476,477,478,479,481,483,486,487,494,495,496,499],somehow:3,someindex:338,someon:[7,11,363],someth:[2,3,7,8,11,12,59,218,255,331,334,336,366,402,467,476],sometim:[2,3,6,8,12,18,210,218,255,322,329,355,367],somewhat:[7,9,12,70,104,148,158,206,255,355],somewher:[17,256,395],soon:[42,204,217,228,231,236,432],sophist:[7,144],sorensen:483,sort:[3,13,16,39,71,191,194,195,236,365,366,370,392,470,471,498],sound:[130,242,253,304,447,448],soundspe:[447,448],sourc:[],source_integr:203,sourceforg:11,south:142,souza:322,space:[2,3,6,8,11,12,18,41,59,71,120,142,157,162,167,168,188,190,193,198,199,202,209,210,211,214,216,220,221,237,242,249,252,255,281,282,297,300,304,314,331,333,334,336,339,355,356,358,364,365,366,378,380,381,387,390,393,395,405,407,411,419,422,427,430,435,452,459,461,466,469,472,481,487,490,495,496],spahn:399,span:[2,12,38,71,198,199,210,237,299,355,371,372,377,386,393,396,403,404,419,420,421,426,430,441,451,453,454,455,458,463,464,472,473,495],spars:[71,188],spatial:[],spawn:236,spc:[],spcpu:487,speak:[17,314,321],spearot:[120,167,300],specfi:[12,109,237,472],speci:[],special:[],special_bond:[],specif:[1,2,3,6,7,8,9,10,12,13,15,16,17,18,22,29,33,40,41,42,50,63,71,110,115,117,118,148,150,153,168,176,181,191,193,194,195,197,198,199,202,203,206,207,209,210,211,212,214,217,219,228,229,231,232,236,242,250,285,287,288,291,299,321,326,327,331,337,341,356,363,365,370,372,375,377,389,393,398,399,402,403,404,405,419,422,424,432,433,434,450,451,456,457,466,469,470,474,475,476,478,479,485,486,487,494,495,496,497],specifi:[2,3,6,7,8,9,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,59,61,63,65,66,68,69,70,71,73,75,76,77,78,79,80,81,83,85,86,87,88,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,143,145,148,150,155,156,157,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,185,186,187,188,190,191,192,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,227,230,231,232,233,234,235,237,238,239,240,242,243,244,245,247,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,269,272,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,294,295,296,297,298,299,300,301,302,303,307,308,311,312,313,314,315,316,317,318,319,321,324,325,326,328,330,331,332,333,334,335,336,337,338,339,340,341,342,343,345,346,347,349,350,351,354,355,356,358,359,360,363,364,365,366,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,490,494,495,496,497,498,499],specifii:[233,242],speciti:478,spectral:441,spectrum:[9,142,289,294],sped:[39,253],speed:[1,3,6,9,12,14,15,16,17,18,19,39,41,130,191,194,214,239,242,253,289,304,314,321,327,333,355,356,365,370,377,387,422,424,447,448,453,464,478,484],speedup:[1,18,356,478],spefici:[168,193,401],speicifi:[],spell:472,spellmey:[6,174,481],spend:[12,205],spent:[1,12,13,15,464,483,488],sph:[],sph_lammps_userguid:9,sph_user_guid:[],sphere1:242,sphere:[],spheric:[],spheriod:[3,6],spherioid:314,spheroid:[6,299,314],spike:118,spin:[9,40,115,332,373,395,469],spirit:[7,208],spit:3,spline:[],split:[1,3,6,11,12,18,41,206,210,214,240,255,334,355,370,457,463,466,478],splittol:[6,355],sppark:6,spread:[1,6,12,339,477],spring:[],springer:303,springgreen:194,sptial:71,sputter:221,sq2:[3,358],sqrt:[2,3,42,59,81,89,108,231,239,241,280,314,330,332,358,385,391,393,397,399,419,424,495],squar:[],squeez:[218,237,416,417],squibb:[5,7],sr2:167,src:[0,1,3,4,6,7,8,9,11,12,14,15,16,17,18,19,166,191,229,302,422],srd:[],srmax:71,srmin:71,srolovitz:393,srp:[],srtio:440,srun:12,ssao:[193,498],stabil:[6,9,239,255,377,432],stabl:[6,64,130,242,260,298,304,377,490],stabli:232,stack:[3,8,70],stage:[3,8,87,197,229,254,293,337,365,464,483,495],stagger:[1,3,194,356,476,485,495],stai:[3,14,17,198,199,253,271,289,370,469],stamp:[321,470],stamped:12,stan:17,stand:[0,6,7,12,13,295,432,433,467],standard:[],stanford:9,starikov:326,start:[],start_6:397,start_7:478,startstep:495,stat:[12,54,172,280,294,363,391],statcoul:494,statcoulomb:494,state:[],statement:[3,467,468],stationari:[],statist:[3,6,12,39,41,64,208,215,216,217,232,233,239,240,241,284,285,289,294,299,302,314,325,326,327,363,365,372,391,392,399,416,461,464,471,477,479,483,486,487],statu:[3,12,54,60,123,172,219,224,240,386,468,483],statvolt:494,std:12,stdin:[3,12,354],steadi:[6,253,260,289],steelblu:194,steep:452,steepest:[7,362],steer:[7,9,219,222,303],stegailov:326,steinhardt:[63,108],steinhaus:490,stencil:[3,242,355],step:[1,2,3,6,8,10,11,12,13,14,15,16,17,18,19,39,71,91,97,98,112,118,119,130,143,154,164,166,191,192,193,194,195,197,198,199,203,204,206,207,208,209,210,211,212,214,215,216,217,218,220,221,224,225,228,229,231,233,236,237,240,253,269,280,281,287,288,289,290,291,292,300,302,303,304,314,316,319,320,321,322,323,324,325,326,327,328,329,336,337,339,354,355,361,363,365,366,391,397,401,419,422,432,433,440,464,466,467,471,473,474,476,477,478,483,484,486,487,490,495,499],stepani:303,stepwis:87,stesman:321,steve:[0,5,7,13],steven:217,stiff:[6,40,51,215,216,281,282,363,429,490],stile:388,still:[1,3,6,9,11,12,13,14,17,38,41,61,71,92,110,118,166,172,188,189,191,194,198,199,214,235,239,269,290,294,314,326,339,355,356,361,383,393,398,399,402,406,416,428,432,434,442,450,469,471,477],stilling:[3,5,7,15,88,144,394,421,430,450,451,458,481],stipul:236,stl:[9,71,307,310],stl_surf:310,stochast:[4,7,9,197,233,314,321,336,392],stoddard:390,stoichiometri:440,stoke:[242,330],stoll:[239,241],stone:[9,19,356,390],stop:[],stopstep:495,stopthresh:[41,214],storag:[3,12,15,328,370,481],store:[],store_st:315,storm:12,stouch:7,str:495,straatsma:6,straddl:[3,59,61,158,237,299,311,337,469,473,479],straight:299,straightforward:[13,395,490],strain:[2,3,6,59,80,123,126,127,132,133,134,138,139,190,218,220,253,255,260,416,417],strang:[188,193,495],strategi:[],stratford:242,strcmp:339,stream:[3,6,114,143,148,151,152,193,203,220,232,233,239,240,276,285,294,314,496],streamlin:[12,477],streitz:[],streiz:387,strength:[3,9,142,162,173,193,298,331,335,376,402,433,434,481],stress:[],stretch:[3,54,59,119,215,303],strict:441,strictli:[6,41,188,214,253,289,321,469],stride2:495,stride:[194,233,476,485,495],strietz:387,strike:221,string:[2,3,6,11,12,41,168,191,192,194,206,207,208,209,210,211,212,214,231,287,300,339,357,369,419,430,431,432,441,465,467,469,479,480,486,487,495],strip:495,strong:[290,372],stronger:6,strongest:[416,417],strongli:[1,6,13,221,299,302,326,422,490],structrur:3,structur:[],structured_point:300,strucur:73,stuart:[290,291,372,386,440,450],stub:12,stuck:218,student:284,studi:[6,106,409,440],studio:[],stukowski:[204,393],style1:[33,50,181,347,402,469],style2:[33,50,181,347,402,469],style:[],style_nam:[255,256],stylecomput:440,stylist:8,sub1:480,sub:[1,3,4,6,7,8,9,11,12,13,18,33,37,39,40,41,42,50,55,58,61,63,68,87,91,109,142,162,170,181,187,192,193,194,198,199,214,218,220,255,256,260,281,289,294,299,302,326,327,335,337,347,350,358,360,370,375,386,392,398,399,401,402,424,432,433,434,440,456,457,462,466,469,472,478,486],subbox:[119,193,194],subdirectori:4,subdivis:242,subdomain:242,subequ:11,subgroup:[191,498],subinterv:192,subject:[6,41,171,214,456],submit:[],subramaniyan:13,subroutin:370,subscript:[11,326,340,396,458,495],subsequ:[6,11,12,41,59,104,169,194,208,214,218,231,321,326,327,328,358,369,393,450,467,469,470,476,479,480,489,495,499],subset:[6,11,12,16,41,80,142,191,194,214,251,255,257,258,259,260,261,262,263,285,286,290,299,365,370,372,377,402,424,463,466,469,471,474,478,495],substanti:[6,16,451,478],substep:255,substitut:[1,2,3,12,191,238,365,369,395,424,467,480,495],substract:387,substrat:[170,218,255,257,258,259,261,262,263,286,299,469],substyl:[415,478],subsystem:326,subtl:[95,97,98,233],subtleti:154,subtract:[3,6,54,63,91,95,98,103,104,106,114,143,145,146,147,148,149,150,151,152,154,155,156,157,158,160,161,191,197,206,231,232,235,239,240,241,243,247,251,276,283,299,337,366,414,469,479,487,495,496],succe:12,succeed:[207,208],succes:208,succesfulli:3,success:[2,6,11,12,14,15,118,191,194,204,207,218,221,231,269,285,299,314,321,339,363,365,467,468,476,477],successfulli:[3,11,191,221,467,480],successulli:11,successv:474,sucessfulli:3,sudden:36,suddenli:335,sudo:[11,12],sufac:42,suffer:[16,17,18,329,335,370],suffici:[2,3,7,17,18,41,61,71,192,210,214,253,255,281,314,321,328,331,339,406,424,469,490],suffix2:12,suffix:[],suggest:[0,6,7,12,253,289,467,490],suit:[7,9,13,199,242,395],suitabl:[4,12,13,17,54,87,191,217,288,318,377,384,399,415,419,432,433,464,483],sukumaran:208,sum:[3,6,8,9,12,40,70,71,76,80,83,88,89,90,92,95,99,104,106,108,109,111,112,114,118,119,125,141,142,143,145,148,149,150,151,154,155,156,157,158,160,162,164,165,166,206,207,209,210,211,212,221,229,232,239,240,245,280,281,285,289,294,299,300,303,313,324,326,328,331,335,337,355,356,363,375,387,391,395,396,405,407,410,419,432,433,441,457,467,487,490,495,496],summar:[6,396,440],summari:[],summat:[6,9,42,70,88,108,355,356,381,387,393,394,407,411,422,440,451,453,454,455,458],summer:[3,13,210,432,433],sumsq:119,sun:[21,43,175,340,383,424,433],sunderland:17,sup:[281,289,294,386,440,490],supercomput:[12,18,467],superpos:[402,450],superposit:7,supinski:422,supplement:[233,432,433],supplementari:[219,398,434],suppli:[12,188,231,253,326],support:[1,3,6,7,8,9,11,12,13,14,15,16,17,18,19,40,41,42,61,87,88,103,109,191,192,193,194,195,198,199,200,201,206,214,217,218,219,226,229,233,234,237,239,240,241,242,250,253,255,257,258,259,260,261,262,263,274,275,276,277,278,280,281,286,289,291,293,298,299,301,304,305,306,307,308,310,311,313,317,318,319,320,324,329,331,335,353,354,355,356,362,363,364,370,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,456,457,458,460,461,462,466,470,471,472,476,478,479,480,482,483,489,490,494,495,498,499],suppos:[3,8,396,495],suppress:[6,12,166],sure:[6,8,11,13,14,188,198,199,218,299,302,336,393,452],surf:169,surfac:[2,3,4,6,8,9,40,42,57,70,120,142,166,168,171,193,197,221,228,237,242,245,280,291,298,307,310,311,314,321,326,331,335,336,365,377,402,416,417,422,438,440,457,461,466,472],surface_mov:326,surfact:[388,397],surpris:395,surrog:9,surround:[38,56,70,168,188,194,218,255,257,258,259,261,262,263,280,286,299,452,490],suspect:3,suspens:[416,417],sustain:[191,218,399],suzuki:[255,299],svg:6,svn:[7,11,12],sw_exampl:431,swamp:299,swap:[],swegat:325,swiggl:[3,252,331,334,336,472,495],swiler:[142,441],switch7_section_start:397,switchflag:[142,441],swm4:490,swol:53,swope:6,sxx:194,sy0302:9,symbol:[6,12,120,167,296,377,395,441],symmetr:[6,70,87,94,114,133,134,135,138,139,140,143,198,199,218,255,256,322,329,371,384,390,393,453,455,495],symmetri:[3,5,6,7,8,63,64,70,92,108,170,191,253,280,340,356,371,469,490],sync:[3,6,488],synchron:[1,233,365,488],synechococcu:7,syntax:[],sysdim:281,sysmt:17,sysstem:377,syst:440,system:[],system_:282,systemat:[6,9,208,231,239,422],systemx:3,t10:484,t11:484,t12:484,t13:484,t14:484,t15:484,t3e:12,t_chain:3,t_corr:3,t_correl:464,t_dephas:464,t_e:326,t_e_min:326,t_equil:[323,324],t_event:[3,464,483],t_hi:483,t_infil:326,t_init:[289,326],t_iter:3,t_j:29,t_lb:242,t_lo:483,t_order:3,t_oufil:326,t_out:326,t_outfil:326,t_qm:289,t_switch:[323,324],t_target:379,ta06a:441,ta4:422,ta5:167,ta6:422,tab:[2,469],tabbernor:120,tabinn:424,tabul:[3,7,13,22,37,38,44,55,56,65,71,79,93,188,314,355,371,377,378,380,381,382,383,384,387,393,395,407,411,418,427,430,433,435,450,452,453,459,471],tabular:430,tabulate_long_rang:433,tad:[],tadmor:9,tag:[203,490],tagint:3,tail:[3,87,112,162,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,457,458,460,461,462,487,495],tailor:[71,327],tait:[9,447,448],taitwat:[],take:[1,2,3,6,11,12,17,20,21,22,23,24,25,26,27,28,29,30,31,32,35,38,39,40,41,42,43,44,45,46,47,48,49,51,53,54,56,59,77,87,89,91,111,114,115,118,119,143,145,155,162,166,172,174,175,176,177,178,179,180,182,183,185,186,188,191,193,194,198,199,200,213,214,218,220,227,230,234,238,239,240,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,291,299,301,302,311,312,313,314,316,317,318,319,327,330,334,337,340,341,342,343,345,346,349,351,355,356,360,370,371,372,374,377,378,379,380,381,382,383,384,385,386,387,390,391,393,394,396,397,398,399,400,401,405,407,408,409,410,411,412,413,414,415,416,420,422,425,426,427,429,432,433,434,435,440,442,449,451,452,453,454,455,456,457,458,460,461,462,463,467,470,472,477,478,479,486,487,488,495],taken:[6,59,150,168,190,217,221,231,232,233,239,240,241,242,285,289,292,326,345,393,395,398,451,458,464,478,479],talk:[6,7],talli:[],tan:[194,495],tandem:[4,16,299],tang:422,tangent:[42,254],tangenti:[6,110,314,332,336,376,399],tanh:326,tantalum:[4,422,441],taper:[3,292,418],tar:12,tarbal:[0,8,11,12],target:[3,6,7,8,9,11,12,17,39,41,194,202,214,218,219,221,231,232,233,239,240,241,255,256,257,258,259,260,261,262,263,274,275,276,277,278,282,286,289,294,299,303,312,317,318,319,320,325,326,329,330,333,353,356,379,391,464,475,477,496],target_fil:325,task:[1,6,7,12,13,14,15,16,17,18,54,194,236,282,327,370,467,488],taskset:16,tatb:[4,295],tatom:490,tau:[3,157,208,239,240,242,255,286,299,317,318,323,324,326,489,494],tau_1:232,tau_k:232,tau_n_k:232,tb3:167,tbead:160,tbp:377,tchain:[255,256,260,276,277,299],tcl:294,tcom:240,tcsh:[11,12,384],tdamp:[239,255,256,260,299,317,318],tdephas:464,tdrude:[153,224,240,490],teal:194,tech:[7,9,13],technic:[6,7,9,242,292,314,433],techniqu:[6,7,9,87,197,218,253,289,299,330,333,356,424,452,490],technolgi:9,technolog:[9,14,19,236],tell:[2,6,11,12,37,55,187,197,281,350,366,432,433,450,467,471,490],telsa:17,temeperatur:11,temp:[],temp_drud:490,temp_eff:98,tempcom:[146,147,161],temper:[],temperar:282,temperatur:[],temperature_definit:203,tempfix:484,templ:[7,9,18],templat:[3,8,13,17,19,40,168,169,171,221,231,285,299,302,364,469],templeton2010:203,templeton2011:203,templeton:[9,203],tempor:232,temporari:[2,476],temporarili:[188,298,482,483],ten:14,tend:[29,255,280],tensil:[7,220],tensor:[3,6,8,63,82,83,89,90,91,94,107,114,129,132,133,134,135,138,139,140,142,143,144,145,146,147,148,149,150,151,152,154,155,156,157,158,159,160,161,218,242,245,255,256,260,284,286,299,329,355,356,364,395,416,417,422,437,439,487,495],tenth:[129,354],term:[0,1,3,5,6,7,8,9,12,20,21,22,27,38,40,45,46,61,87,88,89,91,112,114,143,144,146,147,156,161,162,175,176,177,188,194,198,199,205,207,209,212,220,226,232,233,234,239,240,241,242,254,255,256,257,258,259,260,261,262,263,274,275,276,278,282,286,289,298,299,312,317,318,319,326,328,330,332,340,341,351,355,363,366,371,372,377,378,379,380,381,382,383,385,386,387,388,389,390,391,393,394,395,396,398,399,400,407,411,414,415,416,417,419,420,421,422,424,427,434,440,449,451,453,454,455,458,461,478,479,481,487,490],termin:[120,255,363,365,437,439,468,477],termostat:318,terrel:362,terri:7,tersoff:[],tersoff_1:[453,454,455],tersoff_2:[453,454,455],tersoff_mod:454,tertiari:180,tessel:[9,166],test:[],test_descriptor_str:3,testf:188,testu:188,tether:[6,297,303,311,313,324,397],tetot:[9,440],tex:8,texa:429,texas_holdem:298,text:[2,3,4,6,7,8,12,13,38,41,56,188,191,193,194,197,203,206,207,208,209,210,211,212,214,219,236,287,325,326,338,356,358,365,393,396,406,419,441,452,465,469,470,486,495,497],textur:17,tfac_insert:231,tfactor:[3,194],tfinal:495,tfix:298,tfmc:[],th4:167,than:[1,2,3,6,8,9,11,12,13,14,15,16,17,18,27,38,39,40,41,42,56,57,58,59,61,63,68,71,76,86,88,92,106,108,110,114,117,118,121,143,166,169,170,171,177,188,190,191,192,194,197,202,204,206,209,210,211,212,214,215,216,217,218,220,221,222,225,228,231,232,233,234,237,238,239,242,253,280,281,285,286,287,288,289,290,292,294,297,298,299,300,303,304,310,311,312,314,318,319,321,322,326,329,330,331,332,333,334,335,336,337,339,355,356,361,362,363,364,365,366,367,370,375,376,377,378,380,381,382,393,395,398,399,405,416,417,419,424,432,433,434,440,442,449,450,451,452,455,457,459,461,462,464,465,466,467,469,470,471,472,473,474,477,478,481,483,484,486,495,496,497],thank:[236,453,455],thb:433,thb_cutoff:433,thb_cutoff_sq:433,thei:[0,1,2,3,4,6,7,8,11,12,13,15,16,17,20,21,23,24,25,26,27,28,29,30,31,32,35,37,38,39,40,41,42,43,45,46,47,48,49,51,53,54,55,56,57,59,61,63,64,66,68,70,71,74,75,81,82,84,87,89,90,91,94,104,105,107,110,111,114,116,117,118,119,121,142,145,146,148,150,151,154,155,161,163,165,168,170,171,172,174,175,177,178,179,180,182,183,185,186,187,188,191,193,194,197,198,199,200,202,205,206,207,209,210,211,212,213,214,215,216,217,218,220,221,226,227,230,231,232,234,235,236,239,240,242,245,252,255,257,258,259,260,261,262,263,264,265,266,267,272,274,275,276,278,284,285,286,287,288,290,291,298,299,300,301,302,314,315,317,318,319,321,325,326,328,329,330,332,334,335,337,339,340,342,343,344,345,346,349,350,351,353,355,356,358,360,362,363,364,365,366,369,370,371,372,374,375,376,377,378,379,380,381,382,383,384,385,386,387,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,405,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,425,426,427,429,430,432,433,434,435,440,441,442,449,450,451,452,453,454,455,456,457,458,459,460,461,462,465,467,469,470,471,472,473,474,478,479,481,482,487,490,495,497,498],them:[1,2,3,4,6,7,8,9,11,12,13,14,17,39,40,41,54,59,71,91,104,109,116,119,121,144,170,175,191,193,194,195,205,206,207,209,210,211,212,214,217,218,220,228,236,239,240,251,255,257,258,259,260,261,262,263,274,275,278,280,286,288,296,297,298,299,302,314,317,318,319,321,325,326,328,332,333,334,336,337,340,356,358,364,365,366,370,371,377,384,393,396,398,402,424,434,442,457,464,467,469,476,481,484,490,495,496],themselv:[6,11,171,198,199,214,240,355,356,365,367,371,377,387,393,415,419,420,421,441,495],theor:321,theorem:[232,239,377],theoret:[106,236,289,451],theori:[3,6,9,12,40,142,203,219,233,255,281,355,356,377,422,461,483],thereaft:[71,247,283,299,322,329,467],therebi:[327,416,417],therefor:[3,6,12,64,87,153,224,231,240,242,302,321,356,389,431,433,451,456,478,490],therein:[6,419],thereof:87,thermal:[],thermo:[],thermo_modifi:[],thermo_p:[3,63,111,467,487],thermo_press:[63,114,218,224,255,257,258,259,260,261,262,263,286,486,487,490],thermo_styl:[],thermo_temp:[63,114,145,217,218,231,255,257,258,259,260,261,262,263,274,275,276,278,281,286,317,318,319,486,487,490],thermoberendsen:6,thermochem:494,thermochemistri:395,thermodyam:[487,494],thermodyanm:[63,217,314,337,478],thermodynam:[],thermophys:424,thermost:[6,150,202,219,224,240,333,490],thermostat:[],thermostatequ:6,thesi:[355,356,416,431],thess:378,theta0:[20,21,24,26,27,28,32,33,35,36,142,177,298,349],theta0max:142,theta10:377,theta1:[175,340,377],theta2:[175,340,377],theta3:[340,377],theta4:377,theta5:377,theta6:377,theta7:377,theta8:377,theta9:377,theta:[3,6,26,27,37,38,63,65,80,92,108,142,167,168,177,190,193,234,294,298,326,340,349,401,430,454,469,472,479],theta_0:426,theta_:[349,377],theta_c:401,theta_ijk:377,theta_ijl:340,theta_jik:[420,421],theta_pi:377,theta_sigma:377,thex:290,thi:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,419,420,421,422,423,424,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,490,491,492,493,494,495,496,497,498,499],thick:[71,120,193,210,472],thie:112,thijss:321,thin:[118,193],thing:[3,6,11,12,54,68,71,218,255,286,299,314,466,467,471,495],think:[3,6,7,8,11,13,194,299,337,342,346,358,363,402,432,433,452,467,471,474,495],third:[6,9,12,29,91,136,142,143,166,206,207,209,210,211,212,232,296,311,312,326,386,396,419,426,456,458,464,465,467,469,472],thirumalai:180,thistl:194,tho:394,thole:[],thompson:[0,5,7,9,13,114,142,143,358,441],thoroughli:9,those:[1,2,3,4,5,6,7,8,12,13,17,18,20,21,23,24,25,26,27,28,29,30,31,32,33,35,38,39,40,42,43,45,46,47,48,49,50,51,53,54,56,61,71,72,77,87,91,92,108,110,111,112,114,118,142,143,145,148,155,158,168,172,174,175,177,178,179,180,181,182,183,185,186,188,190,191,193,194,204,205,206,207,210,211,212,218,220,221,228,234,236,237,238,239,245,254,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,285,288,291,299,316,323,324,328,332,333,334,337,338,340,342,343,345,346,347,349,351,355,356,363,365,366,370,371,372,374,378,379,380,381,382,383,384,385,386,387,390,391,393,394,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,419,420,424,425,426,427,429,432,433,434,435,441,442,450,451,452,453,454,455,457,458,460,461,462,464,466,467,469,471,472,473,474,476,478,479,481,483,486,487,488,490,495,498,499],though:[6,8,12,39,40,63,71,91,105,168,191,194,204,210,215,216,218,220,225,256,297,299,301,310,322,329,339,355,358,365,391,392,393,395,396,398,399,415,416,424,458,464,469,471,472,477,481,488,495],thought:[151,239,276,299,330,331,362,399,406,490],thread:[1,3,9,12,16,17,18,236,327,353,370,482,488],threads_per_atom:3,three:[1,3,6,54,63,74,87,91,92,106,119,120,121,132,142,146,167,168,180,197,217,218,223,243,255,260,281,286,299,314,321,323,326,344,345,349,355,356,364,370,371,372,377,393,394,396,398,399,403,406,419,420,421,422,426,430,433,434,440,441,451,453,454,455,458,467,469,472,495],threebodi:451,thresh:[41,191,193,194,214,467],threshhold:[3,41,193,214,337,467],threshold:[3,41,86,194,214,280,366,433,464,483],thrid:467,through:[3,6,7,9,11,12,63,168,191,195,218,229,231,236,237,242,244,245,246,255,256,282,290,307,321,326,331,354,361,372,394,395,399,407,422,435,440,442,449,456,464,467,470,480,486,490],throughout:[6,16,118,120,327,370,422,469],thru:[3,6,7,11,12,66,74,75,81,89,90,94,104,105,106,107,163,190,191,194,209,252,314,334,339,354,363,369,472],thrust:1,thu:[1,2,3,6,8,9,11,12,18,33,38,39,41,42,50,59,61,63,64,66,67,70,71,72,73,75,77,81,88,90,91,92,94,104,105,107,108,110,111,115,116,117,118,119,142,143,144,148,151,156,158,163,164,165,168,170,171,172,176,181,187,188,190,191,193,194,195,197,198,199,200,201,205,206,207,209,210,211,212,213,214,215,216,217,218,220,221,224,226,228,232,233,234,235,236,237,239,240,245,250,255,260,271,280,286,288,290,294,297,299,300,301,302,303,307,308,311,312,313,314,315,317,318,319,321,322,325,326,328,329,330,331,334,335,336,337,339,340,347,355,356,358,361,363,364,365,369,370,371,372,375,377,378,379,380,381,382,383,384,385,386,387,391,392,393,394,395,396,397,398,399,402,403,404,405,407,411,415,416,417,419,420,421,422,424,425,427,429,430,431,432,433,434,440,441,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,462,464,466,467,469,470,471,472,473,474,476,477,478,479,481,483,484,485,486,487,488,490,494,495,496,497,498],thumb:[8,10,17,168,190,252,299,370,385,472,478],thz:294,ti2:167,ti3:167,ti4:167,tight:[9,377,440],tightli:288,tij:390,tildeslei:[29,87,390],tile:[3,6,41,62,168,214,405,457,466,495],tilt:[3,6,57,58,59,71,156,170,191,194,210,218,220,221,234,253,255,256,280,289,356,358,458,469,472,487],time:[],time_integr:203,timedelta:207,timelin:5,timer:[],timescal:[3,205,206,207,209,210,211,212,253,289,294,395,464,478],timespan:[239,240,255,286,299,317,318],timestamp:[3,474],timestep:[],timesteppnig:302,tin:[386,387],tine:[],tinfoil:356,tini:[72,118,168,363,377,496],tinker:7,tio2:440,tio:440,tip3p:[],tip4:6,tip4p:[],tip:[],tirrel:331,titan:15,titer:299,titl:[206,207,208,209,210,211,212,287,433],title1:[206,207,208,209,210,211,212],title2:[206,207,208,209,210,211,212],title3:[206,207,209,210,211,212],tji:390,tl1:167,tl3:167,tlbr_msw:430,tlo:483,tloop:[255,256,260],tlsph:[],tlsph_defgrad:[],tlsph_strain:[],tlsph_strain_rat:[],tlsph_stress:[],tm3:167,tmax:[3,225,483],tmd:[],tmd_dump_fil:325,tmdatom:325,tmin:225,tmp1:[209,212,480],tmp2:[209,212,480],tmp3:480,tmp:[6,12,41,66,68,69,75,90,94,105,107,116,118,148,163,165,191,193,194,214,288,299,322,329,369,476,480,495],tobia:[255,256,299],todd:276,toe:162,toff:[364,469],togeth:[2,3,6,11,12,17,39,41,71,117,143,148,162,169,191,198,199,206,209,214,218,224,233,240,255,286,299,303,308,311,314,332,336,337,397,402,467,472,477,490,498],toggl:[59,172,476],togheth:3,togther:3,tol:[302,314,355,451],toler:[3,218,290,291,292,302,314,363,365,451,464,483],toma:9,tomato:194,tong:[9,13],too:[1,3,6,7,39,41,64,67,70,72,73,77,88,92,108,142,156,169,171,193,208,214,215,216,218,221,228,231,235,255,281,286,290,294,296,302,314,321,322,326,329,356,365,366,370,391,464,472,483,486,490,495],took:[71,442],tool:[],toolkit:[6,7,13,14,15],top:[0,3,8,9,11,12,13,59,151,190,197,213,220,235,242,254,276,300,333,334,336,365,370,432,433,441,469,473,479],top_group:308,top_veloc:308,topic:[495,498],toplog:[3,466],topolgi:40,topolog:[2,3,6,7,8,12,13,39,40,87,110,117,171,172,194,215,216,236,284,364,402,424,466,469,470,471,473,474,481],topwal:213,torder:299,torqu:[],torsion:[6,175,176,187,372,432,433],torsion_flag:372,tosi:378,tot:[294,440],total:[3,6,11,12,14,15,16,17,18,39,41,42,63,71,81,88,89,90,91,99,103,104,105,106,109,111,112,119,124,125,126,127,129,130,131,132,133,134,135,142,143,145,148,149,150,151,154,155,156,157,158,160,162,164,165,166,191,197,200,201,204,206,208,209,210,211,213,214,216,222,224,226,229,230,231,232,237,239,240,241,242,243,245,253,256,260,271,281,282,284,285,289,294,296,298,299,300,301,303,305,308,311,313,322,323,324,326,329,331,335,355,363,364,365,366,367,370,371,373,375,377,386,393,395,399,419,420,421,422,430,432,433,437,440,441,457,464,466,467,469,471,477,478,483,484,487,488,495],touch:[12,237,332,471],toukmaji:[356,390],toward:[9,29,166,193,197,221,222,237,242,254,260,280,297,311,325,327,349,365],toxvaerd:412,tpa:370,tparam:299,tpartial:148,tpc:370,tpcpu:487,tperiod:299,tptask:[16,370],tqx:[115,191,316],tqy:[115,191,316],tqz:[115,191,316],trace:395,track:[3,7,12,216,220,242,326,336,464,469,475,483,487,495],track_displac:203,tracker:236,trade:[6,12,291,355,356,387,407,411,478,483],tradeoff:424,tradit:[6,9,356],traffic:12,trail:[2,22,44,77,87,118,162,172,176,194,198,199,299,341,360,364,365,384,396,419,433,441,463,469,477,479],train:433,traingul:310,traj:219,traj_titl:433,trajectori:[3,6,12,39,87,191,236,255,257,258,259,261,262,263,264,265,267,268,270,272,273,274,275,276,277,278,282,299,302,303,307,327,336,391,424,433,471,479,490,494],tran:[179,180],transfer:[1,6,16,203,224,236,238,322,326,329,355,370,377,422,490],transform:[],transit:[6,9,86,254,303,325,365,388,415,421,422,455,464,483],translat:[3,6,61,63,95,96,97,98,99,146,147,148,152,161,206,231,235,239,240,245,255,261,262,263,274,275,278,282,299,317,318,319,321,358,395,469,487],transmiss:236,transmit:[6,236],transpar:[14,17],transport:[203,326,443],transpos:12,trap:[3,6,91,164,207,237,328,495],trapezoid:[207,495],trate:[3,220,236],travel:314,treat:[2,3,6,8,17,40,42,71,82,84,85,143,146,150,161,172,189,206,207,209,212,221,230,256,281,284,285,299,314,326,328,335,339,354,355,363,364,366,375,376,389,395,396,398,401,405,420,421,422,434,457,469,472,474,477,479,490,495],treatment:[9,294,389],tree:[3,284,415],tref:392,tri:[],tri_surfac:[],trial:[221,231,373,478],triangl:[2,3,6,7,40,42,82,115,136,166,197,273,299,310,314,438,450,457,469,479],triangleflag:469,triangul:[2,6,13,310,438],triangular:[4,6,42,82,115,218,273,310,438,469],tricki:[466,490],triclin:[],triflag:6,trigger:[3,11,12,62,86,214,217,231,363,487],trigon:25,trilinear:242,trilino:17,trim:[3,470],tripflag:432,tripl:[2,142,220,377,432,465,467],triplet:[3,34,37,394,426,430,451,453,454,455,458],trivial:[8,11],trj:433,trott:[7,9,14,17,142,441],troubl:[11,12],truli:8,truncat:[3,5,6,12,71,288,294,331,335,362,374,387,395,399,407,409,412,424,429,440,479],trung:15,tscale:[3,253,289],tschopp:67,tsige:381,tsrd:[314,336],tstart:[232,233,239,241,255,256,299,317,318,319,320,391,475],tstat:[],tstop:[232,233,239,241,255,256,299,317,318,319,320,391,475,483],tsuzuki:[73,458],tthi:129,ttm:[],ttm_mod:326,tucker:[142,441],tuckerman2006:[],tuckerman:[255,256,277,282,299,478],tune:[],tunnel:282,turkand:108,turn:[3,4,6,12,22,33,37,39,44,50,54,55,59,65,69,71,110,117,142,167,172,176,181,187,193,194,197,204,215,216,217,218,231,236,255,269,284,287,288,299,314,341,347,350,355,363,365,366,368,370,372,389,401,402,419,424,433,449,450,465,469,471,476,481,482,487,488,492,497],turquois:194,tutein:372,tutori:[6,9],tweak:[12,168,236,370],twice:[3,6,16,17,63,88,174,194,197,198,199,218,252,255,292,370,376,402,467,469,476],twin:67,twist:[416,417],two:[1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,22,38,39,41,42,44,54,56,57,59,61,63,65,68,69,71,76,77,79,87,88,92,93,104,109,110,115,116,117,118,119,120,142,144,146,150,151,153,154,156,162,166,167,168,169,171,176,190,191,192,193,194,197,198,199,204,205,206,207,209,210,211,212,214,215,216,217,218,221,224,228,231,232,233,235,237,238,239,240,242,245,254,255,256,260,280,281,282,285,286,288,289,290,294,296,299,303,311,314,321,322,324,326,329,332,335,337,339,341,351,355,356,358,360,361,363,364,365,368,370,371,372,373,375,377,378,379,380,381,384,385,386,387,389,390,391,392,393,394,395,396,398,399,402,405,406,407,411,415,416,417,419,422,424,427,430,431,432,433,434,436,440,441,442,449,450,451,453,454,455,456,457,458,461,462,463,464,466,467,469,470,471,472,473,476,479,481,482,483,484,486,487,490,494,495,496,497,498,499],two_temperatur:203,twobodi:[453,455,458],twogrid:3,twojmax:[142,441],twolevel:[3,466],txt2html:8,txt:[8,13,191,195,287,288,326,353,364,406,440,459,474,495],typcial:[41,214],type1:[77,120,167],type2:[77,120,167],type:[],typen:[77,120,167],typic:[1,2,3,6,7,8,10,11,12,13,14,15,16,17,18,29,39,40,41,45,46,55,57,59,61,63,70,71,86,87,103,109,121,130,162,166,168,169,171,191,192,193,194,197,198,199,200,202,203,206,208,214,215,216,217,218,220,221,226,228,229,231,234,240,255,269,281,284,285,288,290,292,298,299,302,304,306,314,321,329,330,336,355,358,362,363,364,365,366,367,370,382,384,385,387,397,398,401,402,406,407,411,416,417,419,424,434,437,439,450,452,455,464,465,467,469,470,471,472,478,481,483,484,486,494,495,497,499],typicali:12,tzou:326,u_f:242,u_ij:430,u_prom:377,uberuaga:[254,365],ubiquit:[11,377],uhf:373,uiuc:[9,17],uloop:[3,282,365,369,495],ulpsh:[],ulsph:[],ulsph_num_neigh:[],ultim:483,ultra:166,umbrella:[],umin:[26,27,48,49,177],unabl:[3,11,41,214],unaffect:[191,218,255,299,470,481,486],unalt:[198,199,269],unambigu:[71,210,458],unari:[339,495],unbalanc:3,unbias:[156,395],unbond:[216,469],unbroken:80,uncertainti:40,unchang:[59,218,221,254,255,257,258,259,261,262,263,271,286,299,469,470,473,479],uncharg:[40,356],uncom:[1,4],uncompress:[12,71,193],uncomput:[],uncorrel:[232,321,464],uncoupl:282,undefin:[3,12],under:[0,5,6,7,8,9,10,12,18,21,22,44,142,175,176,193,236,253,285,289,290,340,341,360,395,415,433,441,467,483,490],underestim:166,underflow:193,undergo:[6,86,87,104,156,232,239,240,303,314],undergon:[217,314],underli:[6,9,12,17,70,193,255,326,358],undermin:39,underpredict:6,underscor:[2,3,63,197,217,218,253,255,257,258,259,260,261,262,263,274,275,276,278,286,288,317,318,319,339,364,495],understand:[1,6,8,231,256,422],understood:[191,377],undesir:[59,218,220,255,299],undetermin:314,undisturb:[416,417],undo:[172,236],undump:[],unexpect:[3,475],unfix:[],unfix_flux:203,unfold:312,unfortun:[327,477,478],uniaxi:[3,146,260],uniform:[7,16,41,88,118,203,214,215,216,239,242,245,256,321,392,398,434,464,466,495,496],uniformli:[59,118,190,242,285,326,430,452,496],uninstal:12,uninterrupt:[204,221,231,252,253,255,257,258,259,260,261,262,263,274,275,276,277,278,288,289,299,303,313,316,324,326,332],union:[3,6,40,194,335,337,469,472],uniqu:[3,6,7,8,9,12,39,71,124,208,232,233,239,240,260,288,294,296,365,393,395,469,495,496],unit:[],unit_styl:3,uniti:[394,424,445],unitless:[64,67,70,71,116,173,206,210,211,220,231,253,255,289,332,363,373,399,427,429,451,453,454,455,458,494],unitlesss:[78,80,113],univ:[9,13],univers:[3,6,9,12,13,18,87,236,355,356,365,369,416,421,429,431,455,463,466,495],universit:[9,13],unix:[12,17,238,480],unknown:[3,12,64,73,469],unless:[2,3,9,11,12,15,16,55,57,67,104,120,153,167,168,191,194,195,202,218,221,231,239,255,257,258,259,261,262,263,285,286,299,314,325,357,363,385,424,452,467,472,476,481,495],unlik:[12,33,50,59,89,105,158,168,181,191,208,239,255,260,286,292,294,317,318,319,347,354,355,371,377,393,396,401,402,406,419,420,421,433,441,450,466,471,476,481,495,499],unlimit:430,unlucki:3,unmark:7,unmodifi:315,unnecessari:16,unoccupi:326,unoptim:193,unpack:[0,8,11,370],unpack_bord:8,unpack_border_bodi:8,unpack_border_hybrid:8,unpack_border_vel:8,unpack_comm:8,unpack_comm_bodi:8,unpack_comm_hybrid:8,unpack_comm_vel:8,unpack_exchang:8,unpack_restart:8,unpack_revers:8,unpack_reverse_comm:8,unpack_reverse_hybrid:8,unpad:194,unperturb:87,unphys:[3,6,240,255,299,469],unpredict:[297,479],unpublish:422,unrecogn:3,unrel:[8,9,13,174],unreli:424,unrestrain:298,unrestrict:373,unscal:[3,115,162,191,316,470],unset:[355,395],unshift:390,unsmooth:413,unsolv:[367,382],unsort:194,unspecifi:[220,469],unsplit:490,unstabl:[3,242],unstrain:220,unsuccess:[3,285],unsuffici:[],unsupport:3,untar:12,until:[2,3,6,12,14,38,39,41,56,71,121,188,193,214,218,221,231,236,285,307,314,316,323,339,354,355,366,369,370,377,399,452,464,469,470,474,475,477,483,494,495],untilt:472,unus:377,unusu:[3,8,366],unwant:[3,168,355],unwrap:[3,66,74,75,81,89,90,94,104,105,107,115,143,163,191,194,195,205,217,219,236,252,299,311,316,469,470,473,479],unwrapexpand:191,unzip:12,up_intern:193,updat:[0,3,6,8,12,13,125,126,127,137,138,139,140,191,197,204,215,216,224,229,232,239,240,242,244,245,248,249,252,253,255,256,257,258,259,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,284,286,288,289,294,299,306,307,316,317,318,319,321,326,337,370,377,390,422,424,432,433,439,464,469,471,479,480,483,490],upenn:[11,13],upgrad:12,upon:[6,204,236,377,456,483],upper:[2,3,41,57,59,71,88,104,106,144,157,164,190,194,207,208,210,211,214,218,224,240,242,255,289,294,331,332,337,338,363,399,440,472,496],upsid:6,upsilon:398,upto:[3,471,477],upward:221,urbana:[236,355,356,416],urey_bradlei:20,usa:9,usabl:[12,231,393],usag:[3,6,8,240,280,294,314,402,415,469],use_ldg:17,usec:489,useful:370,user:[],user_misc:[30,31,35,178,183,186,345],userguid:9,usr:[11,12,14,470],usual:[2,3,6,9,12,14,17,18,24,28,32,35,36,47,61,71,87,119,146,147,148,153,161,166,185,191,193,198,199,204,206,217,218,219,220,231,234,239,241,253,260,281,289,290,296,298,299,314,322,326,329,331,335,339,346,353,365,366,370,382,385,388,390,398,402,403,406,415,416,417,424,426,436,437,438,439,441,449,451,456,464,468,470,474,478,480,483,486,487,495,499],util:[8,12,17,18,370,398,488],utilizi:12,utilz:[12,488],utsa:429,utsph_strain_r:139,uttormark:13,uuml:281,uwo:9,v11:6,v22:6,v33:6,v_0:[3,326],v_2:422,v_3:422,v_4:422,v_a:[8,220],v_abc:[467,487,495],v_area:[2,495],v_atomfil:479,v_c:162,v_cluster:288,v_dc:162,v_delta:87,v_dhug:[253,289],v_diff:[164,328],v_displac:220,v_dk:162,v_dlj:162,v_drai:[253,289],v_dx:[252,472],v_dy:[252,472],v_dz:252,v_e_hbond:401,v_ea:[432,433],v_eb:[432,433],v_eqeq:[432,433],v_espac:200,v_f:467,v_fac:467,v_flux:235,v_foo:[467,495],v_ij:430,v_increas:234,v_integr:328,v_jx:91,v_jy:91,v_jz:91,v_k11:91,v_k22:91,v_k33:91,v_k:162,v_ke:[191,498],v_left:472,v_lgr_po:[253,289],v_lgr_vel:[253,289],v_linear:[331,334,336],v_lj:162,v_mol:194,v_mu:416,v_myi:252,v_myindex:495,v_myke:119,v_mystep:476,v_myvar:[8,194],v_myx:252,v_n:[242,422],v_name1:[162,220],v_name2:[162,220],v_name:[3,6,71,87,119,190,191,193,194,198,199,200,201,205,206,207,208,209,210,211,212,213,226,234,235,237,239,240,252,301,308,316,317,318,319,328,331,334,336,467,472,476,479,485,487,495,496],v_nstep:337,v_occ:397,v_omega:252,v_oscil:[200,201,213,226,301],v_phi:234,v_prefactor:[198,199,442],v_press:143,v_pressdown:[334,336],v_push:200,v_pxy:6,v_pxz:6,v_pyz:6,v_r0:237,v_r1:166,v_r2:166,v_r:[166,237],v_rad:337,v_radiu:237,v_ramp:[331,334,336],v_rate:[220,237],v_scale1:[198,199],v_scale2:[198,199],v_size:[198,199],v_t_qm:289,v_temp:322,v_theta:[234,472],v_tp:220,v_up:472,v_v0:495,v_v11:6,v_v22:6,v_v33:6,v_v:[252,495],v_valu:[193,467],v_vx:252,v_vy:252,v_vz:[252,496],v_wiggl:[331,334,336],v_x:[2,168,237,252,331,334,336,467,472,495],v_xave:6,v_xmax:6,v_xx:168,v_y:[168,237,472],v_yi:168,v_z:472,vacanc:[4,166,323,422],vacf:[],vacuum:[326,356,388,455,462],valanc:377,vale:3,valenc:[292,377,395,432,433],valent:377,valeriu:9,valid:[2,3,6,9,11,12,71,120,154,167,194,218,231,239,280,299,314,337,339,353,358,393,395,398,422,430,469,470,477,479,495],vallon:419,valon:419,valu:[],valuabl:488,value0:495,value1:[12,148,205,206,207,208,209,210,211,212,260,328,337,480],value2:[12,148,205,206,207,208,209,210,211,212,260,328,337,480],valuei:207,valuej:207,valuev:[7,9],valus:288,van:[9,53,87,109,286,290,295,317,385,386,415,419,432,433,461,496],vanadium:422,vanderwa:[424,487],vanilla:[6,8,12],vanillia:42,vanish:[224,294,302],vapor:[41,214,231,486],vapour:321,var1:480,var2:480,varaibl:[3,472],varavg:12,vare:326,vari:[1,18,41,61,62,71,87,120,156,158,167,198,199,203,206,207,210,214,218,220,253,255,286,298,299,317,318,326,331,355,382,391,400,413,416,429,442,452,466],variabl:[],variable_hill_factor:13,variable_nam:433,varianc:[119,391,495],variant:[1,3,6,12,83,99,260,299,355,362,370,420,421,453,455,478,482,496],variat:[12,41,214,495],varieti:[1,2,6,7,9,13,15,71,193,236,353,358,402,419,432,433,450,458,495],variou:[],varreturn:467,varshalovich:142,varshnei:13,vartiabl:3,vashishta1990:458,vashishta2007:458,vashishta:[],vbia:6,vcm:[],vdim:[157,322,329,496],vdisplac:[3,237,252,331,334,336,495],vdw:[3,386,433],vec1:[119,288],vec2:[119,288],vec:280,vector:[],vel:[3,6,61,206,210,211,220,240,285,303,333,376,391,395,399,464,471,472,474,490,495],veld:[13,314,356,381,411],veloc:[],velocit:[235,391,395,399],velocity_bottom:242,velocity_gradi:439,velocity_temp:496,velocity_top:242,vendor:12,verbatim:467,verbos:[12,440],veri:[1,3,6,7,8,9,10,12,13,17,41,71,72,87,118,119,191,193,194,205,206,207,208,209,210,211,212,214,215,216,218,231,245,255,256,269,282,297,302,317,318,328,365,366,367,370,395,399,416,417,429,441,442,452,477,487,488,490,494,497],verifi:[8,370,424,478,484],verlag:303,verlet:[1,3,7,8,12,18,203,239,255,269,276,282,302,315,326,334,337,463,466,478],versa:[3,6,13,59,162,170,217,237,239,240,299,469,470,490],versu:[6,14,15,16,18,39,41,80,104,105,118,164,194,214,299,302,356,381,390,399,411,424,487,495],vertex:[42,136,310,376],vertic:[2,41,42,136,193,214,221,310,376,495],vfinal:495,vfrac:115,vhi:[157,496],via:[],vibrat:[6,9,221,233,280,289,294,349,395,464,478],vice:[3,6,13,59,162,170,217,237,239,240,299,469,470,490],video:193,view:[4,6,7,9,13,191,193,314,377,395,396,440],viewer:[191,193],viewpoint:193,vij:391,vika:13,vim:[],vincent:[9,19],violat:321,violet:194,virial:[3,63,91,114,142,143,162,198,199,218,224,255,256,257,258,259,260,261,262,263,284,286,299,302,355,370,373,391,392,395,403],virialmod:403,virtual:[6,7,8,12,451],virut:9,visa:7,viscoelast:[113,399,429],viscoelsat:429,viscos:[],viscou:[],viscous:299,vision:440,visit:[300,432,433],vista:191,visual:[],viz:[11,13],viz_tool:11,vizplotgui_tool:11,vizualiziton:300,vlo:[157,496],vmax:[218,314],vmd:[6,7,9,11,13,191,195,236,470],vmdarch:195,vmdhome:195,vname:[168,495],voigt:[6,142],vol:[],volfactor:355,volpress:422,volt:[431,494],volum:[2,3,6,40,41,58,59,63,80,87,91,101,114,118,120,128,132,141,143,166,167,168,171,204,206,210,211,214,218,220,221,231,242,253,255,256,260,264,265,267,268,270,272,273,274,275,276,277,278,285,286,289,299,303,326,331,335,337,355,358,364,379,416,417,422,429,447,448,462,465,466,469,472,479,487,490,494,495],volumetr:80,von:[135,140],voro:[3,9,166],vorobyov:490,voronoi:[],vorselaar:208,voter2:[464,483],voter:[420,421,464,483],voth:[40,282],vpz:333,vratio:495,vri:400,vrpn:236,vshear:332,vstream:6,vtarget:[3,329],vtk:[],vv0210:13,vx0:164,vxcm:299,vxhi:[221,285],vxlo:[221,285],vy0:164,vycm:299,vyhi:[221,285],vylo:[221,285],vz0:164,vzcm:299,vzhi:221,vzi:333,vzlo:221,w_1:142,w_2:142,w_i:142,w_ik:430,waal:[87,109,385,386,415,432,433,461],wadlei:[13,377],wag:[7,9,13],wagner:[7,9,203,242,419],wai:[1,2,3,6,7,8,11,12,15,18,22,44,59,63,65,66,69,71,72,75,77,79,87,90,91,92,93,94,105,107,108,110,116,117,118,142,143,145,146,147,148,149,150,151,154,155,156,157,158,160,161,162,163,165,168,171,176,188,190,191,193,194,197,198,199,206,209,210,212,213,216,217,218,220,229,232,237,239,240,242,253,255,260,269,282,286,288,297,299,300,303,311,314,316,317,318,319,322,325,326,328,331,334,336,337,341,342,343,344,346,349,356,358,360,363,365,366,370,371,372,384,387,388,391,392,393,394,396,398,401,402,404,407,419,420,421,424,426,430,431,434,440,441,442,449,451,453,455,458,463,464,467,469,470,471,472,473,474,477,478,479,495,496],wait:[1,12,236,281,464,466],walk:[3,232,239,240],wall:[],wall_surac:136,wall_surfac:[],wallhi:331,wallstyl:332,wander:311,wang:[356,419,430],want:[0,1,2,3,5,6,7,8,9,11,12,17,38,40,56,63,66,68,71,75,81,90,94,104,105,107,109,111,112,114,116,118,143,148,163,164,165,168,171,174,188,191,193,194,197,198,199,200,205,206,214,217,220,221,224,226,229,231,237,240,250,271,280,285,288,298,299,301,311,313,315,322,324,329,331,335,337,339,356,358,365,371,372,377,385,386,391,393,396,402,403,404,419,426,430,432,433,440,442,451,452,453,455,457,458,465,467,469,470,471,472,474,476,477,487,490,495,497,499],ward:377,warm:[16,395],warn:[],warner:371,warp:[5,419],warranti:7,warren:391,wasn:3,wast:3,watanab:[323,324],watch:365,water:[],watkin:185,wave:[7,9,40,202,253,293,333,373,395],wavefunct:[9,373,395],wavelength:[120,167],wavepacket:[40,373,395,469],wavevector:281,wbodi:83,weak:[92,290],web:[1,8,14,15,16,17,384],webb:203,weber:[3,5,7,15,88,144,394,421,430,450,451,458,481],websit:8,weckner:429,wedg:[],weight:[],welcom:467,well:[1,3,6,7,8,9,11,12,13,15,16,17,18,27,40,51,67,71,92,108,114,143,146,154,168,177,193,194,200,204,206,212,214,215,216,218,221,226,231,235,239,242,246,252,255,260,285,299,301,308,321,324,332,363,365,370,375,397,398,401,402,403,416,417,419,422,434,442,453,454,455,467,469,471,473,478,483,488,490,494,498],wennberg:355,went:[3,11],were:[3,4,5,6,7,11,12,13,15,16,19,34,41,42,52,56,60,70,71,104,108,111,114,118,145,148,168,171,172,184,191,194,197,200,206,209,210,211,212,214,220,226,228,235,236,269,276,300,332,333,337,348,355,367,369,395,399,402,406,429,433,464,466,467,469,470,471,472,474,476,484,487,495,496,498,499],weren:474,western:9,westview:461,what:[],whatev:[8,12,14,15,110,115,118,119,121,193,194,198,199,218,255,286,288,332,358,362,363,365,370,383,385,422,432,433,483,490,495],wheat:194,whelan:167,when:[0,1,2,3,4,6,8,9,11,12,13,14,15,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,33,35,37,38,39,40,41,42,43,45,46,47,48,49,50,51,53,54,55,56,59,61,62,63,71,72,81,86,88,92,104,105,106,108,109,111,114,115,118,119,121,144,145,146,151,155,156,158,164,166,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,185,186,187,188,191,192,193,194,195,197,198,199,200,201,202,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,225,226,227,228,229,230,231,233,234,236,239,242,243,245,246,250,255,256,257,258,259,260,261,262,263,264,265,269,271,272,274,275,276,278,280,284,285,286,287,288,289,291,292,293,294,298,299,300,301,302,303,311,312,314,315,316,317,319,321,322,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,342,343,345,346,347,349,350,351,352,353,354,355,356,358,361,362,363,364,365,366,367,369,370,371,372,374,378,379,380,381,382,383,384,385,386,387,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,407,408,409,410,411,412,413,414,415,416,417,419,420,421,422,424,425,426,427,429,430,432,433,434,435,441,442,449,451,452,453,454,455,457,458,460,461,462,464,466,467,469,470,471,472,473,474,475,476,477,478,479,480,481,483,484,486,487,488,489,494,495,496,497,499],whenev:[0,8,12,14,71,194,205,211,299,358,401,467,478,482,495,499],whenth:3,where:[1,3,6,8,9,10,11,12,14,15,18,21,23,24,25,26,27,28,29,32,35,36,37,39,40,41,43,47,48,49,51,55,61,63,65,66,68,69,70,71,73,75,79,80,82,83,84,85,87,88,89,90,92,93,94,95,96,97,98,99,105,107,110,114,115,116,117,118,119,120,121,143,145,146,147,148,149,150,151,154,155,156,157,158,160,161,162,163,165,167,169,171,172,175,177,187,190,191,193,194,197,198,199,200,201,206,207,210,213,214,217,218,220,221,225,226,228,229,231,232,233,234,235,237,239,240,241,242,245,246,248,250,252,253,256,260,269,272,279,280,281,282,285,287,288,289,292,294,299,300,301,302,303,307,308,311,313,316,317,318,319,322,323,324,326,329,330,331,332,334,335,336,337,340,342,343,344,345,346,349,350,351,353,356,358,362,363,364,365,366,367,370,371,372,375,377,378,380,384,385,386,387,388,389,390,391,393,394,395,396,397,398,399,400,401,402,403,404,407,411,416,417,418,419,420,421,422,424,426,427,429,430,431,432,433,434,440,441,444,447,448,449,450,451,452,453,454,455,458,461,462,463,464,466,467,468,469,471,472,473,474,476,478,479,481,483,484,485,486,487,490,494,495,496,497,499],wherea:[6,11,92,204,232,255,290,321,326,490],wherebi:291,wherev:235,whether:[6,8,11,12,17,39,40,54,59,61,63,70,71,103,109,111,155,156,188,193,194,196,197,198,199,206,212,215,216,217,218,219,220,224,228,231,240,252,255,260,288,302,314,322,328,329,337,339,353,355,356,364,368,370,380,382,386,400,402,406,416,417,419,424,433,440,450,464,467,469,470,472,474,481,482,483,486,495,496],which:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,28,29,32,33,37,38,39,40,41,42,44,45,46,47,50,51,53,54,55,56,58,59,61,63,64,66,67,70,71,72,73,74,75,76,77,78,80,81,82,83,85,87,88,89,90,91,94,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,112,113,114,115,116,118,119,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,179,180,181,182,185,187,188,190,191,193,194,195,197,198,199,200,201,202,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,245,246,249,250,252,253,254,255,256,257,258,259,260,261,262,263,265,267,269,270,272,273,274,275,276,277,278,280,281,282,284,285,286,287,288,289,290,291,292,294,295,296,297,298,299,300,301,302,303,304,305,306,308,310,311,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,331,332,333,334,335,336,337,339,340,341,343,346,347,350,351,353,354,355,356,358,360,361,362,363,364,365,366,367,369,370,371,372,373,375,376,377,378,380,381,382,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,409,410,411,413,415,416,417,419,420,421,422,424,426,427,428,430,431,432,433,434,435,436,437,438,439,440,441,442,445,449,450,451,452,453,454,455,456,457,458,461,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,490,495,496,497,498,499],whichev:[12,369,464,483],white:[194,232,239,240,241,299,318,326,469,495,498],whitesmok:194,whitespac:[2,3,194,364,469],who:[0,3,6,7,8,9,13,371,393],whole:[224,236,281,294,303,490],wholli:221,whose:[3,6,7,8,18,19,38,39,42,56,59,76,87,153,171,188,193,194,204,220,237,238,252,255,257,258,259,261,262,263,280,281,297,298,302,314,328,335,337,358,365,366,395,409,436,438,451,452,453,455,490,495,496],why:[3,6,240,322,329],wide:[1,6,7,9,61,63,197,322,329,358,367,382,385,395,432,433],wider:1,width:[193,194,373,397],wiggl:[3,220,252,307,331,332,334,336,472],wigner:142,wih:6,wiki:14,wikipedia:[6,14],wild:[3,12,22,44,77,87,118,176,198,199,299,341,360,384,401,463,471,476,497,499],wildcard:[3,12,162,172,191,193,194,296,384,449,476,479,498,499],wildli:255,win:370,window:[3,4,12,13,71,191,193,195,206,207,208,209,210,211,212,236,300,319,320,384,470],wipe:[197,402,450,491,493],wire:298,wirt:194,wisconsin:13,wise:[3,12,391,451,478],wish:[2,3,5,6,7,8,11,12,14,17,42,57,58,59,71,119,143,148,169,170,172,174,191,194,198,205,206,207,210,211,212,216,220,221,228,231,237,242,246,285,288,299,302,314,315,331,332,358,365,370,380,401,402,419,424,432,452,467,469,470,471,477,481,487,495,496,499],within:[1,2,3,6,8,9,11,12,13,15,16,17,29,39,40,41,42,55,59,61,63,65,69,70,71,72,73,77,79,92,93,108,110,114,117,118,119,121,124,142,159,168,171,192,193,194,198,199,204,205,206,209,210,211,212,214,215,216,217,221,223,228,231,237,239,280,284,285,286,288,290,299,300,302,304,306,310,311,315,326,329,331,335,337,339,354,358,363,364,365,366,367,370,375,378,380,387,392,393,394,395,397,402,403,406,407,419,422,427,428,429,434,435,450,451,453,454,455,456,458,464,466,467,469,477,478,481,483,490,494,495],without:[1,2,3,4,6,7,8,9,11,12,14,16,17,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,43,45,46,47,48,49,51,53,54,56,59,87,111,114,145,150,155,169,174,175,177,178,179,180,182,183,185,186,188,191,193,194,195,197,200,206,208,209,210,211,212,213,218,220,227,230,232,234,236,239,252,255,257,258,259,260,261,262,263,264,265,272,274,275,276,277,278,285,288,290,291,293,297,299,300,301,302,307,314,317,319,330,334,338,340,342,343,345,346,349,351,354,355,356,365,366,370,371,372,374,378,379,380,381,382,383,384,385,386,387,390,391,393,394,395,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,420,422,424,425,426,427,429,433,434,435,442,450,451,452,453,454,455,457,458,460,461,462,467,469,472,477,478,487,490,494,495],witht:[],witi:15,wolf:[],wolff:[424,452],won:[3,297,417],wong:[203,377],word:[2,3,6,8,12,29,63,194,197,204,205,206,207,210,211,212,219,237,266,271,287,292,298,328,339,354,385,424,465,467,469,495,496],work:[1,3,6,7,8,9,11,12,14,16,18,39,54,59,60,88,119,120,146,147,149,150,151,155,156,157,158,160,161,166,167,191,193,195,198,199,206,210,211,217,229,238,239,240,242,246,252,255,261,262,263,274,275,276,277,278,296,298,300,302,317,318,319,324,354,366,370,384,386,389,391,402,416,417,419,422,424,440,464,466,467,470,471,473,477,478,480,483,495],workaround:[72,118,299,424,496],worker:[12,432,433,458],workhors:8,workstat:[370,467],world:[3,12,142,354,365,369,463,466,467,484,495],worlei:391,worri:17,worsen:18,worst:335,worth:[206,207,209,210,211,212,289,300],would:[1,3,4,5,6,7,8,11,12,22,29,37,40,41,42,44,55,70,71,72,89,91,118,143,148,156,168,169,170,171,176,187,191,193,194,195,197,198,199,201,204,206,214,217,219,220,224,225,228,231,234,235,236,240,252,255,256,269,280,282,286,288,290,294,297,314,321,325,333,334,337,339,340,341,342,343,344,346,347,350,355,358,360,362,363,365,366,369,370,371,372,377,384,385,386,387,391,392,393,394,396,402,403,404,419,420,421,422,426,430,432,433,437,439,441,449,451,453,454,455,458,464,467,469,472,473,474,476,477,478,479,480,484,486,487,490,495,496,498,499],wrap:[1,3,6,11,12,57,59,168,170,190,191,192,194,195,205,211,219,220,221,236,242,252,299,311,314,331,333,335,355,356,365,467,469,470,472,477],wrapper:[],wrigger:303,wright:363,writabl:3,write:[],write_atom_weight:203,write_data:[],write_dump:[],write_freq:433,write_head:8,write_restart:[],writen:300,written:[3,5,6,7,8,9,12,13,14,17,65,69,117,142,166,191,192,193,194,195,197,198,199,200,201,202,203,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,222,224,225,226,227,228,229,230,232,233,234,235,236,237,239,240,241,242,243,244,245,246,247,248,249,251,254,264,265,266,267,268,269,270,271,272,273,279,280,281,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,311,312,314,315,317,318,319,320,321,322,323,325,326,328,329,330,331,333,334,335,336,338,353,358,366,393,402,418,422,459,461,464,465,467,470,471,475,476,483,484,485,486,495,497,498,499],wrong:[3,11,218,255,279,331,335,336,366,433,471,476],wrote:[3,471],wt1:424,wt2:424,wt3:424,wurtzit:358,www:[0,2,3,4,5,6,7,8,10,11,12,13,15,371,393,416,431,432,433,494],x86:[12,422],x_ij:430,x_ijkl:340,x_kjli:340,x_ljik:340,xave:6,xavx:16,xcm:[8,299,495],xdr:[12,191],xeon:[1,4,7,9,12,16,17,18,370,482],xflag:[155,156,243,245,251,299,321],xhe:[],xhi:[2,6,57,59,170,191,220,325,331,334,336,469,472,487,495],xhi_bound:[6,191],xhi_new:469,xhost:[12,16],xi_ij:430,xiaowang:[13,396,453,455],xiij:280,xlat:[168,220,237,487],xlo:[2,6,11,57,59,170,191,220,237,325,331,334,336,469,472,487,495],xlo_bound:[6,191],xlo_new:469,xmax:[6,202,225,269,495],xmgrace:[],xmin:495,xml:[195,431],xml_label:431,xmovi:[],xmu:[332,399],xorig:71,xplane:332,xplor:191,xpo:168,xrd:[],xsph:9,xsu:[3,191,470],xt3:191,xt4:[18,191],xt5:[18,191],xtc:[],xtcdump:194,xvf:12,xwall:[333,334,336],xxx:12,xyz:[3,6,7,13,42,66,71,107,110,156,163,168,191,192,193,194,195,210,218,245,255,256,260,286,296,297,299,311,313,332,334,336,357,364,466,470,496,498],xzhou:[13,396],xzy:466,yang:[422,430],yate:422,yb2:167,yb3:167,ybox:220,ycm:299,year:[5,7],yeh:355,yellow:[193,194],yellowgreen:194,yet:[3,7,9,17,39,42,193,198,290,296,331,356,362,363,370,383,385,386,395,461,467,469,470,495,497,498],yflag:[155,156,243,245,251,299,321],yhi:[6,59,170,191,220,325,331,334,336,469,472,487],yhi_bound:[6,191],yield:[6,91,112,119,143,151,156,194,207,218,224,255,276,290,322,328,329,332,337,355,375,391,399,424,429,487,495],yip:323,ylat:[168,220,237,487],ylo:[6,59,170,191,220,325,331,334,336,469,472,487],ylo_bound:[6,191],ymax:[202,495],ymin:495,yorig:71,york:[282,356],yoshida:[255,299],you:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,35,38,39,40,41,42,43,45,46,47,48,49,50,51,53,54,56,57,58,59,61,63,66,68,71,72,73,74,75,77,81,87,88,89,90,91,92,94,103,104,105,107,108,109,111,112,114,116,118,119,142,143,145,146,147,148,151,155,156,161,162,163,164,165,166,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,185,186,187,188,190,191,193,194,195,197,198,199,200,201,204,205,206,207,209,210,211,212,213,214,215,216,217,218,220,221,224,226,227,228,229,230,231,232,233,234,235,236,237,239,240,241,250,252,255,257,258,259,260,261,262,263,264,265,269,271,272,274,275,276,277,278,281,282,284,285,286,288,290,291,294,297,298,299,301,302,303,311,313,314,315,317,318,319,320,322,323,324,325,326,328,329,330,331,332,334,335,336,337,339,340,342,343,345,346,347,349,351,354,355,356,358,360,362,363,364,365,366,369,370,371,372,374,377,378,379,380,381,382,383,384,385,386,387,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,419,420,421,422,424,425,426,427,428,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,460,461,462,463,464,465,466,467,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,486,487,488,490,494,495,496,497,499],young:[399,436,438],your:[0,1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,43,45,46,47,48,49,51,53,54,56,59,61,109,111,114,118,145,146,147,151,155,161,166,168,169,170,171,172,174,175,177,178,179,180,182,183,185,186,188,190,191,192,193,200,203,207,209,212,213,215,216,217,218,220,221,227,230,231,234,236,239,252,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,285,288,291,297,299,301,302,303,316,317,319,322,326,328,329,330,331,332,334,335,336,337,340,342,343,345,346,349,351,356,358,364,365,366,369,370,371,372,374,377,378,379,380,381,382,383,384,385,386,387,390,391,392,393,394,396,397,398,399,400,401,402,403,404,405,407,408,409,410,411,412,413,414,415,416,419,420,421,422,424,425,426,427,429,430,432,433,434,435,442,449,451,452,453,454,455,457,458,460,461,462,463,466,467,469,471,472,473,476,477,478,479,480,481,482,486,487,494,495,497,499],yourself:[6,8,12,13,218,364],yplane:332,ypo:168,ysu:[3,191,470],yuan:9,yukawa:[],yukawa_1_1:459,yxz:466,yzx:466,z_i:[395,455,462],z_j:[455,462],z_meam:419,zachari:13,zannoni:398,zbl:[],zblcut:455,zblcutinn:441,zblcutout:441,zblexpscal:455,zblz:441,zcm:299,zcylind:332,zepeda:204,zero:[3,4,6,9,11,12,26,27,39,41,48,49,59,61,63,66,71,72,75,87,88,90,92,94,103,104,105,106,107,108,110,111,112,114,115,116,117,118,119,120,123,142,143,146,147,148,149,156,157,160,161,163,165,166,167,168,170,171,172,174,177,186,188,190,191,193,194,197,198,199,200,202,204,205,206,207,208,209,210,211,212,213,214,215,216,218,220,225,226,227,228,230,231,232,233,235,239,240,241,242,243,245,251,252,253,255,260,269,272,282,287,288,289,290,291,294,296,297,299,300,301,302,305,306,308,314,316,321,322,324,326,329,330,331,332,333,334,336,337,338,339,345,358,361,363,364,365,366,370,373,377,378,380,381,382,385,387,390,391,395,398,400,401,402,403,407,409,411,412,415,417,418,419,422,424,429,433,434,435,440,449,452,456,458,462,464,465,466,469,470,472,474,476,477,478,479,483,484,487,490,495,496,497,499],zeta:[3,242,290,396],zfactor:193,zflag:[155,156,243,245,251,299,321],zhang:[299,322,399],zhi:[3,6,170,191,202,325,331,334,336,469,472,487],zhi_bound:[6,191],zhou:[13,377,396,430,453,455],zhu:448,ziegenhain:13,ziegler:[284,419,450,455,462],zimmerman2004:203,zimmerman2010:203,zimmerman:[9,70,203,377],zlat:[220,237,487],zlib:191,zlim:440,zlo:[3,6,170,191,202,325,331,333,334,336,469,472,487],zlo_bound:[6,191],zmax:[202,242,495],zmin:[242,495],zn2:167,zone:[120,300],zoom:[3,191,193,194],zorig:71,zplane:332,zr4:167,zrest:313,zsu:[3,191,470],zwall:331,zwall_veloc:242,zxy:466,zybin:433,zyx:466},titles:["LAMMPS Documentation","5. Accelerating LAMMPS performance","3. Commands","12. Errors","7. Example problems","13. Future and history","6. How-to discussions","1. Introduction","10. Modifying &amp; extending LAMMPS","4. Packages","8. Performance &amp; scalability","11. Python interface to LAMMPS","2. Getting Started","9. Additional tools","5.USER-CUDA package","5.GPU package","5.USER-INTEL package","5.KOKKOS package","5.USER-OMP package","5.OPT package","angle_style charmm command","angle_style class2 command","angle_coeff command","angle_style cosine command","angle_style cosine/delta command","angle_style cosine/periodic command","angle_style cosine/shift command","angle_style cosine/shift/exp command","angle_style cosine/squared command","angle_style dipole command","angle_style fourier command","angle_style fourier/simple command","angle_style harmonic command","angle_style hybrid command","angle_style none command","angle_style quartic command","angle_style sdk command","angle_style command","angle_style table command","atom_modify command","atom_style command","balance command","Body particles","bond_style class2 command","bond_coeff command","bond_style fene command","bond_style fene/expand command","bond_style harmonic command","bond_style harmonic/shift command","bond_style harmonic/shift/cut command","bond_style hybrid command","bond_style morse command","bond_style none command","bond_style nonlinear command","bond_style quartic command","bond_style command","bond_style table command","boundary command","box command","change_box command","clear command","comm_modify command","comm_style command","compute command","compute ackland/atom command","compute angle/local command","compute angmom/chunk command","compute basal/atom command","compute body/local command","compute bond/local command","compute centro/atom command","compute chunk/atom command","compute cluster/atom command","compute cna/atom command","compute com command","compute com/chunk command","compute contact/atom command","compute coord/atom command","compute damage/atom command","compute dihedral/local command","compute dilatation/atom command","compute displace/atom command","compute erotate/asphere command","compute erotate/rigid command","compute erotate/sphere command","compute erotate/sphere/atom command","compute event/displace command","compute fep command","compute group/group command","compute gyration command","compute gyration/chunk command","compute heat/flux command","compute hexorder/atom command","compute improper/local command","compute inertia/chunk command","compute ke command","compute ke/atom command","compute ke/atom/eff command","compute ke/eff command","compute ke/rigid command","compute meso_e/atom command","compute meso_rho/atom command","compute meso_t/atom command","compute_modify command","compute msd command","compute msd/chunk command","compute msd/nongauss command","compute omega/chunk command","compute orientorder/atom command","compute pair command","compute pair/local command","compute pe command","compute pe/atom command","compute plasticity/atom command","compute pressure command","compute property/atom command","compute property/chunk command","compute property/local command","compute rdf command","compute reduce command","compute saed command","compute slice command","compute smd/contact_radius command","compute smd/damage command","compute smd/hourglass_error command","compute smd/internal_energy command","compute smd/plastic_strain command","compute smd/plastic_strain_rate command","compute smd/rho command","compute smd/tlsph_defgrad command","compute smd/tlsph_dt command","compute smd/tlsph_num_neighs command","compute smd/tlsph_shape command","compute smd/tlsph_strain command","compute smd/tlsph_strain_rate command","compute smd/tlsph_stress command","compute smd/triangle_mesh_vertices","compute smd/ulsph_num_neighs command","compute smd/ulsph_strain command","compute smd/ulsph_strain_rate command","compute smd/ulsph_stress command","compute smd/vol command","compute sna/atom command","compute stress/atom command","compute force/tally command","compute temp command","compute temp/asphere command","compute temp/body command","compute temp/chunk command","compute temp/com command","compute temp/cs command","compute temp/deform command","compute temp/deform/eff command","compute temp/drude command","compute temp/eff command","compute temp/partial command","compute temp/profile command","compute temp/ramp command","compute temp/region command","compute temp/region/eff command","compute temp/rotate command","compute temp/sphere command","compute ti command","compute torque/chunk command","compute vacf command","compute vcm/chunk command","compute voronoi/atom command","compute xrd command","create_atoms command","create_bonds command","create_box command","delete_atoms command","delete_bonds command","dielectric command","dihedral_style charmm command","dihedral_style class2 command","dihedral_coeff command","dihedral_style cosine/shift/exp command","dihedral_style fourier command","dihedral_style harmonic command","dihedral_style helix command","dihedral_style hybrid command","dihedral_style multi/harmonic command","dihedral_style nharmonic command","dihedral_style none command","dihedral_style opls command","dihedral_style quadratic command","dihedral_style command","dihedral_style table command","dimension command","displace_atoms command","dump command","dump h5md command","dump image command","dump_modify command","dump molfile command","echo command","fix command","fix adapt command","fix adapt/fep command","fix addforce command","fix addtorque command","fix append/atoms command","fix atc command","fix atom/swap command","fix ave/atom command","fix ave/chunk command","fix ave/correlate command","fix ave/correlate/long command","fix ave/histo command","fix ave/spatial command","fix ave/spatial/sphere command","fix ave/time command","fix aveforce command","fix balance command","fix bond/break command","fix bond/create command","fix bond/swap command","fix box/relax command","fix colvars command","fix deform command","fix deposit command","fix drag command","fix drude command","fix drude/transform/direct command","fix dt/reset command","fix efield command","fix enforce2d command","fix evaporate command","fix external command","fix freeze command","fix gcmc command","fix gld command","fix gle command","fix gravity command","fix heat command","fix imd command","fix indent command","fix ipi command","fix langevin command","fix langevin/drude command","fix langevin/eff command","fix lb/fluid command","fix lb/momentum command","fix lb/pc command","fix lb/rigid/pc/sphere command","fix lb/viscous command","fix lineforce command","fix meso command","fix meso/stationary command","fix_modify command","fix momentum command","fix move command","fix msst command","fix neb command","fix nvt command","fix nvt/eff command","fix nph/asphere command","fix nph/body command","fix nph/sphere command","fix nphug command","fix npt/asphere command","fix npt/body command","fix npt/sphere command","fix nve command","fix nve/asphere command","fix nve/asphere/noforce command","fix nve/body command","fix nve/eff command","fix nve/limit command","fix nve/line command","fix nve/noforce command","fix nve/sphere command","fix nve/tri command","fix nvt/asphere command","fix nvt/body command","fix nvt/sllod command","fix nvt/sllod/eff command","fix nvt/sphere command","fix oneway command","fix orient/fcc command","fix phonon command","fix pimd command","fix planeforce command","fix poems","fix pour command","fix press/berendsen command","fix print command","fix property/atom command","fix qbmsst command","fix qeq/point command","fix qeq/comb command","fix qeq/reax command","fix qmmm command","fix qtb command","fix reax/bonds command","fix reax/c/species command","fix recenter command","fix restrain command","fix rigid command","fix saed/vtk command","fix setforce command","fix shake command","fix smd command","fix smd/adjust_dt command","fix smd/integrate_tlsph command","fix smd/integrate_ulsph command","fix smd/move_tri_surf command","fix smd/setvel command","&lt;no title&gt;","fix smd/wall_surface command","fix spring command","fix spring/rg command","fix spring/self command","fix srd command","fix store/force command","fix store/state command","fix temp/berendsen command","fix temp/csvr command","fix temp/rescale command","fix temp/rescale/eff command","fix tfmc command","fix thermal/conductivity command","fix ti/rs command","fix ti/spring command","fix tmd command","fix ttm command","fix tune/kspace command","fix vector command","fix viscosity command","fix viscous command","fix wall/lj93 command","fix wall/gran command","fix wall/piston command","fix wall/reflect command","fix wall/region command","fix wall/srd command","group command","group2ndx command","if command","improper_style class2 command","improper_coeff command","improper_style cossq command","improper_style cvff command","improper_style distance command","improper_style fourier command","improper_style harmonic command","improper_style hybrid command","improper_style none command","improper_style ring command","improper_style command","improper_style umbrella command","include command","info command","jump command","kspace_modify command","kspace_style command","label command","lattice command","log command","mass command","min_modify command","min_style command","minimize command","molecule command","neb command","neigh_modify command","neighbor command","newton command","next command","package command","pair_style adp command","pair_style airebo command","pair_style awpmd/cut command","pair_style beck command","pair_style body command","pair_style body/rounded/polygon command","pair_style bop command","pair_style born command","pair_style brownian command","pair_style buck command","pair_style buck/long/coul/long command","pair_style lj/charmm/coul/charmm command","pair_style lj/class2 command","pair_coeff command","pair_style colloid command","pair_style comb command","pair_style coul/cut command","pair_style coul/diel command","pair_style born/coul/long/cs command","pair_style lj/cut/dipole/cut command","pair_style dpd command","pair_style dsmc command","pair_style eam command","pair_style edip command","pair_style eff/cut command","pair_style eim command","pair_style gauss command","pair_style gayberne command","pair_style gran/hooke command","pair_style lj/gromacs command","pair_style hbond/dreiding/lj command","pair_style hybrid command","pair_style kim command","pair_style lcbop command","pair_style line/lj command","pair_style list command","pair_style lj/cut command","pair_style lj96/cut command","pair_style lj/cubic command","pair_style lj/expand command","pair_style lj/long/coul/long command","pair_style lj/sf command","pair_style lj/smooth command","pair_style lj/smooth/linear command","pair_style lj/cut/soft command","pair_style lubricate command","pair_style lubricateU command","pair_style lj/mdf command","pair_style meam command","pair_style meam/spline","pair_style meam/sw/spline","pair_style mgpt command","pair_style mie/cut command","pair_modify command","pair_style morse command","pair_style nb3b/harmonic command","pair_style nm/cut command","pair_style none command","pair_style peri/pmb command","pair_style polymorphic command","pair_style quip command","pair_style reax command","pair_style reax/c command","pair_style resquared command","pair_style lj/sdk command","pair_style smd/hertz command","pair_style smd/tlsph command","pair_style smd/tri_surface command","pair_style smd/ulsph command","pair_style smtbq command","pair_style snap command","pair_style soft command","pair_style sph/heatconduction command","pair_style sph/idealgas command","pair_style sph/lj command","pair_style sph/rhosum command","pair_style sph/taitwater command","pair_style sph/taitwater/morris command","pair_style srp command","pair_style command","pair_style sw command","pair_style table command","pair_style tersoff command","pair_style tersoff/mod command","pair_style tersoff/zbl command","pair_style thole command","pair_style tri/lj command","pair_style vashishta command","pair_write command","pair_style yukawa command","pair_style yukawa/colloid command","pair_style zbl command","partition command","prd command","print command","processors command","python command","quit command","read_data command","read_dump command","read_restart command","region command","replicate command","rerun command","reset_timestep command","restart command","run command","run_style command","set command","shell command","special_bonds command","suffix command","tad command","temper command","thermo command","thermo_modify command","thermo_style command","timer command","timestep command","&lt;no title&gt;","uncompute command","undump command","unfix command","units command","variable command","velocity command","write_data command","write_dump command","write_restart command"],titleterms:{"break":215,"default":[37,39,40,55,57,58,59,61,62,71,87,88,92,103,104,106,108,109,120,124,125,142,148,156,157,161,167,168,171,173,187,189,190,191,193,194,195,196,198,199,200,202,203,204,206,210,211,212,215,216,218,219,220,221,225,228,231,232,237,239,240,241,242,243,245,250,253,255,256,260,276,277,281,282,285,286,287,288,289,291,294,296,297,299,300,314,316,321,322,323,324,327,329,331,333,337,350,353,355,356,358,359,361,362,364,366,367,368,370,373,377,379,395,416,417,422,424,432,433,449,450,464,465,466,469,470,472,474,476,477,478,481,483,485,486,487,488,489,494,496,497,498],"function":495,"long":[208,378,380,381,382,383,387,389,390,407,411,415,427,435],"new":8,"static":12,acceler:1,ackland:64,acknowledg:7,adapt:[198,199],addforc:200,addit:[12,13],addtorqu:201,adiabat:6,adjust_dt:304,adp:371,airebo:372,alloi:393,amber2lmp:13,amber:6,angl:[8,65],angle_coeff:22,angle_styl:[2,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],angmom:66,append:202,arrai:6,aspher:[6,82,146,257,261,265,266,274],atc:[9,203],atom:[6,7,8,64,67,70,71,72,73,76,77,78,80,81,85,92,96,97,100,101,102,108,112,113,115,142,143,166,202,204,205,288,495],atom_modifi:39,atom_styl:40,attract:5,aug:[],aveforc:213,awpmd:[9,373],balanc:[41,214],barostat:6,basal:67,beck:374,berendsen:[286,317],between:6,binary2txt:13,bodi:[6,8,42,68,147,258,262,267,275,375,376],bond:[8,13,69,215,216,217,295],bond_coeff:44,bond_styl:[2,43,45,46,47,48,49,50,51,52,53,54,55,56],bop:377,born:[378,389],boundari:[7,57],box:[6,58,218],brownian:379,buck:[380,381,389,418],bug:3,build:[9,11,12],calcul:6,call:12,categori:2,centro:70,ch2lmp:13,chain:13,change_box:59,charmm:[6,20,174,382,415],chunk:[6,66,71,75,90,94,105,107,116,148,163,165,206],citat:7,class2:[21,43,175,340,383],clear:60,cluster:72,cmm:9,cna:73,code:6,coeffici:6,colloid:[331,385,461],colvar:[9,13,219],com:[74,75,149],comb3:386,comb:[291,386],come:5,comm_modifi:61,comm_styl:62,comman:[],command:[2,6,8,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,491,492,493,494,495,496,497,498,499],common:3,comparison:1,compos:6,compress:9,comput:[2,6,8,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,495],compute_modifi:103,condit:7,conduct:[6,322],constant:6,constraint:7,contact:76,contact_radiu:122,coord:77,core:6,correl:[207,208],cosin:[23,24,25,26,27,28,177],cossq:342,coul:[378,380,381,382,383,387,388,389,400,407,411,415,427,435],coupl:6,creat:216,create_atom:168,create_bond:169,create_box:170,createatom:13,creation:7,csld:318,csvr:318,cubic:409,cuda:[9,14,111,114,145,155,200,213,227,230,234,255,264,301,302,317,319,330,378,380,382,383,393,399,400,407,408,410,413,425,451,453],custom:8,cut:[49,373,380,383,387,390,395,397,407,408,415,423,427],cvff:343,damag:[78,123],data2xmovi:13,data:6,databas:13,deby:[387,407],dec:0,deform:[151,152,220],delete_atom:171,delete_bond:172,delta:24,deposit:221,descript:[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,491,492,493,494,495,496,497,498,499],diagnost:7,diel:388,dielectr:173,diffract:9,diffus:6,dihedr:[8,79],dihedral_coeff:176,dihedral_styl:[2,174,175,177,178,179,180,181,182,183,184,185,186,187,188],dilat:80,dimens:189,dipol:[6,29,390],direct:224,discuss:6,disp:6,displac:[81,86],displace_atom:190,distanc:344,distribut:[7,12],document:0,dpd:391,drag:222,dreid:[6,401],drude:[6,9,153,223,224,240],dsf:[387,407],dsmc:392,dump:[6,8,191,192,193,195],dump_modifi:194,dynam:290,eam:[13,393],echo:196,edip:394,eff:[9,13,97,98,152,154,159,241,256,268,277,320,395],efield:226,eim:396,elast:6,emac:13,enforce2d:227,ensembl:7,erot:[82,83,84,85],error:3,evapor:228,event:86,exampl:[1,4,6,11,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,482,483,484,485,486,487,488,489,491,492,493,494,495,496,497,498,499],exp:[27,177],expand:[46,410],extend:[8,11],extern:229,fcc:280,featur:[7,8,495],fene:[45,46],fep:[9,13,87,199],field:[6,7],file:6,finit:6,fix:[2,6,8,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,495],fix_modifi:[198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336],flow:6,fluid:242,flux:[91,144],forc:[6,7,144,315],fourier:[30,31,178,345],freez:230,from:[6,11],futur:5,gauss:397,gaybern:398,gcmc:231,gener:[1,6,7,13],get:12,gld:232,gle:233,global:6,gpu:[9,15,374,378,380,382,383,385,387,390,391,393,397,398,400,407,408,409,410,423,425,434,435,442,451,452,453,460,461,462],gran:[332,399],granular:6,graviti:234,gromac:400,group2ndx:338,group:[88,337,495],gyrat:[89,90],h5md:[9,191,192],harmon:[32,47,48,49,179,182,331,346,426],hbond:401,heat:[91,144,235],heatconduct:443,helix:180,hertz:[399,436],hexord:92,histo:209,histori:[5,399],hook:399,hourglass_error:124,how:6,hybrid:[33,50,181,347,402],idealga:444,imag:[191,193],imd:236,implicit:382,improp:[8,93],improper_coeff:341,improper_styl:[2,340,342,343,344,345,346,347,348,349,350,351],includ:352,inclus:8,indent:237,indic:0,individu:2,induc:6,inertia:94,info:[0,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336,353],input:[2,6,8],instal:11,instruct:9,integr:[6,7],integrate_tlsph:305,integrate_ulsph:306,intel:[9,16,255,264,265,380,382,398,407,451,453],interfac:[6,11],internal_energi:125,introduct:7,invers:224,ipi:238,ipp:13,jul:[],jump:354,kate:13,keyword:424,kim:[9,403],kokko:[9,17],kspace:[2,8,9,327],kspace_modifi:355,kspace_styl:[6,356],label:357,lammp:[0,1,2,6,7,8,11,12],langevin:[239,240,241],lattic:358,lcbop:404,lennard:418,librari:[6,11,12],limit:[269,319],line:[12,270,405],linear:414,lineforc:247,list:[2,406],lj1043:331,lj126:331,lj93:331,lj96:408,lmp2arc:13,lmp2cfg:13,lmp2vmd:13,local:[6,65,68,69,79,93,110,117],log:359,lubric:416,lubricateu:417,make:12,mass:360,math:495,matlab:13,mdf:418,meam:[9,419,420,421],measur:1,meso:[248,249],meso_:100,meso_rho:101,meso_t:102,messag:3,mgpt:[9,422],micelle2d:13,mie:423,min_modifi:361,min_styl:362,minim:[8,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336,363],misc:9,mod:[326,454],model:[6,7],modifi:8,molecul:364,molfil:[9,191,195],moltempl:13,momentum:[243,251],morri:448,mors:[51,401,425],move:252,move_tri_surf:307,movi:[191,193],mpi:11,msd:[104,105,106],msi2lmp:13,msm:[378,380,382,387,407],msst:253,multi:[6,7,182],multipl:6,nb3b:426,neb:[254,365],neigh_modifi:366,neighbor:367,nemd:6,newton:368,next:369,nharmon:183,noforc:[266,271],non:[6,7],none:[34,52,184,348,428],nongauss:106,nonlinear:53,nph:[255,256,257,258,259,299],nphug:260,npt:[255,256,261,262,263,299],nve:[264,265,266,267,268,269,270,271,272,273,299],nvt:[255,256,274,275,276,277,278,299],omega:107,omp:[9,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,43,45,46,47,48,49,51,53,54,56,174,175,177,178,179,180,182,183,185,186,188,234,255,257,259,260,261,263,264,272,274,276,278,291,340,342,343,345,346,349,351,371,372,374,378,379,380,381,382,383,385,386,387,388,390,391,393,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,420,421,425,426,427,429,434,435,442,451,452,453,454,455,457,458,460,461,462],onewai:279,open:7,oper:495,opl:185,opt:[19,382,393,407,411,425],optim:1,option:[6,8,12],orient:280,orientord:108,orthogon:6,other:6,output:[6,7,8,12,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336],overlai:402,overview:11,packag:[1,9,12,14,15,16,17,18,19,370],pair:[6,109,110],pair_coeff:384,pair_modifi:424,pair_styl:[2,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462],pair_writ:459,pairwis:8,parallel:11,paramet:6,pars:2,partial:155,particl:[6,7,42],partit:463,past:5,per:6,perform:[1,10],peri:429,period:25,phonon:[9,13,281],pimd:282,piston:333,planeforc:283,plastic:113,plastic_strain:126,plastic_strain_r:127,pmb:429,poem:[9,284],point:290,polariz:6,poli:[379,416,417],polygon:376,polym:13,polymorph:430,post:7,potenti:[2,6,8],pour:285,pppm:6,prd:464,pre:7,press:286,pressur:114,previou:12,print:[287,465],problem:[3,4],process:[6,7],processor:466,profil:156,properti:[6,115,116,117,288],pymol_aspher:13,python:[9,11,13,467],qbmsst:289,qeq:[290,291,292],qmmm:[9,293],qtb:[9,294],quadrat:186,quantiti:6,quartic:[35,54],quip:431,quit:468,ramp:157,rattl:302,rdf:118,read_data:469,read_dump:470,read_restart:471,reax:[9,13,292,295,296,432,433],reaxc:9,rebo:372,recent:297,reduc:119,refer:495,reflect:334,region:[8,119,158,159,335,472,495],relat:[20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,40,41,43,44,45,46,47,48,49,50,51,53,54,55,56,57,59,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,83,84,85,86,87,89,91,92,93,94,95,96,97,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,185,186,187,188,189,190,191,192,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,228,230,231,232,233,234,235,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,294,295,296,297,299,300,301,303,304,305,306,307,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,349,350,351,352,353,354,355,356,358,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,429,430,431,432,433,434,435,436,437,438,439,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,474,475,476,477,478,479,481,482,483,484,485,486,487,488,489,491,492,493,495,496,497,498,499],relax:218,replic:473,replica:[6,7],report:3,requir:12,rerun:474,rescal:[319,320],reset:225,reset_timestep:475,resquar:434,restart2data:13,restart:[6,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336,476],restrain:298,restrict:[14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,491,492,493,494,495,496,497,498,499],rho:128,rhosum:446,rigid:[6,83,99,245,299],ring:349,rotat:160,round:376,rule:2,run:[6,11,12,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336,477],run_styl:478,scalabl:10,scalar:6,screen:12,script:[2,6,8,11],sdk:[36,435],self:313,serial:11,set:[6,479],setforc:301,setvel:308,shake:302,share:[11,12],shell:[6,480],shield:290,shift:[26,27,48,49,177],simpl:31,simul:6,size:6,slater:290,slice:121,sllod:[276,277],small:299,smd:[9,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,303,304,305,306,307,308,310,436,437,438,439],smooth:[413,414],smtbq:[9,440],sna:142,snad:142,snap:441,snapshot:6,snav:142,soft:[415,442],solver:2,sourc:7,spatial:[210,211],spc:6,speci:296,special:[7,424,495],special_bond:481,sph:[9,443,444,445,446,447,448],sphere:[84,85,161,211,245,259,263,272,278],spheric:6,spline:[420,421],spring:[311,312,313,324],squar:28,srd:[314,336],srp:449,standard:9,start:[12,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336],state:316,stationari:249,stop:[198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336],store:[315,316],strategi:1,streitz:387,stress:[143,144],structur:2,style:[1,2,6,8],submit:8,suffix:482,summari:6,swap:[204,217],syntax:[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,281,282,283,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,491,492,493,494,495,496,497,498,499],system:6,tabl:[0,6,38,56,188,452,453],tad:483,taitwat:[447,448],talli:144,temp:[145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,317,318,319,320],temper:484,temperatur:6,tersoff:[453,454,455],test:11,tfmc:321,thermal:[6,322],thermo:[6,485],thermo_modifi:486,thermo_styl:487,thermodynam:[6,8],thermostat:6,thole:456,time:[6,212],timer:488,timestep:489,tip3p:6,tip4p:[6,387,407,411,415],tip:12,tlsph:437,tlsph_defgrad:129,tlsph_dt:130,tlsph_num_neigh:131,tlsph_shape:132,tlsph_strain:133,tlsph_strain_rat:134,tlsph_stress:135,tmd:325,tool:[12,13],torqu:163,transform:224,tri:[273,457],tri_surfac:438,triangle_mesh_vertic:136,triclin:6,tstat:391,ttm:326,tune:327,type:7,ulsph:439,ulsph_num_neigh:137,ulsph_strain:138,ulsph_strain_r:139,ulsph_stress:140,umbrella:351,uncomput:491,undump:492,unfix:493,unit:494,user:[9,12,14,16,18],vacf:164,valu:[6,495],variabl:[6,8,495],variou:1,vashishta:458,vcm:165,vector:[6,328,495],veloc:496,version:[0,5,12],via:12,vim:13,viscos:[6,329],viscou:[246,330],visual:6,vol:141,voronoi:[9,166],vtk:300,wall:[6,331,332,333,334,335,336],wall_surfac:310,warn:3,water:6,weight:209,what:[7,12],wolf:[378,387],wrapper:11,write:6,write_data:497,write_dump:498,write_restart:499,xmgrace:13,xmovi:13,xrd:167,xtc:9,yukawa:[460,461],zbl:[455,462]}})
\ No newline at end of file
+Search.setIndex({envversion:47,filenames:["Manual","Section_accelerate","Section_commands","Section_errors","Section_example","Section_history","Section_howto","Section_intro","Section_modify","Section_packages","Section_perf","Section_python","Section_start","Section_tools","accelerate_cuda","accelerate_gpu","accelerate_intel","accelerate_kokkos","accelerate_omp","accelerate_opt","angle_charmm","angle_class2","angle_coeff","angle_cosine","angle_cosine_delta","angle_cosine_periodic","angle_cosine_shift","angle_cosine_shift_exp","angle_cosine_squared","angle_dipole","angle_fourier","angle_fourier_simple","angle_harmonic","angle_hybrid","angle_none","angle_quartic","angle_sdk","angle_style","angle_table","atom_modify","atom_style","balance","body","bond_class2","bond_coeff","bond_fene","bond_fene_expand","bond_harmonic","bond_harmonic_shift","bond_harmonic_shift_cut","bond_hybrid","bond_morse","bond_none","bond_nonlinear","bond_quartic","bond_style","bond_table","boundary","box","change_box","clear","comm_modify","comm_style","compute","compute_ackland_atom","compute_angle_local","compute_angmom_chunk","compute_basal_atom","compute_body_local","compute_bond_local","compute_centro_atom","compute_chunk_atom","compute_cluster_atom","compute_cna_atom","compute_com","compute_com_chunk","compute_contact_atom","compute_coord_atom","compute_damage_atom","compute_dihedral_local","compute_dilatation_atom","compute_displace_atom","compute_erotate_asphere","compute_erotate_rigid","compute_erotate_sphere","compute_erotate_sphere_atom","compute_event_displace","compute_fep","compute_group_group","compute_gyration","compute_gyration_chunk","compute_heat_flux","compute_hexorder_atom","compute_improper_local","compute_inertia_chunk","compute_ke","compute_ke_atom","compute_ke_atom_eff","compute_ke_eff","compute_ke_rigid","compute_meso_e_atom","compute_meso_rho_atom","compute_meso_t_atom","compute_modify","compute_msd","compute_msd_chunk","compute_msd_nongauss","compute_omega_chunk","compute_orientorder_atom","compute_pair","compute_pair_local","compute_pe","compute_pe_atom","compute_plasticity_atom","compute_pressure","compute_property_atom","compute_property_chunk","compute_property_local","compute_rdf","compute_reduce","compute_saed","compute_slice","compute_smd_contact_radius","compute_smd_damage","compute_smd_hourglass_error","compute_smd_internal_energy","compute_smd_plastic_strain","compute_smd_plastic_strain_rate","compute_smd_rho","compute_smd_tlsph_defgrad","compute_smd_tlsph_dt","compute_smd_tlsph_num_neighs","compute_smd_tlsph_shape","compute_smd_tlsph_strain","compute_smd_tlsph_strain_rate","compute_smd_tlsph_stress","compute_smd_triangle_mesh_vertices","compute_smd_ulsph_num_neighs","compute_smd_ulsph_strain","compute_smd_ulsph_strain_rate","compute_smd_ulsph_stress","compute_smd_vol","compute_sna_atom","compute_stress_atom","compute_tally","compute_temp","compute_temp_asphere","compute_temp_body","compute_temp_chunk","compute_temp_com","compute_temp_cs","compute_temp_deform","compute_temp_deform_eff","compute_temp_drude","compute_temp_eff","compute_temp_partial","compute_temp_profile","compute_temp_ramp","compute_temp_region","compute_temp_region_eff","compute_temp_rotate","compute_temp_sphere","compute_ti","compute_torque_chunk","compute_vacf","compute_vcm_chunk","compute_voronoi_atom","compute_xrd","create_atoms","create_bonds","create_box","delete_atoms","delete_bonds","dielectric","dihedral_charmm","dihedral_class2","dihedral_coeff","dihedral_cosine_shift_exp","dihedral_fourier","dihedral_harmonic","dihedral_helix","dihedral_hybrid","dihedral_multi_harmonic","dihedral_nharmonic","dihedral_none","dihedral_opls","dihedral_quadratic","dihedral_style","dihedral_table","dimension","displace_atoms","dump","dump_h5md","dump_image","dump_modify","dump_molfile","echo","fix","fix_adapt","fix_adapt_fep","fix_addforce","fix_addtorque","fix_append_atoms","fix_atc","fix_atom_swap","fix_ave_atom","fix_ave_chunk","fix_ave_correlate","fix_ave_correlate_long","fix_ave_histo","fix_ave_spatial","fix_ave_spatial_sphere","fix_ave_time","fix_aveforce","fix_balance","fix_bond_break","fix_bond_create","fix_bond_swap","fix_box_relax","fix_colvars","fix_deform","fix_deposit","fix_drag","fix_drude","fix_drude_transform","fix_dt_reset","fix_efield","fix_enforce2d","fix_evaporate","fix_external","fix_freeze","fix_gcmc","fix_gld","fix_gle","fix_gravity","fix_heat","fix_imd","fix_indent","fix_ipi","fix_langevin","fix_langevin_drude","fix_langevin_eff","fix_lb_fluid","fix_lb_momentum","fix_lb_pc","fix_lb_rigid_pc_sphere","fix_lb_viscous","fix_lineforce","fix_meso","fix_meso_stationary","fix_modify","fix_momentum","fix_move","fix_msst","fix_neb","fix_nh","fix_nh_eff","fix_nph_asphere","fix_nph_body","fix_nph_sphere","fix_nphug","fix_npt_asphere","fix_npt_body","fix_npt_sphere","fix_nve","fix_nve_asphere","fix_nve_asphere_noforce","fix_nve_body","fix_nve_eff","fix_nve_limit","fix_nve_line","fix_nve_noforce","fix_nve_sphere","fix_nve_tri","fix_nvt_asphere","fix_nvt_body","fix_nvt_sllod","fix_nvt_sllod_eff","fix_nvt_sphere","fix_oneway","fix_orient_fcc","fix_phonon","fix_pimd","fix_planeforce","fix_poems","fix_pour","fix_press_berendsen","fix_print","fix_property_atom","fix_qbmsst","fix_qeq","fix_qeq_comb","fix_qeq_reax","fix_qmmm","fix_qtb","fix_reax_bonds","fix_reaxc_species","fix_recenter","fix_restrain","fix_rigid","fix_saed_vtk","fix_setforce","fix_shake","fix_smd","fix_smd_adjust_dt","fix_smd_integrate_tlsph","fix_smd_integrate_ulsph","fix_smd_move_triangulated_surface","fix_smd_setvel","fix_smd_tlsph_reference_configuration","fix_smd_wall_surface","fix_spring","fix_spring_rg","fix_spring_self","fix_srd","fix_store_force","fix_store_state","fix_temp_berendsen","fix_temp_csvr","fix_temp_rescale","fix_temp_rescale_eff","fix_tfmc","fix_thermal_conductivity","fix_ti_rs","fix_ti_spring","fix_tmd","fix_ttm","fix_tune_kspace","fix_vector","fix_viscosity","fix_viscous","fix_wall","fix_wall_gran","fix_wall_piston","fix_wall_reflect","fix_wall_region","fix_wall_srd","group","group2ndx","if","improper_class2","improper_coeff","improper_cossq","improper_cvff","improper_distance","improper_fourier","improper_harmonic","improper_hybrid","improper_none","improper_ring","improper_style","improper_umbrella","include","info","jump","kspace_modify","kspace_style","label","lattice","log","mass","min_modify","min_style","minimize","molecule","neb","neigh_modify","neighbor","newton","next","package","pair_adp","pair_airebo","pair_awpmd","pair_beck","pair_body","pair_body_rounded_polygon","pair_bop","pair_born","pair_brownian","pair_buck","pair_buck_long","pair_charmm","pair_class2","pair_coeff","pair_colloid","pair_comb","pair_coul","pair_coul_diel","pair_cs","pair_dipole","pair_dpd","pair_dsmc","pair_eam","pair_edip","pair_eff","pair_eim","pair_gauss","pair_gayberne","pair_gran","pair_gromacs","pair_hbond_dreiding","pair_hybrid","pair_kim","pair_lcbop","pair_line_lj","pair_list","pair_lj","pair_lj96","pair_lj_cubic","pair_lj_expand","pair_lj_long","pair_lj_sf","pair_lj_smooth","pair_lj_smooth_linear","pair_lj_soft","pair_lubricate","pair_lubricateU","pair_mdf","pair_meam","pair_meam_spline","pair_meam_sw_spline","pair_mgpt","pair_mie","pair_modify","pair_morse","pair_nb3b_harmonic","pair_nm","pair_none","pair_peri","pair_polymorphic","pair_quip","pair_reax","pair_reax_c","pair_resquared","pair_sdk","pair_smd_hertz","pair_smd_tlsph","pair_smd_triangulated_surface","pair_smd_ulsph","pair_smtbq","pair_snap","pair_soft","pair_sph_heatconduction","pair_sph_idealgas","pair_sph_lj","pair_sph_rhosum","pair_sph_taitwater","pair_sph_taitwater_morris","pair_srp","pair_style","pair_sw","pair_table","pair_tersoff","pair_tersoff_mod","pair_tersoff_zbl","pair_thole","pair_tri_lj","pair_vashishta","pair_write","pair_yukawa","pair_yukawa_colloid","pair_zbl","partition","prd","print","processors","python","quit","read_data","read_dump","read_restart","region","replicate","rerun","reset_timestep","restart","run","run_style","set","shell","special_bonds","suffix","tad","temper","thermo","thermo_modify","thermo_style","timer","timestep","tutorial_drude","uncompute","undump","unfix","units","variable","velocity","write_data","write_dump","write_restart"],objects:{},objnames:{},objtypes:{},terms:{"00a":323,"00b":323,"02214e23":91,"03275e":494,"0892e":12,"0b1":11,"0e20":[339,472,495],"0e4":[253,332,399],"0e5":253,"0x98b5e0":193,"100k":1,"1024x1024":193,"10e":389,"10f":3,"10g":495,"10th":[464,470,483],"10x":[3,362,363,365,366,377],"10x10x10":156,"10x20x20":358,"11e":10,"15g":[194,495],"16g":[206,212],"16x":1,"18986e":363,"18e":10,"1_12":358,"1_3":358,"1_6":358,"1_prop":6,"1st":[2,6,8,12,20,22,38,44,56,57,58,60,71,87,162,174,176,188,198,199,206,207,208,209,210,211,212,216,220,255,287,297,325,337,341,360,366,371,372,377,384,386,393,395,396,403,404,413,414,419,420,421,426,430,441,451,452,453,454,455,458,463,469,477,478,481,495],"1x2x2":466,"2000k":193,"20x":377,"23899e":363,"2400k":193,"256k":10,"25x":10,"298k":388,"2_3":358,"2k_ss":395,"2nd":[2,3,6,11,12,15,17,38,45,46,56,57,60,71,77,88,150,157,188,194,206,207,208,209,210,211,212,216,218,220,255,299,303,311,337,340,347,354,363,364,365,366,370,372,386,395,401,402,419,441,450,451,452,453,454,455,458,469,476,478,481,495],"2pi":188,"2theta":167,"2x1x2":466,"2x2x1":466,"2x2x2":466,"2x4x10":466,"2x5":395,"300k":[233,299,496],"32k":10,"3419e":253,"3806504e":[6,91],"38e":10,"3n_k":232,"3nk":289,"3nkb":294,"3rd":[15,17,20,38,56,71,106,116,188,206,207,209,210,211,212,216,299,300,337,364,368,370,386,395,401,402,441,451,452,453,454,455,458,469,476,481,495],"3x3":[91,358],"4857990943e":395,"4_94":11,"4th":[6,38,56,81,104,105,118,164,174,188,194,311,337,356,369,371,372,377,393,396,403,419,426,430,441,451,452,453,455,458,469,476,481,484,499],"4x10":354,"4x2x10":466,"4x6x10":466,"50k":1,"53xx":18,"54xx":18,"55e":10,"5_1":377,"5_12":358,"5_6":358,"5kx":[200,226],"5nlog_2":12,"5th":[118,363,486],"6021765e":494,"6863e22":429,"6x6":6,"72360e":253,"7797e":253,"7842e":12,"8032044e":494,"8706e":440,"8706q":440,"8730m":440,"8730n":440,"8e12":208,"8x1":6,"8x2":[6,12],"948q":440,"9e18":[12,39],"9e9":429,"9jan09":[332,399],"9th":365,"__main__":467,"__pthread_key_cr":12,"_compute_group_group":144,"_compute_heat_flux":144,"_compute_t":8,"_j1m1m1":142,"_j2m2m2":142,"_serial":12,"abstract":17,"boolean":[3,337,339],"break":[],"byte":[3,12,208,486],"case":[1,2,3,6,8,9,11,12,13,15,16,17,18,39,40,41,45,46,59,61,63,71,73,104,105,110,116,118,119,145,146,147,148,149,151,154,155,156,157,158,160,161,162,166,168,170,171,172,174,190,191,192,193,194,200,201,205,206,207,209,210,211,212,213,214,216,218,220,224,226,228,231,234,235,237,238,239,240,242,253,255,256,257,258,259,260,261,262,263,274,275,276,278,280,281,286,288,289,290,291,298,299,301,303,305,306,308,311,314,317,318,319,321,322,326,328,329,331,332,334,335,336,337,339,354,355,356,358,360,362,363,364,365,367,369,370,372,382,385,387,389,393,395,398,399,401,402,403,415,416,417,419,422,424,426,430,433,436,438,442,449,452,453,455,462,464,467,469,471,472,476,477,479,481,483,485,486,487,488,490,494,495,496,498,499],"catch":[1,3,467],"char":[6,8,440],"class":[1,3,5,6,7,8,9,11,12,13,22,37,44,55,176,187,229,288,341,350,383,402,432,433,450,458,467,469],"default":[],"export":[193,384],"final":[3,5,6,7,8,11,12,17,41,59,87,143,194,205,206,207,209,210,211,212,214,218,220,231,254,255,260,289,293,299,300,303,323,325,326,333,339,363,365,371,372,377,393,396,403,415,419,426,430,431,451,452,453,455,458,464,477,483,490,495,497],"float":[3,6,8,12,40,42,71,115,191,194,206,212,236,288,300,316,395,437,439,467,469,479,486,495],"function":[],"import":[1,2,3,6,11,17,71,106,168,179,197,218,231,234,239,240,255,294,317,318,319,321,326,336,338,415,422,467,469,478,486,490],"int":[3,6,8,11,102,229,231,239,241,294,326,486],"long":[],"new":[],"null":[3,6,91,92,108,114,143,168,197,213,219,222,225,252,288,297,301,303,307,308,311,312,332,371,372,386,393,396,399,402,403,404,419,420,421,426,430,432,433,441,451,453,454,455,458,469,472,477,479,496],"public":[0,7,8,12,229,238,396,431,440],"return":[2,3,6,8,11,14,15,16,17,18,19,41,71,110,119,136,137,141,166,168,194,206,210,211,220,229,255,339,352,354,399,466,467,468,476,479,485,495],"short":[1,3,6,7,13,16,166,255,299,314,327,356,366,367,370,372,377,378,380,381,382,386,387,389,395,402,405,407,411,415,418,419,424,427,435,440,452,456,464,467,477,479,483,490],"static":[],"switch":[1,3,6,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,43,45,46,47,48,49,51,53,54,56,91,111,114,142,145,155,167,174,175,177,178,179,180,182,183,185,186,188,193,196,200,204,213,220,227,230,234,238,239,242,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,291,299,301,302,317,319,323,324,330,334,340,342,343,345,346,349,351,352,354,356,359,365,369,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,396,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,420,422,425,426,427,429,432,434,435,442,451,452,453,454,455,458,460,461,462,463,464,466,469,471,472,476,478,482,484,495,497,499],"throw":486,"true":[6,12,13,17,110,117,191,206,214,216,220,255,256,280,281,282,286,299,321,325,337,339,370,395,399,440,451,467,471,479,495],"try":[1,3,8,12,17,19,206,236,242,322,323,324,329,467,495],"var":[3,11,12,168,337,354,480,495],"void":[4,6,7,8,41,171,214,229,472],"while":[1,3,9,10,11,12,13,14,18,71,106,142,151,166,179,191,195,204,211,218,220,224,232,233,238,239,240,242,255,276,289,290,294,296,327,356,363,370,377,388,393,433,453,455,458,464,467,478,483,490],a10:339,a123:339,a12:434,a2m:[6,91],a_0:[242,326,377],a_0_real:242,a_1:326,a_2:326,a_3:326,a_4:326,a_c:385,a_cc:385,a_f:455,a_i:[],a_ij:377,a_j:[],a_pi:377,a_sigma:377,a_ss:385,aacut:281,aat:175,aatom1:117,aatom2:117,aatom3:117,ab_23_cd:339,abbrevi:12,abc:[3,12,339,467,495],abf:219,abf_integr:13,abi:195,abil:[3,9,218,255,286,299,395],abl:[3,8,11,12,39,86,191,195,217,226,230,322,329,370,467,495,498],ablat:326,about:[0,1,3,4,6,8,9,10,11,12,13,17,39,41,42,61,63,78,110,117,118,120,162,168,191,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,222,224,225,226,227,228,229,230,231,234,235,236,237,239,240,241,242,243,244,245,246,247,248,249,251,254,260,264,265,266,267,268,269,270,271,272,273,279,280,281,283,284,285,286,287,288,290,291,292,293,294,295,296,297,298,299,300,301,302,311,312,314,315,317,318,319,320,321,322,323,324,325,326,328,329,330,331,333,334,335,336,337,353,356,362,363,365,370,375,376,382,387,402,429,433,461,467,470,471,476,477,479,484,488,495,497,499],abov:[1,2,6,7,8,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,38,40,41,42,43,44,45,46,47,48,49,50,51,53,54,56,57,63,64,68,70,71,72,73,76,77,86,87,89,90,91,94,95,97,98,114,116,118,120,142,143,145,146,147,148,149,150,151,154,155,156,157,158,160,161,162,166,167,168,170,171,174,175,176,177,178,179,180,181,182,183,185,186,188,191,192,193,194,197,198,199,200,201,206,207,209,210,211,212,214,217,218,220,221,226,229,231,235,237,239,240,241,245,254,255,260,282,285,287,292,298,299,303,311,314,317,318,319,320,337,339,340,341,342,343,344,345,346,347,349,351,356,358,360,364,365,369,370,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,417,418,419,422,423,424,425,427,429,430,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,456,457,458,460,461,462,463,464,465,466,467,469,470,471,472,473,476,477,478,479,480,483,484,487,490,495,496,498,499],abscissa:452,absenc:201,absent:490,absolut:[3,194,204,219,220,224,303,316,355,356,363,399,407,470],absorb:326,absoult:356,ac3:167,academ:231,acc:321,acceler:[],accelri:[6,13],accept:[7,12,87,166,168,194,204,217,220,231,321,381,411,477,484],acceptor:401,access:[0,3,6,7,8,9,11,12,16,40,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,85,88,89,90,91,92,93,94,96,97,100,101,102,104,105,106,107,108,109,110,112,113,114,115,116,117,119,120,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,155,156,157,158,159,160,161,163,164,165,166,167,197,198,199,200,201,202,203,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,222,225,226,227,228,229,230,231,232,233,234,235,236,237,239,241,242,243,244,245,246,247,248,249,251,252,253,254,255,260,264,265,266,267,268,269,270,271,272,273,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,308,311,312,313,314,315,316,317,318,319,320,322,323,324,325,326,328,329,330,331,332,333,334,335,336,355,370,397,399,401,402,419,432,433,442,466,467,470,475,487,495],accidenti:349,accler:16,accommod:202,accomod:255,accompani:8,accomplish:[16,220,243,271],accord:[6,64,71,123,129,132,150,193,204,215,216,242,255,281,289,303,305,323,324,326,331,332,334,335,336,366,370,395,399,410,413,430,437,439,440,442,444,445,447,448,449,478,483,495],accordingli:[11,14,146,147,161,166,172,366,416,417,449],account:[3,6,9,87,120,150,166,167,176,187,207,209,225,236,237,239,255,261,262,263,274,275,276,278,280,284,290,299,300,302,311,312,313,314,317,318,319,322,326,329,345,364,387,399,407,411,416,417,419,422,440,466,483,496],accuml:[3,299,322,329],accumul:[1,6,8,15,71,144,197,207,208,239,299,303,328,353,370,475,494],accur:[1,3,6,15,17,38,41,56,151,214,253,294,299,302,314,322,329,335,337,356,377,395,398,399,424,434,450,452,453,455,483,488,495],accuraci:[1,3,6,12,41,190,191,194,214,233,255,291,302,327,337,355,356,362,395,424,432,433,452,459,478,483,488,490,495,498],accuractli:488,ach:355,achiev:[1,3,6,16,17,18,29,41,214,231,233,255,256,281,282,289,355,402,478],achiv:18,acid:9,ackland1:393,ackland2:393,ackland:[],acknowledg:[],acml:12,aco:495,acolor:[193,194],acoust:281,acquir:[3,6,58,61,62,171,172,216,218,220,255,428,474,490],across:[1,2,3,6,9,12,13,15,41,57,61,65,68,69,71,79,93,109,110,117,119,156,170,172,206,209,210,211,214,225,235,299,300,304,322,326,329,335,339,365,370,464,469,472,473,477,486,488],act:[3,6,110,153,224,234,237,238,239,240,242,245,254,299,308,321,323,324,326,335,336,337,363,379,390,398,399,401,434,449],acta:[120,167,371],actinid:[9,422],action:[2,6,11,12,71,232,237,324,490],activ:[5,8,11,12,13,14,55,59,87,166,219,232,236,239,245,254,279,299,306,325,353,415,450,463,492,495],actual:[1,3,6,8,12,56,62,124,151,191,194,198,199,213,215,216,224,239,240,276,280,286,294,303,314,316,317,318,319,321,327,336,337,355,366,398,400,405,410,416,417,449,466,467,478,479,487,495],adam:[355,356],adapt:[],add:[0,1,3,5,6,7,8,9,11,12,13,14,15,16,17,18,19,40,42,71,87,91,103,116,119,121,166,168,169,191,192,193,197,198,199,200,201,203,205,206,207,209,210,211,212,216,219,224,226,229,233,234,235,237,239,241,242,246,253,254,255,256,257,258,259,260,261,262,263,274,275,276,277,278,280,288,298,299,301,302,311,313,317,319,320,324,325,326,328,330,331,335,337,356,358,362,364,372,378,380,383,387,395,402,407,419,424,427,433,435,467,469,470,475,477,479,481,488,490],add_molecul:203,add_speci:203,add_to_nodeset:203,addforc:[],addit:[],addition:[6,8,16,141,314,336,398,434],addres:9,address:[7,8,11,193,238],addtorqu:[],adequ:[314,327,355,365,478],adher:29,adhikari:242,adiabat:[],adiam:[193,194],adjac:[39,166,168,365,424,452,453,483,484],adjiman:423,adjust:[2,3,6,16,17,41,59,120,146,147,148,151,152,155,156,161,162,167,172,191,193,206,214,218,220,236,239,243,247,251,252,255,256,260,276,280,283,285,286,289,290,291,292,297,299,306,314,318,322,327,329,330,331,333,334,336,355,356,363,365,370,372,392,416,417,440,455,479,496],adjust_dt:[],adjust_radiu:306,adjust_radius_factor:306,admiss:260,adof:[148,206],adopt:[298,490],adp:[],adri:[9,295,432,433],adust:162,advanc:[3,236,377,464,475],advantag:[1,6,8,11,14,18,39,40,41,214,370,394,478,483],advect:[3,6,314],advertis:8,advis:[365,431],afer:3,affect:[1,6,10,14,15,16,17,40,60,61,71,88,119,143,152,166,172,193,194,199,206,207,209,210,211,212,215,216,217,218,220,221,229,235,237,239,245,252,256,257,258,259,261,262,263,269,274,275,276,278,299,300,312,326,336,349,355,361,362,363,365,366,367,370,395,416,417,424,466,467,469,471,472,474,477,479],affin:[16,17,18,220,370,386],afil:233,aforement:18,afresh:[287,477,495],afshar:391,after:[2,3,5,6,8,9,11,12,15,21,22,33,39,40,41,44,50,57,58,59,61,63,71,146,147,148,149,150,151,152,155,156,157,158,160,161,168,169,171,172,175,176,181,190,191,192,193,194,195,197,198,199,203,204,206,207,214,215,216,217,218,220,224,231,242,243,244,245,246,251,252,253,255,261,262,263,269,274,275,276,278,281,285,289,297,299,302,310,315,317,318,319,321,322,323,324,325,329,331,333,337,340,341,347,354,360,361,363,364,366,368,369,370,371,372,377,384,386,393,394,395,396,402,403,404,415,416,417,419,420,421,422,426,430,432,433,440,441,451,453,454,455,458,464,466,468,469,470,471,472,474,475,477,479,481,483,486,487,490,494,495,496,497,498,499],afterrun:477,afterward:3,afterword:41,ag1:167,ag2:167,again:[6,11,12,16,17,62,142,148,154,162,191,194,220,235,285,340,354,365,416,417,464,466,467,469,471,476,483,485,495,497],against:[11,12,13,64,221,365,432,433],aggreg:[6,12,65,68,69,79,93,110,117,235,251,297,299,312,464,496],aggress:[235,483],agilio:[9,13],agre:[3,8,188,363,372,404,433],agreement:[5,7],ahd:401,ahead:333,aidan:[0,5,7,9,13,358],aij:13,aim:6,airebo:[],ajaramil:[7,9,13],aka:193,akohlmei:[7,9,13,195,236],aktulga:[7,9,292,433],al2o3:440,al2o3_001:[120,300],al3:167,ala:[242,440],alain:9,alat:[280,419],alb:[430,453,455],albeit:298,albert:9,alchem:[87,162],alcohol:329,alcu:[371,377],alcu_eam:430,alderton:390,alejandr:[255,256],alessandro:13,algebra:422,algorithm:[0,1,6,7,8,9,41,61,194,203,214,217,220,242,244,245,269,282,290,299,302,321,322,326,329,334,361,362,363,367,370,395,417,422,437,439,464,466,483],alia:[12,16],alias:[1,356],aliceblu:194,align:[6,12,29,41,71,170,188,210,214,237,358,469,472,490],alkali:395,all:[0,1,2,3,5,6,7,8,9,11,12,13,14,15,16,17,18,22,33,37,39,40,41,42,44,50,54,55,57,59,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,156,161,162,163,164,165,166,167,168,169,170,171,172,174,176,181,187,188,191,192,193,194,195,197,198,199,200,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,223,224,225,226,227,228,229,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,248,250,251,253,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,272,273,274,275,276,277,278,279,280,281,282,284,285,286,287,288,289,290,291,292,294,295,296,297,298,299,300,301,302,303,304,305,306,310,311,313,314,315,316,317,318,321,322,323,324,325,326,327,328,329,331,332,333,334,335,336,337,338,339,340,341,345,350,353,354,355,356,357,358,360,363,364,365,366,367,369,370,371,372,373,375,376,377,378,380,381,382,383,384,386,387,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,411,415,416,417,418,419,420,421,422,423,424,425,426,427,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,461,462,463,464,466,467,468,469,470,471,472,473,474,476,477,478,479,480,481,482,483,484,486,487,488,490,494,495,496,497,498,499],allen:[29,87,390,398],allentildeslei:87,allign:3,allindex:338,alloc:[3,5,6,8,9,11,12,60,229,328,364,366,370,428,433,469,477],allocat:3,alloi:[],allosw:71,allow:[1,2,3,6,8,9,11,12,13,14,15,16,17,18,22,37,39,40,41,55,57,58,59,61,62,63,77,92,108,110,144,146,147,148,161,166,167,168,170,176,187,188,191,193,194,195,197,198,200,202,203,204,206,207,208,209,210,211,212,214,216,217,218,219,220,221,225,226,229,231,232,233,234,236,239,242,245,246,250,252,255,256,280,284,286,287,288,289,293,299,300,302,303,305,306,310,314,321,322,323,324,326,327,328,329,330,331,337,339,341,350,355,356,358,363,364,365,366,369,370,373,377,378,379,380,381,382,387,393,395,399,400,401,402,407,411,416,417,422,424,430,433,434,437,439,440,449,459,461,464,467,469,471,472,473,474,475,476,479,481,482,483,486,487,495,496],almost:[2,3,12,60,237,289,326,356,367,370,449],alo:387,alon:[6,7,217,295,432,433,467],alond:13,along:[6,8,9,12,29,40,71,87,120,166,167,168,190,191,193,206,217,237,242,243,247,252,254,289,299,302,303,307,311,312,321,325,326,332,335,337,358,361,362,363,365,387,390,399,402,405,407,411,419,432,433,452,469,472,479,480,495],alonso:[420,421],alpha:[6,12,51,198,242,281,289,290,294,363,371,374,378,387,391,393,394,396,401,406,407,419,425,429,454,456,487,490],alpha_:[],alpha_c:415,alpha_i:441,alpha_ialpha_j:[],alpha_lj:415,alphabet:[2,3,22,37,44,55,63,176,187,197,341,350,364,384,450,469],alphanumer:[3,63,197,288,296,339,364,495],alreadi:[3,7,8,9,12,16,17,18,42,168,169,171,192,202,206,210,211,214,216,220,246,287,289,314,337,364,365,391,400,402,409,417,449,459,462,465,469,470,474,479,495],also:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,22,29,36,37,38,39,40,41,42,44,54,55,56,58,59,61,63,66,71,72,73,75,77,81,87,89,90,92,94,104,105,106,107,108,109,114,116,118,119,121,142,143,144,145,146,147,148,149,150,151,152,154,155,156,157,158,160,161,162,163,164,165,168,169,170,171,172,174,176,187,188,189,190,191,192,193,194,195,197,198,199,200,202,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,226,229,230,231,232,233,235,236,239,240,241,242,252,253,255,256,257,258,259,260,261,262,263,268,271,272,274,275,276,277,278,280,281,282,284,285,286,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,307,308,311,312,314,317,318,319,320,321,325,326,327,328,330,332,335,337,339,341,347,350,353,355,356,358,359,360,363,364,365,366,367,369,370,377,381,382,384,388,389,390,391,393,394,395,398,399,401,402,403,411,415,416,419,422,424,426,428,429,430,431,434,435,437,444,445,447,448,450,451,452,453,454,455,456,458,464,466,467,468,469,470,471,472,473,474,476,477,478,479,481,482,483,484,487,488,489,490,491,493,494,495,496,497,499],alter:[3,6,8,9,11,12,41,59,145,146,147,148,149,151,154,155,156,157,160,161,168,172,191,193,195,198,199,206,215,216,217,218,220,254,255,294,297,299,301,308,314,322,329,336,362,365,402,469,474,476,479,495,496,499],altern:[1,6,8,11,12,17,18,91,168,191,197,207,220,236,240,255,288,299,321,322,329,342,346,355,362,363,371,372,387,393,394,396,404,407,415,419,420,421,426,430,431,441,451,453,455,458,467,469,470,482,484,487],although:[29,42,188,245,255,286,290,299,321,354,476,490,499],aluminum:462,alwai:[0,6,11,12,17,18,54,57,63,71,166,194,206,207,208,210,211,212,216,219,231,233,237,291,294,299,314,331,335,336,340,355,356,361,363,364,366,367,370,380,383,393,410,422,432,433,440,442,452,453,455,462,464,469,470,472,474,481,483,486,490,495,496],amap:194,amatrix:233,amaz:11,amazingli:13,amber2lmp:[],amber:[],ambient:193,ambigu:[3,63,197,495],amd:[17,370,422],amend:11,amino:9,amit:9,among:[16,143,204,242],amorph:[168,454],amount:[1,3,6,12,59,88,117,166,170,190,193,204,208,218,219,231,235,239,255,280,286,299,306,314,319,322,327,329,337,355,370,391,428,469,472],amplitud:[220,252,307,332,349,472,495],amu:231,amzallag:440,analag:[6,495],analalog:6,analog:[6,108,142,170,188,399],analys:[7,474],analysi:[7,9,13,63,64,73,195,295,296,304,338,422,441,469,479],analyt:[1,3,9,13,120,162,167,302,355,377,403,404,409,422,430],analyz:[6,8,13,365,422],andersen:302,anderson:[284,391],andr:[7,9,13],andrew:13,andzelm:449,ang:280,angl:[],angle1:298,angle2:298,angle_coeff:[],angle_cosineshift:27,angle_cosineshiftexp:[26,177],angle_cutof:401,angle_cutoff:401,angle_hybrid:29,angle_info:433,angle_styl:[],angle_typ:40,angleangl:[3,340,347,469],angleangletors:[3,175,469],anglecoeff:3,angletors:[3,175,181,469],angletyp:216,angmom:[],angmomi:[115,191,316],angmomx:[115,191,316],angmomz:[115,191,316],angstrom:[6,10,59,71,120,157,167,168,190,191,193,194,202,210,211,220,221,231,236,237,252,292,297,331,333,334,336,356,358,361,367,371,372,382,393,415,419,426,431,432,433,455,462,472,478,494,496],angular:[3,6,29,40,61,63,66,82,83,84,85,107,115,142,146,147,160,161,168,191,197,239,245,251,252,257,258,259,261,262,263,265,266,267,270,272,273,274,275,278,297,299,302,307,316,371,377,386,399,416,417,419,422,430,450,453,454,469,479,495,496],angularm:266,anharmon:[27,53,177,294,483],ani:[1,3,6,7,8,9,10,11,12,13,14,15,16,17,22,29,38,39,40,41,42,44,55,56,58,59,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,171,172,174,176,188,190,191,192,193,194,197,200,201,202,204,206,207,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,226,228,231,234,235,237,239,242,245,251,252,255,260,280,282,284,285,286,288,290,291,292,294,296,297,299,301,302,303,307,308,311,313,314,315,316,325,326,331,332,333,334,335,336,337,338,339,341,354,355,356,358,360,361,363,364,365,367,368,369,370,372,377,381,382,386,387,390,391,393,394,396,398,402,403,404,411,422,424,430,432,433,434,441,449,450,451,452,453,454,455,456,457,458,463,464,466,467,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,487,488,490,491,493,494,495,496,497,498,499],anihil:415,anim:[2,4,7,11,13,193,365],anion:[396,440],aniso:[3,218,220,255,256,257,258,259,260,261,262,263,286,299],anisotrop:[239,398,434],ann:423,annot:[7,451,453,454,455,458,469],annual:[464,483],anoth:[1,3,4,6,7,8,11,12,17,29,40,63,71,72,87,118,121,192,193,197,198,204,206,209,210,211,212,217,220,221,232,235,239,240,245,255,256,260,285,288,299,300,317,318,319,326,336,339,361,363,365,366,369,387,391,395,396,398,401,402,406,407,415,432,434,442,449,453,454,455,463,464,467,470,476,478,490,495,499],ansi:[12,16],answer:[3,4,8,12,299,367,368],anthoni:324,antiquewhit:194,antisymmetr:[9,40,373],antisymmetri:395,antonelli:[323,324],antonio:429,anymor:324,anyon:7,anyparticl:86,anyth:[8,11,168,220,238,451,453,455,480],anywai:[171,370,490,497],anywher:[12,168,384,419,441,495],aoff:[364,469],aparam:[87,198,199],apart:[3,169,245,311,366,375,442,469,478],aperiod:281,api:[11,12,195,403,467],appar:3,appear:[2,3,6,11,12,13,39,40,41,72,77,87,92,108,110,117,118,142,151,168,169,171,191,193,194,206,210,211,214,218,221,224,231,236,285,296,297,325,337,339,340,355,363,364,365,385,393,419,424,440,452,458,465,466,467,469,470,471,474,476,490,495,499],append:[],appendix:[29,390,440],appl:[218,255,256,458],appli:[2,3,4,5,6,8,9,12,17,18,29,33,41,50,57,59,61,63,71,72,87,88,106,118,142,143,148,154,156,158,162,167,168,170,174,176,181,187,190,191,193,194,197,198,199,200,201,203,206,213,214,218,219,220,222,225,226,229,230,231,232,233,234,236,237,239,240,241,242,246,255,256,260,261,262,263,269,274,275,278,279,280,282,286,289,297,298,299,301,302,303,304,307,311,312,313,315,317,318,319,320,322,324,325,326,329,337,355,358,363,364,365,375,378,380,382,387,390,395,399,400,401,402,404,405,407,413,417,422,424,427,432,435,436,437,438,439,449,456,461,469,470,472,473,474,478,479,481,486,490,495,496,497,498],applic:[1,6,9,12,17,195,203,217,221,222,229,231,233,236,280,285,298,303,311,322,329,355,370,455,479,490],applyt:3,appopri:17,approach:[6,7,9,14,191,203,232,281,282,294,299,321,322,324,326,329,355,377,387,389,392,398,402,422,434,436,438,449,459],appropri:[1,2,3,6,8,11,12,13,15,17,33,38,42,50,56,61,73,88,91,118,119,146,147,148,176,181,187,188,190,191,194,206,207,210,211,212,217,218,220,229,230,233,242,250,252,253,255,257,258,259,260,261,262,263,274,275,276,278,282,285,286,289,294,299,314,317,318,319,322,329,331,332,334,335,336,347,356,365,372,377,381,385,386,387,394,399,402,404,411,415,422,431,432,433,451,452,453,454,455,458,459,469,470,471,473,474,482,483,486,495,496],approri:234,approxim:[6,9,120,124,167,231,233,242,282,300,302,321,355,361,362,363,379,389,395,398,416,417,422,424,431,434,440,461,483,490],april:11,aprpopri:464,apu:[416,417],aqua:[193,194],aquamarin:194,ar_therm:203,ar_ttm:203,ara:13,arbitrari:[6,40,58,118,191,193,195,219,220,234,255,282,290,451,467,480,495],arbitrarili:[11,59,118,142,190,218,255,387,495],arcco:3,arch:[1,12,14,15,17],architect:353,architectur:[16,370,422],archiv:[6,7,11,12,316,384,476],arcsin:3,area:[6,41,91,114,118,166,214,220,242,322,329,392,399,429,457,466,479],aren:[118,288,339],arflag:12,arg:[3,11,12,22,40,41,44,55,59,63,71,87,119,156,162,166,168,171,172,176,190,191,192,194,197,198,199,200,202,204,206,207,208,209,210,211,212,213,214,215,216,219,220,221,226,229,231,234,235,236,237,245,252,257,258,259,285,298,299,300,301,304,307,308,310,321,324,331,332,333,334,336,337,341,353,365,370,378,379,380,382,383,384,389,390,395,400,402,407,411,415,416,417,418,427,435,437,439,450,466,467,469,472,474,476,478,480,482,487,488,495,496,498,499],argon:231,argonn:12,argument:[2,3,6,8,11,12,17,20,21,22,23,24,25,26,27,28,29,30,31,32,35,38,40,41,42,43,44,45,46,47,48,49,51,53,54,56,59,63,73,87,91,108,111,114,118,142,143,145,150,155,156,157,162,166,168,169,170,172,174,175,176,177,178,179,180,182,183,185,186,188,191,194,197,198,199,200,202,205,206,207,208,209,210,211,212,213,214,218,219,220,227,229,230,231,233,234,238,239,245,252,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,284,285,287,291,296,299,300,301,302,314,317,319,326,328,330,332,334,337,339,340,341,342,343,345,346,347,349,351,353,354,356,357,358,360,365,369,370,371,372,374,375,376,377,378,379,380,381,382,383,384,385,386,387,389,390,391,393,394,396,397,398,399,400,401,402,403,404,405,407,408,409,410,411,412,413,414,415,416,418,419,420,421,424,425,426,427,429,430,432,433,434,435,440,441,442,450,451,452,453,454,455,456,458,460,461,462,463,464,465,466,467,468,469,470,472,474,477,478,479,480,484,486,487,495,496,498],aris:[12,461],arithmet:[3,6,104,355,382,385,410,424,456,457],arkansa:9,arl:9,armv8:17,arnold:355,around:[1,3,4,6,12,42,57,58,59,66,70,71,72,73,77,118,142,146,163,166,168,170,190,193,194,201,202,218,220,221,237,252,255,288,290,294,299,307,311,314,331,332,335,354,364,440,469,472,479,480,490,495],aroung:3,arrai:[],arrang:142,arrheniu:483,art:[9,464,483],artefact:233,articl:[6,440],articul:[7,284],artifact:[88,166,490],artifici:[253,289,444,445,447],arun:13,arxiv:[142,192,441],ascend:[41,194,236,245,299,474],asci:7,ascii:[13,300,325,365,393,396,419,469],ash:[416,417],asid:[8,168,419],asin:495,ask:[3,11],askari:429,askoos:13,asoci:193,aspect:[6,7,59,220,231,398,434,457,469,479,483],aspect_ratio:300,asper:4,aspher:[],asq:[416,417],assembl:4,assign:[1,2,3,6,7,11,12,14,15,17,18,33,39,40,41,50,57,59,61,63,66,71,72,75,90,94,105,107,112,115,116,120,142,143,148,163,165,167,168,171,181,190,191,192,193,194,195,197,198,199,202,206,209,214,216,217,218,221,223,231,236,239,240,241,242,252,255,257,258,259,260,261,262,263,272,274,275,276,277,278,282,285,286,288,290,296,299,300,317,318,319,320,337,347,356,358,360,364,365,369,370,377,393,396,398,401,402,433,434,462,466,467,469,470,471,472,473,478,479,484,487,495,496],assignemnt:[6,478],assing:288,assist:[7,253],associ:[3,5,6,8,9,12,22,37,39,40,44,55,59,66,74,75,81,87,89,90,94,100,102,104,105,107,132,163,176,187,191,193,194,198,199,200,204,218,220,226,229,231,232,238,242,252,255,284,294,298,299,300,312,314,338,339,341,350,358,363,365,369,370,384,387,391,392,393,395,401,402,404,407,411,436,438,449,450,452,467,470,477,489,490,492,495],associd:67,assum:[2,3,4,6,11,12,16,17,18,39,59,67,71,88,97,103,105,145,146,147,148,149,150,151,153,154,155,156,157,158,160,161,162,166,168,171,194,198,199,204,206,207,209,210,211,212,218,220,228,236,238,242,245,257,258,259,261,262,263,265,267,270,272,273,274,275,278,280,281,285,286,287,290,299,301,303,311,322,325,326,331,334,337,344,355,356,364,365,370,376,377,379,381,384,385,392,395,401,402,406,411,416,417,457,464,466,467,469,471,474,479,483,486,487,490,496],assumpt:[166,236,371,424],astar:419,astart:442,asterisk:[22,44,61,77,87,118,162,172,176,194,198,199,245,299,341,360,384,401,449,463,466,479,494],astop:[363,442],asu:393,asub:419,asubrama:13,asymmetr:[129,334,377,393],asynchron:[15,16],atan2:495,atan:495,atc:[],atc_fe_output:203,athomp:[0,7,9,13],atm2pa:6,atmospher:494,atol:12,atom1:[284,298,364,469],atom2:[284,298,364,469],atom3:[284,298,364,469],atom4:[298,364,469],atom:[],atom_element_map:203,atom_forc:433,atom_info:433,atom_modifi:[],atom_styl:[],atom_vec:8,atom_vec_atom:8,atom_vec_electron:8,atom_veloc:433,atom_weight:203,atomey:[6,7,11,13,191,193,194],atomfil:[3,71,288,337,369,479,495],atomic_charg:203,atomic_numb:430,atomid:469,atomist:[6,203,321,422],atomperbin:3,atomt:194,atomvec:8,attach:[6,211,282,303,311,469],attatch:324,attempt:[3,6,41,59,71,190,204,214,215,216,217,221,231,285,286,314,334,355,359,365,402,467,484,487,495],attend:203,attent:[15,18],attogram:494,attrac:419,attract:[],attribut:[3,6,7,8,11,39,40,42,58,63,71,87,115,116,117,119,146,162,191,193,194,197,198,199,205,206,209,210,211,217,218,255,257,258,259,260,261,262,263,265,266,274,275,276,278,286,299,300,316,317,318,319,358,364,377,395,402,469,470,471,479,487,495],atw:[416,417],atwat:454,atwt:419,atyp:[117,162,216,387,407,411,415],au1:167,au3:167,aug:[],augment:[12,115,218,288,419],augt1:419,auo:296,auoh:296,author:[3,8,9,13,192,393,394,490],auto:[6,8,11,12,91,164,197,207,208,303,328,355,364,370,466],autocorrel:[63,91,239],autom:[12,193],automag:7,automat:[3,6,12,14,15,16,17,18,19,36,130,188,202,208,231,233,242,299,303,327,355,370,386,393,402,419,422,436,437,438,439,462,469,482,490,495],auxiliari:[1,6,9,11,12,13,191,281,299,470,474,497],avail:[1,3,5,6,7,8,9,11,12,13,15,16,17,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,43,45,46,47,48,49,51,53,54,56,61,63,87,111,114,115,142,145,155,166,174,175,177,178,179,180,182,183,185,186,188,191,193,197,200,206,209,210,211,212,213,218,219,220,227,230,232,234,236,239,255,256,257,258,259,260,261,262,263,264,265,272,274,275,276,278,291,293,299,300,301,302,317,319,324,330,334,340,342,343,345,346,349,351,353,356,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,395,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,417,419,420,424,425,426,427,429,430,432,433,434,435,441,442,451,452,453,454,455,458,460,461,462,470,472,478,482,495],availab:[],ave_chunk:6,aveforc:[],avendano:423,averag:[3,6,7,12,15,41,63,64,71,87,91,92,104,106,118,120,144,148,156,164,167,191,194,197,199,203,205,206,207,208,209,210,211,212,213,214,218,231,233,235,239,245,255,256,260,281,286,289,295,296,299,300,303,340,372,395,419,456,470,474,487,490,495],averi:314,avesq:119,avg:12,avi:193,avoid:[1,3,6,12,36,39,59,168,169,188,193,202,207,209,212,224,231,233,240,280,282,290,294,299,300,328,335,368,377,395,415,419,433,452,471,477,478,490],awai:[3,6,61,118,191,193,206,217,221,234,237,254,280,303,311,325,331,366,387,407,411,474],awar:[370,394,466],awpmd:[],axel:[7,9,13,18],axi:[3,6,41,71,92,120,132,146,167,168,170,190,193,206,214,231,234,237,252,285,307,311,326,332,345,351,358,469,472,479],axial:260,azimuth:[193,234],azur:194,b_k:441,ba2:167,babadi:434,back:[1,6,7,11,12,13,14,15,17,149,150,151,155,156,157,158,160,168,172,191,194,195,198,199,219,224,229,236,237,239,240,255,261,262,263,274,275,276,278,297,299,317,318,319,323,324,333,334,336,354,355,356,365,399,467,469,470,471,472,473,476,482,483,495,496],backbon:[217,302,349],backcolor:[194,498],backend:17,background:[9,87,88,114,143,194,214,220,239,314,322,326,329,365,385,416,417,419],backtrack:[361,363],backward:[9,12,195,365,483,495],baczewski:232,bad:[3,12,59,61,237,365,469,474,486],badli:[3,218,255],bal:321,balanc:[],balasubramanian:277,ball:[142,416,417],ballenegg:355,bammann:203,band:[4,6,7,9,142,197,254,362,365,377,422,440],bandwidth:[1,10,18,40],bandwith:193,bar:[87,193,494],barashev:393,bare:[224,238,240],barost:[224,490],barostat:[],barostt:6,barr:386,barrat:294,barrett:67,barrier:[3,4,6,254,351,365,386,397,483],bartel:281,bartok2010:441,bartok2013:441,bartok:[9,142,431,441],bartok_2010:431,bartok_phd:431,bary:494,barycent:310,basal:[],base:[3,4,6,8,9,11,12,13,14,15,20,63,64,71,78,87,91,104,113,120,148,150,167,168,170,191,192,193,194,197,203,210,211,214,215,216,220,221,225,231,236,239,243,245,269,281,282,288,290,292,299,300,303,304,314,321,356,370,372,374,377,391,395,398,401,402,403,405,407,416,420,421,427,429,430,440,451,454,455,458,464,466,469,470,471,473,476,479,480,483,484,487,494,495,496,499],bash:384,bashford:[6,20,174,382,481],basi:[3,6,12,40,142,148,168,202,239,241,281,314,331,358,405,479,495],basic:[6,7,8,12,17,41,115,143,193,194,203,214,255,256,280,335,371,373,422,463,471,490],basin:[86,365,464,483],bask:[393,419,430],bath:[9,289,294],batom1:[69,117,119,191,194],batom2:[69,117,119,191,194],bayli:[6,174,481],bb13:175,bcc:[3,4,7,64,70,73,358,419,421],bcolor:[3,193,194],bdiam:[3,193,194],be2:167,bead:[5,7,10,13,40,45,46,160,201,217,282,449],beam:221,bear:[6,232],becau:13,becaus:[0,1,3,6,8,12,16,17,18,40,41,42,59,64,71,72,77,92,108,118,130,142,148,153,158,168,169,170,174,191,192,193,194,195,200,206,214,215,216,217,218,220,226,230,231,232,233,238,239,240,241,252,255,256,269,276,285,289,290,294,299,311,316,321,322,325,326,329,333,334,335,336,337,343,355,361,363,365,366,369,370,376,382,384,387,389,391,395,396,398,399,400,401,402,406,415,416,417,419,424,434,449,450,456,457,466,467,469,471,472,473,476,478,479,481,483,490,495,496,497,499],beck:[],becker:[371,393],beckman:236,becom:[1,2,3,6,7,8,18,39,41,54,57,59,71,170,191,193,194,214,215,216,217,220,231,233,242,254,255,296,297,317,318,331,332,334,335,336,355,356,361,365,372,385,387,393,395,398,407,424,430,434,451,458,461,469,470,472,479,495],been:[1,2,3,6,7,8,9,11,12,13,16,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,41,42,43,45,46,47,48,49,51,53,54,56,57,59,60,63,65,69,71,87,111,114,115,116,117,119,121,145,146,147,148,149,150,151,155,156,157,158,160,161,169,170,171,172,174,175,177,178,179,180,182,183,185,186,188,190,191,193,194,195,200,202,204,205,206,207,209,210,211,212,213,214,217,218,219,220,221,227,230,231,234,236,237,239,240,242,243,244,245,246,250,252,253,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,284,285,286,289,291,293,296,297,299,301,302,310,315,317,318,319,326,327,328,330,331,332,333,334,336,337,340,342,343,345,346,349,351,354,355,356,363,366,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,392,393,394,395,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,417,420,421,422,425,426,427,429,432,433,434,435,442,449,451,452,453,454,455,457,458,460,461,462,464,466,467,469,470,471,472,473,475,479,483,486,487,495,496,497,498],befor:[1,2,3,6,8,9,12,14,17,22,29,39,40,41,44,59,66,71,74,75,81,89,90,94,104,105,106,107,116,148,151,156,157,163,168,169,171,172,176,189,190,194,198,199,200,201,202,204,206,209,210,211,212,213,214,218,223,224,230,231,236,238,239,240,242,245,252,255,261,262,263,274,275,278,281,288,289,290,293,294,299,300,301,315,317,318,319,325,331,332,333,337,341,360,361,363,365,370,396,399,415,419,422,450,459,464,466,467,470,471,472,473,474,476,477,479,483,486,487,490,495,496,497,498,499],began:[5,12],begin:[3,8,12,38,39,56,71,119,121,169,188,190,191,194,198,199,203,205,206,207,209,210,211,212,214,220,269,284,297,300,314,316,319,328,333,336,337,352,354,355,356,357,359,362,364,365,366,369,370,393,422,424,430,437,439,440,442,449,452,462,464,469,476,483,485,487,494,495,497],behalf:3,behav:[3,27,177,362,363],behavior:[3,172,188,191,193,195,217,218,221,231,232,233,236,239,240,241,255,285,289,294,314,317,318,326,362,377,395,419,462,463,471,475,495,497],behaviour:[6,239],behind:[8,238,253,289,314,355],beig:194,belak:7,believ:11,bellott:[6,20,174,382,481],bellow:345,belong:[2,3,40,71,122,171,204,206,210,231,245,299,337,364,436,469],below:[1,2,3,5,6,8,9,11,12,15,16,17,22,38,39,41,42,44,54,56,59,60,63,65,68,69,71,77,79,91,93,114,115,118,119,120,142,143,148,154,156,162,166,167,168,171,172,174,176,187,188,190,191,193,194,197,198,200,201,203,206,207,208,209,210,211,213,214,216,217,218,220,221,226,229,231,234,235,237,239,240,245,252,253,255,260,261,262,263,274,275,278,280,285,288,289,290,297,298,299,301,302,308,311,314,315,316,317,318,319,322,323,324,326,329,331,332,337,339,341,353,355,358,360,361,363,364,365,367,370,371,372,373,377,378,379,382,383,384,385,387,390,393,395,396,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,417,418,419,423,424,429,432,433,434,435,441,442,449,450,452,457,458,460,461,462,463,464,467,469,470,471,472,474,476,477,479,481,482,483,485,486,487,489,490,495,496,499],bench:[1,6,11,12],benchmark:[1,7,10,11,12,13,14,15,16,17,18,41,214,355,482],beneath:221,benedict:422,benefici:[61,367],benefit:[1,232,478],bennet:87,beowulf:7,berardi:[398,434],beraun:326,berendsen:[],berensen:299,berkelei:166,berkowitz:355,berlin:[7,9,303],bern:[3,282,290,291,386,398,440,450,478],bernendsen:6,beryllium:395,besid:[8,301,472],best:[1,6,8,14,15,16,17,18,19,255,276,277,298,299,370,377,387,407,411,424,452,470,478,483],beta:[6,9,281,289,371,374,393,394,396,419,453,454,455,487,495],beta_:377,beta_k:441,beta_pi:377,beta_sigma:377,beta_t:454,better:[3,6,7,8,12,14,16,27,142,177,199,214,231,242,255,269,290,297,299,314,356,365,370,453],betwe:375,between:[],beutler:415,bewteen:[110,207,314,322,329,402,405,466],beyon:478,beyond:[3,5,6,12,17,61,71,87,166,191,194,209,210,231,255,355,367,397,413,424,483,487,495],bflag1:[42,193],bflag2:[42,193],bgq:[17,422],bi3:167,bi5:167,bia:[3,6,8,114,143,146,147,148,149,150,151,155,156,157,158,160,161,206,219,220,231,239,240,255,261,262,263,274,275,276,278,294,317,318,319,321,496],bias:[6,9,219,496],biaxial:146,biersack:[419,450,455,462],big:[3,4,12,191,289,294,314,366,385],bigbig:[3,12],bigint:[3,229],bilay:[4,10,311],bilayer1:311,bilayer2:311,bill:7,billion:[3,7,10,12,39,231,477],bin2d:71,bin3d:71,bin:[3,6,11,12,39,63,66,71,75,90,94,105,107,116,118,148,156,163,165,191,194,206,209,210,211,281,289,294,314,366,367,370,392,428,470,498],binari:[3,6,7,9,12,13,16,33,37,50,55,181,187,191,192,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,227,228,229,230,231,232,233,234,235,236,237,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336,347,350,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,425,427,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,460,461,462,470,471,476,497,499],binary2txt:[],binchunk:206,bind:[9,17,18,192,210,377,440],binsiz:[39,194,366,370],binstyl:156,bio:[40,366],biolog:[6,7],biologi:180,biomolecul:[284,299,355,356,382],biomolecular:478,biophys:236,biosym:13,bird:392,bisect:[41,214,457],bisector:[6,387,407,411],bispectrum:[63,142,441],bisqu:194,bit:[3,11,12,17,39,229,240,424,452,477,490],bitmap:[3,452,459],bitrat:[193,194],bitzek:362,bkgd_dyn:419,bla:12,black:194,blais:[9,13],blanchedalmond:194,blank:[2,3,12,38,56,109,188,193,284,299,364,365,377,394,419,426,441,451,452,453,454,455,458,466,467,469,495],blast:326,blend:419,block:[2,3,6,91,142,168,170,171,285,335,358,370,377,395,430,441,472,483,490],blocksiz:370,blow:[3,269,331,335,442],blown:3,blue:[2,193,194,217],bluegen:[191,355,422],blueviolet:194,bni:71,board:[356,390],bodi:[],body_nparticl:8,bodyflag:469,bodyforc:242,bodyforcei:242,bodyforcex:242,bodyforcez:242,bodystyl:[245,299],boff:[364,469],bogaert:321,bogu:[3,151,218],bogusz:88,bohr:[393,395,422,455,494],boltzmann:[6,7,9,87,91,114,145,148,149,150,151,154,155,156,157,158,160,206,217,239,242,243,244,245,246,260,330,391,484,494],bond:[],bond_coeff:[],bond_graph_cutoff:433,bond_harmon:[8,48,49],bond_harmonicshift:49,bond_info:433,bond_interact:203,bond_styl:[],bond_typ:172,bondangl:[3,21,33,469],bondbond13:[3,175,469],bondbond:[3,21,33,469],bondchk:433,bondcoeff:3,bondtyp:[215,216,364],bonu:[3,497],book:461,bookkeep:424,bookmark:0,boost:[1,3,12,64,366],bop:[],border:[3,7,16,61,326,496],boresch:87,boreschkarplu:87,born:[],boron:395,borrow:303,bose:294,botero:[7,9,13,395],both:[1,3,6,7,8,9,11,12,14,15,16,17,27,37,39,40,54,55,57,59,61,62,63,68,69,71,83,87,88,110,115,117,118,130,144,146,147,148,153,156,158,161,166,168,170,171,172,177,187,188,191,193,196,197,198,199,204,206,207,210,211,212,215,216,217,218,219,220,225,231,233,235,237,239,240,242,243,251,252,255,256,261,262,263,269,274,275,278,284,288,289,296,299,302,303,311,314,318,322,323,324,326,329,331,332,334,335,336,339,340,350,356,360,363,364,365,366,368,370,372,377,378,379,380,381,382,383,385,390,391,393,394,395,398,399,401,402,403,407,409,411,412,413,415,416,417,422,423,424,427,434,435,451,453,454,455,458,464,466,467,469,470,471,472,476,481,486,487,490,495,497,498,499],bottleneck:[1,3,467,488],bottom:[8,9,151,166,194,220,230,242,276,322,329,358,481],bottomwal:213,bounc:[3,314],bound:[3,6,17,26,27,41,42,57,59,71,157,170,177,190,191,194,209,210,214,220,221,225,231,240,255,285,314,331,332,333,334,335,336,355,363,395,469,472,483,490,495,496],boundar:3,boundari:[],boundary_dynam:203,boundary_faceset:203,boundary_integr:203,bount:11,bourgogn:9,box:[],boxcolor:[193,194],boxxlo:11,bpa:370,bpclermont:[9,13],bptype:449,br1:167,bracket:[2,3,6,41,63,71,119,121,197,205,206,207,209,210,211,212,214,328,487,495],bragg:[120,167],branc:11,branch:11,branicio2009:458,branicio:[73,458],breakabl:[7,44,55],breakag:[78,215],breakdown:[1,12,15,88,109,432,433,464,483],brennan:449,brenner:[372,450],brick:[3,41,61,62,156,170,214,469,471,473,495],brief:[1,5,6,7,8,12,238,255,372,377,433,483],briefli:[6,10,282,386,440],brilliantov:399,bristol:[5,7],brittl:429,broader:467,broadli:8,broken:[2,54,65,69,70,78,104,109,117,172,215,255,377,471,481,488,497],brook:6,brought:190,brown:[7,9,13,15,16,120,143,194],brownain:379,brownian:[],brownw:7,brows:0,browser:[4,193],bryantsev:401,bsd:12,bstyle:[40,42],btype:[69,117,169,191,387,407,411,415,449],buc:380,buck:[],buckingham:[7,198,199,290,356,378,380,381,389,418,450],buckplusattr:440,buffer:[3,8,193,194,486],bufi:193,bug:[],bui:193,build:[],builder:[7,13],built:[1,2,3,4,6,8,9,11,12,13,14,15,16,17,20,21,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,40,43,45,46,47,48,49,50,51,53,54,55,56,64,67,78,80,83,86,87,97,98,99,100,101,102,106,111,113,114,120,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,144,145,146,147,152,154,155,159,160,162,166,167,174,175,177,178,179,180,181,182,183,185,186,187,188,191,192,195,197,200,201,202,204,208,213,215,216,217,219,220,221,226,227,228,230,231,232,233,234,236,238,239,241,242,243,244,245,246,248,249,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,270,272,273,274,275,276,277,278,280,281,282,284,285,288,289,290,291,292,293,294,295,296,299,301,302,303,304,305,306,307,308,310,314,317,319,320,321,322,323,324,326,327,329,330,332,333,334,338,339,340,342,343,344,345,346,347,349,350,351,356,365,366,367,370,371,372,374,375,376,377,378,379,380,381,382,383,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,425,426,427,428,429,430,431,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462,464,467,470,472,478,482,483,484],bulatov:[420,421],bulk:[4,6,10,70,242,280,286,388,419,422,424,429,436,438,440,473],bullet:7,bump:239,bunch:8,bundl:[9,193,195],burlywood:194,bussi1:318,bussi2:318,bussi:[233,318],buyl:[9,192],bybe:9,bypass:6,c1060:14,c11:[207,419],c12:207,c13:207,c1n:207,c2050:14,c21:207,c22:207,c23:207,c2n:207,c31:207,c32:207,c33:207,c34:207,c3n:207,c41:207,c42:207,c43:207,c44:207,c_0:[326,447,448],c_1:[68,69,119,120,167,191,194,232,288,300,337],c_2:[69,119,120,164,166,167,191,300,328,337],c_3:[119,300],c_6:166,c_cluster:6,c_cstherm:6,c_dist:119,c_doubl:11,c_e:326,c_flux:91,c_forc:119,c_gauss:397,c_hb:401,c_id:[6,63,71,87,119,121,191,205,206,207,208,209,210,211,212,300,316,328,487,495],c_ij:6,c_ijkl:6,c_index:119,c_k:232,c_ke:322,c_msdmol:121,c_my_stress:205,c_mycentro:[206,210],c_mychunk1:116,c_mychunk2:116,c_mychunk:[6,66,75,90,94,105,107,148,163,165],c_mycom:209,c_mycomput:206,c_myf:[191,498],c_myrdf:[118,212],c_mytemp:[8,207,208,209,212,328,487,495],c_n:376,c_n_k:232,c_p:143,c_pe:112,c_peratom:[112,143],c_pi:377,c_press:119,c_prop:6,c_radiu:166,c_reax:[432,433],c_sa:300,c_sigma:377,c_size:6,c_stress:191,c_tatom:[],c_tdrude:[224,240,490],c_thermo_press:[8,207,208,209,212],c_thermo_temp:212,c_xrd:209,ca2:167,cach:[17,39,424,482],cacul:302,cadetblu:194,cai:490,calcforc:242,calclat:91,calcluat:[106,112,114,143,387],calcualt:[91,206],calcul:[],caldwel:[6,174,481],calhoun:282,call:[],callabl:[3,11],callback:[3,8,11,144,197,229,467],caller:3,calori:494,caltech:[6,7,9,13,395],calucl:6,calul:[11,12,148,356],cambridg:[9,431],campa:281,can:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,185,186,187,188,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,349,350,351,352,353,354,355,356,358,359,360,361,363,364,365,366,367,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,476,477,478,479,480,481,482,483,484,485,486,487,488,490,494,495,496,497,498,499],cancel:[197,299,496],candid:[172,204,231],cannot:[1,2,3,6,11,12,13,15,16,17,39,40,41,54,57,58,59,68,71,82,84,88,119,121,144,146,148,169,171,172,190,191,192,193,194,205,206,207,209,210,211,212,214,217,218,220,221,231,232,233,239,240,241,245,252,255,257,259,261,263,265,266,267,272,274,278,285,286,289,294,296,299,300,301,304,314,322,326,328,329,331,332,335,336,337,339,355,358,363,365,368,369,370,380,381,383,393,398,400,407,411,413,415,424,427,432,434,435,436,438,449,450,452,464,466,467,469,470,472,473,475,478,479,481,483,486,494,495],canon:[197,204,231,233,255,256,274,275,276,277,278,282,318,321,324,422,429],cao1:282,cao2:282,cao:282,capabl:[5,7,9,11,14,17,18,333,339,356,370,372,383],capac:[9,40,102,154,294,326,444,469,479],capit:[223,469],capolungo:[120,167,300],captur:[6,327,372,381,395,399,411,419,490],carbid:387,carbon:[7,193,349,372,386,404,419],card:[12,14,16,22,44,77,87,118,176,198,199,299,341,360,384,401,463,471,476,497,499],care:[3,6,59,71,168,171,190,206,210,211,215,216,221,233,238,242,255,285,299,321,375,467,469,472,473,478,479],carefulli:[11,12,54,296,337,402,404,474],carlo:[6,7,9,197,204,217,231,299,321,392,450],caro:[204,393],carpent:[7,13],carri:[16,248,288,326,399,433],cart:[3,466],carter:[9,17],cartesian:[3,62,371,466],carv:171,cascad:[225,326],cash:7,cast:[233,495],cat:[15,193],catastroph:290,cate:242,categori:[],cation:[396,440],cauchi:[135,140],caus:[1,2,3,6,8,12,16,17,168,170,171,172,191,194,202,218,225,231,255,269,280,297,299,302,331,333,334,335,336,339,354,356,363,365,369,401,407,413,416,417,424,463,467,468,469,470,473,474,476,477,495,499],caution:[1,356],cautiou:[215,216],cautious:372,caveat:[372,478],cbecker:[371,393],cc1:[6,14,66,75,90,94,105,107,116,148,163,165,206,210],cc2:14,ccc:[394,451,453,455,458],ccflag:[12,16,17,18,19,191],ccm6:393,ccsi:[394,451,453,455,458],ccu:377,cd2:167,cdeam:393,cdennist:9,cdll:11,cdof:[6,148,206],cdte:377,cdte_bop:377,cdtese:377,cdzn:377,cdznte:377,ce3:167,ce4:167,ceas:362,ceil:495,cell:[3,6,59,88,118,120,166,167,168,191,202,218,219,231,236,253,255,256,260,281,289,292,326,355,356,358,392,395,422,487],cella:[6,487],cellalpha:[6,487],cellb:[6,487],cellbeta:[6,487],cellc:[6,487],cellgamma:[6,487],center:[3,6,25,42,63,66,71,74,75,86,89,90,99,104,105,106,116,118,120,148,149,150,153,156,160,163,165,168,193,194,197,198,199,201,206,209,210,211,218,220,221,222,224,231,232,237,239,240,245,251,255,261,262,263,274,275,276,278,281,285,290,296,297,299,300,303,311,312,314,316,317,318,319,321,322,324,331,335,340,358,364,375,376,394,395,398,399,405,416,417,419,420,421,451,453,454,455,457,458,472,479,490,495],centimet:494,central:[3,61,70,76,77,92,108,118,124,142,166,245,280,302,312,344,364,422,426,432,433,458,469],centro:[],centroid:[3,282,457,479],cerda:355,ceriotti2:233,ceriotti:[13,233,238],certain:[1,2,3,6,8,12,17,39,71,115,119,121,172,191,193,205,206,207,209,210,211,212,217,229,230,299,301,315,328,339,347,354,366,402,424,433,456,471,475,490,495],certainli:237,cerutti:356,cfg:[3,6,7,13,191,192,193,194,195],cfile:433,cfl:[130,304],cfor:303,cg_type:435,cgiko:2,cgikot:2,cgkio:2,cgko:2,cgkot:2,cgo:2,cgot:2,ch2:302,ch2lmp:[],ch3:302,ch5md:192,chain3:366,chain:[],challeng:[6,303],chalopin:294,champaign:[236,355,356,416],chan:422,chandler:[371,393],chandrasekhar:[6,407],chang:[1,2,3,6,8,9,11,12,14,15,16,17,39,40,41,46,55,57,59,62,71,80,87,104,118,128,130,150,151,152,168,169,170,172,188,190,191,192,193,194,195,197,198,199,200,201,203,204,210,211,213,214,215,216,217,218,219,220,221,225,226,228,230,231,233,235,236,237,239,241,242,243,245,251,252,253,255,256,257,258,259,260,261,262,263,269,274,275,276,277,278,280,281,285,286,288,289,290,293,296,297,298,299,301,302,303,314,317,318,319,320,322,323,324,325,326,327,329,332,335,337,356,361,363,365,368,370,391,395,399,402,416,417,419,422,424,432,433,440,449,450,464,465,466,467,469,470,471,472,473,474,475,477,478,479,480,481,484,487,491,493,494,495,496,497],change_box:[],changeabl:191,channel:[4,200],chapter:[282,356],charact:[2,3,6,12,38,41,56,63,188,191,193,194,195,197,214,288,296,339,364,369,395,406,430,432,433,440,452,466,467,471,476,477,495,497,498,499],character:[6,67,70,108,118,142,441,464,483],characterist:[240,314,323,376],charg:[1,3,4,5,6,7,9,11,15,40,87,88,115,120,167,168,191,195,197,198,199,204,221,226,231,288,290,291,292,296,316,329,355,356,364,378,380,386,387,389,390,393,395,396,402,407,411,415,427,432,433,440,450,455,456,458,459,461,462,469,470,474,479,481,490,494,495],charmm2lammp:13,charmm:[],chartreus:194,cheap:314,cheaper:[225,398,434],check:[3,6,8,11,12,15,17,39,41,71,91,188,204,210,214,215,216,221,228,231,237,238,298,302,314,322,324,329,337,339,354,363,364,365,366,367,370,392,403,406,424,433,464,466,467,469,477,483,486,487,495],checkf:188,checkqeq:433,checku:188,chem:[6,13,20,21,25,39,40,43,45,46,87,88,108,114,143,174,175,185,208,219,224,232,233,240,242,254,255,256,276,277,282,286,289,291,299,303,314,317,318,321,322,323,324,331,340,349,351,355,356,362,365,372,378,382,383,386,387,388,390,391,395,397,398,400,401,407,411,412,415,419,423,424,427,440,449,456,478,481,483,490],chemic:[9,120,162,167,191,203,204,231,290,295,296,321,356,432,433,445],chemistri:[9,289,290,292,377,395,432,433],chen:326,cheng:386,chenoweth:[432,433],chenoweth_2008:[432,433],chi:[93,157,190,280,290,292,396,398,496],chiefli:431,child:8,chip:[7,12,17,18,370,482],chipot:219,chiral:349,chmod:[11,12],cho:419,chocol:[7,194],choic:[3,6,12,15,16,18,40,41,54,87,143,146,147,161,172,188,206,210,211,214,217,220,221,233,239,242,253,255,282,290,299,321,350,356,361,362,365,367,370,402,415,424,428,469,478,479,482,483,489,490,494],choos:[1,3,6,7,8,12,16,17,18,29,39,54,87,119,158,159,193,215,216,217,218,221,228,239,242,253,255,257,258,259,260,261,262,263,286,314,318,332,355,356,362,459,464,466,478,484],chose:[453,455],chosen:[2,3,6,12,17,142,168,171,180,188,193,199,204,218,221,228,231,232,240,242,253,255,260,282,285,296,314,318,321,322,327,329,330,336,356,357,362,370,395,399,406,409,435,453,464,478,483,490],chri:166,christian:[7,9,14,17],christoph:7,chunk:[],chunkid:[66,75,90,94,105,107,116,148,163,165,206],chute:[4,10,234],ciccotti:302,cieplak:[6,174,481],cii:207,cij:207,circl:[42,71,310],circular:[3,6,146,189],circumst:18,circumv:[92,108,294],citat:[],cite:[3,7,8,12,239,440],ckio:2,cko:2,cl1:167,clarendon:[29,390],clarifi:[7,453,455],clariti:339,clark:427,class2:[],classic:[0,3,5,6,7,8,9,229,282,289,294,326,351,395],classifi:[9,450,458],claus:467,clean:[6,12,14,15,17,477],cleanli:[468,498],clear:[],clearli:7,clebsch:142,clermont:[9,13],clever:473,click:[2,11,22,37,44,55,168,176,187,193,236,341,350,365,384,450],client:[236,238],climb:[254,365,483],clinic:[7,13],clo:[157,190,496],clock:[12,464,483],clockwis:332,close:[3,6,11,12,13,39,41,67,71,143,171,191,216,217,218,233,240,242,255,276,299,302,332,335,354,356,359,361,362,365,370,372,377,387,388,405,419,424,436,438,455,473,479,490,492],closer:[3,41,118,166,190,191,214,218,222,323,365],closest:[216,280,299,329,398,434,449,459],cloud:[440,490],clovertown:18,clsuter:72,clump1:[284,299],clump2:[284,299],clump3:[284,299],clump:299,cluster:[],clutter:[3,9],cmap:469,cmatrix:233,cmax:419,cmd:[11,12,282,480],cmdarg:11,cmin:419,cmm:[],cn1:207,cn2:207,cna:[],cnn:207,cnr:[9,13],cnt:[402,473],co2:[40,167,302,364],coars:[7,9,29,36,40,54,180,284,299,314,400,435,481],coarser:[356,495],coarsest:142,code:[],coeff:[3,7,8,12,21,22,33,44,50,174,175,176,181,340,341,347,384,402,406,424,437,439,442,469],coeffcient:469,coeffici:[],coefficienct:391,coefficient0:393,coefficient1:393,coeffieci:[6,374,405],coeffincientn:393,coexist:[9,231,395],cohes:[6,396,419],coincid:[124,335,382,416,417,464],colberg:192,cold:[6,153,231,235,366,490],coldest:322,coleman8:9,coleman:[9,120,167,300],colin:9,collabor:[7,8,9,15],collect:[3,6,7,8,9,13,40,42,66,75,83,90,94,99,105,107,116,148,156,163,165,168,191,194,206,219,245,251,284,294,297,299,337,355,364,366,385,469,476,482,488,499],collid:[225,314,336],colliex:167,collinear:[3,284],collis:[3,242,314,332,336,392,399,462],colllis:314,colloid:[],colombo:39,colon:[195,337,470],color1:194,color2:194,color:[3,9,41,191,193,194,214,232,289,294],column:[3,6,9,12,13,42,63,65,66,67,68,69,71,75,77,79,81,90,92,93,94,105,107,108,110,112,115,116,117,118,119,121,142,143,148,156,163,165,166,167,188,191,194,197,205,206,207,209,210,211,212,245,252,253,289,299,315,316,326,336,397,401,432,433,470,484,486,495],columnar:166,colvar:[],colvarmodul:12,com:[],comamnd:220,comand:217,comannd:370,comb3:[],comb:[],comb_1:291,comb_2:291,combiant:388,combin:[3,6,7,9,11,13,36,40,63,65,69,79,87,93,104,110,117,146,147,161,191,193,203,209,236,245,255,282,288,318,327,335,338,340,355,356,358,362,370,385,387,388,395,396,402,414,415,441,451,453,455,458,461,472,477,482,490,495],come:[],comfort:[12,13],comm:[0,3,11,12,61,73,192,236,238,239,356,365,370,391,424,429,452,471],comm_modifi:[],comm_modift:61,comm_styl:[],comm_world:11,command:[],comment:[2,7,11,12,38,56,174,188,191,240,299,326,364,365,371,393,394,396,406,419,426,433,440,441,451,452,453,454,455,458,466,467,469,490,495],commerci:7,commmand:[3,6,12,59,109,277,405,463,464,466,483,498],common:[],commonli:[3,6,12,17,25,57,59,106,108,170,191,193,195,351,400,409,441,453,455,469,472,481],commun:[1,3,6,7,8,10,11,12,14,15,16,18,40,41,58,61,62,71,166,171,172,193,194,214,215,216,218,219,220,236,238,242,244,245,246,255,281,288,290,291,292,299,314,326,337,353,355,366,367,368,370,392,428,466,467,478,479,495,497,499],communc:355,comp:[7,192,238,239,302,356,365,395,424,429,434,448,452,454],compact:[63,197,384,450],compani:[5,7],compar:[1,3,4,6,8,12,17,39,86,112,120,151,167,176,187,194,224,290,337,339,355,356,363,365,419,440,464,483,484,490,494],comparison:[],comparison_of_nvidia_graphics_processing_unit:14,compass:[7,21,22,37,43,44,55,175,176,187,340,341,350,383,450],compat:[3,5,7,8,9,11,12,13,17,18,41,71,119,121,179,191,195,199,205,206,207,209,210,211,212,214,281,293,318,321,328,331,334,355,370,403,422,424,452,466,467,495],compens:[6,215,216,297,366,395],compet:325,competit:356,compil:[3,7,8,9,10,12,13,14,15,16,17,18,19,166,191,192,193,195,236,325,356,370,422,469,470,474,495],compl:17,complain:[12,17],complement:419,complementari:[7,387,407],complet:[3,6,9,11,12,15,41,59,71,194,210,214,219,245,282,285,288,314,325,327,339,354,365,370,396,437,439,457,464,469,474,477,481,483,486,490,495],complex:[6,8,11,12,13,25,40,42,62,92,108,142,144,156,168,169,242,310,335,353,365,395,422,452,467,469,472,495],compli:[321,325],complic:[6,7,9,12,13,204,231,467],complier:12,compon:[3,6,8,12,61,63,66,67,73,81,88,89,90,91,92,94,95,98,105,106,107,108,109,110,111,112,114,115,119,129,132,133,134,135,138,139,140,142,143,145,146,147,148,149,150,151,152,153,154,155,156,157,158,160,161,163,164,165,190,191,193,194,200,201,205,206,207,208,209,210,211,212,213,217,218,220,221,226,229,234,238,239,242,245,247,251,252,254,255,256,260,261,262,263,274,275,276,278,279,281,282,283,286,297,299,301,302,303,307,308,311,314,317,318,319,321,328,329,334,335,336,355,358,362,363,364,365,370,376,391,395,399,416,417,437,439,440,441,469,470,479,487,495,496],componenet:6,composit:[6,204,242,393],compound:[386,395,396,458],compres:[71,116,206],compress:[],compris:[40,335,434,457],compton:[120,167],comptu:3,compuat:356,comput:[],computation:[3,6,215,216,326,377],computational:490,compute_arrai:8,compute_fep:[199,415],compute_group_group:231,compute_inn:8,compute_ke_atom:8,compute_loc:8,compute_modifi:[],compute_peratom:8,compute_sa:[120,300],compute_scalar:8,compute_temp:8,compute_ti:199,compute_vector:8,compute_xrd:167,concaten:[2,3,498],concav:335,concentr:[71,393],concept:[6,148,158,206,478],conceptu:[3,6,71,156,218,220,365,387,402,419,474],concern:[6,73,87,192,232],concetr:71,concis:[11,325],conclud:12,concret:8,concurr:[9,16,356,495],conden:[326,453,455],condens:[6,150,326,372,389,393,407,458],condit:[],conducit:6,conduct:[],cone:472,confer:422,confid:[3,483],config:[12,191,466],configfil:219,configur:[1,2,6,12,15,17,38,59,124,170,188,190,191,193,197,218,219,220,221,225,231,238,239,269,282,290,325,353,363,365,372,377,394,419,422,451,453,455,458,464,469,471,472,483],confin:[469,483],conflict:[3,12,40,424,467],conform:[3,6,13,59,217,218,254,298,303,325,349,365,395,481],confus:[3,458],conjuct:391,conjug:[7,8,239,362,395,432,433],conjunct:[6,7,71,86,87,116,151,156,162,168,172,194,198,199,239,242,246,269,285,286,290,291,292,294,299,314,322,329,334,355,356,365,378,380,384,387,391,395,401,407,424,427,435,456,469,472,476,490,499],connect:[3,6,87,153,171,217,236,284,299,302,311,365,388,399,449,455,466,467,473,490],conput:3,consecut:[3,11,12,39,71,168,194,198,199,221,236,237,387,407,411,464,470,472],consequ:[1,6,204,326,406,483],conserv:[3,29,197,204,217,224,225,232,235,239,241,242,246,251,253,255,269,299,302,317,318,322,329,330,334,365,390,391,399,413,440,478,483],consid:[6,9,70,71,78,87,117,150,153,154,171,191,194,198,199,205,207,210,214,216,217,221,243,256,281,299,321,322,325,326,329,356,384,395,402,433,434,440,449,464,465,467,470,471,472,474,477,479,487,490,495],consider:[6,8,239,240,317,318,319,370,478],consist:[3,6,8,9,11,12,40,42,65,69,79,93,105,110,113,114,117,148,151,153,168,180,190,195,200,201,206,220,221,224,226,229,232,239,240,241,252,255,257,258,259,260,261,262,263,264,265,267,268,269,270,272,273,274,275,276,277,278,286,289,294,296,298,299,317,318,319,320,330,355,356,358,364,365,370,372,377,379,385,387,395,398,402,405,416,417,419,422,424,434,437,439,440,452,459,467,469,470,471,472,473,474,481,490,495],consistent_fe_initi:203,consit:299,constant:[],constitu:[3,6,245,299,331,335,385,434],constitut:[437,439],constrain:[3,6,8,145,146,147,148,149,151,154,155,156,157,158,160,161,197,206,221,231,232,237,245,249,284,285,297,299,302,312,322,329,363,364,395,474,481,490],constraint:[],construct:[6,8,12,14,38,54,56,61,64,67,70,72,73,77,92,108,120,142,167,218,255,281,298,335,366,370,390,422,424,449,451,452,472,473,488,495],constructor:[8,11],consult:433,consum:[1,294,428,495],consumpt:353,contact:[],contact_stiff:[436,438],contain:[0,1,2,3,4,6,8,9,11,12,13,17,18,19,38,40,41,56,63,87,91,118,120,142,148,156,166,167,168,170,174,176,187,188,191,193,194,195,197,198,199,203,205,206,207,209,210,211,212,214,219,221,226,233,237,238,239,242,253,269,280,281,284,285,287,289,292,296,299,300,304,314,321,325,326,335,336,339,354,356,364,365,368,369,371,372,373,377,386,387,390,393,394,395,402,403,419,422,426,430,431,432,433,441,451,452,453,454,455,456,458,464,465,466,467,469,470,471,472,474,476,478,481,483,486,487,490,495,497,499],content:[12,18,433,485,487],context:[3,6,8,12,17,118,119,194,215,216,221,284,296,330,362,461,469,476,485,494,495,496],contibut:70,contigu:466,contin:16,continu:[0,2,3,5,6,9,12,13,14,41,71,81,104,105,164,194,197,198,199,204,206,207,208,209,210,211,212,214,217,218,219,220,221,231,232,233,235,236,237,239,240,241,247,252,253,255,257,258,259,260,261,262,263,274,275,276,277,278,283,285,288,289,299,300,303,313,314,316,323,324,326,332,335,339,354,369,370,377,391,392,409,412,432,433,434,437,439,454,464,467,469,471,472,477,483,486,487,495,497],continuum:[6,7,9,203,326,437,439],contour_integr:203,contract:[59,218,220,255,286,299],contradictori:3,contrain:302,contraint:269,contrari:[233,240],contrast:[1,6,42,55,64,150,153,220,337,437,439,461,498],contrib:326,contribut:[3,5,6,7,8,9,12,13,17,63,66,68,70,71,74,75,77,80,84,87,88,89,90,91,94,103,105,107,109,110,111,112,114,116,119,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,199,204,205,206,207,209,210,211,212,218,231,239,242,245,246,250,256,276,277,284,285,293,296,299,300,302,328,355,363,365,373,391,392,393,395,402,416,417,422,424,432,433,440,481,487,490],contributor:12,control:[3,5,6,7,8,9,11,13,16,27,29,41,87,91,124,142,177,191,193,197,203,204,214,218,219,220,235,236,239,240,255,257,258,259,260,261,262,263,286,291,299,305,306,317,318,319,326,330,353,355,367,395,398,422,432,433,436,438,451,455,464,466,478,484,485],control_typ:203,controlfil:433,convect:91,conveni:[6,12,29,191,195,212,300,358,441,495],convent:[3,8,9,29,179,186,187,194,298,311,338,393,395,495],converg:[3,6,41,88,191,193,195,200,214,217,218,226,229,260,289,291,294,298,302,361,362,363,365,386,387,407,440,464,476,483],convers:[3,8,142,193,194,204,207,286,355,387,388,389,395,407,411,415,427,467,483,494],convert:[2,3,4,5,6,7,8,12,13,20,21,24,28,32,35,36,59,63,71,91,168,175,191,193,194,212,253,337,340,342,346,349,358,365,371,393,422,453,455,462,467,469,470,471,476,486,490,494,495,497,499],convex:[42,335,376],convinc:[7,12],cook:9,cooki:7,cool:[7,158,235,297],cooordin:191,cooper:[5,7],coord123:116,coord1:[3,116,206,210,211],coord2:[3,116,206,210,211],coord3:[3,116,206,210,211],coord:[],coordb:440,coordbb:440,coordiat:363,coordin:[1,3,4,6,7,8,11,13,14,15,17,40,41,42,59,61,62,63,66,68,71,74,75,77,81,87,89,90,94,104,105,107,115,116,118,136,142,151,157,163,165,166,168,172,190,191,192,193,194,195,197,200,205,206,209,210,211,214,215,216,217,218,219,220,221,224,226,227,229,231,234,235,236,237,238,239,240,252,254,255,257,258,259,261,262,263,276,279,280,281,284,285,286,296,297,299,301,302,303,308,311,312,313,314,316,324,325,326,333,334,336,337,358,363,364,365,370,371,372,375,376,394,440,464,469,470,471,472,474,477,479,483,490,495,496],coordn:[116,206],coorind:[],copi:[0,3,4,8,11,12,15,17,40,121,193,326,365,384,432,467],copper:462,coproccesor:16,coprocessor:[1,4,7,9,16,17,370,482],coproprocessor:17,copy_arrai:8,copyright:[7,8,284],coral:194,core:[],core_shel:150,coreshel:[6,9,380,387,389],cornel:[6,174,481],corner123i:115,corner123x:115,corner123z:115,corner1i:115,corner1x:115,corner1z:115,corner2i:115,corner2x:115,corner2z:115,corner3i:115,corner3x:115,corner3z:115,corner:[3,6,40,115,193,335,336,358,457,469],cornflowerblu:194,cornsilk:194,corpor:16,corr:386,correct:[3,6,9,11,12,16,17,59,87,88,103,104,112,118,150,155,162,193,220,231,233,239,255,256,276,284,286,289,325,331,335,355,365,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,389,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,457,458,460,461,462,469,484,487,490],correction_max_iter:203,correctli:[3,8,9,11,17,71,81,103,104,105,145,146,147,149,151,153,154,155,156,157,160,161,164,191,194,200,221,226,229,240,249,255,256,292,299,302,311,313,332,335,365,366,370,389,417,422,466,467,469,479,494,496],correl:[],correspond:[1,2,6,8,11,12,14,20,21,22,23,24,25,26,27,28,29,30,31,32,35,38,40,42,43,44,45,46,47,48,49,51,53,54,56,70,71,87,97,98,111,114,115,116,117,120,121,129,132,133,134,135,136,138,139,140,142,145,146,155,162,166,167,174,175,176,177,178,179,180,182,183,185,186,188,190,191,193,194,198,199,200,206,208,209,210,211,213,216,218,220,227,229,230,234,239,242,243,251,252,253,255,257,258,259,260,261,262,263,264,265,269,272,274,275,276,278,281,282,286,291,299,301,302,317,319,321,330,331,332,334,335,336,338,340,341,342,343,345,346,349,351,356,360,362,364,365,371,372,374,378,379,380,381,382,383,384,385,386,387,390,391,393,394,395,396,397,398,399,400,401,402,405,407,408,409,410,411,412,413,414,415,416,419,420,422,424,425,426,427,429,430,432,433,434,435,440,441,442,451,452,453,454,455,458,460,461,462,464,466,467,469,470,472,482,483,484,486,487,490,495],correspondingli:[416,417,478],cosin:[],cosineshift:27,cosmo:[233,238],cossq:[],cost:[1,6,10,11,12,17,39,41,71,111,120,143,167,193,194,206,210,211,214,215,216,228,255,291,326,355,356,368,387,407,411,422,424,451,466,478],costheta0:[451,453,455,458],costheta:430,costli:[11,88,233,366],couett:4,coul:[],could:[2,3,6,9,11,12,17,33,41,50,59,66,71,75,87,90,94,105,107,111,114,116,148,158,163,165,181,191,193,194,198,199,206,207,210,214,220,229,238,288,289,290,294,297,299,301,314,315,321,325,326,327,331,335,337,339,347,352,354,361,363,366,370,373,397,401,402,405,432,433,465,466,467,469,471,473,476,477,485,490,495,496],coulomb:[3,5,6,7,8,9,10,12,14,15,18,72,88,109,110,118,143,169,173,290,292,327,355,356,363,370,378,380,381,382,383,386,387,388,389,390,395,399,400,402,407,411,415,418,424,427,432,433,435,440,450,455,456,458,461,474,481,487,490,494],coulommb:6,cound:3,count:[1,3,6,8,10,11,12,16,41,63,68,77,91,116,118,119,156,166,172,200,201,204,206,209,210,211,213,214,221,226,228,231,237,255,269,285,302,317,318,335,356,363,364,365,367,370,397,401,424,487,495],counter:[332,464,475,477,483],counteract:231,counterbal:235,counterbalanc:29,counterpart:[191,299,464],counterproduct:18,coupl:[],courant:304,cours:[3,8,128,130,162,191,198,199,232,298,311,325,331,333,334,336,337,356,416,442,466,469,482,490,495,497],courtesi:358,cov:440,coval:[6,29,395,419,440,490],covari:233,cover:[6,71,188,194,203,242,395,457],coverag:[71,210],cpc:238,cpp:[1,3,6,8,9,11,12,13,87,191,198,199,229,302],cpu:[1,3,4,9,10,12,14,15,16,17,18,63,71,194,208,224,240,327,353,356,370,384,450,464,482,483,486,487,488,495],cpuremain:487,cr2:167,cr3:167,crack:[4,366],crada:[5,7],crai:[5,7,13,18,191],crash:[3,12,366,490],craympi:370,creat:[],create_atom:[],create_bond:[],create_box:[],create_elementset:203,create_faceset:203,create_group:192,create_nodeset:203,createatom:[],creation:[],crimson:194,critchlei:284,criteria:[3,118,169,193,194,215,216,217,250,363,429,457,471,474,495],criterion:[12,41,123,168,171,204,214,217,231,269,291,304,332,337,363,365,386,395,399,440,474,483,484],criterioni:483,critic:[6,48,49,253,321,326,363],crmax:71,crmin:71,cross:[3,12,22,71,89,146,166,176,191,193,205,210,216,220,252,254,276,299,307,311,313,322,329,341,358,365,382,391,392,393,400,401,402,407,409,411,430,435,437,439,453,455,462,469,473,479,497],crossov:1,crossterm:469,crozier:[0,7,13],crucial:289,crystal:[4,6,13,73,108,280,281,324,358,366,473,487,490],crystallin:[6,104,281,358,454,490],crystallis:321,crystallogr:[120,167],crystallograph:[358,487],crystallographi:[120,167,358],cs1:167,cs_chunk:6,cs_im:[40,469],cs_re:[40,469],csanyi:[142,431,441],cscl:419,csequ:6,csh:[11,12,384],cshrc:[11,12],csic:[394,451,453,455,458],csinfo:6,csisi:[394,451,453,455,458],csld:[],cst:393,cstherm:6,cstyle:466,csvr:[],ctcm:[371,393],ctemp_cor:224,cterm:303,ctr:9,ctype:11,cu1:167,cu2:167,cu3au:419,cube:[6,41,166,171,214,224,335,358,490],cubic:[],cuda:[],cuda_arch:15,cuda_get:15,cuda_hom:15,cuda_prec:15,cufft:14,cuh:377,cummul:[3,6,212,215,216,217,219,228,233,239,241,314,317,318,319,320,322,329,401,487],cumul:[6,204,206,209,210,211,225,231,239,253,255,260,269,299,300,365],curli:2,current:[0,1,3,5,6,7,8,9,11,12,13,15,16,17,18,40,41,42,59,61,63,71,73,81,87,103,104,110,118,119,132,143,148,156,158,164,166,169,172,190,191,192,193,194,195,198,199,203,206,210,211,212,214,215,216,217,218,219,220,221,225,226,229,231,233,236,237,239,245,252,255,256,261,262,263,269,274,275,276,278,284,290,291,293,296,297,298,299,302,303,304,305,306,307,308,310,312,313,314,317,318,319,325,326,329,330,331,332,333,334,336,337,339,353,354,355,356,359,360,362,363,364,365,370,376,377,384,386,390,393,395,396,399,402,403,406,416,417,419,420,421,424,430,432,433,436,437,438,439,442,453,455,456,459,464,465,466,467,469,470,471,472,473,475,476,477,479,481,483,484,486,487,495,496,497,498,499],curv:[6,168,231,281],curvatur:[398,434,462],custom:[],cut0:467,cut1:478,cut2:478,cut:[],cuthi:[280,292],cutinn:[379,416,417],cutlo:[280,292],cutmax:430,cutoff1:[383,390,407,411,415,418,427,435],cutoff2:[378,380,381,383,389,390,407,411,415,418,427,435],cutoff:[3,6,10,16,18,39,45,46,54,55,61,70,72,73,77,87,92,108,110,117,118,142,166,169,171,172,216,217,222,280,289,290,292,294,296,299,314,327,331,335,337,353,355,356,363,366,367,368,370,371,372,373,374,375,376,377,378,379,380,381,382,383,385,387,388,389,390,391,392,393,394,395,396,397,398,400,401,402,403,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,432,433,434,435,440,441,442,443,444,445,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,467,471,474,478,490,495],cutoff_glob:376,cutoff_inn:376,cutoffa:394,cutoffc:394,cuu3:393,cval:167,cvd:321,cvel:303,cvff:[],cwiggl:[3,252,331,334,336,495],cyan:[2,193,194],cycl:[3,231,253,255,256,260],cyclic:[3,188],cygwin:12,cylind:[3,4,71,193,206,237,285,332,335,472],cylindr:[6,237,311,332],cypress:370,cyrot:377,cyrstal:281,d3q15:242,d3q19:242,d_double_doubl:15,d_e:326,d_flag2:288,d_flag:288,d_name:[115,191,288,316,479],d_single_doubl:15,d_single_singl:15,d_sx:288,d_sy:288,d_sz:288,daan:324,dai:12,daili:12,daivi:276,damag:[],dammak:294,damp:[3,6,197,202,239,240,241,246,255,256,260,286,289,290,294,299,317,318,330,332,333,362,363,365,378,380,382,387,390,395,399,407,415,427,435,450,456,483,490],damp_com:240,damp_drud:240,dampen:[299,490],dampflag:[332,399],dan:17,danger:[3,12,231,337,391,487],dangl:171,daniel:9,darden:[356,390],darkblu:194,darkcyan:194,darken:193,darkgoldenrod:194,darkgrai:194,darkgreen:194,darkkhaki:194,darkmagenta:194,darkolivegreen:194,darkorang:194,darkorchid:194,darkr:194,darksalmon:194,darkseagreen:194,darkslateblu:194,darkslategrai:194,darkturquois:194,darkviolet:194,dasgupta:290,dash:[399,486],dat:[6,91,188,203,465],data2xmovi:[],data:[],data_atom:8,data_atom_hybrid:8,data_bodi:8,data_vel:8,data_vel_hybrid:8,databas:[],datafil:[12,13,300],dataset:300,datatyp:3,date:[0,6,12,13,190,432,433,495],datom1:117,datom2:117,datom3:117,datom4:117,datum:[3,6,42,65,68,69,79,93,110,117,191,207],davenport:418,davi:331,david:[9,19,355,356,453,455],daw:[393,430],dbg:14,dcd:[3,6,7,191,192,193,194,195,282,470,474],ddim:190,deactiv:415,dealt:238,debug:[6,7,11,12,13,14,17,120,124,167,168,282,287,353,355,370,403,424,459,467,468,476,479,486,495],deby:[],decai:[92,387,462],decid:[3,6,12,16,71,252,288,299,327,484],decipher:358,declar:192,declin:314,decod:193,decompos:[87,441],decomposit:[3,5,7,18,62,203,282],decoupl:[6,490],decreas:[3,191,200,201,208,217,220,226,229,231,239,325,355],decrement:303,deepli:352,deeppink:194,deepskyblu:194,def:[12,13,467],defaul:61,defect:[6,70,166,422],defgrad:2,defin:[2,3,5,6,7,8,11,12,17,20,21,22,23,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,51,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,182,183,185,186,187,188,189,190,191,192,193,194,197,198,199,200,201,202,203,204,205,206,207,209,210,211,212,213,214,215,216,217,218,220,221,224,225,226,229,230,231,234,237,238,239,240,241,242,250,252,254,255,256,257,258,259,260,261,262,263,265,266,267,270,272,273,274,275,276,277,278,280,281,282,284,285,286,288,290,292,297,299,300,301,302,304,308,312,314,316,317,318,319,320,322,323,324,326,328,329,331,332,333,334,335,336,337,339,340,341,342,343,344,345,346,349,350,351,353,355,356,358,360,362,363,364,365,366,367,368,369,370,372,373,374,375,376,378,379,380,381,382,383,384,385,387,388,390,391,392,394,395,397,398,399,400,401,402,403,405,407,408,409,410,411,412,413,414,415,416,417,418,422,423,424,425,426,427,429,430,432,433,434,435,436,437,438,439,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,466,467,469,470,472,473,474,475,478,479,480,481,483,484,486,487,490,491,492,493,494,495,496],definit:[2,3,6,8,12,13,78,80,118,142,194,206,207,208,209,210,211,212,220,237,260,300,316,328,331,334,336,338,350,353,364,373,377,385,395,405,430,437,439,441,457,467,469,471,478,480,494,495],defint:487,deform:[],deg2theta:167,deg:490,degener:[3,284],degrad:[8,18,281,356,478],degre:[3,6,8,20,21,24,28,29,32,35,36,38,65,79,92,93,95,97,98,100,102,103,108,114,145,146,147,148,149,150,151,152,153,154,155,156,157,158,160,161,167,168,174,175,178,179,186,188,190,193,206,217,224,231,233,234,239,240,245,255,256,260,261,262,263,274,275,276,278,282,284,298,299,302,317,318,319,324,340,342,346,349,351,363,390,393,401,479,487,490,496],degress:[148,206],del:483,delai:[3,6,12,366,392,487],deleg:402,delet:[2,3,7,8,12,54,57,60,63,166,171,172,197,206,207,209,210,211,212,215,217,228,231,255,300,317,318,337,339,354,364,366,369,424,449,469,470,471,472,480,481,486,491,493,495,496],delete_atom:[],delete_bond:[],delete_el:203,deli:190,delimit:[467,495],deloc:[256,395,440],delr:419,delt_lo:483,delta:[],delta_1:377,delta_3:377,delta_7:377,delta_conf:3,delta_ij:[419,430],delta_mu:3,delta_pi:377,delta_r:430,delta_sigma:377,delta_ua:376,delx:190,delz:190,dem:376,demand:294,demo:11,demon:279,demonstr:[289,419],den:285,dendrim:401,denniston:[9,242,244,245,246,281],denomin:[7,173],denot:[120,224,240,281,292,294,387,400,402,433,437,439],dens:[71,217,395],densiti:[3,6,7,9,18,40,41,59,101,118,128,142,154,166,168,198,199,203,206,210,211,214,220,229,242,245,248,249,281,285,286,290,326,331,358,360,364,371,377,393,419,420,421,430,434,440,444,446,447,448,469,478,479,487,494],density_continu:439,density_summ:439,depart:[0,7],departur:[253,289],depend:[1,2,3,6,8,9,11,12,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,35,38,39,40,41,43,44,45,46,47,48,49,51,53,54,56,61,63,65,68,69,70,71,79,92,93,104,110,111,114,115,116,117,121,142,145,151,155,156,162,168,169,174,175,176,177,178,179,180,182,183,185,186,187,188,190,191,193,194,197,198,199,200,201,204,206,208,209,210,212,213,214,216,218,220,226,227,230,233,234,235,237,239,240,242,244,245,252,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,280,291,294,296,299,301,302,308,314,317,318,319,321,323,325,326,328,330,331,334,335,336,337,339,340,341,342,343,345,346,349,351,356,358,363,364,366,367,368,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,390,391,393,394,395,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,419,420,422,423,425,426,427,429,430,432,433,434,435,440,441,442,450,451,452,453,454,455,456,458,460,461,462,464,466,469,471,472,475,479,481,483,486,487,489,495,496],dependend:6,depflag:12,dephas:[464,483],depos:221,deposit:[],deprec:[290,432],depth:[51,146,193,326,398,434],dequidt:9,der:[87,109,385,386,415,432,433,461,490],deriv:[6,7,8,9,38,56,63,87,142,162,188,207,218,220,231,239,252,255,257,258,259,260,261,262,263,280,286,290,294,323,324,326,331,332,335,362,364,372,377,385,390,395,396,400,409,413,414,419,422,432,433,450,452,461,490],derjagin:461,derlet:280,descend:194,descent:[7,362],descib:[40,193,290],describ:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,38,39,40,41,42,56,62,63,68,70,71,73,88,112,115,118,120,132,142,143,146,147,148,152,153,156,159,161,162,166,167,168,170,171,180,185,188,191,192,197,198,199,206,207,208,209,210,211,212,214,217,218,219,220,221,223,224,232,233,236,237,238,239,240,241,242,244,245,246,250,254,255,256,260,268,277,280,282,287,288,289,290,291,292,299,303,311,314,315,316,317,318,319,320,321,322,323,324,329,331,332,334,339,355,356,358,361,362,363,364,365,369,372,373,375,376,378,379,380,382,383,384,385,386,387,390,393,395,396,398,399,400,402,405,407,408,409,410,411,412,413,414,415,416,417,418,419,422,423,429,430,431,432,433,434,435,440,441,442,449,450,451,452,453,454,455,456,458,460,461,462,464,466,467,469,470,471,472,473,479,482,483,486,495,496,497],descript:[],descriptor:[142,191,403],deserno:356,design:[0,3,6,7,8,9,11,13,14,15,17,120,150,153,167,203,217,223,224,255,256,280,281,300,321,326,373,374,375,376,379,382,387,389,395,415,416,417,420,421,430,433,452,478],desir:[2,3,6,7,11,12,14,15,16,33,40,50,59,71,88,91,114,119,143,150,168,181,190,206,212,218,220,229,231,232,239,240,241,245,255,276,284,285,286,287,290,294,299,302,314,317,318,319,320,325,332,347,352,355,356,358,361,363,364,365,391,393,401,416,417,451,453,455,465,466,467,469,473,478,483,484,486,487,495,496,497],desk:7,desktop:[4,6,7,10,12,193],despit:490,destabil:377,destre:349,destroi:[11,39,215,216],detail:[1,2,3,4,6,7,8,9,11,12,13,14,15,16,17,18,19,22,37,40,41,42,55,63,66,67,68,71,75,78,90,91,94,103,105,107,109,111,113,114,116,119,121,142,143,145,146,147,148,151,161,162,163,165,168,169,172,173,176,187,190,191,193,194,197,198,199,203,206,207,208,209,210,212,214,216,217,218,219,220,221,229,231,232,233,234,236,237,239,241,242,246,252,253,254,255,256,257,258,259,260,261,262,263,267,269,274,275,276,277,278,281,284,285,286,288,289,291,292,293,299,302,314,317,318,319,320,321,322,324,325,326,327,328,329,330,337,339,341,350,355,356,359,363,364,366,367,370,371,372,373,375,376,377,379,381,382,383,384,385,386,387,390,391,395,396,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,417,418,419,423,424,429,432,433,434,440,441,442,450,457,460,461,467,469,470,471,472,474,475,478,479,481,484,487,488,495,496,499],detect:[2,3,12,42,61,63,86,92,230,285,325,365,386,401,406,464,466,469,480,483,495],determ:370,determin:[1,3,6,8,9,12,15,39,40,42,51,57,58,59,61,62,68,71,87,103,109,111,114,120,121,129,143,156,157,166,167,168,190,191,193,194,195,196,200,201,202,205,206,207,208,209,210,211,212,213,214,218,220,221,224,226,231,234,235,237,239,240,245,250,252,253,255,261,262,263,274,275,276,278,280,282,286,289,296,297,298,299,300,301,304,306,308,314,317,318,319,321,327,328,331,332,333,334,335,336,337,350,355,356,358,364,366,367,370,372,373,381,386,390,392,393,397,399,402,403,411,419,422,424,433,434,440,449,452,456,461,466,469,470,472,474,476,479,483,485,486,488,494,495,496],detil:110,devan:[9,435],devanathan:455,develop:[0,3,5,6,7,8,9,11,12,14,15,16,17,18,19,42,236,260,284,289,290,293,372,377,395,421,422,440,458,471],devemi:9,deviat:[253,260,280,397],deviator:9,devic:[1,3,12,15,17,236,370],device_typ:370,devin:[291,386],devis:421,dfactor:193,dff:490,dfft_fftw2:12,dfft_fftw3:12,dfft_fftw:12,dfft_none:12,dfft_singl:[3,12,356],dfft_xxx:12,dfftw:12,dfftw_size:12,dft:[9,293,422],dhi:[59,190,220,285],dhug:[253,289],dhugoniot:[253,289],dia:419,diagnost:[],diagon:[3,6,83,142,143,144,218,255,286,299,329,437,439],diagonalstyl:441,diagram:[41,120,167,187,214,282],diallo:401,diam:[193,194,285,364],diamet:[3,6,40,42,115,168,191,193,194,198,199,239,285,299,314,316,330,332,364,376,385,398,399,409,434,457,461,469,470,479],diamond:[358,395,419],diamter:[40,285],dick:6,dicsuss:252,dictat:[204,253],did:[3,12,363,391,392,393,399,424,453,455,477],didn:3,die:18,diel:[],dielectr:[],diff:[3,6,12,164,328,355],differ:[1,2,3,4,6,7,8,9,10,11,12,14,15,16,17,18,22,37,38,39,41,42,54,55,56,61,64,68,70,71,87,92,95,97,98,122,142,145,146,147,148,149,151,154,155,156,157,158,160,161,162,168,169,171,176,187,188,190,191,193,194,197,199,202,204,206,209,214,215,216,217,218,219,220,224,230,231,232,233,234,235,236,239,240,242,252,255,256,257,258,259,261,262,263,265,267,270,272,273,274,275,278,280,282,284,286,289,290,291,294,297,299,302,303,311,312,314,317,318,319,322,323,324,326,329,330,331,332,335,339,340,350,352,354,355,356,358,359,361,362,364,365,367,368,369,370,371,372,377,381,382,384,385,386,391,393,395,398,399,400,402,405,407,408,410,411,418,419,420,421,423,424,426,430,432,433,434,435,436,437,439,440,441,442,450,451,452,453,455,457,458,461,463,464,466,467,469,471,472,473,474,477,478,479,481,483,484,486,487,488,490,494,495,496,497],differenti:[1,3,6,29,188,355,387,430,454],difficult:[218,282,370,401,478],difficulti:[92,108,302,432],diffract:[],diffus:[],digit:[2,3,194,339,422],dih_table1:188,dih_table2:188,dihedr:[],dihedral_coeff:[],dihedral_cosineshift:27,dihedral_styl:[],dihedralcoeff:3,dihedraltyp:216,dihydrid:395,dij:302,dilat:[],dim1:3,dim2:3,dim:[3,59,71,145,149,150,151,154,155,156,157,158,160,168,190,210,220,237,332,358,419,472,494,495,496],dimdim:495,dimems:281,dimens:[],dimensinon:71,dimension:[3,39,92,114,120,142,145,148,149,150,151,154,155,156,157,158,160,167,189,206,210,254,281,326,358,361,365,430,469,479],dimensionless:[106,123,124,126,129,131,133,138,142,326,356,441,461],dimentionless:137,dimer:[6,299,419],dimgrai:194,dimstr:[41,214],dinola:[286,317],dintel_offload_noaffin:16,dipol:[],dipolar:[4,29,40,191,316,490],dir1:480,dir2:480,dir:[1,3,4,8,9,11,12,253,280,289,313,430,432,433,467,480,495],dirac:142,direc:430,direct:[],directli:[3,6,8,9,11,12,87,115,142,144,191,192,193,200,226,233,237,242,281,300,318,330,332,333,334,335,358,362,370,371,372,378,380,381,387,390,393,395,407,411,424,427,435,449,467,479,480,481,487,495],directoi:14,directori:[0,1,2,3,4,6,7,8,9,11,12,13,14,15,16,17,60,195,219,238,284,290,293,310,314,323,324,365,369,371,372,377,384,386,387,393,394,396,403,404,415,419,420,421,422,426,430,431,432,433,440,441,451,453,454,455,458,467,469,470,471,480,495],disabl:[3,12,16,326,406,467,482,495],disadvantag:[6,214],disallow:[191,220,255],disappear:471,discard:[2,3,41,71,208,210,214,327,335,466,471,472],discontinu:[9,188,363,413],discourag:419,discov:[13,327],discret:[6,8,40,42,193,194,239,242,376],discuss:[],disk:[6,84,85,92,161,189,221,231,285,467],disloc:[70,422],disord:[39,70,422],disp:[],dispar:434,disperion:[390,411],dispers:[3,6,7,9,166,281,355,356,381,390,411,416,424,433,452,458],displac:[],displace_atom:[],displace_box:59,displacemet:472,displai:[11,13,22,37,44,55,176,187,191,193,341,350,384,450],dispters:3,disregard:422,dissip:[6,232,239,281,323,324,379,391,399,416,417,450],dissolut:215,dist:[6,69,91,110,119,191,282,298,392,449,464,496],distanc:[],distinct:[6,224,296,355,434],distinguish:[6,86,142,245,376,395,468],distort:[166,371],distrbut:371,distribut:[],distro:[113,384,429,430],ditto:[8,12,14,15,16,17,18,42,117,216,462,467],div:8,divd:119,diverg:[3,12,39,299,324,471,490,497],divid:[3,6,16,41,91,114,119,128,130,143,165,166,176,187,194,206,207,209,214,220,280,322,329,334,355,363,365,396,433,440,458,478,486,495],divis:[6,242,377,405,415,466,487,495],dl_poli:[6,7],dlambda:162,dlammps_async_imd:236,dlammps_bigbig:[12,39],dlammps_ffmpeg:[3,12,193],dlammps_gzip:[3,12,191,193,325,469,470,474],dlammps_jpeg:[3,12,193],dlammps_longlong_to_long:12,dlammps_memalign:[12,16],dlammps_png:[3,12,193],dlammps_smallbig:12,dlammps_smallsmal:12,dlammps_xdr:[12,191],dlen:479,dlmp_intel_offload:[12,16],dlo:[59,190,220,285],dlopen:6,dlvo:[7,385,461],dm_lb:242,dmax:[314,361],dna:7,doc:[0,1,2,3,4,6,7,8,9,11,12,13,14,15,16,17,18,22,37,40,42,55,57,59,63,66,68,75,87,90,94,103,105,106,107,109,111,113,114,116,119,121,143,146,147,148,161,163,165,168,169,170,176,187,190,191,192,193,194,195,197,198,199,204,205,206,207,208,209,210,211,212,221,231,239,240,250,255,256,261,262,263,267,274,275,276,277,278,285,288,299,311,314,317,318,319,328,332,335,337,339,341,350,354,363,364,365,370,371,372,375,376,384,386,387,393,394,396,401,402,404,405,419,420,421,424,426,429,430,431,441,450,451,453,455,457,458,467,469,470,471,472,474,477,478,479,486,487,495,496,497,498],docuement:434,dodd:[42,376],dodgerblu:194,doe:[0,1,2,3,5,6,7,8,9,11,12,14,15,16,17,18,33,38,39,41,42,50,54,56,59,62,63,67,70,71,72,87,88,91,105,112,118,119,120,144,146,148,150,151,156,158,162,167,168,169,170,172,174,176,181,187,188,190,191,192,193,194,197,203,204,206,210,213,214,216,217,218,220,224,226,228,231,232,235,237,239,240,242,245,251,255,256,257,258,259,261,262,263,274,275,276,277,278,286,287,288,292,294,297,299,314,317,319,321,322,326,329,330,331,334,335,336,337,342,343,344,346,347,349,354,355,356,357,358,364,365,366,371,372,373,374,375,376,377,379,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,402,403,404,405,406,409,410,412,413,414,416,417,419,420,421,422,424,430,431,432,433,434,436,437,438,439,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,456,457,458,460,461,462,464,465,466,467,469,470,471,472,473,476,477,479,480,481,482,483,486,487,490,495,499],doegenomestolif:7,doesn:[3,7,8,12,168,191,204,210,211,311,364,366,370,372,386,394,404,432,433,451,453,454,455,458,469,471],dof:[3,8,114,146,147,148,161,206,299,496],dof_per_atom:[148,206],dof_per_chunk:[148,206],doff:[364,469],doi:[6,219],domain:[3,6,7,12,13,18,39,41,42,58,61,62,71,120,157,167,170,190,192,193,194,197,204,214,218,220,221,235,238,242,255,256,282,294,299,326,331,332,355,356,365,370,392,424,464,466,469,473,486],domin:[1,395,483],don:[0,8,11,12,13,118,171,200,226,240,288,335,419,440,467,469],donadio:318,done:[1,3,6,7,8,12,14,15,16,17,18,38,39,41,56,59,62,71,162,165,168,171,188,191,193,194,203,204,206,208,209,210,211,212,214,215,216,217,218,220,221,229,231,236,237,239,240,247,255,261,262,263,274,275,276,278,279,281,282,283,288,296,299,300,302,314,317,318,319,321,323,324,337,339,354,355,356,363,365,366,369,370,372,381,393,402,403,404,411,417,418,419,424,432,449,452,457,464,465,466,467,470,473,474,477,487,488,490,495,496],donor:401,dot:[143,164,200,226,234,254],doti:[377,430],doubl:[1,2,3,6,8,9,11,12,14,15,16,17,39,87,220,229,287,335,339,354,356,369,370,377,396,400,422,432,433,465,469,473,477,482,495,496],dover:203,down:[3,6,7,8,11,39,71,218,231,239,314,330,370,395,424,440,468,488],downhil:[361,362],download:[5,7,8,9,11,12,13,17,236,403,431],downsid:6,downward:296,dozen:[8,12,109,197,432,433],dpack_arrai:12,dpack_memcpi:12,dpack_point:12,dpd:[],dpde:248,dproduct:373,dr_ewald:[120,300],drag:[],dragforc:242,drai:[253,289],drain:[235,330,363],dramat:[59,190,215,216,217,218,220,255,314,317,318,356,370,424,440,466],drautz:377,draw:193,drawback:288,drawn:[42,191,193,194,232,464],drayleigh:[253,289],dreid:[],drfourth:106,drho:[115,371,393],drift:[6,104,106,232,233,239,240,251,297,314,478,486,490],drive:[11,12,201,218,220,234,255,280,286,299,333,365],driven:[6,180],driver:[6,12,14,15,197,229,236],drop:[3,194,391],droplet:402,drsquar:106,drude:[],dry:228,dsecriptor:403,dsf:[],dsmc:[],dstyle:285,dt_collis:242,dt_lb:242,dt_md:242,dt_srd:314,dtilt:[59,220],dtneb:483,dtqm:289,dtype:[117,216],dual:[16,17,314,370],dudarev:167,due:[1,3,6,9,10,12,16,17,19,40,54,57,58,61,66,70,71,74,75,81,86,88,89,90,94,103,104,105,106,107,112,118,120,128,142,143,145,146,147,149,151,154,155,156,157,158,160,161,163,167,168,171,172,191,193,197,200,201,209,213,215,216,217,218,219,220,221,226,227,228,229,232,233,236,237,239,240,241,242,245,246,247,251,252,253,254,255,260,269,280,283,285,297,298,299,301,311,313,314,315,317,318,319,320,321,323,324,326,330,331,333,334,335,337,356,361,363,365,366,367,388,391,393,397,398,402,416,417,424,430,432,434,435,449,452,453,455,459,461,462,464,466,469,470,471,478,483,486,487,488,490,495,496],duffi:326,duin:[9,290,295,432,433],duke:356,dummi:[12,29,454],dump1:474,dump2:474,dump2vtk_tri:136,dump:[],dump_atom:8,dump_custom:8,dump_h5md:192,dump_modifi:[],dumpcustom:8,dumptimestep:474,dunbrack:[6,20,174,382,481],dunweg:[239,241],duplic:[2,3,14,15,17,41,42,169,214,233,280,469,494],dupont:[5,7,13],durat:[37,55,145,146,147,149,150,151,153,154,155,156,157,160,161,187,194,206,231,294,326,350,399,450],dure:[2,3,6,8,9,12,16,17,38,39,41,56,71,87,128,130,144,150,169,172,188,191,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,222,225,226,227,228,229,230,231,232,233,234,235,236,237,239,240,241,242,243,244,245,246,247,248,249,251,252,254,255,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,307,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,356,363,365,369,370,391,415,422,424,433,452,464,465,467,469,472,474,476,477,479,481,483,484,487,488,495,498,499],dvector:8,dvlo:461,dvx:6,dx_lb:242,dy3:167,dyamic:12,dyanam:6,dyanmic:483,dynam:[],dynamo:[5,371,393,419],dyne:494,dyre:412,dysam:472,e28637:29,e_1:377,e_2:377,e_b:396,e_e:395,e_hbond:401,e_i:[6,377,396],e_j:[6,377],e_k:[377,395],e_kl:6,e_lj:[372,390],e_n:[377,395],e_nn:395,e_pr:395,e_rebo:372,e_tors:372,e_tot:422,e_vol:422,eaa:340,eaat:175,each:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,53,54,55,56,57,59,61,62,63,64,66,67,68,70,71,72,73,74,75,76,77,78,80,81,83,85,87,89,90,92,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,111,112,113,114,115,116,117,118,119,120,121,122,136,142,143,144,146,147,148,149,150,151,152,155,156,157,158,160,161,162,163,164,165,166,167,168,171,172,174,175,176,177,178,179,180,181,182,183,185,186,187,188,190,191,192,193,194,195,196,197,198,199,200,201,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,231,232,233,234,235,236,237,238,239,240,241,242,243,245,246,247,248,249,251,252,253,254,255,257,258,259,260,261,262,263,264,265,266,267,269,270,271,272,273,274,275,276,277,278,280,281,282,283,284,285,286,287,288,290,291,292,294,296,299,300,301,302,303,307,308,310,311,312,313,314,315,316,317,318,319,321,324,325,326,327,328,329,330,331,332,334,335,336,337,339,340,342,343,344,345,346,347,349,350,351,354,355,356,358,362,363,364,365,366,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,395,396,397,398,399,400,401,402,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,423,424,425,426,427,429,430,432,433,434,435,436,440,441,442,443,444,445,446,447,448,449,450,451,452,455,456,457,458,459,460,461,462,463,464,466,467,469,470,471,472,473,474,476,477,478,479,481,483,484,486,487,488,489,490,494,495,496,497,499],eacn:[41,214],eam0d:281,eam3d:281,eam:[],eam_databas:13,eam_gener:13,eangl:487,earli:[41,206,209,210,211,212,214,293,300],earlier:[7,8,12,59,194,365,399,419,424,483],earliest:483,earth:395,easi:[6,7,8,9,11,13,87,143,191,198,199,200,201,210,213,226,234,235,237,239,240,301,308,317,318,319,331,334,336,364,469,472,477,479,496],easier:[8,9,13,16,191,193,281],easili:[8,11,193,194,330,365,466,476,485,495],eastwood:[355,356],eat:175,eatom:337,eaxmpl:6,eba:21,ebb13:175,ebb:21,ebond:[224,240,486,487],ebt:175,ec_ii:419,ec_ij:419,ec_jj:419,echo:[],eco:[432,433],ecoa:[432,433],ecoul:[109,224,240,432,433,487],ecp:[395,469],edg:[2,3,6,41,42,59,71,120,166,167,170,171,192,193,202,210,237,301,331,334,335,336,337,358,376,469,472,479],edge_histo:166,edge_threshold:166,edih:487,edim:322,edip:[],edit:[3,8,12,13,14,15,16,17,18,19,490],editor:13,edu:[7,9,11,13,393,416,429,432,433],edward:[9,17],eebt:175,eff:[],effect:[1,2,3,6,8,9,11,12,14,15,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,43,45,46,47,48,49,51,53,54,56,66,71,74,75,81,89,90,94,104,105,106,107,111,114,143,145,150,155,156,163,166,172,174,175,177,178,179,180,182,183,185,186,187,188,190,191,193,194,198,199,200,203,204,207,211,212,213,215,216,217,218,220,221,227,230,231,232,233,234,235,236,237,239,240,254,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,279,280,282,285,286,288,289,290,291,294,298,299,301,302,313,314,317,318,319,321,322,324,326,329,330,331,332,333,334,335,336,337,340,342,343,345,346,349,351,355,356,358,362,363,364,365,366,371,372,374,377,378,379,380,381,382,383,385,386,387,390,391,393,394,395,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,420,422,424,425,426,427,429,434,435,436,438,440,442,450,451,452,453,454,455,457,458,460,461,462,464,466,467,471,472,474,478,479,481,487,488,494,495,497],efffect:473,efficaci:39,effici:[0,1,3,6,7,8,10,12,15,17,18,39,58,61,67,114,144,191,192,193,194,207,208,218,220,224,233,255,282,284,294,299,302,314,355,356,361,366,370,377,385,387,402,407,411,422,434,476,499],effort:[5,7,470],efftemp:[97,98,154],efi:[432,433],efield:[],eflux:235,eggebrecht:[387,440],ehb:[432,433],eigensolv:3,eigenvalu:[281,282,355],eigtol:3,eik:162,eim:[],eimp:487,einstein:[294,324],either:[1,2,3,4,6,8,9,11,12,14,15,16,17,22,33,41,44,50,59,63,71,104,109,115,118,120,142,143,148,150,151,166,167,168,171,176,181,188,191,192,193,194,197,205,207,209,211,212,214,217,218,219,220,221,231,237,238,242,246,252,253,255,256,260,276,280,296,299,301,302,303,311,314,321,328,332,335,339,341,353,355,356,358,362,363,367,370,377,379,385,393,402,403,405,416,417,419,422,424,428,430,449,453,455,457,464,467,469,471,472,473,476,478,481,484,486,495],ejtehadi:[385,398,434],elaplong:[198,199,237,472,487,495],elaps:[3,190,198,199,200,201,213,220,226,234,235,237,239,240,252,285,301,308,317,318,319,331,332,334,336,442,464,472,474,475,479,483,487,495],elast:[],elastic_t:4,elba:29,electr:[6,197,203,226,240,355,356,396,432,433,462,490,494],electrolyt:[9,461],electron:[3,6,7,9,13,40,97,98,115,120,152,154,159,197,203,223,224,240,241,256,268,277,292,320,326,362,364,371,373,386,390,393,395,396,419,422,430,431,440,455,458,462,469,489,490,494],electron_integr:203,electron_temperatur:203,electron_unit:395,electroneg:[6,290,291,292,386,396,440],electroneg_compon:440,electronic_dens:3,electronic_specific_heat:3,electronic_thermal_conduct:3,electrostat:[6,9,16,18,204,231,290,292,293,327,355,356,385,390,395,407,415,417,433,440,461],eleftheri:299,elem1:[396,419,441],elem2:[396,419,441],elem:440,element1:[296,371,393,440],element2:[296,371,393,440],element:[3,6,7,8,12,13,42,63,81,89,104,106,114,119,121,136,142,143,144,145,146,147,148,149,150,151,155,156,157,158,160,161,164,191,192,193,194,195,197,203,207,209,212,281,296,321,328,371,372,376,377,386,393,394,395,396,402,403,404,419,420,421,422,426,430,431,432,433,440,441,451,453,454,455,458,490,495,498],elementn:[371,393],elementset:203,elev:483,elif:[142,339],elig:[3,204,215,216,228,231,401],elimin:[3,6,71,166,232,239,240,299,302,323,324,464],elj:390,ellad:9,elliot:9,elliott:9,ellips:[4,6,9,71,82,146,189],ellipsoid:[3,4,6,7,13,40,42,71,82,115,132,146,168,189,190,191,239,252,257,261,265,266,274,299,314,360,363,398,417,434,450,469,479,497],ellipsoidflag:469,elong:[224,240,487],elp:[432,433],els:[3,7,8,12,71,109,118,119,121,192,193,205,206,207,209,210,211,212,231,255,299,314,326,327,328,337,339,355,402,468,480,495,498],elsewher:[8,252,314,419,431,432,433,481,487,495],elt:419,emac:[],email:[0,3,5,7,8,9,11,396],emb:[3,9,335],emb_lin_neg:419,embed:[3,5,7,11,12,13,29,88,144,166,326,371,393,396,415,419,420,421,430,450,459,467],embt:175,emi:[7,9],emil:9,emol:[432,433,487],emphas:399,empir:[203,318,372,395],emploi:[9,281,290,294,454],empti:[3,57,71,166,170,299,355,366,406,469,480,481,495],enabl:[3,6,8,9,11,12,13,14,15,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,33,35,37,38,39,40,43,45,46,47,48,49,50,51,53,54,55,56,60,61,62,64,67,78,80,83,87,97,98,99,100,101,102,106,111,113,114,120,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,144,145,146,147,150,152,154,155,159,160,162,166,167,174,175,177,178,179,180,181,182,183,185,186,187,188,191,192,194,195,197,198,199,200,201,202,204,208,211,213,215,216,217,219,220,221,226,227,228,229,230,231,232,233,234,236,237,238,239,240,241,242,243,244,245,246,248,249,251,253,255,256,257,258,259,260,261,262,263,264,265,266,267,268,270,272,273,274,275,276,277,278,280,281,282,284,285,289,290,291,292,293,294,295,296,298,299,301,302,303,304,305,306,307,308,310,311,313,314,317,319,320,321,322,323,324,326,327,329,330,331,332,333,334,335,338,340,342,343,345,346,347,349,350,351,356,363,365,369,370,371,372,374,375,376,377,378,379,380,381,382,383,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,419,420,421,422,424,425,426,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462,467,470,471,472,476,478,488,495,499],enclos:[2,6,12,170,191,287,339,419,440,465,467,477,495],encod:[13,39,42,191,193,194,288,402],encompass:[3,6,40,42,57,59,118,169,310,328,450,472],encount:[3,8,12,59,108,209,369,474,495],encourag:[7,8,293,312],end12i:115,end12x:115,end12z:115,end1i:115,end1x:115,end1z:115,end2i:115,end2x:115,end2z:115,end:[1,2,3,5,6,8,11,12,15,16,17,18,19,38,40,41,42,57,59,71,115,171,172,175,190,191,193,194,195,198,199,207,209,211,212,217,220,232,237,239,241,254,255,256,269,286,298,299,303,314,317,318,319,320,322,325,326,329,333,336,337,354,355,364,365,369,370,391,393,398,405,418,422,434,437,439,441,442,459,464,467,469,470,471,472,474,476,477,481,485,487,490,495,499],end_of_step:8,endbondtors:[3,175,181,469],endif:8,energet:[217,372,433],energi:[0,1,2,3,4,5,6,7,8,9,12,13,20,21,23,24,25,26,27,28,29,30,31,32,35,36,38,40,43,45,46,47,48,49,51,53,54,56,63,65,69,82,83,84,85,86,87,88,91,95,96,97,98,99,100,102,103,109,110,111,112,114,125,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,168,172,174,175,176,177,178,179,180,182,183,185,186,187,188,191,194,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,340,342,343,344,345,346,349,351,355,356,361,362,363,365,366,370,371,372,374,375,376,377,378,379,380,381,382,383,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,429,430,432,433,434,435,440,441,442,443,444,449,450,451,452,453,454,455,457,458,459,460,461,462,464,467,469,474,478,479,481,483,485,486,487,490,494,495,498],energy_compon:440,energy_update_freq:433,enforc:[6,57,58,105,190,191,192,193,195,197,204,217,220,255,279,281,291,299,302,339,355,407,466,495,496],enforce2d:[],eng:[11,65,69,110,191,229,337,339,386,421],eng_previ:339,engin:[203,220,284,303,323,393,420],engr:[432,433],enhanc:[199,203,464],enlarg:[59,193],enough:[3,40,61,86,168,169,171,172,214,240,285,289,294,299,327,331,332,335,366,370,387,428,469,473,474],enpub:393,enrti:[],ensembl:[],ensight:6,ensur:[3,6,142,191,204,208,218,231,232,255,304,325,356,377,392,415,451,458],enter:[57,158,396,422,458,483],enthalpi:[125,257,258,259,393,486,487,495],entir:[0,2,3,6,11,14,15,41,42,63,88,111,112,114,118,120,143,148,167,168,194,197,198,199,206,210,211,214,217,219,228,231,232,235,239,240,251,255,257,258,259,260,261,262,263,280,282,284,297,299,312,326,328,339,370,390,411,424,452,469,477,478],entireti:457,entiti:[6,8,40,42,191,299],entri:[3,8,12,38,42,56,65,69,79,93,110,117,120,129,132,133,134,135,136,138,139,140,166,188,194,209,210,211,219,289,337,364,377,394,419,426,433,441,451,452,453,454,455,458,495],entropi:483,entry1:[38,56,194,384,452],entry2:194,entryn:194,enumer:[169,191],enumuer:6,env:370,environ:[1,3,6,11,12,16,17,18,193,233,238,280,370,371,377,384,386,394,395,430,453,466,480,495],epair:[109,194,397,401,432,433,487],epen:[432,433],epfl:[233,238],epp:390,epq:390,eps0:461,eps14:415,epsilon0:455,epsilon:[3,6,36,45,46,50,53,54,87,174,198,199,231,299,314,331,335,361,363,375,376,382,383,385,387,388,389,390,398,400,401,402,405,406,407,408,409,410,411,412,413,414,415,418,423,427,434,435,445,451,457,460,461,478,490,494],epsilon_0:462,epsilon_14:382,epsilon_:434,epsilon_d:388,epsilon_i:[398,424,434],epsilon_i_:434,epsilon_i_a:[398,434],epsilon_i_b:[398,434],epsilon_i_c:[398,434],epsilon_ij:424,epsilon_j:[398,424,434],epsilon_j_:434,epsilon_j_a:[398,434],epsilon_j_b:[398,434],epsilon_j_c:[398,434],epsilon_lj:434,epton:429,eqch:163,eqeq:[432,433],eqp:390,eqq:390,equal:[2,3,6,8,11,12,17,39,41,54,63,65,68,69,71,76,79,86,87,91,93,110,112,117,119,121,143,146,162,164,166,168,190,193,194,197,198,199,200,201,204,207,208,209,212,213,214,218,220,221,226,231,232,234,235,237,239,240,242,245,246,252,253,260,271,280,282,285,287,289,290,291,294,296,298,299,301,303,308,310,317,318,319,322,323,324,326,328,329,331,334,336,337,339,354,358,363,365,366,367,369,370,386,391,397,398,401,405,416,422,423,430,432,433,434,436,437,438,440,441,442,452,457,458,462,465,466,467,469,471,472,476,477,480,483,485,487,495,496],equat:[3,6,7,8,9,91,108,114,120,167,176,187,197,218,224,225,233,239,240,242,245,253,254,255,256,260,276,280,282,289,290,294,302,314,322,326,329,331,332,334,336,349,355,356,385,390,391,395,396,399,404,416,417,419,424,434,437,439,444,445,447,448,462,490],equi:256,equidist:254,equil:[3,290,359,476,499],equilater:479,equilibr:[3,4,5,6,7,9,59,91,168,197,204,207,217,218,231,253,255,256,276,277,289,290,291,292,322,323,324,329,386,387,432,433,465,479],equilibria:329,equilibribum:[215,216],equilibrium:[1,3,4,6,7,21,24,26,27,28,29,32,35,36,38,43,47,48,49,51,53,56,59,151,152,175,177,218,220,231,232,233,240,242,255,260,276,289,290,294,298,302,303,311,314,321,322,324,329,340,342,346,349,386,419,426,440,490],equilibrium_angl:8,equilibrium_dist:8,equilibrium_start:203,equival:[6,12,13,29,59,61,126,127,135,140,166,170,194,209,212,218,220,231,239,255,276,286,298,299,334,391,395,440,453,455,469,472,477,478,487,490],equlibrium:6,equliibr:[290,292],er3:167,eradiu:[40,115,395,469],eras:[301,323],erat:[220,417],erc:387,erfc:[387,407,424],erforc:115,erg:494,erhart:[204,393,453,455],ermscal:373,ernst:9,eror:3,eros:419,erose_form:419,erot:[],errata:[453,455],erratum:331,erron:3,error:[],erta:399,ervel:[115,469],escap:[221,490],especi:[8,11,16,156,168,197,204,214,231,289,294,297,298,370,466],espresso:[9,293],essenti:[8,11,12,27,88,130,149,150,151,154,155,156,157,158,160,177,207,260,281,330,356,372,387,407,455,474,487],essex:29,establish:[87,235],estim:[1,3,6,10,12,38,41,56,91,143,203,214,225,253,314,321,355,356,361,424,433,452,483,487],esu:494,esub:419,eta:[6,242,255,289,290,292,330,394,396,398,430,454,458,494],eta_dot:255,eta_ij:430,eta_ji:396,etag:[40,469],etail:487,etap:255,etap_dot:255,etc:[1,2,3,6,7,8,9,10,11,12,13,15,16,39,40,42,54,61,68,89,90,91,95,111,112,115,117,143,145,148,149,150,151,152,154,155,156,157,158,160,162,168,170,171,172,181,191,193,194,197,198,203,204,205,206,209,210,211,212,215,216,220,221,229,231,232,239,255,285,296,300,326,327,335,339,354,355,363,364,365,366,368,393,394,402,415,417,422,428,432,433,451,453,455,458,464,467,469,470,471,476,478,479,483,485,486,487,488,490,494,495,497,499],ethernet:18,etol:[363,365,464,483],etot0:289,etot:[6,95,97,98,112,143,154,194,224,240,253,289,486,487],eu2:167,eu3:167,euler:[363,365],eulerian:203,euqat:443,europhi:242,ev_tal:8,evalu:[2,3,9,11,12,38,56,71,87,88,91,109,119,142,144,148,158,166,168,190,191,193,194,198,199,200,201,203,205,206,207,208,209,210,211,212,213,220,226,232,234,235,237,238,239,240,281,287,290,301,304,308,317,318,319,328,331,334,336,337,339,355,356,361,363,370,422,424,430,436,438,440,452,464,465,467,471,472,474,476,477,478,479,483,485,487,495,496],evalut:[339,467],evan:[156,276],evanseck:[6,20,174,382,481],evapor:[],evaul:[8,363],evdwl:[109,432,433,487],even:[3,6,8,12,15,17,18,34,39,41,52,57,59,61,63,70,71,121,166,169,170,184,188,191,194,197,198,199,204,205,206,209,210,211,212,214,215,216,218,220,221,224,237,240,253,255,256,281,294,296,299,300,310,314,322,326,329,331,335,337,348,355,361,363,365,370,375,395,396,399,402,405,424,434,458,459,469,470,472,474,475,476,478,479,481,484,486,487,488,490,499],evenli:[3,41,143,188,214,242,405,459],event:[],eventu:[3,6,12,15,170,290,483],ever:[54,56,238,314],evera:[385,398,434,450],everi:[0,1,2,3,6,8,9,11,12,15,16,39,41,71,72,91,115,121,130,156,171,191,192,193,194,195,197,198,199,200,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,225,228,229,231,233,235,236,237,242,243,251,255,256,260,279,280,281,285,286,287,288,289,290,291,292,294,296,297,299,300,302,303,314,316,317,318,319,320,321,322,325,326,327,328,329,337,339,354,356,365,366,367,370,391,392,402,415,432,433,440,446,463,464,465,469,471,473,474,476,477,478,483,484,485,487,495,499],everyth:[8,109],everywher:[118,409],eviri:395,evolut:[233,242,282,464],evolv:[242,282,327],ewald:[2,3,5,6,7,8,12,88,112,120,143,327,355,356,363,378,380,381,387,390,395,407,411,427,435,450,452],ewald_disp:390,ewalddisp:3,exact:[22,41,44,71,124,162,171,176,214,217,232,233,239,240,241,285,294,295,314,326,341,355,384,471,476,483,495,497,499],exactli:[3,6,12,14,17,38,41,42,56,59,71,72,91,118,146,152,159,168,188,198,199,209,214,220,225,232,239,240,241,256,268,269,277,281,289,314,319,320,333,370,384,391,393,399,402,416,424,452,471,472,479,483,495],exager:490,examin:[6,8,9,17,217,281],examp:[467,495],exampl:[],exce:[3,6,16,17,18,41,58,71,170,205,206,209,210,211,212,214,218,220,225,228,255,281,296,300,305,306,314,363,370,469,495],exceed:[3,41,59,214,220,255,314,477],excel:395,except:[1,2,5,6,8,9,11,14,20,21,22,23,24,25,26,27,28,29,30,31,32,35,37,38,40,41,43,44,45,46,47,48,49,51,53,54,55,56,59,60,63,71,89,90,110,111,114,119,143,145,146,147,148,149,150,151,152,154,155,156,157,158,159,160,161,168,172,174,175,176,177,178,179,180,182,183,185,186,187,188,190,191,194,197,200,206,207,209,213,214,218,220,227,230,231,234,237,239,241,255,256,257,258,259,260,261,262,263,264,265,268,269,272,274,275,276,277,278,282,291,292,299,301,302,311,314,317,319,320,326,330,334,337,339,340,341,342,343,345,346,349,350,351,355,356,358,360,364,365,366,368,369,370,371,372,374,378,379,380,381,382,383,384,385,386,387,389,390,391,393,394,395,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,417,420,425,426,427,429,432,433,434,435,442,450,451,452,453,454,455,458,460,461,462,464,466,467,469,471,472,474,477,478,479,480,481,483,487,490,494,495,496,498],excess:[208,395],exchang:[2,3,6,8,9,61,62,197,203,204,231,239,291,299,322,326,329,355,370,395,484],exchange:355,excit:[9,395],exclud:[3,6,9,12,16,17,63,71,114,142,148,155,156,172,191,206,210,215,216,243,251,284,297,299,321,332,337,363,364,366,379,399,402,405,416,417,424,449,481],exclus:[1,3,9,12,16,87,370,386,422,424,478,488],excurs:[255,464],exectubl:12,execut:[1,2,3,4,6,8,11,12,17,60,169,193,236,293,339,354,357,369,465,467,477,480,483,495],exempl:440,exemplari:232,exemplifi:395,exert:[6,237,240,294,333,334,335,356],exhaust:[203,369,495],exhibit:[92,255,362,395,478],exist:[3,6,7,8,11,12,13,16,37,55,59,68,70,124,168,169,187,192,193,194,197,202,213,216,218,221,231,284,285,287,337,340,342,343,344,346,350,359,364,370,402,432,449,459,465,467,469,470,471,480,481,482,495,496,497],exit:[2,3,11,12,41,57,191,214,354,369,467,468,477,486,495],exlanatori:3,exp:[],expand:[],expans:[12,142,191,480,495],expect:[1,3,8,12,13,14,15,16,17,18,19,41,42,71,103,149,160,166,188,214,226,231,233,252,280,286,288,289,294,299,337,356,366,384,419,422,424,464,467,469,471,474,478,483,495],expens:[6,10,71,194,280,284,299,326,337,355,356,366,370,467],experi:[6,13,15,17,213,221,236,245,254,286,298,299,361,365,391,424,478,483],experienc:[6,12,244,245],experiment:[231,355,370,483],expert:12,expertis:7,explain:[1,3,6,8,9,11,12,16,18,41,59,63,65,68,69,71,72,73,76,77,79,86,93,148,156,188,191,193,194,197,206,207,212,214,216,218,220,255,280,288,299,311,337,339,354,355,358,364,365,369,375,393,405,440,442,457,467,470,471,474,476,479,490,495,499],explan:[3,6,59,115,142,191,206,254,280,402,463,466,467,469,478],explanatori:[3,8,119,191,205,206,209,210,211,299,364,466,495],explantori:[3,295],explic:423,explicit:[6,9,11,22,44,77,87,115,118,162,176,198,199,220,305,306,341,360,372,373,377,382,384,393,395,406,416,456,463,466,470,473],explicitli:[3,6,8,12,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,43,45,46,47,48,49,51,53,54,56,71,111,114,145,155,158,166,168,174,175,177,178,179,180,182,183,185,186,188,191,194,200,210,213,220,227,230,232,234,239,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,288,289,291,299,301,302,317,319,320,326,330,334,340,342,343,345,346,349,351,364,370,371,372,374,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,396,397,398,399,400,401,402,406,407,408,409,410,411,412,413,414,415,416,420,422,424,425,426,427,429,434,435,442,443,444,445,446,447,448,450,451,452,453,454,455,456,458,460,461,462,469,471,472,478,479,481,482,488,490],explictli:[16,482],exploit:[9,15,17,282],explor:[120,167],expon:[3,290,292,393,398,401,415,423,435],exponenti:[87,430,451,458,462,483,495],expos:11,exposit:[203,391,392],express:[6,142,154,168,198,199,218,252,280,290,326,332,339,377,393,395,409,419,440,441,450,495],expressiont:377,extend:[],extens:[3,6,9,17,44,45,46,53,55,63,82,83,84,87,88,91,95,98,99,109,111,119,121,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,197,200,201,204,212,213,219,222,226,229,230,231,233,234,235,237,239,241,253,255,260,269,280,281,297,298,299,301,303,308,311,313,317,318,319,320,321,323,324,326,328,331,335,336,398,419,422,433,434,441,486,487],extent:[1,3,41,42,45,57,71,166,170,191,202,210,214,237,333,336,355,358,372,436,438,452,466,469,472],exterior:[3,6,166,335],extern:[],extra:[3,6,8,12,16,17,40,41,46,61,71,103,111,112,114,120,143,145,146,147,149,151,154,155,156,157,158,160,161,167,168,169,170,174,194,209,214,216,255,287,288,289,299,314,363,364,367,368,390,399,402,405,419,424,466,467,469,472,481,490,495],extract:[3,6,11,13,36,63,87,109,117,119,121,198,199,292,365,387,396,419,441,467,474,486],extract_atom:11,extract_comput:[11,467],extract_fix:11,extract_glob:11,extract_vari:11,extramak:[12,15],extrapol:1,extrem:[1,3,6,17,58,193,208,218,220,255,324,395,454,490],extrema:415,extrins:203,f77:[5,7,12],f90:[5,7,12],f_1:6,f_5:[164,328],f_a:[453,454,455],f_ave:119,f_c:454,f_f:455,f_fix_id:289,f_harm:324,f_i:[29,430],f_id:[6,71,119,121,191,197,205,206,207,208,209,210,211,212,250,316,328,487,495],f_ij:430,f_indent:212,f_int:323,f_j:29,f_jj:91,f_k:430,f_langevin:326,f_max:[289,294],f_msst:253,f_r:[240,453,454,455],f_sigma:377,f_solid:324,f_ss:6,f_temp:[],face:[3,6,57,59,71,156,166,170,202,210,211,331,333,334,335,336,358,398,419,434,469,472],face_threshold:166,facet:166,facil:[0,12],facilit:[6,13,42],fact:[6,8,16,233,314,324,399,440,481],factor:[1,3,6,12,18,24,28,32,35,36,39,41,46,47,57,58,59,72,87,91,103,110,117,118,120,142,162,167,170,174,185,190,191,193,194,198,199,207,214,218,220,221,231,236,239,241,242,253,255,256,260,282,286,290,298,302,304,306,314,318,322,329,330,331,335,346,356,358,364,370,372,373,377,378,380,382,387,388,389,391,395,399,402,406,407,419,422,424,426,427,433,435,442,451,456,466,469,472,473,478,481,483,484,487,490,494,495],factori:[3,467],factoriz:355,fail:[3,11,12,59,172,218,221,355,363,365,389,433,467],failur:[123,437,468,495],fairli:[11,424,478,483],faken:73,falcon:236,fall:[3,6,194,209,285,467,495],fals:[86,337,339,440,495],fame:8,famili:[458,466],familiar:[0,11],fan:430,far:[3,6,12,17,57,59,61,86,191,194,195,214,215,216,218,221,255,280,298,299,314,331,342,346,361,365,366,457,467,469,474,487],farago:239,farrel:[453,455],farther:191,fashion:[6,8,41,71,168,194,197,198,199,204,210,214,216,221,231,233,237,252,253,255,257,258,259,260,261,262,263,271,274,275,276,277,278,288,289,291,299,303,307,313,316,324,326,330,331,332,334,336,365,402,416,472,481,495,498],fasolino:404,fast:[6,7,9,12,13,17,39,191,266,289,327,355,356,379,416,417,422,450,452,471,476,478,487,496,499],faster:[1,6,9,10,11,12,14,15,17,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,41,43,45,46,47,48,49,51,53,54,56,61,63,106,111,114,145,155,174,175,177,178,179,180,182,183,185,186,188,191,194,200,213,214,220,227,230,234,238,239,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,286,290,291,299,301,302,314,317,319,321,323,326,330,334,340,342,343,345,346,349,351,355,356,367,368,370,371,372,374,377,378,379,380,381,382,383,384,385,386,387,390,391,393,394,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,420,425,426,427,429,434,435,442,450,451,452,453,454,455,458,460,461,462,464,472,478,482,490],fastest:[1,6,14,17,156,210,326,327,370,466],fatal:[3,486],fault:[70,433],faulti:12,fava:398,favor:217,favorit:7,fbmc:321,fcc:[],fcm:[271,495],fdirect:224,fdotr:403,fdti:87,fe2:167,fe3:167,fe_md_boundari:203,featu:8,featur:[],fecr:393,feedback:[7,236],feel:[7,236,237,245,280,335,337,365,424],felling:421,felt:335,femtosecond:494,fene:[],fennel:[387,407],fep:[],ferguson:[6,174,481],fermi:[1,12,15,154,370,455],fermion:[9,395],fernando:418,ferrand:[9,13],few:[1,3,4,5,6,7,9,10,11,12,13,14,18,39,63,195,205,206,207,209,210,211,212,240,255,285,288,290,302,328,355,363,364,365,372,440,466,469,474,478,480,488,495,497],fewer:[1,3,11,15,16,61,245,478],fewest:3,fextern:229,feynman:282,fff:467,ffield:[386,396,432,433,440],ffmpeg:[3,12,193],ffplai:193,fft:[1,3,7,12,14,15,88,111,112,143,281,355,356,478],fft_inc:[12,356],fft_lib:12,fft_path:12,fftbench:[355,488],fftw2:12,fftw3:12,fftw:[11,12],fhg:[7,9],ficiti:449,fictiti:[6,200,201,226,229,233,282,298,387,407,411,449],field1:[470,474],field2:470,field:[],fifth:[311,426],figur:[1,3,8,11,12,289,466,467],fij:390,file0:280,file1:[11,13,280,325,339,364,474,476,480],file2:[11,13,325,339,364,474,476,480],file:[],file_from:192,filen:364,filenam:[3,12,13,38,41,56,188,191,193,194,195,203,206,207,208,209,210,211,212,214,219,280,284,287,290,291,292,295,296,299,300,325,326,352,353,354,364,365,371,372,377,387,393,394,396,404,419,420,421,426,430,431,432,433,440,441,451,452,453,454,455,458,465,466,467,470,471,476,480,487,495,497,498,499],filennam:476,filep:[3,191,194,471,476,499],filepo:296,fill:[7,9,168,193,285,326,358,366,377,422,433,472],filter:[194,203],final_integr:8,final_integrate_respa:8,finchham:[6,150,389],find:[0,3,4,6,7,8,11,12,13,14,16,38,39,56,61,71,73,87,119,171,188,195,204,217,218,228,231,254,280,286,294,298,361,363,365,366,387,402,407,411,419,440,450,452,490,495],find_custom:8,fine:[16,17,172,200,226,324,366,370,495],finer:[142,168,495],finest:355,finger:[168,190,252,472],finish:[6,11,41,214,339,352,354,355,367,369,370,457,474,495,496],finit:[],finni:[7,393,450],finvers:224,fiorin:[9,219],fire:[],firebrick:194,first:[0,1,2,3,5,6,8,9,11,12,14,15,16,17,21,38,39,41,42,45,46,54,56,57,59,61,62,71,81,88,91,104,105,106,108,114,118,119,129,132,135,136,140,143,153,156,162,164,166,167,169,170,171,175,188,191,192,193,194,195,197,198,206,207,209,210,211,212,214,217,220,231,232,237,242,252,253,254,255,280,282,287,288,289,291,296,299,302,303,311,312,314,315,316,323,324,325,326,328,332,337,339,340,347,358,363,364,365,366,369,370,371,372,375,377,378,380,382,384,386,387,393,395,396,399,400,402,403,404,405,406,407,411,416,417,419,421,422,424,426,430,432,433,440,441,449,451,452,453,454,455,458,462,464,465,466,467,469,470,471,474,476,478,481,482,483,486,487,490,495,496,497,499],fischer:[6,9,19,20,174,382,481],fit:[3,6,9,12,38,56,188,298,314,372,377,404,419,424,445,452,454,477,495],five:[73,154,289,364,377,420,469,483],fix:[],fix_adapt:[162,199,415],fix_atom_swap:[],fix_bal:62,fix_deposit:[3,204,285],fix_evapor:204,fix_flux:203,fix_gcmc:[204,364],fix_gl:233,fix_gld:233,fix_grav:285,fix_id:[3,218,253,255,257,258,259,260,261,262,263,286,289],fix_modifi:[],fix_mov:[190,332],fix_nh:8,fix_npt:233,fix_nvt:[204,231],fix_poem:[3,6],fix_pour:[3,221],fix_qbmsst:9,fix_qeq:[3,386],fix_rattl:302,fix_reax_bond:432,fix_rigid:[245,375],fix_saed_vtk:300,fix_setforc:8,fix_shak:302,fix_srd:3,fix_styl:260,fix_temp_rescal:320,fixedpoint:[218,255],fixextern:229,fixid:203,fji:390,flag1:[223,368],flag2:[223,368],flag:[3,8,11,12,14,15,16,17,40,66,74,75,81,86,89,90,94,104,105,107,120,163,167,171,191,193,194,195,212,217,219,223,236,239,243,245,251,252,281,288,299,311,313,314,321,325,334,337,353,356,364,368,369,370,372,401,406,419,422,449,464,466,467,469,470,471,473,474,475,479,495],flag_buck:381,flag_coul:[381,390,411],flag_lj:[390,411],flagfld:[379,416,417],flaghi:[3,379,416,417],flaglog:[379,416,417],flagn:223,flagvf:[379,416,417],flat:[6,326,331,332,336],flavor:[2,7,12],fld:[9,331,379,416,417],flen:373,flex_press:373,flexibl:[3,6,8,169,193,206,210,219,233,256,322,329,395,454,487],flip:[3,6,220,255,333,334],floor:495,flop:12,floralwhit:194,flow:[],fluctuat:[6,64,87,218,231,232,239,242,255,260,280,281,324,326,349],fluid:[],fluid_veloc:246,flush:[3,194,486],flux:[],flv:193,fly:[7,9,12,41,193,197,203,208,221,224,299,302,327,377,422,487,490],fmackai:9,fmag:222,fmass:282,fmax:[363,487],fmomentum:224,fmsec:[2,194,239,240,252,255,286,299,317,318,478,489,494,496],fname:354,fno:[12,16],fnorm:[363,487],fnpt:224,fnvt:224,foce:402,fock:373,focu:302,fogarti:[9,292,433],foil:[142,280,441],fold:[312,478],folk:7,follow:[0,1,2,3,4,6,7,8,9,11,12,13,14,15,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,35,36,38,41,42,43,45,46,47,48,49,51,53,54,56,59,63,64,70,71,73,91,92,97,98,108,115,118,119,121,142,143,146,147,148,154,156,161,164,166,168,169,174,177,178,179,180,182,183,185,186,188,191,192,193,194,197,203,204,205,206,207,208,209,210,211,212,214,219,220,221,224,225,229,231,232,233,236,238,239,240,242,245,253,255,260,261,262,263,274,275,276,278,281,282,284,287,288,289,290,292,294,296,298,299,300,302,316,317,318,319,322,323,324,325,326,328,329,337,338,342,343,344,345,346,349,351,353,358,360,363,364,365,370,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,389,390,391,392,393,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,423,424,425,426,427,429,430,431,432,433,434,435,437,439,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,456,457,458,460,461,462,464,466,467,469,470,472,474,476,477,478,481,483,484,485,490,495,496,498],foo:[4,8,11,12,191,193,229,467,480,495],foot:6,footprint:[12,370],fopenmp:[12,16,18],forc:[],force_uvm:17,forceatom:245,forcefield:[298,401],forcegroup:242,forcezero:361,ford:390,forestgreen:194,forev:71,forget:[240,490],forgiv:255,fork:[12,191],form:[2,3,6,8,12,19,22,44,54,63,66,74,75,77,81,87,89,90,92,94,104,105,107,118,142,143,162,163,172,176,194,197,198,199,216,232,233,239,241,245,252,276,281,292,294,298,299,326,331,335,340,341,344,349,360,362,364,365,372,373,377,384,393,395,397,401,402,406,418,419,421,422,426,427,430,432,433,434,440,441,442,450,452,453,454,455,461,463,466,467,469,474,479,486,490,495],formal:[6,78,80,91,232,233,239,255,282,314,322,440],format:[2,3,6,7,8,9,12,13,22,38,41,44,56,68,77,176,188,191,192,193,194,195,206,209,210,211,212,214,216,281,284,288,290,292,295,299,300,310,325,326,337,338,341,360,364,365,371,372,377,384,393,396,406,419,421,431,432,433,435,441,452,458,459,466,467,469,470,471,474,485,486,487,495,497],former:[6,12,16,39,41,194,214,326,330,377,379,475,481,495],formerli:[7,13],formul:[1,40,64,143,200,226,239,255,276,290,292,298,302,325,355,372,377,393,395,398,419,429],formula:[2,3,6,7,13,21,22,37,44,54,55,70,73,87,89,90,91,95,97,98,107,114,120,143,145,146,147,148,149,150,151,152,154,155,156,157,158,159,160,161,167,168,173,175,176,187,190,191,198,199,200,201,206,207,208,209,212,213,220,226,234,235,237,239,240,252,280,281,287,296,301,308,312,314,317,318,319,328,331,334,336,337,339,340,341,343,350,358,364,372,373,375,377,382,383,384,385,390,391,393,394,398,399,400,401,403,406,407,409,410,411,413,414,416,417,419,423,424,425,434,435,442,450,451,453,454,455,458,460,461,465,469,472,479,486,487,494,495,496],forth:[1,6,11,12,13,14,15,369,467,472,476],fortran:[3,6,9,11,12,13,229,393,402,419,432,433],fortun:8,forward:[3,8,87,354,365,370],foster:[377,429,430],foul:171,found:[3,6,9,12,73,162,191,217,219,231,236,242,281,321,327,339,354,366,384,387,390,464,470,471,486],four:[6,11,54,81,104,105,142,164,253,326,349,364,365,422,464],fourier:[],fourth:[6,106,298,311,321,382,426,440],fox:[6,120,174,448,481],fphi:[38,56,452],fpic:12,fplo:[38,56,452],fprime:452,fqdn:238,fqq:390,frac:[],fraction:[1,3,6,8,12,16,39,41,80,111,143,171,190,193,194,204,215,216,217,218,253,285,289,296,297,314,319,320,358,365,370,377,379,399,416,417,474,479],fragment:[42,236,296],fraig:[42,376],frame:[83,142,194,203,253,289,333,398],framer:[193,194],framework:[5,233,371,441],franc:9,fraunhof:9,free:[5,6,7,9,13,29,60,63,70,87,162,199,280,314,323,324,325,326,362,365,373,395,415,422,430,461,466],freedom:[3,6,8,95,97,98,100,102,103,114,145,146,147,148,149,150,151,152,153,154,155,156,157,158,160,161,206,217,224,231,233,239,240,245,255,256,260,261,262,263,274,275,276,278,282,284,299,302,317,318,319,324,363,390,487,490,496],freeli:[0,6,7,12,146,147,161,166,193],freez:[],frenkel:[231,324],freq:202,frequenc:[3,6,16,39,104,194,208,269,281,282,289,294,353,391,395,433,440,464,478,483,495,498],frequent:[3,64,67,70,72,73,77,88,92,108,142,194,215,216,228,322,329,424,476],fri:[253,289],friction:[4,5,6,10,42,197,233,239,289,294,299,326,330,332,376,399,479],friedrich:304,from:[],front:[253,289,333],frontend:[193,293],frozen:[6,114,172,230,232,240,366,397],fs2:[6,91],fscale:236,fstr:495,fstring:467,ftol:[363,365,464,483],fuchsia:194,fuction:387,fudg:302,fugac:231,fugacity_coeff:231,fulfil:6,full:[1,2,6,9,12,17,38,39,40,91,193,207,208,219,242,280,355,356,370,377,393,395,396,398,456,469,471,476,477,481,483,488,490,498],full_energi:[3,231],fuller:363,fulli:[3,6,9,78,233,238,280,363,365,387,430,431,497],fulton:393,fumi:378,func:[467,495],funcfl:393,functino:[],functionaliri:219,fund:[0,7],fundament:[314,494],funnel_flow:310,funrol:422,further:[3,6,8,12,13,61,63,71,86,106,109,118,193,194,197,206,209,210,211,212,215,221,225,242,246,282,290,300,304,314,326,328,337,356,361,363,364,365,366,371,375,386,422,440,464,483,484,495],furthermor:[27,177,395],furthest:61,futher:3,futur:[],g_ewald:3,g_ewald_6:3,g_ewald_disp:3,g_jik:430,g_p:326,ga3:167,gaa:377,gahler:362,gai:[3,398,450],gain:321,gainsboro:194,galindo:423,game:236,gamma0:29,gamma:[3,6,29,239,242,246,281,289,290,292,294,330,391,394,398,419,423,444,447,448,451,453,455,458,487],gamma_:[3,326,332],gamma_ijk:453,gamma_n:[332,399],gamma_p:[3,326],gamma_t:[332,399],gammaa:423,gammafactor:242,gammar:423,gan:[430,451,453,455,458],gan_sw:430,gan_tersoff:430,ganzenmuel:[7,9],ganzenmul:9,gao:[6,20,174,382,481],gap:[188,416,417,431,441],gap_2014_5_8_60_17_10_38_466:431,gap_exampl:431,gaseou:7,gass:231,gather:[11,477],gather_atom:11,gather_scatter_loop_unrol:12,gathert_atom:11,gauch:180,gaug:12,gauss:[],gaussian:[6,40,63,91,104,106,232,233,239,282,298,314,318,336,355,391,392,395,397,431,450,464,495,496],gave:[3,424],gaybern:[],gcc:17,gcmc:[],gcore:224,gd3:167,gdot:417,gdrude:224,ge4:167,gec:[453,455],gen:[255,256],gener:[],genom:7,gentler:[331,334,336],gentli:394,geom:[6,355,392,464,496],geometr:[3,6,7,8,42,57,59,71,158,159,168,170,191,194,200,210,211,213,214,221,226,235,255,261,262,263,274,275,276,278,299,301,308,317,318,319,335,337,355,358,365,375,376,379,383,385,387,390,395,398,400,407,408,409,410,411,412,413,414,415,416,417,418,423,424,434,442,456,457,460,461,469,472,479,487,495],geometri:[3,6,7,9,13,25,41,71,156,168,210,214,215,216,218,221,237,358,424,469,472],georg:[7,9],georgia:13,gerber:415,germani:[9,14],germann:[260,409,464,483],germano:398,gerolf:13,get:[],get_natom:[11,467],get_rank:11,get_siz:11,getenv:495,gettimeofdai:12,gewald:[6,355],gezelt:[387,407],gf100:14,gf104:14,gf200:14,gflop:12,gflp:12,ghost:[3,6,7,12,16,58,61,62,73,166,171,172,218,220,240,255,288,299,300,353,355,366,370,391,392,395,399,406,474,479,490],ghostwhit:194,ghz:10,giacomo:9,gif:[4,193],gifsicl:193,gigabit:18,gillan:441,gingold:[444,445,447],gio:2,git:[7,12],github:[13,17,219,233,238,431],give:[0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,54,71,92,108,115,148,151,155,168,191,194,200,202,206,207,209,212,218,220,233,255,276,280,281,286,294,296,299,328,355,356,363,366,367,370,372,377,392,395,401,402,419,422,424,434,453,454,455,464,466,467,469,479,483,490,496],given:[3,5,6,7,9,10,11,12,16,17,22,27,37,44,55,61,63,64,67,71,108,115,125,126,127,129,130,133,134,135,136,137,138,139,140,141,142,143,162,166,170,176,177,187,188,191,192,194,197,204,206,208,210,215,216,218,220,221,225,231,232,233,234,236,242,249,252,254,255,260,279,280,281,282,289,290,296,298,302,310,311,312,314,316,321,326,327,330,331,332,335,341,350,355,356,370,371,372,377,378,380,381,383,384,385,386,387,388,391,392,393,395,396,398,401,407,408,409,411,419,420,421,422,423,424,426,427,430,434,435,437,439,440,441,450,462,464,467,469,471,472,479,483,494,498,499],gjf:239,gjwagn:7,gko:2,gld:[],gle4md:[233,238],gle:[],glitch:3,glob:480,global:[],glosli:[356,422],glotzer:[299,391],glue:11,gmail:[7,9,13],gmake:[12,17],gmask:[3,495],gnu:[0,7,12,17],gnuplot:[11,13],goal:[5,12,39],goddard:[6,9,25,290,291,292,351,395,401,432,433,481],goe:[12,54,142,168,190,252,307,363,366,390,394,400,409,412,442,462,472,476],gold:[70,194],goldenrod:194,goldman:289,gone:3,good:[1,3,6,12,17,41,73,120,166,167,214,239,253,255,290,296,302,321,355,365,366,371,385,392,393,422,424,452,458,464,478,483,487],googl:236,gordan:142,gordon:6,gould:[6,174,481],gov:[0,7,9,13,371,393,396,494],govern:242,gpl:[0,7,8,12],gpt:[9,422],gpu1:370,gpu:[],gpuid:370,gpun:370,grab:[3,6],gracefulli:3,grad:[6,200,226,254],gradient:[6,7,8,12,13,124,129,218,226,234,235,254,276,291,322,326,361,362,365,417,433,452],gradient_correct:439,graduat:284,graft:217,grai:194,grain:[5,6,7,9,29,36,40,54,67,168,171,180,197,280,284,299,314,400,422,435,481],gram:[206,210,211,393,494],grama:[9,292,433],gran:[],grand:[3,197,204,231],granflow:5,granular:[],graph:11,graphen:473,graphic:11,grasp:5,gravit:234,graviti:[],grdient:203,great:[3,13,289],greater:[1,3,10,61,71,86,166,194,218,232,255,280,319,333,370,375,376,378,380,381,405,424,464,466,469,472,478,483,495,496],greathous:13,greatli:[120,483],green:[2,6,91,132,133,193,194,281,282,322,377],green_kubo:6,greenyellow:194,greffet:294,greg:[7,9],grest:[45,46,217,314,356,381,399,411,481],grew:71,grid:[3,12,41,62,120,156,167,170,214,242,294,314,326,327,353,355,356,463,466,469,471,473,478],grigera:6,grime:40,grmask:[3,495],gromac:[],gronbech:[239,355],groot:391,ground:[6,395],group1:[150,171,366],group2:[88,144,150,169,171,366],group2ndx:[],group:[],group_id:11,groupbig:314,groupid1:[245,299],groupid2:[245,299],groupid:469,groupnam:366,grouptyp:231,grow:[3,6,8,202,220,221,237,239,255,280,328,399,469,481],grow_arrai:8,grow_reset:8,growth:[6,321],grueneisen:9,gsmooth_factor:419,gstyle:[3,466],gtl:7,gtx285:14,gtx450:14,gtx460:14,gtx470:14,gtx560:14,gtx580:14,guarante:[65,69,79,93,110,117,168,171,191,225,290,354,358,479],guess:[3,191,286,470],gui:[7,11],guid:[1,17,40,78,80,100,101,102,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,197,248,249,304,305,306,307,310,327,429,437,439,443,444,445,446,447,448,479],guidelin:[1,8,14,15,16,17,18,19,355,452],guidlin:17,gullet:419,gulp:6,gumbsch:362,gunnel:422,gunsteren:[286,317,415],gunzenmul:7,gunzip:12,guo:[6,20,174,180,382,481],gwald:3,gyrat:[],gzip:[3,12,191,193,194,325,365,469,470,474],h12:398,h2o:[40,364],h5cc:192,h5md1:192,haak:[286,317],had:[3,6,11,13,59,63,191,194,195,209,212,217,218,232,233,235,239,240,241,253,255,257,258,259,260,261,262,263,274,275,276,278,285,286,314,317,318,319,326,391,392,399,449,471,475,478,484,487],hafskjold:6,half:[1,3,6,8,9,16,17,39,41,58,59,170,193,205,214,220,239,255,326,331,335,366,370,373,377,385,395,422,436,438,469,471,472,479,490],halfwai:[41,193,194,405],halperin:92,halsei:399,halt:[41,194,214,235,339,486],halv:193,ham:[38,56],hamak:[331,335,385,434],hamilton:70,hamiltonian:[233,255,256,318,395,478],hammond:[355,356],han:393,hand:[3,6,19,54,144,168,186,190,193,242,252,358,387,395,469,472,479,482],handl:[3,9,16,193,219,292,370,373,395,416,433,458,467,483],hang:[3,12,466,467],happen:[3,6,8,12,15,18,61,118,172,194,204,207,366,370,467,470,477],happi:8,haptic:236,hara:454,hard:[1,245,292,298,299,392,440,472],harden:[9,442],harder:[331,335,490],hardi:[203,240,355,356,490],hardwar:[1,12,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,43,45,46,47,48,49,51,53,54,56,111,114,145,155,174,175,177,178,179,180,182,183,185,186,188,200,213,220,227,230,234,239,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,291,299,301,302,317,319,330,334,340,342,343,345,346,349,351,355,356,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,420,425,426,427,429,434,435,442,451,452,453,454,455,458,460,461,462,472,482],hardwir:[3,17,332],hardy2:356,harm:373,harmon:[],harmonic_fix_wal:417,harpertown:18,harrison:372,hart:314,hartre:[373,393,395,422,494],hasan:9,hash:[39,469],hassl:298,hat:[6,10,254],have:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,41,42,43,45,46,47,48,49,51,53,54,56,57,59,63,64,65,66,67,69,70,71,72,73,75,77,81,86,90,91,92,94,104,105,106,107,108,111,114,115,116,117,118,132,142,143,144,145,146,147,148,149,151,155,157,160,161,163,164,165,166,168,169,170,171,172,174,175,177,178,179,180,182,183,185,186,188,190,191,192,193,194,195,200,202,204,205,206,207,210,211,212,213,214,215,216,217,218,220,221,226,227,228,230,231,232,233,234,235,236,237,239,240,241,242,245,250,252,253,255,257,258,259,260,261,262,263,264,265,269,272,274,275,276,277,278,280,282,284,285,286,288,289,290,291,294,297,299,301,302,308,310,314,315,317,318,319,320,321,325,326,327,328,330,331,332,333,334,335,336,337,338,339,340,342,343,345,346,347,349,351,355,356,358,361,362,363,364,365,366,367,370,371,372,373,374,377,378,379,380,381,382,383,385,386,387,390,391,392,393,394,396,397,398,399,400,401,402,403,407,408,409,410,411,412,413,414,415,416,417,419,420,421,422,424,425,426,427,429,430,432,433,434,435,439,440,442,451,452,453,454,455,457,458,460,461,462,463,464,466,467,469,470,471,472,473,474,475,476,477,478,479,481,483,484,486,487,488,490,494,495,496,497,498,499],haven:467,hayoun:294,hayr:239,hbcut:432,hbnewflag:432,hbond:[],hbond_cutoff:433,hcp:[64,67,73,358,419],hdf5:[9,192],he1:167,head:[6,21,175,340,397,401,432,433,484],header:[3,6,7,8,12,169,191,193,194,195,206,207,209,210,211,212,253,289,296,300,326,364,371,377,393,449,466,469,479,486],heal:478,heat:[],heatconduct:[],heavi:314,heavili:[41,214],heavisid:326,hecht:314,heenen:9,height:[193,221,285,365,397],heisenberg:9,held:[6,71,314,365,399],helic:180,helium:374,helix:[],hello:467,help:[3,8,12,14,15,16,17,18,19,191,218,220,253,353,377,453,455,497],henc:[1,3,13,20,21,26,32,35,36,70,71,110,148,150,158,175,206,255,292,314,330,331,335,337,340,342,346,349,356,387,397,415,430],henderson:53,hendrik:9,henin:[9,219],henkelman1:[254,365],henkelman2:[254,365],henkelman:[254,362,365],here:[1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,22,37,41,44,55,63,68,69,70,71,120,148,166,167,176,179,187,191,193,194,197,206,214,217,220,231,232,240,242,280,289,292,294,300,326,331,334,336,337,339,341,350,354,363,365,369,370,372,373,377,384,396,398,401,402,406,418,422,430,434,437,439,440,450,452,462,467,471,474,490,495],herist:327,herrmann:314,hertizian:332,hertz:[],hertzian:[6,332,399,450],hertzsch:399,hess:355,hessian:[5,362],heterogen:106,heurist:[327,470],hex:[3,168,358],hexagon:[67,92,419],hexat:92,hexord:[],hey:[112,143],hf4:167,hfo:386,hftn:[362,363,365],hg1:167,hg2:167,hgrid:314,hibb:282,hidden:[17,467],hienergi:337,hierarch:[7,478],hierarchi:[356,381,382,407,408,411,418,423,478],higdon:[9,416,417],high:[1,3,6,7,9,12,19,41,108,188,191,193,214,218,225,240,253,322,326,329,356,362,363,370,377,395,398,422,434,452,462,466,478,483,490],higher:[1,14,142,171,194,206,212,215,216,221,237,285,294,321,334,336,363,395,403,440,495],highest:[221,339,364,365,495],highli:[3,6,7,9,168,193,220,239,255,269,289,299,361,363,395,464,483],highlight:[6,7,10,13],hight:397,hilger:[355,356],hill:282,hill_height:13,him:9,hint:12,histo:[],histogram:[1,6,12,63,118,166,197,207,209,212],histor:396,histori:[],hit:[3,314,333],hmaktulga:[7,9],ho3:167,hoc:349,hocknei:[355,356],hofl:192,hoh:[6,387,407,411],hold:[6,33,59,71,181,206,220,247,283,298,299,311,363,365,399,415,461,480],holdem:298,holder2:356,holder:[355,356],hole:311,holian:[260,409],holm:[280,356],holonom:325,home:[11,12,195],homebrew:12,homepag:[193,236],homogen:[276,424],hone:282,honeydew:194,honor:195,hood:422,hook:[],hookean:399,hoomd:195,hoover:[6,7,8,158,197,224,239,240,255,256,257,258,259,260,261,262,263,274,275,276,277,278,282,286,294,299,317,318,319,324,391,490],hop:[217,365,377,440],hope:[5,13,17,41,42,214,477],hopefulli:[8,363],horizon:429,horn:6,host:[3,12,16,17,219,370],hot:[6,235,256],hotpink:194,hottest:322,hour:12,hourglass:[2,9,124],hove:419,how:[],howev:[1,2,3,6,7,9,11,12,15,16,17,36,39,41,71,88,91,105,120,142,167,188,191,193,194,207,208,212,214,217,218,221,224,231,232,233,238,239,240,241,242,245,255,280,282,285,288,289,294,299,300,314,315,317,318,321,322,326,327,328,329,330,356,358,360,361,365,370,383,385,393,394,399,402,419,422,428,430,439,451,452,455,464,466,467,470,471,477,483,486,487,490,495,496],howto:[6,63,71,145,146,147,149,151,154,155,156,157,158,160,161,197,239,240,255,286,317,318,319,387,401,407,411,496],hoyt:203,hpc:[1,15],hsw:17,htm:393,html:[0,4,8,11,12,15,144,238,397,417,478,479],htmldoc:0,htst:483,http:[0,6,7,9,11,13,14,15,219,233,236,238,371,393,416,431,432,433],htype:[387,407,411,415],hubbard:388,huge:[12,170,269,314,469,474,486],huggin:[7,378,380,450],hugh:203,hugoniostat:[4,197,260],hugoniot:[253,260,289],hull:166,hummer:355,hundr:[7,14],hura:6,hwloc:[12,17],hybrid:[],hydrat:397,hydrocarbon:[372,386,395],hydrodyanm:40,hydrodynam:[7,9,40,100,102,242,244,245,246,379,416,417,437,439,450,479],hydrogen:[3,6,7,228,294,372,377,387,395,401,407,411,415,432,433,450,469,478,490],hydrostat:[3,9,218,255,260,286,299],hynninen:[388,397],hyoungki:421,hyper:282,hyperbol:388,hyperspher:142,hyperthread:[16,17],i_0:326,i_1:430,i_csid:6,i_flag1:288,i_mpi_pin_domain:16,i_myflag1:288,i_myflag2:288,i_n:430,i_nam:[115,191,288,316,479],ialloi:419,iatom1:117,iatom2:117,iatom3:117,iatom4:117,ibar:419,ibead:282,ibm:[191,355,422],icc:[10,12,422],icm:[9,236],ico:64,icosohedr:73,ictp:13,id1:[299,365,406,469,472],id2:[299,303,311,365,406,469,472],id_press:[218,253,255,257,258,259,260,261,262,263,286],id_temp:[217,218,253,255,257,258,259,260,261,262,263,274,275,276,278,286,317,318,319],idea:[1,3,6,11,12,41,143,193,194,214,237,280,303,314,322,356,424,477,490],ideal:[6,9,12,40,73,118,124,224,231,280,358,416,444,490],idealga:[],ident:[1,3,9,12,39,40,71,142,191,194,209,218,219,232,233,239,240,252,255,280,282,286,294,296,299,356,364,365,370,378,380,387,389,393,407,409,415,426,432,433,440,441,458,462,464,467,470,483,494,495,496,498],identi:370,identif:67,identifi:[1,3,6,12,38,40,56,70,166,168,188,296,314,337,401,406,419,452,464,466,469,472,483,484,486,488],idl:[18,483],idn:[299,365],idr:495,ielement:419,ieni:13,ifdef:[8,12],iff:240,iffp:467,ignor:[3,6,11,16,41,42,61,71,83,87,99,109,121,172,191,193,194,198,199,207,208,209,210,212,214,218,219,220,221,231,234,238,239,252,255,260,266,271,286,287,288,298,299,300,314,317,318,319,325,326,328,331,335,336,337,347,357,360,364,365,370,371,383,384,385,393,394,396,398,405,406,419,426,430,434,451,452,453,454,455,457,458,464,466,469,470,474,479,481,483,486,495],ihl:314,iii:[6,9,25,290,292,351,401,481],ijj:458,ijk:[345,349,351,377,430,458,466],ijl:349,ikeshoji:6,ikj:458,ill:[148,158,206,290],illeg:3,illinoi:[236,355,356,416],illog:467,illustr:[1,6,8,11,12,16,17,18,19,280,282,365,402,467,495],ilmenau:[7,9,14],ilya:[7,9],imag:[],image2pip:193,imageint:3,imagemagick:[4,193],imagin:[311,325,377,394,402,403,405,420,421,426,430,451,453,454,455,458,481],imaginari:[6,92,231,282,469],imbal:[1,12,41,214,370,488],imbalanc:[41,214],imbu:314,imd:[],img:193,immedi:[0,2,3,8,12,168,215,216,221,302,310,315,316,333,466,467,469,471,483,495,498],immens:3,immers:[242,299],impact:[1,4,6,8,225,321,488],impart:[3,6,234,314,336],impei:[6,407],implement:[1,3,6,8,9,12,17,18,27,78,87,108,120,150,156,167,168,176,177,187,206,219,223,233,236,239,242,244,245,246,253,255,276,279,281,282,288,289,292,293,294,302,303,314,321,326,330,349,354,355,356,363,365,370,371,373,376,377,386,387,389,391,393,394,395,402,407,411,415,419,429,432,433,434,453,455,466,467,478,483,490,495,497],impli:[3,6,40,59,87,143,190,193,198,199,200,220,226,239,298,317,319,320,355,358,384,467],implicit:[],implicitli:8,implict:388,imporop:364,importannt:[],important:324,important_not:[],impos:[2,6,71,114,157,190,197,200,201,213,226,227,229,234,237,246,247,254,269,280,283,301,308,311,313,314,321,322,323,324,329,330,331,334,335,336,363,365,367,463,477],imposs:1,improp:[],improper_coeff:[],improper_styl:[],impropercoeff:3,impropertyp:216,imprort:98,improt:[198,199],improv:[0,1,9,16,39,41,194,214,255,281,370,401,407,422,424,433,451,454],in3:167,inaccur:[1,3,6,171,253,355],inaccuraci:335,inact:401,inappropri:168,incid:[120,167,221],includ:[],includig:[339,354],inclus:[],incom:236,incompat:[3,11,403],incomplet:[3,11,469],incompress:[256,395],inconsist:[3,172,217,470],inconveni:358,incorpor:[289,377,388],incorrect:[3,151,239,419],incorrectli:[3,358,399,495],increas:[1,3,6,10,18,38,56,57,59,111,120,143,188,191,193,194,208,215,216,217,220,231,239,286,297,298,299,322,325,329,355,356,365,370,395,398,433,452,454,467,478,483,495],increasingli:395,increment:[3,11,130,200,201,213,214,221,226,228,255,303,304,337,354,369,405,440,464,467,481,483,495],incur:[14,17,206,210,211,228,326,466],inde:151,indefatig:7,indefinit:323,indent:[],independ:[4,6,9,11,12,16,17,41,59,63,91,119,121,154,168,190,197,205,206,207,209,210,211,212,214,217,218,219,220,221,232,234,239,240,242,245,255,281,286,290,294,299,300,303,313,324,326,358,399,422,464,467,486,496],indetermin:[191,194],index:[0,3,6,8,11,12,38,39,40,56,68,69,119,121,166,188,191,194,205,207,236,238,282,300,326,337,338,339,360,369,424,432,433,452,459,469,484,495],indianr:194,indigo:194,indirectli:[6,495],indistinguish:239,indium:441,individu:[],induc:[],industri:7,ineffici:[3,6,40,64,67,70,72,73,77,92,108,142,156,193,220,255,281,355,367],inelig:204,inerti:417,inertia:[],inexpens:[233,478],inf:[2,3,12,329,472],infer:[3,95,97,98,162,200,201,214,215,216,226,236,284,314,322,329,358,384,396,469,481,487],infil:[3,13,299,466],infin:[3,363,474,487],infininti:193,infinit:[3,221,230,237,239,242,281,314,326,332,333,356,358,395,473,494],infinitesim:6,inflect:[388,409],influenc:[3,9,41,80,150,252,285,355,356,424,453,454,455],inform:[0,1,2,3,6,7,8,9,11,12,13,15,17,39,41,42,59,61,62,63,68,88,117,119,120,167,168,174,191,192,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,227,228,229,230,231,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,254,264,265,266,267,268,269,270,271,272,273,279,280,281,283,284,285,286,287,288,290,291,292,293,294,295,296,297,298,299,300,301,302,304,311,312,314,315,317,318,319,320,321,322,323,325,328,329,330,331,333,334,335,336,338,353,355,356,359,362,363,364,365,366,368,370,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,425,427,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,457,458,460,461,462,466,467,469,470,471,473,474,476,481,483,484,486,488,495,497,498,499],infrequ:[6,255,391,464,483],infti:[388,416,417],ingtegr:377,inher:[355,363,424],inherit:[6,456],inhomogen:[18,326,424],inidividu:363,init:[3,8,297,440],init_fil:326,init_list:8,init_on:8,init_styl:8,initi:[2,3,4,6,7,8,11,12,13,38,39,40,41,56,57,59,62,71,80,81,86,87,104,105,132,164,169,170,188,190,191,193,194,195,198,199,202,203,207,214,216,217,218,220,227,231,232,236,237,238,239,240,242,247,251,252,253,254,255,260,269,281,282,283,288,289,294,297,298,299,301,313,314,316,321,323,324,325,326,327,328,331,332,333,334,336,337,339,355,359,362,363,365,372,373,376,390,391,392,422,431,432,433,440,452,464,466,467,469,471,472,474,476,477,479,483,484,487,490,495,496,497,499],initial_integr:8,initial_integrate_respa:8,initialis:431,initialt:326,inlclud:11,inlcud:495,inlin:467,inner2:[382,400],inner:[3,8,16,191,237,339,354,361,362,363,365,369,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,427,429,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,459,460,461,462,478,483,495],inner_distance_cutoff:401,innergroup:245,innermost:[38,56,71,368,452,478],innernod:245,innner:413,inordin:327,inorgan:[6,458],inp:[219,339,441,458],input1:[65,68,69,79,93,110,115,116,117,119,121,316],input2:[65,68,69,79,93,110,115,116,117,119,121,316],input:[],input_doubl:3,inquir:304,insensit:12,insert:[3,5,7,8,12,59,168,197,221,231,237,285,355,441,449,467,473,490],insid:[2,3,6,8,11,71,131,137,168,191,194,205,210,211,221,222,228,231,237,242,245,285,299,314,331,333,334,335,336,337,353,358,409,467,468,469,471,472,479,483,495],insight:[6,13],instabl:[242,390,439],instal:[],instanc:[6,11,198,219,233,333,397,402,424,430,467,490],instantan:[6,63,217,218,232,233,255,260,281,286,289,294,296,299,321,475,487],instanti:[6,11,12,203,402,466],instead:[1,3,6,8,9,11,12,13,17,18,40,41,59,61,63,70,71,90,104,119,146,150,172,188,191,199,206,209,210,211,212,214,218,219,231,239,242,245,246,281,287,297,299,316,334,353,355,356,359,366,370,380,381,393,406,408,415,419,422,464,472,476,483,485,490,495],institut:[9,236,284],instruct:[],insuffici:[3,6,12],insult:255,insur:[3,6,11,12,17,39,40,61,73,103,105,168,169,188,191,193,194,200,215,216,221,226,227,228,229,231,234,239,251,287,288,297,299,314,326,331,335,336,337,339,354,364,366,370,385,398,402,428,434,452,466,467,469,470,474,477,478,486,487,495,496],int_max:3,integ:[3,6,8,11,12,39,40,42,64,68,70,71,108,115,117,119,121,142,166,168,171,172,174,178,179,183,188,190,191,193,194,204,206,210,211,215,216,217,221,223,229,231,232,233,236,239,240,241,242,281,284,285,288,289,294,299,314,316,318,321,325,326,345,355,358,379,391,392,405,419,432,433,437,439,441,464,466,467,468,469,477,478,479,483,486,495,496],integr:[],integrate_ulsph:[],intel:[],intel_cpu:[12,16],intel_phi:[12,16],intend:[3,6,8,12,13,36,208,232,431,469],intens:[1,3,6,9,63,66,74,75,86,89,90,91,94,104,105,106,107,114,116,118,119,120,121,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,163,164,165,167,197,206,207,209,210,211,212,214,215,216,217,225,228,235,245,253,255,260,296,299,300,314,322,326,328,329,486,487],intepol:495,inter:[14,18,42,61,62,148,171,172,191,217,239,241,254,291,299,355,365,377,479,490,495,497,499],interact:[1,3,6,7,8,9,10,11,12,14,15,16,17,22,29,33,37,39,40,42,44,50,54,55,57,61,63,65,69,72,77,79,87,88,92,93,108,109,110,112,114,117,118,124,125,126,127,129,130,131,132,133,134,135,137,138,139,140,142,143,144,146,147,161,162,166,169,170,171,172,173,174,176,180,181,187,191,197,198,199,215,216,217,230,231,236,237,239,241,245,269,280,282,284,290,292,298,299,305,306,314,315,321,326,330,331,332,335,336,341,342,343,344,346,350,355,356,363,364,365,366,367,368,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,427,429,430,433,434,435,437,439,440,441,442,449,450,451,453,454,455,456,457,458,459,460,461,462,464,467,469,471,473,474,478,479,481,486,487,490,497],interatom:[3,4,7,168,191,254,323,324,371,377,393,395,403,419,422,440,454,495],intercept:120,interchang:6,interconnect:18,interconvert:395,intereract:39,interesect:335,interest:[1,5,7,8,9,11,13,71,167,282,321,324,356,394,417,432,433,467,495],interf:370,interfac:[],interfer:[12,255,372],interg:[6,490],intergr:[478,482],interi:417,interior:[3,6,41,335,472],interlac:419,interleav:[6,168,477],intermedi:[6,12,59,193,254,280,349,365,467,468,477,481],intermix:464,intermolecular:372,intern:[0,2,3,5,6,9,11,16,20,21,24,28,32,35,36,39,40,42,63,87,100,102,120,143,148,150,167,175,188,193,194,197,198,199,203,216,220,224,236,248,249,253,255,260,281,299,303,340,342,346,349,353,363,364,443,444,452,467,469,471,474,483,486,487,494,495,496,497],internal_element_set:203,internal_quadratur:203,internet:238,interpenetr:419,interpentr:[444,445,447],interpol:[6,15,38,56,101,188,193,194,203,242,280,355,356,365,377,424,433,446,452,453],interpret:[2,6,11,193,209,399,442,464,467,483,495],interrupt:289,intersect:[3,6,120,194,335,337,472],intersert:335,interspers:363,interstiti:[166,422],intertia:[3,94],interv:[3,6,91,192,207,239,255,289,294,295,306,440,446,464,483,495],intestieti:120,intial:[6,370,372],intiial:[41,474],intiti:[3,313],intra:299,intra_energi:231,intramolecular:[29,231],introduc:[6,9,92,108,193,255,289,294,299,349,355,371,387,395,407,411,415,451,483,495],introduct:[],intsal:[],intuit:358,inv:[120,167,300],invalid:[3,12,71,89,171,269,365,416,417,471],invari:[108,135,140,142],invent:302,invers:[],invert:[1,6,172,281],invis:335,invoc:[166,217,370,437,439,467],invok:[1,3,6,7,8,11,12,13,14,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,41,43,45,46,47,48,49,51,53,54,56,59,63,66,71,74,75,81,87,88,89,90,94,104,105,107,111,112,113,114,119,145,155,162,163,166,168,169,171,172,174,175,177,178,179,180,182,183,185,186,188,191,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,222,223,225,226,227,228,229,230,231,232,234,235,236,237,239,240,241,242,243,244,245,246,247,248,249,251,252,254,255,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,290,291,292,293,294,295,296,297,299,300,301,302,303,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,340,342,343,345,346,349,351,354,355,356,357,358,363,365,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,396,397,398,399,400,401,402,403,407,408,409,410,411,412,413,414,415,416,417,420,424,425,426,427,429,434,435,437,439,441,442,451,452,453,454,455,458,459,460,461,462,463,466,467,468,470,472,474,477,478,480,481,483,486,487,490,495,496],invokd:3,involv:[3,6,7,8,12,63,110,117,118,119,148,172,197,204,215,231,242,284,287,292,314,355,362,363,365,375,392,398,405,451,453,455,465,466,472,474,478,483],ioff:[364,469],ion:[6,7,9,150,279,311,326,356,377,388,396,397,419,422,440,450,455,462,469,490],ionic:[6,9,378,380,388,395,396,427,440,490],ioniz:[9,386,395],ionocoval:9,iparam:[3,216],ipi:[],ipp:[],ir3:167,ir4:167,irregular:[6,41,58,214,218,220,255,299],irrelev:426,irrespect:[416,417],irrevers:224,is_act:495,is_avail:495,is_defin:495,isbn:461,isel:[355,356],isenthalp:[255,256,257,258,259],ismail:[355,356,381,411],isn:[3,8,11,12,235],iso:[3,218,224,240,255,256,257,258,259,260,261,262,263,286,294,299,490],isobar:[255,256,261,262,263],isodem:395,isol:[3,171,337],isomorph:282,isotherm:[231,255,256,261,262,263,286],isotrop:[6,92,239,286,355,356,379,398,416,417],isovolum:300,isralewitz:303,issu:[1,3,6,9,11,12,13,14,15,17,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,43,45,46,47,48,49,51,53,54,56,59,71,73,81,104,111,114,145,155,174,175,177,178,179,180,182,183,185,186,188,193,200,203,213,217,218,220,221,226,227,230,231,234,239,253,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,282,286,288,291,299,301,302,313,317,318,319,324,330,334,336,339,340,342,343,345,346,349,351,356,364,365,368,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,396,397,398,399,400,401,407,408,409,410,411,412,413,414,415,416,420,425,426,427,429,434,435,442,449,451,452,453,454,455,458,460,461,462,469,471,472,478,481,486,487,495,496],ital:[432,433],itali:13,item:[6,7,8,41,191,194,214],iter:[3,6,12,39,41,63,192,200,201,213,214,218,224,226,229,237,281,290,291,299,302,321,337,339,354,361,362,363,365,369,440,464,474,478,483,487,495],ith:[71,119,121,205,206,207,208,209,210,211,212,316,328,487,495],itself:[2,3,4,6,7,8,9,11,12,13,18,42,59,91,109,159,191,192,193,194,195,207,208,219,224,240,250,254,293,299,326,337,339,364,365,387,396,398,402,403,452,467,473,476,477,481,495,499],ityp:[3,117,118,168,202,216,292,459],itype1:118,itype2:118,itypen:118,ivector:8,ivori:194,ixcm:299,ixi:[42,94,299,364,495],ixx:[42,94,299,364,495],ixz:[42,94,299,364,495],iycm:299,iyi:[42,94,299,364,495],iyz:[42,94,299,364,495],izcm:299,izrailev:303,izumi:454,izz:[42,94,299,364,495],j0jt:91,j20:207,j_m:142,jac:[6,174,481],jackson:423,jacobi:3,jacobsen:362,jagreat:13,jame:[9,19],janssen:280,januari:419,jaramillo:[7,9,13,395],jarzynski:303,jatempl:9,jcc:9,jcp:331,jec:13,jeff:13,jello:255,jensen:[239,355],jeremi:[9,421],jerom:9,jewett:13,jiang:[240,490],jiao:[9,13],jiht:[7,9],jik:377,jim:7,jku:7,jmake:12,jmm:142,joannopoulo:253,job:[12,60,302,477],jochim:[255,256],john:[7,9,13,192],johnson:[9,13],join:[6,472],joint:[3,284,401],jon:[9,70],jonathan:9,jone:[1,3,6,7,9,10,12,13,45,46,64,87,109,112,197,203,286,314,331,335,356,358,363,372,375,380,381,382,383,385,390,398,400,401,402,405,406,407,408,409,411,412,414,415,418,423,424,430,434,435,445,450,457,481,490],jonsson:[73,254,362,365,440],jorgensen:[6,185,387,407,411],joul:494,journal:[162,180,203,292,356,393,422,432,433,444,445,447],jparam:[3,216],jpeg:[3,12,193],jpeglib:12,jpg:[4,8,12,191,193,194,498],jpg_inc:12,jpg_lib:12,jpg_path:12,jpl:[7,9],jth:495,jtype1:118,jtype2:118,jtype:[3,118,216,459],jtypen:118,judg:483,judici:6,julien:9,jump:[],june:195,just:[3,6,8,11,12,13,17,19,22,29,42,44,59,61,91,109,112,118,143,146,147,161,172,176,191,206,210,211,220,224,228,245,252,286,288,299,321,326,337,339,341,364,365,370,372,375,384,402,430,457,467,471,473,474,476,477,488,490,495,498,499],justo:394,jusufi:[388,397],jut:335,jzimmer:9,k11:91,k22:91,k33:91,k_2:344,k_4:344,k_b:[],k_d:490,k_n:376,k_na:376,k_sigma:377,k_ub:20,kadiri:67,kalia:458,kamberaj:299,kapfer:108,kappa:[6,91,322,387,407,460,461],kappa_:326,karplu:87,karttunen:242,kate:[],kayser:388,kbit:194,kboltz:314,kbp:194,kbt:294,kcal2j:91,kcal:[236,478,490,494],kde:13,ke_eta_dot:255,ke_etap_dot:255,ke_omega_dot:255,keblinski:[387,440],kecom:148,keef:120,keep:[3,7,12,59,71,186,210,216,220,237,281,297,324,329,355,363,387,415,441,464,469,475,477,483,487,495],keflag:3,kei:[6,17,59,314,458,483],keir:13,kelchner:70,kelkar:329,kelvin:494,kemper:[291,386],kepler30:17,kepler32:17,kepler35:17,kepler37:17,kepler:[1,12,14,15,17,370],kept:[6,197,260,323,324,490],kernel:[7,13,17,40,101,131,137,203,232,233,306,422,443,444,445,446,447,448,479],kernel_radiu:469,keword:193,keyboard:12,keyword:[],keywrod:395,kforc:490,khaki:194,khersonskii:142,kick:[200,201,202,226,333],kilogram:494,kim:[],kimviri:[3,403],kind:[1,2,3,6,7,8,9,11,12,17,39,40,41,42,61,62,63,73,119,121,148,191,193,197,204,206,207,209,214,217,219,223,231,234,252,299,302,314,321,336,365,367,369,377,395,432,433,459,464,468,469,474,475,482,483,490,495],kinemat:[9,416,417],kinet:[3,6,8,9,63,82,83,84,85,87,91,95,96,97,98,99,114,143,145,146,147,148,149,150,151,153,154,155,156,157,158,160,161,197,204,206,218,224,231,235,239,251,253,255,256,257,258,259,260,261,262,263,286,289,314,322,329,330,363,395,464,483,487,490],kiss:12,kjl:349,klahn:325,klapp:355,klein:[6,9,203,219,255,256,277,299,407,435],kloss:7,kmax:[3,120,300,355],knc:17,knock:326,know:[3,11,12,41,63,109,118,197,224,238,240,269,314,363,394,403,456,467,470,473,478,490],knowledg:[4,8,193,403],known:[3,12,142,193,281,290,299,323,466,483,496],kohlmey:[7,9,13,18,355,356],kokko:[],kokkos_arch:17,kokkos_cuda:[12,17],kokkos_cuda_opt:17,kokkos_debug:17,kokkos_devic:17,kokkos_omp:[12,17],kokkos_pg:17,kokkos_phi:[12,17],kokkos_use_tpl:17,kolafa:356,kollman:[6,174,481],kondor:431,kone:[323,324],kong2011:281,kong:[9,13,281],konglt:9,koning00a:323,koning00b:323,koning96:[323,324],koning97:324,koning99:323,kooser:13,koskinen:362,kosztin:303,krau:13,kremer:[45,46,481],kress:[420,421],kspace:[],kspace_modifi:[],kspace_styl:[],kspce:12,kspring:254,kstart:298,kstop:298,kth:[232,282],kub:20,kubo:[6,91,322],kumagai:454,kumar:[9,416,417],kuronen:430,kurt:284,l12:419,l_box:395,l_skin:326,la3:167,laa:9,lab:[5,7,9,12,113,429],label:[],laboratori:[0,253,289],lack:[3,253,395],lackmann:377,ladd:[276,324],lafitt:423,lag:326,lagrang:[132,133],lagrangian:[6,124,125,126,127,129,130,131,132,133,134,135,137,138,139,140,203,253,289,290,305,306,437,439,490],lagrangian_posit:[253,289],lagrangian_spe:[253,289],lai:463,lambda1:[453,454,455,458],lambda2:[453,454,455],lambda3:[453,455],lambda4:458,lambda:[87,113,120,162,167,242,300,323,324,326,371,394,415,451],lambda_fin:323,lambda_initi:323,lamda:[3,53,314],laminar:448,lamm:6,lammps2pdb:[6,13],lammps_clos:6,lammps_command:6,lammps_extract_atom:6,lammps_extract_comput:6,lammps_extract_fix:6,lammps_extract_glob:6,lammps_extract_vari:6,lammps_fil:6,lammps_gather_atom:3,lammps_get_coord:6,lammps_get_natom:6,lammps_n:[6,12],lammps_open:6,lammps_potenti:[384,386,480],lammps_put_coord:6,lammps_quest:[6,229],lammps_scatter_atom:3,lammps_set_vari:6,lammps_sppark:6,lammps_vers:6,lammpsplot:13,lammpspotenti:384,lammpstrj:[470,474,490],lammpsviri:[3,403],lamoureux:[6,224,456,490],landron:440,lane:1,lang:490,langevin:[],langevin_drud:[],langston:[42,376],languag:[6,11,12,17,467,495],lanl:9,lapack:12,laps:327,laptop:7,larg:[0,1,3,5,6,7,8,9,10,12,13,14,16,18,39,40,41,58,59,70,71,111,118,143,148,151,156,168,169,170,180,188,190,191,193,194,206,210,211,214,217,218,220,221,225,231,242,255,269,276,281,284,285,289,294,296,297,298,299,302,311,314,322,326,327,329,331,335,349,355,356,361,363,366,370,385,391,395,398,399,406,422,424,428,434,452,464,467,469,471,472,476,478,483,486,488,490,496,499],larger:[1,2,3,6,11,12,13,39,41,56,59,70,71,118,168,170,193,207,209,212,221,235,242,255,276,277,285,290,294,298,299,300,310,314,321,326,330,331,332,335,355,356,361,362,363,365,366,367,370,377,385,387,388,395,399,407,411,417,424,428,449,450,457,469,473,474,477,478,483,495],largest:[3,6,12,39,71,166,168,225,355,363,367,449,452,469,471,477,478,489,495],laroch:294,laser:326,last:[1,2,3,5,6,11,12,15,38,42,56,59,61,71,112,119,143,166,188,191,193,194,195,196,206,207,209,210,211,212,214,225,254,297,300,311,314,339,353,363,364,365,366,370,374,375,376,377,378,385,386,391,393,397,398,400,401,405,408,410,412,413,414,417,423,425,434,440,442,449,452,456,457,460,461,464,465,467,470,474,476,477,481,483,484,487,488,495],lat:419,late:5,latenc:[10,236],later:[6,9,11,12,16,17,40,59,71,105,170,172,207,221,260,276,284,303,321,337,339,355,363,364,369,370,372,377,467,469,471,473,483,486,495,497],latest:[7,206,207,208,209,210,211,212,300,471],latex:8,latgen:281,latitud:142,lattc:419,latter:[2,6,11,12,14,15,16,17,41,42,87,146,194,198,199,205,206,210,211,214,218,237,246,255,257,258,259,261,262,263,284,286,288,292,299,314,330,335,354,364,377,379,380,381,382,383,390,405,407,411,415,422,427,435,440,456,464,466,467,472,475,486,495,498],lattic:[],launch:[1,3,6,11,12,17,18,370,466,467],laupretr:349,lavend:194,lavenderblush:194,lavgevin:220,law:[6,253,368,437,439],lawngreen:194,lawrenc:9,layer:[6,9,71,197,210,322,326,329],layout:[1,3,17,170,353,466,469,478],lb_fluid:242,lbl:[7,9,166],lbnl:9,lbtype:242,lcbop:[],ld_library_path:[11,12],ldfftw:12,ldrd:7,lead:[2,3,6,12,22,25,39,41,44,59,61,77,87,118,162,166,172,176,194,198,199,209,214,221,233,242,260,289,299,302,314,321,322,329,341,349,355,360,365,370,384,387,407,411,413,422,439,463,469,479,490,495,496],least:[3,6,12,18,71,120,167,192,204,210,233,284,288,330,366,370,376,402,452,457,467,495],leav:[3,7,11,12,17,21,41,57,143,158,175,214,218,221,255,257,258,259,261,262,263,286,299,302,340,424,469,473,481],lechman:314,lectur:303,led:[3,5],lee2:419,lee:[203,419],left:[6,11,12,41,109,144,187,193,194,217,237,279,314,337,339,358,469,471,476,495,499],leftmost:[41,214],legaci:12,legal:7,lehoucq:429,leimkuhl:334,leiu:391,lemonchiffon:194,len:479,lenart:[388,397],length:[3,6,8,11,12,18,21,38,39,40,41,42,44,53,54,55,56,58,59,61,65,68,69,71,74,79,80,82,87,88,89,90,91,93,104,106,109,110,114,116,117,119,120,121,130,132,145,146,147,148,149,150,151,152,153,155,156,157,158,159,160,161,164,166,167,170,175,188,191,193,194,197,204,208,209,211,212,214,215,216,217,218,220,231,234,242,253,254,255,256,260,269,280,286,296,299,300,302,311,314,321,325,326,328,331,335,356,358,361,363,365,366,368,373,376,377,378,380,387,388,392,395,397,401,405,407,419,424,432,433,443,452,453,460,461,469,472,477,479,486,487,490,495],lengthi:231,lennard:[],lenoski:[420,421],less:[1,3,6,13,14,15,16,17,18,38,41,56,57,58,59,71,76,92,108,110,117,118,146,147,161,188,194,206,209,210,211,212,214,216,217,218,220,221,228,237,253,255,280,292,294,300,314,333,334,336,356,358,363,367,370,377,382,398,399,405,416,417,424,434,451,452,455,461,469,495,496],let:[1,11,12,38,56,151,179,188,207,302,314,332,370,385,452,478,482,490,497],lett:[142,156,233,240,242,253,294,303,323,324,362,377,393,395,398,415,441,490],letter:[2,9,12,41,57,59,194,214,223,224,240,282,339,369,431],leuven:9,level:[2,3,8,11,12,14,17,191,193,198,199,208,236,252,254,255,339,353,356,369,377,381,382,407,408,411,418,422,423,432,433,466,478,483,488,495],lever:449,levin:399,lewi:304,lexicon:7,lgr_po:[253,289],lgr_vel:[253,289],lgvdw:433,li1:167,liang:386,lib:[1,3,9,11,12,14,15,17,293,370,386,403,467,470],libatom:[9,431],libcolvar:12,libdir:11,libfftw3:12,libgpu:15,libjpeg:12,liblammp:[11,12],liblammps_foo:[11,12],liblammps_g:[11,12],liblammpscuda:14,libmpi:11,libmpi_stub:12,libmpich:12,libpackag:12,libpng:12,librari:[],librt:17,licens:[0,7,8,12,193],lie:[6,300],lieu:355,life:7,lifo:8,ligand:311,liggght:7,lightblu:194,lightcor:194,lightcyan:194,lightest:321,lightgoldenrodyellow:194,lightgreen:194,lightgrei:194,lightli:311,lightpink:194,lightsalmon:194,lightseagreen:194,lightskyblu:194,lightslategrai:194,lightsteelblu:194,lightweight:314,lightyellow:194,like:[3,4,6,7,8,9,11,12,14,16,17,18,39,42,54,59,152,159,193,195,200,218,219,221,224,226,236,239,240,241,253,255,256,261,262,263,268,269,274,275,276,277,278,280,286,288,289,290,294,299,300,314,316,317,318,319,320,321,322,329,330,331,334,335,336,339,355,358,362,365,370,377,385,390,391,395,396,399,401,402,412,413,419,441,452,455,460,461,466,467,469,470,471,472,474,479,484,487,488,490,495,496],likelihood:[120,167,217],likewis:[1,6,10,12,15,16,18,39,41,71,88,117,203,214,215,216,231,239,240,255,256,260,277,294,314,317,318,319,356,365,371,375,377,387,393,396,422,450,467,469,471,481,495],likhtman:208,lime:194,limegreen:194,limit:[],limit_eradiu:395,limit_veloc:[305,306],lindahl:355,line:[],linear:[],linearli:[10,119,194,220,281,331,333,334,336,364,365,367,469,495],lineflag:[6,469],lineforc:[],linen:194,linesearch:[8,12,361],ling:[9,13],lingo:[11,403],link:[5,6,7,8,9,11,12,13,14,15,17,22,37,44,55,63,176,187,193,197,216,236,240,284,293,295,303,311,341,350,373,384,419,431,432,433,450,456,467],linker:12,linkflag:[12,16,18],linux:[10,11,12,15,193,195,236],linuxamd64:470,liouvil:255,lip:13,lipid:[4,9,10,13,29,299],lipton:284,liquid:[6,7,9,29,39,40,41,59,87,92,143,154,166,214,218,220,231,255,286,289,294,321,390,422,424,427,454,478],lisal:449,lism:9,list:[],listen:[236,238],listfil:406,liter:[469,480],literatur:[6,8,419,440,451],lithium:395,littl:[1,3,12,64,255,366,464,472],littmark:[419,450,455,462],liu:[401,433],livermor:9,lj1043:[],lj126:[],lj12_4:435,lj12_6:435,lj1d:281,lj6:3,lj93:[],lj96:[],lj9_6:435,lj_flag:372,llnl:[5,7,9],lmp1:11,lmp2:11,lmp2arc:[],lmp2cfg:[],lmp2vmd:[],lmp:[11,467,490],lmp_auto:12,lmp_cuda:[14,17],lmp_foo:12,lmp_g:[6,11,12,13,17,354],lmp_gpu:15,lmp_ibm:[12,354],lmp_inc:12,lmp_intel_cpu:[],lmp_intel_phi:[],lmp_kokkos_cuda:17,lmp_kokkos_omp:17,lmp_kokkos_phi:17,lmp_linux:[4,6,12],lmp_mac:12,lmp_machin:[1,12,14,15,16,370],lmp_mpi:[12,17,18,19,282],lmp_mvapich:17,lmp_omp:[],lmp_openmpi:17,lmp_opt:[],lmp_win_mpi:12,lmp_win_no:12,lmpptr:[11,467],lmpqst:229,lmpsdata:13,lmptype:[3,12,229],load:[1,3,4,6,7,9,11,12,16,17,18,41,193,195,197,214,236,289,370,386,466,467,488],loadabl:11,loca:194,local:[],localhost:236,localized_lambda:203,localonli:12,localvector:63,locat:[3,6,8,9,11,12,27,61,118,120,166,167,177,188,191,221,222,242,313,324,335,361,384,387,396,397,407,409,411,456,466,469,470,472,479,481],lock:[3,369,495],lockstep:[218,255,286,299],log:[],logarithm:[138,139,495],logfil:[0,3,6,12,287,359,465],logfreq2:495,logfreq:[194,476,485,495],logic:[7,11,12,17,41,168,214,337,339,464,466,467,470,478,483,495],lomdahl:[260,409],london:[13,231,433],lone:[432,433],longer:[1,3,6,8,12,13,54,118,191,194,205,206,207,208,209,210,211,212,215,231,239,280,284,289,299,302,321,331,335,337,361,370,372,399,440,466,474,478,483,492],longest:[41,214,215,366,457],longitudin:311,look:[1,3,6,8,11,12,18,54,61,191,193,196,384,441,452,490,495],lookup:[3,39,188,424,452],lookup_t:300,loop:[3,4,6,7,11,12,18,39,42,65,68,69,79,88,93,110,117,118,143,193,206,210,211,215,216,225,321,337,339,354,357,363,365,366,368,369,392,422,440,464,465,467,473,474,477,478,483,488,489,495,496],loopa:[339,354,369],loopb:[339,354,369],loopmax:440,loopvar:495,lopez:[255,256],lorant:290,lorentz:167,lose:[6,58,59,170,218,220,240,255,399,469],loss:[6,494],lossi:193,lossless:193,lost:[3,12,13,57,103,221,297,304,314,424,469,470,471,478,486],lot:[18,303,355],low:[1,3,6,7,12,41,151,166,191,193,214,224,240,276,294,299,322,329,356,422,433,452,461,483,490],lower:[2,3,6,9,11,12,41,57,59,71,88,144,157,190,193,194,207,208,209,210,211,214,218,224,236,239,240,242,255,289,294,322,329,331,332,337,338,355,358,369,388,419,483,491,493,496],lowercas:193,lowest:[142,339,364,479,483,484,495],ls_:136,lsfftw:12,lsurfac:326,lu3:167,lubric:[],lubricateu:[],lubricuteu:266,lucki:12,luigi:13,lumped_lambda_solv:203,lussetti:322,lustig:[7,13],lybrand:356,lyulin:349,m4v:193,m_c:[],m_d:490,m_eff:[332,399],m_fill:3,m_i:312,m_lambdai:429,m_taubi:429,m_u:242,m_v:242,m_yield_stress:429,mac:[12,14],mac_mpi:12,mach:[9,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,304,305,306,307,310,479],machin:[1,3,4,6,7,9,10,11,12,14,15,16,17,18,19,191,193,236,255,327,355,361,363,368,370,422,466,471,476,477,478,496,499],mackai:[9,242,244,245,246],mackerel:[6,20,174,240,382,481,490],maco:193,macro:17,macroparticl:392,macroscop:[7,234,253,429],made:[3,6,11,12,15,16,33,41,42,50,64,169,181,191,193,195,197,198,199,204,214,221,225,236,245,285,293,297,299,324,337,347,366,370,398,399,402,432,434,442,466,473,479,482,491,493,496,497],madura:[6,407],magazin:393,magda:331,magenta:194,magic:[3,11],maginn:[162,329],magnitu:316,magnitud:[6,70,106,110,115,144,168,190,191,194,221,222,234,235,237,239,303,311,313,314,321,332,356,363,390,399,479],mai:[0,1,2,3,6,7,8,11,12,13,14,15,16,17,18,29,38,39,40,41,56,58,59,61,63,65,68,69,71,79,86,87,88,89,90,92,93,103,104,106,108,109,110,111,112,114,115,116,117,119,120,121,142,143,146,147,148,156,157,161,162,166,167,168,169,170,171,172,187,188,190,191,192,193,194,195,197,198,199,200,202,204,206,207,208,209,210,211,212,213,214,215,216,218,220,221,224,225,226,228,231,232,233,235,236,237,239,240,241,242,243,245,250,251,252,253,255,256,260,269,272,281,282,285,286,287,288,289,290,291,294,296,297,298,299,300,301,302,303,305,306,308,314,316,317,318,321,322,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,353,354,355,356,358,361,362,363,364,365,366,367,368,370,373,375,377,385,391,395,399,402,403,405,413,415,417,419,420,421,422,424,432,433,435,441,449,452,458,462,464,465,466,467,469,470,471,472,473,474,475,476,477,478,479,481,483,486,487,490,495,496,497,499],mail:[3,7,9,12,337],main:[3,6,8,11,12,236,242,299,323,324,393,440,456,467,484],mainboard:1,mainli:[370,427],maintain:[8,9,13,39,153,216,220,276,314,327,362,371,393,478,481],major:12,make:[],makefil:[3,7,9,11,12,13,14,15,16,17,18,19,191,356,370,422,467],makelist:12,maks:399,malloc:[3,12],manag:[5,8,12,191,236,282,316,478],manbi:441,mandadapu:203,mandatori:[8,191,219],manh:377,mani:[1,2,3,4,5,6,7,8,9,12,13,14,15,16,17,18,38,39,41,42,56,61,63,68,71,88,91,103,104,118,144,148,168,169,188,190,191,192,193,194,195,197,198,199,200,204,205,206,207,208,209,210,211,212,214,215,216,217,218,220,221,228,231,232,235,236,242,243,251,253,255,256,260,269,279,280,281,285,288,290,291,292,294,296,299,300,302,314,325,326,328,337,339,355,363,365,366,368,370,384,386,392,395,397,401,402,440,441,450,452,453,455,467,469,471,473,474,476,477,478,479,481,482,483,484,488,495,496,499],manipul:[12,41,214,236,387,430,480],manner:[2,3,6,9,11,17,41,143,164,193,198,199,200,201,209,214,220,225,226,229,235,239,240,255,261,262,263,274,275,276,278,293,317,318,319,322,323,324,329,331,335,339,356,364,365,369,370,393,395,402,405,416,457,464,466,469,470,471,472,474,478,483],manolopoulo:238,mantissa:3,manual:[0,1,3,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,43,45,46,47,48,49,51,53,54,56,58,63,68,71,111,114,120,145,146,147,149,150,151,154,155,156,157,158,160,161,167,174,175,177,178,179,180,182,183,185,186,188,191,193,195,200,210,213,220,227,230,234,238,239,240,254,255,257,258,259,260,261,262,263,264,265,267,270,272,273,274,275,276,278,286,288,291,299,300,301,302,317,318,319,329,330,334,339,340,342,343,345,346,349,351,356,365,369,370,371,372,374,375,378,379,380,381,382,383,385,386,387,389,390,391,393,394,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,420,425,426,427,429,434,435,442,451,452,453,454,455,458,460,461,462,464,472,478,482,483,484,487,495],manybodi:[3,7,8,9,12,143,144,363,371,372,377,386,393,396,402,404,426,430,451,453,454,455,458,481,495],map:[2,3,11,12,17,18,39,59,64,71,120,124,142,156,167,168,190,193,194,203,210,281,298,355,356,358,365,371,372,377,386,393,394,396,402,403,404,419,420,421,424,426,430,431,432,433,440,441,449,451,452,453,454,455,458,466,469,471,483,495],map_fil:281,mapflag:12,mara:[9,440],march:419,margin:483,mari:13,mark:[400,415,437,439,440],marker:287,maroon:194,maroonmpi:11,marrink:400,marsaglia:[3,232,233,239,240,294],marseil:9,martin:[281,419],martinez:204,martyna:[255,256,299,478],mashayak:17,mask:[3,280,495],mask_direct:203,mass:[],mass_matrix:203,massdelta:302,massiv:[0,193,242,282,322,329],massless:[6,240,356,387,407,411,415,490],masstot:299,master:[3,365,464,483],mat:[67,203,386,454],match:[3,6,8,9,11,12,17,38,41,56,59,71,118,151,188,194,195,214,217,220,236,255,256,276,296,300,314,321,355,356,377,401,413,419,431,432,433,452,463,467,469,470,471,474,478,483,490,495],matchett:[42,376],mater:[73,371,421,430,440],materi:[6,7,9,59,70,126,127,171,202,203,220,231,237,253,280,286,294,322,326,332,387,393,394,395,399,403,419,420,422,429,432,433,436,437,438,439,464,469,483,490,494],material_fil:203,math:[],mathemat:[120,142,167,168,190,198,199,200,201,213,218,226,232,234,235,237,239,240,287,301,308,317,318,319,331,334,336,441,465,472,479,496],mathrm:[],mathtt:[],matlab:[],matric:[9,142,233,281,398],matrix:[3,6,9,91,166,207,218,233,281,290,355,358,422],matter:[6,9,12,39,57,59,71,150,210,326,366,372,389,393,395,419,435,440,453,455,458,462],mattson:[114,143],max2theta:167,max:[3,6,8,12,15,18,71,119,194,209,214,216,218,221,285,302,314,339,358,361,363,365,366,370,440,464,469,483,487,495],max_alpha:8,max_cell_s:392,max_group:3,max_nn:306,max_travel:307,max_vel:[305,306],max_veloc:306,maxangl:231,maxbodi:3,maxbond:[3,216],maxedg:166,maxev:[363,464,483],maxfoo:8,maxim:[321,365],maximum:[3,6,8,12,15,17,25,41,42,45,53,54,57,59,61,92,108,118,119,120,123,166,167,169,170,190,191,202,207,208,209,214,216,220,221,225,231,269,280,285,290,302,304,305,306,314,327,355,356,361,365,366,370,373,377,392,397,416,417,440,469,472,477,487,495,496],maxit:[290,363,464,483,487],maxsize_restart:8,maxwel:[17,279],maxwell50:17,maxwell52:17,maxwell53:17,maxx:430,mayb:13,mayer:[7,378,380,440,450],mayo:[6,7,13,25,351,401,481],mbt:175,mbyte:[12,294],mcdlt:[158,235],mcgraw:282,mdash:490,mdatom:231,mdf:[],mdnvt:231,mdregion:203,mdtemp:231,mdump:[41,214],meain:[],meam:[],meam_sw_splin:421,meamf:419,mean:[1,2,3,4,6,7,8,10,11,12,17,22,34,37,38,39,41,42,44,52,54,55,56,57,59,61,63,68,71,72,76,77,82,84,85,87,91,92,104,105,106,108,114,115,116,117,118,119,142,143,145,146,147,149,150,151,154,155,156,157,158,160,161,162,168,169,171,172,174,176,184,187,188,189,190,191,193,194,195,197,198,199,202,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,226,229,231,232,233,234,235,237,239,240,241,245,252,255,257,258,259,260,261,262,263,269,274,275,276,278,280,282,284,285,286,288,294,296,297,299,301,302,303,308,311,314,316,317,318,319,321,322,325,326,328,329,330,331,332,333,334,335,336,337,341,342,343,344,346,348,350,355,356,358,360,361,363,364,365,366,368,370,373,378,380,381,382,384,387,391,392,393,395,398,399,401,402,405,407,408,411,418,419,423,424,427,428,430,432,433,434,435,449,451,452,453,454,455,457,461,463,464,466,467,469,470,471,472,473,474,475,476,477,478,479,480,481,483,484,486,487,490,494,495,496,497,499],meaning:[118,126,127,129,132,136,402],meaningless:[67,321],meant:[6,299,456,473],measur:[],meaur:488,mech:429,mechan:[6,8,9,11,12,16,17,128,144,203,235,282,293,377,395,403,409,422,437,439,463,467,469],mechanic:293,mechanim:124,meck:108,media:193,medium:461,mediumaquamarin:194,mediumblu:194,mediumorchid:194,mediumpurpl:194,mediumseagreen:194,mediumslateblu:194,mediumspringgreen:194,mediumturquois:194,mediumvioletr:194,mee:321,meet:[3,12,169,193,194,216,217,327,474],mehl:371,mei:418,meloni:39,melros:[416,417],melt1:195,melt2:195,melt3:195,melt:[4,10,217,281,377,422,454],mem:15,member:[171,284,377],membran:[29,279,461],memori:[1,3,5,6,7,8,9,12,15,16,17,18,39,40,60,71,194,206,208,210,211,232,233,294,326,353,366,370,377,424,428,433,466,469],memory_usag:8,mendelev:393,mention:[1,6,7,11,40,42,220,235,242,260,331,358,365,372,432,433,471,495],menu:[193,236],mep:[254,365],mer:[4,10,217],meremianin:142,merg:[3,5,469],merz:[6,174,481],mescscop:429,mesh:[1,2,3,6,7,8,10,12,40,41,42,120,136,167,203,214,242,300,310,355,356,392,422],meshless:9,meso:[],meso_:[],meso_cv:479,meso_rho:[],meso_t:[],mesocop:40,mesoscal:7,mesoscop:[7,100,101,102,248],mess:[3,479],messag:[],met:[8,41,118,214,339,354,356,363,365,369,457,477],metadynam:[9,13,219],metal:[3,5,7,9,10,40,59,71,157,168,202,203,210,211,220,221,235,237,289,290,294,330,331,333,334,336,356,358,367,371,372,377,386,393,394,395,396,402,404,419,420,421,422,430,431,440,451,453,454,455,458,472,486,487,489,494],meter:[367,494],methan:[289,294],methanol:4,methin:349,method:[1,3,5,6,7,8,9,11,12,13,16,17,19,38,39,40,41,56,64,87,91,112,143,188,197,198,199,203,207,208,214,219,229,239,242,246,250,253,255,281,282,289,290,291,292,294,299,302,303,321,322,323,324,329,355,356,361,362,363,365,370,371,373,377,386,387,393,395,396,419,420,421,424,430,440,450,452,458,464,466,467,469,470,472,483,490],methodolog:[6,73,143,282,355],metin:[7,9],metric:[3,10,64,472,487],metropoli:[204,231,484],mezei:87,mf1:195,mf2:195,mf3:195,mg2:167,mglob_default_function_attr:12,mgoh:426,mgpt:[],miai:294,mic:[12,17],micel:[4,13,312],micelle2d:[],michael:[9,13,421],michel:13,mickel:108,micro:[3,489,494],microcanon:[264,265,267,268,270,272,273],microelast:429,micromet:494,micropor:231,microscal:416,microsec:494,microsecond:494,mid:[5,9,59,220,422,449],middl:[3,6,8,16,22,41,44,77,87,118,157,162,172,175,176,194,198,199,205,214,285,297,298,299,322,329,340,341,360,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,420,421,422,423,425,427,429,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,460,461,462,463,467,477,478,479,495],middlebondtors:[3,175,469],midnightblu:194,midpoint:449,mie:[],might:[3,4,6,7,8,12,14,25,71,150,229,231,233,299,440,467,477,495],migrat:[3,8,17,41,42,59,61,65,69,79,93,110,117,191,197,214,280,288,294,314,355,367,370,477,497,499],mikami:[6,255,256],mike:[7,9,13,15,16],mil:[9,393],mill:362,miller:299,million:[3,7,10,39,41,71,214],mimic:[6,42,54,240,253,285,387,397,407],mimim:[218,365],min2theta:167,min:[3,4,6,8,12,119,142,194,209,355,358,440,449,464,483,495],min_cap:3,min_cg:8,min_clearstor:8,min_dof:8,min_modifi:[],min_nn:306,min_popstor:8,min_post_forc:8,min_pre_forc:8,min_pushstor:8,min_setup:8,min_setup_pre_forc:8,min_step:8,min_stor:8,min_styl:[],minarea:166,mincap:433,mind:[7,232,281],mine:[12,88,158,159,197,337,492],minim:[],minima:[180,351],minimi:[365,457],minimizaiton:365,minimizi:294,minimum:[3,12,25,26,27,42,45,57,59,71,86,106,119,166,167,169,171,177,190,191,193,202,209,218,219,225,238,254,296,298,300,304,306,310,314,331,335,339,351,355,358,361,362,363,365,366,382,395,398,400,401,407,409,411,416,417,433,435,449,464,477,483,495,496],minlength:166,minmiz:[8,218],minn:9,minord:[3,355],mintcream:194,mintmir:[7,290,387,450],minu:[12,59,148,220,339,365,495],minut:[4,8],mirror:[61,333],misc:[],miscellan:[2,203],mise:[135,140],mishin:[371,450],mismatch:3,miss:[3,5,12,171,209,231,269,294,314,406,424,486,487],mistak:[3,495],mistakenli:3,mistyp:3,mistyros:194,mitchel:[6,113,150,355,356,389,429],mitchell2011:429,mitchell2011a:429,mitig:255,mitur:[],mivi2:294,mix:[1,3,6,9,14,15,16,71,117,150,209,210,327,355,356,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462,467,469,482,490,497],mixtur:[6,40,255,299,314,336,385,419,469],mixture_ref_t:419,mjpeg:193,mkdir:480,mkl:12,mkmk:281,mkv:193,mldivide3:3,mlpark:7,mlutipl:212,mn2:167,mn3:167,mn4:167,mo3:167,mo5:[167,422],mo6:167,mobil:[6,106,143,145,146,147,149,154,161,193,299,337,338],moccasin:194,mod:[],mode:[1,3,6,9,11,12,13,14,15,16,17,18,61,66,75,88,90,94,105,107,116,118,119,144,148,163,165,166,167,191,193,194,209,212,219,220,229,233,255,282,294,303,314,353,355,367,370,387,395,422,440,466,471,476,478,487,494,495,499],model:[],model_ar_p_mors:403,modern:[12,239,241],modest:[1,368],modif:[6,13,87,419,422,434,455,490],modifi:[],modify_param:8,modin:203,modul:[3,9,11,12,13,219,294,467],modular:8,modulo:[3,495],modulu:[286,399,419,429,436,438],moementum:252,mofil:470,mol1:495,mol:[3,9,71,115,168,170,171,191,194,219,221,231,236,239,285,288,299,302,310,316,390,398,435,478,479,490,495],molchunk:[66,75,90,94,105,107,148,163,165,206],mole:[204,393,494],moleclu:[215,216,221,228],molecul:[],molecular:[0,2,3,5,6,7,8,9,12,13,39,40,53,71,110,115,117,145,146,147,149,151,154,155,156,157,160,161,168,169,170,171,172,180,191,192,195,203,216,219,231,238,281,282,289,293,294,298,303,325,326,356,364,373,374,377,381,392,395,402,450,469,470,471,473,474,478,479,481,487,489,490,495],molfil:[],molfrac:[221,285],molnar:303,molp:111,moltempl:[],molybdenum:422,mom:[6,91,298,496],momementum:[146,147,257,258,261,262,265,266,267,274,275],momemtum:66,moment:[3,6,9,40,42,82,84,85,107,115,146,161,168,189,191,239,242,245,255,272,285,299,312,316,364,390,394,440,469,479,490,494],momenta:[233,266,329,395],momentum:[],momon:217,monaghan:[9,444,445,447],monitor:[3,6,12,97,98,151,218,220,221,228,236,239,253,255,285,287,289,299,302,314,363,365,390,487],mono:[73,416],monodispers:[3,332,379,399,416,417],monom:[13,54,217],monoton:[3,303,325,365,483],monoval:356,mont:[6,7,9,197,204,217,231,299,321,392,450],montalenti:[464,483],month:0,moor:[17,143],more:[0,1,2,3,4,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,58,59,61,62,63,64,65,67,68,69,70,71,72,77,78,79,80,83,86,87,88,90,92,93,97,98,99,100,101,102,103,104,106,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,150,151,152,154,155,156,157,159,160,161,162,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,185,186,187,188,190,191,192,193,194,195,197,198,199,200,201,202,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,227,228,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,270,272,273,274,275,276,277,278,280,281,282,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,301,302,303,304,305,306,307,308,310,314,316,317,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,349,350,351,353,355,356,358,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,424,425,426,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462,464,465,466,467,469,470,472,473,474,475,476,477,478,479,480,481,482,483,484,486,488,490,495,496,497,498,499],morefoo:8,moreov:[215,216],moriarti:[9,422],moriarty1:422,moriarty2:[9,422],moriarty3:422,morri:[],morriss:[156,276],mors:[],morse_f:452,mosel:362,mosi2:419,moskalev:142,most:[0,1,2,3,4,5,6,7,8,10,11,12,15,17,18,19,37,39,41,55,71,104,110,156,187,191,193,194,206,209,210,211,212,214,215,216,218,235,255,256,282,287,288,289,290,299,300,327,329,337,339,350,356,362,366,368,370,372,395,398,419,431,432,433,455,464,465,466,478,483,487,488,495,497],mostli:[8,9,11,13,71,170,193,366,469,478,481,495,498],motiion:6,motion:[3,6,7,9,42,86,98,104,145,146,147,149,151,153,154,155,156,157,158,160,161,220,224,233,242,245,246,252,255,256,260,276,280,282,284,294,298,299,322,326,332,335,365,390,395,416,417,472,478,490],motiv:280,mous:236,mov:193,move:[],move_tri_surf:[],movement:[3,6,12,252,321,363,487],movi:[],mp4:193,mpeg:193,mpg:193,mpi4pi:11,mpi:[],mpi_allreduc:[299,467],mpi_barri:1,mpi_cart:466,mpi_cart_cr:466,mpi_cart_get:466,mpi_cart_rank:466,mpi_cart_shift:466,mpi_comm:6,mpi_comm_world:11,mpi_fastmgpt:422,mpi_get_processor_nam:466,mpi_inc:12,mpi_lib:12,mpi_lmp_bigint:3,mpi_lmp_tagint:3,mpi_path:12,mpi_wtim:12,mpicc:11,mpich2:12,mpich:[12,14,15,16,17,18,370],mpich_icc:16,mpicxx:[12,17],mpiexec:[12,14,15,16,17,18,370],mpiio:[3,191,194,471,476,499],mpirun:[1,6,11,12,14,15,16,17,18,19,282,354,370],mplayer:193,msd:[],msi2lmp:[],msi:13,msm:[],msmse:[120,167,300],msse3:422,msst:[],mtchell2011:429,mtchell2011a:429,mtd:219,mth:[8,121,194,486],mtk:[255,256,260],mtotal:364,mu_j:29,muccioli:398,much:[1,3,6,11,39,144,191,193,208,218,289,321,366,367,370,398,434,464,467,483,488,490,495],mui:[115,191,226,316,469],mukherje:[7,9,284],mulder:325,muller:[6,91,197,322,329,423],mult:8,multi:[],multibodi:[3,61,284],multicent:395,multicor:[1,466,482],multidimension:13,multielectron:373,multilevel:[355,356],multiphys:11,multipl:[],multipli:[3,87,91,118,176,187,198,199,207,239,242,280,286,358,363,372,469,495],multiprocessor:370,multiscal:11,multisect:[41,214],multistag:87,multitud:7,mundi:277,munich:9,murdick:377,murti:454,murtola:355,must:[1,2,3,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,56,57,59,61,62,71,82,84,86,87,105,109,111,114,117,118,119,120,121,146,150,157,161,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,185,186,188,189,190,191,192,193,194,195,198,199,200,202,203,204,205,206,207,209,210,211,212,213,214,215,216,217,218,220,221,224,226,229,231,232,233,235,236,237,238,239,240,242,243,244,245,246,250,251,252,253,254,255,256,257,259,260,261,263,265,266,267,269,272,274,278,280,284,285,286,287,288,289,290,292,294,296,297,298,299,300,301,302,308,310,311,313,314,317,318,319,321,322,324,325,326,328,329,331,332,333,334,335,336,337,339,340,341,342,343,344,345,346,347,349,351,355,356,358,360,363,364,365,366,367,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,437,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,464,465,466,467,469,470,471,472,474,476,477,478,479,480,483,484,486,487,490,494,495,496,497,499],mutli:6,mutlipl:469,mutual:[3,358,488],mutut:478,muvt:231,mux:[115,191,193,226,316,469],muz:[115,191,226,316,469],mv2_comm_world_local_rank:12,mvapich2:[17,370],mvapich:12,mxn:[12,282],my_ga:231,my_one_wat:231,my_post_process:480,my_qeq:290,my_setup:480,my_swap_region:204,myblock:[221,285],mybox:170,mychunk1:116,mychunk2:116,mychunk:[6,66,75,90,94,105,107,148,163,165],mycmap:469,mycom:209,mydump:[191,194],myer:[5,7],myfil:[466,495],myfix:[204,484],myflux:91,myforc:[191,498],myhug:260,myke:91,mymol:[40,302,364],mympi:11,mymultipli:[467,495],myn:467,mype:91,mypi:495,mypress:250,myramp:143,myrdf:[118,212],myreg:358,myregion:337,myrigid:[83,99,285],mysocket:238,myspher:[194,335],mystr:339,mystress:91,mytemp:[2,103,145,146,147,149,151,152,154,156,161,250,339,354,369,486,496],myz:469,n_dephas:464,n_element:192,n_f:[289,294],n_hbond:401,n_ij:399,n_ion:326,n_k:232,na1:167,nabla:326,nacl:[4,6,419],nacl_cs_x0:6,nakano:[290,292,365,458],namd:[7,9,191,236],name1:[162,220],name2:[162,220],name:[0,1,2,3,5,6,8,9,11,12,13,33,42,50,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,181,190,191,192,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,257,258,259,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,281,282,283,284,285,286,287,288,289,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,327,328,329,330,331,332,333,334,335,336,337,338,339,347,353,354,356,357,359,364,365,369,371,372,377,380,393,394,396,398,399,402,403,404,406,419,420,421,426,430,432,433,440,441,451,453,454,455,456,458,459,466,467,469,470,471,472,476,479,482,484,485,487,490,495,496,497,498,499],namespac:[6,8,12],nan:3,nangl:[3,469],nangletyp:[364,469,479],nano:[299,489,494],nanoindent:70,nanolett:299,nanomet:[191,194,494],nanoparticl:[214,299],nanosec:494,nanosecond:494,nappli:229,narea:3,narrow:[6,188],narulkar:[453,455],nasa:7,nasr:281,natdef:3,nation:[0,7,9,12,113,429],nativ:[1,6,7,12,16,17,191,195,470],natoli:[9,19],natom1:117,natom2:117,natom:[6,11,39,364,467,469,486,487,495],nattempt:285,natur:[6,9,142,220,255,280,294,332,393,395,396,419,430,466,495],navajowhit:194,navi:[194,393],navier:242,nb3:167,nb3b:[],nb3bharmon:426,nb5:167,nbin:[118,209,210,211,322,329],nbodi:[245,299,422],nbond:[3,115,469],nbondtyp:[194,364,469,479],nbot:377,nbounc:314,nbrhood_cutoff:433,nbtype:117,nbuild:487,ncall:229,ncbin:71,nchar:194,nchunk:[3,6,66,71,75,90,94,105,107,116,148,163,165,206],ncoeff:441,ncorr:208,ncorrel:208,ncount:[206,207,208],nd3:167,ndanger:487,nden:[6,91],ndihedr:[3,469],ndihedraltyp:[364,469],ndim:210,ndirango:299,ndof:[255,260],ndoubl:469,ndp:490,ndx:338,neal:299,nearbi:[7,62,169,221,252,291,314,335,366,372,416,417,450,461,490],nearest:[3,70,71,73,92,108,166,169,242,254,280,321,335,355,406,419,440,452,495],nearli:[6,9,18,54,59,214,239,314,395,422,424,464,467,473,481],neb:[],neb_combin:365,neb_fin:365,neb_log:483,neb_step:483,neb_styl:483,necessari:[6,9,11,12,13,15,17,33,61,87,176,181,187,195,214,218,219,231,232,293,314,327,337,355,370,415,422,424,440,469,470,474,477,478,479,483,490,498],necessarili:[12,294,321,342,343,344,346,358,424,496],necessit:288,need:[1,2,3,5,6,7,8,9,11,12,13,14,15,16,17,18,33,37,38,39,40,41,42,50,54,55,56,58,61,63,64,67,70,72,73,77,82,91,92,103,105,108,111,114,130,142,143,145,146,147,148,149,151,154,155,156,157,158,160,161,168,170,172,174,176,181,187,188,190,191,192,193,194,198,199,200,201,203,204,206,207,208,209,210,211,212,214,215,216,218,219,220,224,226,229,230,231,235,236,238,239,240,242,248,249,255,269,281,285,286,288,294,298,299,303,310,314,322,325,326,328,329,330,331,337,347,350,355,356,364,365,366,367,370,371,372,373,374,377,378,379,380,381,382,383,385,386,387,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,460,461,464,467,469,470,471,472,474,476,477,479,481,482,483,490,495,497,498,499],needless:[6,366],neeed:9,neelov:356,neg:[3,6,12,27,46,65,69,89,103,110,117,142,143,170,172,177,179,188,193,218,220,221,232,260,280,303,311,325,329,331,336,355,362,396,410,419,450,469,472,488],neglect:[376,401,417],neglig:[6,11,87,255,451],neigh:[2,3,12,15,370],neigh_modifi:[],neighbor:[],neighborhood:[26,92,124,441],neighbour:240,neighobr:[6,387,407,411],neither:[2,3,12,41,63,203,217,220,221,372,379,395,416,417,474],nelem:441,nelement:[371,393],nelson:[92,108],nemd:[],nest:[2,339,352,369,495],net:[3,6,11,39,86,88,149,160,235,280,290,299,417,433],netpbm:193,network:[12,191,215,216,236,466],neumann:355,neutral:[3,88,231,355,387,407,440],never:[7,12,63,71,197,207,218,231,255,280,302,316,327,331,334,336,355,366,393,419,441,458,466,469,483,486,495],neveri:[3,8,71,200,205,206,207,208,209,210,211,212,215,216,217,242,243,281,290,291,292,295,296,300,322,328,329,365,440,474,483],newatom:221,newer:[12,206,419,495],newfil:[352,354],newli:[221,490,496],newlin:194,newn:299,newt:155,newtemp:[63,103],newtion:[377,422,430],newton:[],newtonian:232,newtyp:[3,216],next:[],neyt:321,nfile:[3,38,56,188,191,194,452,471,476,499],nfirst:474,nfirt:474,nfreak:300,nfreq:[39,71,205,206,207,208,209,210,211,212,214,296,300,474],nghost:[3,12],ngp:106,ngpu:370,nguyen:[15,377],nharmon:[],nhc:282,nht:299,ni2:167,ni3:167,ni_000:[120,300],nialh_jea:393,nialhjea:[384,402],nice:[6,8],nickla:421,nicola:9,nimprop:[3,469],nimpropertyp:[364,469],nine:[129,136,396,440],ninteg:469,nissila:[242,440],nist:[371,393,494],niter:[41,214],nitrid:387,niu3:[384,393,402],nkb:289,nlast:474,nlen:208,nline:364,nlocal:[3,8,11,12,229],nlog:356,nlvalu:108,nmax:42,nmin:42,nmol:469,nmpimd:282,nn2:419,nneighmaxdef:3,nnn:[92,108],no_affin:[16,370],no_gradient_correct:439,no_histori:6,no_velocity_gradi:439,noced:363,nocheck:406,nocit:12,nocoeff:497,nodal:[6,38,56,188,203,326,452],node:[1,3,12,14,15,16,17,18,41,120,124,167,192,214,236,242,326,370,406,466,482],node_area:242,node_group:203,nodeless:395,nodeset:203,nodeset_to_elementset:203,nodess:16,nof:188,noforc:[],nois:[6,232,233,239,240,241,242,289,294,299,318,326],nomenclatur:[6,71,210,358],nomin:[191,255],non:[],nonbond:[4,12,426,450],none:[],noneq:233,nonequilibrium:[9,323,324,395],nonetheless:239,nongauss:[],nongaussian:106,nonlinear:[],nonloc:[429,479],nonperiod:3,nonzero:3,noordhoek:386,nopreliminari:188,nor:[2,3,41,59,203,304,305,306,307,308,310,386,436,437,438,439,469,472],nord:[430,453,455],norder:466,nordlund:[430,453,455],norm:[6,12,63,119,197,206,210,211,300,305,306,363,365,449,486,487,494],normal:[3,6,9,10,11,12,39,41,58,61,63,67,70,71,73,88,91,103,104,114,118,119,153,156,166,168,169,170,188,194,197,206,207,209,210,211,214,218,220,221,230,231,235,239,240,252,255,269,280,282,283,290,294,296,297,303,314,315,317,318,319,326,331,332,335,336,340,342,343,344,346,360,362,363,365,370,376,385,386,398,399,402,422,449,462,463,464,467,469,471,472,474,475,479,483,486,487,488,490,494,495,498],norman:326,nornal:3,nose:[6,7,8,158,197,224,239,240,255,256,257,258,259,260,261,262,263,274,275,276,277,278,282,286,294,299,317,318,319,324,391,490],noskov:[456,490],noslip:[314,336],nosync:488,notabl:[5,39],notat:[6,61,63,70,142,162,197,252,255,393,458,495],note:[1,2,3,6,7,8,9,11,12,13,14,15,16,17,18,19,22,24,25,28,32,33,35,36,37,38,39,40,41,42,44,47,54,55,56,58,59,60,61,62,63,65,66,68,69,71,73,75,79,87,89,90,91,93,94,98,104,105,106,107,110,112,114,115,116,117,118,119,120,121,142,143,148,150,151,152,156,158,162,163,165,166,167,168,169,170,171,172,174,176,179,181,185,187,188,190,191,192,193,194,195,197,198,199,200,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,224,225,226,228,229,231,233,234,235,237,238,239,240,241,242,250,251,252,253,255,257,258,259,260,261,262,263,269,274,275,276,278,282,284,285,286,288,289,290,292,297,298,299,300,303,311,312,314,317,318,319,322,325,326,328,329,330,331,332,335,336,337,339,340,341,342,343,344,346,350,354,355,356,358,360,363,364,365,366,370,371,372,376,377,378,380,381,382,384,385,387,388,390,391,392,393,396,398,399,400,401,402,406,407,409,411,415,416,417,419,420,421,422,423,424,426,430,432,433,434,435,437,439,440,441,442,445,449,451,452,453,455,457,458,461,462,464,466,467,469,470,471,472,473,474,476,477,479,481,483,484,486,487,490,494,495,496,498,499],noth:[204,238,357,370,467,480],notic:[0,6,7,8,12,324,326,490],noutcol:8,noutput:281,noutrow:8,novemb:419,novik:13,novint:236,now:[2,3,6,9,11,12,13,46,61,62,71,191,198,199,216,232,236,237,299,332,335,356,358,376,393,395,399,432,433,442,465,470,490,496],nowait:236,nozforc:355,np3:167,np4:167,np6:167,npair:[118,207],nparticl:[3,40,42,375],npartit:487,npernod:[14,15,16,17,18,370],nph:[],nphi:[16,370],nphug:[],npoli:285,nproc:[3,11,191],npt:[],npt_aspher:[257,263,274],npt_bodi:[258,275],npt_sphere:[259,278],nrbin:[],nrecomput:392,nrepeat:[71,205,206,207,208,209,210,211,212,296,300,474],nreset:[218,255,256,260],nreset_ref:218,nrho:[371,393],nrl:393,nsall:9,nsampl:392,nsbin:71,nsbmax_most:3,nsec:489,nskip:[121,474],nsq:[3,367,428],nstart:[121,207,208,209,212,300,469,474],nstat:280,nstep:[3,13,218,255,337,446,467,470],nsteplast:467,nstop:[121,474],nswap:[322,329],ntabl:[38,56,188,452],nterm:303,nth:[12,77,118,119,191,194,209,220,474,484],ntheta:377,nthread:[3,370],ntild:281,ntpc:370,ntptask:370,ntype1:117,ntype2:117,ntype:[3,142,168,191,194,290,292,395,401,430,469,479],nuclear:[9,97,98,154,233,256,289,294,364,395,462],nuclei:[9,97,98,152,154,159,241,256,268,277,320,373,395,469],nucleu:[97,98,290,455,490],nudg:[4,6,7,197,254,362,365],nulcear:9,num:2,num_of_collis:3,numa:[1,3,12,370,466],numactl:16,number:[1,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,22,27,38,39,40,41,42,44,56,63,64,65,66,68,69,70,71,72,73,75,76,77,78,79,80,87,90,91,92,93,94,103,104,105,107,108,110,113,114,115,116,117,118,119,120,121,131,137,142,145,146,147,148,149,150,151,153,154,155,156,157,158,160,161,162,163,165,166,167,168,169,170,171,172,176,177,187,188,190,191,192,193,194,195,197,198,199,202,204,206,207,208,209,210,211,212,214,215,216,217,219,220,221,228,229,231,232,233,235,236,237,238,239,240,241,242,245,252,255,256,260,269,280,281,282,284,285,288,289,290,294,296,299,302,306,314,315,316,318,321,322,323,324,326,327,328,329,331,333,334,336,337,339,341,353,355,356,358,360,361,363,364,365,366,367,370,371,372,377,379,384,386,391,392,393,394,395,396,401,402,403,404,405,419,420,421,422,424,426,430,431,432,433,434,437,439,440,441,449,451,452,453,454,455,457,458,459,462,463,464,466,467,469,470,471,472,473,475,476,477,478,479,481,483,484,486,487,488,490,494,495,496,499],number_of_a:3,number_of_b:3,number_of_typ:[],numbond:3,numer:[1,2,3,6,9,11,12,22,38,41,42,44,56,71,77,87,108,118,162,172,176,188,191,193,194,198,199,200,202,203,206,210,212,226,232,235,239,252,255,282,299,302,326,331,333,334,336,337,341,360,363,364,384,390,402,419,424,432,433,439,452,462,463,467,468,469,476,479,485,486,487,495],numpi:11,nvalu:[206,210,211,212,467],nvaluelast:467,nvc_get_devic:15,nvcc:[1,12,17],nve:[],nve_aspher:[257,261,274],nve_bodi:[258,262,275],nve_spher:[259,263,278],nvida:17,nvidia:[1,3,9,12,14,15,17,370,482],nvt1:490,nvt2:490,nvt:[],nvt_aspher:[257,261,278],nvt_bodi:[258,262],nvt_sphere:[259,263],nvtfe:203,nwait:281,nwchem:7,nxnode:326,o_cor:150,o_shel:150,oascr:7,obei:[3,220,358,464],ober:7,obj_shared_foo:12,obj_target:12,object:[6,8,11,12,15,40,42,193,218,236,242,245,285,303,310,363,364,467,472],observ:[255,289,317,318,321,322,329],obsolet:13,obstacl:[4,237],obtain:[1,3,9,12,29,73,87,104,108,166,195,199,230,233,242,260,281,282,321,355,372,390,419,424,431,440,453,455,478],obviou:[12,462,495],obvious:[193,484,495],occ:397,occasion:[3,255,464],occlus:193,occup:[3,166,370,397],occur:[1,3,6,9,11,12,14,17,39,57,59,61,62,71,86,106,166,169,171,188,191,194,204,214,217,218,220,231,234,237,245,253,269,290,299,314,323,336,337,339,355,366,370,392,395,415,433,464,466,467,472,474,478,483,486,495],occurr:[349,469,483,495],oct:11,octahedr:25,octant:466,odd:[41,108,194,214,255,299,317,318,326,484],off:[1,3,6,12,14,15,17,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,37,38,39,40,43,44,45,46,47,48,49,50,51,53,54,55,56,59,61,65,69,71,109,110,111,114,115,117,142,143,145,151,155,166,167,172,174,175,176,177,178,179,180,181,182,183,185,186,187,188,191,193,194,197,200,204,212,213,216,217,220,227,230,231,232,234,236,239,240,245,255,257,258,259,260,261,262,263,264,265,269,272,274,275,276,278,284,286,287,291,299,301,302,314,317,319,329,330,331,334,335,340,341,342,343,345,346,347,349,350,351,355,356,363,365,366,368,370,371,372,374,378,379,380,381,382,383,385,386,387,389,390,391,393,394,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,417,419,420,424,425,426,427,429,433,434,435,437,439,440,442,449,450,451,452,453,454,455,458,460,461,462,464,465,466,469,471,472,476,478,481,482,483,488,492,494,495,497,499],offend:[3,467],offer:[6,14,18,171,362,387,440,464,478],offic:7,offload:[1,12,16,17,236,370],offset:[3,6,57,168,193,220,221,285,364,387,407,411,450,469],offsit:8,often:[1,3,6,7,12,13,14,15,16,17,18,37,55,71,162,187,193,200,209,212,214,218,229,236,255,282,300,350,358,362,363,365,366,367,370,386,391,407,453,455,464,483,490,494],ohio:421,old:[3,6,9,197,218,221,255,419,432,442,470,473,477,480,494,497],older:[3,5,12,13,17,194,206,218,255,442,495],oldlac:194,oleinik:377,olfason:[6,25,351,401,481],oliv:194,olivedrab:194,olivi:9,ollila:[242,244,245,246],olmst:[203,280],omega0:351,omega:[],omega_dot:255,omega_ijk:455,omega_ik:453,omegai:[115,191,316],omegax:[115,191,316],omegaz:[115,191,316],omgea:6,omiss:[0,7],omit:[188,194,333,381,390,411],omp:[],omp_num_thread:[3,16,18,370],omp_proc_bind:17,ompi_comm_world_local_rank:12,ompi_icc:16,on_the_fli:203,onc:[0,1,2,3,6,11,12,16,40,41,59,60,63,71,91,105,174,192,193,194,197,198,199,214,215,216,221,229,231,233,240,281,288,299,314,322,327,329,337,361,364,365,366,398,400,402,403,430,434,466,467,476,483,486,490,495],onelevel:466,onewai:[],ongo:236,oniom:[9,293],onli:[1,2,3,6,7,8,9,11,12,13,14,15,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,53,54,55,56,59,60,61,63,64,65,66,67,68,69,70,71,72,73,75,78,79,80,83,86,87,88,90,92,93,94,97,98,99,100,101,102,103,104,105,106,107,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,151,152,154,155,156,158,159,160,161,162,163,165,166,167,168,171,172,174,175,177,178,179,180,181,182,183,185,186,187,188,191,192,193,194,195,197,198,199,200,201,202,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,224,226,227,228,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,270,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,288,289,290,291,292,293,294,295,296,299,300,301,302,303,304,305,306,307,308,310,314,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,342,343,344,345,346,347,349,350,351,353,355,356,358,360,363,364,365,366,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,466,467,469,470,472,473,474,476,477,478,479,480,481,483,484,485,486,487,488,490,495,496,497],only_group:166,onn:478,onset:[289,349],ontario:9,onto:[142,170,217,221,242,449],onward:2,open:[],opencl:[1,3,7,15,370],opengl:6,openkim:9,openmp:[1,3,7,9,12,16,17,18,353,370,482],openmpi:[12,14,15,16,17,18,370],opensourc:7,oper:[],opl:[],oppelstrup2:9,oppelstrup:[9,422],oppos:[6,39,189,191,298,333,356,364,469],opposit:[6,29,70,202,239,246,280,299,329,365,387,415,456,467],opt:[],optic:146,optim:[],option:[],optionn:17,orang:[2,193,194],orbit:[290,292,377,387,395,440,450],orchid:194,order:[1,2,3,6,9,11,12,14,27,29,38,39,41,56,59,63,65,69,71,79,87,89,90,92,93,94,108,110,114,117,132,142,143,145,146,147,148,149,150,151,154,155,156,157,158,160,161,172,177,187,188,191,193,194,197,200,205,207,209,210,211,212,213,215,216,217,218,219,224,226,231,233,235,236,238,242,243,245,253,255,280,288,289,293,296,297,298,299,300,301,302,303,308,310,315,321,325,326,327,328,338,339,340,342,343,344,346,349,350,355,364,365,371,372,373,377,386,392,393,395,396,398,399,402,404,407,415,419,422,432,433,434,440,450,451,452,453,454,455,456,458,459,464,466,467,469,470,474,476,478,479,483,486,490,495,499],orderomg:3,ordinari:[113,401,429],org:[6,7,11,12,13,14,431],organ:[0,3,6,7,8,386],organis:[437,439],organometal:25,orien:479,orient:[],orienti:[],orientord:[],origid:206,origin:[3,6,7,9,12,71,81,104,105,116,120,164,168,170,190,193,194,197,198,199,206,210,211,215,216,220,224,240,252,255,276,282,285,295,299,300,307,313,324,352,354,355,358,362,371,372,374,377,387,390,391,392,393,401,404,419,429,432,433,453,455,456,457,466,469,470,471,472,473,474,494,497],origin_i:211,origin_x:211,origin_z:211,orlikowski:422,ornl:[7,9,15],orsi:29,ortho:[3,59,170,469],orthogon:[],orthograph:193,orthong:59,orthongon:[59,299],orthonorm:221,orthorhomb:289,os4:167,oscil:[6,9,153,216,220,223,224,240,252,253,255,289,294,299,331,332,334,336,364,373,456,490,495],oscillatori:[252,307],oserror:11,other:[],otherswis:16,otherwis:[1,3,9,12,14,16,17,18,37,39,55,71,103,113,120,146,147,148,161,169,187,194,195,204,206,215,216,220,229,231,233,240,255,299,350,351,363,370,379,402,406,416,417,430,459,464,467,469,470,490,495],otyp:[387,407,411,415],ouml:490,our:[5,6,7,8,13,242,302,424,453,455,490],out:[1,2,3,6,7,8,11,12,13,14,18,19,21,41,64,66,71,75,90,91,94,95,98,104,105,106,107,109,116,117,145,146,147,148,149,151,152,154,155,156,157,158,160,161,163,165,171,175,191,193,194,195,197,210,214,215,216,219,227,230,231,237,239,242,247,269,281,283,284,285,294,295,296,299,311,326,335,337,338,339,340,342,346,353,354,358,361,365,369,395,402,418,450,463,464,466,467,472,473,474,476,477,478,480,483,485,486,487,491,493,495,496,497,498,499],outcom:[299,496],outer2:[382,400],outer:[3,8,16,71,225,237,339,354,361,363,369,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,425,427,429,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,459,460,461,462,464,477,478,483,489,495],outer_distance_cutoff:401,outermost:[38,56,71,198,199,252,255,366,452,478],outfil:[13,466],outlin:[6,193],outmost:236,outpt:[],output:[],output_frequ:203,outputss:129,outsid:[3,57,59,71,158,168,190,191,192,193,194,195,209,210,221,231,237,299,300,314,319,320,333,334,336,337,353,365,378,380,387,395,407,409,427,435,467,469,470,472,479,486,496],outuput:[],outut:6,outward:[71,166,331,335,336,469,478],over:[1,3,5,6,7,9,12,16,18,27,39,41,42,55,60,65,68,69,71,79,80,87,88,89,90,92,93,102,104,106,108,110,117,118,127,128,134,139,142,143,148,151,154,162,164,177,188,193,195,197,198,199,205,206,207,208,209,210,211,212,213,214,215,216,220,221,229,232,233,237,239,240,241,245,252,253,254,255,256,257,258,259,261,262,263,274,275,276,277,278,280,285,286,289,296,297,298,299,300,303,311,314,317,318,319,320,322,325,328,329,331,333,334,335,336,337,340,354,357,365,366,367,370,385,391,393,394,395,396,401,416,419,422,430,441,442,450,451,453,454,455,458,465,466,467,472,474,475,477,478,483,486,487,495,496],overal:[6,18,25,59,162,218,224,255,256,282,302,314,339,361,395,401,402,441],overalap:299,overcom:[269,314],overflow:[3,364,366],overhead:[6,11,19,41,194,206,208,210,211,214,228,288,366,367,472,488],overkil:299,overlai:[],overlaid:7,overlap:[3,13,16,62,76,168,171,188,194,202,205,206,209,210,211,212,221,225,269,285,290,296,299,300,314,332,336,355,358,361,363,364,370,391,395,399,402,405,415,436,438,442,457,469,472,478],overload:1,overrid:[3,12,14,16,17,22,44,71,154,168,176,193,194,198,199,218,225,250,255,341,355,366,384,401,402,419,424,432,466,467,479,481,486,495],overridden:[6,168,193,260,299,405,416,424,442,450,477,495,497],overview:[],overwrit:[11,12,22,44,176,194,206,207,208,209,210,211,212,300,341,353,359,384,419,467,470],overwritten:[287,325,353,401,402,464,465,470],own:[3,4,6,7,8,11,12,13,15,17,39,41,59,61,63,65,66,69,71,73,75,79,90,93,94,105,107,115,116,117,119,121,148,151,163,165,166,191,194,197,203,205,206,207,208,209,210,211,212,214,217,218,220,229,232,233,239,240,242,250,253,255,257,258,259,260,261,262,263,274,275,276,278,282,286,294,299,300,317,318,319,328,355,365,370,372,377,386,394,404,430,432,433,451,453,454,455,458,466,479,486,496],oxford:[29,87,390],oxid:[9,386,387,440],oxygen:[6,40,228,387,407,411,440,469],oxygen_c:150,p_e:326,p_ik:430,p_pi:377,pacakg:[3,4,9,19,40,370],pack:[5,8,67,332,370,377,419],pack_bord:8,pack_border_bodi:8,pack_border_hybrid:8,pack_border_vel:8,pack_comm:8,pack_comm_bodi:8,pack_comm_hybrid:8,pack_comm_vel:8,pack_exchang:8,pack_restart:8,pack_revers:8,pack_reverse_comm:8,pack_reverse_hybrid:8,packaag:370,packag:[],packakg:15,packet:[7,9,40,193,373,395],pad:[3,191,193,194,282,495],padua:[9,13],page:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,22,37,40,42,44,55,57,59,63,66,68,75,87,90,94,103,105,106,107,109,111,114,116,119,121,143,146,147,148,161,163,165,168,169,170,176,187,190,191,192,193,194,195,197,198,199,204,205,206,207,208,209,210,211,212,221,231,238,239,240,250,255,256,261,262,263,267,274,275,276,277,278,285,288,299,311,314,317,318,319,328,332,335,337,339,341,350,354,363,364,365,366,370,371,372,375,376,384,386,387,393,394,396,401,402,404,405,419,420,421,424,426,430,431,441,450,451,453,455,457,458,467,469,470,471,472,474,477,478,479,481,486,487,495,496,497,498],pai:[15,18],pair:[],pair_:[87,198,199],pair_airebo:404,pair_charmm:415,pair_class:8,pair_coeff:[],pair_eam:371,pair_eff:154,pair_foo:8,pair_hybrid:[402,456],pair_interact:203,pair_list:406,pair_lj:415,pair_lj_cut:8,pair_lj_soft_coul_soft:87,pair_modifi:[],pair_sph:[443,444,445,446,447,448],pair_styl:[],pair_tally_callback:8,pair_writ:[],paircoeff:3,pairfoo:8,pairij:[3,469],pairkim:3,pairstyl:8,pairwis:[],palegoldenrod:194,palegreen:194,paleturquois:194,palevioletr:194,pan:193,panagiotopoulo:[388,397],pandit:[9,292,433],papaconstantopoulo:371,papayawhip:194,paper:[3,6,7,8,9,13,39,40,64,142,156,162,180,239,242,246,254,284,290,292,299,314,322,326,329,355,362,365,372,381,387,399,401,404,409,411,429,432,433,453,455,464,483],paradyn:5,paraemt:434,paragraph:[71,156,331,358,470,471],parallel:[],parallelepip:[6,170,358,469,472],parallelipip:[170,281],paralleliz:284,param:[3,290,292,405,466,472],paramet:[],parameter:[120,167,372,377,386,387,393,394,395,396,404,419,420,421,430,432,433,440,451,453,454,455,458],parameter_fil:203,parameterizaion:387,parametr:[6,9,36,394,431,435],paramt:[106,290,333,434],paramter:386,paratem:415,paraview:300,parent:[3,8,337],parenthes:[38,56,188,399,452,495],parenthesi:[2,206,339,495],parinello:[6,7],pariticl:214,paritlc:3,park:[3,7,9,203,303,421,429],parmin:422,parrinello1981:218,parrinello:[218,233,253,255,256,289,318],pars:[],parser:[12,495],part:[0,1,2,3,6,7,8,9,11,12,17,20,21,23,24,25,26,27,28,29,30,31,32,35,36,37,38,40,41,43,45,46,47,48,49,51,53,54,55,56,64,67,70,71,72,78,80,83,92,97,98,99,100,101,102,104,106,109,110,111,113,114,117,120,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,150,152,154,155,159,160,162,166,167,171,174,175,177,178,179,180,182,183,185,186,187,188,191,192,194,195,197,200,201,202,204,208,211,213,214,215,216,217,218,219,220,221,223,226,227,228,229,230,231,232,233,234,236,237,238,239,240,241,242,243,244,245,246,248,249,250,253,255,256,257,258,259,260,261,262,263,264,265,266,267,268,270,272,273,274,275,276,277,278,280,281,282,284,285,289,290,291,292,293,294,295,296,298,299,301,302,303,304,305,306,307,308,310,311,313,314,317,319,320,321,322,323,324,325,326,327,329,330,331,332,333,334,335,337,338,339,340,342,343,345,346,349,350,351,355,356,363,364,365,366,370,371,372,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,419,420,421,422,425,426,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462,466,467,469,470,471,472,476,477,478,481,487,495,499],partai:[9,431],parti:9,partial:[],partic:6,particip:[216,375,376,405,457],particl:[],particleenergi:3,particleviri:3,particular:[1,3,6,8,10,12,40,63,65,69,70,71,79,93,110,115,117,118,142,168,190,191,197,202,210,214,217,231,232,237,238,242,252,255,280,285,298,299,302,321,332,337,340,356,358,361,364,370,375,377,378,380,382,383,385,389,394,395,398,400,402,407,411,415,418,426,427,434,435,450,451,453,454,455,458,464,466,469,470,471,476,477,479,487,495,496,498,499],particularli:[6,7,9,12,15,16,25,39,193,218,299,356,395],particuolog:[42,376],partilc:314,partit:[],partitoin:62,partner:[3,7,61,215,216,217,240,314,329,456,479,484,490],pascal:[9,13,494],pass:[6,7,8,11,66,74,75,81,89,90,94,104,105,106,107,163,191,193,194,195,218,219,229,231,252,253,255,288,314,331,354,366,370,402,405,432,449,467,469,470,474,480,495,498],passphras:12,past:[],patch:[0,12],patchi:299,patel:422,path:[3,6,7,11,12,13,15,195,238,254,282,303,314,321,326,365,371,372,377,384,393,394,396,404,419,420,421,426,430,431,432,440,441,451,453,455,458,470],pathtolammp:440,patient:12,patom1:117,patom2:117,patrick:454,pattern:[3,7,12,62,73,471],pattnaik:299,paul:[0,7,13,239,241],pauli:[9,395,440],paus:477,paves:282,payn:[142,431,441],pb2:167,pb4:167,pbc:[71,331,373],pchain:[255,256,260,299],pcie:1,pd2:167,pd4:167,pdamp:[255,256,260,286,299],pdb:[6,13,195],pdebuyl:9,pdf:[0,8,9,13,17,40,100,101,102,113,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,219,238,248,249,304,305,306,307,310,429,443,444,445,446,447,448,479],pdim:329,pdlammp:[78,80,429],pdlammps_ep:[113,429],pdlammps_v:429,pe_eta:255,pe_etap:255,pe_omega:255,pe_strain:255,peachei:13,peachpuff:194,peak:397,pearlman:87,peculiar:12,pedersen:356,peform:[39,291],penalti:[14,432,433],pencil:[6,71,156,210],pend:3,penetr:[42,122,436,438,479],penetret:40,peng:167,penn:13,pentium:10,peopl:[7,8,9,12],peptid:[4,9,219],per:[],peratom:[3,112,143,166],perceiv:193,percent:[3,12,16,218,370,451],percentag:[1,12,218,255,285,286,299],percol:216,perfect:[6,41,70,73,92,214,280,365],perfectli:[41,214,470],perfom:[6,365],perform:[],performac:1,pergamon:[419,455,462],perhap:358,peri:[],peridyma:78,peridynam:[3,4,6,7,9,40,63,78,80,113,429,450,479],perimitt:388,period:[],perioid:331,perl:[6,13],perm0:494,perman:[3,39,54,71,172,215,216,236,298,337,370,401,473,481],permeabl:279,permiss:[216,467],permit:[6,242,422],permitt:[388,455,461,462],permut:[12,394,451,453,455,458],perpendicular:[6,71,146,193,220,237,247,252,254,280,283,307,331,332,362,469],perram:[356,398],persepct:193,persist:[3,8,71,229,299,370,466,467,471,475,495],person:9,persp:[3,193],perspect:193,pertain:[384,450],perturb:[9,13,70,87,251,297,331,334,336,474],peru:194,peskin:242,pessimist:356,petersen:[314,356],pettifor:[377,450],pettifor_1:377,pettifor_2:377,pettifor_3:377,pfactor:193,pforc:467,phantom:236,pharmaceut:7,phase:[3,12,16,255,321,329,377,407,454,466],phd:431,phenol:490,phenomena:395,phi0:[186,298],phi1:175,phi2:[175,394,451],phi3:[175,394,451],phi:[1,3,4,7,9,12,16,17,79,92,108,142,187,188,193,234,281,298,343,370,371,377,393,396,419,420,421,482],phi_ij:[377,396,430],philadelphia:9,phillip:[240,391,490],phillpot:[291,386,387,440],philosoph:393,philosophi:[6,7,238],phonon:[],phophor:441,phosphid:441,phy:[6,7,13,20,21,25,39,43,45,46,64,70,73,87,88,92,108,112,114,142,143,150,156,174,175,185,192,204,208,218,219,224,232,233,238,239,240,241,242,253,254,255,256,260,276,277,281,282,286,289,291,294,299,302,303,314,317,318,321,322,323,324,326,329,331,340,349,351,355,356,362,365,372,377,378,382,383,385,386,387,388,389,390,391,393,394,395,397,398,399,400,401,404,407,409,411,412,415,416,417,418,419,421,423,424,427,429,430,434,440,441,449,451,452,453,454,455,456,458,464,478,481,483,490],physic:[3,6,9,12,14,16,17,18,40,42,53,59,122,150,162,203,220,233,239,241,242,244,245,246,253,281,290,292,325,326,356,358,365,370,372,374,381,385,393,401,402,422,431,432,433,436,444,445,447,448,464,466,478,479,484,494],physica:[416,417],physik:[7,9],pic:9,picki:8,picocoulomb:494,picogram:494,picosecond:[194,220,487,494],picosend:395,pictur:7,pie:[],piec:[3,11,142,194,255,476,499],pierr:9,pieter:13,pimd:[],pin:16,pink:194,pipe:[6,191,193],pipelin:[3,6],pisarev:326,pishevar:391,piston:[],pitera:6,pixel:193,pizza:[4,6,7,11,13,41,191,193,214],pjintv:13,pka:326,place:[3,6,7,9,11,12,33,41,50,71,87,162,168,172,181,188,191,193,194,196,197,198,199,216,217,220,231,232,233,235,238,239,240,241,243,245,246,255,261,262,263,274,275,278,285,288,297,299,317,318,319,326,331,334,336,354,384,401,450,457,466,467,470,477,479,487,495],placehold:[33,181,371,372,386,393,396,403,404,419,420,421,426,430,432,433,441,449,451,453,454,455,458],placement:[358,407],plai:[193,321],plain:[9,415,467],plan:[3,5,6,17,170,469],planar:[6,40,42,237,280,332,349,351],planck:[231,282],plane:[3,6,9,41,42,57,59,67,71,92,193,197,203,210,214,234,237,247,280,283,293,311,313,326,332,340,342,343,344,345,346,351,358,417,457,472,479],planeforc:[],plasma:[9,88,256,326,395],plastic:[],plastic_strain:[],plastic_strain_r:[],platform:[1,3,7,9,12,13,15,17,191,193,195,471,476,499],plath:[6,91,197,322,329],player:193,pleas:[0,3,7,11,12,13,203,233,242,246,281,284,295,321,337,394,396,429,437,439,440],plen:373,plimpton:[0,5,7,70,114,143,217,280,290,314,399,429],plo:29,plog:[3,12,478],ploop:[255,256,260],plot:[7,11,13,289,413,415,452,459],plu:[3,11,12,39,59,68,97,166,171,194,213,218,220,221,260,299,367,395,405],plug:9,plugin:[9,13,195,470],plum:194,pm3:167,pmb:[],pme:356,pmf:[219,303,311],png:[3,12,191,193],pni:193,poariz:6,poem:[],point1:469,point2:469,point3:469,point:[],point_data:300,pointer:[3,7,8,11,229,467],pois:494,poiseuil:[4,200,234],poisson:[59,220,356,399],poisson_solv:203,polak:362,polar:[6,7,108,142,150,167,203,223,386,387,407,456,490],polar_off:386,polar_on:386,polariz:[],poli:[],politano:[9,440],pollock:[7,356],polya:337,polybond:13,polychain:299,polydispers:[3,364,379,385,399,416,417,450,461],polygon:[],polyhedron:166,polym:[],polymer:7,polymorph:[],polynomi:[9,38,56,188,393,413,424,440,445,452],polytechn:284,poor:[16,17,41,214,276,277,302,370,413],poorli:[362,363],pop:[3,8],popen:12,popul:[12,294,358,392,469],popular:[12,191,394],pore:311,poros:171,porou:[242,245],port:[236,238],portabl:[7,9,12,191,192,219,432,471],portion:[1,3,9,11,12,15,16,41,54,71,88,91,109,110,112,115,143,144,158,191,194,205,206,209,210,211,212,214,218,228,242,255,257,258,259,261,262,263,291,296,297,299,300,339,354,366,370,378,380,381,382,383,387,388,390,391,395,397,398,400,401,407,411,415,418,427,434,435,455,459,468,469,474,478,479,488,495],poschel:399,posfreq:296,posit:[3,6,14,27,39,40,41,42,46,57,59,70,71,81,89,90,104,105,110,119,120,124,142,143,151,166,167,168,170,171,172,177,179,188,190,192,193,194,197,198,200,202,204,205,206,209,210,211,214,215,216,217,218,219,220,221,224,226,231,232,233,234,236,237,239,240,241,242,244,245,248,249,252,253,255,256,257,258,259,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,280,281,282,284,285,286,289,290,294,296,297,299,302,303,307,310,311,313,314,316,317,318,319,321,323,324,325,326,329,331,332,333,334,335,336,337,340,355,358,365,372,373,375,376,379,391,392,395,397,410,433,440,449,452,457,464,469,472,479,490,495,496],posix:236,posix_memalign:12,possibl:[1,3,6,8,9,11,12,15,38,40,41,55,59,63,70,71,87,115,117,142,143,146,147,161,190,191,192,194,197,199,203,204,210,214,215,216,217,221,223,233,240,280,293,294,296,299,310,314,316,326,327,345,354,356,363,366,367,370,392,401,419,433,437,439,440,452,458,467,473,482,483,484,487,490,495,496,498],post:[],post_forc:8,post_force_integr:8,post_force_respa:8,post_integrate_respa:8,postit:[210,211,269],postiv:86,postma:[286,317],postprocess:13,pot:[399,433],potentail:396,potenti:[],potentiel:415,potetni:402,potin:422,potpourri:9,pour:[],pourtoi:321,pow:220,powderblu:194,power7:17,power8:17,power:[3,9,11,106,142,194,294,355,370,377,467],pparam:[87,198,199],ppm:[12,191,193],ppn:[14,15,16,17,18,370],pppm:[],pppm_disp:3,pppmdisp:3,pproni:[3,232],pr3:167,pr4:167,practic:[3,12,218,255,256,281,288,458,466],prb:[453,455],prd:[],pre:[],pre_exchang:8,pre_forc:8,pre_force_respa:8,pre_neighbor:8,prec:440,prec_tim:14,prece:439,preced:[2,6,59,205,206,207,208,209,210,211,212,238,296,300,339,358,365,370,377,401,483,486,487,495],preceed:[11,12,71,156,207,331,467,495],precipit:166,precis:[1,3,9,12,13,14,15,16,17,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,43,45,46,47,48,49,51,53,54,56,104,111,114,145,155,168,174,175,177,178,179,180,182,183,185,186,188,191,194,200,206,212,213,218,220,227,230,234,239,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,290,291,292,299,301,302,317,319,330,334,340,342,343,345,346,349,351,355,356,363,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,396,397,398,399,400,401,407,408,409,410,411,412,413,414,415,416,420,422,425,426,427,429,432,434,435,440,442,451,452,453,454,455,458,460,461,462,471,472,478,479,482,487,490,494,495,496],precv:466,predefin:[186,194,337,395],predict:[1,6,10,12,269,299,370],preexponenti:483,prefactor:[24,25,28,32,35,36,162,176,187,198,199,207,331,342,346,349,363,385,397,426,434,435,442,461],prefer:[7,8,12,298,327,372],prefix:[9,11,12,193,219,281,463,466],preliminari:[38,56,188,452],prematur:363,prepar:[9,290,293,314,480,490],prepend:432,preprint:[142,441],preprocessor:236,prerecord:219,prescrib:[6,8,146,147,148,161,197,198,203,206,221,252,271,327],presenc:[191,215,216,242,245,416,417,422,461,497],present:[1,3,12,18,166,188,192,193,221,232,233,238,242,243,245,246,294,310,332,335,386,395,406,415,422,433,434,440,466,490],preserv:[3,59,218,220,255,302,314,336,470],press:[],pressdown:213,pressur:[],pressure_with_eviri:395,presum:[73,157,197,198,199,220,365,402,472],prevent:[2,3,6,40,122,221,230,314,325,349,355,361,363,365,370,391,402,428,444,445,447,449,467,471,477,479,490,495],previou:[],previouli:221,previous:[3,11,59,61,71,86,103,119,121,157,168,170,172,190,191,192,194,202,204,205,206,207,209,210,211,212,220,221,231,237,250,252,285,297,299,301,302,326,328,331,332,333,334,336,337,357,399,450,464,467,471,472,482,484,486,487,491,492,493,495,496],prevoiu:332,price:[6,390],primari:[0,6,9,326],primarili:[5,7,9,17,144],primaritli:[],prime:[224,240,400,422,453,455,466],primit:[3,6,334,335,358],princip:[3,236,440],principl:[6,9,11,236,256,290,395,403,422,451,466],prinicp:[42,299,364],print:[],printabl:2,printflag:403,printfluid:242,prior:[166,189,357,498],priori:478,prioriz:370,prism:[3,6,156,170,472],priveleg:3,privileg:[11,12,236],prob:[215,216],probab:442,probabl:[3,8,12,40,71,158,171,172,174,204,214,215,216,217,221,231,240,255,285,331,337,363,424,464,483,490],probe:495,problem:[],problemat:231,proc:[1,3,8,11,12,15,115,191,354,466],proce:[41,54,172,214,225,365,422,476,484,487],procedur:[6,12,39,41,194,204,214,231,239,240,241,255,257,258,259,260,261,262,263,274,275,276,277,278,281,317,318,319,320,323,324,363,365,372,379,470,490],proceed:[12,422],procesor:[41,466],process:[],processor:[],processsor:[41,214,466],procp1:191,procsessor:488,procssor:478,produc:[1,3,4,6,7,9,12,13,14,15,16,17,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,41,42,43,45,46,47,48,49,51,53,54,56,63,65,68,69,71,79,93,110,111,112,114,115,116,117,119,121,143,145,155,166,174,175,177,178,179,180,182,183,185,186,188,191,194,197,200,205,206,207,209,210,211,212,213,214,217,220,227,229,230,232,233,234,239,240,241,250,252,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,285,289,290,291,294,299,300,301,302,315,316,317,319,326,327,328,330,331,334,339,340,342,343,345,346,349,351,356,363,365,368,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,395,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,420,425,426,427,429,430,433,434,435,442,451,452,453,454,455,458,460,461,462,464,466,471,472,474,475,478,483,495,496],product:[6,16,17,18,142,166,220,276,290,327,370,373,395,433,466,495],proessor:370,prof:284,profi:157,profil:[],program:[3,4,6,7,9,11,12,13,17,144,191,193,194,195,197,219,229,236,242,293,393,467,468,480,495],programm:[13,17],progress:[1,41,214,236,253,289,362,363,365,487,490],prohibit:479,project:[6,7,13,14,362,450],promis:7,promot:377,prompt:[8,11,12,236,480],proni:[3,232,233],proofread:8,prop:[6,288],propag:[4,9,202,255,289,304,395,402],propens:6,proper:[217,280,419,467],properati:288,properli:[200,226,299,310,364,365,467,496],properti:[],propoerti:314,proport:[6,39,41,87,104,105,164,214,239,240,241,289,322,329,330,399],proportion:239,propos:[6,142,204,218,231,255,276,294,407,421,454,456],prospect:7,protect:314,protein:[7,10,168,297,299,312,469,477],protocol:236,proton:[455,462,494],prototyp:[10,42,429],prouduc:[212,328],prove:242,proven:276,provid:[1,3,4,6,7,8,9,11,12,13,14,15,16,17,18,29,40,42,61,67,70,120,141,144,162,166,167,168,192,193,195,205,206,212,217,218,219,220,229,231,236,238,242,246,253,255,281,289,290,293,294,299,303,321,323,324,327,328,339,353,355,356,361,365,370,372,377,379,384,386,387,391,394,395,399,401,404,406,415,416,419,421,422,430,431,432,433,440,441,449,450,451,453,454,455,458,466,471,477,479,482,483,487,488,495],proxim:190,psa:334,pscreen:[3,12,478],pscrozi:[0,7,13],psec:[194,220,235,239,240,255,286,299,317,318,489,494],psend:466,pseudo:[395,464,469,474],pseudodynam:321,pseudopotenti:[9,422],psf:6,psi:[396,461],psi_ij:396,pstart:[3,255,256,260,286,299],pstop:[3,255,256,260,286,299],pstyle:[87,109,198,199],psu:[432,433],psuedo:474,pt2:167,pt4:167,ptarget:218,pthread:[12,17],ptr:[6,11,229,467],ptype1:117,ptype2:117,pu3:167,pu4:167,pu6:167,publicli:5,publish:[7,242,246,290,387,419,422,453,455],pull:[303,311],puls:326,pump:[416,417],punctuat:[2,464,483],purchas:193,purdu:[9,13],pure:[11,314,402,420,421,453,455,478],purg:[3,470],purpl:[2,194],purport:11,purpos:[3,6,7,12,42,61,71,120,130,136,151,152,167,168,170,172,188,191,210,212,217,218,239,280,282,285,287,298,314,355,370,381,405,411,422,424,457,469,472,476,479,481,482,495,499],push:[3,8,200,213,220,237,254,280,297,303,363,399,442],pushd:237,put:[3,6,8,11,12,13,39,59,156,168,191,221,225,333,334,337,358,432,467,469,473],putenv:[480,495],px1:478,px2:478,pxx:[218,255,286,299,355,356,486,487],pxy:[3,6,487],pxz:[3,6,487],py1:478,py2:478,pydir:11,pyi:[218,255,286,299,355,356,487],pymol:[7,11,13],pymol_aspher:[],pympi:11,pypar:11,python:[],pythonpath:11,pyz:[3,6,487],pz1:478,pz2:478,pzz:[218,253,255,286,289,299,355,356,487],q_1:440,q_2:440,q_3:440,q_c:[],q_d:490,q_i:[396,415],q_j:415,qbmsst:[],qcore:290,qdamp:290,qdist:[387,407,411,415],qeq1:290,qeq2:290,qeq:[],qeqal:440,qeqallparallel:440,qfile:[290,387],qin:235,qinitmod:440,qmin:362,qmmm:[],qmol:293,qout:235,qstep:290,qtb:[],quad:[12,18,370,466],quadrat:[],quadratur:[87,203],quadrupl:371,quadruplet:[184,187,340,342,343,344,346,348,349,350],qualifi:[3,238],qualiti:[7,9,193,194],quantic:440,quantit:[74,81,104,105,106,164,399],quantiti:[],quantum:[6,9,142,229,233,282,289,293,294,377,395,422,440,450],quantum_temperatur:289,quartic:[],quartic_spher:203,quartz:[289,294],quasi:282,quat:479,quaternion:[3,6,40,82,115,132,146,147,168,257,258,261,262,265,266,267,274,275,398,469,479],quati:[115,469],quatj:[115,469],quatk:[115,469],quatw:[115,469],queen:13,quench:[337,464,483],queri:[3,11,54,271,467,495],quest:[6,229],question:[8,9,12,13,280,337,429,495],quick:[0,9,12,14,15,16,17,18,19],quickli:[3,4,8,12,13,39,92,214,220,231,236,314,362,363,365],quickmin:[361,362,363,365,483],quicktim:[4,193],quip:[],quit:[],quot:[2,3,12,192,245,287,339,419,464,465,467,477,495],quotat:440,r10:377,r12:398,r_1:142,r_2:142,r_c:[388,390,397,455],r_cut:[377,418],r_d:490,r_e:396,r_ewald:300,r_fu:[416,417],r_i:[29,142],r_ii:142,r_ij:[29,377,395,430,462],r_ik:430,r_j:29,r_jik:430,r_m:418,r_max:211,r_me:388,r_mh:397,r_min:[211,389],r_ub:20,r_x86_64_32:12,ra2:167,rad2theta:167,rad:337,radhi:472,radial:[63,71,97,98,115,118,142,152,154,159,206,211,241,256,268,277,311,320,363,395,401,424,469,472],radian:[20,21,24,28,32,35,36,38,167,175,186,188,298,340,342,346,349,469,472,479],radiat:[120,167,326],radic:[170,469],radii:[71,76,142,217,221,385,393,398,399,416,417,422,436,438,461,472],radit:395,radiu:[2,3,6,40,42,63,71,76,84,85,89,90,115,120,122,131,132,137,142,161,166,191,193,197,211,237,242,256,259,263,268,272,277,278,292,306,310,311,312,314,316,331,332,335,337,362,376,377,379,385,395,396,399,407,415,416,417,418,419,436,438,440,441,455,461,469,472,479,495],radlo:472,rafferti:329,rahman:[6,7,218,253,255,256,289,429],rai:[9,17,167],ram:455,ramirez:208,ramp:[],ran:[3,4,6,10,11],random:[3,6,39,168,171,190,193,202,204,215,216,217,219,221,228,231,232,233,239,240,241,242,251,255,282,285,289,294,297,299,314,318,321,326,330,333,379,391,392,464,479,484,490,495,496],random_se:464,randomli:[168,171,204,221,231,239,285,314,336,483,484],rang:[1,3,6,7,8,9,10,12,14,15,16,18,38,39,56,61,71,72,77,88,108,110,111,112,114,118,119,123,142,143,154,162,167,169,172,173,180,188,191,193,194,203,204,216,220,221,231,233,285,300,314,315,321,322,327,329,355,356,363,366,367,370,372,374,377,378,379,380,381,382,383,385,387,388,389,390,391,392,393,395,398,400,401,402,404,407,408,409,410,411,412,413,414,415,416,417,418,419,422,423,424,425,427,430,433,434,435,440,449,450,452,455,460,461,462,463,467,478,479,487,498],rangecoulomb:[],rank:[6,11,12,236,327,353,466],rankin:260,raphson:3,rapid:[4,6,11],rapidli:[3,8,12,71,217,239,253,255,299,317,318,330,387,391],rapp:[290,291,292],rappe_and_goddard:291,rare:6,rasmol:[6,7],rasmussen:398,raster3d:[6,7],rate:[2,6,12,127,134,138,139,151,194,203,220,221,235,236,237,285,289,322,323,324,325,329,361,362,392,416,417,464,483,487],rather:[1,2,6,9,12,40,41,62,114,151,193,214,220,232,233,299,318,326,330,332,333,334,337,395,432,452,470,474,479,481,486,495],ratio:[6,10,59,87,102,142,204,214,220,239,241,314,322,329,330,355,368,398,399,434,444,457,466,469,479,483],rational:[327,481],rattl:[],rattle_debug:302,ravelo:[260,409],rayleigh:[253,289],rb1:167,rbb:440,rbg:194,rcb:[3,41,214],rcm:[89,90],rcmx:[89,90],rcmy:[89,90],rcut:61,rcutfac:[142,441],rd1:365,rdc:17,rdf:[],rdn:365,rdt:365,rdx:4,reach:[6,12,41,121,208,214,216,218,240,260,307,314,321,339,354,369,388,490,495],react:6,reactant:395,reaction:[303,312,325,336,365,395],reactiv:[9,296,372],read:[2,3,6,7,8,9,11,12,13,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37,38,40,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,59,117,166,168,169,171,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,190,191,193,194,195,196,197,203,204,217,218,220,221,231,233,236,252,253,255,257,258,259,260,261,262,263,274,275,276,277,278,281,282,284,285,287,288,292,299,302,303,307,310,313,316,324,325,326,332,340,341,342,343,344,345,346,348,349,350,351,352,354,360,364,365,369,371,372,373,374,375,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,425,427,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,457,458,459,460,461,462,464,466,469,470,471,473,474,475,476,477,479,480,481,483,495,496,497,499],read_data:[],read_dump:[],read_restart:[],read_restart_set:8,readabl:[193,364,476,499],reader:[3,13,470],readi:[11,12,169,171,172,236,479,490,497,498,499],readm:[1,4,6,8,9,11,12,13,166,191,195,293,403,422,432,433,467],real:[3,6,7,11,27,30,31,59,71,91,92,108,142,157,168,177,190,194,202,210,211,220,221,224,236,237,240,252,282,289,294,297,330,331,333,334,336,345,355,356,358,361,367,387,422,424,432,433,455,469,472,478,486,489,494,496],realist:[3,221,473],realiz:[71,197,467],realli:[1,3,8,12,114,124,143,194,237,366,402,481],realloc:3,realtim:236,reamin:[331,335],rearrang:365,reason:[3,6,7,11,12,19,39,149,160,168,206,210,211,239,286,299,323,324,327,337,364,365,370,384,388,395,396,397,417,424,457,459,473,478,496],reax:[],reax_def:3,reaxc:[],reaxff:[3,4,5,7,9,13,197,290,292,295,296,402,432,433,450,481],rebal:[41,214],rebalanc:[41,214],rebo:[],rebuild:[11,12,14,15,16,231,366,391,487],rebuilt:[3,12,191,192,193,195,366,370],recalcul:[71,87,314],receiv:[3,213,236,238,280,466],recent:[],reciproc:[6,12,120,166,167,281,355,378,380,381,387,390,395,407,411,427,435,483],recog:12,recoginz:3,recogn:[3,12,16,73,170,215,216,255,364,393,419,432,467,469,476,477,490],recomend:6,recommend:[7,9,12,14,16,193,194,289,324,355,395,402,416,417,422,433,434,437,439,440,478,488],recompil:[1,3,9,12,195,302],recomput:[103,130,172,225,303,392,481],reconstruct:[3,219,440],record:[195,219,303],recov:[218,255],rectangl:[41,214,358],rectangular:[7,41,62,170,214,231,358,469,471,473],rectilinear:[120,167],rector:53,recurs:[41,214,377,457],recust:41,recv:466,red:[2,10,193,194,217,282],redefin:[3,471,477,495],redirect:12,redo:12,reduc:[],reduct:[18,19,119,120,167,253,289,355],redund:396,ree:445,reed:[253,289],rees:[7,9,13],ref:[323,324,362],refactor:6,refer:[],referenc:[3,6,12,63,68,71,116,191,197,207,212,231,288,328,356,387,401,426,434,467,487,495],reflect:[],reformat:7,refresh:203,reg:472,regard:[6,59,252,302,307,429,433],regardless:[15,71,168,171,190,209,210,220,239,255,257,258,259,261,262,263,286,299,308,314,370,466,472,479],regim:[6,322,329,388,478],region:[],region_spher:8,region_styl:335,regist:[8,118,144,310,432,433],regoin:6,regress:495,regspher:168,regstrip:337,regul:6,regular:[1,3,9,41,62,88,166,170,191,193,204,214,231,326,356,388,405,466,469,471,473],reigon:495,reinhardt:[323,324],reject:[168,217,432,484],rel:[1,6,14,27,36,41,59,71,92,104,124,132,142,146,150,151,153,168,177,194,197,204,210,214,220,221,224,231,237,240,251,252,276,280,285,294,296,297,303,311,314,316,321,322,326,333,337,355,356,363,395,398,399,416,417,419,434,461,470,478,483,487,490,496],relat:[],relatic:[],relationship:[6,290,339,355,440,461,490,495],relax:[],releas:[0,5,7,8,13,215],relect:[3,424],reles:42,relev:[2,6,12,41,78,80,113,130,168,172,194,198,199,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,220,221,222,225,227,228,230,231,232,235,236,242,243,244,246,247,248,249,251,252,254,264,265,266,267,268,269,270,271,272,273,279,283,284,285,287,288,291,293,295,296,297,300,301,302,303,308,312,314,315,316,321,322,325,326,327,328,329,330,331,332,333,334,336,337,355,363,373,374,379,385,387,388,390,391,392,395,397,398,399,400,401,406,408,409,410,412,413,414,416,417,424,425,429,434,442,449,452,460,461,462,466,482,496],reli:[3,12,291,395,433,462,469,479],reloc:12,remain:[7,12,33,37,41,50,55,59,71,87,105,148,149,150,151,155,156,157,158,160,171,181,187,188,191,198,199,204,206,207,210,211,218,220,239,240,247,255,256,261,262,263,274,275,276,278,283,284,306,314,317,318,319,325,326,337,339,347,350,364,377,395,402,415,422,424,450,464,469,470,474,479,481,483,487,490,495,496],remaina:377,remaind:[168,191,221,285,314,327,455,469],remap:[3,6,12,59,61,71,151,168,190,210,220,237,252,276,355,469,470,471],remedi:[6,490],rememb:2,remov:[2,3,6,8,9,13,54,71,72,77,92,108,116,118,142,146,147,148,149,150,151,155,156,157,158,160,161,168,171,172,197,206,210,215,228,239,240,245,251,253,255,261,262,263,274,275,276,278,284,290,299,300,302,314,317,318,319,321,337,355,365,390,417,422,469,472,480,481,495,496],remove_bia:8,remove_bias_al:8,remove_molecul:203,remove_sourc:203,remove_speci:203,ren:167,renam:[12,338,480],render:[12,13,191,193,194],rendon:[255,256],reneighbor:[3,8,12,39,57,71,210,214,231,314,327,337,391,486,487],renssela:284,renumb:71,reorder:[3,12,39,466],repeat:[2,6,193,194,210,217,218,231,307,358,377,453,455,457,464,483],repeatedli:2,repel:237,repes:191,replac:[2,3,6,11,12,41,63,89,90,119,145,146,147,148,149,150,151,154,155,156,157,158,160,161,191,193,194,195,206,207,209,210,211,212,214,217,221,239,260,287,294,296,387,409,470,471,476,477,487,495,496,497,499],replic:[],replica:[],replica_fil:12,report:[],repositori:[7,12,403,431,432,433],reprens:326,repres:[1,3,6,8,9,12,15,40,41,42,59,67,71,90,115,118,180,188,191,193,206,207,208,209,210,211,212,218,224,232,234,239,242,255,282,284,286,294,299,300,303,311,326,328,335,356,365,371,377,398,405,415,416,417,419,420,421,427,430,432,433,456,457,464,466,469,479,481,484,490,495,497],represent:[3,6,8,9,57,59,136,170,191,232,233,282,326,377,395,398,422,434,469,472,490],reprocess:474,reproduc:[3,255,332,387,393,399],repul:419,repuls:[6,7,9,36,40,45,46,110,237,290,331,332,335,372,376,377,385,387,391,395,399,401,415,419,423,440,449,455,458,461,462,479],reqir:[290,292],request:[3,6,8,12,41,104,171,188,191,236,242,297,314,316,353,355,424,432,433,464,474,479,483,495,496,497],requir:[],rerun:[],rescal:[],research:[5,7,242,246,422,464,483],resembl:294,reserv:[12,236,490],reservoir:[91,231,235,239,326],reset:[],reset_atomic_reference_posit:203,reset_dt:8,reset_target:8,reset_tim:203,reset_timestep:[],resid:13,residu:236,residue1:366,resist:[6,236],resolut:[208,440,452],resolv:[218,282,314,417],resort:3,resourc:[7,371,393],respa:[3,16,225,236,255,368,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,420,421,422,423,425,427,429,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,460,461,462,477,478,489,495],respecifi:422,respect:[1,6,9,10,13,14,15,17,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,42,43,45,46,47,48,49,51,53,54,56,59,70,71,87,89,97,98,111,114,120,124,145,150,153,155,162,166,167,174,175,177,178,179,180,182,183,185,186,188,193,194,210,211,216,217,218,220,234,237,239,240,242,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,290,291,299,300,303,311,313,326,331,334,340,342,343,345,346,349,351,353,355,356,360,363,364,369,370,371,372,374,376,377,378,379,380,381,382,383,385,386,387,390,391,393,394,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,419,420,422,424,425,426,427,429,434,435,439,440,441,442,451,452,453,454,455,456,458,460,461,462,466,470,478,479,482,490,495,497,499],respon:9,respond:[6,7,151,220,395,429],respons:[6,7,253,322,329],resquar:[],rest:[6,8,12,288,292,298,377,417,419,486,487,490],restart1:282,restart2:282,restart2data:[],restart:[],restartfil:[12,13],restor:[3,8,60,61,104,168,198,199,288,303,311,316,486,487],restore_bia:8,restore_bias_al:8,restrain:[],restraint:[9,219,253,298,313,406],restratin:298,restrict:[],result:[1,2,3,6,7,9,11,12,13,15,16,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,41,43,45,46,47,48,49,51,53,54,56,63,64,66,67,71,75,87,90,91,94,104,105,107,111,112,114,116,117,118,119,120,121,143,145,148,151,155,162,163,165,167,168,171,174,175,177,178,179,180,182,183,185,186,188,190,191,193,194,197,200,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,224,227,230,231,232,234,239,240,242,246,253,255,257,258,259,260,261,262,263,264,265,272,274,275,276,277,278,281,282,290,291,296,297,299,301,302,314,317,319,322,323,324,326,327,328,330,331,332,334,336,339,340,342,343,345,346,349,351,355,356,365,368,370,371,372,374,378,379,380,381,382,383,385,386,387,390,391,393,394,395,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,417,419,420,422,424,425,426,427,429,433,434,435,442,451,452,453,454,455,456,458,460,461,462,464,466,469,471,472,473,474,478,479,480,481,483,494,495,496],resum:495,retain:[2,215,216,377,422,466],retart:[33,50,181,347],retir:432,retreiv:8,retriev:[6,8,229,420,421,495],reus:[3,481],rev:[6,13,64,70,92,108,112,142,143,156,204,233,239,241,253,255,256,260,276,281,291,294,299,303,314,318,321,323,324,329,362,377,385,386,387,390,393,394,395,398,399,404,409,416,417,418,419,421,430,434,441,451,453,454,455,458,464],revers:[2,6,8,87,179,217,237,255,279,280,290,307,322,323,329,365,415,478,490],review:[142,290,303,321,422,431,441,464,483,490],rewind:354,rewrap:191,rewrit:[5,12],rewritten:19,rezwanur:429,rfac0:[142,441],rfactor:314,rfile:299,rg0:312,rgb:194,rh3:167,rh4:167,rhaphson:3,rheolog:6,rhi:452,rho0:[419,437,439,447,448],rho0_meam:419,rho:[],rho_0:[447,448],rho_alpha_beta:393,rho_bkgd:419,rho_colloid:331,rho_e:326,rho_fin:325,rho_i:[420,421],rho_initi:325,rho_ref_meam:419,rho_wal:331,rhodo:10,rhodopsin:[1,10],rhosum:[],ribier:362,richardson:299,richi:[9,19],rick:[290,291,386,440],rick_and_stuart:291,ridg:[9,19],right:[3,6,11,12,41,144,168,186,187,190,214,217,237,242,252,279,339,358,387,469,472,479,495],rightmost:[41,214],rigid:[],rigidifi:299,rii:[89,90],rij:[92,108,215,216,280,391,449],rin:[401,412,413],ring:[],rino:[73,458],rinv:355,rirj:[332,399],rise:[],risi:[142,441],risk:[8,298,478],rix:[89,90],rjk:[215,216],rjone:[7,9,13],rlo:452,rmask:[3,495],rmass:3,rmax:[71,169,215],rmdir:480,rmin0:[142,441],rmin:[71,169,216,409],rmsd:325,rnemd:6,robert:9,robin:194,robust:[361,362,363],rock:419,rockett:430,rod:299,rodata:12,rodnei:294,roi:7,role:321,roll:12,ronchetti:108,room:[57,59],root:[11,87,89,90,192,321,325,370,393,476],rosati:39,rose:419,ross:419,rosski:282,rosybrown:194,rot:[6,91,282,298,321,496],rotat:[],rotation:108,rotaton:472,rough:[6,168,193,336],roughli:[7,10,12,41,151,193,208,231,239,240,254,255,269,286,299,314,317,318,321,356,365,370,436,438,471,478],round:[],rous:232,rout:[87,401,415],routin:[5,6,8,11,15,16,38,39,56,88,172,174,242,422,431,452,482],roux:[6,224,240,456,490],row:[6,65,66,68,69,75,79,90,93,94,105,107,110,116,117,118,121,148,156,163,165,166,167,206,207,209,210,211,212,245,299,326,328,336,395],royalblu:194,rozero:419,rperp:[252,307],rpi:284,rpm:12,rrespa:[1,3,5,7,8,16,198,199,252,255,366,371,372,373,374,375,376,378,379,380,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,420,421,423,425,427,429,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,457,458,460,461,462,478],rspace:3,rsq:[452,459],rsurfac:326,ru3:167,ru4:167,rub:20,rubia:[420,421],rudd:[424,452],rudra:[7,9],rudranarayan:[7,284],ruiz:204,rule:[],run1:[6,369,495],run2:[6,352,354,369,495],run3:[6,369,495],run4:[6,369,495],run5:[6,369,495],run6:[6,369,495],run7:[6,369,469,470,474,495],run8:[6,369,495],run:[],run_styl:[],runloop:354,runtim:[12,17,193,370],russia:9,rutherford:326,rutuparna:[453,455],ryan:9,ryckaert:[302,349],rycroft:166,rydberg:422,s00:429,s0st:6,s2050:1,s2629:393,s319:203,s_fact:304,s_i:[6,395],s_ij:6,sack:7,saddl:[254,365],saddlebrown:194,sadigh:[204,393,420,421],saed_vtk:120,safe:[12,193,224,240,370],safe_zon:3,safest:[3,314],safeti:304,safezon:433,safran:461,sagui:[356,390],sai:[1,3,12,13,194,432,433,467],said:363,sakai:454,sall:[9,440],salmon:194,salt:[388,397,419,469],salter:440,same:[1,2,3,4,6,8,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,38,39,40,41,43,44,45,46,47,48,49,50,51,53,54,56,57,59,62,63,65,69,71,72,77,79,81,82,84,85,87,88,89,90,91,92,93,95,98,104,105,106,108,110,111,112,114,115,117,118,119,142,143,144,145,146,147,148,149,150,151,154,155,156,157,158,160,161,162,164,166,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,185,186,188,189,190,191,192,193,194,197,198,199,200,203,204,206,209,210,211,212,213,214,215,216,217,218,220,221,225,226,227,230,231,232,233,234,235,236,237,238,239,240,241,242,245,252,255,257,258,259,260,261,262,263,264,265,272,274,275,276,277,278,280,281,282,284,285,286,289,290,291,292,294,295,296,297,298,299,301,302,303,308,311,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,332,333,334,335,337,339,340,341,342,343,345,346,349,351,355,356,358,359,360,364,365,366,367,368,369,370,371,372,374,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,406,407,408,409,410,411,412,413,414,415,416,417,419,420,423,424,425,426,427,429,430,434,435,440,442,449,450,451,452,453,454,455,458,460,461,462,464,466,467,469,470,471,472,474,477,478,479,480,481,482,483,487,490,494,495,496,498],sampl:[1,2,4,6,9,10,11,12,14,91,104,146,147,161,166,190,193,206,207,210,211,219,221,229,231,233,235,255,256,282,285,294,296,300,311,312,314,318,321,324,336,366,377,392,469,483],sample_frequ:203,san:429,sandia:[0,5,7,9,13,14,17,70,113,396,419,429],sandybrown:194,saniti:[298,366],satellit:[6,150],satifsi:495,satisfi:[3,12,73,120,142,167,218,242,260,302,334,363,366,399,483],satur:388,save:[6,8,12,19,40,59,188,193,208,217,232,233,239,240,241,285,294,326,356,366,368,377,471,474,481],sb3:167,sb5:167,sc3:167,scalabl:[],scalar:[],scale:[0,1,3,4,5,6,9,10,13,18,40,59,63,71,72,91,115,118,119,142,154,162,188,190,191,193,194,197,198,199,203,204,207,218,220,231,235,236,237,239,241,242,253,255,257,258,259,260,261,262,263,282,286,289,290,299,305,306,314,316,318,321,323,324,326,330,337,355,356,358,364,367,371,372,373,388,392,395,399,402,416,417,419,422,429,436,438,456,470,472,474,478,481,483,486,487,495,496],scale_factor:[436,438],scalegamma:242,scalexi:[3,218,255,260],scalexz:[218,255,260],scaleyz:[218,255,260],scan:[194,216,354,470],scatter:[11,120,167],scatter_atom:11,scatter_coord:11,scenario:[6,40,61,217,288,297,314,327,335,366,473,474,478,486],scf:490,schaik:415,schedul:464,schell:454,schemat:217,scheme:[6,9,18,232,233,255,282,294,302,326,355,456],schlitter1:325,schlitter2:325,schlitter:325,schmid:391,schneider:[239,241],schoen:355,schr:490,schroding:395,schroeder:[108,490],schulten:[240,303,356,490],schunk:314,schwen:9,sci:[73,334,386,421,430,440],scienc:[8,203,217,236,303,323,393,420,440,454],scientif:[142,393],scm:11,scratch:[12,41,214],screen:[],screenshot:11,scripe:11,script:[],scripta:67,scsl:12,sdk:[],sea:11,seagreen:194,seamlessli:288,search:[0,2,3,8,12,92,108,169,171,194,195,314,361,362,363,365,367,464,470,471,483,495],seashel:194,sec:[12,489,494],second:[1,3,6,9,10,11,12,16,54,57,59,61,71,88,91,104,106,108,114,135,136,140,143,144,156,162,166,167,169,170,171,190,191,194,197,198,206,207,209,210,211,212,217,231,232,237,252,254,282,296,298,299,302,303,311,312,314,323,324,326,337,355,358,362,363,365,366,370,375,377,378,380,381,386,387,393,395,396,399,400,402,405,406,409,419,424,426,440,451,454,455,456,458,462,464,465,466,467,469,471,476,478,482,483,487,490,494,495,496,497,499],second_mo:440,secondari:[3,180],sectinn:498,section:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,58,59,63,64,65,66,67,68,69,71,74,75,78,79,80,81,83,86,87,88,89,90,91,93,94,97,98,99,100,101,102,104,105,106,107,109,110,111,113,114,115,116,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,144,145,146,147,148,149,151,152,153,154,155,156,157,158,159,160,161,162,163,164,166,167,169,174,175,176,177,178,179,180,181,182,183,185,186,187,188,190,191,192,193,195,197,200,201,202,203,204,206,207,208,209,210,211,212,213,214,215,216,217,219,220,221,223,224,226,227,228,230,231,232,233,234,236,238,239,240,241,242,243,244,245,246,248,249,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,270,272,273,274,275,276,277,278,280,281,282,284,285,286,288,289,290,291,292,293,294,295,296,299,301,302,303,304,305,306,307,308,310,314,317,318,319,320,321,322,323,324,325,326,327,329,330,332,333,334,337,338,340,341,342,343,344,345,346,347,349,350,351,356,357,358,360,364,365,367,369,370,371,372,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,424,425,426,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,464,465,466,467,469,470,472,474,477,478,479,480,482,483,484,487,488,490,495,496],section_acceler:[9,12,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,43,45,46,47,48,49,51,53,54,56,111,114,145,155,174,175,177,178,179,180,182,183,185,186,188,200,213,220,227,230,234,239,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,291,299,301,302,317,319,330,334,340,342,343,345,346,349,351,356,371,372,374,378,380,381,382,383,385,386,387,390,391,393,394,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,420,425,426,427,429,434,435,442,451,452,453,454,455,458,460,461,462,472,478],section_accerl:393,section_command:[0,1,9,339],section_error:[7,12],section_exampl:[2,6],section_histori:[7,12],section_howto:[6,8,9,11,12,40,42,57,59,64,66,67,68,70,71,72,73,75,76,77,78,80,81,82,83,84,85,86,87,89,90,92,94,95,96,97,98,99,100,101,102,105,107,108,111,112,113,116,118,119,122,137,138,139,140,142,143,148,150,162,163,165,166,170,189,206,254,267,270,273,329,375,389,464,469,472,483],section_modifi:[6,7,42,191,193,487],section_packag:12,section_perf:7,section_python:[6,12],section_start:[3,4,6,9,11,359,365,463,464,478,484,487],section_tool:[6,7],see:[1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,248,249,250,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,272,273,274,275,276,277,278,280,281,282,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,301,302,303,304,305,306,307,308,310,311,313,314,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,337,338,339,340,341,342,343,344,345,346,347,349,350,351,352,355,356,358,359,360,362,363,364,365,366,367,369,370,371,372,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462,463,464,465,466,467,469,470,471,472,474,475,476,477,478,479,481,482,483,484,485,486,487,488,489,490,495,496,497,498,499],seed1:484,seed2:484,seed:[3,168,171,190,193,202,204,215,216,217,219,221,228,231,232,233,239,240,241,242,282,285,289,294,299,314,318,321,326,333,379,391,392,464,479,484,490,495,496],seed_com:240,seed_drud:240,seek:[41,214],seem:[6,218,327,362,419,478],seen:[12,242,335],segement:3,segment:[3,4,6,7,12,40,42,82,115,193,197,270,299,314,391,405,433,449,450,469,477,479],select:[6,12,15,59,61,71,119,120,157,162,167,168,188,193,195,202,204,210,211,220,221,228,231,236,237,252,303,313,321,322,327,329,331,333,334,336,353,355,361,365,367,370,401,406,419,440,466,470,472,478,479,483,488,495],self:[],sellerio:13,semi:[3,195,203,204,279,281,470],semiax:146,semimet:395,send:[0,3,5,7,8,11,12,194,236,466],sender:[3,466],sens:[1,3,6,7,18,39,41,42,59,71,104,187,191,206,209,210,211,212,214,217,220,232,233,238,239,240,241,285,289,294,300,314,321,322,326,329,337,365,387,407,411,453,454,455,464,469,474,478,481,486],sensabl:236,sensibl:105,sensit:[2,6,73,218,294,496],sent:[194,236,353],sep:[6,11,495],separ:[2,6,7,9,12,13,40,41,76,118,124,142,168,171,193,194,195,203,207,214,215,216,217,218,221,224,231,239,240,255,269,282,285,286,288,290,294,299,302,314,317,318,319,322,329,337,356,370,378,380,387,388,390,407,416,417,419,426,431,441,450,451,452,455,461,467,469,470,471,478,481,486,490,496,497,498],seper:388,sequec:495,sequenc:[2,3,12,41,59,191,193,194,195,214,233,254,337,358,365,402,430,484,495],sequenti:[59,60,194,430,470],sequestr:7,ser:281,seri:[3,4,6,9,13,18,142,191,193,194,207,212,232,233,285,369,372,398,419,422,424,434,442,452,467,476,477,486,487,495],serial:[],serial_icc:12,serious:8,serv:[6,130,170,314,449],server:[1,238,370],set:[],set_callback:229,set_energi:229,set_vari:[6,11,467],setarea:242,sete:[206,217],setenv:[11,12,384],setfl:[13,371,393],setforc:[],setgamma:242,setmask:8,settl:218,setup:[3,4,6,7,8,11,12,13,16,37,40,55,59,71,87,91,156,169,170,171,172,187,194,203,217,220,314,327,350,366,367,370,450,466,469,477,497,499],setup_pre_exchang:8,setup_pre_forc:8,setup_pre_force_respa:8,setvel:[],seven:421,seventh:[135,140],sever:[1,4,5,6,7,8,10,11,12,13,15,18,39,40,63,71,87,162,169,172,187,191,192,195,197,203,215,216,218,233,239,242,246,255,284,286,288,299,303,314,321,330,353,358,363,370,373,377,381,392,393,402,411,415,419,424,430,432,433,439,440,464,467,471,475,483,487,490,495,496],sexton:422,sfactor:[3,193,194,364],sfftw:12,sgi:12,sgmc:204,sgrid:314,sgroup:166,shade:193,shake:[],shan:[17,290,291,386],shanghai:[9,13],shape:[2,3,6,8,40,41,58,59,62,71,82,115,132,146,151,152,168,170,190,193,194,197,198,210,214,218,220,239,253,255,257,261,265,266,274,276,289,314,327,335,375,398,434,466,469,470,471,479],shapei:[115,469],shapex:[115,469],shapez:[115,469],shapshot:474,share:[],shared0:[],sharon:299,sharp:[335,419,455],shawn:9,shear:[3,4,5,6,7,9,59,61,151,190,218,220,242,255,276,314,329,332,399,416,417,429,437,439],sheet:473,shell:[],shen:9,shenderova:372,sheppard:362,shflag:12,shield:[],shift:[],shiftse:314,shiga:[6,255,256],shini:[193,498],shinoda:[6,9,255,256,435],shiny:193,ship:195,shlib:[11,12],shlibflag:12,shock:[4,9,197,202,253,260,289,333,409],shockvel:[253,289],shortcut:[218,255,286,299],shorter:[3,121,231,280,367,424,477],shortest:[193,367,373,478],shorthand:194,shoul:457,should:[1,2,3,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,35,38,39,40,41,42,43,44,45,46,47,48,49,51,53,54,56,59,61,70,71,73,81,83,87,91,97,98,99,103,104,105,111,112,114,143,145,146,147,150,151,154,155,156,158,161,164,168,170,172,174,175,176,177,178,179,180,182,183,185,186,188,189,190,191,193,194,198,199,200,201,204,208,213,214,215,216,217,218,220,221,223,224,226,227,228,229,230,231,232,233,234,235,237,239,240,241,242,244,245,246,247,252,255,257,258,259,260,261,262,263,264,265,269,272,274,275,276,278,280,281,282,283,284,285,286,287,289,290,291,292,293,294,295,296,297,298,299,301,302,308,311,314,315,317,318,319,320,321,322,325,326,327,329,330,331,332,333,334,335,336,337,339,340,341,342,343,345,346,349,351,356,358,359,361,363,364,365,366,367,368,370,371,372,374,375,376,378,379,380,381,382,383,384,385,386,387,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,407,408,409,410,411,412,413,414,415,416,417,419,420,422,424,425,426,427,428,429,431,432,434,435,436,438,440,442,449,451,452,453,454,455,456,458,460,461,462,464,465,466,467,469,470,471,472,473,474,476,477,478,479,481,485,486,487,490,495,496,497],shouldn:[3,8],show:[6,11,12,118,280,365,401,419,422,452],shown:[1,12,16,17,41,97,98,120,142,154,167,187,214,217,239,255,276,282,285,294,321,355,395,396,398,399,415,422,434,440,469],shrank:71,shrink:[3,6,41,57,59,71,170,190,191,193,198,199,202,214,220,221,237,242,280,314,333,337,355,356,363,387,407,411,424,469,470],shrunk:71,shut:[6,11,366,468],si4:167,siam:334,sic:[4,387,402,419,426,451,453,455,458],sic_tersoff:430,sicc:[394,451,453,455,458],sicg:[453,455],sicsi:[394,451,453,455,458],side1:472,side2:472,side3:472,side4:472,side:[3,8,41,57,61,71,158,168,204,205,214,217,221,231,237,242,252,280,285,293,311,331,335,336,337,365,387,398,399,434,457,467,469,472,479],sidewai:4,sienna:194,siepmann:329,sigam:385,sigam_ii:[],sige:[453,455],sigma0:377,sigma14:415,sigma1:377,sigma2:377,sigma:[3,6,10,45,46,50,54,87,174,191,194,198,199,231,242,280,314,330,331,335,358,367,370,372,375,376,377,378,382,383,385,390,391,392,394,395,398,400,401,405,406,407,408,409,410,411,412,413,414,415,418,423,424,434,435,445,451,457,478,494,495,496],sigma_14:382,sigma_:388,sigma_c:385,sigma_cc:[372,385],sigma_h:397,sigma_i:[396,424],sigma_ii:457,sigma_ij:[424,457],sigma_j:424,sigma_max:392,sigma_ss:385,sign:[3,6,12,179,187,279,311,334,339,422,477,486,495],signal:468,signicantli:17,signifi:[3,66,75,90,94,105,107,116,148,163,165],signific:[7,12,18,86,232,253,256,294,314,327,395,398,419,422,424,497],significantli:[1,6,39,143,166,242,255,298,395,451],sij:207,sikandar:17,silbert:399,silent:[194,467,480],silicon:[394,419,451,469],sill:429,silver:194,sim:[9,435],similar:[5,6,7,8,9,11,12,17,18,40,41,42,46,59,68,72,87,114,117,118,143,144,168,169,191,194,197,198,199,206,208,214,229,230,232,239,245,246,256,288,289,294,298,299,318,321,331,332,334,336,356,361,362,364,372,375,377,391,393,395,399,415,416,424,429,430,439,466,471,476,478,483,485,487,490,495,496,497,499],similarli:[3,6,7,8,59,114,164,170,172,190,191,193,194,205,206,209,210,211,212,216,220,226,237,255,257,258,259,261,262,263,284,286,299,300,302,314,321,322,329,335,340,356,358,365,368,381,399,411,451,466,469,472,473,478,479,483,498],simluat:[6,39,194,314,416,470,471],simlul:[299,326],simmul:329,simpl:[],simpler:[8,11,42,194,299],simplest:[3,8,40,66,75,90,94,105,107,116,118,148,163,165,290,490],simpli:[1,3,6,8,11,12,14,17,66,71,75,88,90,94,96,105,107,115,116,121,148,163,165,171,172,194,197,198,199,206,209,210,211,212,216,218,220,224,229,238,240,245,255,282,286,297,299,300,322,328,329,355,356,358,364,365,370,381,390,402,411,419,424,466,467,474,477,484,487,494,495],simplif:395,simplifi:[204,298,422],simplist:11,simualt:356,simul:[],simulatan:370,simulation_nam:433,simulationub:440,simulatoin:[12,470],simult:370,simultan:[6,7,15,16,220],sin:[220,252,331,334,336,430,469,472,479,495],sinc:[0,1,2,3,6,8,9,10,11,12,13,15,16,21,22,33,39,41,44,54,59,61,64,67,71,73,89,90,112,118,120,146,148,158,166,170,171,173,174,176,181,191,193,194,197,198,199,200,201,204,205,206,207,208,209,210,211,212,213,214,217,218,219,220,221,225,226,231,233,235,238,239,241,242,252,255,257,258,259,260,261,262,263,266,269,276,280,282,285,287,288,294,297,299,303,313,314,322,326,327,328,329,331,332,335,336,337,338,340,341,354,356,363,364,365,366,369,370,371,372,377,380,381,382,383,385,386,390,391,392,393,394,398,399,400,402,403,404,405,406,407,409,410,411,412,413,414,415,416,417,418,419,420,421,422,424,427,430,431,432,433,434,435,440,441,442,451,452,453,454,455,458,462,464,466,467,469,470,472,474,477,478,479,480,481,483,487,490,494,495,496,498],sinclair:[7,393,450],sine:430,singapor:142,singh:371,singl:[1,2,3,6,7,8,9,11,12,14,15,16,17,18,40,41,42,57,59,61,63,65,66,68,69,75,77,79,87,88,90,93,94,104,105,107,110,115,116,117,118,119,121,144,148,163,165,166,168,191,193,194,195,197,202,205,206,207,209,210,211,212,214,216,217,218,221,224,228,230,235,242,245,252,255,256,260,269,282,284,285,287,298,299,300,302,304,310,314,316,326,328,331,332,334,336,337,339,355,356,361,364,365,366,367,369,370,371,372,377,382,384,386,392,393,394,395,396,399,400,401,402,403,404,419,420,421,422,426,427,430,431,432,433,434,440,441,442,451,453,454,455,458,464,465,467,469,476,477,478,479,480,481,482,483,486,495,498,499],singleel:377,singular:[415,416,417],sinnott:[291,372,386],sinusoid:[168,220,331,332,334,336],sio2:458,sio:386,sirk:[143,449],sisic:[394,451,453,455,458],sisisi:[394,451,453,454,455,458],sister:384,sit:[281,469],site:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,67,70,87,236,242,243,302,356,371,377,387,393,397,407,411,415,427,432,433,456],situat:[9,166,218,231,242,255,282,300,362,377],sival:167,six:[6,135,140,142,207,209,426,430],sixth:426,sixthpow:[383,424],size:[],size_restart:8,sizei:405,sizej:405,sizex:263,sjplimp:[0,7,11,12],sjtu:9,skew:[3,6,58,59,170,193,220,255,469,472],skin:[3,12,39,61,73,117,169,171,231,269,299,326,366,367,370,405,428,487,494],skip:[12,16,33,181,284,354,364,369,406,469,474,477,486,495],skyblu:194,slab:[3,6,71,156,210,285,311,355,356,366,424],slateblu:194,slategrai:194,slater:[],sleight:54,slepoi:419,slice:[],slider:11,slight:[3,12,326],slightli:[1,6,39,40,191,192,193,195,294,299,356,372,387,407,411,453,455,458,464,477,497],sligthli:390,sliozberg:449,slip:[3,197,314,330,336],sllod:[],slope:[6,104,105,322,324,329,388,495],slot:1,slow:[3,6,7,12,39,232,236,239,240,253,255,314,321,355,365,370,424,440,478,488,490,496],slower:[1,10,17,39,240,356,370,377],slowest:[326,466],slowli:[12,71,214,330,363,422,442,471],slurm:12,slurm_localid:12,sm3:167,small:[],smallbig:3,smaller:[1,3,6,12,16,17,39,56,59,61,71,121,170,191,193,194,204,221,225,231,242,281,299,314,324,339,355,356,361,370,424,450,457,459,469,476,478,495,499],smallest:[3,42,70,71,72,166,253,296,495],smallint:3,smallq:356,smallsmal:[3,12],smart:233,smd:[],smd_contact_radiu:479,smd_lammps_userguid:9,smd_mass_dens:479,smd_user_guid:[],smi:[3,370],smirichinski:9,smit:231,smith:427,smmoth:479,smooth:[],smoother:168,smoothli:[54,142,322,329,382,400,413,415,418,455,462],smpd:12,smtb:[9,440],smtbq:[],smulat:422,sn2:167,sn4:167,sna:[],snad:[],snap:[],snapcoeff:441,snaphot:474,snapparam:441,snapshot:[],snav:[],snb:17,snow:194,soc:401,socket:[12,17,18,238,466],soderlind:422,soft:[],softer:[331,335],softwar:[1,6,11,12,14,15,16,17,18,19,166,236,284,300],sole:[215,216,365,430,437,439],solid:[4,6,7,9,10,39,40,41,59,70,73,91,104,143,166,203,214,218,220,225,245,255,257,258,259,261,262,263,280,281,286,299,321,324,356,358,378,409,422,429,437,439,469],solut:[3,6,13,166,218,225,253,297,302,314,335,495],solv:[3,9,12,18,242,290,302,324,326,356,362,417],solvat:[4,10,168],solvent:[4,7,13,61,71,169,171,214,228,232,233,239,255,297,299,311,314,322,329,330,382,385,387,388,397,407,416,417,434,450,469,479],solver:[],some:[1,2,3,4,6,7,8,9,10,11,12,13,16,17,18,39,40,41,55,61,63,71,103,106,109,115,119,121,146,147,148,149,160,161,162,166,168,171,176,179,187,189,191,193,194,197,198,199,202,204,205,206,207,209,210,211,212,214,216,217,218,219,228,231,253,255,256,287,288,290,292,299,303,315,321,326,327,328,330,331,337,353,354,355,356,361,362,363,364,365,366,367,370,373,375,377,384,387,393,395,402,405,422,424,432,433,450,452,464,466,467,468,469,471,474,475,476,477,478,479,481,483,486,487,494,495,496,499],somehow:3,someindex:338,someon:[7,11,363],someth:[2,3,7,8,11,12,59,218,255,331,334,336,366,402,467,476],sometim:[2,3,6,8,12,18,210,218,255,322,329,355,367],somewhat:[7,9,12,70,104,148,158,206,255,355],somewher:[17,256,395],soon:[42,204,217,228,231,236,432],sophist:[7,144],sorensen:483,sort:[3,13,16,39,71,191,194,195,236,365,366,370,392,470,471,498],sound:[130,242,253,304,447,448],soundspe:[447,448],sourc:[],source_integr:203,sourceforg:11,south:142,souza:322,space:[2,3,6,8,11,12,18,41,59,71,120,142,157,162,167,168,188,190,193,198,199,202,209,210,211,214,216,220,221,237,242,249,252,255,281,282,297,300,304,314,331,333,334,336,339,355,356,358,364,365,366,378,380,381,387,390,393,395,405,407,411,419,422,427,430,435,452,459,461,466,469,472,481,487,490,495,496],spahn:399,span:[2,12,38,71,198,199,210,237,299,355,371,372,377,386,393,396,403,404,419,420,421,426,430,441,451,453,454,455,458,463,464,472,473,495],spars:[71,188],spatial:[],spawn:236,spc:[],spcpu:487,speak:[17,314,321],spearot:[120,167,300],specfi:[12,109,237,472],speci:[],special:[],special_bond:[],specif:[1,2,3,6,7,8,9,10,12,13,15,16,17,18,22,29,33,40,41,42,50,63,71,110,115,117,118,148,150,153,166,168,176,181,191,193,194,195,197,198,199,202,203,206,207,209,210,211,212,214,217,219,228,229,231,232,236,242,250,285,287,288,291,299,321,326,327,331,337,341,356,363,365,370,372,375,377,389,393,398,399,402,403,404,419,422,424,432,433,434,450,451,456,457,466,469,470,474,475,476,478,479,485,486,487,494,495,496,497],specifi:[2,3,6,7,8,9,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,59,61,63,65,66,68,69,70,71,73,75,76,77,78,79,80,81,83,85,86,87,88,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,143,145,148,150,155,156,157,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,185,186,187,188,190,191,192,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,227,230,231,232,233,234,235,237,238,239,240,242,243,244,245,247,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,269,272,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,294,295,296,297,298,299,300,301,302,303,307,308,311,312,313,314,315,316,317,318,319,321,324,325,326,328,330,331,332,333,334,335,336,337,338,339,340,341,342,343,345,346,347,349,350,351,354,355,356,358,359,360,363,364,365,366,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,490,494,495,496,497,498,499],specifii:[233,242],speciti:478,spectral:441,spectrum:[9,142,289,294],sped:[39,253],speed:[1,3,6,9,12,14,15,16,17,18,19,39,41,130,191,194,214,239,242,253,289,304,314,321,327,333,355,356,365,370,377,387,422,424,447,448,453,464,478,484],speedup:[1,18,356,478],spefici:[168,193,401],speicifi:[],spell:472,spellmey:[6,174,481],spend:[12,205],spent:[1,12,13,15,464,483,488],sph:[],sph_lammps_userguid:9,sph_user_guid:[],sphere1:242,sphere:[],spheric:[],spheriod:[3,6],spherioid:314,spheroid:[6,255,272,299,314],spike:118,spin:[9,40,115,332,373,395,469],spirit:[7,208],spit:3,spline:[],split:[1,3,6,11,12,18,41,206,210,214,240,255,334,355,370,457,463,466,478],splittol:[6,355],sppark:6,spread:[1,6,12,339,477],spring:[],springer:303,springgreen:194,sptial:71,sputter:221,sq2:[3,358],sqrt:[2,3,42,59,81,89,108,231,239,241,280,314,330,332,358,385,391,393,397,399,419,424,495],squar:[],squeez:[218,237,416,417],squibb:[5,7],sr2:167,src:[0,1,3,4,6,7,8,9,11,12,14,15,16,17,18,19,166,191,229,302,422],srd:[],srmax:71,srmin:71,srolovitz:393,srp:[],srtio:440,srun:12,ssao:[193,498],stabil:[6,9,239,255,377,432],stabl:[6,64,130,242,260,298,304,377,490],stabli:232,stack:[3,8,70],stage:[3,8,87,197,229,254,293,337,365,464,483,495],stagger:[1,3,194,356,476,485,495],stai:[3,14,17,198,199,253,271,289,370,469],stamp:[321,470],stamped:12,stan:17,stand:[0,6,7,12,13,295,432,433,467],standard:[],stanford:9,starikov:326,start:[],start_6:397,start_7:478,startstep:495,stat:[12,54,172,280,294,363,391],statcoul:494,statcoulomb:494,state:[],statement:[3,467,468],stationari:[],statist:[3,6,12,39,41,64,208,215,216,217,232,233,239,240,241,284,285,289,294,299,302,314,325,326,327,363,365,372,391,392,399,416,461,464,471,477,479,483,486,487],statu:[3,12,54,60,123,172,219,224,240,386,468,483],statvolt:494,std:12,stdin:[3,12,354],steadi:[6,253,260,289],steelblu:194,steep:452,steepest:[7,362],steer:[7,9,219,222,303],stegailov:326,steinhardt:[63,108],steinhaus:490,stencil:[3,242,355],step:[1,2,3,6,8,10,11,12,13,14,15,16,17,18,19,39,71,91,97,98,112,118,119,130,143,154,164,166,191,192,193,194,195,197,198,199,203,204,206,207,208,209,210,211,212,214,215,216,217,218,220,221,224,225,228,229,231,233,236,237,240,253,269,280,281,287,288,289,290,291,292,300,302,303,304,314,316,319,320,321,322,323,324,325,326,327,328,329,336,337,339,354,355,361,363,365,366,391,397,401,419,422,432,433,440,464,466,467,471,473,474,476,477,478,483,484,486,487,490,495,499],stepani:303,stepwis:87,stesman:321,steve:[0,5,7,13],steven:217,stiff:[6,40,51,215,216,281,282,363,429,490],stile:388,still:[1,3,6,9,11,12,13,14,17,38,41,61,71,92,110,118,166,172,188,189,191,194,198,199,214,235,239,269,290,294,314,326,339,355,356,361,383,393,398,399,402,406,416,428,432,434,442,450,469,471,477],stilling:[3,5,7,15,88,144,394,421,430,450,451,458,481],stipul:236,stl:[9,71,307,310],stl_surf:310,stochast:[4,7,9,197,233,314,321,336,392],stockmay:40,stoddard:390,stoichiometri:440,stoke:[242,330],stoll:[239,241],stone:[9,19,356,390],stop:[],stopstep:495,stopthresh:[41,214],storag:[3,12,15,328,370,481],store:[],store_st:315,storm:12,stouch:7,str:495,straatsma:6,straddl:[3,59,61,158,237,299,311,337,469,473,479],straight:299,straightforward:[13,395,490],strain:[2,3,6,59,80,123,126,127,132,133,134,138,139,190,218,220,253,255,260,416,417],strang:[188,193,495],strategi:[],stratford:242,strcmp:339,stream:[3,6,114,143,148,151,152,193,203,220,232,233,239,240,276,285,294,314,496],streamlin:[12,477],streitz:[],streiz:387,strength:[3,9,142,162,173,193,298,331,335,376,402,433,434,481],stress:[],stretch:[3,54,59,119,215,303],strict:441,strictli:[6,41,188,214,253,289,321,469],stride2:495,stride:[194,233,476,485,495],strietz:387,strike:221,string:[2,3,6,11,12,41,168,191,192,194,206,207,208,209,210,211,212,214,231,287,300,339,357,369,419,430,431,432,441,465,467,469,479,480,486,487,495],strip:495,strong:[290,372],stronger:6,strongest:[416,417],strongli:[1,6,13,221,299,302,326,422,490],structrur:3,structur:[],structured_point:300,strucur:73,stuart:[290,291,372,386,440,450],stub:12,stuck:218,student:284,studi:[6,106,409,440],studio:[],stukowski:[204,393],style1:[33,50,181,347,402,469],style2:[33,50,181,347,402,469],style:[],style_nam:[255,256],stylecomput:440,stylist:8,sub1:480,sub:[1,3,4,6,7,8,9,11,12,13,18,33,37,39,40,41,42,50,55,58,61,63,68,87,91,109,142,162,170,181,187,192,193,194,198,199,214,218,220,255,256,260,281,289,294,299,302,326,327,335,337,347,350,358,360,370,375,386,392,398,399,401,402,405,424,432,433,434,440,456,457,462,466,469,472,478,486],subbox:[119,193,194],subcutoff:405,subdirectori:4,subdivis:242,subdomain:242,subequ:11,subgroup:[191,498],subinterv:192,subject:[6,41,171,214,456],submit:[],subramaniyan:13,subroutin:370,subscript:[11,326,340,396,458,495],subsequ:[6,11,12,41,59,104,169,194,208,214,218,231,321,326,327,328,358,369,393,450,467,469,470,476,479,480,489,495,499],subset:[6,11,12,16,41,80,142,191,194,214,251,255,257,258,259,260,261,262,263,285,286,290,299,365,370,372,377,402,424,463,466,469,471,474,478,495],substanti:[6,16,451,478],substep:255,substitut:[1,2,3,12,191,238,365,369,395,424,467,480,495],substract:387,substrat:[170,218,255,257,258,259,261,262,263,286,299,469],substyl:[415,478],subsystem:326,subtl:[95,97,98,233],subtleti:154,subtract:[3,6,54,63,71,91,95,98,103,104,106,114,143,145,146,147,148,149,150,151,152,154,155,156,157,158,160,161,191,197,206,231,232,235,239,240,241,243,247,251,276,283,299,337,366,414,469,479,487,495,496],succe:12,succeed:[207,208],succes:208,succesfulli:3,success:[2,6,11,12,14,15,118,191,194,204,207,218,221,231,269,285,299,314,321,339,363,365,467,468,476,477],successfulli:[3,11,191,221,467,480],successulli:11,successv:474,sucessfulli:3,sudden:36,suddenli:335,sudo:[11,12],sufac:42,suffer:[16,17,18,329,335,370],suffici:[2,3,7,17,18,41,61,71,192,210,214,253,255,281,314,321,328,331,339,406,424,469,490],suffix2:12,suffix:[],suggest:[0,6,7,12,253,289,467,490],suit:[7,9,13,199,242,395],suitabl:[4,12,13,17,54,87,191,217,288,318,377,384,399,415,419,432,433,464,483],sukumaran:208,sum:[3,6,8,9,12,40,70,71,76,80,83,88,89,90,92,95,99,104,106,108,109,111,112,114,118,119,125,141,142,143,145,148,149,150,151,154,155,156,157,158,160,162,164,165,166,206,207,209,210,211,212,221,229,232,239,240,245,280,281,285,289,294,299,300,303,313,324,326,328,331,335,337,355,356,363,375,387,391,395,396,405,407,410,419,432,433,441,457,467,487,490,495,496],summar:[6,396,440],summari:[],summat:[6,9,42,70,88,108,355,356,381,387,393,394,407,411,422,440,451,453,454,455,458],summer:[3,13,210,432,433],sumsq:119,sun:[21,43,175,340,383,424,433],sunderland:17,sup:[281,289,294,386,440,490],supercomput:[12,18,467],superpos:[402,450],superposit:7,supinski:422,supplement:[233,432,433],supplementari:[219,398,434],suppli:[12,188,231,253,326],support:[1,3,6,7,8,9,11,12,13,14,15,16,17,18,19,40,41,42,61,87,88,103,109,191,192,193,194,195,198,199,200,201,206,214,217,218,219,226,229,233,234,237,239,240,241,242,250,253,255,257,258,259,260,261,262,263,274,275,276,277,278,280,281,286,289,291,293,298,299,301,304,305,306,307,308,310,311,313,317,318,319,320,324,329,331,335,353,354,355,356,362,363,364,370,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,456,457,458,460,461,462,466,470,471,472,476,478,479,480,482,483,489,490,494,495,498,499],suppos:[3,8,396,495],suppress:[6,12,166],sure:[6,8,11,13,14,188,198,199,218,299,302,336,393,452],surf:169,surfac:[2,3,4,6,8,9,40,42,57,70,120,142,166,168,171,193,197,221,228,237,242,245,280,291,298,307,310,311,314,321,326,331,335,336,365,377,402,416,417,422,438,440,457,461,466,472],surface_mov:326,surfact:[388,397],surpris:395,surrog:9,surround:[38,56,70,168,188,194,218,255,257,258,259,261,262,263,280,286,299,452,490],suspect:3,suspens:[416,417],sustain:[191,218,399],suzuki:[255,299],svg:6,svn:[7,11,12],sw_exampl:431,swamp:299,swap:[],swegat:325,swiggl:[3,252,331,334,336,472,495],swiler:[142,441],switch7_section_start:397,switchflag:[142,441],swm4:490,swol:53,swope:6,sxx:194,sy0302:9,symbol:[6,12,120,167,296,377,395,441],symmetr:[6,70,87,94,114,133,134,135,138,139,140,143,198,199,218,255,256,322,329,371,384,390,393,453,455,495],symmetri:[3,5,6,7,8,63,64,70,92,108,170,191,253,280,340,356,371,469,490],sync:[3,6,488],synchron:[1,233,365,488],synechococcu:7,syntax:[],sysdim:281,sysmt:17,sysstem:377,syst:440,system:[],system_:282,systemat:[6,9,208,231,239,422],systemx:3,t10:484,t11:484,t12:484,t13:484,t14:484,t15:484,t3e:12,t_chain:3,t_corr:3,t_correl:464,t_dephas:464,t_e:326,t_e_min:326,t_equil:[323,324],t_event:[3,464,483],t_hi:483,t_infil:326,t_init:[289,326],t_iter:3,t_j:29,t_lb:242,t_lo:483,t_order:3,t_oufil:326,t_out:326,t_outfil:326,t_qm:289,t_switch:[323,324],t_target:379,ta06a:441,ta4:422,ta5:167,ta6:422,tab:[2,469],tabbernor:120,tabinn:424,tabul:[3,7,13,22,37,38,44,55,56,65,71,79,93,188,314,355,371,377,378,380,381,382,383,384,387,393,395,407,411,418,427,430,433,435,450,452,453,459,471],tabular:430,tabulate_long_rang:433,tad:[],tadmor:9,tag:[203,490],tagint:3,tail:[3,87,112,162,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,427,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,457,458,460,461,462,487,495],tailor:[71,327],tait:[9,447,448],taitwat:[],take:[1,2,3,6,11,12,17,20,21,22,23,24,25,26,27,28,29,30,31,32,35,38,39,40,41,42,43,44,45,46,47,48,49,51,53,54,56,59,77,87,89,91,111,114,115,118,119,143,145,155,162,166,172,174,175,176,177,178,179,180,182,183,185,186,188,191,193,194,198,199,200,213,214,218,220,227,230,234,238,239,240,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,291,299,301,302,311,312,313,314,316,317,318,319,327,330,334,337,340,341,342,343,345,346,349,351,355,356,360,370,371,372,374,377,378,379,380,381,382,383,384,385,386,387,390,391,393,394,396,397,398,399,400,401,407,408,409,410,411,412,413,414,415,416,420,422,425,426,427,429,432,433,434,435,440,442,449,451,452,453,454,455,456,458,460,461,462,463,467,470,472,477,478,479,486,487,488,495],taken:[6,59,150,168,190,217,221,231,232,233,239,240,241,242,285,289,292,326,345,393,395,398,451,458,464,478,479],talk:[6,7],talli:[],tan:[194,495],tandem:[4,16,299],tang:422,tangent:[42,254],tangenti:[6,110,314,332,336,376,399],tanh:326,tantalum:[4,422,441],taper:[3,292,418],tar:12,tarbal:[0,8,11,12],target:[3,6,7,8,9,11,12,17,39,41,194,202,214,218,219,221,231,232,233,239,240,241,255,256,257,258,259,260,261,262,263,274,275,276,277,278,282,286,289,294,299,303,312,317,318,319,320,325,326,329,330,333,353,356,379,391,464,475,477,496],target_fil:325,task:[1,6,7,12,13,14,15,16,17,18,54,194,236,282,327,370,467,488],taskset:16,tatb:[4,295],tatom:490,tau:[3,157,208,239,240,242,255,286,299,317,318,323,324,326,489,494],tau_1:232,tau_k:232,tau_n_k:232,tb3:167,tbead:160,tbp:377,tchain:[255,256,260,276,277,299],tcl:294,tcom:240,tcsh:[11,12,384],tdamp:[239,255,256,260,299,317,318],tdephas:464,tdrude:[153,224,240,490],teal:194,tech:[7,9,13],technic:[6,7,9,242,292,314,433],techniqu:[6,7,9,87,197,218,253,289,299,330,333,356,424,452,490],technolgi:9,technolog:[9,14,19,236],tell:[2,6,11,12,37,55,187,197,281,350,366,432,433,450,467,471,490],telsa:17,temeperatur:11,temp:[],temp_drud:490,temp_eff:98,tempcom:[146,147,161],temper:[],temperar:282,temperatur:[],temperature_definit:203,tempfix:484,templ:[7,9,18],templat:[3,8,13,17,19,40,168,169,171,221,231,285,299,302,364,469],templeton2010:203,templeton2011:203,templeton:[9,203],tempor:232,temporari:[2,476],temporarili:[188,298,482,483],ten:14,tend:[29,255,280],tensil:[7,220],tensor:[3,6,8,63,82,83,89,90,91,94,107,114,129,132,133,134,135,138,139,140,142,143,144,145,146,147,148,149,150,151,152,154,155,156,157,158,159,160,161,218,242,245,255,256,260,284,286,299,329,355,356,364,395,416,417,422,437,439,487,495],tenth:[129,354],term:[0,1,3,5,6,7,8,9,12,20,21,22,27,38,40,45,46,61,87,88,89,91,112,114,143,144,146,147,156,161,162,175,176,177,188,194,198,199,205,207,209,212,220,226,232,233,234,239,240,241,242,254,255,256,257,258,259,260,261,262,263,274,275,276,278,282,286,289,298,299,312,317,318,319,326,328,330,332,340,341,351,355,363,366,371,372,377,378,379,380,381,382,383,385,386,387,388,389,390,391,393,394,395,396,398,399,400,407,411,414,415,416,417,419,420,421,422,424,427,434,440,449,451,453,454,455,458,461,478,479,481,487,490],termin:[120,255,363,365,437,439,468,477],termostat:318,terrel:362,terri:7,tersoff:[],tersoff_1:[453,454,455],tersoff_2:[453,454,455],tersoff_mod:454,tertiari:180,tessel:[9,166],test:[],test_descriptor_str:3,testf:188,testu:188,tether:[6,297,303,311,313,324,397],tetot:[9,440],tex:8,texa:429,texas_holdem:298,text:[2,3,4,6,7,8,12,13,38,41,56,188,191,193,194,197,203,206,207,208,209,210,211,212,214,219,236,287,325,326,338,356,358,365,393,396,406,419,441,452,465,469,470,486,495,497],textur:17,tfac_insert:231,tfactor:[3,194],tfinal:495,tfix:298,tfmc:[],th4:167,than:[1,2,3,6,8,9,11,12,13,14,15,16,17,18,27,38,39,40,41,42,56,57,58,59,61,63,68,71,76,86,88,92,106,108,110,114,117,118,121,143,166,169,170,171,177,188,190,191,192,194,197,202,204,206,209,210,211,212,214,215,216,217,218,220,221,222,225,228,231,232,233,234,237,238,239,242,253,280,281,285,286,287,288,289,290,292,294,297,298,299,300,303,304,310,311,312,314,318,319,321,322,326,329,330,331,332,333,334,335,336,337,339,355,356,361,362,363,364,365,366,367,370,375,376,377,378,380,381,382,393,395,398,399,405,416,417,419,424,432,433,434,440,442,449,450,451,452,455,457,459,461,462,464,465,466,467,469,470,471,472,473,474,477,478,481,483,484,486,495,496,497],thank:[236,453,455],thb:433,thb_cutoff:433,thb_cutoff_sq:433,thei:[0,1,2,3,4,6,7,8,11,12,13,15,16,17,20,21,23,24,25,26,27,28,29,30,31,32,35,37,38,39,40,41,42,43,45,46,47,48,49,51,53,54,55,56,57,59,61,63,64,66,68,70,71,74,75,81,82,84,87,89,90,91,94,104,105,107,110,111,114,116,117,118,119,121,142,145,146,148,150,151,154,155,161,163,165,166,168,170,171,172,174,175,177,178,179,180,182,183,185,186,187,188,191,193,194,197,198,199,200,202,205,206,207,209,210,211,212,213,214,215,216,217,218,220,221,226,227,230,231,232,234,235,236,239,240,242,245,252,255,257,258,259,260,261,262,263,264,265,266,267,272,274,275,276,278,284,285,286,287,288,290,291,298,299,300,301,302,314,315,317,318,319,321,325,326,328,329,330,332,334,335,337,339,340,342,343,344,345,346,349,350,351,353,355,356,358,360,362,363,364,365,366,369,370,371,372,374,375,376,377,378,379,380,381,382,383,384,385,386,387,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,405,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,425,426,427,429,430,432,433,434,435,440,441,442,449,450,451,452,453,454,455,456,457,458,459,460,461,462,465,467,469,470,471,472,473,474,478,479,481,482,487,490,495,497,498],them:[1,2,3,4,6,7,8,9,11,12,13,14,17,39,40,41,54,59,71,91,104,109,116,119,121,144,170,175,191,193,194,195,205,206,207,209,210,211,212,214,217,218,220,228,236,239,240,251,255,257,258,259,260,261,262,263,274,275,278,280,286,288,296,297,298,299,302,314,317,318,319,321,325,326,328,332,333,334,336,337,340,356,358,364,365,366,370,371,377,384,393,396,398,402,405,424,434,442,457,464,467,469,476,481,484,490,495,496],themselv:[6,11,171,198,199,214,240,355,356,365,367,371,377,387,393,415,419,420,421,441,495],theor:321,theorem:[232,239,377],theoret:[106,236,289,451],theori:[3,6,9,12,40,142,203,219,233,255,281,355,356,377,422,461,483],thereaft:[71,247,283,299,322,329,467],therebi:[327,416,417],therefor:[3,6,12,64,87,153,224,231,240,242,302,321,356,389,431,433,451,456,478,490],therein:[6,419],thereof:87,thermal:[],thermo:[],thermo_modifi:[],thermo_p:[3,63,111,467,487],thermo_press:[63,114,218,224,255,257,258,259,260,261,262,263,286,486,487,490],thermo_styl:[],thermo_temp:[63,114,145,217,218,231,255,257,258,259,260,261,262,263,274,275,276,278,281,286,317,318,319,486,487,490],thermoberendsen:6,thermochem:494,thermochemistri:395,thermodyam:[487,494],thermodyanm:[63,217,314,337,478],thermodynam:[],thermophys:424,thermost:[6,150,202,219,224,240,333,490],thermostat:[],thermostatequ:6,thesi:[355,356,416,431],thess:378,theta0:[20,21,24,26,27,28,32,33,35,36,142,177,298,349],theta0max:142,theta10:377,theta1:[175,340,377],theta2:[175,340,377],theta3:[340,377],theta4:377,theta5:377,theta6:377,theta7:377,theta8:377,theta9:377,theta:[3,6,26,27,37,38,63,65,80,92,108,142,167,168,177,190,193,234,294,298,326,340,349,401,430,454,469,472,479],theta_0:426,theta_:[349,377],theta_c:401,theta_ijk:377,theta_ijl:340,theta_jik:[420,421],theta_pi:377,theta_sigma:377,thex:290,thi:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,419,420,421,422,423,424,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,490,491,492,493,494,495,496,497,498,499],thick:[71,120,193,210,472],thie:112,thijss:321,thin:[118,193],thing:[3,6,11,12,54,68,71,218,255,286,299,314,466,467,471,495],think:[3,6,7,8,11,13,194,299,337,342,346,358,363,402,432,433,452,467,471,474,495],third:[6,9,12,29,91,136,142,143,166,206,207,209,210,211,212,232,296,311,312,326,386,396,419,426,456,458,464,465,467,469,472],thirumalai:180,thistl:194,tho:394,thole:[],thompson:[0,5,7,9,13,114,142,143,290,358,441],thoroughli:9,those:[1,2,3,4,5,6,7,8,12,13,17,18,20,21,23,24,25,26,27,28,29,30,31,32,33,35,38,39,40,42,43,45,46,47,48,49,50,51,53,54,56,61,71,72,77,87,91,92,108,110,111,112,114,118,142,143,145,148,155,158,166,168,172,174,175,177,178,179,180,181,182,183,185,186,188,190,191,193,194,204,205,206,207,210,211,212,218,220,221,228,234,236,237,238,239,245,252,254,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,285,288,291,299,316,323,324,328,332,333,334,337,338,340,342,343,345,346,347,349,351,355,356,363,365,366,370,371,372,374,378,379,380,381,382,383,384,385,386,387,390,391,393,394,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,419,420,424,425,426,427,429,432,433,434,435,441,442,450,451,452,453,454,455,458,460,461,462,464,466,467,469,471,472,473,474,476,478,479,481,483,486,487,488,490,495,498,499],though:[6,8,12,39,40,63,71,91,105,168,191,194,204,210,215,216,218,220,225,256,297,299,301,310,322,329,339,355,358,365,391,392,393,395,396,398,399,415,416,424,458,464,469,471,472,477,481,488,495],thought:[151,239,276,299,330,331,362,399,406,490],thread:[1,3,9,12,16,17,18,236,327,353,370,482,488],threads_per_atom:3,three:[1,3,6,54,63,74,87,91,92,106,119,120,121,132,142,146,167,168,180,197,217,218,223,243,255,260,281,286,290,299,314,321,323,326,344,345,349,355,356,364,370,371,372,377,393,394,396,398,399,403,406,419,420,421,422,426,430,433,434,440,441,451,453,454,455,458,467,469,472,495],threebodi:451,thresh:[41,191,193,194,214,467],threshhold:[3,41,193,214,337,467],threshold:[3,41,86,166,194,214,280,366,433,464,483],thrid:467,through:[3,6,7,9,11,12,63,168,172,191,195,218,229,231,236,237,242,244,245,246,255,256,282,290,307,321,326,331,354,361,372,394,395,399,405,407,422,435,440,442,449,456,464,467,470,480,486,490],throughout:[6,16,118,120,327,370,422,469],thru:[3,6,7,11,12,66,74,75,81,89,90,94,104,105,106,107,163,190,191,194,209,252,314,334,339,354,363,369,472],thrust:1,thu:[1,2,3,6,8,9,11,12,18,33,38,39,41,42,50,59,61,63,64,66,67,70,71,72,73,75,77,81,88,90,91,92,94,104,105,107,108,110,111,115,116,117,118,119,142,143,144,148,151,156,158,163,164,165,168,170,171,172,176,181,187,188,190,191,193,194,195,197,198,199,200,201,205,206,207,209,210,211,212,213,214,215,216,217,218,220,221,224,226,228,232,233,234,235,236,237,239,240,245,250,255,260,271,280,286,288,290,294,297,299,300,301,302,303,307,308,311,312,313,314,315,317,318,319,321,322,325,326,328,329,330,331,334,335,336,337,339,340,347,355,356,358,361,363,364,365,369,370,371,372,375,377,378,379,380,381,382,383,384,385,386,387,391,392,393,394,395,396,397,398,399,402,403,404,405,407,411,415,416,417,419,420,421,422,424,425,427,429,430,431,432,433,434,440,441,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,462,464,466,467,469,470,471,472,473,474,476,477,478,479,481,483,484,485,486,487,488,490,494,495,496,497,498],thumb:[8,10,17,168,190,252,299,370,385,472,478],thz:294,ti2:167,ti3:167,ti4:167,tight:[9,377,440],tightli:288,tij:390,tildeslei:[29,87,390],tile:[3,6,41,62,168,214,405,457,466,495],tilt:[3,6,57,58,59,71,156,170,191,194,210,218,220,221,234,253,255,256,280,289,356,358,458,469,472,487],time:[],time_integr:203,timedelta:207,timelin:5,timer:[],timescal:[3,205,206,207,209,210,211,212,253,289,294,395,464,478],timespan:[239,240,255,286,299,317,318],timestamp:[3,474],timestep:[],timesteppnig:302,tin:[386,387],tine:[],tinfoil:356,tini:[72,118,168,363,377,496],tinker:7,tio2:440,tio:440,tip3p:[],tip4:6,tip4p:[],tip:[],tirrel:331,titan:15,titer:299,titl:[206,207,208,209,210,211,212,287,433],title1:[206,207,208,209,210,211,212],title2:[206,207,208,209,210,211,212],title3:[206,207,209,210,211,212],tji:390,tl1:167,tl3:167,tlbr_msw:430,tlo:483,tloop:[255,256,260],tlsph:[],tlsph_defgrad:[],tlsph_strain:[],tlsph_strain_rat:[],tlsph_stress:[],tm3:167,tmax:[3,225,483],tmd:[],tmd_dump_fil:325,tmdatom:325,tmin:225,tmp1:[209,212,480],tmp2:[209,212,480],tmp3:480,tmp:[6,12,41,66,68,69,75,90,94,105,107,116,118,148,163,165,191,193,194,214,288,299,322,329,369,476,480,495],tobia:[255,256,299],todd:276,toe:162,toff:[364,469],togeth:[2,3,6,11,12,17,39,41,71,117,143,148,162,169,191,198,199,206,209,214,218,224,233,240,255,286,299,303,308,311,314,332,336,337,397,402,467,472,477,490,498],toggl:[59,172,476],togheth:3,togther:3,tol:[302,314,355,451],toler:[3,218,290,291,292,302,314,363,365,451,464,483],toma:9,tomato:194,tong:[9,13],too:[1,3,6,7,39,41,64,67,70,72,73,77,88,92,108,142,156,169,171,193,208,214,215,216,218,221,228,231,235,255,281,286,290,294,296,302,314,321,322,326,329,356,365,366,370,391,405,464,472,483,486,490,495],took:[71,442],tool:[],toolkit:[6,7,13,14,15],top:[0,3,8,9,11,12,13,59,151,166,190,197,213,220,235,242,254,276,300,333,334,336,365,370,432,433,441,469,473,479],top_group:308,top_veloc:308,topic:[495,498],toplog:[3,466],topolgi:40,topolog:[2,3,6,7,8,12,13,39,40,87,110,117,171,172,194,215,216,236,284,364,402,424,466,469,470,471,473,474,481],topwal:213,torder:299,torqu:[],torsion:[6,175,176,187,372,432,433],torsion_flag:372,tosi:378,tot:[294,440],total:[3,6,11,12,14,15,16,17,18,39,41,42,63,71,81,88,89,90,91,99,103,104,105,106,109,111,112,119,124,125,126,127,129,130,131,132,133,134,135,142,143,145,148,149,150,151,154,155,156,157,158,160,162,164,165,166,191,197,200,201,204,206,208,209,210,211,213,214,216,222,224,226,229,230,231,232,237,239,240,241,242,243,245,253,255,256,260,271,281,282,284,285,289,294,296,298,299,300,301,303,305,308,311,313,322,323,324,326,329,331,335,355,363,364,365,366,367,370,371,373,375,377,386,393,395,399,419,420,421,422,430,432,433,437,440,441,457,464,466,467,469,471,477,478,483,484,487,488,495],touch:[12,237,332,471],toukmaji:[356,390],toward:[9,29,166,193,197,221,222,237,242,254,260,280,297,311,325,327,349,365],toxvaerd:412,tpa:370,tparam:299,tpartial:148,tpc:370,tpcpu:487,tperiod:299,tptask:[16,370],tqx:[115,191,316],tqy:[115,191,316],tqz:[115,191,316],trace:395,track:[3,7,12,216,220,242,326,336,464,469,475,483,487,495],track_displac:203,tracker:236,trade:[6,12,291,355,356,387,407,411,478,483],tradeoff:424,tradit:[6,9,356],traffic:12,trail:[2,22,44,77,87,118,162,172,176,194,198,199,299,341,360,364,365,384,396,419,433,441,463,469,477,479],train:433,traingul:310,traj:219,traj_titl:433,trajectori:[3,6,12,39,87,191,236,255,257,258,259,261,262,263,264,265,267,268,270,272,273,274,275,276,277,278,282,299,302,303,307,327,336,391,424,433,471,479,490,494],tran:[179,180],transfer:[1,6,16,203,224,236,238,322,326,329,355,370,377,422,490],transform:[],transit:[6,9,86,254,303,325,365,388,415,421,422,455,464,483],translat:[3,6,61,63,95,96,97,98,99,146,147,148,152,161,206,231,235,239,240,245,255,261,262,263,274,275,278,282,299,317,318,319,321,358,395,469,487],transmiss:236,transmit:[6,236],transpar:[14,17],transport:[203,326,443],transpos:12,trap:[3,6,91,164,207,237,328,495],trapezoid:[207,495],trate:[3,220,236],travel:314,treat:[2,3,6,8,17,40,42,71,82,84,85,143,146,150,161,172,189,206,207,209,212,221,230,256,281,284,285,299,314,326,328,335,339,354,355,363,364,366,375,376,389,395,396,398,401,405,420,421,422,434,457,469,472,474,477,479,490,495],treatment:[9,294,389],tree:[3,284,415],tref:392,tri:[],tri_surfac:[],trial:[221,231,373,478],triangl:[2,3,6,7,40,42,82,115,136,166,193,197,273,299,310,314,438,450,457,469,479],triangleflag:469,triangul:[2,6,13,310,438],triangular:[4,6,42,82,115,218,273,310,438,469],tricki:[466,490],triclin:[],triflag:6,trigger:[3,11,12,62,86,214,217,231,363,487],trigon:25,trilinear:242,trilino:17,trim:[3,470],tripflag:432,tripl:[2,142,220,377,432,465,467],triplet:[3,34,37,394,426,430,451,453,454,455,458],trivial:[8,11,290],trj:433,trott:[7,9,14,17,142,441],troubl:[11,12],truli:8,truncat:[3,5,6,12,71,288,294,331,335,362,374,387,395,399,407,409,412,424,429,440,479],trung:15,tscale:[3,253,289],tschopp:67,tsige:381,tsrd:[314,336],tstart:[232,233,239,241,255,256,299,317,318,319,320,391,475],tstat:[],tstop:[232,233,239,241,255,256,299,317,318,319,320,391,475,483],tsuzuki:[73,458],tthi:129,ttm:[],ttm_mod:326,tucker:[142,441],tuckerman2006:[],tuckerman:[255,256,277,282,299,478],tune:[],tunnel:282,turkand:108,turn:[3,4,6,12,22,33,37,39,44,50,54,55,59,65,69,71,110,117,142,166,167,172,176,181,187,193,194,197,204,215,216,217,218,231,236,255,269,284,287,288,299,314,341,347,350,355,363,365,366,368,370,372,389,401,402,419,424,433,449,450,465,469,471,476,481,482,487,488,492,497],turquois:194,tutein:372,tutori:[6,9],tweak:[12,168,236,370],twice:[3,6,16,17,63,88,174,194,197,198,199,218,252,255,292,370,376,402,467,469,476],twin:67,twist:[416,417],two:[1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,22,38,39,41,42,44,54,56,57,59,61,63,65,68,69,71,76,77,79,87,88,92,93,104,109,110,115,116,117,118,119,120,142,144,146,150,151,153,154,156,162,166,167,168,169,171,176,190,191,192,193,194,197,198,199,204,205,206,207,209,210,211,212,214,215,216,217,218,221,224,228,231,232,233,235,237,238,239,240,242,245,254,255,256,260,280,281,282,285,286,288,289,290,294,296,299,303,311,314,321,322,324,326,329,332,335,337,339,341,351,355,356,358,360,361,363,364,365,368,370,371,372,373,375,377,378,379,380,381,384,385,386,387,389,390,391,392,393,394,395,396,398,399,402,405,406,407,411,415,416,417,419,422,424,427,430,431,432,433,434,436,440,441,442,449,450,451,453,454,455,456,457,458,461,462,463,464,466,467,469,470,471,472,473,476,479,481,482,483,484,486,487,490,494,495,496,497,498,499],two_temperatur:203,twobodi:[453,455,458],twogrid:3,twojmax:[142,441],twolevel:[3,466],txt2html:8,txt:[8,13,191,195,287,288,326,353,364,406,440,459,474,495],typcial:[41,214],type1:[77,120,167],type2:[77,120,167],type:[],typei:405,typej:405,typen:[77,120,167],typic:[1,2,3,6,7,8,10,11,12,13,14,15,16,17,18,29,39,40,41,45,46,55,57,59,61,63,70,71,86,87,103,109,121,130,162,168,169,171,191,192,193,194,197,198,199,200,202,203,206,208,214,215,216,217,218,220,221,226,228,229,231,234,240,255,269,281,284,285,288,290,292,298,299,302,304,306,314,321,329,330,336,355,358,362,363,364,365,366,367,370,382,384,385,387,397,398,401,402,406,407,411,416,417,419,424,434,437,439,450,452,455,464,465,467,469,470,471,472,478,481,483,484,486,494,495,497,499],typicali:12,tzou:326,u_f:242,u_ij:430,u_prom:377,uberuaga:[254,365],ubiquit:[11,377],uhf:373,uiuc:[9,17],uloop:[3,282,365,369,495],ulpsh:[],ulsph:[],ulsph_num_neigh:[],ultim:483,ultra:166,umbrella:[],umin:[26,27,48,49,177],unabl:[3,11,41,214],unaffect:[191,218,255,299,470,481,486],unalt:[198,199,269],unambigu:[71,210,458],unari:[339,495],unbalanc:3,unbias:[156,395],unbond:[216,469],unbroken:80,uncertainti:40,unchang:[59,218,221,254,255,257,258,259,261,262,263,271,286,299,469,470,473,479],uncharg:[40,356],uncom:[1,4],uncompress:[12,71,193],uncomput:[],uncorrel:[232,321,464],uncoupl:282,undefin:[3,12],under:[0,5,6,7,8,9,10,12,18,21,22,44,142,175,176,193,236,253,255,285,289,290,340,341,360,395,415,433,441,467,483,490],underestim:166,underflow:193,undergo:[6,86,87,104,156,232,239,240,255,303,314],undergon:[217,314],underli:[6,9,12,17,70,193,255,326,358],undermin:39,underpredict:6,underscor:[2,3,63,197,217,218,253,255,257,258,259,260,261,262,263,274,275,276,278,286,288,317,318,319,339,364,495],understand:[1,6,8,231,256,422],understood:[191,377],undesir:[59,218,220,255,299],undetermin:314,undisturb:[416,417],undo:[172,236],undump:[],unexpect:[3,475],unfix:[],unfix_flux:203,unfold:312,unfortun:[327,477,478],uniaxi:[3,146,260],uniform:[7,16,41,88,118,203,214,215,216,239,242,245,256,321,392,398,434,464,466,495,496],uniformli:[59,118,190,242,285,326,430,452,496],uninstal:12,uninterrupt:[204,221,231,252,253,255,257,258,259,260,261,262,263,274,275,276,277,278,288,289,299,303,313,316,324,326,332],union:[3,6,40,194,335,337,469,472],uniqu:[3,6,7,8,9,12,39,71,124,208,232,233,239,240,260,288,294,296,365,393,395,469,495,496],unit:[],unit_styl:3,uniti:[394,424,445],unitless:[64,67,70,71,116,173,206,210,211,220,231,253,255,289,332,363,373,399,427,429,451,453,454,455,458,494],unitlesss:[78,80,113],univ:[9,13],univers:[3,6,9,12,13,18,87,236,355,356,365,369,416,421,429,431,455,463,466,495],universit:[9,13],unix:[12,17,238,480],unknown:[3,12,64,73,469],unless:[2,3,9,11,12,15,16,55,57,67,104,120,153,167,168,191,194,195,202,218,221,231,239,255,257,258,259,261,262,263,285,286,299,314,325,357,363,385,424,452,467,472,476,481,495],unlik:[12,33,50,59,89,158,168,181,191,208,239,255,260,286,292,294,317,318,319,347,354,355,371,377,393,396,401,402,406,419,420,421,433,441,450,466,471,476,481,495,499],unlimit:430,unlucki:3,unmark:7,unmodifi:315,unnecessari:16,unoccupi:326,unoptim:193,unpack:[0,8,11,370],unpack_bord:8,unpack_border_bodi:8,unpack_border_hybrid:8,unpack_border_vel:8,unpack_comm:8,unpack_comm_bodi:8,unpack_comm_hybrid:8,unpack_comm_vel:8,unpack_exchang:8,unpack_restart:8,unpack_revers:8,unpack_reverse_comm:8,unpack_reverse_hybrid:8,unpad:194,unperturb:87,unphys:[3,6,240,255,299,469],unpredict:[297,479],unpublish:422,unrecogn:3,unrel:[8,9,13,174],unreli:424,unrestrain:298,unrestrict:373,unscal:[3,115,162,191,316,470],unset:[355,395],unshift:390,unsmooth:413,unsolv:[367,382],unsort:194,unspecifi:[220,469],unsplit:490,unstabl:[3,242],unstrain:220,unsuccess:[3,285],unsuffici:[],unsupport:3,untar:12,until:[2,3,6,12,14,38,39,41,56,71,121,188,193,214,218,221,231,236,285,307,314,316,323,339,354,355,366,369,370,377,399,452,464,469,470,474,475,477,483,494,495],untilt:472,unus:377,unusu:[3,8,366],unwant:[3,168,355],unwrap:[3,66,74,75,81,89,90,94,104,105,107,115,143,163,191,194,195,205,217,219,236,252,299,311,316,469,470,473,479],unwrapexpand:191,unzip:12,up_intern:193,updat:[0,3,6,8,12,13,125,126,127,137,138,139,140,190,191,197,204,215,216,224,229,232,239,240,242,244,245,248,249,252,253,255,256,257,258,259,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,284,286,288,289,294,299,306,307,316,317,318,319,321,326,337,370,377,390,422,424,432,433,439,464,469,471,479,480,483,490],upenn:[11,13],upgrad:12,upon:[6,204,236,377,456,483],upper:[2,3,41,57,59,71,88,104,106,144,157,164,190,194,207,208,210,211,214,218,224,240,242,255,289,294,331,332,337,338,363,399,440,472,496],upsid:6,upsilon:398,upto:[3,471,477],upward:221,urbana:[236,355,356,416],urey_bradlei:20,usa:9,usabl:[12,231,393],usag:[3,6,8,240,280,294,314,402,415,469],use_ldg:17,usec:489,useful:370,user:[],user_misc:[30,31,35,178,183,186,345],userguid:9,usr:[11,12,14,470],usual:[2,3,6,9,12,14,17,18,24,28,32,35,36,47,61,71,87,119,146,147,148,153,161,166,185,191,193,198,199,204,206,217,218,219,220,231,234,239,241,253,260,281,289,290,296,298,299,314,322,326,329,331,335,339,346,353,365,366,370,382,385,388,390,398,402,403,406,415,416,417,424,426,436,437,438,439,441,449,451,456,464,468,470,474,478,480,483,486,487,495,499],util:[8,12,17,18,370,398,488],utilizi:12,utilz:[12,488],utsa:429,utsph_strain_r:139,uttormark:13,uuml:281,uwo:9,v11:6,v22:6,v33:6,v_0:[3,326],v_2:422,v_3:422,v_4:422,v_a:[8,220],v_abc:[467,487,495],v_area:[2,495],v_atomfil:479,v_c:162,v_cluster:288,v_dc:162,v_delta:87,v_dhug:[253,289],v_diff:[164,328],v_displac:220,v_dk:162,v_dlj:162,v_drai:[253,289],v_dx:[252,472],v_dy:[252,472],v_dz:252,v_e_hbond:401,v_ea:[432,433],v_eb:[432,433],v_eqeq:[432,433],v_espac:200,v_f:467,v_fac:467,v_flux:235,v_foo:[467,495],v_ij:430,v_increas:234,v_integr:328,v_jx:91,v_jy:91,v_jz:91,v_k11:91,v_k22:91,v_k33:91,v_k:162,v_ke:[191,498],v_left:472,v_lgr_po:[253,289],v_lgr_vel:[253,289],v_linear:[331,334,336],v_lj:162,v_mol:194,v_mu:416,v_myi:252,v_myindex:495,v_myke:119,v_mystep:476,v_myvar:[8,194],v_myx:252,v_n:[242,422],v_name1:[162,220],v_name2:[162,220],v_name:[3,6,71,87,119,190,191,193,194,198,199,200,201,205,206,207,208,209,210,211,212,213,226,234,235,237,239,240,252,301,308,316,317,318,319,328,331,334,336,467,472,476,479,485,487,495,496],v_nstep:337,v_occ:397,v_omega:252,v_oscil:[200,201,213,226,301],v_phi:234,v_prefactor:[198,199,442],v_press:143,v_pressdown:[334,336],v_push:200,v_pxy:6,v_pxz:6,v_pyz:6,v_r0:237,v_r1:166,v_r2:166,v_r:[166,237],v_rad:337,v_radiu:237,v_ramp:[331,334,336],v_rate:[220,237],v_scale1:[198,199],v_scale2:[198,199],v_size:[198,199],v_t_qm:289,v_temp:322,v_theta:[234,472],v_tp:220,v_up:472,v_v0:495,v_v11:6,v_v22:6,v_v33:6,v_v:[252,495],v_valu:[193,467],v_vx:252,v_vy:252,v_vz:[252,496],v_wiggl:[331,334,336],v_x:[2,168,237,252,331,334,336,467,472,495],v_xave:6,v_xmax:6,v_xx:168,v_y:[168,237,472],v_yi:168,v_z:472,vacanc:[4,166,323,422],vacf:[],vacuum:[326,356,388,455,462],valanc:377,vale:3,valenc:[292,377,395,432,433],valent:377,valeriu:9,valid:[2,3,6,9,11,12,71,120,154,167,194,218,231,239,280,299,314,337,339,353,358,393,395,398,422,430,469,470,477,479,495],vallon:419,valon:419,valu:[],valuabl:488,value0:495,value1:[12,148,205,206,207,208,209,210,211,212,260,328,337,480],value2:[12,148,205,206,207,208,209,210,211,212,260,328,337,480],valuei:207,valuej:207,valuev:[7,9],valus:288,van:[9,53,87,109,286,290,295,317,385,386,415,419,432,433,461,496],vanadium:422,vanderwa:[424,487],vanilla:[6,8,12],vanillia:42,vanish:[224,294,302],vapor:[41,214,231,486],vapour:321,var1:480,var2:480,varaibl:[3,472],varavg:12,vare:326,vari:[1,18,41,61,62,71,87,120,156,158,167,198,199,203,206,207,210,214,218,220,253,255,286,298,299,317,318,326,331,355,382,391,400,413,416,429,442,452,466],variabl:[],variable_hill_factor:13,variable_nam:433,varianc:[119,391,495],variant:[1,3,6,12,83,99,255,260,299,355,362,370,420,421,453,455,478,482,496],variat:[12,41,214,495],varieti:[1,2,6,7,9,13,15,71,193,236,353,358,402,419,432,433,450,458,495],variou:[],varreturn:467,varshalovich:142,varshnei:13,vartiabl:3,vashishta1990:458,vashishta2007:458,vashishta:[],vbia:6,vcm:[],vdim:[157,322,329,496],vdisplac:[3,237,252,331,334,336,495],vdw:[3,386,433],vec1:[119,288],vec2:[119,288],vec:280,vector:[],vel:[3,6,61,206,210,211,220,240,285,303,333,376,391,395,399,464,471,472,474,490,495],veld:[13,314,356,381,411],veloc:[],velocit:[235,391,395,399],velocity_bottom:242,velocity_gradi:439,velocity_temp:496,velocity_top:242,vendor:12,verbatim:467,verbos:[12,440],veri:[1,3,6,7,8,9,10,12,13,17,41,71,72,87,118,119,191,193,194,205,206,207,208,209,210,211,212,214,215,216,218,231,245,255,256,269,282,297,302,317,318,328,365,366,367,370,395,399,416,417,429,441,442,452,477,487,488,490,494,497],verifi:[8,370,424,478,484],verlag:303,verlet:[1,3,7,8,12,18,203,239,255,269,276,282,302,315,326,334,337,463,466,478],versa:[3,6,13,59,162,170,217,237,239,240,299,469,470,490],versu:[6,14,15,16,18,39,41,80,104,105,118,164,194,214,299,302,356,381,390,399,411,424,487,495],vertex:[42,136,310,376],vertic:[2,41,42,136,193,214,221,310,376,495],vfinal:495,vfrac:115,vhi:[157,496],via:[],vibrat:[6,9,221,233,280,289,294,349,395,464,478],vice:[3,6,13,59,162,170,217,237,239,240,299,469,470,490],video:193,view:[4,6,7,9,13,191,193,314,377,395,396,440],viewer:[191,193],viewpoint:193,vij:391,vika:13,vim:[],vincent:[9,19],violat:321,violet:194,virial:[3,63,91,114,142,143,162,198,199,218,224,255,256,257,258,259,260,261,262,263,284,286,299,302,355,370,373,391,392,395,403],virialmod:403,virtual:[6,7,8,12,451],virut:9,visa:7,viscoelast:[113,399,429],viscoelsat:429,viscos:[],viscou:[],viscous:299,vision:440,visit:[300,432,433],vista:191,visual:[],viz:[11,13],viz_tool:11,vizplotgui_tool:11,vizualiziton:300,vlo:[157,496],vmax:[218,314],vmd:[6,7,9,11,13,191,195,236,470],vmdarch:195,vmdhome:195,vname:[168,495],voigt:[6,142],vol:[],volfactor:355,volpress:422,volt:[431,494],volum:[2,3,6,40,41,58,59,63,80,87,91,101,114,118,120,128,132,141,143,166,167,168,171,204,206,210,211,214,218,220,221,231,242,253,255,256,260,264,265,267,268,270,272,273,274,275,276,277,278,285,286,289,299,303,326,331,335,337,355,358,364,379,416,417,422,429,447,448,462,465,466,469,472,479,487,490,494,495],volumetr:80,von:[135,140],voro:[3,9,166],vorobyov:490,voronoi:[],vorselaar:208,voter2:[464,483],voter:[420,421,464,483],voth:[40,282],vpz:333,vratio:495,vri:400,vrpn:236,vshear:332,vstream:6,vtarget:[3,329],vtk:[],vv0210:13,vx0:164,vxcm:299,vxhi:[221,285],vxlo:[221,285],vy0:164,vycm:299,vyhi:[221,285],vylo:[221,285],vz0:164,vzcm:299,vzhi:221,vzi:333,vzlo:221,w_1:142,w_2:142,w_i:142,w_ik:430,waal:[87,109,385,386,415,432,433,461],wadlei:[13,377],wag:[7,9,13],wagner:[7,9,203,242,419],wai:[1,2,3,6,7,8,11,12,15,18,22,44,59,63,65,66,69,71,72,75,77,79,87,90,91,92,93,94,105,107,108,110,116,117,118,142,143,145,146,147,148,149,150,151,154,155,156,157,158,160,161,162,163,165,168,171,176,188,190,191,193,194,197,198,199,206,209,210,212,213,216,217,218,220,229,232,237,239,240,242,253,255,260,269,282,286,288,297,299,300,303,311,314,316,317,318,319,322,325,326,328,331,334,336,337,341,342,343,344,346,349,356,358,360,363,365,366,370,371,372,384,387,388,391,392,393,394,396,398,401,402,404,407,419,420,421,424,426,430,431,434,440,441,442,449,451,453,455,458,463,464,467,469,470,471,472,473,474,477,478,479,495,496],wait:[1,12,236,281,464,466],walk:[3,232,239,240,255],wall:[],wall_surac:136,wall_surfac:[],wallhi:331,wallstyl:332,wander:311,wang:[356,419,430],want:[0,1,2,3,5,6,7,8,9,11,12,17,38,40,56,63,66,68,71,75,81,90,94,104,105,107,109,111,112,114,116,118,143,148,163,164,165,166,168,171,174,188,191,193,194,197,198,199,200,205,206,214,217,220,221,224,226,229,231,237,240,250,271,280,285,288,298,299,301,311,313,315,322,324,329,331,335,337,339,356,358,365,371,372,377,385,386,391,393,396,402,403,404,405,419,426,430,432,433,440,442,451,452,453,455,457,458,465,467,469,470,471,472,474,476,477,487,490,495,497,499],ward:377,warm:[16,395],warn:[],warner:371,warp:[5,419],warranti:7,warren:391,wasn:3,wast:3,watanab:[323,324],watch:365,water:[],watkin:185,wave:[7,9,40,202,253,293,333,373,395],wavefunct:[9,373,395],wavelength:[120,167],wavepacket:[40,373,395,469],wavevector:281,wbodi:83,weak:[92,290],web:[1,8,14,15,16,17,384],webb:203,weber:[3,5,7,15,88,144,394,421,430,450,451,458,481],websit:8,weckner:429,wedg:[],weight:[],welcom:467,well:[1,3,6,7,8,9,11,12,13,15,16,17,18,27,40,51,67,71,92,108,114,143,146,154,168,177,193,194,200,204,206,212,214,215,216,218,221,226,231,235,239,242,246,252,255,260,285,299,301,308,321,324,332,363,365,370,375,397,398,401,402,403,416,417,419,422,434,442,453,454,455,467,469,471,473,478,483,488,490,494,498],wennberg:355,went:[3,11],were:[3,4,5,6,7,11,12,13,15,16,19,34,41,42,52,56,60,70,71,104,108,111,114,118,145,148,168,171,172,184,191,193,194,197,200,206,209,210,211,212,214,220,226,228,235,236,269,276,300,332,333,337,348,355,367,369,395,399,402,406,429,433,464,466,467,469,470,471,472,474,476,484,487,495,496,498,499],weren:474,western:9,westview:461,what:[],whatev:[8,12,14,15,110,115,118,119,121,193,194,198,199,218,255,286,288,332,358,362,363,365,370,383,385,422,432,433,483,490,495],wheat:194,whelan:167,when:[0,1,2,3,4,6,8,9,11,12,13,14,15,16,17,18,20,21,23,24,25,26,27,28,29,30,31,32,33,35,37,38,39,40,41,42,43,45,46,47,48,49,50,51,53,54,55,56,59,61,62,63,71,72,81,86,88,92,104,105,106,108,109,111,114,115,118,119,121,144,145,146,151,155,156,158,164,166,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,185,186,187,188,191,192,193,194,195,197,198,199,200,201,202,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,225,226,227,228,229,230,231,233,234,236,239,242,243,245,246,250,255,256,257,258,259,260,261,262,263,264,265,269,271,272,274,275,276,278,280,284,285,286,287,288,289,291,292,293,294,298,299,300,301,302,303,311,312,314,315,316,317,319,321,322,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,342,343,345,346,347,349,350,351,352,353,354,355,356,358,361,362,363,364,365,366,367,369,370,371,372,374,378,379,380,381,382,383,384,385,386,387,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,407,408,409,410,411,412,413,414,415,416,417,419,420,421,422,424,425,426,427,429,430,432,433,434,435,441,442,449,451,452,453,454,455,457,458,460,461,462,464,466,467,469,470,471,472,473,474,475,476,477,478,479,480,481,483,484,486,487,488,489,494,495,496,497,499],whenev:[0,8,12,14,71,194,205,211,299,358,401,467,478,482,495,499],whenth:3,where:[1,3,6,8,9,10,11,12,14,15,18,21,23,24,25,26,27,28,29,32,35,36,37,39,40,41,43,47,48,49,51,55,61,63,65,66,68,69,70,71,73,75,79,80,82,83,84,85,87,88,89,90,92,93,94,95,96,97,98,99,105,107,110,114,115,116,117,118,119,120,121,143,145,146,147,148,149,150,151,154,155,156,157,158,160,161,162,163,165,167,169,171,172,175,177,187,190,191,193,194,197,198,199,200,201,206,207,210,213,214,217,218,220,221,225,226,228,229,231,232,233,234,235,237,239,240,241,242,245,246,248,250,252,253,255,256,260,269,272,279,280,281,282,285,287,288,289,292,294,299,300,301,302,303,307,308,311,313,316,317,318,319,322,323,324,326,329,330,331,332,334,335,336,337,340,342,343,344,345,346,349,350,351,353,356,358,362,363,364,365,366,367,370,371,372,375,377,378,380,384,385,386,387,388,389,390,391,393,394,395,396,397,398,399,400,401,402,403,404,407,411,416,417,418,419,420,421,422,424,426,427,429,430,431,432,433,434,440,441,444,447,448,449,450,451,452,453,454,455,458,461,462,463,464,466,467,468,469,471,472,473,474,476,478,479,481,483,484,485,486,487,490,494,495,496,497,499],wherea:[6,11,92,204,232,255,290,321,326,490],wherebi:291,wherev:235,whether:[6,8,11,12,17,39,40,54,59,61,63,70,71,103,109,111,155,156,188,193,194,196,197,198,199,206,212,215,216,217,218,219,220,224,228,231,240,252,255,260,288,302,314,322,328,329,337,339,353,355,356,364,368,370,380,382,386,400,402,406,416,417,419,424,433,440,450,464,467,469,470,472,474,481,482,483,486,495,496],which:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,28,29,32,33,37,38,39,40,41,42,44,45,46,47,50,51,53,54,55,56,58,59,61,63,64,66,67,70,71,72,73,74,75,76,77,78,80,81,82,83,85,87,88,89,90,91,94,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,112,113,114,115,116,118,119,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,179,180,181,182,185,187,188,190,191,193,194,195,197,198,199,200,201,202,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,245,246,249,250,252,253,254,255,256,257,258,259,260,261,262,263,265,267,269,270,272,273,274,275,276,277,278,280,281,282,284,285,286,287,288,289,290,291,292,294,295,296,297,298,299,300,301,302,303,304,305,306,308,310,311,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,331,332,333,334,335,336,337,339,340,341,343,346,347,350,351,353,354,355,356,358,360,361,362,363,364,365,366,367,369,370,371,372,373,375,376,377,378,380,381,382,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,409,410,411,413,415,416,417,419,420,421,422,424,426,427,428,430,431,432,433,434,435,436,437,438,439,440,441,442,445,449,450,451,452,453,454,455,456,457,458,461,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,490,495,496,497,498,499],whichev:[12,369,464,483],white:[194,232,239,240,241,299,318,326,469,495,498],whitesmok:194,whitespac:[2,3,194,364,469],who:[0,3,6,7,8,9,13,371,393],whole:[224,236,281,294,303,490],wholli:221,whose:[3,6,7,8,18,19,38,39,42,56,59,76,87,153,171,188,193,194,204,220,237,238,252,255,257,258,259,261,262,263,280,281,297,298,302,314,328,335,337,358,365,366,395,409,436,438,451,452,453,455,490,495,496],why:[3,6,240,322,329],wide:[1,6,7,9,61,63,197,322,329,358,367,382,385,395,432,433],wider:1,width:[193,194,373,397],wiggl:[3,220,252,307,331,332,334,336,472],wigner:142,wih:6,wiki:14,wikipedia:[6,14],wild:[3,12,22,44,77,87,118,176,198,199,299,341,360,384,401,463,471,476,497,499],wildcard:[3,12,162,172,191,193,194,296,384,449,476,479,498,499],wildli:255,win:370,window:[3,4,12,13,71,191,193,195,206,207,208,209,210,211,212,236,300,319,320,384,470],wipe:[197,402,450,491,493],wire:298,wirt:194,wisconsin:13,wise:[3,12,391,451,478],wish:[2,3,5,6,7,8,11,12,14,17,40,42,57,58,59,71,119,143,148,169,170,172,174,191,194,198,205,206,207,210,211,212,216,220,221,228,231,237,242,246,285,288,299,302,314,315,331,332,358,365,370,380,401,402,419,424,432,452,467,469,470,471,477,481,487,495,496,499],within:[1,2,3,6,8,9,11,12,13,15,16,17,29,39,40,41,42,55,59,61,63,65,69,70,71,72,73,77,79,92,93,108,110,114,117,118,119,121,124,142,159,168,171,192,193,194,198,199,204,205,206,209,210,211,212,214,215,216,217,221,223,228,231,237,239,280,284,285,286,288,290,299,300,302,304,306,310,311,315,326,329,331,335,337,339,354,358,363,364,365,366,367,370,375,378,380,387,392,393,394,395,397,402,403,406,407,419,422,427,428,429,434,435,450,451,453,454,455,456,458,464,466,467,469,477,478,481,483,490,494,495],without:[1,2,3,4,6,7,8,9,11,12,14,16,17,20,21,23,24,25,26,27,28,29,30,31,32,35,38,40,43,45,46,47,48,49,51,53,54,56,59,87,111,114,145,150,155,169,174,175,177,178,179,180,182,183,185,186,188,191,193,194,195,197,200,206,208,209,210,211,212,213,218,220,227,230,232,234,236,239,252,255,257,258,259,260,261,262,263,264,265,272,274,275,276,277,278,285,288,290,291,293,297,299,300,301,302,307,314,317,319,330,334,338,340,342,343,345,346,349,351,354,355,356,365,366,370,371,372,374,378,379,380,381,382,383,384,385,386,387,390,391,393,394,395,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,420,422,424,425,426,427,429,433,434,435,442,450,451,452,453,454,455,458,460,461,462,467,469,472,477,478,487,490,494,495],witht:[],witi:15,wolf:[],wolff:[424,452],won:[3,297,417],wong:[203,377],word:[2,3,6,8,12,29,63,194,197,204,205,206,207,210,211,212,219,237,266,271,287,292,298,328,339,354,385,424,465,467,469,495,496],work:[1,3,6,7,8,9,11,12,14,16,18,39,54,59,60,88,119,120,146,147,149,150,151,155,156,157,158,160,161,166,167,191,193,195,198,199,206,210,211,217,229,238,239,240,242,246,252,255,261,262,263,274,275,276,277,278,296,298,300,302,317,318,319,324,354,366,370,384,386,389,391,402,416,417,419,422,424,440,464,466,467,470,471,473,477,478,480,483,495],workaround:[72,118,299,424,496],worker:[12,432,433,458],workhors:8,workstat:[370,467],world:[3,12,142,354,365,369,463,466,467,484,495],worlei:391,worri:17,worsen:18,worst:335,worth:[206,207,209,210,211,212,289,300],would:[1,3,4,5,6,7,8,11,12,22,29,37,41,42,44,55,70,71,72,89,91,118,143,148,156,168,169,170,171,172,176,187,191,193,194,195,197,198,199,201,204,206,214,217,219,220,224,225,228,231,234,235,236,240,252,255,256,269,280,282,286,288,290,294,297,314,321,325,333,334,337,339,340,341,342,343,344,346,347,350,355,358,360,362,363,365,366,369,370,371,372,377,384,385,386,387,391,392,393,394,396,402,403,404,405,419,420,421,422,426,430,432,433,437,439,441,449,451,453,454,455,458,464,467,469,472,473,474,476,477,478,479,480,484,486,487,490,495,496,498,499],wrap:[1,3,6,11,12,57,59,168,170,190,191,192,194,195,205,211,219,220,221,236,242,252,299,311,314,331,333,335,355,356,365,467,469,470,472,477],wrapper:[],wrigger:303,wright:363,writabl:3,write:[],write_atom_weight:203,write_data:[],write_dump:[],write_freq:433,write_head:8,write_restart:[],writen:300,written:[3,5,6,7,8,9,12,13,14,17,65,69,117,142,166,191,192,193,194,195,197,198,199,200,201,202,203,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,222,224,225,226,227,228,229,230,232,233,234,235,236,237,239,240,241,242,243,244,245,246,247,248,249,251,254,264,265,266,267,268,269,270,271,272,273,279,280,281,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,311,312,314,315,317,318,319,320,321,322,323,325,326,328,329,330,331,333,334,335,336,338,353,358,366,393,402,418,422,459,461,464,465,467,470,471,475,476,483,484,485,486,495,497,498,499],wrong:[3,11,218,255,279,331,335,336,366,433,471,476],wrote:[3,471],wt1:424,wt2:424,wt3:424,wurtzit:358,www:[0,2,3,4,5,6,7,8,10,11,12,13,15,371,393,416,431,432,433,494],x86:[12,422],x_ij:430,x_ijkl:340,x_kjli:340,x_ljik:340,xave:6,xavx:16,xcm:[8,299,495],xdr:[12,191],xeon:[1,4,7,9,12,16,17,18,370,482],xflag:[155,156,243,245,251,299,321],xhe:[],xhi:[2,6,57,59,170,191,220,325,331,334,336,469,472,487,495],xhi_bound:[6,191],xhi_new:469,xhost:[12,16],xi_ij:430,xiaowang:[13,396,453,455],xiij:280,xlat:[168,220,237,487],xlo:[2,6,11,57,59,170,191,220,237,325,331,334,336,469,472,487,495],xlo_bound:[6,191],xlo_new:469,xmax:[6,202,225,269,495],xmgrace:[],xmin:495,xml:[195,431],xml_label:431,xmovi:[],xmu:[332,399],xorig:71,xplane:332,xplor:191,xpo:168,xrd:[],xsph:9,xsu:[3,191,316,470],xt3:191,xt4:[18,191],xt5:[18,191],xtc:[],xtcdump:194,xvf:12,xwall:[333,334,336],xxx:12,xyz:[3,6,7,13,42,66,71,107,110,156,163,168,191,192,193,194,195,210,218,245,255,256,260,286,296,297,299,311,313,332,334,336,357,364,466,470,496,498],xzhou:[13,396],xzy:466,yang:[422,430],yate:422,yb2:167,yb3:167,ybox:220,ycm:299,year:[5,7],yeh:355,yellow:[193,194],yellowgreen:194,yet:[3,7,9,17,39,42,193,198,296,331,356,362,363,370,383,385,386,395,461,467,469,470,495,497,498],yflag:[155,156,243,245,251,299,321],yhi:[6,59,170,191,220,325,331,334,336,469,472,487],yhi_bound:[6,191],yield:[6,91,112,119,143,151,156,194,207,218,224,255,276,290,322,328,329,332,337,355,375,391,399,424,429,487,495],yip:323,ylat:[168,220,237,487],ylo:[6,59,170,191,220,325,331,334,336,469,472,487],ylo_bound:[6,191],ymax:[202,495],ymin:495,yorig:71,york:[282,356],yoshida:[255,299],you:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,35,38,39,40,41,42,43,45,46,47,48,49,50,51,53,54,56,57,58,59,61,63,66,68,71,72,73,74,75,77,81,87,88,89,90,91,92,94,103,104,105,107,108,109,111,112,114,116,118,119,142,143,145,146,147,148,151,155,156,161,162,163,164,165,166,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,185,186,187,188,190,191,193,194,195,197,198,199,200,201,204,205,206,207,209,210,211,212,213,214,215,216,217,218,220,221,224,226,227,228,229,230,231,232,233,234,235,236,237,239,240,241,250,252,255,257,258,259,260,261,262,263,264,265,269,271,272,274,275,276,277,278,281,282,284,285,286,288,290,291,294,297,298,299,301,302,303,311,313,314,315,317,318,319,320,322,323,324,325,326,328,329,330,331,332,334,335,336,337,339,340,342,343,345,346,347,349,351,354,355,356,358,360,362,363,364,365,366,369,370,371,372,374,377,378,379,380,381,382,383,384,385,386,387,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,419,420,421,422,424,425,426,427,428,429,430,431,432,433,434,435,440,441,442,443,444,445,446,447,448,449,451,452,453,454,455,458,460,461,462,463,464,465,466,467,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,486,487,488,490,494,495,496,497,499],young:[399,436,438],your:[0,1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,35,38,39,40,43,45,46,47,48,49,51,53,54,56,59,61,109,111,114,118,145,146,147,151,155,161,166,168,169,170,171,172,174,175,177,178,179,180,182,183,185,186,188,190,191,192,193,200,203,207,209,212,213,215,216,217,218,220,221,227,230,231,234,236,239,252,255,257,258,259,260,261,262,263,264,265,272,274,275,276,278,285,288,291,297,299,301,302,303,316,317,319,322,326,328,329,330,331,332,334,335,336,337,340,342,343,345,346,349,351,356,358,364,365,366,369,370,371,372,374,377,378,379,380,381,382,383,384,385,386,387,390,391,392,393,394,396,397,398,399,400,401,402,403,404,407,408,409,410,411,412,413,414,415,416,419,420,421,422,424,425,426,427,429,430,432,433,434,435,442,449,451,452,453,454,455,458,460,461,462,463,466,467,469,471,472,473,476,477,478,479,480,481,482,486,487,494,495,497,499],yourself:[6,8,12,13,218,364],yplane:332,ypo:168,ysu:[3,191,316,470],yuan:9,yukawa:[],yukawa_1_1:459,yxz:466,yzx:466,z_i:[395,455,462],z_j:[455,462],z_meam:419,zachari:13,zannoni:398,zbl:[],zblcut:455,zblcutinn:441,zblcutout:441,zblexpscal:455,zblz:441,zcm:299,zcylind:332,zepeda:204,zero:[3,4,6,9,11,12,26,27,39,41,48,49,59,61,63,66,71,72,75,87,88,90,92,94,103,104,105,106,107,108,110,111,112,114,115,116,117,118,119,120,123,142,143,146,147,148,149,156,157,160,161,163,165,166,167,168,170,171,172,174,177,186,188,190,191,193,194,197,198,199,200,202,204,205,206,207,208,209,210,211,212,213,214,215,216,218,220,225,226,227,228,230,231,232,233,235,239,240,241,242,243,245,251,252,253,255,260,269,272,282,287,288,289,290,291,294,296,297,299,300,301,302,305,306,308,314,316,321,322,324,326,329,330,331,332,333,334,336,337,338,339,345,358,361,363,364,365,366,370,373,377,378,380,381,382,385,387,390,391,395,398,400,401,402,403,407,409,411,412,415,417,418,419,422,424,429,433,434,435,440,449,452,456,458,462,464,465,466,469,470,472,474,476,477,478,479,483,484,487,490,495,496,497,499],zeta:[3,242,290,396],zfactor:193,zflag:[155,156,243,245,251,299,321],zhang:[299,322,399],zhi:[3,6,170,191,202,325,331,334,336,469,472,487],zhi_bound:[6,191],zhou:[13,377,396,430,453,455],zhu:448,ziegenhain:13,ziegler:[284,419,450,455,462],zimmerman2004:203,zimmerman2010:203,zimmerman:[9,70,203,377],zlat:[220,237,487],zlib:191,zlim:440,zlo:[3,6,170,191,202,325,331,333,334,336,469,472,487],zlo_bound:[6,191],zmax:[202,242,495],zmin:[242,495],zn2:167,zone:[120,300],zoom:[3,191,193,194],zorig:71,zplane:332,zr4:167,zrest:313,zsu:[3,191,316,470],zwall:331,zwall_veloc:242,zxy:466,zybin:433,zyx:466},titles:["LAMMPS Documentation","5. Accelerating LAMMPS performance","3. Commands","12. Errors","7. Example problems","13. Future and history","6. How-to discussions","1. Introduction","10. Modifying &amp; extending LAMMPS","4. Packages","8. Performance &amp; scalability","11. Python interface to LAMMPS","2. Getting Started","9. Additional tools","5.USER-CUDA package","5.GPU package","5.USER-INTEL package","5.KOKKOS package","5.USER-OMP package","5.OPT package","angle_style charmm command","angle_style class2 command","angle_coeff command","angle_style cosine command","angle_style cosine/delta command","angle_style cosine/periodic command","angle_style cosine/shift command","angle_style cosine/shift/exp command","angle_style cosine/squared command","angle_style dipole command","angle_style fourier command","angle_style fourier/simple command","angle_style harmonic command","angle_style hybrid command","angle_style none command","angle_style quartic command","angle_style sdk command","angle_style command","angle_style table command","atom_modify command","atom_style command","balance command","Body particles","bond_style class2 command","bond_coeff command","bond_style fene command","bond_style fene/expand command","bond_style harmonic command","bond_style harmonic/shift command","bond_style harmonic/shift/cut command","bond_style hybrid command","bond_style morse command","bond_style none command","bond_style nonlinear command","bond_style quartic command","bond_style command","bond_style table command","boundary command","box command","change_box command","clear command","comm_modify command","comm_style command","compute command","compute ackland/atom command","compute angle/local command","compute angmom/chunk command","compute basal/atom command","compute body/local command","compute bond/local command","compute centro/atom command","compute chunk/atom command","compute cluster/atom command","compute cna/atom command","compute com command","compute com/chunk command","compute contact/atom command","compute coord/atom command","compute damage/atom command","compute dihedral/local command","compute dilatation/atom command","compute displace/atom command","compute erotate/asphere command","compute erotate/rigid command","compute erotate/sphere command","compute erotate/sphere/atom command","compute event/displace command","compute fep command","compute group/group command","compute gyration command","compute gyration/chunk command","compute heat/flux command","compute hexorder/atom command","compute improper/local command","compute inertia/chunk command","compute ke command","compute ke/atom command","compute ke/atom/eff command","compute ke/eff command","compute ke/rigid command","compute meso_e/atom command","compute meso_rho/atom command","compute meso_t/atom command","compute_modify command","compute msd command","compute msd/chunk command","compute msd/nongauss command","compute omega/chunk command","compute orientorder/atom command","compute pair command","compute pair/local command","compute pe command","compute pe/atom command","compute plasticity/atom command","compute pressure command","compute property/atom command","compute property/chunk command","compute property/local command","compute rdf command","compute reduce command","compute saed command","compute slice command","compute smd/contact_radius command","compute smd/damage command","compute smd/hourglass_error command","compute smd/internal_energy command","compute smd/plastic_strain command","compute smd/plastic_strain_rate command","compute smd/rho command","compute smd/tlsph_defgrad command","compute smd/tlsph_dt command","compute smd/tlsph_num_neighs command","compute smd/tlsph_shape command","compute smd/tlsph_strain command","compute smd/tlsph_strain_rate command","compute smd/tlsph_stress command","compute smd/triangle_mesh_vertices","compute smd/ulsph_num_neighs command","compute smd/ulsph_strain command","compute smd/ulsph_strain_rate command","compute smd/ulsph_stress command","compute smd/vol command","compute sna/atom command","compute stress/atom command","compute force/tally command","compute temp command","compute temp/asphere command","compute temp/body command","compute temp/chunk command","compute temp/com command","compute temp/cs command","compute temp/deform command","compute temp/deform/eff command","compute temp/drude command","compute temp/eff command","compute temp/partial command","compute temp/profile command","compute temp/ramp command","compute temp/region command","compute temp/region/eff command","compute temp/rotate command","compute temp/sphere command","compute ti command","compute torque/chunk command","compute vacf command","compute vcm/chunk command","compute voronoi/atom command","compute xrd command","create_atoms command","create_bonds command","create_box command","delete_atoms command","delete_bonds command","dielectric command","dihedral_style charmm command","dihedral_style class2 command","dihedral_coeff command","dihedral_style cosine/shift/exp command","dihedral_style fourier command","dihedral_style harmonic command","dihedral_style helix command","dihedral_style hybrid command","dihedral_style multi/harmonic command","dihedral_style nharmonic command","dihedral_style none command","dihedral_style opls command","dihedral_style quadratic command","dihedral_style command","dihedral_style table command","dimension command","displace_atoms command","dump command","dump h5md command","dump image command","dump_modify command","dump molfile command","echo command","fix command","fix adapt command","fix adapt/fep command","fix addforce command","fix addtorque command","fix append/atoms command","fix atc command","fix atom/swap command","fix ave/atom command","fix ave/chunk command","fix ave/correlate command","fix ave/correlate/long command","fix ave/histo command","fix ave/spatial command","fix ave/spatial/sphere command","fix ave/time command","fix aveforce command","fix balance command","fix bond/break command","fix bond/create command","fix bond/swap command","fix box/relax command","fix colvars command","fix deform command","fix deposit command","fix drag command","fix drude command","fix drude/transform/direct command","fix dt/reset command","fix efield command","fix enforce2d command","fix evaporate command","fix external command","fix freeze command","fix gcmc command","fix gld command","fix gle command","fix gravity command","fix heat command","fix imd command","fix indent command","fix ipi command","fix langevin command","fix langevin/drude command","fix langevin/eff command","fix lb/fluid command","fix lb/momentum command","fix lb/pc command","fix lb/rigid/pc/sphere command","fix lb/viscous command","fix lineforce command","fix meso command","fix meso/stationary command","fix_modify command","fix momentum command","fix move command","fix msst command","fix neb command","fix nvt command","fix nvt/eff command","fix nph/asphere command","fix nph/body command","fix nph/sphere command","fix nphug command","fix npt/asphere command","fix npt/body command","fix npt/sphere command","fix nve command","fix nve/asphere command","fix nve/asphere/noforce command","fix nve/body command","fix nve/eff command","fix nve/limit command","fix nve/line command","fix nve/noforce command","fix nve/sphere command","fix nve/tri command","fix nvt/asphere command","fix nvt/body command","fix nvt/sllod command","fix nvt/sllod/eff command","fix nvt/sphere command","fix oneway command","fix orient/fcc command","fix phonon command","fix pimd command","fix planeforce command","fix poems","fix pour command","fix press/berendsen command","fix print command","fix property/atom command","fix qbmsst command","fix qeq/point command","fix qeq/comb command","fix qeq/reax command","fix qmmm command","fix qtb command","fix reax/bonds command","fix reax/c/species command","fix recenter command","fix restrain command","fix rigid command","fix saed/vtk command","fix setforce command","fix shake command","fix smd command","fix smd/adjust_dt command","fix smd/integrate_tlsph command","fix smd/integrate_ulsph command","fix smd/move_tri_surf command","fix smd/setvel command","&lt;no title&gt;","fix smd/wall_surface command","fix spring command","fix spring/rg command","fix spring/self command","fix srd command","fix store/force command","fix store/state command","fix temp/berendsen command","fix temp/csvr command","fix temp/rescale command","fix temp/rescale/eff command","fix tfmc command","fix thermal/conductivity command","fix ti/rs command","fix ti/spring command","fix tmd command","fix ttm command","fix tune/kspace command","fix vector command","fix viscosity command","fix viscous command","fix wall/lj93 command","fix wall/gran command","fix wall/piston command","fix wall/reflect command","fix wall/region command","fix wall/srd command","group command","group2ndx command","if command","improper_style class2 command","improper_coeff command","improper_style cossq command","improper_style cvff command","improper_style distance command","improper_style fourier command","improper_style harmonic command","improper_style hybrid command","improper_style none command","improper_style ring command","improper_style command","improper_style umbrella command","include command","info command","jump command","kspace_modify command","kspace_style command","label command","lattice command","log command","mass command","min_modify command","min_style command","minimize command","molecule command","neb command","neigh_modify command","neighbor command","newton command","next command","package command","pair_style adp command","pair_style airebo command","pair_style awpmd/cut command","pair_style beck command","pair_style body command","pair_style body/rounded/polygon command","pair_style bop command","pair_style born command","pair_style brownian command","pair_style buck command","pair_style buck/long/coul/long command","pair_style lj/charmm/coul/charmm command","pair_style lj/class2 command","pair_coeff command","pair_style colloid command","pair_style comb command","pair_style coul/cut command","pair_style coul/diel command","pair_style born/coul/long/cs command","pair_style lj/cut/dipole/cut command","pair_style dpd command","pair_style dsmc command","pair_style eam command","pair_style edip command","pair_style eff/cut command","pair_style eim command","pair_style gauss command","pair_style gayberne command","pair_style gran/hooke command","pair_style lj/gromacs command","pair_style hbond/dreiding/lj command","pair_style hybrid command","pair_style kim command","pair_style lcbop command","pair_style line/lj command","pair_style list command","pair_style lj/cut command","pair_style lj96/cut command","pair_style lj/cubic command","pair_style lj/expand command","pair_style lj/long/coul/long command","pair_style lj/sf command","pair_style lj/smooth command","pair_style lj/smooth/linear command","pair_style lj/cut/soft command","pair_style lubricate command","pair_style lubricateU command","pair_style lj/mdf command","pair_style meam command","pair_style meam/spline","pair_style meam/sw/spline","pair_style mgpt command","pair_style mie/cut command","pair_modify command","pair_style morse command","pair_style nb3b/harmonic command","pair_style nm/cut command","pair_style none command","pair_style peri/pmb command","pair_style polymorphic command","pair_style quip command","pair_style reax command","pair_style reax/c command","pair_style resquared command","pair_style lj/sdk command","pair_style smd/hertz command","pair_style smd/tlsph command","pair_style smd/tri_surface command","pair_style smd/ulsph command","pair_style smtbq command","pair_style snap command","pair_style soft command","pair_style sph/heatconduction command","pair_style sph/idealgas command","pair_style sph/lj command","pair_style sph/rhosum command","pair_style sph/taitwater command","pair_style sph/taitwater/morris command","pair_style srp command","pair_style command","pair_style sw command","pair_style table command","pair_style tersoff command","pair_style tersoff/mod command","pair_style tersoff/zbl command","pair_style thole command","pair_style tri/lj command","pair_style vashishta command","pair_write command","pair_style yukawa command","pair_style yukawa/colloid command","pair_style zbl command","partition command","prd command","print command","processors command","python command","quit command","read_data command","read_dump command","read_restart command","region command","replicate command","rerun command","reset_timestep command","restart command","run command","run_style command","set command","shell command","special_bonds command","suffix command","tad command","temper command","thermo command","thermo_modify command","thermo_style command","timer command","timestep command","&lt;no title&gt;","uncompute command","undump command","unfix command","units command","variable command","velocity command","write_data command","write_dump command","write_restart command"],titleterms:{"break":215,"default":[37,39,40,55,57,58,59,61,62,71,87,88,92,103,104,106,108,109,120,124,125,142,148,156,157,161,167,168,171,173,187,189,190,191,193,194,195,196,198,199,200,202,203,204,206,210,211,212,215,216,218,219,220,221,225,228,231,232,237,239,240,241,242,243,245,250,253,255,256,260,276,277,281,282,285,286,287,288,289,291,294,296,297,299,300,314,316,321,322,323,324,327,329,331,333,337,350,353,355,356,358,359,361,362,364,366,367,368,370,373,377,379,395,416,417,422,424,432,433,449,450,464,465,466,469,470,472,474,476,477,478,481,483,485,486,487,488,489,494,496,497,498],"function":495,"long":[208,378,380,381,382,383,387,389,390,407,411,415,427,435],"new":8,"static":12,acceler:1,ackland:64,acknowledg:7,adapt:[198,199],addforc:200,addit:[12,13],addtorqu:201,adiabat:6,adjust_dt:304,adp:371,airebo:372,alloi:393,amber2lmp:13,amber:6,angl:[8,65],angle_coeff:22,angle_styl:[2,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],angmom:66,append:202,arrai:6,aspher:[6,82,146,257,261,265,266,274],atc:[9,203],atom:[6,7,8,64,67,70,71,72,73,76,77,78,80,81,85,92,96,97,100,101,102,108,112,113,115,142,143,166,202,204,205,288,495],atom_modifi:39,atom_styl:40,attract:5,aug:[],aveforc:213,awpmd:[9,373],balanc:[41,214],barostat:6,basal:67,beck:374,berendsen:[286,317],between:6,binary2txt:13,bodi:[6,8,42,68,147,258,262,267,275,375,376],bond:[8,13,69,215,216,217,295],bond_coeff:44,bond_styl:[2,43,45,46,47,48,49,50,51,52,53,54,55,56],bop:377,born:[378,389],boundari:[7,57],box:[6,58,218],brownian:379,buck:[380,381,389,418],bug:3,build:[9,11,12],calcul:6,call:12,categori:2,centro:70,ch2lmp:13,chain:13,change_box:59,charmm:[6,20,174,382,415],chunk:[6,66,71,75,90,94,105,107,116,148,163,165,206],citat:7,class2:[21,43,175,340,383],clear:60,cluster:72,cmm:9,cna:73,code:6,coeffici:6,colloid:[331,385,461],colvar:[9,13,219],com:[74,75,149],comb3:386,comb:[291,386],come:5,comm_modifi:61,comm_styl:62,comman:[],command:[2,6,8,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,491,492,493,494,495,496,497,498,499],common:3,comparison:1,compos:6,compress:9,comput:[2,6,8,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,495],compute_modifi:103,condit:7,conduct:[6,322],constant:6,constraint:7,contact:76,contact_radiu:122,coord:77,core:6,correl:[207,208],cosin:[23,24,25,26,27,28,177],cossq:342,coul:[378,380,381,382,383,387,388,389,400,407,411,415,427,435],coupl:6,creat:216,create_atom:168,create_bond:169,create_box:170,createatom:13,creation:7,csld:318,csvr:318,cubic:409,cuda:[9,14,111,114,145,155,200,213,227,230,234,255,264,301,302,317,319,330,378,380,382,383,393,399,400,407,408,410,413,425,451,453],custom:8,cut:[49,373,380,383,387,390,395,397,407,408,415,423,427],cvff:343,damag:[78,123],data2xmovi:13,data:6,databas:13,deby:[387,407],dec:[],deform:[151,152,220],delete_atom:171,delete_bond:172,delta:24,deposit:221,descript:[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,491,492,493,494,495,496,497,498,499],diagnost:7,diel:388,dielectr:173,diffract:9,diffus:6,dihedr:[8,79],dihedral_coeff:176,dihedral_styl:[2,174,175,177,178,179,180,181,182,183,184,185,186,187,188],dilat:80,dimens:189,dipol:[6,29,390],direct:224,discuss:6,disp:6,displac:[81,86],displace_atom:190,distanc:344,distribut:[7,12],document:0,dpd:391,drag:222,dreid:[6,401],drude:[6,9,153,223,224,240],dsf:[387,407],dsmc:392,dump:[6,8,191,192,193,195],dump_modifi:194,dynam:290,eam:[13,393],echo:196,edip:394,eff:[9,13,97,98,152,154,159,241,256,268,277,320,395],efield:226,eim:396,elast:6,emac:13,enforce2d:227,ensembl:7,erot:[82,83,84,85],error:3,evapor:228,event:86,exampl:[1,4,6,11,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,482,483,484,485,486,487,488,489,491,492,493,494,495,496,497,498,499],exp:[27,177],expand:[46,410],extend:[8,11],extern:229,fcc:280,featur:[7,8,495],fene:[45,46],fep:[9,13,87,199],field:[6,7],file:6,finit:6,fire:290,fix:[2,6,8,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,495],fix_modifi:[198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336],flow:6,fluid:242,flux:[91,144],forc:[6,7,144,315],fourier:[30,31,178,345],freez:230,from:[6,11],futur:5,gauss:397,gaybern:398,gcmc:231,gener:[1,6,7,13],get:12,gld:232,gle:233,global:6,gpu:[9,15,374,378,380,382,383,385,387,390,391,393,397,398,400,407,408,409,410,423,425,434,435,442,451,452,453,460,461,462],gran:[332,399],granular:6,graviti:234,gromac:400,group2ndx:338,group:[88,337,495],gyrat:[89,90],h5md:[9,191,192],harmon:[32,47,48,49,179,182,331,346,426],hbond:401,heat:[91,144,235],heatconduct:443,helix:180,hertz:[399,436],hexord:92,histo:209,histori:[5,399],hook:399,hourglass_error:124,how:6,hybrid:[33,50,181,347,402],idealga:444,imag:[191,193],imd:236,implicit:382,improp:[8,93],improper_coeff:341,improper_styl:[2,340,342,343,344,345,346,347,348,349,350,351],includ:352,inclus:8,indent:237,indic:0,individu:2,induc:6,inertia:94,info:[0,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336,353],input:[2,6,8],instal:11,instruct:9,integr:[6,7],integrate_tlsph:305,integrate_ulsph:306,intel:[9,16,255,264,265,380,382,398,407,451,453],interfac:[6,11],internal_energi:125,introduct:7,invers:224,ipi:238,ipp:13,jan:0,jul:[],jump:354,kate:13,keyword:424,kim:[9,403],kokko:[9,17],kspace:[2,8,9,327],kspace_modifi:355,kspace_styl:[6,356],label:357,lammp:[0,1,2,6,7,8,11,12],langevin:[239,240,241],lattic:358,lcbop:404,lennard:418,librari:[6,11,12],limit:[269,319],line:[12,270,405],linear:414,lineforc:247,list:[2,406],lj1043:331,lj126:331,lj93:331,lj96:408,lmp2arc:13,lmp2cfg:13,lmp2vmd:13,local:[6,65,68,69,79,93,110,117],log:359,lubric:416,lubricateu:417,make:12,mass:360,math:495,matlab:13,mdf:418,meam:[9,419,420,421],measur:1,meso:[248,249],meso_:100,meso_rho:101,meso_t:102,messag:3,mgpt:[9,422],micelle2d:13,mie:423,min_modifi:361,min_styl:362,minim:[8,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336,363],misc:9,mod:[326,454],model:[6,7],modifi:8,molecul:364,molfil:[9,191,195],moltempl:13,momentum:[243,251],morri:448,mors:[51,401,425],move:252,move_tri_surf:307,movi:[191,193],mpi:11,msd:[104,105,106],msi2lmp:13,msm:[378,380,382,387,407],msst:253,multi:[6,7,182],multipl:6,nb3b:426,neb:[254,365],neigh_modifi:366,neighbor:367,nemd:6,newton:368,next:369,nharmon:183,noforc:[266,271],non:[6,7],none:[34,52,184,348,428],nongauss:106,nonlinear:53,nph:[255,256,257,258,259,299],nphug:260,npt:[255,256,261,262,263,299],nve:[264,265,266,267,268,269,270,271,272,273,299],nvt:[255,256,274,275,276,277,278,299],omega:107,omp:[9,18,20,21,23,24,25,26,27,28,29,30,31,32,35,38,43,45,46,47,48,49,51,53,54,56,174,175,177,178,179,180,182,183,185,186,188,234,255,257,259,260,261,263,264,272,274,276,278,291,340,342,343,345,346,349,351,371,372,374,378,379,380,381,382,383,385,386,387,388,390,391,393,396,397,398,399,400,401,402,407,408,409,410,411,412,413,414,415,416,420,421,425,426,427,429,434,435,442,451,452,453,454,455,458,460,461,462],onewai:279,open:7,oper:495,opl:185,opt:[19,382,393,407,411,425],optim:1,option:[6,8,12],orient:280,orientord:108,orthogon:6,other:6,output:[6,7,8,12,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336],overlai:402,overview:11,packag:[1,9,12,14,15,16,17,18,19,370],pair:[6,109,110],pair_coeff:384,pair_modifi:424,pair_styl:[2,371,372,373,374,375,376,377,378,379,380,381,382,383,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,460,461,462],pair_writ:459,pairwis:8,parallel:11,paramet:6,pars:2,partial:155,particl:[6,7,42],partit:463,past:5,per:6,perform:[1,10],peri:429,period:25,phonon:[9,13,281],pimd:282,piston:333,planeforc:283,plastic:113,plastic_strain:126,plastic_strain_r:127,pmb:429,poem:[9,284],point:290,polariz:6,poli:[379,416,417],polygon:376,polym:13,polymorph:430,post:7,potenti:[2,6,8],pour:285,pppm:6,prd:464,pre:7,press:286,pressur:114,previou:12,print:[287,465],problem:[3,4],process:[6,7],processor:466,profil:156,properti:[6,115,116,117,288],pymol_aspher:13,python:[9,11,13,467],qbmsst:289,qeq:[290,291,292],qmmm:[9,293],qtb:[9,294],quadrat:186,quantiti:6,quartic:[35,54],quip:431,quit:468,ramp:157,rattl:302,rdf:118,read_data:469,read_dump:470,read_restart:471,reax:[9,13,292,295,296,432,433],reaxc:9,rebo:372,recent:297,reduc:119,refer:495,reflect:334,region:[8,119,158,159,335,472,495],relat:[20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,40,41,43,44,45,46,47,48,49,50,51,53,54,55,56,57,59,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,83,84,85,86,87,89,91,92,93,94,95,96,97,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,185,186,187,188,189,190,191,192,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,228,230,231,232,233,234,235,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,294,295,296,297,299,300,301,303,304,305,306,307,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,349,350,351,352,353,354,355,356,358,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,429,430,431,432,433,434,435,436,437,438,439,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,474,475,476,477,478,479,481,482,483,484,485,486,487,488,489,491,492,493,495,496,497,498,499],relax:218,replic:473,replica:[6,7],report:3,requir:12,rerun:474,rescal:[319,320],reset:225,reset_timestep:475,resquar:434,restart2data:13,restart:[6,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336,476],restrain:298,restrict:[14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,491,492,493,494,495,496,497,498,499],rho:128,rhosum:446,rigid:[6,83,99,245,299],ring:349,rotat:160,round:376,rule:2,run:[6,11,12,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336,477],run_styl:478,scalabl:10,scalar:6,screen:12,script:[2,6,8,11],sdk:[36,435],self:313,serial:11,set:[6,479],setforc:301,setvel:308,shake:302,share:[11,12],shell:[6,480],shield:290,shift:[26,27,48,49,177],simpl:31,simul:6,size:6,slater:290,slice:121,sllod:[276,277],small:299,smd:[9,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,303,304,305,306,307,308,310,436,437,438,439],smooth:[413,414],smtbq:[9,440],sna:142,snad:142,snap:441,snapshot:6,snav:142,soft:[415,442],solver:2,sourc:7,spatial:[210,211],spc:6,speci:296,special:[7,424,495],special_bond:481,sph:[9,443,444,445,446,447,448],sphere:[84,85,161,211,245,259,263,272,278],spheric:6,spline:[420,421],spring:[311,312,313,324],squar:28,srd:[314,336],srp:449,standard:9,start:[12,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336],state:316,stationari:249,stop:[198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,283,284,285,286,287,288,289,290,291,292,293,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,328,329,330,331,332,333,334,335,336],store:[315,316],strategi:1,streitz:387,stress:[143,144],structur:2,style:[1,2,6,8],submit:8,suffix:482,summari:6,swap:[204,217],syntax:[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,281,282,283,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,491,492,493,494,495,496,497,498,499],system:6,tabl:[0,6,38,56,188,452,453],tad:483,taitwat:[447,448],talli:144,temp:[145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,317,318,319,320],temper:484,temperatur:6,tersoff:[453,454,455],test:11,tfmc:321,thermal:[6,322],thermo:[6,485],thermo_modifi:486,thermo_styl:487,thermodynam:[6,8],thermostat:6,thole:456,time:[6,212],timer:488,timestep:489,tip3p:6,tip4p:[6,387,407,411,415],tip:12,tlsph:437,tlsph_defgrad:129,tlsph_dt:130,tlsph_num_neigh:131,tlsph_shape:132,tlsph_strain:133,tlsph_strain_rat:134,tlsph_stress:135,tmd:325,tool:[12,13],torqu:163,transform:224,tri:[273,457],tri_surfac:438,triangle_mesh_vertic:136,triclin:6,tstat:391,ttm:326,tune:327,type:7,ulsph:439,ulsph_num_neigh:137,ulsph_strain:138,ulsph_strain_r:139,ulsph_stress:140,umbrella:351,uncomput:491,undump:492,unfix:493,unit:494,user:[9,12,14,16,18],vacf:164,valu:[6,495],variabl:[6,8,495],variou:1,vashishta:458,vcm:165,vector:[6,328,495],veloc:496,version:[0,5,12],via:12,vim:13,viscos:[6,329],viscou:[246,330],visual:6,vol:141,voronoi:[9,166],vtk:300,wall:[6,331,332,333,334,335,336],wall_surfac:310,warn:3,water:6,weight:209,what:[7,12],wolf:[378,387],wrapper:11,write:6,write_data:497,write_dump:498,write_restart:499,xmgrace:13,xmovi:13,xrd:167,xtc:9,yukawa:[460,461],zbl:[455,462]}})
\ No newline at end of file
diff --git a/doc/set.html b/doc/set.html
index 19adadf2b..2f79b9eda 100644
--- a/doc/set.html
+++ b/doc/set.html
@@ -1,556 +1,556 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>set command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="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="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<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">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>set command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="set-command">
<span id="index-0"></span><h1>set command<a class="headerlink" href="#set-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>set style ID keyword values ...
</pre></div>
</div>
-<ul>
-<li><p class="first">style = <em>atom</em> or <em>type</em> or <em>mol</em> or <em>group</em> or <em>region</em></p>
-</li>
-<li><p class="first">ID = atom ID range or type range or mol ID range or group ID or region ID</p>
-</li>
-<li><p class="first">one or more keyword/value pairs may be appended</p>
-</li>
-<li><dl class="first docutils">
-<dt>keyword = <em>type</em> or <em>type/fraction</em> or <em>mol</em> or <em>x</em> or <em>y</em> or <em>z</em> or <em>charge</em> or <em>dipole</em> or <em>dipole/random</em> or <em>quat</em> or <em>quat/random</em> or <em>diameter</em> or <em>shape</em> or <em>length</em> or <em>tri</em> or <em>theta</em> or <em>angmom</em> or <em>omega</em> or <em>mass</em> or <em>density</em> or <em>volume</em> or <em>image</em> or</dt>
-<dd><p class="first last"><em>bond</em> or <em>angle</em> or <em>dihedral</em> or <em>improper</em> or
-<em>meso_e</em> or <em>meso_cv</em> or <em>meso_rho</em> or <em>smd_contact_radius</em> or <em>smd_mass_density</em> or <em>i_name</em> or <em>d_name</em></p>
-</dd>
-</dl>
-</li>
+<ul class="simple">
+<li>style = <em>atom</em> or <em>type</em> or <em>mol</em> or <em>group</em> or <em>region</em></li>
+<li>ID = atom ID range or type range or mol ID range or group ID or region ID</li>
+<li>one or more keyword/value pairs may be appended</li>
+<li>keyword = <em>type</em> or <em>type/fraction</em> or <em>mol</em> or <em>x</em> or <em>y</em> or <em>z</em> or <em>charge</em> or <em>dipole</em> or <em>dipole/random</em> or <em>quat</em> or <em>quat/random</em> or <em>diameter</em> or <em>shape</em> or <em>length</em> or <em>tri</em> or <em>theta</em> or <em>theta/random</em> or <em>angmom</em> or <em>omega</em> or <em>mass</em> or <em>density</em> or <em>volume</em> or <em>image</em> or <em>bond</em> or <em>angle</em> or <em>dihedral</em> or <em>improper</em> or <em>meso_e</em> or <em>meso_cv</em> or <em>meso_rho</em> or <em>smd_contact_radius</em> or <em>smd_mass_density</em> or <em>i_name</em> or <em>d_name</em></li>
</ul>
<pre class="literal-block">
<em>type</em> value = atom type
value can be an atom-style variable (see below)
<em>type/fraction</em> values = type fraction seed
type = new atom type
fraction = fraction of selected atoms to set to new atom type
seed = random # seed (positive integer)
<em>mol</em> value = molecule ID
value can be an atom-style variable (see below)
<em>x</em>,*y*,*z* value = atom coordinate (distance units)
value can be an atom-style variable (see below)
<em>charge</em> value = atomic charge (charge units)
value can be an atom-style variable (see below)
<em>dipole</em> values = x y z
x,y,z = orientation of dipole moment vector
any of x,y,z can be an atom-style variable (see below)
<em>dipole/random</em> value = seed Dlen
seed = random # seed (positive integer) for dipole moment orientations
Dlen = magnitude of dipole moment (dipole units)
<em>quat</em> values = a b c theta
a,b,c = unit vector to rotate particle around via right-hand rule
theta = rotation angle (degrees)
any of a,b,c,theta can be an atom-style variable (see below)
<em>quat/random</em> value = seed
seed = random # seed (positive integer) for quaternion orientations
<em>diameter</em> value = diameter of spherical particle (distance units)
value can be an atom-style variable (see below)
<em>shape</em> value = Sx Sy Sz
Sx,Sy,Sz = 3 diameters of ellipsoid (distance units)
<em>length</em> value = len
len = length of line segment (distance units)
len can be an atom-style variable (see below)
<em>tri</em> value = side
side = side length of equilateral triangle (distance units)
side can be an atom-style variable (see below)
<em>theta</em> value = angle (degrees)
angle = orientation of line segment with respect to x-axis
angle can be an atom-style variable (see below)
+<em>theta/random</em> value = seed
+ seed = random # seed (positive integer) for line segment orienations
<em>angmom</em> values = Lx Ly Lz
Lx,Ly,Lz = components of angular momentum vector (distance-mass-velocity units)
any of Lx,Ly,Lz can be an atom-style variable (see below)
<em>omega</em> values = Wx Wy Wz
Wx,Wy,Wz = components of angular velocity vector (radians/time units)
any of wx,wy,wz can be an atom-style variable (see below)
<em>mass</em> value = per-atom mass (mass units)
value can be an atom-style variable (see below)
<em>density</em> value = particle density for sphere or ellipsoid (mass/distance^3 or mass/distance^2 or mass/distance units, depending on dimensionality of particle)
value can be an atom-style variable (see below)
<em>volume</em> value = particle volume for Peridynamic particle (distance^3 units)
value can be an atom-style variable (see below)
<em>image</em> nx ny nz
nx,ny,nz = which periodic image of the simulation box the atom is in
<em>bond</em> value = bond type for all bonds between selected atoms
<em>angle</em> value = angle type for all angles between selected atoms
<em>dihedral</em> value = dihedral type for all dihedrals between selected atoms
<em>improper</em> value = improper type for all impropers between selected atoms
<em>meso_e</em> value = energy of SPH particles (need units)
value can be an atom-style variable (see below)
<em>meso_cv</em> value = heat capacity of SPH particles (need units)
value can be an atom-style variable (see below)
<em>meso_rho</em> value = density of SPH particles (need units)
value can be an atom-style variable (see below)
<em>smd_contact_radius</em> = radius for short range interactions, i.e. contact and friction
value can be an atom-style variable (see below)
<em>smd_mass_density</em> = set particle mass based on volume by providing a mass density
value can be an atom-style variable (see below)
<em>i_name</em> value = value for custom integer vector with name
<em>d_name</em> value = value for custom floating-point vector with name
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>set group solvent type 2
set group solvent type/fraction 2 0.5 12393
set group edge bond 4
set region half charge 0.5
set type 3 charge 0.5
set type 1*3 charge 0.5
set atom * charge v_atomfile
set atom 100*200 x 0.5 y 1.0
set atom 1492 type 3
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Set one or more properties of one or more atoms. Since atom
properties are initially assigned by the <a class="reference internal" href="read_data.html"><em>read_data</em></a>,
<a class="reference internal" href="read_restart.html"><em>read_restart</em></a> or <a class="reference internal" href="create_atoms.html"><em>create_atoms</em></a>
commands, this command changes those assignments. This can be useful
for overriding the default values assigned by the
<a class="reference internal" href="create_atoms.html"><em>create_atoms</em></a> command (e.g. charge = 0.0). It can
be useful for altering pairwise and molecular force interactions,
since force-field coefficients are defined in terms of types. It can
be used to change the labeling of atoms by atom type or molecule ID
when they are output in <a class="reference internal" href="dump.html"><em>dump</em></a> files. It can also be useful
for debugging purposes; i.e. positioning an atom at a precise location
to compute subsequent forces or energy.</p>
<p>Note that the <em>style</em> and <em>ID</em> arguments determine which atoms have
their properties reset. The remaining keywords specify which
properties to reset and what the new values are. Some strings like
<em>type</em> or <em>mol</em> can be used as a style and/or a keyword.</p>
<hr class="docutils" />
<p>This section describes how to select which atoms to change
the properties of, via the <em>style</em> and <em>ID</em> arguments.</p>
<p>The style <em>atom</em> selects all the atoms in a range of atom IDs. The
style <em>type</em> selects all the atoms in a range of types. The style
<em>mol</em> selects all the atoms in a range of molecule IDs.</p>
<p>In each of the range cases, the range can be specified as a single
numeric value, or a wildcard asterisk can be used to specify a range
of values. This takes the form &#8220;*&#8221; or &#8220;<em>n&#8221; or &#8220;n</em>&#8221; or &#8220;m*n&#8221;. For
example, for the style <em>type</em>, if N = the number of atom types, then
an asterisk with no numeric values means all types from 1 to N. A
leading asterisk means all types from 1 to n (inclusive). A trailing
asterisk means all types from n to N (inclusive). A middle asterisk
means all types from m to n (inclusive). For all the styles except
<em>mol</em>, the lowest value for the wildcard is 1; for <em>mol</em> it is 0.</p>
<p>The style <em>group</em> selects all the atoms in the specified group. The
style <em>region</em> selects all the atoms in the specified geometric
region. See the <a class="reference internal" href="group.html"><em>group</em></a> and <a class="reference internal" href="region.html"><em>region</em></a> commands
for details of how to specify a group or region.</p>
<hr class="docutils" />
<p>This section describes the keyword options for which properties to
change, for the selected atoms.</p>
<p>Note that except where explicitly prohibited below, all of the
keywords allow an <a class="reference internal" href="variable.html"><em>atom-style or atomfile-style variable</em></a> to be used as the specified value(s). If the
value is a variable, it should be specified as v_name, where name is
the variable name. In this case, the variable will be evaluated, and
its resulting per-atom value used to determine the value assigned to
each selected atom. Note that the per-atom value from the variable
will be ignored for atoms that are not selected via the <em>style</em> and
<em>ID</em> settings explained above. A simple way to use per-atom values
from the variable to reset a property for all atoms is to use style
<em>atom</em> with <em>ID</em> = &#8220;*&#8221;; this selects all atom IDs.</p>
<p>Atom-style variables can specify formulas with various mathematical
functions, and include <a class="reference internal" href="thermo_style.html"><em>thermo_style</em></a> command
keywords for the simulation box parameters and timestep and elapsed
time. They can also include per-atom values, such as atom
coordinates. Thus it is easy to specify a time-dependent or
spatially-dependent set of per-atom values. As explained on the
<a class="reference internal" href="variable.html"><em>variable</em></a> doc page, atomfile-style variables can be
used in place of atom-style variables, and thus as arguments to the
set command. Atomfile-style variables read their per-atoms values
from a file.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Atom-style and atomfile-style variables return floating point
per-atom values. If the values are assigned to an integer variable,
such as the molecule ID, then the floating point value is truncated to
its integer portion, e.g. a value of 2.6 would become 2.</p>
</div>
<p>Keyword <em>type</em> sets the atom type for all selected atoms. The
specified value must be from 1 to ntypes, where ntypes was set by the
<a class="reference internal" href="create_box.html"><em>create_box</em></a> command or the <em>atom types</em> field in the
header of the data file read by the <a class="reference internal" href="read_data.html"><em>read_data</em></a>
command.</p>
<p>Keyword <em>type/fraction</em> sets the atom type for a fraction of the
selected atoms. The actual number of atoms changed is not guaranteed
to be exactly the requested fraction, but should be statistically
close. Random numbers are used in such a way that a particular atom
is changed or not changed, regardless of how many processors are being
used. This keyword does not allow use of an atom-style variable.</p>
<p>Keyword <em>mol</em> sets the molecule ID for all selected atoms. The <a class="reference internal" href="atom_style.html"><em>atom style</em></a> being used must support the use of molecule
IDs.</p>
<p>Keywords <em>x</em>, <em>y</em>, <em>z</em>, and <em>charge</em> set the coordinates or charge of
all selected atoms. For <em>charge</em>, the <a class="reference internal" href="atom_style.html"><em>atom style</em></a>
being used must support the use of atomic charge.</p>
<p>Keyword <em>dipole</em> uses the specified x,y,z values as components of a
vector to set as the orientation of the dipole moment vectors of the
selected atoms. The magnitude of the dipole moment is set
by the length of this orientation vector.</p>
<p>Keyword <em>dipole/random</em> randomizes the orientation of the dipole
-moment vectors of the selected atoms and sets the magnitude of each to
-the specified <em>Dlen</em> value. For 2d systems, the z component of the
+moment vectors for the selected atoms and sets the magnitude of each
+to the specified <em>Dlen</em> value. For 2d systems, the z component of the
orientation is set to 0.0. Random numbers are used in such a way that
the orientation of a particular atom is the same, regardless of how
many processors are being used. This keyword does not allow use of an
atom-style variable.</p>
<p>Keyword <em>quat</em> uses the specified values to create a quaternion
(4-vector) that represents the orientation of the selected atoms. The
-particles must be ellipsoids as defined by the <a class="reference internal" href="atom_style.html"><em>atom_style ellipsoid</em></a> command or triangles as defined by the
-<a class="reference internal" href="atom_style.html"><em>atom_style tri</em></a> command. Note that particles defined
-by <a class="reference internal" href="atom_style.html"><em>atom_style ellipsoid</em></a> have 3 shape parameters.
-The 3 values must be non-zero for each particle set by this command.
-They are used to specify the aspect ratios of an ellipsoidal particle,
+particles must define a quaternion for their orientation
+(e.g. ellipsoids, triangles, body particles) as defined by the
+<a class="reference internal" href="atom_style.html"><em>atom_style</em></a> command. Note that particles defined by
+<a class="reference internal" href="atom_style.html"><em>atom_style ellipsoid</em></a> have 3 shape parameters. The 3
+values must be non-zero for each particle set by this command. They
+are used to specify the aspect ratios of an ellipsoidal particle,
which is oriented by default with its x-axis along the simulation
box&#8217;s x-axis, and similarly for y and z. If this body is rotated (via
the right-hand rule) by an angle theta around a unit rotation vector
(a,b,c), then the quaternion that represents its new orientation is
given by (cos(theta/2), a*sin(theta/2), b*sin(theta/2),
c*sin(theta/2)). The theta and a,b,c values are the arguments to the
<em>quat</em> keyword. LAMMPS normalizes the quaternion in case (a,b,c) was
not specified as a unit vector. For 2d systems, the a,b,c values are
ignored, since a rotation vector of (0,0,1) is the only valid choice.</p>
-<p>Keyword <em>quat/random</em> randomizes the orientation of the quaternion of
-the selected atoms. The particles must be ellipsoids as defined by
-the <a class="reference internal" href="atom_style.html"><em>atom_style ellipsoid</em></a> command or triangles as
-defined by the <a class="reference internal" href="atom_style.html"><em>atom_style tri</em></a> command. Random
-numbers are used in such a way that the orientation of a particular
-atom is the same, regardless of how many processors are being used.
-For 2d systems, only orientations in the xy plane are generated. As
-with keyword <em>quat</em>, for ellipsoidal particles, the 3 shape values
-must be non-zero for each particle set by this command. This keyword
-does not allow use of an atom-style variable.</p>
+<p>Keyword <em>quat/random</em> randomizes the orientation of the quaternion for
+the selected atoms. The particles must define a quaternion for their
+orientation (e.g. ellipsoids, triangles, body particles) as defined by
+the <a class="reference internal" href="atom_style.html"><em>atom_style</em></a> command. Random numbers are used in
+such a way that the orientation of a particular atom is the same,
+regardless of how many processors are being used. For 2d systems,
+only orientations in the xy plane are generated. As with keyword
+<em>quat</em>, for ellipsoidal particles, the 3 shape values must be non-zero
+for each particle set by this command. This keyword does not allow
+use of an atom-style variable.</p>
<p>Keyword <em>diameter</em> sets the size of the selected atoms. The particles
must be finite-size spheres as defined by the <a class="reference internal" href="atom_style.html"><em>atom_style sphere</em></a> command. The diameter of a particle can be
set to 0.0, which means they will be treated as point particles. Note
that this command does not adjust the particle mass, even if it was
defined with a density, e.g. via the <a class="reference internal" href="read_data.html"><em>read_data</em></a>
command.</p>
<p>Keyword <em>shape</em> sets the size and shape of the selected atoms. The
particles must be ellipsoids as defined by the <a class="reference internal" href="atom_style.html"><em>atom_style ellipsoid</em></a> command. The <em>Sx</em>, <em>Sy</em>, <em>Sz</em> settings are
the 3 diameters of the ellipsoid in each direction. All 3 can be set
to the same value, which means the ellipsoid is effectively a sphere.
They can also all be set to 0.0 which means the particle will be
treated as a point particle. Note that this command does not adjust
the particle mass, even if it was defined with a density, e.g. via the
<a class="reference internal" href="read_data.html"><em>read_data</em></a> command.</p>
<p>Keyword <em>length</em> sets the length of selected atoms. The particles
must be line segments as defined by the <a class="reference internal" href="atom_style.html"><em>atom_style line</em></a> command. If the specified value is non-zero the
line segment is (re)set to a length = the specified value, centered
around the particle position, with an orientation along the x-axis.
If the specified value is 0.0, the particle will become a point
particle. Note that this command does not adjust the particle mass,
even if it was defined with a density, e.g. via the
<a class="reference internal" href="read_data.html"><em>read_data</em></a> command.</p>
<p>Keyword <em>tri</em> sets the size of selected atoms. The particles must be
triangles as defined by the <a class="reference internal" href="atom_style.html"><em>atom_style tri</em></a> command.
If the specified value is non-zero the triangle is (re)set to be an
equilateral triangle in the xy plane with side length = the specified
value, with a centroid at the particle position, with its base
parallel to the x axis, and the y-axis running from the center of the
base to the top point of the triangle. If the specified value is 0.0,
the particle will become a point particle. Note that this command
does not adjust the particle mass, even if it was defined with a
density, e.g. via the <a class="reference internal" href="read_data.html"><em>read_data</em></a> command.</p>
<p>Keyword <em>theta</em> sets the orientation of selected atoms. The particles
must be line segments as defined by the <a class="reference internal" href="atom_style.html"><em>atom_style line</em></a> command. The specified value is used to set the
orientation angle of the line segments with respect to the x axis.</p>
+<p>Keyword <em>theta/random</em> randomizes the orientation of theta for the
+selected atoms. The particles must be line segments as defined by the
+<a class="reference internal" href="atom_style.html"><em>atom_style line</em></a> command. Random numbers are used in
+such a way that the orientation of a particular atom is the same,
+regardless of how many processors are being used. This keyword does
+not allow use of an atom-style variable.</p>
<p>Keyword <em>angmom</em> sets the angular momentum of selected atoms. The
particles must be ellipsoids as defined by the <a class="reference internal" href="atom_style.html"><em>atom_style ellipsoid</em></a> command or triangles as defined by the
<a class="reference internal" href="atom_style.html"><em>atom_style tri</em></a> command. The angular momentum vector
of the particles is set to the 3 specified components.</p>
<p>Keyword <em>omega</em> sets the angular velocity of selected atoms. The
particles must be spheres as defined by the &#8220;atom_style sphere&#8221;_
atom_style.html command. The angular velocity vector of the particles
is set to the 3 specified components.</p>
<p>Keyword <em>mass</em> sets the mass of all selected particles. The particles
must have a per-atom mass attribute, as defined by the
<a class="reference internal" href="atom_style.html"><em>atom_style</em></a> command. See the &#8220;mass&#8221; command for how
to set mass values on a per-type basis.</p>
<p>Keyword <em>density</em> also sets the mass of all selected particles, but in
a different way. The particles must have a per-atom mass attribute,
as defined by the <a class="reference internal" href="atom_style.html"><em>atom_style</em></a> command. If the atom
has a radius attribute (see <a class="reference internal" href="atom_style.html"><em>atom_style sphere</em></a>) and
its radius is non-zero, its mass is set from the density and particle
volume. If the atom has a shape attribute (see <a class="reference internal" href="atom_style.html"><em>atom_style ellipsoid</em></a>) and its 3 shape parameters are non-zero,
then its mass is set from the density and particle volume. If the
atom has a length attribute (see <a class="reference internal" href="atom_style.html"><em>atom_style line</em></a>)
and its length is non-zero, then its mass is set from the density and
line segment length (the input density is assumed to be in
mass/distance units). If the atom has an area attribute (see
<a class="reference internal" href="atom_style.html"><em>atom_style tri</em></a>) and its area is non-zero, then its
mass is set from the density and triangle area (the input density is
assumed to be in mass/distance^2 units). If none of these cases are
valid, then the mass is set to the density value directly (the input
density is assumed to be in mass units).</p>
<p>Keyword <em>smd_mass_density</em> also sets the mass of all selected
particles, but it is only applicable to the Smooth Mach Dynamics
package USER-SMD. This command assumes that the particle volume has
already been correctly set and calculates particle mass from the
provided mass density value.</p>
<p>Keyword <em>smd_contact_radius</em> only applies to simulations with the
Smooth Mach Dynamics package USER-SMD. This command sets an
interaction radius for computing short-range interactions,
e.g. repulsive forces to prevent different individual physical bodies
from penetrating each other. Note that the SPH smoothing kernel
diameter used for computing long range, nonlocal interactions, is set
using the <em>diameter</em> keyword.</p>
<p>Keyword <em>volume</em> sets the volume of all selected particles.
Currently, only the <a class="reference internal" href="atom_style.html"><em>atom_style peri</em></a> command defines
particles with a volume attribute. Note that this command does not
adjust the particle mass.</p>
<p>Keyword <em>image</em> sets which image of the simulation box the atom is
considered to be in. An image of 0 means it is inside the box as
defined. A value of 2 means add 2 box lengths to get the true value.
A value of -1 means subtract 1 box length to get the true value.
LAMMPS updates these flags as atoms cross periodic boundaries during
the simulation. The flags can be output with atom snapshots via the
<a class="reference internal" href="dump.html"><em>dump</em></a> command. If a value of NULL is specified for any of
nx,ny,nz, then the current image value for that dimension is
unchanged. For non-periodic dimensions only a value of 0 can be
specified. This keyword does not allow use of atom-style variables.
This command can be useful after a system has been equilibrated and
atoms have diffused one or more box lengths in various directions.
This command can then reset the image values for atoms so that they
are effectively inside the simulation box, e.g if a diffusion
coefficient is about to be measured via the <a class="reference internal" href="compute_msd.html"><em>compute msd</em></a> command. Care should be taken not to reset the
image flags of two atoms in a bond to the same value if the bond
straddles a periodic boundary (rather they should be different by +/-
1). This will not affect the dynamics of a simulation, but may mess
up analysis of the trajectories if a LAMMPS diagnostic or your own
analysis relies on the image flags to unwrap a molecule which
straddles the periodic box.</p>
<p>Keywords <em>bond</em>, <em>angle</em>, <em>dihedral</em>, and <em>improper</em>, set the bond
type (angle type, etc) of all bonds (angles, etc) of selected atoms to
the specified value from 1 to nbondtypes (nangletypes, etc). All
atoms in a particular bond (angle, etc) must be selected atoms in
order for the change to be made. The value of nbondtype (nangletypes,
etc) was set by the <em>bond types</em> (<em>angle types</em>, etc) field in the
header of the data file read by the <a class="reference internal" href="read_data.html"><em>read_data</em></a>
command. These keywords do not allow use of an atom-style variable.</p>
<p>Keywords <em>meso_e</em>, <em>meso_cv</em>, and <em>meso_rho</em> set the energy, heat
capacity, and density of smmothed particle hydrodynamics (SPH)
particles. See <a class="reference external" href="USER/sph/SPH_LAMMPS_userguide.pdf">this PDF guide</a> to
using SPH in LAMMPS.</p>
<p>Keywords <em>i_name</em> and <em>d_name</em> refer to custom integer and
floating-point properties that have been added to each atom via the
<a class="reference internal" href="fix_property_atom.html"><em>fix property/atom</em></a> command. When that command
is used specific names are given to each attribute which are what is
specified as the &#8220;name&#8221; portion of <em>i_name</em> or <em>d_name</em>.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>You cannot set an atom attribute (e.g. <em>mol</em> or <em>q</em> or <em>volume</em>) if
the <a class="reference internal" href="atom_style.html"><em>atom_style</em></a> does not have that attribute.</p>
<p>This command requires inter-processor communication to coordinate the
setting of bond types (angle types, etc). This means that your system
must be ready to perform a simulation before using one of these
keywords (force fields set, atom mass set, etc). This is not
necessary for other keywords.</p>
<p>Using the <em>region</em> style with the bond (angle, etc) keywords can give
unpredictable results if there are bonds (angles, etc) that straddle
periodic boundaries. This is because the region may only extend up to
the boundary and partner atoms in the bond (angle, etc) may have
coordinates outside the simulation box if they are ghost atoms.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="create_box.html"><em>create_box</em></a>, <a class="reference internal" href="create_atoms.html"><em>create_atoms</em></a>,
<a class="reference internal" href="read_data.html"><em>read_data</em></a></p>
<p><strong>Default:</strong> none</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
diff --git a/doc/set.txt b/doc/set.txt
index 47188dd82..7dfa8bf12 100644
--- a/doc/set.txt
+++ b/doc/set.txt
@@ -1,410 +1,420 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
set command :h3
[Syntax:]
set style ID keyword values ... :pre
style = {atom} or {type} or {mol} or {group} or {region} :ulb,l
ID = atom ID range or type range or mol ID range or group ID or region ID :l
one or more keyword/value pairs may be appended :l
keyword = {type} or {type/fraction} or {mol} or {x} or {y} or {z} or \
{charge} or {dipole} or {dipole/random} or {quat} or \
{quat/random} or {diameter} or {shape} or \
- {length} or {tri} or {theta} or {angmom} or {omega} or \
- {mass} or {density} or {volume} or {image} or
- {bond} or {angle} or {dihedral} or {improper} or
+ {length} or {tri} or {theta} or {theta/random} or \
+ {angmom} or {omega} or \
+ {mass} or {density} or {volume} or {image} or \
+ {bond} or {angle} or {dihedral} or {improper} or \
{meso_e} or {meso_cv} or {meso_rho} or \
{smd_contact_radius} or {smd_mass_density} or \
{i_name} or {d_name} :l
{type} value = atom type
value can be an atom-style variable (see below)
{type/fraction} values = type fraction seed
type = new atom type
fraction = fraction of selected atoms to set to new atom type
seed = random # seed (positive integer)
{mol} value = molecule ID
value can be an atom-style variable (see below)
{x},{y},{z} value = atom coordinate (distance units)
value can be an atom-style variable (see below)
{charge} value = atomic charge (charge units)
value can be an atom-style variable (see below)
{dipole} values = x y z
x,y,z = orientation of dipole moment vector
any of x,y,z can be an atom-style variable (see below)
{dipole/random} value = seed Dlen
seed = random # seed (positive integer) for dipole moment orientations
Dlen = magnitude of dipole moment (dipole units)
{quat} values = a b c theta
a,b,c = unit vector to rotate particle around via right-hand rule
theta = rotation angle (degrees)
any of a,b,c,theta can be an atom-style variable (see below)
{quat/random} value = seed
seed = random # seed (positive integer) for quaternion orientations
{diameter} value = diameter of spherical particle (distance units)
value can be an atom-style variable (see below)
{shape} value = Sx Sy Sz
Sx,Sy,Sz = 3 diameters of ellipsoid (distance units)
{length} value = len
len = length of line segment (distance units)
len can be an atom-style variable (see below)
{tri} value = side
side = side length of equilateral triangle (distance units)
side can be an atom-style variable (see below)
{theta} value = angle (degrees)
angle = orientation of line segment with respect to x-axis
angle can be an atom-style variable (see below)
+ {theta/random} value = seed
+ seed = random # seed (positive integer) for line segment orienations
{angmom} values = Lx Ly Lz
Lx,Ly,Lz = components of angular momentum vector (distance-mass-velocity units)
any of Lx,Ly,Lz can be an atom-style variable (see below)
{omega} values = Wx Wy Wz
Wx,Wy,Wz = components of angular velocity vector (radians/time units)
any of wx,wy,wz can be an atom-style variable (see below)
{mass} value = per-atom mass (mass units)
value can be an atom-style variable (see below)
{density} value = particle density for sphere or ellipsoid (mass/distance^3 or mass/distance^2 or mass/distance units, depending on dimensionality of particle)
value can be an atom-style variable (see below)
{volume} value = particle volume for Peridynamic particle (distance^3 units)
value can be an atom-style variable (see below)
{image} nx ny nz
nx,ny,nz = which periodic image of the simulation box the atom is in
{bond} value = bond type for all bonds between selected atoms
{angle} value = angle type for all angles between selected atoms
{dihedral} value = dihedral type for all dihedrals between selected atoms
{improper} value = improper type for all impropers between selected atoms
{meso_e} value = energy of SPH particles (need units)
value can be an atom-style variable (see below)
{meso_cv} value = heat capacity of SPH particles (need units)
value can be an atom-style variable (see below)
{meso_rho} value = density of SPH particles (need units)
value can be an atom-style variable (see below)
{smd_contact_radius} = radius for short range interactions, i.e. contact and friction
value can be an atom-style variable (see below)
{smd_mass_density} = set particle mass based on volume by providing a mass density
value can be an atom-style variable (see below)
{i_name} value = value for custom integer vector with name
{d_name} value = value for custom floating-point vector with name :pre
:ule
[Examples:]
set group solvent type 2
set group solvent type/fraction 2 0.5 12393
set group edge bond 4
set region half charge 0.5
set type 3 charge 0.5
set type 1*3 charge 0.5
set atom * charge v_atomfile
set atom 100*200 x 0.5 y 1.0
set atom 1492 type 3 :pre
[Description:]
Set one or more properties of one or more atoms. Since atom
properties are initially assigned by the "read_data"_read_data.html,
"read_restart"_read_restart.html or "create_atoms"_create_atoms.html
commands, this command changes those assignments. This can be useful
for overriding the default values assigned by the
"create_atoms"_create_atoms.html command (e.g. charge = 0.0). It can
be useful for altering pairwise and molecular force interactions,
since force-field coefficients are defined in terms of types. It can
be used to change the labeling of atoms by atom type or molecule ID
when they are output in "dump"_dump.html files. It can also be useful
for debugging purposes; i.e. positioning an atom at a precise location
to compute subsequent forces or energy.
Note that the {style} and {ID} arguments determine which atoms have
their properties reset. The remaining keywords specify which
properties to reset and what the new values are. Some strings like
{type} or {mol} can be used as a style and/or a keyword.
:line
This section describes how to select which atoms to change
the properties of, via the {style} and {ID} arguments.
The style {atom} selects all the atoms in a range of atom IDs. The
style {type} selects all the atoms in a range of types. The style
{mol} selects all the atoms in a range of molecule IDs.
In each of the range cases, the range can be specified as a single
numeric value, or a wildcard asterisk can be used to specify a range
of values. This takes the form "*" or "*n" or "n*" or "m*n". For
example, for the style {type}, if N = the number of atom types, then
an asterisk with no numeric values means all types from 1 to N. A
leading asterisk means all types from 1 to n (inclusive). A trailing
asterisk means all types from n to N (inclusive). A middle asterisk
means all types from m to n (inclusive). For all the styles except
{mol}, the lowest value for the wildcard is 1; for {mol} it is 0.
The style {group} selects all the atoms in the specified group. The
style {region} selects all the atoms in the specified geometric
region. See the "group"_group.html and "region"_region.html commands
for details of how to specify a group or region.
:line
This section describes the keyword options for which properties to
change, for the selected atoms.
Note that except where explicitly prohibited below, all of the
keywords allow an "atom-style or atomfile-style
variable"_variable.html to be used as the specified value(s). If the
value is a variable, it should be specified as v_name, where name is
the variable name. In this case, the variable will be evaluated, and
its resulting per-atom value used to determine the value assigned to
each selected atom. Note that the per-atom value from the variable
will be ignored for atoms that are not selected via the {style} and
{ID} settings explained above. A simple way to use per-atom values
from the variable to reset a property for all atoms is to use style
{atom} with {ID} = "*"; this selects all atom IDs.
Atom-style variables can specify formulas with various mathematical
functions, and include "thermo_style"_thermo_style.html command
keywords for the simulation box parameters and timestep and elapsed
time. They can also include per-atom values, such as atom
coordinates. Thus it is easy to specify a time-dependent or
spatially-dependent set of per-atom values. As explained on the
"variable"_variable.html doc page, atomfile-style variables can be
used in place of atom-style variables, and thus as arguments to the
set command. Atomfile-style variables read their per-atoms values
from a file.
NOTE: Atom-style and atomfile-style variables return floating point
per-atom values. If the values are assigned to an integer variable,
such as the molecule ID, then the floating point value is truncated to
its integer portion, e.g. a value of 2.6 would become 2.
Keyword {type} sets the atom type for all selected atoms. The
specified value must be from 1 to ntypes, where ntypes was set by the
"create_box"_create_box.html command or the {atom types} field in the
header of the data file read by the "read_data"_read_data.html
command.
Keyword {type/fraction} sets the atom type for a fraction of the
selected atoms. The actual number of atoms changed is not guaranteed
to be exactly the requested fraction, but should be statistically
close. Random numbers are used in such a way that a particular atom
is changed or not changed, regardless of how many processors are being
used. This keyword does not allow use of an atom-style variable.
Keyword {mol} sets the molecule ID for all selected atoms. The "atom
style"_atom_style.html being used must support the use of molecule
IDs.
Keywords {x}, {y}, {z}, and {charge} set the coordinates or charge of
all selected atoms. For {charge}, the "atom style"_atom_style.html
being used must support the use of atomic charge.
Keyword {dipole} uses the specified x,y,z values as components of a
vector to set as the orientation of the dipole moment vectors of the
selected atoms. The magnitude of the dipole moment is set
by the length of this orientation vector.
Keyword {dipole/random} randomizes the orientation of the dipole
-moment vectors of the selected atoms and sets the magnitude of each to
-the specified {Dlen} value. For 2d systems, the z component of the
+moment vectors for the selected atoms and sets the magnitude of each
+to the specified {Dlen} value. For 2d systems, the z component of the
orientation is set to 0.0. Random numbers are used in such a way that
the orientation of a particular atom is the same, regardless of how
many processors are being used. This keyword does not allow use of an
atom-style variable.
Keyword {quat} uses the specified values to create a quaternion
(4-vector) that represents the orientation of the selected atoms. The
-particles must be ellipsoids as defined by the "atom_style
-ellipsoid"_atom_style.html command or triangles as defined by the
-"atom_style tri"_atom_style.html command. Note that particles defined
-by "atom_style ellipsoid"_atom_style.html have 3 shape parameters.
-The 3 values must be non-zero for each particle set by this command.
-They are used to specify the aspect ratios of an ellipsoidal particle,
+particles must define a quaternion for their orientation
+(e.g. ellipsoids, triangles, body particles) as defined by the
+"atom_style"_atom_style.html command. Note that particles defined by
+"atom_style ellipsoid"_atom_style.html have 3 shape parameters. The 3
+values must be non-zero for each particle set by this command. They
+are used to specify the aspect ratios of an ellipsoidal particle,
which is oriented by default with its x-axis along the simulation
box's x-axis, and similarly for y and z. If this body is rotated (via
the right-hand rule) by an angle theta around a unit rotation vector
(a,b,c), then the quaternion that represents its new orientation is
given by (cos(theta/2), a*sin(theta/2), b*sin(theta/2),
c*sin(theta/2)). The theta and a,b,c values are the arguments to the
{quat} keyword. LAMMPS normalizes the quaternion in case (a,b,c) was
not specified as a unit vector. For 2d systems, the a,b,c values are
ignored, since a rotation vector of (0,0,1) is the only valid choice.
-Keyword {quat/random} randomizes the orientation of the quaternion of
-the selected atoms. The particles must be ellipsoids as defined by
-the "atom_style ellipsoid"_atom_style.html command or triangles as
-defined by the "atom_style tri"_atom_style.html command. Random
-numbers are used in such a way that the orientation of a particular
-atom is the same, regardless of how many processors are being used.
-For 2d systems, only orientations in the xy plane are generated. As
-with keyword {quat}, for ellipsoidal particles, the 3 shape values
-must be non-zero for each particle set by this command. This keyword
-does not allow use of an atom-style variable.
+Keyword {quat/random} randomizes the orientation of the quaternion for
+the selected atoms. The particles must define a quaternion for their
+orientation (e.g. ellipsoids, triangles, body particles) as defined by
+the "atom_style"_atom_style.html command. Random numbers are used in
+such a way that the orientation of a particular atom is the same,
+regardless of how many processors are being used. For 2d systems,
+only orientations in the xy plane are generated. As with keyword
+{quat}, for ellipsoidal particles, the 3 shape values must be non-zero
+for each particle set by this command. This keyword does not allow
+use of an atom-style variable.
Keyword {diameter} sets the size of the selected atoms. The particles
must be finite-size spheres as defined by the "atom_style
sphere"_atom_style.html command. The diameter of a particle can be
set to 0.0, which means they will be treated as point particles. Note
that this command does not adjust the particle mass, even if it was
defined with a density, e.g. via the "read_data"_read_data.html
command.
Keyword {shape} sets the size and shape of the selected atoms. The
particles must be ellipsoids as defined by the "atom_style
ellipsoid"_atom_style.html command. The {Sx}, {Sy}, {Sz} settings are
the 3 diameters of the ellipsoid in each direction. All 3 can be set
to the same value, which means the ellipsoid is effectively a sphere.
They can also all be set to 0.0 which means the particle will be
treated as a point particle. Note that this command does not adjust
the particle mass, even if it was defined with a density, e.g. via the
"read_data"_read_data.html command.
Keyword {length} sets the length of selected atoms. The particles
must be line segments as defined by the "atom_style
line"_atom_style.html command. If the specified value is non-zero the
line segment is (re)set to a length = the specified value, centered
around the particle position, with an orientation along the x-axis.
If the specified value is 0.0, the particle will become a point
particle. Note that this command does not adjust the particle mass,
even if it was defined with a density, e.g. via the
"read_data"_read_data.html command.
Keyword {tri} sets the size of selected atoms. The particles must be
triangles as defined by the "atom_style tri"_atom_style.html command.
If the specified value is non-zero the triangle is (re)set to be an
equilateral triangle in the xy plane with side length = the specified
value, with a centroid at the particle position, with its base
parallel to the x axis, and the y-axis running from the center of the
base to the top point of the triangle. If the specified value is 0.0,
the particle will become a point particle. Note that this command
does not adjust the particle mass, even if it was defined with a
density, e.g. via the "read_data"_read_data.html command.
Keyword {theta} sets the orientation of selected atoms. The particles
must be line segments as defined by the "atom_style
line"_atom_style.html command. The specified value is used to set the
orientation angle of the line segments with respect to the x axis.
+
+Keyword {theta/random} randomizes the orientation of theta for the
+selected atoms. The particles must be line segments as defined by the
+"atom_style line"_atom_style.html command. Random numbers are used in
+such a way that the orientation of a particular atom is the same,
+regardless of how many processors are being used. This keyword does
+not allow use of an atom-style variable.
Keyword {angmom} sets the angular momentum of selected atoms. The
particles must be ellipsoids as defined by the "atom_style
ellipsoid"_atom_style.html command or triangles as defined by the
"atom_style tri"_atom_style.html command. The angular momentum vector
of the particles is set to the 3 specified components.
Keyword {omega} sets the angular velocity of selected atoms. The
particles must be spheres as defined by the "atom_style sphere"_
atom_style.html command. The angular velocity vector of the particles
is set to the 3 specified components.
Keyword {mass} sets the mass of all selected particles. The particles
must have a per-atom mass attribute, as defined by the
"atom_style"_atom_style.html command. See the "mass" command for how
to set mass values on a per-type basis.
Keyword {density} also sets the mass of all selected particles, but in
a different way. The particles must have a per-atom mass attribute,
as defined by the "atom_style"_atom_style.html command. If the atom
has a radius attribute (see "atom_style sphere"_atom_style.html) and
its radius is non-zero, its mass is set from the density and particle
volume. If the atom has a shape attribute (see "atom_style
ellipsoid"_atom_style.html) and its 3 shape parameters are non-zero,
then its mass is set from the density and particle volume. If the
atom has a length attribute (see "atom_style line"_atom_style.html)
and its length is non-zero, then its mass is set from the density and
line segment length (the input density is assumed to be in
mass/distance units). If the atom has an area attribute (see
"atom_style tri"_atom_style.html) and its area is non-zero, then its
mass is set from the density and triangle area (the input density is
assumed to be in mass/distance^2 units). If none of these cases are
valid, then the mass is set to the density value directly (the input
density is assumed to be in mass units).
Keyword {smd_mass_density} also sets the mass of all selected
particles, but it is only applicable to the Smooth Mach Dynamics
package USER-SMD. This command assumes that the particle volume has
already been correctly set and calculates particle mass from the
provided mass density value.
Keyword {smd_contact_radius} only applies to simulations with the
Smooth Mach Dynamics package USER-SMD. This command sets an
interaction radius for computing short-range interactions,
e.g. repulsive forces to prevent different individual physical bodies
from penetrating each other. Note that the SPH smoothing kernel
diameter used for computing long range, nonlocal interactions, is set
using the {diameter} keyword.
Keyword {volume} sets the volume of all selected particles.
Currently, only the "atom_style peri"_atom_style.html command defines
particles with a volume attribute. Note that this command does not
adjust the particle mass.
Keyword {image} sets which image of the simulation box the atom is
considered to be in. An image of 0 means it is inside the box as
defined. A value of 2 means add 2 box lengths to get the true value.
A value of -1 means subtract 1 box length to get the true value.
LAMMPS updates these flags as atoms cross periodic boundaries during
the simulation. The flags can be output with atom snapshots via the
"dump"_dump.html command. If a value of NULL is specified for any of
nx,ny,nz, then the current image value for that dimension is
unchanged. For non-periodic dimensions only a value of 0 can be
specified. This keyword does not allow use of atom-style variables.
This command can be useful after a system has been equilibrated and
atoms have diffused one or more box lengths in various directions.
This command can then reset the image values for atoms so that they
are effectively inside the simulation box, e.g if a diffusion
coefficient is about to be measured via the "compute
msd"_compute_msd.html command. Care should be taken not to reset the
image flags of two atoms in a bond to the same value if the bond
straddles a periodic boundary (rather they should be different by +/-
1). This will not affect the dynamics of a simulation, but may mess
up analysis of the trajectories if a LAMMPS diagnostic or your own
analysis relies on the image flags to unwrap a molecule which
straddles the periodic box.
Keywords {bond}, {angle}, {dihedral}, and {improper}, set the bond
type (angle type, etc) of all bonds (angles, etc) of selected atoms to
the specified value from 1 to nbondtypes (nangletypes, etc). All
atoms in a particular bond (angle, etc) must be selected atoms in
order for the change to be made. The value of nbondtype (nangletypes,
etc) was set by the {bond types} ({angle types}, etc) field in the
header of the data file read by the "read_data"_read_data.html
command. These keywords do not allow use of an atom-style variable.
Keywords {meso_e}, {meso_cv}, and {meso_rho} set the energy, heat
capacity, and density of smmothed particle hydrodynamics (SPH)
particles. See "this PDF guide"_USER/sph/SPH_LAMMPS_userguide.pdf to
using SPH in LAMMPS.
Keywords {i_name} and {d_name} refer to custom integer and
floating-point properties that have been added to each atom via the
"fix property/atom"_fix_property_atom.html command. When that command
is used specific names are given to each attribute which are what is
specified as the "name" portion of {i_name} or {d_name}.
[Restrictions:]
You cannot set an atom attribute (e.g. {mol} or {q} or {volume}) if
the "atom_style"_atom_style.html does not have that attribute.
This command requires inter-processor communication to coordinate the
setting of bond types (angle types, etc). This means that your system
must be ready to perform a simulation before using one of these
keywords (force fields set, atom mass set, etc). This is not
necessary for other keywords.
Using the {region} style with the bond (angle, etc) keywords can give
unpredictable results if there are bonds (angles, etc) that straddle
periodic boundaries. This is because the region may only extend up to
the boundary and partner atoms in the bond (angle, etc) may have
coordinates outside the simulation box if they are ghost atoms.
[Related commands:]
"create_box"_create_box.html, "create_atoms"_create_atoms.html,
"read_data"_read_data.html
[Default:] none
diff --git a/examples/ASPHERE/line/in.line b/examples/ASPHERE/line/in.line
index cf4ae80cc..cd7fed163 100644
--- a/examples/ASPHERE/line/in.line
+++ b/examples/ASPHERE/line/in.line
@@ -1,53 +1,53 @@
# Aspherical shear demo - 2d line box and triangle mixture, implicit solvent
units lj
atom_style line
dimension 2
read_data data.line
velocity all create 1.44 320984 loop geom
neighbor 0.3 bin
neigh_modify delay 0 every 1 check yes
neigh_modify exclude molecule all
pair_style line/lj 2.5
-pair_coeff * * 1.0 0.25
+pair_coeff * * 1.0 1.0 1.0 0.25 2.5
fix 2 all rigid molecule langevin 2.0 2.0 1.0 492983
fix 3 all deform 1 x scale 0.3 y scale 0.3
fix 4 all enforce2d
compute 10 all property/atom end1x end1y end2x end2y
#dump 1 all custom 500 dump1.atom id type x y z ix iy iz
#dump 2 all custom 500 dump1.line id type &
# c_10[1] c_10[2] c_10[3] c_10[4]
timestep 0.004
compute 1 all erotate/asphere
compute 2 all ke
compute 3 all pe
variable toteng equal (c_1+c_2+c_3)/atoms
thermo 1000
thermo_style custom step temp f_2 pe ke c_1 c_2 c_3 v_toteng
run 10000
#undump 1
#undump 2
unfix 3
change_box all triclinic
#dump 1 all custom 500 dump2.atom id type x y z ix iy iz
#dump 2 all custom 500 dump2.line id type &
# c_10[1] c_10[2] c_10[3] c_10[4]
fix 3 all deform 1 xy erate 0.01 units box
run 100000
diff --git a/examples/ASPHERE/line/in.line.srd b/examples/ASPHERE/line/in.line.srd
index 93ea5c3d3..4b89b14b4 100644
--- a/examples/ASPHERE/line/in.line.srd
+++ b/examples/ASPHERE/line/in.line.srd
@@ -1,105 +1,105 @@
# Aspherical shear demo - 2d line boxes, solvated by SRD particles
units lj
atom_style line
atom_modify first big
dimension 2
read_data data.line.srd
# add small particles as hi density lattice
lattice sq 0.4
region plane block INF INF INF INF -0.001 0.001
lattice sq 10.0
create_atoms 2 region plane
group big type 1
group small type 2
set group small mass 0.01
# delete overlaps
# must set 1-2 cutoff to non-zero value
pair_style lj/cut 1.5
pair_coeff 1 1 1.0 1.0
pair_coeff 2 2 0.0 1.0 0.0
pair_coeff 1 2 0.0 1.0
delete_atoms overlap 1.5 small big
# SRD run
reset_timestep 0
velocity small create 1.44 87287 loop geom
neighbor 0.3 bin
neigh_modify delay 0 every 1 check yes
neigh_modify exclude molecule big include big
comm_modify mode multi group big vel yes
neigh_modify include big
# no pairwise interactions with small particles
pair_style line/lj 2.5
-pair_coeff 1 1 1.0 1.0
-pair_coeff 2 2 0.0 1.0 0.0
-pair_coeff 1 2 0.0 1.0 0.0
+pair_coeff 1 1 1.0 1.0 1.0 1.0 2.5
+pair_coeff 2 2 0.0 0.0 0.0 1.0 0.0
+pair_coeff 1 2 1.0 0.0 0.0 1.0 0.0
# use fix SRD to push small particles out from inside big ones
# if comment out, big particles won't see SRD particles
timestep 0.001
fix 1 big rigid molecule
fix 2 small srd 20 big 1.0 0.25 49894 &
search 0.2 cubic warn 0.0001 shift yes 49829 &
overlap yes collision noslip
fix 3 all deform 1 x scale 0.35 y scale 0.35
fix 4 all enforce2d
# diagnostics
compute tsmall small temp/deform
compute tbig big temp
variable pebig equal pe*atoms/count(big)
variable ebig equal etotal*atoms/count(big)
compute 1 big erotate/asphere
compute 2 all ke
compute 3 all pe
variable toteng equal (c_1+c_2+c_3)/atoms
thermo 1000
thermo_style custom step temp c_tsmall f_2[9] c_1 etotal &
v_pebig v_ebig press
thermo_modify temp tbig
compute 10 big property/atom end1x end1y end2x end2y
#dump 1 all custom 500 dump1.atom.srd id type x y z ix iy iz
#dump 2 all custom 500 dump1.line.srd id type &
# c_10[1] c_10[2] c_10[3] c_10[4]
run 10000
#undump 1
#undump 2
unfix 3
change_box all triclinic
fix 2 small srd 20 big 1.0 0.25 49894 &
search 0.2 cubic warn 0.0001 shift yes 49829 &
overlap yes collision noslip tstat yes
#dump 1 all custom 500 dump2.atom.srd id type x y z ix iy iz
#dump 2 all custom 500 dump2.line.srd id type &
# c_10[1] c_10[2] c_10[3] c_10[4]
fix 3 all deform 1 xy erate 0.05 units box remap v
run 40000
diff --git a/examples/USER/phonon/1-1D-mono/in.Ana b/examples/USER/phonon/1-1D-mono/in.Ana
index 375249827..5ab710ab7 100644
--- a/examples/USER/phonon/1-1D-mono/in.Ana
+++ b/examples/USER/phonon/1-1D-mono/in.Ana
@@ -1,50 +1,50 @@
# 3D simple cubic lattice simulation
dimension 2
boundary p f p
units lj
atom_style bond
atom_modify sort 0 1.
bond_style harmonic
pair_style none
-communicate single cutoff 2.0
+comm_modify cutoff 2.0
# geometry
read_data data.pos
#
neighbor 0.5 nsq
neigh_modify delay 0 check no
#Langevin random seed
variable r equal 571101
#Langevin Temperature
variable t equal 0.005
# Langevin Damping variable
variable d equal 0.5
# time step
timestep 0.005
# Create velocities and equilibrate
compute MyTemp all temp/partial 1 0 0
velocity all create $t 28711 mom yes rot yes dist gaussian temp MyTemp
velocity all set NULL 0.0 0.0 units box
#
fix 1 all langevin $t $t $d $r
fix_modify 1 temp MyTemp
fix 2 all setforce NULL 0. 0.
fix 3 all nve
fix 4 all phonon 10 50000 500000 map.in phonon sysdim 1
fix_modify 4 temp MyTemp
#
# 1 2 3 4
thermo_style custom step temp pe etotal
thermo_modify temp MyTemp
thermo 100
dump 4 all atom 50000 dump_LJ_ANA.lammpstrj
run 2000000
diff --git a/examples/USER/smtbq/log.smtbq.Al b/examples/USER/smtbq/log.smtbq.Al.g++.1
similarity index 92%
rename from examples/USER/smtbq/log.smtbq.Al
rename to examples/USER/smtbq/log.smtbq.Al.g++.1
index b52a37c2e..11cecd89f 100644
--- a/examples/USER/smtbq/log.smtbq.Al
+++ b/examples/USER/smtbq/log.smtbq.Al.g++.1
@@ -1,279 +1,280 @@
-LAMMPS (23 Oct 2015)
+LAMMPS (24 Dec 2015)
# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants
variable T_depart equal 300
variable dt equal 0.0002
#Constante
variable rac3 equal sqrt(3.0)
variable rac1_2 equal sqrt(0.5)
variable rac3_2 equal sqrt(1.5)
#Structure
variable a equal 4.05
variable nx equal 10
variable ny equal 7
variable nz equal 4
variable bx equal ${a}*${nx}*${rac1_2}
variable bx equal 4.05*${nx}*${rac1_2}
variable bx equal 4.05*10*${rac1_2}
variable bx equal 4.05*10*0.707106781186548
variable by equal ${a}*${ny}*${rac3_2}
variable by equal 4.05*${ny}*${rac3_2}
variable by equal 4.05*7*${rac3_2}
variable by equal 4.05*7*1.22474487139159
variable bz equal ${a}*${nz}*${rac3}
variable bz equal 4.05*${nz}*${rac3}
variable bz equal 4.05*4*${rac3}
variable bz equal 4.05*4*1.73205080756888
# =======================================================================
units metal
atom_style charge
dimension 3
boundary p p p
lattice sc 1.0
Lattice spacing in x,y,z = 1 1 1
region box_vide prism 0 ${bx} 0 ${by} 0 ${bz} 0.0 0.0 0.0
region box_vide prism 0 28.6378246380552 0 ${by} 0 ${bz} 0.0 0.0 0.0
region box_vide prism 0 28.6378246380552 0 34.7215171039516 0 ${bz} 0.0 0.0 0.0
region box_vide prism 0 28.6378246380552 0 34.7215171039516 0 28.0592230826159 0.0 0.0 0.0
create_box 1 box_vide
Created triclinic box = (0 0 0) to (28.6378 34.7215 28.0592) with tilt (0 0 0)
1 by 1 by 1 MPI processor grid
# Aluminium atoms z = [111]
lattice custom ${a} a1 ${rac1_2} 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667
lattice custom 4.05 a1 ${rac1_2} 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667
lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667
lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 1.22474487139159 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667
lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 1.22474487139159 0.0 a3 0.0 0.0 1.73205080756888 basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667
Lattice spacing in x,y,z = 2.86378 4.96022 7.01481
create_atoms 1 region box_vide
Created 1680 atoms
mass 1 26.98
velocity all create ${T_depart} 277387
velocity all create 300 277387
pair_style smtbq
pair_coeff * * ffield.smtbq.Al Al
+Reading potential file ffield.smtbq.Al with DATE: 2015-10-22
neighbor 0.5 bin
neigh_modify every 20 delay 0 check yes
timestep ${dt}
timestep 0.0002
thermo_style custom step temp press pe ke etotal lx ly lz vol
thermo_modify flush yes
thermo 1
#dump 5 all custom 1 box_Al.lammpstrj id type q x y z
fix 3 all nve
run 10
Neighbor list info ...
1 neighbor list requests
update every 20 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11.6714
ghost atom cutoff = 11.6714
binsize = 5.8357 -> bins = 5 6 5
Memory usage per processor = 4.52298 Mbytes
Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume
0 300 729.26605 -5600.8541 65.108335 -5535.7458 28.637825 34.721517 28.059223 27900.653
1 299.98323 729.90439 -5600.8505 65.104695 -5535.7458 28.637825 34.721517 28.059223 27900.653
2 299.93288 731.82072 -5600.8395 65.093767 -5535.7458 28.637825 34.721517 28.059223 27900.653
3 299.84896 735.01448 -5600.8213 65.075556 -5535.7458 28.637825 34.721517 28.059223 27900.653
4 299.7315 739.48472 -5600.7958 65.050064 -5535.7458 28.637825 34.721517 28.059223 27900.653
5 299.58053 745.23012 -5600.7631 65.017299 -5535.7458 28.637825 34.721517 28.059223 27900.653
6 299.39609 752.24896 -5600.723 64.977269 -5535.7458 28.637825 34.721517 28.059223 27900.653
7 299.17822 760.5391 -5600.6757 64.929985 -5535.7458 28.637825 34.721517 28.059223 27900.653
8 298.92698 770.098 -5600.6212 64.875459 -5535.7458 28.637825 34.721517 28.059223 27900.653
9 298.64244 780.92261 -5600.5595 64.813707 -5535.7458 28.637825 34.721517 28.059223 27900.653
10 298.32468 793.00943 -5600.4905 64.744743 -5535.7458 28.637825 34.721517 28.059223 27900.653
-Loop time of 5.10336 on 1 procs for 10 steps with 1680 atoms
+Loop time of 5.10475 on 1 procs for 10 steps with 1680 atoms
-Performance: 0.034 ns/day, 708.800 hours/ns, 1.959 timesteps/s
+Performance: 0.034 ns/day, 708.993 hours/ns, 1.959 timesteps/s
99.9% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
-Pair | 5.1023 | 5.1023 | 5.1023 | 0.0 | 99.98
+Pair | 5.1037 | 5.1037 | 5.1037 | 0.0 | 99.98
Neigh | 0 | 0 | 0 | 0.0 | 0.00
-Comm | 0.00045538 | 0.00045538 | 0.00045538 | 0.0 | 0.01
-Output | 0.00024509 | 0.00024509 | 0.00024509 | 0.0 | 0.00
-Modify | 0.00026131 | 0.00026131 | 0.00026131 | 0.0 | 0.01
-Other | | 0.0001056 | | | 0.00
+Comm | 0.00044179 | 0.00044179 | 0.00044179 | 0.0 | 0.01
+Output | 0.00024772 | 0.00024772 | 0.00024772 | 0.0 | 0.00
+Modify | 0.00026011 | 0.00026011 | 0.00026011 | 0.0 | 0.01
+Other | | 0.0001063 | | | 0.00
Nlocal: 1680 ave 1680 max 1680 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 7518 ave 7518 max 7518 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 638400 ave 638400 max 638400 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 638400
Ave neighs/atom = 380
Neighbor list builds = 0
Dangerous builds = 0
unfix 3
#thermo 15
fix 1 all box/relax tri 0.0 vmax 0.001
minimize 1.0e-8 1.0e-10 1000 10000
WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168)
Neighbor list info ...
1 neighbor list requests
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11.6714
ghost atom cutoff = 11.6714
binsize = 5.8357 -> bins = 5 6 5
Memory usage per processor = 5.64798 Mbytes
Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume
10 298.32468 793.00943 -5600.4905 64.744743 -5535.7458 28.637825 34.721517 28.059223 27900.653
11 298.32468 2483.3228 -5600.5212 64.744743 -5535.7764 28.617938 34.697425 28.039771 27842.617
12 298.32468 3102.6624 -5600.6242 64.744743 -5535.8795 28.594201 34.68783 28.048729 27820.715
13 298.32468 1681.0688 -5600.6477 64.744743 -5535.903 28.619779 34.708131 28.055945 27869.065
14 298.32468 949.90841 -5600.6635 64.744743 -5535.9187 28.648416 34.718691 28.044409 27893.966
15 298.32468 2009.1662 -5600.7072 64.744743 -5535.9625 28.652241 34.703261 28.01635 27857.391
16 298.32468 2867.1434 -5600.7192 64.744743 -5535.9744 28.626861 34.69005 28.022309 27828.038
17 298.32468 2480.3207 -5600.7238 64.744743 -5535.9791 28.618046 34.695106 28.040113 27841.2
18 298.32468 2482.4906 -5600.7249 64.744743 -5535.9802 28.614169 34.704237 28.036452 27841.119
19 298.32468 2495.6209 -5600.7261 64.744743 -5535.9813 28.616207 34.697481 28.039453 27840.662
20 298.32468 2210.2897 -5600.7271 64.744743 -5535.9823 28.620852 34.699678 28.042926 27850.393
21 298.32468 2464.137 -5600.734 64.744743 -5535.9893 28.625239 34.687085 28.040022 27841.67
22 298.32468 3091.7034 -5600.7471 64.744743 -5536.0024 28.623565 34.674943 28.02983 27820.181
23 298.32468 2334.9443 -5600.7598 64.744743 -5536.0151 28.634413 34.684598 28.037298 27845.891
24 298.32468 2462.2836 -5600.7767 64.744743 -5536.032 28.615834 34.692433 28.044664 27841.422
25 298.32468 2652.08 -5600.7914 64.744743 -5536.0466 28.61528 34.695645 28.035991 27834.85
26 298.32468 2365.4126 -5600.7923 64.744743 -5536.0476 28.618526 34.699347 28.039662 27844.623
27 298.32468 2334.9429 -5600.7934 64.744743 -5536.0486 28.61826 34.698136 28.041941 27845.656
28 298.32468 2501.1598 -5600.7937 64.744743 -5536.0489 28.616356 34.695993 28.039825 27839.982
29 298.32468 2506.0962 -5600.794 64.744743 -5536.0493 28.617255 34.699031 28.036317 27839.811
30 298.32468 2400.7588 -5600.7942 64.744743 -5536.0495 28.618372 34.698464 28.039299 27843.404
31 298.32468 2499.8528 -5600.7945 64.744743 -5536.0497 28.61702 34.69385 28.040945 27840.021
32 298.32468 2629.5393 -5600.7967 64.744743 -5536.0519 28.619399 34.691546 28.036003 27835.58
33 298.32468 2397.5939 -5600.7973 64.744743 -5536.0526 28.621863 34.69535 28.03848 27843.488
34 298.32468 2222.7714 -5600.8007 64.744743 -5536.056 28.609815 34.705091 28.048395 27849.426
35 298.32468 2748.5871 -5600.8042 64.744743 -5536.0594 28.600322 34.6998 28.043876 27831.457
36 298.32468 2661.1018 -5600.8166 64.744743 -5536.0719 28.615123 34.696499 28.034947 27834.344
37 298.32468 2255.4994 -5600.8185 64.744743 -5536.0737 28.618919 34.702261 28.040497 27848.173
38 298.32468 2260.815 -5600.8239 64.744743 -5536.0791 28.614993 34.70246 28.043972 27847.962
39 298.32468 2549.2876 -5600.8248 64.744743 -5536.0801 28.612892 34.697988 28.039725 27838.113
40 298.32468 2488.3825 -5600.8266 64.744743 -5536.0819 28.623347 34.695524 28.033557 27840.182
41 298.32468 2400.9714 -5600.8283 64.744743 -5536.0835 28.619176 34.695733 28.040468 27843.155
42 298.32468 2496.6566 -5600.8284 64.744743 -5536.0837 28.617629 34.694692 28.039536 27839.89
43 298.32468 2486.2773 -5600.8285 64.744743 -5536.0838 28.617585 34.697413 28.037736 27840.243
44 298.32468 2446.3916 -5600.8287 64.744743 -5536.0839 28.617115 34.696389 28.040393 27841.603
45 298.32468 2547.2311 -5600.8288 64.744743 -5536.0841 28.615267 34.694882 28.039956 27838.161
46 298.32468 2479.9982 -5600.8321 64.744743 -5536.0874 28.603008 34.71581 28.037344 27840.427
47 298.32468 2449.645 -5600.8444 64.744743 -5536.0997 28.612743 34.683541 28.054837 27841.375
48 298.32468 2682.7109 -5600.8695 64.744743 -5536.1248 28.617414 34.683477 28.042139 27833.265
49 298.32468 2350.1707 -5600.8711 64.744743 -5536.1263 28.619236 34.694213 28.043092 27844.6
50 298.32468 2486.1481 -5600.8719 64.744743 -5536.1271 28.615167 34.699435 28.038181 27839.955
51 298.32468 2498.3384 -5600.8721 64.744743 -5536.1274 28.616069 34.696071 28.039596 27839.537
52 298.32468 2443.1247 -5600.8722 64.744743 -5536.1274 28.617616 34.696737 28.039439 27841.421
-Loop time of 36.9389 on 1 procs for 42 steps with 1680 atoms
+Loop time of 36.8807 on 1 procs for 42 steps with 1680 atoms
99.9% CPU use with 1 MPI tasks x no OpenMP threads
Minimization stats:
Stopping criterion = energy tolerance
Energy initial, next-to-last, final =
-5600.49050006 -5600.87213771 -5600.87218615
Force two-norm initial, final = 50.879 1.39888
Force max component initial, final = 29.3783 0.749036
Final line search alpha, max atom move = 0.0013373 0.00100168
Iterations, force evaluations = 42 71
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
-Pair | 36.918 | 36.918 | 36.918 | 0.0 | 99.94
+Pair | 36.86 | 36.86 | 36.86 | 0.0 | 99.95
Neigh | 0 | 0 | 0 | 0.0 | 0.00
-Comm | 0.0033035 | 0.0033035 | 0.0033035 | 0.0 | 0.01
-Output | 0.0011785 | 0.0011785 | 0.0011785 | 0.0 | 0.00
+Comm | 0.0032628 | 0.0032628 | 0.0032628 | 0.0 | 0.01
+Output | 0.001102 | 0.001102 | 0.001102 | 0.0 | 0.00
Modify | 0 | 0 | 0 | 0.0 | 0.00
-Other | | 0.01603 | | | 0.04
+Other | | 0.0159 | | | 0.04
Nlocal: 1680 ave 1680 max 1680 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 7518 ave 7518 max 7518 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 638400 ave 638400 max 638400 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 638400
Ave neighs/atom = 380
Neighbor list builds = 0
Dangerous builds = 0
unfix 1
thermo 1
fix 3 all nve
run 10
Neighbor list info ...
1 neighbor list requests
update every 20 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11.6714
ghost atom cutoff = 11.6714
binsize = 5.8357 -> bins = 5 6 5
Memory usage per processor = 4.52298 Mbytes
Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume
52 298.32468 2443.1247 -5600.8722 64.744743 -5536.1274 28.617616 34.696737 28.039439 27841.421
53 298.28341 2444.4342 -5600.8632 64.735788 -5536.1274 28.617616 34.696737 28.039439 27841.421
54 298.20852 2447.019 -5600.847 64.719534 -5536.1274 28.617616 34.696737 28.039439 27841.421
55 298.1 2450.8786 -5600.8234 64.695982 -5536.1274 28.617616 34.696737 28.039439 27841.421
56 297.95788 2456.0119 -5600.7926 64.665139 -5536.1274 28.617616 34.696737 28.039439 27841.421
57 297.7822 2462.4173 -5600.7545 64.62701 -5536.1274 28.617616 34.696737 28.039439 27841.421
58 297.57298 2470.0928 -5600.709 64.581604 -5536.1274 28.617616 34.696737 28.039439 27841.421
59 297.33028 2479.0363 -5600.6564 64.528932 -5536.1274 28.617616 34.696737 28.039439 27841.421
60 297.05416 2489.245 -5600.5964 64.469006 -5536.1274 28.617616 34.696737 28.039439 27841.421
61 296.74469 2500.7159 -5600.5293 64.401842 -5536.1274 28.617616 34.696737 28.039439 27841.421
62 296.40194 2513.4457 -5600.4549 64.327455 -5536.1274 28.617616 34.696737 28.039439 27841.421
-Loop time of 5.13028 on 1 procs for 10 steps with 1680 atoms
+Loop time of 5.13584 on 1 procs for 10 steps with 1680 atoms
-Performance: 0.034 ns/day, 712.539 hours/ns, 1.949 timesteps/s
+Performance: 0.034 ns/day, 713.311 hours/ns, 1.947 timesteps/s
99.9% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
-Pair | 5.1292 | 5.1292 | 5.1292 | 0.0 | 99.98
+Pair | 5.1346 | 5.1346 | 5.1346 | 0.0 | 99.98
Neigh | 0 | 0 | 0 | 0.0 | 0.00
-Comm | 0.00045729 | 0.00045729 | 0.00045729 | 0.0 | 0.01
-Output | 0.00024509 | 0.00024509 | 0.00024509 | 0.0 | 0.00
-Modify | 0.00026488 | 0.00026488 | 0.00026488 | 0.0 | 0.01
-Other | | 0.0001016 | | | 0.00
+Comm | 0.00047112 | 0.00047112 | 0.00047112 | 0.0 | 0.01
+Output | 0.00036144 | 0.00036144 | 0.00036144 | 0.0 | 0.01
+Modify | 0.00029016 | 0.00029016 | 0.00029016 | 0.0 | 0.01
+Other | | 0.0001101 | | | 0.00
Nlocal: 1680 ave 1680 max 1680 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 7518 ave 7518 max 7518 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 638400 ave 638400 max 638400 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 638400
Ave neighs/atom = 380
Neighbor list builds = 0
Dangerous builds = 0
Total wall time: 0:00:49
diff --git a/examples/USER/smtbq/log.smtbq.Al.g++.4 b/examples/USER/smtbq/log.smtbq.Al.g++.4
new file mode 100644
index 000000000..89f959ec7
--- /dev/null
+++ b/examples/USER/smtbq/log.smtbq.Al.g++.4
@@ -0,0 +1,278 @@
+LAMMPS (24 Dec 2015)
+# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants
+
+variable T_depart equal 300
+variable dt equal 0.0002
+
+#Constante
+variable rac3 equal sqrt(3.0)
+variable rac1_2 equal sqrt(0.5)
+variable rac3_2 equal sqrt(1.5)
+
+#Structure
+variable a equal 4.05
+
+variable nx equal 10
+variable ny equal 7
+variable nz equal 4
+
+variable bx equal ${a}*${nx}*${rac1_2}
+variable bx equal 4.05*${nx}*${rac1_2}
+variable bx equal 4.05*10*${rac1_2}
+variable bx equal 4.05*10*0.707106781186548
+variable by equal ${a}*${ny}*${rac3_2}
+variable by equal 4.05*${ny}*${rac3_2}
+variable by equal 4.05*7*${rac3_2}
+variable by equal 4.05*7*1.22474487139159
+variable bz equal ${a}*${nz}*${rac3}
+variable bz equal 4.05*${nz}*${rac3}
+variable bz equal 4.05*4*${rac3}
+variable bz equal 4.05*4*1.73205080756888
+# =======================================================================
+
+units metal
+atom_style charge
+dimension 3
+boundary p p p
+
+
+lattice sc 1.0
+Lattice spacing in x,y,z = 1 1 1
+region box_vide prism 0 ${bx} 0 ${by} 0 ${bz} 0.0 0.0 0.0
+region box_vide prism 0 28.6378246380552 0 ${by} 0 ${bz} 0.0 0.0 0.0
+region box_vide prism 0 28.6378246380552 0 34.7215171039516 0 ${bz} 0.0 0.0 0.0
+region box_vide prism 0 28.6378246380552 0 34.7215171039516 0 28.0592230826159 0.0 0.0 0.0
+create_box 1 box_vide
+Created triclinic box = (0 0 0) to (28.6378 34.7215 28.0592) with tilt (0 0 0)
+ 2 by 2 by 1 MPI processor grid
+
+# Aluminium atoms z = [111]
+lattice custom ${a} a1 ${rac1_2} 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667
+lattice custom 4.05 a1 ${rac1_2} 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667
+lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 ${rac3_2} 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667
+lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 1.22474487139159 0.0 a3 0.0 0.0 ${rac3} basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667
+lattice custom 4.05 a1 0.707106781186548 0.0 0.0 a2 0.0 1.22474487139159 0.0 a3 0.0 0.0 1.73205080756888 basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.166666667 0.33333 basis 0.0 0.666666667 0.33333 basis 0.0 0.333333333 0.66667 basis 0.5 0.833333333 0.66667
+Lattice spacing in x,y,z = 2.86378 4.96022 7.01481
+
+create_atoms 1 region box_vide
+Created 1680 atoms
+
+mass 1 26.98
+
+velocity all create ${T_depart} 277387
+velocity all create 300 277387
+
+pair_style smtbq
+pair_coeff * * ffield.smtbq.Al Al
+Reading potential file ffield.smtbq.Al with DATE: 2015-10-22
+
+neighbor 0.5 bin
+neigh_modify every 20 delay 0 check yes
+
+timestep ${dt}
+timestep 0.0002
+
+thermo_style custom step temp press pe ke etotal lx ly lz vol
+thermo_modify flush yes
+thermo 1
+
+
+#dump 5 all custom 1 box_Al.lammpstrj id type q x y z
+
+fix 3 all nve
+run 10
+Neighbor list info ...
+ 1 neighbor list requests
+ update every 20 steps, delay 0 steps, check yes
+ max neighbors/atom: 2000, page size: 100000
+ master list distance cutoff = 11.6714
+ ghost atom cutoff = 11.6714
+ binsize = 5.8357 -> bins = 5 6 5
+Memory usage per processor = 4.2858 Mbytes
+Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume
+ 0 300 729.26605 -5600.8541 65.108335 -5535.7458 28.637825 34.721517 28.059223 27900.653
+ 1 299.98339 729.897 -5600.8505 65.104731 -5535.7458 28.637825 34.721517 28.059223 27900.653
+ 2 299.93356 731.7909 -5600.8397 65.093915 -5535.7458 28.637825 34.721517 28.059223 27900.653
+ 3 299.8505 734.94708 -5600.8217 65.07589 -5535.7458 28.637825 34.721517 28.059223 27900.653
+ 4 299.73426 739.36449 -5600.7964 65.050662 -5535.7458 28.637825 34.721517 28.059223 27900.653
+ 5 299.58486 745.04171 -5600.764 65.018238 -5535.7458 28.637825 34.721517 28.059223 27900.653
+ 6 299.40234 751.97694 -5600.7244 64.978627 -5535.7458 28.637825 34.721517 28.059223 27900.653
+ 7 299.18677 760.16798 -5600.6776 64.931841 -5535.7458 28.637825 34.721517 28.059223 27900.653
+ 8 298.9382 769.6122 -5600.6237 64.877894 -5535.7458 28.637825 34.721517 28.059223 27900.653
+ 9 298.65669 780.3065 -5600.5626 64.8168 -5535.7458 28.637825 34.721517 28.059223 27900.653
+ 10 298.34234 792.24735 -5600.4943 64.748578 -5535.7458 28.637825 34.721517 28.059223 27900.653
+Loop time of 1.49703 on 4 procs for 10 steps with 1680 atoms
+
+Performance: 0.115 ns/day, 207.920 hours/ns, 6.680 timesteps/s
+98.4% CPU use with 4 MPI tasks x no OpenMP threads
+
+MPI task timing breakdown:
+Section | min time | avg time | max time |%varavg| %total
+---------------------------------------------------------------
+Pair | 1.4956 | 1.4957 | 1.4957 | 0.0 | 99.91
+Neigh | 0 | 0 | 0 | 0.0 | 0.00
+Comm | 0.00078988 | 0.00090927 | 0.0010064 | 0.3 | 0.06
+Output | 0.00022459 | 0.00027347 | 0.00034189 | 0.3 | 0.02
+Modify | 6.4373e-05 | 7.8619e-05 | 9.3222e-05 | 0.1 | 0.01
+Other | | 8.106e-05 | | | 0.01
+
+Nlocal: 420 ave 484 max 360 min
+Histogram: 1 0 1 0 0 0 1 0 0 1
+Nghost: 4305 ave 4365 max 4241 min
+Histogram: 1 0 0 1 0 0 0 1 0 1
+Neighs: 0 ave 0 max 0 min
+Histogram: 4 0 0 0 0 0 0 0 0 0
+FullNghs: 159600 ave 183920 max 136800 min
+Histogram: 1 0 1 0 0 0 1 0 0 1
+
+Total # of neighbors = 638400
+Ave neighs/atom = 380
+Neighbor list builds = 0
+Dangerous builds = 0
+
+unfix 3
+#thermo 15
+fix 1 all box/relax tri 0.0 vmax 0.001
+minimize 1.0e-8 1.0e-10 1000 10000
+WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168)
+Neighbor list info ...
+ 1 neighbor list requests
+ update every 1 steps, delay 0 steps, check yes
+ max neighbors/atom: 2000, page size: 100000
+ master list distance cutoff = 11.6714
+ ghost atom cutoff = 11.6714
+ binsize = 5.8357 -> bins = 5 6 5
+Memory usage per processor = 5.4127 Mbytes
+Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume
+ 10 298.34234 792.24735 -5600.4943 64.748578 -5535.7458 28.637825 34.721517 28.059223 27900.653
+ 11 298.34234 2483.41 -5600.5251 64.748578 -5535.7765 28.617939 34.697415 28.039749 27842.588
+ 12 298.34234 3212.2068 -5600.6294 64.748578 -5535.8809 28.605195 34.685635 28.035928 27816.95
+ 13 298.34234 1756.312 -5600.6529 64.748578 -5535.9044 28.62806 34.701751 28.05036 27866.456
+ 14 298.34234 845.30512 -5600.6668 64.748578 -5535.9182 28.652683 34.704776 28.055059 27897.528
+ 15 298.34234 1950.7901 -5600.7433 64.748578 -5535.9948 28.66644 34.670055 28.031028 27859.115
+ 16 298.34234 2860.9521 -5600.7579 64.748578 -5536.0093 28.637802 34.669634 28.028024 27827.963
+ 17 298.34234 2406.0293 -5600.7642 64.748578 -5536.0156 28.624953 34.689277 28.040313 27843.439
+ 18 298.34234 2531.6658 -5600.7645 64.748578 -5536.0159 28.619984 34.690929 28.039526 27839.151
+ 19 298.34234 2410.8263 -5600.7651 64.748578 -5536.0166 28.615355 34.70117 28.039934 27843.27
+ 20 298.34234 2538.4705 -5600.7654 64.748578 -5536.0169 28.613142 34.700755 28.038049 27838.913
+ 21 298.34234 2455.2909 -5600.7657 64.748578 -5536.0171 28.615273 34.700334 28.039158 27841.749
+ 22 298.34234 2578.5637 -5600.766 64.748578 -5536.0174 28.614997 34.695849 28.038814 27837.541
+ 23 298.34234 2413.5858 -5600.7667 64.748578 -5536.0181 28.617591 34.695982 28.041829 27843.164
+ 24 298.34234 2575.34 -5600.7677 64.748578 -5536.0191 28.614711 34.696953 28.038299 27837.636
+ 25 298.34234 2313.5501 -5600.7689 64.748578 -5536.0203 28.618801 34.702208 28.039031 27846.559
+ 26 298.34234 2589.6554 -5600.7724 64.748578 -5536.0239 28.622807 34.692685 28.033282 27837.106
+ 27 298.34234 2258.4841 -5600.7755 64.748578 -5536.0269 28.633037 34.683012 28.042438 27848.382
+ 28 298.34234 2668.7002 -5600.7789 64.748578 -5536.0303 28.632179 34.665065 28.043666 27834.358
+ 29 298.34234 2339.309 -5600.8141 64.748578 -5536.0655 28.626885 34.675842 28.051214 27845.356
+ 30 298.34234 2846.4227 -5600.8223 64.748578 -5536.0737 28.612492 34.69364 28.033449 27828.006
+ 31 298.34234 2534.6985 -5600.8246 64.748578 -5536.076 28.611965 34.709562 28.031793 27838.619
+ 32 298.34234 2278.6053 -5600.8262 64.748578 -5536.0776 28.617042 34.703828 28.040241 27847.349
+ 33 298.34234 2477.381 -5600.8269 64.748578 -5536.0783 28.616395 34.695005 28.041167 27840.56
+ 34 298.34234 2561.8128 -5600.8271 64.748578 -5536.0785 28.615917 34.69647 28.037549 27837.678
+ 35 298.34234 2470.4145 -5600.8273 64.748578 -5536.0787 28.617208 34.699332 28.037111 27840.795
+ 36 298.34234 2415.0452 -5600.8276 64.748578 -5536.079 28.617651 34.69562 28.041578 27842.683
+ 37 298.34234 2514.0703 -5600.8277 64.748578 -5536.0791 28.616929 34.693138 28.040886 27839.303
+ 38 298.34234 2515.7338 -5600.828 64.748578 -5536.0794 28.619947 34.694884 28.03646 27839.244
+ 39 298.34234 2402.2948 -5600.8281 64.748578 -5536.0796 28.620623 34.69709 28.037911 27843.113
+ 40 298.34234 2457.1081 -5600.8289 64.748578 -5536.0804 28.612617 34.697892 28.043218 27841.237
+ 41 298.34234 2729.4589 -5600.8299 64.748578 -5536.0814 28.610746 34.694899 28.038106 27831.941
+ 42 298.34234 2487.8313 -5600.8331 64.748578 -5536.0845 28.620239 34.701333 28.031882 27840.157
+ 43 298.34234 1959.1329 -5600.8393 64.748578 -5536.0908 28.609631 34.719775 28.045509 27858.164
+ 44 298.34234 2535.5621 -5600.8461 64.748578 -5536.0975 28.587496 34.720535 28.046731 27838.433
+ 45 298.34234 2978.3628 -5600.858 64.748578 -5536.1095 28.609197 34.699148 28.027451 27823.264
+ 46 298.34234 2351.5532 -5600.8632 64.748578 -5536.1146 28.624986 34.701661 28.031447 27844.605
+ 47 298.34234 2294.1629 -5600.8704 64.748578 -5536.1218 28.614261 34.700247 28.045027 27846.522
+ 48 298.34234 2528.0548 -5600.871 64.748578 -5536.1225 28.612265 34.696612 28.041878 27838.536
+ 49 298.34234 2516.2649 -5600.8715 64.748578 -5536.1229 28.618047 34.695729 28.037328 27838.936
+ 50 298.34234 2461.5711 -5600.8715 64.748578 -5536.1229 28.61865 34.696255 28.038191 27840.802
+Loop time of 10.0107 on 4 procs for 40 steps with 1680 atoms
+
+98.5% CPU use with 4 MPI tasks x no OpenMP threads
+
+Minimization stats:
+ Stopping criterion = energy tolerance
+ Energy initial, next-to-last, final =
+ -5600.49433365 -5600.87146764 -5600.87150075
+ Force two-norm initial, final = 50.9055 1.01476
+ Force max component initial, final = 29.378 0.811083
+ Final line search alpha, max atom move = 0.00128157 0.00103946
+ Iterations, force evaluations = 40 75
+
+MPI task timing breakdown:
+Section | min time | avg time | max time |%varavg| %total
+---------------------------------------------------------------
+Pair | 9.9932 | 9.9933 | 9.9933 | 0.0 | 99.83
+Neigh | 0 | 0 | 0 | 0.0 | 0.00
+Comm | 0.0059471 | 0.0059789 | 0.0059991 | 0.0 | 0.06
+Output | 0.00088 | 0.0010666 | 0.0015972 | 0.9 | 0.01
+Modify | 0 | 0 | 0 | 0.0 | 0.00
+Other | | 0.01039 | | | 0.10
+
+Nlocal: 420 ave 426 max 416 min
+Histogram: 1 1 0 0 0 1 0 0 0 1
+Nghost: 4305 ave 4309 max 4299 min
+Histogram: 1 0 0 0 0 1 0 0 0 2
+Neighs: 0 ave 0 max 0 min
+Histogram: 4 0 0 0 0 0 0 0 0 0
+FullNghs: 159600 ave 161880 max 158080 min
+Histogram: 1 1 0 0 0 1 0 0 0 1
+
+Total # of neighbors = 638400
+Ave neighs/atom = 380
+Neighbor list builds = 0
+Dangerous builds = 0
+
+unfix 1
+thermo 1
+fix 3 all nve
+run 10
+Neighbor list info ...
+ 1 neighbor list requests
+ update every 20 steps, delay 0 steps, check yes
+ max neighbors/atom: 2000, page size: 100000
+ master list distance cutoff = 11.6714
+ ghost atom cutoff = 11.6714
+ binsize = 5.8357 -> bins = 5 6 5
+Memory usage per processor = 4.2877 Mbytes
+Step Temp Press PotEng KinEng TotEng Lx Ly Lz Volume
+ 50 298.34234 2461.5711 -5600.8715 64.748578 -5536.1229 28.61865 34.696255 28.038191 27840.802
+ 51 298.30489 2462.7206 -5600.8634 64.740449 -5536.1229 28.61865 34.696255 28.038191 27840.802
+ 52 298.23415 2465.1307 -5600.848 64.725096 -5536.1229 28.61865 34.696255 28.038191 27840.802
+ 53 298.13012 2468.8007 -5600.8254 64.702519 -5536.1229 28.61865 34.696255 28.038191 27840.802
+ 54 297.99284 2473.7295 -5600.7956 64.672726 -5536.1229 28.61865 34.696255 28.038191 27840.802
+ 55 297.82234 2479.9155 -5600.7586 64.635722 -5536.1229 28.61865 34.696255 28.038191 27840.802
+ 56 297.61866 2487.3567 -5600.7144 64.591518 -5536.1229 28.61865 34.696255 28.038191 27840.802
+ 57 297.38185 2496.0508 -5600.663 64.540124 -5536.1229 28.61865 34.696255 28.038191 27840.802
+ 58 297.11198 2505.9952 -5600.6045 64.481554 -5536.1229 28.61865 34.696255 28.038191 27840.802
+ 59 296.80911 2517.1867 -5600.5387 64.415823 -5536.1229 28.61865 34.696255 28.038191 27840.802
+ 60 296.47332 2529.6221 -5600.4659 64.342947 -5536.1229 28.61865 34.696255 28.038191 27840.802
+Loop time of 1.2969 on 4 procs for 10 steps with 1680 atoms
+
+Performance: 0.133 ns/day, 180.125 hours/ns, 7.711 timesteps/s
+98.4% CPU use with 4 MPI tasks x no OpenMP threads
+
+MPI task timing breakdown:
+Section | min time | avg time | max time |%varavg| %total
+---------------------------------------------------------------
+Pair | 1.2955 | 1.2955 | 1.2955 | 0.0 | 99.89
+Neigh | 0 | 0 | 0 | 0.0 | 0.00
+Comm | 0.00080395 | 0.00095397 | 0.0010161 | 0.3 | 0.07
+Output | 0.00023341 | 0.00028217 | 0.00041556 | 0.5 | 0.02
+Modify | 7.2241e-05 | 7.993e-05 | 8.8692e-05 | 0.1 | 0.01
+Other | | 8.166e-05 | | | 0.01
+
+Nlocal: 420 ave 424 max 416 min
+Histogram: 1 0 0 0 0 2 0 0 0 1
+Nghost: 4305 ave 4309 max 4301 min
+Histogram: 1 0 0 0 0 2 0 0 0 1
+Neighs: 0 ave 0 max 0 min
+Histogram: 4 0 0 0 0 0 0 0 0 0
+FullNghs: 159600 ave 161120 max 158080 min
+Histogram: 1 0 0 0 0 2 0 0 0 1
+
+Total # of neighbors = 638400
+Ave neighs/atom = 380
+Neighbor list builds = 0
+Dangerous builds = 0
+
+Total wall time: 0:00:13
diff --git a/examples/USER/smtbq/log.smtbq.Al2O3 b/examples/USER/smtbq/log.smtbq.Al2O3.g++.1
similarity index 100%
copy from examples/USER/smtbq/log.smtbq.Al2O3
copy to examples/USER/smtbq/log.smtbq.Al2O3.g++.1
diff --git a/examples/USER/smtbq/log.smtbq.Al2O3 b/examples/USER/smtbq/log.smtbq.Al2O3.g++.4
similarity index 76%
rename from examples/USER/smtbq/log.smtbq.Al2O3
rename to examples/USER/smtbq/log.smtbq.Al2O3.g++.4
index b7d2ad5ae..06f06fbb7 100644
--- a/examples/USER/smtbq/log.smtbq.Al2O3
+++ b/examples/USER/smtbq/log.smtbq.Al2O3.g++.4
@@ -1,210 +1,210 @@
-LAMMPS (23 Oct 2015)
+LAMMPS (24 Dec 2015)
# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants
variable T_depart equal 300
variable dt equal 0.0002
# =======================================================================
units metal
atom_style charge
dimension 3
boundary p p p
read_data data.Alpha
triclinic box = (0 0 0) to (23.769 24.7015 25.9564) with tilt (0 0 0)
- 1 by 1 by 1 MPI processor grid
+ 1 by 2 by 2 MPI processor grid
reading atoms ...
1800 atoms
# ^ Orthorombic box of corundum strcture
mass 1 16.00
group Oxy type 1
1080 atoms in group Oxy
compute chargeOxy Oxy property/atom q
compute q_Oxy Oxy reduce ave c_chargeOxy
mass 2 26.98
group Al type 2
720 atoms in group Al
compute chargeAl Al property/atom q
compute q_Al Al reduce ave c_chargeAl
velocity all create ${T_depart} 277387
velocity all create 300 277387
pair_style smtbq
pair_coeff * * ffield.smtbq.Al2O3 O Al
+Reading potential file ffield.smtbq.Al2O3 with DATE: 2015-10-22
neighbor 0.5 bin
neigh_modify every 20 delay 0 check yes
timestep ${dt}
timestep 0.0002
thermo_style custom step temp press pe ke etotal c_q_Al c_q_Oxy lx ly lz vol
thermo_modify flush yes
thermo 1
-
#dump 5 all custom 500 boxAlpha_alumina.lammpstrj id type q x y z
fix 3 all nve
run 10
Neighbor list info ...
1 neighbor list requests
update every 20 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11.6714
ghost atom cutoff = 11.6714
binsize = 5.8357 -> bins = 5 5 5
-Memory usage per processor = 4.12573 Mbytes
+Memory usage per processor = 3.94008 Mbytes
Step Temp Press PotEng KinEng TotEng q_Al q_Oxy Lx Ly Lz Volume
0 300 91921.482 -11494.543 69.7617 -11424.781 2.6095997 -1.7397331 23.769 24.7015 25.9564 15239.78
1 299.96467 91922.303 -11494.535 69.753485 -11424.781 2.6095996 -1.739733 23.769 24.7015 25.9564 15239.78
2 299.75126 91933.246 -11494.485 69.703859 -11424.781 2.6095978 -1.7397318 23.769 24.7015 25.9564 15239.78
3 299.36045 91954.835 -11494.394 69.61298 -11424.781 2.6095941 -1.7397294 23.769 24.7015 25.9564 15239.78
4 298.79335 91986.343 -11494.262 69.481107 -11424.781 2.6095886 -1.7397257 23.769 24.7015 25.9564 15239.78
5 298.05151 92027.62 -11494.09 69.3086 -11424.781 2.6095812 -1.7397208 23.769 24.7015 25.9564 15239.78
6 297.13689 92078.615 -11493.877 69.095915 -11424.781 2.6095721 -1.7397147 23.769 24.7015 25.9564 15239.78
7 296.05187 92139.141 -11493.625 68.843606 -11424.781 2.6095613 -1.7397075 23.769 24.7015 25.9564 15239.78
8 294.79923 92209.15 -11493.334 68.552319 -11424.781 2.6095488 -1.7396992 23.769 24.7015 25.9564 15239.78
9 293.38215 92288.12 -11493.004 68.222793 -11424.781 2.6095347 -1.7396898 23.769 24.7015 25.9564 15239.78
10 291.80421 92376.81 -11492.637 67.855859 -11424.781 2.6095191 -1.7396794 23.769 24.7015 25.9564 15239.78
-Loop time of 169.694 on 1 procs for 10 steps with 1800 atoms
+Loop time of 43.8203 on 4 procs for 10 steps with 1800 atoms
-Performance: 0.001 ns/day, 23568.600 hours/ns, 0.059 timesteps/s
-99.9% CPU use with 1 MPI tasks x no OpenMP threads
+Performance: 0.004 ns/day, 6086.154 hours/ns, 0.228 timesteps/s
+99.9% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
-Pair | 169.69 | 169.69 | 169.69 | 0.0 |100.00
+Pair | 43.817 | 43.817 | 43.817 | 0.0 | 99.99
Neigh | 0 | 0 | 0 | 0.0 | 0.00
-Comm | 0.00075507 | 0.00075507 | 0.00075507 | 0.0 | 0.00
-Output | 0.00078607 | 0.00078607 | 0.00078607 | 0.0 | 0.00
-Modify | 0.00034666 | 0.00034666 | 0.00034666 | 0.0 | 0.00
-Other | | 0.0001752 | | | 0.00
-
-Nlocal: 1800 ave 1800 max 1800 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
-Nghost: 11490 ave 11490 max 11490 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
+Comm | 0.0020506 | 0.0024325 | 0.0026755 | 0.5 | 0.01
+Output | 0.00047874 | 0.00057358 | 0.00084901 | 0.7 | 0.00
+Modify | 9.8944e-05 | 0.00010616 | 0.00011468 | 0.1 | 0.00
+Other | | 0.0001459 | | | 0.00
+
+Nlocal: 450 ave 450 max 450 min
+Histogram: 4 0 0 0 0 0 0 0 0 0
+Nghost: 6820 ave 6820 max 6820 min
+Histogram: 4 0 0 0 0 0 0 0 0 0
Neighs: 0 ave 0 max 0 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
-FullNghs: 1.4472e+06 ave 1.4472e+06 max 1.4472e+06 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
+Histogram: 4 0 0 0 0 0 0 0 0 0
+FullNghs: 361800 ave 361800 max 361800 min
+Histogram: 4 0 0 0 0 0 0 0 0 0
Total # of neighbors = 1447200
Ave neighs/atom = 804
Neighbor list builds = 0
Dangerous builds = 0
unfix 3
thermo 1
fix 1 all box/relax tri 0.0 vmax 0.001
minimize 1.0e-3 1.0e-5 1000 10000
WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168)
Neighbor list info ...
1 neighbor list requests
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11.6714
ghost atom cutoff = 11.6714
binsize = 5.8357 -> bins = 5 5 5
-Memory usage per processor = 5.50073 Mbytes
+Memory usage per processor = 5.31508 Mbytes
Step Temp Press PotEng KinEng TotEng q_Al q_Oxy Lx Ly Lz Volume
10 291.80421 92376.81 -11492.637 67.855859 -11424.781 2.6095191 -1.7396794 23.769 24.7015 25.9564 15239.78
11 291.80421 84416.246 -11494.722 67.855859 -11426.866 2.6087748 -1.7391832 23.787835 24.721015 25.982356 15279.17
-Loop time of 25.4145 on 1 procs for 1 steps with 1800 atoms
+Loop time of 6.48552 on 4 procs for 1 steps with 1800 atoms
-99.9% CPU use with 1 MPI tasks x no OpenMP threads
+99.9% CPU use with 4 MPI tasks x no OpenMP threads
Minimization stats:
Stopping criterion = energy tolerance
Energy initial, next-to-last, final =
-11492.6369832 -11492.6369832 -11494.7221261
Force two-norm initial, final = 1453.27 1325.26
Force max component initial, final = 968.201 892.249
Final line search alpha, max atom move = 1.03284e-06 0.000921553
Iterations, force evaluations = 1 1
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
-Pair | 25.414 | 25.414 | 25.414 | -nan |100.00
+Pair | 6.4848 | 6.4848 | 6.4848 | 0.0 | 99.99
Neigh | 0 | 0 | 0 | 0.0 | 0.00
-Comm | 0.00013995 | 0.00013995 | 0.00013995 | 0.0 | 0.00
+Comm | 0.00037098 | 0.00037396 | 0.00037694 | 0.0 | 0.01
Output | 0 | 0 | 0 | 0.0 | 0.00
Modify | 0 | 0 | 0 | 0.0 | 0.00
-Other | | 0.0005064 | | | 0.00
+Other | | 0.0003674 | | | 0.01
-Nlocal: 1800 ave 1800 max 1800 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
-Nghost: 11408 ave 11408 max 11408 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
+Nlocal: 450 ave 450 max 450 min
+Histogram: 4 0 0 0 0 0 0 0 0 0
+Nghost: 6759 ave 6772 max 6750 min
+Histogram: 1 1 0 0 1 0 0 0 0 1
Neighs: 0 ave 0 max 0 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
-FullNghs: 1.44456e+06 ave 1.44456e+06 max 1.44456e+06 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
+Histogram: 4 0 0 0 0 0 0 0 0 0
+FullNghs: 361140 ave 361150 max 361130 min
+Histogram: 1 0 0 1 0 0 0 1 0 1
Total # of neighbors = 1444562
Ave neighs/atom = 802.534
Neighbor list builds = 0
Dangerous builds = 0
unfix 1
thermo 1
fix 3 all nve
run 10
Neighbor list info ...
1 neighbor list requests
update every 20 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11.6714
ghost atom cutoff = 11.6714
binsize = 5.8357 -> bins = 5 5 5
-Memory usage per processor = 4.37573 Mbytes
+Memory usage per processor = 4.19008 Mbytes
Step Temp Press PotEng KinEng TotEng q_Al q_Oxy Lx Ly Lz Volume
11 291.80421 84416.246 -11494.722 67.855859 -11426.866 2.6087748 -1.7391832 23.787835 24.721015 25.982356 15279.17
12 290.08293 84514.767 -11494.322 67.455594 -11426.866 2.6087578 -1.7391718 23.787835 24.721015 25.982356 15279.17
13 288.21041 84622.406 -11493.886 67.020161 -11426.866 2.6087394 -1.7391596 23.787835 24.721015 25.982356 15279.17
14 286.19128 84738.689 -11493.417 66.550634 -11426.866 2.6087199 -1.7391466 23.787835 24.721015 25.982356 15279.17
15 284.03049 84864.242 -11492.914 66.048166 -11426.866 2.6086993 -1.7391329 23.787835 24.721015 25.982356 15279.17
16 281.73331 84998.125 -11492.38 65.513983 -11426.866 2.6086776 -1.7391184 23.787835 24.721015 25.982356 15279.17
17 279.30534 85140.233 -11491.815 64.949384 -11426.866 2.6086551 -1.7391034 23.787835 24.721015 25.982356 15279.17
18 276.75244 85290.405 -11491.221 64.355737 -11426.866 2.6086319 -1.7390879 23.787835 24.721015 25.982356 15279.17
19 274.08079 85448.449 -11490.6 63.734472 -11426.866 2.608608 -1.739072 23.787835 24.721015 25.982356 15279.17
20 271.29678 85614.064 -11489.953 63.087082 -11426.866 2.6085837 -1.7390558 23.787835 24.721015 25.982356 15279.17
21 268.40708 85786.72 -11489.281 62.415114 -11426.865 2.608559 -1.7390393 23.787835 24.721015 25.982356 15279.17
-Loop time of 170.699 on 1 procs for 10 steps with 1800 atoms
+Loop time of 47.1154 on 4 procs for 10 steps with 1800 atoms
-Performance: 0.001 ns/day, 23708.143 hours/ns, 0.059 timesteps/s
-99.9% CPU use with 1 MPI tasks x no OpenMP threads
+Performance: 0.004 ns/day, 6543.802 hours/ns, 0.212 timesteps/s
+99.9% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
-Pair | 170.7 | 170.7 | 170.7 | 0.0 |100.00
+Pair | 47.112 | 47.112 | 47.112 | 0.0 | 99.99
Neigh | 0 | 0 | 0 | 0.0 | 0.00
-Comm | 0.00068879 | 0.00068879 | 0.00068879 | 0.0 | 0.00
-Output | 0.0008359 | 0.0008359 | 0.0008359 | 0.0 | 0.00
-Modify | 0.00031424 | 0.00031424 | 0.00031424 | 0.0 | 0.00
-Other | | 0.0001593 | | | 0.00
-
-Nlocal: 1800 ave 1800 max 1800 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
-Nghost: 11222 ave 11222 max 11222 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
+Comm | 0.0019891 | 0.0023952 | 0.0026395 | 0.5 | 0.01
+Output | 0.0004952 | 0.00062233 | 0.00096345 | 0.8 | 0.00
+Modify | 0.00010109 | 0.00010723 | 0.00012183 | 0.1 | 0.00
+Other | | 0.0001532 | | | 0.00
+
+Nlocal: 450 ave 450 max 450 min
+Histogram: 4 0 0 0 0 0 0 0 0 0
+Nghost: 6611 ave 6620 max 6600 min
+Histogram: 1 0 0 0 0 0 2 0 0 1
Neighs: 0 ave 0 max 0 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
-FullNghs: 1.44126e+06 ave 1.44126e+06 max 1.44126e+06 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
+Histogram: 4 0 0 0 0 0 0 0 0 0
+FullNghs: 360316 ave 360333 max 360300 min
+Histogram: 1 1 0 0 0 0 1 0 0 1
Total # of neighbors = 1441262
Ave neighs/atom = 800.701
Neighbor list builds = 0
Dangerous builds = 0
-Total wall time: 0:06:42
+Total wall time: 0:01:48
diff --git a/examples/USER/smtbq/log.smtbq.TiO2 b/examples/USER/smtbq/log.smtbq.TiO2.g++.1
similarity index 100%
copy from examples/USER/smtbq/log.smtbq.TiO2
copy to examples/USER/smtbq/log.smtbq.TiO2.g++.1
diff --git a/examples/USER/smtbq/log.smtbq.TiO2 b/examples/USER/smtbq/log.smtbq.TiO2.g++.4
similarity index 56%
rename from examples/USER/smtbq/log.smtbq.TiO2
rename to examples/USER/smtbq/log.smtbq.TiO2.g++.4
index 433a7ceab..6034a6730 100644
--- a/examples/USER/smtbq/log.smtbq.TiO2
+++ b/examples/USER/smtbq/log.smtbq.TiO2.g++.4
@@ -1,255 +1,256 @@
-LAMMPS (23 Oct 2015)
+LAMMPS (24 Dec 2015)
# Al2O3 crystal, qeq on, minimizes, then calculates elastic constants
variable T_depart equal 300
variable dt equal 0.0002
variable a equal 4.5937
variable c equal 2.9587
variable ca equal ${c}/${a}
variable ca equal 2.9587/${a}
variable ca equal 2.9587/4.5937
variable nx equal 6
variable ny equal 6
variable nz equal 11
variable bx equal ${a}*${nx}
variable bx equal 4.5937*${nx}
variable bx equal 4.5937*6
variable by equal ${a}*${ny}
variable by equal 4.5937*${ny}
variable by equal 4.5937*6
variable bz equal ${c}*${nz}
variable bz equal 2.9587*${nz}
variable bz equal 2.9587*11
# =======================================================================
units metal
atom_style charge
dimension 3
boundary p p p
lattice sc 1.0
Lattice spacing in x,y,z = 1 1 1
region box_vide prism 0 ${bx} 0 ${by} 0 ${bz} 0.0 0.0 0.0
region box_vide prism 0 27.5622 0 ${by} 0 ${bz} 0.0 0.0 0.0
region box_vide prism 0 27.5622 0 27.5622 0 ${bz} 0.0 0.0 0.0
region box_vide prism 0 27.5622 0 27.5622 0 32.5457 0.0 0.0 0.0
create_box 2 box_vide
Created triclinic box = (0 0 0) to (27.5622 27.5622 32.5457) with tilt (0 0 0)
- 1 by 1 by 1 MPI processor grid
+ 1 by 2 by 2 MPI processor grid
#lattice sc 1.0
#region box_TiO2 block 0 ${bx} 0 ${by} 0 ${bz}
# titanium atoms
lattice custom ${a} origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.0 0.0 0.0 basis 0.5 0.5 0.5
lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.0 0.0 0.0 basis 0.5 0.5 0.5
lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 0.644077758669482 basis 0.0 0.0 0.0 basis 0.5 0.5 0.5
Lattice spacing in x,y,z = 4.5937 4.5937 2.9587
create_atoms 2 region box_vide
Created 792 atoms
# Oxygen atoms
lattice custom ${a} origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.30478 0.30478 0.0 basis 0.69522 0.69522 0.0 basis 0.19522 0.80478 0.5 basis 0.80478 0.19522 0.5
lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 ${ca} basis 0.30478 0.30478 0.0 basis 0.69522 0.69522 0.0 basis 0.19522 0.80478 0.5 basis 0.80478 0.19522 0.5
lattice custom 4.5937 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 0.644077758669482 basis 0.30478 0.30478 0.0 basis 0.69522 0.69522 0.0 basis 0.19522 0.80478 0.5 basis 0.80478 0.19522 0.5
Lattice spacing in x,y,z = 4.5937 4.5937 2.9587
create_atoms 1 region box_vide
Created 1584 atoms
mass 1 16.00
group Oxy type 1
1584 atoms in group Oxy
compute chargeOxy Oxy property/atom q
compute q_Oxy Oxy reduce ave c_chargeOxy
mass 2 47.867
group Ti type 2
792 atoms in group Ti
compute chargeTi Ti property/atom q
compute q_Ti Ti reduce ave c_chargeTi
velocity all create ${T_depart} 277387
velocity all create 300 277387
pair_style smtbq
pair_coeff * * ffield.smtbq.TiO2 O Ti
+Reading potential file ffield.smtbq.TiO2 with DATE: 2015-10-22
neighbor 0.5 bin
neigh_modify every 20 delay 0 check yes
timestep ${dt}
timestep 0.0002
thermo_style custom step temp press pe ke etotal c_q_Ti c_q_Oxy lx ly lz vol
thermo_modify flush yes
thermo 1
#dump 5 all custom 500 boxAlpha_alumina.lammpstrj id type q x y z
fix 3 all nve
run 10
Neighbor list info ...
1 neighbor list requests
update every 20 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12.6744
ghost atom cutoff = 12.6744
binsize = 6.3372 -> bins = 5 5 6
-Memory usage per processor = 4.77264 Mbytes
+Memory usage per processor = 4.60415 Mbytes
Step Temp Press PotEng KinEng TotEng q_Ti q_Oxy Lx Ly Lz Volume
0 300 44365.066 -15815.239 92.097853 -15723.142 2.5521775 -1.2760888 27.5622 27.5622 32.5457 24724.15
- 1 299.90455 44375.373 -15815.21 92.06855 -15723.142 2.552178 -1.276089 27.5622 27.5622 32.5457 24724.15
- 2 299.63739 44392.241 -15815.128 91.986534 -15723.142 2.5521725 -1.2760863 27.5622 27.5622 32.5457 24724.15
- 3 299.19899 44415.606 -15814.994 91.85195 -15723.142 2.5521616 -1.2760808 27.5622 27.5622 32.5457 24724.15
- 4 298.59012 44445.345 -15814.808 91.665031 -15723.143 2.5521454 -1.2760727 27.5622 27.5622 32.5457 24724.15
- 5 297.81185 44481.382 -15814.57 91.426105 -15723.144 2.5521238 -1.2760619 27.5622 27.5622 32.5457 24724.15
- 6 296.86552 44523.683 -15814.28 91.135592 -15723.144 2.5520969 -1.2760484 27.5622 27.5622 32.5457 24724.15
- 7 295.75281 44572.175 -15813.939 90.793996 -15723.145 2.5520648 -1.2760324 27.5622 27.5622 32.5457 24724.15
- 8 294.47564 44626.778 -15813.548 90.401913 -15723.147 2.5520274 -1.2760137 27.5622 27.5622 32.5457 24724.15
- 9 293.03623 44687.401 -15813.108 89.960027 -15723.148 2.5519849 -1.2759925 27.5622 27.5622 32.5457 24724.15
- 10 291.43711 44753.932 -15812.618 89.469107 -15723.149 2.5519374 -1.2759687 27.5622 27.5622 32.5457 24724.15
-Loop time of 570.52 on 1 procs for 10 steps with 2376 atoms
-
-Performance: 0.000 ns/day, 79238.948 hours/ns, 0.018 timesteps/s
-99.9% CPU use with 1 MPI tasks x no OpenMP threads
+ 1 299.90799 44372.657 -15815.211 92.069608 -15723.142 2.5521771 -1.2760885 27.5622 27.5622 32.5457 24724.15
+ 2 299.64406 44386.645 -15815.13 91.988581 -15723.142 2.5521705 -1.2760852 27.5622 27.5622 32.5457 24724.15
+ 3 299.20863 44406.97 -15814.997 91.854908 -15723.142 2.5521584 -1.2760792 27.5622 27.5622 32.5457 24724.15
+ 4 298.60246 44433.509 -15814.812 91.668818 -15723.143 2.552141 -1.2760705 27.5622 27.5622 32.5457 24724.15
+ 5 297.82659 44466.206 -15814.574 91.430631 -15723.144 2.5521181 -1.276059 27.5622 27.5622 32.5457 24724.15
+ 6 296.88235 44505.016 -15814.285 91.140758 -15723.144 2.5520898 -1.2760449 27.5622 27.5622 32.5457 24724.15
+ 7 295.77139 44549.856 -15813.945 90.7997 -15723.145 2.5520562 -1.2760281 27.5622 27.5622 32.5457 24724.15
+ 8 294.49562 44600.663 -15813.555 90.408048 -15723.147 2.5520173 -1.2760087 27.5622 27.5622 32.5457 24724.15
+ 9 293.05725 44657.353 -15813.114 89.966478 -15723.148 2.5519732 -1.2759866 27.5622 27.5622 32.5457 24724.15
+ 10 291.45876 44719.821 -15812.625 89.475755 -15723.149 2.551924 -1.275962 27.5622 27.5622 32.5457 24724.15
+Loop time of 161.071 on 4 procs for 10 steps with 2376 atoms
+
+Performance: 0.001 ns/day, 22370.960 hours/ns, 0.062 timesteps/s
+99.8% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
-Pair | 570.52 | 570.52 | 570.52 | 0.0 |100.00
+Pair | 161.07 | 161.07 | 161.07 | 0.0 |100.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
-Comm | 0.00087428 | 0.00087428 | 0.00087428 | 0.0 | 0.00
-Output | 0.00091386 | 0.00091386 | 0.00091386 | 0.0 | 0.00
-Modify | 0.00045085 | 0.00045085 | 0.00045085 | 0.0 | 0.00
-Other | | 0.0001979 | | | 0.00
-
-Nlocal: 2376 ave 2376 max 2376 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
-Nghost: 13138 ave 13138 max 13138 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
+Comm | 0.0021119 | 0.0024694 | 0.0026705 | 0.4 | 0.00
+Output | 0.00060225 | 0.00070065 | 0.00098777 | 0.6 | 0.00
+Modify | 0.00012326 | 0.00013238 | 0.00014782 | 0.1 | 0.00
+Other | | 0.0001593 | | | 0.00
+
+Nlocal: 594 ave 630 max 558 min
+Histogram: 2 0 0 0 0 0 0 0 0 2
+Nghost: 7638 ave 7674 max 7602 min
+Histogram: 2 0 0 0 0 0 0 0 0 2
Neighs: 0 ave 0 max 0 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
-FullNghs: 1.9705e+06 ave 1.9705e+06 max 1.9705e+06 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
+Histogram: 4 0 0 0 0 0 0 0 0 0
+FullNghs: 492624 ave 522720 max 462528 min
+Histogram: 2 0 0 0 0 0 0 0 0 2
Total # of neighbors = 1970496
Ave neighs/atom = 829.333
Neighbor list builds = 0
Dangerous builds = 0
unfix 3
#thermo 15
fix 1 all box/relax tri 0.0 vmax 0.001
minimize 1.0e-3 1.0e-5 1000 10000
WARNING: Resetting reneighboring criteria during minimization (../min.cpp:168)
Neighbor list info ...
1 neighbor list requests
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12.6744
ghost atom cutoff = 12.6744
binsize = 6.3372 -> bins = 5 5 6
-Memory usage per processor = 6.14764 Mbytes
+Memory usage per processor = 5.97915 Mbytes
Step Temp Press PotEng KinEng TotEng q_Ti q_Oxy Lx Ly Lz Volume
- 10 291.43711 44753.932 -15812.618 89.469107 -15723.149 2.5519374 -1.2759687 27.5622 27.5622 32.5457 24724.15
- 11 291.43711 39000.467 -15814.109 89.469107 -15724.639 2.5514249 -1.2757124 27.582771 27.582775 32.578246 24785.834
-Loop time of 80.5411 on 1 procs for 1 steps with 2376 atoms
+ 10 291.45876 44719.821 -15812.625 89.475755 -15723.149 2.551924 -1.275962 27.5622 27.5622 32.5457 24724.15
+ 11 291.45876 38966.735 -15814.114 89.475755 -15724.638 2.5514114 -1.2757057 27.582769 27.582778 32.578246 24785.835
+Loop time of 22.3212 on 4 procs for 1 steps with 2376 atoms
-99.9% CPU use with 1 MPI tasks x no OpenMP threads
+99.9% CPU use with 4 MPI tasks x no OpenMP threads
Minimization stats:
Stopping criterion = energy tolerance
Energy initial, next-to-last, final =
- -15812.6183471 -15812.6183471 -15814.1085593
- Force two-norm initial, final = 1104.2 951.386
- Force max component initial, final = 759.352 657.815
- Final line search alpha, max atom move = 1.31691e-06 0.000866285
+ -15812.6250198 -15812.6250198 -15814.1138993
+ Force two-norm initial, final = 1103.27 950.466
+ Force max component initial, final = 758.704 657.184
+ Final line search alpha, max atom move = 1.31804e-06 0.000866193
Iterations, force evaluations = 1 1
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
-Pair | 80.54 | 80.54 | 80.54 | 0.0 |100.00
+Pair | 22.32 | 22.32 | 22.32 | 0.0 |100.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
-Comm | 0.00016761 | 0.00016761 | 0.00016761 | 0.0 | 0.00
+Comm | 0.00042605 | 0.00043178 | 0.00043893 | 0.0 | 0.00
Output | 0 | 0 | 0 | 0.0 | 0.00
Modify | 0 | 0 | 0 | 0.0 | 0.00
-Other | | 0.0006053 | | | 0.00
+Other | | 0.0004204 | | | 0.00
-Nlocal: 2376 ave 2376 max 2376 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
-Nghost: 13138 ave 13138 max 13138 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
+Nlocal: 594 ave 600 max 587 min
+Histogram: 1 0 0 0 1 0 1 0 0 1
+Nghost: 7638 ave 7645 max 7632 min
+Histogram: 1 0 0 1 0 1 0 0 0 1
Neighs: 0 ave 0 max 0 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
-FullNghs: 1.96864e+06 ave 1.96864e+06 max 1.96864e+06 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
+Histogram: 4 0 0 0 0 0 0 0 0 0
+FullNghs: 492126 ave 497133 max 486366 min
+Histogram: 1 0 0 0 1 0 1 0 0 1
-Total # of neighbors = 1968636
-Ave neighs/atom = 828.551
+Total # of neighbors = 1968506
+Ave neighs/atom = 828.496
Neighbor list builds = 0
Dangerous builds = 0
unfix 1
thermo 1
fix 3 all nve
run 10
Neighbor list info ...
1 neighbor list requests
update every 20 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12.6744
ghost atom cutoff = 12.6744
binsize = 6.3372 -> bins = 5 5 6
-Memory usage per processor = 5.02264 Mbytes
+Memory usage per processor = 4.85415 Mbytes
Step Temp Press PotEng KinEng TotEng q_Ti q_Oxy Lx Ly Lz Volume
- 11 291.43711 39000.467 -15814.109 89.469107 -15724.639 2.5514249 -1.2757124 27.582771 27.582775 32.578246 24785.834
- 12 289.69465 39072.309 -15813.575 88.934185 -15724.641 2.551372 -1.275686 27.582771 27.582775 32.578246 24785.834
- 13 287.79928 39149.855 -15812.994 88.352321 -15724.642 2.5513146 -1.2756573 27.582771 27.582775 32.578246 24785.834
- 14 285.75427 39232.968 -15812.368 87.724515 -15724.644 2.5512525 -1.2756262 27.582771 27.582775 32.578246 24785.834
- 15 283.56312 39321.472 -15811.697 87.05185 -15724.645 2.5511856 -1.2755928 27.582771 27.582775 32.578246 24785.834
- 16 281.22962 39415.185 -15810.983 86.335481 -15724.647 2.5511143 -1.2755571 27.582771 27.582775 32.578246 24785.834
- 17 278.75777 39513.921 -15810.226 85.57664 -15724.649 2.5510384 -1.2755192 27.582771 27.582775 32.578246 24785.834
- 18 276.15182 39617.471 -15809.428 84.776632 -15724.651 2.5509583 -1.2754791 27.582771 27.582775 32.578246 24785.834
- 19 273.41625 39725.622 -15808.591 83.936831 -15724.654 2.5508739 -1.275437 27.582771 27.582775 32.578246 24785.834
- 20 270.55575 39838.144 -15807.715 83.058679 -15724.656 2.5507855 -1.2753928 27.582771 27.582775 32.578246 24785.834
- 21 267.57523 39954.804 -15806.802 82.14368 -15724.659 2.5506932 -1.2753466 27.582771 27.582775 32.578246 24785.834
-Loop time of 606.774 on 1 procs for 10 steps with 2376 atoms
-
-Performance: 0.000 ns/day, 84274.222 hours/ns, 0.016 timesteps/s
-99.9% CPU use with 1 MPI tasks x no OpenMP threads
+ 11 291.45876 38966.735 -15814.114 89.475755 -15724.638 2.5514114 -1.2757057 27.582769 27.582778 32.578246 24785.835
+ 12 289.71602 39034.428 -15813.58 88.940745 -15724.639 2.5513568 -1.2756784 27.582769 27.582778 32.578246 24785.835
+ 13 287.81994 39107.705 -15813 88.358662 -15724.641 2.5512976 -1.2756488 27.582769 27.582778 32.578246 24785.835
+ 14 285.77378 39186.429 -15812.373 87.730505 -15724.642 2.5512335 -1.2756168 27.582769 27.582778 32.578246 24785.835
+ 15 283.58105 39270.434 -15811.702 87.057353 -15724.644 2.5511647 -1.2755824 27.582769 27.582778 32.578246 24785.835
+ 16 281.24552 39359.544 -15810.986 86.340362 -15724.646 2.5510913 -1.2755457 27.582769 27.582778 32.578246 24785.835
+ 17 278.77119 39453.574 -15810.229 85.580761 -15724.648 2.5510134 -1.2755067 27.582769 27.582778 32.578246 24785.835
+ 18 276.16232 39552.323 -15809.43 84.779855 -15724.65 2.5509311 -1.2754655 27.582769 27.582778 32.578246 24785.835
+ 19 273.42337 39655.586 -15808.592 83.939017 -15724.652 2.5508445 -1.2754223 27.582769 27.582778 32.578246 24785.835
+ 20 270.55904 39763.139 -15807.715 83.05969 -15724.655 2.5507538 -1.2753769 27.582769 27.582778 32.578246 24785.835
+ 21 267.57425 39874.754 -15806.801 82.14338 -15724.658 2.5506591 -1.2753296 27.582769 27.582778 32.578246 24785.835
+Loop time of 170.172 on 4 procs for 10 steps with 2376 atoms
+
+Performance: 0.001 ns/day, 23634.979 hours/ns, 0.059 timesteps/s
+99.9% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
-Pair | 606.77 | 606.77 | 606.77 | 0.0 |100.00
+Pair | 170.17 | 170.17 | 170.17 | 0.0 |100.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
-Comm | 0.00085855 | 0.00085855 | 0.00085855 | 0.0 | 0.00
-Output | 0.00087833 | 0.00087833 | 0.00087833 | 0.0 | 0.00
-Modify | 0.00041723 | 0.00041723 | 0.00041723 | 0.0 | 0.00
-Other | | 0.0001888 | | | 0.00
-
-Nlocal: 2376 ave 2376 max 2376 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
-Nghost: 13138 ave 13138 max 13138 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
+Comm | 0.0025029 | 0.0028628 | 0.0030224 | 0.4 | 0.00
+Output | 0.00063372 | 0.00081372 | 0.0011685 | 0.7 | 0.00
+Modify | 0.00012541 | 0.0001539 | 0.00021005 | 0.3 | 0.00
+Other | | 0.0001655 | | | 0.00
+
+Nlocal: 594 ave 600 max 587 min
+Histogram: 1 0 0 0 1 0 1 0 0 1
+Nghost: 7638 ave 7645 max 7632 min
+Histogram: 1 0 0 1 0 1 0 0 0 1
Neighs: 0 ave 0 max 0 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
-FullNghs: 1.96049e+06 ave 1.96049e+06 max 1.96049e+06 min
-Histogram: 1 0 0 0 0 0 0 0 0 0
+Histogram: 4 0 0 0 0 0 0 0 0 0
+FullNghs: 490100 ave 495079 max 484284 min
+Histogram: 1 0 0 0 1 0 1 0 0 1
-Total # of neighbors = 1960492
-Ave neighs/atom = 825.123
+Total # of neighbors = 1960398
+Ave neighs/atom = 825.083
Neighbor list builds = 0
Dangerous builds = 0
-Total wall time: 0:23:48
+Total wall time: 0:06:39
diff --git a/examples/qeq/in.qeq.buck b/examples/qeq/in.qeq.buck
index 05801a32a..f7ec2bb80 100644
--- a/examples/qeq/in.qeq.buck
+++ b/examples/qeq/in.qeq.buck
@@ -1,39 +1,41 @@
# This example demonstrates the use of various fix qeq variants with
# that defines and uses charges, in this case pair_style buck/coul/long
units metal
atom_style charge
read_data data.aC
+replicate 2 2 2
pair_style buck/coul/long 12.0
pair_coeff 2 2 1388.77 .3623188 175.0
pair_coeff 1 2 18003 .2052124 133.5381
pair_coeff 1 1 0 .1 0
kspace_style ewald 1e-6
neighbor 1.0 bin
neigh_modify delay 0 every 1 check yes
group type1 type 1
compute charge1 type1 property/atom q
compute q1 type1 reduce ave c_charge1
group type2 type 2
compute charge2 type2 property/atom q
compute q2 type2 reduce ave c_charge2
variable qtot equal count(type1)*c_q1+count(type2)*c_q2
-thermo_style custom step pe c_q1 c_q2 v_qtot
-thermo 1
+thermo_style custom step pe c_q1 c_q2 v_qtot spcpu
+thermo 10
timestep 0.0001
velocity all create 300.0 1281937
fix 1 all nve
-#fix 2 all qeq/point 1 10 1.0e-6 100 param.qeq2
-#fix 2 all qeq/shielded 1 10 1.0e-6 100 param.qeq2
-#fix 2 all qeq/slater 1 10 1.0e-6 100 param.qeq2
-fix 2 all qeq/dynamic 1 10 1.0e-2 100 param.qeq2
+#fix 2 all qeq/point 1 10 1.0e-6 100 param.qeq2
+#fix 2 all qeq/shielded 1 10 1.0e-6 100 param.qeq2
+#fix 2 all qeq/slater 1 10 1.0e-6 100 param.qeq2
+#fix 2 all qeq/dynamic 1 10 1.0e-4 100 param.qeq2
+fix 2 all qeq/fire 1 10 1.0e-4 100 param.qeq2
-run 10
+run 100
diff --git a/examples/voronoi/in.voronoi.2d b/examples/voronoi/in.voronoi.2d
new file mode 100644
index 000000000..74bde73f1
--- /dev/null
+++ b/examples/voronoi/in.voronoi.2d
@@ -0,0 +1,52 @@
+# Test volume definitions for 2d and finite systems
+
+variable rcut equal 10.0
+variable rskin equal 2.0
+variable rcomm equal 20.0
+variable len equal 4.0
+variable lenz equal 10.0
+
+dimension 2
+units metal
+boundary p p p
+
+#lattice sq 1.0 origin 0.5 0.5 0.0
+lattice hex 1.0 origin 0.5 0.5 0.0
+
+atom_style atomic
+
+region box block 0 ${len} 0 ${len} 0.0 ${lenz}
+region atoms block 0 ${len} 0 ${len} 0.0 0.0
+create_box 1 box
+create_atoms 1 region atoms
+
+mass 1 1.0
+
+pair_style lj/cut ${rcut}
+pair_coeff 1 1 0.0 1.0
+
+neighbor ${rskin} nsq
+
+# set the minimum communication cut-off
+comm_modify cutoff ${rcomm}
+
+compute v1 all voronoi/atom neighbors yes
+compute volvor all reduce sum c_v1[1]
+variable volsys equal lz*lx*ly
+variable err equal c_volvor-v_volsys
+thermo_style custom c_volvor v_volsys vol v_err
+thermo 1
+
+#
+# TEST 1: Volume check for 2d bulk system
+#
+
+run 0
+
+#
+# TEST 2: Volume check for 2d finite system
+# add margins in x and y directions
+#
+
+change_box all boundary f f p
+run 0
diff --git a/examples/voronoi/in.voronoi.data b/examples/voronoi/in.voronoi.data
new file mode 100644
index 000000000..853c2c2bd
--- /dev/null
+++ b/examples/voronoi/in.voronoi.data
@@ -0,0 +1,88 @@
+# Exercise different output data options
+
+variable len equal 4.0
+variable lenz equal 10.0
+
+dimension 2
+units metal
+boundary f f p
+
+lattice hex 1.0 origin 0.25 0.25 0.0
+
+atom_style atomic
+
+region box block 0 ${len} 0 ${len} 0.0 ${lenz}
+region atoms block 0 ${len} 0 ${len} 0.0 0.0
+create_box 1 box
+create_atoms 1 region atoms
+
+mass 1 1.0
+
+pair_style lj/cut 2.5
+pair_coeff 1 1 0.0 1.0
+
+neighbor 1.0 nsq
+
+#
+# TEST 1:
+#
+
+# This compute voronoi generates all three
+# types of quantity: per-atom, local, and global
+
+compute v1 all voronoi/atom neighbors yes edge_histo 6
+
+# write voronoi per-atom quantities to a file
+
+dump dperatom all custom 1 dump.voro id type x y z c_v1[1] c_v1[2]
+
+# writing voronoi local quantities to a file
+
+dump dlocal all local 1 dump.neighbors index c_v1[1] c_v1[2] c_v1[3]
+
+# sum up a voronoi per-atom quantity
+
+compute volvor all reduce sum c_v1[1]
+
+variable volsys equal lz*lx*ly
+variable err equal c_volvor-v_volsys
+
+# output voronoi global quantities
+
+thermo_style custom c_volvor v_volsys vol v_err c_v1[3] c_v1[4] c_v1[5] c_v1[6] c_v1[7]
+thermo 1
+
+run 0
+
+uncompute v1
+uncompute volvor
+undump dperatom
+undump dlocal
+
+#
+# TEST 2:
+#
+
+# This compute voronoi generates
+# local and global quantities, but
+# not per-atom quantities
+
+compute v2 all voronoi/atom neighbors yes edge_histo 6 peratom no
+
+# write voronoi local quantities to a file
+
+dump d2 all local 1 dump.neighbors2 index c_v2[1] c_v2[2] c_v2[3]
+
+# sum up a voronoi local quantity
+
+compute sumarea all reduce sum c_v2[3]
+
+# output voronoi global quantities
+
+thermo_style custom c_sumarea c_v2[3] c_v2[4] c_v2[5] c_v2[6] c_v2[7]
+thermo 1
+
+run 0
+
+
+
diff --git a/extra_cleanup.sh b/extra_cleanup.sh
index bd2a50d68..c09576579 100755
--- a/extra_cleanup.sh
+++ b/extra_cleanup.sh
@@ -1,19 +1,19 @@
#!/bin/sh
# do some cleaning up to fix permissions and remove cruft
# delete backup and patch rejection files
find ./ -name \*.orig -print -or -name \*~ -print -or -name \*.rej -print \
| xargs rm -vf
# remove executable permissions from sources
find ./ -name \*.cpp -print -or -name \*.c -print \
-or -name \*.h -print -or -name Makefile\* -print \
| xargs chmod -x $f
-# remove training whitespace from C/C++ source files
+# remove trailing whitespace from C/C++ source files
find ./ -name \*.cpp -print -or -name \*.c -print -or -name \*.h -print \
| xargs sed -i -e 's,[ ]\+$,,'
# change #include "..." to #include <...> for system headers
find ./ -name \*.cpp -print -or -name \*.c -print -or -name \*.h -print \
| xargs sed -i -e 's,^#include \+"\(Python\|assert\|ctype\|direct\|dirent\|errno\|float\|inttypes\|limits\|math\|mpi\|omp\|rpc/.\*\|stdint\|stdio\|stdlib\|string\|sys/\*\|time\|unistd\)\.h",#include <\1.h>,'
diff --git a/src/ASPHERE/pair_line_lj.cpp b/src/ASPHERE/pair_line_lj.cpp
index 2124b455f..737aefa18 100644
--- a/src/ASPHERE/pair_line_lj.cpp
+++ b/src/ASPHERE/pair_line_lj.cpp
@@ -1,454 +1,471 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_line_lj.h"
#include "atom.h"
#include "atom_vec_line.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define DELTA 10000
/* ---------------------------------------------------------------------- */
PairLineLJ::PairLineLJ(LAMMPS *lmp) : Pair(lmp)
{
dmax = nmax = 0;
discrete = NULL;
dnum = dfirst = NULL;
single_enable = 0;
restartinfo = 0;
}
/* ---------------------------------------------------------------------- */
PairLineLJ::~PairLineLJ()
{
memory->sfree(discrete);
memory->destroy(dnum);
memory->destroy(dfirst);
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
+ memory->destroy(subsize);
memory->destroy(cut);
+ memory->destroy(cutsub);
+ memory->destroy(cutsubsq);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
}
}
/* ---------------------------------------------------------------------- */
void PairLineLJ::compute(int eflag, int vflag)
{
- int i,j,ii,jj,inum,jnum,itype,jtype;
+ int i,j,ii,jj,inum,jnum,itype,jtype,tmp;
int ni,nj,npi,npj,ifirst,jfirst;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,r2inv,r6inv,term1,term2,sig,sig3,forcelj;
double xi[2],xj[2],fi[2],fj[2],dxi,dxj,dyi,dyj;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
double **x = atom->x;
double **f = atom->f;
double **torque = atom->torque;
int *line = atom->line;
int *type = atom->type;
int nlocal = atom->nlocal;
int nall = nlocal + atom->nghost;
int newton_pair = force->newton_pair;
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
// grow discrete list if necessary and initialize
if (nall > nmax) {
nmax = nall;
memory->destroy(dnum);
memory->destroy(dfirst);
memory->create(dnum,nall,"pair:dnum");
memory->create(dfirst,nall,"pair:dfirst");
}
for (i = 0; i < nall; i++) dnum[i] = 0;
ndiscrete = 0;
// loop over neighbors of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
jtype = type[j];
if (rsq >= cutsq[itype][jtype]) continue;
// line/line interactions = NxN particles
evdwl = 0.0;
if (line[i] >= 0 && line[j] >= 0) {
- if (dnum[i] == 0) discretize(i,sigma[itype][itype]);
+ if (dnum[i] == 0) discretize(i,subsize[itype]);
npi = dnum[i];
ifirst = dfirst[i];
- if (dnum[j] == 0) discretize(j,sigma[jtype][jtype]);
+ if (dnum[j] == 0) discretize(j,subsize[jtype]);
npj = dnum[j];
jfirst = dfirst[j];
for (ni = 0; ni < npi; ni++) {
dxi = discrete[ifirst+ni].dx;
dyi = discrete[ifirst+ni].dy;
for (nj = 0; nj < npj; nj++) {
dxj = discrete[jfirst+nj].dx;
dyj = discrete[jfirst+nj].dy;
xi[0] = x[i][0] + dxi;
xi[1] = x[i][1] + dyi;
xj[0] = x[j][0] + dxj;
xj[1] = x[j][1] + dyj;
delx = xi[0] - xj[0];
dely = xi[1] - xj[1];
rsq = delx*delx + dely*dely;
- sig = 0.5 * (discrete[ifirst+ni].sigma+discrete[jfirst+nj].sigma);
+ // skip this pair of sub-particles if outside sub cutoff
+
+ if (rsq >= cutsubsq[itype][jtype]) continue;
+
+ sig = sigma[itype][jtype];
sig3 = sig*sig*sig;
term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
term1 = 2.0 * term2 * sig3*sig3;
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (term1*r6inv - term2);
fpair = forcelj*r2inv;
if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
fi[0] = delx*fpair;
fi[1] = dely*fpair;
+
f[i][0] += fi[0];
f[i][1] += fi[1];
torque[i][2] += dxi*fi[1] - dyi*fi[0];
if (newton_pair || j < nlocal) {
- fj[0] = -delx*fpair;
- fj[1] = -dely*fpair;
- f[j][0] += fj[0];
- f[j][1] += fj[1];
- torque[j][2] += dxj*fj[1] - dyj*fj[0];
+ f[j][0] -= fi[0];
+ f[j][1] -= fi[1];
+ torque[j][2] -= dxj*fi[1] - dyj*fi[0];
}
}
}
// line/particle interaction = Nx1 particles
// convert line into Np particles based on sigma and line length
} else if (line[i] >= 0) {
- if (dnum[i] == 0) discretize(i,sigma[itype][itype]);
+ if (dnum[i] == 0) discretize(i,subsize[itype]);
npi = dnum[i];
ifirst = dfirst[i];
for (ni = 0; ni < npi; ni++) {
dxi = discrete[ifirst+ni].dx;
dyi = discrete[ifirst+ni].dy;
xi[0] = x[i][0] + dxi;
xi[1] = x[i][1] + dyi;
xj[0] = x[j][0];
xj[1] = x[j][1];
delx = xi[0] - xj[0];
dely = xi[1] - xj[1];
rsq = delx*delx + dely*dely;
- sig = 0.5 * (discrete[ifirst+ni].sigma+sigma[jtype][jtype]);
+ // skip this pair of sub-particles if outside sub cutoff
+
+ if (rsq >= cutsubsq[itype][jtype]) continue;
+
+ sig = sigma[itype][jtype];
sig3 = sig*sig*sig;
term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
term1 = 2.0 * term2 * sig3*sig3;
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (term1*r6inv - term2);
fpair = forcelj*r2inv;
if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
fi[0] = delx*fpair;
fi[1] = dely*fpair;
f[i][0] += fi[0];
f[i][1] += fi[1];
torque[i][2] += dxi*fi[1] - dyi*fi[0];
if (newton_pair || j < nlocal) {
- fj[0] = -delx*fpair;
- fj[1] = -dely*fpair;
- f[j][0] += fj[0];
- f[j][1] += fj[1];
+ f[j][0] -= fi[0];
+ f[j][1] -= fi[1];
}
}
// particle/line interaction = Nx1 particles
// convert line into Np particles based on sigma and line length
} else if (line[j] >= 0) {
- if (dnum[j] == 0) discretize(j,sigma[jtype][jtype]);
+ if (dnum[j] == 0) discretize(j,subsize[jtype]);
npj = dnum[j];
jfirst = dfirst[j];
for (nj = 0; nj < npj; nj++) {
dxj = discrete[jfirst+nj].dx;
dyj = discrete[jfirst+nj].dy;
xi[0] = x[i][0];
xi[1] = x[i][1];
xj[0] = x[j][0] + dxj;
xj[1] = x[j][1] + dyj;
delx = xi[0] - xj[0];
dely = xi[1] - xj[1];
rsq = delx*delx + dely*dely;
- sig = 0.5 * (sigma[itype][itype]+discrete[jfirst+nj].sigma);
+ // skip this pair of sub-particles if outside sub cutoff
+
+ if (rsq >= cutsubsq[itype][jtype]) continue;
+
+ sig = sigma[itype][jtype];
sig3 = sig*sig*sig;
term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
term1 = 2.0 * term2 * sig3*sig3;
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (term1*r6inv - term2);
fpair = forcelj*r2inv;
if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
fi[0] = delx*fpair;
fi[1] = dely*fpair;
f[i][0] += fi[0];
f[i][1] += fi[1];
if (newton_pair || j < nlocal) {
- f[j][0] += fj[0];
- f[j][1] += fj[1];
- fj[0] = -delx*fpair;
- fj[1] = -dely*fpair;
- torque[j][2] += dxj*fj[1] - dyj*fj[0];
+ f[j][0] -= fi[0];
+ f[j][1] -= fi[1];
+ torque[j][2] -= dxj*fi[1] - dyj*fi[0];
}
}
// particle/particle interaction = 1x1 particles
} else {
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
fpair = forcelj*r2inv;
if (eflag)
evdwl += r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
if (newton_pair || j < nlocal) {
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
}
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairLineLJ::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
+ memory->create(subsize,n+1,"pair:subsize");
memory->create(cut,n+1,n+1,"pair:cut");
+ memory->create(cutsub,n+1,n+1,"pair:cutsub");
+ memory->create(cutsubsq,n+1,n+1,"pair:cutsubsq");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairLineLJ::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = force->numeric(FLERR,arg[0]);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut[i][j] = cut_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairLineLJ::coeff(int narg, char **arg)
{
- if (narg < 4 || narg > 5)
+ if (narg < 7 || narg > 8)
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
- double epsilon_one = force->numeric(FLERR,arg[2]);
- double sigma_one = force->numeric(FLERR,arg[3]);
+ double size_itype = force->numeric(FLERR,arg[2]);
+ double size_jtype = force->numeric(FLERR,arg[3]);
+ double epsilon_one = force->numeric(FLERR,arg[4]);
+ double sigma_one = force->numeric(FLERR,arg[5]);
+ double cutsub_one = force->numeric(FLERR,arg[6]);
double cut_one = cut_global;
- if (narg == 5) cut_one = force->numeric(FLERR,arg[4]);
+ if (narg == 8) cut_one = force->numeric(FLERR,arg[7]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
+ subsize[i] = size_itype;
+ subsize[j] = size_jtype;
epsilon[i][j] = epsilon_one;
sigma[i][j] = sigma_one;
+ cutsub[i][j] = cutsub_one;
cut[i][j] = cut_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairLineLJ::init_style()
{
avec = (AtomVecLine *) atom->style_match("line");
if (!avec) error->all(FLERR,"Pair line/lj requires atom style line");
neighbor->request(this,instance_me);
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairLineLJ::init_one(int i, int j)
{
- if (setflag[i][j] == 0) {
- epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
- sigma[i][i],sigma[j][j]);
- sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
- cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
- }
+ if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
+
+ cutsubsq[i][j] = cutsub[i][j] * cutsub[i][j];
lj1[i][j] = 48.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
lj2[i][j] = 24.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
epsilon[j][i] = epsilon[i][j];
sigma[j][i] = sigma[i][j];
+ cutsubsq[j][i] = cutsubsq[i][j];
+
lj1[j][i] = lj1[i][j];
lj2[j][i] = lj2[i][j];
lj3[j][i] = lj3[i][j];
lj4[j][i] = lj4[i][j];
return cut[i][j];
}
/* ----------------------------------------------------------------------
- discretize line segment I into N sub-segments no more than sigma in length
- store new discrete particles in Discrete list
+ discretize line segment I into N sub-particles with <= size separation
+ store displacement dx,dy of discrete particles in Discrete list
------------------------------------------------------------------------- */
-void PairLineLJ::discretize(int i, double sigma)
+void PairLineLJ::discretize(int i, double size)
{
AtomVecLine::Bonus *bonus = avec->bonus;
double length = bonus[atom->line[i]].length;
double theta = bonus[atom->line[i]].theta;
- int n = static_cast<int> (length/sigma) + 1;
+ int n = static_cast<int> (length/size) + 1;
+
dnum[i] = n;
dfirst[i] = ndiscrete;
if (ndiscrete + n > dmax) {
dmax += DELTA;
discrete = (Discrete *)
memory->srealloc(discrete,dmax*sizeof(Discrete),"pair:discrete");
}
- sigma = length/n;
double delta;
for (int m = 0; m < n; m++) {
delta = -0.5 + (2*m+1)/(2.0*n);
discrete[ndiscrete].dx = delta*length*cos(theta);
discrete[ndiscrete].dy = delta*length*sin(theta);
- discrete[ndiscrete].sigma = sigma;
ndiscrete++;
}
}
diff --git a/src/ASPHERE/pair_line_lj.h b/src/ASPHERE/pair_line_lj.h
index 7d99e836f..0eb5bb0e0 100644
--- a/src/ASPHERE/pair_line_lj.h
+++ b/src/ASPHERE/pair_line_lj.h
@@ -1,80 +1,82 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(line/lj,PairLineLJ)
#else
#ifndef LMP_PAIR_LINE_LJ_H
#define LMP_PAIR_LINE_LJ_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLineLJ : public Pair {
public:
PairLineLJ(class LAMMPS *);
virtual ~PairLineLJ();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
virtual void init_style();
double init_one(int, int);
protected:
double cut_global;
+ double *subsize;
+ double **epsilon,**sigma,**cutsub,**cutsubsq;
double **cut;
- double **epsilon,**sigma;
- double **lj1,**lj2,**lj3,**lj4;
+ double **lj1,**lj2,**lj3,**lj4; // for sphere/sphere interactions
class AtomVecLine *avec;
+ double *size; // per-type size of sub-particles to tile line segment
+
struct Discrete {
double dx,dy;
- double sigma;
};
Discrete *discrete; // list of all discretes for all lines
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
void allocate();
void discretize(int, double);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Incorrect args for pair coefficients
Self-explanatory. Check the input script or data file.
E: Pair line/lj requires atom style line
Self-explanatory.
*/
diff --git a/src/ASPHERE/pair_tri_lj.cpp b/src/ASPHERE/pair_tri_lj.cpp
index 4823664de..ef5123dc1 100644
--- a/src/ASPHERE/pair_tri_lj.cpp
+++ b/src/ASPHERE/pair_tri_lj.cpp
@@ -1,646 +1,646 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_tri_lj.h"
#include "math_extra.h"
#include "atom.h"
#include "atom_vec_tri.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define DELTA 20
/* ---------------------------------------------------------------------- */
PairTriLJ::PairTriLJ(LAMMPS *lmp) : Pair(lmp)
{
dmax = nmax = 0;
discrete = NULL;
dnum = dfirst = NULL;
single_enable = 0;
restartinfo = 0;
}
/* ---------------------------------------------------------------------- */
PairTriLJ::~PairTriLJ()
{
memory->sfree(discrete);
memory->destroy(dnum);
memory->destroy(dfirst);
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cut);
memory->destroy(epsilon);
memory->destroy(sigma);
memory->destroy(lj1);
memory->destroy(lj2);
memory->destroy(lj3);
memory->destroy(lj4);
}
}
/* ---------------------------------------------------------------------- */
void PairTriLJ::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
int ni,nj,npi,npj,ifirst,jfirst;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,r2inv,r6inv,term1,term2,sig,sig3,forcelj;
double dxi,dxj,dyi,dyj,dzi,dzj;
double xi[3],xj[3],fi[3],fj[3],ti[3],tj[3],p[3][3];
double dc1[3],dc2[3],dc3[3];
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
AtomVecTri::Bonus *bonus = avec->bonus;
double **x = atom->x;
double **f = atom->f;
double **torque = atom->torque;
int *tri = atom->tri;
int *type = atom->type;
int nlocal = atom->nlocal;
int nall = nlocal + atom->nghost;
int newton_pair = force->newton_pair;
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
// grow discrete list if necessary and initialize
if (nall > nmax) {
nmax = nall;
memory->destroy(dnum);
memory->destroy(dfirst);
memory->create(dnum,nall,"pair:dnum");
memory->create(dfirst,nall,"pair:dfirst");
}
for (i = 0; i < nall; i++) dnum[i] = 0;
ndiscrete = 0;
// loop over neighbors of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
jtype = type[j];
if (rsq >= cutsq[itype][jtype]) continue;
// tri/tri interactions = NxN particles
// c1,c2,c3 = corner pts of triangle I or J
evdwl = 0.0;
if (tri[i] >= 0 && tri[j] >= 0) {
if (dnum[i] == 0) {
MathExtra::quat_to_mat(bonus[tri[i]].quat,p);
MathExtra::matvec(p,bonus[tri[i]].c1,dc1);
MathExtra::matvec(p,bonus[tri[i]].c2,dc2);
MathExtra::matvec(p,bonus[tri[i]].c3,dc3);
dfirst[i] = ndiscrete;
discretize(i,sigma[itype][itype],dc1,dc2,dc3);
dnum[i] = ndiscrete - dfirst[i];
}
npi = dnum[i];
ifirst = dfirst[i];
if (dnum[j] == 0) {
MathExtra::quat_to_mat(bonus[tri[j]].quat,p);
MathExtra::matvec(p,bonus[tri[j]].c1,dc1);
MathExtra::matvec(p,bonus[tri[j]].c2,dc2);
MathExtra::matvec(p,bonus[tri[j]].c3,dc3);
dfirst[j] = ndiscrete;
discretize(j,sigma[jtype][jtype],dc1,dc2,dc3);
dnum[j] = ndiscrete - dfirst[j];
}
npj = dnum[j];
jfirst = dfirst[j];
for (ni = 0; ni < npi; ni++) {
dxi = discrete[ifirst+ni].dx;
dyi = discrete[ifirst+ni].dy;
dzi = discrete[ifirst+ni].dz;
for (nj = 0; nj < npj; nj++) {
dxj = discrete[jfirst+nj].dx;
dyj = discrete[jfirst+nj].dy;
dzj = discrete[jfirst+nj].dz;
xi[0] = x[i][0] + dxi;
xi[1] = x[i][1] + dyi;
xi[2] = x[i][2] + dzi;
xj[0] = x[j][0] + dxj;
xj[1] = x[j][1] + dyj;
xj[2] = x[j][2] + dzj;
delx = xi[0] - xj[0];
dely = xi[1] - xj[1];
delz = xi[2] - xj[2];
rsq = delx*delx + dely*dely + delz*delz;
sig = 0.5 * (discrete[ifirst+ni].sigma+discrete[jfirst+nj].sigma);
sig3 = sig*sig*sig;
term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
term1 = 2.0 * term2 * sig3*sig3;
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (term1*r6inv - term2);
fpair = forcelj*r2inv;
if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
fi[0] = delx*fpair;
fi[1] = dely*fpair;
fi[2] = delz*fpair;
f[i][0] += fi[0];
f[i][1] += fi[1];
f[i][2] += fi[2];
ti[0] = dyi*fi[2] - dzi*fi[1];
ti[1] = dzi*fi[0] - dxi*fi[2];
ti[2] = dxi*fi[1] - dyi*fi[0];
torque[i][0] += ti[0];
torque[i][1] += ti[1];
torque[i][2] += ti[2];
if (newton_pair || j < nlocal) {
fj[0] = -delx*fpair;
fj[1] = -dely*fpair;
fj[2] = -delz*fpair;
f[j][0] += fj[0];
f[j][1] += fj[1];
f[j][2] += fj[2];
tj[0] = dyj*fj[2] - dzj*fj[1];
tj[1] = dzj*fj[0] - dxj*fj[2];
tj[2] = dxj*fj[1] - dyj*fj[0];
torque[j][0] += tj[0];
torque[j][1] += tj[1];
torque[j][2] += tj[2];
}
}
}
// tri/particle interaction = Nx1 particles
// c1,c2,c3 = corner pts of triangle I
} else if (tri[i] >= 0) {
if (dnum[i] == 0) {
MathExtra::quat_to_mat(bonus[tri[i]].quat,p);
MathExtra::matvec(p,bonus[tri[i]].c1,dc1);
MathExtra::matvec(p,bonus[tri[i]].c2,dc2);
MathExtra::matvec(p,bonus[tri[i]].c3,dc3);
dfirst[i] = ndiscrete;
discretize(i,sigma[itype][itype],dc1,dc2,dc3);
dnum[i] = ndiscrete - dfirst[i];
}
npi = dnum[i];
ifirst = dfirst[i];
for (ni = 0; ni < npi; ni++) {
dxi = discrete[ifirst+ni].dx;
dyi = discrete[ifirst+ni].dy;
dzi = discrete[ifirst+ni].dz;
xi[0] = x[i][0] + dxi;
xi[1] = x[i][1] + dyi;
xi[2] = x[i][2] + dzi;
xj[0] = x[j][0];
xj[1] = x[j][1];
xj[2] = x[j][2];
delx = xi[0] - xj[0];
dely = xi[1] - xj[1];
delz = xi[2] - xj[2];
rsq = delx*delx + dely*dely + delz*delz;
sig = 0.5 * (discrete[ifirst+ni].sigma+sigma[jtype][jtype]);
sig3 = sig*sig*sig;
term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
term1 = 2.0 * term2 * sig3*sig3;
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (term1*r6inv - term2);
fpair = forcelj*r2inv;
if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
fi[0] = delx*fpair;
fi[1] = dely*fpair;
fi[2] = delz*fpair;
f[i][0] += fi[0];
f[i][1] += fi[1];
f[i][2] += fi[2];
ti[0] = dyi*fi[2] - dzi*fi[1];
ti[1] = dzi*fi[0] - dxi*fi[2];
ti[2] = dxi*fi[1] - dyi*fi[0];
torque[i][2] += ti[0];
torque[i][1] += ti[1];
torque[i][2] += ti[2];
if (newton_pair || j < nlocal) {
fj[0] = -delx*fpair;
fj[1] = -dely*fpair;
fj[2] = -delz*fpair;
f[j][0] += fj[0];
f[j][1] += fj[1];
f[j][2] += fj[2];
}
}
// particle/tri interaction = Nx1 particles
// c1,c2,c3 = corner pts of triangle J
} else if (tri[j] >= 0) {
if (dnum[j] == 0) {
MathExtra::quat_to_mat(bonus[tri[j]].quat,p);
MathExtra::matvec(p,bonus[tri[j]].c1,dc1);
MathExtra::matvec(p,bonus[tri[j]].c2,dc2);
MathExtra::matvec(p,bonus[tri[j]].c3,dc3);
dfirst[j] = ndiscrete;
discretize(j,sigma[jtype][jtype],dc1,dc2,dc3);
dnum[j] = ndiscrete - dfirst[j];
}
npj = dnum[j];
jfirst = dfirst[j];
for (nj = 0; nj < npj; nj++) {
dxj = discrete[jfirst+nj].dx;
dyj = discrete[jfirst+nj].dy;
dzj = discrete[jfirst+nj].dz;
xi[0] = x[i][0];
xi[1] = x[i][1];
xi[2] = x[i][2];
xj[0] = x[j][0] + dxj;
xj[1] = x[j][1] + dyj;
xj[2] = x[j][2] + dzj;
delx = xi[0] - xj[0];
dely = xi[1] - xj[1];
delz = xi[2] - xj[2];
rsq = delx*delx + dely*dely + delz*delz;
sig = 0.5 * (sigma[itype][itype]+discrete[jfirst+nj].sigma);
sig3 = sig*sig*sig;
term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
term1 = 2.0 * term2 * sig3*sig3;
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (term1*r6inv - term2);
fpair = forcelj*r2inv;
if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
fi[0] = delx*fpair;
fi[1] = dely*fpair;
fi[2] = delz*fpair;
f[i][0] += fi[0];
f[i][1] += fi[1];
f[i][2] += fi[2];
if (newton_pair || j < nlocal) {
fj[0] = -delx*fpair;
fj[1] = -dely*fpair;
fj[2] = -delz*fpair;
f[j][0] += fj[0];
f[j][1] += fj[1];
f[j][2] += fj[2];
tj[0] = dyj*fj[2] - dzj*fj[1];
tj[1] = dzj*fj[0] - dxj*fj[2];
tj[2] = dxj*fj[1] - dyj*fj[0];
torque[j][0] += tj[0];
torque[j][1] += tj[1];
torque[j][2] += tj[2];
}
}
// particle/particle interaction = 1x1 particles
} else {
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
fpair = forcelj*r2inv;
if (eflag)
evdwl += r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
if (newton_pair || j < nlocal) {
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
}
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairTriLJ::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(epsilon,n+1,n+1,"pair:epsilon");
memory->create(sigma,n+1,n+1,"pair:sigma");
memory->create(lj1,n+1,n+1,"pair:lj1");
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairTriLJ::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = force->numeric(FLERR,arg[0]);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i+1; j <= atom->ntypes; j++)
if (setflag[i][j]) cut[i][j] = cut_global;
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairTriLJ::coeff(int narg, char **arg)
{
if (narg < 4 || narg > 5)
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = force->numeric(FLERR,arg[2]);
double sigma_one = force->numeric(FLERR,arg[3]);
double cut_one = cut_global;
if (narg == 5) cut_one = force->numeric(FLERR,arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
epsilon[i][j] = epsilon_one;
sigma[i][j] = sigma_one;
cut[i][j] = cut_one;
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairTriLJ::init_style()
{
avec = (AtomVecTri *) atom->style_match("tri");
if (!avec) error->all(FLERR,"Pair tri/lj requires atom style tri");
neighbor->request(this,instance_me);
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairTriLJ::init_one(int i, int j)
{
if (setflag[i][j] == 0) {
epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
sigma[i][i],sigma[j][j]);
sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
}
lj1[i][j] = 48.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
lj2[i][j] = 24.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
epsilon[j][i] = epsilon[i][j];
sigma[j][i] = sigma[i][j];
lj1[j][i] = lj1[i][j];
lj2[j][i] = lj2[i][j];
lj3[j][i] = lj3[i][j];
lj4[j][i] = lj4[i][j];
return cut[i][j];
}
/* ----------------------------------------------------------------------
recursively discretize triangle I with displaced corners c1,c2,c3
into N sub-tris no more than sigma in size
recurse by making 2 tris via bisecting longest side
store new discrete particles in Discrete list
------------------------------------------------------------------------- */
void PairTriLJ::discretize(int i, double sigma,
- double *c1, double *c2, double *c3)
+ double *c1, double *c2, double *c3)
{
double centroid[3],dc1[3],dc2[3],dc3[3];
centroid[0] = (c1[0] + c2[0] + c3[0]) / 3.0;
centroid[1] = (c1[1] + c2[1] + c3[1]) / 3.0;
centroid[2] = (c1[2] + c2[2] + c3[2]) / 3.0;
MathExtra::sub3(c1,centroid,dc1);
MathExtra::sub3(c2,centroid,dc2);
MathExtra::sub3(c3,centroid,dc3);
double sigmasq = 0.25 * sigma*sigma;
double len1sq = MathExtra::lensq3(dc1);
double len2sq = MathExtra::lensq3(dc2);
double len3sq = MathExtra::lensq3(dc3);
// if sigma sphere overlaps all corner points, add particle at centroid
if ((len1sq <= sigmasq) && (len2sq <= sigmasq) && (len3sq <= sigmasq)) {
if (ndiscrete == dmax) {
dmax += DELTA;
discrete = (Discrete *)
memory->srealloc(discrete,dmax*sizeof(Discrete),"pair:discrete");
}
discrete[ndiscrete].dx = centroid[0];
discrete[ndiscrete].dy = centroid[1];
discrete[ndiscrete].dz = centroid[2];
sigmasq = MAX(len1sq,len2sq);
sigmasq = MAX(sigmasq,len3sq);
discrete[ndiscrete].sigma = 2.0 * sqrt(sigmasq);
ndiscrete++;
return;
}
// else break triangle into 2 sub-triangles and recurse
double c12[3],c23[3],c13[3],mid[3];
MathExtra::sub3(c2,c3,c23);
len1sq = MathExtra::lensq3(c23);
MathExtra::sub3(c1,c3,c13);
len2sq = MathExtra::lensq3(c13);
MathExtra::sub3(c1,c2,c12);
len3sq = MathExtra::lensq3(c12);
double maxsq = MAX(len1sq,len2sq);
maxsq = MAX(maxsq,len3sq);
if (len1sq == maxsq) {
MathExtra::add3(c2,c3,mid);
MathExtra::scale3(0.5,mid);
discretize(i,sigma,c1,c2,mid);
discretize(i,sigma,c1,c3,mid);
} else if (len2sq == maxsq) {
MathExtra::add3(c1,c3,mid);
MathExtra::scale3(0.5,mid);
discretize(i,sigma,c2,c1,mid);
discretize(i,sigma,c2,c3,mid);
} else {
MathExtra::add3(c1,c2,mid);
MathExtra::scale3(0.5,mid);
discretize(i,sigma,c3,c1,mid);
discretize(i,sigma,c3,c2,mid);
}
}
/* ----------------------------------------------------------------------
recursively discretize triangle I with displaced corners c1,c2,c3
into N sub-tris no more than sigma in size
recurse by making 6 tris via centroid
store new discrete particles in Discrete list
------------------------------------------------------------------------- */
/*
void PairTriLJ::discretize(int i, double sigma,
double *c1, double *c2, double *c3)
{
double centroid[3],dc1[3],dc2[3],dc3[3];
centroid[0] = (c1[0] + c2[0] + c3[0]) / 3.0;
centroid[1] = (c1[1] + c2[1] + c3[1]) / 3.0;
centroid[2] = (c1[2] + c2[2] + c3[2]) / 3.0;
MathExtra::sub3(c1,centroid,dc1);
MathExtra::sub3(c2,centroid,dc2);
MathExtra::sub3(c3,centroid,dc3);
double sigmasq = 0.25 * sigma*sigma;
double len1sq = MathExtra::lensq3(dc1);
double len2sq = MathExtra::lensq3(dc2);
double len3sq = MathExtra::lensq3(dc3);
// if sigma sphere overlaps all corner points, add particle at centroid
if (len1sq <= sigmasq && len2sq <= sigmasq & len3sq <= sigmasq) {
if (ndiscrete == dmax) {
dmax += DELTA;
discrete = (Discrete *)
memory->srealloc(discrete,dmax*sizeof(Discrete),"pair:discrete");
}
discrete[ndiscrete].dx = centroid[0];
discrete[ndiscrete].dy = centroid[1];
discrete[ndiscrete].dz = centroid[2];
sigmasq = MAX(len1sq,len2sq);
sigmasq = MAX(sigmasq,len3sq);
discrete[ndiscrete].sigma = 2.0 * sqrt(sigmasq);
ndiscrete++;
return;
}
// else break triangle into 6 sub-triangles and recurse
double c1c2mid[3],c2c3mid[3],c1c3mid[3];
MathExtra::add3(c1,c2,c1c2mid);
MathExtra::scale3(0.5,c1c2mid);
MathExtra::add3(c2,c3,c2c3mid);
MathExtra::scale3(0.5,c2c3mid);
MathExtra::add3(c1,c3,c1c3mid);
MathExtra::scale3(0.5,c1c3mid);
discretize(i,sigma,c1,c1c2mid,centroid);
discretize(i,sigma,c1,c1c3mid,centroid);
discretize(i,sigma,c2,c2c3mid,centroid);
discretize(i,sigma,c2,c1c2mid,centroid);
discretize(i,sigma,c3,c1c3mid,centroid);
discretize(i,sigma,c3,c2c3mid,centroid);
}
*/
diff --git a/src/BODY/body_nparticle.cpp b/src/BODY/body_nparticle.cpp
index e71943569..0e1afd51f 100644
--- a/src/BODY/body_nparticle.cpp
+++ b/src/BODY/body_nparticle.cpp
@@ -1,257 +1,285 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <stdlib.h>
#include "body_nparticle.h"
#include "math_extra.h"
#include "atom_vec_body.h"
#include "atom.h"
#include "force.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define EPSILON 1.0e-7
enum{SPHERE,LINE}; // also in DumpImage
/* ---------------------------------------------------------------------- */
BodyNparticle::BodyNparticle(LAMMPS *lmp, int narg, char **arg) :
Body(lmp, narg, arg)
{
if (narg != 3) error->all(FLERR,"Invalid body nparticle command");
int nmin = force->inumeric(FLERR,arg[1]);
int nmax = force->inumeric(FLERR,arg[2]);
if (nmin <= 0 || nmin > nmax)
error->all(FLERR,"Invalid body nparticle command");
size_forward = 0;
size_border = 1 + 3*nmax;
// NOTE: need to set appropriate nnbin param for dcp
icp = new MyPoolChunk<int>(1,1);
dcp = new MyPoolChunk<double>(3*nmin,3*nmax);
memory->create(imflag,nmax,"body/nparticle:imflag");
memory->create(imdata,nmax,4,"body/nparticle:imdata");
}
/* ---------------------------------------------------------------------- */
BodyNparticle::~BodyNparticle()
{
delete icp;
delete dcp;
memory->destroy(imflag);
memory->destroy(imdata);
}
/* ---------------------------------------------------------------------- */
int BodyNparticle::nsub(AtomVecBody::Bonus *bonus)
{
return bonus->ivalue[0];
}
/* ---------------------------------------------------------------------- */
double *BodyNparticle::coords(AtomVecBody::Bonus *bonus)
{
return bonus->dvalue;
}
/* ---------------------------------------------------------------------- */
int BodyNparticle::pack_border_body(AtomVecBody::Bonus *bonus, double *buf)
{
int nsub = bonus->ivalue[0];
buf[0] = nsub;
memcpy(&buf[1],bonus->dvalue,3*nsub*sizeof(double));
return 1+3*nsub;
}
/* ---------------------------------------------------------------------- */
int BodyNparticle::unpack_border_body(AtomVecBody::Bonus *bonus, double *buf)
{
int nsub = static_cast<int> (buf[0]);
bonus->ivalue[0] = nsub;
memcpy(bonus->dvalue,&buf[1],3*nsub*sizeof(double));
return 1+3*nsub;
}
/* ----------------------------------------------------------------------
populate bonus data structure with data file values
------------------------------------------------------------------------- */
void BodyNparticle::data_body(int ibonus, int ninteger, int ndouble,
- char **ifile, char **dfile)
+ int *ifile, double *dfile)
{
AtomVecBody::Bonus *bonus = &avec->bonus[ibonus];
- // error in data file if any values are NULL
-
- for (int i = 0; i < ninteger; i++)
- if (ifile[i] == NULL)
- error->one(FLERR,"Invalid format in Bodies section of data file");
- for (int i = 0; i < ndouble; i++)
- if (dfile[i] == NULL)
- error->one(FLERR,"Invalid format in Bodies section of data file");
-
// set ninteger, ndouble in bonus and allocate 2 vectors of ints, doubles
if (ninteger != 1)
error->one(FLERR,"Incorrect # of integer values in "
"Bodies section of data file");
- int nsub = atoi(ifile[0]);
+ int nsub = ifile[0];
if (nsub < 1)
error->one(FLERR,"Incorrect integer value in "
"Bodies section of data file");
if (ndouble != 6 + 3*nsub)
error->one(FLERR,"Incorrect # of floating-point values in "
"Bodies section of data file");
bonus->ninteger = 1;
bonus->ivalue = icp->get(bonus->iindex);
bonus->ivalue[0] = nsub;
bonus->ndouble = 3*nsub;
bonus->dvalue = dcp->get(bonus->ndouble,bonus->dindex);
// diagonalize inertia tensor
double tensor[3][3];
- tensor[0][0] = atof(dfile[0]);
- tensor[1][1] = atof(dfile[1]);
- tensor[2][2] = atof(dfile[2]);
- tensor[0][1] = tensor[1][0] = atof(dfile[3]);
- tensor[0][2] = tensor[2][0] = atof(dfile[4]);
- tensor[1][2] = tensor[2][1] = atof(dfile[5]);
+ tensor[0][0] = dfile[0];
+ tensor[1][1] = dfile[1];
+ tensor[2][2] = dfile[2];
+ tensor[0][1] = tensor[1][0] = dfile[3];
+ tensor[0][2] = tensor[2][0] = dfile[4];
+ tensor[1][2] = tensor[2][1] = dfile[5];
double *inertia = bonus->inertia;
double evectors[3][3];
int ierror = MathExtra::jacobi(tensor,inertia,evectors);
if (ierror) error->one(FLERR,
"Insufficient Jacobi rotations for body nparticle");
// if any principal moment < scaled EPSILON, set to 0.0
double max;
max = MAX(inertia[0],inertia[1]);
max = MAX(max,inertia[2]);
if (inertia[0] < EPSILON*max) inertia[0] = 0.0;
if (inertia[1] < EPSILON*max) inertia[1] = 0.0;
if (inertia[2] < EPSILON*max) inertia[2] = 0.0;
// exyz_space = principal axes in space frame
double ex_space[3],ey_space[3],ez_space[3];
ex_space[0] = evectors[0][0];
ex_space[1] = evectors[1][0];
ex_space[2] = evectors[2][0];
ey_space[0] = evectors[0][1];
ey_space[1] = evectors[1][1];
ey_space[2] = evectors[2][1];
ez_space[0] = evectors[0][2];
ez_space[1] = evectors[1][2];
ez_space[2] = evectors[2][2];
// enforce 3 evectors as a right-handed coordinate system
// flip 3rd vector if needed
double cross[3];
MathExtra::cross3(ex_space,ey_space,cross);
if (MathExtra::dot3(cross,ez_space) < 0.0) MathExtra::negate3(ez_space);
// create initial quaternion
MathExtra::exyz_to_q(ex_space,ey_space,ez_space,bonus->quat);
// bonus->dvalue = sub-particle displacements in body frame
double delta[3];
int j = 6;
int k = 0;
for (int i = 0; i < nsub; i++) {
- delta[0] = atof(dfile[j]);
- delta[1] = atof(dfile[j+1]);
- delta[2] = atof(dfile[j+2]);
+ delta[0] = dfile[j];
+ delta[1] = dfile[j+1];
+ delta[2] = dfile[j+2];
MathExtra::transpose_matvec(ex_space,ey_space,ez_space,
delta,&bonus->dvalue[k]);
j += 3;
k += 3;
}
}
+/* ----------------------------------------------------------------------
+ return radius of body particle defined by ifile/dfile params
+ params are ordered as in data file
+ called by Molecule class which needs single body size
+------------------------------------------------------------------------- */
+
+double BodyNparticle::radius_body(int ninteger, int ndouble,
+ int *ifile, double *dfile)
+{
+ int nsub = ifile[0];
+ if (nsub < 1)
+ error->one(FLERR,"Incorrect integer value in "
+ "Bodies section of data file");
+ if (ndouble != 6 + 3*nsub)
+ error->one(FLERR,"Incorrect # of floating-point values in "
+ "Bodies section of data file");
+
+ // sub-particle coords are relative to body center at (0,0,0)
+ // offset = 6 for sub-particle coords
+
+ double onerad;
+ double maxrad = 0.0;
+ double delta[3];
+
+ int offset = 6;
+ for (int i = 0; i < nsub; i++) {
+ delta[0] = dfile[offset];
+ delta[1] = dfile[offset+1];
+ delta[2] = dfile[offset+2];
+ offset += 3;
+ onerad = MathExtra::len3(delta);
+ maxrad = MAX(maxrad,onerad);
+ }
+
+ return maxrad;
+}
+
/* ---------------------------------------------------------------------- */
int BodyNparticle::noutcol()
{
return 3;
}
/* ---------------------------------------------------------------------- */
int BodyNparticle::noutrow(int ibonus)
{
return avec->bonus[ibonus].ivalue[0];
}
/* ---------------------------------------------------------------------- */
void BodyNparticle::output(int ibonus, int m, double *values)
{
AtomVecBody::Bonus *bonus = &avec->bonus[ibonus];
double p[3][3];
MathExtra::quat_to_mat(bonus->quat,p);
MathExtra::matvec(p,&bonus->dvalue[3*m],values);
double *x = atom->x[bonus->ilocal];
values[0] += x[0];
values[1] += x[1];
values[2] += x[2];
}
/* ---------------------------------------------------------------------- */
int BodyNparticle::image(int ibonus, double flag1, double flag2,
int *&ivec, double **&darray)
{
double p[3][3];
double *x;
AtomVecBody::Bonus *bonus = &avec->bonus[ibonus];
int n = bonus->ivalue[0];
for (int i = 0; i < n; i++) {
imflag[i] = SPHERE;
MathExtra::quat_to_mat(bonus->quat,p);
MathExtra::matvec(p,&bonus->dvalue[3*i],imdata[i]);
x = atom->x[bonus->ilocal];
imdata[i][0] += x[0];
imdata[i][1] += x[1];
imdata[i][2] += x[2];
imdata[i][3] = flag1;
}
ivec = imflag;
darray = imdata;
return n;
}
diff --git a/src/BODY/body_nparticle.h b/src/BODY/body_nparticle.h
index 1e7e082a4..8d6fb27bf 100644
--- a/src/BODY/body_nparticle.h
+++ b/src/BODY/body_nparticle.h
@@ -1,82 +1,83 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef BODY_CLASS
BodyStyle(nparticle,BodyNparticle)
#else
#ifndef LMP_BODY_NPARTICLE_H
#define LMP_BODY_NPARTICLE_H
#include "body.h"
#include "atom_vec_body.h"
namespace LAMMPS_NS {
class BodyNparticle : public Body {
public:
BodyNparticle(class LAMMPS *, int, char **);
~BodyNparticle();
int nsub(struct AtomVecBody::Bonus *);
double *coords(struct AtomVecBody::Bonus *);
int pack_border_body(struct AtomVecBody::Bonus *, double *);
int unpack_border_body(struct AtomVecBody::Bonus *, double *);
- void data_body(int, int, int, char **, char **);
+ void data_body(int, int, int, int *, double *);
+ double radius_body(int, int, int *, double *);
int noutrow(int);
int noutcol();
void output(int, int, double *);
int image(int, double, double, int *&, double **&);
private:
int *imflag;
double **imdata;
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Invalid body nparticle command
Arguments in atom-style command are not correct.
E: Invalid format in Bodies section of data file
The specified number of integer or floating point values does not
appear.
E: Incorrect # of integer values in Bodies section of data file
See doc page for body style.
E: Incorrect integer value in Bodies section of data file
See doc page for body style.
E: Incorrect # of floating-point values in Bodies section of data file
See doc page for body style.
E: Insufficient Jacobi rotations for body nparticle
Eigensolve for rigid body was not sufficiently accurate.
*/
diff --git a/src/CORESHELL/compute_temp_cs.cpp b/src/CORESHELL/compute_temp_cs.cpp
index 43bf7b8e5..b10a9256b 100644
--- a/src/CORESHELL/compute_temp_cs.cpp
+++ b/src/CORESHELL/compute_temp_cs.cpp
@@ -1,489 +1,490 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Hendrik Heenen (Technical University of Munich)
(hendrik.heenen at mytum.com)
------------------------------------------------------------------------- */
#include <mpi.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "compute_temp_cs.h"
#include "atom.h"
#include "atom_vec.h"
#include "domain.h"
#include "update.h"
#include "force.h"
#include "group.h"
#include "modify.h"
#include "fix.h"
#include "fix_store.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeTempCS::ComputeTempCS(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg != 5) error->all(FLERR,"Illegal compute temp/cs command");
if (atom->avec->bonds_allow == 0)
error->all(FLERR,"Compute temp/cs used when bonds are not allowed");
scalar_flag = vector_flag = 1;
size_vector = 6;
extscalar = 0;
extvector = 1;
tempflag = 1;
tempbias = 1;
extarray = 0;
// find and define groupbits for core and shell groups
cgroup = group->find(arg[3]);
if (cgroup == -1)
error->all(FLERR,"Cannot find specified group ID for core particles");
groupbit_c = group->bitmask[cgroup];
sgroup = group->find(arg[4]);
if (sgroup == -1)
error->all(FLERR,"Cannot find specified group ID for shell particles");
groupbit_s = group->bitmask[sgroup];
// create a new fix STORE style
// id = compute-ID + COMPUTE_STORE, fix group = compute group
int n = strlen(id) + strlen("_COMPUTE_STORE") + 1;
id_fix = new char[n];
strcpy(id_fix,id);
strcat(id_fix,"_COMPUTE_STORE");
- char **newarg = new char*[5];
+ char **newarg = new char*[6];
newarg[0] = id_fix;
newarg[1] = group->names[igroup];
newarg[2] = (char *) "STORE";
- newarg[3] = (char *) "0";
- newarg[4] = (char *) "1";
- modify->add_fix(5,newarg);
+ newarg[3] = (char *) "peratom";
+ newarg[4] = (char *) "0";
+ newarg[5] = (char *) "1";
+ modify->add_fix(6,newarg);
fix = (FixStore *) modify->fix[modify->nfix-1];
delete [] newarg;
// set fix store values = 0 for now
// fill them in via setup() once Comm::borders() has been called
// skip if resetting from restart file
if (fix->restart_reset) {
fix->restart_reset = 0;
firstflag = 0;
} else {
double *partner = fix->vstore;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) partner[i] = ubuf(0).d;
firstflag = 1;
}
// allocate memory
vector = new double[6];
maxatom = 0;
vint = NULL;
// set comm size needed by this Compute
comm_reverse = 1;
}
/* ---------------------------------------------------------------------- */
ComputeTempCS::~ComputeTempCS()
{
// check nfix in case all fixes have already been deleted
if (modify->nfix) modify->delete_fix(id_fix);
delete [] id_fix;
delete [] vector;
memory->destroy(vint);
}
/* ---------------------------------------------------------------------- */
void ComputeTempCS::init()
{
if (comm->ghost_velocity == 0)
error->all(FLERR,"Compute temp/cs requires ghost atoms store velocity");
}
/* ---------------------------------------------------------------------- */
void ComputeTempCS::setup()
{
if (firstflag) {
firstflag = 0;
// insure # of core atoms = # of shell atoms
int ncores = group->count(cgroup);
nshells = group->count(sgroup);
if (ncores != nshells)
error->all(FLERR,"Number of core atoms != number of shell atoms");
// for each C/S pair:
// set partner IDs of both atoms if this atom stores bond between them
// will set partner IDs for ghost atoms if needed by another proc
// nall loop insures all ghost atom partner IDs are set before reverse comm
int *num_bond = atom->num_bond;
tagint **bond_atom = atom->bond_atom;
tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double *partner = fix->vstore;
tagint partnerID;
int nall = nlocal + atom->nghost;
for (int i = nlocal; i < nall; i++) partner[i] = ubuf(0).d;
int i,j,m,match;
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit_c || mask[i] & groupbit_s) {
for (m = 0; m < num_bond[i]; m++) {
partnerID = bond_atom[i][m];
j = atom->map(partnerID);
if (j == -1) error->one(FLERR,"Core/shell partner atom not found");
match = 0;
if (mask[i] & groupbit_c && mask[j] & groupbit_s) match = 1;
if (mask[i] & groupbit_s && mask[j] & groupbit_c) match = 1;
if (match) {
partner[i] = ubuf(partnerID).d;
partner[j] = ubuf(tag[i]).d;
}
}
}
}
// reverse comm to acquire unknown partner IDs from ghost atoms
// only needed if newton_bond = on
if (force->newton_bond) comm->reverse_comm_compute(this);
// check that all C/S partners were found
int flag = 0;
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit_c || mask[i] & groupbit_s) {
partnerID = (tagint) ubuf(partner[i]).i;
if (partnerID == 0) flag = 1;
}
}
int flagall;
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
if (flagall) error->all(FLERR,"Core/shell partners were not all found");
}
// calculate DOF for temperature
dof_compute();
}
/* ---------------------------------------------------------------------- */
void ComputeTempCS::dof_compute()
{
adjust_dof_fix();
int nper = domain->dimension;
natoms_temp = group->count(igroup);
dof = nper * natoms_temp;
dof -= nper * nshells;
dof -= extra_dof + fix_dof;
if (dof > 0) tfactor = force->mvv2e / (dof * force->boltz);
else tfactor = 0.0;
}
/* ---------------------------------------------------------------------- */
double ComputeTempCS::compute_scalar()
{
double vthermal[3];
invoked_scalar = update->ntimestep;
vcm_pairs();
// calculate thermal scalar in respect to atom velocities as center-of-mass
// velocities of its according core/shell pairs
double **v = atom->v;
int *mask = atom->mask;
int *type = atom->type;
double *mass = atom->mass;
double *rmass = atom->rmass;
int nlocal = atom->nlocal;
double t = 0.0;
for (int i = 0; i < nlocal; i++){
if (mask[i] & groupbit) {
vthermal[0] = v[i][0] - vint[i][0];
vthermal[1] = v[i][1] - vint[i][1];
vthermal[2] = v[i][2] - vint[i][2];
if (rmass)
t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
vthermal[2]*vthermal[2]) * rmass[i];
else
t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
vthermal[2]*vthermal[2]) * mass[type[i]];
}
}
MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
if (dynamic) dof_compute();
if (dof < 0.0 && natoms_temp > 0.0)
error->all(FLERR,"Temperature compute degrees of freedom < 0");
scalar *= tfactor;
return scalar;
}
/* ---------------------------------------------------------------------- */
void ComputeTempCS::compute_vector()
{
invoked_vector = update->ntimestep;
double **v = atom->v;
int *mask = atom->mask;
int *type = atom->type;
double *mass = atom->mass;
double *rmass = atom->rmass;
int nlocal = atom->nlocal;
double massone;
double t[6];
for (int i = 0; i < 6; i++) t[i] = 0.0;
for (int i = 0; i < nlocal; i++){
if (mask[i] & groupbit) {
if (rmass) massone = rmass[i];
else massone = mass[type[i]];
t[0] += massone * v[i][0]*v[i][0];
t[1] += massone * v[i][1]*v[i][1];
t[2] += massone * v[i][2]*v[i][2];
t[3] += massone * v[i][0]*v[i][1];
t[4] += massone * v[i][0]*v[i][2];
t[5] += massone * v[i][1]*v[i][2];
}
}
MPI_Allreduce(t,vector,6,MPI_DOUBLE,MPI_SUM,world);
for (int i = 0; i < 6; i++) vector[i] *= force->mvv2e;
}
/* ---------------------------------------------------------------------- */
void ComputeTempCS::vcm_pairs()
{
int i,j;
double massone,masstwo;
double vcm[3];
// reallocate vint if necessary
int nlocal = atom->nlocal;
if (nlocal > maxatom) {
memory->destroy(vint);
maxatom = atom->nmax;
memory->create(vint,maxatom,3,"temp/cs:vint");
}
// vcm = COM velocity of each CS pair
// vint = internal velocity of each C/S atom, used as bias
double **v = atom->v;
int *mask = atom->mask;
int *type = atom->type;
double *mass = atom->mass;
double *rmass = atom->rmass;
double *partner = fix->vstore;
tagint partnerID;
for (i = 0; i < nlocal; i++) {
if ((mask[i] & groupbit) &&
(mask[i] & groupbit_c || mask[i] & groupbit_s)) {
if (rmass) massone = rmass[i];
else massone = mass[type[i]];
vcm[0] = v[i][0]*massone;
vcm[1] = v[i][1]*massone;
vcm[2] = v[i][2]*massone;
partnerID = (tagint) ubuf(partner[i]).i;
j = atom->map(partnerID);
if (j == -1) error->one(FLERR,"Core/shell partner atom not found");
if (rmass) masstwo = rmass[j];
else masstwo = mass[type[j]];
vcm[0] += v[j][0]*masstwo;
vcm[1] += v[j][1]*masstwo;
vcm[2] += v[j][2]*masstwo;
vcm[0] /= (massone + masstwo);
vcm[1] /= (massone + masstwo);
vcm[2] /= (massone + masstwo);
vint[i][0] = v[i][0] - vcm[0];
vint[i][1] = v[i][1] - vcm[1];
vint[i][2] = v[i][2] - vcm[2];
} else vint[i][0] = vint[i][1] = vint[i][2] = 0.0;
}
}
/* ----------------------------------------------------------------------
remove velocity bias from atom I to leave thermal velocity
thermal velocity in this case is COM velocity of C/S pair
------------------------------------------------------------------------- */
void ComputeTempCS::remove_bias(int i, double *v)
{
v[0] -= vint[i][0];
v[1] -= vint[i][1];
v[2] -= vint[i][2];
}
/* ----------------------------------------------------------------------
remove velocity bias from all atoms to leave thermal velocity
thermal velocity in this case is COM velocity of C/S pair
------------------------------------------------------------------------- */
void ComputeTempCS::remove_bias_all()
{
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
v[i][0] -= vint[i][0];
v[i][1] -= vint[i][1];
v[i][2] -= vint[i][2];
}
}
/* ----------------------------------------------------------------------
reset thermal velocity of all atoms to be consistent with bias
called from velocity command after it creates thermal velocities
this resets each atom's velocity to COM velocity of C/S pair
------------------------------------------------------------------------- */
void ComputeTempCS::reapply_bias_all()
{
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
// recalculate current COM velocities
vcm_pairs();
// zero vint after using ti so that Velocity call to restore_bias_all()
// will not further alter the velocities within a C/S pair
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
v[i][0] -= vint[i][0];
v[i][1] -= vint[i][1];
v[i][2] -= vint[i][2];
vint[i][0] = 0.0;
vint[i][1] = 0.0;
vint[i][2] = 0.0;
}
}
/* ----------------------------------------------------------------------
add back in velocity bias to atom I removed by remove_bias()
assume remove_bias() was previously called
------------------------------------------------------------------------- */
void ComputeTempCS::restore_bias(int i, double *v)
{
v[0] += vint[i][0];
v[1] += vint[i][1];
v[2] += vint[i][2];
}
/* ----------------------------------------------------------------------
add back in velocity bias to all atoms removed by remove_bias_all()
assume remove_bias_all() was previously called
------------------------------------------------------------------------- */
void ComputeTempCS::restore_bias_all()
{
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
v[i][0] += vint[i][0];
v[i][1] += vint[i][1];
v[i][2] += vint[i][2];
}
}
/* ---------------------------------------------------------------------- */
int ComputeTempCS::pack_reverse_comm(int n, int first, double *buf)
{
int i,m,last;
double *partner = fix->vstore;
m = 0;
last = first + n;
for (i = first; i < last; i++) buf[m++] = partner[i];
return m;
}
/* ---------------------------------------------------------------------- */
void ComputeTempCS::unpack_reverse_comm(int n, int *list, double *buf)
{
int i,j,m;
double *partner = fix->vstore;
tagint partnerID;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
partnerID = (tagint) ubuf(buf[m++]).i;
if (partnerID) partner[j] = ubuf(partnerID).d;
}
}
/* ----------------------------------------------------------------------
memory usage of local data
------------------------------------------------------------------------- */
double ComputeTempCS::memory_usage()
{
double bytes = (bigint) maxatom * 3 * sizeof(double);
return bytes;
}
diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp
index 8086a68d4..3e1ea6b89 100644
--- a/src/GRANULAR/fix_pour.cpp
+++ b/src/GRANULAR/fix_pour.cpp
@@ -1,1035 +1,1047 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "fix_pour.h"
#include "atom.h"
#include "atom_vec.h"
#include "force.h"
#include "update.h"
#include "comm.h"
#include "molecule.h"
#include "modify.h"
#include "fix_gravity.h"
#include "domain.h"
#include "region.h"
#include "region_block.h"
#include "region_cylinder.h"
#include "random_park.h"
#include "math_extra.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
using namespace MathConst;
enum{ATOM,MOLECULE};
enum{ONE,RANGE,POLY};
enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files
#define EPSILON 0.001
/* ---------------------------------------------------------------------- */
FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 6) error->all(FLERR,"Illegal fix pour command");
time_depend = 1;
if (!atom->radius_flag || !atom->rmass_flag)
error->all(FLERR,"Fix pour requires atom attributes radius, rmass");
// required args
ninsert = force->inumeric(FLERR,arg[3]);
ntype = force->inumeric(FLERR,arg[4]);
seed = force->inumeric(FLERR,arg[5]);
if (seed <= 0) error->all(FLERR,"Illegal fix pour command");
// read options from end of input line
options(narg-6,&arg[6]);
// error check on type
if (mode == ATOM && (ntype <= 0 || ntype > atom->ntypes))
error->all(FLERR,"Invalid atom type in fix pour command");
// error checks on region and its extent being inside simulation box
if (iregion == -1) error->all(FLERR,"Must specify a region in fix pour");
if (domain->regions[iregion]->bboxflag == 0)
error->all(FLERR,"Fix pour region does not support a bounding box");
if (domain->regions[iregion]->dynamic_check())
error->all(FLERR,"Fix pour region cannot be dynamic");
if (strcmp(domain->regions[iregion]->style,"block") == 0) {
region_style = 1;
xlo = ((RegBlock *) domain->regions[iregion])->xlo;
xhi = ((RegBlock *) domain->regions[iregion])->xhi;
ylo = ((RegBlock *) domain->regions[iregion])->ylo;
yhi = ((RegBlock *) domain->regions[iregion])->yhi;
zlo = ((RegBlock *) domain->regions[iregion])->zlo;
zhi = ((RegBlock *) domain->regions[iregion])->zhi;
if (xlo < domain->boxlo[0] || xhi > domain->boxhi[0] ||
ylo < domain->boxlo[1] || yhi > domain->boxhi[1] ||
zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
error->all(FLERR,"Insertion region extends outside simulation box");
} else if (strcmp(domain->regions[iregion]->style,"cylinder") == 0) {
region_style = 2;
char axis = ((RegCylinder *) domain->regions[iregion])->axis;
xc = ((RegCylinder *) domain->regions[iregion])->c1;
yc = ((RegCylinder *) domain->regions[iregion])->c2;
rc = ((RegCylinder *) domain->regions[iregion])->radius;
zlo = ((RegCylinder *) domain->regions[iregion])->lo;
zhi = ((RegCylinder *) domain->regions[iregion])->hi;
if (axis != 'z')
error->all(FLERR,"Must use a z-axis cylinder region with fix pour");
if (xc-rc < domain->boxlo[0] || xc+rc > domain->boxhi[0] ||
yc-rc < domain->boxlo[1] || yc+rc > domain->boxhi[1] ||
zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
error->all(FLERR,"Insertion region extends outside simulation box");
} else error->all(FLERR,"Must use a block or cylinder region with fix pour");
if (region_style == 2 && domain->dimension == 2)
error->all(FLERR,
"Must use a block region with fix pour for 2d simulations");
// error check and further setup for mode = MOLECULE
if (atom->tag_enable == 0)
error->all(FLERR,"Cannot use fix_pour unless atoms have IDs");
if (mode == MOLECULE) {
for (int i = 0; i < nmol; i++) {
if (onemols[i]->xflag == 0)
error->all(FLERR,"Fix pour molecule must have coordinates");
if (onemols[i]->typeflag == 0)
error->all(FLERR,"Fix pour molecule must have atom types");
if (ntype+onemols[i]->ntypes <= 0 ||
ntype+onemols[i]->ntypes > atom->ntypes)
error->all(FLERR,"Invalid atom type in fix pour mol command");
if (atom->molecular == 2 && onemols != atom->avec->onemols)
error->all(FLERR,"Fix pour molecule template ID must be same "
"as atom style template ID");
onemols[i]->check_attributes(0);
// fix pour uses geoemetric center of molecule for insertion
onemols[i]->compute_center();
}
}
if (rigidflag && mode == ATOM)
error->all(FLERR,"Cannot use fix pour rigid and not molecule");
if (shakeflag && mode == ATOM)
error->all(FLERR,"Cannot use fix pour shake and not molecule");
if (rigidflag && shakeflag)
error->all(FLERR,"Cannot use fix pour rigid and shake");
// setup of coords and imageflags array
if (mode == ATOM) natom_max = 1;
else {
natom_max = 0;
for (int i = 0; i < nmol; i++)
natom_max = MAX(natom_max,onemols[i]->natoms);
}
memory->create(coords,natom_max,4,"pour:coords");
memory->create(imageflags,natom_max,"pour:imageflags");
// find current max atom and molecule IDs if necessary
if (idnext) find_maxid();
// random number generator, same for all procs
random = new RanPark(lmp,seed);
// allgather arrays
MPI_Comm_rank(world,&me);
MPI_Comm_size(world,&nprocs);
recvcounts = new int[nprocs];
displs = new int[nprocs];
// grav = gravity in distance/time^2 units
// assume grav = -magnitude at this point, enforce in init()
int ifix;
for (ifix = 0; ifix < modify->nfix; ifix++) {
if (strcmp(modify->fix[ifix]->style,"gravity") == 0) break;
if (strcmp(modify->fix[ifix]->style,"gravity/omp") == 0) break;
}
if (ifix == modify->nfix)
error->all(FLERR,"No fix gravity defined for fix pour");
grav = - ((FixGravity *) modify->fix[ifix])->magnitude * force->ftm2v;
// nfreq = timesteps between insertions
// should be time for a particle to fall from top of insertion region
// to bottom, taking into account that the region may be moving
// set these 2 eqs equal to each other, solve for smallest positive t
// x = zhi + vz*t + 1/2 grav t^2
// x = zlo + rate*t
// gives t = [-(vz-rate) - sqrt((vz-rate)^2 - 2*grav*(zhi-zlo))] / grav
// where zhi-zlo > 0, grav < 0, and vz & rate can be either > 0 or < 0
double v_relative,delta;
if (domain->dimension == 3) {
v_relative = vz - rate;
delta = zhi - zlo;
} else {
v_relative = vy - rate;
delta = yhi - ylo;
}
double t =
(-v_relative - sqrt(v_relative*v_relative - 2.0*grav*delta)) / grav;
nfreq = static_cast<int> (t/update->dt + 0.5);
// 1st insertion on next timestep
force_reneighbor = 1;
next_reneighbor = update->ntimestep + 1;
nfirst = next_reneighbor;
ninserted = 0;
// nper = # to insert each time
// depends on specified volume fraction
// volume = volume of insertion region
// volume_one = volume of inserted particle (with max possible radius)
// in 3d, insure dy >= 1, for quasi-2d simulations
double volume,volume_one=1.0;
molradius_max = 0.0;
if (mode == MOLECULE) {
for (int i = 0; i < nmol; i++)
molradius_max = MAX(molradius_max,onemols[i]->molradius);
}
if (domain->dimension == 3) {
if (region_style == 1) {
double dy = yhi - ylo;
if (dy < 1.0) dy = 1.0;
volume = (xhi-xlo) * dy * (zhi-zlo);
} else volume = MY_PI*rc*rc * (zhi-zlo);
if (mode == MOLECULE) {
volume_one = 4.0/3.0 * MY_PI * molradius_max*molradius_max*molradius_max;
} else if (dstyle == ONE || dstyle == RANGE) {
volume_one = 4.0/3.0 * MY_PI * radius_max*radius_max*radius_max;
} else if (dstyle == POLY) {
volume_one = 0.0;
for (int i = 0; i < npoly; i++)
volume_one += (4.0/3.0 * MY_PI *
radius_poly[i]*radius_poly[i]*radius_poly[i]) * frac_poly[i];
}
} else {
volume = (xhi-xlo) * (yhi-ylo);
if (mode == MOLECULE) {
volume_one = MY_PI * molradius_max*molradius_max;
} else if (dstyle == ONE || dstyle == RANGE) {
volume_one = MY_PI * radius_max*radius_max;
} else if (dstyle == POLY) {
volume_one = 0.0;
for (int i = 0; i < npoly; i++)
volume_one += (MY_PI * radius_poly[i]*radius_poly[i]) * frac_poly[i];
}
}
nper = static_cast<int> (volfrac*volume/volume_one);
if (nper == 0) error->all(FLERR,"Fix pour insertion count per timestep is 0");
int nfinal = update->ntimestep + 1 + (ninsert-1)/nper * nfreq;
// print stats
if (me == 0) {
if (screen)
fprintf(screen,
"Particle insertion: %d every %d steps, %d by step %d\n",
nper,nfreq,ninsert,nfinal);
if (logfile)
fprintf(logfile,
"Particle insertion: %d every %d steps, %d by step %d\n",
nper,nfreq,ninsert,nfinal);
}
}
/* ---------------------------------------------------------------------- */
FixPour::~FixPour()
{
delete random;
delete [] molfrac;
delete [] idrigid;
delete [] idshake;
delete [] radius_poly;
delete [] frac_poly;
memory->destroy(coords);
memory->destroy(imageflags);
delete [] recvcounts;
delete [] displs;
}
/* ---------------------------------------------------------------------- */
int FixPour::setmask()
{
int mask = 0;
mask |= PRE_EXCHANGE;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixPour::init()
{
if (domain->triclinic)
error->all(FLERR,"Cannot use fix pour with triclinic box");
// insure gravity fix exists
// for 3d must point in -z, for 2d must point in -y
// else insertion cannot work
int ifix;
for (ifix = 0; ifix < modify->nfix; ifix++) {
if (strcmp(modify->fix[ifix]->style,"gravity") == 0) break;
if (strcmp(modify->fix[ifix]->style,"gravity/omp") == 0) break;
}
if (ifix == modify->nfix)
error->all(FLERR,"No fix gravity defined for fix pour");
double xgrav = ((FixGravity *) modify->fix[ifix])->xgrav;
double ygrav = ((FixGravity *) modify->fix[ifix])->ygrav;
double zgrav = ((FixGravity *) modify->fix[ifix])->zgrav;
if (domain->dimension == 3) {
if (fabs(xgrav) > EPSILON || fabs(ygrav) > EPSILON ||
fabs(zgrav+1.0) > EPSILON)
error->all(FLERR,"Gravity must point in -z to use with fix pour in 3d");
} else {
if (fabs(xgrav) > EPSILON || fabs(ygrav+1.0) > EPSILON ||
fabs(zgrav) > EPSILON)
error->all(FLERR,"Gravity must point in -y to use with fix pour in 2d");
}
double gnew = - ((FixGravity *) modify->fix[ifix])->magnitude * force->ftm2v;
if (gnew != grav)
error->all(FLERR,"Gravity changed since fix pour was created");
// if rigidflag defined, check for rigid/small fix
// its molecule template must be same as this one
fixrigid = NULL;
if (rigidflag) {
int ifix = modify->find_fix(idrigid);
if (ifix < 0) error->all(FLERR,"Fix pour rigid fix does not exist");
fixrigid = modify->fix[ifix];
int tmp;
if (onemols != (Molecule **) fixrigid->extract("onemol",tmp))
error->all(FLERR,
"Fix pour and fix rigid/small not using "
"same molecule template ID");
}
// if shakeflag defined, check for SHAKE fix
// its molecule template must be same as this one
fixshake = NULL;
if (shakeflag) {
int ifix = modify->find_fix(idshake);
if (ifix < 0) error->all(FLERR,"Fix pour shake fix does not exist");
fixshake = modify->fix[ifix];
int tmp;
if (onemols != (Molecule **) fixshake->extract("onemol",tmp))
error->all(FLERR,"Fix pour and fix shake not using "
"same molecule template ID");
}
}
/* ----------------------------------------------------------------------
perform particle insertion
------------------------------------------------------------------------- */
void FixPour::pre_exchange()
{
int i,m,flag,nlocalprev,imol,natom;
double r[3],rotmat[3][3],quat[4],vnew[3];
double *newcoord;
// just return if should not be called on this timestep
if (next_reneighbor != update->ntimestep) return;
+ // clear ghost count and any ghost bonus data internal to AtomVec
+ // same logic as beginning of Comm::exchange()
+ // do it now b/c inserting atoms will overwrite ghost atoms
+
+ atom->nghost = 0;
+ atom->avec->clear_bonus();
+
// find current max atom and molecule IDs if necessary
if (!idnext) find_maxid();
// nnew = # of particles (atoms or molecules) to insert this timestep
int nnew = nper;
if (ninserted + nnew > ninsert) nnew = ninsert - ninserted;
// lo/hi current = z (or y) bounds of insertion region this timestep
int dimension = domain->dimension;
if (dimension == 3) {
lo_current = zlo + (update->ntimestep - nfirst) * update->dt * rate;
hi_current = zhi + (update->ntimestep - nfirst) * update->dt * rate;
} else {
lo_current = ylo + (update->ntimestep - nfirst) * update->dt * rate;
hi_current = yhi + (update->ntimestep - nfirst) * update->dt * rate;
}
// ncount = # of my atoms that overlap the insertion region
// nprevious = total of ncount across all procs
int ncount = 0;
for (i = 0; i < atom->nlocal; i++)
if (overlap(i)) ncount++;
int nprevious;
MPI_Allreduce(&ncount,&nprevious,1,MPI_INT,MPI_SUM,world);
// xmine is for my atoms
// xnear is for atoms from all procs + atoms to be inserted
double **xmine,**xnear;
memory->create(xmine,ncount,4,"fix_pour:xmine");
memory->create(xnear,nprevious+nnew*natom_max,4,"fix_pour:xnear");
int nnear = nprevious;
// setup for allgatherv
int n = 4*ncount;
MPI_Allgather(&n,1,MPI_INT,recvcounts,1,MPI_INT,world);
displs[0] = 0;
for (int iproc = 1; iproc < nprocs; iproc++)
displs[iproc] = displs[iproc-1] + recvcounts[iproc-1];
// load up xmine array
double **x = atom->x;
double *radius = atom->radius;
ncount = 0;
for (i = 0; i < atom->nlocal; i++)
if (overlap(i)) {
xmine[ncount][0] = x[i][0];
xmine[ncount][1] = x[i][1];
xmine[ncount][2] = x[i][2];
xmine[ncount][3] = radius[i];
ncount++;
}
// perform allgatherv to acquire list of nearby particles on all procs
double *ptr = NULL;
if (ncount) ptr = xmine[0];
MPI_Allgatherv(ptr,4*ncount,MPI_DOUBLE,
xnear[0],recvcounts,displs,MPI_DOUBLE,world);
// insert new particles into xnear list, one by one
// check against all nearby atoms and previously inserted ones
// if there is an overlap then try again at same z (3d) or y (2d) coord
// else insert by adding to xnear list
// max = maximum # of insertion attempts for all particles
// h = height, biased to give uniform distribution in time of insertion
// for MOLECULE mode:
// coords = coords of all atoms in particle
// perform random rotation around center pt
// apply PBC so final coords are inside box
// store image flag modified due to PBC
int success;
double radtmp,delx,dely,delz,rsq,radsum,rn,h;
double coord[3];
double denstmp;
double *sublo = domain->sublo;
double *subhi = domain->subhi;
int nsuccess = 0;
int attempt = 0;
int maxiter = nnew * maxattempt;
while (nsuccess < nnew) {
rn = random->uniform();
h = hi_current - rn*rn * (hi_current-lo_current);
if (mode == ATOM) radtmp = radius_sample();
success = 0;
while (attempt < maxiter) {
attempt++;
xyz_random(h,coord);
if (mode == ATOM) {
natom = 1;
coords[0][0] = coord[0];
coords[0][1] = coord[1];
coords[0][2] = coord[2];
coords[0][3] = radtmp;
imageflags[0] = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
} else {
double rng = random->uniform();
imol = 0;
while (rng > molfrac[imol]) imol++;
natom = onemols[imol]->natoms;
if (dimension == 3) {
r[0] = random->uniform() - 0.5;
r[1] = random->uniform() - 0.5;
r[2] = random->uniform() - 0.5;
} else {
r[0] = r[1] = 0.0;
r[2] = 1.0;
}
double theta = random->uniform() * MY_2PI;
MathExtra::norm3(r);
MathExtra::axisangle_to_quat(r,theta,quat);
MathExtra::quat_to_mat(quat,rotmat);
for (i = 0; i < natom; i++) {
MathExtra::matvec(rotmat,onemols[imol]->dx[i],coords[i]);
coords[i][0] += coord[0];
coords[i][1] += coord[1];
coords[i][2] += coord[2];
// coords[3] = particle radius
// default to 0.5, if radii not defined in Molecule
// same as atom->avec->create_atom(), invoked below
if (onemols[imol]->radiusflag)
coords[i][3] = onemols[imol]->radius[i];
else coords[i][3] = 0.5;
imageflags[i] = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
domain->remap(coords[i],imageflags[i]);
}
}
// if any pair of atoms overlap, try again
// use minimum_image() to account for PBC
for (m = 0; m < natom; m++) {
for (i = 0; i < nnear; i++) {
delx = coords[m][0] - xnear[i][0];
dely = coords[m][1] - xnear[i][1];
delz = coords[m][2] - xnear[i][2];
domain->minimum_image(delx,dely,delz);
rsq = delx*delx + dely*dely + delz*delz;
radsum = coords[m][3] + xnear[i][3];
if (rsq <= radsum*radsum) break;
}
if (i < nnear) break;
}
if (m == natom) {
success = 1;
break;
}
}
if (!success) break;
// proceed with insertion
nsuccess++;
nlocalprev = atom->nlocal;
// add all atoms in particle to xnear
for (m = 0; m < natom; m++) {
xnear[nnear][0] = coords[m][0];
xnear[nnear][1] = coords[m][1];
xnear[nnear][2] = coords[m][2];
xnear[nnear][3] = coords[m][3];
nnear++;
}
// choose random velocity for new particle
// used for every atom in molecule
// z velocity set to what velocity would be if particle
// had fallen from top of insertion region
// this gives continuous stream of atoms
// solution for v from these 2 eqs, after eliminate t:
// v = vz + grav*t
// coord[2] = hi_current + vz*t + 1/2 grav t^2
if (dimension == 3) {
vnew[0] = vxlo + random->uniform() * (vxhi-vxlo);
vnew[1] = vylo + random->uniform() * (vyhi-vylo);
vnew[2] = -sqrt(vz*vz + 2.0*grav*(coord[2]-hi_current));
} else {
vnew[0] = vxlo + random->uniform() * (vxhi-vxlo);
vnew[1] = -sqrt(vy*vy + 2.0*grav*(coord[1]-hi_current));
vnew[2] = 0.0;
}
// check if new atoms are in my sub-box or above it if I am highest proc
// if so, add atom to my list via create_atom()
// initialize additional info about the atoms
// set group mask to "all" plus fix group
for (m = 0; m < natom; m++) {
if (mode == ATOM)
denstmp = density_lo + random->uniform() * (density_hi-density_lo);
newcoord = coords[m];
flag = 0;
if (newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] &&
newcoord[1] >= sublo[1] && newcoord[1] < subhi[1] &&
newcoord[2] >= sublo[2] && newcoord[2] < subhi[2]) flag = 1;
else if (dimension == 3 && newcoord[2] >= domain->boxhi[2]) {
if (comm->layout != LAYOUT_TILED) {
if (comm->myloc[2] == comm->procgrid[2]-1 &&
newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] &&
newcoord[1] >= sublo[1] && newcoord[1] < subhi[1]) flag = 1;
} else {
if (comm->mysplit[2][1] == 1.0 &&
newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] &&
newcoord[1] >= sublo[1] && newcoord[1] < subhi[1]) flag = 1;
}
} else if (dimension == 2 && newcoord[1] >= domain->boxhi[1]) {
if (comm->layout != LAYOUT_TILED) {
if (comm->myloc[1] == comm->procgrid[1]-1 &&
newcoord[0] >= sublo[0] && newcoord[0] < subhi[0]) flag = 1;
} else {
if (comm->mysplit[1][1] == 1.0 &&
newcoord[0] >= sublo[0] && newcoord[0] < subhi[0]) flag = 1;
}
}
if (flag) {
if (mode == ATOM) atom->avec->create_atom(ntype,coords[m]);
else atom->avec->create_atom(ntype+onemols[imol]->type[m],coords[m]);
int n = atom->nlocal - 1;
atom->tag[n] = maxtag_all + m+1;
if (mode == MOLECULE) {
if (atom->molecule_flag) atom->molecule[n] = maxmol_all+1;
if (atom->molecular == 2) {
atom->molindex[n] = 0;
atom->molatom[n] = m;
}
}
atom->mask[n] = 1 | groupbit;
atom->image[n] = imageflags[m];
atom->v[n][0] = vnew[0];
atom->v[n][1] = vnew[1];
atom->v[n][2] = vnew[2];
if (mode == ATOM) {
radtmp = newcoord[3];
atom->radius[n] = radtmp;
atom->rmass[n] = 4.0*MY_PI/3.0 * radtmp*radtmp*radtmp * denstmp;
- } else atom->add_molecule_atom(onemols[imol],m,n,maxtag_all);
+ } else {
+ onemols[imol]->quat_external = quat;
+ atom->add_molecule_atom(onemols[imol],m,n,maxtag_all);
+ }
+
modify->create_attribute(n);
}
}
// FixRigidSmall::set_molecule stores rigid body attributes
// coord is new position of geometric center of mol, not COM
// FixShake::set_molecule stores shake info for molecule
if (rigidflag)
fixrigid->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat);
else if (shakeflag)
fixshake->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat);
maxtag_all += natom;
if (mode == MOLECULE && atom->molecule_flag) maxmol_all++;
}
// warn if not successful with all insertions b/c too many attempts
int ninserted_atoms = nnear - nprevious;
int ninserted_mols = ninserted_atoms / natom;
ninserted += ninserted_mols;
if (ninserted_mols < nnew && me == 0)
error->warning(FLERR,"Less insertions than requested",0);
// reset global natoms,nbonds,etc
// increment maxtag_all and maxmol_all if necessary
// if global map exists, reset it now instead of waiting for comm
- // since adding atoms messes up ghosts
+ // since other pre-exchange fixes may use it
+ // invoke map_init() b/c atom count has grown
if (ninserted_atoms) {
atom->natoms += ninserted_atoms;
if (atom->natoms < 0)
error->all(FLERR,"Too many total atoms");
if (mode == MOLECULE) {
atom->nbonds += onemols[imol]->nbonds * ninserted_mols;
atom->nangles += onemols[imol]->nangles * ninserted_mols;
atom->ndihedrals += onemols[imol]->ndihedrals * ninserted_mols;
atom->nimpropers += onemols[imol]->nimpropers * ninserted_mols;
}
if (maxtag_all >= MAXTAGINT)
error->all(FLERR,"New atom IDs exceed maximum allowed ID");
if (atom->map_style) {
- atom->nghost = 0;
atom->map_init();
atom->map_set();
}
}
// free local memory
memory->destroy(xmine);
memory->destroy(xnear);
// next timestep to insert
if (ninserted < ninsert) next_reneighbor += nfreq;
else next_reneighbor = 0;
}
/* ----------------------------------------------------------------------
maxtag_all = current max atom ID for all atoms
maxmol_all = current max molecule ID for all atoms
------------------------------------------------------------------------- */
void FixPour::find_maxid()
{
tagint *tag = atom->tag;
tagint *molecule = atom->molecule;
int nlocal = atom->nlocal;
tagint max = 0;
for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
MPI_Allreduce(&max,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
if (mode == MOLECULE && molecule) {
max = 0;
for (int i = 0; i < nlocal; i++) max = MAX(max,molecule[i]);
MPI_Allreduce(&max,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
}
}
/* ----------------------------------------------------------------------
check if particle i could overlap with a particle inserted into region
return 1 if yes, 0 if no
for ATOM mode, use delta with maximum size for inserted atoms
for MOLECULE mode, use delta with max radius of inserted molecules
account for PBC in overlap decision via outside() and minimum_image()
------------------------------------------------------------------------- */
int FixPour::overlap(int i)
{
double delta;
if (mode == ATOM) delta = atom->radius[i] + radius_max;
else delta = atom->radius[i] + molradius_max;
double *x = atom->x[i];
if (domain->dimension == 3) {
if (region_style == 1) {
if (outside(0,x[0],xlo-delta,xhi+delta)) return 0;
if (outside(1,x[1],ylo-delta,yhi+delta)) return 0;
if (outside(2,x[2],lo_current-delta,hi_current+delta)) return 0;
} else {
double delx = x[0] - xc;
double dely = x[1] - yc;
double delz = 0.0;
domain->minimum_image(delx,dely,delz);
double rsq = delx*delx + dely*dely;
double r = rc + delta;
if (rsq > r*r) return 0;
if (outside(2,x[2],lo_current-delta,hi_current+delta)) return 0;
}
} else {
if (outside(0,x[0],xlo-delta,xhi+delta)) return 0;
if (outside(1,x[1],lo_current-delta,hi_current+delta)) return 0;
}
return 1;
}
/* ----------------------------------------------------------------------
check if value is inside/outside lo/hi bounds in dimension
account for PBC if needed
return 1 if value is outside, 0 if inside
------------------------------------------------------------------------- */
int FixPour::outside(int dim, double value, double lo, double hi)
{
double boxlo = domain->boxlo[dim];
double boxhi = domain->boxhi[dim];
if (domain->periodicity[dim]) {
if (lo < boxlo && hi > boxhi) {
return 0;
} else if (lo < boxlo) {
if (value > hi && value < lo + domain->prd[dim]) return 1;
} else if (hi > boxhi) {
if (value > hi - domain->prd[dim] && value < lo) return 1;
} else {
if (value < lo || value > hi) return 1;
}
}
if (value < lo || value > hi) return 1;
return 0;
}
/* ---------------------------------------------------------------------- */
void FixPour::xyz_random(double h, double *coord)
{
if (domain->dimension == 3) {
if (region_style == 1) {
coord[0] = xlo + random->uniform() * (xhi-xlo);
coord[1] = ylo + random->uniform() * (yhi-ylo);
coord[2] = h;
} else {
double r1,r2;
while (1) {
r1 = random->uniform() - 0.5;
r2 = random->uniform() - 0.5;
if (r1*r1 + r2*r2 < 0.25) break;
}
coord[0] = xc + 2.0*r1*rc;
coord[1] = yc + 2.0*r2*rc;
coord[2] = h;
}
} else {
coord[0] = xlo + random->uniform() * (xhi-xlo);
coord[1] = h;
coord[2] = 0.0;
}
}
/* ---------------------------------------------------------------------- */
double FixPour::radius_sample()
{
if (dstyle == ONE) return radius_one;
if (dstyle == RANGE) return radius_lo +
random->uniform()*(radius_hi-radius_lo);
double value = random->uniform();
int i = 0;
double sum = 0.0;
while (sum < value) {
sum += frac_poly[i];
i++;
}
return radius_poly[i-1];
}
/* ----------------------------------------------------------------------
parse optional parameters at end of input line
------------------------------------------------------------------------- */
void FixPour::options(int narg, char **arg)
{
// defaults
iregion = -1;
mode = ATOM;
molfrac = NULL;
rigidflag = 0;
idrigid = NULL;
shakeflag = 0;
idshake = NULL;
idnext = 0;
dstyle = ONE;
radius_max = radius_one = 0.5;
radius_poly = frac_poly = NULL;
density_lo = density_hi = 1.0;
volfrac = 0.25;
maxattempt = 50;
rate = 0.0;
vxlo = vxhi = vylo = vyhi = vy = vz = 0.0;
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"region") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command");
iregion = domain->find_region(arg[iarg+1]);
if (iregion == -1) error->all(FLERR,"Fix pour region ID does not exist");
iarg += 2;
} else if (strcmp(arg[iarg],"mol") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command");
int imol = atom->find_molecule(arg[iarg+1]);
if (imol == -1)
error->all(FLERR,"Molecule template ID for fix pour does not exist");
mode = MOLECULE;
onemols = &atom->molecules[imol];
nmol = onemols[0]->nset;
delete [] molfrac;
molfrac = new double[nmol];
molfrac[0] = 1.0/nmol;
for (int i = 1; i < nmol-1; i++) molfrac[i] = molfrac[i-1] + 1.0/nmol;
molfrac[nmol-1] = 1.0;
iarg += 2;
} else if (strcmp(arg[iarg],"molfrac") == 0) {
if (mode != MOLECULE) error->all(FLERR,"Illegal fix deposit command");
if (iarg+nmol+1 > narg) error->all(FLERR,"Illegal fix deposit command");
molfrac[0] = force->numeric(FLERR,arg[iarg+1]);
for (int i = 1; i < nmol; i++)
molfrac[i] = molfrac[i-1] + force->numeric(FLERR,arg[iarg+i+1]);
if (molfrac[nmol-1] < 1.0-EPSILON || molfrac[nmol-1] > 1.0+EPSILON)
error->all(FLERR,"Illegal fix deposit command");
molfrac[nmol-1] = 1.0;
iarg += nmol+1;
} else if (strcmp(arg[iarg],"rigid") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command");
int n = strlen(arg[iarg+1]) + 1;
delete [] idrigid;
idrigid = new char[n];
strcpy(idrigid,arg[iarg+1]);
rigidflag = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"shake") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command");
int n = strlen(arg[iarg+1]) + 1;
delete [] idshake;
idshake = new char[n];
strcpy(idshake,arg[iarg+1]);
shakeflag = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"id") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command");
if (strcmp(arg[iarg+1],"max") == 0) idnext = 0;
else if (strcmp(arg[iarg+1],"next") == 0) idnext = 1;
else error->all(FLERR,"Illegal fix pour command");
iarg += 2;
} else if (strcmp(arg[iarg],"diam") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command");
if (strcmp(arg[iarg+1],"one") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command");
dstyle = ONE;
radius_one = 0.5 * force->numeric(FLERR,arg[iarg+2]);
radius_max = radius_one;
iarg += 3;
} else if (strcmp(arg[iarg+1],"range") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix pour command");
dstyle = RANGE;
radius_lo = 0.5 * force->numeric(FLERR,arg[iarg+2]);
radius_hi = 0.5 * force->numeric(FLERR,arg[iarg+3]);
radius_max = radius_hi;
iarg += 4;
} else if (strcmp(arg[iarg+1],"poly") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command");
dstyle = POLY;
npoly = force->inumeric(FLERR,arg[iarg+2]);
if (npoly <= 0) error->all(FLERR,"Illegal fix pour command");
if (iarg+3 + 2*npoly > narg)
error->all(FLERR,"Illegal fix pour command");
radius_poly = new double[npoly];
frac_poly = new double[npoly];
iarg += 3;
radius_max = 0.0;
for (int i = 0; i < npoly; i++) {
radius_poly[i] = 0.5 * force->numeric(FLERR,arg[iarg++]);
frac_poly[i] = force->numeric(FLERR,arg[iarg++]);
if (radius_poly[i] <= 0.0 || frac_poly[i] < 0.0)
error->all(FLERR,"Illegal fix pour command");
radius_max = MAX(radius_max,radius_poly[i]);
}
double sum = 0.0;
for (int i = 0; i < npoly; i++) sum += frac_poly[i];
if (sum != 1.0)
error->all(FLERR,"Fix pour polydisperse fractions do not sum to 1.0");
} else error->all(FLERR,"Illegal fix pour command");
} else if (strcmp(arg[iarg],"dens") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command");
density_lo = force->numeric(FLERR,arg[iarg+1]);
density_hi = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"vol") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command");
volfrac = force->numeric(FLERR,arg[iarg+1]);
maxattempt = force->inumeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"rate") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command");
rate = force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"vel") == 0) {
if (domain->dimension == 3) {
if (iarg+6 > narg) error->all(FLERR,"Illegal fix pour command");
vxlo = force->numeric(FLERR,arg[iarg+1]);
vxhi = force->numeric(FLERR,arg[iarg+2]);
vylo = force->numeric(FLERR,arg[iarg+3]);
vyhi = force->numeric(FLERR,arg[iarg+4]);
vz = force->numeric(FLERR,arg[iarg+5]);
iarg += 6;
} else {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix pour command");
vxlo = force->numeric(FLERR,arg[iarg+1]);
vxhi = force->numeric(FLERR,arg[iarg+2]);
vy = force->numeric(FLERR,arg[iarg+3]);
vz = 0.0;
iarg += 4;
}
} else error->all(FLERR,"Illegal fix pour command");
}
}
/* ---------------------------------------------------------------------- */
void FixPour::reset_dt()
{
error->all(FLERR,"Cannot change timestep with fix pour");
}
/* ----------------------------------------------------------------------
extract particle radius for atom type = itype
------------------------------------------------------------------------- */
void *FixPour::extract(const char *str, int &itype)
{
if (strcmp(str,"radius") == 0) {
if (mode == ATOM) {
if (itype == ntype) oneradius = radius_max;
else oneradius = 0.0;
} else {
- // find a molecule in template with matching type
+ // loop over onemols molecules
+ // skip a molecule with no atoms as large as itype
+ oneradius = 0.0;
for (int i = 0; i < nmol; i++) {
- if (itype-ntype > onemols[i]->ntypes) continue;
+ if (itype > ntype+onemols[i]->ntypes) continue;
double *radius = onemols[i]->radius;
int *type = onemols[i]->type;
int natoms = onemols[i]->natoms;
- // check radii of matching types in Molecule
+ // check radii of atoms in Molecule with matching types
// default to 0.5, if radii not defined in Molecule
// same as atom->avec->create_atom(), invoked in pre_exchange()
- oneradius = 0.0;
for (int i = 0; i < natoms; i++)
- if (type[i] == itype-ntype) {
+ if (type[i]+ntype == itype) {
if (radius) oneradius = MAX(oneradius,radius[i]);
- else oneradius = 0.5;
+ else oneradius = MAX(oneradius,0.5);
}
}
}
itype = 0;
return &oneradius;
}
return NULL;
}
diff --git a/src/GRANULAR/pair_gran_hertz_history.cpp b/src/GRANULAR/pair_gran_hertz_history.cpp
index f7937fd66..b32f13672 100644
--- a/src/GRANULAR/pair_gran_hertz_history.cpp
+++ b/src/GRANULAR/pair_gran_hertz_history.cpp
@@ -1,466 +1,454 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing authors: Leo Silbert (SNL), Gary Grest (SNL)
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "pair_gran_hertz_history.h"
#include "atom.h"
#include "update.h"
#include "force.h"
#include "fix.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PairGranHertzHistory::PairGranHertzHistory(LAMMPS *lmp) :
PairGranHookeHistory(lmp) {}
/* ---------------------------------------------------------------------- */
void PairGranHertzHistory::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum;
double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz;
double radi,radj,radsum,rsq,r,rinv,rsqinv;
double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
double wr1,wr2,wr3;
double vtr1,vtr2,vtr3,vrel;
double mi,mj,meff,damp,ccel,tor1,tor2,tor3;
double fn,fs,fs1,fs2,fs3;
double shrmag,rsht,polyhertz;
int *ilist,*jlist,*numneigh,**firstneigh;
int *touch,**firsttouch;
double *shear,*allshear,**firstshear;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
int shearupdate = 1;
if (update->setupflag) shearupdate = 0;
// update rigid body info for owned & ghost atoms if using FixRigid masses
// body[i] = which body atom I is in, -1 if none
// mass_body = mass of each rigid body
if (fix_rigid && neighbor->ago == 0) {
int tmp;
int *body = (int *) fix_rigid->extract("body",tmp);
double *mass_body = (double *) fix_rigid->extract("masstotal",tmp);
if (atom->nmax > nmax) {
memory->destroy(mass_rigid);
nmax = atom->nmax;
memory->create(mass_rigid,nmax,"pair:mass_rigid");
}
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++)
if (body[i] >= 0) mass_rigid[i] = mass_body[body[i]];
else mass_rigid[i] = 0.0;
comm->forward_comm_pair(this);
}
double **x = atom->x;
double **v = atom->v;
double **f = atom->f;
double **omega = atom->omega;
double **torque = atom->torque;
double *radius = atom->radius;
double *rmass = atom->rmass;
- double *mass = atom->mass;
int *type = atom->type;
int *mask = atom->mask;
int nlocal = atom->nlocal;
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
firsttouch = list->listgranhistory->firstneigh;
firstshear = list->listgranhistory->firstdouble;
// loop over neighbors of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
radi = radius[i];
touch = firsttouch[i];
allshear = firstshear[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
radj = radius[j];
radsum = radi + radj;
if (rsq >= radsum*radsum) {
// unset non-touching neighbors
touch[jj] = 0;
shear = &allshear[3*jj];
shear[0] = 0.0;
shear[1] = 0.0;
shear[2] = 0.0;
} else {
r = sqrt(rsq);
rinv = 1.0/r;
rsqinv = 1.0/rsq;
// relative translational velocity
vr1 = v[i][0] - v[j][0];
vr2 = v[i][1] - v[j][1];
vr3 = v[i][2] - v[j][2];
// normal component
vnnr = vr1*delx + vr2*dely + vr3*delz;
vn1 = delx*vnnr * rsqinv;
vn2 = dely*vnnr * rsqinv;
vn3 = delz*vnnr * rsqinv;
// tangential component
vt1 = vr1 - vn1;
vt2 = vr2 - vn2;
vt3 = vr3 - vn3;
// relative rotational velocity
wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
// meff = effective mass of pair of particles
// if I or J part of rigid body, use body mass
// if I or J is frozen, meff is other particle
- if (rmass) {
- mi = rmass[i];
- mj = rmass[j];
- } else {
- mi = mass[type[i]];
- mj = mass[type[j]];
- }
+ mi = rmass[i];
+ mj = rmass[j];
if (fix_rigid) {
if (mass_rigid[i] > 0.0) mi = mass_rigid[i];
if (mass_rigid[j] > 0.0) mj = mass_rigid[j];
}
meff = mi*mj / (mi+mj);
if (mask[i] & freeze_group_bit) meff = mj;
if (mask[j] & freeze_group_bit) meff = mi;
// normal force = Hertzian contact + normal velocity damping
damp = meff*gamman*vnnr*rsqinv;
ccel = kn*(radsum-r)*rinv - damp;
polyhertz = sqrt((radsum-r)*radi*radj / radsum);
ccel *= polyhertz;
// relative velocities
vtr1 = vt1 - (delz*wr2-dely*wr3);
vtr2 = vt2 - (delx*wr3-delz*wr1);
vtr3 = vt3 - (dely*wr1-delx*wr2);
vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
vrel = sqrt(vrel);
// shear history effects
touch[jj] = 1;
shear = &allshear[3*jj];
if (shearupdate) {
shear[0] += vtr1*dt;
shear[1] += vtr2*dt;
shear[2] += vtr3*dt;
}
shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] +
shear[2]*shear[2]);
// rotate shear displacements
rsht = shear[0]*delx + shear[1]*dely + shear[2]*delz;
rsht *= rsqinv;
if (shearupdate) {
shear[0] -= rsht*delx;
shear[1] -= rsht*dely;
shear[2] -= rsht*delz;
}
// tangential forces = shear + tangential velocity damping
fs1 = -polyhertz * (kt*shear[0] + meff*gammat*vtr1);
fs2 = -polyhertz * (kt*shear[1] + meff*gammat*vtr2);
fs3 = -polyhertz * (kt*shear[2] + meff*gammat*vtr3);
// rescale frictional displacements and forces if needed
fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
fn = xmu * fabs(ccel*r);
if (fs > fn) {
if (shrmag != 0.0) {
shear[0] = (fn/fs) * (shear[0] + meff*gammat*vtr1/kt) -
meff*gammat*vtr1/kt;
shear[1] = (fn/fs) * (shear[1] + meff*gammat*vtr2/kt) -
meff*gammat*vtr2/kt;
shear[2] = (fn/fs) * (shear[2] + meff*gammat*vtr3/kt) -
meff*gammat*vtr3/kt;
fs1 *= fn/fs;
fs2 *= fn/fs;
fs3 *= fn/fs;
} else fs1 = fs2 = fs3 = 0.0;
}
// forces & torques
fx = delx*ccel + fs1;
fy = dely*ccel + fs2;
fz = delz*ccel + fs3;
f[i][0] += fx;
f[i][1] += fy;
f[i][2] += fz;
tor1 = rinv * (dely*fs3 - delz*fs2);
tor2 = rinv * (delz*fs1 - delx*fs3);
tor3 = rinv * (delx*fs2 - dely*fs1);
torque[i][0] -= radi*tor1;
torque[i][1] -= radi*tor2;
torque[i][2] -= radi*tor3;
if (j < nlocal) {
f[j][0] -= fx;
f[j][1] -= fy;
f[j][2] -= fz;
torque[j][0] -= radj*tor1;
torque[j][1] -= radj*tor2;
torque[j][2] -= radj*tor3;
}
if (evflag) ev_tally_xyz(i,j,nlocal,0,
0.0,0.0,fx,fy,fz,delx,dely,delz);
}
}
}
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairGranHertzHistory::settings(int narg, char **arg)
{
if (narg != 6) error->all(FLERR,"Illegal pair_style command");
kn = force->numeric(FLERR,arg[0]);
if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0;
else kt = force->numeric(FLERR,arg[1]);
gamman = force->numeric(FLERR,arg[2]);
if (strcmp(arg[3],"NULL") == 0) gammat = 0.5 * gamman;
else gammat = force->numeric(FLERR,arg[3]);
xmu = force->numeric(FLERR,arg[4]);
dampflag = force->inumeric(FLERR,arg[5]);
if (dampflag == 0) gammat = 0.0;
if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 ||
xmu < 0.0 || xmu > 10000.0 || dampflag < 0 || dampflag > 1)
error->all(FLERR,"Illegal pair_style command");
// convert Kn and Kt from pressure units to force/distance^2
kn /= force->nktv2p;
kt /= force->nktv2p;
}
/* ---------------------------------------------------------------------- */
double PairGranHertzHistory::single(int i, int j, int itype, int jtype,
double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double radi,radj,radsum;
double r,rinv,rsqinv,delx,dely,delz;
double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3,wr1,wr2,wr3;
double mi,mj,meff,damp,ccel,polyhertz;
double vtr1,vtr2,vtr3,vrel,shrmag,rsht;
double fs1,fs2,fs3,fs,fn;
double *radius = atom->radius;
radi = radius[i];
radj = radius[j];
radsum = radi + radj;
if (rsq >= radsum*radsum) {
fforce = 0.0;
svector[0] = svector[1] = svector[2] = svector[3] = 0.0;
return 0.0;
}
r = sqrt(rsq);
rinv = 1.0/r;
rsqinv = 1.0/rsq;
// relative translational velocity
double **v = atom->v;
vr1 = v[i][0] - v[j][0];
vr2 = v[i][1] - v[j][1];
vr3 = v[i][2] - v[j][2];
// normal component
double **x = atom->x;
delx = x[i][0] - x[j][0];
dely = x[i][1] - x[j][1];
delz = x[i][2] - x[j][2];
vnnr = vr1*delx + vr2*dely + vr3*delz;
vn1 = delx*vnnr * rsqinv;
vn2 = dely*vnnr * rsqinv;
vn3 = delz*vnnr * rsqinv;
// tangential component
vt1 = vr1 - vn1;
vt2 = vr2 - vn2;
vt3 = vr3 - vn3;
// relative rotational velocity
double **omega = atom->omega;
wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
// meff = effective mass of pair of particles
// if I or J part of rigid body, use body mass
// if I or J is frozen, meff is other particle
double *rmass = atom->rmass;
- double *mass = atom->mass;
int *type = atom->type;
int *mask = atom->mask;
- if (rmass) {
- mi = rmass[i];
- mj = rmass[j];
- } else {
- mi = mass[type[i]];
- mj = mass[type[j]];
- }
+ mi = rmass[i];
+ mj = rmass[j];
if (fix_rigid) {
// NOTE: insure mass_rigid is current for owned+ghost atoms?
if (mass_rigid[i] > 0.0) mi = mass_rigid[i];
if (mass_rigid[j] > 0.0) mj = mass_rigid[j];
}
meff = mi*mj / (mi+mj);
if (mask[i] & freeze_group_bit) meff = mj;
if (mask[j] & freeze_group_bit) meff = mi;
// normal force = Hertzian contact + normal velocity damping
damp = meff*gamman*vnnr*rsqinv;
ccel = kn*(radsum-r)*rinv - damp;
polyhertz = sqrt((radsum-r)*radi*radj / radsum);
ccel *= polyhertz;
// relative velocities
vtr1 = vt1 - (delz*wr2-dely*wr3);
vtr2 = vt2 - (delx*wr3-delz*wr1);
vtr3 = vt3 - (dely*wr1-delx*wr2);
vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
vrel = sqrt(vrel);
// shear history effects
// neighprev = index of found neigh on previous call
// search entire jnum list of neighbors of I for neighbor J
// start from neighprev, since will typically be next neighbor
// reset neighprev to 0 as necessary
int jnum = list->numneigh[i];
int *jlist = list->firstneigh[i];
double *allshear = list->listgranhistory->firstdouble[i];
for (int jj = 0; jj < jnum; jj++) {
neighprev++;
if (neighprev >= jnum) neighprev = 0;
if (jlist[neighprev] == j) break;
}
double *shear = &allshear[3*neighprev];
shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] +
shear[2]*shear[2]);
// rotate shear displacements
rsht = shear[0]*delx + shear[1]*dely + shear[2]*delz;
rsht *= rsqinv;
// tangential forces = shear + tangential velocity damping
fs1 = -polyhertz * (kt*shear[0] + meff*gammat*vtr1);
fs2 = -polyhertz * (kt*shear[1] + meff*gammat*vtr2);
fs3 = -polyhertz * (kt*shear[2] + meff*gammat*vtr3);
// rescale frictional displacements and forces if needed
fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
fn = xmu * fabs(ccel*r);
if (fs > fn) {
if (shrmag != 0.0) {
fs1 *= fn/fs;
fs2 *= fn/fs;
fs3 *= fn/fs;
fs *= fn/fs;
} else fs1 = fs2 = fs3 = fs = 0.0;
}
// set all forces and return no energy
fforce = ccel;
svector[0] = fs1;
svector[1] = fs2;
svector[2] = fs3;
svector[3] = fs;
return 0.0;
}
diff --git a/src/GRANULAR/pair_gran_hooke.cpp b/src/GRANULAR/pair_gran_hooke.cpp
index 79503e07b..b5305c309 100644
--- a/src/GRANULAR/pair_gran_hooke.cpp
+++ b/src/GRANULAR/pair_gran_hooke.cpp
@@ -1,346 +1,333 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing authors: Leo Silbert (SNL), Gary Grest (SNL)
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "pair_gran_hooke.h"
#include "atom.h"
#include "force.h"
#include "fix.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "comm.h"
#include "memory.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PairGranHooke::PairGranHooke(LAMMPS *lmp) : PairGranHookeHistory(lmp)
{
no_virial_fdotr_compute = 0;
history = 0;
}
/* ---------------------------------------------------------------------- */
void PairGranHooke::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum;
double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz;
double radi,radj,radsum,rsq,r,rinv,rsqinv;
double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
double wr1,wr2,wr3;
double vtr1,vtr2,vtr3,vrel;
double mi,mj,meff,damp,ccel,tor1,tor2,tor3;
double fn,fs,ft,fs1,fs2,fs3;
int *ilist,*jlist,*numneigh,**firstneigh;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
// update rigid body info for owned & ghost atoms if using FixRigid masses
// body[i] = which body atom I is in, -1 if none
// mass_body = mass of each rigid body
if (fix_rigid && neighbor->ago == 0) {
int tmp;
int *body = (int *) fix_rigid->extract("body",tmp);
double *mass_body = (double *) fix_rigid->extract("masstotal",tmp);
if (atom->nmax > nmax) {
memory->destroy(mass_rigid);
nmax = atom->nmax;
memory->create(mass_rigid,nmax,"pair:mass_rigid");
}
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++)
if (body[i] >= 0) mass_rigid[i] = mass_body[body[i]];
else mass_rigid[i] = 0.0;
comm->forward_comm_pair(this);
}
double **x = atom->x;
double **v = atom->v;
double **f = atom->f;
double **omega = atom->omega;
double **torque = atom->torque;
double *radius = atom->radius;
double *rmass = atom->rmass;
- double *mass = atom->mass;
int *type = atom->type;
int *mask = atom->mask;
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
// loop over neighbors of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
radi = radius[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
radj = radius[j];
radsum = radi + radj;
if (rsq < radsum*radsum) {
r = sqrt(rsq);
rinv = 1.0/r;
rsqinv = 1.0/rsq;
// relative translational velocity
vr1 = v[i][0] - v[j][0];
vr2 = v[i][1] - v[j][1];
vr3 = v[i][2] - v[j][2];
// normal component
vnnr = vr1*delx + vr2*dely + vr3*delz;
vn1 = delx*vnnr * rsqinv;
vn2 = dely*vnnr * rsqinv;
vn3 = delz*vnnr * rsqinv;
// tangential component
vt1 = vr1 - vn1;
vt2 = vr2 - vn2;
vt3 = vr3 - vn3;
// relative rotational velocity
wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
// meff = effective mass of pair of particles
// if I or J part of rigid body, use body mass
// if I or J is frozen, meff is other particle
- if (rmass) {
- mi = rmass[i];
- mj = rmass[j];
- } else {
- mi = mass[type[i]];
- mj = mass[type[j]];
- }
+ mi = rmass[i];
+ mj = rmass[j];
if (fix_rigid) {
if (mass_rigid[i] > 0.0) mi = mass_rigid[i];
if (mass_rigid[j] > 0.0) mj = mass_rigid[j];
}
meff = mi*mj / (mi+mj);
if (mask[i] & freeze_group_bit) meff = mj;
if (mask[j] & freeze_group_bit) meff = mi;
// normal forces = Hookian contact + normal velocity damping
damp = meff*gamman*vnnr*rsqinv;
ccel = kn*(radsum-r)*rinv - damp;
// relative velocities
vtr1 = vt1 - (delz*wr2-dely*wr3);
vtr2 = vt2 - (delx*wr3-delz*wr1);
vtr3 = vt3 - (dely*wr1-delx*wr2);
vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
vrel = sqrt(vrel);
// force normalization
fn = xmu * fabs(ccel*r);
fs = meff*gammat*vrel;
if (vrel != 0.0) ft = MIN(fn,fs) / vrel;
else ft = 0.0;
// tangential force due to tangential velocity damping
fs1 = -ft*vtr1;
fs2 = -ft*vtr2;
fs3 = -ft*vtr3;
// forces & torques
fx = delx*ccel + fs1;
fy = dely*ccel + fs2;
fz = delz*ccel + fs3;
f[i][0] += fx;
f[i][1] += fy;
f[i][2] += fz;
tor1 = rinv * (dely*fs3 - delz*fs2);
tor2 = rinv * (delz*fs1 - delx*fs3);
tor3 = rinv * (delx*fs2 - dely*fs1);
torque[i][0] -= radi*tor1;
torque[i][1] -= radi*tor2;
torque[i][2] -= radi*tor3;
if (newton_pair || j < nlocal) {
f[j][0] -= fx;
f[j][1] -= fy;
f[j][2] -= fz;
torque[j][0] -= radj*tor1;
torque[j][1] -= radj*tor2;
torque[j][2] -= radj*tor3;
}
if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
0.0,0.0,fx,fy,fz,delx,dely,delz);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ---------------------------------------------------------------------- */
double PairGranHooke::single(int i, int j, int itype, int jtype, double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double radi,radj,radsum,r,rinv,rsqinv;
double delx,dely,delz;
double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3,wr1,wr2,wr3;
double vtr1,vtr2,vtr3,vrel;
double mi,mj,meff,damp,ccel;
double fn,fs,ft;
double *radius = atom->radius;
radi = radius[i];
radj = radius[j];
radsum = radi + radj;
// zero out forces if caller requests non-touching pair outside cutoff
if (rsq >= radsum*radsum) {
fforce = 0.0;
svector[0] = svector[1] = svector[2] = svector[3] = 0.0;
return 0.0;
}
r = sqrt(rsq);
rinv = 1.0/r;
rsqinv = 1.0/rsq;
// relative translational velocity
double **v = atom->v;
vr1 = v[i][0] - v[j][0];
vr2 = v[i][1] - v[j][1];
vr3 = v[i][2] - v[j][2];
// normal component
double **x = atom->x;
delx = x[i][0] - x[j][0];
dely = x[i][1] - x[j][1];
delz = x[i][2] - x[j][2];
vnnr = vr1*delx + vr2*dely + vr3*delz;
vn1 = delx*vnnr * rsqinv;
vn2 = dely*vnnr * rsqinv;
vn3 = delz*vnnr * rsqinv;
// tangential component
vt1 = vr1 - vn1;
vt2 = vr2 - vn2;
vt3 = vr3 - vn3;
// relative rotational velocity
double **omega = atom->omega;
wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
// meff = effective mass of pair of particles
// if I or J part of rigid body, use body mass
// if I or J is frozen, meff is other particle
double *rmass = atom->rmass;
- double *mass = atom->mass;
int *type = atom->type;
int *mask = atom->mask;
- if (rmass) {
- mi = rmass[i];
- mj = rmass[j];
- } else {
- mi = mass[type[i]];
- mj = mass[type[j]];
- }
-
+ mi = rmass[i];
+ mj = rmass[j];
if (fix_rigid) {
// NOTE: insure mass_rigid is current for owned+ghost atoms?
if (mass_rigid[i] > 0.0) mi = mass_rigid[i];
if (mass_rigid[j] > 0.0) mj = mass_rigid[j];
}
meff = mi*mj / (mi+mj);
if (mask[i] & freeze_group_bit) meff = mj;
if (mask[j] & freeze_group_bit) meff = mi;
// normal forces = Hookian contact + normal velocity damping
damp = meff*gamman*vnnr*rsqinv;
ccel = kn*(radsum-r)*rinv - damp;
// relative velocities
vtr1 = vt1 - (delz*wr2-dely*wr3);
vtr2 = vt2 - (delx*wr3-delz*wr1);
vtr3 = vt3 - (dely*wr1-delx*wr2);
vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
vrel = sqrt(vrel);
// force normalization
fn = xmu * fabs(ccel*r);
fs = meff*gammat*vrel;
if (vrel != 0.0) ft = MIN(fn,fs) / vrel;
else ft = 0.0;
// set all forces and return no energy
fforce = ccel;
svector[0] = -ft*vtr1;
svector[1] = -ft*vtr2;
svector[2] = -ft*vtr3;
svector[3] = sqrt(svector[0]*svector[0] +
svector[1]*svector[1] +
svector[2]*svector[2]);
return 0.0;
}
diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp
index ec156b4ac..208d30008 100644
--- a/src/GRANULAR/pair_gran_hooke_history.cpp
+++ b/src/GRANULAR/pair_gran_hooke_history.cpp
@@ -1,795 +1,791 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing authors: Leo Silbert (SNL), Gary Grest (SNL)
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_gran_hooke_history.h"
#include "atom.h"
#include "atom_vec.h"
#include "domain.h"
#include "force.h"
#include "update.h"
#include "modify.h"
#include "fix.h"
#include "fix_shear_history.h"
#include "comm.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PairGranHookeHistory::PairGranHookeHistory(LAMMPS *lmp) : Pair(lmp)
{
single_enable = 1;
no_virial_fdotr_compute = 1;
history = 1;
fix_history = NULL;
single_extra = 4;
svector = new double[4];
neighprev = 0;
nmax = 0;
mass_rigid = NULL;
// set comm size needed by this Pair if used with fix rigid
comm_forward = 1;
}
/* ---------------------------------------------------------------------- */
PairGranHookeHistory::~PairGranHookeHistory()
{
delete [] svector;
if (fix_history) modify->delete_fix("SHEAR_HISTORY");
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] onerad_dynamic;
delete [] onerad_frozen;
delete [] maxrad_dynamic;
delete [] maxrad_frozen;
}
memory->destroy(mass_rigid);
}
/* ---------------------------------------------------------------------- */
void PairGranHookeHistory::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum;
double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz;
double radi,radj,radsum,rsq,r,rinv,rsqinv;
double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
double wr1,wr2,wr3;
double vtr1,vtr2,vtr3,vrel;
double mi,mj,meff,damp,ccel,tor1,tor2,tor3;
double fn,fs,fs1,fs2,fs3;
double shrmag,rsht;
int *ilist,*jlist,*numneigh,**firstneigh;
int *touch,**firsttouch;
double *shear,*allshear,**firstshear;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
int shearupdate = 1;
if (update->setupflag) shearupdate = 0;
// update rigid body info for owned & ghost atoms if using FixRigid masses
// body[i] = which body atom I is in, -1 if none
// mass_body = mass of each rigid body
if (fix_rigid && neighbor->ago == 0) {
int tmp;
int *body = (int *) fix_rigid->extract("body",tmp);
double *mass_body = (double *) fix_rigid->extract("masstotal",tmp);
if (atom->nmax > nmax) {
memory->destroy(mass_rigid);
nmax = atom->nmax;
memory->create(mass_rigid,nmax,"pair:mass_rigid");
}
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++)
if (body[i] >= 0) mass_rigid[i] = mass_body[body[i]];
else mass_rigid[i] = 0.0;
comm->forward_comm_pair(this);
}
double **x = atom->x;
double **v = atom->v;
double **f = atom->f;
double **omega = atom->omega;
double **torque = atom->torque;
double *radius = atom->radius;
double *rmass = atom->rmass;
- double *mass = atom->mass;
int *type = atom->type;
int *mask = atom->mask;
int nlocal = atom->nlocal;
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
firsttouch = listgranhistory->firstneigh;
firstshear = listgranhistory->firstdouble;
// loop over neighbors of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
radi = radius[i];
touch = firsttouch[i];
allshear = firstshear[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
radj = radius[j];
radsum = radi + radj;
if (rsq >= radsum*radsum) {
// unset non-touching neighbors
touch[jj] = 0;
shear = &allshear[3*jj];
shear[0] = 0.0;
shear[1] = 0.0;
shear[2] = 0.0;
} else {
r = sqrt(rsq);
rinv = 1.0/r;
rsqinv = 1.0/rsq;
// relative translational velocity
vr1 = v[i][0] - v[j][0];
vr2 = v[i][1] - v[j][1];
vr3 = v[i][2] - v[j][2];
// normal component
vnnr = vr1*delx + vr2*dely + vr3*delz;
vn1 = delx*vnnr * rsqinv;
vn2 = dely*vnnr * rsqinv;
vn3 = delz*vnnr * rsqinv;
// tangential component
vt1 = vr1 - vn1;
vt2 = vr2 - vn2;
vt3 = vr3 - vn3;
// relative rotational velocity
wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
// meff = effective mass of pair of particles
// if I or J part of rigid body, use body mass
// if I or J is frozen, meff is other particle
- if (rmass) {
- mi = rmass[i];
- mj = rmass[j];
- } else {
- mi = mass[type[i]];
- mj = mass[type[j]];
- }
+ mi = rmass[i];
+ mj = rmass[j];
if (fix_rigid) {
if (mass_rigid[i] > 0.0) mi = mass_rigid[i];
if (mass_rigid[j] > 0.0) mj = mass_rigid[j];
}
meff = mi*mj / (mi+mj);
if (mask[i] & freeze_group_bit) meff = mj;
if (mask[j] & freeze_group_bit) meff = mi;
// normal forces = Hookian contact + normal velocity damping
damp = meff*gamman*vnnr*rsqinv;
ccel = kn*(radsum-r)*rinv - damp;
// relative velocities
vtr1 = vt1 - (delz*wr2-dely*wr3);
vtr2 = vt2 - (delx*wr3-delz*wr1);
vtr3 = vt3 - (dely*wr1-delx*wr2);
vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
vrel = sqrt(vrel);
// shear history effects
touch[jj] = 1;
shear = &allshear[3*jj];
if (shearupdate) {
shear[0] += vtr1*dt;
shear[1] += vtr2*dt;
shear[2] += vtr3*dt;
}
shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] +
shear[2]*shear[2]);
// rotate shear displacements
rsht = shear[0]*delx + shear[1]*dely + shear[2]*delz;
rsht *= rsqinv;
if (shearupdate) {
shear[0] -= rsht*delx;
shear[1] -= rsht*dely;
shear[2] -= rsht*delz;
}
// tangential forces = shear + tangential velocity damping
fs1 = - (kt*shear[0] + meff*gammat*vtr1);
fs2 = - (kt*shear[1] + meff*gammat*vtr2);
fs3 = - (kt*shear[2] + meff*gammat*vtr3);
// rescale frictional displacements and forces if needed
fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
fn = xmu * fabs(ccel*r);
if (fs > fn) {
if (shrmag != 0.0) {
shear[0] = (fn/fs) * (shear[0] + meff*gammat*vtr1/kt) -
meff*gammat*vtr1/kt;
shear[1] = (fn/fs) * (shear[1] + meff*gammat*vtr2/kt) -
meff*gammat*vtr2/kt;
shear[2] = (fn/fs) * (shear[2] + meff*gammat*vtr3/kt) -
meff*gammat*vtr3/kt;
fs1 *= fn/fs;
fs2 *= fn/fs;
fs3 *= fn/fs;
} else fs1 = fs2 = fs3 = 0.0;
}
// forces & torques
fx = delx*ccel + fs1;
fy = dely*ccel + fs2;
fz = delz*ccel + fs3;
f[i][0] += fx;
f[i][1] += fy;
f[i][2] += fz;
tor1 = rinv * (dely*fs3 - delz*fs2);
tor2 = rinv * (delz*fs1 - delx*fs3);
tor3 = rinv * (delx*fs2 - dely*fs1);
torque[i][0] -= radi*tor1;
torque[i][1] -= radi*tor2;
torque[i][2] -= radi*tor3;
if (j < nlocal) {
f[j][0] -= fx;
f[j][1] -= fy;
f[j][2] -= fz;
torque[j][0] -= radj*tor1;
torque[j][1] -= radj*tor2;
torque[j][2] -= radj*tor3;
}
if (evflag) ev_tally_xyz(i,j,nlocal,0,
0.0,0.0,fx,fy,fz,delx,dely,delz);
}
}
}
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairGranHookeHistory::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
onerad_dynamic = new double[n+1];
onerad_frozen = new double[n+1];
maxrad_dynamic = new double[n+1];
maxrad_frozen = new double[n+1];
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairGranHookeHistory::settings(int narg, char **arg)
{
if (narg != 6) error->all(FLERR,"Illegal pair_style command");
kn = force->numeric(FLERR,arg[0]);
if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0;
else kt = force->numeric(FLERR,arg[1]);
gamman = force->numeric(FLERR,arg[2]);
if (strcmp(arg[3],"NULL") == 0) gammat = 0.5 * gamman;
else gammat = force->numeric(FLERR,arg[3]);
xmu = force->numeric(FLERR,arg[4]);
dampflag = force->inumeric(FLERR,arg[5]);
if (dampflag == 0) gammat = 0.0;
if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 ||
xmu < 0.0 || xmu > 10000.0 || dampflag < 0 || dampflag > 1)
error->all(FLERR,"Illegal pair_style command");
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairGranHookeHistory::coeff(int narg, char **arg)
{
if (narg > 2) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
setflag[i][j] = 1;
count++;
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairGranHookeHistory::init_style()
{
int i;
// error and warning checks
- if (!atom->sphere_flag)
- error->all(FLERR,"Pair granular requires atom style sphere");
+ if (!atom->radius_flag || !atom->rmass_flag)
+ error->all(FLERR,"Pair granular requires atom atrributes radius, rmass");
if (comm->ghost_velocity == 0)
error->all(FLERR,"Pair granular requires ghost atoms store velocity");
// need a granular neigh list and optionally a granular history neigh list
int irequest = neighbor->request(this,instance_me);
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->gran = 1;
if (history) {
irequest = neighbor->request(this,instance_me);
neighbor->requests[irequest]->id = 1;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->granhistory = 1;
neighbor->requests[irequest]->dnum = 3;
}
dt = update->dt;
// if shear history is stored:
// check if newton flag is valid
// if first init, create Fix needed for storing shear history
if (history && force->newton_pair == 1)
error->all(FLERR,
"Pair granular with shear history requires newton pair off");
if (history && fix_history == NULL) {
char **fixarg = new char*[3];
fixarg[0] = (char *) "SHEAR_HISTORY";
fixarg[1] = (char *) "all";
fixarg[2] = (char *) "SHEAR_HISTORY";
modify->add_fix(3,fixarg,1);
delete [] fixarg;
fix_history = (FixShearHistory *) modify->fix[modify->nfix-1];
fix_history->pair = this;
}
// check for FixFreeze and set freeze_group_bit
for (i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"freeze") == 0) break;
if (i < modify->nfix) freeze_group_bit = modify->fix[i]->groupbit;
else freeze_group_bit = 0;
// check for FixRigid so can extract rigid body masses
fix_rigid = NULL;
for (i = 0; i < modify->nfix; i++)
if (modify->fix[i]->rigid_flag) break;
if (i < modify->nfix) fix_rigid = modify->fix[i];
// check for FixPour and FixDeposit so can extract particle radii
int ipour;
for (ipour = 0; ipour < modify->nfix; ipour++)
if (strcmp(modify->fix[ipour]->style,"pour") == 0) break;
if (ipour == modify->nfix) ipour = -1;
int idep;
for (idep = 0; idep < modify->nfix; idep++)
if (strcmp(modify->fix[idep]->style,"deposit") == 0) break;
if (idep == modify->nfix) idep = -1;
// set maxrad_dynamic and maxrad_frozen for each type
// include future FixPour and FixDeposit particles as dynamic
int itype;
for (i = 1; i <= atom->ntypes; i++) {
onerad_dynamic[i] = onerad_frozen[i] = 0.0;
if (ipour >= 0) {
itype = i;
onerad_dynamic[i] =
*((double *) modify->fix[ipour]->extract("radius",itype));
}
if (idep >= 0) {
itype = i;
onerad_dynamic[i] =
*((double *) modify->fix[idep]->extract("radius",itype));
}
}
double *radius = atom->radius;
int *mask = atom->mask;
int *type = atom->type;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++)
if (mask[i] & freeze_group_bit)
onerad_frozen[type[i]] = MAX(onerad_frozen[type[i]],radius[i]);
else
onerad_dynamic[type[i]] = MAX(onerad_dynamic[type[i]],radius[i]);
MPI_Allreduce(&onerad_dynamic[1],&maxrad_dynamic[1],atom->ntypes,
MPI_DOUBLE,MPI_MAX,world);
MPI_Allreduce(&onerad_frozen[1],&maxrad_frozen[1],atom->ntypes,
MPI_DOUBLE,MPI_MAX,world);
+
+ // set fix which stores history info
+
+ if (history) {
+ int ifix = modify->find_fix("SHEAR_HISTORY");
+ if (ifix < 0) error->all(FLERR,"Could not find pair fix ID");
+ fix_history = (FixShearHistory *) modify->fix[ifix];
+ }
}
/* ----------------------------------------------------------------------
neighbor callback to inform pair style of neighbor list to use
optional granular history list
------------------------------------------------------------------------- */
void PairGranHookeHistory::init_list(int id, NeighList *ptr)
{
if (id == 0) list = ptr;
else if (id == 1) listgranhistory = ptr;
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairGranHookeHistory::init_one(int i, int j)
{
if (!allocated) allocate();
// cutoff = sum of max I,J radii for
// dynamic/dynamic & dynamic/frozen interactions, but not frozen/frozen
double cutoff = maxrad_dynamic[i]+maxrad_dynamic[j];
cutoff = MAX(cutoff,maxrad_frozen[i]+maxrad_dynamic[j]);
cutoff = MAX(cutoff,maxrad_dynamic[i]+maxrad_frozen[j]);
return cutoff;
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairGranHookeHistory::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++)
fwrite(&setflag[i][j],sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairGranHookeHistory::read_restart(FILE *fp)
{
read_restart_settings(fp);
allocate();
int i,j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairGranHookeHistory::write_restart_settings(FILE *fp)
{
fwrite(&kn,sizeof(double),1,fp);
fwrite(&kt,sizeof(double),1,fp);
fwrite(&gamman,sizeof(double),1,fp);
fwrite(&gammat,sizeof(double),1,fp);
fwrite(&xmu,sizeof(double),1,fp);
fwrite(&dampflag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairGranHookeHistory::read_restart_settings(FILE *fp)
{
if (comm->me == 0) {
fread(&kn,sizeof(double),1,fp);
fread(&kt,sizeof(double),1,fp);
fread(&gamman,sizeof(double),1,fp);
fread(&gammat,sizeof(double),1,fp);
fread(&xmu,sizeof(double),1,fp);
fread(&dampflag,sizeof(int),1,fp);
}
MPI_Bcast(&kn,1,MPI_DOUBLE,0,world);
MPI_Bcast(&kt,1,MPI_DOUBLE,0,world);
MPI_Bcast(&gamman,1,MPI_DOUBLE,0,world);
MPI_Bcast(&gammat,1,MPI_DOUBLE,0,world);
MPI_Bcast(&xmu,1,MPI_DOUBLE,0,world);
MPI_Bcast(&dampflag,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
void PairGranHookeHistory::reset_dt()
{
dt = update->dt;
}
/* ---------------------------------------------------------------------- */
double PairGranHookeHistory::single(int i, int j, int itype, int jtype,
double rsq,
double factor_coul, double factor_lj,
double &fforce)
{
double radi,radj,radsum;
double r,rinv,rsqinv,delx,dely,delz;
double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3,wr1,wr2,wr3;
double mi,mj,meff,damp,ccel;
double vtr1,vtr2,vtr3,vrel,shrmag,rsht;
double fs1,fs2,fs3,fs,fn;
double *radius = atom->radius;
radi = radius[i];
radj = radius[j];
radsum = radi + radj;
if (rsq >= radsum*radsum) {
fforce = 0.0;
svector[0] = svector[1] = svector[2] = svector[3] = 0.0;
return 0.0;
}
r = sqrt(rsq);
rinv = 1.0/r;
rsqinv = 1.0/rsq;
// relative translational velocity
double **v = atom->v;
vr1 = v[i][0] - v[j][0];
vr2 = v[i][1] - v[j][1];
vr3 = v[i][2] - v[j][2];
// normal component
double **x = atom->x;
delx = x[i][0] - x[j][0];
dely = x[i][1] - x[j][1];
delz = x[i][2] - x[j][2];
vnnr = vr1*delx + vr2*dely + vr3*delz;
vn1 = delx*vnnr * rsqinv;
vn2 = dely*vnnr * rsqinv;
vn3 = delz*vnnr * rsqinv;
// tangential component
vt1 = vr1 - vn1;
vt2 = vr2 - vn2;
vt3 = vr3 - vn3;
// relative rotational velocity
double **omega = atom->omega;
wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
// meff = effective mass of pair of particles
// if I or J part of rigid body, use body mass
// if I or J is frozen, meff is other particle
double *rmass = atom->rmass;
- double *mass = atom->mass;
int *type = atom->type;
int *mask = atom->mask;
- if (rmass) {
- mi = rmass[i];
- mj = rmass[j];
- } else {
- mi = mass[type[i]];
- mj = mass[type[j]];
- }
+ mi = rmass[i];
+ mj = rmass[j];
if (fix_rigid) {
// NOTE: insure mass_rigid is current for owned+ghost atoms?
if (mass_rigid[i] > 0.0) mi = mass_rigid[i];
if (mass_rigid[j] > 0.0) mj = mass_rigid[j];
}
meff = mi*mj / (mi+mj);
if (mask[i] & freeze_group_bit) meff = mj;
if (mask[j] & freeze_group_bit) meff = mi;
// normal forces = Hookian contact + normal velocity damping
damp = meff*gamman*vnnr*rsqinv;
ccel = kn*(radsum-r)*rinv - damp;
// relative velocities
vtr1 = vt1 - (delz*wr2-dely*wr3);
vtr2 = vt2 - (delx*wr3-delz*wr1);
vtr3 = vt3 - (dely*wr1-delx*wr2);
vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
vrel = sqrt(vrel);
// shear history effects
// neighprev = index of found neigh on previous call
// search entire jnum list of neighbors of I for neighbor J
// start from neighprev, since will typically be next neighbor
// reset neighprev to 0 as necessary
int jnum = list->numneigh[i];
int *jlist = list->firstneigh[i];
double *allshear = list->listgranhistory->firstdouble[i];
for (int jj = 0; jj < jnum; jj++) {
neighprev++;
if (neighprev >= jnum) neighprev = 0;
if (jlist[neighprev] == j) break;
}
double *shear = &allshear[3*neighprev];
shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] +
shear[2]*shear[2]);
// rotate shear displacements
rsht = shear[0]*delx + shear[1]*dely + shear[2]*delz;
rsht *= rsqinv;
// tangential forces = shear + tangential velocity damping
fs1 = - (kt*shear[0] + meff*gammat*vtr1);
fs2 = - (kt*shear[1] + meff*gammat*vtr2);
fs3 = - (kt*shear[2] + meff*gammat*vtr3);
// rescale frictional displacements and forces if needed
fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
fn = xmu * fabs(ccel*r);
if (fs > fn) {
if (shrmag != 0.0) {
fs1 *= fn/fs;
fs2 *= fn/fs;
fs3 *= fn/fs;
fs *= fn/fs;
} else fs1 = fs2 = fs3 = fs = 0.0;
}
// set all forces and return no energy
fforce = ccel;
svector[0] = fs1;
svector[1] = fs2;
svector[2] = fs3;
svector[3] = fs;
return 0.0;
}
/* ---------------------------------------------------------------------- */
int PairGranHookeHistory::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = mass_rigid[j];
}
return m;
}
/* ---------------------------------------------------------------------- */
void PairGranHookeHistory::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++)
mass_rigid[i] = buf[m++];
}
/* ----------------------------------------------------------------------
memory usage of local atom-based arrays
------------------------------------------------------------------------- */
double PairGranHookeHistory::memory_usage()
{
double bytes = nmax * sizeof(double);
return bytes;
}
diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.cpp b/src/KOKKOS/atom_vec_atomic_kokkos.cpp
index e9b3115d1..4b50b9b9f 100644
--- a/src/KOKKOS/atom_vec_atomic_kokkos.cpp
+++ b/src/KOKKOS/atom_vec_atomic_kokkos.cpp
@@ -1,1397 +1,1399 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale AtomicKokkos/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <stdlib.h>
#include "atom_vec_atomic_kokkos.h"
#include "atom_kokkos.h"
#include "comm_kokkos.h"
#include "domain.h"
#include "modify.h"
#include "fix.h"
#include "atom_masks.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define DELTA 10000
/* ---------------------------------------------------------------------- */
AtomVecAtomicKokkos::AtomVecAtomicKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp)
{
molecular = 0;
mass_type = 1;
comm_x_only = comm_f_only = 1;
size_forward = 3;
size_reverse = 3;
size_border = 6;
size_velocity = 3;
size_data_atom = 5;
size_data_vel = 4;
xcol_data = 3;
k_count = DAT::tdual_int_1d("atom::k_count",1);
atomKK = (AtomKokkos *) atom;
commKK = (CommKokkos *) comm;
}
/* ----------------------------------------------------------------------
grow atom arrays
n = 0 grows arrays by DELTA
n > 0 allocates arrays to size n
------------------------------------------------------------------------- */
void AtomVecAtomicKokkos::grow(int n)
{
if (n == 0) nmax += DELTA;
else nmax = n;
atomKK->nmax = nmax;
if (nmax < 0 || nmax > MAXSMALLINT)
error->one(FLERR,"Per-processor system is too big");
sync(Device,ALL_MASK);
modified(Device,ALL_MASK);
memory->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag");
memory->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type");
memory->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask");
memory->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image");
memory->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x");
memory->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v");
memory->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f");
grow_reset();
sync(Host,ALL_MASK);
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecAtomicKokkos::grow_reset()
{
tag = atomKK->tag;
d_tag = atomKK->k_tag.d_view;
h_tag = atomKK->k_tag.h_view;
type = atomKK->type;
d_type = atomKK->k_type.d_view;
h_type = atomKK->k_type.h_view;
mask = atomKK->mask;
d_mask = atomKK->k_mask.d_view;
h_mask = atomKK->k_mask.h_view;
image = atomKK->image;
d_image = atomKK->k_image.d_view;
h_image = atomKK->k_image.h_view;
x = atomKK->x;
d_x = atomKK->k_x.d_view;
h_x = atomKK->k_x.h_view;
v = atomKK->v;
d_v = atomKK->k_v.d_view;
h_v = atomKK->k_v.h_view;
f = atomKK->f;
d_f = atomKK->k_f.d_view;
h_f = atomKK->k_f.h_view;
}
/* ----------------------------------------------------------------------
copy atom I info to atom J
------------------------------------------------------------------------- */
void AtomVecAtomicKokkos::copy(int i, int j, int delflag)
{
h_tag[j] = h_tag[i];
h_type[j] = h_type[i];
mask[j] = mask[i];
h_image[j] = h_image[i];
h_x(j,0) = h_x(i,0);
h_x(j,1) = h_x(i,1);
h_x(j,2) = h_x(i,2);
h_v(j,0) = h_v(i,0);
h_v(j,1) = h_v(i,1);
h_v(j,2) = h_v(i,2);
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j,delflag);
}
/* ---------------------------------------------------------------------- */
template<class DeviceType,int PBC_FLAG,int TRICLINIC>
struct AtomVecAtomicKokkos_PackComm {
typedef DeviceType device_type;
typename ArrayTypes<DeviceType>::t_x_array_randomread _x;
typename ArrayTypes<DeviceType>::t_xfloat_2d_um _buf;
typename ArrayTypes<DeviceType>::t_int_2d_const _list;
const int _iswap;
X_FLOAT _xprd,_yprd,_zprd,_xy,_xz,_yz;
X_FLOAT _pbc[6];
AtomVecAtomicKokkos_PackComm(
const typename DAT::tdual_x_array &x,
const typename DAT::tdual_xfloat_2d &buf,
const typename DAT::tdual_int_2d &list,
const int & iswap,
const X_FLOAT &xprd, const X_FLOAT &yprd, const X_FLOAT &zprd,
const X_FLOAT &xy, const X_FLOAT &xz, const X_FLOAT &yz, const int* const pbc):
_x(x.view<DeviceType>()),_list(list.view<DeviceType>()),_iswap(iswap),
_xprd(xprd),_yprd(yprd),_zprd(zprd),
_xy(xy),_xz(xz),_yz(yz) {
const size_t maxsend = (buf.view<DeviceType>().dimension_0()*buf.view<DeviceType>().dimension_1())/3;
const size_t elements = 3;
buffer_view<DeviceType>(_buf,buf,maxsend,elements);
_pbc[0] = pbc[0]; _pbc[1] = pbc[1]; _pbc[2] = pbc[2];
_pbc[3] = pbc[3]; _pbc[4] = pbc[4]; _pbc[5] = pbc[5];
};
KOKKOS_INLINE_FUNCTION
void operator() (const int& i) const {
const int j = _list(_iswap,i);
if (PBC_FLAG == 0) {
_buf(i,0) = _x(j,0);
_buf(i,1) = _x(j,1);
_buf(i,2) = _x(j,2);
} else {
if (TRICLINIC == 0) {
_buf(i,0) = _x(j,0) + _pbc[0]*_xprd;
_buf(i,1) = _x(j,1) + _pbc[1]*_yprd;
_buf(i,2) = _x(j,2) + _pbc[2]*_zprd;
} else {
_buf(i,0) = _x(j,0) + _pbc[0]*_xprd + _pbc[5]*_xy + _pbc[4]*_xz;
_buf(i,1) = _x(j,1) + _pbc[1]*_yprd + _pbc[3]*_yz;
_buf(i,2) = _x(j,2) + _pbc[2]*_zprd;
}
}
}
};
/* ---------------------------------------------------------------------- */
int AtomVecAtomicKokkos::pack_comm_kokkos(const int &n,
const DAT::tdual_int_2d &list,
const int & iswap,
const DAT::tdual_xfloat_2d &buf,
const int &pbc_flag,
const int* const pbc)
{
// Check whether to always run forward communication on the host
// Choose correct forward PackComm kernel
if(commKK->forward_comm_on_host) {
sync(Host,X_MASK);
if(pbc_flag) {
if(domain->triclinic) {
struct AtomVecAtomicKokkos_PackComm<LMPHostType,1,1> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecAtomicKokkos_PackComm<LMPHostType,1,0> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
} else {
if(domain->triclinic) {
struct AtomVecAtomicKokkos_PackComm<LMPHostType,0,1> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecAtomicKokkos_PackComm<LMPHostType,0,0> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
}
LMPHostType::fence();
} else {
sync(Device,X_MASK);
if(pbc_flag) {
if(domain->triclinic) {
struct AtomVecAtomicKokkos_PackComm<LMPDeviceType,1,1> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecAtomicKokkos_PackComm<LMPDeviceType,1,0> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
} else {
if(domain->triclinic) {
struct AtomVecAtomicKokkos_PackComm<LMPDeviceType,0,1> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecAtomicKokkos_PackComm<LMPDeviceType,0,0> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
}
LMPDeviceType::fence();
}
return n*size_forward;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType,int PBC_FLAG,int TRICLINIC>
struct AtomVecAtomicKokkos_PackCommSelf {
typedef DeviceType device_type;
typename ArrayTypes<DeviceType>::t_x_array_randomread _x;
typename ArrayTypes<DeviceType>::t_x_array _xw;
int _nfirst;
typename ArrayTypes<DeviceType>::t_int_2d_const _list;
const int _iswap;
X_FLOAT _xprd,_yprd,_zprd,_xy,_xz,_yz;
X_FLOAT _pbc[6];
AtomVecAtomicKokkos_PackCommSelf(
const typename DAT::tdual_x_array &x,
const int &nfirst,
const typename DAT::tdual_int_2d &list,
const int & iswap,
const X_FLOAT &xprd, const X_FLOAT &yprd, const X_FLOAT &zprd,
const X_FLOAT &xy, const X_FLOAT &xz, const X_FLOAT &yz, const int* const pbc):
_x(x.view<DeviceType>()),_xw(x.view<DeviceType>()),_nfirst(nfirst),_list(list.view<DeviceType>()),_iswap(iswap),
_xprd(xprd),_yprd(yprd),_zprd(zprd),
_xy(xy),_xz(xz),_yz(yz) {
_pbc[0] = pbc[0]; _pbc[1] = pbc[1]; _pbc[2] = pbc[2];
_pbc[3] = pbc[3]; _pbc[4] = pbc[4]; _pbc[5] = pbc[5];
};
KOKKOS_INLINE_FUNCTION
void operator() (const int& i) const {
const int j = _list(_iswap,i);
if (PBC_FLAG == 0) {
_xw(i+_nfirst,0) = _x(j,0);
_xw(i+_nfirst,1) = _x(j,1);
_xw(i+_nfirst,2) = _x(j,2);
} else {
if (TRICLINIC == 0) {
_xw(i+_nfirst,0) = _x(j,0) + _pbc[0]*_xprd;
_xw(i+_nfirst,1) = _x(j,1) + _pbc[1]*_yprd;
_xw(i+_nfirst,2) = _x(j,2) + _pbc[2]*_zprd;
} else {
_xw(i+_nfirst,0) = _x(j,0) + _pbc[0]*_xprd + _pbc[5]*_xy + _pbc[4]*_xz;
_xw(i+_nfirst,1) = _x(j,1) + _pbc[1]*_yprd + _pbc[3]*_yz;
_xw(i+_nfirst,2) = _x(j,2) + _pbc[2]*_zprd;
}
}
}
};
/* ---------------------------------------------------------------------- */
int AtomVecAtomicKokkos::pack_comm_self(const int &n, const DAT::tdual_int_2d &list, const int & iswap,
const int nfirst, const int &pbc_flag, const int* const pbc) {
if(commKK->forward_comm_on_host) {
sync(Host,X_MASK);
modified(Host,X_MASK);
if(pbc_flag) {
if(domain->triclinic) {
struct AtomVecAtomicKokkos_PackCommSelf<LMPHostType,1,1> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecAtomicKokkos_PackCommSelf<LMPHostType,1,0> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
} else {
if(domain->triclinic) {
struct AtomVecAtomicKokkos_PackCommSelf<LMPHostType,0,1> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecAtomicKokkos_PackCommSelf<LMPHostType,0,0> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
}
LMPHostType::fence();
} else {
sync(Device,X_MASK);
modified(Device,X_MASK);
if(pbc_flag) {
if(domain->triclinic) {
struct AtomVecAtomicKokkos_PackCommSelf<LMPDeviceType,1,1> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecAtomicKokkos_PackCommSelf<LMPDeviceType,1,0> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
} else {
if(domain->triclinic) {
struct AtomVecAtomicKokkos_PackCommSelf<LMPDeviceType,0,1> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecAtomicKokkos_PackCommSelf<LMPDeviceType,0,0> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
}
LMPDeviceType::fence();
}
return n*3;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
struct AtomVecAtomicKokkos_UnpackComm {
typedef DeviceType device_type;
typename ArrayTypes<DeviceType>::t_x_array _x;
typename ArrayTypes<DeviceType>::t_xfloat_2d_const _buf;
int _first;
AtomVecAtomicKokkos_UnpackComm(
const typename DAT::tdual_x_array &x,
const typename DAT::tdual_xfloat_2d &buf,
const int& first):_x(x.view<DeviceType>()),_buf(buf.view<DeviceType>()),
_first(first) {};
KOKKOS_INLINE_FUNCTION
void operator() (const int& i) const {
_x(i+_first,0) = _buf(i,0);
_x(i+_first,1) = _buf(i,1);
_x(i+_first,2) = _buf(i,2);
}
};
/* ---------------------------------------------------------------------- */
void AtomVecAtomicKokkos::unpack_comm_kokkos(const int &n, const int &first,
const DAT::tdual_xfloat_2d &buf ) {
if(commKK->forward_comm_on_host) {
sync(Host,X_MASK);
modified(Host,X_MASK);
struct AtomVecAtomicKokkos_UnpackComm<LMPHostType> f(atomKK->k_x,buf,first);
Kokkos::parallel_for(n,f);
LMPDeviceType::fence();
} else {
sync(Device,X_MASK);
modified(Device,X_MASK);
struct AtomVecAtomicKokkos_UnpackComm<LMPDeviceType> f(atomKK->k_x,buf,first);
Kokkos::parallel_for(n,f);
LMPDeviceType::fence();
}
}
/* ---------------------------------------------------------------------- */
int AtomVecAtomicKokkos::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0);
buf[m++] = h_x(j,1);
buf[m++] = h_x(j,2);
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
dz = pbc[2]*domain->zprd;
}
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0) + dx;
buf[m++] = h_x(j,1) + dy;
buf[m++] = h_x(j,2) + dz;
}
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecAtomicKokkos::pack_comm_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz,dvx,dvy,dvz;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0);
buf[m++] = h_x(j,1);
buf[m++] = h_x(j,2);
buf[m++] = h_v(j,0);
buf[m++] = h_v(j,1);
buf[m++] = h_v(j,2);
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
dz = pbc[2]*domain->zprd;
}
if (!deform_vremap) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0) + dx;
buf[m++] = h_x(j,1) + dy;
buf[m++] = h_x(j,2) + dz;
buf[m++] = h_v(j,0);
buf[m++] = h_v(j,1);
buf[m++] = h_v(j,2);
}
} else {
dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
dvz = pbc[2]*h_rate[2];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0) + dx;
buf[m++] = h_x(j,1) + dy;
buf[m++] = h_x(j,2) + dz;
if (mask[i] & deform_groupbit) {
buf[m++] = h_v(j,0) + dvx;
buf[m++] = h_v(j,1) + dvy;
buf[m++] = h_v(j,2) + dvz;
} else {
buf[m++] = h_v(j,0);
buf[m++] = h_v(j,1);
buf[m++] = h_v(j,2);
}
}
}
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecAtomicKokkos::unpack_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
h_x(i,0) = buf[m++];
h_x(i,1) = buf[m++];
h_x(i,2) = buf[m++];
}
}
/* ---------------------------------------------------------------------- */
void AtomVecAtomicKokkos::unpack_comm_vel(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
h_x(i,0) = buf[m++];
h_x(i,1) = buf[m++];
h_x(i,2) = buf[m++];
h_v(i,0) = buf[m++];
h_v(i,1) = buf[m++];
h_v(i,2) = buf[m++];
}
}
/* ---------------------------------------------------------------------- */
int AtomVecAtomicKokkos::pack_reverse(int n, int first, double *buf)
{
if(n > 0)
sync(Host,F_MASK);
int m = 0;
const int last = first + n;
for (int i = first; i < last; i++) {
buf[m++] = h_f(i,0);
buf[m++] = h_f(i,1);
buf[m++] = h_f(i,2);
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecAtomicKokkos::unpack_reverse(int n, int *list, double *buf)
{
if(n > 0) {
sync(Host,F_MASK);
modified(Host,F_MASK);
}
int m = 0;
for (int i = 0; i < n; i++) {
const int j = list[i];
h_f(j,0) += buf[m++];
h_f(j,1) += buf[m++];
h_f(j,2) += buf[m++];
}
}
/* ---------------------------------------------------------------------- */
template<class DeviceType,int PBC_FLAG>
struct AtomVecAtomicKokkos_PackBorder {
typedef DeviceType device_type;
typename ArrayTypes<DeviceType>::t_xfloat_2d _buf;
const typename ArrayTypes<DeviceType>::t_int_2d_const _list;
const int _iswap;
const typename ArrayTypes<DeviceType>::t_x_array_randomread _x;
const typename ArrayTypes<DeviceType>::t_tagint_1d _tag;
const typename ArrayTypes<DeviceType>::t_int_1d _type;
const typename ArrayTypes<DeviceType>::t_int_1d _mask;
X_FLOAT _dx,_dy,_dz;
AtomVecAtomicKokkos_PackBorder(
const typename ArrayTypes<DeviceType>::t_xfloat_2d &buf,
const typename ArrayTypes<DeviceType>::t_int_2d_const &list,
const int & iswap,
const typename ArrayTypes<DeviceType>::t_x_array &x,
const typename ArrayTypes<DeviceType>::t_tagint_1d &tag,
const typename ArrayTypes<DeviceType>::t_int_1d &type,
const typename ArrayTypes<DeviceType>::t_int_1d &mask,
const X_FLOAT &dx, const X_FLOAT &dy, const X_FLOAT &dz):
_buf(buf),_list(list),_iswap(iswap),
_x(x),_tag(tag),_type(type),_mask(mask),
_dx(dx),_dy(dy),_dz(dz) {}
KOKKOS_INLINE_FUNCTION
void operator() (const int& i) const {
const int j = _list(_iswap,i);
if (PBC_FLAG == 0) {
_buf(i,0) = _x(j,0);
_buf(i,1) = _x(j,1);
_buf(i,2) = _x(j,2);
_buf(i,3) = _tag(j);
_buf(i,4) = _type(j);
_buf(i,5) = _mask(j);
} else {
_buf(i,0) = _x(j,0) + _dx;
_buf(i,1) = _x(j,1) + _dy;
_buf(i,2) = _x(j,2) + _dz;
_buf(i,3) = _tag(j);
_buf(i,4) = _type(j);
_buf(i,5) = _mask(j);
}
}
};
/* ---------------------------------------------------------------------- */
int AtomVecAtomicKokkos::pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap,
int pbc_flag, int *pbc, ExecutionSpace space)
{
X_FLOAT dx,dy,dz;
if (pbc_flag != 0) {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0];
dy = pbc[1];
dz = pbc[2];
}
if(space==Host) {
AtomVecAtomicKokkos_PackBorder<LMPHostType,1> f(
buf.view<LMPHostType>(), k_sendlist.view<LMPHostType>(),
iswap,h_x,h_tag,h_type,h_mask,dx,dy,dz);
Kokkos::parallel_for(n,f);
LMPHostType::fence();
} else {
AtomVecAtomicKokkos_PackBorder<LMPDeviceType,1> f(
buf.view<LMPDeviceType>(), k_sendlist.view<LMPDeviceType>(),
iswap,d_x,d_tag,d_type,d_mask,dx,dy,dz);
Kokkos::parallel_for(n,f);
LMPDeviceType::fence();
}
} else {
dx = dy = dz = 0;
if(space==Host) {
AtomVecAtomicKokkos_PackBorder<LMPHostType,0> f(
buf.view<LMPHostType>(), k_sendlist.view<LMPHostType>(),
iswap,h_x,h_tag,h_type,h_mask,dx,dy,dz);
Kokkos::parallel_for(n,f);
LMPHostType::fence();
} else {
AtomVecAtomicKokkos_PackBorder<LMPDeviceType,0> f(
buf.view<LMPDeviceType>(), k_sendlist.view<LMPDeviceType>(),
iswap,d_x,d_tag,d_type,d_mask,dx,dy,dz);
Kokkos::parallel_for(n,f);
LMPDeviceType::fence();
}
}
return n*6;
}
/* ---------------------------------------------------------------------- */
int AtomVecAtomicKokkos::pack_border(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0);
buf[m++] = h_x(j,1);
buf[m++] = h_x(j,2);
buf[m++] = ubuf(h_tag(j)).d;
buf[m++] = ubuf(h_type(j)).d;
buf[m++] = ubuf(h_mask(j)).d;
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0];
dy = pbc[1];
dz = pbc[2];
}
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0) + dx;
buf[m++] = h_x(j,1) + dy;
buf[m++] = h_x(j,2) + dz;
buf[m++] = ubuf(h_tag(j)).d;
buf[m++] = ubuf(h_type(j)).d;
buf[m++] = ubuf(h_mask(j)).d;
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->pack_border(n,list,&buf[m]);
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecAtomicKokkos::pack_border_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz,dvx,dvy,dvz;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0);
buf[m++] = h_x(j,1);
buf[m++] = h_x(j,2);
buf[m++] = ubuf(h_tag(j)).d;
buf[m++] = ubuf(h_type(j)).d;
buf[m++] = ubuf(h_mask(j)).d;
buf[m++] = h_v(j,0);
buf[m++] = h_v(j,1);
buf[m++] = h_v(j,2);
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0];
dy = pbc[1];
dz = pbc[2];
}
if (!deform_vremap) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0) + dx;
buf[m++] = h_x(j,1) + dy;
buf[m++] = h_x(j,2) + dz;
buf[m++] = ubuf(h_tag(j)).d;
buf[m++] = ubuf(h_type(j)).d;
buf[m++] = ubuf(h_mask(j)).d;
buf[m++] = h_v(j,0);
buf[m++] = h_v(j,1);
buf[m++] = h_v(j,2);
}
} else {
dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
dvz = pbc[2]*h_rate[2];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0) + dx;
buf[m++] = h_x(j,1) + dy;
buf[m++] = h_x(j,2) + dz;
buf[m++] = ubuf(h_tag(j)).d;
buf[m++] = ubuf(h_type(j)).d;
buf[m++] = ubuf(h_mask(j)).d;
if (mask[i] & deform_groupbit) {
buf[m++] = h_v(j,0) + dvx;
buf[m++] = h_v(j,1) + dvy;
buf[m++] = h_v(j,2) + dvz;
} else {
buf[m++] = h_v(j,0);
buf[m++] = h_v(j,1);
buf[m++] = h_v(j,2);
}
}
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->pack_border(n,list,&buf[m]);
return m;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
struct AtomVecAtomicKokkos_UnpackBorder {
typedef DeviceType device_type;
const typename ArrayTypes<DeviceType>::t_xfloat_2d_const _buf;
typename ArrayTypes<DeviceType>::t_x_array _x;
typename ArrayTypes<DeviceType>::t_tagint_1d _tag;
typename ArrayTypes<DeviceType>::t_int_1d _type;
typename ArrayTypes<DeviceType>::t_int_1d _mask;
int _first;
AtomVecAtomicKokkos_UnpackBorder(
const typename ArrayTypes<DeviceType>::t_xfloat_2d_const &buf,
typename ArrayTypes<DeviceType>::t_x_array &x,
typename ArrayTypes<DeviceType>::t_tagint_1d &tag,
typename ArrayTypes<DeviceType>::t_int_1d &type,
typename ArrayTypes<DeviceType>::t_int_1d &mask,
const int& first):
_buf(buf),_x(x),_tag(tag),_type(type),_mask(mask),_first(first){
};
KOKKOS_INLINE_FUNCTION
void operator() (const int& i) const {
_x(i+_first,0) = _buf(i,0);
_x(i+_first,1) = _buf(i,1);
_x(i+_first,2) = _buf(i,2);
_tag(i+_first) = static_cast<int> (_buf(i,3));
_type(i+_first) = static_cast<int> (_buf(i,4));
_mask(i+_first) = static_cast<int> (_buf(i,5));
// printf("%i %i %lf %lf %lf %i BORDER\n",_tag(i+_first),i+_first,_x(i+_first,0),_x(i+_first,1),_x(i+_first,2),_type(i+_first));
}
};
/* ---------------------------------------------------------------------- */
void AtomVecAtomicKokkos::unpack_border_kokkos(const int &n, const int &first,
const DAT::tdual_xfloat_2d &buf,ExecutionSpace space) {
modified(space,X_MASK|TAG_MASK|TYPE_MASK|MASK_MASK);
while (first+n >= nmax) grow(0);
modified(space,X_MASK|TAG_MASK|TYPE_MASK|MASK_MASK);
if(space==Host) {
struct AtomVecAtomicKokkos_UnpackBorder<LMPHostType> f(buf.view<LMPHostType>(),h_x,h_tag,h_type,h_mask,first);
Kokkos::parallel_for(n,f);
LMPHostType::fence();
} else {
struct AtomVecAtomicKokkos_UnpackBorder<LMPDeviceType> f(buf.view<LMPDeviceType>(),d_x,d_tag,d_type,d_mask,first);
Kokkos::parallel_for(n,f);
LMPDeviceType::fence();
}
}
/* ---------------------------------------------------------------------- */
void AtomVecAtomicKokkos::unpack_border(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
if (i == nmax) grow(0);
modified(Host,X_MASK|TAG_MASK|TYPE_MASK|MASK_MASK);
h_x(i,0) = buf[m++];
h_x(i,1) = buf[m++];
h_x(i,2) = buf[m++];
h_tag(i) = (tagint) ubuf(buf[m++]).i;
h_type(i) = (int) ubuf(buf[m++]).i;
h_mask(i) = (int) ubuf(buf[m++]).i;
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->
unpack_border(n,first,&buf[m]);
}
/* ---------------------------------------------------------------------- */
void AtomVecAtomicKokkos::unpack_border_vel(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
if (i == nmax) grow(0);
h_x(i,0) = buf[m++];
h_x(i,1) = buf[m++];
h_x(i,2) = buf[m++];
h_tag(i) = (tagint) ubuf(buf[m++]).i;
h_type(i) = (int) ubuf(buf[m++]).i;
h_mask(i) = (int) ubuf(buf[m++]).i;
h_v(i,0) = buf[m++];
h_v(i,1) = buf[m++];
h_v(i,2) = buf[m++];
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->
unpack_border(n,first,&buf[m]);
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
struct AtomVecAtomicKokkos_PackExchangeFunctor {
typedef DeviceType device_type;
typedef ArrayTypes<DeviceType> AT;
typename AT::t_x_array_randomread _x;
typename AT::t_v_array_randomread _v;
typename AT::t_tagint_1d_randomread _tag;
typename AT::t_int_1d_randomread _type;
typename AT::t_int_1d_randomread _mask;
typename AT::t_imageint_1d_randomread _image;
typename AT::t_x_array _xw;
typename AT::t_v_array _vw;
typename AT::t_tagint_1d _tagw;
typename AT::t_int_1d _typew;
typename AT::t_int_1d _maskw;
typename AT::t_imageint_1d _imagew;
typename AT::t_xfloat_2d_um _buf;
typename AT::t_int_1d_const _sendlist;
typename AT::t_int_1d_const _copylist;
int _nlocal,_dim;
X_FLOAT _lo,_hi;
AtomVecAtomicKokkos_PackExchangeFunctor(
const AtomKokkos* atom,
const typename AT::tdual_xfloat_2d buf,
typename AT::tdual_int_1d sendlist,
typename AT::tdual_int_1d copylist,int nlocal, int dim,
X_FLOAT lo, X_FLOAT hi):
_x(atom->k_x.view<DeviceType>()),
_v(atom->k_v.view<DeviceType>()),
_tag(atom->k_tag.view<DeviceType>()),
_type(atom->k_type.view<DeviceType>()),
_mask(atom->k_mask.view<DeviceType>()),
_image(atom->k_image.view<DeviceType>()),
_xw(atom->k_x.view<DeviceType>()),
_vw(atom->k_v.view<DeviceType>()),
_tagw(atom->k_tag.view<DeviceType>()),
_typew(atom->k_type.view<DeviceType>()),
_maskw(atom->k_mask.view<DeviceType>()),
_imagew(atom->k_image.view<DeviceType>()),
_sendlist(sendlist.template view<DeviceType>()),
_copylist(copylist.template view<DeviceType>()),
_nlocal(nlocal),_dim(dim),
_lo(lo),_hi(hi){
const size_t elements = 11;
const int maxsendlist = (buf.template view<DeviceType>().dimension_0()*buf.template view<DeviceType>().dimension_1())/elements;
buffer_view<DeviceType>(_buf,buf,maxsendlist,elements);
}
KOKKOS_INLINE_FUNCTION
void operator() (const int &mysend) const {
const int i = _sendlist(mysend);
_buf(mysend,0) = 11;
_buf(mysend,1) = _x(i,0);
_buf(mysend,2) = _x(i,1);
_buf(mysend,3) = _x(i,2);
_buf(mysend,4) = _v(i,0);
_buf(mysend,5) = _v(i,1);
_buf(mysend,6) = _v(i,2);
_buf(mysend,7) = _tag[i];
_buf(mysend,8) = _type[i];
_buf(mysend,9) = _mask[i];
_buf(mysend,10) = _image[i];
const int j = _copylist(mysend);
if(j>-1) {
_xw(i,0) = _x(j,0);
_xw(i,1) = _x(j,1);
_xw(i,2) = _x(j,2);
_vw(i,0) = _v(j,0);
_vw(i,1) = _v(j,1);
_vw(i,2) = _v(j,2);
_tagw[i] = _tag(j);
_typew[i] = _type(j);
_maskw[i] = _mask(j);
_imagew[i] = _image(j);
}
}
};
/* ---------------------------------------------------------------------- */
int AtomVecAtomicKokkos::pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &k_buf, DAT::tdual_int_1d k_sendlist,DAT::tdual_int_1d k_copylist,ExecutionSpace space,int dim,X_FLOAT lo,X_FLOAT hi )
{
if(nsend > (int) (k_buf.view<LMPHostType>().dimension_0()*k_buf.view<LMPHostType>().dimension_1())/11) {
int newsize = nsend*11/k_buf.view<LMPHostType>().dimension_1()+1;
k_buf.resize(newsize,k_buf.view<LMPHostType>().dimension_1());
}
if(space == Host) {
AtomVecAtomicKokkos_PackExchangeFunctor<LMPHostType> f(atomKK,k_buf,k_sendlist,k_copylist,atom->nlocal,dim,lo,hi);
Kokkos::parallel_for(nsend,f);
LMPHostType::fence();
return nsend*11;
} else {
AtomVecAtomicKokkos_PackExchangeFunctor<LMPDeviceType> f(atomKK,k_buf,k_sendlist,k_copylist,atom->nlocal,dim,lo,hi);
Kokkos::parallel_for(nsend,f);
LMPDeviceType::fence();
return nsend*11;
}
}
/* ---------------------------------------------------------------------- */
int AtomVecAtomicKokkos::pack_exchange(int i, double *buf)
{
int m = 1;
buf[m++] = h_x(i,0);
buf[m++] = h_x(i,1);
buf[m++] = h_x(i,2);
buf[m++] = h_v(i,0);
buf[m++] = h_v(i,1);
buf[m++] = h_v(i,2);
buf[m++] = ubuf(h_tag(i)).d;
buf[m++] = ubuf(h_type(i)).d;
buf[m++] = ubuf(h_mask(i)).d;
buf[m++] = ubuf(h_image(i)).d;
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
buf[0] = m;
return m;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
struct AtomVecAtomicKokkos_UnpackExchangeFunctor {
typedef DeviceType device_type;
typedef ArrayTypes<DeviceType> AT;
typename AT::t_x_array _x;
typename AT::t_v_array _v;
typename AT::t_tagint_1d _tag;
typename AT::t_int_1d _type;
typename AT::t_int_1d _mask;
typename AT::t_imageint_1d _image;
typename AT::t_xfloat_2d_um _buf;
typename AT::t_int_1d _nlocal;
int _dim;
X_FLOAT _lo,_hi;
AtomVecAtomicKokkos_UnpackExchangeFunctor(
const AtomKokkos* atom,
const typename AT::tdual_xfloat_2d buf,
typename AT::tdual_int_1d nlocal,
int dim, X_FLOAT lo, X_FLOAT hi):
_x(atom->k_x.view<DeviceType>()),
_v(atom->k_v.view<DeviceType>()),
_tag(atom->k_tag.view<DeviceType>()),
_type(atom->k_type.view<DeviceType>()),
_mask(atom->k_mask.view<DeviceType>()),
_image(atom->k_image.view<DeviceType>()),
_nlocal(nlocal.template view<DeviceType>()),_dim(dim),
_lo(lo),_hi(hi){
const size_t elements = 11;
const int maxsendlist = (buf.template view<DeviceType>().dimension_0()*buf.template view<DeviceType>().dimension_1())/elements;
buffer_view<DeviceType>(_buf,buf,maxsendlist,elements);
}
KOKKOS_INLINE_FUNCTION
void operator() (const int &myrecv) const {
X_FLOAT x = _buf(myrecv,_dim+1);
if (x >= _lo && x < _hi) {
int i = Kokkos::atomic_fetch_add(&_nlocal(0),1);
_x(i,0) = _buf(myrecv,1);
_x(i,1) = _buf(myrecv,2);
_x(i,2) = _buf(myrecv,3);
_v(i,0) = _buf(myrecv,4);
_v(i,1) = _buf(myrecv,5);
_v(i,2) = _buf(myrecv,6);
_tag[i] = _buf(myrecv,7);
_type[i] = _buf(myrecv,8);
_mask[i] = _buf(myrecv,9);
_image[i] = _buf(myrecv,10);
}
}
};
/* ---------------------------------------------------------------------- */
int AtomVecAtomicKokkos::unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf,int nrecv,int nlocal,int dim,X_FLOAT lo,X_FLOAT hi,ExecutionSpace space) {
if(space == Host) {
k_count.h_view(0) = nlocal;
AtomVecAtomicKokkos_UnpackExchangeFunctor<LMPHostType> f(atomKK,k_buf,k_count,dim,lo,hi);
Kokkos::parallel_for(nrecv/11,f);
LMPHostType::fence();
return k_count.h_view(0);
} else {
k_count.h_view(0) = nlocal;
k_count.modify<LMPHostType>();
k_count.sync<LMPDeviceType>();
AtomVecAtomicKokkos_UnpackExchangeFunctor<LMPDeviceType> f(atomKK,k_buf,k_count,dim,lo,hi);
Kokkos::parallel_for(nrecv/11,f);
LMPDeviceType::fence();
k_count.modify<LMPDeviceType>();
k_count.sync<LMPHostType>();
return k_count.h_view(0);
}
}
/* ---------------------------------------------------------------------- */
int AtomVecAtomicKokkos::unpack_exchange(double *buf)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
modified(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK |
MASK_MASK | IMAGE_MASK);
int m = 1;
h_x(nlocal,0) = buf[m++];
h_x(nlocal,1) = buf[m++];
h_x(nlocal,2) = buf[m++];
h_v(nlocal,0) = buf[m++];
h_v(nlocal,1) = buf[m++];
h_v(nlocal,2) = buf[m++];
h_tag(nlocal) = (tagint) ubuf(buf[m++]).i;
h_type(nlocal) = (int) ubuf(buf[m++]).i;
h_mask(nlocal) = (int) ubuf(buf[m++]).i;
h_image(nlocal) = (imageint) ubuf(buf[m++]).i;
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
m += modify->fix[atom->extra_grow[iextra]]->
unpack_exchange(nlocal,&buf[m]);
atom->nlocal++;
return m;
}
/* ----------------------------------------------------------------------
size of restart data for all atoms owned by this proc
include extra data stored by fixes
------------------------------------------------------------------------- */
int AtomVecAtomicKokkos::size_restart()
{
int i;
int nlocal = atom->nlocal;
int n = 11 * nlocal;
if (atom->nextra_restart)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
for (i = 0; i < nlocal; i++)
n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
return n;
}
/* ----------------------------------------------------------------------
pack atom I's data for restart file including extra quantities
xyz must be 1st 3 values, so that read_restart can test on them
molecular types may be negative, but write as positive
------------------------------------------------------------------------- */
int AtomVecAtomicKokkos::pack_restart(int i, double *buf)
{
sync(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK |
MASK_MASK | IMAGE_MASK );
int m = 1;
buf[m++] = h_x(i,0);
buf[m++] = h_x(i,1);
buf[m++] = h_x(i,2);
buf[m++] = ubuf(h_tag(i)).d;
buf[m++] = ubuf(h_type(i)).d;
buf[m++] = ubuf(h_mask(i)).d;
buf[m++] = ubuf(h_image(i)).d;
buf[m++] = h_v(i,0);
buf[m++] = h_v(i,1);
buf[m++] = h_v(i,2);
if (atom->nextra_restart)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
buf[0] = m;
return m;
}
/* ----------------------------------------------------------------------
unpack data for one atom from restart file including extra quantities
------------------------------------------------------------------------- */
int AtomVecAtomicKokkos::unpack_restart(double *buf)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
modified(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK |
MASK_MASK | IMAGE_MASK );
int m = 1;
h_x(nlocal,0) = buf[m++];
h_x(nlocal,1) = buf[m++];
h_x(nlocal,2) = buf[m++];
h_tag(nlocal) = (tagint) ubuf(buf[m++]).i;
h_type(nlocal) = (int) ubuf(buf[m++]).i;
h_mask(nlocal) = (int) ubuf(buf[m++]).i;
h_image(nlocal) = (imageint) ubuf(buf[m++]).i;
h_v(nlocal,0) = buf[m++];
h_v(nlocal,1) = buf[m++];
h_v(nlocal,2) = buf[m++];
double **extra = atom->extra;
if (atom->nextra_store) {
int size = static_cast<int> (ubuf(buf[m++]).i) - m;
for (int i = 0; i < size; i++) extra[nlocal][i] = buf[m++];
}
atom->nlocal++;
return m;
}
/* ----------------------------------------------------------------------
create one atom of itype at coord
set other values to defaults
------------------------------------------------------------------------- */
void AtomVecAtomicKokkos::create_atom(int itype, double *coord)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) {
//if(nlocal>2) printf("typeA: %i %i\n",type[0],type[1]);
atomKK->modified(Host,ALL_MASK);
grow(0);
//if(nlocal>2) printf("typeB: %i %i\n",type[0],type[1]);
}
atomKK->modified(Host,ALL_MASK);
tag[nlocal] = 0;
type[nlocal] = itype;
h_x(nlocal,0) = coord[0];
h_x(nlocal,1) = coord[1];
h_x(nlocal,2) = coord[2];
h_mask[nlocal] = 1;
h_image[nlocal] = ((tagint) IMGMAX << IMG2BITS) |
((tagint) IMGMAX << IMGBITS) | IMGMAX;
h_v(nlocal,0) = 0.0;
h_v(nlocal,1) = 0.0;
h_v(nlocal,2) = 0.0;
atom->nlocal++;
}
/* ----------------------------------------------------------------------
unpack one line from Atoms section of data file
initialize other atom quantities
------------------------------------------------------------------------- */
void AtomVecAtomicKokkos::data_atom(double *coord, tagint imagetmp,
char **values)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
h_tag[nlocal] = atoi(values[0]);
h_type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
h_x(nlocal,0) = coord[0];
h_x(nlocal,1) = coord[1];
h_x(nlocal,2) = coord[2];
h_image[nlocal] = imagetmp;
h_mask[nlocal] = 1;
h_v(nlocal,0) = 0.0;
h_v(nlocal,1) = 0.0;
h_v(nlocal,2) = 0.0;
+ atomKK->modified(Host,ALL_MASK);
+
atom->nlocal++;
}
/* ----------------------------------------------------------------------
pack atom info for data file including 3 image flags
------------------------------------------------------------------------- */
void AtomVecAtomicKokkos::pack_data(double **buf)
{
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
buf[i][0] = h_tag[i];
buf[i][1] = h_type[i];
buf[i][2] = h_x(i,0);
buf[i][3] = h_x(i,1);
buf[i][4] = h_x(i,2);
buf[i][5] = (h_image[i] & IMGMASK) - IMGMAX;
buf[i][6] = (h_image[i] >> IMGBITS & IMGMASK) - IMGMAX;
buf[i][7] = (h_image[i] >> IMG2BITS) - IMGMAX;
}
}
/* ----------------------------------------------------------------------
write atom info to data file including 3 image flags
------------------------------------------------------------------------- */
void AtomVecAtomicKokkos::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
(int) buf[i][0],(int) buf[i][1],buf[i][2],buf[i][3],buf[i][4],
(int) buf[i][5],(int) buf[i][6],(int) buf[i][7]);
}
/* ----------------------------------------------------------------------
return # of bytes of allocated memory
------------------------------------------------------------------------- */
bigint AtomVecAtomicKokkos::memory_usage()
{
bigint bytes = 0;
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax*commKK->nthreads,3);
return bytes;
}
/* ---------------------------------------------------------------------- */
void AtomVecAtomicKokkos::sync(ExecutionSpace space, unsigned int mask)
{
if (space == Device) {
if (mask & X_MASK) atomKK->k_x.sync<LMPDeviceType>();
if (mask & V_MASK) atomKK->k_v.sync<LMPDeviceType>();
if (mask & F_MASK) atomKK->k_f.sync<LMPDeviceType>();
if (mask & TAG_MASK) atomKK->k_tag.sync<LMPDeviceType>();
if (mask & TYPE_MASK) atomKK->k_type.sync<LMPDeviceType>();
if (mask & MASK_MASK) atomKK->k_mask.sync<LMPDeviceType>();
if (mask & IMAGE_MASK) atomKK->k_image.sync<LMPDeviceType>();
} else {
if (mask & X_MASK) atomKK->k_x.sync<LMPHostType>();
if (mask & V_MASK) atomKK->k_v.sync<LMPHostType>();
if (mask & F_MASK) atomKK->k_f.sync<LMPHostType>();
if (mask & TAG_MASK) atomKK->k_tag.sync<LMPHostType>();
if (mask & TYPE_MASK) atomKK->k_type.sync<LMPHostType>();
if (mask & MASK_MASK) atomKK->k_mask.sync<LMPHostType>();
if (mask & IMAGE_MASK) atomKK->k_image.sync<LMPHostType>();
}
}
/* ---------------------------------------------------------------------- */
void AtomVecAtomicKokkos::modified(ExecutionSpace space, unsigned int mask)
{
if (space == Device) {
if (mask & X_MASK) atomKK->k_x.modify<LMPDeviceType>();
if (mask & V_MASK) atomKK->k_v.modify<LMPDeviceType>();
if (mask & F_MASK) atomKK->k_f.modify<LMPDeviceType>();
if (mask & TAG_MASK) atomKK->k_tag.modify<LMPDeviceType>();
if (mask & TYPE_MASK) atomKK->k_type.modify<LMPDeviceType>();
if (mask & MASK_MASK) atomKK->k_mask.modify<LMPDeviceType>();
if (mask & IMAGE_MASK) atomKK->k_image.modify<LMPDeviceType>();
} else {
if (mask & X_MASK) atomKK->k_x.modify<LMPHostType>();
if (mask & V_MASK) atomKK->k_v.modify<LMPHostType>();
if (mask & F_MASK) atomKK->k_f.modify<LMPHostType>();
if (mask & TAG_MASK) atomKK->k_tag.modify<LMPHostType>();
if (mask & TYPE_MASK) atomKK->k_type.modify<LMPHostType>();
if (mask & MASK_MASK) atomKK->k_mask.modify<LMPHostType>();
if (mask & IMAGE_MASK) atomKK->k_image.modify<LMPHostType>();
}
}
diff --git a/src/KOKKOS/atom_vec_charge_kokkos.cpp b/src/KOKKOS/atom_vec_charge_kokkos.cpp
index 34e7bbae9..87e9ac1cf 100644
--- a/src/KOKKOS/atom_vec_charge_kokkos.cpp
+++ b/src/KOKKOS/atom_vec_charge_kokkos.cpp
@@ -1,1520 +1,1522 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <stdlib.h>
#include "atom_vec_charge_kokkos.h"
#include "atom_kokkos.h"
#include "comm_kokkos.h"
#include "domain.h"
#include "modify.h"
#include "fix.h"
#include "atom_masks.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define DELTA 10000
/* ---------------------------------------------------------------------- */
AtomVecChargeKokkos::AtomVecChargeKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp)
{
molecular = 0;
mass_type = 1;
comm_x_only = comm_f_only = 1;
size_forward = 3;
size_reverse = 3;
size_border = 7;
size_velocity = 3;
size_data_atom = 6;
size_data_vel = 4;
xcol_data = 4;
atom->q_flag = 1;
k_count = DAT::tdual_int_1d("atom::k_count",1);
atomKK = (AtomKokkos *) atom;
commKK = (CommKokkos *) comm;
}
/* ----------------------------------------------------------------------
grow atom arrays
n = 0 grows arrays by DELTA
n > 0 allocates arrays to size n
------------------------------------------------------------------------- */
void AtomVecChargeKokkos::grow(int n)
{
if (n == 0) nmax += DELTA;
else nmax = n;
atomKK->nmax = nmax;
if (nmax < 0 || nmax > MAXSMALLINT)
error->one(FLERR,"Per-processor system is too big");
sync(Device,ALL_MASK);
modified(Device,ALL_MASK);
memory->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag");
memory->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type");
memory->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask");
memory->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image");
memory->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x");
memory->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v");
memory->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f");
memory->grow_kokkos(atomKK->k_q,atomKK->q,nmax,"atom:q");
grow_reset();
sync(Host,ALL_MASK);
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecChargeKokkos::grow_reset()
{
tag = atomKK->tag;
d_tag = atomKK->k_tag.d_view;
h_tag = atomKK->k_tag.h_view;
type = atomKK->type;
d_type = atomKK->k_type.d_view;
h_type = atomKK->k_type.h_view;
mask = atomKK->mask;
d_mask = atomKK->k_mask.d_view;
h_mask = atomKK->k_mask.h_view;
image = atomKK->image;
d_image = atomKK->k_image.d_view;
h_image = atomKK->k_image.h_view;
x = atomKK->x;
d_x = atomKK->k_x.d_view;
h_x = atomKK->k_x.h_view;
v = atomKK->v;
d_v = atomKK->k_v.d_view;
h_v = atomKK->k_v.h_view;
f = atomKK->f;
d_f = atomKK->k_f.d_view;
h_f = atomKK->k_f.h_view;
q = atomKK->q;
d_q = atomKK->k_q.d_view;
h_q = atomKK->k_q.h_view;
}
/* ----------------------------------------------------------------------
copy atom I info to atom J
------------------------------------------------------------------------- */
void AtomVecChargeKokkos::copy(int i, int j, int delflag)
{
h_tag[j] = h_tag[i];
h_type[j] = h_type[i];
mask[j] = mask[i];
h_image[j] = h_image[i];
h_x(j,0) = h_x(i,0);
h_x(j,1) = h_x(i,1);
h_x(j,2) = h_x(i,2);
h_v(j,0) = h_v(i,0);
h_v(j,1) = h_v(i,1);
h_v(j,2) = h_v(i,2);
h_q[j] = h_q[i];
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j,delflag);
}
/* ---------------------------------------------------------------------- */
template<class DeviceType,int PBC_FLAG,int TRICLINIC>
struct AtomVecChargeKokkos_PackComm {
typedef DeviceType device_type;
typename ArrayTypes<DeviceType>::t_x_array_randomread _x;
typename ArrayTypes<DeviceType>::t_xfloat_2d_um _buf;
typename ArrayTypes<DeviceType>::t_int_2d_const _list;
const int _iswap;
X_FLOAT _xprd,_yprd,_zprd,_xy,_xz,_yz;
X_FLOAT _pbc[6];
AtomVecChargeKokkos_PackComm(
const typename DAT::tdual_x_array &x,
const typename DAT::tdual_xfloat_2d &buf,
const typename DAT::tdual_int_2d &list,
const int & iswap,
const X_FLOAT &xprd, const X_FLOAT &yprd, const X_FLOAT &zprd,
const X_FLOAT &xy, const X_FLOAT &xz, const X_FLOAT &yz, const int* const pbc):
_x(x.view<DeviceType>()),_list(list.view<DeviceType>()),_iswap(iswap),
_xprd(xprd),_yprd(yprd),_zprd(zprd),
_xy(xy),_xz(xz),_yz(yz) {
const size_t maxsend = (buf.view<DeviceType>().dimension_0()*buf.view<DeviceType>().dimension_1())/3;
const size_t elements = 3;
buffer_view<DeviceType>(_buf,buf,maxsend,elements);
_pbc[0] = pbc[0]; _pbc[1] = pbc[1]; _pbc[2] = pbc[2];
_pbc[3] = pbc[3]; _pbc[4] = pbc[4]; _pbc[5] = pbc[5];
};
KOKKOS_INLINE_FUNCTION
void operator() (const int& i) const {
const int j = _list(_iswap,i);
if (PBC_FLAG == 0) {
_buf(i,0) = _x(j,0);
_buf(i,1) = _x(j,1);
_buf(i,2) = _x(j,2);
} else {
if (TRICLINIC == 0) {
_buf(i,0) = _x(j,0) + _pbc[0]*_xprd;
_buf(i,1) = _x(j,1) + _pbc[1]*_yprd;
_buf(i,2) = _x(j,2) + _pbc[2]*_zprd;
} else {
_buf(i,0) = _x(j,0) + _pbc[0]*_xprd + _pbc[5]*_xy + _pbc[4]*_xz;
_buf(i,1) = _x(j,1) + _pbc[1]*_yprd + _pbc[3]*_yz;
_buf(i,2) = _x(j,2) + _pbc[2]*_zprd;
}
}
}
};
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_comm_kokkos(const int &n,
const DAT::tdual_int_2d &list,
const int & iswap,
const DAT::tdual_xfloat_2d &buf,
const int &pbc_flag,
const int* const pbc)
{
// Check whether to always run forward communication on the host
// Choose correct forward PackComm kernel
if(commKK->forward_comm_on_host) {
sync(Host,X_MASK);
if(pbc_flag) {
if(domain->triclinic) {
struct AtomVecChargeKokkos_PackComm<LMPHostType,1,1> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecChargeKokkos_PackComm<LMPHostType,1,0> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
} else {
if(domain->triclinic) {
struct AtomVecChargeKokkos_PackComm<LMPHostType,0,1> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecChargeKokkos_PackComm<LMPHostType,0,0> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
}
LMPHostType::fence();
} else {
sync(Device,X_MASK);
if(pbc_flag) {
if(domain->triclinic) {
struct AtomVecChargeKokkos_PackComm<LMPDeviceType,1,1> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecChargeKokkos_PackComm<LMPDeviceType,1,0> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
} else {
if(domain->triclinic) {
struct AtomVecChargeKokkos_PackComm<LMPDeviceType,0,1> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecChargeKokkos_PackComm<LMPDeviceType,0,0> f(atomKK->k_x,buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
}
LMPDeviceType::fence();
}
return n*size_forward;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType,int PBC_FLAG,int TRICLINIC>
struct AtomVecChargeKokkos_PackCommSelf {
typedef DeviceType device_type;
typename ArrayTypes<DeviceType>::t_x_array_randomread _x;
typename ArrayTypes<DeviceType>::t_x_array _xw;
int _nfirst;
typename ArrayTypes<DeviceType>::t_int_2d_const _list;
const int _iswap;
X_FLOAT _xprd,_yprd,_zprd,_xy,_xz,_yz;
X_FLOAT _pbc[6];
AtomVecChargeKokkos_PackCommSelf(
const typename DAT::tdual_x_array &x,
const int &nfirst,
const typename DAT::tdual_int_2d &list,
const int & iswap,
const X_FLOAT &xprd, const X_FLOAT &yprd, const X_FLOAT &zprd,
const X_FLOAT &xy, const X_FLOAT &xz, const X_FLOAT &yz, const int* const pbc):
_x(x.view<DeviceType>()),_xw(x.view<DeviceType>()),_nfirst(nfirst),_list(list.view<DeviceType>()),_iswap(iswap),
_xprd(xprd),_yprd(yprd),_zprd(zprd),
_xy(xy),_xz(xz),_yz(yz) {
_pbc[0] = pbc[0]; _pbc[1] = pbc[1]; _pbc[2] = pbc[2];
_pbc[3] = pbc[3]; _pbc[4] = pbc[4]; _pbc[5] = pbc[5];
};
KOKKOS_INLINE_FUNCTION
void operator() (const int& i) const {
const int j = _list(_iswap,i);
if (PBC_FLAG == 0) {
_xw(i+_nfirst,0) = _x(j,0);
_xw(i+_nfirst,1) = _x(j,1);
_xw(i+_nfirst,2) = _x(j,2);
} else {
if (TRICLINIC == 0) {
_xw(i+_nfirst,0) = _x(j,0) + _pbc[0]*_xprd;
_xw(i+_nfirst,1) = _x(j,1) + _pbc[1]*_yprd;
_xw(i+_nfirst,2) = _x(j,2) + _pbc[2]*_zprd;
} else {
_xw(i+_nfirst,0) = _x(j,0) + _pbc[0]*_xprd + _pbc[5]*_xy + _pbc[4]*_xz;
_xw(i+_nfirst,1) = _x(j,1) + _pbc[1]*_yprd + _pbc[3]*_yz;
_xw(i+_nfirst,2) = _x(j,2) + _pbc[2]*_zprd;
}
}
}
};
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_comm_self(const int &n, const DAT::tdual_int_2d &list, const int & iswap,
const int nfirst, const int &pbc_flag, const int* const pbc) {
if(commKK->forward_comm_on_host) {
sync(Host,X_MASK);
modified(Host,X_MASK);
if(pbc_flag) {
if(domain->triclinic) {
struct AtomVecChargeKokkos_PackCommSelf<LMPHostType,1,1> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecChargeKokkos_PackCommSelf<LMPHostType,1,0> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
} else {
if(domain->triclinic) {
struct AtomVecChargeKokkos_PackCommSelf<LMPHostType,0,1> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecChargeKokkos_PackCommSelf<LMPHostType,0,0> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
}
LMPHostType::fence();
} else {
sync(Device,X_MASK);
modified(Device,X_MASK);
if(pbc_flag) {
if(domain->triclinic) {
struct AtomVecChargeKokkos_PackCommSelf<LMPDeviceType,1,1> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecChargeKokkos_PackCommSelf<LMPDeviceType,1,0> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
} else {
if(domain->triclinic) {
struct AtomVecChargeKokkos_PackCommSelf<LMPDeviceType,0,1> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecChargeKokkos_PackCommSelf<LMPDeviceType,0,0> f(atomKK->k_x,nfirst,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc);
Kokkos::parallel_for(n,f);
}
}
LMPDeviceType::fence();
}
return n*3;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
struct AtomVecChargeKokkos_UnpackComm {
typedef DeviceType device_type;
typename ArrayTypes<DeviceType>::t_x_array _x;
typename ArrayTypes<DeviceType>::t_xfloat_2d_const _buf;
int _first;
AtomVecChargeKokkos_UnpackComm(
const typename DAT::tdual_x_array &x,
const typename DAT::tdual_xfloat_2d &buf,
const int& first):_x(x.view<DeviceType>()),_buf(buf.view<DeviceType>()),
_first(first) {};
KOKKOS_INLINE_FUNCTION
void operator() (const int& i) const {
_x(i+_first,0) = _buf(i,0);
_x(i+_first,1) = _buf(i,1);
_x(i+_first,2) = _buf(i,2);
}
};
/* ---------------------------------------------------------------------- */
void AtomVecChargeKokkos::unpack_comm_kokkos(const int &n, const int &first,
const DAT::tdual_xfloat_2d &buf ) {
if(commKK->forward_comm_on_host) {
sync(Host,X_MASK);
modified(Host,X_MASK);
struct AtomVecChargeKokkos_UnpackComm<LMPHostType> f(atomKK->k_x,buf,first);
Kokkos::parallel_for(n,f);
LMPDeviceType::fence();
} else {
sync(Device,X_MASK);
modified(Device,X_MASK);
struct AtomVecChargeKokkos_UnpackComm<LMPDeviceType> f(atomKK->k_x,buf,first);
Kokkos::parallel_for(n,f);
LMPDeviceType::fence();
}
}
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0);
buf[m++] = h_x(j,1);
buf[m++] = h_x(j,2);
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
dz = pbc[2]*domain->zprd;
}
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0) + dx;
buf[m++] = h_x(j,1) + dy;
buf[m++] = h_x(j,2) + dz;
}
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_comm_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz,dvx,dvy,dvz;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0);
buf[m++] = h_x(j,1);
buf[m++] = h_x(j,2);
buf[m++] = h_v(j,0);
buf[m++] = h_v(j,1);
buf[m++] = h_v(j,2);
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
dz = pbc[2]*domain->zprd;
}
if (!deform_vremap) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0) + dx;
buf[m++] = h_x(j,1) + dy;
buf[m++] = h_x(j,2) + dz;
buf[m++] = h_v(j,0);
buf[m++] = h_v(j,1);
buf[m++] = h_v(j,2);
}
} else {
dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
dvz = pbc[2]*h_rate[2];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0) + dx;
buf[m++] = h_x(j,1) + dy;
buf[m++] = h_x(j,2) + dz;
if (mask[i] & deform_groupbit) {
buf[m++] = h_v(j,0) + dvx;
buf[m++] = h_v(j,1) + dvy;
buf[m++] = h_v(j,2) + dvz;
} else {
buf[m++] = h_v(j,0);
buf[m++] = h_v(j,1);
buf[m++] = h_v(j,2);
}
}
}
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecChargeKokkos::unpack_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
h_x(i,0) = buf[m++];
h_x(i,1) = buf[m++];
h_x(i,2) = buf[m++];
}
}
/* ---------------------------------------------------------------------- */
void AtomVecChargeKokkos::unpack_comm_vel(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
h_x(i,0) = buf[m++];
h_x(i,1) = buf[m++];
h_x(i,2) = buf[m++];
h_v(i,0) = buf[m++];
h_v(i,1) = buf[m++];
h_v(i,2) = buf[m++];
}
}
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_reverse(int n, int first, double *buf)
{
if(n > 0)
sync(Host,F_MASK);
int m = 0;
const int last = first + n;
for (int i = first; i < last; i++) {
buf[m++] = h_f(i,0);
buf[m++] = h_f(i,1);
buf[m++] = h_f(i,2);
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecChargeKokkos::unpack_reverse(int n, int *list, double *buf)
{
if(n > 0)
modified(Host,F_MASK);
int m = 0;
for (int i = 0; i < n; i++) {
const int j = list[i];
h_f(j,0) += buf[m++];
h_f(j,1) += buf[m++];
h_f(j,2) += buf[m++];
}
}
/* ---------------------------------------------------------------------- */
template<class DeviceType,int PBC_FLAG>
struct AtomVecChargeKokkos_PackBorder {
typedef DeviceType device_type;
typename ArrayTypes<DeviceType>::t_xfloat_2d _buf;
const typename ArrayTypes<DeviceType>::t_int_2d_const _list;
const int _iswap;
const typename ArrayTypes<DeviceType>::t_x_array_randomread _x;
const typename ArrayTypes<DeviceType>::t_tagint_1d _tag;
const typename ArrayTypes<DeviceType>::t_int_1d _type;
const typename ArrayTypes<DeviceType>::t_int_1d _mask;
const typename ArrayTypes<DeviceType>::t_float_1d _q;
X_FLOAT _dx,_dy,_dz;
AtomVecChargeKokkos_PackBorder(
const typename ArrayTypes<DeviceType>::t_xfloat_2d &buf,
const typename ArrayTypes<DeviceType>::t_int_2d_const &list,
const int & iswap,
const typename ArrayTypes<DeviceType>::t_x_array &x,
const typename ArrayTypes<DeviceType>::t_tagint_1d &tag,
const typename ArrayTypes<DeviceType>::t_int_1d &type,
const typename ArrayTypes<DeviceType>::t_int_1d &mask,
const typename ArrayTypes<DeviceType>::t_float_1d &q,
const X_FLOAT &dx, const X_FLOAT &dy, const X_FLOAT &dz):
_buf(buf),_list(list),_iswap(iswap),
_x(x),_tag(tag),_type(type),_mask(mask),_q(q),
_dx(dx),_dy(dy),_dz(dz) {}
KOKKOS_INLINE_FUNCTION
void operator() (const int& i) const {
const int j = _list(_iswap,i);
if (PBC_FLAG == 0) {
_buf(i,0) = _x(j,0);
_buf(i,1) = _x(j,1);
_buf(i,2) = _x(j,2);
_buf(i,3) = _tag(j);
_buf(i,4) = _type(j);
_buf(i,5) = _mask(j);
_buf(i,6) = _q(j);
} else {
_buf(i,0) = _x(j,0) + _dx;
_buf(i,1) = _x(j,1) + _dy;
_buf(i,2) = _x(j,2) + _dz;
_buf(i,3) = _tag(j);
_buf(i,4) = _type(j);
_buf(i,5) = _mask(j);
_buf(i,6) = _q(j);
}
}
};
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap,
int pbc_flag, int *pbc, ExecutionSpace space)
{
X_FLOAT dx,dy,dz;
if (pbc_flag != 0) {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0];
dy = pbc[1];
dz = pbc[2];
}
if(space==Host) {
AtomVecChargeKokkos_PackBorder<LMPHostType,1> f(
buf.view<LMPHostType>(), k_sendlist.view<LMPHostType>(),
iswap,h_x,h_tag,h_type,h_mask,h_q,dx,dy,dz);
Kokkos::parallel_for(n,f);
LMPHostType::fence();
} else {
AtomVecChargeKokkos_PackBorder<LMPDeviceType,1> f(
buf.view<LMPDeviceType>(), k_sendlist.view<LMPDeviceType>(),
iswap,d_x,d_tag,d_type,d_mask,d_q,dx,dy,dz);
Kokkos::parallel_for(n,f);
LMPDeviceType::fence();
}
} else {
dx = dy = dz = 0;
if(space==Host) {
AtomVecChargeKokkos_PackBorder<LMPHostType,0> f(
buf.view<LMPHostType>(), k_sendlist.view<LMPHostType>(),
iswap,h_x,h_tag,h_type,h_mask,h_q,dx,dy,dz);
Kokkos::parallel_for(n,f);
LMPHostType::fence();
} else {
AtomVecChargeKokkos_PackBorder<LMPDeviceType,0> f(
buf.view<LMPDeviceType>(), k_sendlist.view<LMPDeviceType>(),
iswap,d_x,d_tag,d_type,d_mask,d_q,dx,dy,dz);
Kokkos::parallel_for(n,f);
LMPDeviceType::fence();
}
}
return n*size_border;
}
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_border(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0);
buf[m++] = h_x(j,1);
buf[m++] = h_x(j,2);
buf[m++] = ubuf(h_tag(j)).d;
buf[m++] = ubuf(h_type(j)).d;
buf[m++] = ubuf(h_mask(j)).d;
buf[m++] = h_q(j);
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0];
dy = pbc[1];
dz = pbc[2];
}
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0) + dx;
buf[m++] = h_x(j,1) + dy;
buf[m++] = h_x(j,2) + dz;
buf[m++] = ubuf(h_tag(j)).d;
buf[m++] = ubuf(h_type(j)).d;
buf[m++] = ubuf(h_mask(j)).d;
buf[m++] = h_q(j);
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->pack_border(n,list,&buf[m]);
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_border_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz,dvx,dvy,dvz;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0);
buf[m++] = h_x(j,1);
buf[m++] = h_x(j,2);
buf[m++] = ubuf(h_tag(j)).d;
buf[m++] = ubuf(h_type(j)).d;
buf[m++] = ubuf(h_mask(j)).d;
buf[m++] = h_q[j];
buf[m++] = h_v(j,0);
buf[m++] = h_v(j,1);
buf[m++] = h_v(j,2);
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0];
dy = pbc[1];
dz = pbc[2];
}
if (!deform_vremap) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0) + dx;
buf[m++] = h_x(j,1) + dy;
buf[m++] = h_x(j,2) + dz;
buf[m++] = ubuf(h_tag(j)).d;
buf[m++] = ubuf(h_type(j)).d;
buf[m++] = ubuf(h_mask(j)).d;
buf[m++] = h_q[j];
buf[m++] = h_v(j,0);
buf[m++] = h_v(j,1);
buf[m++] = h_v(j,2);
}
} else {
dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
dvz = pbc[2]*h_rate[2];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_x(j,0) + dx;
buf[m++] = h_x(j,1) + dy;
buf[m++] = h_x(j,2) + dz;
buf[m++] = ubuf(h_tag(j)).d;
buf[m++] = ubuf(h_type(j)).d;
buf[m++] = ubuf(h_mask(j)).d;
buf[m++] = h_q[j];
if (mask[i] & deform_groupbit) {
buf[m++] = h_v(j,0) + dvx;
buf[m++] = h_v(j,1) + dvy;
buf[m++] = h_v(j,2) + dvz;
} else {
buf[m++] = h_v(j,0);
buf[m++] = h_v(j,1);
buf[m++] = h_v(j,2);
}
}
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->pack_border(n,list,&buf[m]);
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_border_hybrid(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = h_q[j];
}
return m;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
struct AtomVecChargeKokkos_UnpackBorder {
typedef DeviceType device_type;
const typename ArrayTypes<DeviceType>::t_xfloat_2d_const _buf;
typename ArrayTypes<DeviceType>::t_x_array _x;
typename ArrayTypes<DeviceType>::t_tagint_1d _tag;
typename ArrayTypes<DeviceType>::t_int_1d _type;
typename ArrayTypes<DeviceType>::t_int_1d _mask;
typename ArrayTypes<DeviceType>::t_float_1d _q;
int _first;
AtomVecChargeKokkos_UnpackBorder(
const typename ArrayTypes<DeviceType>::t_xfloat_2d_const &buf,
typename ArrayTypes<DeviceType>::t_x_array &x,
typename ArrayTypes<DeviceType>::t_tagint_1d &tag,
typename ArrayTypes<DeviceType>::t_int_1d &type,
typename ArrayTypes<DeviceType>::t_int_1d &mask,
typename ArrayTypes<DeviceType>::t_float_1d &q,
const int& first):
_buf(buf),_x(x),_tag(tag),_type(type),_mask(mask),_q(q),_first(first){
};
KOKKOS_INLINE_FUNCTION
void operator() (const int& i) const {
_x(i+_first,0) = _buf(i,0);
_x(i+_first,1) = _buf(i,1);
_x(i+_first,2) = _buf(i,2);
_tag(i+_first) = static_cast<int> (_buf(i,3));
_type(i+_first) = static_cast<int> (_buf(i,4));
_mask(i+_first) = static_cast<int> (_buf(i,5));
_q(i+_first) = _buf(i,6);
}
};
/* ---------------------------------------------------------------------- */
void AtomVecChargeKokkos::unpack_border_kokkos(const int &n, const int &first,
const DAT::tdual_xfloat_2d &buf,ExecutionSpace space) {
if (first+n >= nmax) {
grow(first+n+100);
}
if(space==Host) {
struct AtomVecChargeKokkos_UnpackBorder<LMPHostType>
f(buf.view<LMPHostType>(),h_x,h_tag,h_type,h_mask,h_q,first);
Kokkos::parallel_for(n,f);
LMPHostType::fence();
} else {
struct AtomVecChargeKokkos_UnpackBorder<LMPDeviceType>
f(buf.view<LMPDeviceType>(),d_x,d_tag,d_type,d_mask,d_q,first);
Kokkos::parallel_for(n,f);
LMPDeviceType::fence();
}
modified(space,X_MASK|TAG_MASK|TYPE_MASK|MASK_MASK|Q_MASK);
}
/* ---------------------------------------------------------------------- */
void AtomVecChargeKokkos::unpack_border(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
if (i == nmax) {
grow(0);
}
modified(Host,X_MASK|TAG_MASK|TYPE_MASK|MASK_MASK|Q_MASK);
h_x(i,0) = buf[m++];
h_x(i,1) = buf[m++];
h_x(i,2) = buf[m++];
h_tag(i) = (tagint) ubuf(buf[m++]).i;
h_type(i) = (int) ubuf(buf[m++]).i;
h_mask(i) = (int) ubuf(buf[m++]).i;
h_q[i] = buf[m++];
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->
unpack_border(n,first,&buf[m]);
}
/* ---------------------------------------------------------------------- */
void AtomVecChargeKokkos::unpack_border_vel(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
if (i == nmax) grow(0);
h_x(i,0) = buf[m++];
h_x(i,1) = buf[m++];
h_x(i,2) = buf[m++];
h_tag(i) = (tagint) ubuf(buf[m++]).i;
h_type(i) = (int) ubuf(buf[m++]).i;
h_mask(i) = (int) ubuf(buf[m++]).i;
h_q[i] = buf[m++];
h_v(i,0) = buf[m++];
h_v(i,1) = buf[m++];
h_v(i,2) = buf[m++];
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->
unpack_border(n,first,&buf[m]);
}
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::unpack_border_hybrid(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++)
h_q[i] = buf[m++];
return m;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
struct AtomVecChargeKokkos_PackExchangeFunctor {
typedef DeviceType device_type;
typedef ArrayTypes<DeviceType> AT;
typename AT::t_x_array_randomread _x;
typename AT::t_v_array_randomread _v;
typename AT::t_tagint_1d_randomread _tag;
typename AT::t_int_1d_randomread _type;
typename AT::t_int_1d_randomread _mask;
typename AT::t_imageint_1d_randomread _image;
typename AT::t_float_1d_randomread _q;
typename AT::t_x_array _xw;
typename AT::t_v_array _vw;
typename AT::t_tagint_1d _tagw;
typename AT::t_int_1d _typew;
typename AT::t_int_1d _maskw;
typename AT::t_imageint_1d _imagew;
typename AT::t_float_1d _qw;
typename AT::t_xfloat_2d_um _buf;
typename AT::t_int_1d_const _sendlist;
typename AT::t_int_1d_const _copylist;
int _nlocal,_dim;
X_FLOAT _lo,_hi;
AtomVecChargeKokkos_PackExchangeFunctor(
const AtomKokkos* atom,
const typename AT::tdual_xfloat_2d buf,
typename AT::tdual_int_1d sendlist,
typename AT::tdual_int_1d copylist,int nlocal, int dim,
X_FLOAT lo, X_FLOAT hi):
_x(atom->k_x.view<DeviceType>()),
_v(atom->k_v.view<DeviceType>()),
_tag(atom->k_tag.view<DeviceType>()),
_type(atom->k_type.view<DeviceType>()),
_mask(atom->k_mask.view<DeviceType>()),
_image(atom->k_image.view<DeviceType>()),
_q(atom->k_q.view<DeviceType>()),
_xw(atom->k_x.view<DeviceType>()),
_vw(atom->k_v.view<DeviceType>()),
_tagw(atom->k_tag.view<DeviceType>()),
_typew(atom->k_type.view<DeviceType>()),
_maskw(atom->k_mask.view<DeviceType>()),
_imagew(atom->k_image.view<DeviceType>()),
_qw(atom->k_q.view<DeviceType>()),
_sendlist(sendlist.template view<DeviceType>()),
_copylist(copylist.template view<DeviceType>()),
_nlocal(nlocal),_dim(dim),
_lo(lo),_hi(hi){
const size_t elements = 12;
const int maxsendlist = (buf.template view<DeviceType>().dimension_0()*
buf.template view<DeviceType>().dimension_1())/elements;
buffer_view<DeviceType>(_buf,buf,maxsendlist,elements);
}
KOKKOS_INLINE_FUNCTION
void operator() (const int &mysend) const {
const int i = _sendlist(mysend);
_buf(mysend,0) = 12;
_buf(mysend,1) = _x(i,0);
_buf(mysend,2) = _x(i,1);
_buf(mysend,3) = _x(i,2);
_buf(mysend,4) = _v(i,0);
_buf(mysend,5) = _v(i,1);
_buf(mysend,6) = _v(i,2);
_buf(mysend,7) = _tag[i];
_buf(mysend,8) = _type[i];
_buf(mysend,9) = _mask[i];
_buf(mysend,10) = _image[i];
_buf(mysend,11) = _q[i];
const int j = _copylist(mysend);
if(j>-1) {
_xw(i,0) = _x(j,0);
_xw(i,1) = _x(j,1);
_xw(i,2) = _x(j,2);
_vw(i,0) = _v(j,0);
_vw(i,1) = _v(j,1);
_vw(i,2) = _v(j,2);
_tagw(i) = _tag(j);
_typew(i) = _type(j);
_maskw(i) = _mask(j);
_imagew(i) = _image(j);
_qw(i) = _q(j);
}
}
};
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &k_buf,
DAT::tdual_int_1d k_sendlist,
DAT::tdual_int_1d k_copylist,
ExecutionSpace space,int dim,
X_FLOAT lo,X_FLOAT hi )
{
if(nsend > (int) (k_buf.view<LMPHostType>().dimension_0()*k_buf.view<LMPHostType>().dimension_1())/12) {
int newsize = nsend*12/k_buf.view<LMPHostType>().dimension_1()+1;
k_buf.resize(newsize,k_buf.view<LMPHostType>().dimension_1());
}
if(space == Host) {
AtomVecChargeKokkos_PackExchangeFunctor<LMPHostType>
f(atomKK,k_buf,k_sendlist,k_copylist,atom->nlocal,dim,lo,hi);
Kokkos::parallel_for(nsend,f);
LMPHostType::fence();
return nsend*12;
} else {
AtomVecChargeKokkos_PackExchangeFunctor<LMPDeviceType>
f(atomKK,k_buf,k_sendlist,k_copylist,atom->nlocal,dim,lo,hi);
Kokkos::parallel_for(nsend,f);
LMPDeviceType::fence();
return nsend*12;
}
}
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_exchange(int i, double *buf)
{
int m = 1;
buf[m++] = h_x(i,0);
buf[m++] = h_x(i,1);
buf[m++] = h_x(i,2);
buf[m++] = h_v(i,0);
buf[m++] = h_v(i,1);
buf[m++] = h_v(i,2);
buf[m++] = ubuf(h_tag(i)).d;
buf[m++] = ubuf(h_type(i)).d;
buf[m++] = ubuf(h_mask(i)).d;
buf[m++] = ubuf(h_image(i)).d;
buf[m++] = h_q[i];
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
buf[0] = m;
return m;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
struct AtomVecChargeKokkos_UnpackExchangeFunctor {
typedef DeviceType device_type;
typedef ArrayTypes<DeviceType> AT;
typename AT::t_x_array _x;
typename AT::t_v_array _v;
typename AT::t_tagint_1d _tag;
typename AT::t_int_1d _type;
typename AT::t_int_1d _mask;
typename AT::t_imageint_1d _image;
typename AT::t_float_1d _q;
typename AT::t_xfloat_2d_um _buf;
typename AT::t_int_1d _nlocal;
int _dim;
X_FLOAT _lo,_hi;
AtomVecChargeKokkos_UnpackExchangeFunctor(
const AtomKokkos* atom,
const typename AT::tdual_xfloat_2d buf,
typename AT::tdual_int_1d nlocal,
int dim, X_FLOAT lo, X_FLOAT hi):
_x(atom->k_x.view<DeviceType>()),
_v(atom->k_v.view<DeviceType>()),
_tag(atom->k_tag.view<DeviceType>()),
_type(atom->k_type.view<DeviceType>()),
_mask(atom->k_mask.view<DeviceType>()),
_image(atom->k_image.view<DeviceType>()),
_q(atom->k_q.view<DeviceType>()),
_nlocal(nlocal.template view<DeviceType>()),_dim(dim),
_lo(lo),_hi(hi){
const size_t elements = 12;
const int maxsendlist = (buf.template view<DeviceType>().dimension_0()*buf.template view<DeviceType>().dimension_1())/elements;
buffer_view<DeviceType>(_buf,buf,maxsendlist,elements);
}
KOKKOS_INLINE_FUNCTION
void operator() (const int &myrecv) const {
X_FLOAT x = _buf(myrecv,_dim+1);
if (x >= _lo && x < _hi) {
int i = Kokkos::atomic_fetch_add(&_nlocal(0),1);
_x(i,0) = _buf(myrecv,1);
_x(i,1) = _buf(myrecv,2);
_x(i,2) = _buf(myrecv,3);
_v(i,0) = _buf(myrecv,4);
_v(i,1) = _buf(myrecv,5);
_v(i,2) = _buf(myrecv,6);
_tag[i] = _buf(myrecv,7);
_type[i] = _buf(myrecv,8);
_mask[i] = _buf(myrecv,9);
_image[i] = _buf(myrecv,10);
_q[i] = _buf(myrecv,11);
}
}
};
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf,int nrecv,
int nlocal,int dim,X_FLOAT lo,X_FLOAT hi,
ExecutionSpace space) {
if(space == Host) {
k_count.h_view(0) = nlocal;
AtomVecChargeKokkos_UnpackExchangeFunctor<LMPHostType> f(atomKK,k_buf,k_count,dim,lo,hi);
Kokkos::parallel_for(nrecv/12,f);
LMPHostType::fence();
return k_count.h_view(0);
} else {
k_count.h_view(0) = nlocal;
k_count.modify<LMPHostType>();
k_count.sync<LMPDeviceType>();
AtomVecChargeKokkos_UnpackExchangeFunctor<LMPDeviceType>
f(atomKK,k_buf,k_count,dim,lo,hi);
Kokkos::parallel_for(nrecv/12,f);
LMPDeviceType::fence();
k_count.modify<LMPDeviceType>();
k_count.sync<LMPHostType>();
return k_count.h_view(0);
}
}
/* ---------------------------------------------------------------------- */
int AtomVecChargeKokkos::unpack_exchange(double *buf)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
modified(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK |
MASK_MASK | IMAGE_MASK | Q_MASK);
int m = 1;
h_x(nlocal,0) = buf[m++];
h_x(nlocal,1) = buf[m++];
h_x(nlocal,2) = buf[m++];
h_v(nlocal,0) = buf[m++];
h_v(nlocal,1) = buf[m++];
h_v(nlocal,2) = buf[m++];
h_tag(nlocal) = (tagint) ubuf(buf[m++]).i;
h_type(nlocal) = (int) ubuf(buf[m++]).i;
h_mask(nlocal) = (int) ubuf(buf[m++]).i;
h_image(nlocal) = (imageint) ubuf(buf[m++]).i;
h_q[nlocal] = buf[m++];
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
m += modify->fix[atom->extra_grow[iextra]]->
unpack_exchange(nlocal,&buf[m]);
atom->nlocal++;
return m;
}
/* ----------------------------------------------------------------------
size of restart data for all atoms owned by this proc
include extra data stored by fixes
------------------------------------------------------------------------- */
int AtomVecChargeKokkos::size_restart()
{
int i;
int nlocal = atom->nlocal;
int n = 12 * nlocal;
if (atom->nextra_restart)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
for (i = 0; i < nlocal; i++)
n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
return n;
}
/* ----------------------------------------------------------------------
pack atom I's data for restart file including extra quantities
xyz must be 1st 3 values, so that read_restart can test on them
molecular types may be negative, but write as positive
------------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_restart(int i, double *buf)
{
sync(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK |
MASK_MASK | IMAGE_MASK | Q_MASK);
int m = 1;
buf[m++] = h_x(i,0);
buf[m++] = h_x(i,1);
buf[m++] = h_x(i,2);
buf[m++] = ubuf(h_tag(i)).d;
buf[m++] = ubuf(h_type(i)).d;
buf[m++] = ubuf(h_mask(i)).d;
buf[m++] = ubuf(h_image(i)).d;
buf[m++] = h_v(i,0);
buf[m++] = h_v(i,1);
buf[m++] = h_v(i,2);
buf[m++] = h_q[i];
if (atom->nextra_restart)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
buf[0] = m;
return m;
}
/* ----------------------------------------------------------------------
unpack data for one atom from restart file including extra quantities
------------------------------------------------------------------------- */
int AtomVecChargeKokkos::unpack_restart(double *buf)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
modified(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK |
MASK_MASK | IMAGE_MASK | Q_MASK);
int m = 1;
h_x(nlocal,0) = buf[m++];
h_x(nlocal,1) = buf[m++];
h_x(nlocal,2) = buf[m++];
h_tag(nlocal) = (tagint) ubuf(buf[m++]).i;
h_type(nlocal) = (int) ubuf(buf[m++]).i;
h_mask(nlocal) = (int) ubuf(buf[m++]).i;
h_image(nlocal) = (imageint) ubuf(buf[m++]).i;
h_v(nlocal,0) = buf[m++];
h_v(nlocal,1) = buf[m++];
h_v(nlocal,2) = buf[m++];
h_q[nlocal] = buf[m++];
double **extra = atom->extra;
if (atom->nextra_store) {
int size = static_cast<int> (ubuf(buf[m++]).i) - m;
for (int i = 0; i < size; i++) extra[nlocal][i] = buf[m++];
}
atom->nlocal++;
return m;
}
/* ----------------------------------------------------------------------
create one atom of itype at coord
set other values to defaults
------------------------------------------------------------------------- */
void AtomVecChargeKokkos::create_atom(int itype, double *coord)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) {
//if(nlocal>2) printf("typeA: %i %i\n",type[0],type[1]);
atomKK->modified(Host,ALL_MASK);
grow(0);
//if(nlocal>2) printf("typeB: %i %i\n",type[0],type[1]);
}
atomKK->modified(Host,ALL_MASK);
tag[nlocal] = 0;
type[nlocal] = itype;
h_x(nlocal,0) = coord[0];
h_x(nlocal,1) = coord[1];
h_x(nlocal,2) = coord[2];
h_mask[nlocal] = 1;
h_image[nlocal] = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
h_v(nlocal,0) = 0.0;
h_v(nlocal,1) = 0.0;
h_v(nlocal,2) = 0.0;
h_q[nlocal] = 0.0;
atom->nlocal++;
}
/* ----------------------------------------------------------------------
unpack one line from Atoms section of data file
initialize other atom quantities
------------------------------------------------------------------------- */
void AtomVecChargeKokkos::data_atom(double *coord, imageint imagetmp,
char **values)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
h_tag[nlocal] = atoi(values[0]);
h_type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
h_q[nlocal] = atof(values[2]);
h_x(nlocal,0) = coord[0];
h_x(nlocal,1) = coord[1];
h_x(nlocal,2) = coord[2];
h_image[nlocal] = imagetmp;
h_mask[nlocal] = 1;
h_v(nlocal,0) = 0.0;
h_v(nlocal,1) = 0.0;
h_v(nlocal,2) = 0.0;
+ atomKK->modified(Host,ALL_MASK);
+
atom->nlocal++;
}
/* ----------------------------------------------------------------------
unpack hybrid quantities from one line in Atoms section of data file
initialize other atom quantities for this sub-style
------------------------------------------------------------------------- */
int AtomVecChargeKokkos::data_atom_hybrid(int nlocal, char **values)
{
h_q[nlocal] = atof(values[0]);
return 1;
}
/* ----------------------------------------------------------------------
pack atom info for data file including 3 image flags
------------------------------------------------------------------------- */
void AtomVecChargeKokkos::pack_data(double **buf)
{
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
buf[i][0] = h_tag[i];
buf[i][1] = h_type[i];
buf[i][2] = h_q[i];
buf[i][3] = h_x(i,0);
buf[i][4] = h_x(i,1);
buf[i][5] = h_x(i,2);
buf[i][6] = (h_image[i] & IMGMASK) - IMGMAX;
buf[i][7] = (h_image[i] >> IMGBITS & IMGMASK) - IMGMAX;
buf[i][8] = (h_image[i] >> IMG2BITS) - IMGMAX;
}
}
/* ----------------------------------------------------------------------
pack hybrid atom info for data file
------------------------------------------------------------------------- */
int AtomVecChargeKokkos::pack_data_hybrid(int i, double *buf)
{
buf[0] = h_q[i];
return 1;
}
/* ----------------------------------------------------------------------
write atom info to data file including 3 image flags
------------------------------------------------------------------------- */
void AtomVecChargeKokkos::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
(int) buf[i][0],(int) buf[i][1],buf[i][2],buf[i][3],buf[i][4],buf[i][5],
(int) buf[i][6],(int) buf[i][7],(int) buf[i][8]);
}
/* ----------------------------------------------------------------------
write hybrid atom info to data file
------------------------------------------------------------------------- */
int AtomVecChargeKokkos::write_data_hybrid(FILE *fp, double *buf)
{
fprintf(fp," %-1.16e",buf[0]);
return 1;
}
/* ----------------------------------------------------------------------
return # of bytes of allocated memory
------------------------------------------------------------------------- */
bigint AtomVecChargeKokkos::memory_usage()
{
bigint bytes = 0;
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax*commKK->nthreads,3);
if (atom->memcheck("q")) bytes += memory->usage(q,nmax);
return bytes;
}
/* ---------------------------------------------------------------------- */
void AtomVecChargeKokkos::sync(ExecutionSpace space, unsigned int mask)
{
if (space == Device) {
if (mask & X_MASK) atomKK->k_x.sync<LMPDeviceType>();
if (mask & V_MASK) atomKK->k_v.sync<LMPDeviceType>();
if (mask & F_MASK) atomKK->k_f.sync<LMPDeviceType>();
if (mask & TAG_MASK) atomKK->k_tag.sync<LMPDeviceType>();
if (mask & TYPE_MASK) atomKK->k_type.sync<LMPDeviceType>();
if (mask & MASK_MASK) atomKK->k_mask.sync<LMPDeviceType>();
if (mask & IMAGE_MASK) atomKK->k_image.sync<LMPDeviceType>();
if (mask & Q_MASK) atomKK->k_q.sync<LMPDeviceType>();
} else {
if (mask & X_MASK) atomKK->k_x.sync<LMPHostType>();
if (mask & V_MASK) atomKK->k_v.sync<LMPHostType>();
if (mask & F_MASK) atomKK->k_f.sync<LMPHostType>();
if (mask & TAG_MASK) atomKK->k_tag.sync<LMPHostType>();
if (mask & TYPE_MASK) atomKK->k_type.sync<LMPHostType>();
if (mask & MASK_MASK) atomKK->k_mask.sync<LMPHostType>();
if (mask & IMAGE_MASK) atomKK->k_image.sync<LMPHostType>();
if (mask & Q_MASK) atomKK->k_q.sync<LMPHostType>();
}
}
/* ---------------------------------------------------------------------- */
void AtomVecChargeKokkos::modified(ExecutionSpace space, unsigned int mask)
{
if (space == Device) {
if (mask & X_MASK) atomKK->k_x.modify<LMPDeviceType>();
if (mask & V_MASK) atomKK->k_v.modify<LMPDeviceType>();
if (mask & F_MASK) atomKK->k_f.modify<LMPDeviceType>();
if (mask & TAG_MASK) atomKK->k_tag.modify<LMPDeviceType>();
if (mask & TYPE_MASK) atomKK->k_type.modify<LMPDeviceType>();
if (mask & MASK_MASK) atomKK->k_mask.modify<LMPDeviceType>();
if (mask & IMAGE_MASK) atomKK->k_image.modify<LMPDeviceType>();
if (mask & Q_MASK) atomKK->k_q.modify<LMPDeviceType>();
} else {
if (mask & X_MASK) atomKK->k_x.modify<LMPHostType>();
if (mask & V_MASK) atomKK->k_v.modify<LMPHostType>();
if (mask & F_MASK) atomKK->k_f.modify<LMPHostType>();
if (mask & TAG_MASK) atomKK->k_tag.modify<LMPHostType>();
if (mask & TYPE_MASK) atomKK->k_type.modify<LMPHostType>();
if (mask & MASK_MASK) atomKK->k_mask.modify<LMPHostType>();
if (mask & IMAGE_MASK) atomKK->k_image.modify<LMPHostType>();
if (mask & Q_MASK) atomKK->k_q.modify<LMPHostType>();
}
}
diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h
index eb188f9c1..b880654fb 100644
--- a/src/KOKKOS/pair_kokkos.h
+++ b/src/KOKKOS/pair_kokkos.h
@@ -1,754 +1,754 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
#else
#ifndef LMP_PAIR_KOKKOS_H
#define LMP_PAIR_KOKKOS_H
#include "Kokkos_Macros.hpp"
#include "pair.h"
#include "neigh_list_kokkos.h"
#include "Kokkos_Vectorization.hpp"
namespace LAMMPS_NS {
template<int Table>
struct CoulLongTable {
enum {DoTable = Table};
};
// Tags for doing coulomb calculations or not
// They facilitate function overloading, since
// partial template specialization of member functions is not allowed
struct CoulTag {};
struct NoCoulTag {};
template<int FLAG>
struct DoCoul {
typedef NoCoulTag type;
};
template<>
struct DoCoul<1> {
typedef CoulTag type;
};
// Determine memory traits for force array
// Do atomic trait when running HALFTHREAD neighbor list style
template<int NEIGHFLAG>
struct AtomicF {
enum {value = Kokkos::Unmanaged};
};
template<>
struct AtomicF<HALFTHREAD> {
enum {value = Kokkos::Atomic|Kokkos::Unmanaged};
};
//Specialisation for Neighborlist types Half, HalfThread, Full
template <class PairStyle, int NEIGHFLAG, bool STACKPARAMS, class Specialisation = void>
struct PairComputeFunctor {
typedef typename PairStyle::device_type device_type ;
// Reduction type, contains evdwl, ecoul and virial[6]
typedef EV_FLOAT value_type;
// The copy of the pair style
PairStyle c;
// The force array is atomic for Half/Thread neighbor style
Kokkos::View<F_FLOAT*[3], typename DAT::t_f_array::array_layout,
device_type,Kokkos::MemoryTraits<AtomicF<NEIGHFLAG>::value> > f;
// The eatom and vatom arrays are atomic for Half/Thread neighbor style
Kokkos::View<E_FLOAT*, typename DAT::t_efloat_1d::array_layout,
device_type,Kokkos::MemoryTraits<AtomicF<NEIGHFLAG>::value> > eatom;
Kokkos::View<F_FLOAT*[6], typename DAT::t_virial_array::array_layout,
device_type,Kokkos::MemoryTraits<AtomicF<NEIGHFLAG>::value> > vatom;
NeighListKokkos<device_type> list;
PairComputeFunctor(PairStyle* c_ptr,
NeighListKokkos<device_type>* list_ptr):
c(*c_ptr),f(c.f),eatom(c.d_eatom),
vatom(c.d_vatom),list(*list_ptr) {};
// Call cleanup_copy which sets allocations NULL which are destructed by the PairStyle
~PairComputeFunctor() {c.cleanup_copy();list.clean_copy();};
KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const {
return j >> SBBITS & 3;
}
// Loop over neighbors of one atom without coulomb interaction
// This function is called in parallel
template<int EVFLAG, int NEWTON_PAIR>
KOKKOS_FUNCTION
EV_FLOAT compute_item(const int& ii,
const NeighListKokkos<device_type> &list, const NoCoulTag&) const {
EV_FLOAT ev;
const int i = list.d_ilist[ii];
const X_FLOAT xtmp = c.x(i,0);
const X_FLOAT ytmp = c.x(i,1);
const X_FLOAT ztmp = c.x(i,2);
const int itype = c.type(i);
const AtomNeighborsConst neighbors_i = list.get_neighbors_const(i);
const int jnum = list.d_numneigh[i];
F_FLOAT fxtmp = 0.0;
F_FLOAT fytmp = 0.0;
F_FLOAT fztmp = 0.0;
for (int jj = 0; jj < jnum; jj++) {
int j = neighbors_i(jj);
const F_FLOAT factor_lj = c.special_lj[sbmask(j)];
j &= NEIGHMASK;
const X_FLOAT delx = xtmp - c.x(j,0);
const X_FLOAT dely = ytmp - c.x(j,1);
const X_FLOAT delz = ztmp - c.x(j,2);
const int jtype = c.type(j);
const F_FLOAT rsq = delx*delx + dely*dely + delz*delz;
if(rsq < (STACKPARAMS?c.m_cutsq[itype][jtype]:c.d_cutsq(itype,jtype))) {
const F_FLOAT fpair = factor_lj*c.template compute_fpair<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype);
fxtmp += delx*fpair;
fytmp += dely*fpair;
fztmp += delz*fpair;
if ((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR || j < c.nlocal)) {
f(j,0) -= delx*fpair;
f(j,1) -= dely*fpair;
f(j,2) -= delz*fpair;
}
if (EVFLAG) {
F_FLOAT evdwl = 0.0;
if (c.eflag) {
evdwl = factor_lj * c.template compute_evdwl<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype);
ev.evdwl += (((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD)&&(NEWTON_PAIR||(j<c.nlocal)))?1.0:0.5)*evdwl;
}
if (c.vflag_either || c.eflag_atom) ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz);
}
}
}
f(i,0) += fxtmp;
f(i,1) += fytmp;
f(i,2) += fztmp;
return ev;
}
// Loop over neighbors of one atom with coulomb interaction
// This function is called in parallel
template<int EVFLAG, int NEWTON_PAIR>
KOKKOS_FUNCTION
EV_FLOAT compute_item(const int& ii,
const NeighListKokkos<device_type> &list, const CoulTag& ) const {
EV_FLOAT ev;
const int i = list.d_ilist[ii];
const X_FLOAT xtmp = c.x(i,0);
const X_FLOAT ytmp = c.x(i,1);
const X_FLOAT ztmp = c.x(i,2);
const int itype = c.type(i);
const F_FLOAT qtmp = c.q(i);
const AtomNeighborsConst neighbors_i = list.get_neighbors_const(i);
const int jnum = list.d_numneigh[i];
F_FLOAT fxtmp = 0.0;
F_FLOAT fytmp = 0.0;
F_FLOAT fztmp = 0.0;
for (int jj = 0; jj < jnum; jj++) {
int j = neighbors_i(jj);
const F_FLOAT factor_lj = c.special_lj[sbmask(j)];
const F_FLOAT factor_coul = c.special_coul[sbmask(j)];
j &= NEIGHMASK;
const X_FLOAT delx = xtmp - c.x(j,0);
const X_FLOAT dely = ytmp - c.x(j,1);
const X_FLOAT delz = ztmp - c.x(j,2);
const int jtype = c.type(j);
const F_FLOAT rsq = delx*delx + dely*dely + delz*delz;
if(rsq < (STACKPARAMS?c.m_cutsq[itype][jtype]:c.d_cutsq(itype,jtype))) {
F_FLOAT fpair = F_FLOAT();
if(rsq < (STACKPARAMS?c.m_cut_ljsq[itype][jtype]:c.d_cut_ljsq(itype,jtype)))
fpair+=factor_lj*c.template compute_fpair<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype);
if(rsq < (STACKPARAMS?c.m_cut_coulsq[itype][jtype]:c.d_cut_coulsq(itype,jtype)))
fpair+=c.template compute_fcoul<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype,factor_coul,qtmp);
fxtmp += delx*fpair;
fytmp += dely*fpair;
fztmp += delz*fpair;
if ((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR || j < c.nlocal)) {
f(j,0) -= delx*fpair;
f(j,1) -= dely*fpair;
f(j,2) -= delz*fpair;
}
if (EVFLAG) {
F_FLOAT evdwl = 0.0;
F_FLOAT ecoul = 0.0;
if (c.eflag) {
if(rsq < (STACKPARAMS?c.m_cut_ljsq[itype][jtype]:c.d_cut_ljsq(itype,jtype))) {
evdwl = factor_lj * c.template compute_evdwl<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype);
ev.evdwl += (((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD)&&(NEWTON_PAIR||(j<c.nlocal)))?1.0:0.5)*evdwl;
}
if(rsq < (STACKPARAMS?c.m_cut_coulsq[itype][jtype]:c.d_cut_coulsq(itype,jtype))) {
ecoul = c.template compute_ecoul<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype,factor_coul,qtmp);
ev.ecoul += (((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD)&&(NEWTON_PAIR||(j<c.nlocal)))?1.0:0.5)*ecoul;
}
}
if (c.vflag_either || c.eflag_atom) ev_tally(ev,i,j,evdwl+ecoul,fpair,delx,dely,delz);
}
}
}
f(i,0) += fxtmp;
f(i,1) += fytmp;
f(i,2) += fztmp;
return ev;
}
KOKKOS_INLINE_FUNCTION
void ev_tally(EV_FLOAT &ev, const int &i, const int &j,
const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx,
const F_FLOAT &dely, const F_FLOAT &delz) const
{
const int EFLAG = c.eflag;
const int NEWTON_PAIR = c.newton_pair;
const int VFLAG = c.vflag_either;
if (EFLAG) {
if (c.eflag_atom) {
const E_FLOAT epairhalf = 0.5 * epair;
- if (NEWTON_PAIR || i < c.nlocal) eatom[i] += epairhalf;
- if ((NEWTON_PAIR || j < c.nlocal) && NEIGHFLAG != FULL) eatom[j] += epairhalf;
+ if (NEWTON_PAIR || i < c.nlocal) c.d_eatom[i] += epairhalf;
+ if ((NEWTON_PAIR || j < c.nlocal) && NEIGHFLAG != FULL) c.d_eatom[j] += epairhalf;
}
}
if (VFLAG) {
const E_FLOAT v0 = delx*delx*fpair;
const E_FLOAT v1 = dely*dely*fpair;
const E_FLOAT v2 = delz*delz*fpair;
const E_FLOAT v3 = delx*dely*fpair;
const E_FLOAT v4 = delx*delz*fpair;
const E_FLOAT v5 = dely*delz*fpair;
if (c.vflag_global) {
if (NEIGHFLAG!=FULL) {
if (NEWTON_PAIR) {
ev.v[0] += v0;
ev.v[1] += v1;
ev.v[2] += v2;
ev.v[3] += v3;
ev.v[4] += v4;
ev.v[5] += v5;
} else {
if (i < c.nlocal) {
ev.v[0] += 0.5*v0;
ev.v[1] += 0.5*v1;
ev.v[2] += 0.5*v2;
ev.v[3] += 0.5*v3;
ev.v[4] += 0.5*v4;
ev.v[5] += 0.5*v5;
}
if (j < c.nlocal) {
ev.v[0] += 0.5*v0;
ev.v[1] += 0.5*v1;
ev.v[2] += 0.5*v2;
ev.v[3] += 0.5*v3;
ev.v[4] += 0.5*v4;
ev.v[5] += 0.5*v5;
}
}
} else {
ev.v[0] += 0.5*v0;
ev.v[1] += 0.5*v1;
ev.v[2] += 0.5*v2;
ev.v[3] += 0.5*v3;
ev.v[4] += 0.5*v4;
ev.v[5] += 0.5*v5;
}
}
if (c.vflag_atom) {
if (NEWTON_PAIR || i < c.nlocal) {
- vatom(i,0) += 0.5*v0;
- vatom(i,1) += 0.5*v1;
- vatom(i,2) += 0.5*v2;
- vatom(i,3) += 0.5*v3;
- vatom(i,4) += 0.5*v4;
- vatom(i,5) += 0.5*v5;
+ c.d_vatom(i,0) += 0.5*v0;
+ c.d_vatom(i,1) += 0.5*v1;
+ c.d_vatom(i,2) += 0.5*v2;
+ c.d_vatom(i,3) += 0.5*v3;
+ c.d_vatom(i,4) += 0.5*v4;
+ c.d_vatom(i,5) += 0.5*v5;
}
if ((NEWTON_PAIR || j < c.nlocal) && NEIGHFLAG != FULL) {
- vatom(j,0) += 0.5*v0;
- vatom(j,1) += 0.5*v1;
- vatom(j,2) += 0.5*v2;
- vatom(j,3) += 0.5*v3;
- vatom(j,4) += 0.5*v4;
- vatom(j,5) += 0.5*v5;
+ c.d_vatom(j,0) += 0.5*v0;
+ c.d_vatom(j,1) += 0.5*v1;
+ c.d_vatom(j,2) += 0.5*v2;
+ c.d_vatom(j,3) += 0.5*v3;
+ c.d_vatom(j,4) += 0.5*v4;
+ c.d_vatom(j,5) += 0.5*v5;
}
}
}
}
KOKKOS_INLINE_FUNCTION
void operator()(const int i) const {
if (c.newton_pair) compute_item<0,1>(i,list,typename DoCoul<PairStyle::COUL_FLAG>::type());
else compute_item<0,0>(i,list,typename DoCoul<PairStyle::COUL_FLAG>::type());
}
KOKKOS_INLINE_FUNCTION
void operator()(const int i, value_type &energy_virial) const {
if (c.newton_pair)
energy_virial += compute_item<1,1>(i,list,typename DoCoul<PairStyle::COUL_FLAG>::type());
else
energy_virial += compute_item<1,0>(i,list,typename DoCoul<PairStyle::COUL_FLAG>::type());
}
};
template <class PairStyle, bool STACKPARAMS, class Specialisation>
struct PairComputeFunctor<PairStyle,FULLCLUSTER,STACKPARAMS,Specialisation> {
typedef typename PairStyle::device_type device_type ;
typedef EV_FLOAT value_type;
PairStyle c;
NeighListKokkos<device_type> list;
PairComputeFunctor(PairStyle* c_ptr,
NeighListKokkos<device_type>* list_ptr):
c(*c_ptr),list(*list_ptr) {};
~PairComputeFunctor() {c.cleanup_copy();list.clean_copy();};
KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const {
return j >> SBBITS & 3;
}
template<int EVFLAG, int NEWTON_PAIR>
KOKKOS_FUNCTION
EV_FLOAT compute_item(const typename Kokkos::TeamPolicy<device_type>::member_type& dev,
const NeighListKokkos<device_type> &list, const NoCoulTag& ) const {
EV_FLOAT ev;
int i = dev.league_rank()*dev.team_size() + dev.team_rank();
const X_FLOAT xtmp = c.c_x(i,0);
const X_FLOAT ytmp = c.c_x(i,1);
const X_FLOAT ztmp = c.c_x(i,2);
int itype = c.type(i);
const AtomNeighborsConst neighbors_i = list.get_neighbors_const(i);
const int jnum = list.d_numneigh[i];
F_FLOAT3 ftmp;
for (int jj = 0; jj < jnum; jj++) {
int jjj = neighbors_i(jj);
Kokkos::parallel_reduce(Kokkos::ThreadVectorRange(dev,NeighClusterSize),[&] (const int& k, F_FLOAT3& fftmp) {
const F_FLOAT factor_lj = c.special_lj[sbmask(jjj+k)];
const int j = (jjj + k)&NEIGHMASK;
if((j==i)||(j>=c.nall)) return;
const X_FLOAT delx = xtmp - c.c_x(j,0);
const X_FLOAT dely = ytmp - c.c_x(j,1);
const X_FLOAT delz = ztmp - c.c_x(j,2);
const int jtype = c.type(j);
const F_FLOAT rsq = (delx*delx + dely*dely + delz*delz);
if(rsq < (STACKPARAMS?c.m_cutsq[itype][jtype]:c.d_cutsq(itype,jtype))) {
const F_FLOAT fpair = factor_lj*c.template compute_fpair<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype);
fftmp.x += delx*fpair;
fftmp.y += dely*fpair;
fftmp.z += delz*fpair;
if (EVFLAG) {
F_FLOAT evdwl = 0.0;
if (c.eflag) {
evdwl = 0.5*
factor_lj * c.template compute_evdwl<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype);
ev.evdwl += evdwl;
}
if (c.vflag_either || c.eflag_atom) ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz);
}
}
},ftmp);
}
Kokkos::single(Kokkos::PerThread(dev), [&]() {
c.f(i,0) += ftmp.x;
c.f(i,1) += ftmp.y;
c.f(i,2) += ftmp.z;
});
return ev;
}
KOKKOS_INLINE_FUNCTION
void ev_tally(EV_FLOAT &ev, const int &i, const int &j,
const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx,
const F_FLOAT &dely, const F_FLOAT &delz) const
{
const int EFLAG = c.eflag;
const int NEWTON_PAIR = c.newton_pair;
const int VFLAG = c.vflag_either;
if (EFLAG) {
if (c.eflag_atom) {
const E_FLOAT epairhalf = 0.5 * epair;
if (NEWTON_PAIR || i < c.nlocal) c.d_eatom[i] += epairhalf;
if (NEWTON_PAIR || j < c.nlocal) c.d_eatom[j] += epairhalf;
}
}
if (VFLAG) {
const E_FLOAT v0 = delx*delx*fpair;
const E_FLOAT v1 = dely*dely*fpair;
const E_FLOAT v2 = delz*delz*fpair;
const E_FLOAT v3 = delx*dely*fpair;
const E_FLOAT v4 = delx*delz*fpair;
const E_FLOAT v5 = dely*delz*fpair;
if (c.vflag_global) {
ev.v[0] += 0.5*v0;
ev.v[1] += 0.5*v1;
ev.v[2] += 0.5*v2;
ev.v[3] += 0.5*v3;
ev.v[4] += 0.5*v4;
ev.v[5] += 0.5*v5;
}
if (c.vflag_atom) {
if (i < c.nlocal) {
c.d_vatom(i,0) += 0.5*v0;
c.d_vatom(i,1) += 0.5*v1;
c.d_vatom(i,2) += 0.5*v2;
c.d_vatom(i,3) += 0.5*v3;
c.d_vatom(i,4) += 0.5*v4;
c.d_vatom(i,5) += 0.5*v5;
}
}
}
}
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::TeamPolicy<device_type>::member_type& dev) const {
if (c.newton_pair) compute_item<0,1>(dev,list,typename DoCoul<PairStyle::COUL_FLAG>::type());
else compute_item<0,0>(dev,list,typename DoCoul<PairStyle::COUL_FLAG>::type());
}
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::TeamPolicy<device_type>::member_type& dev, value_type &energy_virial) const {
if (c.newton_pair)
energy_virial += compute_item<1,1>(dev,list,typename DoCoul<PairStyle::COUL_FLAG>::type());
else
energy_virial += compute_item<1,0>(dev,list,typename DoCoul<PairStyle::COUL_FLAG>::type());
}
};
template <class PairStyle, bool STACKPARAMS, class Specialisation>
struct PairComputeFunctor<PairStyle,N2,STACKPARAMS,Specialisation> {
typedef typename PairStyle::device_type device_type ;
typedef EV_FLOAT value_type;
PairStyle c;
NeighListKokkos<device_type> list;
PairComputeFunctor(PairStyle* c_ptr,
NeighListKokkos<device_type>* list_ptr):
c(*c_ptr),list(*list_ptr) {};
~PairComputeFunctor() {c.cleanup_copy();list.clean_copy();};
KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const {
return j >> SBBITS & 3;
}
template<int EVFLAG, int NEWTON_PAIR>
KOKKOS_FUNCTION
EV_FLOAT compute_item(const int& ii,
const NeighListKokkos<device_type> &list, const NoCoulTag&) const {
(void) list;
EV_FLOAT ev;
const int i = ii;//list.d_ilist[ii];
const X_FLOAT xtmp = c.x(i,0);
const X_FLOAT ytmp = c.x(i,1);
const X_FLOAT ztmp = c.x(i,2);
const int itype = c.type(i);
//const AtomNeighborsConst neighbors_i = list.get_neighbors_const(i);
const int jnum = c.nall;
F_FLOAT fxtmp = 0.0;
F_FLOAT fytmp = 0.0;
F_FLOAT fztmp = 0.0;
for (int jj = 0; jj < jnum; jj++) {
int j = jj;//neighbors_i(jj);
if(i==j) continue;
const F_FLOAT factor_lj = c.special_lj[sbmask(j)];
j &= NEIGHMASK;
const X_FLOAT delx = xtmp - c.x(j,0);
const X_FLOAT dely = ytmp - c.x(j,1);
const X_FLOAT delz = ztmp - c.x(j,2);
const int jtype = c.type(j);
const F_FLOAT rsq = delx*delx + dely*dely + delz*delz;
if(rsq < (STACKPARAMS?c.m_cutsq[itype][jtype]:c.d_cutsq(itype,jtype))) {
const F_FLOAT fpair = factor_lj*c.template compute_fpair<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype);
fxtmp += delx*fpair;
fytmp += dely*fpair;
fztmp += delz*fpair;
if (EVFLAG) {
F_FLOAT evdwl = 0.0;
if (c.eflag) {
evdwl = 0.5*
factor_lj * c.template compute_evdwl<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype);
ev.evdwl += evdwl;
}
if (c.vflag_either || c.eflag_atom) ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz);
}
}
}
c.f(i,0) += fxtmp;
c.f(i,1) += fytmp;
c.f(i,2) += fztmp;
return ev;
}
KOKKOS_INLINE_FUNCTION
void ev_tally(EV_FLOAT &ev, const int &i, const int &j,
const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx,
const F_FLOAT &dely, const F_FLOAT &delz) const
{
const int EFLAG = c.eflag;
const int VFLAG = c.vflag_either;
if (EFLAG) {
if (c.eflag_atom) {
const E_FLOAT epairhalf = 0.5 * epair;
if (i < c.nlocal) c.d_eatom[i] += epairhalf;
if (j < c.nlocal) c.d_eatom[j] += epairhalf;
}
}
if (VFLAG) {
const E_FLOAT v0 = delx*delx*fpair;
const E_FLOAT v1 = dely*dely*fpair;
const E_FLOAT v2 = delz*delz*fpair;
const E_FLOAT v3 = delx*dely*fpair;
const E_FLOAT v4 = delx*delz*fpair;
const E_FLOAT v5 = dely*delz*fpair;
if (c.vflag_global) {
ev.v[0] += 0.5*v0;
ev.v[1] += 0.5*v1;
ev.v[2] += 0.5*v2;
ev.v[3] += 0.5*v3;
ev.v[4] += 0.5*v4;
ev.v[5] += 0.5*v5;
}
if (c.vflag_atom) {
if (i < c.nlocal) {
c.d_vatom(i,0) += 0.5*v0;
c.d_vatom(i,1) += 0.5*v1;
c.d_vatom(i,2) += 0.5*v2;
c.d_vatom(i,3) += 0.5*v3;
c.d_vatom(i,4) += 0.5*v4;
c.d_vatom(i,5) += 0.5*v5;
}
}
}
}
KOKKOS_INLINE_FUNCTION
void operator()(const int i) const {
compute_item<0,0>(i,list,typename DoCoul<PairStyle::COUL_FLAG>::type());
}
KOKKOS_INLINE_FUNCTION
void operator()(const int i, value_type &energy_virial) const {
energy_virial += compute_item<1,0>(i,list,typename DoCoul<PairStyle::COUL_FLAG>::type());
}
};
// Filter out Neighflags which are not supported for PairStyle
// The enable_if clause will invalidate the last parameter of the function, so that
// a match is only achieved, if PairStyle supports the specific neighborlist variant.
// This uses the fact that failure to match template parameters is not an error.
// By having the enable_if with a ! and without it, exactly one of the two versions of the functions
// pair_compute_neighlist and pair_compute_fullcluster will match - either the dummy version
// or the real one further below.
template<class PairStyle, unsigned NEIGHFLAG, class Specialisation>
EV_FLOAT pair_compute_neighlist (PairStyle* fpair, typename Kokkos::Impl::enable_if<!(NEIGHFLAG&PairStyle::EnabledNeighFlags), NeighListKokkos<typename PairStyle::device_type>*>::type list) {
EV_FLOAT ev;
(void) fpair;
(void) list;
printf("ERROR: calling pair_compute with invalid neighbor list style: requested %i available %i \n",NEIGHFLAG,PairStyle::EnabledNeighFlags);
return ev;
}
template<class PairStyle, class Specialisation>
EV_FLOAT pair_compute_fullcluster (PairStyle* fpair, typename Kokkos::Impl::enable_if<!(FULLCLUSTER&PairStyle::EnabledNeighFlags), NeighListKokkos<typename PairStyle::device_type>*>::type list) {
EV_FLOAT ev;
(void) fpair;
(void) list;
printf("ERROR: calling pair_compute with invalid neighbor list style: requested %i available %i \n",FULLCLUSTER,PairStyle::EnabledNeighFlags);
return ev;
}
// Submit ParallelFor for NEIGHFLAG=HALF,HALFTHREAD,FULL,N2
template<class PairStyle, unsigned NEIGHFLAG, class Specialisation>
EV_FLOAT pair_compute_neighlist (PairStyle* fpair, typename Kokkos::Impl::enable_if<NEIGHFLAG&PairStyle::EnabledNeighFlags, NeighListKokkos<typename PairStyle::device_type>*>::type list) {
EV_FLOAT ev;
if(fpair->atom->ntypes > MAX_TYPES_STACKPARAMS) {
PairComputeFunctor<PairStyle,NEIGHFLAG,false,Specialisation > ff(fpair,list);
if (fpair->eflag || fpair->vflag) Kokkos::parallel_reduce(list->inum,ff,ev);
else Kokkos::parallel_for(list->inum,ff);
} else {
PairComputeFunctor<PairStyle,NEIGHFLAG,true,Specialisation > ff(fpair,list);
if (fpair->eflag || fpair->vflag) Kokkos::parallel_reduce(list->inum,ff,ev);
else Kokkos::parallel_for(list->inum,ff);
}
return ev;
}
// Submit ParallelFor for NEIGHFLAG=FULLCLUSTER
template<class PairStyle, class Specialisation>
EV_FLOAT pair_compute_fullcluster (PairStyle* fpair, typename Kokkos::Impl::enable_if<FULLCLUSTER&PairStyle::EnabledNeighFlags, NeighListKokkos<typename PairStyle::device_type>*>::type list) {
EV_FLOAT ev;
if(fpair->atom->ntypes > MAX_TYPES_STACKPARAMS) {
typedef PairComputeFunctor<PairStyle,FULLCLUSTER,false,Specialisation >
f_type;
f_type ff(fpair, list);
#ifdef KOKKOS_HAVE_CUDA
const int teamsize = Kokkos::Impl::is_same<typename f_type::device_type, Kokkos::Cuda>::value ? 32 : 1;
#else
const int teamsize = 1;
#endif
const int nteams = (list->inum*+teamsize-1)/teamsize;
Kokkos::TeamPolicy<typename f_type::device_type> config(nteams,teamsize,NeighClusterSize);
if (fpair->eflag || fpair->vflag) Kokkos::parallel_reduce(config,ff,ev);
else Kokkos::parallel_for(config,ff);
} else {
typedef PairComputeFunctor<PairStyle,FULLCLUSTER,true,Specialisation >
f_type;
f_type ff(fpair, list);
#ifdef KOKKOS_HAVE_CUDA
const int teamsize = Kokkos::Impl::is_same<typename f_type::device_type, Kokkos::Cuda>::value ? 32 : 1;
#else
const int teamsize = 1;
#endif
const int nteams = (list->inum*+teamsize-1)/teamsize;
Kokkos::TeamPolicy<typename f_type::device_type> config(nteams,teamsize,NeighClusterSize);
if (fpair->eflag || fpair->vflag) Kokkos::parallel_reduce(config,ff,ev);
else Kokkos::parallel_for(config,ff);
}
return ev;
}
template<class PairStyle, class Specialisation>
EV_FLOAT pair_compute (PairStyle* fpair, NeighListKokkos<typename PairStyle::device_type>* list) {
EV_FLOAT ev;
if (fpair->neighflag == FULL) {
ev = pair_compute_neighlist<PairStyle,FULL,Specialisation> (fpair,list);
} else if (fpair->neighflag == HALFTHREAD) {
ev = pair_compute_neighlist<PairStyle,HALFTHREAD,Specialisation> (fpair,list);
} else if (fpair->neighflag == HALF) {
ev = pair_compute_neighlist<PairStyle,HALF,Specialisation> (fpair,list);
} else if (fpair->neighflag == N2) {
ev = pair_compute_neighlist<PairStyle,N2,Specialisation> (fpair,list);
} else if (fpair->neighflag == FULLCLUSTER) {
ev = pair_compute_fullcluster<PairStyle,Specialisation> (fpair,list);
}
return ev;
}
template<class DeviceType>
struct PairVirialFDotRCompute {
typedef ArrayTypes<DeviceType> AT;
typedef EV_FLOAT value_type;
typename AT::t_x_array_const_um x;
typename AT::t_f_array_const_um f;
const int offset;
PairVirialFDotRCompute( typename AT::t_x_array_const_um x_,
typename AT::t_f_array_const_um f_,
const int offset_):x(x_),f(f_),offset(offset_) {}
KOKKOS_INLINE_FUNCTION
void operator()(const int j, value_type &energy_virial) const {
const int i = j + offset;
energy_virial.v[0] += f(i,0)*x(i,0);
energy_virial.v[1] += f(i,1)*x(i,1);
energy_virial.v[2] += f(i,2)*x(i,2);
energy_virial.v[3] += f(i,1)*x(i,0);
energy_virial.v[4] += f(i,2)*x(i,0);
energy_virial.v[5] += f(i,2)*x(i,1);
}
};
template<class PairStyle>
void pair_virial_fdotr_compute(PairStyle* fpair) {
EV_FLOAT virial;
if (fpair->neighbor->includegroup == 0) {
int nall = fpair->atom->nlocal + fpair->atom->nghost;
Kokkos::parallel_reduce(nall,PairVirialFDotRCompute<typename PairStyle::device_type>(fpair->x,fpair->f,0),virial);
} else {
Kokkos::parallel_reduce(fpair->atom->nfirst,PairVirialFDotRCompute<typename PairStyle::device_type>(fpair->x,fpair->f,0),virial);
EV_FLOAT virial_ghost;
Kokkos::parallel_reduce(fpair->atom->nghost,PairVirialFDotRCompute<typename PairStyle::device_type>(fpair->x,fpair->f,fpair->atom->nlocal),virial_ghost);
virial+=virial_ghost;
}
fpair->vflag_fdotr = 0;
fpair->virial[0] = virial.v[0];
fpair->virial[1] = virial.v[1];
fpair->virial[2] = virial.v[2];
fpair->virial[3] = virial.v[3];
fpair->virial[4] = virial.v[4];
fpair->virial[5] = virial.v[5];
}
}
#endif
#endif
/* ERROR/WARNING messages:
*/
diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp
index ad41540b5..224e76195 100644
--- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp
+++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp
@@ -1,537 +1,524 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Ray Shan (SNL)
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_lj_charmm_coul_long_kokkos.h"
#include "kokkos.h"
#include "atom_kokkos.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "update.h"
#include "integrate.h"
#include "respa.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
#include "atom_masks.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define KOKKOS_CUDA_MAX_THREADS 256
#define KOKKOS_CUDA_MIN_BLOCKS 8
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
/* ---------------------------------------------------------------------- */
template<class DeviceType>
PairLJCharmmCoulLongKokkos<DeviceType>::PairLJCharmmCoulLongKokkos(LAMMPS *lmp):PairLJCharmmCoulLong(lmp)
{
respa_enable = 0;
atomKK = (AtomKokkos *) atom;
execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK;
datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK;
cutsq = NULL;
cut_ljsq = 0.0;
cut_coulsq = 0.0;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
PairLJCharmmCoulLongKokkos<DeviceType>::~PairLJCharmmCoulLongKokkos()
{
if (!copymode) {
memory->destroy_kokkos(k_eatom,eatom);
memory->destroy_kokkos(k_vatom,vatom);
k_cutsq = DAT::tdual_ffloat_2d();
k_cut_ljsq = DAT::tdual_ffloat_2d();
k_cut_coulsq = DAT::tdual_ffloat_2d();
memory->sfree(cutsq);
//memory->sfree(cut_ljsq);
//memory->sfree(cut_coulsq);
eatom = NULL;
vatom = NULL;
cutsq = NULL;
cut_ljsq = 0.0;
cut_coulsq = 0.0;
}
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void PairLJCharmmCoulLongKokkos<DeviceType>::cleanup_copy() {
// WHY needed: this prevents parent copy from deallocating any arrays
allocated = 0;
cutsq = NULL;
cut_ljsq = 0.0;
eatom = NULL;
vatom = NULL;
ftable = NULL;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void PairLJCharmmCoulLongKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
{
eflag = eflag_in;
vflag = vflag_in;
if (neighflag == FULL || neighflag == FULLCLUSTER) no_virial_fdotr_compute = 1;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
atomKK->sync(execution_space,datamask_read);
k_cutsq.template sync<DeviceType>();
k_cut_ljsq.template sync<DeviceType>();
k_cut_coulsq.template sync<DeviceType>();
k_params.template sync<DeviceType>();
if (eflag || vflag) atomKK->modified(execution_space,datamask_modify);
else atomKK->modified(execution_space,F_MASK);
x = atomKK->k_x.view<DeviceType>();
c_x = atomKK->k_x.view<DeviceType>();
f = atomKK->k_f.view<DeviceType>();
q = atomKK->k_q.view<DeviceType>();
type = atomKK->k_type.view<DeviceType>();
nlocal = atom->nlocal;
nall = atom->nlocal + atom->nghost;
special_lj[0] = force->special_lj[0];
special_lj[1] = force->special_lj[1];
special_lj[2] = force->special_lj[2];
special_lj[3] = force->special_lj[3];
special_coul[0] = force->special_coul[0];
special_coul[1] = force->special_coul[1];
special_coul[2] = force->special_coul[2];
special_coul[3] = force->special_coul[3];
qqrd2e = force->qqrd2e;
newton_pair = force->newton_pair;
// loop over neighbors of my atoms
copymode = 1;
EV_FLOAT ev;
if(ncoultablebits)
ev = pair_compute<PairLJCharmmCoulLongKokkos<DeviceType>,CoulLongTable<1> >
(this,(NeighListKokkos<DeviceType>*)list);
else
ev = pair_compute<PairLJCharmmCoulLongKokkos<DeviceType>,CoulLongTable<0> >
(this,(NeighListKokkos<DeviceType>*)list);
DeviceType::fence();
if (eflag) {
eng_vdwl += ev.evdwl;
eng_coul += ev.ecoul;
}
if (vflag_global) {
virial[0] += ev.v[0];
virial[1] += ev.v[1];
virial[2] += ev.v[2];
virial[3] += ev.v[3];
virial[4] += ev.v[4];
virial[5] += ev.v[5];
}
if (vflag_fdotr) pair_virial_fdotr_compute(this);
copymode = 0;
}
/* ----------------------------------------------------------------------
compute LJ CHARMM pair force between atoms i and j
---------------------------------------------------------------------- */
template<class DeviceType>
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT PairLJCharmmCoulLongKokkos<DeviceType>::
compute_fpair(const F_FLOAT& rsq, const int& i, const int&j,
const int& itype, const int& jtype) const {
const F_FLOAT r2inv = 1.0/rsq;
const F_FLOAT r6inv = r2inv*r2inv*r2inv;
F_FLOAT forcelj, switch1, switch2, englj;
forcelj = r6inv *
((STACKPARAMS?m_params[itype][jtype].lj1:params(itype,jtype).lj1)*r6inv -
(STACKPARAMS?m_params[itype][jtype].lj2:params(itype,jtype).lj2));
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
switch2 = 12.0*rsq * (cut_ljsq-rsq) * (rsq-cut_lj_innersq) / denom_lj;
englj = r6inv *
((STACKPARAMS?m_params[itype][jtype].lj3:params(itype,jtype).lj3)*r6inv -
(STACKPARAMS?m_params[itype][jtype].lj4:params(itype,jtype).lj4));
forcelj = forcelj*switch1 + englj*switch2;
}
return forcelj*r2inv;
}
/* ----------------------------------------------------------------------
compute LJ CHARMM pair potential energy between atoms i and j
---------------------------------------------------------------------- */
template<class DeviceType>
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT PairLJCharmmCoulLongKokkos<DeviceType>::
compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j,
const int& itype, const int& jtype) const {
const F_FLOAT r2inv = 1.0/rsq;
const F_FLOAT r6inv = r2inv*r2inv*r2inv;
F_FLOAT englj, switch1;
englj = r6inv *
((STACKPARAMS?m_params[itype][jtype].lj3:params(itype,jtype).lj3)*r6inv -
(STACKPARAMS?m_params[itype][jtype].lj4:params(itype,jtype).lj4));
if (rsq > cut_lj_innersq) {
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
englj *= switch1;
}
return englj;
}
/* ----------------------------------------------------------------------
compute coulomb pair force between atoms i and j
---------------------------------------------------------------------- */
template<class DeviceType>
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT PairLJCharmmCoulLongKokkos<DeviceType>::
compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j,
const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const {
if(Specialisation::DoTable && rsq > tabinnersq) {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
const int itable = (rsq_lookup.i & ncoulmask) >> ncoulshiftbits;
const F_FLOAT fraction = (rsq_lookup.f - d_rtable[itable]) * d_drtable[itable];
const F_FLOAT table = d_ftable[itable] + fraction*d_dftable[itable];
F_FLOAT forcecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
const F_FLOAT table = d_ctable[itable] + fraction*d_dctable[itable];
const F_FLOAT prefactor = qtmp*q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
}
return forcecoul/rsq;
} else {
const F_FLOAT r = sqrt(rsq);
const F_FLOAT grij = g_ewald * r;
const F_FLOAT expm2 = exp(-grij*grij);
const F_FLOAT t = 1.0 / (1.0 + EWALD_P*grij);
const F_FLOAT rinv = 1.0/r;
const F_FLOAT erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
const F_FLOAT prefactor = qqrd2e * qtmp*q[j]*rinv;
F_FLOAT forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
return forcecoul*rinv*rinv;
}
}
/* ----------------------------------------------------------------------
compute coulomb pair potential energy between atoms i and j
---------------------------------------------------------------------- */
template<class DeviceType>
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT PairLJCharmmCoulLongKokkos<DeviceType>::
compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j,
const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const {
if(Specialisation::DoTable && rsq > tabinnersq) {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
const int itable = (rsq_lookup.i & ncoulmask) >> ncoulshiftbits;
const F_FLOAT fraction = (rsq_lookup.f - d_rtable[itable]) * d_drtable[itable];
const F_FLOAT table = d_etable[itable] + fraction*d_detable[itable];
F_FLOAT ecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
const F_FLOAT table = d_ctable[itable] + fraction*d_dctable[itable];
const F_FLOAT prefactor = qtmp*q[j] * table;
ecoul -= (1.0-factor_coul)*prefactor;
}
return ecoul;
} else {
const F_FLOAT r = sqrt(rsq);
const F_FLOAT grij = g_ewald * r;
const F_FLOAT expm2 = exp(-grij*grij);
const F_FLOAT t = 1.0 / (1.0 + EWALD_P*grij);
const F_FLOAT erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
const F_FLOAT prefactor = qqrd2e * qtmp*q[j]/r;
F_FLOAT ecoul = prefactor * erfc;
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
return ecoul;
}
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
template<class DeviceType>
void PairLJCharmmCoulLongKokkos<DeviceType>::allocate()
{
PairLJCharmmCoulLong::allocate();
int n = atom->ntypes;
memory->destroy(cutsq);
memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq");
d_cutsq = k_cutsq.template view<DeviceType>();
//memory->destroy(cut_ljsq);
memory->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq");
d_cut_ljsq = k_cut_ljsq.template view<DeviceType>();
memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq");
d_cut_coulsq = k_cut_coulsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType>("PairLJCharmmCoulLong::params",n+1,n+1);
params = k_params.d_view;
}
template<class DeviceType>
void PairLJCharmmCoulLongKokkos<DeviceType>::init_tables(double cut_coul, double *cut_respa)
{
Pair::init_tables(cut_coul,cut_respa);
typedef typename ArrayTypes<DeviceType>::t_ffloat_1d table_type;
typedef typename ArrayTypes<LMPHostType>::t_ffloat_1d host_table_type;
int ntable = 1;
for (int i = 0; i < ncoultablebits; i++) ntable *= 2;
// Copy rtable and drtable
{
host_table_type h_table("HostTable",ntable);
table_type d_table("DeviceTable",ntable);
for(int i = 0; i < ntable; i++) {
h_table(i) = rtable[i];
}
Kokkos::deep_copy(d_table,h_table);
d_rtable = d_table;
}
{
host_table_type h_table("HostTable",ntable);
table_type d_table("DeviceTable",ntable);
for(int i = 0; i < ntable; i++) {
h_table(i) = drtable[i];
}
Kokkos::deep_copy(d_table,h_table);
d_drtable = d_table;
}
{
host_table_type h_table("HostTable",ntable);
table_type d_table("DeviceTable",ntable);
// Copy ftable and dftable
for(int i = 0; i < ntable; i++) {
h_table(i) = ftable[i];
}
Kokkos::deep_copy(d_table,h_table);
d_ftable = d_table;
}
{
host_table_type h_table("HostTable",ntable);
table_type d_table("DeviceTable",ntable);
for(int i = 0; i < ntable; i++) {
h_table(i) = dftable[i];
}
Kokkos::deep_copy(d_table,h_table);
d_dftable = d_table;
}
{
host_table_type h_table("HostTable",ntable);
table_type d_table("DeviceTable",ntable);
// Copy ctable and dctable
for(int i = 0; i < ntable; i++) {
h_table(i) = ctable[i];
}
Kokkos::deep_copy(d_table,h_table);
d_ctable = d_table;
}
{
host_table_type h_table("HostTable",ntable);
table_type d_table("DeviceTable",ntable);
for(int i = 0; i < ntable; i++) {
h_table(i) = dctable[i];
}
Kokkos::deep_copy(d_table,h_table);
d_dctable = d_table;
}
{
host_table_type h_table("HostTable",ntable);
table_type d_table("DeviceTable",ntable);
// Copy etable and detable
for(int i = 0; i < ntable; i++) {
h_table(i) = etable[i];
}
Kokkos::deep_copy(d_table,h_table);
d_etable = d_table;
}
{
host_table_type h_table("HostTable",ntable);
table_type d_table("DeviceTable",ntable);
for(int i = 0; i < ntable; i++) {
h_table(i) = detable[i];
}
Kokkos::deep_copy(d_table,h_table);
d_detable = d_table;
}
}
-
-/* ----------------------------------------------------------------------
- global settings
-------------------------------------------------------------------------- */
-
-template<class DeviceType>
-void PairLJCharmmCoulLongKokkos<DeviceType>::settings(int narg, char **arg)
-{
- if (narg > 2) error->all(FLERR,"Illegal pair_style command");
-
- PairLJCharmmCoulLong::settings(narg,arg);
-}
-
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
template<class DeviceType>
void PairLJCharmmCoulLongKokkos<DeviceType>::init_style()
{
PairLJCharmmCoulLong::init_style();
// error if rRESPA with inner levels
if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
int respa = 0;
if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
if (respa)
error->all(FLERR,"Cannot use Kokkos pair style with rRESPA inner/middle");
}
// irequest = neigh request made by parent class
neighflag = lmp->kokkos->neighflag;
int irequest = neighbor->nrequest - 1;
neighbor->requests[irequest]->
kokkos_host = Kokkos::Impl::is_same<DeviceType,LMPHostType>::value &&
!Kokkos::Impl::is_same<DeviceType,LMPDeviceType>::value;
neighbor->requests[irequest]->
kokkos_device = Kokkos::Impl::is_same<DeviceType,LMPDeviceType>::value;
if (neighflag == FULL) {
neighbor->requests[irequest]->full = 1;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full_cluster = 0;
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
neighbor->requests[irequest]->full = 0;
neighbor->requests[irequest]->half = 1;
neighbor->requests[irequest]->full_cluster = 0;
} else {
error->all(FLERR,"Cannot use chosen neighbor list style with lj/charmm/coul/long/kk");
}
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
template<class DeviceType>
double PairLJCharmmCoulLongKokkos<DeviceType>::init_one(int i, int j)
{
double cutone = PairLJCharmmCoulLong::init_one(i,j);
double cut_ljsqm = cut_ljsq;
double cut_coulsqm = cut_coulsq;
k_params.h_view(i,j).lj1 = lj1[i][j];
k_params.h_view(i,j).lj2 = lj2[i][j];
k_params.h_view(i,j).lj3 = lj3[i][j];
k_params.h_view(i,j).lj4 = lj4[i][j];
//k_params.h_view(i,j).offset = offset[i][j];
k_params.h_view(i,j).cut_ljsq = cut_ljsqm;
k_params.h_view(i,j).cut_coulsq = cut_coulsqm;
k_params.h_view(j,i) = k_params.h_view(i,j);
if(i<MAX_TYPES_STACKPARAMS+1 && j<MAX_TYPES_STACKPARAMS+1) {
m_params[i][j] = m_params[j][i] = k_params.h_view(i,j);
m_cutsq[j][i] = m_cutsq[i][j] = cutone*cutone;
m_cut_ljsq[j][i] = m_cut_ljsq[i][j] = cut_ljsqm;
m_cut_coulsq[j][i] = m_cut_coulsq[i][j] = cut_coulsqm;
}
k_cutsq.h_view(i,j) = cutone*cutone;
k_cutsq.h_view(j,i) = k_cutsq.h_view(i,j);
k_cutsq.template modify<LMPHostType>();
k_cut_ljsq.h_view(i,j) = cut_ljsqm;
k_cut_ljsq.h_view(j,i) = k_cut_ljsq.h_view(i,j);
k_cut_ljsq.template modify<LMPHostType>();
k_cut_coulsq.h_view(i,j) = cut_coulsqm;
k_cut_coulsq.h_view(j,i) = k_cut_coulsq.h_view(i,j);
k_cut_coulsq.template modify<LMPHostType>();
k_params.template modify<LMPHostType>();
return cutone;
}
template class PairLJCharmmCoulLongKokkos<LMPDeviceType>;
#ifdef KOKKOS_HAVE_CUDA
template class PairLJCharmmCoulLongKokkos<LMPHostType>;
#endif
diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h
index f212540a1..7ecf19ffb 100644
--- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h
+++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h
@@ -1,151 +1,150 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(lj/charmm/coul/long/kk,PairLJCharmmCoulLongKokkos<LMPDeviceType>)
PairStyle(lj/charmm/coul/long/kk/device,PairLJCharmmCoulLongKokkos<LMPDeviceType>)
PairStyle(lj/charmm/coul/long/kk/host,PairLJCharmmCoulLongKokkos<LMPHostType>)
#else
#ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_KOKKOS_H
#define LMP_PAIR_LJ_CHARMM_COUL_LONG_KOKKOS_H
#include "pair_kokkos.h"
#include "pair_lj_charmm_coul_long.h"
#include "neigh_list_kokkos.h"
namespace LAMMPS_NS {
template<class DeviceType>
class PairLJCharmmCoulLongKokkos : public PairLJCharmmCoulLong {
public:
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
enum {COUL_FLAG=1};
typedef DeviceType device_type;
PairLJCharmmCoulLongKokkos(class LAMMPS *);
~PairLJCharmmCoulLongKokkos();
void compute(int, int);
- void settings(int, char **);
void init_tables(double cut_coul, double *cut_respa);
void init_style();
double init_one(int, int);
struct params_lj_coul{
params_lj_coul(){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
params_lj_coul(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset;
};
protected:
void cleanup_copy();
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j,
const int& itype, const int& jtype) const;
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype,
const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const;
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j,
const int& itype, const int& jtype) const;
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j,
const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const;
Kokkos::DualView<params_lj_coul**,Kokkos::LayoutRight,DeviceType> k_params;
typename Kokkos::DualView<params_lj_coul**,
Kokkos::LayoutRight,DeviceType>::t_dev_const_um params;
// hardwired to space for 15 atom types
params_lj_coul m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
F_FLOAT m_cutsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
F_FLOAT m_cut_ljsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
F_FLOAT m_cut_coulsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
typename ArrayTypes<DeviceType>::t_x_array_randomread x;
typename ArrayTypes<DeviceType>::t_x_array c_x;
typename ArrayTypes<DeviceType>::t_f_array f;
typename ArrayTypes<DeviceType>::t_int_1d_randomread type;
typename ArrayTypes<DeviceType>::t_float_1d_randomread q;
DAT::tdual_efloat_1d k_eatom;
DAT::tdual_virial_array k_vatom;
typename ArrayTypes<DeviceType>::t_efloat_1d d_eatom;
typename ArrayTypes<DeviceType>::t_virial_array d_vatom;
int newton_pair;
typename ArrayTypes<DeviceType>::tdual_ffloat_2d k_cutsq;
typename ArrayTypes<DeviceType>::t_ffloat_2d d_cutsq;
typename ArrayTypes<DeviceType>::tdual_ffloat_2d k_cut_ljsq;
typename ArrayTypes<DeviceType>::t_ffloat_2d d_cut_ljsq;
typename ArrayTypes<DeviceType>::tdual_ffloat_2d k_cut_coulsq;
typename ArrayTypes<DeviceType>::t_ffloat_2d d_cut_coulsq;
typename ArrayTypes<DeviceType>::t_ffloat_1d_randomread
d_rtable, d_drtable, d_ftable, d_dftable,
d_ctable, d_dctable, d_etable, d_detable;
int neighflag;
int nlocal,nall,eflag,vflag;
double special_coul[4];
double special_lj[4];
double qqrd2e;
void allocate();
friend class PairComputeFunctor<PairLJCharmmCoulLongKokkos,FULL,true,CoulLongTable<1> >;
friend class PairComputeFunctor<PairLJCharmmCoulLongKokkos,HALF,true,CoulLongTable<1> >;
friend class PairComputeFunctor<PairLJCharmmCoulLongKokkos,HALFTHREAD,true,CoulLongTable<1> >;
friend class PairComputeFunctor<PairLJCharmmCoulLongKokkos,FULL,false,CoulLongTable<1> >;
friend class PairComputeFunctor<PairLJCharmmCoulLongKokkos,HALF,false,CoulLongTable<1> >;
friend class PairComputeFunctor<PairLJCharmmCoulLongKokkos,HALFTHREAD,false,CoulLongTable<1> >;
friend EV_FLOAT pair_compute_neighlist<PairLJCharmmCoulLongKokkos,FULL,CoulLongTable<1> >(PairLJCharmmCoulLongKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairLJCharmmCoulLongKokkos,HALF,CoulLongTable<1> >(PairLJCharmmCoulLongKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairLJCharmmCoulLongKokkos,HALFTHREAD,CoulLongTable<1> >(PairLJCharmmCoulLongKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute<PairLJCharmmCoulLongKokkos,CoulLongTable<1> >(PairLJCharmmCoulLongKokkos*,
NeighListKokkos<DeviceType>*);
friend class PairComputeFunctor<PairLJCharmmCoulLongKokkos,FULL,true,CoulLongTable<0> >;
friend class PairComputeFunctor<PairLJCharmmCoulLongKokkos,HALF,true,CoulLongTable<0> >;
friend class PairComputeFunctor<PairLJCharmmCoulLongKokkos,HALFTHREAD,true,CoulLongTable<0> >;
friend class PairComputeFunctor<PairLJCharmmCoulLongKokkos,FULL,false,CoulLongTable<0> >;
friend class PairComputeFunctor<PairLJCharmmCoulLongKokkos,HALF,false,CoulLongTable<0> >;
friend class PairComputeFunctor<PairLJCharmmCoulLongKokkos,HALFTHREAD,false,CoulLongTable<0> >;
friend EV_FLOAT pair_compute_neighlist<PairLJCharmmCoulLongKokkos,FULL,CoulLongTable<0> >(PairLJCharmmCoulLongKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairLJCharmmCoulLongKokkos,HALF,CoulLongTable<0> >(PairLJCharmmCoulLongKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairLJCharmmCoulLongKokkos,HALFTHREAD,CoulLongTable<0> >(PairLJCharmmCoulLongKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute<PairLJCharmmCoulLongKokkos,CoulLongTable<0> >(PairLJCharmmCoulLongKokkos*,
NeighListKokkos<DeviceType>*);
friend void pair_virial_fdotr_compute<PairLJCharmmCoulLongKokkos>(PairLJCharmmCoulLongKokkos*);
};
}
#endif
#endif
/* ERROR/WARNING messages:
*/
diff --git a/src/KOKKOS/pair_lj_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_kokkos.cpp
index 1e400c641..3fd73350e 100644
--- a/src/KOKKOS/pair_lj_cut_kokkos.cpp
+++ b/src/KOKKOS/pair_lj_cut_kokkos.cpp
@@ -1,272 +1,299 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_lj_cut_kokkos.h"
#include "kokkos.h"
#include "atom_kokkos.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "update.h"
#include "integrate.h"
#include "respa.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
#include "atom_masks.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define KOKKOS_CUDA_MAX_THREADS 256
#define KOKKOS_CUDA_MIN_BLOCKS 8
/* ---------------------------------------------------------------------- */
template<class DeviceType>
PairLJCutKokkos<DeviceType>::PairLJCutKokkos(LAMMPS *lmp) : PairLJCut(lmp)
{
respa_enable = 0;
atomKK = (AtomKokkos *) atom;
execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK;
datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK;
cutsq = NULL;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
PairLJCutKokkos<DeviceType>::~PairLJCutKokkos()
{
if (allocated) {
+ memory->destroy_kokkos(k_eatom,eatom);
+ memory->destroy_kokkos(k_vatom,vatom);
k_cutsq = DAT::tdual_ffloat_2d();
memory->sfree(cutsq);
+ eatom = NULL;
+ vatom = NULL;
cutsq = NULL;
}
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void PairLJCutKokkos<DeviceType>::cleanup_copy() {
// WHY needed: this prevents parent copy from deallocating any arrays
allocated = 0;
cutsq = NULL;
eatom = NULL;
vatom = NULL;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void PairLJCutKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
{
eflag = eflag_in;
vflag = vflag_in;
if (neighflag == FULL || neighflag == FULLCLUSTER) no_virial_fdotr_compute = 1;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
+ // reallocate per-atom arrays if necessary
+
+ if (eflag_atom) {
+ memory->destroy_kokkos(k_eatom,eatom);
+ memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom");
+ d_eatom = k_eatom.view<DeviceType>();
+ }
+ if (vflag_atom) {
+ memory->destroy_kokkos(k_vatom,vatom);
+ memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom");
+ d_vatom = k_vatom.view<DeviceType>();
+ }
+
atomKK->sync(execution_space,datamask_read);
k_cutsq.template sync<DeviceType>();
k_params.template sync<DeviceType>();
if (eflag || vflag) atomKK->modified(execution_space,datamask_modify);
else atomKK->modified(execution_space,F_MASK);
x = atomKK->k_x.view<DeviceType>();
c_x = atomKK->k_x.view<DeviceType>();
f = atomKK->k_f.view<DeviceType>();
type = atomKK->k_type.view<DeviceType>();
tag = atomKK->k_tag.view<DeviceType>();
nlocal = atom->nlocal;
nall = atom->nlocal + atom->nghost;
newton_pair = force->newton_pair;
special_lj[0] = force->special_lj[0];
special_lj[1] = force->special_lj[1];
special_lj[2] = force->special_lj[2];
special_lj[3] = force->special_lj[3];
// loop over neighbors of my atoms
EV_FLOAT ev = pair_compute<PairLJCutKokkos<DeviceType>,void >(this,(NeighListKokkos<DeviceType>*)list);
DeviceType::fence();
- if (eflag) eng_vdwl += ev.evdwl;
+ if (eflag_global) eng_vdwl += ev.evdwl;
if (vflag_global) {
virial[0] += ev.v[0];
virial[1] += ev.v[1];
virial[2] += ev.v[2];
virial[3] += ev.v[3];
virial[4] += ev.v[4];
virial[5] += ev.v[5];
}
if (vflag_fdotr) pair_virial_fdotr_compute(this);
+
+ if (eflag_atom) {
+ k_eatom.template modify<DeviceType>();
+ k_eatom.template sync<LMPHostType>();
+ }
+
+ if (vflag_atom) {
+ k_vatom.template modify<DeviceType>();
+ k_vatom.template sync<LMPHostType>();
+ }
}
template<class DeviceType>
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT PairLJCutKokkos<DeviceType>::
compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const {
(void) i;
(void) j;
const F_FLOAT r2inv = 1.0/rsq;
const F_FLOAT r6inv = r2inv*r2inv*r2inv;
const F_FLOAT forcelj = r6inv *
((STACKPARAMS?m_params[itype][jtype].lj1:params(itype,jtype).lj1)*r6inv -
(STACKPARAMS?m_params[itype][jtype].lj2:params(itype,jtype).lj2));
return forcelj*r2inv;
}
template<class DeviceType>
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT PairLJCutKokkos<DeviceType>::
compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const {
(void) i;
(void) j;
const F_FLOAT r2inv = 1.0/rsq;
const F_FLOAT r6inv = r2inv*r2inv*r2inv;
return r6inv*((STACKPARAMS?m_params[itype][jtype].lj3:params(itype,jtype).lj3)*r6inv -
(STACKPARAMS?m_params[itype][jtype].lj4:params(itype,jtype).lj4)) -
(STACKPARAMS?m_params[itype][jtype].offset:params(itype,jtype).offset);
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
template<class DeviceType>
void PairLJCutKokkos<DeviceType>::allocate()
{
PairLJCut::allocate();
int n = atom->ntypes;
memory->destroy(cutsq);
memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq");
d_cutsq = k_cutsq.template view<DeviceType>();
k_params = Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType>("PairLJCut::params",n+1,n+1);
params = k_params.d_view;
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
template<class DeviceType>
void PairLJCutKokkos<DeviceType>::settings(int narg, char **arg)
{
if (narg > 2) error->all(FLERR,"Illegal pair_style command");
PairLJCut::settings(1,arg);
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
template<class DeviceType>
void PairLJCutKokkos<DeviceType>::init_style()
{
PairLJCut::init_style();
// error if rRESPA with inner levels
if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
int respa = 0;
if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
if (respa)
error->all(FLERR,"Cannot use Kokkos pair style with rRESPA inner/middle");
}
// irequest = neigh request made by parent class
neighflag = lmp->kokkos->neighflag;
int irequest = neighbor->nrequest - 1;
neighbor->requests[irequest]->
kokkos_host = Kokkos::Impl::is_same<DeviceType,LMPHostType>::value &&
!Kokkos::Impl::is_same<DeviceType,LMPDeviceType>::value;
neighbor->requests[irequest]->
kokkos_device = Kokkos::Impl::is_same<DeviceType,LMPDeviceType>::value;
if (neighflag == FULL) {
neighbor->requests[irequest]->full = 1;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full_cluster = 0;
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
neighbor->requests[irequest]->full = 0;
neighbor->requests[irequest]->half = 1;
neighbor->requests[irequest]->full_cluster = 0;
} else if (neighflag == N2) {
neighbor->requests[irequest]->full = 0;
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full_cluster = 0;
} else if (neighflag == FULLCLUSTER) {
neighbor->requests[irequest]->full_cluster = 1;
neighbor->requests[irequest]->full = 1;
neighbor->requests[irequest]->half = 0;
} else {
error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/kk");
}
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
template<class DeviceType>
double PairLJCutKokkos<DeviceType>::init_one(int i, int j)
{
double cutone = PairLJCut::init_one(i,j);
k_params.h_view(i,j).lj1 = lj1[i][j];
k_params.h_view(i,j).lj2 = lj2[i][j];
k_params.h_view(i,j).lj3 = lj3[i][j];
k_params.h_view(i,j).lj4 = lj4[i][j];
k_params.h_view(i,j).offset = offset[i][j];
k_params.h_view(i,j).cutsq = cutone*cutone;
k_params.h_view(j,i) = k_params.h_view(i,j);
if(i<MAX_TYPES_STACKPARAMS+1 && j<MAX_TYPES_STACKPARAMS+1) {
m_params[i][j] = m_params[j][i] = k_params.h_view(i,j);
m_cutsq[j][i] = m_cutsq[i][j] = cutone*cutone;
}
k_cutsq.h_view(i,j) = cutone*cutone;
k_cutsq.template modify<LMPHostType>();
k_params.template modify<LMPHostType>();
return cutone;
}
template class PairLJCutKokkos<LMPDeviceType>;
#ifdef KOKKOS_HAVE_CUDA
template class PairLJCutKokkos<LMPHostType>;
#endif
diff --git a/src/KOKKOS/pair_lj_cut_kokkos.h b/src/KOKKOS/pair_lj_cut_kokkos.h
index 37046e457..88e13ea9a 100644
--- a/src/KOKKOS/pair_lj_cut_kokkos.h
+++ b/src/KOKKOS/pair_lj_cut_kokkos.h
@@ -1,135 +1,138 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(lj/cut/kk,PairLJCutKokkos<LMPDeviceType>)
PairStyle(lj/cut/kk/device,PairLJCutKokkos<LMPDeviceType>)
PairStyle(lj/cut/kk/host,PairLJCutKokkos<LMPHostType>)
#else
#ifndef LMP_PAIR_LJ_CUT_KOKKOS_H
#define LMP_PAIR_LJ_CUT_KOKKOS_H
#include "pair_kokkos.h"
#include "pair_lj_cut.h"
#include "neigh_list_kokkos.h"
namespace LAMMPS_NS {
template<class DeviceType>
class PairLJCutKokkos : public PairLJCut {
public:
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2|FULLCLUSTER};
enum {COUL_FLAG=0};
typedef DeviceType device_type;
PairLJCutKokkos(class LAMMPS *);
~PairLJCutKokkos();
void compute(int, int);
void settings(int, char **);
void init_style();
double init_one(int, int);
struct params_lj{
KOKKOS_INLINE_FUNCTION
params_lj(){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
KOKKOS_INLINE_FUNCTION
params_lj(int i){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
F_FLOAT cutsq,lj1,lj2,lj3,lj4,offset;
};
protected:
void cleanup_copy();
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const;
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const;
template<bool STACKPARAMS, class Specialisation>
KOKKOS_INLINE_FUNCTION
F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const {
return 0;
}
Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType> k_params;
typename Kokkos::DualView<params_lj**,Kokkos::LayoutRight,DeviceType>::t_dev_const_um params;
params_lj m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1]; // hardwired to space for 15 atom types
F_FLOAT m_cutsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
typename ArrayTypes<DeviceType>::t_x_array_randomread x;
typename ArrayTypes<DeviceType>::t_x_array c_x;
typename ArrayTypes<DeviceType>::t_f_array f;
typename ArrayTypes<DeviceType>::t_int_1d_randomread type;
+
+ DAT::tdual_efloat_1d k_eatom;
+ DAT::tdual_virial_array k_vatom;
typename ArrayTypes<DeviceType>::t_efloat_1d d_eatom;
typename ArrayTypes<DeviceType>::t_virial_array d_vatom;
typename ArrayTypes<DeviceType>::t_tagint_1d tag;
int newton_pair;
double special_lj[4];
typename ArrayTypes<DeviceType>::tdual_ffloat_2d k_cutsq;
typename ArrayTypes<DeviceType>::t_ffloat_2d d_cutsq;
int neighflag;
int nlocal,nall,eflag,vflag;
void allocate();
friend class PairComputeFunctor<PairLJCutKokkos,FULL,true>;
friend class PairComputeFunctor<PairLJCutKokkos,HALF,true>;
friend class PairComputeFunctor<PairLJCutKokkos,HALFTHREAD,true>;
friend class PairComputeFunctor<PairLJCutKokkos,N2,true>;
friend class PairComputeFunctor<PairLJCutKokkos,FULLCLUSTER,true >;
friend class PairComputeFunctor<PairLJCutKokkos,FULL,false>;
friend class PairComputeFunctor<PairLJCutKokkos,HALF,false>;
friend class PairComputeFunctor<PairLJCutKokkos,HALFTHREAD,false>;
friend class PairComputeFunctor<PairLJCutKokkos,N2,false>;
friend class PairComputeFunctor<PairLJCutKokkos,FULLCLUSTER,false >;
friend EV_FLOAT pair_compute_neighlist<PairLJCutKokkos,FULL,void>(PairLJCutKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairLJCutKokkos,HALF,void>(PairLJCutKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairLJCutKokkos,HALFTHREAD,void>(PairLJCutKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_neighlist<PairLJCutKokkos,N2,void>(PairLJCutKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute_fullcluster<PairLJCutKokkos,void>(PairLJCutKokkos*,NeighListKokkos<DeviceType>*);
friend EV_FLOAT pair_compute<PairLJCutKokkos,void>(PairLJCutKokkos*,NeighListKokkos<DeviceType>*);
friend void pair_virial_fdotr_compute<PairLJCutKokkos>(PairLJCutKokkos*);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Cannot use Kokkos pair style with rRESPA inner/middle
rRESPA inner/middle options are not yet supported by Kokkos.
E: Cannot use chosen neighbor list style with lj/cut/kk
That style is not supported by Kokkos.
*/
diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp
index 083e63e96..c5b95598e 100644
--- a/src/MANYBODY/pair_comb.cpp
+++ b/src/MANYBODY/pair_comb.cpp
@@ -1,2136 +1,2135 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Tzu-Ray Shan (U Florida, present: tnshan@sandia.gov)
LAMMPS implementation of the Charge-optimized many-body (COMB) potential
based on the HELL MD program (Prof Simon Phillpot, UF, sphil@mse.ufl.edu)
and Aidan Thompson's Tersoff code in LAMMPS
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_comb.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "group.h"
#include "update.h"
#include "my_page.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define MAXLINE 1024
#define DELTA 4
#define PGDELTA 1
#define MAXNEIGH 24
/* ---------------------------------------------------------------------- */
PairComb::PairComb(LAMMPS *lmp) : Pair(lmp)
{
single_enable = 0;
restartinfo = 0;
one_coeff = 1;
manybody_flag = 1;
nmax = 0;
NCo = NULL;
bbij = NULL;
map = NULL;
esm = NULL;
nelements = 0;
elements = NULL;
nparams = 0;
maxparam = 0;
params = NULL;
elem2param = NULL;
intype = NULL;
fafb = NULL;
dfafb = NULL;
ddfafb = NULL;
phin = NULL;
dphin = NULL;
erpaw = NULL;
sht_num = NULL;
sht_first = NULL;
ipage = NULL;
pgsize = oneatom = 0;
// set comm size needed by this Pair
comm_forward = 1;
comm_reverse = 1;
}
/* ----------------------------------------------------------------------
check if allocated, since class can be destructed when incomplete
------------------------------------------------------------------------- */
PairComb::~PairComb()
{
memory->destroy(NCo);
if (elements)
for (int i = 0; i < nelements; i++) delete [] elements[i];
delete [] elements;
memory->sfree(params);
memory->destroy(elem2param);
memory->destroy(intype);
memory->destroy(fafb);
memory->destroy(dfafb);
memory->destroy(ddfafb);
memory->destroy(phin);
memory->destroy(dphin);
memory->destroy(erpaw);
memory->destroy(bbij);
memory->destroy(sht_num);
memory->sfree(sht_first);
delete [] ipage;
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] map;
delete [] esm;
}
}
/* ---------------------------------------------------------------------- */
void PairComb::compute(int eflag, int vflag)
{
int i,j,k,ii,jj,kk,inum,jnum,iparam_i;
int itype,jtype,ktype,iparam_ij,iparam_ijk;
tagint itag,jtag;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,rsq1,rsq2;
double delr1[3],delr2[3],fi[3],fj[3],fk[3];
double zeta_ij,prefactor;
int *ilist,*jlist,*numneigh,**firstneigh;
int mr1,mr2,mr3;
int rsc,inty;
double elp_ij,filp[3],fjlp[3],fklp[3];
double iq,jq;
double yaself;
double potal,fac11,fac11e;
double vionij,fvionij,sr1,sr2,sr3,Eov,Fov;
int sht_jnum, *sht_jlist, nj;
evdwl = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = vflag_atom = 0;
// Build short range neighbor list
Short_neigh();
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
tagint *tag = atom->tag;
int *type = atom->type;
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
yaself = vionij = fvionij = Eov = Fov = 0.0;
// self energy correction term: potal
potal_calc(potal,fac11,fac11e);
// loop over full neighbor list of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
itag = tag[i];
itype = map[type[i]];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
iq = q[i];
NCo[i] = 0;
nj = 0;
iparam_i = elem2param[itype][itype][itype];
// self energy, only on i atom
yaself = self(&params[iparam_i],iq,potal);
if (evflag) ev_tally(i,i,nlocal,0,yaself,0.0,0.0,0.0,0.0,0.0);
// two-body interactions (long and short repulsive)
jlist = firstneigh[i];
jnum = numneigh[i];
sht_jlist = sht_first[i];
sht_jnum = sht_num[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
jtag = tag[j];
if (itag > jtag) {
if ((itag+jtag) % 2 == 0) continue;
} else if (itag < jtag) {
if ((itag+jtag) % 2 == 1) continue;
} else {
if (x[j][2] < x[i][2]) continue;
if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
}
// Qj calculates 2-body Coulombic
jtype = map[type[j]];
jq = q[j];
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
iparam_ij = elem2param[itype][jtype][jtype];
// long range q-dependent
if (rsq > params[iparam_ij].lcutsq) continue;
inty = intype[itype][jtype];
// polynomial three-point interpolation
tri_point(rsq, mr1, mr2, mr3, sr1, sr2, sr3, itype);
// 1/r energy and forces
direct(inty,mr1,mr2,mr3,rsq,sr1,sr2,sr3,iq,jq,
potal,fac11,fac11e,vionij,fvionij);
// field correction to self energy
field(&params[iparam_ij],rsq,iq,jq,vionij,fvionij);
// polarization field
// sums up long range forces
f[i][0] += delx*fvionij;
f[i][1] += dely*fvionij;
f[i][2] += delz*fvionij;
f[j][0] -= delx*fvionij;
f[j][1] -= dely*fvionij;
f[j][2] -= delz*fvionij;
if (evflag)
ev_tally(i,j,nlocal,newton_pair,0.0,vionij,fvionij,delx,dely,delz);
// short range q-independent
if (rsq > params[iparam_ij].cutsq) continue;
repulsive(&params[iparam_ij],rsq,fpair,eflag,evdwl,iq,jq);
// repulsion is pure two-body, sums up pair repulsive forces
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
if (evflag)
ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
}
// accumulate coordination number information
if (cor_flag) {
for (jj = 0; jj < sht_jnum; jj++) {
j = sht_jlist[jj];
jtype = map[type[j]];
iparam_ij = elem2param[itype][jtype][jtype];
if(params[iparam_ij].hfocor > 0.0 ) {
delr1[0] = x[j][0] - xtmp;
delr1[1] = x[j][1] - ytmp;
delr1[2] = x[j][2] - ztmp;
rsq1 = vec3_dot(delr1,delr1);
if (rsq1 > params[iparam_ij].cutsq) continue;
NCo[i] += 1;
}
}
}
// three-body interactions
// half i-j loop
for (jj = 0; jj < sht_jnum; jj++) {
j = sht_jlist[jj];
jtype = map[type[j]];
iparam_ij = elem2param[itype][jtype][jtype];
// this Qj for q-dependent BSi
jq = q[j];
delr1[0] = x[j][0] - xtmp;
delr1[1] = x[j][1] - ytmp;
delr1[2] = x[j][2] - ztmp;
rsq1 = vec3_dot(delr1,delr1);
if (rsq1 > params[iparam_ij].cutsq) continue;
nj ++;
// accumulate bondorder zeta for each i-j interaction via loop over k
zeta_ij = 0.0;
cuo_flag1 = 0; cuo_flag2 = 0;
for (kk = 0; kk < sht_jnum; kk++) {
k = sht_jlist[kk];
if (j == k) continue;
ktype = map[type[k]];
iparam_ijk = elem2param[itype][jtype][ktype];
delr2[0] = x[k][0] - xtmp;
delr2[1] = x[k][1] - ytmp;
delr2[2] = x[k][2] - ztmp;
rsq2 = vec3_dot(delr2,delr2);
if (rsq2 > params[iparam_ijk].cutsq) continue;
zeta_ij += zeta(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
if (params[iparam_ijk].hfocor == -2.0) cuo_flag1 = 1;
if (params[iparam_ijk].hfocor == -1.0) cuo_flag2 = 1;
}
if (cuo_flag1 && cuo_flag2) cuo_flag = 1;
else cuo_flag = 0;
force_zeta(&params[iparam_ij],eflag,i,nj,rsq1,zeta_ij,
iq,jq,fpair,prefactor,evdwl);
// over-coordination correction for HfO2
if (cor_flag && NCo[i] != 0)
Over_cor(&params[iparam_ij],rsq1,NCo[i],Eov, Fov);
evdwl += Eov;
fpair += Fov;
f[i][0] += delr1[0]*fpair;
f[i][1] += delr1[1]*fpair;
f[i][2] += delr1[2]*fpair;
f[j][0] -= delr1[0]*fpair;
f[j][1] -= delr1[1]*fpair;
f[j][2] -= delr1[2]*fpair;
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,-fpair,-delr1[0],-delr1[1],-delr1[2]);
// attractive term via loop over k (3-body forces)
for (kk = 0; kk < sht_jnum; kk++) {
k = sht_jlist[kk];
if (j == k) continue;
ktype = map[type[k]];
iparam_ijk = elem2param[itype][jtype][ktype];
delr2[0] = x[k][0] - xtmp;
delr2[1] = x[k][1] - ytmp;
delr2[2] = x[k][2] - ztmp;
rsq2 = vec3_dot(delr2,delr2);
if (rsq2 > params[iparam_ijk].cutsq) continue;
for (rsc = 0; rsc < 3; rsc++)
fi[rsc] = fj[rsc] = fk[rsc] = 0.0;
attractive(&params[iparam_ijk],prefactor,
rsq1,rsq2,delr1,delr2,fi,fj,fk);
// 3-body LP and BB correction and forces
elp_ij = elp(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
flp(&params[iparam_ijk],rsq1,rsq2,delr1,delr2,filp,fjlp,fklp);
for (rsc = 0; rsc < 3; rsc++) {
fi[rsc] += filp[rsc];
fj[rsc] += fjlp[rsc];
fk[rsc] += fklp[rsc];
}
for (rsc = 0; rsc < 3; rsc++) {
f[i][rsc] += fi[rsc];
f[j][rsc] += fj[rsc];
f[k][rsc] += fk[rsc];
}
if (evflag)
ev_tally(i,j,nlocal,newton_pair,elp_ij,0.0,0.0,0.0,0.0,0.0);
if (vflag_atom) v_tally3(i,j,k,fj,fk,delr1,delr2);
}
}
if (cuo_flag) params[iparam_i].cutsq *= 0.65;
}
cuo_flag = 0;
if (vflag_fdotr) virial_fdotr_compute();
}
/* ---------------------------------------------------------------------- */
void PairComb::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
map = new int[n+1];
esm = new double[n];
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairComb::settings(int narg, char **arg)
{
if (narg > 0) error->all(FLERR,"Illegal pair_style command");
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairComb::coeff(int narg, char **arg)
{
int i,j,n;
if (!allocated) allocate();
if (narg != 3 + atom->ntypes)
error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if NULL
// nelements = # of unique elements
// elements = list of element names
if (elements) {
for (i = 0; i < nelements; i++) delete [] elements[i];
delete [] elements;
}
elements = new char*[atom->ntypes];
for (i = 0; i < atom->ntypes; i++) elements[i] = NULL;
nelements = 0;
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {
map[i-2] = -1;
continue;
}
for (j = 0; j < nelements; j++)
if (strcmp(arg[i],elements[j]) == 0) break;
map[i-2] = j;
if (j == nelements) {
n = strlen(arg[i]) + 1;
elements[j] = new char[n];
strcpy(elements[j],arg[i]);
nelements++;
}
}
// read potential file and initialize potential parameters
read_file(arg[2]);
setup();
n = atom->ntypes;
// generate streitz-mintmire direct 1/r energy look-up table
if (comm->me == 0 && screen) fprintf(screen,"Pair COMB:\n");
if (comm->me == 0 && screen)
fprintf(screen," generating Coulomb integral lookup table ...\n");
sm_table();
if (cor_flag && comm->me == 0 && screen)
fprintf(screen," will apply over-coordination correction ...\n");
if (!cor_flag&& comm->me == 0 && screen)
fprintf(screen," will not apply over-coordination correction ...\n");
// clear setflag since coeff() called once with I,J = * *
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
// set setflag i,j for type pairs where both are mapped to elements
int count = 0;
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
if (map[i] >= 0 && map[j] >= 0) {
setflag[i][j] = 1;
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairComb::init_style()
{
if (atom->tag_enable == 0)
error->all(FLERR,"Pair style COMB requires atom IDs");
if (force->newton_pair == 0)
error->all(FLERR,"Pair style COMB requires newton pair on");
if (!atom->q_flag)
error->all(FLERR,"Pair style COMB requires atom attribute q");
// ptr to QEQ fix
//for (i = 0; i < modify->nfix; i++)
// if (strcmp(modify->fix[i]->style,"qeq") == 0) break;
//if (i < modify->nfix) fixqeq = (FixQEQ *) modify->fix[i];
//else fixqeq = NULL;
// need a full neighbor list
int irequest = neighbor->request(this,instance_me);
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1;
// local Comb neighbor list
// create pages if first time or if neighbor pgsize/oneatom has changed
int create = 0;
if (ipage == NULL) create = 1;
if (pgsize != neighbor->pgsize) create = 1;
if (oneatom != neighbor->oneatom) create = 1;
if (create) {
delete [] ipage;
pgsize = neighbor->pgsize;
oneatom = neighbor->oneatom;
int nmypage = comm->nthreads;
ipage = new MyPage<int>[nmypage];
for (int i = 0; i < nmypage; i++)
ipage[i].init(oneatom,pgsize);
}
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairComb::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
return cutmax;
}
/* ---------------------------------------------------------------------- */
void PairComb::read_file(char *file)
{
int params_per_line = 49;
char **words = new char*[params_per_line+1];
memory->sfree(params);
params = NULL;
nparams = 0;
maxparam = 0;
// open file on proc 0
FILE *fp;
if (comm->me == 0) {
fp = force->open_potential(file);
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open COMB potential file %s",file);
error->one(FLERR,str);
}
}
// read each line out of file, skipping blank lines or leading '#'
// store line of params if all 3 element tags are in element list
int n,nwords,ielement,jelement,kelement;
char line[MAXLINE],*ptr;
int eof = 0;
while (1) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fp);
if (ptr == NULL) {
eof = 1;
fclose(fp);
} else n = strlen(line) + 1;
}
MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) break;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
// strip comment, skip line if blank
if ((ptr = strchr(line,'#'))) *ptr = '\0';
nwords = atom->count_words(line);
if (nwords == 0) continue;
// concatenate additional lines until have params_per_line words
while (nwords < params_per_line) {
n = strlen(line);
if (comm->me == 0) {
ptr = fgets(&line[n],MAXLINE-n,fp);
if (ptr == NULL) {
eof = 1;
fclose(fp);
} else n = strlen(line) + 1;
}
MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) break;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
if ((ptr = strchr(line,'#'))) *ptr = '\0';
nwords = atom->count_words(line);
}
if (nwords != params_per_line)
error->all(FLERR,"Incorrect format in COMB potential file");
// words = ptrs to all words in line
nwords = 0;
words[nwords++] = strtok(line," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue;
// ielement,jelement,kelement = 1st args
// if all 3 args are in element list, then parse this line
// else skip to next line
for (ielement = 0; ielement < nelements; ielement++)
if (strcmp(words[0],elements[ielement]) == 0) break;
if (ielement == nelements) continue;
for (jelement = 0; jelement < nelements; jelement++)
if (strcmp(words[1],elements[jelement]) == 0) break;
if (jelement == nelements) continue;
for (kelement = 0; kelement < nelements; kelement++)
if (strcmp(words[2],elements[kelement]) == 0) break;
if (kelement == nelements) continue;
// load up parameter settings and error check their values
if (nparams == maxparam) {
maxparam += DELTA;
params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
"pair:params");
}
params[nparams].ielement = ielement;
params[nparams].jelement = jelement;
params[nparams].kelement = kelement;
params[nparams].powerm = atof(words[3]);
params[nparams].c = atof(words[4]);
params[nparams].d = atof(words[5]);
params[nparams].h = atof(words[6]);
params[nparams].powern = atof(words[7]);
params[nparams].beta = atof(words[8]);
params[nparams].lam21 = atof(words[9]);
params[nparams].lam22 = atof(words[10]);
params[nparams].bigb1 = atof(words[11]);
params[nparams].bigb2 = atof(words[12]);
params[nparams].bigr = atof(words[13]);
params[nparams].bigd = atof(words[14]);
params[nparams].lam11 = atof(words[15]);
params[nparams].lam12 = atof(words[16]);
params[nparams].biga1 = atof(words[17]);
params[nparams].biga2 = atof(words[18]);
params[nparams].plp1 = atof(words[19]);
params[nparams].plp3 = atof(words[20]);
params[nparams].plp6 = atof(words[21]);
params[nparams].a123 = atof(words[22]);
params[nparams].aconf= atof(words[23]);
params[nparams].addrep = atof(words[24]);
params[nparams].romigb = atof(words[25]);
params[nparams].romigc = atof(words[26]);
params[nparams].romigd = atof(words[27]);
params[nparams].romiga = atof(words[28]);
params[nparams].QL1 = atof(words[29]);
params[nparams].QU1 = atof(words[30]);
params[nparams].DL1 = atof(words[31]);
params[nparams].DU1 = atof(words[32]);
params[nparams].QL2 = atof(words[33]);
params[nparams].QU2 = atof(words[34]);
params[nparams].DL2 = atof(words[35]);
params[nparams].DU2 = atof(words[36]);
params[nparams].chi = atof(words[37]);
params[nparams].dj = atof(words[38]);
params[nparams].dk = atof(words[39]);
params[nparams].dl = atof(words[40]);
params[nparams].dm = atof(words[41]);
params[nparams].esm1 = atof(words[42]);
params[nparams].cmn1 = atof(words[43]);
params[nparams].cml1 = atof(words[44]);
params[nparams].cmn2 = atof(words[45]);
params[nparams].cml2 = atof(words[46]);
params[nparams].coulcut = atof(words[47]);
params[nparams].hfocor = atof(words[48]);
params[nparams].powermint = int(params[nparams].powerm);
// parameter sanity checks
if (params[nparams].lam11 < 0.0 || params[nparams].lam12 < 0.0 ||
params[nparams].c < 0.0 || params[nparams].d < 0.0 ||
params[nparams].powern < 0.0 || params[nparams].beta < 0.0 ||
params[nparams].lam21 < 0.0 || params[nparams].lam22 < 0.0 ||
params[nparams].bigb1< 0.0 || params[nparams].bigb2< 0.0 ||
params[nparams].biga1< 0.0 || params[nparams].biga2< 0.0 ||
params[nparams].bigr < 0.0 || params[nparams].bigd < 0.0 ||
params[nparams].bigd > params[nparams].bigr ||
params[nparams].powerm - params[nparams].powermint != 0.0 ||
(params[nparams].powermint != 3 && params[nparams].powermint != 1) ||
params[nparams].plp1 < 0.0 || params[nparams].plp3 < 0.0 ||
params[nparams].plp6 < 0.0 ||
params[nparams].a123 > 360.0 || params[nparams].aconf < 0.0 ||
params[nparams].addrep < 0.0 || params[nparams].romigb < 0.0 ||
params[nparams].romigc < 0.0 || params[nparams].romigd < 0.0 ||
params[nparams].romiga < 0.0 ||
params[nparams].QL1 > 0.0 || params[nparams].QU1 < 0.0 ||
params[nparams].DL1 < 0.0 || params[nparams].DU1 > 0.0 ||
params[nparams].QL2 > 0.0 || params[nparams].QU2 < 0.0 ||
params[nparams].DL2 < 0.0 || params[nparams].DU2 > 0.0 ||
params[nparams].chi < 0.0 ||
// params[nparams].dj < 0.0 || params[nparams].dk < 0.0 ||
// params[nparams].dl < 0.0 || params[nparams].dm < 0.0 ||
params[nparams].esm1 < 0.0)
error->all(FLERR,"Illegal COMB parameter");
if (params[nparams].lam11 < params[nparams].lam21 ||
params[nparams].lam12 < params[nparams].lam22 ||
params[nparams].biga1< params[nparams].bigb1 ||
params[nparams].biga2< params[nparams].bigb2)
error->all(FLERR,"Illegal COMB parameter");
nparams++;
}
delete [] words;
}
/* ---------------------------------------------------------------------- */
void PairComb::setup()
{
int i,j,k,m,n;
// set elem2param for all element triplet combinations
// must be a single exact match to lines read from file
// do not allow for ACB in place of ABC
memory->destroy(elem2param);
memory->create(elem2param,nelements,nelements,nelements,"pair:elem2param");
for (i = 0; i < nelements; i++)
for (j = 0; j < nelements; j++)
for (k = 0; k < nelements; k++) {
n = -1;
for (m = 0; m < nparams; m++) {
if (i == params[m].ielement && j == params[m].jelement &&
k == params[m].kelement) {
if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
n = m;
}
}
if (n < 0) error->all(FLERR,"Potential file is missing an entry");
elem2param[i][j][k] = n;
}
// compute parameter values derived from inputs
for (m = 0; m < nparams; m++) {
params[m].cut = params[m].bigr + params[m].bigd;
params[m].cutsq = params[m].cut*params[m].cut;
params[m].c1 = pow(2.0*params[m].powern*1.0e-16,-1.0/params[m].powern);
params[m].c2 = pow(2.0*params[m].powern*1.0e-8,-1.0/params[m].powern);
params[m].c3 = 1.0/params[m].c2;
params[m].c4 = 1.0/params[m].c1;
params[m].rlm1 = 0.5*(params[m].lam11+params[m].lam12)*params[m].romigc;
params[m].rlm2 = 0.5*(params[m].lam21+params[m].lam22)*params[m].romigd;
params[m].Qo1 = (params[m].QU1+params[m].QL1)/2.0; // (A22)
params[m].dQ1 = (params[m].QU1-params[m].QL1)/2.0; // (A21)
params[m].aB1 = 1.0 /
(1.0-pow(fabs(params[m].Qo1/params[m].dQ1),10.0)); // (A20)
params[m].bB1 = pow(fabs(params[m].aB1),0.1)/params[m].dQ1; // (A19)
params[m].nD1 = log(params[m].DU1/(params[m].DU1-params[m].DL1))/
log(params[m].QU1/(params[m].QU1-params[m].QL1));
params[m].bD1 = (pow((params[m].DL1-params[m].DU1),(1.0/params[m].nD1)))/
(params[m].QU1-params[m].QL1);
params[m].Qo2 = (params[m].QU2+params[m].QL2)/2.0; // (A22)
params[m].dQ2 = (params[m].QU2-params[m].QL2)/2.0; // (A21)
params[m].aB2 = 1.0 /
(1.0-pow(fabs(params[m].Qo2/params[m].dQ2),10.0)); // (A20)
params[m].bB2 = pow(fabs(params[m].aB2),0.1)/params[m].dQ2; // (A19)
params[m].nD2 = log(params[m].DU2/(params[m].DU2-params[m].DL2))/
log(params[m].QU2/(params[m].QU2-params[m].QL2));
params[m].bD2 = (pow((params[m].DL2-params[m].DU2),(1.0/params[m].nD2)))/
(params[m].QU2-params[m].QL2);
params[m].lcut = params[m].coulcut;
params[m].lcutsq = params[m].lcut*params[m].lcut;
params[m].gamma = 1.0; // for the change in pair_comb.h
}
// set cutmax to max of all params
cutmax = cutmin = 0.0;
cor_flag = 0;
for (m = 0; m < nparams; m++) {
if (params[m].cut > cutmax) cutmax = params[m].cut;
if (params[m].lcut > cutmax) cutmax = params[m].lcut;
if (params[m].cutsq > cutmin) cutmin = params[m].cutsq+0.2;
if (params[m].hfocor > 0.0001) cor_flag = 1;
}
}
/* ---------------------------------------------------------------------- */
void PairComb::repulsive(Param *param, double rsq, double &fforce,
int eflag, double &eng, double iq, double jq)
{
double r,tmp_fc,tmp_fc_d,tmp_exp,Di,Dj;
double bigA,Asi,Asj,vrcs,fvrcs,fforce_tmp;
double rslp,rslp2,rslp4,arr1,arr2,fc2j,fc3j,fcp2j,fcp3j;
double romi = param->addrep;
double rrcs = param->bigr + param->bigd;
r = sqrt(rsq);
if (r > rrcs) return ;
tmp_fc = comb_fc(r,param);
tmp_fc_d = comb_fc_d(r,param);
tmp_exp = exp(-param->rlm1 * r);
arr1 = 2.22850; arr2 = 1.89350;
fc2j = comb_fc2(r);
fc3j = comb_fc3(r);
fcp2j = comb_fc2_d(r);
fcp3j = comb_fc3_d(r);
Di = param->DU1 + pow(fabs(param->bD1*(param->QU1-iq)),param->nD1);
Dj = param->DU2 + pow(fabs(param->bD2*(param->QU2-jq)),param->nD2);
Asi = param->biga1 * exp(param->lam11*Di);
Asj = param->biga2 * exp(param->lam12*Dj);
if ( Asi > 0.0 && Asj > 0.0 )
bigA = sqrt(Asi*Asj)*param->romiga;
else
bigA = 0.0;
fforce = -bigA * tmp_exp * (tmp_fc_d - tmp_fc*param->rlm1) / r;
// additional repulsion for TiO2 and HfO2 (switch by cor_flag)
vrcs = 0.0; fvrcs = 0.0;
if (romi > 0.0) {
if (!cor_flag) {
vrcs = romi * pow((1.0-r/rrcs),2.0);
fvrcs= romi * 2.0 * (r/rrcs-1.0)/rrcs; }
else if (cor_flag) {
rslp = ((arr1-r)/(arr1-arr2));
rslp2 = rslp * rslp; rslp4 = rslp2 * rslp2;
vrcs = fc2j * fc3j * romi * ((50.0*rslp4-30.0*rslp2+4.50))/8.0;
fvrcs = fcp2j*fcp3j*romi*rslp*(-25.0*rslp2+7.50)/(arr1-arr2);
}
fforce_tmp = fforce*vrcs - (tmp_fc * bigA * tmp_exp * fvrcs);
fforce += fforce_tmp;
}
// eng = repulsive energy
if (eflag) eng = (tmp_fc * bigA * tmp_exp)*(1.0+vrcs);
}
/* ---------------------------------------------------------------------- */
double PairComb::zeta(Param *param, double rsqij, double rsqik,
double *delrij, double *delrik)
{
double rij,rik,costheta,arg,ex_delr;
rij = sqrt(rsqij);
if (rij > param->bigr+param->bigd) return 0.0;
rik = sqrt(rsqik);
costheta = vec3_dot(delrij,delrik) / (rij*rik);
if (param->powermint == 3) arg = pow(param->rlm2 * (rij-rik),3.0);
else arg = param->rlm2 * (rij-rik);
if (arg > 69.0776) ex_delr = 1.e30;
else if (arg < -69.0776) ex_delr = 0.0;
else ex_delr = exp(arg);
return comb_fc(rik,param) * comb_gijk(costheta,param) * ex_delr;
}
/* ----------------------------------------------------------------------
Legendre polynomial bond angle correction to energy
------------------------------------------------------------------------- */
double PairComb::elp(Param *param, double rsqij, double rsqik,
double *delrij, double *delrik)
{
if (param->aconf > 1.0e-6 || param->plp1 > 1.0e-6 ||
param->plp3 > 1.0e-6 || param->plp6 > 1.0e-6) {
double rij,rik,costheta,lp1,lp3,lp6;
double rmu,rmu2,comtt,fcj,fck;
double pplp1 = param->plp1, pplp3 = param->plp3, pplp6 = param->plp6;
double c123 = cos(param->a123*MY_PI/180.0);
// cos(theta) of the i-j-k
// cutoff function of rik
rij = sqrt(rsqij);
rik = sqrt(rsqik);
costheta = vec3_dot(delrij,delrik) / (rij*rik);
fcj = comb_fc(rij,param);
fck = comb_fc(rik,param);
rmu = costheta;
// Legendre Polynomial functions
if (param->plp1 > 1.0e-6 || param->plp3 > 1.0e-6 || param->plp6 > 1.0e-6) {
rmu2 = rmu*rmu;
lp1 = rmu; lp3 = 0.5*(5.0*rmu2*rmu-3.0*rmu);
lp6 = (231.0*rmu2*rmu2*rmu2-315.0*rmu2*rmu2+105.0*rmu2-5.0)/16.0;
comtt = pplp1*lp1 + pplp3*lp3 + pplp6*lp6;
} else comtt = 0.0;
// bond-bending terms
if (param->aconf>1e-4) {
if (param->hfocor >= 0.0)
comtt += param->aconf *(rmu-c123)*(rmu-c123);
else if (param->hfocor < 0.0)
comtt += param->aconf *(4.0-(rmu-c123)*(rmu-c123));
}
return 0.5 * fcj * fck * comtt;
}
return 0.0;
}
/* ----------------------------------------------------------------------
Legendre polynomial bond angle correction to forces
------------------------------------------------------------------------- */
void PairComb::flp(Param *param, double rsqij, double rsqik,
double *delrij, double *delrik, double *drilp,
double *drjlp, double *drklp)
{
double ffj1,ffj2,ffk1,ffk2;
ffj1 = 0.0; ffj2 = 0.0; ffk1 = 0.0; ffk2 = 0.0;
if (param->aconf > 1.0e-4 || param->plp1 > 1.0e-6 ||
param->plp3 > 1.0e-6 || param->plp6 > 1.0e-6) {
double rij,rik,costheta,lp1,lp1_d,lp3,lp3_d,lp6,lp6_d;
double rmu,rmu2,comtt,comtt_d,com4k,com5,fcj,fck,fck_d;
double pplp1 = param->plp1;
double pplp3 = param->plp3;
double pplp6 = param->plp6;
double c123 = cos(param->a123*MY_PI/180.0);
// fck_d = derivative of cutoff function
rij = sqrt(rsqij); rik = sqrt(rsqik);
costheta = vec3_dot(delrij,delrik) / (rij*rik);
fcj = comb_fc(rij,param);
fck = comb_fc(rik,param);
fck_d = comb_fc_d(rik,param);
rmu = costheta;
// Legendre Polynomial functions and derivatives
if (param->plp1 > 1.0e-6 || param->plp3 > 1.0e-6 || param->plp6 > 1.0e-6) {
rmu2 = rmu*rmu;
lp1 = rmu; lp3 = (2.5*rmu2*rmu-1.5*rmu);
lp6 = (231.0*rmu2*rmu2*rmu2-315.0*rmu2*rmu2+105.0*rmu2-5.0)/16.0;
lp1_d = 1.0;lp3_d = (7.5*rmu2-1.5);
lp6_d = (1386.0*rmu2*rmu2*rmu-1260.0*rmu2*rmu+210.0)/16.0;
comtt = pplp1*lp1 + pplp3*lp3 + pplp6*lp6;
comtt_d = pplp1*lp1_d + pplp3*lp3_d + pplp6*lp6_d;
} else {
comtt = 0.0;
comtt_d = 0.0;
}
// bond-bending terms derivatives
if (param->aconf > 1.0e-4) {
if (param->hfocor >= 0.0) {
comtt += param->aconf *(rmu-c123)*(rmu-c123);
comtt_d += 2.0*param->aconf*(rmu-c123);
} else if (param->hfocor < 0.0) {
comtt += param->aconf *(4.0-(rmu-c123)*(rmu-c123));
comtt_d += -2.0*param->aconf*(rmu-c123);
}
}
com4k = 2.0 * fcj * fck_d * comtt;
com5 = fcj * fck * comtt_d;
ffj1 =-0.5*(com5/(rij*rik));
ffj2 = 0.5*(com5*rmu/rsqij);
ffk1 = ffj1;
ffk2 = 0.5*(-com4k/rik+com5*rmu/rsqik);
} else {
ffj1 = 0.0; ffj2 = 0.0;
ffk1 = 0.0; ffk2 = 0.0;
}
// j-atom
vec3_scale(ffj1,delrik,drjlp); // (k,x[],y[]), y[]=k*x[]
vec3_scaleadd(ffj2,delrij,drjlp,drjlp); // (k,x[],y[],z[]), z[]=k*x[]+y[]
// k-atom
vec3_scale(ffk1,delrij,drklp);
vec3_scaleadd(ffk2,delrik,drklp,drklp);
// i-atom
vec3_add(drjlp,drklp,drilp); // (x[],y[],z[]), z[]=x[]+y[]
vec3_scale(-1.0,drilp,drilp);
}
/* ---------------------------------------------------------------------- */
void PairComb::force_zeta(Param *param, int eflag, int i, int j, double rsq,
double zeta_ij, double iq, double jq, double &fforce,
double &prefactor, double &eng)
{
double r,fa,fa_d,bij;
r = sqrt(rsq);
if (r > param->bigr+param->bigd) return;
fa = comb_fa(r,param,iq,jq);
fa_d = comb_fa_d(r,param,iq,jq);
bij = comb_bij(zeta_ij,param);
bbij[i][j] = bij;
// force
fforce = 0.5*bij*fa_d / r;
prefactor = -0.5*fa * comb_bij_d(zeta_ij,param);
// eng = attractive energy
if (eflag) eng = 0.5*bij*fa;
}
/* ---------------------------------------------------------------------- */
double PairComb::comb_fc(double r, Param *param)
{
double comb_R = param->bigr;
double comb_D = param->bigd;
if (r < comb_R-comb_D) return 1.0;
if (r > comb_R+comb_D) return 0.0;
return 0.5*(1.0 - sin(MY_PI2*(r - comb_R)/comb_D));
}
/* ---------------------------------------------------------------------- */
double PairComb::comb_fc_d(double r, Param *param)
{
double comb_R = param->bigr;
double comb_D = param->bigd;
if (r < comb_R-comb_D) return 0.0;
if (r > comb_R+comb_D) return 0.0;
return -(MY_PI4/comb_D) * cos(MY_PI2*(r - comb_R)/comb_D);
}
/* ---------------------------------------------------------------------- */
double PairComb::comb_fc2(double r)
{
double comb_R = 1.89350;
double comb_D = comb_R + 0.050;
if (r < comb_R) return 0.0;
if (r > comb_D) return 1.0;
return 0.5*(1.0 + cos(MY_PI*(r - comb_R)/(comb_D-comb_R)));
}
/* ---------------------------------------------------------------------- */
double PairComb::comb_fc2_d(double r)
{
double comb_R = 1.89350;
double comb_D = comb_R + 0.050;
if (r < comb_R) return 0.0;
if (r > comb_D) return 0.0;
return -(MY_PI2/(comb_D-comb_R)) * sin(MY_PI*(r - comb_R)/(comb_D-comb_R));
}
/* ---------------------------------------------------------------------- */
double PairComb::comb_fc3(double r)
{
double comb_R = 2.51350;
double comb_D = comb_R + 0.050;
if (r < comb_R) return 1.0;
if (r > comb_D) return 0.0;
return 0.5*(1.0 + cos(MY_PI*(r - comb_R)/(comb_D-comb_R)));
}
/* ---------------------------------------------------------------------- */
double PairComb::comb_fc3_d(double r)
{
double comb_R = 2.51350;
double comb_D = comb_R + 0.050;
if (r < comb_R) return 0.0;
if (r > comb_D) return 0.0;
return -(MY_PI2/(comb_D-comb_R)) * sin(MY_PI*(r - comb_R)/(comb_D-comb_R));
}
/* ---------------------------------------------------------------------- */
double PairComb::self(Param *param, double qi, double selfpot)
{
double self_tmp, cmin, cmax, qmin, qmax;
double s1=param->chi, s2=param->dj, s3=param->dk, s4=param->dl, s5=param->dm;
self_tmp = 0.0;
qmin = param->QL1*0.90;
qmax = param->QU1*0.90;
cmin = cmax = 1000.0;
self_tmp = qi*(s1+qi*(s2+selfpot+qi*(s3+qi*(s4+qi*qi*s5))));
if (qi < qmin) self_tmp += cmin * pow((qi-qmin),4.0);
if (qi > qmax) self_tmp += cmax * pow((qi-qmax),4.0);
return self_tmp;
}
/* ---------------------------------------------------------------------- */
double PairComb::comb_fa(double r, Param *param, double iq, double jq)
{
double bigB,Bsi,Bsj;
double qi,qj,Di,Dj;
if (r > param->bigr + param->bigd) return 0.0;
qi = iq; qj = jq;
Di = Dj = Bsi = Bsj = bigB = 0.0;
Di = param->DU1 + pow(fabs(param->bD1*(param->QU1-qi)),param->nD1);
Dj = param->DU2 + pow(fabs(param->bD2*(param->QU2-qj)),param->nD2);
Bsi = param->bigb1 * exp(param->lam21*Di)*
(param->aB1-fabs(pow(param->bB1*(qi-param->Qo1),10.0)));
Bsj = param->bigb2 * exp(param->lam22*Dj)*
(param->aB2-fabs(pow(param->bB2*(qj-param->Qo2),10.0)));
if (Bsi > 0.0 && Bsj > 0.0) bigB = sqrt(Bsi*Bsj)*param->romigb;
else bigB = 0.0;
return -bigB * exp(-param->rlm2 * r) * comb_fc(r,param);
}
/* ---------------------------------------------------------------------- */
double PairComb::comb_fa_d(double r, Param *param, double iq, double jq)
{
double bigB,Bsi,Bsj;
double qi,qj,Di,Dj;
if (r > param->bigr + param->bigd) return 0.0;
qi = iq; qj = jq;
Di = Dj = Bsi = Bsj = bigB = 0.0;
Di = param->DU1 + pow(fabs(param->bD1*(param->QU1-qi)),param->nD1);
Dj = param->DU2 + pow(fabs(param->bD2*(param->QU2-qj)),param->nD2);
Bsi = param->bigb1 * exp(param->lam21*Di)*
(param->aB1-fabs(pow(param->bB1*(qi-param->Qo1),10.0)));
Bsj = param->bigb2 * exp(param->lam22*Dj)*
(param->aB2-fabs(pow(param->bB2*(qj-param->Qo2),10.0)));
if (Bsi > 0.0 && Bsj > 0.0) bigB = sqrt(Bsi*Bsj)*param->romigb;
else bigB = 0.0;
return bigB * exp(-param->rlm2 * r) *
(param->rlm2 * comb_fc(r,param) - comb_fc_d(r,param));
}
/* ---------------------------------------------------------------------- */
double PairComb::comb_bij(double zeta, Param *param)
{
double tmp = param->beta * zeta;
if (tmp > param->c1) return 1.0/sqrt(tmp);
if (tmp > param->c2)
return (1.0 - pow(tmp,-1.0*param->powern) / (2.0*param->powern))/sqrt(tmp);
if (tmp < param->c4) return 1.0;
if (tmp < param->c3)
return 1.0 - pow(tmp,param->powern)/(2.0*param->powern);
return pow(1.0 + pow(tmp,param->powern), -1.0/(2.0*param->powern));
}
/* ---------------------------------------------------------------------- */
double PairComb::comb_bij_d(double zeta, Param *param)
{
double tmp = param->beta * zeta;
if (tmp > param->c1) return param->beta * -0.5*pow(tmp,-1.5);
if (tmp > param->c2)
return param->beta * (-0.5*pow(tmp,-1.5) *
// error in negligible 2nd term fixed 9/30/2015
// (1.0 - 0.5*(1.0 + 1.0/(2.0*param->powern)) *
(1.0 - (1.0 + 1.0/(2.0*param->powern)) *
pow(tmp,-param->powern)));
if (tmp < param->c4) return 0.0;
if (tmp < param->c3)
return -0.5*param->beta * pow(tmp,param->powern-1.0);
double tmp_n = pow(tmp,param->powern);
return -0.5 * pow(1.0+tmp_n, -1.0-(1.0/(2.0*param->powern)))*tmp_n / zeta;
}
/* ---------------------------------------------------------------------- */
void PairComb::attractive(Param *param, double prefactor,
double rsqij, double rsqik,
double *delrij, double *delrik,
double *fi, double *fj, double *fk)
{
double rij_hat[3],rik_hat[3];
double rij,rijinv,rik,rikinv;
rij = sqrt(rsqij);
rijinv = 1.0/rij;
vec3_scale(rijinv,delrij,rij_hat);
rik = sqrt(rsqik);
rikinv = 1.0/rik;
vec3_scale(rikinv,delrik,rik_hat);
comb_zetaterm_d(prefactor,rij_hat,rij,rik_hat,rik,fi,fj,fk,param);
}
/* ---------------------------------------------------------------------- */
void PairComb::comb_zetaterm_d(double prefactor, double *rij_hat, double rij,
double *rik_hat, double rik, double *dri,
double *drj, double *drk, Param *param)
{
double gijk,gijk_d,ex_delr,ex_delr_d,fc,dfc,cos_theta,tmp;
double dcosdri[3],dcosdrj[3],dcosdrk[3];
fc = comb_fc(rik,param);
dfc = comb_fc_d(rik,param);
if (param->powermint == 3) tmp = pow(param->rlm2 * (rij-rik),3.0);
else tmp = param->rlm2 * (rij-rik);
if (tmp > 69.0776) ex_delr = 1.e30;
else if (tmp < -69.0776) ex_delr = 0.0;
else ex_delr = exp(tmp); // ex_delr is Ygexp
if (param->powermint == 3)
ex_delr_d = 3.0*pow(param->rlm2,3.0) * pow(rij-rik,2.0)*ex_delr; // com3
else ex_delr_d = param->rlm2 * ex_delr; // com3
cos_theta = vec3_dot(rij_hat,rik_hat);
gijk = comb_gijk(cos_theta,param);
gijk_d = comb_gijk_d(cos_theta,param);
costheta_d(rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk);
// compute the derivative wrt Ri
// dri = -dfc*gijk*ex_delr*rik_hat;
// dri += fc*gijk_d*ex_delr*dcosdri;
// dri += fc*gijk*ex_delr_d*(rik_hat - rij_hat);
// (k,x[],y[]), y[]=k*x[]
// (k,x[],y[],z[]), z[]=k*x[]+y[]
vec3_scale(-dfc*gijk*ex_delr,rik_hat,dri);
vec3_scaleadd(fc*gijk_d*ex_delr,dcosdri,dri,dri);
vec3_scaleadd(fc*gijk*ex_delr_d,rik_hat,dri,dri);
vec3_scaleadd(-fc*gijk*ex_delr_d,rij_hat,dri,dri);
vec3_scale(prefactor,dri,dri);
// compute the derivative wrt Rj
// drj = fc*gijk_d*ex_delr*dcosdrj;
// drj += fc*gijk*ex_delr_d*rij_hat;
vec3_scale(fc*gijk_d*ex_delr,dcosdrj,drj);
vec3_scaleadd(fc*gijk*ex_delr_d,rij_hat,drj,drj);
vec3_scale(prefactor,drj,drj);
// compute the derivative wrt Rk
// drk = dfc*gijk*ex_delr*rik_hat;
// drk += fc*gijk_d*ex_delr*dcosdrk;
// drk += -fc*gijk*ex_delr_d*rik_hat;
vec3_scale(dfc*gijk*ex_delr,rik_hat,drk);
vec3_scaleadd(fc*gijk_d*ex_delr,dcosdrk,drk,drk);
vec3_scaleadd(-fc*gijk*ex_delr_d,rik_hat,drk,drk);
vec3_scale(prefactor,drk,drk);
}
/* ---------------------------------------------------------------------- */
void PairComb::costheta_d(double *rij_hat, double rij,
double *rik_hat, double rik,
double *dri, double *drj, double *drk)
{
// first element is devative wrt Ri, second wrt Rj, third wrt Rk
double cos_theta = vec3_dot(rij_hat,rik_hat);
vec3_scaleadd(-cos_theta,rij_hat,rik_hat,drj);
vec3_scale(1.0/rij,drj,drj);
vec3_scaleadd(-cos_theta,rik_hat,rij_hat,drk);
vec3_scale(1.0/rik,drk,drk);
vec3_add(drj,drk,dri);
vec3_scale(-1.0,dri,dri);
}
/* ---------------------------------------------------------------------- */
void PairComb::sm_table()
{
int i,j,k,m,nntypes,ncoul;
int inty, itype, jtype;
int iparam_i, iparam_ij, iparam_ji;
double r,dra,drin,rc,z,zr,zrc,ea,eb,ea3,eb3,alf;
double exp2er,exp2ersh,fafash,dfafash,F1,dF1,ddF1,E1,E2,E3,E4;
double exp2ear,exp2ebr,exp2earsh,exp2ebrsh,fafbsh,dfafbsh;
int n = atom->ntypes;
int nmax = atom->nmax;
dra = 0.001; // lookup table step size
drin = 0.1; // starting distance of 1/r
rc = cutmax;
alf = 0.20;
nntypes = int((n+1)*n/2); // interaction types
ncoul = int((rc-drin)/dra)+1;
// allocate arrays
memory->create(intype,n,n,"pair:intype");
memory->create(fafb,ncoul,nntypes,"pair:fafb");
memory->create(dfafb,ncoul,nntypes,"pair:dfafb");
memory->create(ddfafb,ncoul,nntypes,"pair:ddfafb");
memory->create(phin,ncoul,nntypes,"pair:phin");
memory->create(dphin,ncoul,nntypes,"pair:dphin");
memory->create(erpaw,25000,2,"pair:erpaw");
memory->create(NCo,nmax,"pair:NCo");
memory->create(bbij,nmax,MAXNEIGH,"pair:bbij");
memory->create(sht_num,nmax,"pair:sht_num");
sht_first = (int **) memory->smalloc(nmax*sizeof(int *),"pair:sht_first");
// set interaction number: 0-0=0, 1-1=1, 0-1=1-0=2
m = 0; k = n;
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
if (j == i) {
intype[i][j] = m;
m += 1;
} else if (j != i && j > i) {
intype[i][j] = k;
k += 1;
} else if (j != i && j < i) {
intype[i][j] = intype[j][i];
}
}
}
// default arrays to zero
for (i = 0; i < ncoul; i ++) {
for (j = 0; j < nntypes; j ++) {
fafb[i][j] = 0.0;
dfafb[i][j] = 0.0;
ddfafb[i][j] = 0.0;
phin[i][j] = 0.0;
dphin[i][j] = 0.0;
}
}
// direct 1/r energy with Slater 1S orbital overlap
for (i = 0; i < n; i++) {
if (map[i+1] < 0) continue;
r = drin;
itype = params[map[i+1]].ielement;
iparam_i = elem2param[itype][itype][itype];
z = params[iparam_i].esm1;
if (comm->me == 0 && screen)
fprintf(screen," element[%d] = %-2s, z = %g\n",i+1,elements[map[i+1]],z);
for (j = 0; j < ncoul; j++) {
exp2er = exp(-2.0 * z * r);
phin[j][i] = 1.0 - exp2er * (1.0 + 2.0 * z * r * (1.0 + z * r));
dphin[j][i] = (4.0 * exp2er * z * z * z * r * r);
r += dra;
}
}
for (i = 0; i < n; i ++) {
if (map[i+1] < 0) continue;
for (j = 0; j < n; j ++) {
if (map[j+1] < 0) continue;
r = drin;
if (j == i) {
itype = params[map[i+1]].ielement;
inty = intype[itype][itype];
iparam_i = elem2param[itype][itype][itype];
z = params[iparam_i].esm1;
zrc = z * rc;
exp2ersh = exp(-2.0 * zrc);
fafash = -exp2ersh * (1.0 / rc +
z * (11.0/8.0 + 3.0/4.0*zrc + zrc*zrc/6.0));
dfafash = exp2ersh * (1.0/(rc*rc) + 2.0*z/rc +
z*z*(2.0 + 7.0/6.0*zrc + zrc*zrc/3.0));
for (k = 0; k < ncoul; k ++) {
zr = z * r;
exp2er = exp(-2.0*zr);
F1 = -exp2er * (1.0 / r +
z * (11.0/8.0 + 3.0/4.0*zr + zr*zr/6.0));
dF1 = exp2er * (1.0/(r*r) + 2.0*z/r +
z*z*(2.0 + 7.0/6.0*zr + zr*zr/3.0));
ddF1 = -exp2er * (2.0/(r*r*r) + 4.0*z/(r*r) -
z*z*z/3.0*(17.0/2.0 + 5.0*zr + 2.0*zr*zr));
fafb[k][inty] = F1-fafash-(r-rc)*dfafash;
dfafb[k][inty] = (dF1 - dfafash);
ddfafb[k][inty] = ddF1;
r += dra;
}
} else if (j != i) {
itype = params[map[i+1]].ielement;
jtype = params[map[j+1]].ielement;
inty = intype[itype][jtype];
iparam_ij = elem2param[itype][jtype][jtype];
ea = params[iparam_ij].esm1;
ea3 = ea*ea*ea;
iparam_ji = elem2param[jtype][itype][itype];
eb = params[iparam_ji].esm1;
eb3 = eb*eb*eb;
E1 = ea*eb3*eb/((ea+eb)*(ea+eb)*(ea-eb)*(ea-eb));
E2 = eb*ea3*ea/((ea+eb)*(ea+eb)*(eb-ea)*(eb-ea));
E3 = (3.0*ea*ea*eb3*eb-eb3*eb3) /
((ea+eb)*(ea+eb)*(ea+eb)*(ea-eb)*(ea-eb)*(ea-eb));
E4 = (3.0*eb*eb*ea3*ea-ea3*ea3) /
((ea+eb)*(ea+eb)*(ea+eb)*(eb-ea)*(eb-ea)*(eb-ea));
exp2earsh = exp(-2.0*ea*rc);
exp2ebrsh = exp(-2.0*eb*rc);
fafbsh = -exp2earsh*(E1 + E3/rc)-exp2ebrsh*(E2 + E4/rc);
dfafbsh =
exp2earsh*(2.0*ea*(E1+E3/rc)+E3/(rc*rc)) +
exp2ebrsh*(2.0*eb*(E2+E4/rc)+E4/(rc*rc));
for (k = 0; k < ncoul; k ++) {
exp2ear = exp(-2.0*ea*r);
exp2ebr = exp(-2.0*eb*r);
fafb[k][inty] =
- exp2ear*(E1+E3/r) - exp2ebr*(E2+E4/r)
- fafbsh - (r-rc) * dfafbsh;
dfafb[k][inty] = (exp2ear*(2.0*ea*(E1+E3/r) + E3/(r*r))
+ exp2ebr*(2.0*eb*(E2+E4/r) + E4/(r*r))- dfafbsh);
ddfafb[k][inty] = (- exp2ear*(E3/(r*r)*(1.0/r+2.0*ea/r+2.0/(r*r))
+ 2.0*ea*(E1+E3/r))-
exp2ebr*(E4/(r*r)
*(1.0/r+2.0*eb/r+2.0/(r*r)) +
2.0*eb*(E2+E4/r)));
r += dra;
}
}
}
}
for (i = 0; i < 25000; i ++) {
r = dra * i + drin;
erpaw[i][0] = erfc(r*alf);
erpaw[i][1] = exp(-r*r*alf*alf);
}
}
/* ---------------------------------------------------------------------- */
void PairComb::potal_calc(double &calc1, double &calc2, double &calc3)
{
double alf,rcoul,esucon;
int m;
rcoul = 0.0;
for (m = 0; m < nparams; m++)
if (params[m].lcut > rcoul) rcoul = params[m].lcut;
alf = 0.20;
esucon = force->qqr2e;
calc2 = (erfc(rcoul*alf)/rcoul/rcoul+2.0*alf/MY_PIS*
exp(-alf*alf*rcoul*rcoul)/rcoul)*esucon/rcoul;
calc3 = (erfc(rcoul*alf)/rcoul)*esucon;
calc1 = -(alf/MY_PIS*esucon+calc3*0.5);
}
/* ---------------------------------------------------------------------- */
void PairComb::tri_point(double rsq, int &mr1, int &mr2,
int &mr3, double &sr1, double &sr2,
double &sr3, int &itype)
{
double r, rin, dr, dd, rr1, rridr, rridr2;
rin = 0.10; dr = 0.0010;
r = sqrt(rsq);
if (r < rin + 2.0*dr) r = rin + 2.0*dr;
if (r > cutmax - 2.0*dr) r = cutmax - 2.0*dr;
rridr = (r-rin)/dr;
mr1 = int(rridr)-1;
dd = rridr - float(mr1);
if (dd > 0.5) mr1 += 1;
mr2 = mr1 + 1;
mr3 = mr2 + 1;
rr1 = float(mr1)*dr;
rridr = (r - rin - rr1)/dr;
rridr2 = rridr * rridr;
sr1 = (rridr2 - rridr) * 0.50;
sr2 = 1.0 - rridr2;
sr3 = (rridr2 + rridr) * 0.50;
}
/* ---------------------------------------------------------------------- */
void PairComb::direct(int inty, int mr1, int mr2, int mr3, double rsq,
double sr1, double sr2, double sr3,
double iq, double jq,
double potal, double fac11, double fac11e,
double &pot_tmp, double &pot_d)
{
double r,erfcc,fafbn1,potij,sme2,esucon;
double r3,erfcd,dfafbn1,smf2,dvdrr,alf,alfdpi;
r = sqrt(rsq);
r3 = r * rsq;
alf = 0.20;
alfdpi = 2.0*alf/MY_PIS;
esucon = force->qqr2e;
pot_tmp = 0.0;
pot_d = 0.0;
// 1/r energy
erfcc = sr1*erpaw[mr1][0] + sr2*erpaw[mr2][0] + sr3*erpaw[mr3][0];
fafbn1= sr1*fafb[mr1][inty] + sr2*fafb[mr2][inty] + sr3*fafb[mr3][inty];
potij = (erfcc/r * esucon - fac11e);
sme2 = potij + fafbn1 * esucon;
pot_tmp = 1.0 * iq * jq *sme2;
// 1/r force (wrt r)
erfcd = sr1*erpaw[mr1][1] + sr2*erpaw[mr2][1] + sr3*erpaw[mr3][1];
dfafbn1= sr1*dfafb[mr1][inty] + sr2*dfafb[mr2][inty] + sr3*dfafb[mr3][inty];
dvdrr = (erfcc/r3+alfdpi*erfcd/rsq)*esucon-fac11;
smf2 = dvdrr - dfafbn1 * esucon/r;
pot_d = 1.0 * iq * jq * smf2;
}
/* ---------------------------------------------------------------------- */
void PairComb::field(Param *param, double rsq, double iq,double jq,
double &vionij,double &fvionij)
{
double r,r5,r6,rc,rc5,rc6,rf5,drf6,smpn,smpl,rfx1,rfx2;
double cmi1,cmi2,cmj1,cmj2;
r = sqrt(rsq);
r5 = r*r*r*r*r;
r6 = r5 * r;
rc = param->lcut;
rc5 = rc*rc*rc*rc*rc;
rc6 = rc5 * rc;
cmi1 = param->cmn1;
cmi2 = param->cmn2;
cmj1 = param->cml1;
cmj2 = param->cml2;
rf5 = 1.0/r5 - 1.0/rc5 + 5.0*(r-rc)/rc6;
drf6 = 5.0/rc6 - 5.0/r6;
// field correction energy
smpn = rf5*jq*(cmi1+jq*cmi2);
smpl = rf5*iq*(cmj1+iq*cmj2);
vionij += 1.0 * (smpn + smpl);
// field correction force
rfx1 = jq*drf6*(cmi1+jq*cmi2)/r;
rfx2 = iq*drf6*(cmj1+iq*cmj2)/r;
fvionij -= 1.0 * (rfx1 + rfx2);
}
/* ---------------------------------------------------------------------- */
double PairComb::yasu_char(double *qf_fix, int &igroup)
{
int i,j,ii,jj,jnum;
int itype,jtype,iparam_i,iparam_ij;
tagint itag,jtag;
double xtmp,ytmp,ztmp;
double rsq1,delr1[3];
int *ilist,*jlist,*numneigh,**firstneigh;
double iq,jq,fqi,fqij,fqjj;
double potal,fac11,fac11e,sr1,sr2,sr3;
int mr1,mr2,mr3,inty,nj;
double **x = atom->x;
double *q = atom->q;
int *type = atom->type;
tagint *tag = atom->tag;
int inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
int *mask = atom->mask;
int groupbit = group->bitmask[igroup];
qf = qf_fix;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
if (mask[i] & groupbit)
qf[i] = 0.0;
}
// communicating charge force to all nodes, first forward then reverse
comm->forward_comm_pair(this);
// self energy correction term: potal
potal_calc(potal,fac11,fac11e);
// loop over full neighbor list of my atoms
fqi = fqij = fqjj = 0.0;
for (ii = 0; ii < inum; ii ++) {
i = ilist[ii];
itag = tag[i];
nj = 0;
if (mask[i] & groupbit) {
itype = map[type[i]];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
iq = q[i];
iparam_i = elem2param[itype][itype][itype];
// charge force from self energy
fqi = qfo_self(&params[iparam_i],iq,potal);
// two-body interactions
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
jtag = tag[j];
if (itag > jtag) {
if ((itag+jtag) % 2 == 0) continue;
} else if (itag < jtag) {
if ((itag+jtag) % 2 == 1) continue;
} else {
if (x[j][2] < x[i][2]) continue;
if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
}
jtype = map[type[j]];
jq = q[j];
delr1[0] = x[j][0] - xtmp;
delr1[1] = x[j][1] - ytmp;
delr1[2] = x[j][2] - ztmp;
rsq1 = vec3_dot(delr1,delr1);
iparam_ij = elem2param[itype][jtype][jtype];
// long range q-dependent
if (rsq1 > params[iparam_ij].lcutsq) continue;
inty = intype[itype][jtype];
// polynomial three-point interpolation
tri_point(rsq1,mr1,mr2,mr3,sr1,sr2,sr3,itype);
// 1/r charge forces
qfo_direct(inty,mr1,mr2,mr3,rsq1,sr1,sr2,sr3,fac11e,fqij);
fqi += jq * fqij; qf[j] += iq * fqij;
// field correction to self energy and charge force
qfo_field(&params[iparam_ij],rsq1,iq,jq,fqij,fqjj);
fqi += fqij;
qf[j] += fqjj;
}
// three-body interactions
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
jtype = map[type[j]];
jq = q[j];
delr1[0] = x[j][0] - xtmp;
delr1[1] = x[j][1] - ytmp;
delr1[2] = x[j][2] - ztmp;
rsq1 = vec3_dot(delr1,delr1);
iparam_ij = elem2param[itype][jtype][jtype];
if (rsq1 > params[iparam_ij].cutsq) continue;
nj ++;
// charge force in Aij and Bij
qfo_short(&params[iparam_ij],i,nj,rsq1,iq,jq,fqij,fqjj);
fqi += fqij; qf[j] += fqjj;
}
qf[i] += fqi;
}
}
comm->reverse_comm_pair(this);
// sum charge force on each node and return it
double eneg = 0.0;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
if (mask[i] & groupbit)
eneg += qf[i];
}
- double enegtot;
MPI_Allreduce(&eneg,&enegtot,1,MPI_DOUBLE,MPI_SUM,world);
return enegtot;
}
/* ---------------------------------------------------------------------- */
double PairComb::qfo_self(Param *param, double qi, double selfpot)
{
double self_d,cmin,cmax,qmin,qmax;
double s1 = param->chi;
double s2 = param->dj;
double s3 = param->dk;
double s4 = param->dl;
double s5 = param->dm;
self_d = 0.0;
qmin = param->QL1*0.90;
qmax = param->QU1*0.90;
cmin = cmax = 1000.0;
self_d = s1+qi*(2.0*(s2+selfpot)+qi*(3.0*s3+qi*(4.0*s4+qi*qi*6.0*s5)));
if (qi < qmin) {
// char str[128];
// sprintf(str,"Pair COMB charge %.10f with force %.10f hit min barrier",
// qi,self_d);
// error->warning(FLERR,str,0);
self_d += 4.0 * cmin * pow((qi-qmin),3.0);
}
if (qi > qmax) {
// char str[128];
// sprintf(str,"Pair COMB charge %.10f with force %.10f hit max barrier",
// qi,self_d);
// error->warning(FLERR,str,0);
self_d += 4.0 * cmax * pow((qi-qmax),3.0);
}
return self_d;
}
/* ---------------------------------------------------------------------- */
void PairComb::qfo_direct(int inty, int mr1, int mr2, int mr3,
double rsq, double sr1, double sr2,
double sr3, double fac11e, double &fqij)
{
double r, erfcc, fafbn1, vm, esucon;
r = sqrt(rsq);
esucon=force->qqr2e;
// 1/r force (wrt q)
erfcc = sr1*erpaw[mr1][0] + sr2*erpaw[mr2][0] + sr3*erpaw[mr3][0];
fafbn1= sr1*fafb[mr1][inty] + sr2*fafb[mr2][inty] + sr3*fafb[mr3][inty];
vm = (erfcc/r * esucon - fac11e);
fqij = 1.0 * (vm+esucon*fafbn1);
}
/* ---------------------------------------------------------------------- */
void PairComb::qfo_field(Param *param, double rsq,double iq,double jq,
double &fqij, double &fqjj)
{
double r,r5,rc,rc5,rc6;
double cmi1,cmi2,cmj1,cmj2,rf5;
fqij = fqjj = 0.0;
r = sqrt(rsq);
r5 = r*r*r*r*r;
rc = param->lcut;
rc5 = rc*rc*rc*rc*rc;
rc6 = rc5 * rc;
cmi1 = param->cmn1;
cmi2 = param->cmn2;
cmj1 = param->cml1;
cmj2 = param->cml2;
rf5 = 1.0/r5 - 1.0/rc5 + 5.0*(r-rc)/rc6;
// field correction charge force
fqij = 1.0 * rf5 * (cmj1 + 2.0 * iq * cmj2);
fqjj = 1.0 * rf5 * (cmi1 + 2.0 * jq * cmi2);
}
/* ---------------------------------------------------------------------- */
void PairComb::qfo_short(Param *param, int i, int j, double rsq,
double iq, double jq, double &fqij, double &fqjj)
{
double r,tmp_fc,tmp_exp1,tmp_exp2;
double Asi,Asj,vrcs;
double romi = param->addrep,rrcs = param->bigr + param->bigd;
double qi,qj,Di,Dj,Bsi,Bsj;
double QUchi,QOchi,QUchj,QOchj,YYDiqp,YYDjqp;
double YYAsiqp,YYAsjqp,YYBsiqp,YYBsjqp;
double caj,cbj,bij,cfqr,cfqs;
double romie = param->romiga;
double romib = param->romigb;
double ca1,ca2,ca3,ca4;
double rslp,rslp2,rslp4,arr1,arr2,fc2j,fc3j;
qi = iq; qj = jq; r = sqrt(rsq);
Di = Dj = Asi = Asj = Bsi = Bsj = 0.0;
QUchi = QOchi = QUchj = QOchj = YYDiqp = YYDjqp =0.0;
YYAsiqp = YYAsjqp = YYBsiqp = YYBsjqp = 0.0;
caj = cbj = vrcs = cfqr = cfqs = 0.0;
tmp_fc = comb_fc(r,param);
tmp_exp1 = exp(-param->rlm1 * r);
tmp_exp2 = exp(-param->rlm2 * r);
bij = bbij[i][j]; //comb_bij(zeta_ij,param);
arr1 = 2.22850; arr2 = 1.89350;
fc2j = comb_fc2(r);
fc3j = comb_fc3(r);
vrcs = 0.0;
if (romi > 0.0) {
if (!cor_flag) vrcs = romi * pow((1.0-r/rrcs),2.0);
else if (cor_flag) {
rslp = ((arr1-r)/(arr1-arr2));
rslp2 = rslp * rslp; rslp4 = rslp2 * rslp2;
vrcs = fc2j * fc3j * romi * ((50.0*rslp4-30.0*rslp2+4.50))/8.0;
}
}
Di = param->DU1 + pow(fabs(param->bD1*(param->QU1-qi)),param->nD1);
Dj = param->DU2 + pow(fabs(param->bD2*(param->QU2-qj)),param->nD2);
Asi = param->biga1 * exp(param->lam11*Di);
Asj = param->biga2 * exp(param->lam12*Dj);
Bsi = param->bigb1 * exp(param->lam21*Di)*
(param->aB1-fabs(pow(param->bB1*(qi-param->Qo1),10.0)));
Bsj = param->bigb2 * exp(param->lam22*Dj)*
(param->aB2-fabs(pow(param->bB2*(qj-param->Qo2),10.0)));
QUchi = (param->QU1-qi)*param->bD1;
QUchj = (param->QU2-qj)*param->bD2;
QOchi = (qi-param->Qo1)*param->bB1;
QOchj = (qj-param->Qo2)*param->bB2;
if (QUchi == 0.0) YYDiqp = 0.0;
else YYDiqp = -param->nD1 * QUchi * param->bD1 *
pow(fabs(QUchi),(param->nD1-2.0));
if (QUchj == 0.0) YYDjqp = 0.0;
else YYDjqp = -param->nD2 * QUchj * param->bD2 *
pow(fabs(QUchj),(param->nD2-2.0));
YYAsiqp = Asi * param->lam11 * YYDiqp;
YYAsjqp = Asj * param->lam12 * YYDjqp;
if (QOchi == 0.0)
YYBsiqp=Bsi*param->lam21*YYDiqp;
else
YYBsiqp=Bsi*param->lam21*YYDiqp-param->bigb1*exp(param->lam21*Di)*
10.0*QOchi*param->bB1*pow(fabs(QOchi),(10.0-2.0));
if (QOchj == 0.0)
YYBsjqp=Bsj*param->lam22*YYDjqp;
else
YYBsjqp=Bsj*param->lam22*YYDjqp-param->bigb2*exp(param->lam22*Dj)*
10.0*QOchj*param->bB2*pow(fabs(QOchj),(10.0-2.0));
if (Asi > 0.0 && Asj > 0.0) caj = 1.0/(2.0*sqrt(Asi*Asj)) * romie;
else caj = 0.0;
if (Bsi > 0.0 && Bsj > 0.0) cbj = 1.0/(2.0*sqrt(Bsi*Bsj)) * romib ;
else cbj = 0.0;
cfqr = 0.50 * tmp_fc * (1.0 + vrcs); // 0.5 b/c full atom loop
cfqs = -0.50 * tmp_fc * bij;
ca1 = Asj * caj * YYAsiqp;
ca2 = Bsj * cbj * YYBsiqp;
ca3 = Asi * caj * YYAsjqp;
ca4 = Bsi * cbj * YYBsjqp;
fqij = cfqr * tmp_exp1 * ca1;
fqij += cfqs * tmp_exp2 * ca2;
fqjj = cfqr * tmp_exp1 * ca3;
fqjj += cfqs * tmp_exp2 * ca4;
}
/* ---------------------------------------------------------------------- */
void PairComb::Over_cor(Param *param, double rsq1, int NCoi,
double &Eov, double &Fov)
{
double ECo,BCo,tmp_fc,tmp_fc_d;
double r = sqrt(rsq1);
int NCon = NCoi - 7;
tmp_fc = comb_fc(r,param);
tmp_fc_d = comb_fc(r,param);
Eov = 0.0; Fov = 0.0;
ECo = param->hfocor;
BCo = 0.1;
if (NCon >= 0.20) {
Eov = tmp_fc * ECo * NCon/(1.0+exp(BCo*NCon));
Fov = -(tmp_fc_d*Eov + tmp_fc*ECo/(1.0+exp(BCo*NCon)) -
(tmp_fc*ECo*NCon*BCo*exp(BCo*NCon)) /
((1.0+exp(BCo*NCon))*(1.0+exp(BCo*NCon))));
Fov /= r;
}
}
/* ---------------------------------------------------------------------- */
int PairComb::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i ++) {
j = list[i];
buf[m++] = qf[j];
}
return m;
}
/* ---------------------------------------------------------------------- */
void PairComb::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n ;
for (i = first; i < last; i++) qf[i] = buf[m++];
}
/* ---------------------------------------------------------------------- */
int PairComb::pack_reverse_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) buf[m++] = qf[i];
return m;
}
/* ---------------------------------------------------------------------- */
void PairComb::unpack_reverse_comm(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
qf[j] += buf[m++];
}
}
/* ---------------------------------------------------------------------- */
void PairComb::Short_neigh()
{
int nj;
int inum,jnum,i,j,ii,jj;
int *neighptrj,*ilist,*jlist,*numneigh;
int **firstneigh;
double xtmp,ytmp,ztmp,rsq,delrj[3];
double **x = atom->x;
if (atom->nmax > nmax) {
memory->sfree(sht_first);
nmax = atom->nmax;
sht_first = (int **) memory->smalloc(nmax*sizeof(int *),
"pair:sht_first");
memory->grow(sht_num,nmax,"pair:sht_num");
memory->grow(NCo,nmax,"pair:NCo");
memory->grow(bbij,nmax,MAXNEIGH,"pair:bbij");
}
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
// create Comb neighbor list
ipage->reset();
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
nj = 0;
neighptrj = ipage->vget();
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
delrj[0] = xtmp - x[j][0];
delrj[1] = ytmp - x[j][1];
delrj[2] = ztmp - x[j][2];
rsq = vec3_dot(delrj,delrj);
if (rsq > cutmin) continue;
neighptrj[nj++] = j;
}
sht_first[i] = neighptrj;
sht_num[i] = nj;
ipage->vgot(nj);
if (ipage->status())
error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
}
}
/* ----------------------------------------------------------------------
memory usage of local atom-based arrays
------------------------------------------------------------------------- */
double PairComb::memory_usage()
{
double bytes = maxeatom * sizeof(double);
bytes += maxvatom*6 * sizeof(double);
bytes += nmax * sizeof(int);
bytes += nmax * sizeof(int *);
for (int i = 0; i < comm->nthreads; i++)
bytes += ipage[i].size();
bytes += nmax * sizeof(int);
bytes += MAXNEIGH*nmax * sizeof(double);
return bytes;
}
diff --git a/src/MANYBODY/pair_comb.h b/src/MANYBODY/pair_comb.h
index 2732f5bc8..4d8251bd0 100644
--- a/src/MANYBODY/pair_comb.h
+++ b/src/MANYBODY/pair_comb.h
@@ -1,252 +1,253 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(comb,PairComb)
#else
#ifndef LMP_PAIR_COMB_H
#define LMP_PAIR_COMB_H
#include "pair.h"
#include "my_page.h"
namespace LAMMPS_NS {
class PairComb : public Pair {
public:
PairComb(class LAMMPS *);
virtual ~PairComb();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
double memory_usage();
virtual double yasu_char(double *, int &);
+ double enegtot;
protected:
struct Param {
double lam11,lam12,lam21,lam22;
double c,d,h;
double gamma,powerm;
double powern,beta;
double biga1,biga2,bigb1,bigb2;
double bigd,bigr;
double cut,cutsq;
double c1,c2,c3,c4;
double plp1,plp3,plp6,a123,aconf;
double rlm1,rlm2;
double romiga,romigb,romigc,romigd,addrep;
double QU1,QL1,DU1,DL1,Qo1,dQ1,aB1,bB1,nD1,bD1;
double QU2,QL2,DU2,DL2,Qo2,dQ2,aB2,bB2,nD2,bD2;
double chi,dj,dk,dl,dm,esm1,esm2,cmn1,cmn2,cml1,cml2;
double coulcut, lcut, lcutsq, hfocor;
int ielement,jelement,kelement;
int powermint;
};
double cutmax; // max cutoff for all elements
int nelements; // # of unique elements
char **elements; // names of unique elements
int ***elem2param; // mapping from element triplets to parameters
int *map; // mapping from atom types to elements
int nparams; // # of stored parameter sets
int maxparam; // max # of parameter sets
double precision;
Param *params; // parameter set for an I-J-K interaction
int nmax;
double *qf;
double *esm, **fafb, **dfafb, **ddfafb, **phin, **dphin, **erpaw;
double *charge;
int **intype, *typeno;
int *NCo, cor_flag, cuo_flag, cuo_flag1, cuo_flag2;
double **bbij;
int pgsize; // size of neighbor page
int oneatom; // max # of neighbors for one atom
int *sht_num,**sht_first; // short-range neighbor list
MyPage<int> *ipage; // neighbor list pages
double cutmin;
void allocate();
virtual void read_file(char *);
void setup();
virtual void repulsive(Param *, double, double &, int,
double &, double, double);
double zeta(Param *, double, double, double *, double *);
void force_zeta(Param *, int, int, int, double, double, double, double,
double &, double &, double &);
void attractive(Param *, double, double, double, double *, double *,
double *, double *, double *);
double elp(Param *, double, double, double *, double *);
void flp(Param *, double, double, double *, double *, double *,
double *, double *);
double comb_fc(double, Param *);
double comb_fc_d(double, Param *);
double comb_fc2(double);
double comb_fc2_d(double);
double comb_fc3(double);
double comb_fc3_d(double);
virtual double comb_fa(double, Param *, double,double);
virtual double comb_fa_d(double, Param *, double,double);
double comb_bij(double, Param *);
double comb_bij_d(double, Param *);
inline double comb_gijk(const double costheta,
const Param * const param) const {
const double comb_c = param->c * param->c;
const double comb_d = param->d * param->d;
const double hcth = param->h - costheta;
return param->gamma*(1.0 + comb_c/comb_d - comb_c / (comb_d + hcth*hcth));
}
inline double comb_gijk_d(const double costheta,
const Param * const param) const {
const double comb_c = param->c * param->c;
const double comb_d = param->d * param->d;
const double hcth = param->h - costheta;
const double numerator = -2.0 * comb_c * hcth;
const double denominator = 1.0/(comb_d + hcth*hcth);
return param->gamma*numerator*denominator*denominator;
}
void comb_zetaterm_d(double, double *, double, double *, double,
double *, double *, double *, Param *);
void costheta_d(double *, double, double *, double,
double *, double *, double *);
double self(Param *, double, double);
void sm_table();
void potal_calc(double &, double &, double &);
void tri_point(double, int &, int &, int &, double &, double &,
double &, int &);
void direct(int,int,int,int,double,double,double,double,double,double,
double,double,double,double &,double &);
void field(Param *,double,double,double,double &,double &);
double qfo_self(Param *, double, double);
void qfo_short(Param *, int, int, double, double, double,
double &, double &);
void qfo_direct (int, int, int, int, double, double, double, double,
double, double &);
void qfo_field(Param *, double,double ,double ,double &, double &);
void qsolve(double *);
void Over_cor(Param *, double, int, double &, double &);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
int pack_forward_comm(int , int *, double *, int, int *);
void unpack_forward_comm(int , int , double *);
void Short_neigh();
// vector functions, inline for efficiency
inline double vec3_dot(const double x[3], const double y[3]) const {
return x[0]*y[0] + x[1]*y[1] + x[2]*y[2];
}
inline void vec3_add(const double x[3], const double y[3],
double * const z) const {
z[0] = x[0]+y[0]; z[1] = x[1]+y[1]; z[2] = x[2]+y[2];
}
inline void vec3_scale(const double k, const double x[3],
double y[3]) const {
y[0] = k*x[0]; y[1] = k*x[1]; y[2] = k*x[2];
}
inline void vec3_scaleadd(const double k, const double x[3],
const double y[3], double * const z) const {
z[0] = k*x[0]+y[0];
z[1] = k*x[1]+y[1];
z[2] = k*x[2]+y[2];
}
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Incorrect args for pair coefficients
Self-explanatory. Check the input script or data file.
E: Pair style COMB requires atom IDs
This is a requirement to use the AIREBO potential.
E: Pair style COMB requires newton pair on
See the newton command. This is a restriction to use the COMB
potential.
E: Pair style COMB requires atom attribute q
Self-explanatory.
E: All pair coeffs are not set
All pair coefficients must be set in the data file or by the
pair_coeff command before running a simulation.
E: Cannot open COMB potential file %s
The specified COMB potential file cannot be opened. Check that the
path and name are correct.
E: Incorrect format in COMB potential file
Incorrect number of words per line in the potential file.
E: Illegal COMB parameter
One or more of the coefficients defined in the potential file is
invalid.
E: Potential file has duplicate entry
The potential file has more than one entry for the same element.
E: Potential file is missing an entry
The potential file does not have a needed entry.
W: Pair COMB charge %.10f with force %.10f hit min barrier
Something is possibly wrong with your model.
W: Pair COMB charge %.10f with force %.10f hit max barrier
Something is possibly wrong with your model.
E: Neighbor list overflow, boost neigh_modify one
There are too many neighbors of a single atom. Use the neigh_modify
command to increase the max number of neighbors allowed for one atom.
You may also want to boost the page size.
*/
diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp
index fc2a805d1..56f376ba2 100644
--- a/src/MANYBODY/pair_comb3.cpp
+++ b/src/MANYBODY/pair_comb3.cpp
@@ -1,3957 +1,3956 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Ray Shan (Sandia, tnshan@sandia.gov)
Updates and debug: Tao Liang (U Florida, liang75@ufl.edu)
Dundar Yilmaz (dundar.yilmaz@zirve.edu.tr)
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_comb3.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "group.h"
#include "update.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define MAXLINE 1024
#define DELTA 4
#define PGDELTA 1
#define MAXNEIGH 24
/* ---------------------------------------------------------------------- */
PairComb3::PairComb3(LAMMPS *lmp) : Pair(lmp)
{
single_enable = 0;
restartinfo = 0;
one_coeff = 1;
ghostneigh = 1;
nmax = 0;
NCo = NULL;
bbij = NULL;
map = NULL;
esm = NULL;
nelements = 0;
elements = NULL;
nparams = 0;
maxparam = 0;
params = NULL;
elem2param = NULL;
intype = NULL;
afb = NULL;
dafb = NULL;
fafb = NULL;
dfafb = NULL;
ddfafb = NULL;
phin = NULL;
dphin = NULL;
erpaw = NULL;
vvdw = NULL;
vdvdw = NULL;
dpl = NULL;
xcctmp = NULL;
xchtmp = NULL;
xcotmp = NULL;
sht_num = NULL;
sht_first = NULL;
ipage = NULL;
pgsize = oneatom = 0;
cflag = 0;
// set comm size needed by this Pair
comm_forward = 1;
comm_reverse = 1;
}
/* ----------------------------------------------------------------------
check if allocated, since class can be destructed when incomplete
------------------------------------------------------------------------- */
PairComb3::~PairComb3()
{
memory->destroy(NCo);
if (elements)
for (int i = 0; i < nelements; i++) delete [] elements[i];
delete [] elements;
memory->sfree(params);
memory->destroy(elem2param);
memory->destroy(afb);
memory->destroy(dpl);
memory->destroy(dafb);
memory->destroy(fafb);
memory->destroy(phin);
memory->destroy(bbij);
memory->destroy(vvdw);
memory->destroy(vdvdw);
memory->destroy(dphin);
memory->destroy(erpaw);
memory->destroy(dfafb);
memory->destroy(ddfafb);
memory->destroy(xcctmp);
memory->destroy(xchtmp);
memory->destroy(xcotmp);
memory->destroy(intype);
memory->destroy(sht_num);
memory->sfree(sht_first);
delete [] ipage;
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cutghost);
delete [] map;
delete [] esm;
}
}
/* ---------------------------------------------------------------------- */
void PairComb3::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cutghost,n+1,n+1,"pair:cutghost");
map = new int[n+1];
esm = new double[n];
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairComb3::settings(int narg, char **arg)
{
if (strcmp(arg[0],"polar_on") == 0) {
pol_flag = 1;
if (comm->me == 0) fprintf(screen,
" PairComb3: polarization is on \n");
} else if (strcmp(arg[0],"polar_off") == 0) {
pol_flag = 0;
if (comm->me == 0) fprintf(screen,
" PairComb3: polarization is off \n");
} else {
error->all(FLERR,"Illegal pair_style command");
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairComb3::coeff(int narg, char **arg)
{
int i,j,n;
if (!allocated) allocate();
if (narg != 3 + atom->ntypes)
error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if NULL
// nelements = # of unique elements
// elements = list of element names
if (elements) {
for (i = 0; i < nelements; i++) delete [] elements[i];
delete [] elements;
}
elements = new char*[atom->ntypes];
for (i = 0; i < atom->ntypes; i++) elements[i] = NULL;
nelements = 0;
for (i = 3; i < narg; i++) {
if ((strcmp(arg[i],"C") == 0) && (cflag == 0)) {
if( comm->me == 0) fprintf(screen,
" PairComb3: Found C: reading additional library file\n");
read_lib();
cflag = 1;
}
if (strcmp(arg[i],"NULL") == 0) {
map[i-2] = -1;
continue;
}
for (j = 0; j < nelements; j++)
if (strcmp(arg[i],elements[j]) == 0) break;
map[i-2] = j;
if (j == nelements) {
n = strlen(arg[i]) + 1;
elements[j] = new char[n];
strcpy(elements[j],arg[i]);
nelements++;
}
}
// read potential file and initialize potential parameters
read_file(arg[2]);
setup();
n = atom->ntypes;
// generate Wolf 1/r energy and van der Waals look-up tables
tables();
// clear setflag since coeff() called once with I,J = * *
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
// set setflag i,j for type pairs where both are mapped to elements
int count = 0;
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
if (map[i] >= 0 && map[j] >= 0) {
setflag[i][j] = 1;
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairComb3::init_style()
{
if (atom->tag_enable == 0)
error->all(FLERR,"Pair style COMB3 requires atom IDs");
if (force->newton_pair == 0)
error->all(FLERR,"Pair style COMB3 requires newton pair on");
if (!atom->q_flag)
error->all(FLERR,"Pair style COMB3 requires atom attribute q");
// need a full neighbor list
int irequest = neighbor->request(this,instance_me);
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1;
neighbor->requests[irequest]->ghost = 1;
// local Comb neighbor list
// create pages if first time or if neighbor pgsize/oneatom has changed
int create = 0;
if (ipage == NULL) create = 1;
if (pgsize != neighbor->pgsize) create = 1;
if (oneatom != neighbor->oneatom) create = 1;
if (create) {
delete [] ipage;
pgsize = neighbor->pgsize;
oneatom = neighbor->oneatom;
int nmypage = comm->nthreads;
ipage = new MyPage<int>[nmypage];
for (int i = 0; i < nmypage; i++)
ipage[i].init(oneatom,pgsize);
}
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairComb3::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
cutghost[j][i] = cutghost[i][j] = cutmax;
return cutmax;
}
/* ---------------------------------------------------------------------- */
void PairComb3::read_lib()
{
unsigned int maxlib = 1024;
int i,j,k,l,nwords,m;
int ii,jj,kk,ll,mm,iii;
char s[maxlib];
char **words = new char*[80];
MPI_Comm_rank(world,&comm->me);
// open libraray file on proc 0
if (comm->me == 0) {
FILE *fp = force->open_potential("lib.comb3");
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open COMB3 lib.comb3 file");
error->one(FLERR,str);
}
// read and store at the same time
fgets(s,maxlib,fp);
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
ccutoff[0] = atof(words[0]);
ccutoff[1] = atof(words[1]);
ccutoff[2] = atof(words[2]);
ccutoff[3] = atof(words[3]);
ccutoff[4] = atof(words[4]);
ccutoff[5] = atof(words[5]);
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
ch_a[0] = atof(words[0]);
ch_a[1] = atof(words[1]);
ch_a[2] = atof(words[2]);
ch_a[3] = atof(words[3]);
ch_a[4] = atof(words[4]);
ch_a[5] = atof(words[5]);
ch_a[6] = atof(words[6]);
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
nsplpcn = atoi(words[0]);
nsplrad = atoi(words[1]);
nspltor = atoi(words[2]);
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
maxx = atoi(words[0]);
maxy = atoi(words[1]);
maxz = atoi(words[2]);
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
maxxc = atoi(words[0]);
maxyc = atoi(words[1]);
maxconj = atoi(words[2]);
for (l=0; l<nsplpcn; l++) {
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
maxxcn[l] = atoi(words[1]);
vmaxxcn[l] = atof(words[2]);
dvmaxxcn[l] = atof(words[3]);
}
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
ntab = atoi(words[0]);
for (i=0; i<ntab+1; i++){
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
pang[i] = atof(words[1]);
dpang[i] = atof(words[2]);
ddpang[i] = atof(words[3]);
}
for (l=0; l<nsplpcn; l++)
for (i=0; i<maxx+1; i++)
for (j=0; j<maxy+1; j++)
for (k=0; k<maxz+1; k++) {
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
ll = atoi(words[0])-1;
ii = atoi(words[1]);
jj = atoi(words[2]);
kk = atoi(words[3]);
pcn_grid[ll][ii][jj][kk] = atof(words[4]);
pcn_gridx[ll][ii][jj][kk] = atof(words[5]);
pcn_gridy[ll][ii][jj][kk] = atof(words[6]);
pcn_gridz[ll][ii][jj][kk] = atof(words[7]);
}
for (l=0; l<nsplpcn; l++)
for (i=0; i<maxx; i++)
for (j=0; j<maxy; j++)
for (k=0; k<maxz; k++) {
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
ll = atoi(words[0])-1;
ii = atoi(words[1]);
jj = atoi(words[2]);
kk = atoi(words[3]);
for(iii=0; iii<2; iii++) {
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
for(m=0; m<32 ; m++) {
mm=iii*32+m;
pcn_cubs[ll][ii][jj][kk][mm] = atof(words[m]);
}
}
}
for (l=0; l<nsplrad; l++)
for (i=0; i<maxxc+1; i++)
for (j=0; j<maxyc+1; j++)
for (k=0; k<maxconj; k++) {
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
ll = atoi(words[0])-1;
ii = atoi(words[1]);
jj = atoi(words[2]);
kk = atoi(words[3])-1;
rad_grid[ll][ii][jj][kk] = atof(words[4]);
rad_gridx[ll][ii][jj][kk] = atof(words[5]);
rad_gridy[ll][ii][jj][kk] = atof(words[6]);
rad_gridz[ll][ii][jj][kk] = atof(words[7]);
}
for (l=0; l<nsplrad; l++)
for (i=0; i<maxxc; i++)
for (j=0; j<maxyc; j++)
for (k=0; k<maxconj-1; k++) {
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
ll = atoi(words[0])-1;
ii = atoi(words[1]);
jj = atoi(words[2]);
kk = atoi(words[3])-1;
for (iii=0; iii<2; iii++) {
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
for(m=0; m<32 ; m++){
mm=iii*32+m;
rad_spl[ll][ii][jj][kk][mm] = atof(words[m]);
}
}
}
for (l=0; l<nspltor; l++)
for (i=0; i<maxxc+1; i++)
for (j=0; j<maxyc+1; j++)
for (k=0; k<maxconj; k++) {
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
ll = atoi(words[0])-1;
ii = atoi(words[1]);
jj = atoi(words[2]);
kk = atoi(words[3])-1;
tor_grid[ll][ii][jj][kk] = atof(words[4]);
tor_gridx[ll][ii][jj][kk] = atof(words[5]);
tor_gridy[ll][ii][jj][kk] = atof(words[6]);
tor_gridz[ll][ii][jj][kk] = atof(words[7]);
}
for (l=0; l<nspltor; l++)
for (i=0; i<maxxc; i++)
for (j=0; j<maxyc; j++)
for (k=0; k<maxconj-1; k++) {
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
ll = atoi(words[0])-1;
ii = atoi(words[1]);
jj = atoi(words[2]);
kk = atoi(words[3])-1;
for(iii=0; iii<2; iii++) {
fgets(s,maxlib,fp);
nwords = 0;
words[nwords++] = strtok(s," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f")))continue;
for (m=0; m<32 ; m++){
mm=iii*32+m;
tor_spl[ll][ii][jj][kk][mm] = atof(words[m]);
}
}
}
fclose(fp);
}
k = 0;
for (i=0; i<4; i++)
for (j=0; j<4; j++) {
iin2[k][0] = i;
iin2[k][1] = j;
k ++;
}
l = 0;
for (i=0; i<4; i++)
for (j=0; j<4; j++)
for (k=0; k<4; k++) {
iin3[l][0] = i;
iin3[l][1] = j;
iin3[l][2] = k;
l ++;
}
MPI_Bcast(&ccutoff[0],6,MPI_DOUBLE,0,world);
MPI_Bcast(&ch_a[0],7,MPI_DOUBLE,0,world);
MPI_Bcast(&nsplpcn,1,MPI_INT,0,world);
MPI_Bcast(&nsplrad,1,MPI_INT,0,world);
MPI_Bcast(&nspltor,1,MPI_INT,0,world);
MPI_Bcast(&maxx,1,MPI_INT,0,world);
MPI_Bcast(&maxy,1,MPI_INT,0,world);
MPI_Bcast(&maxz,1,MPI_INT,0,world);
MPI_Bcast(&maxxc,1,MPI_INT,0,world);
MPI_Bcast(&maxyc,1,MPI_INT,0,world);
MPI_Bcast(&maxconj,1,MPI_INT,0,world);
MPI_Bcast(&maxxcn,4,MPI_INT,0,world);
MPI_Bcast(&vmaxxcn,4,MPI_DOUBLE,0,world);
MPI_Bcast(&dvmaxxcn,4,MPI_DOUBLE,0,world);
MPI_Bcast(&ntab,1,MPI_INT,0,world);
MPI_Bcast(&pang[0],20001,MPI_DOUBLE,0,world);
MPI_Bcast(&dpang[0],20001,MPI_DOUBLE,0,world);
MPI_Bcast(&ddpang[0],20001,MPI_DOUBLE,0,world);
MPI_Bcast(&pcn_grid[0][0][0][0],500,MPI_DOUBLE,0,world);
MPI_Bcast(&pcn_gridx[0][0][0][0],500,MPI_DOUBLE,0,world);
MPI_Bcast(&pcn_gridy[0][0][0][0],500,MPI_DOUBLE,0,world);
MPI_Bcast(&pcn_gridz[0][0][0][0],500,MPI_DOUBLE,0,world);
MPI_Bcast(&pcn_cubs[0][0][0][0][0],16384,MPI_DOUBLE,0,world);
MPI_Bcast(&rad_grid[0][0][0][0],825,MPI_DOUBLE,0,world);
MPI_Bcast(&rad_gridx[0][0][0][0],825,MPI_DOUBLE,0,world);
MPI_Bcast(&rad_gridy[0][0][0][0],825,MPI_DOUBLE,0,world);
MPI_Bcast(&rad_gridz[0][0][0][0],825,MPI_DOUBLE,0,world);
MPI_Bcast(&rad_spl[0][0][0][0][0],30720,MPI_DOUBLE,0,world);
MPI_Bcast(&tor_grid[0][0][0][0],275,MPI_DOUBLE,0,world);
MPI_Bcast(&tor_gridx[0][0][0][0],275,MPI_DOUBLE,0,world);
MPI_Bcast(&tor_gridy[0][0][0][0],275,MPI_DOUBLE,0,world);
MPI_Bcast(&tor_gridz[0][0][0][0],275,MPI_DOUBLE,0,world);
MPI_Bcast(&tor_spl[0][0][0][0][0],10240,MPI_DOUBLE,0,world);
MPI_Bcast(&iin2[0][0],32,MPI_INT,0,world);
MPI_Bcast(&iin3[0][0],192,MPI_INT,0,world);
delete [] words;
}
/* ---------------------------------------------------------------------- */
void PairComb3::read_file(char *file)
{
int params_per_line = 74;
char **words = new char*[params_per_line+1];
if (params) delete [] params;
params = NULL;
nparams = 0;
// open file on proc 0
FILE *fp;
if (comm->me == 0) {
fp = force->open_potential(file);
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open COMB3 potential file %s",file);
error->one(FLERR,str);
}
}
// read each line out of file, skipping blank lines or leading '#'
// store line of params if all 3 element tags are in element list
int n,nwords,ielement,jelement,kelement;
char line[MAXLINE],*ptr;
int eof = 0;
nwords=0;
while (1) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fp);
if (ptr == NULL) {
eof = 1;
fclose(fp);
} else n = strlen(line) + 1;
}
MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) break;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
// strip comment, skip line if blank
if ((ptr = strchr(line,'#'))) *ptr = '\0';
nwords = atom->count_words(line);
if (nwords == 0) continue;
// concatenate additional lines until have params_per_line words
while (nwords < params_per_line) {
n = strlen(line);
if (comm->me == 0) {
ptr = fgets(&line[n],MAXLINE-n,fp);
if (ptr == NULL) {
eof = 1;
fclose(fp);
} else n = strlen(line) + 1;
}
MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) break;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
if ((ptr = strchr(line,'#'))) *ptr = '\0';
nwords = atom->count_words(line);
}
if (nwords != params_per_line){
error->all(FLERR,"Incorrect format in COMB3 potential file");
}
// words = ptrs to all words in line
nwords = 0;
words[nwords++] = strtok(line," \t\n\r\f");
while ((nwords <= params_per_line)
&& (words[nwords++] = strtok(NULL," \t\n\r\f"))) {
continue;
}
// ielement,jelement,kelement = 1st args
// if all 3 args are in element list, then parse this line
// else skip to next line
for (ielement = 0; ielement < nelements; ielement++)
if (strcmp(words[0],elements[ielement]) == 0) break;
if (ielement == nelements) continue;
for (jelement = 0; jelement < nelements; jelement++)
if (strcmp(words[1],elements[jelement]) == 0) break;
if (jelement == nelements) continue;
for (kelement = 0; kelement < nelements; kelement++)
if (strcmp(words[2],elements[kelement]) == 0) break;
if (kelement == nelements) continue;
// load up parameter settings and error check their values
if (nparams == maxparam) {
maxparam += DELTA;
params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
"pair:params");
}
params[nparams].ielement = ielement;
params[nparams].jelement = jelement;
params[nparams].kelement = kelement;
params[nparams].ielementgp = atoi(words[3]);
params[nparams].jelementgp = atoi(words[4]);
params[nparams].kelementgp = atoi(words[5]);
params[nparams].ang_flag = atoi(words[6]);
params[nparams].pcn_flag = atoi(words[7]);
params[nparams].rad_flag = atoi(words[8]);
params[nparams].tor_flag = atoi(words[9]);
params[nparams].vdwflag = atof(words[10]);
params[nparams].powerm = atof(words[11]);
params[nparams].veps = atof(words[12]);
params[nparams].vsig = atof(words[13]);
params[nparams].paaa = atof(words[14]);
params[nparams].pbbb = atof(words[15]);
params[nparams].lami = atof(words[16]);
params[nparams].alfi = atof(words[17]);
params[nparams].powern = atof(words[18]);
params[nparams].QL = atof(words[19]);
params[nparams].QU = atof(words[20]);
params[nparams].DL = atof(words[21]);
params[nparams].DU = atof(words[22]);
params[nparams].qmin = atof(words[23]);
params[nparams].qmax = atof(words[24]);
params[nparams].chi = atof(words[25]);
params[nparams].dj = atof(words[26]);
params[nparams].dk = atof(words[27]);
params[nparams].dl = atof(words[28]);
params[nparams].esm = atof(words[29]);
params[nparams].cmn1 = atof(words[30]);
params[nparams].cmn2 = atof(words[31]);
params[nparams].pcmn1 = atof(words[32]);
params[nparams].pcmn2 = atof(words[33]);
params[nparams].coulcut = atof(words[34]);
params[nparams].polz = atof(words[35]);
params[nparams].curl = atof(words[36]);
params[nparams].curlcut1 = atof(words[37]);
params[nparams].curlcut2 = atof(words[38]);
params[nparams].curl0 = atof(words[39]);
params[nparams].alpha1 = atof(words[40]);
params[nparams].bigB1 = atof(words[41]);
params[nparams].alpha2 = atof(words[42]);
params[nparams].bigB2 = atof(words[43]);
params[nparams].alpha3 = atof(words[44]);
params[nparams].bigB3 = atof(words[45]);
params[nparams].lambda = atof(words[46]);
params[nparams].bigA = atof(words[47]);
params[nparams].beta = atof(words[48]);
params[nparams].bigr = atof(words[49]);
params[nparams].bigd = atof(words[50]);
params[nparams].pcos6 = atof(words[51]);
params[nparams].pcos5 = atof(words[52]);
params[nparams].pcos4 = atof(words[53]);
params[nparams].pcos3 = atof(words[54]);
params[nparams].pcos2 = atof(words[55]);
params[nparams].pcos1 = atof(words[56]);
params[nparams].pcos0 = atof(words[57]);
params[nparams].pcna = atof(words[58]);
params[nparams].pcnb = atof(words[59]);
params[nparams].pcnc = atof(words[60]);
params[nparams].pcnd = atof(words[61]);
params[nparams].p6p0 = atof(words[62]);
params[nparams].p6p1 = atof(words[63]);
params[nparams].p6p2 = atof(words[64]);
params[nparams].p6p3 = atof(words[65]);
params[nparams].p6p4 = atof(words[66]);
params[nparams].p6p5 = atof(words[67]);
params[nparams].p6p6 = atof(words[68]);
params[nparams].ptork1=atof(words[69]);
params[nparams].ptork2=atof(words[70]);
params[nparams].addrepr=atof(words[71]);
params[nparams].addrep=atof(words[72]);
params[nparams].pcross = atof(words[73]);
params[nparams].powermint = int(params[nparams].powerm);
// parameter sanity checks
if (params[nparams].lambda < 0.0 || params[nparams].powern < 0.0 ||
params[nparams].beta < 0.0 || params[nparams].alpha1 < 0.0 ||
params[nparams].bigB1< 0.0 || params[nparams].bigA< 0.0 ||
params[nparams].bigB2< 0.0 || params[nparams].alpha2 <0.0 ||
params[nparams].bigB3< 0.0 || params[nparams].alpha3 <0.0 ||
params[nparams].bigr < 0.0 || params[nparams].bigd < 0.0 ||
params[nparams].bigd > params[nparams].bigr ||
params[nparams].powerm - params[nparams].powermint != 0.0 ||
params[nparams].addrepr < 0.0 || params[nparams].powermint < 1.0 ||
params[nparams].QL > 0.0 || params[nparams].QU < 0.0 ||
params[nparams].DL < 0.0 || params[nparams].DU > 0.0 ||
params[nparams].pcross < 0.0 ||
params[nparams].esm < 0.0 || params[nparams].veps < 0.0 ||
params[nparams].vsig < 0.0 || params[nparams].vdwflag < 0.0
)
error->all(FLERR,"Illegal COMB3 parameter");
nparams++;
}
delete [] words;
}
/* ---------------------------------------------------------------------- */
void PairComb3::setup()
{
int i,j,k,m,n;
// set elem2param for all element triplet combinations
// must be a single exact match to lines read from file
// do not allow for ACB in place of ABC
memory->destroy(elem2param);
memory->create(elem2param,nelements,nelements,nelements,"pair:elem2param");
for (i = 0; i < nelements; i++)
for (j = 0; j < nelements; j++)
for (k = 0; k < nelements; k++) {
n = -1;
for (m = 0; m < nparams; m++) {
if (i == params[m].ielement && j == params[m].jelement &&
k == params[m].kelement) {
if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
n = m;
}
}
if (n < 0) error->all(FLERR,"Potential file is missing an entry");
elem2param[i][j][k] = n;
}
// compute parameter values derived from inputs
for (m = 0; m < nparams; m++) {
params[m].cut = params[m].bigr + params[m].bigd;
params[m].cutsq = params[m].cut*params[m].cut;
params[m].c1 = pow(2.0*params[m].powern*1.0e-16,-1.0/params[m].powern);
params[m].c2 = pow(2.0*params[m].powern*1.00e-8,-1.0/params[m].powern);
params[m].c3 = 1.0/params[m].c2;
params[m].c4 = 1.0/params[m].c1;
params[m].Qo = (params[m].QU+params[m].QL)/2.0; // (A22)
params[m].dQ = (params[m].QU-params[m].QL)/2.0; // (A21)
params[m].aB = 1.0 /
(1.0-pow(fabs(params[m].Qo/params[m].dQ),10)); // (A20)
params[m].bB = pow(fabs(params[m].aB),0.1)/params[m].dQ; // (A19)
params[m].nD = log(params[m].DU/(params[m].DU-params[m].DL))/
log(params[m].QU/(params[m].QU-params[m].QL));
params[m].bD = (pow((params[m].DL-params[m].DU),(1.0/params[m].nD)))/
(params[m].QU-params[m].QL);
params[m].lcut = params[m].coulcut;
params[m].lcutsq = params[m].lcut*params[m].lcut;
}
// set cutmax to max of all params
cutmin = cutmax = 0.0;
polar = 0;
for (m = 0; m < nparams; m++) {
if (params[m].cutsq > cutmin) cutmin = params[m].cutsq + 2.0;
if (params[m].lcut > cutmax) cutmax = params[m].lcut;
}
chicut1 = 7.0;
chicut2 = cutmax;
}
/* ---------------------------------------------------------------------- */
void PairComb3::Short_neigh()
{
int nj,*neighptrj,icontrol;
int iparam_ij,*ilist,*jlist,*numneigh,**firstneigh;
int inum,jnum,i,j,ii,jj,itype,jtype;
double rr1,rsq1,delrj[3];
double **x = atom->x;
int *type = atom->type;
if (atom->nmax > nmax) {
memory->sfree(sht_first);
nmax = atom->nmax;
sht_first = (int **) memory->smalloc(nmax*sizeof(int *),
"pair:sht_first");
memory->grow(dpl,nmax,3,"pair:dpl");
memory->grow(xcctmp,nmax,"pair:xcctmp");
memory->grow(xchtmp,nmax,"pair:xchtmp");
memory->grow(xcotmp,nmax,"pair:xcotmp");
memory->grow(NCo,nmax,"pair:NCo");
memory->grow(sht_num,nmax,"pair:sht_num");
memory->grow(bbij,nmax,MAXNEIGH,"pair:bbij");
}
inum = list->inum + list->gnum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
// create COMB neighbor list
ipage->reset();
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
dpl[i][0] = dpl[i][1] = dpl[i][2] = 0.0;
nj = 0;
neighptrj = ipage->vget();
itype = map[type[i]];
jlist = firstneigh[i];
jnum = numneigh[i];
NCo[i] = 0.0;
xcctmp[i] = 0.0;
xchtmp[i] = 0.0;
xcotmp[i] = 0.0;
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj] & NEIGHMASK;
delrj[0] = x[i][0] - x[j][0];
delrj[1] = x[i][1] - x[j][1];
delrj[2] = x[i][2] - x[j][2];
rsq1 = vec3_dot(delrj,delrj);
jtype = map[type[j]];
iparam_ij = elem2param[itype][jtype][jtype];
if (rsq1 > cutmin) continue;
neighptrj[nj++] = j;
rr1 = sqrt(rsq1);
NCo[i] += comb_fc(rr1,&params[iparam_ij]) * params[iparam_ij].pcross;
icontrol = params[iparam_ij].jelementgp;
if( icontrol == 1)
xcctmp[i] += comb_fc(rr1,&params[iparam_ij]) * params[iparam_ij].pcross;
if (icontrol == 2)
xchtmp[i] += comb_fc(rr1,&params[iparam_ij]) * params[iparam_ij].pcross;
if (icontrol == 3)
xcotmp[i] += comb_fc(rr1,&params[iparam_ij]) * params[iparam_ij].pcross;
}
sht_first[i] = neighptrj;
sht_num[i] = nj;
ipage->vgot(nj);
if (ipage->status())
error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
}
// communicating coordination number to all nodes
pack_flag = 2;
comm->forward_comm_pair(this);
}
/* ---------------------------------------------------------------------- */
void PairComb3::compute(int eflag, int vflag)
{
int i,ii,k,kk,j,jj,im,inum,jnum,itype,jtype,ktype;
int iparam_i,iparam_ij,iparam_ji;
int iparam_ijk,iparam_jik,iparam_ikj,iparam_jli,iparam_ikl;
int sht_jnum,*sht_jlist,sht_lnum,*sht_llist;
int sht_mnum,*sht_mlist,sht_pnum,*sht_plist;
int *ilist,*jlist,*numneigh,**firstneigh,mr1,mr2,mr3,inty,nj;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,rsq1,rsq2,rsq3,iq,jq,yaself;
double eng_tmp,vionij,fvionij,sr1,sr2,sr3;
double zeta_ij,prefac_ij1,prefac_ij2,prefac_ij3,prefac_ij4,prefac_ij5;
double zeta_ji,prefac_ji1,prefac_ji2,prefac_ji3,prefac_ji4,prefac_ji5;
double delrj[3],delrk[3],fi[3],fj[3],fk[3],fl[3];
double ep6p_ij,ep6p_ji,fip6p[3],fjp6p[3],fkp6p[3],flp6p[3];
double potal,fac11,fac11e;
tagint itag, jtag;
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
tagint *tag = atom->tag;
int *type = atom->type;
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
// coordination terms
double xcn, ycn;
double kcn, lcn;
int torindx;
// torsion and radical variables
int l, ll, ltype, m, mm, mtype, p, pp, ptype;
int iparam_jil, iparam_ijl, iparam_ki, iparam_lj;
int iparam_jl, iparam_ik, iparam_km, iparam_lp;
double kconjug, lconjug, kradtot, lradtot;
double delrl[3], delrm[3], delrp[3], ddprx[3], srmu;
double zet_addi,zet_addj;
evdwl = eng_tmp = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = vflag_atom = 0;
// Build short range neighbor list
Short_neigh();
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
yaself = vionij = fvionij = fpair = 0.0;
// self energy correction term: potal
potal_calc(potal,fac11,fac11e);
// generate initial dipole tensor
if (pol_flag )
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
itag = tag[i];
itype = map[type[i]];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
iq = q[i];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj] & NEIGHMASK;
jtag = tag[j];
if (itag > jtag) {
if ((itag+jtag) % 2 == 0) continue;
} else if (itag < jtag) {
if ((itag+jtag) % 2 == 1) continue;
} else {
if (x[j][2] < x[i][2]) continue;
if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
}
jtype = map[type[j]];
jq = q[j];
delrj[0] = x[j][0] - xtmp;
delrj[1] = x[j][1] - ytmp;
delrj[2] = x[j][2] - ztmp;
rsq = vec3_dot(delrj,delrj);
iparam_ij = elem2param[itype][jtype][jtype];
iparam_ji = elem2param[jtype][itype][itype];
if (rsq > params[iparam_ij].lcutsq) continue;
tri_point(rsq, mr1, mr2, mr3, sr1, sr2, sr3);
dipole_init(&params[iparam_ij],&params[iparam_ji],fac11,delrj,
rsq,mr1,mr2,mr3,sr1,sr2,sr3,iq,jq,i,j);
}
}
// loop over full neighbor list of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
itag = tag[i];
itype = map[type[i]];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
iq = q[i];
nj = 0;
iparam_i = elem2param[itype][itype][itype];
// self energy, only on i atom
yaself = self(&params[iparam_i],iq);
// dipole self energy
if (pol_flag)
yaself += dipole_self(&params[iparam_i],i);
if (evflag) ev_tally(i,i,nlocal,0,0.0,yaself,0.0,0.0,0.0,0.0);
// two-body interactions (long:R + A, short: only R)
jlist = firstneigh[i];
jnum = numneigh[i];
sht_jlist = sht_first[i];
sht_jnum = sht_num[i];
// long range interactions
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj] & NEIGHMASK;
jtag = tag[j];
if (itag > jtag) {
if ((itag+jtag) % 2 == 0) continue;
} else if (itag < jtag) {
if ((itag+jtag) % 2 == 1) continue;
} else {
if (x[j][2] < x[i][2]) continue;
if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
}
jtype = map[type[j]];
jq = q[j];
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
iparam_ij = elem2param[itype][jtype][jtype];
iparam_ji = elem2param[jtype][itype][itype];
if (rsq > params[iparam_ij].lcutsq) continue;
inty = intype[itype][jtype];
// three-point interpolation
tri_point(rsq, mr1, mr2, mr3, sr1, sr2, sr3);
// Q-indenpendent: van der Waals
vdwaals(inty,mr1,mr2,mr3,rsq,sr1,sr2,sr3,eng_tmp,fpair);
evdwl = eng_tmp;
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
if (evflag)
ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
// Q-dependent: Coulombic, field, polarization
// 1/r energy and forces
direct(&params[iparam_ij], &params[iparam_ji],
mr1, mr2, mr3, rsq, sr1, sr2, sr3, iq, jq,
fac11, fac11e, eng_tmp, fvionij, i, j);
vionij = eng_tmp;
// field correction to self energy
field(&params[iparam_ij], &params[iparam_ji],rsq,iq,jq,
eng_tmp,fvionij);
vionij += eng_tmp;
// sums up long range Q-dependent forces (excluding dipole)
f[i][0] += delx*fvionij;
f[i][1] += dely*fvionij;
f[i][2] += delz*fvionij;
f[j][0] -= delx*fvionij;
f[j][1] -= dely*fvionij;
f[j][2] -= delz*fvionij;
// sums up long range Q-dependent energies (excluding dipole)
if (evflag)
ev_tally(i,j,nlocal,newton_pair,0.0,vionij,fvionij,delx,dely,delz);
// polarization field
if (pol_flag) {
dipole_calc(&params[iparam_ij], &params[iparam_ji],fac11,
delx,dely,delz,rsq,mr1,mr2,mr3,
sr1,sr2,sr3,iq,jq,i,j,eng_tmp,fvionij,ddprx);
vionij = eng_tmp;
// sums up dipole energies
if (evflag)
ev_tally(i,j,nlocal,newton_pair,0.0,vionij,fvionij,delx,dely,delz);
// sums up dipole forces
f[i][0] += (ddprx[0] + delx*fvionij);
f[i][1] += (ddprx[1] + dely*fvionij);
f[i][2] += (ddprx[2] + delz*fvionij);
f[j][0] -= (ddprx[0] + delx*fvionij);
f[j][1] -= (ddprx[1] + dely*fvionij);
f[j][2] -= (ddprx[2] + delz*fvionij);
}
if (rsq > params[iparam_ij].cutsq) continue;
repulsive(&params[iparam_ij], &params[iparam_ji], rsq,
fpair, eflag, eng_tmp, iq, jq);
evdwl = eng_tmp;
// repulsion is pure two-body, sums up pair repulsive forces
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
if (evflag)
ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
}
// many-body interactions: start of short-range
xcn = NCo[i];
for (jj = 0; jj < sht_jnum; jj++) {
j = sht_jlist[jj];
sht_llist = sht_first[j];
sht_lnum = sht_num[j];
jtag = tag[j];
if ( jtag <= itag ) continue ;
ycn = NCo[j];
jtype = map[type[j]];
iparam_ij = elem2param[itype][jtype][jtype];
iparam_ji = elem2param[jtype][itype][itype];
delrj[0] = x[j][0] - xtmp;
delrj[1] = x[j][1] - ytmp;
delrj[2] = x[j][2] - ztmp;
rsq1 = vec3_dot(delrj,delrj);
if (rsq1 > params[iparam_ij].cutsq) continue;
nj ++;
// this Qj for q-dependent BSi
jq = q[j];
// accumulate bondorder zeta for each i-j interaction via k and l loops
zeta_ij = 0.0;
bbtor = 0.0;
kconjug = 0.0;
for (kk = 0; kk < sht_jnum; kk++) { // kk is neighbor of ii
k = sht_jlist[kk];
if (j == k) continue;
ktype = map[type[k]];
iparam_ijk = elem2param[itype][jtype][ktype];
iparam_ikj = elem2param[itype][ktype][jtype];
iparam_jik = elem2param[jtype][itype][ktype];
iparam_ik = elem2param[itype][ktype][ktype];
delrk[0] = x[k][0] - xtmp;
delrk[1] = x[k][1] - ytmp;
delrk[2] = x[k][2] - ztmp;
rsq2 = vec3_dot(delrk,delrk);
if (rsq2 > params[iparam_ik].cutsq) continue;
// 3-body zeta in bond order
zeta_ij += zeta(&params[iparam_ijk], &params[iparam_ik],
rsq1, rsq2, delrj, delrk, i, xcn);
// radical initialization: apply only to CC,CO,OC bonds
if (params[iparam_ij].rad_flag > 0 &&
params[iparam_ik].ielementgp == 1 &&
params[iparam_ik].jelementgp == 1) {
iparam_ki = elem2param[ktype][itype][itype];
kcn=NCo[k];
kconjug += rad_init(rsq2,&params[iparam_ki],i,kradtot,kcn);
}
// torsion: i-j-k-l: apply to all C-C bonds
if( params[iparam_ij].tor_flag != 0 ) {
srmu = vec3_dot(delrj,delrk)/(sqrt(rsq1*rsq2));
srmu = sqrt(1.0-srmu*srmu);
if(srmu > 0.1) {
for (ll = 0; ll < sht_lnum; ll++) { // ll is neighbor of jj
l = sht_llist[ll];
if(l==i || l==j || l==k) continue;
ltype = map[type[l]];
delrl[0] = x[l][0] - x[j][0];
delrl[1] = x[l][1] - x[j][1];
delrl[2] = x[l][2] - x[j][2];
rsq3 = vec3_dot(delrl,delrl);
iparam_jl = elem2param[jtype][ltype][ltype];
if (rsq3 > params[iparam_jl].cutsq) continue;
iparam_ikl = elem2param[itype][ktype][ltype];
torindx = params[iparam_ij].tor_flag;
bbtor += bbtor1(torindx, &params[iparam_ikl],&params[iparam_jl],
rsq1,rsq2,rsq3,delrj,delrk,delrl,srmu);
}
}
}
}
zeta_ji = 0.0;
lconjug = 0.0;
for (ll = 0; ll < sht_lnum; ll++) {
l = sht_llist[ll];
if (l == i) continue;
ltype = map[type[l]];
iparam_jil = elem2param[jtype][itype][ltype];
iparam_ijl = elem2param[itype][jtype][ltype];
iparam_jl = elem2param[jtype][ltype][ltype];
iparam_lj = elem2param[ltype][jtype][jtype];
delrk[0] = x[l][0] - x[j][0];
delrk[1] = x[l][1] - x[j][1];
delrk[2] = x[l][2] - x[j][2];
rsq2 = vec3_dot(delrk,delrk);
delrl[0] = x[l][0] - x[j][0];
delrl[1] = x[l][1] - x[j][1];
delrl[2] = x[l][2] - x[j][2];
rsq2 = vec3_dot(delrl,delrl);
if (rsq2 > params[iparam_jl].cutsq) continue;
vec3_scale(-1,delrj,delrl); // ji_hat is -(ij_hat)
zeta_ji += zeta(&params[iparam_jil], &params[iparam_jl]
, rsq1, rsq2, delrl, delrk, j, ycn);
// radical initialization: apply only to CC,CO,OC bonds
if(params[iparam_ji].rad_flag > 0
&& params[iparam_jl].ielementgp == 1
&& params[iparam_jl].jelementgp == 1) {
iparam_lj = elem2param[ltype][jtype][jtype];
lcn=NCo[l];
lconjug += rad_init(rsq2,&params[iparam_lj],j,lradtot,lcn);
}
}
force_zeta(&params[iparam_ij], &params[iparam_ji],
rsq1, xcn, ycn, zeta_ij, zeta_ji, fpair,
prefac_ij1, prefac_ij2, prefac_ij3, prefac_ij4, prefac_ij5,
prefac_ji1, prefac_ji2, prefac_ji3, prefac_ji4, prefac_ji5,
eflag, eng_tmp, iq, jq, i, j, nj, bbtor, kconjug, lconjug);
evdwl = eng_tmp;
selfp6p(&params[iparam_ij],&params[iparam_ji],rsq1,eng_tmp,fpair);
evdwl += eng_tmp;
f[i][0] += delrj[0]*fpair;
f[i][1] += delrj[1]*fpair;
f[i][2] += delrj[2]*fpair;
f[j][0] -= delrj[0]*fpair;
f[j][1] -= delrj[1]*fpair;
f[j][2] -= delrj[2]*fpair;
if (evflag) ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,-fpair,-delrj[0],-delrj[1],-delrj[2]);
// attractive term via loop over k (3-body forces: i-j-k)
zet_addi=0;
zet_addj=0;
for (kk = 0; kk < sht_jnum; kk++) {
k = sht_jlist[kk];
if (j == k) continue;
sht_mlist = sht_first[k];
sht_mnum = sht_num[k];
ktype = map[type[k]];
iparam_ijk = elem2param[itype][jtype][ktype];
iparam_ikj = elem2param[itype][ktype][jtype];
iparam_jik = elem2param[jtype][itype][ktype];
iparam_ik = elem2param[itype][ktype][ktype];
delrk[0] = x[k][0] - xtmp;
delrk[1] = x[k][1] - ytmp;
delrk[2] = x[k][2] - ztmp;
rsq2 = vec3_dot(delrk,delrk);
if (rsq2 > params[iparam_ik].cutsq) continue;
// BO-dependent 3-body E & F
attractive(&params[iparam_ijk], &params[iparam_jik],&params[iparam_ikj],
prefac_ij1, prefac_ij2, prefac_ij3, prefac_ij4, prefac_ij5,
rsq1,rsq2,delrj,delrk,fi,fj,fk,i,xcn);
ep6p_ij = ep6p(&params[iparam_ijk],&params[iparam_ikj],rsq1,rsq2,delrj,delrk,zet_addi);
fp6p(&params[iparam_ijk],&params[iparam_ikj],rsq1,rsq2,delrj,delrk,fip6p,fjp6p,fkp6p);
// Sums up i-j-k forces: LP contribution
for (im = 0; im < 3; im++) {
fi[im] += fip6p[im];
fj[im] += fjp6p[im];
fk[im] += fkp6p[im];
}
// Sums up i-j-k forces: Tallies into global force vector
for (im = 0; im < 3; im++) {
f[i][im] += fi[im];
f[j][im] += fj[im];
f[k][im] += fk[im];
}
// torsion and radical: apply to all C-C bonds
if( params[iparam_ijk].tor_flag != 0 && fabs(ptorr)>1.0e-8) {
srmu = vec3_dot(delrj,delrk)/(sqrt(rsq1*rsq2));
srmu = sqrt(1.0-srmu*srmu);
if(srmu > 0.1) {
for (ll = 0; ll < sht_lnum; ll++) { // ll is neighbor of jj
l = sht_llist[ll];
if (l==i||l==j||l==k) continue;
ltype = map[type[l]];
delrl[0] = x[l][0] - x[j][0];
delrl[1] = x[l][1] - x[j][1];
delrl[2] = x[l][2] - x[j][2];
rsq3 = vec3_dot(delrl,delrl);
iparam_jl = elem2param[jtype][ltype][ltype];
if (rsq3 > params[iparam_jl].cutsq) continue;
iparam_ikl = elem2param[itype][ktype][ltype];
torindx = params[iparam_ij].tor_flag;
tor_force(torindx, &params[iparam_ikl], &params[iparam_jl],srmu,
rsq1,rsq2,rsq3,delrj,delrk,delrl);
for (im = 0; im < 3; im++) {
f[i][im] += fi_tor[im];
f[j][im] += fj_tor[im];
f[k][im] += fk_tor[im];
f[l][im] += fl_tor[im];
}
}
}
}
if( params[iparam_ijk].rad_flag>=1 &&
params[iparam_ijk].ielementgp==1 &&
params[iparam_ijk].kelementgp==1) {
iparam_ki = elem2param[ktype][itype][itype];
kcn=NCo[k];
double rik=sqrt(rsq2);
kradtot = -comb_fc(rik,&params[iparam_ki])*params[iparam_ki].pcross+kcn;
rad_forceik(&params[iparam_ki],rsq2,delrk,kconjug,kradtot);
for (im = 0; im < 3; im++) {
f[i][im] += fi_rad[im];
f[k][im] += fk_rad[im];
}
if (fabs(radtmp) > 1.0e-12) {
for (mm = 0; mm < sht_mnum; mm++) { // mm is neighbor of kk
m = sht_mlist[mm];
if (m == k) continue;
mtype = map[type[m]];
delrm[0] = x[m][0] - x[k][0];
delrm[1] = x[m][1] - x[k][1];
delrm[2] = x[m][2] - x[k][2];
rsq3 = vec3_dot(delrm,delrm);
iparam_km = elem2param[ktype][mtype][mtype];
iparam_ki = elem2param[ktype][itype][itype];
if (rsq3 > params[iparam_km].cutsq) continue;
rad_force(&params[iparam_km],rsq3,delrm,radtmp);
for (im = 0; im < 3; im++) {
f[k][im] += fj_rad[im];
f[m][im] += fk_rad[im];
}
}
}
}
if (evflag)
ev_tally(i,j,nlocal,newton_pair,ep6p_ij,0.0,0.0,0.0,0.0,0.0);
if (vflag_atom)
v_tally3(i,j,k,fj,fk,delrj,delrk);
} // k-loop
// attractive term via loop over l (3-body forces: j-i-l)
for (ll = 0; ll < sht_lnum; ll++) {
l = sht_llist[ll];
if (l == i) continue;
sht_plist = sht_first[l];
sht_pnum = sht_num[l];
ltype = map[type[l]];
iparam_jil = elem2param[jtype][itype][ltype];
iparam_jli = elem2param[jtype][ltype][itype];
iparam_ijl = elem2param[itype][jtype][ltype];
iparam_jl = elem2param[jtype][ltype][ltype];
delrk[0] = x[l][0] - x[j][0];
delrk[1] = x[l][1] - x[j][1];
delrk[2] = x[l][2] - x[j][2];
rsq2 = vec3_dot(delrk,delrk);
if (rsq2 > params[iparam_jl].cutsq) continue;
vec3_scale(-1,delrj,delrl);
attractive(&params[iparam_jil],&params[iparam_ijl],&params[iparam_jli],
prefac_ji1,prefac_ji2,prefac_ji3,prefac_ji4,prefac_ji5,
rsq1,rsq2,delrl,delrk,fj,fi,fl,j,ycn);
// BO-independent 3-body j-i-l LP and BB correction and forces
ep6p_ji = ep6p(&params[iparam_jil],&params[iparam_jli],rsq1,rsq2,delrl,delrk,zet_addj);
fp6p(&params[iparam_jil],&params[iparam_jli],rsq1,rsq2,delrl,delrk,fjp6p,fip6p,flp6p);
if (evflag)
ev_tally(j,i,nlocal,newton_pair,ep6p_ji,0.0,0.0,0.0,0.0,0.0);
// BO-dependent 3-body E & F
for (im = 0; im < 3; im++) {
fj[im] += fjp6p[im];
fi[im] += fip6p[im];
fl[im] += flp6p[im];
}
// Sums up j-i-l forces: Tallies into global force vector
for (im = 0; im < 3; im++) {
f[j][im] += fj[im];
f[i][im] += fi[im];
f[l][im] += fl[im];
}
// radical i-j-l-p: apply to all CC,CO,OC bonds
if( params[iparam_jil].rad_flag >= 1 &&
params[iparam_jil].ielementgp == 1 &&
params[iparam_jil].kelementgp == 1 ) {
iparam_lj = elem2param[ltype][jtype][jtype];
lcn=NCo[l];
double rjl=sqrt(rsq2);
lradtot=-comb_fc(rjl,&params[iparam_lj])*params[iparam_lj].pcross +lcn;
rad_forceik(&params[iparam_lj],rsq2,delrk,lconjug,lradtot);
for (im = 0; im < 3; im++) {
f[j][im] += fi_rad[im];
f[l][im] += fk_rad[im];
}
if (fabs(radtmp)>1.0e-12) {
for (pp = 0; pp < sht_pnum; pp++) { // pp is neighbor of ll
p = sht_plist[pp];
if (p == l) continue;
ptype = map[type[p]];
delrp[0] = x[p][0] - x[l][0];
delrp[1] = x[p][1] - x[l][1];
delrp[2] = x[p][2] - x[l][2];
rsq3 = vec3_dot(delrp,delrp);
iparam_lp = elem2param[ltype][ptype][ptype];
if (rsq3 > params[iparam_lp].cutsq) continue;
vec3_scale(-1,delrj,delrj);
rad_force(&params[iparam_lp],rsq3,delrp,radtmp);
vec3_scale(-1,delrj,delrj);
for (im = 0; im < 3; im++) {
f[l][im] += fj_rad[im];
f[p][im] += fk_rad[im];
}
}
}
}
if (vflag_atom)
v_tally3(j,i,l,fi,fl,delrl,delrk);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ---------------------------------------------------------------------- */
void PairComb3::repulsive(Param *parami, Param *paramj, double rsq,
double &fforce,int eflag, double &eng, double iq, double jq)
{
double r,tmp_fc,tmp_fc_d,Di,Dj;
double caj,vrcs,fvrcs;
double LamDiLamDj,fcdA,rlm1,bigA;
double romi = parami->addrep;
double rrcs = parami->bigr + parami->bigd;
double addr = parami->addrepr;
r = sqrt(rsq);
if (r > rrcs) return ;
tmp_fc = comb_fc(r,parami);
tmp_fc_d = comb_fc_d(r,parami);
Di = parami->DU + pow(fabs(parami->bD*(parami->QU-iq)),parami->nD);
Dj = paramj->DU + pow(fabs(paramj->bD*(paramj->QU-jq)),paramj->nD);
bigA = parami->bigA;
rlm1 = parami->lambda;
fcdA = tmp_fc_d - tmp_fc * rlm1;
LamDiLamDj = exp(0.5*(parami->lami*Di+paramj->lami*Dj)-rlm1*r);
caj = bigA * LamDiLamDj;
fforce = -caj * fcdA;
// additional repulsion
vrcs = 1.0; fvrcs = 0.0;
if (romi != 0.0 && r < addr) {
vrcs += romi * pow((1.0-r/addr),2.0);
fvrcs = romi * 2.0 * (r/addr-1.0)/addr;
fforce = fforce*vrcs - caj * tmp_fc * vrcs * fvrcs;
}
fforce /= r;
// eng = repulsive energy
eng = caj * tmp_fc * vrcs;
}
/* ---------------------------------------------------------------------- */
double PairComb3::zeta(Param *parami, Param *paramj, double rsqij,
double rsqik, double *delrij, double *delrik, int i, double xcn)
{
double rij,rik,costheta,arg,ex_delr,rlm3;
rij = sqrt(rsqij);
if (rij > parami->bigr+parami->bigd) return 0.0;
rik = sqrt(rsqik);
costheta = vec3_dot(delrij,delrik) / (rij*rik);
rlm3 = parami->beta;
arg = pow(rlm3*(rij-rik),int(parami->powermint));
if (arg > 69.0776) ex_delr = 1.e30;
else if (arg < -69.0776) ex_delr = 0.0;
else ex_delr = exp(arg);
return comb_fc(rik,paramj) * comb_gijk(costheta,parami,xcn) * ex_delr;
}
/* ---------------------------------------------------------------------- */
void PairComb3::selfp6p(Param *parami, Param *paramj, double rsq,
double &eng, double &force)
{
double r,comtti,comttj,fcj,fcj_d;
r=sqrt(rsq);
fcj=comb_fc(r,parami);
fcj_d=comb_fc_d(r,parami);
comtti = comttj = 0.0;
double pilp0 = parami->p6p0;
double pilp1 = parami->p6p1, pilp2 = parami->p6p2, pilp3 = parami->p6p3;
double pilp4 = parami->p6p4, pilp5 = parami->p6p5, pilp6 = parami->p6p6;
comtti = pilp0 + pilp1 + pilp2 + pilp3 + pilp4 + pilp5 + pilp6;
double pjlp0 = paramj->p6p0;
double pjlp1 = paramj->p6p1, pjlp2 = paramj->p6p2, pjlp3 = paramj->p6p3;
double pjlp4 = paramj->p6p4, pjlp5 = paramj->p6p5, pjlp6 = paramj->p6p6;
comttj = pjlp0 + pjlp1 + pjlp2 + pjlp3 + pjlp4 + pjlp5 + pjlp6;
eng = 0.5 * fcj * (comtti + comttj);
force += 0.5 * fcj_d * (comtti + comttj)/r;
}
/* ---------------------------------------------------------------------- */
double PairComb3::ep6p(Param *paramj, Param *paramk, double rsqij, double rsqik,
double *delrij, double *delrik , double &zet_add)
{
double comtt;
double pplp0 = paramj->p6p0;
double pplp1 = paramj->p6p1, pplp2 = paramj->p6p2, pplp3 = paramj->p6p3;
double pplp4 = paramj->p6p4, pplp5 = paramj->p6p5, pplp6 = paramj->p6p6;
double rij,rik,costheta,lp0,lp1,lp2,lp3,lp4,lp5,lp6;
double rmu,rmu2,rmu3,rmu4,rmu5,rmu6,fcj,fck;
comtt=0.0;
rij = sqrt(rsqij);
rik = sqrt(rsqik);
costheta = vec3_dot(delrij,delrik) / (rij*rik);
fcj = comb_fc(rij,paramj);
fck = comb_fc(rik,paramk);
rmu = costheta;
rmu2 = rmu *rmu; rmu3 = rmu2*rmu; rmu4 = rmu3*rmu;
rmu5 = rmu4*rmu; rmu6 = rmu5*rmu;
lp0 = pplp0;
lp1 = pplp1*rmu;
lp2 = pplp2*rmu2;
lp3 = pplp3*rmu3;
lp4 = pplp4*rmu4;
lp5 = pplp5*rmu5;
lp6 = pplp6*rmu6;
comtt = lp0 + lp1 + lp2 + lp3 + lp4 + lp5 + lp6;
return 0.5 * fck * comtt *fcj;
}
/*---------------------------------------------------------------------- */
void PairComb3::fp6p(Param *paramij,Param *paramik, double rsqij, double rsqik,
double *delrij, double *delrik, double *drilp,
double *drjlp, double *drklp)
{
double pplp0 = paramij->p6p0;
double pplp1 = paramij->p6p1, pplp2 = paramij->p6p2, pplp3 = paramij->p6p3;
double pplp4 = paramij->p6p4, pplp5 = paramij->p6p5, pplp6 = paramij->p6p6;
double ffj1,ffj2,ffk1,ffk2;
double rij,rik,costheta;
double rmu,comtt,comtt_d,com4k,com5,com5k,fcj,fcj_d,fck,fck_d;
double lp0,lp1,lp2,lp3,lp4,lp5,lp6;
double lp1_d,lp2_d,lp3_d,lp4_d,lp5_d,lp6_d;
double rmu2, rmu3, rmu4, rmu5, rmu6;
ffj1 = 0.0, ffj2 = 0.0;
ffk1 = 0.0, ffk2 = 0.0;
rij = sqrt(rsqij); rik = sqrt(rsqik);
costheta = vec3_dot(delrij,delrik) / (rij*rik);
fcj = comb_fc(rij,paramij);
fck = comb_fc(rik,paramik);
fcj_d = comb_fc_d(rij,paramij);
fck_d = comb_fc_d(rik,paramik);
rmu = costheta;
rmu2 = rmu *rmu; rmu3 = rmu2*rmu;
rmu4 = rmu3*rmu; rmu5 = rmu4*rmu; rmu6 = rmu5*rmu;
lp0 = pplp0;
lp1 = pplp1*rmu;
lp2 = pplp2*rmu2;
lp3 = pplp3*rmu3;
lp4 = pplp4*rmu4;
lp5 = pplp5*rmu5;
lp6 = pplp6*rmu6;
lp1_d = pplp1;
lp2_d = pplp2*2.0*rmu;
lp3_d = pplp3*3.0*rmu2;
lp4_d = pplp4*4.0*rmu3;
lp5_d = pplp5*5.0*rmu4;
lp6_d = pplp6*6.0*rmu5;
comtt = lp0 + lp1 + lp2 + lp3 + lp4 + lp5 + lp6;
comtt_d = lp1_d + lp2_d + lp3_d + lp4_d + lp5_d + lp6_d;
com4k = fcj * fck_d * comtt;
com5 = fcj * fck * comtt_d;
com5k = fck * comtt * fcj_d;
ffj1 = 0.5*(-com5/(rij*rik));
ffj2 = 0.5*(com5*rmu/rsqij-com5k/rij);
ffk1 = ffj1;
ffk2 = 0.5*(-com4k/rik+com5*rmu/rsqik);
// j-atom
vec3_scale(ffj1,delrik,drjlp);
vec3_scaleadd(ffj2,delrij,drjlp,drjlp);
// k-atom
vec3_scale(ffk1,delrij,drklp);
vec3_scaleadd(ffk2,delrik,drklp,drklp);
// i-atom
vec3_add(drjlp,drklp,drilp);
vec3_scale(-1.0,drilp,drilp);
}
/* ---------------------------------------------------------------------- */
void PairComb3::force_zeta(Param *parami, Param *paramj, double rsq,
double xcn, double ycn, double &zeta_ij, double &zeta_ji, double &fforce,
double &prefac_ij1, double &prefac_ij2, double &prefac_ij3,
double &prefac_ij4, double &prefac_ij5,
double &prefac_ji1, double &prefac_ji2, double &prefac_ji3,
double &prefac_ji4, double &prefac_ji5,
int eflag, double &eng, double iq, double jq,
int i, int j, int nj, double bbtor, double kconjug, double lconjug)
{
double r,att_eng,att_force,bij; // att_eng is -cbj
double boij, dbij1, dbij2, dbij3, dbij4, dbij5;
double boji, dbji1, dbji2, dbji3, dbji4, dbji5;
double pradx, prady;
r = sqrt(rsq);
if (r > parami->bigr + parami->bigd) return;
comb_fa(r, parami, paramj, iq, jq, att_eng, att_force);
comb_bij_d(zeta_ij,parami,r,i,boij,dbij1,dbij2,dbij3,dbij4,dbij5,xcn);
comb_bij_d(zeta_ji,paramj,r,j,boji,dbji1,dbji2,dbji3,dbji4,dbji5,ycn);
bij = 0.5*(boij + boji);
// radical energy
if ( parami->rad_flag>0 ) {
rad_calc( r, parami, paramj, kconjug, lconjug, i, j, xcn, ycn);
bij += brad[0];
pradx = brad[1]*att_eng;
prady = brad[2]*att_eng;
brad[3] = 1.0 * brad[3]*att_eng;
}
// torsion energy
if ( parami->tor_flag!=0) {
tor_calc( r, parami, paramj, kconjug, lconjug, i, j, xcn, ycn);
bij += btor[0] * bbtor;
ptorr = att_eng * btor[0];
pradx += 1.0 * btor[1] * bbtor * att_eng;
prady += 1.0 * btor[2] * bbtor * att_eng;
brad[3]+= 1.0 * btor[3] * bbtor * att_eng;
}
fforce = 1.0*bij*att_force/r; // divide by r will done compute
bbij[i][nj] = bij;
prefac_ij1 = -0.5*att_eng*dbij1; // prefac_ij1 = -pfij
prefac_ij2 = -0.5*att_eng*dbij2; // prefac_ij2 = -pfij1
prefac_ij3 = -0.5*att_eng*dbij3; // prefac_ij3 = -pfij2
prefac_ij4 = -0.5*att_eng*dbij4; // prefac_ij4 = -pfij3
prefac_ij5 = -0.5*att_eng*dbij5; // prefac_ij5 = -pfij4
prefac_ji1 = -0.5*att_eng*dbji1; // prefac_ji1 = -pfji
prefac_ji2 = -0.5*att_eng*dbji2; // prefac_ji2 = -pfji1
prefac_ji3 = -0.5*att_eng*dbji3; // prefac_ji3 = -pfji2
prefac_ji4 = -0.5*att_eng*dbji4; // prefac_ji4 = -pfji3
prefac_ji5 = -0.5*att_eng*dbji5; // prefac_ji5 = -pfji4
// combines com6 & com7 below
if ( parami->rad_flag>0 || parami->tor_flag!=0 ) {
prefac_ij2-=pradx;
prefac_ji2-=prady;
}
// eng = attraction energy
if (eflag) eng = 1.0*bij*att_eng;
}
/* ---------------------------------------------------------------------- */
double PairComb3::comb_fc(double r, Param *param)
{
double r_inn = param->bigr - param->bigd;
double r_out = param->bigr + param->bigd;
if (r <= r_inn) return 1.0;
if (r >= r_out) return 0.0;
return 0.5*(1.0 + cos(MY_PI*(r-r_inn)/(r_out-r_inn)));
}
/* ---------------------------------------------------------------------- */
double PairComb3::comb_fc_d(double r, Param *param)
{
double r_inn = param->bigr - param->bigd;
double r_out = param->bigr + param->bigd;
if (r <= r_inn) return 0.0;
if (r >= r_out) return 0.0;
return -MY_PI2/(r_out-r_inn)*sin(MY_PI*(r-r_inn)/(r_out-r_inn));
}
/* ---------------------------------------------------------------------- */
double PairComb3::comb_fccc(double xcn)
{
double cut1 = ccutoff[0];
double cut2 = ccutoff[1];
if (xcn <= cut1) return 1.0;
if (xcn >= cut2) return 0.0;
return 0.5*(1.0 + cos(MY_PI*(xcn-cut1)/(cut2-cut1)));
}
/* ---------------------------------------------------------------------- */
double PairComb3::comb_fccc_d(double xcn)
{
double cut1 = ccutoff[0];
double cut2 = ccutoff[1];
if (xcn <= cut1) return 0.0;
if (xcn >= cut2) return 0.0;
return -MY_PI2/(cut2-cut1)*sin(MY_PI*(xcn-cut1)/(cut2-cut1));
}
/* ---------------------------------------------------------------------- */
double PairComb3::comb_fcch(double xcn)
{
double cut1 = ccutoff[2];
double cut2 = ccutoff[3];
if (xcn <= cut1) return 1.0;
if (xcn >= cut2) return 0.0;
return 0.5*(1.0 + cos(MY_PI*(xcn-cut1)/(cut2-cut1)));
}
/* ---------------------------------------------------------------------- */
double PairComb3::comb_fcch_d(double xcn)
{
double cut1 = ccutoff[2];
double cut2 = ccutoff[3];
if (xcn <= cut1) return 0.0;
if (xcn >= cut2) return 0.0;
return -MY_PI2/(cut2-cut1)*sin(MY_PI*(xcn-cut1)/(cut2-cut1));
}
/* ---------------------------------------------------------------------- */
double PairComb3::comb_fccch(double xcn)
{
double cut1 = ccutoff[4];
double cut2 = ccutoff[5];
if (xcn <= cut1) return 1.0;
if (xcn >= cut2) return 0.0;
return 0.5*(1.0 + cos(MY_PI*(xcn-cut1)/(cut2-cut1)));
}
/* ---------------------------------------------------------------------- */
double PairComb3::comb_fccch_d(double xcn)
{
double cut1 = ccutoff[4];
double cut2 = ccutoff[5];
if (xcn <= cut1) return 0.0;
if (xcn >= cut2) return 0.0;
return -MY_PI2/(cut2-cut1)*sin(MY_PI*(xcn-cut1)/(cut2-cut1));
}
/* ---------------------------------------------------------------------- */
double PairComb3::comb_fcsw(double rsq)
{
double r = sqrt(rsq);
if (r <= chicut1) return 1.0;
if (r >= chicut2) return 0.0;
return 0.5*(1.0 + cos(MY_PI*(r-chicut1)/(chicut2-chicut1)));
}
/* ---------------------------------------------------------------------- */
double PairComb3::self(Param *param, double qi)
{
double self_tmp, cmin, cmax, qmin, qmax;
double s1=param->chi, s2=param->dj, s3=param->dk, s4=param->dl;
self_tmp = 0.0;
qmin = param->qmin;
qmax = param->qmax;
cmin = cmax = 100.0;
self_tmp = qi*(s1+qi*(s2+qi*(s3+qi*s4)));
if (qi < qmin) self_tmp += cmin * pow((qi-qmin),4);
if (qi > qmax) self_tmp += cmax * pow((qi-qmax),4);
return self_tmp;
}
/* ---------------------------------------------------------------------- */
void PairComb3::comb_fa(double r, Param *parami, Param *paramj, double iq,
double jq, double &att_eng, double &att_force)
{
double Bsi;
double qi,qj,Di,Dj;
double AlfDiAlfDj, YYBn, YYBj;
double alfij1= parami->alpha1;
double alfij2= parami->alpha2;
double alfij3= parami->alpha3;
double pbij1= parami->bigB1;
double pbij2= parami->bigB2;
double pbij3= parami->bigB3;
if (r > parami->bigr + parami->bigd) Bsi = 0.0;
qi = iq; qj = jq;
Di = Dj = Bsi = 0.0;
Di = parami->DU + pow(fabs(parami->bD*(parami->QU-qi)),parami->nD);
Dj = paramj->DU + pow(fabs(paramj->bD*(paramj->QU-qj)),paramj->nD);
YYBn = (parami->aB-fabs(pow(parami->bB*(qi-parami->Qo),10)));
YYBj = (paramj->aB-fabs(pow(paramj->bB*(qj-paramj->Qo),10)));
if (YYBn*YYBj > 0.0 ) {
AlfDiAlfDj = exp(0.5*(parami->alfi*Di+paramj->alfi*Dj));
Bsi = (pbij1*exp(-alfij1*r)+pbij2*exp(-alfij2*r)+pbij3*exp(-alfij3*r))*
sqrt(YYBn*YYBj)*AlfDiAlfDj; // Bsi is cbj
att_eng = -Bsi * comb_fc(r,parami);
att_force = -(Bsi*comb_fc_d(r,parami)-comb_fc(r,parami)*sqrt(YYBn*YYBj)*
AlfDiAlfDj*(alfij1*pbij1*exp(-alfij1*r)+
alfij2*pbij2*exp(-alfij2*r)+alfij3*pbij3*exp(-alfij3*r)));
} else {
att_eng = 0.0;
att_force = 0.0;
}
}
/* ---------------------------------------------------------------------- */
void PairComb3::comb_bij_d(double zet, Param *param, double r, int i,
double &tbij, double &tbij1, double &tbij2,
double &tbij3, double &tbij4, double &tbij5, double xcn)
{
double pcorn,dpcorn,dxccij,dxchij,dxcoij;
double zeta = zet;
double zetang,tmp_tbij, pow_n;
pcorn = dpcorn = dxccij = dxchij = dxcoij = 0.0;
coord(param,r,i,pcorn,dpcorn,dxccij,dxchij,dxcoij,xcn); // coordination term
zetang=zeta;
pow_n=param->powern;
zeta = pow(zetang,pow_n)+pcorn;
tmp_tbij=pow_n*pow(zetang,(pow_n-1.0));
if ((1.0 + zeta) < 0.1 ){
zeta=0.1-1.0;
tbij = pow(1.0 + zeta, -0.5/pow_n);
tbij1=0.0;
}
else if (zeta > param->c1) {
tbij = pow(zeta,-0.5/pow_n);
tbij1 = -0.5/pow_n*pow(zeta,(-0.5/pow_n-1.0));
} else if (zeta > param->c2) {
tbij = pow(zeta,-0.5/pow_n)-0.5/pow_n*pow(zeta,(-0.5/pow_n-1.0));
tbij1 = -0.5/pow_n/zeta;
} else if (fabs(zeta) < param->c4) {
tbij = 1.0;
tbij1 = 0.0;
} else if (fabs(zeta) < param->c3) {
tbij = 1.0 - zeta/(2.0*pow_n);
tbij1 = -1/(2.0*pow_n);
} else {
tbij = pow(1.0 + zeta, -0.5/pow_n);
tbij1 = -0.5/pow_n * pow(1.0 + zeta,(-1.0-0.5/pow_n));
}
tbij2 = tbij1 * dpcorn;
tbij3 = tbij1 * dxccij;
tbij4 = tbij1 * dxchij;
tbij5 = tbij1 * dxcoij;
tbij1 = tbij1 * tmp_tbij;
}
/* ---------------------------------------------------------------------- */
void PairComb3::coord(Param *param, double r, int i,
double &pcorn, double &dpcorn, double &dxccij,
double &dxchij, double &dxcoij, double xcn)
{
int ixmin,iymin,izmin;
double xcntot,xcccn,xchcn,xcocn;
int tri_flag= param-> pcn_flag;
int jele_gp= param->jelementgp;
double pan = param->pcna;
double pbn = param->pcnb;
double pcn = param->pcnc;
double pdn = param->pcnd;
xcccn = xchcn = xcocn = 0.0;
xcccn = xcctmp[i];
xchcn = xchtmp[i];
xcocn = xcotmp[i];
xcntot = -comb_fc(r,param)*param->pcross + xcn;
pcorn = dpcorn = dxccij = dxchij = dxcoij = 0.0;
pcorn = 0.0; dpcorn = 0.0;
if(xcntot < 0.0) xcntot = 0.0;
if (tri_flag>0) {
if(jele_gp==1) xcccn = xcccn-comb_fc(r,param)*param->pcross;
if(jele_gp==2) xchcn = xchcn-comb_fc(r,param)*param->pcross;
if(jele_gp==3) xcocn = xcocn-comb_fc(r,param)*param->pcross;
if(xcccn < 0.0) xcccn = 0.0;
if(xchcn < 0.0) xchcn = 0.0;
if(xcocn < 0.0) xcocn = 0.0;
if(xcccn > maxx) xcccn = maxx;
if(xchcn > maxy) xchcn = maxy;
if(xcocn > maxz) xcocn = maxz;
double xcntritot=xcccn+xchcn+xcocn;
if(xcntritot > maxxcn[tri_flag-1]) {
pcorn = vmaxxcn[tri_flag-1]+(xcntot-maxxcn[tri_flag-1])*dvmaxxcn[tri_flag-1];
dxccij = dxchij = dxcoij = dvmaxxcn[tri_flag-1];
}
else {
ixmin=int(xcccn+1.0e-12);
iymin=int(xchcn+1.0e-12);
izmin=int(xcocn+1.0e-12);
if (fabs(float(ixmin)-xcccn)>1.0e-8 ||
fabs(float(iymin)-xchcn)>1.0e-8 ||
fabs(float(izmin)-xcocn)>1.0e-8) {
cntri_int(tri_flag,xcccn,xchcn,xcocn,ixmin,iymin,izmin,
pcorn,dxccij,dxchij,dxcoij,param);
}
else {
pcorn = pcn_grid[tri_flag-1][ixmin][iymin][izmin];
dxccij = pcn_gridx[tri_flag-1][ixmin][iymin][izmin];
dxchij = pcn_gridy[tri_flag-1][ixmin][iymin][izmin];
dxcoij = pcn_gridz[tri_flag-1][ixmin][iymin][izmin];
}
}
} else {
pcorn = pan*xcntot+pbn*exp(pcn*xcntot)+pdn;
dpcorn = pan+pbn*pcn*exp(pcn*xcntot);
}
}
/* ---------------------------------------------------------------------- */
void PairComb3::cntri_int(int tri_flag, double xval, double yval,
double zval, int ixmin, int iymin, int izmin, double &vval,
double &dvalx, double &dvaly, double &dvalz, Param *param)
{
double x;
vval = 0.0; dvalx = 0.0; dvaly = 0.0; dvalz = 0.0;
if(ixmin >= maxx-1) { ixmin=maxx-1; }
if(iymin >= maxy-1) { iymin=maxy-1; }
if(izmin >= maxz-1) { izmin=maxz-1; }
for (int j=0; j<64; j++) {
x = pcn_cubs[tri_flag-1][ixmin][iymin][izmin][j]
*pow(xval,iin3[j][0])*pow(yval,iin3[j][1])
*pow(zval,iin3[j][2]);
vval += x;
if(xval>1.0e-8) {dvalx += x*iin3[j][0]/xval;}
if(yval>1.0e-8) {dvaly += x*iin3[j][1]/yval;}
if(zval>1.0e-8) {dvalz += x*iin3[j][2]/zval;}
}
}
/* ---------------------------------------------------------------------- */
double PairComb3::comb_gijk(double costheta, Param *param, double nco_tmp)
{
double rmu1 = costheta;
double rmu2 = rmu1*rmu1;
double rmu3 = rmu2*rmu1;
double rmu4 = rmu3*rmu1;
double rmu5 = rmu4*rmu1;
double rmu6 = rmu5*rmu1;
double co6 = param->pcos6*rmu6;
double co5 = param->pcos5*rmu5;
double co4 = param->pcos4*rmu4;
double co3 = param->pcos3*rmu3;
double co2 = param->pcos2*rmu2;
double co1 = param->pcos1*rmu1;
double co0 = param->pcos0;
double pcross = param->pcross;
double gmu;
if (param->ang_flag==1) {
double qtheta, gmu1, gmu2, rrmu, astep;
int k;
qtheta = comb_fccc(nco_tmp);
astep = 2.0/ntab;
rrmu = (rmu1+1.0)/astep;
k = int(rrmu);
gmu1 = co6+co5+co4+co3+co2+co1+co0;
gmu2 = pang[k]+(pang[k+1]-pang[k])*(rrmu-k);
gmu = gmu2+qtheta*(gmu1-gmu2);
return gmu*pcross;
} else if (param->ang_flag==2){
double qtheta, gmu1, gmu2;
double ch6 = ch_a[6]*rmu6;
double ch5 = ch_a[5]*rmu5;
double ch4 = ch_a[4]*rmu4;
double ch3 = ch_a[3]*rmu3;
double ch2 = ch_a[2]*rmu2;
double ch1 = ch_a[1]*rmu1;
double ch0 = ch_a[0];
qtheta = comb_fccch(nco_tmp);
gmu1 = co6+co5+co4+co3+co2+co1+co0;
gmu2 = ch6+ch5+ch4+ch3+ch2+ch1+ch0;
gmu = gmu2+qtheta*(gmu1-gmu2);
return gmu*pcross;
} else {
gmu = co6+co5+co4+co3+co2+co1+co0;
return gmu*pcross;
}
}
/* ---------------------------------------------------------------------- */
void PairComb3::comb_gijk_d(double costheta, Param *param, double nco_tmp,
double &gijk_d, double &com3jk)
{
double rmu1 = costheta;
double rmu2 = rmu1*rmu1;
double rmu3 = rmu2*rmu1;
double rmu4 = rmu3*rmu1;
double rmu5 = rmu4*rmu1;
double rmu6 = rmu5*rmu1;
double co6 = param->pcos6; //*rmu5*6.0;
double co5 = param->pcos5; //*rmu4*5.0;
double co4 = param->pcos4; //*rmu3*4.0;
double co3 = param->pcos3; //*rmu2*3.0;
double co2 = param->pcos2; //*rmu1*2.0;
double co1 = param->pcos1;
double co0 = param->pcos0;
double pcross = param->pcross;
gijk_d = com3jk = 0.0;
if (param->ang_flag==1) {
double qtheta, dqtheta, gmu1, gmu2, dgmu1,dgmu2, rrmu, astep;
int k;
qtheta = comb_fccc(nco_tmp);
dqtheta = comb_fccc_d(nco_tmp);
astep = 2.0/ntab;
rrmu = (rmu1+1.0)/astep;
k = int(rrmu);
gmu1 =rmu6*co6+rmu5*co5+rmu4*co4
+rmu3*co3+rmu2*co2+rmu1*co1+co0;
dgmu1 =6.0*rmu5*co6+5.0*rmu4*co5+4.0*rmu3*co4
+3.0*rmu2*co3+2.0*rmu1*co2+co1;
gmu2 = pang[k]+(pang[k+1]-pang[k])*(rrmu-k);
dgmu2 = dpang[k]+(dpang[k+1]-dpang[k])*(rrmu-k);
gijk_d = pcross*(dgmu2+qtheta*(dgmu1-dgmu2));
com3jk = dqtheta * (gmu1-gmu2);
} else if(param->ang_flag==2) {
double qtheta, dqtheta, gmu1, gmu2, dgmu1,dgmu2;
double ch6 = ch_a[6];
double ch5 = ch_a[5];
double ch4 = ch_a[4];
double ch3 = ch_a[3];
double ch2 = ch_a[2];
double ch1 = ch_a[1];
double ch0 = ch_a[0];
qtheta = comb_fccch(nco_tmp);
dqtheta = comb_fccch_d(nco_tmp);
gmu1 =rmu6*co6+rmu5*co5+rmu4*co4
+rmu3*co3+rmu2*co2+rmu1*co1+co0;
dgmu1 =6.0*rmu5*co6+5.0*rmu4*co5+4.0*rmu3*co4
+3.0*rmu2*co3+2.0*rmu1*co2+co1;
gmu2 =rmu6*ch6+rmu5*ch5+rmu4*ch4
+rmu3*ch3+rmu2*ch2+rmu1*ch1+ch0;
dgmu2 =6.0*rmu5*ch6+5.0*rmu4*ch5+4.0*rmu3*ch4
+3.0*rmu2*ch3+2.0*rmu1*ch2+ch1;
gijk_d = pcross*(dgmu2+qtheta*(dgmu1-dgmu2));
com3jk = dqtheta * (gmu1-gmu2);
} else {
gijk_d = pcross*(6.0*rmu5*co6+5.0*rmu4*co5+4.0*rmu3*co4
+3.0*rmu2*co3+2.0*rmu1*co2+co1);
com3jk = 0.0;
}
}
/*------------------------------------------------------------------------- */
void PairComb3::attractive(Param *parami, Param *paramj , Param *paramk, double prefac_ij1,
double prefac_ij2, double prefac_ij3, double prefac_ij4,
double prefac_ij5, double rsqij, double rsqik, double *delrij,
double *delrik, double *fi, double *fj,double *fk, int i, double xcn)
{
double rij_hat[3],rik_hat[3];
double rij,rijinv,rik,rikinv;
rij = sqrt(rsqij);
rijinv = 1.0/rij;
vec3_scale(rijinv,delrij,rij_hat);
rik = sqrt(rsqik);
rikinv = 1.0/rik;
vec3_scale(rikinv,delrik,rik_hat);
comb_zetaterm_d(prefac_ij1, prefac_ij2, prefac_ij3, prefac_ij4, prefac_ij5,
rij_hat, rij,rik_hat, rik, fi, fj, fk, parami, paramj, paramk,xcn);
}
/* ---------------------------------------------------------------------- */
void PairComb3::comb_zetaterm_d(double prefac_ij1, double prefac_ij2,
double prefac_ij3, double prefac_ij4, double prefac_ij5,
double *rij_hat, double rij, double *rik_hat, double rik, double *dri,
double *drj, double *drk, Param *parami, Param *paramj, Param *paramk, double xcn)
{
double gijk,gijk_d,ex_delr,ex_delr_d,fc_k,cos_theta,tmp,rlm3;
double dcosdri[3],dcosdrj[3],dcosdrk[3],dfc_i,dfc_k;
double com6, com3j, com3k, com3jk;
int mint = int(parami->powermint);
double pcrossi = parami->pcross;
double pcrossj = paramj->pcross;
double pcrossk = paramk->pcross;
int icontrol = parami->pcn_flag;
dfc_i = comb_fc_d(rij,parami);
fc_k = comb_fc(rik,paramk);
dfc_k = comb_fc_d(rik,paramk);
rlm3 = parami->beta;
tmp = pow(rlm3*(rij-rik),mint);
if (tmp > 69.0776) ex_delr = 1.e30;
else if (tmp < -69.0776) ex_delr = 0.0;
else ex_delr = exp(tmp);
ex_delr *= pcrossi;
cos_theta = vec3_dot(rij_hat,rik_hat);
gijk = comb_gijk(cos_theta,parami,xcn);
comb_gijk_d(cos_theta,parami,xcn,gijk_d,com3jk);
costheta_d(rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk);
// com6 & com7
if(icontrol > 0){
if(parami->kelementgp==1) {com6 = prefac_ij3*pcrossk*dfc_k;}
if(parami->kelementgp==2) {com6 = prefac_ij4*pcrossk*dfc_k;}
if(parami->kelementgp==3) {com6 = prefac_ij5*pcrossk*dfc_k;}
if(parami->rad_flag>=1 || parami->tor_flag!=0)
{com6+=prefac_ij2*pcrossk*dfc_k;}
} else {
com6 = prefac_ij2*pcrossi*dfc_k;
}
if (parami->ang_flag==1 || parami->ang_flag==2) {
com3j = com3jk*ex_delr*pcrossk*pcrossj*fc_k*dfc_i;
com3k = com3jk*ex_delr*pcrossk*pcrossk*fc_k*dfc_k;
} else {
com3j = 0.0;
com3k = 0.0;
}
ex_delr_d = mint*pow(rlm3,mint)*pow((rij-rik),(mint-1))*ex_delr; // com3
vec3_scale(-dfc_k*gijk*ex_delr,rik_hat,dri); // com1
vec3_scaleadd(fc_k*gijk_d*ex_delr,dcosdri,dri,dri); // com2
vec3_scaleadd(fc_k*gijk*ex_delr_d,rik_hat,dri,dri); // com3 cont'd
vec3_scaleadd(-fc_k*gijk*ex_delr_d,rij_hat,dri,dri); // com3 sums j
vec3_scaleadd(-com3k,rik_hat,dri,dri); // com3k
vec3_scaleadd(-com3j,rij_hat,dri,dri); // com3j
vec3_scale(prefac_ij1,dri,dri);
vec3_scaleadd(-com6,rik_hat,dri,dri); // com6
vec3_scale(fc_k*gijk_d*ex_delr,dcosdrj,drj); // com2
vec3_scaleadd(fc_k*gijk*ex_delr_d,rij_hat,drj,drj); // com3 cont'd
vec3_scaleadd(com3j,rij_hat,drj,drj); // com3j
vec3_scale(prefac_ij1,drj,drj);
vec3_scale(dfc_k*gijk*ex_delr,rik_hat,drk); // com1
vec3_scaleadd(fc_k*gijk_d*ex_delr,dcosdrk,drk,drk); // com2
vec3_scaleadd(-fc_k*gijk*ex_delr_d,rik_hat,drk,drk); // com3 cont'd
vec3_scaleadd(com3k,rik_hat,drk,drk); // com3k
vec3_scale(prefac_ij1,drk,drk);
vec3_scaleadd(com6,rik_hat,drk,drk); // com6
}
/* ---------------------------------------------------------------------- */
void PairComb3::costheta_d(double *rij_hat, double rij, double *rik_hat,
double rik, double *dri, double *drj, double *drk)
{
double cos_theta = vec3_dot(rij_hat,rik_hat);
vec3_scaleadd(-cos_theta,rij_hat,rik_hat,drj);
vec3_scale(1.0/rij,drj,drj);
vec3_scaleadd(-cos_theta,rik_hat,rij_hat,drk);
vec3_scale(1.0/rik,drk,drk);
vec3_add(drj,drk,dri);
vec3_scale(-1.0,dri,dri);
}
/* ---------------------------------------------------------------------- */
void PairComb3::tables()
{
int i,j,k,m, nntypes, ncoul,nnbuf, ncoul_lim, inty, itype, jtype;
int iparam_i, iparam_ij, iparam_ji;
double r,dra,drin,drbuf,rc,z,zr,zrc,ea,eb,ea3,eb3,alf;
double exp2er,exp2ersh,fafash,dfafash,F1,dF1,ddF1,E1,E2,E3,E4;
double exp2ear,exp2ebr,exp2earsh,exp2ebrsh,fafbsh,dfafbsh;
double afbshift, dafbshift, exp2ershift;
int n = nelements;
dra = 0.001;
drin = 0.100;
drbuf = 0.100;
nnbuf = int(drbuf/dra) +1;
rc = cutmax;
alf = 0.20;
nmax = atom->nmax;
nntypes = int((n+1)*n/2.0)+1;
ncoul = int((rc-drin)/dra)+ nnbuf;
ncoul_lim = int(ncoul * 1.20);
// allocate arrays
memory->create(intype,n,n,"pair:intype");
memory->create(erpaw,ncoul_lim,3,"pair:erpaw");
memory->create(fafb,ncoul_lim,nntypes,"pair:fafb");
memory->create(dfafb,ncoul_lim,nntypes,"pair:dfafb");
memory->create(ddfafb,ncoul_lim,nntypes,"pair:ddfafb");
memory->create(phin,ncoul_lim,nntypes,"pair:phin");
memory->create(dphin,ncoul_lim,nntypes,"pair:dphin");
memory->create(afb,ncoul_lim,nntypes,"pair:afb");
memory->create(dafb,ncoul_lim,nntypes,"pair:dafb");
memory->create(vvdw,ncoul,nntypes,"pair:vvdw");
memory->create(vdvdw,ncoul,nntypes,"pair:vdvdw");
memory->create(dpl,nmax,3,"pair:dpl");
memory->create(bbij,nmax,MAXNEIGH,"pair:bbij");
memory->create(xcctmp,nmax,"pair:xcctmp");
memory->create(xchtmp,nmax,"pair:xchtmp");
memory->create(xcotmp,nmax,"pair:xcotmp");
memory->create(NCo,nmax,"pair:NCo");
memory->create(sht_num,nmax,"pair:sht_num");
sht_first = (int **) memory->smalloc(nmax*sizeof(int *),
"pair:sht_first");
// set interaction number: 0-0=0, 1-1=1, 0-1=1-0=2
m = 0; k = n;
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
if (j == i) {
intype[i][j] = m;
m += 1;
} else if (j != i && j > i) {
intype[i][j] = k;
k += 1;
} else if (j != i && j < i) {
intype[i][j] = intype[j][i];
}
}
}
// default arrays to zero
for (i = 0; i < ncoul; i ++) {
for (j = 0; j < nntypes; j ++) {
fafb[i][j] = 0.0;
dfafb[i][j] = 0.0;
ddfafb[i][j] = 0.0;
phin[i][j] = 0.0;
dphin[i][j] = 0.0;
afb[i][j] = 0.0;
dafb[i][j] = 0.0;
}
}
// direct 1/r energy with Slater 1S orbital overlap
for (i = 0; i < n; i++) {
if (map[i+1] < 0) continue;
r = drin - dra;
itype = map[i+1];
iparam_i = elem2param[itype][itype][itype];
z = params[iparam_i].esm;
exp2ershift = exp(-2.0*z*rc);
afbshift = -exp2ershift*(z+1.0/rc);
dafbshift = exp2ershift*(2.0*z*z+2.0*z/rc+1.0/(rc*rc));
if (comm->me == 0 && screen)
fprintf(screen," element[%d] = %-2s, z = %g\n",i+1,elements[map[i+1]],z);
for (j = 0; j < ncoul; j++) {
exp2er = exp(-2.0 * z * r);
phin[j][i] = 1.0 - exp2er * (1.0 + 2.0 * z * r * (1.0 + z * r));
dphin[j][i] = (4.0 * exp2er * z * z * z * r * r);
afb[j][i] = -exp2er*(z+1.0/r)-afbshift-(r-rc)*dafbshift;
dafb[j][i] = -(exp2er*(2.0*z*z+2.0*z/r+1.0/(r*r))-dafbshift);
r += dra;
}
}
for (i = 0; i < n; i ++) {
if (map[i+1] < 0) continue;
for (j = 0; j < n; j ++) {
if (map[j+1] < 0) continue;
r = drin - dra;
if (j == i) {
itype = map[i+1];
inty = intype[itype][itype];
iparam_i = elem2param[itype][itype][itype];
z = params[iparam_i].esm;
zrc = z * rc;
exp2ersh = exp(-2.0 * zrc);
fafash = -exp2ersh * (1.0 / rc +
z * (11.0/8.0 + 3.0/4.0*zrc + zrc*zrc/6.0));
dfafash = exp2ersh * (1.0/(rc*rc) + 2.0*z/rc +
z*z*(2.0 + 7.0/6.0*zrc + zrc*zrc/3.0));
for (k = 0; k < ncoul; k ++) {
zr = z * r;
exp2er = exp(-2.0*zr);
F1 = -exp2er * (1.0 / r +
z * (11.0/8.0 + 3.0/4.0*zr + zr*zr/6.0));
dF1 = exp2er * (1.0/(r*r) + 2.0*z/r +
z*z*(2.0 + 7.0/6.0*zr + zr*zr/3.0));
ddF1 = -exp2er * (2.0/(r*r*r) + 4.0*z/(r*r) + 4.0*z*z/r +
z*z*z/3.0*(17.0/2.0 + 5.0*zr + 2.0*zr*zr));
fafb[k][inty] = F1-fafash-(r-rc)*dfafash;
dfafb[k][inty] = -(dF1 - dfafash);
ddfafb[k][inty] = ddF1;
r += dra;
}
} else if (j != i) {
itype = map[i+1];
jtype = map[j+1];
inty = intype[itype][jtype];
iparam_ij = elem2param[itype][jtype][jtype];
ea = params[iparam_ij].esm;
ea3 = ea*ea*ea;
iparam_ji = elem2param[jtype][itype][itype];
eb = params[iparam_ji].esm;
eb3 = eb*eb*eb;
E1 = ea*eb3*eb/((ea+eb)*(ea+eb)*(ea-eb)*(ea-eb));
E2 = eb*ea3*ea/((ea+eb)*(ea+eb)*(eb-ea)*(eb-ea));
E3 = (3.0*ea*ea*eb3*eb-eb3*eb3) /
((ea+eb)*(ea+eb)*(ea+eb)*(ea-eb)*(ea-eb)*(ea-eb));
E4 = (3.0*eb*eb*ea3*ea-ea3*ea3) /
((ea+eb)*(ea+eb)*(ea+eb)*(eb-ea)*(eb-ea)*(eb-ea));
exp2earsh = exp(-2.0*ea*rc);
exp2ebrsh = exp(-2.0*eb*rc);
fafbsh = -exp2earsh*(E1 + E3/rc)-exp2ebrsh*(E2 + E4/rc);
dfafbsh =
exp2earsh*(2.0*ea*(E1+E3/rc)+E3/(rc*rc)) +
exp2ebrsh*(2.0*eb*(E2+E4/rc)+E4/(rc*rc));
for (k = 0; k < ncoul; k ++) {
exp2ear = exp(-2.0*ea*r);
exp2ebr = exp(-2.0*eb*r);
fafb[k][inty] =
- exp2ear*(E1+E3/r) - exp2ebr*(E2+E4/r)
- fafbsh - (r-rc) * dfafbsh;
dfafb[k][inty] = -(exp2ear*(2.0*ea*(E1+E3/r) + E3/(r*r))
+ exp2ebr*(2.0*eb*(E2+E4/r) + E4/(r*r))- dfafbsh);
ddfafb[k][inty] = -exp2ear*(4.0*ea*ea*(E1+E3/r)+4.0*ea*E3/(r*r)
+2.0*E3/(r*r*r))
-exp2ebr*(4.0*eb*eb*(E2+E4/r)+4.0*eb*E4/(r*r)
+2.0*E4/(r*r*r));
r += dra;
}
}
}
}
for (i = 0; i < ncoul_lim; i ++) {
r = dra * (i-1) + drin;
erpaw[i][0] = erfc(r*alf);
erpaw[i][1] = exp(-r*r*alf*alf);
}
// end wolf summation
// van der Waals
int ii,jj;
double **rvdw, *cc2, *cc3, *vrc, *rrc;
double r6, r7, r12, r13, rf6, rf12, drf7, drf13;
double drcc, temp6, temp7, temp12, temp13;
double vsigt, vepst, vdwt, dvdwt;
vrc = new double[13];
rrc = new double[13];
cc2 = new double[nntypes];
cc3 = new double[nntypes];
memory->create(rvdw,2,nntypes,"pair:rvdw");
vrc[0] = rc;
for (i=1; i<13; i++) {
vrc[i] = vrc[i-1] * vrc[0];
}
// generate spline coefficients for CC, CH, HH vdw
for (ii = 0; ii < n; ii ++) {
for (jj = ii; jj < n; jj ++) {
itype = ii;
jtype = jj;
inty = intype[itype][jtype];
iparam_ij = elem2param[itype][jtype][jtype];
// parameter check: eps > 0
if(params[iparam_ij].vdwflag > 0) {
if(params[iparam_ij].vdwflag==1){
rvdw[0][inty] = params[iparam_ij].bigr + params[iparam_ij].bigd;
}
else {
rvdw[0][inty] = params[iparam_ij].bigr - params[iparam_ij].bigd;
}
rvdw[1][inty] = params[iparam_ij].vsig * 0.950;
// radius check: outer radius vs. sigma
if( rvdw[0][inty] > rvdw[1][inty] )
error->all(FLERR,"Error in vdw spline: inner radius > outer radius");
rrc[0] = rvdw[1][inty];
for (i=1; i<13; i++)
rrc[i] = rrc[i-1] * rrc[0];
drcc = rrc[0] - rvdw[0][inty];
temp6 = 1.0/rrc[5]-1.0/vrc[5]+6.0*(rrc[0]-vrc[0])/vrc[6];
temp7 = 6.0*(1.0/vrc[6]-1.0/rrc[6]);
temp12 = 1.0/rrc[11]-1.0/vrc[11]+(rrc[0]-vrc[0])*12.0/vrc[12];
temp13 = 12.0*(1.0/vrc[12]-1.0/rrc[12]);
vsigt = params[iparam_ij].vsig;
vepst = params[iparam_ij].veps;
vsigt = vsigt*vsigt*vsigt*vsigt*vsigt*vsigt;
vdwt = vepst*(vsigt*vsigt*temp12-vsigt*temp6);
dvdwt = vepst*(vsigt*vsigt*temp13-vsigt*temp7);
cc2[inty] = (3.0/drcc*vdwt-dvdwt)/drcc;
cc3[inty] = (vdwt/(drcc*drcc)-cc2[inty] )/drcc;
}
}
}
// generate vdw look-up table
for (ii = 0; ii < n; ii ++) {
for (jj = ii; jj < n; jj ++) {
itype = ii;
jtype = jj;
inty = intype[itype][jtype];
iparam_ij = elem2param[itype][jtype][jtype];
r = drin;
for (k = 0; k < ncoul; k ++) {
r6 = r*r*r*r*r*r;
r7 = r6 * r;
rf6 = 1.0/r6-1.0/vrc[5]+(r-vrc[0])*6.0/vrc[6];
drf7 = 6.0*(1.0/vrc[6]-1.0/r7);
vsigt = params[iparam_ij].vsig;
vepst = params[iparam_ij].veps;
vsigt = vsigt*vsigt*vsigt*vsigt*vsigt*vsigt;
if(params[iparam_ij].vdwflag>0) {
if(r <= rvdw[0][inty]) {
vvdw[k][inty] = 0.0;
vdvdw[k][inty] = 0.0;
}
else if ( r > rvdw[0][inty] && r <= rvdw[1][inty]) {
drcc = r-rvdw[0][inty];
vvdw[k][inty] = drcc*drcc*(drcc*cc3[inty]+cc2[inty]);
vdvdw[k][inty] = drcc*(3.0*drcc*cc3[inty]+2.0*cc2[inty]);
} else {
r12 = r6*r6;
r13 = r6*r7;
rf12 = 1.0/r12-1.0/vrc[11]+(r-vrc[0])*12.0/vrc[12];
drf13= 12.0*(1.0/vrc[12]-1.0/r13);
vvdw[k][inty] = vepst*(vsigt*vsigt*rf12-vsigt*rf6);
vdvdw[k][inty] = vepst*(vsigt*vsigt*drf13-vsigt*drf7);
}
} else {
vvdw[k][inty]=0.0;
vdvdw[k][inty]=0.0;
}
r += dra;
}
}
}
delete [] vrc;
delete [] rrc;
delete [] cc2;
delete [] cc3;
memory->destroy(rvdw);
}
/* ---------------------------------------------------------------------- */
void PairComb3::potal_calc(double &calc1, double &calc2, double &calc3)
{
double alf,rcoul,esucon;
int m;
rcoul = 0.0;
for (m = 0; m < nparams; m++)
if (params[m].lcut > rcoul) rcoul = params[m].lcut;
alf = 0.20;
esucon = force->qqr2e;
calc2 = (erfc(rcoul*alf)/rcoul/rcoul+2.0*alf/MY_PIS*
exp(-alf*alf*rcoul*rcoul)/rcoul)*esucon/rcoul;
calc3 = (erfc(rcoul*alf)/rcoul)*esucon;
calc1 = -(alf/MY_PIS*esucon+calc3*0.5);
}
/* ---------------------------------------------------------------------- */
void PairComb3::tri_point(double rsq, int &mr1, int &mr2,
int &mr3, double &sr1, double &sr2, double &sr3)
{
double r, rin, dr, dd, rr1, rridr, rridr2;
rin = 0.1000; dr = 0.0010;
r = sqrt(rsq);
if (r < rin + 2.0*dr) r = rin + 2.0*dr;
if (r > cutmax - 2.0*dr) r = cutmax - 2.0*dr;
rridr = (r-rin)/dr;
mr1 = int(rridr) ;
dd = rridr - float(mr1);
if (dd > 0.5) mr1 += 1;
rr1 = float(mr1)*dr;
rridr = (r - rin - rr1)/dr;
rridr2 = rridr * rridr;
sr1 = (rridr2 - rridr) * 0.50;
sr2 = 1.0 - rridr2;
sr3 = (rridr2 + rridr) * 0.50;
mr2 = mr1 + 1;
mr3 = mr1 + 2;
}
/* ---------------------------------------------------------------------- */
void PairComb3::vdwaals(int inty, int mr1, int mr2, int mr3, double rsq,
double sr1, double sr2, double sr3,
double &eng, double &fforce)
{
double r = sqrt(rsq);
eng = 1.0*(sr1*vvdw[mr1-1][inty]+sr2*vvdw[mr2-1][inty]+sr3*vvdw[mr3-1][inty]);
fforce = -1.0/r*(sr1*vdvdw[mr1-1][inty]+sr2*vdvdw[mr2-1][inty]+sr3*vdvdw[mr3-1][inty]);
}
/* ---------------------------------------------------------------------- */
void PairComb3::direct(Param *parami, Param *paramj, int mr1,
int mr2, int mr3, double rsq, double sr1, double sr2, double sr3,
double iq, double jq, double fac11, double fac11e,
double &pot_tmp, double &for_tmp, int i, int j)
{
double r,erfcc,fafbnl,potij,esucon;
double r3,erfcd,dfafbnl,smf2,dvdrr,alf,alfdpi;
double afbn,afbj,sme1n,sme1j,sme1,sme2,dafbn, dafbj,smf1n,smf1j;
double curli = parami->curl;
double curlj = paramj->curl;
int inti = parami->ielement;
int intj = paramj->ielement;
int inty = intype[inti][intj];
double curlij0 = parami->curl0;
double curlji0 = paramj->curl0;
double curlij1,curlji1,dcurlij,dcurlji;
double fcp1j,xcoij,xcoji;
int icurl, jcurl;
int ielegp = parami->ielementgp;
int jelegp = paramj->ielementgp;
r = sqrt(rsq);
r3 = r * rsq;
alf = 0.20;
alfdpi = 2.0*alf/MY_PIS;
esucon = force->qqr2e;
pot_tmp = for_tmp = 0.0;
icurl=jcurl=0;
if(ielegp==2 && curli>curlij0) {
icurl=1;
curlij1=curli;
}
if(jelegp==2 && curlj>curlji0) {
jcurl=1;
curlji1=curlj;
}
if(icurl==1 || jcurl ==1) {
xcoij = xcotmp[i];
xcoji = xcotmp[j];
fcp1j = comb_fc_d(r,parami);
if(icurl==1) {
curli=curlij1+(curlij0-curlij1)*comb_fc_curl(xcoij,parami);
dcurlij=fcp1j*(curlij0-curlij1)*comb_fc_curl_d(xcoij,parami);
}
if(jcurl==1) {
curlj=curlji1+(curlji0-curlji1)*comb_fc_curl(xcoji,paramj);
dcurlji=fcp1j*(curlji0-curlji1)*comb_fc_curl_d(xcoji,paramj);
}
}
erfcc = sr1*erpaw[mr1][0] + sr2*erpaw[mr2][0] + sr3*erpaw[mr3][0];
afbn = sr1*afb[mr1][inti] + sr2*afb[mr2][inti] + sr3*afb[mr3][inti];
afbj = sr1*afb[mr1][intj] + sr2*afb[mr2][intj] + sr3*afb[mr3][intj];
fafbnl= sr1*fafb[mr1][inty] + sr2*fafb[mr2][inty] + sr3*fafb[mr3][inty];
potij = (erfcc/r * esucon - fac11e);
sme1n = iq*curlj*(afbn-fafbnl)*esucon;
sme1j = jq*curli*(afbj-fafbnl)*esucon;
sme1 = sme1n + sme1j;
sme2 = (potij + fafbnl * esucon) * iq * jq;
pot_tmp = 1.0 * (sme1+sme2);
// 1/r force (wrt r)
erfcd = sr1*erpaw[mr1][1] + sr2*erpaw[mr2][1] + sr3*erpaw[mr3][1];
dafbn = sr1*dafb[mr1][inti] + sr2*dafb[mr2][inti] + sr3*dafb[mr3][inti];
dafbj = sr1*dafb[mr1][intj] + sr2*dafb[mr2][intj] + sr3*dafb[mr3][intj];
dfafbnl= sr1*dfafb[mr1][inty] + sr2*dfafb[mr2][inty] + sr3*dfafb[mr3][inty];
dvdrr = (erfcc/r3+alfdpi*erfcd/rsq)*esucon-fac11;
smf1n = iq * curlj * (dafbn-dfafbnl)*esucon/r;
smf1j = jq * curli * (dafbj-dfafbnl)*esucon/r;
if(jcurl==1 && ielegp == 3 && dcurlji != 0.0){
smf1n += dcurlji*iq*(afbn-fafbnl)*esucon/r;
}
if(icurl==1 && jelegp == 3 && dcurlij != 0.0){
smf1j += dcurlij*jq*(afbj-fafbnl)*esucon/r;
}
smf2 = dvdrr + dfafbnl * esucon/r;
for_tmp = 1.0 * iq * jq * smf2 + smf1n + smf1j;
}
/* ---------------------------------------------------------------------- */
void PairComb3::field(Param *parami, Param *paramj, double rsq, double iq,
double jq, double &eng_tmp,double &for_tmp)
{
double r,r3,r4,r5,rc,rc2,rc3,rc4,rc5;
double cmi1,cmi2,cmj1,cmj2,pcmi1,pcmi2;
double rf3i,rcf3i,rf5i,rcf5i;
double drf3i,drcf3i,drf5i,drcf5i;
double rf3,rf5,drf4,drf6;
double smpn,smpl,rfx1,rfx2;
r = sqrt(rsq);
r3 = r * r * r;
r4 = r3 * r;
r5 = r4 * r;
rc = parami->lcut;
rc2 = rc * rc;
rc3 = rc*rc*rc;
rc4 = rc3 * rc;
rc5 = rc4 * rc;
cmi1 = parami->cmn1;
cmi2 = parami->cmn2;
cmj1 = paramj->cmn1;
cmj2 = paramj->cmn2;
pcmi1 = parami->pcmn1;
pcmi2 = parami->pcmn2;
rf3i = r3/(pow(r3,2)+pow(pcmi1,3));
rcf3i = rc3/(pow(rc3,2)+pow(pcmi1,3));
rf5i = r5/(pow(r5,2)+pow(pcmi2,5));
rcf5i = rc5/(pow(rc5,2)+pow(pcmi2,5));
drf3i = 3/r*rf3i-6*rsq*rf3i*rf3i;
drcf3i = 3/rc*rcf3i-6*rc2*rcf3i*rcf3i;
drf5i = 5/r*rf5i-10*r4*rf5i*rf5i;
drcf5i = 5/rc*rcf5i-10*rc4*rcf5i*rcf5i;
rf3 = rf3i-rcf3i-(r-rc)*drcf3i;
rf5 = rf5i-rcf5i-(r-rc)*drcf5i;
drf4 = drf3i - drcf3i;
drf6 = drf5i - drcf5i;
// field correction energy
smpn = jq*(cmi1*rf3+jq*cmi2*rf5);
smpl = iq*(cmj1*rf3+iq*cmj2*rf5);
eng_tmp = 1.0 * (smpn + smpl);
// field correction force
rfx1 = jq*(cmi1*drf4+jq*cmi2*drf6)/r;
rfx2 = iq*(cmj1*drf4+iq*cmj2*drf6)/r;
for_tmp -= 1.0 * (rfx1 + rfx2);
}
/* ---------------------------------------------------------------------- */
double PairComb3::rad_init(double rsq2,Param *param,int i,
double &radtot, double cnconj)
{
double r, fc1k, radcut;
r = sqrt(rsq2);
fc1k = comb_fc(r,param);
radtot = -fc1k * param->pcross + cnconj;
radcut = comb_fcch(radtot);
return fc1k * param->pcross * radcut;
}
/* ---------------------------------------------------------------------- */
void PairComb3::rad_calc(double r, Param *parami, Param *paramj,
double kconjug, double lconjug, int i, int j, double xcn, double ycn)
{
int ixmin, iymin, izmin;
int radindx;
double xrad, yrad, zcon, vrad, pradx, prady, pradz;
vrad = pradx = prady = pradz = 0.0;
xrad = -comb_fc(r,parami)*parami->pcross + xcn;
yrad = -comb_fc(r,paramj)*paramj->pcross + ycn;
zcon = 1.0 + pow(kconjug,2) + pow(lconjug,2);
if(xrad < 0.0) xrad = 0.0;
if(yrad < 0.0) yrad = 0.0;
if(zcon < 1.0) zcon = 1.0;
if(xrad > maxxc) xrad = maxxc;
if(yrad > maxyc) yrad = maxyc;
if(zcon > maxconj) zcon = maxconj;
ixmin = int(xrad+1.0e-12);
iymin = int(yrad+1.0e-12);
izmin = int(zcon+1.0e-12);
radindx=parami->rad_flag-1;
if (fabs(float(ixmin)-xrad)>1.0e-8 ||
fabs(float(iymin)-yrad)>1.0e-8 ||
fabs(float(izmin)-zcon)>1.0e-8) {
rad_int(radindx,xrad,yrad,zcon,ixmin,iymin,izmin,
vrad,pradx,prady,pradz);
} else {
vrad = rad_grid[radindx][ixmin][iymin][izmin-1];
pradx = rad_gridx[radindx][ixmin][iymin][izmin-1];
prady = rad_gridy[radindx][ixmin][iymin][izmin-1];
pradz = rad_gridz[radindx][ixmin][iymin][izmin-1];
}
brad[0] = vrad;
brad[1] = pradx;
brad[2] = prady;
brad[3] = pradz;
}
/* ---------------------------------------------------------------------- */
void PairComb3::rad_int(int radindx,double xrad, double yrad, double zcon, int l,
int m, int n, double &vrad, double &pradx, double &prady,
double &pradz)
{
int j;
double x;
vrad = pradx = prady = pradz = 0.0;
if(l >= maxxc-1) { l=maxxc-1;}
if(m >= maxyc-1) { m=maxyc-1; }
if(n >= maxconj-1) { n=maxconj-1;}
for (j=0; j<64; j++) {
x = rad_spl[radindx][l][m][n-1][j] * pow(xrad,iin3[j][0])
* pow(yrad,iin3[j][1]) * pow(zcon,iin3[j][2]);
vrad += x;
if(xrad > 1.0e-8) pradx += x*iin3[j][0]/xrad;
if(yrad > 1.0e-8) prady += x*iin3[j][1]/yrad;
if(zcon > 1.0e-8) pradz += x*iin3[j][2]/zcon;
}
}
/* ---------------------------------------------------------------------- */
void PairComb3::rad_forceik(Param *paramk, double rsq2, double *delrk,
double conjug, double radtot)
{
int nm;
double rik, fc1k, fcp1k;
double pradk, ffkk2, fktmp[3];
double radcut = comb_fcch(radtot);
double dradcut = comb_fcch_d(radtot);
for (nm=0; nm<3; nm++) {
fi_rad[nm] = fk_rad[nm] = 0.0;
}
radtmp =0.0;
rik = sqrt(rsq2);
fc1k = comb_fc(rik, paramk);
fcp1k = comb_fc_d(rik,paramk);
pradk = brad[3]*fcp1k*radcut*paramk->pcross*2.0*conjug;
radtmp= brad[3]*fc1k*dradcut*paramk->pcross*2.0*conjug;
ffkk2 = -pradk/rik;
for (nm=0; nm<3; nm++) {
fktmp[nm] = - ffkk2 * delrk[nm];
}
for (nm=0; nm<3; nm++) {
fi_rad[nm] = fktmp[nm];
fk_rad[nm] = -fktmp[nm];
}
}
/* ---------------------------------------------------------------------- */
void PairComb3::rad_force(Param *paramm, double rsq3,
double *delrm, double dpradk)
{
int nm;
double rkm, fcp1m;
double comkm, ffmm2, fkm[3];
for (nm=0; nm<3; nm++) {
fj_rad[nm] = fk_rad[nm] = 0.0;
fkm[nm]=0.0;
}
rkm = sqrt(rsq3);
fcp1m = comb_fc_d(rkm, paramm);
comkm = dpradk * fcp1m * paramm->pcross;
ffmm2 = -comkm/rkm;
for (nm=0; nm<3; nm++) {
fkm[nm] = -ffmm2 * delrm[nm];
}
for (nm=0; nm<3; nm++) {
fj_rad[nm] = fkm[nm];
fk_rad[nm] = -fkm[nm];
}
}
/* ---------------------------------------------------------------------- */
double PairComb3::bbtor1(int torindx, Param *paramk, Param *paraml,
double rsq1, double rsq2, double rsq3, double *delrj,
double *delrk, double *delrl, double srmu)
{
double rmul, rij, rik, rjl;
rij = sqrt(rsq1);
rik = sqrt(rsq2);
rjl = sqrt(rsq3);
vec3_scale(-1.0,delrl,delrl);
rmul = vec3_dot(delrj,delrl)/(rij*rjl);
vec3_scale(-1.0,delrl,delrl);
rmul = sqrt(1.0-rmul*rmul);
if(rmul > 0.1 ) {
double fc1k, fc1l, TT1, TT2, rmut, btt, tork[3], torl[3];
fc1k = comb_fc(rik,paramk);
fc1l = comb_fc(rjl,paraml);
TT1 = rik*rjl*rij*rij*srmu*rmul;
tork[0] = delrk[1]*delrj[2] - delrk[2]*delrj[1];
torl[0] = delrj[1]*delrl[2] - delrj[2]*delrl[1];
tork[1] = delrk[2]*delrj[0] - delrk[0]*delrj[2];
torl[1] = delrj[2]*delrl[0] - delrj[0]*delrl[2];
tork[2] = delrk[0]*delrj[1] - delrk[1]*delrj[0];
torl[2] = delrj[0]*delrl[1] - delrj[1]*delrl[0];
TT2 = vec3_dot(tork,torl);
rmut = pow((TT2/TT1),2);
if(torindx>=1) {
btt = 1.0 - rmut;
return btt * fc1k * fc1l;
}
else {
btt=paramk->ptork1-TT2/TT1;
btt=paramk->ptork2*pow(btt,2);
return btt * fc1k * fc1l;
}
} else {
return 0.0;
}
}
/* ---------------------------------------------------------------------- */
void PairComb3::tor_calc(double r, Param *parami, Param *paramj,
double kconjug, double lconjug, int i, int j, double xcn, double ycn)
{
int ixmin, iymin, izmin;
double vtor, dtorx, dtory, dtorz;
double xtor, ytor, zcon;
int torindx;
vtor = dtorx = dtory = dtorz = 0.0;
torindx=parami->tor_flag;
if(torindx<0){
vtor=1.0;
dtorx=0.0;
dtory=0.0;
dtorz=0.0;
} else {
xtor = -comb_fc(r, parami) * parami->pcross + xcn;
ytor = -comb_fc(r, paramj) * paramj->pcross + ycn;
zcon = 1.0 + pow(kconjug,2) + pow(lconjug,2);
if (xtor < 0.0) xtor = 0.0;
if (ytor < 0.0) ytor = 0.0;
if (zcon < 1.0) zcon = 1.0;
if (xtor > maxxc) xtor = maxxc;
if (ytor > maxyc) ytor = maxyc;
if (zcon > maxconj) zcon = maxconj;
ixmin = int(xtor+1.0e-12);
iymin = int(ytor+1.0e-12);
izmin = int(zcon+1.0e-12);
torindx=torindx-1;
if (fabs(float(ixmin)-xtor)>1.0e-8 ||
fabs(float(iymin)-ytor)>1.0e-8 ||
fabs(float(izmin)-zcon)>1.0e-8) {
tor_int(torindx,xtor,ytor,zcon,ixmin,iymin,izmin,
vtor,dtorx,dtory,dtorz);
} else {
vtor = tor_grid[torindx][ixmin][iymin][izmin-1];
dtorx = tor_gridx[torindx][ixmin][iymin][izmin-1];
dtory = tor_gridy[torindx][ixmin][iymin][izmin-1];
dtorz = tor_gridz[torindx][ixmin][iymin][izmin-1];
}
}
btor[0] = vtor;
btor[1] = dtorx;
btor[2] = dtory;
btor[3] = dtorz;
}
/* ---------------------------------------------------------------------- */
void PairComb3::tor_int(int torindx,double xtor, double ytor, double zcon, int l,
int m, int n, double &vtor, double &dtorx, double &dtory, double &dtorz)
{
int j;
double x;
vtor = dtorx = dtory = dtorz = 0.0;
if(l >= maxxc-1) { l=maxxc-1; } //boundary condition changed
if(m >= maxyc-1) { m=maxyc-1; }
if(n >= maxconj-1) { n=maxconj-1; }
for (j=0; j<64; j++) {
x = tor_spl[torindx][l][m][n-1][j] * pow(xtor,iin3[j][0])
* pow(ytor,iin3[j][1]) * pow(zcon,iin3[j][2]);
vtor += x;
if(xtor > 1.0e-8 ) dtorx += x*iin3[j][0]/xtor;
if(ytor > 1.0e-8 ) dtory += x*iin3[j][1]/ytor;
if(zcon > 1.0e-8 ) dtorz += x*iin3[j][2]/zcon;
}
}
/* ---------------------------------------------------------------------- */
void PairComb3::tor_force(int torindx, Param *paramk, Param *paraml,
double srmu, double rsq1,double rsq2, double rsq3,
double *delrj, double *delrk, double *delrl)
{
int nm;
double rmu, rmul, srmul, rij, rik, rjl;
for (nm=0; nm<3; nm++) {
fi_tor[nm] = fj_tor[nm] = fk_tor[nm] = fl_tor[nm] = 0.0;
}
rij = sqrt(rsq1);
rik = sqrt(rsq2);
rjl = sqrt(rsq3);
rmu = vec3_dot(delrj,delrk)/(rij*rik);
vec3_scale(-1.0,delrl,delrl);
rmul = vec3_dot(delrj,delrl)/(rij*rjl);
vec3_scale(-1.0,delrl,delrl);
srmul = sqrt(1.0-rmul*rmul);
if(acos(rmul) > MY_PI) srmul = -srmul;
if(srmul > 0.1 ) {
double fc1k, fcp1k, fc1l, fcp1l, srmul2, dt1dik, dt1djl;
double TT1, TT2, rmut, btt, tork[3], torl[3];
double dt2dik[3], dt2djl[3], dt2dij[3], AA, AA2;
double tfij[4], tfik[2], tfjl[2], tjx[3], tjy[3], tjz[3];
double tkx[2], tky[2], tkz[2], tlx[2], tly[2], tlz[2];
fc1k = comb_fc(rik,paramk);
fcp1k = comb_fc_d(rik,paramk);
fc1l = comb_fc(rjl,paraml);
fcp1l = comb_fc_d(rjl,paraml);
srmul2 = pow(srmul,2);
TT1 = rik*rjl*rij*rij*srmu*srmul;
dt1dik = -rmu/pow(srmu,2);
dt1djl = -rmul/srmul2;
tork[0] = delrk[1]*delrj[2] - delrk[2]*delrj[1];
torl[0] = delrj[1]*delrl[2] - delrj[2]*delrl[1];
tork[1] = delrk[2]*delrj[0] - delrk[0]*delrj[2];
torl[1] = delrj[2]*delrl[0] - delrj[0]*delrl[2];
tork[2] = delrk[0]*delrj[1] - delrk[1]*delrj[0];
torl[2] = delrj[0]*delrl[1] - delrj[1]*delrl[0];
TT2 = vec3_dot(tork,torl);
dt2dik[0] = -delrj[1]*torl[2] + delrj[2]*torl[1];
dt2dik[1] = -delrj[2]*torl[0] + delrj[0]*torl[2];
dt2dik[2] = -delrj[0]*torl[1] + delrj[1]*torl[0];
dt2djl[0] = delrj[1]*tork[2] - delrj[2]*tork[1];
dt2djl[1] = delrj[2]*tork[0] - delrj[0]*tork[2];
dt2djl[2] = delrj[0]*tork[1] - delrj[1]*tork[0];
dt2dij[0] = -delrk[2]*torl[1] + delrl[2]*tork[1]
+ delrk[1]*torl[2] - delrl[1]*tork[2];
dt2dij[1] = -delrk[0]*torl[2] + delrl[0]*tork[2]
+ delrk[2]*torl[0] - delrl[2]*tork[0];
dt2dij[2] = -delrk[1]*torl[0] + delrl[1]*tork[0]
+ delrk[0]*torl[1] - delrl[0]*tork[1];
rmut = TT2/TT1;
if(torindx>=1) {
btt = 1.0 - pow(rmut,2);
AA = -2.0 * ptorr * rmut * fc1k * fc1l / TT1;
}
else {
btt=paramk->ptork1-rmut;
btt=paramk->ptork2*pow(btt,2);
AA = -2.0 * ptorr * paramk->ptork2 *
(paramk->ptork1-rmut) * fc1k * fc1l /TT1;
}
AA2 = AA * TT2;
tfij[0] = -(dt1dik*AA2)/rij/rik;
tfij[1] = AA2/rij/rij - dt1dik*AA2*rmu/rij/rij;
tfij[2] = -dt1djl*AA2/rij/rjl;
tfij[3] = AA2/rij/rij - dt1djl*AA2*rmul/rij/rij;
tfik[0] = tfij[0];
tfik[1] = (AA2/rik - btt*ptorr*fc1l*fcp1k)/rik -
dt1dik*AA2*rmu/rik/rik;
tfjl[0] = tfij[2];
tfjl[1] = (AA2/rjl - btt*ptorr*fc1k*fcp1l)/rjl -
dt1djl*AA2*rmul/rjl/rjl;
tjx[0] = tfij[0]*delrk[0] - tfij[1]*delrj[0];
tjy[0] = tfij[0]*delrk[1] - tfij[1]*delrj[1];
tjz[0] = tfij[0]*delrk[2] - tfij[1]*delrj[2];
tjx[1] = -tfij[2]*delrl[0] - tfij[3]*delrj[0];
tjy[1] = -tfij[2]*delrl[1] - tfij[3]*delrj[1];
tjz[1] = -tfij[2]*delrl[2] - tfij[3]*delrj[2];
tjx[2] = -dt2dij[0] * AA;
tjy[2] = -dt2dij[1] * AA;
tjz[2] = -dt2dij[2] * AA;
tkx[0] = tfik[0]*delrj[0] - tfik[1]*delrk[0];
tky[0] = tfik[0]*delrj[1] - tfik[1]*delrk[1];
tkz[0] = tfik[0]*delrj[2] - tfik[1]*delrk[2];
tkx[1] = -dt2dik[0] * AA;
tky[1] = -dt2dik[1] * AA;
tkz[1] = -dt2dik[2] * AA;
tlx[0] = -tfjl[0]*delrj[0] - tfjl[1]*delrl[0];
tly[0] = -tfjl[0]*delrj[1] - tfjl[1]*delrl[1];
tlz[0] = -tfjl[0]*delrj[2] - tfjl[1]*delrl[2];
tlx[1] = -dt2djl[0] * AA;
tly[1] = -dt2djl[1] * AA;
tlz[1] = -dt2djl[2] * AA;
fi_tor[0] = tjx[0]+tjx[1]+tjx[2]+tkx[0]+tkx[1];
fi_tor[1] = tjy[0]+tjy[1]+tjy[2]+tky[0]+tky[1];
fi_tor[2] = tjz[0]+tjz[1]+tjz[2]+tkz[0]+tkz[1];
fj_tor[0] = -tjx[0]-tjx[1]-tjx[2]+tlx[0]+tlx[1];
fj_tor[1] = -tjy[0]-tjy[1]-tjy[2]+tly[0]+tly[1];
fj_tor[2] = -tjz[0]-tjz[1]-tjz[2]+tlz[0]+tlz[1];
fk_tor[0] = -tkx[0]-tkx[1];
fk_tor[1] = -tky[0]-tky[1];
fk_tor[2] = -tkz[0]-tkz[1];
fl_tor[0] = -tlx[0]-tlx[1];
fl_tor[1] = -tly[0]-tly[1];
fl_tor[2] = -tlz[0]-tlz[1];
}
}
/* ---------------------------------------------------------------------- */
double PairComb3::combqeq(double *qf_fix, int &igroup)
{
int i,j,ii, jj,itype,jtype,jnum;
int iparam_i,iparam_ji,iparam_ij;
int *ilist,*jlist,*numneigh,**firstneigh;
int mr1,mr2,mr3,inty,nj;
double xtmp,ytmp,ztmp,rsq1,delrj[3];
double iq,jq,fqi,fqij,fqji,sr1,sr2,sr3;
double potal,fac11,fac11e;
int sht_jnum,*sht_jlist;
tagint itag, jtag;
double **x = atom->x;
double *q = atom->q;
tagint *tag = atom->tag;
int *type = atom->type;
int inum = list->inum;
int *mask = atom->mask;
int groupbit = group->bitmask[igroup];
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
qf = qf_fix;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
if (mask[i] & groupbit) {
qf[i] = 0.0;
dpl[i][0] = dpl[i][1] = dpl[i][2] = 0.0;
}
}
// communicating charge force to all nodes, first forward then reverse
pack_flag = 1;
comm->forward_comm_pair(this);
// self energy correction term: potal
potal_calc(potal,fac11,fac11e);
// loop over full neighbor list of my atoms
fqi = fqij = fqji = 0.0;
for (ii = 0; ii < inum; ii ++) {
i = ilist[ii];
itag = tag[i];
nj = 0;
if (mask[i] & groupbit) {
itype = map[type[i]];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
iq = q[i];
iparam_i = elem2param[itype][itype][itype];
// charge force from self energy
fqi = qfo_self(&params[iparam_i],iq);
jlist = firstneigh[i];
jnum = numneigh[i];
sht_jlist = sht_first[i];
sht_jnum = sht_num[i];
// two-body interactions
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj] & NEIGHMASK;
jtag = tag[j];
if (itag >= jtag) continue;
jtype = map[type[j]];
inty = intype[itype][jtype];
jq = q[j];
delrj[0] = xtmp - x[j][0];
delrj[1] = ytmp - x[j][1];
delrj[2] = ztmp - x[j][2];
rsq1 = vec3_dot(delrj,delrj);
iparam_ij = elem2param[itype][jtype][jtype];
iparam_ji = elem2param[jtype][itype][itype];
// long range q-dependent
if (rsq1 > params[iparam_ij].lcutsq) continue;
// polynomial three-point interpolation
tri_point(rsq1,mr1,mr2,mr3,sr1,sr2,sr3);
// 1/r charge forces
qfo_direct(&params[iparam_ij],&params[iparam_ji],
mr1,mr2,mr3,rsq1,sr1,sr2,sr3,fac11e,fqij,fqji,
iq,jq,i,j);
fqi += fqij; qf[j] += fqji;
// field correction to self energy and charge force
qfo_field(&params[iparam_ij],&params[iparam_ji],rsq1,
iq,jq,fqij,fqji);
fqi += fqij; qf[j] += fqji;
// polarization field charge force
if (pol_flag) {
qfo_dipole(fac11,mr1,mr2,mr3,inty,rsq1,delrj,sr1,sr2,sr3,
fqij,fqji,i,j);
fqi += fqij; qf[j] += fqji;
}
}
for (jj = 0; jj < sht_jnum; jj++) {
j = sht_jlist[jj];
jtag = tag[j];
if (itag >= jtag) continue;
jtype = map[type[j]];
inty = intype[itype][jtype];
jq = q[j];
delrj[0] = xtmp - x[j][0];
delrj[1] = ytmp - x[j][1];
delrj[2] = ztmp - x[j][2];
rsq1 = vec3_dot(delrj,delrj);
iparam_ij = elem2param[itype][jtype][jtype];
iparam_ji = elem2param[jtype][itype][itype];
if (rsq1 >= params[iparam_ij].cutsq) continue;
nj ++;
// charge force in Aij and Bij
qfo_short(&params[iparam_ij],&params[iparam_ji],
rsq1,iq,jq,fqij,fqji,i,j,nj);
fqi += fqij; qf[j] += fqji;
}
qf[i] += fqi;
}
}
comm->reverse_comm_pair(this);
// sum charge force on each node and return it
double eneg = 0.0;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
if (mask[i] & groupbit){
eneg += qf[i];
itag=tag[i];
}
}
- double enegtot;
MPI_Allreduce(&eneg,&enegtot,1,MPI_DOUBLE,MPI_SUM,world);
MPI_Bcast(&enegtot,1,MPI_DOUBLE,0,world);
return enegtot;
}
/* ---------------------------------------------------------------------- */
double PairComb3::qfo_self(Param *param, double qi)
{
double self_d,cmin,cmax,qmin,qmax;
double s1 = param->chi;
double s2 = param->dj;
double s3 = param->dk;
double s4 = param->dl;
self_d = 0.0;
qmin = param->qmin;
qmax = param->qmax;
cmin = cmax = 100.0;
self_d = s1+qi*(2.0*s2+qi*(3.0*s3+qi*4.0*s4));
if (qi < qmin) self_d += 4.0 * cmin * pow((qi-qmin),3);
if (qi > qmax) self_d += 4.0 * cmax * pow((qi-qmax),3);
return self_d;
}
/* ---------------------------------------------------------------------- */
void PairComb3::qfo_direct(Param *parami, Param *paramj, int mr1,
int mr2, int mr3, double rsq, double sr1, double sr2,
double sr3, double fac11e, double &fqij, double &fqji,
double iq, double jq, int i, int j)
{
double r, erfcc, fafbnl, vm, vmfafb, esucon;
double afbn, afbj, sme1n, sme1j;
double curli = parami->curl;
double curlj = paramj->curl;
int inti = parami->ielement;
int intj = paramj->ielement;
int inty = intype[inti][intj];
double curlij0 = parami->curl0;
double curlji0 = paramj->curl0;
double curlij1,curlji1;
int icurl, jcurl;
int ielegp = parami->ielementgp;
int jelegp = paramj->ielementgp;
r = sqrt(rsq);
esucon=force->qqr2e;
icurl = jcurl = 0;
if(ielegp==2 && curli>curlij0) {
icurl=1;
curlij1=curli;
}
if(jelegp==2 && curlj>curlji0) {
jcurl=1;
curlji1=curlj;
}
if(icurl==1 || jcurl ==1) {
double xcoij= xcotmp[i];
double xcoji= xcotmp[j];
if(icurl==1) {
curli=curlij1+(curlij0-curlij1)*comb_fc_curl(xcoij,parami);
}
if(jcurl==1) {
curlj=curlji1+(curlji0-curlji1)*comb_fc_curl(xcoji,paramj);
}
}
// 1/r force (wrt q)
erfcc = sr1*erpaw[mr1][0] + sr2*erpaw[mr2][0] + sr3*erpaw[mr3][0];
fafbnl= sr1*fafb[mr1][inty] + sr2*fafb[mr2][inty] + sr3*fafb[mr3][inty];
afbn = sr1*afb[mr1][inti] + sr2*afb[mr2][inti] + sr3*afb[mr3][inti];
afbj = sr1*afb[mr1][intj] + sr2*afb[mr2][intj] + sr3*afb[mr3][intj];
vm = (erfcc/r * esucon - fac11e);
vmfafb = vm + esucon * fafbnl;
sme1n = curlj * (afbn - fafbnl) * esucon;
sme1j = curli * (afbj - fafbnl) * esucon;
fqij = 1.0 * (jq * vmfafb + sme1n);
fqji = 1.0 * (iq * vmfafb + sme1j);
}
/* ---------------------------------------------------------------------- */
void PairComb3::qfo_field(Param *parami, Param *paramj, double rsq,
double iq,double jq, double &fqij, double &fqji)
{
double r,r3,r5,rc,rc2,rc3,rc4,rc5;
double cmi1,cmi2,cmj1,cmj2,pcmi1,pcmi2;
double rf3i,rcf3i,rf5i,rcf5i;
double drcf3i,drcf5i,rf3,rf5;
r = sqrt(rsq);
r3 = r * rsq;
r5 = r3 * rsq;
rc = parami->lcut;
rc2= rc*rc;
rc3 = rc*rc*rc;
rc4 = rc3 * rc;
rc5 = rc4 * rc;
cmi1 = parami->cmn1;
cmi2 = parami->cmn2;
cmj1 = paramj->cmn1;
cmj2 = paramj->cmn2;
pcmi1 = parami->pcmn1;
pcmi2 = parami->pcmn2;
rf3i = r3/(pow(r3,2)+pow(pcmi1,3));
rcf3i = rc3/(pow(rc3,2)+pow(pcmi1,3));
rf5i = r5/(pow(r5,2)+pow(pcmi2,5));
rcf5i = rc5/(pow(rc5,2)+pow(pcmi2,5));
drcf3i = 3/rc*rcf3i-6*rc2*rcf3i*rcf3i;
drcf5i = 5/rc*rcf5i-10*rc4*rcf5i*rcf5i;
rf3 = rf3i-rcf3i-(r-rc)*drcf3i;
rf5 = rf5i-rcf5i-(r-rc)*drcf5i;
// field correction charge force
fqij = 1.0 * cmj1*rf3+2.0*iq*cmj2*rf5;
fqji = 1.0 * cmi1*rf3+2.0*jq*cmi2*rf5;
}
/* ---------------------------------------------------------------------- */
void PairComb3::qfo_dipole(double fac11, int mr1, int mr2, int mr3,
int inty, double rsq, double *delrj, double sr1, double sr2,
double sr3, double &fqij, double &fqji, int i, int j)
{
double erfcc, erfcd, dvdrr, dfafbnl, smf2;
double r, r3, alfdpi, esucon;
r = sqrt(rsq);
r3 = r * rsq;
alfdpi = 0.4/MY_PIS;
esucon = force->qqr2e;
erfcc = sr1*erpaw[mr1][0] + sr2*erpaw[mr2][0] + sr3*erpaw[mr3][0];
erfcd = sr1*erpaw[mr1][1] + sr2*erpaw[mr2][1] + sr3*erpaw[mr3][1];
dvdrr = (erfcc/r3+alfdpi*erfcd/rsq)*esucon-fac11;
dfafbnl= sr1*dfafb[mr1][inty] + sr2*dfafb[mr2][inty] + sr3*dfafb[mr3][inty];
smf2 = (dvdrr + dfafbnl*esucon)/r;
fqij = dpl[i][0]*delrj[0] + dpl[i][1]*delrj[1] +dpl[i][2]*delrj[2];
fqji = dpl[j][0]*delrj[0] + dpl[j][1]*delrj[1] +dpl[j][2]*delrj[2];
fqij *= smf2;
fqji *= smf2;
}
/* ---------------------------------------------------------------------- */
void PairComb3::qfo_short(Param *parami, Param *paramj, double rsq,
double iq, double jq, double &fqij, double &fqji,
int i, int j, int nj)
{
double r, tmp_fc;
double Di, Dj, dDi, dDj, Bsi, Bsj, dBsi, dBsj;
double QUchi, QOchi, QUchj, QOchj;
double bij, caj, cbj, caqpn, caqpj, cbqpn, cbqpj;
double LamDiLamDj, AlfDiAlfDj;
double rlm1 = parami->lambda;
double alfij1= parami->alpha1;
double alfij2= parami->alpha2;
double alfij3= parami->alpha3;
double pbij1= parami->bigB1;
double pbij2= parami->bigB2;
double pbij3= parami->bigB3;
caj = cbj = caqpn = caqpj = cbqpn = cbqpj = 0.0;
r = sqrt(rsq);
tmp_fc = comb_fc(r,parami);
bij = bbij[i][nj];
QUchi = (parami->QU - iq) * parami->bD;
QUchj = (paramj->QU - jq) * paramj->bD;
QOchi = (iq - parami->Qo) * parami->bB;
QOchj = (jq - paramj->Qo) * paramj->bB;
if (iq < parami->QL-0.2) {
iq = parami->QL-0.2;
Di = parami->DL;
dDi = Bsi = dBsi = 0.0;
} else if (iq > parami->QU+0.2) {
iq = parami->QU+0.2;
Di = parami->DU;
dDi = Bsi = dBsi = 0.0;
} else {
Di = parami->DU + pow(QUchi,parami->nD); // YYDin
dDi = -parami->nD * parami->bD * pow(QUchi,(parami->nD-1.0)); // YYDiqp
Bsi = parami->aB - pow(QOchi,10); // YYBsin
dBsi = -parami->bB * 10.0 * pow(QOchi,9.0); // YYBsiqp
}
if (jq < paramj->QL-0.2) {
jq = paramj->QL-0.2;
Dj = paramj->DL;
dDj = Bsj = dBsj = 0.0;
} else if (jq > paramj->QU+0.2) {
jq = paramj->QU+0.2;
Dj = paramj->DU;
dDj = Bsj = dBsj = 0.0;
} else {
Dj = paramj->DU + pow(QUchj,paramj->nD); // YYDij
dDj = -paramj->nD * paramj->bD * pow(QUchj,(paramj->nD-1.0)); // YYDiqpj
Bsj = paramj->aB - pow(QOchj,10); // YYBsij
dBsj = -paramj->bB * 10.0 * pow(QOchj,9.0); // YYBsiqpj
}
LamDiLamDj = exp(0.5*(parami->lami*Di+paramj->lami*Dj)-rlm1*r);
caj = 0.5 * tmp_fc * parami->bigA * LamDiLamDj;
if (Bsi*Bsj > 0.0) {
AlfDiAlfDj = exp(0.5*(parami->alfi*Di+paramj->alfi*Dj));
cbj=-0.5*tmp_fc*bij*sqrt(Bsi*Bsj)*AlfDiAlfDj*
(pbij1*exp(-alfij1*r)+pbij2*exp(-alfij2*r)+pbij3*exp(-alfij3*r));
cbqpn = cbj * (parami->alfi * dDi + dBsi/Bsi);
cbqpj = cbj * (paramj->alfi * dDj + dBsj/Bsj);
} else {
cbj = cbqpn = cbqpj = 0.0;
}
caqpn = caj * parami->lami * dDi;
caqpj = caj * paramj->lami * dDj;
fqij = 1.0 * (caqpn + cbqpn);
fqji = 1.0 * (caqpj + cbqpj);
}
/* ---------------------------------------------------------------------- */
void PairComb3::dipole_init(Param *parami, Param *paramj, double fac11,
double *delrj, double rsq, int mr1, int mr2, int mr3, double sr1,
double sr2, double sr3, double iq, double jq, int i, int j)
{
double erfcc, erfcd, dvdrr, dfafbnl, smf2, phinn, phinj, efn, efj;
double r, r3, alfdpi, esucon;
double rcd, rct, tmurn, tmurj, poln[3], polj[3], Qext[3];
int nm;
int inti = parami->ielement;
int intj = paramj->ielement;
int inty = intype[inti][intj];
for(nm=0; nm<3; nm++) Qext[nm] = 0.0;
r = sqrt(rsq);
r3 = r * rsq;
rcd = 1.0/(r3);
rct = 3.0*rcd/rsq;
alfdpi = 0.4/MY_PIS;
esucon = force->qqr2e;
erfcc = sr1*erpaw[mr1][0] + sr2*erpaw[mr2][0] + sr3*erpaw[mr3][0];
erfcd = sr1*erpaw[mr1][1] + sr2*erpaw[mr2][1] + sr3*erpaw[mr3][1];
dvdrr = (erfcc/r3+alfdpi*erfcd/rsq)*esucon-fac11;
dfafbnl= sr1*dfafb[mr1][inty] + sr2*dfafb[mr2][inty] + sr3*dfafb[mr3][inty];
smf2 = dvdrr/esucon + dfafbnl/r;
phinn = sr1*phin[mr1][inti] + sr2*phin[mr2][inti] + sr3*phin[mr3][inti];
phinj = sr1*phin[mr1][intj] + sr2*phin[mr2][intj] + sr3*phin[mr3][intj];
efn = jq * smf2;
efj = iq * smf2;
tmurn = dpl[i][0]*delrj[0] + dpl[i][1]*delrj[1] + dpl[i][2]*delrj[2];
tmurj = dpl[j][0]*delrj[0] + dpl[j][1]*delrj[1] + dpl[j][2]*delrj[2];
for (nm=0; nm<3; nm++) {
poln[nm] = (tmurj*delrj[nm]*rct - dpl[j][nm]*rcd)*phinj;
polj[nm] = (tmurn*delrj[nm]*rct - dpl[i][nm]*rcd)*phinn;
}
for (nm=0; nm<3; nm++) {
dpl[i][nm] += (Qext[nm]/esucon + delrj[nm]*efn + poln[nm])*parami->polz*0.50;
dpl[j][nm] += (Qext[nm]/esucon - delrj[nm]*efj + polj[nm])*paramj->polz*0.50;
}
}
/* ---------------------------------------------------------------------- */
double PairComb3::dipole_self(Param *parami, int i)
{
double esucon = force->qqr2e;
double apn = parami->polz;
double selfdpV = 0.0;
if (apn != 0.0) {
selfdpV= (dpl[i][0]*dpl[i][0]+dpl[i][1]*dpl[i][1]+dpl[i][2]*dpl[i][2])
*esucon/(2.0*apn); }
return selfdpV;
}
/* ---------------------------------------------------------------------- */
void PairComb3::dipole_calc(Param *parami, Param *paramj, double fac11,
double delx, double dely, double delz, double rsq,
int mr1, int mr2, int mr3, double sr1, double sr2, double sr3,
double iq, double jq, int i, int j, double &vionij,
double &fvionij, double *ddprx)
{
double erfcc, erfcd, dvdrr, dfafbnl, ef, phinn, phinj, efn, efj;
double r, r3, alf, alfdpi, esucon, dphinn, dphinj, ddfafbnl;
double def, defn, defj, tmun, tmuj, emuTmu, edqn, edqj, ddvdrr;
double rcd, rct, tmurn, tmurj, tmumu, poln[3], polj[3], delr1[3];
double demuTmu, ddpr, dcoef;
int nm;
int inti = parami->ielement;
int intj = paramj->ielement;
int inty = intype[inti][intj];
r = sqrt(rsq);
r3 = r * rsq;
esucon = force->qqr2e;
rcd = esucon/r3;
rct = 3.0*rcd/rsq;
alf = 0.2;
alfdpi = 2.0*alf/MY_PIS;
delr1[0] = delx;
delr1[1] = dely;
delr1[2] = delz;
// generate energy & force information from tables
erfcc = sr1*erpaw[mr1][0] + sr2*erpaw[mr2][0] + sr3*erpaw[mr3][0];
erfcd = sr1*erpaw[mr1][1] + sr2*erpaw[mr2][1] + sr3*erpaw[mr3][1];
dvdrr = (erfcc/r3+alfdpi*erfcd/rsq)*esucon-fac11;
ddvdrr = (2.0*erfcc/r3 + 2.0*alfdpi*erfcd*(1.0/rsq+alf*alf))*esucon;
dfafbnl= sr1*dfafb[mr1][inty] + sr2*dfafb[mr2][inty] + sr3*dfafb[mr3][inty];
phinn = sr1*phin[mr1][inti] + sr2*phin[mr2][inti] + sr3*phin[mr3][inti];
phinj = sr1*phin[mr1][intj] + sr2*phin[mr2][intj] + sr3*phin[mr3][intj];
dphinn = sr1*dphin[mr1][inti] + sr2*dphin[mr2][inti] + sr3*dphin[mr3][inti];
dphinj = sr1*dphin[mr1][intj] + sr2*dphin[mr2][intj] + sr3*dphin[mr3][intj];
ddfafbnl= sr1*ddfafb[mr1][inty] + sr2*ddfafb[mr2][inty] + sr3*ddfafb[mr3][inty];
ef = (dvdrr + dfafbnl * esucon)/r;
efn = jq * ef;
efj = -iq * ef;
def = (ddvdrr + ddfafbnl * esucon)/r;
defn = jq * def;
defj = -iq * def;
// dipole - dipole field tensor (Tij)
tmurn = dpl[i][0]*delr1[0] + dpl[i][1]*delr1[1] + dpl[i][2]*delr1[2];
tmurj = dpl[j][0]*delr1[0] + dpl[j][1]*delr1[1] + dpl[j][2]*delr1[2];
tmumu = dpl[i][0]*dpl[j][0] + dpl[i][1]*dpl[j][1] + dpl[i][2]*dpl[j][2];
for (nm=0; nm<3; nm++) {
poln[nm] = (tmurj*delr1[nm]*rct - dpl[j][nm]*rcd);
polj[nm] = (tmurn*delr1[nm]*rct - dpl[i][nm]*rcd);
}
tmun = dpl[j][0]*polj[0] + dpl[j][1]*polj[1] + dpl[j][2]*polj[2];
tmuj = dpl[i][0]*poln[0] + dpl[i][1]*poln[1] + dpl[i][2]*poln[2];
// dipole - dipole energy
emuTmu = -0.5*(tmun*phinn+tmuj*phinj);
// dipole - charge energy
edqn = -0.5 * (tmurn * efn);
edqj = -0.5 * (tmurj * efj);
// overall dipole energy
vionij = emuTmu + edqn + edqj;
// dipole - dipole force
demuTmu = (tmun*dphinn + tmuj*dphinj)/r;
ddpr = 5.0*tmurn*tmurj/rsq - tmumu;
dcoef = rct * (phinn+phinj);
for (nm = 0; nm < 3; nm ++) {
ddprx[nm] = dcoef * (ddpr*delr1[nm] - tmurn*dpl[j][nm] - tmurj*dpl[i][nm])
+ demuTmu * delr1[nm];
}
// dipole - charge force
fvionij = -tmurn*defn - tmurj*defj;
}
/* ---------------------------------------------------------------------- */
double PairComb3::comb_fc_curl(double rocn, Param *param)
{
double r_inn = param->curlcut1;
double r_out = param->curlcut2;
if (rocn <= r_inn) return 1.0;
if (rocn >= r_out) return 0.0;
return 0.5*(1.0 + cos(MY_PI*(rocn-r_inn)/(r_out-r_inn)));
}
/* ---------------------------------------------------------------------- */
double PairComb3::comb_fc_curl_d(double rocn, Param *param)
{
double r_inn = param->curlcut1;
double r_out = param->curlcut2;
if (rocn <= r_inn) return 0.0;
if (rocn >= r_out) return 0.0;
return -MY_PI2/(r_out-r_inn)*sin(MY_PI*(rocn-r_inn)/(r_out-r_inn));
}
/* ---------------------------------------------------------------------- */
int PairComb3::heaviside(double rr)
{
if (rr <= 0.0) return 0;
else return 1;
}
/* ---------------------------------------------------------------------- */
double PairComb3::switching(double rr)
{
if (rr <= 0.0) return 1.0;
else if (rr >= 1.0) return 0.0;
else return heaviside(-rr)+heaviside(rr)*heaviside(1.0-rr)
* (1.0-(3.0-2.0*rr)*rr*rr);
}
/* ---------------------------------------------------------------------- */
double PairComb3::switching_d(double rr)
{
if (rr <= 0.0) return 0.0;
else if (rr >= 1.0) return 0.0;
else return heaviside(rr)*heaviside(1.0-rr)
* 6.0*rr*(rr-1.0);
}
/* ---------------------------------------------------------------------- */
int PairComb3::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
m = 0;
if (pack_flag == 1) {
for (i = 0; i < n; i ++) {
j = list[i];
buf[m++] = qf[j];
}
} else if (pack_flag == 2) {
for (i = 0; i < n; i ++) {
j = list[i];
buf[m++] = NCo[j];
}
}
return m;
}
/* ---------------------------------------------------------------------- */
void PairComb3::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n ;
if (pack_flag == 1) {
for (i = first; i < last; i++)
qf[i] = buf[m++];
} else if (pack_flag == 2) {
for (i = first; i < last; i++)
NCo[i] = buf[m++];
}
}
/* ---------------------------------------------------------------------- */
int PairComb3::pack_reverse_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
if (pack_flag == 1) {
for (i = first; i < last; i++)
buf[m++] = qf[i];
} else if (pack_flag == 2) {
for (i = first; i < last; i++)
buf[m++] = NCo[i];
}
return m;
}
/* ---------------------------------------------------------------------- */
void PairComb3::unpack_reverse_comm(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
if (pack_flag == 1) {
for (i = 0; i < n; i++) {
j = list[i];
qf[j] += buf[m++];
}
} else if (pack_flag == 2) {
for (i = 0; i < n; i++) {
j = list[i];
NCo[j] += buf[m++];
}
}
}
/* ----------------------------------------------------------------------
memory usage of local atom-based arrays
------------------------------------------------------------------------- */
double PairComb3::memory_usage()
{
double bytes = maxeatom * sizeof(double);
bytes += maxvatom*6 * sizeof(double);
bytes += nmax * sizeof(int);
bytes += nmax * 8.0 * sizeof(double);
bytes += 25000*2*sizeof(double);
for (int i = 0; i < comm->nthreads; i++)
bytes += ipage[i].size();
return bytes;
}
diff --git a/src/MANYBODY/pair_comb3.h b/src/MANYBODY/pair_comb3.h
index 94490e00b..6db987b56 100644
--- a/src/MANYBODY/pair_comb3.h
+++ b/src/MANYBODY/pair_comb3.h
@@ -1,339 +1,340 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(comb3,PairComb3)
#else
#ifndef LMP_PAIR_COMB3_H
#define LMP_PAIR_COMB3_H
#include "pair.h"
#include "my_page.h"
namespace LAMMPS_NS {
class PairComb3 : public Pair {
public:
PairComb3(class LAMMPS *);
virtual ~PairComb3();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
double init_one(int, int);
double memory_usage();
virtual double combqeq(double *, int &);
+ double enegtot;
// general potential parameters
protected:
struct Param {
int ielement,jelement,kelement,powermint;
int ielementgp,jelementgp,kelementgp; //element group
int ang_flag,pcn_flag,rad_flag,tor_flag; //angle, coordination,radical, torsion flag
double lami,lambda,alfi,alpha1,alpha2,alpha3,beta;
double pcos6,pcos5,pcos4,pcos3,pcos2,pcos1,pcos0;
double gamma,powerm,powern,bigA,bigB1,bigB2,bigB3;
double bigd,bigr,cut,cutsq,c1,c2,c3,c4;
double p6p0,p6p1,p6p2,p6p3,p6p4,p6p5,p6p6;
double ptork1,ptork2;
double addrepr,addrep, vdwflag;
double QU,QL,DU,DL,Qo,dQ,aB,bB,nD,bD,qmin,qmax;
double chi,dj,dk,dl,dm,esm,cmn1,cmn2,pcmn1,pcmn2;
double coulcut, lcut, lcutsq;
double veps, vsig, pcna, pcnb, pcnc, pcnd, polz, curl, pcross;
double paaa, pbbb;
double curlcut1, curlcut2, curl0;
};
// general setups
int nelements; // # of unique elements
int ***elem2param; // mapping from element triplets to parameters
int *map; // mapping from atom types to elements
int nparams; // # of stored parameter sets
int maxparam; // max # of parameter sets
double PI,PI2,PI4,PIsq; // PIs
double cutmin; // min cutoff for all elements
double cutmax; // max cutoff for all elements
double precision; // tolerance for QEq convergence
char **elements; // names of unique elements
Param *params; // parameter set for an I-J-K interaction
int debug_eng1, debug_eng2, debug_fq; // logic controlling debugging outputs
int pack_flag;
// Short range neighbor list
void Short_neigh();
int pgsize, oneatom;
int *sht_num, **sht_first;
MyPage<int> *ipage;
// loop up tables and flags
int nmax, **intype;
int pol_flag, polar;
double *qf, **bbij, *charge, *NCo;
double *esm, **fafb, **dfafb, **ddfafb, **phin, **dphin, **erpaw;
double **vvdw, **vdvdw;
double **afb, **dafb;
double **dpl, bytes;
double *xcctmp, *xchtmp, *xcotmp;
// additional carbon parameters
int cflag;
int nsplpcn,nsplrad,nspltor;
int maxx,maxy,maxz,maxxc,maxyc,maxconj;
int maxxcn[4];
double vmaxxcn[4],dvmaxxcn[4];
int ntab;
double iin2[16][2],iin3[64][3];
double brad[4], btor[4], bbtor, ptorr;
double fi_tor[3], fj_tor[3], fk_tor[3], fl_tor[3];
double radtmp, fi_rad[3], fj_rad[3], fk_rad[3];
double ccutoff[6],ch_a[7];
//COMB3-v18 arrays for CHO
// We wanna dynamic arrays
// C angle arrays, size = ntab+1
double pang[20001];
double dpang[20001];
double ddpang[20001];
//coordination spline arrays
double pcn_grid[4][5][5][5];
double pcn_gridx[4][5][5][5];
double pcn_gridy[4][5][5][5];
double pcn_gridz[4][5][5][5];
double pcn_cubs[4][4][4][4][64];
//coordination spline arrays
double rad_grid[3][5][5][11];
double rad_gridx[3][5][5][11];
double rad_gridy[3][5][5][11];
double rad_gridz[3][5][5][11];
double rad_spl[3][4][4][10][64];
//torsion spline arrays
double tor_grid[1][5][5][11];
double tor_gridx[1][5][5][11];
double tor_gridy[1][5][5][11];
double tor_gridz[1][5][5][11];
double tor_spl[1][4][4][10][64];
// initialization functions
void allocate();
void read_lib();
void setup();
virtual void read_file(char *);
// cutoff functions
double comb_fc(double, Param *);
double comb_fc_d(double, Param *);
double comb_fc_curl(double, Param *);
double comb_fc_curl_d(double, Param *);
double comb_fccc(double);
double comb_fccc_d(double);
double comb_fcch(double);
double comb_fcch_d(double);
double comb_fccch(double);
double comb_fccch_d(double);
double comb_fcsw(double);
// short range terms
void attractive(Param *, Param *, Param *, double, double, double, double,
double, double, double, double *, double *, double *,
double *, double *, int, double);
virtual void comb_fa(double, Param *, Param *, double, double,
double &, double &);
virtual void repulsive(Param *, Param *,double, double &, int,
double &, double, double);
// bond order terms
double comb_bij(double, Param *, double, int, double);
double comb_gijk(double, Param *, double);
void comb_gijk_d(double, Param *, double, double &, double &);
double zeta(Param *, Param *, double, double, double *, double *, int, double);
void comb_bij_d(double, Param *, double, int, double &,
double &, double &, double &, double &, double &, double);
void coord(Param *, double, int, double &, double &,
double &, double &, double &, double);
void comb_zetaterm_d(double, double, double, double, double,
double *, double, double *, double, double *, double *,
double *, Param *, Param *, Param *, double);
void costheta_d(double *, double, double *, double,
double *, double *, double *);
void force_zeta(Param *, Param *, double, double, double, double &,
double &, double &, double &, double &, double &, double &,
double &, double &, double &, double &, double &, double &,
int, double &, double,double, int, int, int,
double , double , double);
void cntri_int(int, double, double, double, int, int, int,
double &, double &, double &, double &, Param *);
// Legendre polynomials
void selfp6p(Param *, Param *, double, double &, double &);
double ep6p(Param *, Param *, double, double, double *, double * ,double &);
void fp6p(Param *, Param *, double, double, double *, double *, double *,
double *, double *);
// long range q-dependent terms
double self(Param *, double);
void tables();
void potal_calc(double &, double &, double &);
void tri_point(double, int &, int &, int &, double &, double &,
double &);
void vdwaals(int,int,int,int,double,double,double,double,
double &, double &);
void direct(Param *, Param *, int,int,int,double,double,
double,double,double,double, double,double,double &,double &,
int, int);
void field(Param *, Param *,double,double,double,double &,double &);
int heaviside(double);
double switching(double);
double switching_d(double);
double chicut1, chicut2;
// radical terms
double rad_init(double, Param *, int, double &, double);
void rad_calc(double, Param *, Param *, double, double, int,
int, double, double);
void rad_int(int , double, double, double, int, int, int,
double &, double &, double &, double &);
void rad_forceik(Param *, double, double *, double, double);
void rad_force(Param *, double, double *, double);
// torsion terms
double bbtor1(int, Param *, Param *, double, double, double,
double *, double *, double *, double); //modified by TAO
void tor_calc(double, Param *, Param *, double, double, int,
int, double, double);
void tor_int(int , double, double, double, int, int, int,
double &, double &, double &, double &);
void tor_force(int, Param *, Param *, double, double, double,
double, double *, double *, double *); //modified by TAO
// charge force terms
double qfo_self(Param *, double);
void qfo_short(Param *, Param *, double, double, double,
double &, double &, int, int, int);
void qfo_direct(Param *, Param *, int, int, int, double,
double, double, double, double, double &, double &,
double, double, int, int);
void qfo_field(Param *, Param *,double,double ,double ,double &, double &);
void qfo_dipole(double, int, int, int, int, double, double *, double,
double, double, double &, double &, int, int);
void qsolve(double *);
// dipole - polarization terms
double dipole_self(Param *, int);
void dipole_init(Param *, Param *, double, double *, double,
int, int, int, double, double, double, double, double, int , int);
void dipole_calc(Param *, Param *, double, double, double, double, double,
int, int, int, double, double, double, double, double, int , int,
double &, double &, double *);
// communication functions
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
int pack_forward_comm(int , int *, double *, int, int *);
void unpack_forward_comm(int , int , double *);
// vector functions, inline for efficiency
inline double vec3_dot(double *x, double *y) {
return x[0]*y[0] + x[1]*y[1] + x[2]*y[2];
}
inline void vec3_add(double *x, double *y, double *z) {
z[0] = x[0]+y[0]; z[1] = x[1]+y[1]; z[2] = x[2]+y[2];
}
inline void vec3_scale(double k, double *x, double *y) {
y[0] = k*x[0]; y[1] = k*x[1]; y[2] = k*x[2];
}
inline void vec3_scaleadd(double k, double *x, double *y, double *z) {
z[0] = k*x[0]+y[0]; z[1] = k*x[1]+y[1]; z[2] = k*x[2]+y[2];
}
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Incorrect args for pair coefficients
Self-explanatory. Check the input script or data file.
E: Pair style COMB3 requires atom IDs
This is a requirement to use the COMB3 potential.
E: Pair style COMB3 requires newton pair on
See the newton command. This is a restriction to use the COMB3
potential.
E: Pair style COMB3 requires atom attribute q
Self-explanatory.
E: All pair coeffs are not set
All pair coefficients must be set in the data file or by the
pair_coeff command before running a simulation.
E: Cannot open COMB3 lib.comb3 file
The COMB3 library file cannot be opened. Check that the path and name
are correct.
E: Cannot open COMB3 potential file %s
The specified COMB3 potential file cannot be opened. Check that the
path and name are correct.
E: Incorrect format in COMB3 potential file
Incorrect number of words per line in the potential file.
E: Illegal COMB3 parameter
One or more of the coefficients defined in the potential file is
invalid.
E: Potential file has duplicate entry
The potential file has more than one entry for the same element.
E: Potential file is missing an entry
The potential file does not have a needed entry.
E: Neighbor list overflow, boost neigh_modify one
There are too many neighbors of a single atom. Use the neigh_modify
command to increase the max number of neighbors allowed for one atom.
You may also want to boost the page size.
E: Error in vdw spline: inner radius > outer radius
A pre-tabulated spline is invalid. Likely a problem with the
potential parameters.
*/
diff --git a/src/MISC/fix_deposit.cpp b/src/MISC/fix_deposit.cpp
index bfac27fa5..a7729ba83 100644
--- a/src/MISC/fix_deposit.cpp
+++ b/src/MISC/fix_deposit.cpp
@@ -1,839 +1,849 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "fix_deposit.h"
#include "atom.h"
#include "atom_vec.h"
#include "molecule.h"
#include "force.h"
#include "update.h"
#include "modify.h"
#include "fix.h"
#include "comm.h"
#include "domain.h"
#include "lattice.h"
#include "region.h"
#include "random_park.h"
#include "math_extra.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
using namespace MathConst;
enum{ATOM,MOLECULE};
enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files
#define EPSILON 1.0e6
/* ---------------------------------------------------------------------- */
FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 7) error->all(FLERR,"Illegal fix deposit command");
restart_global = 1;
time_depend = 1;
// required args
ninsert = force->inumeric(FLERR,arg[3]);
ntype = force->inumeric(FLERR,arg[4]);
nfreq = force->inumeric(FLERR,arg[5]);
seed = force->inumeric(FLERR,arg[6]);
if (seed <= 0) error->all(FLERR,"Illegal fix deposit command");
// read options from end of input line
options(narg-7,&arg[7]);
// error check on type
if (mode == ATOM && (ntype <= 0 || ntype > atom->ntypes))
error->all(FLERR,"Invalid atom type in fix deposit command");
// error checks on region and its extent being inside simulation box
if (iregion == -1) error->all(FLERR,"Must specify a region in fix deposit");
if (domain->regions[iregion]->bboxflag == 0)
error->all(FLERR,"Fix deposit region does not support a bounding box");
if (domain->regions[iregion]->dynamic_check())
error->all(FLERR,"Fix deposit region cannot be dynamic");
xlo = domain->regions[iregion]->extent_xlo;
xhi = domain->regions[iregion]->extent_xhi;
ylo = domain->regions[iregion]->extent_ylo;
yhi = domain->regions[iregion]->extent_yhi;
zlo = domain->regions[iregion]->extent_zlo;
zhi = domain->regions[iregion]->extent_zhi;
if (domain->triclinic == 0) {
if (xlo < domain->boxlo[0] || xhi > domain->boxhi[0] ||
ylo < domain->boxlo[1] || yhi > domain->boxhi[1] ||
zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
error->all(FLERR,"Deposition region extends outside simulation box");
} else {
if (xlo < domain->boxlo_bound[0] || xhi > domain->boxhi_bound[0] ||
ylo < domain->boxlo_bound[1] || yhi > domain->boxhi_bound[1] ||
zlo < domain->boxlo_bound[2] || zhi > domain->boxhi_bound[2])
error->all(FLERR,"Deposition region extends outside simulation box");
}
// error check and further setup for mode = MOLECULE
if (atom->tag_enable == 0)
error->all(FLERR,"Cannot use fix_deposit unless atoms have IDs");
if (mode == MOLECULE) {
for (int i = 0; i < nmol; i++) {
if (onemols[i]->xflag == 0)
error->all(FLERR,"Fix deposit molecule must have coordinates");
if (onemols[i]->typeflag == 0)
error->all(FLERR,"Fix deposit molecule must have atom types");
if (ntype+onemols[i]->ntypes <= 0 ||
ntype+onemols[i]->ntypes > atom->ntypes)
error->all(FLERR,"Invalid atom type in fix deposit mol command");
if (atom->molecular == 2 && onemols != atom->avec->onemols)
error->all(FLERR,"Fix deposit molecule template ID must be same "
"as atom_style template ID");
onemols[i]->check_attributes(0);
// fix deposit uses geoemetric center of molecule for insertion
onemols[i]->compute_center();
}
}
if (rigidflag && mode == ATOM)
error->all(FLERR,"Cannot use fix deposit rigid and not molecule");
if (shakeflag && mode == ATOM)
error->all(FLERR,"Cannot use fix deposit shake and not molecule");
if (rigidflag && shakeflag)
error->all(FLERR,"Cannot use fix deposit rigid and shake");
// setup of coords and imageflags array
if (mode == ATOM) natom_max = 1;
else {
natom_max = 0;
for (int i = 0; i < nmol; i++)
natom_max = MAX(natom_max,onemols[i]->natoms);
}
memory->create(coords,natom_max,3,"deposit:coords");
memory->create(imageflags,natom_max,"deposit:imageflags");
// setup scaling
double xscale,yscale,zscale;
if (scaleflag) {
xscale = domain->lattice->xlattice;
yscale = domain->lattice->ylattice;
zscale = domain->lattice->zlattice;
}
else xscale = yscale = zscale = 1.0;
// apply scaling to all input parameters with dist/vel units
if (domain->dimension == 2) {
lo *= yscale;
hi *= yscale;
rate *= yscale;
} else {
lo *= zscale;
hi *= zscale;
rate *= zscale;
}
deltasq *= xscale*xscale;
nearsq *= xscale*xscale;
vxlo *= xscale;
vxhi *= xscale;
vylo *= yscale;
vyhi *= yscale;
vzlo *= zscale;
vzhi *= zscale;
tx *= xscale;
ty *= yscale;
tz *= zscale;
// find current max atom and molecule IDs if necessary
if (idnext) find_maxid();
// random number generator, same for all procs
random = new RanPark(lmp,seed);
// set up reneighboring
force_reneighbor = 1;
next_reneighbor = update->ntimestep + 1;
nfirst = next_reneighbor;
ninserted = 0;
}
/* ---------------------------------------------------------------------- */
FixDeposit::~FixDeposit()
{
delete random;
delete [] molfrac;
delete [] idrigid;
delete [] idshake;
delete [] idregion;
memory->destroy(coords);
memory->destroy(imageflags);
}
/* ---------------------------------------------------------------------- */
int FixDeposit::setmask()
{
int mask = 0;
mask |= PRE_EXCHANGE;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixDeposit::init()
{
// set index and check validity of region
iregion = domain->find_region(idregion);
if (iregion == -1)
error->all(FLERR,"Region ID for fix deposit does not exist");
// if rigidflag defined, check for rigid/small fix
// its molecule template must be same as this one
fixrigid = NULL;
if (rigidflag) {
int ifix = modify->find_fix(idrigid);
if (ifix < 0) error->all(FLERR,"Fix pour rigid fix does not exist");
fixrigid = modify->fix[ifix];
int tmp;
if (onemols != (Molecule **) fixrigid->extract("onemol",tmp))
error->all(FLERR,
"Fix deposit and fix rigid/small not using "
"same molecule template ID");
}
// if shakeflag defined, check for SHAKE fix
// its molecule template must be same as this one
fixshake = NULL;
if (shakeflag) {
int ifix = modify->find_fix(idshake);
if (ifix < 0) error->all(FLERR,"Fix deposit shake fix does not exist");
fixshake = modify->fix[ifix];
int tmp;
if (onemols != (Molecule **) fixshake->extract("onemol",tmp))
error->all(FLERR,"Fix deposit and fix shake not using "
"same molecule template ID");
}
// for finite size spherical particles:
// warn if near < 2 * maxrad of existing and inserted particles
// since may lead to overlaps
// if inserted molecule does not define diameters,
// use AtomVecSphere::create_atom() default radius = 0.5
if (atom->radius_flag) {
double *radius = atom->radius;
int nlocal = atom->nlocal;
double maxrad = 0.0;
for (int i = 0; i < nlocal; i++)
maxrad = MAX(maxrad,radius[i]);
double maxradall;
MPI_Allreduce(&maxrad,&maxradall,1,MPI_DOUBLE,MPI_MAX,world);
double maxradinsert = 0.0;
if (mode == MOLECULE) {
for (int i = 0; i < nmol; i++) {
if (onemols[i]->radiusflag)
maxradinsert = MAX(maxradinsert,onemols[i]->maxradius);
else maxradinsert = MAX(maxradinsert,0.5);
}
} else maxradinsert = 0.5;
double separation = MAX(2.0*maxradinsert,maxradall+maxradinsert);
if (sqrt(nearsq) < separation && comm->me == 0) {
char str[128];
sprintf(str,"Fix deposit near setting < possible overlap separation %g",
separation);
error->warning(FLERR,str);
}
}
}
/* ----------------------------------------------------------------------
perform particle insertion
------------------------------------------------------------------------- */
void FixDeposit::pre_exchange()
{
int i,m,n,nlocalprev,imol,natom,flag,flagall;
double coord[3],lamda[3],delx,dely,delz,rsq;
double r[3],vnew[3],rotmat[3][3],quat[4];
double *newcoord;
// just return if should not be called on this timestep
if (next_reneighbor != update->ntimestep) return;
+ // clear ghost count and any ghost bonus data internal to AtomVec
+ // same logic as beginning of Comm::exchange()
+ // do it now b/c inserting atoms will overwrite ghost atoms
+
+ atom->nghost = 0;
+ atom->avec->clear_bonus();
+
// compute current offset = bottom of insertion volume
double offset = 0.0;
if (rateflag) offset = (update->ntimestep - nfirst) * update->dt * rate;
double *sublo,*subhi;
if (domain->triclinic == 0) {
sublo = domain->sublo;
subhi = domain->subhi;
} else {
sublo = domain->sublo_lamda;
subhi = domain->subhi_lamda;
}
// find current max atom and molecule IDs if necessary
if (!idnext) find_maxid();
// attempt an insertion until successful
int dimension = domain->dimension;
int success = 0;
int attempt = 0;
while (attempt < maxattempt) {
attempt++;
// choose random position for new particle within region
coord[0] = xlo + random->uniform() * (xhi-xlo);
coord[1] = ylo + random->uniform() * (yhi-ylo);
coord[2] = zlo + random->uniform() * (zhi-zlo);
while (domain->regions[iregion]->match(coord[0],coord[1],coord[2]) == 0) {
coord[0] = xlo + random->uniform() * (xhi-xlo);
coord[1] = ylo + random->uniform() * (yhi-ylo);
coord[2] = zlo + random->uniform() * (zhi-zlo);
}
// adjust vertical coord by offset
if (dimension == 2) coord[1] += offset;
else coord[2] += offset;
// if global, reset vertical coord to be lo-hi above highest atom
// if local, reset vertical coord to be lo-hi above highest "nearby" atom
// local computation computes lateral distance between 2 particles w/ PBC
// when done, have final coord of atom or center pt of molecule
if (globalflag || localflag) {
int dim;
double max,maxall,delx,dely,delz,rsq;
if (dimension == 2) {
dim = 1;
max = domain->boxlo[1];
} else {
dim = 2;
max = domain->boxlo[2];
}
double **x = atom->x;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++) {
if (localflag) {
delx = coord[0] - x[i][0];
dely = coord[1] - x[i][1];
delz = 0.0;
domain->minimum_image(delx,dely,delz);
if (dimension == 2) rsq = delx*delx;
else rsq = delx*delx + dely*dely;
if (rsq > deltasq) continue;
}
if (x[i][dim] > max) max = x[i][dim];
}
MPI_Allreduce(&max,&maxall,1,MPI_DOUBLE,MPI_MAX,world);
if (dimension == 2)
coord[1] = maxall + lo + random->uniform()*(hi-lo);
else
coord[2] = maxall + lo + random->uniform()*(hi-lo);
}
// coords = coords of all atoms
// for molecule, perform random rotation around center pt
// apply PBC so final coords are inside box
// also modify image flags due to PBC
if (mode == ATOM) {
natom = 1;
coords[0][0] = coord[0];
coords[0][1] = coord[1];
coords[0][2] = coord[2];
imageflags[0] = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
} else {
double rng = random->uniform();
imol = 0;
while (rng > molfrac[imol]) imol++;
natom = onemols[imol]->natoms;
if (dimension == 3) {
r[0] = random->uniform() - 0.5;
r[1] = random->uniform() - 0.5;
r[2] = random->uniform() - 0.5;
} else {
r[0] = r[1] = 0.0;
r[2] = 1.0;
}
double theta = random->uniform() * MY_2PI;
MathExtra::norm3(r);
MathExtra::axisangle_to_quat(r,theta,quat);
MathExtra::quat_to_mat(quat,rotmat);
for (i = 0; i < natom; i++) {
MathExtra::matvec(rotmat,onemols[imol]->dx[i],coords[i]);
coords[i][0] += coord[0];
coords[i][1] += coord[1];
coords[i][2] += coord[2];
imageflags[i] = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
domain->remap(coords[i],imageflags[i]);
}
}
// check distance between any existing atom and any inserted atom
// if less than near, try again
// use minimum_image() to account for PBC
double **x = atom->x;
int nlocal = atom->nlocal;
flag = 0;
for (m = 0; m < natom; m++) {
for (i = 0; i < nlocal; i++) {
delx = coords[m][0] - x[i][0];
dely = coords[m][1] - x[i][1];
delz = coords[m][2] - x[i][2];
domain->minimum_image(delx,dely,delz);
rsq = delx*delx + dely*dely + delz*delz;
if (rsq < nearsq) flag = 1;
}
}
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_MAX,world);
if (flagall) continue;
// proceed with insertion
nlocalprev = atom->nlocal;
// choose random velocity for new particle
// used for every atom in molecule
vnew[0] = vxlo + random->uniform() * (vxhi-vxlo);
vnew[1] = vylo + random->uniform() * (vyhi-vylo);
vnew[2] = vzlo + random->uniform() * (vzhi-vzlo);
// if target specified, change velocity vector accordingly
if (targetflag) {
double vel = sqrt(vnew[0]*vnew[0] + vnew[1]*vnew[1] + vnew[2]*vnew[2]);
delx = tx - coord[0];
dely = ty - coord[1];
delz = tz - coord[2];
double rsq = delx*delx + dely*dely + delz*delz;
if (rsq > 0.0) {
double rinv = sqrt(1.0/rsq);
vnew[0] = delx*rinv*vel;
vnew[1] = dely*rinv*vel;
vnew[2] = delz*rinv*vel;
}
}
// check if new atoms are in my sub-box or above it if I am highest proc
// if so, add atom to my list via create_atom()
// initialize additional info about the atoms
// set group mask to "all" plus fix group
for (m = 0; m < natom; m++) {
if (domain->triclinic) {
domain->x2lamda(coords[m],lamda);
newcoord = lamda;
} else newcoord = coords[m];
flag = 0;
if (newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] &&
newcoord[1] >= sublo[1] && newcoord[1] < subhi[1] &&
newcoord[2] >= sublo[2] && newcoord[2] < subhi[2]) flag = 1;
else if (dimension == 3 && newcoord[2] >= domain->boxhi[2]) {
if (comm->layout != LAYOUT_TILED) {
if (comm->myloc[2] == comm->procgrid[2]-1 &&
newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] &&
newcoord[1] >= sublo[1] && newcoord[1] < subhi[1]) flag = 1;
} else {
if (comm->mysplit[2][1] == 1.0 &&
newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] &&
newcoord[1] >= sublo[1] && newcoord[1] < subhi[1]) flag = 1;
}
} else if (dimension == 2 && newcoord[1] >= domain->boxhi[1]) {
if (comm->layout != LAYOUT_TILED) {
if (comm->myloc[1] == comm->procgrid[1]-1 &&
newcoord[0] >= sublo[0] && newcoord[0] < subhi[0]) flag = 1;
} else {
if (comm->mysplit[1][1] == 1.0 &&
newcoord[0] >= sublo[0] && newcoord[0] < subhi[0]) flag = 1;
}
}
if (flag) {
if (mode == ATOM) atom->avec->create_atom(ntype,coords[m]);
else atom->avec->create_atom(ntype+onemols[imol]->type[m],coords[m]);
n = atom->nlocal - 1;
atom->tag[n] = maxtag_all + m+1;
if (mode == MOLECULE) {
if (atom->molecule_flag) atom->molecule[n] = maxmol_all+1;
if (atom->molecular == 2) {
atom->molindex[n] = 0;
atom->molatom[n] = m;
}
}
atom->mask[n] = 1 | groupbit;
atom->image[n] = imageflags[m];
atom->v[n][0] = vnew[0];
atom->v[n][1] = vnew[1];
atom->v[n][2] = vnew[2];
- if (mode == MOLECULE)
+ if (mode == MOLECULE) {
+ onemols[imol]->quat_external = quat;
atom->add_molecule_atom(onemols[imol],m,n,maxtag_all);
+ }
modify->create_attribute(n);
}
}
// FixRigidSmall::set_molecule stores rigid body attributes
// coord is new position of geometric center of mol, not COM
// FixShake::set_molecule stores shake info for molecule
if (rigidflag)
fixrigid->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat);
else if (shakeflag)
fixshake->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat);
// old code: unsuccessful if no proc performed insertion of an atom
// don't think that check is necessary
// if get this far, should always be succesful
// would be hard to undo partial insertion for a molecule
// better to check how many atoms could be inserted (w/out inserting)
// then sum to insure all are inserted, before doing actual insertion
// MPI_Allreduce(&flag,&success,1,MPI_INT,MPI_MAX,world);
success = 1;
break;
}
// warn if not successful b/c too many attempts
if (!success && comm->me == 0)
error->warning(FLERR,"Particle deposition was unsuccessful",0);
// reset global natoms,nbonds,etc
// increment maxtag_all and maxmol_all if necessary
// if global map exists, reset it now instead of waiting for comm
- // since adding atoms messes up ghosts
+ // since other pre-exchange fixes may use it
+ // invoke map_init() b/c atom count has grown
if (success) {
atom->natoms += natom;
if (atom->natoms < 0)
error->all(FLERR,"Too many total atoms");
if (mode == MOLECULE) {
atom->nbonds += onemols[imol]->nbonds;
atom->nangles += onemols[imol]->nangles;
atom->ndihedrals += onemols[imol]->ndihedrals;
atom->nimpropers += onemols[imol]->nimpropers;
}
maxtag_all += natom;
if (maxtag_all >= MAXTAGINT)
error->all(FLERR,"New atom IDs exceed maximum allowed ID");
if (mode == MOLECULE && atom->molecule_flag) maxmol_all++;
if (atom->map_style) {
- atom->nghost = 0;
atom->map_init();
atom->map_set();
}
}
// next timestep to insert
// next_reneighbor = 0 if done
if (success) ninserted++;
if (ninserted < ninsert) next_reneighbor += nfreq;
else next_reneighbor = 0;
}
/* ----------------------------------------------------------------------
maxtag_all = current max atom ID for all atoms
maxmol_all = current max molecule ID for all atoms
------------------------------------------------------------------------- */
void FixDeposit::find_maxid()
{
tagint *tag = atom->tag;
tagint *molecule = atom->molecule;
int nlocal = atom->nlocal;
tagint max = 0;
for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
MPI_Allreduce(&max,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
if (mode == MOLECULE && molecule) {
max = 0;
for (int i = 0; i < nlocal; i++) max = MAX(max,molecule[i]);
MPI_Allreduce(&max,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
}
}
/* ----------------------------------------------------------------------
parse optional parameters at end of input line
------------------------------------------------------------------------- */
void FixDeposit::options(int narg, char **arg)
{
// defaults
iregion = -1;
idregion = NULL;
mode = ATOM;
molfrac = NULL;
rigidflag = 0;
idrigid = NULL;
shakeflag = 0;
idshake = NULL;
idnext = 0;
globalflag = localflag = 0;
lo = hi = deltasq = 0.0;
nearsq = 0.0;
maxattempt = 10;
rateflag = 0;
vxlo = vxhi = vylo = vyhi = vzlo = vzhi = 0.0;
scaleflag = 1;
targetflag = 0;
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"region") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
iregion = domain->find_region(arg[iarg+1]);
if (iregion == -1)
error->all(FLERR,"Region ID for fix deposit does not exist");
int n = strlen(arg[iarg+1]) + 1;
idregion = new char[n];
strcpy(idregion,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"mol") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
int imol = atom->find_molecule(arg[iarg+1]);
if (imol == -1)
error->all(FLERR,"Molecule template ID for fix deposit does not exist");
mode = MOLECULE;
onemols = &atom->molecules[imol];
nmol = onemols[0]->nset;
delete [] molfrac;
molfrac = new double[nmol];
molfrac[0] = 1.0/nmol;
for (int i = 1; i < nmol-1; i++) molfrac[i] = molfrac[i-1] + 1.0/nmol;
molfrac[nmol-1] = 1.0;
iarg += 2;
} else if (strcmp(arg[iarg],"molfrac") == 0) {
if (mode != MOLECULE) error->all(FLERR,"Illegal fix deposit command");
if (iarg+nmol+1 > narg) error->all(FLERR,"Illegal fix deposit command");
molfrac[0] = force->numeric(FLERR,arg[iarg+1]);
for (int i = 1; i < nmol; i++)
molfrac[i] = molfrac[i-1] + force->numeric(FLERR,arg[iarg+i+1]);
if (molfrac[nmol-1] < 1.0-EPSILON || molfrac[nmol-1] > 1.0+EPSILON)
error->all(FLERR,"Illegal fix deposit command");
molfrac[nmol-1] = 1.0;
iarg += nmol+1;
} else if (strcmp(arg[iarg],"rigid") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
int n = strlen(arg[iarg+1]) + 1;
delete [] idrigid;
idrigid = new char[n];
strcpy(idrigid,arg[iarg+1]);
rigidflag = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"shake") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
int n = strlen(arg[iarg+1]) + 1;
delete [] idshake;
idshake = new char[n];
strcpy(idshake,arg[iarg+1]);
shakeflag = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"id") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
if (strcmp(arg[iarg+1],"max") == 0) idnext = 0;
else if (strcmp(arg[iarg+1],"next") == 0) idnext = 1;
else error->all(FLERR,"Illegal fix deposit command");
iarg += 2;
} else if (strcmp(arg[iarg],"global") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command");
globalflag = 1;
localflag = 0;
lo = force->numeric(FLERR,arg[iarg+1]);
hi = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"local") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command");
localflag = 1;
globalflag = 0;
lo = force->numeric(FLERR,arg[iarg+1]);
hi = force->numeric(FLERR,arg[iarg+2]);
deltasq = force->numeric(FLERR,arg[iarg+3]) *
force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"near") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
nearsq = force->numeric(FLERR,arg[iarg+1]) *
force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"attempt") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
maxattempt = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"rate") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
rateflag = 1;
rate = force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"vx") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command");
vxlo = force->numeric(FLERR,arg[iarg+1]);
vxhi = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"vy") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command");
vylo = force->numeric(FLERR,arg[iarg+1]);
vyhi = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"vz") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command");
vzlo = force->numeric(FLERR,arg[iarg+1]);
vzhi = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"units") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
else error->all(FLERR,"Illegal fix deposit command");
iarg += 2;
} else if (strcmp(arg[iarg],"target") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command");
tx = force->numeric(FLERR,arg[iarg+1]);
ty = force->numeric(FLERR,arg[iarg+2]);
tz = force->numeric(FLERR,arg[iarg+3]);
targetflag = 1;
iarg += 4;
} else error->all(FLERR,"Illegal fix deposit command");
}
}
/* ----------------------------------------------------------------------
pack entire state of Fix into one write
------------------------------------------------------------------------- */
void FixDeposit::write_restart(FILE *fp)
{
int n = 0;
double list[4];
list[n++] = random->state();
list[n++] = ninserted;
list[n++] = nfirst;
list[n++] = next_reneighbor;
if (comm->me == 0) {
int size = n * sizeof(double);
fwrite(&size,sizeof(int),1,fp);
fwrite(list,sizeof(double),n,fp);
}
}
/* ----------------------------------------------------------------------
use state info from restart file to restart the Fix
------------------------------------------------------------------------- */
void FixDeposit::restart(char *buf)
{
int n = 0;
double *list = (double *) buf;
seed = static_cast<int> (list[n++]);
ninserted = static_cast<int> (list[n++]);
nfirst = static_cast<int> (list[n++]);
next_reneighbor = static_cast<int> (list[n++]);
random->reset(seed);
}
/* ----------------------------------------------------------------------
extract particle radius for atom type = itype
------------------------------------------------------------------------- */
void *FixDeposit::extract(const char *str, int &itype)
{
if (strcmp(str,"radius") == 0) {
if (mode == ATOM) {
if (itype == ntype) oneradius = 0.5;
else oneradius = 0.0;
} else {
- // find a molecule in template with matching type
+ // loop over onemols molecules
+ // skip a molecule with no atoms as large as itype
+ oneradius = 0.0;
for (int i = 0; i < nmol; i++) {
- if (itype-ntype > onemols[i]->ntypes) continue;
+ if (itype > ntype+onemols[i]->ntypes) continue;
double *radius = onemols[i]->radius;
int *type = onemols[i]->type;
int natoms = onemols[i]->natoms;
- // check radii of matching types in Molecule
+ // check radii of atoms in Molecule with matching types
// default to 0.5, if radii not defined in Molecule
// same as atom->avec->create_atom(), invoked in pre_exchange()
- oneradius = 0.0;
for (int i = 0; i < natoms; i++)
- if (type[i] == itype-ntype) {
+ if (type[i]+ntype == itype) {
if (radius) oneradius = MAX(oneradius,radius[i]);
- else oneradius = 0.5;
+ else oneradius = MAX(oneradius,0.5);
}
}
}
itype = 0;
return &oneradius;
}
return NULL;
}
diff --git a/src/Makefile b/src/Makefile
index 982bdb087..f9fe676ce 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,323 +1,324 @@
# LAMMPS multiple-machine -*- Makefile -*-
SHELL = /bin/bash
#.IGNORE:
# Definitions
ROOT = lmp
EXE = lmp_$@
ARLIB = liblammps_$@.a
SHLIB = liblammps_$@.so
ARLINK = liblammps.a
SHLINK = liblammps.so
OBJDIR = Obj_$@
OBJSHDIR = Obj_shared_$@
SRC = $(wildcard *.cpp)
INC = $(wildcard *.h)
OBJ = $(SRC:.cpp=.o)
SRCLIB = $(filter-out main.cpp,$(SRC))
OBJLIB = $(filter-out main.o,$(OBJ))
# Command-line options for mode: exe (default), shexe, lib, shlib
mode = exe
objdir = $(OBJDIR)
ifeq ($(mode),shexe)
objdir = $(OBJSHDIR)
endif
ifeq ($(mode),lib)
objdir = $(OBJDIR)
endif
ifeq ($(mode),shlib)
objdir = $(OBJSHDIR)
endif
# Package variables
PACKAGE = asphere body class2 colloid compress coreshell dipole fld gpu \
granular kim kokkos kspace manybody mc meam misc molecule mpiio \
opt peri poems python qeq replica rigid shock snap srd \
voronoi xtc
PACKUSER = user-atc user-awpmd user-cg-cmm user-colvars user-cuda \
user-diffraction user-drude user-eff user-fep user-h5md \
user-intel user-lb user-mgpt \
user-misc user-molfile user-omp user-phonon user-qmmm user-qtb \
user-quip user-reaxc user-smd user-smtbq user-sph user-tally
PACKLIB = compress gpu kim kokkos meam mpiio poems python voronoi \
user-atc user-awpmd user-colvars user-cuda user-h5md user-intel \
user-lb user-molfile user-qmmm user-quip user-smd
PACKALL = $(PACKAGE) $(PACKUSER)
PACKAGEUC = $(shell echo $(PACKAGE) | tr a-z A-Z)
PACKUSERUC = $(shell echo $(PACKUSER) | tr a-z A-Z)
YESDIR = $(shell echo $(@:yes-%=%) | tr a-z A-Z)
NODIR = $(shell echo $(@:no-%=%) | tr a-z A-Z)
# List of all targets
help:
@echo ''
@echo 'make clean-all delete all object files'
@echo 'make clean-machine delete object files for one machine'
@echo 'make mpi-stubs build dummy MPI library in STUBS'
@echo 'make install-python install LAMMPS wrapper in Python'
@echo 'make tar create lmp_src.tar.gz of src dir and packages'
@echo ''
@echo 'make package list available packages'
@echo 'make package-status (ps) status of all packages'
@echo 'make yes-package install a single pgk in src dir'
@echo 'make no-package remove a single pkg from src dir'
@echo 'make yes-all install all pgks in src dir'
@echo 'make no-all remove all pkgs from src dir'
@echo 'make yes-standard (yes-std) install all standard pkgs'
@echo 'make no-standard (no-std) remove all standard pkgs'
@echo 'make yes-user install all user pkgs'
@echo 'make no-user remove all user pkgs'
@echo 'make no-lib remove all pkgs with external libs'
@echo ''
@echo 'make package-update (pu) replace src files with updated package files'
@echo 'make package-overwrite replace package files with src files'
@echo 'make package-diff (pd) diff src files against package files'
@echo 'make package-purge purge obsolete copies of package sources'
@echo ''
@echo 'make machine build LAMMPS for machine'
@echo 'make mode=lib machine build LAMMPS as static lib for machine'
@echo 'make mode=shlib machine build LAMMPS as shared lib for machine'
@echo 'make mode=shexe machine build LAMMPS as shared exe for machine'
@echo 'make makelist create Makefile.list used by old makes'
@echo 'make -f Makefile.list machine build LAMMPS for machine (old)'
@echo ''
@echo 'machine is one of these from src/MAKE:'
@echo ''
@files="`ls MAKE/Makefile.*`"; \
for file in $$files; do head -1 $$file; done
@echo ''
@echo '... or one of these from src/MAKE/OPTIONS:'
@echo ''
@files="`ls MAKE/OPTIONS/Makefile.*`"; \
for file in $$files; do head -1 $$file; done
@echo ''
@echo '... or one of these from src/MAKE/MACHINES:'
@echo ''
@files="`ls MAKE/MACHINES/Makefile.*`"; \
for file in $$files; do head -1 $$file; done
@echo ''
@echo '... or one of these from src/MAKE/MINE:'
@echo ''
@files="`ls MAKE/MINE/Makefile.* 2>/dev/null`"; \
for file in $$files; do head -1 $$file; done
@echo ''
# Build LAMMPS in one of 4 modes
# exe = exe with static compile in Obj_machine (default)
# shexe = exe with shared compile in Obj_shared_machine
# lib = static lib in Obj_machine
# shlib = shared lib in Obj_shared_machine
.DEFAULT:
@if [ $@ = "serial" -a ! -f STUBS/libmpi_stubs.a ]; \
then $(MAKE) mpi-stubs; fi
@test -f MAKE/Makefile.$@ -o -f MAKE/OPTIONS/Makefile.$@ -o \
-f MAKE/MACHINES/Makefile.$@ -o -f MAKE/MINE/Makefile.$@
@if [ ! -d $(objdir) ]; then mkdir $(objdir); fi
@$(SHELL) Make.sh style
@if [ -f MAKE/MACHINES/Makefile.$@ ]; \
then cp MAKE/MACHINES/Makefile.$@ $(objdir)/Makefile; fi
@if [ -f MAKE/OPTIONS/Makefile.$@ ]; \
then cp MAKE/OPTIONS/Makefile.$@ $(objdir)/Makefile; fi
@if [ -f MAKE/Makefile.$@ ]; \
then cp MAKE/Makefile.$@ $(objdir)/Makefile; fi
@if [ -f MAKE/MINE/Makefile.$@ ]; \
then cp MAKE/MINE/Makefile.$@ $(objdir)/Makefile; fi
@if [ ! -e Makefile.package ]; \
then cp Makefile.package.empty Makefile.package; fi
@if [ ! -e Makefile.package.settings ]; \
then cp Makefile.package.settings.empty Makefile.package.settings; fi
@cp Makefile.package Makefile.package.settings $(objdir)
ifeq ($(mode),exe)
@cd $(objdir); \
$(MAKE) $(MFLAGS) "OBJ = $(OBJ)" "INC = $(INC)" "SHFLAGS =" \
"EXE = ../$(EXE)" ../$(EXE)
endif
ifeq ($(mode),shexe)
@cd $(objdir); \
$(MAKE) $(MFLAGS) "OBJ = $(OBJ)" "INC = $(INC)" \
"EXE = ../$(EXE)" ../$(EXE)
endif
ifeq ($(mode),lib)
@cd $(objdir); \
$(MAKE) $(MFLAGS) "OBJ = $(OBJLIB)" "INC = $(INC)" "SHFLAGS =" \
"EXE = ../$(ARLIB)" lib
@rm -f $(ARLINK)
@ln -s $(ARLIB) $(ARLINK)
endif
ifeq ($(mode),shlib)
@cd $(objdir); \
$(MAKE) $(MFLAGS) "OBJ = $(OBJLIB)" "INC = $(INC)" \
"EXE = ../$(SHLIB)" shlib
@rm -f $(SHLINK)
@ln -s $(SHLIB) $(SHLINK)
endif
# Remove machine-specific object files
clean:
@echo 'make clean-all delete all object files'
@echo 'make clean-machine delete object files for one machine'
clean-all:
rm -rf Obj_*
clean-%:
rm -rf Obj_$(@:clean-%=%) Obj_shared_$(@:clean-%=%)
test-clean:
@cd ../test/; $(MAKE) $(MFLAGS) clean; cd ..
test-%:
$(MAKE) $(MFLAGS) $(@:test-%=%)
@cd ../test/; $(MAKE) $(MFLAGS) test MACH=$(@:test-%=%) MPICMD="$(MPICMD)" LMPFLAGS="$(LMPFLAGS)" TAG=$(TAG) || exit 1 ; cd ..
# Create Makefile.list
makelist:
@$(SHELL) Make.sh style
@$(SHELL) Make.sh Makefile.list
# Make MPI STUBS library
mpi-stubs:
@cd STUBS; $(MAKE) clean; $(MAKE)
# install LAMMPS shared lib and Python wrapper for Python usage
install-python:
@python ../python/install.py
# Create a tarball of src dir and packages
tar:
@cd STUBS; $(MAKE) clean
@cd ..; tar cvzf src/$(ROOT)_src.tar.gz \
- src/Make* src/Package.sh src/MAKE src/*.cpp src/*.h src/STUBS \
+ src/Make* src/Package.sh src/Depend.sh \
+ src/MAKE src/*.cpp src/*.h src/STUBS \
$(patsubst %,src/%,$(PACKAGEUC)) $(patsubst %,src/%,$(PACKUSERUC)) \
--exclude=*/.svn
@cd STUBS; $(MAKE)
@echo "Created $(ROOT)_src.tar.gz"
# Package management
package:
@echo 'Standard packages:' $(PACKAGE)
@echo ''
@echo 'User-contributed packages:' $(PACKUSER)
@echo ''
@echo 'make package list available packages'
@echo 'make package-status (ps) status of all packages'
@echo 'make yes-package install a single pgk in src dir'
@echo 'make no-package remove a single pkg from src dir'
@echo 'make yes-all install all pgks in src dir'
@echo 'make no-all remove all pkgs from src dir'
@echo 'make yes-standard (yes-std) install all standard pkgs'
@echo 'make no-standard (no-srd) remove all standard pkgs'
@echo ''
@echo 'make yes-user install all user pkgs'
@echo 'make no-user remove all user pkgs'
@echo 'make no-lib remove all pkgs with external libs'
@echo 'make package-update (pu) replace src files with package files'
@echo 'make package-overwrite replace package files with src files'
@echo 'make package-diff (pd) diff src files against package file'
yes-all:
@for p in $(PACKALL); do $(MAKE) yes-$$p; done
no-all:
@for p in $(PACKALL); do $(MAKE) no-$$p; done
yes-standard yes-std:
@for p in $(PACKAGE); do $(MAKE) yes-$$p; done
no-standard no-std:
@for p in $(PACKAGE); do $(MAKE) no-$$p; done
yes-user:
@for p in $(PACKUSER); do $(MAKE) yes-$$p; done
no-user:
@for p in $(PACKUSER); do $(MAKE) no-$$p; done
no-lib:
@for p in $(PACKLIB); do $(MAKE) no-$$p; done
yes-%:
@if [ ! -e Makefile.package ]; \
then cp Makefile.package.empty Makefile.package; fi
@if [ ! -e Makefile.package.settings ]; \
then cp Makefile.package.settings.empty Makefile.package.settings; fi
@if [ ! -e $(YESDIR) ]; then \
echo "Package $(@:yes-%=%) does not exist"; \
elif [ -e $(YESDIR)/Install.sh ]; then \
echo "Installing package $(@:yes-%=%)"; \
cd $(YESDIR); $(SHELL) Install.sh 1; cd ..; \
$(SHELL) Depend.sh $(YESDIR) 1; \
else \
echo "Installing package $(@:yes-%=%)"; \
cd $(YESDIR); $(SHELL) ../Install.sh 1; cd ..; \
$(SHELL) Depend.sh $(YESDIR) 1; \
fi;
no-%:
@if [ ! -e $(NODIR) ]; then \
echo "Package $(@:no-%=%) does not exist"; \
elif [ -e $(NODIR)/Install.sh ]; then \
echo "Uninstalling package $(@:no-%=%)"; \
cd $(NODIR); $(SHELL) Install.sh 0; cd ..; \
$(SHELL) Depend.sh $(NODIR) 0; \
else \
echo "Uninstalling package $(@:no-%=%)"; \
cd $(NODIR); $(SHELL) ../Install.sh 0; cd ..; \
$(SHELL) Depend.sh $(NODIR) 0; \
fi;
# status = list src files that differ from package files
# update = replace src files with newer package files
# overwrite = overwrite package files with newer src files
# diff = show differences between src and package files
# purge = delete obsolete and auto-generated package files
package-status ps:
@for p in $(PACKAGEUC); do $(SHELL) Package.sh $$p status; done
@echo ''
@for p in $(PACKUSERUC); do $(SHELL) Package.sh $$p status; done
package-update pu:
@for p in $(PACKAGEUC); do $(SHELL) Package.sh $$p update; done
@echo ''
@for p in $(PACKUSERUC); do $(SHELL) Package.sh $$p update; done
package-overwrite:
@for p in $(PACKAGEUC); do $(SHELL) Package.sh $$p overwrite; done
@echo ''
@for p in $(PACKUSERUC); do $(SHELL) Package.sh $$p overwrite; done
package-diff pd:
@for p in $(PACKAGEUC); do $(SHELL) Package.sh $$p diff; done
@echo ''
@for p in $(PACKUSERUC); do $(SHELL) Package.sh $$p diff; done
package-purge: Purge.list
@echo 'Purging obsolete and auto-generated source files'
@for f in `grep -v '#' Purge.list` ; \
do test -f $$f && rm $$f && echo $$f || : ; \
done
diff --git a/src/Purge.list b/src/Purge.list
index 3cfe02778..b44df9879 100644
--- a/src/Purge.list
+++ b/src/Purge.list
@@ -1,267 +1,272 @@
# auto-generated style files
style_angle.h
style_atom.h
style_bond.h
style_command.h
style_compute.h
style_dihedral.h
style_dump.h
style_fix.h
style_improper.h
style_integrate.h
style_kspace.h
style_minimize.h
style_pair.h
style_region.h
+# deleted on 15 Jan 2016
+pair_line_lj.cpp
+pair_line_lj.h
+pair_tri_lj.cpp
+pair_tri_lj.h
# deleted on 13 May 14
commgrid.cpp
commgrid.h
# deleted on 5 May 14
reaxc_basic_comm.cpp
reaxc_basic_comm.h
# deleted on 15 Apr 14
pppm_old.cpp
pppm_old.h
# deleted on Thu Jun 6 15:19:12 2013 +0000
pair_dipole_cut.h
pair_dipole_cut.cpp
pair_dipole_cut_gpu.h
pair_dipole_cut_gpu.cpp
pair_dipole_cut_omp.h
pair_dipole_cut_omp.cpp
pair_dipole_sf.h
pair_dipole_sf.cpp
pair_dipole_sf_omp.h
pair_dipole_sf_omp.cpp
pair_dipole_sf_gpu.h
pair_dipole_sf_gpu.cpp
# deleted on Wed May 8 15:24:36 2013 +0000
compute_spec_atom.cpp
compute_spec_atom.h
fix_species.cpp
fix_species.h
# deleted on Fri Oct 19 15:27:15 2012 +0000
pair_lj_charmm_coul_long_proxy_omp.cpp
pair_lj_charmm_coul_long_proxy_omp.h
pair_lj_class2_coul_long_proxy_omp.cpp
pair_lj_class2_coul_long_proxy_omp.h
pair_lj_cut_coul_long_proxy_omp.cpp
pair_lj_cut_coul_long_proxy_omp.h
pair_lj_cut_tip4p_long_proxy_omp.cpp
pair_lj_cut_tip4p_long_proxy_omp.h
pppm_proxy.cpp
pppm_proxy.h
pppm_tip4p_proxy.cpp
pppm_tip4p_proxy.h
# deleted on Wed Oct 3 15:17:27 2012 +0000
pair_lj_cut_coul_long_proxy_tip4p_omp.cpp
pair_lj_cut_coul_long_proxy_tip4p_omp.h
# deleted on Wed Oct 3 15:06:24 2012 +0000
pair_lj_cut_coul_long_tip4p_opt.cpp
pair_lj_cut_coul_long_tip4p_opt.h
# deleted on Wed Oct 3 14:53:43 2012 +0000
pair_lj_charmm_coul_long_proxy_omp.cpp
pair_lj_charmm_coul_long_proxy_omp.h
pair_lj_class2_coul_long_proxy_omp.cpp
pair_lj_class2_coul_long_proxy_omp.h
pair_lj_cut_coul_long_proxy_omp.cpp
pair_lj_cut_coul_long_proxy_omp.h
pair_lj_cut_coul_long_tip4p_omp.cpp
pair_lj_cut_coul_long_tip4p_omp.h
# deleted on Wed Oct 3 14:50:44 2012 +0000
pair_buck_disp_coul_long_omp.cpp
pair_buck_disp_coul_long_omp.h
pair_lj_disp_coul_long_omp.cpp
pair_lj_disp_coul_long_omp.h
# deleted on Wed Oct 3 14:46:42 2012 +0000
pair_lj_cut_coul_long_tip4p.cpp
pair_lj_cut_coul_long_tip4p.h
# deleted on Wed Oct 3 14:46:23 2012 +0000
pair_buck_disp_coul_long.cpp
pair_buck_disp_coul_long.h
pair_lj_disp_coul_long.cpp
pair_lj_disp_coul_long.h
pair_lj_disp_coul_long_tip4p.cpp
pair_lj_disp_coul_long_tip4p.h
# deleted on Tue Oct 2 22:50:58 2012 +0000
pair_buck_coul_omp.cpp
pair_buck_coul_omp.h
pair_lj_coul_omp.cpp
pair_lj_coul_omp.h
# deleted on Tue Oct 2 20:12:27 2012 +0000
pair_lj_charmm_coul_pppm_omp.cpp
pair_lj_charmm_coul_pppm_omp.h
pair_lj_class2_coul_pppm_omp.cpp
pair_lj_class2_coul_pppm_omp.h
pair_lj_cut_coul_pppm_omp.cpp
pair_lj_cut_coul_pppm_omp.h
pair_lj_cut_coul_pppm_tip4p_omp.cpp
pair_lj_cut_coul_pppm_tip4p_omp.h
# deleted on Tue Oct 2 19:59:40 2012 +0000
pair_buck_coul_omp.cpp
pair_buck_coul_omp.h
pair_lj_coul_omp.cpp
pair_lj_coul_omp.h
pair_lj_cut_coul_long_tip4p_omp.cpp
pair_lj_cut_coul_long_tip4p_omp.h
pppm_proxy.cpp
pppm_proxy.h
pppm_tip4p_proxy.cpp
pppm_tip4p_proxy.h
# deleted on Tue Oct 2 19:58:21 2012 +0000
pair_lj_cut_coul_pppm_omp.cpp
pair_lj_cut_coul_pppm_omp.h
pair_lj_cut_coul_pppm_tip4p_omp.cpp
pair_lj_cut_coul_pppm_tip4p_omp.h
# deleted on Tue Oct 2 19:58:03 2012 +0000
pair_lj_charmm_coul_pppm_omp.cpp
pair_lj_charmm_coul_pppm_omp.h
pair_lj_class2_coul_pppm_omp.cpp
pair_lj_class2_coul_pppm_omp.h
# deleted on Tue Oct 2 16:36:24 2012 +0000
ewald_n.cpp
ewald_n.h
pair_buck_coul.cpp
pair_buck_coul.h
pair_lj_coul.cpp
pair_lj_coul.h
# deleted on Wed Jul 25 15:17:24 2012 +0000
pair_lj_sdk_coul_cut_cuda.cpp
pair_lj_sdk_coul_cut_cuda.h
pair_lj_sdk_coul_debye_cuda.cpp
pair_lj_sdk_coul_debye_cuda.h
# deleted on Tue Jul 24 14:55:49 2012 +0000
pair_cg_cmm_coul_cut_cuda.cpp
pair_cg_cmm_coul_cut_cuda.h
pair_cg_cmm_coul_debye_cuda.cpp
pair_cg_cmm_coul_debye_cuda.h
pair_cg_cmm_coul_long_cuda.cpp
pair_cg_cmm_coul_long_cuda.h
pair_cg_cmm_cuda.cpp
pair_cg_cmm_cuda.h
# deleted on Sat Dec 31 20:27:05 2011 -0500
ewald_cg.cpp
ewald_cg.h
# deleted on Sat Dec 31 20:01:21 2011 -0500
dihedral_omp.cpp
dihedral_omp.h
pair_cg_cmm_omp.cpp
pair_cg_cmm_omp.h
pair_lj_cut_coul_long_tip4p_omp.cpp
pair_lj_cut_coul_long_tip4p_omp.h
pair_omp.cpp
pair_omp.h
# deleted on Thu Dec 8 23:13:51 2011 +0000
pair_cg_cmm_coul_long_gpu.cpp
pair_cg_cmm_coul_long_gpu.h
pair_cg_cmm_gpu.cpp
pair_cg_cmm_gpu.h
# deleted on Mon Nov 7 19:32:59 2011 -0500
pair_cg_cmm_coul_long_gpu.cpp
pair_cg_cmm_coul_long_gpu.h
pair_cg_cmm_gpu.cpp
pair_cg_cmm_gpu.h
# deleted on Tue Oct 25 23:04:03 2011 -0400
lj_sdk_common.cpp
# deleted on Fri Oct 7 08:55:40 2011 -0400
pair_hybrid_overlay_omp.cpp
pair_hybrid_overlay_omp.h
# deleted on Fri Oct 7 08:54:38 2011 -0400
angle_hybrid_omp.cpp
angle_hybrid_omp.h
bond_hybrid_omp.cpp
bond_hybrid_omp.h
dihedral_hybrid_omp.cpp
dihedral_hybrid_omp.h
improper_hybrid_omp.cpp
improper_hybrid_omp.h
pair_hybrid_omp.cpp
pair_hybrid_omp.h
# deleted on Mon Aug 22 13:48:15 2011 -0400
omp_thr.cpp
omp_thr.h
# deleted on Mon Aug 8 22:56:28 2011 +0000
dihedral_cosineshiftexp.cpp
dihedral_cosineshiftexp.h
# deleted on Mon Aug 8 22:55:20 2011 +0000
angle_cosineshift.cpp
angle_cosineshift.h
angle_cosineshiftexp.cpp
angle_cosineshiftexp.h
# deleted on Mon Aug 8 19:25:08 2011 +0000
pppm_gpu_double.cpp
pppm_gpu_double.h
pppm_gpu_single.cpp
pppm_gpu_single.h
# deleted on Fri Apr 15 20:57:03 2011 -0400
pair_lj_charmm_coul_long_gpu2.cpp
pair_lj_charmm_coul_long_gpu2.h
# deleted on Wed Apr 13 21:40:14 2011 +0000
atom_vec_colloid.cpp
atom_vec_colloid.h
atom_vec_granular.cpp
atom_vec_granular.h
# deleted on Fri Nov 19 12:53:07 2010 -0500
fix_pour_omp.cpp
fix_pour_omp.h
# deleted on Thu Aug 19 23:20:14 2010 +0000
fix_qeq.cpp
fix_qeq.h
# deleted on Thu Jun 17 01:34:38 2010 +0000
compute_vsum.cpp
compute_vsum.h
# deleted on Mon Jun 14 11:06:46 2010 -0400
pair_buck_coul_omp.cpp
pair_buck_coul_omp.h
pair_lj_coul_omp.cpp
pair_lj_coul_omp.h
# deleted on Thu Jun 10 15:39:08 2010 -0400
pair_buck_coul_omp.cpp
pair_buck_coul_omp.h
# deleted on Tue Jun 8 15:42:51 2010 -0400
pair_buck_coul_omp.cpp
pair_buck_coul_omp.h
# deleted on Thu Dec 17 23:52:31 2009 +0000
dump_bond.cpp
dump_bond.h
# deleted on Mon Nov 9 18:20:20 2009 +0000
atom_vec_dpd.cpp
atom_vec_dpd.h
style_dpd.h
# deleted on Mon Jun 22 21:11:31 2009 +0000
fix_write_reax_bonds.cpp
fix_write_reax_bonds.h
# deleted on Thu Jan 8 16:53:09 2009 +0000
pair_gran_hertzian.cpp
pair_gran_hertzian.h
pair_gran_history.cpp
pair_gran_history.h
pair_gran_no_history.cpp
pair_gran_no_history.h
# deleted on Mon Mar 17 23:24:44 2008 +0000
compute_temp_dipole.cpp
compute_temp_dipole.h
fix_nve_dipole.cpp
fix_nve_dipole.h
# deleted on Mon Mar 17 23:23:24 2008 +0000
fix_nve_gran.cpp
fix_nve_gran.h
# deleted on Fri Nov 30 21:49:20 2007 +0000
fix_gran_diag.cpp
fix_gran_diag.h
atom_angle.cpp
atom_angle.h
atom_bond.cpp
atom_bond.h
atom_full.cpp
atom_full.h
atom_molecular.cpp
atom_molecular.h
# deleted on Tue Jan 30 00:22:05 2007 +0000
atom_dpd.cpp
atom_dpd.h
atom_granular.cpp
atom_granular.h
# deleted on Wed Dec 13 00:34:21 2006 +0000
fix_insert.cpp
fix_insert.h
diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp
index 0c322634d..d33c841b5 100644
--- a/src/QEQ/fix_qeq.cpp
+++ b/src/QEQ/fix_qeq.cpp
@@ -1,758 +1,765 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Ray Shan (Sandia)
Based on fix qeq/reax by H. Metin Aktulga
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "fix_qeq.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "update.h"
#include "force.h"
#include "kspace.h"
#include "group.h"
#include "pair.h"
#include "respa.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
using namespace FixConst;
#define MAXLINE 1024
/* ---------------------------------------------------------------------- */
FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 8) error->all(FLERR,"Illegal fix qeq command");
nevery = force->inumeric(FLERR,arg[3]);
cutoff = force->numeric(FLERR,arg[4]);
tolerance = force->numeric(FLERR,arg[5]);
maxiter = force->inumeric(FLERR,arg[6]);
alpha = 0.20;
swa = 0.0;
swb = cutoff;
shld = NULL;
nlocal = n_cap = 0;
nall = nmax = 0;
m_fill = m_cap = 0;
pack_flag = 0;
s = NULL;
t = NULL;
nprev = 5;
Hdia_inv = NULL;
b_s = NULL;
b_t = NULL;
// CG
p = NULL;
q = NULL;
r = NULL;
d = NULL;
// H matrix
H.firstnbr = NULL;
H.numnbrs = NULL;
H.jlist = NULL;
H.val = NULL;
// others
cutoff_sq = cutoff*cutoff;
chizj = NULL;
qf = NULL;
q1 = NULL;
q2 = NULL;
streitz_flag = 0;
+ qv = NULL;
comm_forward = comm_reverse = 1;
// perform initial allocation of atom-based arrays
// register with Atom class
s_hist = t_hist = NULL;
grow_arrays(atom->nmax);
atom->add_callback(0);
for( int i = 0; i < atom->nmax; i++ )
for (int j = 0; j < nprev; ++j )
s_hist[i][j] = t_hist[i][j] = atom->q[i];
if (strcmp(arg[7],"coul/streitz") == 0) {
streitz_flag = 1;
} else {
read_file(arg[7]);
}
}
/* ---------------------------------------------------------------------- */
FixQEq::~FixQEq()
{
// unregister callbacks to this fix from Atom class
atom->delete_callback(id,0);
memory->destroy(s_hist);
memory->destroy(t_hist);
deallocate_storage();
deallocate_matrix();
memory->destroy(shld);
if (!streitz_flag) {
memory->destroy(chi);
memory->destroy(eta);
memory->destroy(gamma);
memory->destroy(zeta);
memory->destroy(zcore);
}
}
/* ---------------------------------------------------------------------- */
int FixQEq::setmask()
{
int mask = 0;
mask |= PRE_FORCE;
mask |= MIN_PRE_FORCE;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixQEq::allocate_storage()
{
nmax = atom->nmax;
memory->create(s,nmax,"qeq:s");
memory->create(t,nmax,"qeq:t");
memory->create(Hdia_inv,nmax,"qeq:Hdia_inv");
memory->create(b_s,nmax,"qeq:b_s");
memory->create(b_t,nmax,"qeq:b_t");
memory->create(p,nmax,"qeq:p");
memory->create(q,nmax,"qeq:q");
memory->create(r,nmax,"qeq:r");
memory->create(d,nmax,"qeq:d");
memory->create(chizj,nmax,"qeq:chizj");
memory->create(qf,nmax,"qeq:qf");
memory->create(q1,nmax,"qeq:q1");
memory->create(q2,nmax,"qeq:q2");
+
+ memory->create(qv,nmax,"qeq:qv");
}
/* ---------------------------------------------------------------------- */
void FixQEq::deallocate_storage()
{
memory->destroy(s);
memory->destroy(t);
memory->destroy( Hdia_inv );
memory->destroy( b_s );
memory->destroy( b_t );
memory->destroy( p );
memory->destroy( q );
memory->destroy( r );
memory->destroy( d );
memory->destroy( chizj );
memory->destroy( qf );
memory->destroy( q1 );
memory->destroy( q2 );
+
+ memory->destroy( qv );
}
/* ---------------------------------------------------------------------- */
void FixQEq::reallocate_storage()
{
deallocate_storage();
allocate_storage();
init_storage();
}
/* ---------------------------------------------------------------------- */
void FixQEq::allocate_matrix()
{
int i,ii,inum,m;
int *ilist, *numneigh;
int mincap;
double safezone;
mincap = MIN_CAP;
safezone = SAFE_ZONE;
nlocal = atom->nlocal;
n_cap = MAX( (int)(nlocal * safezone), mincap );
nall = atom->nlocal + atom->nghost;
// determine the total space for the H matrix
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
m = 0;
for( ii = 0; ii < inum; ii++ ) {
i = ilist[ii];
m += numneigh[i];
}
m_cap = MAX( (int)(m * safezone), mincap * MIN_NBRS );
H.n = n_cap;
H.m = m_cap;
memory->create(H.firstnbr,n_cap,"qeq:H.firstnbr");
memory->create(H.numnbrs,n_cap,"qeq:H.numnbrs");
memory->create(H.jlist,m_cap,"qeq:H.jlist");
memory->create(H.val,m_cap,"qeq:H.val");
}
/* ---------------------------------------------------------------------- */
void FixQEq::deallocate_matrix()
{
memory->destroy( H.firstnbr );
memory->destroy( H.numnbrs );
memory->destroy( H.jlist );
memory->destroy( H.val );
}
/* ---------------------------------------------------------------------- */
void FixQEq::reallocate_matrix()
{
deallocate_matrix();
allocate_matrix();
}
/* ---------------------------------------------------------------------- */
void FixQEq::init_list(int id, NeighList *ptr)
{
list = ptr;
}
/* ---------------------------------------------------------------------- */
void FixQEq::setup_pre_force(int vflag)
{
if (force->newton_pair == 0)
error->all(FLERR,"QEQ with 'newton pair off' not supported");
neighbor->build_one(list);
deallocate_storage();
allocate_storage();
init_storage();
deallocate_matrix();
allocate_matrix();
pre_force(vflag);
}
/* ---------------------------------------------------------------------- */
void FixQEq::setup_pre_force_respa(int vflag, int ilevel)
{
if (ilevel < nlevels_respa-1) return;
setup_pre_force(vflag);
}
/* ---------------------------------------------------------------------- */
void FixQEq::min_setup_pre_force(int vflag)
{
setup_pre_force(vflag);
}
/* ---------------------------------------------------------------------- */
void FixQEq::init_storage()
{
nlocal = atom->nlocal;
nall = atom->nlocal + atom->nghost;
for( int i = 0; i < nall; i++ ) {
Hdia_inv[i] = 1. / eta[atom->type[i]];
b_s[i] = -chi[atom->type[i]];
b_t[i] = -1.0;
s[i] = t[i] = atom->q[i];
chizj[i] = 0.0;
qf[i] = 0.0;
q1[i] = 0.0;
q2[i] = 0.0;
+
+ qv[i] = 0.0;
}
}
/* ---------------------------------------------------------------------- */
void FixQEq::pre_force_respa(int vflag, int ilevel, int iloop)
{
if (ilevel == nlevels_respa-1) pre_force(vflag);
}
/* ---------------------------------------------------------------------- */
void FixQEq::min_pre_force(int vflag)
{
pre_force(vflag);
}
/* ---------------------------------------------------------------------- */
int FixQEq::CG( double *b, double *x )
{
int loop, i, ii, inum, *ilist;
double tmp, alfa, beta, b_norm;
double sig_old, sig_new;
inum = list->inum;
ilist = list->ilist;
pack_flag = 1;
sparse_matvec( &H, x, q );
comm->reverse_comm_fix( this );
vector_sum( r , 1., b, -1., q, inum );
for( ii = 0; ii < inum; ++ii ) {
i = ilist[ii];
if (atom->mask[i] & groupbit)
d[i] = r[i] * Hdia_inv[i];
}
b_norm = parallel_norm( b, inum );
sig_new = parallel_dot( r, d, inum);
for( loop = 1; loop < maxiter && sqrt(sig_new)/b_norm > tolerance; ++loop ) {
comm->forward_comm_fix(this);
sparse_matvec( &H, d, q );
comm->reverse_comm_fix(this);
tmp = parallel_dot( d, q, inum);
alfa = sig_new / tmp;
vector_add( x, alfa, d, inum );
vector_add( r, -alfa, q, inum );
for( ii = 0; ii < inum; ++ii ) {
i = ilist[ii];
if (atom->mask[i] & groupbit)
p[i] = r[i] * Hdia_inv[i];
}
sig_old = sig_new;
sig_new = parallel_dot( r, p, inum);
beta = sig_new / sig_old;
vector_sum( d, 1., p, beta, d, inum );
}
if (loop >= maxiter && comm->me == 0) {
char str[128];
sprintf(str,"Fix qeq CG convergence failed (%g) after %d iterations "
"at " BIGINT_FORMAT " step",sqrt(sig_new)/b_norm,loop,update->ntimestep);
error->warning(FLERR,str);
}
return loop;
}
/* ---------------------------------------------------------------------- */
void FixQEq::sparse_matvec( sparse_matrix *A, double *x, double *b )
{
int i, j, itr_j;
nlocal = atom->nlocal;
nall = atom->nlocal + atom->nghost;
for( i = 0; i < nlocal; ++i ) {
if (atom->mask[i] & groupbit)
b[i] = eta[ atom->type[i] ] * x[i];
}
for( i = nlocal; i < nall; ++i ) {
if (atom->mask[i] & groupbit)
b[i] = 0;
}
for( i = 0; i < nlocal; ++i ) {
if (atom->mask[i] & groupbit) {
for( itr_j=A->firstnbr[i]; itr_j<A->firstnbr[i]+A->numnbrs[i]; itr_j++) {
j = A->jlist[itr_j];
b[i] += A->val[itr_j] * x[j];
b[j] += A->val[itr_j] * x[i];
}
}
}
}
/* ---------------------------------------------------------------------- */
void FixQEq::calculate_Q()
{
int i, k, inum, ii;
int *ilist;
double u, s_sum, t_sum;
double *q = atom->q;
inum = list->inum;
ilist = list->ilist;
s_sum = parallel_vector_acc( s, inum );
t_sum = parallel_vector_acc( t, inum);
u = s_sum / t_sum;
for( ii = 0; ii < inum; ++ii ) {
i = ilist[ii];
if (atom->mask[i] & groupbit) {
q[i] = s[i] - u * t[i];
for( k = 4; k > 0; --k ) {
s_hist[i][k] = s_hist[i][k-1];
t_hist[i][k] = t_hist[i][k-1];
}
s_hist[i][0] = s[i];
t_hist[i][0] = t[i];
}
}
pack_flag = 4;
comm->forward_comm_fix( this ); //Dist_vector( atom->q );
}
/* ---------------------------------------------------------------------- */
int FixQEq::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int m;
if( pack_flag == 1)
for(m = 0; m < n; m++) buf[m] = d[list[m]];
else if( pack_flag == 2 )
for(m = 0; m < n; m++) buf[m] = s[list[m]];
else if( pack_flag == 3 )
for(m = 0; m < n; m++) buf[m] = t[list[m]];
else if( pack_flag == 4 )
for(m = 0; m < n; m++) buf[m] = atom->q[list[m]];
return m;
}
/* ---------------------------------------------------------------------- */
void FixQEq::unpack_forward_comm(int n, int first, double *buf)
{
int i, m;
if( pack_flag == 1)
for(m = 0, i = first; m < n; m++, i++) d[i] = buf[m];
else if( pack_flag == 2)
for(m = 0, i = first; m < n; m++, i++) s[i] = buf[m];
else if( pack_flag == 3)
for(m = 0, i = first; m < n; m++, i++) t[i] = buf[m];
else if( pack_flag == 4)
for(m = 0, i = first; m < n; m++, i++) atom->q[i] = buf[m];
}
/* ---------------------------------------------------------------------- */
int FixQEq::pack_reverse_comm(int n, int first, double *buf)
{
int i, m;
for(m = 0, i = first; m < n; m++, i++) buf[m] = q[i];
return m;
}
/* ---------------------------------------------------------------------- */
void FixQEq::unpack_reverse_comm(int n, int *list, double *buf)
{
int m;
for(m = 0; m < n; m++) q[list[m]] += buf[m];
}
/* ----------------------------------------------------------------------
memory usage of local atom-based arrays
------------------------------------------------------------------------- */
double FixQEq::memory_usage()
{
double bytes;
bytes = atom->nmax*nprev*2 * sizeof(double); // s_hist & t_hist
bytes += atom->nmax*11 * sizeof(double); // storage
bytes += n_cap*2 * sizeof(int); // matrix...
bytes += m_cap * sizeof(int);
bytes += m_cap * sizeof(double);
return bytes;
}
/* ----------------------------------------------------------------------
allocate fictitious charge arrays
------------------------------------------------------------------------- */
void FixQEq::grow_arrays(int nmax)
{
memory->grow(s_hist,nmax,nprev,"qeq:s_hist");
memory->grow(t_hist,nmax,nprev,"qeq:t_hist");
}
/* ----------------------------------------------------------------------
copy values within fictitious charge arrays
------------------------------------------------------------------------- */
void FixQEq::copy_arrays(int i, int j, int delflag)
{
for (int m = 0; m < nprev; m++) {
s_hist[j][m] = s_hist[i][m];
t_hist[j][m] = t_hist[i][m];
}
}
/* ----------------------------------------------------------------------
pack values in local atom-based array for exchange with another proc
------------------------------------------------------------------------- */
int FixQEq::pack_exchange(int i, double *buf)
{
for (int m = 0; m < nprev; m++) buf[m] = s_hist[i][m];
for (int m = 0; m < nprev; m++) buf[nprev+m] = t_hist[i][m];
return nprev*2;
}
/* ----------------------------------------------------------------------
unpack values in local atom-based array from exchange with another proc
------------------------------------------------------------------------- */
int FixQEq::unpack_exchange(int n, double *buf)
{
for (int m = 0; m < nprev; m++) s_hist[n][m] = buf[m];
for (int m = 0; m < nprev; m++) t_hist[n][m] = buf[nprev+m];
return nprev*2;
}
/* ---------------------------------------------------------------------- */
double FixQEq::parallel_norm( double *v, int n )
{
int i;
double my_sum, norm_sqr;
int ii;
int *ilist;
ilist = list->ilist;
my_sum = 0.0;
for( ii = 0; ii < n; ++ii ) {
i = ilist[ii];
if (atom->mask[i] & groupbit)
my_sum += v[i]*v[i];
}
MPI_Allreduce( &my_sum, &norm_sqr, 1, MPI_DOUBLE, MPI_SUM, world );
return sqrt( norm_sqr );
}
/* ---------------------------------------------------------------------- */
double FixQEq::parallel_dot( double *v1, double *v2, int n)
{
int i;
double my_dot, res;
int ii;
int *ilist;
ilist = list->ilist;
my_dot = 0.0;
res = 0.0;
for( ii = 0; ii < n; ++ii ) {
i = ilist[ii];
if (atom->mask[i] & groupbit)
my_dot += v1[i] * v2[i];
}
MPI_Allreduce( &my_dot, &res, 1, MPI_DOUBLE, MPI_SUM, world );
return res;
}
/* ---------------------------------------------------------------------- */
double FixQEq::parallel_vector_acc( double *v, int n )
{
int i;
double my_acc, res;
int ii;
int *ilist;
ilist = list->ilist;
my_acc = 0.0;
res = 0.0;
for( ii = 0; ii < n; ++ii ) {
i = ilist[ii];
if (atom->mask[i] & groupbit)
my_acc += v[i];
}
MPI_Allreduce( &my_acc, &res, 1, MPI_DOUBLE, MPI_SUM, world );
return res;
}
/* ---------------------------------------------------------------------- */
void FixQEq::vector_sum( double* dest, double c, double* v,
double d, double* y, int k )
{
int kk;
int *ilist;
ilist = list->ilist;
for( --k; k>=0; --k ) {
kk = ilist[k];
if (atom->mask[kk] & groupbit)
dest[kk] = c * v[kk] + d * y[kk];
}
}
/* ---------------------------------------------------------------------- */
void FixQEq::vector_add( double* dest, double c, double* v, int k )
{
int kk;
int *ilist;
ilist = list->ilist;
for( --k; k>=0; --k ) {
kk = ilist[k];
if (atom->mask[kk] & groupbit)
dest[kk] += c * v[kk];
}
}
/* ---------------------------------------------------------------------- */
void FixQEq::read_file(char *file)
{
int itype,ntypes;
int params_per_line = 6;
char **words = new char*[params_per_line+1];
ntypes = atom->ntypes;
memory->create(chi,ntypes+1,"qeq:chi");
memory->create(eta,ntypes+1,"qeq:eta");
memory->create(gamma,ntypes+1,"qeq:gamma");
memory->create(zeta,ntypes+1,"qeq:zeta");
memory->create(zcore,ntypes+1,"qeq:zcore");
// open file on proc 0
FILE *fp;
if (comm->me == 0) {
fp = force->open_potential(file);
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open fix qeq parameter file %s",file);
error->one(FLERR,str);
}
}
// read each line out of file, skipping blank lines or leading '#'
// store line of params if all 3 element tags are in element list
int n,nwords,ielement,eof;
char line[MAXLINE],*ptr;
eof = ielement = 0;
while (1) {
if (comm->me == 0) {
ptr = fgets(line,MAXLINE,fp);
if (ptr == NULL) {
eof = 1;
fclose(fp);
} else n = strlen(line) + 1;
}
MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) break;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
ielement ++;
if (ielement > ntypes)
error->all(FLERR,"Invalid fix qeq parameter file");
// strip comment, skip line if blank
if ((ptr = strchr(line,'#'))) *ptr = '\0';
nwords = atom->count_words(line);
if (nwords == 0) continue;
// words = ptrs to all words in line
nwords = 0;
words[nwords++] = strtok(line," \t\n\r\f");
while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue;
itype = atoi(words[0]);
chi[itype] = atof(words[1]);
eta[itype] = atof(words[2]);
gamma[itype] = atof(words[3]);
zeta[itype] = atof(words[4]);
zcore[itype] = atof(words[5]);
}
delete [] words;
}
diff --git a/src/QEQ/fix_qeq.h b/src/QEQ/fix_qeq.h
index 337008f9f..152ffd4e3 100644
--- a/src/QEQ/fix_qeq.h
+++ b/src/QEQ/fix_qeq.h
@@ -1,156 +1,159 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_FIX_QEQ_H
#define LMP_FIX_QEQ_H
#include "fix.h"
#define EV_TO_KCAL_PER_MOL 14.4
#define DANGER_ZONE 0.90
#define MIN_CAP 50
#define SAFE_ZONE 1.2
#define MIN_NBRS 100
namespace LAMMPS_NS {
class FixQEq : public Fix {
public:
FixQEq(class LAMMPS *, int, char **);
~FixQEq();
int setmask();
void init_list(int,class NeighList *);
void setup_pre_force(int);
void setup_pre_force_respa(int, int);
void pre_force_respa(int, int, int);
void min_setup_pre_force(int);
void min_pre_force(int);
// derived child classes must provide these functions
virtual void init() = 0;
virtual void pre_force(int) = 0;
virtual int pack_forward_comm(int, int *, double *, int, int *);
virtual void unpack_forward_comm(int, int, double *);
virtual int pack_reverse_comm(int, int, double *);
virtual void unpack_reverse_comm(int, int *, double *);
void grow_arrays(int);
void copy_arrays(int, int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
double memory_usage();
protected:
int nevery;
int nlocal, nall, m_fill;
int n_cap, nmax, m_cap;
int pack_flag;
int nlevels_respa;
class NeighList *list;
int matvecs;
double qeq_time;
double swa, swb; // lower/upper Taper cutoff radius
double Tap[8]; // Taper function
double tolerance; // tolerance for the norm of the rel residual in CG
int maxiter; // maximum number of QEq iterations
double cutoff, cutoff_sq; // neighbor cutoff
double *chi,*eta,*gamma,*zeta,*zcore; // qeq parameters
double *chizj;
double **shld;
int streitz_flag;
bigint ngroup;
// fictitious charges
double *s, *t;
double **s_hist, **t_hist;
int nprev;
typedef struct{
int n, m;
int *firstnbr;
int *numnbrs;
int *jlist;
double *val;
} sparse_matrix;
sparse_matrix H;
double *Hdia_inv;
double *b_s, *b_t;
double *p, *q, *r, *d;
// streitz-mintmire
double alpha;
// damped dynamics
double *qf, *q1, *q2, qdamp, qstep;
+ // fire
+ double *qv;
+
void calculate_Q();
double parallel_norm(double*, int);
double parallel_dot(double*, double*, int);
double parallel_vector_acc(double*, int);
void vector_sum(double *, double, double *, double, double *,int);
void vector_add(double *, double, double *, int);
void init_storage();
void read_file(char*);
void allocate_storage();
void deallocate_storage();
void reallocate_storage();
void allocate_matrix();
void deallocate_matrix();
void reallocate_matrix();
virtual int CG(double *, double *);
virtual void sparse_matvec(sparse_matrix *, double *,double *);
};
}
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: QEQ with 'newton pair off' not supported
See the newton command. This is a restriction to use the QEQ fixes.
W: Fix qeq CG convergence failed (%g) after %d iterations at %ld step
Self-explanatory.
E: Cannot open fix qeq parameter file %s
The specified file cannot be opened. Check that the path and name are
correct.
E: Invalid fix qeq parameter file
Element index > number of atom types.
*/
diff --git a/src/QEQ/fix_qeq_fire.cpp b/src/QEQ/fix_qeq_fire.cpp
new file mode 100644
index 000000000..8596731de
--- /dev/null
+++ b/src/QEQ/fix_qeq_fire.cpp
@@ -0,0 +1,357 @@
+/* ----------------------------------------------------------------------
+ LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
+ http://lammps.sandia.gov, Sandia National Laboratories
+ Steve Plimpton, sjplimp@sandia.gov
+
+ Copyright (2003) Sandia Corporation. Under the terms of Contract
+ DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
+ certain rights in this software. This software is distributed under
+ the GNU General Public License.
+
+ See the README file in the top-level LAMMPS directory.
+------------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------
+ Contributing author: Ray Shan (Sandia)
+------------------------------------------------------------------------- */
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "fix_qeq_fire.h"
+#include "atom.h"
+#include "comm.h"
+#include "domain.h"
+#include "neighbor.h"
+#include "neigh_list.h"
+#include "neigh_request.h"
+#include "update.h"
+#include "force.h"
+#include "group.h"
+#include "pair.h"
+#include "pair_comb.h"
+#include "pair_comb3.h"
+#include "kspace.h"
+#include "respa.h"
+#include "memory.h"
+#include "error.h"
+
+using namespace LAMMPS_NS;
+using namespace FixConst;
+
+#define DELAYSTEP 0
+#define DT_GROW 1.1
+#define DT_SHRINK 0.5
+#define ALPHA0 0.8
+#define ALPHA_SHRINK 0.10
+#define TMAX 10.0
+
+/* ---------------------------------------------------------------------- */
+
+FixQEqFire::FixQEqFire(LAMMPS *lmp, int narg, char **arg) :
+ FixQEq(lmp, narg, arg)
+{
+ qdamp = 0.20;
+ qstep = 0.20;
+
+ int iarg = 8;
+ while (iarg < narg) {
+
+ if (strcmp(arg[iarg],"qdamp") == 0) {
+ if (iarg+2 > narg) error->all(FLERR,"Illegal fix qeq/fire command");
+ qdamp = atof(arg[iarg+1]);
+ iarg += 2;
+ } else if (strcmp(arg[iarg],"qstep") == 0) {
+ if (iarg+2 > narg) error->all(FLERR,"Illegal fix qeq/fire command");
+ qstep = atof(arg[iarg+1]);
+ iarg += 2;
+ } else error->all(FLERR,"Illegal fix qeq/fire command");
+ }
+
+ comb = NULL;
+ comb3 = NULL;
+}
+
+/* ---------------------------------------------------------------------- */
+
+void FixQEqFire::init()
+{
+ if (!atom->q_flag)
+ error->all(FLERR,"Fix qeq/fire requires atom attribute q");
+
+ ngroup = group->count(igroup);
+ if (ngroup == 0) error->all(FLERR,"Fix qeq/fire group has no atoms");
+
+ int irequest = neighbor->request(this,instance_me);
+ neighbor->requests[irequest]->pair = 0;
+ neighbor->requests[irequest]->fix = 1;
+ neighbor->requests[irequest]->half = 1;
+ neighbor->requests[irequest]->full = 0;
+
+ if (tolerance < 1e-4)
+ if (comm->me == 0)
+ error->warning(FLERR,"Fix qeq/fire tolerance may be too small"
+ " for damped fires");
+
+ if (strstr(update->integrate_style,"respa"))
+ nlevels_respa = ((Respa *) update->integrate)->nlevels;
+
+ comb = (PairComb *) force->pair_match("comb",1);
+ comb3 = (PairComb3 *) force->pair_match("comb3",1);
+
+}
+
+/* ---------------------------------------------------------------------- */
+
+void FixQEqFire::pre_force(int vflag)
+{
+ int inum, *ilist;
+ int i,ii,iloop,loopmax;
+ int *mask = atom->mask;
+
+ double *q = atom->q;
+ double vmax,vdotf,vdotfall,vdotv,vdotvall,fdotf,fdotfall;
+ double scale1,scale2;
+ double dtvone,dtv;
+ double enegtot,enegchk,enegmax;
+ double alpha = qdamp;
+ double dt, dtmax;
+ double enegchkall,enegmaxall;
+ bigint ntimestep = update->ntimestep;
+ bigint last_negative = 0;
+
+ if (ntimestep % nevery) return;
+
+ if( atom->nmax > nmax ) reallocate_storage();
+
+ inum = list->inum;
+ ilist = list->ilist;
+
+ for (ii = 0; ii < inum; ii++) {
+ i = ilist[ii];
+ qv[i] = 0.0;
+ }
+
+ dt = qstep;
+ dtmax = TMAX * dt;
+
+ for (iloop = 0; iloop < maxiter; iloop ++ ) {
+ pack_flag = 1;
+ comm->forward_comm_fix(this);
+
+ if (comb) {
+ comb->yasu_char(qf,igroup);
+ enegtot = comb->enegtot / ngroup;
+ } else if (comb3) {
+ comb3->combqeq(qf,igroup);
+ enegtot = comb3->enegtot / ngroup;
+ } else {
+ enegtot = compute_eneg();
+ enegtot /= ngroup;
+ }
+
+ for (ii = 0; ii < inum; ii++) {
+ i = ilist[ii];
+ qf[i] -= enegtot; // Enforce adiabatic
+ }
+
+ // FIRE minimization algorithm
+ // vdotfall = v dot f = qv dot qf
+ vdotf = 0.0;
+ for (ii = 0; ii < inum; ii++) {
+ i = ilist[ii];
+ vdotf += (qv[i]*qf[i]);
+ }
+ MPI_Allreduce(&vdotf,&vdotfall,1,MPI_DOUBLE,MPI_SUM,world);
+
+ if (vdotfall > 0.0) {
+ vdotv = fdotf = 0.0;
+ for (ii = 0; ii < inum; ii++) {
+ i = ilist[ii];
+ vdotv += qv[i]*qv[i];
+ fdotf += qf[i]*qf[i];
+ }
+ MPI_Allreduce(&vdotv,&vdotvall,1,MPI_DOUBLE,MPI_SUM,world);
+ MPI_Allreduce(&fdotf,&fdotfall,1,MPI_DOUBLE,MPI_SUM,world);
+
+ scale1 = 1.0 - alpha;
+ if (fdotfall == 0.0) scale2 = 0.0;
+ else scale2 = alpha * sqrt(vdotvall/fdotfall);
+
+ for (ii = 0; ii < inum; ii++) {
+ i = ilist[ii];
+ qv[i] = scale1*qv[i] + scale2*qf[i];
+ }
+ if (ntimestep - last_negative > DELAYSTEP) {
+ dt = MIN(dt*DT_GROW,dtmax);
+ alpha *= ALPHA_SHRINK;
+ }
+ } else {
+ last_negative = ntimestep;
+ dt *= DT_SHRINK;
+ alpha = ALPHA0;
+ for (ii = 0; ii < inum; ii++) {
+ i = ilist[ii];
+ qv[i] = 0.0;
+ }
+ }
+
+ // limit timestep so no charges change more than dmax
+ dtvone = dt;
+ double dmax = 0.1;
+ for (ii = 0; ii < inum; ii++) {
+ i = ilist[ii];
+ vmax = MAX(fabs(qv[i]),0);
+ if (dtvone*vmax > dmax) dtvone = dmax/vmax;
+ }
+ MPI_Allreduce(&dtvone,&dtv,1,MPI_DOUBLE,MPI_MIN,world);
+ //dtv = dt;
+
+ // Euler integration step
+ enegchk = 0.0;
+ for (ii = 0; ii < inum; ii++) {
+ i = ilist[ii];
+ q[i] -= dtv * qv[i];
+ qv[i] += dtv * qf[i];
+ enegchk += fabs(qf[i]);
+ }
+ MPI_Allreduce(&enegchk,&enegchkall,1,MPI_DOUBLE,MPI_SUM,world);
+ enegchk = enegchkall / ngroup;
+
+ if (enegchk < tolerance) break;
+ }
+
+ if (comm->me == 0) {
+ if (iloop == maxiter) {
+ char str[128];
+ sprintf(str,"Charges did not converge at step "BIGINT_FORMAT
+ ": %lg",update->ntimestep,enegchk);
+ error->warning(FLERR,str);
+ }
+ }
+
+ if (force->kspace) force->kspace->qsum_qsq();
+}
+
+/* ---------------------------------------------------------------------- */
+
+double FixQEqFire::compute_eneg()
+{
+ int i, j, ii, jj, inum, jnum, itype;
+ int *ilist, *jlist, *numneigh, **firstneigh;
+ double eneg, enegtot;
+ double r, rsq, delr[3], rinv;
+
+ int *type = atom->type;
+ int *mask = atom->mask;
+ double *q = atom->q;
+ double **x = atom->x;
+
+ inum = list->inum;
+ ilist = list->ilist;
+ numneigh = list->numneigh;
+ firstneigh = list->firstneigh;
+
+ for (ii = 0; ii < inum; ii++) {
+ i = ilist[ii];
+ if (mask[i] & groupbit)
+ qf[i] = 0.0;
+ }
+
+ // communicating charge force to all nodes, first forward then reverse
+ pack_flag = 2;
+ comm->forward_comm_fix(this);
+
+ for (ii = 0; ii < inum; ii++) {
+ i = ilist[ii];
+ itype = type[i];
+
+ if (mask[i] & groupbit) {
+
+ qf[i] += chi[itype] + eta[itype] * q[i];
+
+ jlist = firstneigh[i];
+ jnum = numneigh[i];
+
+ for (jj = 0; jj < jnum; jj++) {
+ j = jlist[jj];
+ j &= NEIGHMASK;
+
+ delr[0] = x[i][0] - x[j][0];
+ delr[1] = x[i][1] - x[j][1];
+ delr[2] = x[i][2] - x[j][2];
+ rsq = delr[0]*delr[0] + delr[1]*delr[1] + delr[2]*delr[2];
+
+ if (rsq > cutoff_sq) continue;
+
+ r = sqrt(rsq);
+ rinv = 1.0/r;
+ qf[i] += q[j] * rinv;
+ qf[j] += q[i] * rinv;
+ }
+ }
+ }
+
+ pack_flag = 2;
+ comm->reverse_comm_fix(this);
+
+ // sum charge force on each node and return it
+
+ eneg = enegtot = 0.0;
+ for (ii = 0; ii < inum; ii++) {
+ i = ilist[ii];
+ if (mask[i] & groupbit)
+ eneg += qf[i];
+ }
+ MPI_Allreduce(&eneg,&enegtot,1,MPI_DOUBLE,MPI_SUM,world);
+ return enegtot;
+
+}
+
+/* ---------------------------------------------------------------------- */
+
+int FixQEqFire::pack_forward_comm(int n, int *list, double *buf,
+ int pbc_flag, int *pbc)
+{
+ int m;
+
+ if( pack_flag == 1 )
+ for(m = 0; m < n; m++) buf[m] = atom->q[list[m]];
+ else if( pack_flag == 2 )
+ for(m = 0; m < n; m++) buf[m] = qf[list[m]];
+
+ return m;
+}
+
+/* ---------------------------------------------------------------------- */
+
+void FixQEqFire::unpack_forward_comm(int n, int first, double *buf)
+{
+ int i, m;
+
+ if( pack_flag == 1)
+ for(m = 0, i = first; m < n; m++, i++) atom->q[i] = buf[m];
+ else if( pack_flag == 2)
+ for(m = 0, i = first; m < n; m++, i++) qf[i] = buf[m];
+}
+
+/* ---------------------------------------------------------------------- */
+
+int FixQEqFire::pack_reverse_comm(int n, int first, double *buf)
+{
+ int i, m;
+ for(m = 0, i = first; m < n; m++, i++) buf[m] = qf[i];
+ return m;
+}
+
+/* ---------------------------------------------------------------------- */
+
+void FixQEqFire::unpack_reverse_comm(int n, int *list, double *buf)
+{
+ int m;
+
+ for(m = 0; m < n; m++) qf[list[m]] += buf[m];
+}
+
+/* ---------------------------------------------------------------------- */
diff --git a/src/fix_store.h b/src/QEQ/fix_qeq_fire.h
similarity index 55%
copy from src/fix_store.h
copy to src/QEQ/fix_qeq_fire.h
index dab989990..9fd81176e 100644
--- a/src/fix_store.h
+++ b/src/QEQ/fix_qeq_fire.h
@@ -1,64 +1,75 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
-FixStyle(STORE,FixStore)
+FixStyle(qeq/fire,FixQEqFire)
#else
-#ifndef LMP_FIX_STORE_H
-#define LMP_FIX_STORE_H
+#ifndef LMP_FIX_QEQ_FIRE_H
+#define LMP_FIX_QEQ_FIRE_H
-#include "fix.h"
+#include "fix_qeq.h"
namespace LAMMPS_NS {
-class FixStore : public Fix {
+class FixQEqFire : public FixQEq {
public:
- double *vstore; // vector storage if nvalues = 1
- double **astore; // array storage if nvalues > 1
-
- FixStore(class LAMMPS *, int, char **);
- ~FixStore();
- int setmask();
-
- double memory_usage();
- void grow_arrays(int);
- void copy_arrays(int, int, int);
- int pack_exchange(int, double *);
- int unpack_exchange(int, double *);
- int pack_restart(int, double *);
- void unpack_restart(int, int);
- int size_restart(int);
- int maxsize_restart();
+ FixQEqFire(class LAMMPS *, int, char **);
+ ~FixQEqFire() {}
+ void init();
+ void pre_force(int);
+
+ int pack_forward_comm(int, int *, double *, int, int *);
+ void unpack_forward_comm(int, int, double *);
+ int pack_reverse_comm(int, int, double *);
+ void unpack_reverse_comm(int, int *, double *);
private:
- int nvalues; // total # of values per atom
- int vecflag; // 1 if nvalues = 1
+ double compute_eneg();
+
+ class PairComb *comb;
+ class PairComb3 *comb3;
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
+E: Fix qeq/fire requires atom attribute q
+
+Self-explanatory.
+
+E: Fix qeq/fire group has no atoms
+
+Self-explanatory.
+
+W: Fix qeq/fire tolerance may be too small for damped fires
+
+Self-explanatory.
+
+W: Charges did not converge at step %ld: %lg
+
+Self-explanatory.
+
*/
diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp
index 25043a0f8..871901293 100644
--- a/src/REPLICA/tad.cpp
+++ b/src/REPLICA/tad.cpp
@@ -1,1044 +1,1045 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Aidan Thompson (SNL)
------------------------------------------------------------------------- */
// lmptype.h must be first b/c this file uses MAXBIGINT and includes mpi.h
// due to OpenMPI bug which sets INT64_MAX via its mpi.h
// before lmptype.h can set flags to insure it is done correctly
#include "lmptype.h"
#include <mpi.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "tad.h"
#include "universe.h"
#include "update.h"
#include "atom.h"
#include "domain.h"
#include "region.h"
#include "comm.h"
#include "velocity.h"
#include "integrate.h"
#include "min.h"
#include "neighbor.h"
#include "modify.h"
#include "neb.h"
#include "compute.h"
#include "fix.h"
#include "fix_event_tad.h"
#include "fix_store.h"
#include "force.h"
#include "pair.h"
#include "random_park.h"
#include "random_mars.h"
#include "output.h"
#include "dump.h"
#include "finish.h"
#include "timer.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
TAD::TAD(LAMMPS *lmp) : Pointers(lmp) {}
/* ---------------------------------------------------------------------- */
TAD::~TAD()
{
memory->sfree(fix_event_list);
if (neb_logfilename != NULL) delete [] neb_logfilename;
delete [] min_style;
delete [] min_style_neb;
}
/* ----------------------------------------------------------------------
perform TAD simulation on root proc
other procs only used for NEB calcs
------------------------------------------------------------------------- */
void TAD::command(int narg, char **arg)
{
fix_event_list = NULL;
n_event_list = 0;
nmax_event_list = 0;
nmin_event_list = 10;
// error checks
if (domain->box_exist == 0)
error->all(FLERR,"Tad command before simulation box is defined");
if (universe->nworlds == 1)
error->all(FLERR,"Cannot use TAD with a single replica for NEB");
if (universe->nworlds != universe->nprocs)
error->all(FLERR,"Can only use TAD with 1-processor replicas for NEB");
if (atom->sortfreq > 0)
error->all(FLERR,"Cannot use TAD with atom_modify sort enabled for NEB");
if (atom->map_style == 0)
error->all(FLERR,"Cannot use TAD unless atom map exists for NEB");
if (narg < 7) error->universe_all(FLERR,"Illegal tad command");
nsteps = force->inumeric(FLERR,arg[0]);
t_event = force->inumeric(FLERR,arg[1]);
templo = force->numeric(FLERR,arg[2]);
temphi = force->numeric(FLERR,arg[3]);
delta_conf = force->numeric(FLERR,arg[4]);
tmax = force->numeric(FLERR,arg[5]);
char *id_compute = new char[strlen(arg[6])+1];
strcpy(id_compute,arg[6]);
// quench minimizer is set by min_style command
// NEB minimizer is set by options, default = quickmin
int n = strlen(update->minimize_style) + 1;
min_style = new char[n];
strcpy(min_style,update->minimize_style);
options(narg-7,&arg[7]);
// total # of timesteps must be multiple of t_event
if (t_event <= 0) error->universe_all(FLERR,"Invalid t_event in tad command");
if (nsteps % t_event)
error->universe_all(FLERR,"TAD nsteps must be multiple of t_event");
if (delta_conf <= 0.0 || delta_conf >= 1.0)
error->universe_all(FLERR,"Invalid delta_conf in tad command");
if (tmax <= 0.0)
error->universe_all(FLERR,"Invalid tmax in tad command");
// deltconf = (ln(1/delta))/freq_min (timestep units)
deltconf = -log(delta_conf)*tmax/update->dt;
// local storage
int me_universe = universe->me;
int nprocs_universe = universe->nprocs;
MPI_Comm_rank(world,&me);
MPI_Comm_size(world,&nprocs);
delta_beta = (1.0/templo - 1.0/temphi) / force->boltz;
ratio_beta = templo/temphi;
// create FixEventTAD object to store last event
int narg2 = 3;
char **args = new char*[narg2];
args[0] = (char *) "tad_event";
args[1] = (char *) "all";
args[2] = (char *) "EVENT/TAD";
modify->add_fix(narg2,args);
fix_event = (FixEventTAD *) modify->fix[modify->nfix-1];
delete [] args;
// create FixStore object to store revert state
- narg2 = 5;
+ narg2 = 6;
args = new char*[narg2];
args[0] = (char *) "tad_revert";
args[1] = (char *) "all";
args[2] = (char *) "STORE";
- args[3] = (char *) "0";
- args[4] = (char *) "7";
+ args[3] = (char *) "peratom";
+ args[4] = (char *) "0";
+ args[5] = (char *) "7";
modify->add_fix(narg2,args);
fix_revert = (FixStore *) modify->fix[modify->nfix-1];
delete [] args;
// create Finish for timing output
finish = new Finish(lmp);
// assign FixEventTAD to event-detection compute
// necessary so it will know atom coords at last event
int icompute = modify->find_compute(id_compute);
if (icompute < 0) error->all(FLERR,"Could not find compute ID for TAD");
compute_event = modify->compute[icompute];
compute_event->reset_extra_compute_fix("tad_event");
// reset reneighboring criteria since will perform minimizations
neigh_every = neighbor->every;
neigh_delay = neighbor->delay;
neigh_dist_check = neighbor->dist_check;
if (neigh_every != 1 || neigh_delay != 0 || neigh_dist_check != 1) {
if (me_universe == 0)
error->warning(FLERR,"Resetting reneighboring criteria during TAD");
}
neighbor->every = 1;
neighbor->delay = 0;
neighbor->dist_check = 1;
// initialize TAD as if one long dynamics run
update->whichflag = 1;
update->nsteps = nsteps;
update->beginstep = update->firststep = update->ntimestep;
update->endstep = update->laststep = update->firststep + nsteps;
update->restrict_output = 1;
if (update->laststep < 0)
error->all(FLERR,"Too many timesteps");
lmp->init();
// set minimize style for quench
narg2 = 1;
args = new char*[narg2];
args[0] = min_style;
update->create_minimize(narg2,args);
delete [] args;
// init minimizer settings and minimizer itself
update->etol = etol;
update->ftol = ftol;
update->max_eval = maxeval;
update->minimize->init();
// perform TAD simulation
if (me_universe == 0 && universe->uscreen)
fprintf(universe->uscreen,"Setting up TAD ...\n");
if (me_universe == 0) {
if (universe->uscreen)
fprintf(universe->uscreen,
"Step CPU N M Status Barrier Margin t_lo delt_lo\n");
if (universe->ulogfile)
fprintf(universe->ulogfile,
"Step CPU N M Status Barrier Margin t_lo delt_lo\n");
}
ulogfile_lammps = universe->ulogfile;
uscreen_lammps = universe->uscreen;
ulogfile_neb = NULL;
uscreen_neb = NULL;
if (me_universe == 0 && neb_logfilename)
ulogfile_neb = fopen(neb_logfilename,"w");
// store hot state and quenched event, only on replica 0
// need this line if quench() does only setup_minimal()
// update->minimize->setup();
// This should work with if uncommented, but does not
// if (universe->iworld == 0) {
fix_event->store_state_quench();
quench();
timer->init();
timer->barrier_start();
time_start = timer->get_wall(Timer::TOTAL);
fix_event->store_event_tad(update->ntimestep);
log_event(0);
fix_event->restore_state_quench();
// do full init/setup
update->whichflag = 1;
lmp->init();
update->integrate->setup();
// main loop: look for events until out of time
// (1) dynamics, store state, quench, check event, restore state
// (2) if event, perform NEB, record in fix_event_list
// (3) if confident, pick earliest event
nbuild = ndanger = 0;
time_neb = time_dynamics = time_quench = time_comm = time_output = 0.0;
timer->barrier_start();
time_start = timer->get_wall(Timer::TOTAL);
int confident_flag, event_flag;
if (universe->iworld == 0) {
while (update->ntimestep < update->endstep) {
// initialize list of possible events
initialize_event_list();
confident_flag = 0;
while (update->ntimestep < update->endstep) {
event_flag = 0;
while (update->ntimestep < update->endstep) {
dynamics();
fix_event->store_state_quench();
quench();
event_flag = check_event();
MPI_Bcast(&event_flag,1,MPI_INT,0,universe->uworld);
if (event_flag) break;
// restore hot state
fix_event->restore_state_quench();
// store hot state in revert
store_state();
}
if (!event_flag) break;
add_event();
perform_neb(n_event_list-1);
compute_tlo(n_event_list-1);
confident_flag = check_confidence();
MPI_Bcast(&confident_flag,1,MPI_INT,0,universe->uworld);
if (confident_flag) break;
if (universe->iworld == 0) revert_state();
}
if (!confident_flag) break;
perform_event(event_first);
// need to sync timestep with TAD
MPI_Bcast(&(update->ntimestep),1,MPI_INT,0,universe->uworld);
int restart_flag = 0;
if (output->restart_flag && universe->iworld == 0) {
if (output->restart_every_single &&
fix_event->event_number % output->restart_every_single == 0)
restart_flag = 1;
if (output->restart_every_double &&
fix_event->event_number % output->restart_every_double == 0)
restart_flag = 1;
}
// full init/setup since are starting after event
update->whichflag = 1;
lmp->init();
update->integrate->setup();
// write restart file of hot coords
if (restart_flag) {
timer->barrier_start();
output->write_restart(update->ntimestep);
timer->barrier_stop();
time_output += timer->get_wall(Timer::TOTAL);
}
}
} else {
while (update->ntimestep < update->endstep) {
confident_flag = 0;
while (update->ntimestep < update->endstep) {
event_flag = 0;
while (update->ntimestep < update->endstep) {
update->ntimestep += t_event;
MPI_Bcast(&event_flag,1,MPI_INT,0,universe->uworld);
if (event_flag) break;
}
if (!event_flag) break;
perform_neb(-1);
MPI_Bcast(&confident_flag,1,MPI_INT,0,universe->uworld);
if (confident_flag) break;
}
if (!confident_flag) break;
// need to sync timestep with TAD
MPI_Bcast(&(update->ntimestep),1,MPI_INT,0,universe->uworld);
}
}
// set total timers and counters so Finish() will process them
timer->set_wall(Timer::TOTAL, time_start);
timer->barrier_stop();
timer->set_wall(Timer::NEB, time_neb);
timer->set_wall(Timer::DYNAMICS, time_dynamics);
timer->set_wall(Timer::QUENCH, time_quench);
timer->set_wall(Timer::REPCOMM, time_comm);
timer->set_wall(Timer::REPOUT, time_output);
neighbor->ncalls = nbuild;
neighbor->ndanger = ndanger;
if (me_universe == 0) {
if (universe->uscreen)
fprintf(universe->uscreen,
"Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
" atoms\n",
timer->get_wall(Timer::TOTAL),nprocs_universe,nsteps,atom->natoms);
if (universe->ulogfile)
fprintf(universe->ulogfile,
"Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
" atoms\n",
timer->get_wall(Timer::TOTAL),nprocs_universe,nsteps,atom->natoms);
}
if ((me_universe == 0) && ulogfile_neb) fclose(ulogfile_neb);
if (me == 0) {
if (screen) fprintf(screen,"\nTAD done\n");
if (logfile) fprintf(logfile,"\nTAD done\n");
}
finish->end(3);
update->whichflag = 0;
update->firststep = update->laststep = 0;
update->beginstep = update->endstep = 0;
update->restrict_output = 0;
// reset reneighboring criteria
neighbor->every = neigh_every;
neighbor->delay = neigh_delay;
neighbor->dist_check = neigh_dist_check;
delete [] id_compute;
delete finish;
modify->delete_fix("tad_event");
modify->delete_fix("tad_revert");
delete_event_list();
compute_event->reset_extra_compute_fix(NULL);
}
/* ----------------------------------------------------------------------
single short dynamics run
------------------------------------------------------------------------- */
void TAD::dynamics()
{
update->whichflag = 1;
update->nsteps = t_event;
lmp->init();
update->integrate->setup();
// this may be needed if don't do full init
//modify->addstep_compute_all(update->ntimestep);
int ncalls = neighbor->ncalls;
timer->barrier_start();
update->integrate->run(t_event);
timer->barrier_stop();
time_dynamics += timer->get_wall(Timer::TOTAL);
nbuild += neighbor->ncalls - ncalls;
ndanger += neighbor->ndanger;
update->integrate->cleanup();
finish->end(0);
}
/* ----------------------------------------------------------------------
quench minimization
------------------------------------------------------------------------- */
void TAD::quench()
{
bigint ntimestep_hold = update->ntimestep;
bigint endstep_hold = update->endstep;
// need to change whichflag so that minimize->setup() calling
// modify->setup() will call fix->min_setup()
update->whichflag = 2;
update->nsteps = maxiter;
update->endstep = update->laststep = update->firststep + maxiter;
if (update->laststep < 0)
error->all(FLERR,"Too many iterations");
// full init works
lmp->init();
update->minimize->setup();
// partial init does not work
//modify->addstep_compute_all(update->ntimestep);
//update->minimize->setup_minimal(1);
int ncalls = neighbor->ncalls;
timer->barrier_start();
update->minimize->run(maxiter);
timer->barrier_stop();
time_quench += timer->get_wall(Timer::TOTAL);
if (neighbor->ncalls == ncalls) quench_reneighbor = 0;
else quench_reneighbor = 1;
update->minimize->cleanup();
finish->end(1);
// reset timestep as if quench did not occur
// clear timestep storage from computes, since now invalid
update->ntimestep = ntimestep_hold;
update->endstep = update->laststep = endstep_hold;
for (int i = 0; i < modify->ncompute; i++)
if (modify->compute[i]->timeflag) modify->compute[i]->clearstep();
}
/* ----------------------------------------------------------------------
check for an event
return 0 if no event
return 1 if event
------------------------------------------------------------------------- */
int TAD::check_event()
{
int flag;
flag = 0;
if (compute_event->compute_scalar() > 0.0) flag = 1;
return flag;
}
/* ----------------------------------------------------------------------
universe proc 0 prints event info
------------------------------------------------------------------------- */
void TAD::log_event(int ievent)
{
timer->set_wall(Timer::TOTAL, time_start);
if (universe->me == 0) {
double tfrac = 0.0;
if (universe->uscreen)
fprintf(universe->uscreen,
BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
fix_event->event_timestep,
timer->elapsed(Timer::TOTAL),
fix_event->event_number,ievent,
"E ",
fix_event->ebarrier,tfrac,
fix_event->tlo,deltfirst);
if (universe->ulogfile)
fprintf(universe->ulogfile,
BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
fix_event->event_timestep,
timer->elapsed(Timer::TOTAL),
fix_event->event_number,ievent,
"E ",
fix_event->ebarrier,tfrac,
fix_event->tlo,deltfirst);
}
// dump snapshot of quenched coords
// must reneighbor and compute forces before dumping
// addstep_compute_all insures eng/virial are calculated if needed
if (output->ndump && universe->iworld == 0) {
timer->barrier_start();
modify->addstep_compute_all(update->ntimestep);
update->integrate->setup_minimal(1);
output->write_dump(update->ntimestep);
timer->barrier_stop();
time_output += timer->get_wall(Timer::TOTAL);
}
}
/* ----------------------------------------------------------------------
parse optional parameters at end of TAD input line
------------------------------------------------------------------------- */
void TAD::options(int narg, char **arg)
{
if (narg < 0) error->all(FLERR,"Illegal tad command");
// set defaults
etol = 0.1;
ftol = 0.1;
maxiter = 40;
maxeval = 50;
etol_neb = 0.01;
ftol_neb = 0.01;
n1steps_neb = 100;
n2steps_neb = 100;
nevery_neb = 10;
int n = strlen("quickmin") + 1;
min_style_neb = new char[n];
strcpy(min_style_neb,"quickmin");
dt_neb = update->dt;
neb_logfilename = NULL;
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"min") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal tad command");
etol = force->numeric(FLERR,arg[iarg+1]);
ftol = force->numeric(FLERR,arg[iarg+2]);
maxiter = force->inumeric(FLERR,arg[iarg+3]);
maxeval = force->inumeric(FLERR,arg[iarg+4]);
if (maxiter < 0 || maxeval < 0 ||
etol < 0.0 || ftol < 0.0 )
error->all(FLERR,"Illegal tad command");
iarg += 5;
} else if (strcmp(arg[iarg],"neb") == 0) {
if (iarg+6 > narg) error->all(FLERR,"Illegal tad command");
etol_neb = force->numeric(FLERR,arg[iarg+1]);
ftol_neb = force->numeric(FLERR,arg[iarg+2]);
n1steps_neb = force->inumeric(FLERR,arg[iarg+3]);
n2steps_neb = force->inumeric(FLERR,arg[iarg+4]);
nevery_neb = force->inumeric(FLERR,arg[iarg+5]);
if (etol_neb < 0.0 || ftol_neb < 0.0 ||
n1steps_neb < 0 || n2steps_neb < 0 ||
nevery_neb < 0) error->all(FLERR,"Illegal tad command");
iarg += 6;
} else if (strcmp(arg[iarg],"neb_style") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal tad command");
delete [] min_style_neb;
int n = strlen(arg[iarg+1]) + 1;
min_style_neb = new char[n];
strcpy(min_style_neb,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"neb_step") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal tad command");
dt_neb = force->numeric(FLERR,arg[iarg+1]);
if (dt_neb <= 0.0) error->all(FLERR,"Illegal tad command");
iarg += 2;
} else if (strcmp(arg[iarg],"neb_log") == 0) {
delete [] neb_logfilename;
if (iarg+2 > narg) error->all(FLERR,"Illegal tad command");
if (strcmp(arg[iarg+1],"none") == 0) neb_logfilename = NULL;
else {
int n = strlen(arg[iarg+1]) + 1;
neb_logfilename = new char[n];
strcpy(neb_logfilename,arg[iarg+1]);
}
iarg += 2;
} else error->all(FLERR,"Illegal tad command");
}
}
/* ----------------------------------------------------------------------
perform NEB calculation
------------------------------------------------------------------------- */
void TAD::perform_neb(int ievent)
{
double **x = atom->x;
int nlocal = atom->nlocal;
double *buf_final;
memory->create(buf_final,3*nlocal,"tad:buffinal");
// set system to quenched state of event ievent
if (universe->iworld == 0) {
fix_event_list[ievent]->restore_event();
int ii = 0;
for (int i = 0; i < nlocal; i++) {
buf_final[ii++] = x[i][0];
buf_final[ii++] = x[i][1];
buf_final[ii++] = x[i][2];
}
}
MPI_Bcast(buf_final,3*nlocal,MPI_DOUBLE,universe->root_proc[0],
universe->uworld);
double *buf_init;
memory->create(buf_init,3*nlocal,"tad:bufinit");
// set system to quenched state of fix_event
if (universe->iworld == 0) {
fix_event->restore_event();
int ii = 0;
for (int i = 0; i < nlocal; i++) {
buf_init[ii++] = x[i][0];
buf_init[ii++] = x[i][1];
buf_init[ii++] = x[i][2];
}
}
MPI_Bcast(buf_init,3*nlocal,MPI_DOUBLE,universe->root_proc[0],
universe->uworld);
// create FixNEB object to support NEB
int narg2 = 4;
char **args = new char*[narg2];
args[0] = (char *) "neb";
args[1] = (char *) "all";
args[2] = (char *) "neb";
char str[128];
args[3] = str;
double kspring = 1.0;
sprintf(args[3],"%f",kspring);
modify->add_fix(narg2,args);
fix_neb = (Fix *) modify->fix[modify->nfix-1];
delete [] args;
// switch minimize style to quickmin for NEB
narg2 = 1;
args = new char*[narg2];
args[0] = min_style_neb;
update->create_minimize(narg2,args);
delete [] args;
// create NEB object
neb = new NEB(lmp,etol_neb,ftol_neb,n1steps_neb,
n2steps_neb,nevery_neb,buf_init,buf_final);
// free up temporary arrays
memory->destroy(buf_init);
memory->destroy(buf_final);
// run NEB with NEB timestep
int beginstep_hold = update->beginstep;
int endstep_hold = update->endstep;
int ntimestep_hold = update->ntimestep;
int nsteps_hold = update->nsteps;
if (universe->me == 0) {
universe->ulogfile = ulogfile_neb;
universe->uscreen = uscreen_neb;
}
// had to bypass timer interface
// because timer->array is reset inside neb->run()
// timer->barrier_start();
// neb->run();
// timer->barrier_stop();
// time_neb += timer->get_wall(Timer::TOTAL);
MPI_Barrier(world);
double time_tmp = MPI_Wtime();
double dt_hold = update->dt;
update->dt = dt_neb;
neb->run();
update->dt = dt_hold;
MPI_Barrier(world);
time_neb += MPI_Wtime() - time_tmp;
if (universe->me == 0) {
universe->ulogfile = ulogfile_lammps;
universe->uscreen = uscreen_lammps;
}
// extract barrier energy from NEB
if (universe->iworld == 0)
fix_event_list[ievent]->ebarrier = neb->ebf;
update->beginstep = update->firststep = beginstep_hold;
update->endstep = update->laststep = endstep_hold;
update->ntimestep = ntimestep_hold;
update->nsteps = nsteps_hold;
// switch minimize style back for quench
narg2 = 1;
args = new char*[narg2];
args[0] = min_style;
update->create_minimize(narg2,args);
update->etol = etol;
update->ftol = ftol;
delete [] args;
// clean up
modify->delete_fix("neb");
delete neb;
}
/* ----------------------------------------------------------------------
check if confidence criterion for tstop is satisfied
return 0 if not satisfied
return 1 if satisfied
------------------------------------------------------------------------- */
int TAD::check_confidence()
{
int flag;
// update stopping time
deltstop = deltconf*pow(deltfirst/deltconf, ratio_beta);
flag = 0;
if (deltstop < update->ntimestep - fix_event->event_timestep) flag = 1;
return flag;
}
/* ----------------------------------------------------------------------
store state in fix_revert
------------------------------------------------------------------------- */
void TAD::store_state()
{
double **x = atom->x;
double **v = atom->v;
imageint *image = atom->image;
int nlocal = atom->nlocal;
double **astore = fix_revert->astore;
for (int i = 0; i < nlocal; i++) {
astore[i][0] = x[i][0];
astore[i][1] = x[i][1];
astore[i][2] = x[i][2];
astore[i][3] = v[i][0];
astore[i][4] = v[i][1];
astore[i][5] = v[i][2];
*((imageint *) &astore[i][6]) = image[i];
}
}
/* ----------------------------------------------------------------------
restore state archived in fix_revert
flip sign of velocities to reflect back to starting state
------------------------------------------------------------------------- */
void TAD::revert_state()
{
double **x = atom->x;
double **v = atom->v;
imageint *image = atom->image;
int nlocal = atom->nlocal;
double **astore = fix_revert->astore;
for (int i = 0; i < nlocal; i++) {
x[i][0] = astore[i][0];
x[i][1] = astore[i][1];
x[i][2] = astore[i][2];
v[i][0] = -astore[i][3];
v[i][1] = -astore[i][4];
v[i][2] = -astore[i][5];
image[i] = *((imageint *) &astore[i][6]);
}
}
/* ----------------------------------------------------------------------
Initialize list of possible events
------------------------------------------------------------------------- */
void TAD::initialize_event_list() {
// First delete old events, if any
delete_event_list();
// Create new list
n_event_list = 0;
grow_event_list(nmin_event_list);
}
/* ----------------------------------------------------------------------
Delete list of possible events
------------------------------------------------------------------------- */
void TAD::delete_event_list() {
for (int i = 0; i < n_event_list; i++) {
char str[128];
sprintf(str,"tad_event_%d",i);
modify->delete_fix(str);
}
memory->sfree(fix_event_list);
fix_event_list = NULL;
n_event_list = 0;
nmax_event_list = 0;
}
/* ----------------------------------------------------------------------
add event
------------------------------------------------------------------------- */
void TAD::add_event()
{
// create FixEventTAD object to store possible event
int narg = 3;
char **args = new char*[narg];
char str[128];
sprintf(str,"tad_event_%d",n_event_list);
args[0] = str;
args[1] = (char *) "all";
args[2] = (char *) "EVENT/TAD";
modify->add_fix(narg,args);
if (n_event_list == nmax_event_list)
grow_event_list(nmax_event_list+nmin_event_list);
n_event_list += 1;
int ievent = n_event_list-1;
fix_event_list[ievent] = (FixEventTAD *) modify->fix[modify->nfix-1];
// store quenched state for new event
fix_event_list[ievent]->store_event_tad(update->ntimestep);
// store hot state for new event
fix_event->restore_state_quench();
fix_event_list[ievent]->store_state_quench();
// string clean-up
delete [] args;
}
/* ----------------------------------------------------------------------
compute cold time for event ievent
------------------------------------------------------------------------- */
void TAD::compute_tlo(int ievent)
{
double deltlo,delthi,ebarrier;
ebarrier = fix_event_list[ievent]->ebarrier;
delthi = fix_event_list[ievent]->event_timestep
- fix_event->event_timestep;
deltlo = delthi*exp(ebarrier*delta_beta);
fix_event_list[ievent]->tlo = fix_event->tlo + deltlo;
// update first event
char* statstr = (char *) "D ";
if (ievent == 0) {
deltfirst = deltlo;
event_first = ievent;
statstr = (char *) "DF";
} else if (deltlo < deltfirst) {
deltfirst = deltlo;
event_first = ievent;
statstr = (char *) "DF";
}
// first-replica output about each event
timer->set_wall(Timer::TOTAL, time_start);
if (universe->me == 0) {
double tfrac = 0.0;
if (ievent > 0) tfrac = delthi/deltstop;
if (universe->uscreen)
fprintf(universe->uscreen,
BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
fix_event_list[ievent]->event_timestep,
timer->elapsed(Timer::TOTAL),
fix_event->event_number,
ievent,statstr,ebarrier,tfrac,
fix_event->tlo,deltlo);
if (universe->ulogfile)
fprintf(universe->ulogfile,
BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
fix_event_list[ievent]->event_timestep,
timer->elapsed(Timer::TOTAL),
fix_event->event_number,
ievent,statstr,ebarrier,tfrac,
fix_event->tlo,deltlo);
}
}
/* ----------------------------------------------------------------------
perform event
------------------------------------------------------------------------- */
void TAD::perform_event(int ievent)
{
// reset timestep to that of event
update->ntimestep = fix_event_list[ievent]->event_timestep;
// Copy event to current event
// Should really use copy constructor for this
fix_event->tlo = fix_event_list[ievent]->tlo;
fix_event->ebarrier = fix_event_list[ievent]->ebarrier;
fix_event->event_number++;
fix_event->event_timestep = update->ntimestep;
fix_event_list[ievent]->restore_event();
fix_event->store_event_tad(fix_event_list[ievent]->event_timestep);
// output stats and dump for quenched state
log_event(ievent);
// load and store hot state
fix_event_list[ievent]->restore_state_quench();
fix_event->store_state_quench();
}
/* ----------------------------------------------------------------------
Allocate list of pointers to events
------------------------------------------------------------------------- */
void TAD::grow_event_list(int nmax) {
if (nmax_event_list > nmax) return;
fix_event_list = (FixEventTAD **)
memory->srealloc(fix_event_list,nmax*sizeof(FixEventTAD *),"tad:eventlist");
nmax_event_list = nmax;
}
diff --git a/src/USER-COLVARS/ndx_group.cpp b/src/USER-COLVARS/ndx_group.cpp
new file mode 100644
index 000000000..7dcd9b6fd
--- /dev/null
+++ b/src/USER-COLVARS/ndx_group.cpp
@@ -0,0 +1,246 @@
+/* ----------------------------------------------------------------------
+ LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
+ http://lammps.sandia.gov, Sandia National Laboratories
+ Steve Plimpton, sjplimp@sandia.gov
+
+ Copyright (2003) Sandia Corporation. Under the terms of Contract
+ DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
+ certain rights in this software. This software is distributed under
+ the GNU General Public License.
+
+ See the README file in the top-level LAMMPS directory.
+------------------------------------------------------------------------- */
+/* ----------------------------------------------------------------------
+ Contributing author: Axel Kohlmeyer (Temple U)
+------------------------------------------------------------------------- */
+
+#include "ndx_group.h"
+#include "atom.h"
+#include "comm.h"
+#include "group.h"
+#include "memory.h"
+#include "force.h"
+#include "error.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+using namespace LAMMPS_NS;
+#define BUFLEN 4096
+#define DELTA 16384
+
+static char *find_section(FILE *fp, const char *name)
+{
+ char linebuf[BUFLEN];
+ char *n,*p,*t,*r;
+
+ while ((p = fgets(linebuf,BUFLEN,fp))) {
+ t = strtok(p," \t\n\r\f");
+ if ((t != NULL) && *t == '[') {
+ t = strtok(NULL," \t\n\r\f");
+ if (t != NULL) {
+ n = t;
+ t = strtok(NULL," \t\n\r\f");
+ if ((t != NULL) && *t == ']') {
+ if ((name == NULL) || strcmp(name,n) == 0) {
+ int l = strlen(n);
+ r = new char[l+1];
+ strncpy(r,n,l+1);
+ return r;
+ }
+ }
+ }
+ }
+ }
+ return NULL;
+}
+
+static tagint *read_section(FILE *fp, bigint &num)
+{
+ char linebuf[BUFLEN];
+ char *p,*t;
+ tagint *tagbuf;
+ bigint nmax;
+
+ num = 0;
+ nmax = DELTA;
+ tagbuf = (tagint *)malloc(sizeof(tagint)*nmax);
+
+ while ((p = fgets(linebuf,BUFLEN,fp))) {
+ t = strtok(p," \t\n\r\f");
+ while (t != NULL) {
+ // start of a new section. we are done here.
+ if (*t == '[') return tagbuf;
+
+ tagbuf[num++] = ATOTAGINT(t);
+ if (num == nmax) {
+ nmax += DELTA;
+ tagbuf = (tagint *)realloc(tagbuf,sizeof(tagint)*nmax);
+ }
+ t = strtok(NULL," \t\n\r\f");
+ }
+ }
+ return tagbuf;
+}
+
+/* ---------------------------------------------------------------------- */
+
+void Ndx2Group::command(int narg, char **arg)
+{
+ int len;
+ bigint num;
+ FILE *fp;
+ char *name = NULL;
+ tagint *tags;
+
+ if (narg < 1) error->all(FLERR,"Illegal ndx2group command");
+
+ if (atom->tag_enable == 0)
+ error->all(FLERR,"Must have atom IDs for ndx2group command");
+
+ if (comm->me == 0) {
+ fp = fopen(arg[0], "r");
+ if (fp == NULL)
+ error->one(FLERR,"Cannot open index file for reading");
+
+ if (screen)
+ fprintf(screen, "Reading groups from index file %s:\n",arg[0]);
+ if (logfile)
+ fprintf(logfile,"Reading groups from index file %s:\n",arg[0]);
+ }
+
+ if (narg == 1) { // restore all groups
+
+ do {
+ if (comm->me == 0) {
+ len = 0;
+
+ // find the next section.
+ // if we had processed a section, before we need to step back
+ if (name != NULL) {
+ rewind(fp);
+ find_section(fp,name);
+ delete[] name;
+ name = NULL;
+ }
+ name = find_section(fp,NULL);
+ if (name != NULL) {
+ len=strlen(name);
+
+ // skip over group "all", which is called "System" in gromacs
+ if (strcmp(name,"System") == 0) continue;
+
+ if (screen)
+ fprintf(screen," Processing group '%s'\n",name);
+ if (logfile)
+ fprintf(logfile," Processing group '%s'\n",name);
+ }
+ MPI_Bcast(&len,1,MPI_INT,0,world);
+ if (len > 0) {
+ MPI_Bcast(name,len,MPI_CHAR,0,world);
+
+ // read tags for atoms in group and broadcast
+ num = 0;
+ tags = read_section(fp,num);
+ MPI_Bcast(&num,1,MPI_LMP_BIGINT,0,world);
+ MPI_Bcast(tags,num,MPI_LMP_TAGINT,0,world);
+ create(name,num,tags);
+ free(tags);
+ }
+ } else {
+ MPI_Bcast(&len,1,MPI_INT,0,world);
+ if (len > 0) {
+ delete[] name;
+ name = new char[len+1];
+ MPI_Bcast(name,len+1,MPI_CHAR,0,world);
+
+ MPI_Bcast(&num,1,MPI_LMP_BIGINT,0,world);
+ tags = (tagint *)malloc(sizeof(tagint)*(num ? num : 1));
+ MPI_Bcast(tags,num,MPI_LMP_TAGINT,0,world);
+ create(name,num,tags);
+ free(tags);
+ }
+ }
+ } while (len);
+
+ } else { // restore selected groups
+ for (int idx=1; idx < narg; ++idx) {
+
+ if (comm->me == 0) {
+ len = 0;
+
+ // find named section, search from beginning of file
+ rewind(fp);
+ name = find_section(fp,arg[idx]);
+ if (name != NULL) len=strlen(name);
+
+ if (screen)
+ fprintf(screen," %s group '%s'\n",
+ len ? "Processing" : "Skipping",arg[idx]);
+ if (logfile)
+ fprintf(logfile,"%s group '%s'\n",
+ len ? "Processing" : "Skipping",arg[idx]);
+
+ MPI_Bcast(&len,1,MPI_INT,0,world);
+ if (len > 0) {
+ MPI_Bcast(name,len+1,MPI_CHAR,0,world);
+ // read tags for atoms in group and broadcast
+ num = 0;
+ tags = read_section(fp,num);
+ MPI_Bcast(&num,1,MPI_LMP_BIGINT,0,world);
+ MPI_Bcast(tags,num,MPI_LMP_TAGINT,0,world);
+ create(name,num,tags);
+ free(tags);
+ }
+ } else {
+
+ MPI_Bcast(&len,1,MPI_INT,0,world);
+ if (len > 0) {
+ delete[] name;
+ name = new char[len+1];
+ MPI_Bcast(name,len+1,MPI_CHAR,0,world);
+
+ MPI_Bcast(&num,1,MPI_LMP_BIGINT,0,world);
+ tags = (tagint *)malloc(sizeof(tagint)*(num ? num : 1));
+ MPI_Bcast(tags,num,MPI_LMP_TAGINT,0,world);
+ create(name,num,tags);
+ free(tags);
+ }
+ }
+ }
+ }
+
+ delete[] name;
+ if (comm->me == 0) {
+ if (screen) fputs("\n",screen);
+ if (logfile) fputs("\n",logfile);
+ fclose(fp);
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
+void Ndx2Group::create(char *name, bigint num, tagint *tags)
+{
+ // wipe out all members if the group exists. gid==0 is group "all"
+ int gid = group->find(name);
+ if (gid > 0) {
+ char *cmd[2];
+ cmd[0] = name;
+ cmd[1] = (char *)"clear";
+ group->assign(2,cmd);
+ }
+
+ // map from global to local
+ const int nlocal = atom->nlocal;
+ int *flags = (int *)calloc(nlocal,sizeof(int));
+ for (bigint i=0; i < num; ++i) {
+ const int id = atom->map(tags[i]);
+ if (id < nlocal && id >= 0)
+ flags[id] = 1;
+ }
+ group->create(name,flags);
+ free(flags);
+}
+
diff --git a/src/fix_store.h b/src/USER-COLVARS/ndx_group.h
similarity index 56%
copy from src/fix_store.h
copy to src/USER-COLVARS/ndx_group.h
index dab989990..479c442f6 100644
--- a/src/fix_store.h
+++ b/src/USER-COLVARS/ndx_group.h
@@ -1,64 +1,56 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
-#ifdef FIX_CLASS
+#ifdef COMMAND_CLASS
-FixStyle(STORE,FixStore)
+CommandStyle(ndx2group,Ndx2Group)
#else
-#ifndef LMP_FIX_STORE_H
-#define LMP_FIX_STORE_H
+#ifndef LMP_NDX_GROUP_H
+#define LMP_NDX_GROUP_H
-#include "fix.h"
+#include "pointers.h"
namespace LAMMPS_NS {
-class FixStore : public Fix {
+class Ndx2Group : protected Pointers {
public:
- double *vstore; // vector storage if nvalues = 1
- double **astore; // array storage if nvalues > 1
-
- FixStore(class LAMMPS *, int, char **);
- ~FixStore();
- int setmask();
-
- double memory_usage();
- void grow_arrays(int);
- void copy_arrays(int, int, int);
- int pack_exchange(int, double *);
- int unpack_exchange(int, double *);
- int pack_restart(int, double *);
- void unpack_restart(int, int);
- int size_restart(int);
- int maxsize_restart();
-
- private:
- int nvalues; // total # of values per atom
- int vecflag; // 1 if nvalues = 1
+ Ndx2Group(class LAMMPS *lmp) : Pointers(lmp) {};
+ void command(int, char **);
+ void create(char *, bigint, tagint *);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
+E: Must have atom IDs for ndx2group command
+
+There are no atom IDs defined in the system, but they are required
+to identify atoms in a gromacs style index file.
+
+E: Cannot open index file for reading
+
+Self-explanatory. Check your filename, permissions, and disk space or quota.
+
*/
diff --git a/src/USER-FEP/fix_adapt_fep.cpp b/src/USER-FEP/fix_adapt_fep.cpp
index 54e90f4c6..3e0e950cb 100644
--- a/src/USER-FEP/fix_adapt_fep.cpp
+++ b/src/USER-FEP/fix_adapt_fep.cpp
@@ -1,596 +1,597 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Charges by type and after option: Agilio Padua (Univ Blaise Pascal & CNRS)
------------------------------------------------------------------------- */
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "fix_adapt_fep.h"
#include "atom.h"
#include "update.h"
#include "group.h"
#include "modify.h"
#include "force.h"
#include "pair.h"
#include "pair_hybrid.h"
#include "kspace.h"
#include "fix_store.h"
#include "input.h"
#include "variable.h"
#include "respa.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
using namespace MathConst;
enum{PAIR,KSPACE,ATOM};
enum{DIAMETER,CHARGE};
/* ---------------------------------------------------------------------- */
FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 5) error->all(FLERR,"Illegal fix adapt/fep command");
nevery = force->inumeric(FLERR,arg[3]);
if (nevery < 0) error->all(FLERR,"Illegal fix adapt/fep command");
dynamic_group_allow = 1;
create_attribute = 1;
// count # of adaptations
nadapt = 0;
int iarg = 4;
while (iarg < narg) {
if (strcmp(arg[iarg],"pair") == 0) {
if (iarg+6 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
nadapt++;
iarg += 6;
} else if (strcmp(arg[iarg],"kspace") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
nadapt++;
iarg += 2;
} else if (strcmp(arg[iarg],"atom") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
nadapt++;
iarg += 4;
} else break;
}
if (nadapt == 0) error->all(FLERR,"Illegal fix adapt/fep command");
adapt = new Adapt[nadapt];
// parse keywords
nadapt = 0;
diamflag = 0;
chgflag = 0;
iarg = 4;
while (iarg < narg) {
if (strcmp(arg[iarg],"pair") == 0) {
if (iarg+6 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
adapt[nadapt].which = PAIR;
int n = strlen(arg[iarg+1]) + 1;
adapt[nadapt].pstyle = new char[n];
strcpy(adapt[nadapt].pstyle,arg[iarg+1]);
n = strlen(arg[iarg+2]) + 1;
adapt[nadapt].pparam = new char[n];
strcpy(adapt[nadapt].pparam,arg[iarg+2]);
force->bounds(arg[iarg+3],atom->ntypes,
adapt[nadapt].ilo,adapt[nadapt].ihi);
force->bounds(arg[iarg+4],atom->ntypes,
adapt[nadapt].jlo,adapt[nadapt].jhi);
if (strstr(arg[iarg+5],"v_") == arg[iarg+5]) {
n = strlen(&arg[iarg+5][2]) + 1;
adapt[nadapt].var = new char[n];
strcpy(adapt[nadapt].var,&arg[iarg+5][2]);
} else error->all(FLERR,"Illegal fix adapt/fep command");
nadapt++;
iarg += 6;
} else if (strcmp(arg[iarg],"kspace") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
adapt[nadapt].which = KSPACE;
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
int n = strlen(&arg[iarg+1][2]) + 1;
adapt[nadapt].var = new char[n];
strcpy(adapt[nadapt].var,&arg[iarg+1][2]);
} else error->all(FLERR,"Illegal fix adapt/fep command");
nadapt++;
iarg += 2;
} else if (strcmp(arg[iarg],"atom") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
adapt[nadapt].which = ATOM;
if (strcmp(arg[iarg+1],"diameter") == 0) {
adapt[nadapt].aparam = DIAMETER;
diamflag = 1;
} else if (strcmp(arg[iarg+1],"charge") == 0) {
adapt[nadapt].aparam = CHARGE;
chgflag = 1;
} else error->all(FLERR,"Illegal fix adapt/fep command");
force->bounds(arg[iarg+2],atom->ntypes,
adapt[nadapt].ilo,adapt[nadapt].ihi);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
adapt[nadapt].var = new char[n];
strcpy(adapt[nadapt].var,&arg[iarg+3][2]);
} else error->all(FLERR,"Illegal fix adapt/fep command");
nadapt++;
iarg += 4;
} else break;
}
// optional keywords
resetflag = 0;
scaleflag = 0;
afterflag = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"reset") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
if (strcmp(arg[iarg+1],"no") == 0) resetflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) resetflag = 1;
else error->all(FLERR,"Illegal fix adapt/fep command");
iarg += 2;
} else if (strcmp(arg[iarg],"scale") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
if (strcmp(arg[iarg+1],"no") == 0) scaleflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) scaleflag = 1;
else error->all(FLERR,"Illegal fix adapt/fep command");
iarg += 2;
} else if (strcmp(arg[iarg],"after") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
if (strcmp(arg[iarg+1],"no") == 0) afterflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) afterflag = 1;
else error->all(FLERR,"Illegal fix adapt/fep command");
iarg += 2;
} else error->all(FLERR,"Illegal fix adapt/fep command");
}
// allocate pair style arrays
int n = atom->ntypes;
for (int m = 0; m < nadapt; m++)
if (adapt[m].which == PAIR)
memory->create(adapt[m].array_orig,n+1,n+1,"adapt:array_orig");
id_fix_diam = id_fix_chg = NULL;
}
/* ---------------------------------------------------------------------- */
FixAdaptFEP::~FixAdaptFEP()
{
for (int m = 0; m < nadapt; m++) {
delete [] adapt[m].var;
if (adapt[m].which == PAIR) {
delete [] adapt[m].pstyle;
delete [] adapt[m].pparam;
memory->destroy(adapt[m].array_orig);
}
}
delete [] adapt;
// check nfix in case all fixes have already been deleted
if (id_fix_diam && modify->nfix) modify->delete_fix(id_fix_diam);
if (id_fix_chg && modify->nfix) modify->delete_fix(id_fix_chg);
delete [] id_fix_diam;
delete [] id_fix_chg;
}
/* ---------------------------------------------------------------------- */
int FixAdaptFEP::setmask()
{
int mask = 0;
mask |= PRE_FORCE;
mask |= POST_RUN;
mask |= PRE_FORCE_RESPA;
return mask;
}
/* ----------------------------------------------------------------------
if need to restore per-atom quantities, create new fix STORE styles
------------------------------------------------------------------------- */
void FixAdaptFEP::post_constructor()
{
if (!resetflag) return;
if (!diamflag && !chgflag) return;
// new id = fix-ID + FIX_STORE_ATTRIBUTE
// new fix group = group for this fix
id_fix_diam = NULL;
id_fix_chg = NULL;
- char **newarg = new char*[5];
+ char **newarg = new char*[6];
newarg[1] = group->names[igroup];
newarg[2] = (char *) "STORE";
- newarg[3] = (char *) "1";
+ newarg[3] = (char *) "peratom";
newarg[4] = (char *) "1";
+ newarg[5] = (char *) "1";
if (diamflag) {
int n = strlen(id) + strlen("_FIX_STORE_DIAM") + 1;
id_fix_diam = new char[n];
strcpy(id_fix_diam,id);
strcat(id_fix_diam,"_FIX_STORE_DIAM");
newarg[0] = id_fix_diam;
- modify->add_fix(5,newarg);
+ modify->add_fix(6,newarg);
fix_diam = (FixStore *) modify->fix[modify->nfix-1];
if (fix_diam->restart_reset) fix_diam->restart_reset = 0;
else {
double *vec = fix_diam->vstore;
double *radius = atom->radius;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vec[i] = radius[i];
else vec[i] = 0.0;
}
}
}
if (chgflag) {
int n = strlen(id) + strlen("_FIX_STORE_CHG") + 1;
id_fix_chg = new char[n];
strcpy(id_fix_chg,id);
strcat(id_fix_chg,"_FIX_STORE_CHG");
newarg[0] = id_fix_chg;
- modify->add_fix(5,newarg);
+ modify->add_fix(6,newarg);
fix_chg = (FixStore *) modify->fix[modify->nfix-1];
if (fix_chg->restart_reset) fix_chg->restart_reset = 0;
else {
double *vec = fix_chg->vstore;
double *q = atom->q;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vec[i] = q[i];
else vec[i] = 0.0;
}
}
}
delete [] newarg;
}
/* ---------------------------------------------------------------------- */
void FixAdaptFEP::init()
{
int i,j;
// allow a dynamic group only if ATOM attribute not used
if (group->dynamic[igroup])
for (int i = 0; i < nadapt; i++)
if (adapt[i].which == ATOM)
error->all(FLERR,"Cannot use dynamic group with fix adapt/fep atom");
// setup and error checks
anypair = 0;
for (int m = 0; m < nadapt; m++) {
Adapt *ad = &adapt[m];
ad->ivar = input->variable->find(ad->var);
if (ad->ivar < 0)
error->all(FLERR,"Variable name for fix adapt/fep does not exist");
if (!input->variable->equalstyle(ad->ivar))
error->all(FLERR,"Variable for fix adapt/fep is invalid style");
if (ad->which == PAIR) {
anypair = 1;
Pair *pair = NULL;
if (lmp->suffix_enable) {
char psuffix[128];
strcpy(psuffix,ad->pstyle);
strcat(psuffix,"/");
strcat(psuffix,lmp->suffix);
pair = force->pair_match(psuffix,1);
}
if (pair == NULL) pair = force->pair_match(ad->pstyle,1);
if (pair == NULL)
error->all(FLERR, "Fix adapt/fep pair style does not exist");
void *ptr = pair->extract(ad->pparam,ad->pdim);
if (ptr == NULL)
error->all(FLERR,"Fix adapt/fep pair style param not supported");
ad->pdim = 2;
if (ad->pdim == 0) ad->scalar = (double *) ptr;
if (ad->pdim == 2) ad->array = (double **) ptr;
// if pair hybrid, test that ilo,ihi,jlo,jhi are valid for sub-style
if (ad->pdim == 2 && (strcmp(force->pair_style,"hybrid") == 0 ||
strcmp(force->pair_style,"hybrid/overlay") == 0)) {
PairHybrid *pair = (PairHybrid *) force->pair;
for (i = ad->ilo; i <= ad->ihi; i++)
for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
if (!pair->check_ijtype(i,j,ad->pstyle))
error->all(FLERR,"Fix adapt/fep type pair range is not valid for "
"pair hybrid sub-style");
}
} else if (ad->which == KSPACE) {
if (force->kspace == NULL)
error->all(FLERR,"Fix adapt/fep kspace style does not exist");
kspace_scale = (double *) force->kspace->extract("scale");
} else if (ad->which == ATOM) {
if (ad->aparam == DIAMETER) {
if (!atom->radius_flag)
error->all(FLERR,"Fix adapt/fep requires atom attribute diameter");
}
if (ad->aparam == CHARGE) {
if (!atom->q_flag)
error->all(FLERR,"Fix adapt/fep requires atom attribute charge");
}
}
}
// make copy of original pair array values
for (int m = 0; m < nadapt; m++) {
Adapt *ad = &adapt[m];
if (ad->which == PAIR && ad->pdim == 2) {
for (i = ad->ilo; i <= ad->ihi; i++)
for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
ad->array_orig[i][j] = ad->array[i][j];
}
}
// fixes that store initial per-atom values
if (id_fix_diam) {
int ifix = modify->find_fix(id_fix_diam);
if (ifix < 0) error->all(FLERR,"Could not find fix adapt storage fix ID");
fix_diam = (FixStore *) modify->fix[ifix];
}
if (id_fix_chg) {
int ifix = modify->find_fix(id_fix_chg);
if (ifix < 0) error->all(FLERR,"Could not find fix adapt storage fix ID");
fix_chg = (FixStore *) modify->fix[ifix];
}
if (strstr(update->integrate_style,"respa"))
nlevels_respa = ((Respa *) update->integrate)->nlevels;
}
/* ---------------------------------------------------------------------- */
void FixAdaptFEP::setup_pre_force(int vflag)
{
change_settings();
}
/* ---------------------------------------------------------------------- */
void FixAdaptFEP::setup_pre_force_respa(int vflag, int ilevel)
{
if (ilevel < nlevels_respa-1) return;
setup_pre_force(vflag);
}
/* ---------------------------------------------------------------------- */
void FixAdaptFEP::pre_force(int vflag)
{
if (nevery == 0) return;
if (afterflag) { // update at n+1 (better with fix ave/time)
if (nevery == 1 || update->ntimestep == 0)
change_settings();
else if (update->ntimestep > 1 && !((update->ntimestep - 1) % nevery))
change_settings();
} else { // original version: update at n
if (update->ntimestep % nevery)
return;
change_settings();
}
}
/* ---------------------------------------------------------------------- */
void FixAdaptFEP::pre_force_respa(int vflag, int ilevel, int)
{
if (ilevel < nlevels_respa-1) return;
pre_force(vflag);
}
/* ---------------------------------------------------------------------- */
void FixAdaptFEP::post_run()
{
if (resetflag) restore_settings();
}
/* ----------------------------------------------------------------------
change pair,kspace,atom parameters based on variable evaluation
------------------------------------------------------------------------- */
void FixAdaptFEP::change_settings()
{
int i,j;
// variable evaluation may invoke computes so wrap with clear/add
modify->clearstep_compute();
for (int m = 0; m < nadapt; m++) {
Adapt *ad = &adapt[m];
double value = input->variable->compute_equal(ad->ivar);
// set global scalar or type pair array values
if (ad->which == PAIR) {
if (ad->pdim == 0) {
if (scaleflag) *ad->scalar = value * ad->scalar_orig;
else *ad->scalar = value;
} else if (ad->pdim == 2) {
if (scaleflag)
for (i = ad->ilo; i <= ad->ihi; i++)
for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
ad->array[i][j] = value*ad->array_orig[i][j];
else
for (i = ad->ilo; i <= ad->ihi; i++)
for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
ad->array[i][j] = value;
}
// set kspace scale factor
} else if (ad->which == KSPACE) {
*kspace_scale = value;
// set per atom values, also make changes for ghost atoms
} else if (ad->which == ATOM) {
// reset radius from diameter
// also scale rmass to new value
if (ad->aparam == DIAMETER) {
int mflag = 0;
if (atom->rmass_flag) mflag = 1;
double density;
int *atype = atom->type;
double *radius = atom->radius;
double *rmass = atom->rmass;
int *mask = atom->mask;
int nlocal = atom->nlocal;
int nall = nlocal + atom->nghost;
if (mflag == 0) {
for (i = 0; i < nall; i++)
if (atype[i] >= ad->ilo && atype[i] <= ad->ihi)
if (mask[i] & groupbit)
radius[i] = 0.5*value;
} else {
for (i = 0; i < nall; i++)
if (atype[i] >= ad->ilo && atype[i] <= ad->ihi)
if (mask[i] & groupbit) {
density = rmass[i] / (4.0*MY_PI/3.0 *
radius[i]*radius[i]*radius[i]);
radius[i] = 0.5*value;
rmass[i] = 4.0*MY_PI/3.0 *
radius[i]*radius[i]*radius[i] * density;
}
}
} else if (ad->aparam == CHARGE) {
int *atype = atom->type;
double *q = atom->q;
int *mask = atom->mask;
int nlocal = atom->nlocal;
int nall = nlocal + atom->nghost;
for (i = 0; i < nall; i++)
if (atype[i] >= ad->ilo && atype[i] <= ad->ihi)
if (mask[i] & groupbit) q[i] = value;
}
}
}
modify->addstep_compute(update->ntimestep + nevery);
// re-initialize pair styles if any PAIR settings were changed
// this resets other coeffs that may depend on changed values,
// and also offset and tail corrections
if (anypair) force->pair->reinit();
// reset KSpace charges if charges have changed
if (chgflag && force->kspace) force->kspace->qsum_qsq();
}
/* ----------------------------------------------------------------------
restore pair,kspace.atom parameters to original values
------------------------------------------------------------------------- */
void FixAdaptFEP::restore_settings()
{
for (int m = 0; m < nadapt; m++) {
Adapt *ad = &adapt[m];
if (ad->which == PAIR) {
if (ad->pdim == 0) *ad->scalar = ad->scalar_orig;
else if (ad->pdim == 2) {
for (int i = ad->ilo; i <= ad->ihi; i++)
for (int j = MAX(ad->jlo,i); j <= ad->jhi; j++)
ad->array[i][j] = ad->array_orig[i][j];
}
} else if (ad->which == KSPACE) {
*kspace_scale = 1.0;
} else if (ad->which == ATOM) {
if (diamflag) {
double density;
double *vec = fix_diam->vstore;
double *radius = atom->radius;
double *rmass = atom->rmass;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
density = rmass[i] / (4.0*MY_PI/3.0 *
radius[i]*radius[i]*radius[i]);
radius[i] = vec[i];
rmass[i] = 4.0*MY_PI/3.0 * radius[i]*radius[i]*radius[i] * density;
}
}
if (chgflag) {
double *vec = fix_chg->vstore;
double *q = atom->q;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) q[i] = vec[i];
}
}
}
if (anypair) force->pair->reinit();
if (chgflag && force->kspace) force->kspace->qsum_qsq();
}
/* ----------------------------------------------------------------------
initialize one atom's storage values, called when atom is created
------------------------------------------------------------------------- */
void FixAdaptFEP::set_arrays(int i)
{
if (fix_diam) fix_diam->vstore[i] = atom->radius[i];
if (fix_chg) fix_chg->vstore[i] = atom->q[i];
}
diff --git a/src/USER-INTEL/intel_preprocess.h b/src/USER-INTEL/intel_preprocess.h
index aabe6e32a..41c82b76f 100644
--- a/src/USER-INTEL/intel_preprocess.h
+++ b/src/USER-INTEL/intel_preprocess.h
@@ -1,518 +1,528 @@
/* -*- c++ -*- -------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: W. Michael Brown (Intel)
------------------------------------------------------------------------- */
#ifdef __INTEL_COMPILER
#define LMP_SIMD_COMPILER
#endif
#ifdef __INTEL_OFFLOAD
#ifdef LMP_INTEL_OFFLOAD
#define _LMP_INTEL_OFFLOAD
#endif
#endif
#ifndef LMP_INTEL_PREPROCESS_H
#define LMP_INTEL_PREPROCESS_H
#ifndef LAMMPS_MEMALIGN
#error Please set -DLAMMPS_MEMALIGN=64 in CCFLAGS for your LAMMPS makefile.
#else
#if (LAMMPS_MEMALIGN != 64)
#error Please set -DLAMMPS_MEMALIGN=64 in CCFLAGS for your LAMMPS makefile.
#endif
#endif
#if defined(_OPENMP)
#define _use_omp_pragma(txt) _Pragma(txt)
#else
#define _use_omp_pragma(txt)
#endif
#if defined(LMP_SIMD_COMPILER)
#define _use_simd_pragma(txt) _Pragma(txt)
#else
#define _use_simd_pragma(txt)
#endif
namespace LAMMPS_NS {
enum {LMP_OVERFLOW, LMP_LOCAL_MIN, LMP_LOCAL_MAX, LMP_GHOST_MIN,
LMP_GHOST_MAX};
enum {TIME_PACK, TIME_HOST_NEIGHBOR, TIME_HOST_PAIR, TIME_OFFLOAD_NEIGHBOR,
TIME_OFFLOAD_PAIR, TIME_OFFLOAD_WAIT, TIME_OFFLOAD_LATENCY,
TIME_IMBALANCE};
#define NUM_ITIMERS ( TIME_IMBALANCE + 1 )
#define INTEL_MIC_VECTOR_WIDTH 16
#define INTEL_VECTOR_WIDTH 4
#ifdef __AVX__
#undef INTEL_VECTOR_WIDTH
#define INTEL_VECTOR_WIDTH 8
#endif
#ifdef __AVX2__
#undef INTEL_VECTOR_WIDTH
#define INTEL_VECTOR_WIDTH 8
#endif
#ifdef __AVX512F__
#undef INTEL_VECTOR_WIDTH
#define INTEL_VECTOR_WIDTH 16
#define INTEL_V512 1
#define INTEL_VMASK 1
#else
#ifdef __MIC__
#define INTEL_V512 1
#define INTEL_VMASK 1
#endif
#endif
#ifdef __AVX512CD__
#ifndef _LMP_INTEL_OFFLOAD
#define LMP_USE_AVXCD
#endif
#endif
#define INTEL_DATA_ALIGN 64
#define INTEL_ONEATOM_FACTOR 2
#define INTEL_MIC_NBOR_PAD INTEL_MIC_VECTOR_WIDTH
#define INTEL_NBOR_PAD INTEL_VECTOR_WIDTH
#define INTEL_LB_MEAN_WEIGHT 0.1
#define INTEL_BIGP 1e15
#define INTEL_MAX_HOST_CORE_COUNT 512
#define INTEL_MAX_COI_CORES 2
#define IP_PRE_get_stride(stride, n, datasize, torque) \
{ \
int blength = n; \
if (torque) blength *= 2; \
const int bytes = blength * datasize; \
stride = INTEL_DATA_ALIGN - (bytes % INTEL_DATA_ALIGN); \
stride = blength + stride / datasize; \
}
#if defined(_OPENMP)
#define IP_PRE_omp_range(ifrom, ito, tid, inum, nthreads) \
{ \
const int idelta = 1 + inum/nthreads; \
ifrom = tid * idelta; \
ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; \
}
#define IP_PRE_omp_range_id(ifrom, ito, tid, inum, nthreads) \
{ \
tid = omp_get_thread_num(); \
IP_PRE_omp_range(ifrom, ito, tid, inum, nthreads); \
}
#define IP_PRE_omp_range_align(ifrom, ito, tid, inum, nthreads, \
datasize) \
{ \
int chunk_size = INTEL_DATA_ALIGN / datasize; \
int idelta = static_cast<int>(static_cast<float>(inum) \
/chunk_size/nthreads) + 1; \
idelta *= chunk_size; \
ifrom = tid*idelta; \
ito = ifrom + idelta; \
if (ito > inum) ito = inum; \
}
#define IP_PRE_omp_range_id_align(ifrom, ito, tid, inum, \
nthreads, datasize) \
{ \
tid = omp_get_thread_num(); \
IP_PRE_omp_range_align(ifrom, ito, tid, inum, nthreads, \
datasize); \
}
#define IP_PRE_omp_range_id_vec(ifrom, ito, tid, inum, \
nthreads, vecsize) \
{ \
tid = omp_get_thread_num(); \
int idelta = static_cast<int>(ceil(static_cast<float>(inum) \
/vecsize/nthreads)); \
idelta *= vecsize; \
ifrom = tid*idelta; \
ito = ifrom + idelta; \
if (ito > inum) ito = inum; \
}
#else
#define IP_PRE_omp_range(ifrom, ito, tid, inum, nthreads) \
{ \
ifrom = 0; \
ito = inum; \
}
#define IP_PRE_omp_range_id(ifrom, ito, tid, inum, nthreads) \
{ \
tid = 0; \
ifrom = 0; \
ito = inum; \
}
#define IP_PRE_omp_range_align(ifrom, ito, tid, inum, nthreads, \
datasize) \
{ \
ifrom = 0; \
ito = inum; \
}
#define IP_PRE_omp_range_id_align(ifrom, ito, tid, inum, \
nthreads, datasize) \
{ \
tid = 0; \
ifrom = 0; \
ito = inum; \
}
+#define IP_PRE_omp_range_id_vec(ifrom, ito, tid, inum, \
+ nthreads, vecsize) \
+ { \
+ tid = 0; \
+ int idelta = static_cast<int>(ceil(static_cast<float>(inum) \
+ /vecsize)); \
+ ifrom = 0; \
+ ito = inum; \
+ }
+
#endif
#ifdef _LMP_INTEL_OFFLOAD
#include <sys/time.h>
__declspec( target (mic))
inline double MIC_Wtime() {
double time;
struct timeval tv;
gettimeofday(&tv, NULL);
time = 1.0 * tv.tv_sec + 1.0e-6 * tv.tv_usec;
return time;
}
#define IP_PRE_pack_separate_buffers(fix, buffers, ago, offload, \
nlocal, nall) \
{ \
if (fix->separate_buffers() && ago != 0) { \
fix->start_watch(TIME_PACK); \
if (offload) { \
_use_omp_pragma("omp parallel default(none) shared(buffers,nlocal,nall)") \
{ \
int ifrom, ito, tid; \
int nthreads = comm->nthreads; \
IP_PRE_omp_range_id_align(ifrom, ito, tid, nlocal, \
nthreads, sizeof(flt_t)); \
buffers->thr_pack_cop(ifrom, ito, 0); \
int nghost = nall - nlocal; \
if (nghost) { \
IP_PRE_omp_range_align(ifrom, ito, tid, nall - nlocal, \
nthreads, sizeof(flt_t)); \
buffers->thr_pack_cop(ifrom + nlocal, ito + nlocal, \
fix->offload_min_ghost() - nlocal, \
ago == 1); \
} \
} \
} else { \
buffers->thr_pack_host(fix->host_min_local(), nlocal, 0); \
buffers->thr_pack_host(nlocal, nall, \
fix->host_min_ghost()-nlocal); \
} \
fix->stop_watch(TIME_PACK); \
} \
}
#define IP_PRE_get_transfern(ago, newton, evflag, eflag, vflag, \
buffers, offload, fix, separate_flag, \
x_size, q_size, ev_size, f_stride) \
{ \
separate_flag = 0; \
if (ago == 0) { \
x_size = 0; \
q_size = nall; \
if (offload) { \
if (fix->separate_buffers()) { \
if (lmp->atom->torque) \
separate_flag = 2; \
else \
separate_flag = 1; \
} else \
separate_flag = 3; \
} \
} else { \
x_size = nall; \
q_size = 0; \
} \
ev_size = 0; \
if (evflag) { \
if (eflag) ev_size = 2; \
if (vflag) ev_size = 8; \
} \
int f_length; \
if (newton) \
f_length = nall; \
else \
f_length = nlocal; \
f_length -= minlocal; \
f_stride = buffers->get_stride(f_length); \
}
#define IP_PRE_get_buffers(offload, buffers, fix, tc, f_start, \
ev_global) \
{ \
if (offload) { \
tc = buffers->get_off_threads(); \
f_start = buffers->get_off_f(); \
ev_global = buffers->get_ev_global(); \
} else { \
tc = comm->nthreads; \
f_start = buffers->get_f(); \
fix->start_watch(TIME_HOST_PAIR); \
ev_global = buffers->get_ev_global_host(); \
} \
}
#define IP_PRE_repack_for_offload(newton, separate_flag, nlocal, nall, \
f_stride, x, q) \
{ \
if (separate_flag) { \
if (separate_flag < 3) { \
int all_local = nlocal; \
int ghost_min = overflow[LMP_GHOST_MIN]; \
nlocal = overflow[LMP_LOCAL_MAX] + 1; \
int nghost = overflow[LMP_GHOST_MAX] + 1 - ghost_min; \
if (nghost < 0) nghost = 0; \
nall = nlocal + nghost; \
separate_flag--; \
int flength; \
if (newton) flength = nall; \
else flength = nlocal; \
IP_PRE_get_stride(f_stride, flength, sizeof(FORCE_T), \
separate_flag); \
if (nghost) { \
if (nlocal < all_local || ghost_min > all_local) { \
memmove(x + nlocal, x + ghost_min, \
(nall - nlocal) * sizeof(ATOM_T)); \
if (q != 0) \
memmove((void *)(q + nlocal), (void *)(q + ghost_min), \
(nall - nlocal) * sizeof(flt_t)); \
} \
} \
} \
x[nall].x = INTEL_BIGP; \
x[nall].y = INTEL_BIGP; \
x[nall].z = INTEL_BIGP; \
} \
}
#else
#define MIC_Wtime MPI_Wtime
#define IP_PRE_pack_separate_buffers(fix, buffers, ago, offload, \
nlocal, nall)
#define IP_PRE_get_transfern(ago, newton, evflag, eflag, vflag, \
buffers, offload, fix, separate_flag, \
x_size, q_size, ev_size, f_stride) \
{ \
separate_flag = 0; \
int f_length; \
if (newton) \
f_length = nall; \
else \
f_length = nlocal; \
f_stride = buffers->get_stride(f_length); \
}
#define IP_PRE_get_buffers(offload, buffers, fix, tc, f_start, \
ev_global) \
{ \
tc = comm->nthreads; \
f_start = buffers->get_f(); \
fix->start_watch(TIME_HOST_PAIR); \
ev_global = buffers->get_ev_global_host(); \
}
#define IP_PRE_repack_for_offload(newton, separate_flag, nlocal, nall, \
f_stride, x, q)
#endif
#define IP_PRE_ev_tally_nbor(vflag, ev_pre, fpair, delx, dely, delz) \
{ \
if (vflag == 1) { \
sv0 += ev_pre * delx * delx * fpair; \
sv1 += ev_pre * dely * dely * fpair; \
sv2 += ev_pre * delz * delz * fpair; \
sv3 += ev_pre * delx * dely * fpair; \
sv4 += ev_pre * delx * delz * fpair; \
sv5 += ev_pre * dely * delz * fpair; \
} \
}
#define IP_PRE_ev_tally_nbor3(vflag, fj, fk, delx, dely, delz, delr2) \
{ \
if (vflag == 1) { \
sv0 += delx * fj[0] + delr2[0] * fk[0]; \
sv1 += dely * fj[1] + delr2[1] * fk[1]; \
sv2 += delz * fj[2] + delr2[2] * fk[2]; \
sv3 += delx * fj[1] + delr2[0] * fk[1]; \
sv4 += delx * fj[2] + delr2[0] * fk[2]; \
sv5 += dely * fj[2] + delr2[1] * fk[2]; \
} \
}
#define IP_PRE_ev_tally_nbor3v(vflag, fj0, fj1, fj2, delx, dely, delz) \
{ \
if (vflag == 1) { \
sv0 += delx * fj0; \
sv1 += dely * fj1; \
sv2 += delz * fj2; \
sv3 += delx * fj1; \
sv4 += delx * fj2; \
sv5 += dely * fj2; \
} \
}
#define IP_PRE_ev_tally_dihed(eflag, eatom, vflag, deng, i1, i2, i3, i4,\
f1x, f1y, f1z, f3x, f3y, f3z, f4x, f4y, \
f4z, vb1x, vb1y, vb1z, vb2x, vb2y, vb2z, \
vb3x, vb3y, vb3z,oedihedral, force, \
newton, nlocal) \
{ \
flt_t ev_pre; \
if (newton) ev_pre = (flt_t)1.0; \
else { \
ev_pre = (flt_t)0.0; \
if (i1 < nlocal) ev_pre += (flt_t)0.25; \
if (i2 < nlocal) ev_pre += (flt_t)0.25; \
if (i3 < nlocal) ev_pre += (flt_t)0.25; \
if (i4 < nlocal) ev_pre += (flt_t)0.25; \
} \
\
if (eflag) { \
oedihedral += ev_pre * deng; \
if (eatom) { \
flt_t qdeng = deng * (flt_t)0.25; \
if (newton || i1 < nlocal) f[i1].w += qdeng; \
if (newton || i2 < nlocal) f[i2].w += qdeng; \
if (newton || i3 < nlocal) f[i3].w += qdeng; \
if (newton || i4 < nlocal) f[i4].w += qdeng; \
} \
} \
\
if (vflag) { \
sv0 += ev_pre * (vb1x*f1x + vb2x*f3x + (vb3x+vb2x)*f4x); \
sv1 += ev_pre * (vb1y*f1y + vb2y*f3y + (vb3y+vb2y)*f4y); \
sv2 += ev_pre * (vb1z*f1z + vb2z*f3z + (vb3z+vb2z)*f4z); \
sv3 += ev_pre * (vb1x*f1y + vb2x*f3y + (vb3x+vb2x)*f4y); \
sv4 += ev_pre * (vb1x*f1z + vb2x*f3z + (vb3x+vb2x)*f4z); \
sv5 += ev_pre * (vb1y*f1z + vb2y*f3z + (vb3y+vb2y)*f4z); \
} \
}
#define IP_PRE_ev_tally_atom(evflag, eflag, vflag, f, fwtmp) \
{ \
if (evflag) { \
if (eflag) { \
f[i].w += fwtmp; \
oevdwl += sevdwl; \
} \
if (vflag == 1) { \
ov0 += sv0; \
ov1 += sv1; \
ov2 += sv2; \
ov3 += sv3; \
ov4 += sv4; \
ov5 += sv5; \
} \
} \
}
#define IP_PRE_ev_tally_atomq(evflag, eflag, vflag, f, fwtmp) \
{ \
if (evflag) { \
if (eflag) { \
f[i].w += fwtmp; \
oevdwl += sevdwl; \
oecoul += secoul; \
} \
if (vflag == 1) { \
ov0 += sv0; \
ov1 += sv1; \
ov2 += sv2; \
ov3 += sv3; \
ov4 += sv4; \
ov5 += sv5; \
} \
} \
}
#define IP_PRE_fdotr_acc_force(newton, evflag, eflag, vflag, eatom, \
nall, nlocal, minlocal, nthreads, \
f_start, f_stride, x) \
{ \
int o_range; \
if (newton) \
o_range = nall; \
else \
o_range = nlocal; \
if (offload == 0) o_range -= minlocal; \
IP_PRE_omp_range_align(iifrom, iito, tid, o_range, nthreads, \
sizeof(acc_t)); \
\
int t_off = f_stride; \
if (eflag && eatom) { \
for (int t = 1; t < nthreads; t++) { \
_use_simd_pragma("vector nontemporal") \
_use_simd_pragma("novector") \
for (int n = iifrom; n < iito; n++) { \
f_start[n].x += f_start[n + t_off].x; \
f_start[n].y += f_start[n + t_off].y; \
f_start[n].z += f_start[n + t_off].z; \
f_start[n].w += f_start[n + t_off].w; \
} \
t_off += f_stride; \
} \
} else { \
for (int t = 1; t < nthreads; t++) { \
_use_simd_pragma("vector nontemporal") \
_use_simd_pragma("novector") \
for (int n = iifrom; n < iito; n++) { \
f_start[n].x += f_start[n + t_off].x; \
f_start[n].y += f_start[n + t_off].y; \
f_start[n].z += f_start[n + t_off].z; \
} \
t_off += f_stride; \
} \
} \
\
if (evflag) { \
if (vflag == 2) { \
const ATOM_T * _noalias const xo = x + minlocal; \
_use_simd_pragma("vector nontemporal") \
_use_simd_pragma("novector") \
for (int n = iifrom; n < iito; n++) { \
ov0 += f_start[n].x * xo[n].x; \
ov1 += f_start[n].y * xo[n].y; \
ov2 += f_start[n].z * xo[n].z; \
ov3 += f_start[n].y * xo[n].x; \
ov4 += f_start[n].z * xo[n].x; \
ov5 += f_start[n].z * xo[n].y; \
} \
} \
} \
}
}
#endif
diff --git a/src/USER-INTEL/pair_tersoff_intel.cpp b/src/USER-INTEL/pair_tersoff_intel.cpp
index e43e94009..b33056de4 100644
--- a/src/USER-INTEL/pair_tersoff_intel.cpp
+++ b/src/USER-INTEL/pair_tersoff_intel.cpp
@@ -1,1471 +1,1498 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Markus Höhnerbach (RWTH)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_tersoff_intel.h"
#include "atom.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "force.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
+// Currently Intel compiler is required for this pair style.
+// For convenience, base class routines are called if not using Intel compiler.
+#ifndef __INTEL_COMPILER
+using namespace LAMMPS_NS;
+
+PairTersoffIntel::PairTersoffIntel(LAMMPS *lmp) : PairTersoff(lmp)
+{
+}
+
+void PairTersoffIntel::compute(int eflag, int vflag)
+{
+ PairTersoff::compute(eflag, vflag);
+}
+
+void PairTersoffIntel::init_style()
+{
+ if (comm->me == 0) {
+ error->warning(FLERR, "Tersoff/intel currently requires intel compiler. "
+ "Using MANYBODY version.");
+ }
+ PairTersoff::init_style();
+}
+
+#else
+
#ifdef _LMP_INTEL_OFFLOAD
#pragma offload_attribute(push,target(mic))
#endif
#include "intel_intrinsics.h"
#include "math_const.h"
#ifdef _LMP_INTEL_OFFLOAD
#pragma offload_attribute(pop)
#endif
#include "group.h"
#include "kspace.h"
#include "modify.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace MathConst;
/* ---------------------------------------------------------------------- */
PairTersoffIntel::PairTersoffIntel(LAMMPS *lmp) : PairTersoff(lmp)
{
suffix_flag |= Suffix::INTEL;
respa_enable = 0;
}
/* ---------------------------------------------------------------------- */
// Dispatch the requested precision
void PairTersoffIntel::compute(int eflag, int vflag)
{
if (fix->precision()==FixIntel::PREC_MODE_MIXED) {
compute<float,double>(eflag, vflag, fix->get_mixed_buffers(),
force_const_single);
} else if (fix->precision()==FixIntel::PREC_MODE_DOUBLE) {
compute<double,double>(eflag, vflag, fix->get_double_buffers(),
force_const_double);
} else {
compute<float,float>(eflag, vflag, fix->get_single_buffers(),
force_const_single);
}
fix->balance_stamp();
vflag_fdotr = 0;
}
// Dispatch the extent of computation:
// do we need to calculate energy/virial
template <class flt_t, class acc_t>
void PairTersoffIntel::compute(int eflag, int vflag,
IntelBuffers<flt_t,acc_t> *buffers,
const ForceConst<flt_t> &fc)
{
if (eflag || vflag) {
ev_setup(eflag,vflag);
} else evflag = vflag_fdotr = 0;
const int inum = list->inum;
const int nthreads = comm->nthreads;
const int host_start = fix->host_start_pair();
const int offload_end = fix->offload_end_pair();
const int ago = neighbor->ago;
if (ago != 0 && fix->separate_buffers() == 0) {
fix->start_watch(TIME_PACK);
#if defined(_OPENMP)
#pragma omp parallel default(none) shared(eflag,vflag,buffers,fc)
#endif
{
int ifrom, ito, tid;
IP_PRE_omp_range_id_align(ifrom, ito, tid, atom->nlocal + atom->nghost,
nthreads, sizeof(ATOM_T));
buffers->thr_pack(ifrom,ito,ago);
}
fix->stop_watch(TIME_PACK);
}
if (evflag || vflag_fdotr) {
int ovflag = 0;
if (vflag_fdotr) ovflag = 2;
else if (vflag) ovflag = 1;
if (eflag) {
eval<1,1,1>(1, ovflag, buffers, fc, 0, offload_end);
eval<1,1,1>(0, ovflag, buffers, fc, host_start, inum);
} else {
eval<1,0,1>(1, ovflag, buffers, fc, 0, offload_end);
eval<1,0,1>(0, ovflag, buffers, fc, host_start, inum);
}
} else {
eval<0,0,1>(1, 0, buffers, fc, 0, offload_end);
eval<0,0,1>(0, 0, buffers, fc, host_start, inum);
}
}
#ifdef _LMP_INTEL_OFFLOAD
#pragma offload_attribute(push, target(mic))
#endif
// The complete Tersoff computation kernel is encapsulated here
// everything is static, the class just serves as a unit of organization
template<class flt_t, class acc_t, lmp_intel::CalculationMode mic, bool pack_i>
struct IntelKernelTersoff : public lmp_intel::vector_routines<flt_t, acc_t, mic> {
// instantiate the vector library and import the types
typedef typename lmp_intel::vector_routines<flt_t, acc_t, mic> v;
typedef typename v::fvec fvec;
typedef typename v::ivec ivec;
typedef typename v::bvec bvec;
typedef typename v::avec avec;
typedef typename v::iarr iarr;
typedef typename v::farr farr;
typedef typename v::aarr aarr;
typedef typename PairTersoffIntel::ForceConst<flt_t>::c_inner_t c_inner_t;
typedef typename PairTersoffIntel::ForceConst<flt_t>::c_outer_t c_outer_t;
// for descriptions of these methods, please have a look at the original code
// what's done in here is that they are inlined and vectorized
// attractive() also provides an option to compute zeta as well
static fvec zeta_vector(
const c_inner_t * param,
ivec xjw, bvec mask,
fvec vrij, fvec rsq2,
fvec vdijx, fvec vdijy, fvec vdijz,
fvec dikx, fvec diky, fvec dikz
);
static void force_zeta_vector(
const c_outer_t * param,
ivec xjw,
bvec mask,
fvec vrijsq, fvec vzeta_ij,
fvec *vfpair, fvec *vprefactor, int EVDWL, fvec *vevdwl,
bvec vmask_repulsive
);
template<bool ZETA>
static void attractive_vector(
const c_inner_t * param,
ivec xjw,
bvec mask,
fvec vprefactor,
fvec vrijsq, fvec rsq2,
fvec vdijx, fvec vdijy, fvec vdijz,
fvec dikx, fvec diky, fvec dikz,
fvec *fix, fvec *fiy, fvec *fiz,
fvec *fjx, fvec *fjy, fvec *fjz,
fvec *fkx, fvec *fky, fvec *fkz,
fvec *zeta
);
// perform the actual computation
template<bool EVFLAG, bool EFLAG>
static void kernel(
int iito, int iifrom, int eatom, int vflag,
const int * _noalias const numneigh,
const int * _noalias const numneighhalf,
const int * _noalias const cnumneigh,
const int * _noalias const firstneigh, int ntypes,
typename IntelBuffers<flt_t,acc_t>::atom_t * _noalias const x,
const c_inner_t * _noalias const c_inner,
const c_outer_t * _noalias const c_outer,
typename IntelBuffers<flt_t,acc_t>::vec3_acc_t * _noalias const f,
acc_t *evdwl, acc_t *ov0, acc_t * ov1, acc_t *ov2, acc_t* ov3, acc_t *ov4, acc_t *ov5
);
// perform one step of calculation, pass in i-j pairs of atoms (is, js)
template<int EVFLAG, int EFLAG>
static void kernel_step(
int eatom, int vflag,
const int * _noalias const numneigh,
const int * _noalias const cnumneigh,
const int * _noalias const firstneigh,
int ntypes,
typename IntelBuffers<flt_t,acc_t>::atom_t * _noalias const x,
const c_inner_t * _noalias const c_inner,
const c_outer_t * _noalias const c_outer,
typename IntelBuffers<flt_t,acc_t>::vec3_acc_t * _noalias const f,
avec *vsevdwl, avec *vsv0, avec * vsv1, avec *vsv2, avec* vsv3, avec *vsv4, avec *vsv5,
int compress_idx, iarr is, iarr js, bvec vmask_repulsive
);
// perform one step of calculation, as opposed to the previous method now
// with fixed i and a number of js
template<int EVFLAG, int EFLAG>
static void kernel_step_const_i(
int eatom, int vflag,
const int * _noalias const numneigh, const int * _noalias const cnumneigh,
const int * _noalias const firstneigh, int ntypes,
typename IntelBuffers<flt_t,acc_t>::atom_t * _noalias const x,
const c_inner_t * _noalias const c_inner,
const c_outer_t * _noalias const c_outer,
typename IntelBuffers<flt_t,acc_t>::vec3_acc_t * _noalias const f,
avec *vsevdwl, avec *vsv0, avec *vsv1, avec *vsv2, avec *vsv3, avec *vsv4, avec *vsv5,
int compress_idx, int i, iarr js, bvec vmask_repulsive
);
};
#ifdef _LMP_INTEL_OFFLOAD
#pragma offload_attribute(pop)
#endif
/* ---------------------------------------------------------------------- */
// Dispatch to correct kernel instatiation and perform all the work neccesary
// for offloading. In this routine we enter the Phi.
// This method is nearly identical to what happens in the other /intel styles
template <int EVFLAG, int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
void PairTersoffIntel::eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> *buffers,
const ForceConst<flt_t> &fc,
const int astart, const int aend)
{
const int inum = aend - astart;
if (inum == 0) return;
int nlocal, nall, minlocal;
fix->get_buffern(offload, nlocal, nall, minlocal);
const int ago = neighbor->ago;
IP_PRE_pack_separate_buffers(fix, buffers, ago, offload, nlocal, nall);
ATOM_T * _noalias const x = buffers->get_x(offload);
tagint * _noalias tag = this->atom->tag;
flt_t * _noalias const q = buffers->get_q(offload);
const int * _noalias const numneigh = list->numneigh;
const int * _noalias const cnumneigh = buffers->cnumneigh(list);
const int * _noalias const numneighhalf = buffers->get_atombin();
const int * _noalias const firstneigh = buffers->firstneigh(list);
typedef typename ForceConst<flt_t>::c_inner_t c_inner_t;
typedef typename ForceConst<flt_t>::c_outer_t c_outer_t;
typedef typename ForceConst<flt_t>::c_cutoff_t c_cutoff_t;
const c_outer_t * _noalias const c_outer = fc.c_outer[0];
const c_inner_t * _noalias const c_inner = fc.c_inner[0][0];
const c_cutoff_t * _noalias const c_inner_cutoff = fc.c_cutoff_inner[0][0];
const int ntypes = atom->ntypes + 1;
const int eatom = this->eflag_atom;
// Determine how much data to transfer
int x_size, q_size, f_stride, ev_size, separate_flag;
IP_PRE_get_transfern(ago, NEWTON_PAIR, EVFLAG, EFLAG, vflag,
buffers, offload, fix, separate_flag,
x_size, q_size, ev_size, f_stride);
int tc;
FORCE_T * _noalias f_start;
acc_t * _noalias ev_global;
IP_PRE_get_buffers(offload, buffers, fix, tc, f_start, ev_global);
const int nthreads = tc;
#ifdef _LMP_INTEL_OFFLOAD
int *overflow = fix->get_off_overflow_flag();
double *timer_compute = fix->off_watch_pair();
if (offload) fix->start_watch(TIME_OFFLOAD_LATENCY);
#pragma offload target(mic:_cop) if(offload) \
in(c_inner, c_outer :length(0) alloc_if(0) free_if(0)) \
in(c_inner_cutoff :length(0) alloc_if(0) free_if(0)) \
in(firstneigh:length(0) alloc_if(0) free_if(0)) \
in(cnumneigh:length(0) alloc_if(0) free_if(0)) \
in(numneigh:length(0) alloc_if(0) free_if(0)) \
in(numneighhalf:length(0) alloc_if(0) free_if(0)) \
in(x:length(x_size) alloc_if(0) free_if(0)) \
in(overflow:length(0) alloc_if(0) free_if(0)) \
in(astart,nthreads,inum,nall,ntypes,vflag,eatom) \
in(f_stride,nlocal,minlocal,separate_flag,offload) \
out(f_start:length(f_stride) alloc_if(0) free_if(0)) \
out(ev_global:length(ev_size) alloc_if(0) free_if(0)) \
out(timer_compute:length(1) alloc_if(0) free_if(0)) \
signal(f_start)
#endif
{
#ifdef _LMP_INTEL_OFFLOAD
#ifdef __MIC__
*timer_compute = MIC_Wtime();
#endif
#endif
IP_PRE_repack_for_offload(NEWTON_PAIR, separate_flag, nlocal, nall,
f_stride, x, 0);
acc_t oevdwl, oecoul, ov0, ov1, ov2, ov3, ov4, ov5;
if (EVFLAG) {
oevdwl = oecoul = (acc_t)0;
if (vflag) ov0 = ov1 = ov2 = ov3 = ov4 = ov5 = (acc_t)0;
}
// loop over neighbors of my atoms
#if defined(_OPENMP)
#pragma omp parallel default(none) \
shared(f_start,f_stride,nlocal,nall,minlocal) \
reduction(+:oevdwl,oecoul,ov0,ov1,ov2,ov3,ov4,ov5)
#endif
{
int iifrom, iito, tid;
IP_PRE_omp_range_id(iifrom, iito, tid, inum, nthreads);
iifrom += astart;
iito += astart;
FORCE_T * _noalias const f = f_start - minlocal + (tid * f_stride);
memset(f + minlocal, 0, f_stride * sizeof(FORCE_T));
{
acc_t sevdwl, sv0, sv1, sv2, sv3, sv4, sv5;
sevdwl = sv0 = sv1 = sv2 = sv3 = sv4 = sv5 = 0.;
#define ARGS iito, iifrom, eatom, vflag, numneigh, numneighhalf, cnumneigh, \
firstneigh, ntypes, x, c_inner, c_outer, f, &sevdwl, &sv0, &sv1, &sv2, &sv3, &sv4, &sv5
// Pick the variable i algorithm under specific conditions
// do use scalar algorithm with very short vectors
int VL = lmp_intel::vector_routines<flt_t,acc_t,lmp_intel::mode>::VL;
bool pack_i = VL >= 8 &&
lmp_intel::vector_traits<lmp_intel::mode>::support_integer_and_gather_ops;
bool use_scalar = VL < 4;
if (use_scalar) {
IntelKernelTersoff<flt_t,acc_t,lmp_intel::NONE,false>::kernel<EVFLAG,EFLAG>(ARGS);
} else if (pack_i) {
IntelKernelTersoff<flt_t,acc_t,lmp_intel::mode,true >::kernel<EVFLAG,EFLAG>(ARGS);
} else {
IntelKernelTersoff<flt_t,acc_t,lmp_intel::mode,false>::kernel<EVFLAG,EFLAG>(ARGS);
}
if (EVFLAG) {
if (EFLAG) oevdwl += sevdwl;
if (vflag == 1) {
ov0 += sv0;
ov1 += sv1;
ov2 += sv2;
ov3 += sv3;
ov4 += sv4;
ov5 += sv5;
}
}
}
#if defined(_OPENMP)
#pragma omp barrier
#endif
IP_PRE_fdotr_acc_force(NEWTON_PAIR, EVFLAG, EFLAG, vflag, eatom, nall,
nlocal, minlocal, nthreads, f_start, f_stride,
x);
} // end of omp parallel region
if (EVFLAG) {
if (EFLAG) {
ev_global[0] = oevdwl;
ev_global[1] = 0.0;
}
if (vflag) {
ev_global[2] = ov0;
ev_global[3] = ov1;
ev_global[4] = ov2;
ev_global[5] = ov3;
ev_global[6] = ov4;
ev_global[7] = ov5;
}
}
#ifdef _LMP_INTEL_OFFLOAD
#ifdef __MIC__
*timer_compute = MIC_Wtime() - *timer_compute;
#endif
#endif
} // end of offload region
if (offload)
fix->stop_watch(TIME_OFFLOAD_LATENCY);
else
fix->stop_watch(TIME_HOST_PAIR);
if (EVFLAG)
fix->add_result_array(f_start, ev_global, offload, eatom);
else
fix->add_result_array(f_start, 0, offload);
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
// As in any other /intel pair style
void PairTersoffIntel::init_style()
{
if (atom->tag_enable == 0)
error->all(FLERR,"Pair style Tersoff requires atom IDs");
if (force->newton_pair == 0)
error->all(FLERR,"Pair style Tersoff requires newton pair on");
// need a full neighbor list
int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1;
neighbor->requests[irequest]->intel = 1;
int ifix = modify->find_fix("package_intel");
if (ifix < 0)
error->all(FLERR,
"The 'package intel' command is required for /intel styles");
fix = static_cast<FixIntel *>(modify->fix[ifix]);
fix->pair_init_check();
#ifdef _LMP_INTEL_OFFLOAD
_cop = fix->coprocessor_number();
#endif
if (fix->precision() == FixIntel::PREC_MODE_MIXED) {
pack_force_const(force_const_single, fix->get_mixed_buffers());
fix->get_mixed_buffers()->need_tag(1);
} else if (fix->precision() == FixIntel::PREC_MODE_DOUBLE) {
fix->get_double_buffers()->need_tag(1);
pack_force_const(force_const_double, fix->get_double_buffers());
} else {
pack_force_const(force_const_single, fix->get_single_buffers());
fix->get_single_buffers()->need_tag(1);
}
}
// As in any other /intel pair style
template <class flt_t, class acc_t>
void PairTersoffIntel::pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t,acc_t> *buffers)
{
int tp1 = atom->ntypes + 1;
fc.set_ntypes(tp1, memory, _cop);
buffers->set_ntypes(tp1);
flt_t **cutneighsq = buffers->get_cutneighsq();
// Repeat cutsq calculation because done after call to init_style
double cut, cutneigh;
for (int i = 1; i <= atom->ntypes; i++) {
for (int j = i; j <= atom->ntypes; j++) {
if (setflag[i][j] != 0 || (setflag[i][i] != 0 && setflag[j][j] != 0)) {
cut = init_one(i, j);
cutneigh = cut + neighbor->skin;
cutsq[i][j] = cutsq[j][i] = cut*cut;
cutneighsq[i][j] = cutneighsq[j][i] = cutneigh * cutneigh;
}
}
}
for (int i = 1; i < tp1; i++) {
for (int j = 1; j < tp1; j++) {
fc.c_inner_loop[i][j][0].d2 = 1.0;
fc.c_inner_loop[i][0][j].d2 = 1.0;
fc.c_inner_loop[0][i][j].d2 = 1.0;
for (int k = 1; k < tp1; k++) {
Param * param = &params[elem2param[map[i]][map[j]][map[k]]];
fc.c_cutoff_inner[i][k][j].cutsq = static_cast<flt_t>(param->cutsq);
fc.c_inner_loop[i][j][k].lam3 = static_cast<flt_t>(param->lam3);
fc.c_inner_loop[i][j][k].bigr = static_cast<flt_t>(param->bigr);
fc.c_inner_loop[i][j][k].bigd = static_cast<flt_t>(param->bigd);
fc.c_inner_loop[i][j][k].c2 = static_cast<flt_t>(param->c * param->c);
fc.c_inner_loop[i][j][k].d2 = static_cast<flt_t>(param->d * param->d);
fc.c_inner_loop[i][j][k].h = static_cast<flt_t>(param->h);
fc.c_inner_loop[i][j][k].gamma = static_cast<flt_t>(param->gamma);
fc.c_inner_loop[i][j][k].powermint = static_cast<flt_t>(param->powermint);
fc.c_inner[i][j][k].cutsq = static_cast<flt_t>(param->cutsq);
fc.c_inner[i][j][k].lam3 = static_cast<flt_t>(param->lam3);
fc.c_inner[i][j][k].bigr = static_cast<flt_t>(param->bigr);
fc.c_inner[i][j][k].bigd = static_cast<flt_t>(param->bigd);
fc.c_inner[i][j][k].c2 = static_cast<flt_t>(param->c * param->c);
fc.c_inner[i][j][k].d2 = static_cast<flt_t>(param->d * param->d);
fc.c_inner[i][j][k].h = static_cast<flt_t>(param->h);
fc.c_inner[i][j][k].gamma = static_cast<flt_t>(param->gamma);
fc.c_inner[i][j][k].powermint = static_cast<flt_t>(param->powermint);
}
Param * param = &params[elem2param[map[i]][map[j]][map[j]]];
fc.c_cutoff_outer[i][j].cutsq = static_cast<flt_t>(param->cutsq);
fc.c_first_loop[i][j].bigr = static_cast<flt_t>(param->bigr);
fc.c_first_loop[i][j].bigd = static_cast<flt_t>(param->bigd);
fc.c_first_loop[i][j].lam1 = static_cast<flt_t>(param->lam1);
fc.c_first_loop[i][j].biga = static_cast<flt_t>(param->biga);
fc.c_second_loop[i][j].lam2 = static_cast<flt_t>(param->lam2);
fc.c_second_loop[i][j].beta = static_cast<flt_t>(param->beta);
fc.c_second_loop[i][j].bigb = static_cast<flt_t>(param->bigb);
fc.c_second_loop[i][j].powern = static_cast<flt_t>(param->powern);
fc.c_second_loop[i][j].c1 = static_cast<flt_t>(param->c1);
fc.c_second_loop[i][j].c2 = static_cast<flt_t>(param->c2);
fc.c_second_loop[i][j].c3 = static_cast<flt_t>(param->c3);
fc.c_second_loop[i][j].c4 = static_cast<flt_t>(param->c4);
fc.c_outer[i][j].cutsq = static_cast<flt_t>(param->cutsq);
fc.c_outer[i][j].bigr = static_cast<flt_t>(param->bigr);
fc.c_outer[i][j].bigd = static_cast<flt_t>(param->bigd);
fc.c_outer[i][j].lam1 = static_cast<flt_t>(param->lam1);
fc.c_outer[i][j].biga = static_cast<flt_t>(param->biga);
fc.c_outer[i][j].lam2 = static_cast<flt_t>(param->lam2);
fc.c_outer[i][j].beta = static_cast<flt_t>(param->beta);
fc.c_outer[i][j].bigb = static_cast<flt_t>(param->bigb);
fc.c_outer[i][j].powern = static_cast<flt_t>(param->powern);
fc.c_outer[i][j].c1 = static_cast<flt_t>(param->c1);
fc.c_outer[i][j].c2 = static_cast<flt_t>(param->c2);
fc.c_outer[i][j].c3 = static_cast<flt_t>(param->c3);
fc.c_outer[i][j].c4 = static_cast<flt_t>(param->c4);
}
fc.c_outer[i][0].cutsq = 0.;
}
#ifdef _LMP_INTEL_OFFLOAD
if (_cop < 0) return;
typename ForceConst<flt_t>::c_first_loop_t * c_first_loop = fc.c_first_loop[0];
typename ForceConst<flt_t>::c_cutoff_t * c_cutoff_outer = fc.c_cutoff_outer[0];
typename ForceConst<flt_t>::c_outer_t * c_outer = fc.c_outer[0];
typename ForceConst<flt_t>::c_second_loop_t * c_second_loop = fc.c_second_loop[0];
typename ForceConst<flt_t>::c_inner_loop_t * c_inner_loop = fc.c_inner_loop[0][0];
typename ForceConst<flt_t>::c_cutoff_t * c_cutoff_inner = fc.c_cutoff_inner[0][0];
typename ForceConst<flt_t>::c_inner_t * c_inner = fc.c_inner[0][0];
flt_t * ocutneighsq = cutneighsq[0];
size_t VL = 512 / 8 / sizeof(flt_t);
int ntypes = tp1;
int ntypes_pad = ntypes + VL - ntypes % VL;
int tp1sq = tp1 * tp1;
int tp1cb = tp1 * tp1 * tp1;
int tp1cb_pad = tp1 * tp1 * ntypes_pad;
#pragma offload_transfer target(mic:_cop) \
in(c_first_loop, c_second_loop, c_cutoff_outer, c_outer : length(tp1sq) alloc_if(0) free_if(0)) \
in(c_inner : length(tp1cb) alloc_if(0) free_if(0)) \
in(c_cutoff_inner : length(tp1cb_pad) alloc_if(0) free_if(0)) \
in(ocutneighsq: length(tp1sq) alloc_if(0) free_if(0))
#endif
}
/* ---------------------------------------------------------------------- */
// As in any other /intel pair style
template <class flt_t>
void PairTersoffIntel::ForceConst<flt_t>::set_ntypes(const int ntypes,
Memory *memory,
const int cop) {
if ( (ntypes != _ntypes) ) {
if (_ntypes > 0) {
#ifdef _LMP_INTEL_OFFLOAD
c_first_loop_t * oc_first_loop = c_first_loop[0];
c_second_loop_t * oc_second_loop = c_second_loop[0];
c_inner_loop_t * oc_inner_loop = c_inner_loop[0][0];
c_cutoff_t * oc_cutoff_inner = c_cutoff_inner[0][0];
c_cutoff_t * oc_cutoff_outer = c_cutoff_outer[0];
c_inner_t * oc_inner = c_inner[0][0];
c_outer_t * oc_outer = c_outer[0];
if (c_first_loop != NULL && c_second_loop != NULL &&
c_inner_loop != NULL && _cop >= 0) {
#pragma offload_transfer target(mic:cop) \
nocopy(oc_first_loop, oc_second_loop, oc_inner_loop: alloc_if(0) free_if(1)) \
nocopy(oc_cutoff_outer, oc_cutoff_inner: alloc_if(0) free_if(1)) \
nocopy(oc_inner, oc_outer: alloc_if(0) free_if(0))
}
#endif
_memory->destroy(c_first_loop);
_memory->destroy(c_second_loop);
_memory->destroy(c_inner_loop);
_memory->destroy(c_cutoff_outer);
_memory->destroy(c_cutoff_inner);
_memory->destroy(c_inner);
_memory->destroy(c_outer);
}
if (ntypes > 0) {
_cop = cop;
size_t VL = 512 / 8 / sizeof(flt_t);
int ntypes_pad = ntypes + VL - ntypes % VL;
memory->create(c_first_loop,ntypes,ntypes,"fc.c_first_loop");
memory->create(c_second_loop,ntypes,ntypes,"fc.c_second_loop");
memory->create(c_cutoff_outer,ntypes,ntypes,"fc.c_cutoff_outer");
memory->create(c_inner_loop,ntypes,ntypes,ntypes,"fc.c_inner_loop");
memory->create(c_cutoff_inner,ntypes,ntypes,ntypes_pad,"fc.c_cutoff_inner");
memory->create(c_inner,ntypes,ntypes,ntypes,"fc.c_inner");
memory->create(c_outer,ntypes,ntypes,"fc.c_outer");
#ifdef _LMP_INTEL_OFFLOAD
c_first_loop_t * oc_first_loop = c_first_loop[0];
c_second_loop_t * oc_second_loop = c_second_loop[0];
c_cutoff_t * oc_cutoff_outer = c_cutoff_outer[0];
c_inner_loop_t * oc_inner_loop = c_inner_loop[0][0];
c_cutoff_t * oc_cutoff_inner = c_cutoff_inner[0][0];
c_inner_t * oc_inner = c_inner[0][0];
c_outer_t * oc_outer = c_outer[0];
int tp1sq = ntypes * ntypes;
int tp1cb = ntypes * ntypes * ntypes;
int tp1cb_pad = ntypes * ntypes * ntypes_pad;
if (oc_first_loop != NULL && oc_second_loop != NULL &&
oc_inner_loop != NULL && cop >= 0) {
#pragma offload_transfer target(mic:cop) \
nocopy(oc_first_loop: length(tp1sq) alloc_if(1) free_if(0)) \
nocopy(oc_second_loop: length(tp1sq) alloc_if(1) free_if(0)) \
nocopy(oc_cutoff_outer: length(tp1sq) alloc_if(1) free_if(0)) \
nocopy(oc_outer: length(tp1sq) alloc_if(1) free_if(0)) \
nocopy(oc_inner_loop: length(tp1cb) alloc_if(1) free_if(0)) \
nocopy(oc_inner: length(tp1cb) alloc_if(1) free_if(0)) \
nocopy(oc_cutoff_inner: length(tp1cb_pad) alloc_if(1) free_if(0))
}
#endif
}
}
_ntypes=ntypes;
_memory=memory;
}
#ifdef _LMP_INTEL_OFFLOAD
#pragma offload_attribute(push,target(mic))
#endif
// The factor up to which we do caching
static const int N_CACHE = 8;
template<class flt_t, class acc_t, lmp_intel::CalculationMode mic, bool pack_i>
template<int EVFLAG, int EFLAG>
void IntelKernelTersoff<flt_t, acc_t, mic, pack_i>::kernel_step(
int eatom, int vflag,
const int * _noalias const numneigh, const int * _noalias const cnumneigh,
const int * _noalias const firstneigh, int ntypes,
typename IntelBuffers<flt_t,acc_t>::atom_t * _noalias const x,
const typename PairTersoffIntel::ForceConst<flt_t>::c_inner_t * _noalias const c_inner,
const typename PairTersoffIntel::ForceConst<flt_t>::c_outer_t * _noalias const c_outer,
typename IntelBuffers<flt_t,acc_t>::vec3_acc_t * _noalias const f,
avec *vsevdwl,
avec *vsv0,
avec *vsv1,
avec *vsv2,
avec* vsv3,
avec *vsv4,
avec *vsv5,
int compress_idx,
iarr is,
iarr js,
bvec vmask_repulsive
) {
ivec v_i4floats((int) (4 * sizeof(typename v::fscal)));
ivec v_i1(1);
fvec v_2(0.);
fvec v_0_5(0.5);
ivec v_i0(0);
ivec v_i_ntypes(ntypes);
ivec v_i_NEIGHMASK(NEIGHMASK);
farr fx, fy, fz, fw;
int cache_idx = 0;
fvec vfkx_cache[N_CACHE];
fvec vfky_cache[N_CACHE];
fvec vfkz_cache[N_CACHE];
ivec vks_cache[N_CACHE];
bvec vmask_cache[N_CACHE];
ivec vkks_final_cache;
bvec vmask_final_cache;
iarr ts;
// compute all the stuff we know from i and j
// TDO: We could extract this from the driver routine
ivec vis = v::int_mullo(v_i4floats, v::int_load_vl(is));
ivec vjs = v::int_mullo(v_i4floats, v::int_load_vl(js));
bvec vmask = v::mask_enable_lower(compress_idx);
fvec vx_i = v::zero(), vy_i = v::zero(), vz_i = v::zero();
ivec vw_i = v_i0;
v::gather_x(vis, vmask, x, &vx_i, &vy_i, &vz_i, &vw_i);
fvec vx_j = v::zero(), vy_j = v::zero(), vz_j = v::zero();
ivec vw_j = v_i0;
v::gather_x(vjs, vmask, x, &vx_j, &vy_j, &vz_j, &vw_j);
fvec vdx_ij = vx_j - vx_i, vdy_ij = vy_j - vy_i, vdz_ij = vz_j - vz_i;
fvec vrijsq = vdx_ij * vdx_ij + vdy_ij * vdy_ij + vdz_ij * vdz_ij;
fvec vrij = sqrt(vrijsq);
ivec vis_orig = v::int_load_vl(is);
ivec vcnumneigh_i = v::int_gather<4>(v_i0, vmask, vis_orig, cnumneigh);
ivec vnumneigh_i = v::int_gather<4>(v_i0, vmask, vis_orig, numneigh);
ivec vc_idx_ij = v::int_mullo(v_i4floats, vw_j + v::int_mullo(v_i_ntypes, vw_i));
fvec vzeta = v::zero();
fvec vfxtmp = v::zero(), vfytmp = v::zero(), vfztmp = v::zero();
fvec vfjxtmp = v::zero(), vfjytmp = v::zero(), vfjztmp = v::zero();
// This piece of code faciliates the traversal of the k loop assuming
// nothing about i. As such, it uses masking to avoid superfluous loads
// and fast-forwards each lane until work is available.
// This is useful because we can not make assumptions as to where in the
// neighbor list the atoms within the cutoff might be.
// We also implement the caching in here, i.e. collect force contributions
// due to zeta.
// This means that you will see four loops:
// 1. the loop that does zeta calculation and caches the force contributions
// 2. the loop that processes the remaining zeta calculations
// 3. the loop that updates the force based on the cached force contributions
// 4. the loop that computes force contributions for the remainder
{
ivec vkks = v_i0;
bvec vactive_mask = vmask;
bvec veff_old_mask(0);
ivec vks, vw_k;
fvec vx_k, vy_k, vz_k, vcutsq;
while (! v::mask_testz(vactive_mask) && cache_idx < N_CACHE) {
bvec vnew_mask = vactive_mask & ~ veff_old_mask;
vks = v::int_mullo(v_i4floats, v_i_NEIGHMASK &
v::int_gather<4>(vks, vactive_mask, vkks + vcnumneigh_i, firstneigh));
v::gather_x(vks, vnew_mask, x, &vx_k, &vy_k, &vz_k, &vw_k);
fvec vdx_ik = (vx_k - vx_i);
fvec vdy_ik = (vy_k - vy_i);
fvec vdz_ik = (vz_k - vz_i);
fvec vrsq = vdx_ik * vdx_ik + vdy_ik * vdy_ik + vdz_ik * vdz_ik;
ivec vc_idx = v::int_mullo(v_i4floats, vw_k) + v::int_mullo(v_i_ntypes, vc_idx_ij);
vcutsq = v::gather<4>(vcutsq, vnew_mask, vc_idx, c_inner);
bvec vcutoff_mask = v::cmplt(vrsq, vcutsq);
bvec vsame_mask = v::int_cmpneq(vjs, vks);
bvec veff_mask = vcutoff_mask & vsame_mask & vactive_mask;
if (v::mask_testz(~(veff_mask | ~vactive_mask))) {
fvec vzeta_contrib;
fvec vfix, vfiy, vfiz;
fvec vfjx, vfjy, vfjz;
fvec vfkx, vfky, vfkz;
attractive_vector<true>(c_inner,vc_idx,veff_mask,fvec(1.),
vrij,vrsq,vdx_ij,vdy_ij,vdz_ij,vdx_ik,vdy_ik,vdz_ik,
&vfix,&vfiy,&vfiz,
&vfjx,&vfjy,&vfjz,
&vfkx,&vfky,&vfkz,
&vzeta_contrib);
vfxtmp = v::mask_add(vfxtmp, veff_mask, vfxtmp, vfix);
vfytmp = v::mask_add(vfytmp, veff_mask, vfytmp, vfiy);
vfztmp = v::mask_add(vfztmp, veff_mask, vfztmp, vfiz);
vfjxtmp = v::mask_add(vfjxtmp, veff_mask, vfjxtmp, vfjx);
vfjytmp = v::mask_add(vfjytmp, veff_mask, vfjytmp, vfjy);
vfjztmp = v::mask_add(vfjztmp, veff_mask, vfjztmp, vfjz);
vfkx_cache[cache_idx] = vfkx;
vfky_cache[cache_idx] = vfky;
vfkz_cache[cache_idx] = vfkz;
vks_cache[cache_idx] = vks;
vmask_cache[cache_idx] = veff_mask;
cache_idx += 1;
vzeta = v::mask_add(vzeta, veff_mask, vzeta, vzeta_contrib);
vkks = vkks + v_i1;
veff_old_mask = bvec(0);
} else {
vkks = v::int_mask_add(vkks, ~veff_mask, vkks, v_i1);
veff_old_mask = veff_mask;
}
vactive_mask &= v::int_cmplt(vkks, vnumneigh_i);
}
vkks_final_cache = vkks;
vmask_final_cache = vactive_mask;
while (! v::mask_testz(vactive_mask)) {
bvec vnew_mask = vactive_mask & ~ veff_old_mask;
vks = v::int_mullo(v_i4floats, v_i_NEIGHMASK &
v::int_gather<4>(vks, vactive_mask, vkks + vcnumneigh_i, firstneigh));
v::gather_x(vks, vnew_mask, x, &vx_k, &vy_k, &vz_k, &vw_k);
fvec vdx_ik = (vx_k - vx_i);
fvec vdy_ik = (vy_k - vy_i);
fvec vdz_ik = (vz_k - vz_i);
fvec vrsq = vdx_ik * vdx_ik + vdy_ik * vdy_ik + vdz_ik * vdz_ik;
ivec vc_idx = v::int_mullo(v_i4floats, vw_k) + v::int_mullo(v_i_ntypes, vc_idx_ij);
vcutsq = v::gather<4>(vcutsq, vnew_mask, vc_idx, c_inner);
bvec vcutoff_mask = v::cmplt(vrsq, vcutsq);
bvec vsame_mask = v::int_cmpneq(vjs, vks);
bvec veff_mask = vcutoff_mask & vsame_mask & vactive_mask;
if (v::mask_testz(~(veff_mask | ~vactive_mask))) {
fvec vzeta_contrib;
vzeta_contrib = zeta_vector(c_inner,vc_idx,veff_mask,vrij,vrsq,vdx_ij,vdy_ij,vdz_ij,vdx_ik,vdy_ik,vdz_ik);
vzeta = v::mask_add(vzeta, veff_mask, vzeta, vzeta_contrib);
vkks = vkks + v_i1;
veff_old_mask = bvec(0);
} else {
vkks = v::int_mask_add(vkks, ~veff_mask, vkks, v_i1);
veff_old_mask = veff_mask;
}
vactive_mask &= v::int_cmplt(vkks, vnumneigh_i);
}
}
fvec vfpair, vevdwl, vprefactor, vfwtmp, vfjwtmp;
force_zeta_vector(c_outer, vc_idx_ij, vmask, vrij, vzeta, &vfpair, &vprefactor, EFLAG, &vevdwl, vmask_repulsive);
vfxtmp = vfxtmp * vprefactor + vdx_ij * vfpair;
vfytmp = vfytmp * vprefactor + vdy_ij * vfpair;
vfztmp = vfztmp * vprefactor + vdz_ij * vfpair;
vfjxtmp = vfjxtmp * vprefactor - vdx_ij * vfpair;
vfjytmp = vfjytmp * vprefactor - vdy_ij * vfpair;
vfjztmp = vfjztmp * vprefactor - vdz_ij * vfpair;
if (EVFLAG) {
if (EFLAG) {
*vsevdwl = v::acc_mask_add(*vsevdwl, vmask, *vsevdwl, vevdwl);
if (eatom) {
v::store(fw, (v_0_5 * vevdwl));
}
}
if (vflag == 1) {
*vsv0 = v::acc_mask_add(*vsv0, vmask, *vsv0, vdx_ij * vdx_ij * vfpair);
*vsv1 = v::acc_mask_add(*vsv1, vmask, *vsv1, vdy_ij * vdy_ij * vfpair);
*vsv2 = v::acc_mask_add(*vsv2, vmask, *vsv2, vdz_ij * vdz_ij * vfpair);
*vsv3 = v::acc_mask_add(*vsv3, vmask, *vsv3, vdx_ij * vdy_ij * vfpair);
*vsv4 = v::acc_mask_add(*vsv4, vmask, *vsv4, vdx_ij * vdz_ij * vfpair);
*vsv5 = v::acc_mask_add(*vsv5, vmask, *vsv5, vdy_ij * vdz_ij * vfpair);
}
}
{
while (cache_idx-- > 0) {
fvec vfkx = vprefactor * vfkx_cache[cache_idx];
fvec vfky = vprefactor * vfky_cache[cache_idx];
fvec vfkz = vprefactor * vfkz_cache[cache_idx];
ivec vks = vks_cache[cache_idx];
bvec veff_mask = vmask_cache[cache_idx];
v::store(fx, vfkx);
v::store(fy, vfky);
v::store(fz, vfkz);
v::int_store(ts, vks);
for (int t = 0; t < v::VL; t++) {
if (v::mask_test_at(veff_mask, t)) {
int t_ = ts[t] / (4 * sizeof(typename v::fscal));
f[t_].x += fx[t];
f[t_].y += fy[t];
f[t_].z += fz[t];
}
}
}
ivec vkks = vkks_final_cache;
bvec vactive_mask = vmask_final_cache;
bvec veff_old_mask(0);
ivec vks, vw_k;
fvec vx_k, vy_k, vz_k, vcutsq;
while (! v::mask_testz(vactive_mask)) {
bvec vnew_mask = vactive_mask & ~ veff_old_mask;
vks = v::int_mullo(v_i4floats, v_i_NEIGHMASK &
v::int_gather<4>(vks, vactive_mask, vkks + vcnumneigh_i, firstneigh));
v::gather_x(vks, vnew_mask, x, &vx_k, &vy_k, &vz_k, &vw_k);
fvec vdx_ik = vx_k - vx_i;
fvec vdy_ik = vy_k - vy_i;
fvec vdz_ik = vz_k - vz_i;
fvec vrsq = vdx_ik * vdx_ik + vdy_ik * vdy_ik + vdz_ik * vdz_ik;
ivec vc_idx = v::int_mullo(v_i4floats, vw_k) + v::int_mullo(v_i_ntypes, vc_idx_ij);
vcutsq = v::gather<4>(vcutsq, vnew_mask, vc_idx, c_inner);
bvec vcutoff_mask = v::cmplt(vrsq, vcutsq);
bvec vsame_mask = v::int_cmpneq(vjs, vks);
bvec veff_mask = vcutoff_mask & vsame_mask & vactive_mask;
if (v::mask_testz(~(veff_mask | ~vactive_mask))) {
fvec vfix, vfiy, vfiz;
fvec vfjx, vfjy, vfjz;
fvec vfkx, vfky, vfkz;
attractive_vector<false>(c_inner,vc_idx,veff_mask,vprefactor,
vrij,vrsq,vdx_ij,vdy_ij,vdz_ij,vdx_ik,vdy_ik,vdz_ik,
&vfix,&vfiy,&vfiz,
&vfjx,&vfjy,&vfjz,
&vfkx,&vfky,&vfkz,
0);
vfxtmp = v::mask_add(vfxtmp, veff_mask, vfxtmp, vfix);
vfytmp = v::mask_add(vfytmp, veff_mask, vfytmp, vfiy);
vfztmp = v::mask_add(vfztmp, veff_mask, vfztmp, vfiz);
vfjxtmp = v::mask_add(vfjxtmp, veff_mask, vfjxtmp, vfjx);
vfjytmp = v::mask_add(vfjytmp, veff_mask, vfjytmp, vfjy);
vfjztmp = v::mask_add(vfjztmp, veff_mask, vfjztmp, vfjz);
v::store(fx, vfkx);
v::store(fy, vfky);
v::store(fz, vfkz);
v::int_store(ts, vks);
for (int t = 0; t < v::VL; t++) {
if (v::mask_test_at(veff_mask, t)) {
int t_ = ts[t] / (4 * sizeof(typename v::fscal));
f[t_].x += fx[t];
f[t_].y += fy[t];
f[t_].z += fz[t];
}
}
vkks = vkks + v_i1;
veff_old_mask = bvec(0);
} else {
vkks = v::int_mask_add(vkks, ~veff_mask, vkks, v_i1);
veff_old_mask = veff_mask;
}
vactive_mask &= v::int_cmplt(vkks, vnumneigh_i);
} // while (vactive_mask != 0)
} // section k
// We can not make any assumptions regarding conflicts.
// So we sequentialize this.
// TDO: Once AVX-512 is around check out VPCONFLICT
v::store(fx, vfjxtmp);
v::store(fy, vfjytmp);
v::store(fz, vfjztmp);
for (int t = 0; t < compress_idx; t++) {
int t_ = js[t];
f[t_].x += fx[t];
f[t_].y += fy[t];
f[t_].z += fz[t];
if (EVFLAG && EFLAG && eatom) {
f[t_].w += fw[t];
}
}
v::store(fx, vfxtmp);
v::store(fy, vfytmp);
v::store(fz, vfztmp);
for (int t = 0; t < compress_idx; t++) {
int t_ = is[t];
f[t_].x += fx[t];
f[t_].y += fy[t];
f[t_].z += fz[t];
if (EVFLAG && EFLAG && eatom) {
f[t_].w += fw[t];
}
}
}
// Specialized kernel step for fixed i, means that we don't have to use the
// convoluted iteration scheme above, as the loop variables are uniform.
template<class flt_t, class acc_t, lmp_intel::CalculationMode mic, bool pack_i>
template<int EVFLAG, int EFLAG>
void IntelKernelTersoff<flt_t,acc_t,mic, pack_i>::kernel_step_const_i(
int eatom, int vflag,
const int * _noalias const numneigh, const int * _noalias const cnumneigh,
const int * _noalias const firstneigh, int ntypes,
typename IntelBuffers<flt_t,acc_t>::atom_t * _noalias const x,
const typename PairTersoffIntel::ForceConst<flt_t>::c_inner_t * _noalias const c_inner,
const typename PairTersoffIntel::ForceConst<flt_t>::c_outer_t * _noalias const c_outer,
typename IntelBuffers<flt_t,acc_t>::vec3_acc_t * _noalias const f,
avec *vsevdwl,
avec *vsv0,
avec *vsv1,
avec *vsv2,
avec* vsv3,
avec *vsv4,
avec *vsv5,
int compress_idx,
int i,
iarr js,
bvec vmask_repulsive
) {
typedef typename v::fvec fvec;
typedef typename v::ivec ivec;
typedef typename v::bvec bvec;
typedef typename v::farr farr;
typedef typename v::iarr iarr;
typedef typename v::avec avec;
typedef typename v::aarr aarr;
ivec v_i4floats((int) (4 * sizeof(typename v::fscal)));
ivec v_i1(1), v_i0(0), v_i_ntypes(ntypes), v_i_NEIGHMASK(NEIGHMASK);
fvec v_0_5(0.5);
int cache_idx = 0;
fvec vfkx_cache[N_CACHE];
fvec vfky_cache[N_CACHE];
fvec vfkz_cache[N_CACHE];
int k_cache[N_CACHE];
bvec vmask_cache[N_CACHE];
int kk_final_cache;
aarr fx, fy, fz, fw;
iarr ts;
bvec vmask = v::mask_enable_lower(compress_idx);
fvec vx_i(x[i].x), vy_i(x[i].y), vz_i(x[i].z);
int w_i = x[i].w;
ivec vjs = v::int_mullo(v_i4floats, v::int_load_vl(js));
fvec vx_j = v::zero(), vy_j = v::zero(), vz_j = v::zero();
ivec vw_j = v_i0;
v::gather_x(vjs, vmask, x, &vx_j, &vy_j, &vz_j, &vw_j);
fvec vdx_ij = vx_j - vx_i, vdy_ij = vy_j - vy_i, vdz_ij = vz_j - vz_i;
fvec vrijsq = vdx_ij * vdx_ij + vdy_ij * vdy_ij + vdz_ij * vdz_ij;
fvec vrij = sqrt(vrijsq);
int cnumneigh_i = cnumneigh[i];
int numneigh_i = numneigh[i];
ivec vc_idx_j = v::int_mullo(v_i4floats, vw_j);
ivec vc_idx_j_ntypes = v::int_mullo(v_i_ntypes, vc_idx_j);
avec vzeta = v::acc_zero();
avec vfxtmp = v::acc_zero(), vfytmp = v::acc_zero(), vfztmp = v::acc_zero();
avec vfjxtmp = v::acc_zero(), vfjytmp = v::acc_zero(), vfjztmp = v::acc_zero();
// Same structure as kernel_step, just simpler as the loops all iterate over
// the same k
int kk = 0;
for (; kk < numneigh_i && cache_idx < N_CACHE; kk++) {
int k = firstneigh[kk + cnumneigh_i] & NEIGHMASK;
fvec vx_k(x[k].x);
fvec vy_k(x[k].y);
fvec vz_k(x[k].z);
int w_k = x[k].w;
fvec vdx_ik = vx_k - vx_i;
fvec vdy_ik = vy_k - vy_i;
fvec vdz_ik = vz_k - vz_i;
fvec vrsq = vdx_ik * vdx_ik + vdy_ik * vdy_ik + vdz_ik * vdz_ik;
fvec vcutsq = v::gather<4>(v::zero(), vmask, vc_idx_j_ntypes, &c_inner[ntypes * ntypes * w_i + w_k]);
bvec vcutoff_mask = v::cmplt(vrsq, vcutsq);
bvec vsame_mask = v::int_cmpneq(vjs, ivec(static_cast<int>(4 * sizeof(typename v::fscal) * k)));
bvec veff_mask = vcutoff_mask & vsame_mask & vmask;
if (! v::mask_testz(veff_mask)) {
fvec vzeta_contrib;
fvec vfix, vfiy, vfiz;
fvec vfjx, vfjy, vfjz;
fvec vfkx, vfky, vfkz;
attractive_vector<true>(&c_inner[ntypes * ntypes * w_i + w_k],vc_idx_j_ntypes,veff_mask,fvec(1.),
vrij,vrsq,vdx_ij,vdy_ij,vdz_ij,vdx_ik,vdy_ik,vdz_ik,
&vfix,&vfiy,&vfiz,
&vfjx,&vfjy,&vfjz,
&vfkx,&vfky,&vfkz,
&vzeta_contrib);
vfxtmp = v::acc_mask_add(vfxtmp, veff_mask, vfxtmp, vfix);
vfytmp = v::acc_mask_add(vfytmp, veff_mask, vfytmp, vfiy);
vfztmp = v::acc_mask_add(vfztmp, veff_mask, vfztmp, vfiz);
vfjxtmp = v::acc_mask_add(vfjxtmp, veff_mask, vfjxtmp, vfjx);
vfjytmp = v::acc_mask_add(vfjytmp, veff_mask, vfjytmp, vfjy);
vfjztmp = v::acc_mask_add(vfjztmp, veff_mask, vfjztmp, vfjz);
vfkx_cache[cache_idx] = v::mask_add(v::zero(), veff_mask, vfkx, v::zero());
vfky_cache[cache_idx] = v::mask_add(v::zero(), veff_mask, vfky, v::zero());
vfkz_cache[cache_idx] = v::mask_add(v::zero(), veff_mask, vfkz, v::zero());
vmask_cache[cache_idx] = veff_mask;
k_cache[cache_idx] = k;
cache_idx += 1;
vzeta = v::acc_mask_add(vzeta, veff_mask, vzeta, vzeta_contrib);
}
}
kk_final_cache = kk;
for (; kk < numneigh_i; kk++) {
int k = firstneigh[kk + cnumneigh_i] & NEIGHMASK;
fvec vx_k(x[k].x);
fvec vy_k(x[k].y);
fvec vz_k(x[k].z);
int w_k = x[k].w;
fvec vdx_ik = vx_k - vx_i;
fvec vdy_ik = vy_k - vy_i;
fvec vdz_ik = vz_k - vz_i;
fvec vrsq = vdx_ik * vdx_ik + vdy_ik * vdy_ik + vdz_ik * vdz_ik;
fvec vcutsq = v::gather<4>(v::zero(), vmask, vc_idx_j_ntypes, &c_inner[ntypes * ntypes * w_i + w_k]);
bvec vcutoff_mask = v::cmplt(vrsq, vcutsq);
bvec vsame_mask = v::int_cmpneq(vjs, ivec(static_cast<int>(4 * sizeof(typename v::fscal) * k)));
bvec veff_mask = vcutoff_mask & vsame_mask & vmask;
if (! v::mask_testz(veff_mask)) {
fvec vzeta_contrib = zeta_vector(&c_inner[ntypes * ntypes * w_i + w_k], vc_idx_j_ntypes, veff_mask, vrij, vrsq,
vdx_ij,vdy_ij,vdz_ij,vdx_ik,vdy_ik,vdz_ik);
vzeta = v::acc_mask_add(vzeta, veff_mask, vzeta, vzeta_contrib);
}
}
fvec vfpair, vevdwl, vprefactor, vfwtmp;
force_zeta_vector(&c_outer[ntypes * w_i], vc_idx_j, vmask, vrij, vzeta, &vfpair, &vprefactor, EFLAG, &vevdwl, vmask_repulsive);
avec vaprefactor(vprefactor);
vfxtmp = vfxtmp * vaprefactor + avec(vdx_ij * vfpair);
vfytmp = vfytmp * vaprefactor + avec(vdy_ij * vfpair);
vfztmp = vfztmp * vaprefactor + avec(vdz_ij * vfpair);
vfjxtmp = vfjxtmp * vaprefactor - avec(vdx_ij * vfpair);
vfjytmp = vfjytmp * vaprefactor - avec(vdy_ij * vfpair);
vfjztmp = vfjztmp * vaprefactor - avec(vdz_ij * vfpair);
if (EVFLAG) {
if (EFLAG) {
*vsevdwl = v::acc_mask_add(*vsevdwl, vmask, *vsevdwl, vevdwl);
if (eatom) {
vfwtmp = v_0_5 * vevdwl;
v::store(fw, vfwtmp);
}
}
if (vflag == 1) {
*vsv0 = v::acc_mask_add(*vsv0, vmask, *vsv0, vdx_ij * vdx_ij * vfpair);
*vsv1 = v::acc_mask_add(*vsv1, vmask, *vsv1, vdy_ij * vdy_ij * vfpair);
*vsv2 = v::acc_mask_add(*vsv2, vmask, *vsv2, vdz_ij * vdz_ij * vfpair);
*vsv3 = v::acc_mask_add(*vsv3, vmask, *vsv3, vdx_ij * vdy_ij * vfpair);
*vsv4 = v::acc_mask_add(*vsv4, vmask, *vsv4, vdx_ij * vdz_ij * vfpair);
*vsv5 = v::acc_mask_add(*vsv5, vmask, *vsv5, vdy_ij * vdz_ij * vfpair);
}
}
while (cache_idx-- > 0) {
fvec vfkx = vprefactor * vfkx_cache[cache_idx];
fvec vfky = vprefactor * vfky_cache[cache_idx];
fvec vfkz = vprefactor * vfkz_cache[cache_idx];
int k = k_cache[cache_idx];
bvec veff_mask = vmask_cache[cache_idx];
f[k].x += v::reduce_add(v::mask_add(v::zero(), veff_mask, vfkx, v::zero()));
f[k].y += v::reduce_add(v::mask_add(v::zero(), veff_mask, vfky, v::zero()));
f[k].z += v::reduce_add(v::mask_add(v::zero(), veff_mask, vfkz, v::zero()));
}
for (int kk = kk_final_cache; kk < numneigh_i; kk++) {
int k = firstneigh[kk + cnumneigh_i] & NEIGHMASK;
fvec vx_k(x[k].x);
fvec vy_k(x[k].y);
fvec vz_k(x[k].z);
int w_k = x[k].w;
fvec vdx_ik = vx_k - vx_i;
fvec vdy_ik = vy_k - vy_i;
fvec vdz_ik = vz_k - vz_i;
fvec vrsq = vdx_ik * vdx_ik + vdy_ik * vdy_ik + vdz_ik * vdz_ik;
fvec vcutsq = v::gather<4>(v::zero(), vmask, vc_idx_j_ntypes, &c_inner[ntypes * ntypes * w_i + w_k].cutsq);
bvec vcutoff_mask = v::cmplt(vrsq, vcutsq);
bvec vsame_mask = v::int_cmpneq(vjs, ivec(static_cast<int>(4 * sizeof(typename v::fscal) * k)));
bvec veff_mask = vcutoff_mask & vsame_mask & vmask;
if (! v::mask_testz(veff_mask)) {
fvec vfix, vfiy, vfiz;
fvec vfjx, vfjy, vfjz;
fvec vfkx, vfky, vfkz;
attractive_vector<false>(&c_inner[ntypes * ntypes * w_i + w_k],vc_idx_j_ntypes,veff_mask,vprefactor,
vrij,vrsq,vdx_ij,vdy_ij,vdz_ij,vdx_ik,vdy_ik,vdz_ik,
&vfix,&vfiy,&vfiz,
&vfjx,&vfjy,&vfjz,
&vfkx,&vfky,&vfkz,
0);
vfxtmp = v::acc_mask_add(vfxtmp, veff_mask, vfxtmp, vfix);
vfytmp = v::acc_mask_add(vfytmp, veff_mask, vfytmp, vfiy);
vfztmp = v::acc_mask_add(vfztmp, veff_mask, vfztmp, vfiz);
vfjxtmp = v::acc_mask_add(vfjxtmp, veff_mask, vfjxtmp, vfjx);
vfjytmp = v::acc_mask_add(vfjytmp, veff_mask, vfjytmp, vfjy);
vfjztmp = v::acc_mask_add(vfjztmp, veff_mask, vfjztmp, vfjz);
f[k].x += v::reduce_add(v::mask_add(v::zero(), veff_mask, vfkx, v::zero()));
f[k].y += v::reduce_add(v::mask_add(v::zero(), veff_mask, vfky, v::zero()));
f[k].z += v::reduce_add(v::mask_add(v::zero(), veff_mask, vfkz, v::zero()));
}
}
// TDO: This could be a scatter
v::acc_store(fx, vfjxtmp);
v::acc_store(fy, vfjytmp);
v::acc_store(fz, vfjztmp);
for (int t = 0; t < compress_idx; t++) {
int t_ = js[t];
f[t_].x += fx[t];
f[t_].y += fy[t];
f[t_].z += fz[t];
if (EVFLAG && EFLAG && eatom) {
f[t_].w += fw[t];
}
}
f[i].x += v::acc_reduce_add(v::acc_mask_add(v::acc_zero(), vmask, vfxtmp, v::zero()));
f[i].y += v::acc_reduce_add(v::acc_mask_add(v::acc_zero(), vmask, vfytmp, v::zero()));
f[i].z += v::acc_reduce_add(v::acc_mask_add(v::acc_zero(), vmask, vfztmp, v::zero()));
if (EVFLAG && EFLAG && eatom) {
f[i].z += v::acc_reduce_add(v::acc_mask_add(v::acc_zero(), vmask, vfwtmp, v::zero()));
}
}
template<class flt_t, class acc_t, lmp_intel::CalculationMode mic, bool pack_i>
template<bool EVFLAG, bool EFLAG>
void IntelKernelTersoff<flt_t,acc_t,mic, pack_i>::kernel(
int iito, int iifrom, int eatom, int vflag,
const int * _noalias const numneigh,
const int * _noalias const numneighhalf,
const int * _noalias const cnumneigh,
const int * _noalias const firstneigh, int ntypes,
typename IntelBuffers<flt_t,acc_t>::atom_t * _noalias const x,
const c_inner_t * _noalias const c_inner,
const c_outer_t * _noalias const c_outer,
typename IntelBuffers<flt_t,acc_t>::vec3_acc_t * _noalias const f,
acc_t *evdwl, acc_t *ov0, acc_t * ov1, acc_t *ov2, acc_t* ov3, acc_t *ov4, acc_t *ov5
) {
int compress_idx = 0;
int ii, jj;
iarr is, js;
avec vsevdwl = v::acc_zero();
avec vsv0 = v::acc_zero(), vsv1 = v::acc_zero(), vsv2 = v::acc_zero();
avec vsv3 = v::acc_zero(), vsv4 = v::acc_zero(), vsv5 = v::acc_zero();
ivec v_i4floats(static_cast<int>(sizeof(typename v::fscal) * 4));
ivec vj, v_NEIGHMASK(NEIGHMASK);
bvec vmask_repulsive(0);
iarr repulsive_flag = {0};
// If you want to get the very most out of this, please uncomment.
// Consider getting a coffee or doing something else.
// Also good for heating.
//#pragma forceinline recursive
for (ii = iifrom; ii < iito; ii++) {
// Right now this loop is scalar, to allow for the compiler to do
// its prefetching magic.
int i = ii;
int w_i = x[i].w;
flt_t x_i = x[i].x;
flt_t y_i = x[i].y;
flt_t z_i = x[i].z;
int jlist_off_i = cnumneigh[i];
int jnum = numneigh[ii];
for (jj = 0; jj < jnum; jj++) {
int j = firstneigh[jlist_off_i + jj] & NEIGHMASK;
int w_j = x[j].w;
flt_t dx_ij = x[j].x - x_i;
flt_t dy_ij = x[j].y - y_i;
flt_t dz_ij = x[j].z - z_i;
flt_t rsq = dx_ij*dx_ij + dy_ij*dy_ij + dz_ij*dz_ij;
flt_t cutsq = c_outer[w_i * ntypes + w_j].cutsq;
if (rsq < cutsq) {
is[compress_idx] = ii;
js[compress_idx] = j;
if (jj < numneighhalf[i])
repulsive_flag[compress_idx] = 1;
compress_idx += 1;
}
if (pack_i) {
if (compress_idx == v::VL) {
vmask_repulsive = v::int_cmpneq(v::int_load_vl(repulsive_flag), ivec(0));
kernel_step<EVFLAG,EFLAG>(
eatom, vflag,
numneigh, cnumneigh, firstneigh, ntypes,
x, c_inner, c_outer, f,
&vsevdwl, &vsv0, &vsv1, &vsv2, &vsv3, &vsv4, &vsv5, compress_idx,
is, js, vmask_repulsive
);
compress_idx = 0;
v::int_clear_arr(repulsive_flag);
}
} else {
if (compress_idx == v::VL || (compress_idx > 0 && jj == jnum-1)) {
vmask_repulsive = v::int_cmpneq(v::int_load_vl(repulsive_flag), ivec(0));
kernel_step_const_i<EVFLAG,EFLAG>(
eatom, vflag,
numneigh, cnumneigh, firstneigh, ntypes,
x, c_inner, c_outer, f,
&vsevdwl, &vsv0, &vsv1, &vsv2, &vsv3, &vsv4, &vsv5, compress_idx,
i, js, vmask_repulsive
);
compress_idx = 0;
v::int_clear_arr(repulsive_flag);
}
}
}
}
if (compress_idx > 0) {
vmask_repulsive = v::int_cmpneq(v::int_load_vl(repulsive_flag), ivec(0));
IntelKernelTersoff::kernel_step<EVFLAG,EFLAG>(
eatom, vflag,
numneigh, cnumneigh, firstneigh, ntypes,
x, c_inner, c_outer, f,
&vsevdwl, &vsv0, &vsv1, &vsv2, &vsv3, &vsv4, &vsv5, compress_idx,
is, js, vmask_repulsive
);
}
if (EVFLAG) {
if (EFLAG) {
*evdwl += v::acc_reduce_add(vsevdwl);
}
if (vflag == 1) {
*ov0 += v::acc_reduce_add(vsv0);
*ov1 += v::acc_reduce_add(vsv1);
*ov2 += v::acc_reduce_add(vsv2);
*ov3 += v::acc_reduce_add(vsv3);
*ov4 += v::acc_reduce_add(vsv4);
*ov5 += v::acc_reduce_add(vsv5);
}
}
}
template<class flt_t, class acc_t, lmp_intel::CalculationMode mic, bool pack_i>
IntelKernelTersoff<flt_t,acc_t,mic,pack_i>::fvec IntelKernelTersoff<flt_t, acc_t, mic, pack_i>::zeta_vector(
const c_inner_t * param,
ivec xjw, bvec mask,
fvec vrij, fvec rsq2,
fvec vdijx, fvec vdijy, fvec vdijz,
fvec dikx, fvec diky, fvec dikz
) {
fvec v_1_0(1.0);
fvec v_0_5(0.5);
fvec vph = v::zero(), vpc2 = v::zero(), vpd2 = v::zero(), vpgamma = v::zero(), vplam3 = v::zero(), vppowermint = v::zero(), vpbigr = v::zero(), vpbigd = v::zero();
// TDO: Specialize on number of species
v::gather_8(xjw, mask, &param[0].lam3, &vplam3, &vppowermint, &vpbigr, &vpbigd, &vpc2, &vpd2, &vph, &vpgamma);
fvec vrik = sqrt(rsq2);
fvec vcostheta = (vdijx * dikx + vdijy * diky + vdijz * dikz) * v::recip(vrij * vrik);
fvec vhcth = vph - vcostheta;
fvec vgijk_a = vhcth * vhcth;
fvec vgijk = vpgamma * (v_1_0 + vpc2 * vgijk_a * v::recip(vpd2 * (vpd2 + vgijk_a)));
fvec varg1 = vplam3 * (vrij - vrik);
fvec varg3 = varg1 * varg1 * varg1;
bvec mask_ex = v::cmpeq(vppowermint, fvec(3.));
fvec varg = v::blend(mask_ex, varg1, varg3);
fvec vex_delr = v::min(fvec(1.e30), exp(varg));
bvec vmask_need_sine = v::cmpnle(vrik, vpbigr - vpbigd) & mask;
fvec vfc = v_1_0;
// Its kind of important to check the mask.
// Some simulations never/rarely invoke this branch.
if (! v::mask_testz(vmask_need_sine)) {
vfc = v::blend(vmask_need_sine, vfc,
v_0_5 * (v_1_0 - sin(fvec(MY_PI2) * (vrik - vpbigr) * v::recip(vpbigd))));
}
return vgijk * vex_delr * vfc;
}
template<class flt_t, class acc_t, lmp_intel::CalculationMode mic, bool pack_i>
void IntelKernelTersoff<flt_t, acc_t, mic, pack_i>::force_zeta_vector(
const c_outer_t * param,
ivec xjw,
bvec mask,
fvec vrij, fvec vzeta_ij,
fvec *vfpair, fvec *vprefactor, int EVDWL, fvec *vevdwl,
bvec vmask_repulsive
) {
fvec v_0_0(0.0);
fvec v_0_5(0.5);
fvec v_m0_5(-0.5);
fvec v_1_0(1.0);
fvec v_m1_0(-1.0);
fvec v_2_0(2.0);
fvec vpbigr = v::zero(), vpbigd = v::zero(), vplam1 = v::zero(), vpbiga = v::zero(), vplam2 = v::zero(), vpbeta = v::zero(), vpbigb = v::zero(), vppowern = v::zero();
v::gather_8(xjw, mask, &param[0].bigr, &vpbigr, &vpbigd, &vplam1, &vpbiga, &vplam2, &vpbeta, &vpbigb, &vppowern);
fvec vfccos;
// This is pretty much a literal translation.
bvec vmask_need_sine = v::cmpnle(vrij, vpbigr - vpbigd) & mask;
fvec vfc = v_1_0;
fvec vfc_d = v_0_0;
if (! v::mask_testz(vmask_need_sine)) {
fvec vtmp = fvec(MY_PI2) * v::recip(vpbigd);
vfc = v::blend(vmask_need_sine, vfc,
v_0_5 * (v_1_0 - v::sincos(&vfccos, vtmp * (vrij - vpbigr))));
vfc_d = v::blend(vmask_need_sine, vfc_d, v_m0_5 * vtmp * vfccos);
}
fvec vpminus_lam2 = - vplam2;
fvec vpminus_bigb = -vpbigb;
fvec vexp = exp(vpminus_lam2 * vrij);
fvec vfa = vpminus_bigb * vexp * vfc;
fvec vfa_d = vpminus_lam2 * vfa + vpminus_bigb * vexp * vfc_d;
fvec vpc1 = v::zero(), vpc2 = v::zero(), vpc3 = v::zero(), vpc4 = v::zero();
v::gather_4(xjw, mask, &param[0].c1, &vpc1, &vpc2, &vpc3, &vpc4);
fvec vpminus_powern = - vppowern;
fvec vbij(0.), vbij_d(0.);
fvec vtmp = vpbeta * vzeta_ij;
bvec vmc1 = v::cmple(vpc1, vtmp) & mask;
if (! v::mask_testz(vmc1)) {
vbij = v::invsqrt(vtmp);
vbij_d = vpbeta * v_m0_5 * vbij * v::recip(vtmp);
}
bvec vmc2 = v::cmple(vpc2, vtmp) & ~ vmc1 & mask;
if (! v::mask_testz(vmc2)) {
fvec vpowminus_powern = pow(vtmp, vpminus_powern);
fvec vinvsqrt = v::invsqrt(vtmp);
fvec vrcp2powern = v::recip(v_2_0 * vppowern);
fvec va = (v_1_0 - vpowminus_powern * vrcp2powern) * vinvsqrt;
fvec va_d = vpbeta * v_m0_5 * vinvsqrt * v::recip(vtmp) *
(v_1_0 + v_m0_5 * vpowminus_powern * (v_1_0 + vrcp2powern));
vbij = v::blend(vmc2, vbij, va);
vbij_d = v::blend(vmc2, vbij_d, va_d);
}
bvec vmc3 = v::cmplt(vtmp, vpc4) & ~vmc2 & ~vmc1 & mask;
if (! v::mask_testz(vmc3)) {
vbij = v::blend(vmc3, vbij, v_1_0);
vbij_d = v::blend(vmc3, vbij_d, v_0_0);
}
bvec vmc4 = v::cmple(vtmp, vpc3) & ~vmc3 & ~vmc2 & ~ vmc1 & mask;
if (! v::mask_testz(vmc4)) {
fvec vpowm1 = pow(vtmp, vppowern - v_1_0);
fvec vrcp2powern = v::recip(v_2_0 * vppowern);
fvec va = v_1_0 - vtmp * vrcp2powern * vpowm1;
fvec va_d = v_m0_5 * vpbeta * vpowm1;
vbij = v::blend(vmc4, vbij, va);
vbij_d = v::blend(vmc4, vbij_d, va_d);
}
bvec vmc5 = mask & ~vmc1 & ~vmc2 & ~vmc3 & ~vmc4;
if (! v::mask_testz(vmc5)) {
fvec vtmp_n = pow(vtmp, vppowern);
fvec vpow2 = pow(v_1_0 + vtmp_n, v_m1_0 - v::recip(v_2_0 * vppowern));
fvec va = (v_1_0 + vtmp_n) * vpow2;
fvec va_d = v_m0_5 * vpow2 * vtmp_n * v::recip(vzeta_ij);
vbij = v::blend(vmc5, vbij, va);
vbij_d = v::blend(vmc5, vbij_d, va_d);
}
fvec vtmp_exp = exp(-vplam1 * vrij);
fvec vrep_fforce = vpbiga * vtmp_exp * (vfc_d - vfc * vplam1);
fvec vfz_fforce = v_0_5 * vbij * vfa_d;
*vfpair = v::mask_add(vfz_fforce, vmask_repulsive, vfz_fforce, vrep_fforce) * v::recip(vrij);
*vprefactor = v_m0_5 * vfa * vbij_d;
if (EVDWL) {
fvec vrep_eng = vfc * vpbiga * vtmp_exp;
fvec vfz_eng = v_0_5 * vfa * vbij;
*vevdwl = v::mask_add(vfz_eng, vmask_repulsive, vfz_eng, vrep_eng);
}
}
template<class flt_t, class acc_t, lmp_intel::CalculationMode mic, bool pack_i>
template<bool ZETA>
void IntelKernelTersoff<flt_t,acc_t,mic, pack_i>::attractive_vector(
const c_inner_t * param,
ivec xjw,
bvec mask,
fvec vprefactor,
fvec vrij, fvec rsq2,
fvec vdijx, fvec vdijy, fvec vdijz,
fvec dikx, fvec diky, fvec dikz,
fvec *fix, fvec *fiy, fvec *fiz,
fvec *fjx, fvec *fjy, fvec *fjz,
fvec *fkx, fvec *fky, fvec *fkz,
fvec *zeta
) {
fvec v_1_0 = fvec(1.0);
fvec vph = v::zero(), vpc2 = v::zero(), vpd2 = fvec(1.0), vpgamma = v::zero(), vplam3 = v::zero(), vppowermint = v::zero(), vpbigr = v::zero(), vpbigd = fvec(1.0);
v::gather_8(xjw, mask, &param[0].lam3, &vplam3, &vppowermint, &vpbigr, &vpbigd, &vpc2, &vpd2, &vph, &vpgamma);
fvec vrijinv = v::recip(vrij);
fvec vrij_hatx = vrijinv * vdijx;
fvec vrij_haty = vrijinv * vdijy;
fvec vrij_hatz = vrijinv * vdijz;
fvec rikinv = invsqrt(rsq2);
fvec rik_hatx = rikinv * dikx;
fvec rik_haty = rikinv * diky;
fvec rik_hatz = rikinv * dikz;
fvec vrik = sqrt(rsq2);
fvec vcostheta = (vdijx * dikx + vdijy * diky + vdijz * dikz) * v::recip(vrij * vrik);
fvec vhcth = vph - vcostheta;
fvec vdenominator = v::recip(vpd2 + vhcth * vhcth);
fvec vgijk = vpgamma * (v_1_0 + vpc2 * v::recip(vpd2) - vpc2 * vdenominator);
fvec vnumerator = fvec(-2.) * vpc2 * vhcth;
fvec vgijk_d = vpgamma * vnumerator * vdenominator * vdenominator;
fvec varg1 = vplam3 * (vrij - vrik);
fvec varg3 = varg1 * varg1 * varg1;
bvec mask_ex = v::cmpeq(vppowermint, fvec(3.));
fvec varg = v::blend(mask_ex, varg1, varg3);
fvec vex_delr = min(fvec(1.e30), exp(varg));
fvec vex_delr_d_factor = v::blend(mask, v_1_0, fvec(3.0) * varg1 * varg1);
fvec vex_delr_d = vplam3 * vex_delr_d_factor * vex_delr;
bvec vmask_need_sine = v::cmpnle(vrik, vpbigr - vpbigd) & mask;
fvec vfccos;
fvec vfc = v_1_0;
fvec vfc_d = v::zero();
if (! v::mask_testz(vmask_need_sine)) {
fvec vtmp = fvec(MY_PI2) * v::recip(vpbigd);
vfc = v::blend(vmask_need_sine, vfc,
fvec(0.5) * (v_1_0 - v::sincos(&vfccos, vtmp * (vrik - vpbigr))));
vfc_d = v::blend(vmask_need_sine, vfc_d, fvec(-0.5) * vtmp * vfccos);
}
fvec vzeta_d_fc = vfc_d * vgijk * vex_delr;
fvec vzeta_d_gijk = vfc * vgijk_d * vex_delr;
fvec vzeta_d_ex_delr = vfc * vgijk * vex_delr_d;
if (ZETA) *zeta = vfc * vgijk * vex_delr;
fvec vminus_costheta = - vcostheta;
fvec vdcosdrjx = vrijinv * fmadd(vminus_costheta, vrij_hatx, rik_hatx);
fvec vdcosdrjy = vrijinv * fmadd(vminus_costheta, vrij_haty, rik_haty);
fvec vdcosdrjz = vrijinv * fmadd(vminus_costheta, vrij_hatz, rik_hatz);
fvec vdcosdrkx = rikinv * fmadd(vminus_costheta, rik_hatx, vrij_hatx);
fvec vdcosdrky = rikinv * fmadd(vminus_costheta, rik_haty, vrij_haty);
fvec vdcosdrkz = rikinv * fmadd(vminus_costheta, rik_hatz, vrij_hatz);
fvec vdcosdrix = -(vdcosdrjx + vdcosdrkx);
fvec vdcosdriy = -(vdcosdrjy + vdcosdrky);
fvec vdcosdriz = -(vdcosdrjz + vdcosdrkz);
*fix = vprefactor * (vzeta_d_gijk * vdcosdrix + vzeta_d_ex_delr * (rik_hatx - vrij_hatx) - vzeta_d_fc * rik_hatx);
*fiy = vprefactor * (vzeta_d_gijk * vdcosdriy + vzeta_d_ex_delr * (rik_haty - vrij_haty) - vzeta_d_fc * rik_haty);
*fiz = vprefactor * (vzeta_d_gijk * vdcosdriz + vzeta_d_ex_delr * (rik_hatz - vrij_hatz) - vzeta_d_fc * rik_hatz);
*fjx = vprefactor * (vzeta_d_gijk * vdcosdrjx + vzeta_d_ex_delr * vrij_hatx);
*fjy = vprefactor * (vzeta_d_gijk * vdcosdrjy + vzeta_d_ex_delr * vrij_haty);
*fjz = vprefactor * (vzeta_d_gijk * vdcosdrjz + vzeta_d_ex_delr * vrij_hatz);
*fkx = vprefactor * ((vzeta_d_fc - vzeta_d_ex_delr) * rik_hatx + vzeta_d_gijk * vdcosdrkx);
*fky = vprefactor * ((vzeta_d_fc - vzeta_d_ex_delr) * rik_haty + vzeta_d_gijk * vdcosdrky);
*fkz = vprefactor * ((vzeta_d_fc - vzeta_d_ex_delr) * rik_hatz + vzeta_d_gijk * vdcosdrkz);
}
#ifdef _LMP_INTEL_OFFLOAD
#pragma offload_attribute(pop)
#endif
+
+#endif
diff --git a/src/USER-INTEL/pair_tersoff_intel.h b/src/USER-INTEL/pair_tersoff_intel.h
index b00249a83..c9604f279 100644
--- a/src/USER-INTEL/pair_tersoff_intel.h
+++ b/src/USER-INTEL/pair_tersoff_intel.h
@@ -1,150 +1,156 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(tersoff/intel,PairTersoffIntel)
#else
#ifndef LMP_PAIR_TERSOFF_INTEL_H
#define LMP_PAIR_TERSOFF_INTEL_H
#include "pair.h"
#include "fix_intel.h"
#include "pair_tersoff.h"
namespace LAMMPS_NS {
class PairTersoffIntel : public PairTersoff {
public:
PairTersoffIntel(class LAMMPS *);
virtual void compute(int, int);
void init_style();
+#ifdef __INTEL_COMPILER
protected:
typedef struct { float x,y,z; int w; } sng4_t;
private:
FixIntel *fix;
int _cop;
public: // wo needs secrets?
// ----------------------------------------------------------------------
//
template <class flt_t>
class ForceConst {
public:
typedef struct { flt_t cutsq; } c_cutoff_t;
typedef struct { flt_t bigr, bigd, lam1, biga; } c_first_loop_t;
typedef struct { flt_t lam2, beta, bigb, powern, c1, c2, c3, c4; } c_second_loop_t;
typedef struct { flt_t lam3, bigr, bigd, c2, d2, h, gamma, powermint; } c_inner_loop_t;
typedef struct { flt_t cutsq, pad[3];
flt_t bigr, bigd, lam1, biga;
flt_t lam2, beta, bigb, powern;
flt_t c1, c2, c3, c4; } c_outer_t;
typedef struct { flt_t cutsq, pad[7];
flt_t lam3, powermint, bigr, bigd;
flt_t c2, d2, h, gamma; } c_inner_t;
c_cutoff_t * * c_cutoff_outer;
c_cutoff_t * * * c_cutoff_inner;
c_first_loop_t * * c_first_loop;
c_second_loop_t * * c_second_loop;
c_inner_loop_t * * * c_inner_loop;
c_outer_t * * c_outer;
c_inner_t * * * c_inner;
ForceConst() : _ntypes(0) {}
~ForceConst() { set_ntypes(0,NULL,_cop); }
void set_ntypes(const int ntypes, Memory *memory, const int cop);
private:
int _ntypes, _cop;
Memory *_memory;
};
ForceConst<float> force_const_single;
ForceConst<double> force_const_double;
template <class flt_t, class acc_t>
void compute(int eflag, int vflag, IntelBuffers<flt_t,acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EVFLAG, int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
+#endif // __INTEL_COMPILER
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Incorrect args for pair coefficients
Self-explanatory. Check the input script or data file.
E: Pair style Tersoff requires atom IDs
This is a requirement to use the Tersoff potential.
E: Pair style Tersoff requires newton pair on
See the newton command. This is a restriction to use the Tersoff
potential.
E: All pair coeffs are not set
All pair coefficients must be set in the data file or by the
pair_coeff command before running a simulation.
E: Cannot open Tersoff potential file %s
The specified potential file cannot be opened. Check that the path
and name are correct.
E: Incorrect format in Tersoff potential file
Incorrect number of words per line in the potential file.
E: Illegal Tersoff parameter
One or more of the coefficients defined in the potential file is
invalid.
E: Potential file has duplicate entry
The potential file for a SW or Tersoff potential has more than
one entry for the same 3 ordered elements.
E: Potential file is missing an entry
The potential file for a SW or Tersoff potential does not have a
needed entry.
E: The 'package intel' command is required for /intel styles
Self-explanatory.
+W: Tersoff/intel currently requires intel compiler. Using MANYBODY version.
+
+Self-explanatory
+
*/
diff --git a/src/USER-OMP/pair_line_lj_omp.cpp b/src/USER-OMP/pair_line_lj_omp.cpp
deleted file mode 100644
index 144a9f04f..000000000
--- a/src/USER-OMP/pair_line_lj_omp.cpp
+++ /dev/null
@@ -1,343 +0,0 @@
-/* ----------------------------------------------------------------------
- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
- http://lammps.sandia.gov, Sandia National Laboratories
- Steve Plimpton, sjplimp@sandia.gov
-
- Copyright (2003) Sandia Corporation. Under the terms of Contract
- DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
- certain rights in this software. This software is distributed under
- the GNU General Public License.
-
- See the README file in the top-level LAMMPS directory.
-------------------------------------------------------------------------- */
-
-/* ----------------------------------------------------------------------
- Contributing author: Axel Kohlmeyer (Temple U)
-------------------------------------------------------------------------- */
-
-#include <math.h>
-#include "pair_line_lj_omp.h"
-#include "atom.h"
-#include "comm.h"
-#include "force.h"
-#include "memory.h"
-#include "neighbor.h"
-#include "neigh_list.h"
-
-#include <string.h>
-
-#include "suffix.h"
-using namespace LAMMPS_NS;
-
-/* ---------------------------------------------------------------------- */
-
-PairLineLJOMP::PairLineLJOMP(LAMMPS *lmp) :
- PairLineLJ(lmp), ThrOMP(lmp, THR_PAIR)
-{
- suffix_flag |= Suffix::OMP;
- respa_enable = 0;
-}
-
-/* ---------------------------------------------------------------------- */
-
-void PairLineLJOMP::compute(int eflag, int vflag)
-{
- if (eflag || vflag) {
- ev_setup(eflag,vflag);
- } else evflag = vflag_fdotr = 0;
-
- const int nall = atom->nlocal + atom->nghost;
- const int nthreads = comm->nthreads;
- const int inum = list->inum;
- const int * const line = atom->line;
- const int * const type = atom->type;
-
- // grow discrete list if necessary and initialize
-
- if (nall > nmax) {
- nmax = nall;
- memory->destroy(dnum);
- memory->destroy(dfirst);
- memory->create(dnum,nall,"pair:dnum");
- memory->create(dfirst,nall,"pair:dfirst");
- }
- memset(dnum,0,nall*sizeof(int));
- ndiscrete = 0;
-
- // need to discretize the system ahead of time
- // until we find a good way to multi-thread it.
- for (int i = 0; i < nall; ++i)
- if (line[i] >= 0)
- if (dnum[i] == 0)
- discretize(i,sigma[type[i]][type[i]]);
-
-#if defined(_OPENMP)
-#pragma omp parallel default(none) shared(eflag,vflag)
-#endif
- {
- int ifrom, ito, tid;
-
- loop_setup_thr(ifrom, ito, tid, inum, nthreads);
- ThrData *thr = fix->get_thr(tid);
- thr->timer(Timer::START);
- ev_setup_thr(eflag, vflag, nall, eatom, vatom, thr);
-
- if (evflag) {
- if (eflag) {
- if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
- else eval<1,1,0>(ifrom, ito, thr);
- } else {
- if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
- else eval<1,0,0>(ifrom, ito, thr);
- }
- } else {
- if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
- else eval<0,0,0>(ifrom, ito, thr);
- }
-
- thr->timer(Timer::PAIR);
- reduce_thr(this, eflag, vflag, thr);
- } // end of omp parallel region
-}
-
-template <int EVFLAG, int EFLAG, int NEWTON_PAIR>
-void PairLineLJOMP::eval(int iifrom, int iito, ThrData * const thr)
-{
- int i,j,ii,jj,jnum,itype,jtype;
- int ni,nj,npi,npj,ifirst,jfirst;
- double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
- double rsq,r2inv,r6inv,term1,term2,sig,sig3,forcelj;
- double xi[2],xj[2],fi[2],fj[2],dxi,dxj,dyi,dyj,ti,tj;
- int *ilist,*jlist,*numneigh,**firstneigh;
-
- const double * const * const x = atom->x;
- double * const * const f = thr->get_f();
- double * const * const torque = thr->get_torque();
- const int * const line = atom->line;
- const int * const type = atom->type;
- const int nlocal = atom->nlocal;
-
- ilist = list->ilist;
- numneigh = list->numneigh;
- firstneigh = list->firstneigh;
-
- // loop over neighbors of my atoms
-
- for (ii = iifrom; ii < iito; ++ii) {
-
- i = ilist[ii];
- xtmp = x[i][0];
- ytmp = x[i][1];
- ztmp = x[i][2];
- itype = type[i];
- jlist = firstneigh[i];
- jnum = numneigh[i];
-
- for (jj = 0; jj < jnum; jj++) {
- j = jlist[jj];
- j &= NEIGHMASK;
-
- delx = xtmp - x[j][0];
- dely = ytmp - x[j][1];
- delz = ztmp - x[j][2];
- rsq = delx*delx + dely*dely + delz*delz;
- jtype = type[j];
-
- if (rsq >= cutsq[itype][jtype]) continue;
-
- // line/line interactions = NxN particles
-
- evdwl = 0.0;
- if (line[i] >= 0 && line[j] >= 0) {
- npi = dnum[i];
- ifirst = dfirst[i];
- npj = dnum[j];
- jfirst = dfirst[j];
-
- fi[0] = fi[1] = fj[0] = fj[1] = ti = tj = 0.0;
-
- for (ni = 0; ni < npi; ni++) {
- dxi = discrete[ifirst+ni].dx;
- dyi = discrete[ifirst+ni].dy;
-
- for (nj = 0; nj < npj; nj++) {
- dxj = discrete[jfirst+nj].dx;
- dyj = discrete[jfirst+nj].dy;
-
- xi[0] = x[i][0] + dxi;
- xi[1] = x[i][1] + dyi;
- xj[0] = x[j][0] + dxj;
- xj[1] = x[j][1] + dyj;
-
- delx = xi[0] - xj[0];
- dely = xi[1] - xj[1];
- rsq = delx*delx + dely*dely;
-
- sig = 0.5 * (discrete[ifirst+ni].sigma+discrete[jfirst+nj].sigma);
- sig3 = sig*sig*sig;
- term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
- term1 = 2.0 * term2 * sig3*sig3;
- r2inv = 1.0/rsq;
- r6inv = r2inv*r2inv*r2inv;
- forcelj = r6inv * (term1*r6inv - term2);
- fpair = forcelj*r2inv;
-
- if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
- fi[0] += delx*fpair;
- fi[1] += dely*fpair;
- ti += fpair*(dxi*dely - dyi*delx);
-
- if (NEWTON_PAIR || j < nlocal) {
- fj[0] -= delx*fpair;
- fj[1] -= dely*fpair;
- tj += fpair*(dxj*dely - dyj*delx);
- }
- }
- }
-
- f[i][0] += fi[0];
- f[i][1] += fi[1];
- f[j][0] += fj[0];
- f[j][1] += fj[1];
- torque[i][2] += ti;
- torque[j][2] += tj;
-
- // line/particle interaction = Nx1 particles
- // convert line into Np particles based on sigma and line length
-
- } else if (line[i] >= 0) {
- npi = dnum[i];
- ifirst = dfirst[i];
-
- fi[0] = fi[1] = fj[0] = fj[1] = ti = tj = 0.0;
-
- for (ni = 0; ni < npi; ni++) {
- dxi = discrete[ifirst+ni].dx;
- dyi = discrete[ifirst+ni].dy;
-
- xi[0] = x[i][0] + dxi;
- xi[1] = x[i][1] + dyi;
- xj[0] = x[j][0];
- xj[1] = x[j][1];
-
- delx = xi[0] - xj[0];
- dely = xi[1] - xj[1];
- rsq = delx*delx + dely*dely;
-
- sig = 0.5 * (discrete[ifirst+ni].sigma+sigma[jtype][jtype]);
- sig3 = sig*sig*sig;
- term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
- term1 = 2.0 * term2 * sig3*sig3;
- r2inv = 1.0/rsq;
- r6inv = r2inv*r2inv*r2inv;
- forcelj = r6inv * (term1*r6inv - term2);
- fpair = forcelj*r2inv;
-
- if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
- fi[0] += delx*fpair;
- fi[1] += dely*fpair;
- ti += fpair*(dxi*dely - dyi*delx);
-
- if (NEWTON_PAIR || j < nlocal) {
- fj[0] -= delx*fpair;
- fj[1] -= dely*fpair;
- tj += fpair*(dxj*dely - dyj*delx);
- }
- }
-
- f[i][0] += fi[0];
- f[i][1] += fi[1];
- f[j][0] += fj[0];
- f[j][1] += fj[1];
- torque[i][2] += ti;
- torque[j][2] += tj;
-
- // particle/line interaction = Nx1 particles
- // convert line into Np particles based on sigma and line length
-
- } else if (line[j] >= 0) {
- npj = dnum[j];
- jfirst = dfirst[j];
-
- fi[0] = fi[1] = fj[0] = fj[1] = ti = tj = 0.0;
-
- for (nj = 0; nj < npj; nj++) {
- dxj = discrete[jfirst+nj].dx;
- dyj = discrete[jfirst+nj].dy;
-
- xi[0] = x[i][0];
- xi[1] = x[i][1];
- xj[0] = x[j][0] + dxj;
- xj[1] = x[j][1] + dyj;
-
- delx = xi[0] - xj[0];
- dely = xi[1] - xj[1];
- rsq = delx*delx + dely*dely;
-
- sig = 0.5 * (sigma[itype][itype]+discrete[jfirst+nj].sigma);
- sig3 = sig*sig*sig;
- term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
- term1 = 2.0 * term2 * sig3*sig3;
- r2inv = 1.0/rsq;
- r6inv = r2inv*r2inv*r2inv;
- forcelj = r6inv * (term1*r6inv - term2);
- fpair = forcelj*r2inv;
-
- if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
- fi[0] += delx*fpair;
- fi[1] += dely*fpair;
- ti += fpair*(dxi*dely - dyi*delx);
-
- if (NEWTON_PAIR || j < nlocal) {
- fj[0] -= delx*fpair;
- fj[1] -= dely*fpair;
- tj -= fpair*(dxj*dely - dyj*delx);
- }
- }
-
- f[i][0] += fi[0];
- f[i][1] += fi[1];
- f[j][0] += fj[0];
- f[j][1] += fj[1];
- torque[i][2] += ti;
- torque[j][2] += tj;
-
- // particle/particle interaction = 1x1 particles
-
- } else {
- r2inv = 1.0/rsq;
- r6inv = r2inv*r2inv*r2inv;
- forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
- fpair = forcelj*r2inv;
-
- if (EFLAG)
- evdwl += r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-
- f[i][0] += delx*fpair;
- f[i][1] += dely*fpair;
- f[i][2] += delz*fpair;
- if (NEWTON_PAIR || j < nlocal) {
- f[j][0] -= delx*fpair;
- f[j][1] -= dely*fpair;
- f[j][2] -= delz*fpair;
- }
- }
-
- if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
- evdwl,0.0,fpair,delx,dely,delz,thr);
- }
- }
-}
-
-/* ---------------------------------------------------------------------- */
-
-double PairLineLJOMP::memory_usage()
-{
- double bytes = memory_usage_thr();
- bytes += PairLineLJ::memory_usage();
-
- return bytes;
-}
diff --git a/src/USER-OMP/pair_line_lj_omp.h b/src/USER-OMP/pair_line_lj_omp.h
deleted file mode 100644
index 9a5e4333e..000000000
--- a/src/USER-OMP/pair_line_lj_omp.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- c++ -*- ----------------------------------------------------------
- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
- http://lammps.sandia.gov, Sandia National Laboratories
- Steve Plimpton, sjplimp@sandia.gov
-
- Copyright (2003) Sandia Corporation. Under the terms of Contract
- DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
- certain rights in this software. This software is distributed under
- the GNU General Public License.
-
- See the README file in the top-level LAMMPS directory.
-------------------------------------------------------------------------- */
-
-/* ----------------------------------------------------------------------
- Contributing author: Axel Kohlmeyer (Temple U)
-------------------------------------------------------------------------- */
-
-#ifdef PAIR_CLASS
-
-PairStyle(line/lj/omp,PairLineLJOMP)
-
-#else
-
-#ifndef LMP_PAIR_LINE_LJ_OMP_H
-#define LMP_PAIR_LINE_LJ_OMP_H
-
-#include "pair_line_lj.h"
-#include "thr_omp.h"
-
-namespace LAMMPS_NS {
-
-class PairLineLJOMP : public PairLineLJ, public ThrOMP {
-
- public:
- PairLineLJOMP(class LAMMPS *);
-
- virtual void compute(int, int);
- virtual double memory_usage();
-
- private:
- template <int EVFLAG, int EFLAG, int NEWTON_PAIR>
- void eval(int ifrom, int ito, ThrData * const thr);
-};
-
-}
-
-#endif
-#endif
diff --git a/src/USER-OMP/pair_tri_lj_omp.cpp b/src/USER-OMP/pair_tri_lj_omp.cpp
deleted file mode 100644
index 94b84316b..000000000
--- a/src/USER-OMP/pair_tri_lj_omp.cpp
+++ /dev/null
@@ -1,413 +0,0 @@
-/* ----------------------------------------------------------------------
- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
- http://lammps.sandia.gov, Sandia National Laboratories
- Steve Plimpton, sjplimp@sandia.gov
-
- Copyright (2003) Sandia Corporation. Under the terms of Contract
- DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
- certain rights in this software. This software is distributed under
- the GNU General Public License.
-
- See the README file in the top-level LAMMPS directory.
-------------------------------------------------------------------------- */
-
-/* ----------------------------------------------------------------------
- Contributing author: Axel Kohlmeyer (Temple U)
-------------------------------------------------------------------------- */
-
-#include <math.h>
-#include "pair_tri_lj_omp.h"
-#include "math_extra.h"
-#include "atom.h"
-#include "atom_vec_tri.h"
-#include "comm.h"
-#include "force.h"
-#include "memory.h"
-#include "neighbor.h"
-#include "neigh_list.h"
-
-#include <string.h>
-
-#include "suffix.h"
-using namespace LAMMPS_NS;
-
-/* ---------------------------------------------------------------------- */
-
-PairTriLJOMP::PairTriLJOMP(LAMMPS *lmp) :
- PairTriLJ(lmp), ThrOMP(lmp, THR_PAIR)
-{
- suffix_flag |= Suffix::OMP;
- respa_enable = 0;
-}
-
-/* ---------------------------------------------------------------------- */
-
-void PairTriLJOMP::compute(int eflag, int vflag)
-{
- if (eflag || vflag) {
- ev_setup(eflag,vflag);
- } else evflag = vflag_fdotr = 0;
-
- const int nall = atom->nlocal + atom->nghost;
- const int nthreads = comm->nthreads;
- const int inum = list->inum;
- const int * const tri = atom->tri;
- const int * const type = atom->type;
- AtomVecTri::Bonus * const bonus = avec->bonus;
-
- // grow discrete list if necessary and initialize
-
- if (nall > nmax) {
- nmax = nall;
- memory->destroy(dnum);
- memory->destroy(dfirst);
- memory->create(dnum,nall,"pair:dnum");
- memory->create(dfirst,nall,"pair:dfirst");
- }
- memset(dnum,0,nall*sizeof(int));
- ndiscrete = 0;
-
- // need to discretize the system ahead of time
- // until we find a good way to multi-thread it.
- for (int i = 0; i < nall; ++i) {
- double dc1[3],dc2[3],dc3[3],p[3][3];
-
- if (tri[i] >= 0) {
- if (dnum[i] == 0) {
- MathExtra::quat_to_mat(bonus[tri[i]].quat,p);
- MathExtra::matvec(p,bonus[tri[i]].c1,dc1);
- MathExtra::matvec(p,bonus[tri[i]].c2,dc2);
- MathExtra::matvec(p,bonus[tri[i]].c3,dc3);
- dfirst[i] = ndiscrete;
- discretize(i,sigma[type[i]][type[i]],dc1,dc2,dc3);
- dnum[i] = ndiscrete - dfirst[i];
- }
- }
- }
-
-#if defined(_OPENMP)
-#pragma omp parallel default(none) shared(eflag,vflag)
-#endif
- {
- int ifrom, ito, tid;
-
- loop_setup_thr(ifrom, ito, tid, inum, nthreads);
- ThrData *thr = fix->get_thr(tid);
- thr->timer(Timer::START);
- ev_setup_thr(eflag, vflag, nall, eatom, vatom, thr);
-
- if (evflag) {
- if (eflag) {
- if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
- else eval<1,1,0>(ifrom, ito, thr);
- } else {
- if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
- else eval<1,0,0>(ifrom, ito, thr);
- }
- } else {
- if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
- else eval<0,0,0>(ifrom, ito, thr);
- }
-
- thr->timer(Timer::PAIR);
- reduce_thr(this, eflag, vflag, thr);
- } // end of omp parallel region
-}
-
-template <int EVFLAG, int EFLAG, int NEWTON_PAIR>
-void PairTriLJOMP::eval(int iifrom, int iito, ThrData * const thr)
-{
- int i,j,ii,jj,jnum,itype,jtype;
- int ni,nj,npi,npj,ifirst,jfirst;
- double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
- double rsq,r2inv,r6inv,term1,term2,sig,sig3,forcelj;
- double dxi,dxj,dyi,dyj,dzi,dzj;
- double xi[3],xj[3],fi[3],fj[3],ti[3],tj[3];
- int *ilist,*jlist,*numneigh,**firstneigh;
-
- const double * const * const x = atom->x;
- double * const * const f = thr->get_f();
- double * const * const torque = thr->get_torque();
- const int * const tri = atom->tri;
- const int * const type = atom->type;
- const int nlocal = atom->nlocal;
-
- ilist = list->ilist;
- numneigh = list->numneigh;
- firstneigh = list->firstneigh;
-
- // loop over neighbors of my atoms
-
- for (ii = iifrom; ii < iito; ++ii) {
-
- i = ilist[ii];
- xtmp = x[i][0];
- ytmp = x[i][1];
- ztmp = x[i][2];
- itype = type[i];
- jlist = firstneigh[i];
- jnum = numneigh[i];
-
- for (jj = 0; jj < jnum; jj++) {
- j = jlist[jj];
- j &= NEIGHMASK;
-
- delx = xtmp - x[j][0];
- dely = ytmp - x[j][1];
- delz = ztmp - x[j][2];
- rsq = delx*delx + dely*dely + delz*delz;
- jtype = type[j];
-
- if (rsq >= cutsq[itype][jtype]) continue;
-
- // tri/tri interactions = NxN particles
- // c1,c2,c3 = corner pts of triangle I or J
-
- evdwl = 0.0;
- if (tri[i] >= 0 && tri[j] >= 0) {
- npi = dnum[i];
- ifirst = dfirst[i];
- npj = dnum[j];
- jfirst = dfirst[j];
-
- fi[0]=fi[1]=fi[2]=fj[0]=fj[1]=fj[2]=0.0;
- ti[0]=ti[1]=ti[2]=tj[0]=tj[1]=tj[2]=0.0;
-
- for (ni = 0; ni < npi; ni++) {
- dxi = discrete[ifirst+ni].dx;
- dyi = discrete[ifirst+ni].dy;
- dzi = discrete[ifirst+ni].dz;
-
- for (nj = 0; nj < npj; nj++) {
- dxj = discrete[jfirst+nj].dx;
- dyj = discrete[jfirst+nj].dy;
- dzj = discrete[jfirst+nj].dz;
-
- xi[0] = x[i][0] + dxi;
- xi[1] = x[i][1] + dyi;
- xi[2] = x[i][2] + dzi;
- xj[0] = x[j][0] + dxj;
- xj[1] = x[j][1] + dyj;
- xj[2] = x[j][2] + dzj;
-
- delx = xi[0] - xj[0];
- dely = xi[1] - xj[1];
- delz = xi[2] - xj[2];
- rsq = delx*delx + dely*dely + delz*delz;
-
- sig = 0.5 * (discrete[ifirst+ni].sigma+discrete[jfirst+nj].sigma);
- sig3 = sig*sig*sig;
- term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
- term1 = 2.0 * term2 * sig3*sig3;
- r2inv = 1.0/rsq;
- r6inv = r2inv*r2inv*r2inv;
- forcelj = r6inv * (term1*r6inv - term2);
- fpair = forcelj*r2inv;
-
- if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
- fi[0] += delx*fpair;
- fi[1] += dely*fpair;
- fi[2] += delz*fpair;
- ti[0] += fpair*(dyi*delz - dzi*dely);
- ti[1] += fpair*(dzi*delx - dxi*delz);
- ti[2] += fpair*(dxi*dely - dyi*delx);
-
- if (NEWTON_PAIR || j < nlocal) {
- fj[0] -= delx*fpair;
- fj[1] -= dely*fpair;
- fj[2] -= delz*fpair;
- tj[0] -= fpair*(dyj*delz - dzj*dely);
- tj[1] -= fpair*(dzj*delx - dxj*delz);
- tj[2] -= fpair*(dxj*dely - dyj*delx);
- }
- }
- }
-
- f[i][0] += fi[0];
- f[i][1] += fi[1];
- f[i][2] += fi[2];
- f[j][0] += fj[0];
- f[j][1] += fj[1];
- f[j][2] += fj[2];
- torque[i][0] += ti[0];
- torque[i][1] += ti[1];
- torque[i][2] += ti[2];
- torque[j][0] += tj[0];
- torque[j][1] += tj[1];
- torque[j][2] += tj[2];
-
- // tri/particle interaction = Nx1 particles
- // c1,c2,c3 = corner pts of triangle I
-
- } else if (tri[i] >= 0) {
- npi = dnum[i];
- ifirst = dfirst[i];
-
- fi[0]=fi[1]=fi[2]=fj[0]=fj[1]=fj[2]=0.0;
- ti[0]=ti[1]=ti[2]=tj[0]=tj[1]=tj[2]=0.0;
-
- for (ni = 0; ni < npi; ni++) {
- dxi = discrete[ifirst+ni].dx;
- dyi = discrete[ifirst+ni].dy;
- dzi = discrete[ifirst+ni].dz;
-
- xi[0] = x[i][0] + dxi;
- xi[1] = x[i][1] + dyi;
- xi[2] = x[i][2] + dzi;
- xj[0] = x[j][0];
- xj[1] = x[j][1];
- xj[2] = x[j][2];
-
- delx = xi[0] - xj[0];
- dely = xi[1] - xj[1];
- delz = xi[2] - xj[2];
- rsq = delx*delx + dely*dely + delz*delz;
-
- sig = 0.5 * (discrete[ifirst+ni].sigma+sigma[jtype][jtype]);
- sig3 = sig*sig*sig;
- term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
- term1 = 2.0 * term2 * sig3*sig3;
- r2inv = 1.0/rsq;
- r6inv = r2inv*r2inv*r2inv;
- forcelj = r6inv * (term1*r6inv - term2);
- fpair = forcelj*r2inv;
-
- if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
- fi[0] += delx*fpair;
- fi[1] += dely*fpair;
- fi[2] += delz*fpair;
- ti[0] += fpair*(dyi*delz - dzi*dely);
- ti[1] += fpair*(dzi*delx - dxi*delz);
- ti[2] += fpair*(dxi*dely - dyi*delx);
-
- if (NEWTON_PAIR || j < nlocal) {
- fj[0] -= delx*fpair;
- fj[1] -= dely*fpair;
- fj[2] -= delz*fpair;
- tj[0] -= fpair*(dyj*delz - dzj*dely);
- tj[1] -= fpair*(dzj*delx - dxj*delz);
- tj[2] -= fpair*(dxj*dely - dyj*delx);
- }
- }
-
- f[i][0] += fi[0];
- f[i][1] += fi[1];
- f[i][2] += fi[2];
- f[j][0] += fj[0];
- f[j][1] += fj[1];
- f[j][2] += fj[2];
- torque[i][0] += ti[0];
- torque[i][1] += ti[1];
- torque[i][2] += ti[2];
- torque[j][0] += tj[0];
- torque[j][1] += tj[1];
- torque[j][2] += tj[2];
-
- // particle/tri interaction = Nx1 particles
- // c1,c2,c3 = corner pts of triangle J
-
- } else if (tri[j] >= 0) {
- npj = dnum[j];
- jfirst = dfirst[j];
-
- fi[0]=fi[1]=fi[2]=fj[0]=fj[1]=fj[2]=0.0;
- ti[0]=ti[1]=ti[2]=tj[0]=tj[1]=tj[2]=0.0;
-
- for (nj = 0; nj < npj; nj++) {
- dxj = discrete[jfirst+nj].dx;
- dyj = discrete[jfirst+nj].dy;
- dzj = discrete[jfirst+nj].dz;
-
- xi[0] = x[i][0];
- xi[1] = x[i][1];
- xi[2] = x[i][2];
- xj[0] = x[j][0] + dxj;
- xj[1] = x[j][1] + dyj;
- xj[2] = x[j][2] + dzj;
-
- delx = xi[0] - xj[0];
- dely = xi[1] - xj[1];
- delz = xi[2] - xj[2];
- rsq = delx*delx + dely*dely + delz*delz;
-
- sig = 0.5 * (sigma[itype][itype]+discrete[jfirst+nj].sigma);
- sig3 = sig*sig*sig;
- term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
- term1 = 2.0 * term2 * sig3*sig3;
- r2inv = 1.0/rsq;
- r6inv = r2inv*r2inv*r2inv;
- forcelj = r6inv * (term1*r6inv - term2);
- fpair = forcelj*r2inv;
-
- if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
- if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
- fi[0] += delx*fpair;
- fi[1] += dely*fpair;
- fi[2] += delz*fpair;
- ti[0] += fpair*(dyi*delz - dzi*dely);
- ti[1] += fpair*(dzi*delx - dxi*delz);
- ti[2] += fpair*(dxi*dely - dyi*delx);
-
- if (NEWTON_PAIR || j < nlocal) {
- fj[0] -= delx*fpair;
- fj[1] -= dely*fpair;
- fj[2] -= delz*fpair;
- tj[0] -= fpair*(dyj*delz - dzj*dely);
- tj[1] -= fpair*(dzj*delx - dxj*delz);
- tj[2] -= fpair*(dxj*dely - dyj*delx);
- }
- }
-
- f[i][0] += fi[0];
- f[i][1] += fi[1];
- f[i][2] += fi[2];
- f[j][0] += fj[0];
- f[j][1] += fj[1];
- f[j][2] += fj[2];
- torque[i][0] += ti[0];
- torque[i][1] += ti[1];
- torque[i][2] += ti[2];
- torque[j][0] += tj[0];
- torque[j][1] += tj[1];
- torque[j][2] += tj[2];
-
- // particle/particle interaction = 1x1 particles
-
- } else {
- r2inv = 1.0/rsq;
- r6inv = r2inv*r2inv*r2inv;
- forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
- fpair = forcelj*r2inv;
-
- if (EFLAG)
- evdwl += r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-
- f[i][0] += delx*fpair;
- f[i][1] += dely*fpair;
- f[i][2] += delz*fpair;
- if (NEWTON_PAIR || j < nlocal) {
- f[j][0] -= delx*fpair;
- f[j][1] -= dely*fpair;
- f[j][2] -= delz*fpair;
- }
- }
-
- if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
- evdwl,0.0,fpair,delx,dely,delz,thr);
- }
- }
-}
-
-/* ---------------------------------------------------------------------- */
-
-double PairTriLJOMP::memory_usage()
-{
- double bytes = memory_usage_thr();
- bytes += PairTriLJ::memory_usage();
-
- return bytes;
-}
diff --git a/src/USER-OMP/pair_tri_lj_omp.h b/src/USER-OMP/pair_tri_lj_omp.h
deleted file mode 100644
index 7c66fdcf4..000000000
--- a/src/USER-OMP/pair_tri_lj_omp.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- c++ -*- ----------------------------------------------------------
- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
- http://lammps.sandia.gov, Sandia National Laboratories
- Steve Plimpton, sjplimp@sandia.gov
-
- Copyright (2003) Sandia Corporation. Under the terms of Contract
- DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
- certain rights in this software. This software is distributed under
- the GNU General Public License.
-
- See the README file in the top-level LAMMPS directory.
-------------------------------------------------------------------------- */
-
-/* ----------------------------------------------------------------------
- Contributing author: Axel Kohlmeyer (Temple U)
-------------------------------------------------------------------------- */
-
-#ifdef PAIR_CLASS
-
-PairStyle(tri/lj/omp,PairTriLJOMP)
-
-#else
-
-#ifndef LMP_PAIR_TRI_LJ_OMP_H
-#define LMP_PAIR_TRI_LJ_OMP_H
-
-#include "pair_tri_lj.h"
-#include "thr_omp.h"
-
-namespace LAMMPS_NS {
-
-class PairTriLJOMP : public PairTriLJ, public ThrOMP {
-
- public:
- PairTriLJOMP(class LAMMPS *);
-
- virtual void compute(int, int);
- virtual double memory_usage();
-
- private:
- template <int EVFLAG, int EFLAG, int NEWTON_PAIR>
- void eval(int ifrom, int ito, ThrData * const thr);
-};
-
-}
-
-#endif
-#endif
diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp
index 065a28fda..f8097a78b 100644
--- a/src/USER-SMTBQ/pair_smtbq.cpp
+++ b/src/USER-SMTBQ/pair_smtbq.cpp
@@ -1,4195 +1,4196 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
The SMTBQ code has been developed with the financial support of CNRS and
of the Regional Council of Burgundy (Convention n¡ 2010-9201AAO037S03129)
Copyright (2015)
Universite de Bourgogne : Nicolas SALLES, Olivier POLITANO
Universite de Paris-Sud Orsay : R. Tetot
Aalto University (Finland) : E. Maras
Please cite the related publication:
N. Salles, O. Politano, E. Amzallag and R. Tetot,
Comput. Mater. Sci., 111 (2016) 181-189
Contact : lammps@u-bourgogne.fr
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details:
<http://www.gnu.org/licenses/>.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_smtbq.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "group.h"
#include "update.h"
#include "math_const.h"
#include "math_special.h"
#include "memory.h"
#include "error.h"
#include "domain.h"
#include <fstream>
#include <iomanip>
using namespace std;
using namespace LAMMPS_NS;
using namespace MathConst;
using namespace MathSpecial;
#define MAXLINE 2048
#define MAXTOKENS 2048
#define DELTA 4
#define PGDELTA 1
#define MAXNEIGH 24
/* ------------------------------------------------------------------------------------
Calculates the factorial of an integer n via recursion.
------------------------------------------------------------------------------------ */
static double factorial(int n)
{
if (n <= 1) return 1.0;
else return static_cast<double>(n)*factorial(n-1);
}
/* ---------------------------------------------------------------------- */
PairSMTBQ::PairSMTBQ(LAMMPS *lmp) : Pair(lmp)
{
MPI_Comm_rank(world,&me);
MPI_Comm_size(world,&nproc);
single_enable = 0;
restartinfo = 0;
one_coeff = 1;
nmax = 0;
rmin = 0.0;
dr = 0.0;
ds = 0.0;
kmax = 0;
nelements = 0;
elements = NULL;
nparams = 0;
maxparam = 0;
params = NULL;
intparams = NULL;
intype = NULL;
coultype = NULL;
fafb = NULL;
dfafb = NULL;
potqn = NULL;
dpotqn = NULL;
Vself = 0.0;
tabsmb = NULL;
tabsmr = NULL;
dtabsmb = NULL;
dtabsmr = NULL;
sbcov = NULL;
coord = NULL;
sbmet = NULL;
chimet = NULL;
ecov = NULL;
potmad = NULL;
potself = NULL;
potcov = NULL;
qf = NULL;
q1 = NULL;
q2 = NULL;
tab_comm = NULL;
nvsm = NULL;
vsm = NULL;
flag_QEq = NULL;
nQEqaall = NULL;
nQEqcall = NULL;
nQEqall = NULL;
nteam = 0;
cluster = 0;
Nevery = 0.0;
Neverypot = 0.0;
fct = NULL;
maxpage = 0;
// set comm size needed by this Pair
comm_forward = 1;
comm_reverse = 1;
}
/* ----------------------------------------------------------------------
check if allocated, since class can be destructed when incomplete
------------------------------------------------------------------------- */
PairSMTBQ::~PairSMTBQ()
{
int i;
if (elements) {
for ( i = 0; i < nelements; i++) delete [] elements[i];
for( i = 0; i < atom->ntypes ; i++ ) free( params[i].nom );
for( i = 1; i <= maxintparam ; i++ ) free( intparams[i].typepot );
for( i = 1; i <= maxintparam ; i++ ) free( intparams[i].mode );
}
free(QEqMode);
free(QInitMode);
free(writepot);
free(writeenerg);
free(Bavard);
delete [] elements;
memory->sfree(params);
memory->sfree(intparams);
memory->destroy(intype);
memory->destroy(coultype);
memory->destroy(fafb);
memory->destroy(dfafb);
memory->destroy(potqn);
memory->destroy(dpotqn);
memory->destroy(ecov);
memory->destroy(sbcov);
memory->destroy(coord);
memory->destroy(sbmet);
memory->destroy(tabsmb);
memory->destroy(tabsmr);
memory->destroy(dtabsmb);
memory->destroy(dtabsmr);
memory->destroy(potmad);
memory->destroy(potself);
memory->destroy(potcov);
memory->destroy(chimet);
memory->destroy(nvsm);
memory->destroy(vsm);;
memory->destroy(flag_QEq);
memory->destroy(nQEqall);
memory->destroy(nQEqcall);
memory->destroy(nQEqaall);
memory->destroy(qf);
memory->destroy(q1);
memory->destroy(q2);
memory->destroy(tab_comm);
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
delete [] map;
delete [] esm;
}
memory->destroy(fct);
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(cutsq,n+1,n+1,"pair:cutsq");
map = new int[n+1];
esm = new double[n];
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairSMTBQ::settings(int narg, char **arg)
{
if (narg > 0) error->all(FLERR,"Illegal pair_style command");
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairSMTBQ::coeff(int narg, char **arg)
{
int i,j,n;
if (!allocated) allocate();
if (strstr(force->pair_style,"hybrid"))
error->all(FLERR,"Pair style SMTBQ is not compatible with hybrid styles");
if (narg != 3 + atom->ntypes)
error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if NULL
// nelements = # of unique elements
// elements = list of element names
if (elements) {
for (i = 0; i < nelements; i++) delete [] elements[i];
delete [] elements;
}
elements = new char*[atom->ntypes];
for (i = 0; i < atom->ntypes; i++) elements[i] = NULL;
nelements = 0;
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {
map[i-2] = -1;
continue;
}
for (j = 0; j < nelements; j++)
if (strcmp(arg[i],elements[j]) == 0) break;
map[i-2] = j;
if (j == nelements) {
n = strlen(arg[i]) + 1;
elements[j] = new char[n];
strcpy(elements[j],arg[i]);
nelements++;
}
}
// read potential file and initialize potential parameters
read_file(arg[2]);
n = atom->ntypes;
// generate Coulomb 1/r energy look-up table
if (comm->me == 0 && screen) fprintf(screen,"Pair SMTBQ:\n");
if (comm->me == 0 && screen)
fprintf(screen," generating Coulomb integral lookup table ...\n");
tabqeq();
// ------------
if (comm->me == 0 && screen)
fprintf(screen," generating Second Moment integral lookup table ...\n");
tabsm();
// ------------
// clear setflag since coeff() called once with I,J = * *
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
// set setflag i,j for type pairs where both are mapped to elements
int count = 0;
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
if (map[i] >= 0 && map[j] >= 0) {
setflag[i][j] = 1;
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairSMTBQ::init_style()
{
if (atom->tag_enable == 0)
error->all(FLERR,"Pair style SMTBQ requires atom IDs");
if (force->newton_pair == 0)
error->all(FLERR,"Pair style SMTBQ requires newton pair on");
if (!atom->q_flag)
error->all(FLERR,"Pair style SMTBQ requires atom attribute q");
// need a full neighbor list
int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1;
pgsize = neighbor->pgsize;
oneatom = neighbor->oneatom;
// if (maxpage == 0) add_pages();
}
/* ---------------------------------------------------------------------- */
double PairSMTBQ::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
return cutmax;
}
/* ----------------------------------------------------------------------
---------------------------------------------------------------------- */
void PairSMTBQ::read_file(char *file)
{
int num_atom_types,i,k,m,test,j,verbose;
char **words;
memory->sfree(params);
params = NULL;
memory->sfree(intparams);
intparams = NULL;
nparams = 0;
maxparam = 0;
maxintparam = 0;
verbose = 1;
verbose = 0;
// open file on all processors
FILE *fp;
fp = force->open_potential(file);
if ( fp == NULL ) {
char str[128];
sprintf(str,"Cannot open SMTBQ potential file %s",file);
error->one(FLERR,str);
}
// read each line out of file, skipping blank lines or leading '#'
// store line of params if all 3 element tags are in element list
char *ptr;
ptr = (char*) malloc(sizeof(char)*MAXLINE);
words = (char**) malloc(sizeof(char*)*MAXTOKENS);
for (i=0; i < MAXTOKENS; i++)
words[i] = (char*) malloc(sizeof(char)*MAXTOKENS);
/* strip comment, skip line if blank */
if (verbose) printf ("\n");
fgets(ptr,MAXLINE,fp);
while (strchr(ptr,'#')) {
if (verbose) printf ("%s",ptr);
fgets(ptr,MAXLINE,fp);
}
// Nombre d'atome different dans la structure
// ===============================================
Tokenize( ptr, &words );
num_atom_types = atoi(words[1]);
if (verbose) printf (" %s %d\n", words[0], num_atom_types);
memory->create(intype,num_atom_types,num_atom_types,"pair:intype");
m = 0;
for (i = 0; i < num_atom_types; i++) {
for (j = 0; j < num_atom_types; j++) {
if (j < i) { intype[i][j] = intype[j][i];}
else { intype[i][j] = 0;
m = m + 1; }
if (verbose) printf ("i %d, j %d, intype %d - nb pair %d\n",i,j,intype[i][j],m);
}
}
// load up parameter settings and error check their values
if (nparams == maxparam) {
maxparam += DELTA;
params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
"pair:params");
maxintparam += m;
intparams = (Intparam *) memory->srealloc(intparams,(maxintparam+1)*sizeof(Intparam),
"pair:intparams");
}
for (i=0; i < num_atom_types; i++)
params[i].nom = (char*) malloc(sizeof(char)*3);
for (i=1; i <= maxintparam; i++)
intparams[i].typepot = (char*) malloc(sizeof(char)*15);
for (i=1; i <= maxintparam; i++)
intparams[i].mode = (char*) malloc(sizeof(char)*6);
QEqMode = (char*) malloc(sizeof(char)*19);
Bavard = (char*) malloc(sizeof(char)*6);
QInitMode = (char*) malloc(sizeof(char)*19);
writepot = (char*) malloc(sizeof(char)*6);
writeenerg = (char*) malloc(sizeof(char)*6);
// Little loop for ion's parameters
// ================================================
for (i=0; i<num_atom_types; i++) {
fgets(ptr,MAXLINE,fp); if (verbose) printf ("%s",ptr);
// Line 2 - Al
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
strcpy(params[i].nom , words[1]);
params[i].sto = atof(words[2]);
if (verbose) printf (" %s %s %f\n", words[0],params[i].nom,params[i].sto);
//Line 3 - Charges
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
params[i].qform = atof(words[1]);
params[i].masse = atof(words[2]);
if (verbose) printf (" %s %f %f \n", words[0],params[i].qform, params[i].masse);
// Line 4 - Parametres QEq
fgets( ptr, MAXLINE, fp);
Tokenize ( ptr, &words );
params[i].ne = atof(words[1]) ;
params[i].chi = atof(words[2]) ;
params[i].dj = atof(words[3]) ;
if(strcmp(params[i].nom,"O")!=0){
params[i].R = atof(words[4]) ;
if (verbose) printf(" %s %f %f %f %f\n",words[0],params[i].ne,params[i].chi,
params[i].dj,params[i].R);
} else {
if (verbose) printf(" %s %f %f %f\n",words[0],params[i].ne,params[i].chi,params[i].dj);
}
// Line 4bis - Coordinance et rayon pour Ox
if(strcmp(params[i].nom,"O")==0){
fgets( ptr, MAXLINE, fp);
Tokenize ( ptr, &words );
coordOxBB= atof(words[1]) ;
coordOxBulk= atof(words[2]) ;
coordOxSurf= atof(words[3]) ;
ROxBB = atof(words[4]) ;
params[i].R = atof(words[5]) ;
ROxSurf = atof(words[6]) ;
if (verbose) printf(" %s %f %f %f %f %f %f\n",words[0],coordOxBB,coordOxBulk,coordOxSurf,ROxBB,params[i].R,ROxSurf);
}
// Ligne 5 - Nombre d'etats partages
fgets( ptr, MAXLINE, fp);
Tokenize ( ptr, &words );
params[i].n0 = atof(words[1]);
if (verbose) printf(" %s %f\n",words[0],params[i].n0);
// Parametres de Slater
params[i].dzeta = (2.0*params[i].ne + 1.0)/(4.0*params[i].R);
if (verbose) printf (" Parametre dzeta (Slater) : %f\n",params[i].dzeta);
} // Fin elements i
/* =====================================================================
reading the interaction's parameters
===================================================================== */
m = 0; maxintsm = 0; //
for (k=0 ; k<=maxintparam ; k++){intparams[k].intsm = 0;}
// ---------------------------------
for (k = 0; k < maxintparam; k++) {
// ---------------------------------
m += 1;
// Ligne 5 - parametre des potentiels
fgets(ptr,MAXLINE,fp); if (verbose) printf ("%s",ptr);
// Lecture des protagonistes
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
test = 0;
for (i = 0; i <num_atom_types; i++)
{
if (strcmp(params[i].nom,words[1])==0) break;
if (i == num_atom_types - 1) test = 1;
}
// if (test == 0) printf (" on a %s -> %d = %s\n",words[1],i,params[i].nom);
for (j = 0; j <num_atom_types; j++)
{
if (strcmp(params[j].nom,words[2])==0) break;
if (j == num_atom_types - 1) test = 1;
}
// if (test == 0) printf (" on a %s -> %d = %s\n",words[2],j,params[j].nom);
if ( test == 1 ) {
if (verbose) printf ("========== fin des interaction ==========\n");
break ; }
intype[i][j] = m;
intype[j][i] = intype[i][j];
strcpy( intparams[m].typepot , words[3] );
intparams[m].intsm = 0;
if (verbose) printf (" itype %d jtype %d - intype %d\n",i,j,intype[i][j]);
if (strcmp(intparams[m].typepot,"second_moment") !=0 &&
strcmp(intparams[m].typepot,"buck") != 0 &&
strcmp(intparams[m].typepot,"buckPlusAttr") != 0) {
error->all(FLERR,"the potential other than second_moment or buckingham have not treated here\n");}
// On detemrine le type d'interaction
// -----------------------------------
if (strcmp(intparams[m].typepot,"second_moment") == 0) {
maxintsm += 1;
strcpy( intparams[m].mode , words[4] );
intparams[m].intsm = maxintsm;
if (strcmp(intparams[m].mode,"oxide") != 0 &&
strcmp(intparams[m].mode,"metal") != 0){
error->all(FLERR,"needs mode to second moment interaction : oxide or metal"); }
// if (strcmp(intparams[m].mode,"oxide") == 0)
// intparams[m].ncov = min((params[i].sto)*(params[i].n0),(params[j].sto)*(params[j].n0));
if (verbose) printf(" %s %s %s %s %s \n",words[0],words[1],words[2],
intparams[m].typepot,intparams[m].mode);
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
intparams[m].a = atof(words[1]) ;
intparams[m].p = atof(words[2]) ;
intparams[m].ksi = atof(words[3]) ;
intparams[m].q = atof(words[4]) ;
if (verbose) printf (" %s %f %f %f %f\n",words[0],
intparams[m].a,intparams[m].p,intparams[m].ksi,intparams[m].q);
// Ligne 6 - rayon de coupure potentiel SM
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
intparams[m].dc1 = atof(words[1]) ;
intparams[m].dc2 = atof(words[2]) ;
intparams[m].r0 = atof(words[3]) ;
if (strcmp(intparams[m].mode,"metal") == 0) {
if (verbose) printf (" %s %f %f %f\n",words[0],
intparams[m].dc1,intparams[m].dc2,intparams[m].r0);
} else {
if (verbose) printf (" %s %f %f %f\n",words[0],
intparams[m].dc1,intparams[m].dc2,intparams[m].r0);
}
} else if (strcmp(intparams[m].typepot,"buck") == 0) {
if (verbose) printf(" %s %s %s %s\n",words[0],words[1],words[2],
intparams[m].typepot);
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
intparams[m].abuck = atof(words[1]) ; intparams[m].rhobuck = atof(words[2]) ;
if (verbose) printf (" %s %f %f\n",words[0],intparams[m].abuck,intparams[m].rhobuck);
}
else if (strcmp(intparams[m].typepot,"buckPlusAttr") == 0) {
if (verbose) printf(" %s %s %s %s\n",words[0],words[1],words[2],
intparams[m].typepot);
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
intparams[m].abuck = atof(words[1]) ; intparams[m].rhobuck = atof(words[2]) ;
if (verbose) printf (" %s %f %f\n",words[0],intparams[m].abuck,intparams[m].rhobuck);
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
intparams[m].aOO = atof(words[1]) ; intparams[m].bOO = atof(words[2]) ;
intparams[m].r1OO = atof(words[3]) ;intparams[m].r2OO = atof(words[4]) ;
if (verbose) printf (" %s %f %f %f %f \n",words[0],intparams[m].aOO,
intparams[m].bOO,intparams[m].r1OO,intparams[m].r2OO);
}
if (verbose) printf (" intsm %d \n",intparams[m].intsm);
} // for maxintparam
/* ====================================================================
tables Parameters
==================================================================== */
// Ligne 9 - rayon de coupure Electrostatique
if (test == 0) {
fgets(ptr,MAXLINE,fp);
if (verbose) printf ("%s\n",ptr);
fgets( ptr, MAXLINE, fp);
}
Tokenize( ptr, &words );
for (i=0 ; i<num_atom_types; i++) { params[i].cutsq = atof(words[1]); }
cutmax = atof(words[1]);
if (verbose) printf (" %s %f\n",words[0],params[0].cutsq);
// Ligne 9 - parametre pour les tableaux
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
rmin = atof(words[1]) ; dr = atof(words[2]);
if (verbose) printf (" %s %f %f\n",words[0],rmin,dr);
kmax = int(cutmax*cutmax/(2.0*dr*rmin));
ds = cutmax*cutmax/static_cast<double>(kmax) ;
if (verbose) printf (" kmax %d et ds %f\n",kmax,ds);
/* ======================================================== */
fgets( ptr, MAXLINE, fp);
if (verbose) printf ("%s",ptr);
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
Qstep = atoi(words[1]);
if (verbose) printf (" %s " BIGINT_FORMAT "\n",words[0],Qstep);
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
loopmax = atoi(words[1]);
precision = atof(words[2]);
if (verbose) printf (" %s %d %f\n",words[0],loopmax,precision);
/* Param de coordination ============================================= */
fgets( ptr, MAXLINE, fp);
if (verbose) printf ("%s",ptr);
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
r1Coord = atof(words[1]);
r2Coord = atof(words[2]);
if (verbose) printf (" %s %f %f\n",words[0],r1Coord,r2Coord);
/* Mode for QInit============================================= */
fgets( ptr, MAXLINE, fp);
if (verbose) printf ("%s",ptr);
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
strcpy( QInitMode , words[1] );
if (strcmp(QInitMode,"true") == 0) QOxInit= atof(words[2]);
else QOxInit = 0.0;
if (verbose) printf (" %s %s %f\n",words[0],QInitMode,QOxInit);
/* Mode for QEq============================================= */
fgets( ptr, MAXLINE, fp);
if (verbose) printf ("%s",ptr);
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
strcpy( QEqMode , words[1] );
if (verbose) printf (" %s %s\n",words[0],QEqMode);
fgets( ptr, MAXLINE, fp);
if (strcmp(QEqMode,"BulkFromSlab") == 0) {
Tokenize( ptr, &words );
zlim1QEq = atof(words[1]);
zlim2QEq = atof(words[2]);
if (verbose) printf (" %s %f %f\n",words[0],zlim1QEq,zlim2QEq);
} else if (strcmp(QEqMode,"Surface") == 0) {
Tokenize( ptr, &words );
zlim1QEq = atof(words[1]);
if (verbose) printf (" %s %f \n",words[0],zlim1QEq);
} else if (strcmp(QEqMode,"QEqAll") != 0 &&
strcmp(QEqMode,"QEqAllParallel") != 0 &&
strcmp(QEqMode,"Surface") != 0 ) {
error->all(FLERR,"The QEq Mode is not known. QEq mode should be :\n"
" Possible QEq modes | parameters\n"
" QEqAll | no parameters\n"
" QEqAllParallel | no parameters\n"
" Surface | zlim (QEq only for z>zlim)\n"
" BulkFromSlab | zlim1 zlim2 (QEq only for zlim1<z<zlim2)\n");
}
/* Bavard============================================= */
fgets( ptr, MAXLINE, fp);
if (verbose) printf ("%s",ptr);
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
strcpy( Bavard , words[1] );
if (verbose) printf (" %s %s\n",words[0],Bavard);
// ---------------------------------------
// Writing the energy component.
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
strcpy( writeenerg, words[1] );
if (strcmp (writeenerg,"true") == 0) { Nevery = atof(words[2]); }
else { Nevery = 0.0; }
if (verbose) printf (" %s %s %f\n",words[0],writeenerg,Nevery);
// ---------------------------------------
// Writing the chimical electronic potential.
fgets( ptr, MAXLINE, fp);
Tokenize( ptr, &words );
strcpy( writepot, words[1] );
if (strcmp (writepot,"true") == 0) { Neverypot = atof(words[2]); }
else { Neverypot = 0.0; }
if (verbose) printf (" %s %s %f\n",words[0],writepot,Neverypot);
/* ======================================================== */
/* deallocate helper storage */
for( i = 0; i < MAXTOKENS ; i++ ) free( words[i] );
free( words );
free( ptr );
fclose(fp);
// === Rayon de coupure premier voisins : 1,2*r0
for (i=0 ; i<num_atom_types ; i++) {
for (j=0 ; j<=i ; j++) {
m = intype[i][j];
if (m == 0) continue;
if (intparams[m].intsm == 0) continue;
intparams[m].neig_cut = 1.2*intparams[m].r0;
if (strcmp(intparams[m].typepot,"second_moment") == 0 )
if (verbose) printf (" Rc 1er voisin, typepot %s -> %f Ang\n",
intparams[m].typepot,intparams[m].neig_cut);
}
}
//A adapter au STO
- ncov = params[0].sto * params[0].n0;
- for (i=1; i<num_atom_types; i++)
- ncov = min(ncov,params[i].sto * params[i].n0);
+ ncov = min((params[0].sto)*(params[0].n0),(params[1].sto)*(params[1].n0));
if (verbose) printf (" Parametre ncov = %f\n",ncov);
if (verbose) printf (" ********************************************* \n");
}
/* ----------------------------------------------------------------------
* COMPUTE
---------------------------------------------------------------------- */
void PairSMTBQ::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,m,gp;
tagint itag,jtag;
int itype,jtype;
int *ilist,*jlist,*numneigh,**firstneigh;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
double rsq,iq,jq,Eself;
double ecovtot,ErepOO,ErepMO,Eion,Ecoh;
double **tmp,**tmpAll,*nmol;
double dq,dqcov;
if (atom->nmax > nmax) {
memory->destroy(ecov);
memory->destroy(potmad);
memory->destroy(potself);
memory->destroy(potcov);
memory->destroy(sbcov);
memory->destroy(coord);
memory->destroy(sbmet);
memory->destroy(chimet);
memory->destroy(flag_QEq);
memory->destroy(qf);
memory->destroy(q1);
memory->destroy(q2);
memory->destroy(tab_comm);
nmax = atom->nmax;
memory->create(ecov,nmax,"pair:ecov");
memory->create(potmad,nmax,"pair:potmad");
memory->create(potself,nmax,"pair:potself");
memory->create(potcov,nmax,"pair:potcov");
memory->create(sbcov,nmax,"pair:sbcov");
memory->create(coord,nmax,"pair:coord");
memory->create(sbmet,nmax,"pair:sbmet");
memory->create(chimet,nmax,"pair:chimet");
memory->create(flag_QEq,nmax,"pair:flag_QEq");
memory->create(qf,nmax,"pair:qf");
memory->create(q1,nmax,"pair:q1");
memory->create(q2,nmax,"pair:q2");
memory->create(tab_comm,nmax,"pair:tab_comm");
}
evdwl = ecoul = ecovtot = ErepOO = ErepMO = Eion = 0.0;
Eself = 0.0;
if (eflag || vflag) { ev_setup(eflag,vflag); }
else { evflag = vflag_fdotr = vflag_atom = 0; }
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
tagint *tag = atom->tag;
int *type = atom->type;
int newton_pair = force->newton_pair;
int nlocal = atom->nlocal;
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
const bigint step = update->ntimestep;
if (step == 0 || ((Qstep > 0) && (step % Qstep == 0))) Charge();
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// this is necessary to get sbcov or sbmet table in order to caclulate the covalent or metal bonding
if (Qstep == 0 || (step % Qstep != 0)) QForce_charge(0);
// Charges Communication
// ----------------------
- forward(q) ; reverse(q);
+ forward(q) ; // reverse(q);
memory->create(nmol,nteam+1,"pair:nmol");
memory->create(tmp,nteam+1,7,"pair:tmp");
memory->create(tmpAll,nteam+1,7,"pair:tmpAll");
for (i=0; i<nteam+1; i++) {
nmol[i] = static_cast<double>(nQEqall[i]);
for (j=0; j<7; j++) { tmp[i][j] = 0.0; tmpAll[i][j] = 0.0; }
}
/* ------------------------------------------------------------------------
Energy component store in tmp[gp][:] with gp is # QEq group
0 -> ionic energy
1 -> coulombian energy
2 -> Electrosatic energy (ionic + Coulombian)
3 -> Short int. Ox-Ox
4 -> Short int. SMTB (repulsion)
5 -> Covalent energy SMTB
6 -> Somme des Q(i)²
------------------------------------------------------------------------- */
/* -------------- N-body forces Calcul --------------- */
for (ii = 0; ii < inum; ii++) {
// ===============================
i = ilist[ii];
itag = tag[i];
itype = map[type[i]];
iq = q[i];
gp = flag_QEq[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
// --- For atom i
tmp[gp][6] += iq*iq;
// self energy, only on i atom
// ---------------------------
Eself = self(&params[itype],iq);
tmp[gp][0] += Eself;
tmp[gp][2] += Eself;
if (evflag) ev_tally_full (i,0.0,2.0*Eself,0.0,0.0,0.0,0.0);
// N-body energy of i
// ---------------------
dq = fabs(params[itype].qform) - fabs(iq);
dqcov = dq*(2.0*ncov/params[itype].sto - dq);
ecov[i] = - sqrt(sbcov[i]*dqcov + sbmet[i]);
ecovtot += ecov[i];
tmp[gp][5] += ecov[i];
if (evflag) ev_tally_full(i,0.0,2.0*ecov[i],0.0,0.0,0.0,0.0);
// Coulombian Interaction
// -----------------------
evdwl = 2.0*Vself*iq*iq ;
tmp[gp][1] += Vself*iq*iq;
tmp[gp][2] += Vself*iq*iq;
if (evflag) ev_tally_full (i,0.0,evdwl,0.0,0.0,0.0,0.0);
evdwl = 0.0 ;
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
// ===============================
j = jlist[jj];
j &= NEIGHMASK;
jtype = map[type[j]];
jtag = tag[j]; jq = q[j];
// .......................................................................
if (itag > jtag) {
if ((itag+jtag) % 2 == 0) continue;
} else if (itag < jtag) {
if ((itag+jtag) % 2 == 1) continue;
} else {
if (x[j][2] < x[i][2]) continue;
if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
}
// .......................................................................
// # of interaction
// ----------------
m = intype[itype][jtype];
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
// ---------------------------------
if (sqrt(rsq) > cutmax) continue;
// ---------------------------------
// Coulombian Energy
// ------------------
evdwl = 0.0 ; fpair = 0.0;
potqeq(i,j,iq,jq,rsq,fpair,eflag,evdwl);
tmp[gp][1] += evdwl;
tmp[gp][2] += evdwl;
// Coulombian Force
// -----------------
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
if (evflag)
ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
evdwl = 0.0; fpair = 0.0 ;
// ---------------------
if (m == 0) continue;
// ---------------------
// ----------------------------------------------
if ( strcmp(intparams[m].typepot,"buck") == 0 ||
strcmp(intparams[m].typepot,"buckPlusAttr") ==0 ) {
// ----------------------------------------------
evdwl = 0.0; fpair =0.0;
rep_OO (&intparams[m],rsq,fpair,eflag,evdwl);
ErepOO += evdwl ;
tmp[gp][3] += evdwl;
// repulsion is pure two-body, sums up pair repulsive forces
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
if (evflag)
ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
evdwl = 0.0; fpair = 0.0 ;
} // ----------------------------------- Rep O-O
if (strcmp(intparams[m].typepot,"buckPlusAttr") == 0 ) {
// ----------------------------------------------
evdwl = 0.0; fpair =0.0;
Attr_OO (&intparams[m],rsq,fpair,eflag,evdwl);
ErepOO += evdwl ;
tmp[gp][3] += evdwl;
// repulsion is pure two-body, sums up pair repulsive forces
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
if (evflag)
ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
evdwl = 0.0; fpair = 0.0 ;
} // ----------------------------------- Attr O-O
// -----------------------------------------------------------------
if (strcmp(intparams[m].typepot,"second_moment") != 0 ) continue;
// -----------------------------------------------------------------
if (sqrt(rsq) > intparams[m].dc2) continue;
// -------------------------------------------
// Repulsion : Energy + force
// ----------------------------
evdwl = 0.0; fpair = 0.0 ;
repulsive(&intparams[m],rsq,i,j,fpair,eflag,evdwl);
ErepMO += evdwl;
tmp[gp][4] += 2.0*evdwl;
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
if (evflag)
ev_tally(i,j,nlocal,newton_pair,2.0*evdwl,0.0,fpair,delx,dely,delz);
evdwl = 0.0 ; fpair = 0.0;
// ----- ----- ----- ----- ----- -----
// Attraction : force
// ------------------
fpair = 0.0;
f_att(&intparams[m], i, j, rsq, fpair) ;
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
if (evflag)
ev_tally(i,j,nlocal,newton_pair,0.0,0.0,fpair,delx,dely,delz);
} // --------------------------------- End j
} // ---------------------------------- End i
if (vflag_fdotr) virial_fdotr_compute();
for (i = 0; i < nteam+1; i++) {
MPI_Allreduce(tmp[i],tmpAll[i],7,MPI_DOUBLE,MPI_SUM,world);
}
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if (me == 0 && fmod(static_cast<double>(step), Nevery) == 0.0 && strcmp(writeenerg,"true") == 0) {
ofstream fichierE;
if (step == 0) { fichierE.open ("Energy_component.txt", ios::out | ios::trunc) ;}
else { fichierE.open ("Energy_component.txt", ios::out | ios::app) ;}
if (fichierE) fichierE<< setprecision(9) <<step;
for (gp = 0; gp < nteam+1; gp++) {
if (nmol[gp] == 0) continue;
if (fichierE) fichierE<< setprecision(9) <<" "<<gp<<" "<<nmol[gp]
<<" "<<tmpAll[gp][2]<<" "<<tmpAll[gp][3]<<" "<<tmpAll[gp][4]+tmpAll[gp][5];
}
if (fichierE) fichierE<<endl;
if (fichierE) fichierE.close();
}
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if (me == 0&& strcmp(Bavard,"false") != 0) {
printf ("A la fin de Compute\n");
printf ("Nemton_pair : %d, evflag %d, tail_flag %d,vflag_fdotr %d\n",
newton_pair,evflag,force->pair->tail_flag,vflag_fdotr);
printf ("neighbor->includegroup %d\n",neighbor->includegroup);
for (gp=0; gp<nteam+1; gp++) { // -------------------------- Boucle sur les gp
printf ("Energie de la team %d -- %d atome -------(nteam = %d) \n ",gp,int(nmol[gp]),nteam);
if (nmol[gp] == 0) {
printf (" ============================================ \n \n");
continue;
}
printf ("Vself %f, Som q2 : %f, nmol %f\n",Vself,tmpAll[gp][6],nmol[gp]);
// printf ("nmol %f\n",nmol[gp]);
printf ("Energie coul tot : %f | %f par mol\n",tmpAll[gp][1],tmpAll[gp][1]/nmol[gp]);
printf ("Energie ionique : %f | %f par mol\n",tmpAll[gp][0],tmpAll[gp][0]/nmol[gp]);
printf ("Energie elect tot : %f | %f par mol\n",tmpAll[gp][2],tmpAll[gp][2]/nmol[gp]);
printf ("Energie cp pair ox : %f | %f par mol\n",tmpAll[gp][3],tmpAll[gp][3]/nmol[gp]);
printf ("Energie cp pair sm : %f | %f par mol\n",tmpAll[gp][4],tmpAll[gp][4]/nmol[gp]);
printf ("Energie cov sm : %f | %f par mol\n",tmpAll[gp][5],tmpAll[gp][5]/nmol[gp]);
Ecoh = tmpAll[gp][2] + tmpAll[gp][3] + tmpAll[gp][4] + tmpAll[gp][5];
printf ("Energie totale : %f | %f par mol\n",Ecoh,Ecoh/nmol[gp]);
printf ("================================================= \n");
printf (" \n");
} // ----------------------------------------------------- Boucle sur les gp
} // ------------ Call me == 0
memory->destroy(nmol);
memory->destroy(tmp);
memory->destroy(tmpAll);
}
/* ----------------------------------------------------------------------
Partie Electrostatique
----------------------------------------------------------------------*/
double PairSMTBQ::self(Param *param, double qi)
{
double self_tmp;
double s1=param->chi, s2=param->dj;
self_tmp = qi*(s1+0.5*qi*s2);
return self_tmp;
}
/* ---------------------------------------------------------------------- */
double PairSMTBQ::qfo_self(Param *param, double qi)
{
double self_d;
double s1 = param->chi;
double s2 = param->dj;
self_d = 0.0 ;
self_d = s1+qi*s2;
return self_d;
}
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
void PairSMTBQ::tabqeq()
{
int i,j,k,m,verbose;
int nntype;
double rc,s,r;
double alf;
int ii;
double za,zb,ra,rb,gam,dgam,dza,dzb,
d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2,na,nb;
double aCoeff,bCoeff,rcoupe,nang;
int n = atom->ntypes;
- int nmax = atom->nmax;
+ int nlocal = atom->nlocal;
+ int nghost = atom->nghost;
+ nmax = atom->nmax;
verbose = 1;
verbose = 0;
nntype = int((n+1)*n/2);
rc = cutmax ;
alf = 0.3 ;
// alf = 0.2 ;
if (verbose) printf ("kmax %d, ds %f, nmax %d\n",kmax,ds,nmax);
+ if (verbose) printf ("nlocal = %d, nghost = %d\n",nlocal,nghost);
if (verbose) printf ("nntypes %d, kmax %d, rc %f, n %d\n",nntype,kmax,rc,n);
// allocate arrays
memory->create(coultype,n,n,"pair:intype");
memory->create(potqn,kmax+5,"pair:potqn");
memory->create(dpotqn,kmax+5,"pair:dpotqn");
memory->create(fafb,kmax+5,nntype,"pair:fafb");
memory->create(dfafb,kmax+5,nntype,"pair:dfafb");
memory->create(fafbOxOxSurf,kmax+5,"pair:fafbOxOxSurf");
memory->create(dfafbOxOxSurf,kmax+5,"pair:dfafbOxOxSurf");
memory->create(fafbTiOxSurf,kmax+5,"pair:fafbTiOxSurf");
memory->create(dfafbTiOxSurf,kmax+5,"pair:dfafbTiOxSurf");
memory->create(fafbOxOxBB,kmax+5,"pair:fafbOxOxBB");
memory->create(dfafbOxOxBB,kmax+5,"pair:dfafbOxOxBB");
memory->create(fafbTiOxBB,kmax+5,"pair:fafbTiOxB");
memory->create(dfafbTiOxBB,kmax+5,"pair:dfafbTiOxBB");
memory->create(ecov,nmax,"pair:ecov");
memory->create(potmad,nmax,"pair:potmad");
memory->create(potself,nmax,"pair:potself");
memory->create(potcov,nmax,"pair:potcov");
memory->create(sbcov,nmax,"pair:sbcov");
memory->create(coord,nmax,"pair:coord");
memory->create(sbmet,nmax,"pair:sbmet");
memory->create(chimet,nmax,"pair:chimet");
// memory->create(nvsm,nmax,"pair:nvsm");
// memory->create(vsm,nmax,nmax,"pair:vsm");
memory->create(flag_QEq,nmax,"pair:flag_QEq");
memory->create(qf,nmax,"pair:qf");
memory->create(q1,nmax,"pair:q1");
memory->create(q2,nmax,"pair:q2");
memory->create(tab_comm,nmax,"pair:tab_comm");
memory->create(fct,31,"pair:fct");
// set interaction number: 0-0=0, 1-1=1, 0-1=1-0=2
m = 0; k = n;
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
if (j == i) {
coultype[i][j] = m;
m += 1;
} else if (j != i && j > i) {
coultype[i][j] = k;
k += 1;
} else if (j != i && j < i) {
coultype[i][j] = coultype[j][i];
}
if (verbose) printf ("i %d, j %d, coultype %d\n",i,j,coultype[i][j]);
}
}
// -------- Tabqn --------
// -------------------
// Ouverture du fichier
// ofstream fichier("tabqeq.txt", ios::out | ios::trunc) ;
// -------------------
double pi,mu;
pi = 4.0*atan(1.0);
mu = erfc(alf*rc)/rc ;
//if (fichier) fichier <<" r - potqn " <<endl ;
//-------------------------
for (k=0; k < kmax+5; k++)
//-------------------------
{
s = static_cast<double>(k)*ds ; r = sqrt(s);
if (k==0) r=10e-30;
potqn[k] = 14.4*(erfc(alf*r)/r - mu) ;
// $$$ Here is (1/r)*dE/dr
dpotqn[k] = -14.4*( (erfc(alf*r)/(r*r) + 2.0*alf/sqrt(pi)/r*exp(-alf*alf*r*r))/r ) ;
}
Vself = -14.4*(alf/sqrt(pi) + mu*0.5) ;
// --------------------
// default arrays to zero
for (i = 0; i < kmax+5; i ++) {
for (j = 0; j < nntype; j ++) {
fafb[i][j] = 0.0;
dfafb[i][j] = 0.0;
}
fafbOxOxSurf[i] = 0.0;
fafbTiOxSurf[i] = 0.0;
dfafbOxOxSurf[i] = 0.0;
dfafbTiOxSurf[i] = 0.0;
fafbOxOxBB[i] = 0.0;
fafbTiOxBB[i] = 0.0;
dfafbOxOxBB[i] = 0.0;
dfafbTiOxBB[i] = 0.0;
}
// Set Tabqeq
double dij,ddij;
// -------------------
// Ouverture du fichier
//ofstream fichier("dtabqeq.txt", ios::out | ios::trunc) ;
// -------------------
//if (fichier) fichier <<" k , r , fafb , dfafb , dfafb2 , dgam , d(1/r) , dpotqn" <<endl ;
rcoupe = cutmax ;
double cang ;
for (i = 0; i < n ; i++){
for (j = i; j < n ; j++){
rc = cutmax; if (verbose) printf ("cutmax %f\n",cutmax);
m = coultype[i][j] ;
na = params[i].ne ;
nb = params[j].ne ;
za = params[i].dzeta ;
zb = params[j].dzeta ;
ra = params[i].R;
rb = params[j].R;
ii = 0 ; nang =cang= 5.0 ;
// --------------------------
for (k = 0; k < kmax+5; k++)
// --------------------------
{
gam = dgam = dza = dzb = d2zaa = d2zab =
d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ;
dij = 0.0 ;
s = static_cast<double>(k)*ds ; r = sqrt(s) ;
if (k==0) r=10e-30;
gammas(na,nb,za,zb,r,gam,dgam,dza,dzb,
d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ;
// --- Jij
dij = 14.4 * (1.0/r - static_cast<double>(gam));
ddij = 14.4 * (-1.0/(r*r) - static_cast<double>(dgam)) ;
// Cutting Fonction
if (dij < 0.01 && ii==0)
{
ii=2;
if (ii==2) if (verbose) printf ("rc : %f\n",r);
rc = r ; ii=1 ;
if ((rc+nang)>rcoupe) nang = rcoupe - rc ;
bCoeff = (2*dij+ddij*nang)/(dij*nang);
aCoeff = dij*exp(-bCoeff*rc) /square(nang);
}
if (r > rc) {dij = aCoeff *square(r- rc-nang) *exp(bCoeff*r);
ddij = aCoeff*(r- rc-nang) *(2+bCoeff*(r-rc-nang))*exp(bCoeff*r);
}
if (r > (rc+nang)) {dij = 0.0 ; ddij = 0.0;}
fafb[k][m] = potqn[k] - dij ;
if (k == 1) fafb[0][m] = fafb[k][m] ;
dfafb[k][m] = dpotqn[k] - ddij/r ;
}
// Make the table fafbOxOxSurf
rc = cutmax;
if(strcmp(params[i].nom,"O")==0 || strcmp(params[j].nom,"O")==0){
if(strcmp(params[i].nom,"O")==0) {
ra = ROxSurf;
za = (2.0*params[i].ne + 1.0)/(4.0*ra);}
if(strcmp(params[j].nom,"O")==0) {
rb = ROxSurf;
zb = (2.0*params[j].ne + 1.0)/(4.0*rb); }
ii = 0 ; nang =cang= 5.0 ;
// --------------------------
for (k = 0; k < kmax+5; k++)
// --------------------------
{
gam = dgam = dza = dzb = d2zaa = d2zab =
d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ;
dij = 0.0 ;
s = static_cast<double>(k)*ds ; r = sqrt(s) ;
if (k==0) r=10e-30;
gammas(na,nb,za,zb,r,gam,dgam,dza,dzb,
d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ;
// --- Jij
dij = 14.4 * (1.0/r - static_cast<double>(gam));
ddij = 14.4 * (-1.0/(r*r) - static_cast<double>(dgam)) ;
if (dij < 0.01 && ii==0)
{
ii=2;
if (ii==2) if (verbose) printf ("rc : %f\n",r);
rc = r ; ii=1 ;
if ((rc+nang)>rcoupe) nang = rcoupe - rc ;
bCoeff = (2*dij+ddij*nang)/(dij*nang);
aCoeff = dij*exp(-bCoeff*rc) /square(nang);
}
if (r > rc) {dij = aCoeff *square(r- rc-nang) *exp(bCoeff*r);
ddij = aCoeff*(r- rc-nang) *(2+bCoeff*(r-rc-nang))*exp(bCoeff*r);
}
if (r > (rc+nang)) {dij = 0.0 ; ddij = 0.0;}
if(strcmp(params[i].nom,"O")==0 && strcmp(params[j].nom,"O")==0){
fafbOxOxSurf[k] = potqn[k] - dij ;
if (k == 1) fafbOxOxSurf[0] = fafbOxOxSurf[k] ;
dfafbOxOxSurf[k] = dpotqn[k] - ddij/r ;
}
else { fafbTiOxSurf[k] = potqn[k] - dij ;
if (k == 1) fafbTiOxSurf[0] = fafbTiOxSurf[k] ;
dfafbTiOxSurf[k] = dpotqn[k] - ddij/r ;}
}
} //for k
//end of make the table fafbOxOxSurf
// Makes the table fafbOxOxBB
rc = cutmax;
if(strcmp(params[i].nom,"O")==0 || strcmp(params[j].nom,"O")==0){
if(strcmp(params[i].nom,"O")==0) {
ra = ROxBB;
za = (2.0*params[i].ne + 1.0)/(4.0*ra);}
if(strcmp(params[j].nom,"O")==0) {
rb = ROxBB;
zb = (2.0*params[j].ne + 1.0)/(4.0*rb); }
ii = 0 ; nang =cang= 5.0 ;
// --------------------------
for (k = 0; k < kmax+5; k++)
// --------------------------
{
gam = dgam = dza = dzb = d2zaa = d2zab =
d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ;
dij = 0.0 ;
s = static_cast<double>(k)*ds ; r = sqrt(s) ;
if (k==0) r=10e-30;
gammas(na,nb,za,zb,r,gam,dgam,dza,dzb,
d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ;
// --- Jij
dij = 14.4 * (1.0/r - static_cast<double>(gam));
ddij = 14.4 * (-1.0/(r*r) - static_cast<double>(dgam)) ;
if (dij < 0.01 && ii==0) {
ii=2;
if (ii==2) if (verbose) printf ("rc : %f\n",r);
rc = r ; ii=1 ;
if ((rc+nang)>rcoupe) nang = rcoupe - rc ;
bCoeff = (2*dij+ddij*nang)/(dij*nang);
aCoeff = dij*exp(-bCoeff*rc) /square(nang);
}
if (r > rc) {
dij = aCoeff *square(r- rc-nang) *exp(bCoeff*r);
ddij = aCoeff*(r- rc-nang) *(2+bCoeff*(r-rc-nang))*exp(bCoeff*r);
}
if (r > (rc+nang)) {dij = 0.0 ; ddij = 0.0;}
if(strcmp(params[i].nom,"O")==0 && strcmp(params[j].nom,"O")==0){
fafbOxOxBB[k] = potqn[k] - dij ;
if (k == 1) fafbOxOxBB[0] = fafbOxOxBB[k] ;
dfafbOxOxBB[k] = dpotqn[k] - ddij/r ; }
else { fafbTiOxBB[k] = potqn[k] - dij ;
if (k == 1) fafbTiOxBB[0] = fafbTiOxBB[k] ;
dfafbTiOxBB[k] = dpotqn[k] - ddij/r ;
}
}
} //for k
//end of make the table fafbOxOxBB
}
} //for i,j
//if (fichier) fichier.close() ;
}
/* ---------------------------------------------------------------------*/
void PairSMTBQ::potqeq(int i, int j, double qi, double qj, double rsq,
double &fforce, int eflag, double &eng)
{
/* ===================================================================
Coulombian energy calcul between i and j atoms
with fafb table make in sm_table().
fafb[i][j] : i is the table's step (r)
j is the interaction's # (in intype[itype][jtype])
dfafb is derivate energy (force)
==================================================================== */
int itype,jtype,l,m;
double r,t1,t2,sds,xi,engBulk,engSurf,fforceBulk,fforceSurf,dcoordloc,dcoupureloc;
double engBB,fforceBB, dIntfcoup2loc,iCoord,jCoord,iIntfCoup2,jIntfCoup2;
int *type = atom->type;
// int n = atom->ntypes;
itype = map[type[i]];
jtype = map[type[j]];
m = coultype[itype][jtype];
r = rsq;
sds = r/ds ; l = int(sds) ;
xi = sds - static_cast<double>(l) ;
iCoord=coord[i];
jCoord=coord[j];
iIntfCoup2= Intfcoup2(iCoord,coordOxBulk,0.15);
jIntfCoup2= Intfcoup2(jCoord,coordOxBulk,0.15);
// ---- Energies Interpolation
t1 = fafb[l][m] + (fafb[l+1][m] - fafb[l][m])*xi;
t2 = fafb[l+1][m] + (fafb[l+2][m] - fafb[l+1][m])*(xi-1.0);
engBulk = qi*qj*(t1 + (t2 - t1)*xi/2.0);
eng=engBulk;
// ---- Forces Interpolation
t1 = dfafb[l][m] + (dfafb[l+1][m] - dfafb[l][m])*xi;
t2 = dfafb[l+1][m] + (dfafb[l+2][m] - dfafb[l+1][m])*(xi-1);
fforce = - qi*qj*(t1 + (t2 - t1)*xi/2.0) ;
if(strcmp(params[itype].nom,"O")==0 || strcmp(params[jtype].nom,"O")==0){
if(strcmp(params[itype].nom,"O")==0 && strcmp(params[jtype].nom,"O")==0){
// between two oxygens
t1 = fafbOxOxSurf[l] + (fafbOxOxSurf[l+1] - fafbOxOxSurf[l])*xi;
t2 = fafbOxOxSurf[l+1] + (fafbOxOxSurf[l+2] - fafbOxOxSurf[l+1])*(xi-1.0);
engSurf = qi*qj*(t1 + (t2 - t1)*xi/2.0);
t1 = fafbOxOxBB[l] + (fafbOxOxBB[l+1] - fafbOxOxBB[l])*xi;
t2 = fafbOxOxBB[l+1] + (fafbOxOxBB[l+2] - fafbOxOxBB[l+1])*(xi-1.0);
engBB = qi*qj*(t1 + (t2 - t1)*xi/2.0);
eng= engBulk + (iCoord+jCoord-2*coordOxBulk)/(2*(coordOxBB-coordOxBulk)) *(engBB-engBulk)
+ (iIntfCoup2+jIntfCoup2)*((engBulk-engSurf)/(2*(coordOxBulk-coordOxSurf))
- (engBB-engBulk)/(2*(coordOxBB-coordOxBulk))) ;
// ---- Interpolation des forces
fforceBulk=fforce;
t1 = dfafbOxOxSurf[l] + (dfafbOxOxSurf[l+1] - dfafbOxOxSurf[l])*xi;
t2 = dfafbOxOxSurf[l+1] + (dfafbOxOxSurf[l+2] - dfafbOxOxSurf[l+1])*(xi-1);
fforceSurf = - qi*qj*(t1 + (t2 - t1)*xi/2.0) ;
t1 = dfafbOxOxBB[l] + (dfafbOxOxBB[l+1] - dfafbOxOxBB[l])*xi;
t2 = dfafbOxOxBB[l+1] + (dfafbOxOxBB[l+2] - dfafbOxOxBB[l+1])*(xi-1);
fforceBB = - qi*qj*(t1 + (t2 - t1)*xi/2.0) ;
fforce= fforceBulk + (iCoord+jCoord-2*coordOxBulk)/(2*(coordOxBB-coordOxBulk))*(fforceBB-fforceBulk)
+ (iIntfCoup2+jIntfCoup2)*((fforceBulk-fforceSurf)/(2*(coordOxBulk-coordOxSurf))
- (fforceBB-fforceBulk)/(2*(coordOxBB-coordOxBulk))) ;
} else { // between metal and oxygen
t1 = fafbTiOxSurf[l] + (fafbTiOxSurf[l+1] - fafbTiOxSurf[l])*xi;
t2 = fafbTiOxSurf[l+1] + (fafbTiOxSurf[l+2] - fafbTiOxSurf[l+1])*(xi-1.0);
engSurf = qi*qj*(t1 + (t2 - t1)*xi/2.0);
t1 = fafbTiOxBB[l] + (fafbTiOxBB[l+1] - fafbTiOxBB[l])*xi;
t2 = fafbTiOxBB[l+1] + (fafbTiOxBB[l+2] - fafbTiOxBB[l+1])*(xi-1.0);
engBB = qi*qj*(t1 + (t2 - t1)*xi/2.0);
if(strcmp(params[jtype].nom,"O")==0) //the atom j is an oxygen
{ iIntfCoup2=jIntfCoup2;
iCoord=jCoord; }
eng = engBulk + (engBulk-engSurf)/(coordOxBulk-coordOxSurf) * iIntfCoup2
+ (engBB-engBulk)/(coordOxBB-coordOxBulk) * (iCoord-coordOxBulk-iIntfCoup2);
// ---- Forces Interpolation
fforceBulk=fforce;
t1 = dfafbTiOxSurf[l] + (dfafbTiOxSurf[l+1] - dfafbTiOxSurf[l])*xi;
t2 = dfafbTiOxSurf[l+1] + (dfafbTiOxSurf[l+2] - dfafbTiOxSurf[l+1])*(xi-1);
fforceSurf = - qi*qj*(t1 + (t2 - t1)*xi/2.0) ;
t1 = dfafbTiOxBB[l] + (dfafbTiOxBB[l+1] - dfafbTiOxBB[l])*xi;
t2 = dfafbTiOxBB[l+1] + (dfafbTiOxBB[l+2] - dfafbTiOxBB[l+1])*(xi-1);
fforceBB = - qi*qj*(t1 + (t2 - t1)*xi/2.0) ;
dcoordloc = fcoupured(sqrt(r),r1Coord,r2Coord) ;
dcoupureloc = fcoupured(iCoord,coordOxSurf,coordOxBulk) ;
dIntfcoup2loc= fcoup2(iCoord,coordOxBulk,0.15)*dcoupureloc ;
fforce = fforceBulk + 1/(coordOxBulk-coordOxSurf) * ((fforceBulk-fforceSurf)* iIntfCoup2
- (engBulk-engSurf) *dIntfcoup2loc)
+ 1/(coordOxBB-coordOxBulk) * ((fforceBB-fforceBulk)*(iCoord-coordOxBulk- iIntfCoup2)
- (engBB-engBulk) *(dcoordloc-dIntfcoup2loc));
}
}
}
/* -------------------------------------------------------------------- */
void PairSMTBQ::pot_ES (int i, int j, double rsq, double &eng)
{
/* ===================================================================
Coulombian potentiel energy calcul between i and j atoms
with fafb table make in sm_table().
fafb[i][j] : i is the table's step (r)
j is the interaction's # (in intype[itype][jtype])
dfafb is derivate energy (force)
==================================================================== */
int itype,jtype,l,m;
double r,t1,t2,sds,xi,engBulk,engSurf;
double engBB,iCoord,jCoord,iIntfCoup2,jIntfCoup2;
int *type = atom->type;
// int n = atom->ntypes;
itype = map[type[i]];
jtype = map[type[j]];
m = coultype[itype][jtype];
r = rsq;
sds = r/ds ; l = int(sds) ;
xi = sds - static_cast<double>(l) ;
iCoord=coord[i];
jCoord=coord[j];
iIntfCoup2= Intfcoup2(iCoord,coordOxBulk,0.15);
jIntfCoup2= Intfcoup2(jCoord,coordOxBulk,0.15);
// ---- Energies Interpolation
t1 = fafb[l][m] + (fafb[l+1][m] - fafb[l][m])*xi;
t2 = fafb[l+1][m] + (fafb[l+2][m] - fafb[l+1][m])*(xi-1.0);
eng = (t1 + (t2 - t1)*xi/2.0);
engBulk=eng;
if(itype==0 || jtype==0){
if(itype==0 && jtype==0){ // between two oxygens
t1 = fafbOxOxSurf[l] + (fafbOxOxSurf[l+1] - fafbOxOxSurf[l])*xi;
t2 = fafbOxOxSurf[l+1] + (fafbOxOxSurf[l+2] - fafbOxOxSurf[l+1])*(xi-1.0);
engSurf = (t1 + (t2 - t1)*xi/2.0);
t1 = fafbOxOxBB[l] + (fafbOxOxBB[l+1] - fafbOxOxBB[l])*xi;
t2 = fafbOxOxBB[l+1] + (fafbOxOxBB[l+2] - fafbOxOxBB[l+1])*(xi-1.0);
engBB = (t1 + (t2 - t1)*xi/2.0);
eng= engBulk + (iCoord+jCoord-2*coordOxBulk)/(2*(coordOxBB-coordOxBulk))*(engBB-engBulk)
+ (iIntfCoup2+jIntfCoup2)*((engBulk-engSurf)/(2*(coordOxBulk-coordOxSurf))
- (engBB-engBulk)/(2*(coordOxBB-coordOxBulk))) ;
} else { // between metal and oxygen
t1 = fafbTiOxSurf[l] + (fafbTiOxSurf[l+1] - fafbTiOxSurf[l])*xi;
t2 = fafbTiOxSurf[l+1] + (fafbTiOxSurf[l+2] - fafbTiOxSurf[l+1])*(xi-1.0);
engSurf = (t1 + (t2 - t1)*xi/2.0);
t1 = fafbTiOxBB[l] + (fafbTiOxBB[l+1] - fafbTiOxBB[l])*xi;
t2 = fafbTiOxBB[l+1] + (fafbTiOxBB[l+2] - fafbTiOxBB[l+1])*(xi-1.0);
engBB = (t1 + (t2 - t1)*xi/2.0);
if (jtype==0) { //the atom j is an oxygen
iIntfCoup2=jIntfCoup2;
iCoord=jCoord;
}
eng = engBulk + (engBulk-engSurf)/(coordOxBulk-coordOxSurf)*iIntfCoup2
+ (engBB-engBulk)/(coordOxBB-coordOxBulk) * (iCoord-coordOxBulk-iIntfCoup2);
}
}
}
/* -------------------------------------------------------------------- */
void PairSMTBQ::pot_ES2 (int i, int j, double rsq, double &pot)
{
int l,m,itype,jtype;
double sds,xi,t1,t2,r;
int *type = atom->type;
if (sqrt(rsq) > cutmax) return ;
itype = map[type[i]];
jtype = map[type[j]];
m = coultype[itype][jtype];
r = rsq ;
sds = r/ds ; l = int(sds) ;
xi = sds - static_cast<double>(l) ;
// ---- Energies Interpolation
t1 = fafb[l][m] + (fafb[l+1][m] - fafb[l][m])*xi;
t2 = fafb[l+1][m] + (fafb[l+2][m] - fafb[l+1][m])*(xi-1.0);
pot = (t1 + (t2 - t1)*xi/2.0) ;
}
/* --------------------------------------------------------------------
Oxygen-Oxygen Interaction
-------------------------------------------------------------------- */
void PairSMTBQ::rep_OO(Intparam *intparam, double rsq, double &fforce,
int eflag, double &eng)
{
double r,tmp_exp,tmp;
double A = intparam->abuck ;
double rho = intparam->rhobuck ;
r = sqrt(rsq);
tmp = - r/rho ;
tmp_exp = exp( tmp );
eng = A * tmp_exp ;
fforce = A/rho * tmp_exp / r ; //( - )
}
void PairSMTBQ::Attr_OO(Intparam *intparam, double rsq, double &fforce,
int eflag, double &eng)
{
double r,tmp_exp;
double aOO = intparam->aOO ;
double bOO = intparam->bOO ;
double r1OO = intparam->r1OO ;
double r2OO = intparam->r2OO ;
r = sqrt(rsq);
tmp_exp= exp( bOO* r);
eng = aOO * tmp_exp* fcoupure(r,r1OO,r2OO);
fforce = - (aOO*bOO * tmp_exp * fcoupure(r,r1OO,r2OO)+ aOO*tmp_exp *fcoupured(r,r1OO,r2OO))/ r ; //( - )
}
/* ----------------------------------------------------------------------
covalente Interaction
----------------------------------------------------------------------*/
void PairSMTBQ::tabsm()
{
int k,m;
double s,r,tmpb,tmpr,fcv,fcdv;
memory->create(tabsmb,kmax,maxintsm+1,"pair:tabsmb");
memory->create(tabsmr,kmax,maxintsm+1,"pair:tabsmr");
memory->create(dtabsmb,kmax,maxintsm+1,"pair:dtabsmb");
memory->create(dtabsmr,kmax,maxintsm+1,"pair:dtabsmr");
for (m = 0; m <= maxintparam; m++) {
if (intparams[m].intsm == 0) continue;
double rc1 = intparams[m].dc1;
double rc2 = intparams[m].dc2;
double A = intparams[m].a;
double p = intparams[m].p;
double Ksi = intparams[m].ksi;
double q = intparams[m].q;
double rzero = intparams[m].r0;
int sm = intparams[m].intsm;
for (k=0; k < kmax; k++)
{
s = static_cast<double>(k)*ds ; r = sqrt(s);
if (k==0) r=10e-30;
tmpb = exp( -2.0*q*(r/rzero - 1.0));
tmpr = exp( -p*(r/rzero - 1.0));
if (r <= rc1)
{
// -- Energy
tabsmb[k][sm] = Ksi*Ksi * tmpb ;
tabsmr[k][sm] = A * tmpr ;
// -- Force
/* dtabsmb ne correspond pas vraiment a une force puisqu'il y a le /r
(on a donc une unite force/distance). Le programme multiplie ensuite
(dans le PairSMTBQ::compute ) dtabsmb par la projection du vecteur r
sur un axe x (ou y ou z) pour determiner la composante de la force selon
cette direction. Donc tout est ok au final. */
dtabsmb[k][sm] = - 2.0 *Ksi*Ksi* q/rzero * tmpb /r;
dtabsmr[k][sm] = - A * p/rzero * tmpr/r ;
} // if
else if (r > rc1 && r <= rc2)
{
// -- Energie
fcv = fcoupure(r,intparams[sm].dc1,intparams[sm].dc2);
tabsmb[k][sm] = fcv* Ksi*Ksi * tmpb ;
tabsmr[k][sm] = fcv* A * tmpr ;
// -- Force
/* dtabsmb ne correspond pas vraiment a une force puisqu'il y a le /r
(on a donc une unite force/distance). Le programme multiplie ensuite
(dans le PairSMTBQ::compute ) d tabsmb par la projection du vecteur
r sur un axe x (ou y ou z) pour determiner la composante de la force
selon cette direction. Donc tout est ok au final. */
fcdv = fcoupured(r,intparams[sm].dc1,intparams[sm].dc2);
dtabsmb[k][sm] = (fcv*( - 2.0 *Ksi*Ksi* q/rzero * tmpb )+fcdv* Ksi*Ksi * tmpb )/r ;
dtabsmr[k][sm] = (fcv*( - A * p/rzero * tmpr )+fcdv*A * tmpr )/r ;
}
else
{
// -- Energie
tabsmb[k][sm] = 0.0;
tabsmr[k][sm] = 0.0;
// -- Force
dtabsmb[k][sm] = 0.0;
dtabsmr[k][sm] = 0.0;
}
} // for kmax
} // for maxintparam
}
/* -------------------------------------------------------------- */
void PairSMTBQ::repulsive(Intparam *intparam, double rsq, int i, int j,
double &fforce, int eflag, double &eng)
{
/* ================================================
rsq : square of ij distance
fforce : repulsion force
eng : repulsion energy
eflag : Si oui ou non on calcule l'energie
=================================================*/
int l;
double r,sds,xi,t1,t2,dt1,dt2,sweet;
double rrcs = intparam->dc2;
int sm = intparam->intsm;
// printf ("On rentre dans repulsive\n");
r = rsq;
if (sqrt(r) > rrcs) return ;
sds = r/ds ; l = int(sds) ;
xi = sds - static_cast<double>(l) ;
t1 = tabsmr[l][sm] + (tabsmr[l+1][sm] - tabsmr[l][sm])*xi ;
t2 = tabsmr[l+1][sm] + (tabsmr[l+2][sm] - tabsmr[l+1][sm])*(xi-1.0) ;
dt1 = dtabsmr[l][sm] + (dtabsmr[l+1][sm] - dtabsmr[l][sm])*xi ;
dt2 = dtabsmr[l+1][sm] + (dtabsmr[l+2][sm] - dtabsmr[l+1][sm])*(xi-1.0) ;
if (strcmp(intparam->mode,"oxide") == 0)
{
fforce = - 2.0*(dt1 + (dt2 - dt1)*xi/2.0);
eng = (t1 + (t2 - t1)*xi/2.0) ;
}
else if (strcmp(intparam->mode,"metal") == 0)
{
sweet = 1.0;
fforce = - 2.0*(dt1 + (dt2 - dt1)*xi/2.0) * sweet ;
eng = (t1 + (t2 - t1)*xi/2.0) * sweet ;
}
}
/* --------------------------------------------------------------------------------- */
void PairSMTBQ::attractive(Intparam *intparam, double rsq,
int eflag, int i, double iq, int j, double jq)
{
int itype,l;
double r,t1,t2,xi,sds;
double sweet,mu;
double rrcs = intparam->dc2;
int *type = atom->type;
int sm = intparam->intsm;
itype = map[type[i]];
r = rsq;
if (sqrt(r) > rrcs) return ;
sds = r/ds ; l = int(sds) ;
xi = sds - static_cast<double>(l) ;
t1 = tabsmb[l][sm] + (tabsmb[l+1][sm] - tabsmb[l][sm])*xi ;
t2 = tabsmb[l+1][sm] + (tabsmb[l+2][sm] - tabsmb[l+1][sm])*(xi-1.0) ;
if (strcmp(intparam->mode,"oxide") == 0) {
mu = 0.5*(sqrt(params[1].sto) + sqrt(params[0].sto));
// dq = fabs(params[itype].qform) - fabs(iq);
// dqcov = dq*(2.0*ncov/params[itype].sto - dq);
sbcov[i] += (t1 + (t2 - t1)*xi/2.0) *params[itype].sto*mu*mu;
// if (i < 10) printf ("i %d, iq %f sbcov %f \n",i,iq,sbcov[i]);
if (sqrt(r)<r1Coord) { coord[i] += 1 ; }
else if (sqrt(r)<r2Coord){ coord[i] += fcoupure(sqrt(r),r1Coord,r2Coord) ;}
}
else if (strcmp(intparam->mode,"metal") == 0) {
sweet = 1.0;
sbmet[i] += (t1 + (t2 - t1)*xi/2.0) * sweet ;
}
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::f_att(Intparam *intparam, int i, int j,double rsq, double &fforce)
{
int itype,jtype,l;
int *type = atom->type;
double r,sds,xi,dt1,dt2,dq,dqcovi,dqcovj;
double fcov_ij,fcov_ji,sweet,iq,jq,mu;
int sm = intparam->intsm;
double *q = atom->q;
itype = map[type[i]];
jtype = map[type[j]];
iq = q[i] ; jq = q[j];
r = rsq;
sds = r/ds ; l = int(sds) ;
xi = sds - static_cast<double>(l) ;
dt1 = dtabsmb[l][sm] + (dtabsmb[l+1][sm] - dtabsmb[l][sm])*xi ;
dt2 = dtabsmb[l+1][sm] + (dtabsmb[l+2][sm] - dtabsmb[l+1][sm])*(xi-1.0) ;
dq = fabs(params[itype].qform) - fabs(iq);
dqcovi = dq*(2.0*ncov/params[itype].sto - dq);
dq = fabs(params[jtype].qform) - fabs(jq);
dqcovj = dq*(2.0*ncov/params[jtype].sto - dq);
if (strcmp(intparam->mode,"oxide") == 0) {
//------------------------------------------
mu = 0.5*(sqrt(params[1].sto) + sqrt(params[0].sto));
fcov_ij = (dt1 + (dt2 - dt1)*xi/2.0) * dqcovi *params[itype].sto*mu*mu;
fcov_ji = (dt1 + (dt2 - dt1)*xi/2.0) * dqcovj *params[jtype].sto*mu*mu;
fforce = 0.5 * ( fcov_ij/sqrt(sbcov[i]*dqcovi + sbmet[i])
+ fcov_ji/sqrt(sbcov[j]*dqcovj + sbmet[j]) ) ;
}
else if (strcmp(intparam->mode,"metal") == 0) {
//-----------------------------------------------
sweet = 1.0;
fcov_ij = (dt1 + (dt2 - dt1)*xi/2.0) * sweet ;
fforce = 0.5 * fcov_ij*( 1.0/sqrt(sbcov[i]*dqcovi + sbmet[i])
+ 1.0/sqrt(sbcov[j]*dqcovj + sbmet[j]) ) ;
}
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::pot_COV(Param *param, int i, double &qforce)
{
double iq,dq,DQ,sign;
double *q = atom->q;
double qform = param->qform;
double sto = param->sto;
sign = qform / fabs(qform);
iq = q[i];
dq = fabs(qform) - fabs(iq);
DQ = dq*(2.0*ncov/sto - dq);
if (fabs(iq) < 1.0e-7 || fabs(sbcov[i]) < 1.0e-7) {
qforce = 0.0; }
else {
qforce = sign*sbcov[i]/sqrt(sbcov[i]*DQ + sbmet[i])*(ncov/sto - dq) ;
}
}
/* ---------------------------------------------------------------------- */
double PairSMTBQ::potmet(Intparam *intparam, double rsq,
int i, double iq, int j, double jq)
{
int l,itype,jtype;
int *type = atom->type;
double chi,sds,xi,t1,t2,r,dsweet,dq,dqcovi,dqcovj;
int sm = intparam->intsm;
itype = map[type[i]];
jtype = map[type[j]];
r = rsq;
sds = r/ds ; l = int(sds) ;
xi = sds - static_cast<double>(l) ;
t1 = tabsmb[l][sm] + (tabsmb[l+1][sm] - tabsmb[l][sm])*xi ;
t2 = tabsmb[l+1][sm] + (tabsmb[l+2][sm] - tabsmb[l+1][sm])*(xi-1.0) ;
dq = fabs(params[itype].qform) - fabs(iq);
dqcovi = dq*(2.0*ncov/params[itype].sto - dq);
dq = fabs(params[jtype].qform) - fabs(jq);
dqcovj = dq*(2.0*ncov/params[jtype].sto - dq);
dsweet = 0.0;
chi = (t1 + (t2 - t1)*xi/2.0) * dsweet *( 1.0/(2.0*sqrt(sbcov[i]*dqcovi+sbmet[i]))
+ 1.0/(2.0*sqrt(sbcov[j]*dqcovj+sbmet[j])) );
return chi;
}
/* ----------------------------------------------------------------------
Cutting Function
----------------------------------------------------------------------*/
/* -------------------------------------------------------------------- */
double PairSMTBQ::fcoupure(double r, double rep_dc1, double rep_dc2)
{
double ddc,a3,a4,a5,x;
if (r<rep_dc1)
{return 1;}
else if (r> rep_dc2)
{return 0;}
else
{
ddc = rep_dc2 - rep_dc1;
x = r - rep_dc2;
a3 = -10/(ddc*ddc*ddc);
a4 = -15/(ddc*ddc*ddc*ddc);
a5 = -6/(ddc*ddc*ddc*ddc*ddc);
return x*x*x*(a3 + x*(a4 + x*a5));}
}
/* ----------------------------------------------------------------------
Derivate of cutting function
----------------------------------------------------------------------*/
/* ----------------------------------------------------------------------- */
double PairSMTBQ::fcoupured(double r, double rep_dc1, double rep_dc2)
{
double ddc,a3,a4,a5,x;
if ( r>rep_dc1 && r<rep_dc2) {
ddc = rep_dc2 - rep_dc1;
x = r - rep_dc2;
a3 = -10/(ddc*ddc*ddc);
a4 = -15/(ddc*ddc*ddc*ddc);
a5 = -6/(ddc*ddc*ddc*ddc*ddc);
return x*x*(3*a3 + x*(4*a4 + 5*x*a5));}
else {return 0;}
}
/* ----------------------------------------------------------------------
cutting function for derive (force)
----------------------------------------------------------------------*/
/* -------------------------------------------------------------------- */
double PairSMTBQ::fcoup2(double c, double x, double delta)
{
double dc;
if (c<x-delta)
{return 1;}
else if (c> x+delta)
{return 0;}
else
{
dc = c - x-delta;
return dc*dc*(3*delta+dc)/(4*delta*delta*delta);
}
}
/* ----------------------------------------------------------------------
Primitive of cutting function for derive (force)
----------------------------------------------------------------------*/
/* -------------------------------------------------------------------- */
double PairSMTBQ::Primfcoup2(double c, double x, double delta)
{
return (c*(c*c*c - 4* c*c* x - 4* (x - 2 *delta) * (x+delta)*(x+delta) +
6* c *(x*x - delta*delta)))/(16* delta*delta*delta);
}
/* ----------------------------------------------------------------------
Integral of cutting function for derive (force) between x and c
----------------------------------------------------------------------*/
/* -------------------------------------------------------------------- */
double PairSMTBQ::Intfcoup2(double c, double x, double delta)
{
if (c<x-delta)
{return c - x + delta + Primfcoup2(x-delta,x,delta) - Primfcoup2(x,x,delta) ;}
else if (c> x+delta)
{return Primfcoup2(x+delta,x,delta) - Primfcoup2(x,x,delta) ;}
else
{
return Primfcoup2(c,x,delta) - Primfcoup2(x,x,delta) ;}
}
/* ---------------------------------------------------------------------
Energy derivation respect charge Q
--------------------------------------------------------------------- */
void PairSMTBQ::QForce_charge(int loop)
{
int i,j,ii,jj,jnum;
int itype,jtype,m,gp;
double xtmp,ytmp,ztmp;
double rsq;
int *ilist,*jlist,*numneigh,**firstneigh;
double iq,jq,fqi,fqj,fqij,fqij2,fqjj;
int eflag;
double **x = atom->x;
double *q = atom->q;
int *type = atom->type;
int step = update->ntimestep;
int inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
// loop over full neighbor list of my atoms
fqi = fqj = fqij = fqij2 = fqjj = 0.0;
// ==================
if (loop == 0) {
// ==================
memset(sbcov,0,sizeof(double)*atom->nmax);
memset(coord,0,sizeof(double)*atom->nmax);
memset(sbmet,0,sizeof(double)*atom->nmax);
for (ii = 0; ii < inum; ii ++) {
//--------------------------------
i = ilist[ii];
itype = map[type[i]];
gp = flag_QEq[i];
itype = map[type[i]];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
iq = q[i];
// two-body interactions
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
// -------------------------------
j = jlist[jj];
j &= NEIGHMASK;
jtype = map[type[j]];
jq = q[j];
m = intype[itype][jtype];
if (intparams[m].intsm == 0) continue ;
const double delx = x[j][0] - xtmp;
const double dely = x[j][1] - ytmp;
const double delz = x[j][2] - ztmp;
rsq = delx*delx + dely*dely + delz*delz;
// Covalente charge forces - sbcov initialization
// ------------------------------------------------
if (sqrt(rsq) > intparams[m].dc2) continue;
attractive (&intparams[m],rsq,eflag,i,iq,j,jq);
} // ---------------------------------------------- for jj
} // -------------------------------------------- ii
// ===============================================
// Communicates the tables *sbcov and *sbmet
// to calculate the N-body forces
// ================================================
- forward (sbcov) ; reverse (sbcov);
- forward (coord) ; reverse (coord);
- forward (sbmet) ; reverse (sbmet);
+ forward (sbcov) ; // reverse (sbcov);
+ forward (coord) ; // reverse (coord);
+ forward (sbmet) ; // reverse (sbmet);
if (nteam == 0) return; //no oxide
if (Qstep == 0 || (step % Qstep != 0)) return;
// =======================
} // End of If(loop)
// =======================
// ===============================================
for (ii=0; ii<inum; ii++)
{
i = ilist[ii]; itype = map[type[i]];
gp = flag_QEq[i]; iq = q[i];
potmad[i] = potself[i] = potcov[i] = 0.0 ;
if (gp == 0) continue;
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
fqi = 0.0 ;
// Madelung potential
// --------------------
potmad[i] += 2.0*Vself*iq ;
// charge force from self energy
// -----------------------------
fqi = qfo_self(&params[itype],iq);
potself[i] = fqi ;
// Loop on Second moment neighbor
// -------------------------------
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++)
{
j = jlist[jj];
j &= NEIGHMASK;
jtype = map[type[j]];
m = intype[itype][jtype];
jq = q[j];
const double delx = x[j][0] - xtmp;
const double dely = x[j][1] - ytmp;
const double delz = x[j][2] - ztmp;
rsq = delx*delx + dely*dely + delz*delz;
// long range q-dependent
if (sqrt(rsq) > cutmax) continue;
// 1/r charge forces
// --------------------
fqij = 0.0;
// pot_ES2 (i,j,rsq,fqij2);
pot_ES (i,j,rsq,fqij);
potmad[i] += jq*fqij ;
} // ------ jj
fqi = 0.0;
pot_COV (&params[itype],i,fqi) ;
potcov[i] = fqi ;
} // ------- ii
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::Charge()
{
int i,ii,iloop,itype,gp,m;
int *ilist;
double heatpq,qmass,dtq,dtq2,qtot,qtotll;
double t_init,t_end,dt;
double *Transf,*TransfAll;
double *q = atom->q;
double **x = atom->x;
int *type = atom->type;
int step = update->ntimestep;
int inum = list->inum;
ilist = list->ilist;
if (me == 0) t_init = MPI_Wtime();
if (step == 0) cluster = 0;
// ---------------------------
// Mise en place des groupes
// ---------------------------
if (strcmp(QEqMode,"BulkFromSlab") == 0)
groupBulkFromSlab_QEq();
else if (strcmp(QEqMode,"QEqAll") == 0)
groupQEqAll_QEq();
else if (strcmp(QEqMode,"QEqAllParallel") == 0)
groupQEqAllParallel_QEq();
else if (strcmp(QEqMode,"Surface") == 0)
groupSurface_QEq();
if (nteam+1 != cluster) {
memory->destroy(nQEqall);
memory->destroy(nQEqaall);
memory->destroy(nQEqcall);
cluster = nteam+1;
memory->create(nQEqall,nteam+1,"pair:nQEq");
memory->create(nQEqaall,nteam+1,"pair:nQEqa");
memory->create(nQEqcall,nteam+1,"pair:nQEqc");
}
// ---------------------------
double enegtotall[nteam+1],enegchkall[nteam+1],enegmaxall[nteam+1],qtota[nteam+1],qtotc[nteam+1];
double qtotcll[nteam+1],qtotall[nteam+1];
double sigmaa[nteam+1],sigmac[nteam+1],sigmaall[nteam+1],sigmacll[nteam+1];
int end[nteam+1], nQEq[nteam+1],nQEqc[nteam+1],nQEqa[nteam+1];
iloop = 0;
heatpq = 0.07;
qmass = 0.000548580;
dtq = 0.0006; // 0.0006
dtq2 = 0.5*dtq*dtq/qmass;
double enegchk[nteam+1];
double enegtot[nteam+1];
double enegmax[nteam+1];
for (i=0; i<nteam+1; i++) {
nQEq[i] = nQEqa[i] = nQEqc[i] = 0;
nQEqall[i] = nQEqcall[i] = nQEqaall[i] = end[i]= 0;
enegchk[i] = enegtot[i] = enegmax[i] = 0.0;
qtota[i] = qtotc[i] = qtotall[i] = qtotcll[i] = 0.0;
sigmaall[i] = sigmacll[i] = 0.0;
}
qtot = qtotll = 0.0 ;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii]; itype = map[type[i]];
gp = flag_QEq[i];
q1[i] = q2[i] = qf[i] = 0.0;
qtot += q[i] ;
nQEq[gp] += 1;
if (itype != 0) { qtotc[gp] += q[i]; nQEqc[gp] += 1; }
if (itype == 0) { qtota[gp] += q[i]; nQEqa[gp] += 1; }
}
MPI_Allreduce(nQEq,nQEqall,nteam+1,MPI_INT,MPI_SUM,world);
MPI_Allreduce(nQEqc,nQEqcall,nteam+1,MPI_INT,MPI_SUM,world);
MPI_Allreduce(nQEqa,nQEqaall,nteam+1,MPI_INT,MPI_SUM,world);
MPI_Allreduce(qtotc,qtotcll,nteam+1,MPI_DOUBLE,MPI_SUM,world);
MPI_Allreduce(qtota,qtotall,nteam+1,MPI_DOUBLE,MPI_SUM,world);
MPI_Allreduce(&qtot,&qtotll,1,MPI_DOUBLE,MPI_SUM,world);
// ---------------------------------
// Init_charge(nQEq,nQEqa,nQEqc);
// ---------------------------------
if (update->ntimestep == 0 && (strcmp(QInitMode,"true") == 0) ) {
//Carefull here it won't be fine if there are more than 2 species!!!
QOxInit=max(QOxInit, -0.98* params[1].qform *nQEqcall[gp]/nQEqaall[gp]) ;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii]; itype = map[type[i]];
gp = flag_QEq[i];
// if (gp == 0) continue;
if (itype == 0) q[i] = QOxInit ;
if (itype > 0) q[i] = -QOxInit * nQEqaall[gp]/nQEqcall[gp];
}
}
if (nteam == 0 || Qstep == 0) return;
if (step % Qstep != 0) return;
// --------------------------------------
// ----
// ----
if (me == 0 && strcmp(Bavard,"false") != 0) {
for (gp = 0; gp < nteam+1; gp++) {
printf (" ++++ Groupe %d - Nox %d Ncat %d\n",gp,nQEqaall[gp],nQEqcall[gp]);
if (nQEqcall[gp] !=0 && nQEqaall[gp] !=0 )
printf (" neutralite des charges %f\n qtotc %f qtota %f\n",
qtotll,qtotcll[gp]/nQEqcall[gp],qtotall[gp]/nQEqaall[gp]);
printf (" ---------------------------- \n");}
}
// ======================= Tab transfert ==================
// Transf[gp] = enegtot[gp]
// Transf[gp+cluster] = Qtotc[gp]
// Transf[gp+2cluster] = Qtota[gp]
// Transf[3cluster] = Qtot
// -------------------------------------------------------
memory->create(Transf,3*cluster+1,"pair:Tranf");
memory->create(TransfAll,3*cluster+1,"pair:TranfAll");
// ========================================================
// --------------------------------------------
for (iloop = 0; iloop < loopmax; iloop ++ ) {
// --------------------------------------------
qtot = qtotll = Transf[3*cluster] = 0.0 ;
for (gp=0; gp<nteam+1; gp++) {
Transf[gp] = Transf[gp+cluster] = Transf[gp+2*cluster] = 0.0;
TransfAll[gp] = TransfAll[gp+cluster] = TransfAll[gp+2*cluster] = 0.0;
enegtot[gp] = enegtotall[gp] = enegchkall[gp] = enegmaxall[gp] = 0.0 ;
}
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
q1[i] += qf[i]*dtq2 - heatpq*q1[i];
q[i] += q1[i];
Transf[3*cluster] += q[i];
itype = map[type[i]];
gp = flag_QEq[i];
if (itype == 0) Transf[gp+2*cluster] += q[i];
if (itype != 0) Transf[gp+cluster] += q[i];
}
// Communication des charges
// ---------------------------
- forward(q) ; reverse(q);
+ forward(q) ; // reverse(q);
// Calcul des potentiel
// ----------------------
QForce_charge(iloop);
// exit(1);
for (ii = 0; ii < inum; ii++)
{
i = ilist[ii]; itype = map[type[i]];
gp = flag_QEq[i];
qf[i] = 0.0;
qf[i] = potself[i]+potmad[i]+potcov[i]+chimet[i] ;
Transf[gp] += qf[i];
}
MPI_Allreduce(Transf,TransfAll,3*cluster+1,MPI_DOUBLE,MPI_SUM,world);
for (i = 0; i < nteam+1; i++) {
if (nQEqall[i] !=0) TransfAll[i] /= static_cast<double>(nQEqall[i]);
enegchk[i] = enegmax[i] = 0.0;
}
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
itype = map[type[i]];
gp = flag_QEq[i];
if (gp == 0) continue;
q2[i] = TransfAll[gp] - qf[i];
enegmax[gp] = MAX(enegmax[gp],fabs(q2[i]));
enegchk[gp] += fabs(q2[i]);
qf[i] = q2[i];
} // Boucle local
MPI_Allreduce(enegchk,enegchkall,nteam+1,MPI_DOUBLE,MPI_SUM,world);
MPI_Allreduce(enegmax,enegmaxall,nteam+1,MPI_DOUBLE,MPI_MAX,world);
for (gp = 0; gp < nteam+1; gp++) {
if(nQEqall[gp] !=0) {
enegchk[gp] = enegchkall[gp]/static_cast<double>(nQEqall[gp]);
enegmax[gp] = enegmaxall[gp];
}
}
// -----------------------------------------------------
// Convergence Test
// -----------------------------------------------------
m = 0;
for (gp = 1; gp < nteam+1; gp++) {
if (enegchk[gp] <= precision && enegmax[gp] <= 100.0*precision) end[gp] = 1;
}
for (gp = 1; gp < nteam+1; gp++) { m += end[gp] ; }
if (m == nteam) { break; }
// -----------------------------------------------------
// -----------------------------------------------------
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
q1[i] += qf[i]*dtq2 - heatpq*q1[i];
}
// --------------------------------------------
} // -------------------------------- iloop
// --------------------------------------------
// =======================================
// Charge Communication.
// =======================================
- forward(q); reverse(q);
+ forward(q); // reverse(q);
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ==========================================
// Ecriture des potentiels dans un fichier
// ==========================================
if (strcmp(writepot,"true") == 0 && fmod(static_cast<double>(step), Neverypot) == 0.0) {
ofstream fichierpot("Electroneg_component.txt", ios::out | ios::trunc) ;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
itype = map[type[i]];
gp = flag_QEq[i];
if (fichierpot) fichierpot<< setprecision(9) <<i <<" "<<itype<<" "<<x[i][0]<<" "<<x[i][1]
<<" "<<x[i][2]<<" "<<q[i]<<" "<<potself[i] + potmad[i]<<" "<<potcov[i]
<<" "<<sbcov[i]<<" "<<TransfAll[gp]<<endl;
}
if (fichierpot) fichierpot.close() ;
}
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// Statistique (ecart type)
// ------------------------
for (i=0; i<nteam+1; i++) {
if(nQEqcall[i] !=0)
{ TransfAll[i+cluster] /= static_cast<double>(nQEqcall[i]) ;
TransfAll[i+2*cluster] /= static_cast<double>(nQEqaall[i]) ;}
sigmaa[i] = sigmac[i] = 0.0;
}
qtot = 0.0 ;
for (ii = 0; ii < inum; ii++)
{
i = ilist[ii];
itype = map[type[i]];
gp = flag_QEq[i];
// qtot += q[i];
if (gp == 0) continue;
if (itype == 0) sigmaa[gp] += (q[i]-TransfAll[gp+2*cluster])*(q[i]-TransfAll[gp+2*cluster]);
if (itype == 1) sigmac[gp] += (q[i]-TransfAll[gp+cluster])*(q[i]-TransfAll[gp+cluster]);
}
MPI_Allreduce(sigmaa,sigmaall,nteam+1,MPI_DOUBLE,MPI_SUM,world);
MPI_Allreduce(sigmac,sigmacll,nteam+1,MPI_DOUBLE,MPI_SUM,world);
for (gp = 1; gp < nteam+1; gp++) {
sigmaall[gp] = sqrt(sigmaall[gp]/static_cast<double>(nQEqaall[gp])) ;
sigmacll[gp] = sqrt(sigmacll[gp]/static_cast<double>(nQEqcall[gp])) ;
}
if (me == 0 && strcmp(Bavard,"false") != 0){
for (gp = 0; gp < nteam+1; gp++) {
printf (" -------------- Groupe %d -----------------\n",gp);
printf (" qtotc %f(+- %f) qtota %f(+- %f)\n",
TransfAll[gp+cluster],sigmacll[gp],TransfAll[gp+2*cluster],sigmaall[gp]);
printf (" Potentiel elec total : %f\n iloop %d, qtot %f\n",TransfAll[gp],iloop,TransfAll[3*cluster]);
printf (" convergence : %f - %f\n",enegchk[gp],enegmax[gp]);
}
t_end = MPI_Wtime();
dt = t_end - t_init;
printf (" temps dans charges : %f seconde. \n",dt);
printf (" ======================================================== \n");
}
// ============== Destroy Tab
memory->destroy(Transf);
memory->destroy(TransfAll);
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::groupBulkFromSlab_QEq()
{ int ii,i;
double **x=atom->x;
int *ilist;
double ztmp;
int inum = list->inum;
ilist = list->ilist;
for (ii = 0; ii < inum; ii++)
{
i = ilist[ii];
ztmp = x[i][2];
if (ztmp>zlim1QEq && ztmp< zlim2QEq)
flag_QEq[i]=1;
else
flag_QEq[i]=0;
nteam=1;
}
}
// ----------------------------------------------
void PairSMTBQ::groupQEqAll_QEq()
{ int ii,i;
int *ilist;
int inum = list->inum;
ilist = list->ilist;
nteam=1;
for (ii = 0; ii < inum; ii++)
{
i= ilist[ii];
flag_QEq[i]=1;
}
}
// ----------------------------------------------
void PairSMTBQ::groupSurface_QEq()
{ int ii,i;
double **x=atom->x;
int *ilist;
double ztmp;
int inum = list->inum;
ilist = list->ilist;
for (ii = 0; ii < inum; ii++)
{
i = ilist[ii];
ztmp = x[i][2];
if (ztmp>zlim1QEq)
flag_QEq[i]=1;
else
flag_QEq[i]=0;
nteam=1;
}
}
void PairSMTBQ::groupQEqAllParallel_QEq()
{
int ii,i,jj,j,kk,k,itype,jtype,ktype,jnum,m,gp,zz,z,kgp;
int iproc,team_elt[10][nproc],team_QEq[10][nproc][5];
int *ilist,*jlist,*numneigh,**firstneigh,ngp,igp;
double delr[3],xtmp,ytmp,ztmp,rsq;
int **flag_gp, *nelt, **tab_gp;
int QEq,QEqall[nproc];
double **x = atom->x;
int *type = atom->type;
const int nlocal = atom->nlocal;
const int nghost = atom->nghost;
const int nall = nlocal + nghost;
int inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
// +++++++++++++++++++++++++++++++++++++++++++++++++
// On declare et initialise nos p'tits tableaux
// +++++++++++++++++++++++++++++++++++++++++++++++++
int **tabtemp,**Alltabtemp, *gptmp, *Allgptmp;
memory->create(tabtemp,10*nproc+10,nproc,"pair:tabtemp");
memory->create(Alltabtemp,10*nproc+10,nproc,"pair:Alltabtemp");
memory->create(gptmp,10*nproc+10,"pair:gptmp");
memory->create(Allgptmp,10*nproc+10,"pair:Allgptmp");
memory->create(flag_gp,nproc,nall,"pair:flag_gp");
memory->create(nelt,nall,"pair:nelt");
memory->create(tab_gp,10,nall,"pair:flag_gp");
for (i = 0; i < nall ; i++) { flag_QEq[i] = 0; }
for (i = 0; i < 10*nproc; i++) {
gptmp[i] = 0; Allgptmp[i] = 0;
for (j=0;j<nproc;j++) { tabtemp[i][j] = 0;
Alltabtemp[i][j] = 0;}
}
for (i = 0; i < 10; i++) {
for (k = 0; k < nall; k++) { tab_gp[i][k] = 0;
if (i == 0) nelt[k] = 0;
}
for (j = 0; j < nproc; j++) {
team_elt[i][j] = 0;
for (k = 0; k < 5; k++) { team_QEq[i][j][k] = 0; }
}
}
QEq = 0;
// printf ("groupeQEq me %d - nloc %d nghost %d boite %d\n",
// me,nlocal,nghost,nall);
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++
// On identifie les atomes rentrant dans le schema QEq +
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++
for (ii = 0; ii < inum; ii++)
{
i = ilist[ii] ; itype = map[type[i]] ;
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++ )
{
j = jlist[jj] ;
j &= NEIGHMASK;
jtype = map[type[j]];
if (jtype == itype) continue;
m = intype[itype][jtype];
delr[0] = x[j][0] - xtmp;
delr[1] = x[j][1] - ytmp;
delr[2] = x[j][2] - ztmp;
rsq = vec3_dot(delr,delr);
if (sqrt(rsq) <= intparams[m].dc2) {
flag_QEq[i] = 1; flag_QEq[j] = 1;
}
}
if (flag_QEq[i] == 1) {
QEq = 1;
}
}
// ::::::::::::::: Testing the presence of oxide :::::::::::
m = 0;
MPI_Allgather(&QEq,1,MPI_INT,QEqall,1,MPI_INT,world);
for (iproc = 0; iproc < nproc; iproc++) {
if (QEqall[iproc] == 1) m = 1;
}
if (m == 0) {
memory->destroy(tabtemp);
memory->destroy(Alltabtemp);
memory->destroy(gptmp);
memory->destroy(Allgptmp);
memory->destroy(flag_gp);
memory->destroy(tab_gp);
memory->destroy(nelt);
return;
}
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::
for (m = 0; m < nproc; m++) {
for (i = 0; i < nall; i++) { flag_gp[m][i] = 0; }
}
// OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
// It includes oxygens entering the QEq scheme O
// OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
ngp = igp = 0; nelt[ngp] = 0;
// On prend un oxygène
// printf ("[me %d] On prend un oxygene\n",me);
for (ii = 0; ii < inum; ii++) {
i = ilist[ii] ; itype = map[type[i]];
if (itype != 0 || flag_QEq[i] == 0) continue;
m = 0;
if (ngp != 0 && flag_gp[me][i] == ngp) continue;
// Grouping Initialisation
// -----------------------------
if (flag_gp[me][i] == 0) {
ngp += 1; nelt[ngp] = 0;
tab_gp[ngp][nelt[ngp]] = i;
flag_gp[me][i] = ngp;
nelt[ngp] += 1;
}
// -------------------------------
// Loop on the groups
// ----------------------
for (kk = 0; kk < nelt[ngp]; kk++)
{
k = tab_gp[ngp][kk];
ktype = map[type[k]];
// printf ("[me %d] kk - gp %d elemt %d : atom %d(%d)\n",me,ngp,kk,k,ktype);
if (k >= nlocal) continue;
xtmp = x[k][0];
ytmp = x[k][1];
ztmp = x[k][2];
// Loop on the oxygen's neighbor of the group
// ---------------------------------------------
jlist = firstneigh[k];
jnum = numneigh[k];
for (j = 0; j < nall; j++ )
{
jtype = map[type[j]];
if (jtype == ktype) continue;
m = intype[itype][jtype];
if (jtype == 0 && flag_QEq[j] == 0) continue;
if (flag_gp[me][j] == ngp) continue;
delr[0] = x[j][0] - xtmp;
delr[1] = x[j][1] - ytmp;
delr[2] = x[j][2] - ztmp;
rsq = vec3_dot(delr,delr);
// -------------------------------------
if (sqrt(rsq) <= cutmax) {
flag_QEq[j] = 1; //Entre dans le schema QEq
// :::::::::::::::::::: Meeting of two group in the same proc :::::::::::::::::::::
if (flag_gp[me][j] != 0 && flag_gp[me][j] != ngp && nelt[flag_gp[me][j]] != 0) {
printf("[me %d] (atom %d) %d [elt %d] rencontre un nouveau groupe %d [elt %d] (atom %d)\n",
me,k,ngp,nelt[ngp],flag_gp[me][j],nelt[flag_gp[me][j]],j);
// On met a jours les tableaux
// -----------------------------
igp = flag_gp[me][j];
z = min(igp,ngp);
if (z == igp) { igp = z; }
else if (z == ngp) {
ngp = igp ; igp = z;
flag_gp[me][j] = ngp;
}
for (zz = 0; zz < nelt[ngp]; zz++) {
z = tab_gp[ngp][zz];
tab_gp[igp][nelt[igp]] = z;
nelt[igp] += 1;
flag_gp[me][z] = igp;
tab_gp[ngp][zz] = 0;
}
nelt[ngp] = 0;
for (z = nlocal; z < nall; z++) {
if (flag_gp[me][z] == ngp) flag_gp[me][z] = igp;
}
m = 1; kk = 0;
ngp = igp;
break;
}
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
flag_gp[me][j] = ngp;
if (j < nlocal)
{
tab_gp[ngp][nelt[ngp]] = j;
nelt[ngp] += 1;
}
}
} // for j
} // for k
} // for ii
// OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
// Groups communication
// OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
for (i = 0; i < nproc; i++) {
- forward_int(flag_gp[i]); reverse_int(flag_gp[i]);
+ forward_int(flag_gp[i]); //reverse_int(flag_gp[i]);
}
// ---
// =======================================================
// Loop on the cation to make them joined in the oxygen's
// group which it interacts
// =======================================================
igp = 0;
for (ii = 0; ii < inum; ii++)
{
i = ilist[ii] ; itype = map[type[i]];
if (itype == 0) continue;
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++ )
{
j = jlist[jj] ;
j &= NEIGHMASK;
jtype = map[type[j]];
if (jtype != 0) continue;
m = 0;
for (iproc = 0; iproc < nproc; iproc++) {
if (flag_gp[iproc][j] != 0) m = flag_gp[iproc][j];
}
if (m == 0) continue;
delr[0] = x[j][0] - xtmp;
delr[1] = x[j][1] - ytmp;
delr[2] = x[j][2] - ztmp;
rsq = vec3_dot(delr,delr);
// ----------------------------------------
if (sqrt(rsq) <= cutmax) {
// if (sqrt(rsq) <= intparams[m].dc2) {
// ----------------------------------------
flag_QEq[i] = 1; igp = flag_gp[me][j];
if (flag_gp[me][i] == 0) flag_gp[me][i] = igp;
if (flag_gp[me][i] != igp && igp != 0) {
printf ("[me %d] Cation i %d gp %d [nelt %d] rencontre j %d(%d)du groupe %d [nelt %d]\n",
me,i,flag_gp[me][i],nelt[flag_gp[me][i]],j,jtype,igp,nelt[igp]);
igp = min(flag_gp[me][i],flag_gp[me][j]);
if (igp == flag_gp[me][i]) { kgp = flag_gp[me][j]; }
else { kgp = flag_gp[me][i]; }
for (k = 0; k < nelt[kgp]; k++) {
z = tab_gp[kgp][k];
tab_gp[igp][nelt[igp]] = z;
nelt[igp] += 1;
flag_gp[me][z] = igp;
tab_gp[kgp][k] = 0;
}
nelt[kgp] = 0;
for (k = 0; k < nall; k++) {
if (flag_gp[me][k] == kgp) flag_gp[me][k] = igp;
}
}
m = 0;
for (k = 0; k < nelt[igp]; k++) {
if (tab_gp[igp][k] == i) m = 1;
}
if (i >= nlocal || m == 1 ) continue;
// printf ("[me %d] igp %d - nelt %d atom %d\n",me,igp,nelt[igp],i);
tab_gp[igp][nelt[igp]] = i;
nelt[igp] += 1;
break;
}
} // voisin j
} // atom i
/* ==================================================
Group Communication between proc for unification
================================================== */
for (i = 0; i < nproc; i++) {
- forward_int(flag_gp[i]); reverse_int(flag_gp[i]);
+ forward_int(flag_gp[i]);// reverse_int(flag_gp[i]);
}
// =============== End of COMM =================
for (i = 0; i < nall; i++) {
m = 10*me + flag_gp[me][i];
if (m == 10*me) continue; // Pas de groupe zero
gptmp[m] = 1;
for (k = 0; k < nproc; k++) {
if (k == me) continue;
if (tabtemp[m][k] != 0) continue;
if (flag_gp[k][i] != 0) {
tabtemp[m][k] = 10*k + flag_gp[k][i];
}
}
}
for (k = 0; k < 10*nproc; k++) {
MPI_Allreduce(tabtemp[k],Alltabtemp[k],nproc,MPI_INT,MPI_SUM,world); }
MPI_Allreduce(gptmp,Allgptmp,10*nproc,MPI_INT,MPI_SUM,world);
nteam = 0; iproc = 0;
for (igp = 0; igp < 10*nproc; igp++) {
if (Allgptmp[igp] == 0) continue;
iproc = int(static_cast<double>(igp)/10.0);
ngp = igp - 10*iproc;
if (nteam == 0) {
nteam += 1;
team_elt[nteam][iproc] = 0;
team_QEq[nteam][iproc][team_elt[nteam][iproc]] = ngp;
team_elt[nteam][iproc] += 1;
} else {
m = 0;
for (i = 1; i < nteam+1; i++) {
for (k = 0; k < team_elt[i][iproc]; k++) {
if (ngp == team_QEq[i][iproc][k]) m = 1;
} }
if (m == 1) continue;
// create a new team!!
// ---------------------------
if (m == 0) {
nteam += 1;
team_elt[nteam][iproc] = 0;
team_QEq[nteam][iproc][team_elt[nteam][iproc]] = ngp;
team_elt[nteam][iproc] += 1;
}
}
// -------
// On a mis une graine dans le groupe et nous allons
// remplir se groupe en questionnant le "tabtemp[igp][iproc]=jgp"
//
for (kk = 0; kk < nproc; kk++) {
for (k = 0; k < team_elt[nteam][kk]; k++) {
// On prend le gp le k ieme element de la team nteam sur le proc iproc
// ngp = 0;
ngp = team_QEq[nteam][kk][k];
kgp = 10*kk + ngp;
// On regarde sur les autre proc si ce gp ne pointe pas vers un autre.
for (i = 0; i < nproc; i++) {
if (i == kk) continue;
if (Alltabtemp[kgp][i] == 0) continue;
if (Alltabtemp[kgp][i] != 0) ngp = Alltabtemp[kgp][i];
ngp = ngp - 10*i;
// Est ce que ce groupe est nouveau?
m = 0;
for (j = 0; j < team_elt[nteam][i]; j++) {
if (team_QEq[nteam][i][j] == ngp) m = 1;
}
if (m == 0) {
iproc = i; k = 0;
team_QEq[nteam][i][team_elt[nteam][i]] = ngp ;
team_elt[nteam][i] += 1;
}
} // regard sur les autre proc
} // On rempli de proche en proche
} // boucle kk sur les proc
}
// Finalement on met le numero de la team en indice du flag_QEq, c mieu!
// ---------------------------------------------------------------------
for (ii = 0; ii < inum; ii++)
{
i = ilist[ii]; m = 0; itype = map[type[i]];
if (flag_QEq[i] == 0) continue;
gp = flag_gp[me][i];
for (j = 1; j <= nteam; j++) {
for (k = 0; k < team_elt[j][me]; k++) {
if (gp == team_QEq[j][me][k]) {
flag_QEq[i] = j; m = 1;
break;
}
}
if (m == 1) break;
}
}
memory->destroy(tabtemp);
memory->destroy(Alltabtemp);
memory->destroy(gptmp);
memory->destroy(Allgptmp);
memory->destroy(flag_gp);
memory->destroy(tab_gp);
memory->destroy(nelt);
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::Init_charge(int *nQEq, int *nQEqa, int *nQEqc)
{
int ii,i,gp,itype;
int *ilist,test[nteam],init[nteam];
double bound,tot,totll;
int inum = list->inum;
int *type = atom->type;
double *q = atom->q;
ilist = list->ilist;
if (nteam == 0) return;
if (me == 0) printf (" ======== Init_charge ======== \n");
for (gp = 0; gp < cluster; gp++) {
test[gp] = 0; init[gp] = 0;
}
// On fait un test sur les charges pour voir sont
// elles sont dans le domaine delimiter par DeltaQ
// -------------------------------------------------
for (ii = 0; ii < inum; ii++) {
i = ilist[ii]; itype = map[type[i]];
gp = flag_QEq[i];
if (gp != 0 && itype == 0) {
bound = fabs(2.0*ncov/params[itype].sto - fabs(params[itype].qform)) ;
if (bound == fabs(params[itype].qform)) continue;
if (fabs(q[i]) < bound) test[gp] = 1;
}
}
MPI_Allreduce(test,init,nteam+1,MPI_INT,MPI_SUM,world);
// On fait que sur les atomes hybrides!!!
// ----------------------------------------
tot = totll = 0.0;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii]; itype = map[type[i]];
gp = flag_QEq[i];
if (gp != 0 && init[gp] != 0) {
if (itype == 0) q[i] = -1.96;
if (itype != 0) q[i] = 1.96 * static_cast<double>(nQEqaall[gp]) / static_cast<double>(nQEqcall[gp]);
}
tot += q[i];
}
MPI_Allreduce(&tot,&totll,1,MPI_INT,MPI_SUM,world);
if (me == 0) printf (" === Fin de init_charge qtot %20.15f ====\n",totll);
}
/* ----------------------------------------------------------------------
* COMMUNICATION
* ---------------------------------------------------------------------- */
int PairSMTBQ::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i ++) {
j = list[i];
buf[m++] = tab_comm[j];
// if (j < 3) printf ("[%d] %d pfc %d %d buf_send = %f \n",me,n,i,m-1,buf[m-1]);
}
- return 1;
+ return m;
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n ;
for (i = first; i < last; i++) {
tab_comm[i] = buf[m++];
// if (i<first+3) printf ("[%d] ufc %d %d buf_recv = %f \n",me,i,m-1,buf[m-1]);
}
}
/* ---------------------------------------------------------------------- */
int PairSMTBQ::pack_reverse_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
buf[m++] = tab_comm[i];
// if (i<first+3) printf ("[%d] prc %d %d buf_send = %f \n",me,i,m-1,buf[m-1]);
}
- return 1;
+ return m;
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::unpack_reverse_comm(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
// tab_comm[j] += buf[m++];
tab_comm[j] = buf[m++];
// if (j<3) printf ("[%d] %d urc %d %d buf_recv = %f \n",me,n,i,m-1,buf[m-1]);
}
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::forward(double *tab)
{
int i;
int nlocal = atom->nlocal;
int nghost = atom->nghost;
for (i=0; i<nlocal+nghost; i++) tab_comm[i] = tab[i];
comm->forward_comm_pair(this);
for (i=0; i<nlocal+nghost; i++) tab[i] = tab_comm[i];
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::reverse(double *tab)
{
int i;
int nlocal = atom->nlocal;
int nghost = atom->nghost;
for (i=0; i<nlocal+nghost; i++) tab_comm[i] = tab[i];
comm->reverse_comm_pair(this);
for (i=0; i<nlocal+nghost; i++) tab[i] = tab_comm[i];
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::forward_int(int *tab)
{
int i;
int nlocal = atom->nlocal;
int nghost = atom->nghost;
for (i=0; i<nlocal+nghost; i++) { tab_comm[i] = static_cast<double>(tab[i]);}
comm->forward_comm_pair(this);
for (i=0; i<nlocal+nghost; i++) {
if (fabs(tab_comm[i]) > 0.1) tab[i] = int(tab_comm[i]) ; }
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::reverse_int(int *tab)
{
int i;
int nlocal = atom->nlocal;
int nghost = atom->nghost;
for (i=0; i<nlocal+nghost; i++) { tab_comm[i] = static_cast<double>(tab[i]);}
comm->reverse_comm_pair(this);
for (i=0; i<nlocal+nghost; i++) {
if (fabs(tab_comm[i]) > 0.1) tab[i] = int(tab_comm[i]); }
}
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
double PairSMTBQ::memory_usage()
{
double bytes = maxeatom * sizeof(double);
bytes += maxvatom*6 * sizeof(double);
bytes += nmax * sizeof(int);
bytes += MAXNEIGH * nmax * sizeof(int);
return bytes;
}
/* ---------------------------------------------------------------------- */
void PairSMTBQ::add_pages(int howmany)
{
int toppage = maxpage;
maxpage += howmany*PGDELTA;
pages = (int **)
memory->srealloc(pages,maxpage*sizeof(int *),"pair:pages");
for (int i = toppage; i < maxpage; i++)
memory->create(pages[i],pgsize,"pair:pages[i]");
}
/* ---------------------------------------------------------------------- */
int PairSMTBQ::Tokenize( char* s, char*** tok )
{
char test[MAXLINE];
const char *sep = "' ";
char *mot;
int count=0;
mot = NULL;
strncpy( test, s, MAXLINE-1 );
for( mot = strtok(test, sep); mot; mot = strtok(NULL, sep) ) {
strncpy( (*tok)[count], mot, MAXLINE );
count++;
}
return count;
}
void PairSMTBQ::CheckEnergyVSForce()
{
double drL,iq,jq,rsq,evdwlCoul,fpairCoul,eflag,ErepR,frepR,fpair,evdwl;
int i,j,iiiMax,iii,iCoord;
int itype,jtype,l,m;
double r,t1,t2,sds,xi,engSurf,fforceSurf;
double eng,fforce,engBB,fforceBB;
double za,zb,gam,dgam,dza,dzb,
d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2,na,nb;
int *type = atom->type;
const char *NameFile;
i=0;
j=1;
map[type[i]]=0; //ox
itype=map[type[i]];
iq=-1;
map[type[j]]=0; //ox
jtype=map[type[j]];
jq=-1;
coord[i]=coordOxBulk;
coord[j]=coordOxBulk;
m = intype[itype][jtype];
na = params[itype].ne ;
nb = params[jtype].ne ;
za = params[itype].dzeta ;
zb = params[jtype].dzeta ;
// Ouverture du fichier
for (iCoord=1;iCoord<5; iCoord++)
{
if (iCoord==1)
{coord[i]=2.2;
coord[j]=2.1;
NameFile=(const char *)"energyandForceOxOxUnderCoord.txt";
}
if (iCoord==2)
{coord[i]=coordOxBulk;
coord[j]=coordOxBulk;
NameFile=(const char *)"energyandForceOxOxCoordBulk.txt";
}
if (iCoord==3)
{coord[i]=3.8;
coord[j]=4;
NameFile=(const char *)"energyandForceOxOxOverCoord.txt";
}
if (iCoord==4)
{coord[i]=2.2;
coord[j]=3.5;
NameFile=(const char *)"energyandForceOxOxUnderOverCoord.txt";
}
ofstream fichierOxOx(NameFile, ios::out | ios::trunc) ;
drL=0.0001;
iiiMax=int((cutmax-1.2)/drL);
for (iii=1; iii< iiiMax ; iii++){
r=1.2+drL*iii;
rsq=r*r;
evdwlCoul = 0.0 ; fpairCoul = 0.0;
potqeq(i,j,iq,jq,rsq,fpairCoul,eflag,evdwlCoul);
fpairCoul=fpairCoul*r;
rep_OO (&intparams[m],rsq,fpair,eflag,evdwl);
ErepR = evdwl;
frepR= fpair*r;
gam = dgam = dza = dzb = d2zaa = d2zab =
d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ;
// gammas_(na,nb,za,zb,r,gam,dgam,dza,dzb,
// d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ;
gammas(na,nb,za,zb,r,gam,dgam,dza,dzb,
d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ;
sds = rsq/ds ; l = int(sds) ;
xi = sds - static_cast<double>(l) ;
t1 = fafb[l][m] + (fafb[l+1][m] - fafb[l][m])*xi;
t2 = fafb[l+1][m] + (fafb[l+2][m] - fafb[l+1][m])*(xi-1.0);
eng = iq*jq*(t1 + (t2 - t1)*xi/2.0);
t1 = dfafb[l][m] + (dfafb[l+1][m] - dfafb[l][m])*xi;
t2 = dfafb[l+1][m] + (dfafb[l+2][m] - dfafb[l+1][m])*(xi-1);
fforce = - iq*jq*(t1 + (t2 - t1)*xi/2.0)*r ;
t1 = fafbOxOxSurf[l] + (fafbOxOxSurf[l+1] - fafbOxOxSurf[l])*xi;
t2 = fafbOxOxSurf[l+1] + (fafbOxOxSurf[l+2] - fafbOxOxSurf[l+1])*(xi-1.0);
engSurf = iq*jq*(t1 + (t2 - t1)*xi/2.0);
t1 = fafbOxOxBB[l] + (fafbOxOxBB[l+1] - fafbOxOxBB[l])*xi;
t2 = fafbOxOxBB[l+1] + (fafbOxOxBB[l+2] - fafbOxOxBB[l+1])*(xi-1.0);
engBB = iq*jq*(t1 + (t2 - t1)*xi/2.0);
t1 = dfafbOxOxSurf[l] + (dfafbOxOxSurf[l+1] - dfafbOxOxSurf[l])*xi;
t2 = dfafbOxOxSurf[l+1] + (dfafbOxOxSurf[l+2] - dfafbOxOxSurf[l+1])*(xi-1);
fforceSurf = - iq*jq*(t1 + (t2 - t1)*xi/2.0)*r ;
t1 = dfafbOxOxBB[l] + (dfafbOxOxBB[l+1] - dfafbOxOxBB[l])*xi;
t2 = dfafbOxOxBB[l+1] + (dfafbOxOxBB[l+2] - dfafbOxOxBB[l+1])*(xi-1);
fforceBB = - iq*jq*(t1 + (t2 - t1)*xi/2.0)*r ;
if (fichierOxOx) { fichierOxOx<< setprecision (9) <<r <<" "<<evdwlCoul <<" " <<fpairCoul <<" "<<eng <<" " <<fforce <<" "<<engSurf <<" " <<fforceSurf <<" "<<engBB <<" " <<fforceBB <<" "<<ErepR<<" "<<frepR<<" "<<gam<<" "<<dgam<<endl ;}
}
if (fichierOxOx) fichierOxOx.close() ;
}
map[type[j]]=1; //met
jtype=map[type[j]];
jq=1;
coord[i]=coordOxBulk;
coord[j]=6;
m = intype[itype][jtype];
na = params[itype].ne ;
nb = params[jtype].ne ;
za = params[itype].dzeta ;
zb = params[jtype].dzeta ;
// Ouverture du fichier
for (iCoord=1;iCoord<4; iCoord++)
{
if (iCoord==1)
{coord[i]=2.2;
coord[j]=2.1;
NameFile="energyandForceOxTiUnderCoord.txt";
}
if (iCoord==2)
{coord[i]=coordOxBulk;
coord[j]=coordOxBulk;
NameFile="energyandForceOxTiCoordBulk.txt";
}
if (iCoord==3)
{coord[i]=3.8;
coord[j]=4;
NameFile="energyandForceOxTiOverCoord.txt";
}
ofstream fichierOxTi(NameFile, ios::out | ios::trunc) ;
drL=0.0001;
iiiMax=int((cutmax-1.2)/drL);
for (iii=1; iii< iiiMax ; iii++){
r=1.2+drL*iii;
rsq=r*r;
evdwlCoul = 0.0 ; fpairCoul = 0.0;
potqeq(i,j,iq,jq,rsq,fpairCoul,eflag,evdwlCoul);
fpairCoul=fpairCoul*r;
rep_OO (&intparams[m],rsq,fpair,eflag,evdwl);
ErepR = evdwl;
frepR= fpair*r;
gam = dgam = dza = dzb = d2zaa = d2zab =
d2zbb = d2zra = d2zrb = d2gamr2 = 0.0 ;
// gammas_(na,nb,za,zb,r,gam,dgam,dza,dzb,
// d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ;
gammas(na,nb,za,zb,r,gam,dgam,dza,dzb,
d2zaa,d2zab,d2zbb,d2zra,d2zrb,d2gamr2) ;
if (fichierOxTi) { fichierOxTi<< setprecision (9) <<r <<" "<<evdwlCoul <<" " <<fpairCoul <<" "<<ErepR<<" "<<frepR<<" "<<gam<<" "<<dgam<<endl ;}
}
if (fichierOxTi) fichierOxTi.close() ;
}
exit(0);
}
/* :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
GAMMAS FUNCTION (GALE)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
void PairSMTBQ::gammas(double &na, double &nb, double &za, double &zb, double &r, double &gam,
double &dgam, double &dza, double &dzb, double &d2zaa, double &d2zab, double &d2zbb,
double &d2zra, double &d2zrb, double &d2gamr2)
{
/* ---------------------------------------------------------------
Subroutine calculates the integral over two s orbtials
for Slater functions
On input :
na = principle quantum number of A
nb = principle quantum number of B
za = orbital exponent of A
zb = orbital exponent of B
r = distance between A and B
On exit :
gam = integral
dgam = first derivative of gam with respect to r
dza = first derivative of gam with respect to za
dzb = first derivative of gam with respect to zb
d2zaa = second derivative of gam with respect to za/za
d2zab = second derivative of gam with respect to za/zb
d2zbb = second derivative of gam with respect to zb/zb
d2zra = second derivative of gam with respect to r/za
d2zrb = second derivative of gam with respect to r/zb
d2gamr2 = second derivative of gam with respect to r
Julian Gale, Imperial College, December 1997
---------------------------------------------------------------- */
int i;
double z2ra,z2rb,na2,nb2,halfr,drtrm,rtrm,ss,deriv,
dzeta1,dzeta2,d2zeta11,d2zeta12,d2zeta22,d2zeta1r,
d2zeta2r,deriv2,trm1,trm2,trm3,d2rtrm,ztrm,ctrm,
rfct1,rgam1,rdza1,rgam2;
gam=0.0;
dgam=0.0;
dza=0.0;
dzb=0.0;
d2zaa=0.0;
d2zab=0.0;
d2zbb=0.0;
d2zra=0.0;
d2zrb=0.0;
d2gamr2=0.0;
// This routine only handles two centre integrals
if (r < 1.0e-10) return;
// Create local variables
z2ra=2.0*za*r;
z2rb=2.0*zb*r;
na2=2*na;
nb2=2*nb;
halfr=0.5*r;
d2rtrm=powint(halfr,na2-2);
drtrm=d2rtrm*halfr;
rtrm=drtrm*halfr;
// First term
css(ss,na2-1,0,z2ra,0.0,r,deriv,dzeta1,dzeta2,
d2zeta11,d2zeta12,d2zeta22,d2zeta1r,d2zeta2r,
deriv2) ;
gam=rtrm*ss;
dgam=rtrm*deriv+static_cast<double>(na)*drtrm*ss;
dza=rtrm*dzeta1;
d2zaa=rtrm*d2zeta11;
d2zra=rtrm*d2zeta1r+static_cast<double>(na)*drtrm*dzeta1;
d2gamr2=d2gamr2+0.5*static_cast<double>(na*(na2-1))*d2rtrm*ss + 2.0*static_cast<double>(na)*drtrm*deriv+rtrm*deriv2;
// Sum over 2*nb
rtrm=drtrm;
drtrm=d2rtrm;
ztrm=0.5/(zb*static_cast<double>(nb2));
for (i = nb2; i >= 1; i--) {
rtrm=rtrm*halfr;
drtrm=drtrm*halfr;
ztrm=ztrm*2.0*zb;
ctrm=ztrm/factorial(static_cast<int>(nb2-i));
css(ss,na2-1,nb2-i,z2ra,z2rb,r,deriv,dzeta1,dzeta2,
d2zeta11,d2zeta12,d2zeta22,d2zeta1r,d2zeta2r,deriv2);
trm1=static_cast<double>(i)*ctrm;
trm2=trm1*rtrm;
gam=gam-trm2*ss;
trm3=trm1*static_cast<double>(na2+nb2-i)*drtrm;
dgam=dgam-trm2*deriv-0.5*trm3*ss;
d2gamr2=d2gamr2-trm2*deriv2-trm3*deriv-0.5*trm3*static_cast<double>(na2+nb2-i-1)*ss/r;
dza=dza-trm2*dzeta1;
dzb=dzb-(trm2/zb)*((static_cast<double>(nb2-i))*ss+zb*dzeta2);
d2zaa=d2zaa-trm2*d2zeta11;
d2zab=d2zab-(trm2/zb)*((static_cast<double>(nb2-i))*dzeta1+zb*d2zeta12);
d2zbb=d2zbb-(trm2/zb)*(2.0*(static_cast<double>(nb2-i))*dzeta2+zb*d2zeta22 +
(static_cast<double>((nb2-i-1)*(nb2-i))*ss/zb));
d2zra=d2zra-trm2*d2zeta1r-0.5*trm3*dzeta1;
d2zrb=d2zrb-(trm2/zb)*((static_cast<double>(nb2-i))*deriv+zb*d2zeta2r) -
0.5*(trm3/zb)*((static_cast<double>(nb2-i))*ss+zb*dzeta2);
}
// Multiply by coefficients
trm3=powint(2.0*za,na2+1)/factorial(static_cast<int>(na2));
gam=gam*trm3;
dgam=dgam*trm3;
rfct1=((static_cast<double>(na2+1))/za);
rgam1=rfct1*gam;
dza=dza*trm3;
rdza1=2.0*rfct1*dza;
dza=dza+rgam1;
dzb=dzb*trm3;
rgam2=rgam1*static_cast<double>(na2)/za;
d2zaa=d2zaa*trm3+rgam2+rdza1;
d2zab=d2zab*trm3+rfct1*dzb;
d2zbb=d2zbb*trm3;
d2zra=d2zra*trm3+rfct1*dgam;
d2zrb=d2zrb*trm3;
d2gamr2=d2gamr2*trm3;
return;
}
/* --------------------------------------------------------------------------------
Css
-------------------------------------------------------------------------------- */
void PairSMTBQ::css(double &s, double nn1, double nn2, double alpha, double beta, double r,
double &deriv, double &dzeta1, double &dzeta2, double &d2zeta11, double &d2zeta12,
double &d2zeta22, double &d2zeta1r, double &d2zeta2r, double &deriv2)
{
// implicit real (a-h,o-z)
// common /fctrl/ fct(30) // A RAJOUTER DANS Pair_SMTBQ.h
/* ------------------------------------------------------------------
Modified integral calculation routine for Slater orbitals
including derivatives. This version is for S orbitals only.
dzeta1 and dzeta2 are the first derivatives with respect to zetas
and d2zeta11/d2zeta12/d2zeta22 are the second.
d2zeta1r and d2zeta2r are the mixed zeta/r second derivatives
deriv2 is the second derivative with respect to r
Julian Gale, Imperial College, December 1997
------------------------------------------------------------------- */
int i,i1,nni1; //ulim
double ulim,n1,n2,p,pt,x,k,dpdz1,dpdz2,dptdz1,dptdz2,dpdr,dptdr,d2pdz1r,
d2pdz2r,d2ptdz1r,d2ptdz2r,zeta1,zeta2,sumzeta,difzeta,coff;
double da1[30],da2[30],db1[30],db2[30];
double d2a11[30],d2a12[30],d2a22[30],dar[30];
double d2b11[30],d2b12[30],d2b22[30],dbr[30];
double d2a1r[30],d2a2r[30],d2b1r[30],d2b2r[30];
double d2ar2[30],d2br2[30];
double *a,*b;
memory->create(a,31,"pair:a");
memory->create(b,31,"pair:a");
// Set up factorials - stored as factorial(n) in location(n+1)
for (i = 1; i <= 30; i++) {
fct[i]=factorial(i-1);
}
dzeta1=0.0;
dzeta2=0.0;
d2zeta11=0.0;
d2zeta12=0.0;
d2zeta22=0.0;
d2zeta1r=0.0;
d2zeta2r=0.0;
deriv=0.0;
deriv2=0.0;
n1=nn1;
n2=nn2;
p =(alpha + beta)*0.5;
pt=(alpha - beta)*0.5;
x = 0.0;
zeta1=alpha/r;
zeta2=beta/r;
sumzeta=zeta1+zeta2;
difzeta=zeta1-zeta2;
// Partial derivative terms for zeta derivatives
dpdz1=r;
dpdz2=r;
dptdz1=r;
dptdz2=-r;
dpdr=0.5*sumzeta;
dptdr=0.5*difzeta;
d2pdz1r=1.0;
d2pdz2r=1.0;
d2ptdz1r=1.0;
d2ptdz2r=-1.0;
// Reverse quantum numbers if necessary -
// also change the sign of difzeta to match
// change in sign of pt
if (n2 < n1) {
k = n1;
n1= n2;
n2= k;
pt=-pt;
difzeta=-difzeta;
dptdr=-dptdr;
dptdz1=-dptdz1;
dptdz2=-dptdz2;
d2ptdz1r=-d2ptdz1r;
d2ptdz2r=-d2ptdz2r;
}
// Trap for enormously long distances which would cause
// caintgs or cbintgs to crash with an overflow
if (p > 86.0 || pt > 86.0) {
s=0.0;
return;
}
//***************************
// Find a and b integrals *
//***************************
caintgs(p,n1+n2+3,a);
cbintgs(pt,n1+n2+3,b);
// Convert derivatives with respect to p and pt
// into derivatives with respect to zeta1 and
// zeta2
ulim=n1+n2+1;
for (i = 1; i <= int(ulim); i++) {
da1[i]=-a[i+1]*dpdz1;
da2[i]=-a[i+1]*dpdz2;
db1[i]=-b[i+1]*dptdz1;
db2[i]=-b[i+1]*dptdz2;
d2a11[i]=a[i+2]*dpdz1*dpdz1;
d2a12[i]=a[i+2]*dpdz1*dpdz2;
d2a22[i]=a[i+2]*dpdz2*dpdz2;
d2b11[i]=b[i+2]*dptdz1*dptdz1;
d2b12[i]=b[i+2]*dptdz1*dptdz2;
d2b22[i]=b[i+2]*dptdz2*dptdz2;
dar[i]=-a[i+1]*dpdr;
dbr[i]=-b[i+1]*dptdr;
d2a1r[i]=a[i+2]*dpdz1*dpdr-a[i+1]*d2pdz1r;
d2a2r[i]=a[i+2]*dpdz2*dpdr-a[i+1]*d2pdz2r;
d2b1r[i]=b[i+2]*dptdz1*dptdr-b[i+1]*d2ptdz1r;
d2b2r[i]=b[i+2]*dptdz2*dptdr-b[i+1]*d2ptdz2r;
d2ar2[i]=a[i+2]*dpdr*dpdr;
d2br2[i]=b[i+2]*dptdr*dptdr;
}
// Begin section used for overlap integrals involving s functions
for (i1 = 1; i1 <= int(ulim); i1++) {
nni1=n1+n2-i1+2;
coff=coeffs(n1,n2,i1-1);
deriv=deriv+coff*(dar[i1]*b[nni1]+a[i1]*dbr[nni1]);
x=x+coff*a[i1]*b[nni1];
dzeta1=dzeta1+coff*(da1[i1]*b[nni1]+a[i1]*db1[nni1]);
dzeta2=dzeta2+coff*(da2[i1]*b[nni1]+a[i1]*db2[nni1]);
d2zeta11=d2zeta11+coff*(d2a11[i1]*b[nni1]+a[i1]*d2b11[nni1]+
2.0*da1[i1]*db1[nni1]);
d2zeta12=d2zeta12+coff*(d2a12[i1]*b[nni1]+a[i1]*d2b12[nni1]+
da1[i1]*db2[nni1]+da2[i1]*db1[nni1]);
d2zeta22=d2zeta22+coff*(d2a22[i1]*b[nni1]+a[i1]*d2b22[nni1]+
2.0*da2[i1]*db2[nni1]);
d2zeta1r=d2zeta1r+coff*(d2a1r[i1]*b[nni1]+dar[i1]*db1[nni1]+
da1[i1]*dbr[nni1]+a[i1]*d2b1r[nni1]);
d2zeta2r=d2zeta2r+coff*(d2a2r[i1]*b[nni1]+dar[i1]*db2[nni1]+
da2[i1]*dbr[nni1]+a[i1]*d2b2r[nni1]);
deriv2=deriv2+coff*(d2ar2[i1]*b[nni1]+a[i1]*d2br2[nni1]+
2.0*dar[i1]*dbr[nni1]);
}
s=x*0.5;
deriv=0.5*deriv;
deriv2=0.5*deriv2;
dzeta1=0.5*dzeta1;
dzeta2=0.5*dzeta2;
d2zeta11=0.5*d2zeta11;
d2zeta12=0.5*d2zeta12;
d2zeta22=0.5*d2zeta22;
d2zeta1r=0.5*d2zeta1r;
d2zeta2r=0.5*d2zeta2r;
memory->destroy(a);
memory->destroy(b);
return;
}
/* -------------------------------------------------------------------------------
coeffs
------------------------------------------------------------------------------- */
double PairSMTBQ::coeffs(int na, int nb, int k)
{
// implicit real (a-h,o-z)
// common /fctrl/ fct(30)
int il,je,ia,i,j,ie,l;
double coeffs;
// Statement function
// binm(n,i)=fct(n+1)/(fct(n-i+1)*fct(i+1));
coeffs=0.0;
l=na+nb-k;
ie=min(l,na)+1;
je=min(l,nb);
ia=l-je+1;
for (il = ia; il <= ie; il++) {
i=il-1;
j=l-i; // D'ou vient le i
coeffs=coeffs + binm(na,i)*binm(nb,j)*powint(-1.,j);
}
return coeffs;
}
// ============================================
double PairSMTBQ::binm(int n, int i)
{
return fct[n+1]/(fct[n-i+1]*fct[i+1]);
}
/* ---------------------------------------------------------------------------------
Caintgs
-------------------------------------------------------------------------------- */
void PairSMTBQ::caintgs (double x, int k, double *a)
{
// implicit real (a-h,o-z)
// dimension a(30)
int i;
double cste,rx;
cste=exp(-x);
rx=1.0/x;
a[1]=cste*rx;
for (i = 1; i <= k; i++) {
a[i+1]=(a[i]*static_cast<double>(i)+cste)*rx;
}
return;
}
/* -----------------------------------------------------------------------------------
Cbintgs
----------------------------------------------------------------------------------- */
void PairSMTBQ::cbintgs( double x, int k, double *b)
{
// implicit real (a-h,o-z)
/* *******************************************************************
! Fills array of b-integrals. note that b(i) is b(i-1) in the
! usual notation
! for x.gt.3 exponential formula is used
! for 2.lt.x.le.3 and k.le.10 exponential formula is used
! for 2.lt.x.le.3 and k.gt.10 15 term series is used
! for 1.lt.x .e.2 and k.le.7 exponential formula is used
! for 1.lt.x.le.2 and k.gt.7 12 term series is used
! for .5.lt.x.le.1 and k.le.5 exponential formula is used
! for .5.lt.x.le.1 and k.gt.5 7 term series is used
! for x.le..5 6 term series is used
!******************************************************************* */
// dimension b(30)
// common /fctrl/ fct(30)
int i0,m,last,i;
double absx,expx,expmx,ytrm,y,rx;
i0=0;
absx=fabs(x);
if (absx > 3.0) goto g120;
if (absx > 2.0) goto g20;
if (absx > 1.0) goto g50;
if (absx > 0.5) goto g80;
if (absx > 1.0e-8) goto g110;
goto g170;
g110: last=6;
goto g140;
g80: if (k <= 5) goto g120;
last=7;
goto g140;
g50: if (k <= 7) goto g120;
last=12;
goto g140;
g20: if (k <= 10) goto g120;
last=15;
goto g140;
g120: expx=exp(x);
expmx=1./expx;
rx=1.0/x;
b[1]=(expx-expmx)*rx;
for (i = 1; i <= k ; i++) {
b[i+1]=(static_cast<double>(i)*b[i]+ powint(-1.0,i)*expx-expmx)*rx;
}
goto g190;
//
// Series to calculate b(i)
//
g140: for (i = i0; i <= k ; i++) {
y=0.;
for (m = i0; m <= last; m++) {
ytrm = powint(-x,m-1)*(1. - powint(-1.,m+i+1))/(fct[m+1]*static_cast<double>(m+i+1));
y = y + ytrm*(-x);
}
b[i+1] = y;
}
goto g190;
//
// x extremely small
//
g170: for (i = i0; i <= k; i++) {
b[i+1] = (1.-powint(-1.,i+1))/static_cast<double>(i+1);
}
g190:
return;
}
/* ============================== This is the END... ================================== */
diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp
index eccce4f5b..b349cbd67 100644
--- a/src/VORONOI/compute_voronoi_atom.cpp
+++ b/src/VORONOI/compute_voronoi_atom.cpp
@@ -1,540 +1,640 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Daniel Schwen
------------------------------------------------------------------------- */
#include <mpi.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "compute_voronoi_atom.h"
#include "atom.h"
#include "group.h"
#include "update.h"
#include "modify.h"
#include "domain.h"
#include "memory.h"
#include "error.h"
#include "comm.h"
#include "variable.h"
#include "input.h"
#include "force.h"
#include <vector>
using namespace LAMMPS_NS;
using namespace voro;
+#define FACESDELTA 10000
+
/* ---------------------------------------------------------------------- */
ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
int sgroup;
size_peratom_cols = 2;
peratom_flag = 1;
comm_forward = 1;
+ faces_flag = 0;
surface = VOROSURF_NONE;
maxedge = 0;
fthresh = ethresh = 0.0;
radstr = NULL;
onlyGroup = false;
occupation = false;
con_mono = NULL;
con_poly = NULL;
tags = NULL;
occvec = sendocc = lroot = lnext = NULL;
+ faces = NULL;
int iarg = 3;
while ( iarg<narg ) {
if (strcmp(arg[iarg], "occupation") == 0) {
occupation = true;
iarg++;
}
else if (strcmp(arg[iarg], "only_group") == 0) {
onlyGroup = true;
iarg++;
}
else if (strcmp(arg[iarg], "radius") == 0) {
if (iarg + 2 > narg || strstr(arg[iarg+1],"v_") != arg[iarg+1] )
error->all(FLERR,"Illegal compute voronoi/atom command");
int n = strlen(&arg[iarg+1][2]) + 1;
radstr = new char[n];
strcpy(radstr,&arg[iarg+1][2]);
iarg += 2;
}
else if (strcmp(arg[iarg], "surface") == 0) {
if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command");
// group all is a special case where we just skip group testing
if(strcmp(arg[iarg+1], "all") == 0) {
surface = VOROSURF_ALL;
} else {
sgroup = group->find(arg[iarg+1]);
if (sgroup == -1) error->all(FLERR,"Could not find compute/voronoi surface group ID");
sgroupbit = group->bitmask[sgroup];
surface = VOROSURF_GROUP;
}
size_peratom_cols = 3;
iarg += 2;
} else if (strcmp(arg[iarg], "edge_histo") == 0) {
if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command");
maxedge = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg], "face_threshold") == 0) {
if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command");
fthresh = force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg], "edge_threshold") == 0) {
if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command");
ethresh = force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
+ } else if (strcmp(arg[iarg], "neighbors") == 0) {
+ if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command");
+ if (strcmp(arg[iarg+1],"yes") == 0) faces_flag = 1;
+ else if (strcmp(arg[iarg+1],"no") == 0) faces_flag = 0;
+ else error->all(FLERR,"Illegal compute voronoi/atom command");
+ iarg += 2;
+ } else if (strcmp(arg[iarg], "peratom") == 0) {
+ if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command");
+ if (strcmp(arg[iarg+1],"yes") == 0) peratom_flag = 1;
+ else if (strcmp(arg[iarg+1],"no") == 0) peratom_flag = 0;
+ else error->all(FLERR,"Illegal compute voronoi/atom command");
+ iarg += 2;
}
else error->all(FLERR,"Illegal compute voronoi/atom command");
}
if (occupation && ( surface!=VOROSURF_NONE || maxedge>0 ) )
error->all(FLERR,"Illegal compute voronoi/atom command (occupation and (surface or edges))");
nmax = rmax = 0;
edge = rfield = sendvector = NULL;
voro = NULL;
if ( maxedge > 0 ) {
vector_flag = 1;
size_vector = maxedge+1;
memory->create(edge,maxedge+1,"voronoi/atom:edge");
memory->create(sendvector,maxedge+1,"voronoi/atom:sendvector");
vector = edge;
}
+
+ // store local face data: i, j, area
+
+ if (faces_flag) {
+ local_flag = 1;
+ size_local_cols = 3;
+ size_local_rows = 0;
+ nfacesmax = 0;
+ }
}
/* ---------------------------------------------------------------------- */
ComputeVoronoi::~ComputeVoronoi()
{
memory->destroy(edge);
memory->destroy(rfield);
memory->destroy(sendvector);
memory->destroy(voro);
delete[] radstr;
// voro++ container classes
delete con_mono;
delete con_poly;
// occupation analysis stuff
memory->destroy(lroot);
memory->destroy(lnext);
memory->destroy(occvec);
#ifdef NOTINPLACE
memory->destroy(sendocc);
#endif
memory->destroy(tags);
+ memory->destroy(faces);
}
/* ---------------------------------------------------------------------- */
void ComputeVoronoi::init()
{
}
/* ----------------------------------------------------------------------
gather compute vector data from other nodes
------------------------------------------------------------------------- */
void ComputeVoronoi::compute_peratom()
{
invoked_peratom = update->ntimestep;
// grow per atom array if necessary
int nlocal = atom->nlocal;
if (nlocal > nmax) {
memory->destroy(voro);
nmax = atom->nmax;
memory->create(voro,nmax,size_peratom_cols,"voronoi/atom:voro");
array_atom = voro;
}
// decide between occupation or per-frame tesselation modes
if (occupation) {
// build cells only once
int i, nall = nlocal + atom->nghost;
if (con_mono==NULL && con_poly==NULL) {
// generate the voronoi cell network for the initial structure
buildCells();
// save tags of atoms (i.e. of each voronoi cell)
memory->create(tags,nall,"voronoi/atom:tags");
for (i=0; i<nall; i++) tags[i] = atom->tag[i];
// linked list structure for cell occupation count on the atoms
oldnall= nall;
memory->create(lroot,nall,"voronoi/atom:lroot"); // point to first atom index in cell (or -1 for empty cell)
lnext = NULL;
lmax = 0;
// build the occupation buffer
oldnatoms = atom->natoms;
memory->create(occvec,oldnatoms,"voronoi/atom:occvec");
#ifdef NOTINPLACE
memory->create(sendocc,oldnatoms,"voronoi/atom:sendocc");
#endif
}
// get the occupation of each original voronoi cell
checkOccupation();
} else {
// build cells for each output
buildCells();
loopCells();
}
}
void ComputeVoronoi::buildCells()
{
int i;
const double e = 0.01;
int nlocal = atom->nlocal;
int dim = domain->dimension;
// in the onlyGroup mode we are not setting values for all atoms later in the voro loop
// initialize everything to zero here
if (onlyGroup) {
if (surface == VOROSURF_NONE)
for (i = 0; i < nlocal; i++) voro[i][0] = voro[i][1] = 0.0;
else
for (i = 0; i < nlocal; i++) voro[i][0] = voro[i][1] = voro[i][2] = 0.0;
}
double *sublo = domain->sublo, *sublo_lamda = domain->sublo_lamda, *boxlo = domain->boxlo;
double *subhi = domain->subhi, *subhi_lamda = domain->subhi_lamda;
double *cut = comm->cutghost;
double sublo_bound[3], subhi_bound[3], cut_bound[3];
double **x = atom->x;
// setup bounds for voro++ domain for orthogonal and triclinic simulation boxes
if( domain->triclinic ) {
// triclinic box: embed parallelepiped into orthogonal voro++ domain
// cutghost is in lamda coordinates for triclinic boxes, use subxx_lamda
double *h = domain->h;
- sublo_bound[0] = h[0]*sublo_lamda[0] + h[5]*sublo_lamda[1] + h[4]*sublo_lamda[2] + boxlo[0];
- sublo_bound[1] = h[1]*sublo_lamda[1] + h[3]*sublo_lamda[2] + boxlo[1];
- sublo_bound[2] = h[2]*sublo_lamda[2] + boxlo[2];
- subhi_bound[0] = h[0]*subhi_lamda[0] + h[5]*subhi_lamda[1] + h[4]*subhi_lamda[2] + boxlo[0];
- subhi_bound[1] = h[1]*subhi_lamda[1] + h[3]*subhi_lamda[2] + boxlo[1];
- subhi_bound[2] = h[2]*subhi_lamda[2] + boxlo[2];
- cut_bound[0] = h[0]*cut[0] + h[5]*cut[1] + h[4]*cut[2];
- cut_bound[1] = h[1]*cut[1] + h[3]*cut[2];
- cut_bound[2] = h[2]*cut[2];
+ for( i=0; i<3; ++i ) {
+ sublo_bound[i] = sublo[i]-cut[i]-e;
+ subhi_bound[i] = subhi[i]+cut[i]+e;
+ if (domain->periodicity[i]==0) {
+ sublo_bound[i] = MAX(sublo_bound[i],0.0);
+ subhi_bound[i] = MIN(subhi_bound[i],1.0);
+ }
+ }
+ if (dim == 2) {
+ sublo_bound[2] = 0.0;
+ subhi_bound[2] = 1.0;
+ }
+ sublo_bound[0] = h[0]*sublo_bound[0] + h[5]*sublo_bound[1] + h[4]*sublo_bound[2] + boxlo[0];
+ sublo_bound[1] = h[1]*sublo_bound[1] + h[3]*sublo_bound[2] + boxlo[1];
+ sublo_bound[2] = h[2]*sublo_bound[2] + boxlo[2];
+ subhi_bound[0] = h[0]*subhi_bound[0] + h[5]*subhi_bound[1] + h[4]*subhi_bound[2] + boxlo[0];
+ subhi_bound[1] = h[1]*subhi_bound[1] + h[3]*subhi_bound[2] + boxlo[1];
+ subhi_bound[2] = h[2]*subhi_bound[2] + boxlo[2];
} else {
// orthogonal box
for( i=0; i<3; ++i ) {
- sublo_bound[i] = sublo[i];
- subhi_bound[i] = subhi[i];
- cut_bound[i] = cut[i];
+ sublo_bound[i] = sublo[i]-cut[i]-e;
+ subhi_bound[i] = subhi[i]+cut[i]+e;
+ if (domain->periodicity[i]==0) {
+ sublo_bound[i] = MAX(sublo_bound[i],domain->boxlo[i]);
+ subhi_bound[i] = MIN(subhi_bound[i],domain->boxhi[i]);
+ }
+ }
+ if (dim == 2) {
+ sublo_bound[2] = sublo[2];
+ subhi_bound[2] = subhi[2];
}
}
// n = # of voro++ spatial hash cells (with approximately cubic cells)
int nall = nlocal + atom->nghost;
double n[3], V;
for( i=0; i<3; ++i ) n[i] = subhi_bound[i] - sublo_bound[i];
V = n[0]*n[1]*n[2];
for( i=0; i<3; ++i ) {
n[i] = round( n[i]*pow( double(nall)/(V*8.0), 0.333333 ) );
n[i] = n[i]==0 ? 1 : n[i];
}
// clear edge statistics
- for (i = 0; i < maxedge; ++i) edge[i]=0;
+ if ( maxedge > 0 )
+ for (i = 0; i <= maxedge; ++i) edge[i]=0;
// initialize voro++ container
// preallocates 8 atoms per cell
// voro++ allocates more memory if needed
int *mask = atom->mask;
if (radstr) {
// check and fetch atom style variable data
int radvar = input->variable->find(radstr);
if (radvar < 0)
error->all(FLERR,"Variable name for voronoi radius does not exist");
if (!input->variable->atomstyle(radvar))
error->all(FLERR,"Variable for voronoi radius is not atom style");
// prepare destination buffer for variable evaluation
if (nlocal > rmax) {
memory->destroy(rfield);
rmax = atom->nmax;
memory->create(rfield,rmax,"voronoi/atom:rfield");
}
// compute atom style radius variable
input->variable->compute_atom(radvar,0,rfield,1,0);
// communicate values to ghost atoms of neighboring nodes
comm->forward_comm_compute(this);
// polydisperse voro++ container
delete con_poly;
- con_poly = new container_poly(sublo_bound[0]-cut_bound[0]-e,subhi_bound[0]+cut_bound[0]+e,
- sublo_bound[1]-cut_bound[1]-e,subhi_bound[1]+cut_bound[1]+e,
- sublo_bound[2]-(dim==3 ? cut_bound[2]-e : 0.0),subhi_bound[2]+(dim==3 ? cut_bound[2]+e : 0.0),
- int(n[0]),int(n[1]),int(n[2]),false,false,false,8);
+ con_poly = new container_poly(sublo_bound[0],
+ subhi_bound[0],
+ sublo_bound[1],
+ subhi_bound[1],
+ sublo_bound[2],
+ subhi_bound[2],
+ int(n[0]),int(n[1]),int(n[2]),
+ false,false,false,8);
// pass coordinates for local and ghost atoms to voro++
for (i = 0; i < nall; i++) {
if( !onlyGroup || (mask[i] & groupbit) )
con_poly->put(i,x[i][0],x[i][1],x[i][2],rfield[i]);
}
} else {
// monodisperse voro++ container
delete con_mono;
- con_mono = new container(sublo_bound[0]-cut_bound[0]-e,subhi_bound[0]+cut_bound[0]+e,
- sublo_bound[1]-cut_bound[1]-e,subhi_bound[1]+cut_bound[1]+e,
- sublo_bound[2]-(dim==3 ? cut_bound[2]-e : 0.0),subhi_bound[2]+(dim==3 ? cut_bound[2]+e : 0.0),
- int(n[0]),int(n[1]),int(n[2]),false,false,false,8);
+
+ con_mono = new container(sublo_bound[0],
+ subhi_bound[0],
+ sublo_bound[1],
+ subhi_bound[1],
+ sublo_bound[2],
+ subhi_bound[2],
+ int(n[0]),int(n[1]),int(n[2]),
+ false,false,false,8);
// pass coordinates for local and ghost atoms to voro++
for (i = 0; i < nall; i++)
if( !onlyGroup || (mask[i] & groupbit) )
con_mono->put(i,x[i][0],x[i][1],x[i][2]);
}
}
void ComputeVoronoi::checkOccupation()
{
// clear occupation vector
memset(occvec, 0, oldnatoms*sizeof(*occvec));
int i, j, k,
nlocal = atom->nlocal,
nall = atom->nghost + nlocal;
double rx, ry, rz,
**x = atom->x;
// prepare destination buffer for variable evaluation
if (nall > lmax) {
memory->destroy(lnext);
lmax = atom->nmax;
memory->create(lnext,lmax,"voronoi/atom:lnext");
}
// clear lroot
for (i=0; i<oldnall; ++i) lroot[i] = -1;
// clear lnext
for (i=0; i<nall; ++i) lnext[i] = -1;
// loop over all local atoms and find out in which of the local first frame voronoi cells the are in
// (need to loop over ghosts, too, to get correct occupation numbers for the second column)
for (i=0; i<nall; ++i) {
// again: find_voronoi_cell() should be in the common base class. Why it is not, I don't know. Ask the voro++ author.
if (( radstr && con_poly->find_voronoi_cell(x[i][0], x[i][1], x[i][2], rx, ry, rz, k)) ||
( !radstr && con_mono->find_voronoi_cell(x[i][0], x[i][1], x[i][2], rx, ry, rz, k) )) {
// increase occupation count of this particular cell
// only for local atoms, as we do an MPI reduce sum later
if (i<nlocal) occvec[tags[k]-1]++;
// add this atom to the linked list of cell j
if (lroot[k]<0)
lroot[k]=i;
else {
j = lroot[k];
while (lnext[j]>=0) j=lnext[j];
lnext[j] = i;
}
}
}
// MPI sum occupation
#ifdef NOTINPLACE
memcpy(sendocc, occvec, oldnatoms*sizeof(*occvec));
MPI_Allreduce(sendocc, occvec, oldnatoms, MPI_INT, MPI_SUM, world);
#else
MPI_Allreduce(MPI_IN_PLACE, occvec, oldnatoms, MPI_INT, MPI_SUM, world);
#endif
// determine the total number of atoms in this atom's currently occupied cell
int c;
for (i=0; i<oldnall; i++) { // loop over lroot (old voronoi cells)
// count
c = 0;
j = lroot[i];
while (j>=0) {
c++;
j = lnext[j];
}
// set
j = lroot[i];
while (j>=0) {
voro[j][1] = c;
j = lnext[j];
}
}
// cherry pick currently owned atoms
for (i=0; i<nlocal; i++) {
// set the new atom count in the atom's first frame voronoi cell
voro[i][0] = occvec[atom->tag[i]-1];
}
}
void ComputeVoronoi::loopCells()
{
// invoke voro++ and fetch results for owned atoms in group
voronoicell_neighbor c;
int i;
+ if (faces_flag) nfaces = 0;
if (radstr) {
c_loop_all cl(*con_poly);
if (cl.start()) do if (con_poly->compute_cell(c,cl)) {
i = cl.pid();
processCell(c,i);
} while (cl.inc());
} else {
c_loop_all cl(*con_mono);
if (cl.start()) do if (con_mono->compute_cell(c,cl)) {
i = cl.pid();
processCell(c,i);
} while (cl.inc());
}
+ if (faces_flag) size_local_rows = nfaces;
+
}
/* ----------------------------------------------------------------------
memory usage of local atom-based array
------------------------------------------------------------------------- */
void ComputeVoronoi::processCell(voronoicell_neighbor &c, int i)
{
int j,k, *mask = atom->mask;
std::vector<int> neigh, norder, vlist;
std::vector<double> narea, vcell;
bool have_narea = false;
// zero out surface area if surface computation was requested
if (surface != VOROSURF_NONE && !onlyGroup) voro[i][2] = 0.0;
if (i < atom->nlocal && (mask[i] & groupbit)) {
// cell volume
voro[i][0] = c.volume();
// number of cell faces
c.neighbors(neigh);
int neighs = neigh.size();
if (fthresh > 0) {
// count only faces above area threshold
c.face_areas(narea);
have_narea = true;
voro[i][1] = 0.0;
for (j=0; j<narea.size(); ++j)
if (narea[j] > fthresh) voro[i][1] += 1.0;
} else {
// unthresholded face count
voro[i][1] = neighs;
}
// cell surface area
if (surface == VOROSURF_ALL) {
voro[i][2] = c.surface_area();
} else if (surface == VOROSURF_GROUP) {
if (!have_narea) c.face_areas(narea);
voro[i][2] = 0.0;
// each entry in neigh should correspond to an entry in narea
if (neighs != narea.size())
- error->all(FLERR,"Voro++ error: narea and neigh have a different size");
+ error->one(FLERR,"Voro++ error: narea and neigh have a different size");
// loop over all faces (neighbors) and check if they are in the surface group
for (j=0; j<neighs; ++j)
if (neigh[j] >= 0 && mask[neigh[j]] & sgroupbit)
voro[i][2] += narea[j];
}
// histogram of number of face edges
+
if (maxedge>0) {
if (ethresh > 0) {
// count only edges above length threshold
c.vertices(vcell);
c.face_vertices(vlist); // for each face: vertex count followed list of vertex indices (n_1,v1_1,v2_1,v3_1,..,vn_1,n_2,v2_1,...)
double dx, dy, dz, r2, t2 = ethresh*ethresh;
for( j=0; j<vlist.size(); j+=vlist[j]+1 ) {
int a, b, nedge = 0;
// vlist[j] contains number of vertex indices for the current face
for( k=0; k<vlist[j]; ++k ) {
a = vlist[j+1+k]; // first vertex in edge
b = vlist[j+1+(k+1)%vlist[j]]; // second vertex in edge (possible wrap around to first vertex in list)
dx = vcell[a*3] - vcell[b*3];
dy = vcell[a*3+1] - vcell[b*3+1];
dz = vcell[a*3+2] - vcell[b*3+2];
r2 = dx*dx+dy*dy+dz*dz;
if (r2 > t2) nedge++;
}
// counted edges above threshold, now put into the correct bin
if (nedge>0) {
if (nedge<=maxedge)
edge[nedge-1]++;
else
edge[maxedge]++;
}
}
} else {
// unthresholded edge counts
c.face_orders(norder);
for (j=0; j<voro[i][1]; ++j)
if (norder[j]>0) {
if (norder[j]<=maxedge)
edge[norder[j]-1]++;
else
edge[maxedge]++;
}
}
}
+
+ // store info for local faces
+
+ if (faces_flag) {
+ if (nfaces+voro[i][1] > nfacesmax) {
+ while (nfacesmax < nfaces+voro[i][1]) nfacesmax += FACESDELTA;
+ memory->grow(faces,nfacesmax,size_local_cols,"compute/voronoi/atom:faces");
+ array_local = faces;
+ }
+
+ if (!have_narea) c.face_areas(narea);
+
+ if (neighs != narea.size())
+ error->one(FLERR,"Voro++ error: narea and neigh have a different size");
+ tagint itag, jtag;
+ tagint *tag = atom->tag;
+ itag = tag[i];
+ for (j=0; j<neighs; ++j)
+ if (narea[j] > fthresh) {
+
+ // external faces assigned the tag 0
+
+ int jj = neigh[j];
+ if (jj >= 0) jtag = tag[jj];
+ else jtag = 0;
+
+ faces[nfaces][0] = itag;
+ faces[nfaces][1] = jtag;
+ faces[nfaces][2] = narea[j];
+ nfaces++;
+ }
+ }
+
+
} else if (i < atom->nlocal) voro[i][0] = voro[i][1] = 0.0;
}
double ComputeVoronoi::memory_usage()
{
double bytes = size_peratom_cols * nmax * sizeof(double);
+ // estimate based on average coordination of 12
+ if (faces_flag) bytes += 12 * size_local_cols * nmax * sizeof(double);
return bytes;
}
void ComputeVoronoi::compute_vector()
{
invoked_vector = update->ntimestep;
if( invoked_peratom < invoked_vector ) compute_peratom();
for( int i=0; i<size_vector; ++i ) sendvector[i] = edge[i];
MPI_Allreduce(sendvector,edge,size_vector,MPI_DOUBLE,MPI_SUM,world);
}
/* ---------------------------------------------------------------------- */
+void ComputeVoronoi::compute_local()
+{
+ invoked_local = update->ntimestep;
+ if( invoked_peratom < invoked_local ) compute_peratom();
+}
+
+/* ---------------------------------------------------------------------- */
+
int ComputeVoronoi::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,m=0;
for (i = 0; i < n; ++i) buf[m++] = rfield[list[i]];
return m;
}
/* ---------------------------------------------------------------------- */
void ComputeVoronoi::unpack_forward_comm(int n, int first, double *buf)
{
int i,last,m=0;
last = first + n;
for (i = first; i < last; ++i) rfield[i] = buf[m++];
}
diff --git a/src/VORONOI/compute_voronoi_atom.h b/src/VORONOI/compute_voronoi_atom.h
index ca58eca57..7d23a611b 100644
--- a/src/VORONOI/compute_voronoi_atom.h
+++ b/src/VORONOI/compute_voronoi_atom.h
@@ -1,94 +1,97 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(voronoi/atom,ComputeVoronoi)
#else
#ifndef LMP_COMPUTE_VORONOI_H
#define LMP_COMPUTE_VORONOI_H
#include "compute.h"
#include "voro++.hh"
namespace LAMMPS_NS {
class ComputeVoronoi : public Compute {
public:
ComputeVoronoi(class LAMMPS *, int, char **);
~ComputeVoronoi();
void init();
void compute_peratom();
void compute_vector();
+ void compute_local();
double memory_usage();
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
private:
voro::container *con_mono;
voro::container_poly *con_poly;
void buildCells();
void checkOccupation();
void loopCells();
void processCell(voro::voronoicell_neighbor&, int);
int nmax, rmax, maxedge, sgroupbit;
char *radstr;
double fthresh, ethresh;
double **voro;
double *edge, *sendvector, *rfield;
enum { VOROSURF_NONE, VOROSURF_ALL, VOROSURF_GROUP } surface;
bool onlyGroup, occupation;
tagint *tags;
int *occvec, *sendocc, *lroot, *lnext, lmax, oldnatoms, oldnall;
+ int faces_flag, nfaces, nfacesmax;
+ double **faces;
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Could not find compute/voronoi surface group ID
Self-explanatory.
E: Illegal compute voronoi/atom command (occupation and (surface or edges))
Self-explanatory.
E: Variable name for voronoi radius does not exist
Self-explanatory.
E: Variable for voronoi radius is not atom style
Self-explanatory.
E: Voro++ error: narea and neigh have a different size
This error is returned by the Voro++ library.
*/
diff --git a/src/atom.cpp b/src/atom.cpp
index 547df1b11..d8229051d 100644
--- a/src/atom.cpp
+++ b/src/atom.cpp
@@ -1,2154 +1,2166 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <mpi.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "atom.h"
#include "style_atom.h"
#include "atom_vec.h"
#include "atom_vec_ellipsoid.h"
#include "comm.h"
#include "neighbor.h"
#include "force.h"
#include "modify.h"
#include "fix.h"
#include "output.h"
#include "thermo.h"
#include "update.h"
#include "domain.h"
#include "group.h"
#include "molecule.h"
#include "accelerator_cuda.h"
#include "atom_masks.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define DELTA 1
#define DELTA_MEMSTR 1024
#define EPSILON 1.0e-6
#define CUDA_CHUNK 3000
enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files
/* ---------------------------------------------------------------------- */
Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
{
natoms = 0;
nlocal = nghost = nmax = 0;
ntypes = 0;
nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0;
nbonds = nangles = ndihedrals = nimpropers = 0;
firstgroupname = NULL;
sortfreq = 1000;
nextsort = 0;
userbinsize = 0.0;
maxbin = maxnext = 0;
binhead = NULL;
next = permute = NULL;
// initialize atom arrays
// customize by adding new array
tag = NULL;
type = mask = NULL;
image = NULL;
x = v = f = NULL;
molecule = NULL;
molindex = molatom = NULL;
q = NULL;
mu = NULL;
omega = angmom = torque = NULL;
radius = rmass = NULL;
ellipsoid = line = tri = body = NULL;
vfrac = s0 = NULL;
x0 = NULL;
spin = NULL;
eradius = ervel = erforce = NULL;
cs = csforce = vforce = ervelforce = NULL;
etag = NULL;
rho = drho = e = de = cv = NULL;
vest = NULL;
// USER-SMD
contact_radius = NULL;
smd_data_9 = NULL;
smd_stress = NULL;
eff_plastic_strain = NULL;
eff_plastic_strain_rate = NULL;
damage = NULL;
// molecular info
bond_per_atom = extra_bond_per_atom = 0;
num_bond = NULL;
bond_type = NULL;
bond_atom = NULL;
angle_per_atom = extra_angle_per_atom = 0;
num_angle = NULL;
angle_type = NULL;
angle_atom1 = angle_atom2 = angle_atom3 = NULL;
dihedral_per_atom = extra_dihedral_per_atom = 0;
num_dihedral = NULL;
dihedral_type = NULL;
dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = NULL;
improper_per_atom = extra_improper_per_atom = 0;
num_improper = NULL;
improper_type = NULL;
improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = NULL;
maxspecial = 1;
nspecial = NULL;
special = NULL;
// user-defined molecules
nmolecule = 0;
molecules = NULL;
// custom atom arrays
nivector = ndvector = 0;
ivector = NULL;
dvector = NULL;
iname = dname = NULL;
// initialize atom style and array existence flags
// customize by adding new flag
sphere_flag = peri_flag = electron_flag = 0;
wavepacket_flag = sph_flag = 0;
molecule_flag = 0;
q_flag = mu_flag = 0;
omega_flag = torque_flag = angmom_flag = 0;
radius_flag = rmass_flag = 0;
ellipsoid_flag = line_flag = tri_flag = body_flag = 0;
vfrac_flag = 0;
spin_flag = eradius_flag = ervel_flag = erforce_flag = ervelforce_flag = 0;
cs_flag = csforce_flag = vforce_flag = etag_flag = 0;
rho_flag = e_flag = cv_flag = vest_flag = 0;
// USER-SMD
smd_flag = 0;
contact_radius_flag = 0;
smd_data_9_flag = 0;
smd_stress_flag = 0;
x0_flag = 0;
eff_plastic_strain_flag = 0;
eff_plastic_strain_rate_flag = 0;
damage_flag = 0;
// Peridynamic scale factor
pdscale = 1.0;
// ntype-length arrays
mass = NULL;
mass_setflag = NULL;
// callback lists & extra restart info
nextra_grow = nextra_restart = nextra_border = 0;
extra_grow = extra_restart = extra_border = NULL;
nextra_grow_max = nextra_restart_max = nextra_border_max = 0;
nextra_store = 0;
extra = NULL;
// default atom ID and mapping values
tag_enable = 1;
map_style = map_user = 0;
map_tag_max = -1;
map_maxarray = map_nhash = -1;
max_same = 0;
sametag = NULL;
map_array = NULL;
map_bucket = NULL;
map_hash = NULL;
atom_style = NULL;
avec = NULL;
datamask = ALL_MASK;
datamask_ext = ALL_MASK;
}
/* ---------------------------------------------------------------------- */
Atom::~Atom()
{
delete [] atom_style;
delete avec;
delete [] firstgroupname;
memory->destroy(binhead);
memory->destroy(next);
memory->destroy(permute);
// delete atom arrays
// customize by adding new array
memory->destroy(tag);
memory->destroy(type);
memory->destroy(mask);
memory->destroy(image);
memory->destroy(x);
memory->destroy(v);
memory->destroy(f);
memory->destroy(molecule);
memory->destroy(molindex);
memory->destroy(molatom);
memory->destroy(q);
memory->destroy(mu);
memory->destroy(omega);
memory->destroy(angmom);
memory->destroy(torque);
memory->destroy(radius);
memory->destroy(rmass);
memory->destroy(ellipsoid);
memory->destroy(line);
memory->destroy(tri);
memory->destroy(body);
memory->destroy(vfrac);
memory->destroy(s0);
memory->destroy(x0);
memory->destroy(spin);
memory->destroy(eradius);
memory->destroy(ervel);
memory->destroy(erforce);
memory->destroy(ervelforce);
memory->destroy(cs);
memory->destroy(csforce);
memory->destroy(vforce);
memory->destroy(etag);
memory->destroy(rho);
memory->destroy(drho);
memory->destroy(e);
memory->destroy(de);
memory->destroy(cv);
memory->destroy(vest);
memory->destroy(contact_radius);
memory->destroy(smd_data_9);
memory->destroy(smd_stress);
memory->destroy(eff_plastic_strain);
memory->destroy(eff_plastic_strain_rate);
memory->destroy(damage);
memory->destroy(nspecial);
memory->destroy(special);
memory->destroy(num_bond);
memory->destroy(bond_type);
memory->destroy(bond_atom);
memory->destroy(num_angle);
memory->destroy(angle_type);
memory->destroy(angle_atom1);
memory->destroy(angle_atom2);
memory->destroy(angle_atom3);
memory->destroy(num_dihedral);
memory->destroy(dihedral_type);
memory->destroy(dihedral_atom1);
memory->destroy(dihedral_atom2);
memory->destroy(dihedral_atom3);
memory->destroy(dihedral_atom4);
memory->destroy(num_improper);
memory->destroy(improper_type);
memory->destroy(improper_atom1);
memory->destroy(improper_atom2);
memory->destroy(improper_atom3);
memory->destroy(improper_atom4);
// delete custom atom arrays
for (int i = 0; i < nivector; i++) {
delete [] iname[i];
memory->destroy(ivector[i]);
}
for (int i = 0; i < ndvector; i++) {
delete [] dname[i];
memory->destroy(dvector[i]);
}
memory->sfree(iname);
memory->sfree(dname);
memory->sfree(ivector);
memory->sfree(dvector);
// delete user-defined molecules
for (int i = 0; i < nmolecule; i++) delete molecules[i];
memory->sfree(molecules);
// delete per-type arrays
delete [] mass;
delete [] mass_setflag;
// delete extra arrays
memory->destroy(extra_grow);
memory->destroy(extra_restart);
memory->destroy(extra_border);
memory->destroy(extra);
// delete mapping data structures
map_delete();
}
/* ----------------------------------------------------------------------
copy modify settings from old Atom class to current Atom class
------------------------------------------------------------------------- */
void Atom::settings(Atom *old)
{
tag_enable = old->tag_enable;
map_user = old->map_user;
map_style = old->map_style;
sortfreq = old->sortfreq;
userbinsize = old->userbinsize;
if (old->firstgroupname) {
int n = strlen(old->firstgroupname) + 1;
firstgroupname = new char[n];
strcpy(firstgroupname,old->firstgroupname);
}
}
/* ----------------------------------------------------------------------
create an AtomVec style
called from lammps.cpp, input script, restart file, replicate
------------------------------------------------------------------------- */
void Atom::create_avec(const char *style, int narg, char **arg, int trysuffix)
{
delete [] atom_style;
if (avec) delete avec;
// unset atom style and array existence flags
// may have been set by old avec
// customize by adding new flag
sphere_flag = peri_flag = electron_flag = 0;
wavepacket_flag = sph_flag = 0;
molecule_flag = 0;
q_flag = mu_flag = 0;
omega_flag = torque_flag = angmom_flag = 0;
radius_flag = rmass_flag = 0;
ellipsoid_flag = line_flag = tri_flag = body_flag = 0;
vfrac_flag = 0;
spin_flag = eradius_flag = ervel_flag = erforce_flag = ervelforce_flag = 0;
cs_flag = csforce_flag = vforce_flag = etag_flag = 0;
rho_flag = e_flag = cv_flag = vest_flag = 0;
// create instance of AtomVec
// use grow() to initialize atom-based arrays to length 1
// so that x[0][0] can always be referenced even if proc has no atoms
int sflag;
avec = new_avec(style,trysuffix,sflag);
avec->store_args(narg,arg);
avec->process_args(narg,arg);
avec->grow(1);
if (sflag) {
char estyle[256];
if (sflag == 1) sprintf(estyle,"%s/%s",style,lmp->suffix);
else sprintf(estyle,"%s/%s",style,lmp->suffix2);
int n = strlen(estyle) + 1;
atom_style = new char[n];
strcpy(atom_style,estyle);
} else {
int n = strlen(style) + 1;
atom_style = new char[n];
strcpy(atom_style,style);
}
// if molecular system:
// atom IDs must be defined
// force atom map to be created
// map style may be reset by map_init() and its call to map_style_set()
molecular = avec->molecular;
if (molecular && tag_enable == 0)
error->all(FLERR,"Atom IDs must be used for molecular systems");
if (molecular) map_style = 1;
}
/* ----------------------------------------------------------------------
generate an AtomVec class, first with suffix appended
------------------------------------------------------------------------- */
AtomVec *Atom::new_avec(const char *style, int trysuffix, int &sflag)
{
if (trysuffix && lmp->suffix_enable) {
if (lmp->suffix) {
sflag = 1;
char estyle[256];
sprintf(estyle,"%s/%s",style,lmp->suffix);
if (0) return NULL;
#define ATOM_CLASS
#define AtomStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) return new Class(lmp);
#include "style_atom.h"
#undef AtomStyle
#undef ATOM_CLASS
}
if (lmp->suffix2) {
sflag = 2;
char estyle[256];
sprintf(estyle,"%s/%s",style,lmp->suffix2);
if (0) return NULL;
#define ATOM_CLASS
#define AtomStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) return new Class(lmp);
#include "style_atom.h"
#undef AtomStyle
#undef ATOM_CLASS
}
}
sflag = 0;
if (0) return NULL;
#define ATOM_CLASS
#define AtomStyle(key,Class) \
else if (strcmp(style,#key) == 0) return new Class(lmp);
#include "style_atom.h"
#undef ATOM_CLASS
else error->all(FLERR,"Unknown atom style");
return NULL;
}
/* ---------------------------------------------------------------------- */
void Atom::init()
{
// delete extra array since it doesn't persist past first run
if (nextra_store) {
memory->destroy(extra);
extra = NULL;
nextra_store = 0;
}
// check arrays that are atom type in length
check_mass();
// setup of firstgroup
if (firstgroupname) {
firstgroup = group->find(firstgroupname);
if (firstgroup < 0)
error->all(FLERR,"Could not find atom_modify first group ID");
} else firstgroup = -1;
// init AtomVec
avec->init();
}
/* ---------------------------------------------------------------------- */
void Atom::setup()
{
// setup bins for sorting
// cannot do this in init() because uses neighbor cutoff
if (sortfreq > 0) setup_sort_bins();
}
/* ----------------------------------------------------------------------
return ptr to AtomVec class if matches style or to matching hybrid sub-class
return NULL if no match
------------------------------------------------------------------------- */
AtomVec *Atom::style_match(const char *style)
{
if (strcmp(atom_style,style) == 0) return avec;
else if (strcmp(atom_style,"hybrid") == 0) {
AtomVecHybrid *avec_hybrid = (AtomVecHybrid *) avec;
for (int i = 0; i < avec_hybrid->nstyles; i++)
if (strcmp(avec_hybrid->keywords[i],style) == 0)
return avec_hybrid->styles[i];
}
return NULL;
}
/* ----------------------------------------------------------------------
modify parameters of the atom style
some options can only be invoked before simulation box is defined
first and sort options cannot be used together
------------------------------------------------------------------------- */
void Atom::modify_params(int narg, char **arg)
{
if (narg == 0) error->all(FLERR,"Illegal atom_modify command");
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"id") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command");
if (domain->box_exist)
error->all(FLERR,
"Atom_modify id command after simulation box is defined");
if (strcmp(arg[iarg+1],"yes") == 0) tag_enable = 1;
else if (strcmp(arg[iarg+1],"no") == 0) tag_enable = 0;
else error->all(FLERR,"Illegal atom_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"map") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command");
if (domain->box_exist)
error->all(FLERR,
"Atom_modify map command after simulation box is defined");
if (strcmp(arg[iarg+1],"array") == 0) map_user = 1;
else if (strcmp(arg[iarg+1],"hash") == 0) map_user = 2;
else error->all(FLERR,"Illegal atom_modify command");
map_style = map_user;
iarg += 2;
} else if (strcmp(arg[iarg],"first") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command");
if (strcmp(arg[iarg+1],"all") == 0) {
delete [] firstgroupname;
firstgroupname = NULL;
} else {
int n = strlen(arg[iarg+1]) + 1;
firstgroupname = new char[n];
strcpy(firstgroupname,arg[iarg+1]);
sortfreq = 0;
}
iarg += 2;
} else if (strcmp(arg[iarg],"sort") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal atom_modify command");
sortfreq = force->inumeric(FLERR,arg[iarg+1]);
userbinsize = force->numeric(FLERR,arg[iarg+2]);
if (sortfreq < 0 || userbinsize < 0.0)
error->all(FLERR,"Illegal atom_modify command");
if (sortfreq >= 0 && firstgroupname)
error->all(FLERR,"Atom_modify sort and first options "
"cannot be used together");
iarg += 3;
} else error->all(FLERR,"Illegal atom_modify command");
}
}
/* ----------------------------------------------------------------------
check that atom IDs are valid
error if any atom ID < 0 or atom ID = MAXTAGINT
if any atom ID > 0, error if any atom ID == 0
if any atom ID > 0, error if tag_enable = 0
if all atom IDs = 0, tag_enable must be 0
if max atom IDs < natoms, must be duplicates
OK if max atom IDs > natoms
NOTE: not fully checking that atom IDs are unique
------------------------------------------------------------------------- */
void Atom::tag_check()
{
tagint min = MAXTAGINT;
tagint max = 0;
for (int i = 0; i < nlocal; i++) {
min = MIN(min,tag[i]);
max = MAX(max,tag[i]);
}
tagint minall,maxall;
MPI_Allreduce(&min,&minall,1,MPI_LMP_TAGINT,MPI_MIN,world);
MPI_Allreduce(&max,&maxall,1,MPI_LMP_TAGINT,MPI_MAX,world);
if (minall < 0) error->all(FLERR,"One or more Atom IDs is negative");
if (maxall >= MAXTAGINT) error->all(FLERR,"One or more atom IDs is too big");
if (maxall > 0 && minall == 0)
error->all(FLERR,"One or more atom IDs is zero");
if (maxall > 0 && tag_enable == 0)
error->all(FLERR,"Non-zero atom IDs with atom_modify id = no");
if (maxall == 0 && natoms && tag_enable)
error->all(FLERR,"All atom IDs = 0 but atom_modify id = yes");
if (tag_enable && maxall < natoms)
error->all(FLERR,"Duplicate atom IDs exist");
}
/* ----------------------------------------------------------------------
add unique tags to any atoms with tag = 0
new tags are grouped by proc and start after max current tag
called after creating new atoms
error if new tags will exceed MAXTAGINT
------------------------------------------------------------------------- */
void Atom::tag_extend()
{
// maxtag_all = max tag for all atoms
tagint maxtag = 0;
for (int i = 0; i < nlocal; i++) maxtag = MAX(maxtag,tag[i]);
tagint maxtag_all;
MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
// DEBUG: useful for generating 64-bit IDs even for small systems
// use only when LAMMPS is compiled with BIGBIG
//maxtag_all += 1000000000000;
// notag = # of atoms I own with no tag (tag = 0)
// notag_sum = # of total atoms on procs <= me with no tag
bigint notag = 0;
for (int i = 0; i < nlocal; i++) if (tag[i] == 0) notag++;
bigint notag_total;
MPI_Allreduce(&notag,&notag_total,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (notag_total >= MAXTAGINT)
error->all(FLERR,"New atom IDs exceed maximum allowed ID");
bigint notag_sum;
MPI_Scan(&notag,&notag_sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
// itag = 1st new tag that my untagged atoms should use
tagint itag = maxtag_all + notag_sum - notag + 1;
for (int i = 0; i < nlocal; i++) if (tag[i] == 0) tag[i] = itag++;
}
/* ----------------------------------------------------------------------
check that atom IDs span range from 1 to Natoms inclusive
return 0 if mintag != 1 or maxtag != Natoms
return 1 if OK
doesn't actually check if all tag values are used
------------------------------------------------------------------------- */
int Atom::tag_consecutive()
{
tagint idmin = MAXTAGINT;
tagint idmax = 0;
for (int i = 0; i < nlocal; i++) {
idmin = MIN(idmin,tag[i]);
idmax = MAX(idmax,tag[i]);
}
tagint idminall,idmaxall;
MPI_Allreduce(&idmin,&idminall,1,MPI_LMP_TAGINT,MPI_MIN,world);
MPI_Allreduce(&idmax,&idmaxall,1,MPI_LMP_TAGINT,MPI_MAX,world);
if (idminall != 1 || idmaxall != natoms) return 0;
return 1;
}
/* ----------------------------------------------------------------------
count and return words in a single line
make copy of line before using strtok so as not to change line
trim anything from '#' onward
------------------------------------------------------------------------- */
int Atom::count_words(const char *line)
{
int n = strlen(line) + 1;
char *copy;
memory->create(copy,n,"atom:copy");
strcpy(copy,line);
char *ptr;
if ((ptr = strchr(copy,'#'))) *ptr = '\0';
if (strtok(copy," \t\n\r\f") == NULL) {
memory->destroy(copy);
return 0;
}
n = 1;
while (strtok(NULL," \t\n\r\f")) n++;
memory->destroy(copy);
return n;
}
/* ----------------------------------------------------------------------
count and return words in a single line using provided copy buf
make copy of line before using strtok so as not to change line
trim anything from '#' onward
------------------------------------------------------------------------- */
int Atom::count_words(const char *line, char *copy)
{
strcpy(copy,line);
char *ptr;
if ((ptr = strchr(copy,'#'))) *ptr = '\0';
if (strtok(copy," \t\n\r\f") == NULL) {
memory->destroy(copy);
return 0;
}
int n = 1;
while (strtok(NULL," \t\n\r\f")) n++;
return n;
}
/* ----------------------------------------------------------------------
deallocate molecular topology arrays
done before realloc with (possibly) new 2nd dimension set to
correctly initialized per-atom values, e.g. bond_per_atom
needs to be called whenever 2nd dimensions are changed
and these arrays are already pre-allocated,
e.g. due to grow(1) in create_avec()
------------------------------------------------------------------------- */
void Atom::deallocate_topology()
{
memory->destroy(atom->bond_type);
memory->destroy(atom->bond_atom);
atom->bond_type = NULL;
atom->bond_atom = NULL;
memory->destroy(atom->angle_type);
memory->destroy(atom->angle_atom1);
memory->destroy(atom->angle_atom2);
memory->destroy(atom->angle_atom3);
atom->angle_type = NULL;
atom->angle_atom1 = atom->angle_atom2 = atom->angle_atom3 = NULL;
memory->destroy(atom->dihedral_type);
memory->destroy(atom->dihedral_atom1);
memory->destroy(atom->dihedral_atom2);
memory->destroy(atom->dihedral_atom3);
memory->destroy(atom->dihedral_atom4);
atom->dihedral_type = NULL;
atom->dihedral_atom1 = atom->dihedral_atom2 =
atom->dihedral_atom3 = atom->dihedral_atom4 = NULL;
memory->destroy(atom->improper_type);
memory->destroy(atom->improper_atom1);
memory->destroy(atom->improper_atom2);
memory->destroy(atom->improper_atom3);
memory->destroy(atom->improper_atom4);
atom->improper_type = NULL;
atom->improper_atom1 = atom->improper_atom2 =
atom->improper_atom3 = atom->improper_atom4 = NULL;
}
/* ----------------------------------------------------------------------
unpack N lines from Atom section of data file
call style-specific routine to parse line
------------------------------------------------------------------------- */
void Atom::data_atoms(int n, char *buf, tagint id_offset, int type_offset,
int shiftflag, double *shift)
{
int m,xptr,iptr;
imageint imagedata;
double xdata[3],lamda[3];
double *coord;
char *next;
next = strchr(buf,'\n');
*next = '\0';
int nwords = count_words(buf);
*next = '\n';
if (nwords != avec->size_data_atom && nwords != avec->size_data_atom + 3)
error->all(FLERR,"Incorrect atom format in data file");
char **values = new char*[nwords];
// set bounds for my proc
// if periodic and I am lo/hi proc, adjust bounds by EPSILON
// insures all data atoms will be owned even with round-off
int triclinic = domain->triclinic;
double epsilon[3];
if (triclinic) epsilon[0] = epsilon[1] = epsilon[2] = EPSILON;
else {
epsilon[0] = domain->prd[0] * EPSILON;
epsilon[1] = domain->prd[1] * EPSILON;
epsilon[2] = domain->prd[2] * EPSILON;
}
double sublo[3],subhi[3];
if (triclinic == 0) {
sublo[0] = domain->sublo[0]; subhi[0] = domain->subhi[0];
sublo[1] = domain->sublo[1]; subhi[1] = domain->subhi[1];
sublo[2] = domain->sublo[2]; subhi[2] = domain->subhi[2];
} else {
sublo[0] = domain->sublo_lamda[0]; subhi[0] = domain->subhi_lamda[0];
sublo[1] = domain->sublo_lamda[1]; subhi[1] = domain->subhi_lamda[1];
sublo[2] = domain->sublo_lamda[2]; subhi[2] = domain->subhi_lamda[2];
}
if (comm->layout != LAYOUT_TILED) {
if (domain->xperiodic) {
if (comm->myloc[0] == 0) sublo[0] -= epsilon[0];
if (comm->myloc[0] == comm->procgrid[0]-1) subhi[0] += epsilon[0];
}
if (domain->yperiodic) {
if (comm->myloc[1] == 0) sublo[1] -= epsilon[1];
if (comm->myloc[1] == comm->procgrid[1]-1) subhi[1] += epsilon[1];
}
if (domain->zperiodic) {
if (comm->myloc[2] == 0) sublo[2] -= epsilon[2];
if (comm->myloc[2] == comm->procgrid[2]-1) subhi[2] += epsilon[2];
}
} else {
if (domain->xperiodic) {
if (comm->mysplit[0][0] == 0.0) sublo[0] -= epsilon[0];
if (comm->mysplit[0][1] == 1.0) subhi[0] += epsilon[0];
}
if (domain->yperiodic) {
if (comm->mysplit[1][0] == 0.0) sublo[1] -= epsilon[1];
if (comm->mysplit[1][1] == 1.0) subhi[1] += epsilon[1];
}
if (domain->zperiodic) {
if (comm->mysplit[2][0] == 0.0) sublo[2] -= epsilon[2];
if (comm->mysplit[2][1] == 1.0) subhi[2] += epsilon[2];
}
}
// xptr = which word in line starts xyz coords
// iptr = which word in line starts ix,iy,iz image flags
xptr = avec->xcol_data - 1;
int imageflag = 0;
if (nwords > avec->size_data_atom) imageflag = 1;
if (imageflag) iptr = nwords - 3;
// loop over lines of atom data
// tokenize the line into values
// extract xyz coords and image flags
// remap atom into simulation box
// if atom is in my sub-domain, unpack its values
for (int i = 0; i < n; i++) {
next = strchr(buf,'\n');
values[0] = strtok(buf," \t\n\r\f");
if (values[0] == NULL)
error->all(FLERR,"Incorrect atom format in data file");
for (m = 1; m < nwords; m++) {
values[m] = strtok(NULL," \t\n\r\f");
if (values[m] == NULL)
error->all(FLERR,"Incorrect atom format in data file");
}
if (imageflag)
imagedata = ((imageint) (atoi(values[iptr]) + IMGMAX) & IMGMASK) |
(((imageint) (atoi(values[iptr+1]) + IMGMAX) & IMGMASK) << IMGBITS) |
(((imageint) (atoi(values[iptr+2]) + IMGMAX) & IMGMASK) << IMG2BITS);
else imagedata = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
xdata[0] = atof(values[xptr]);
xdata[1] = atof(values[xptr+1]);
xdata[2] = atof(values[xptr+2]);
if (shiftflag) {
xdata[0] += shift[0];
xdata[1] += shift[1];
xdata[2] += shift[2];
}
domain->remap(xdata,imagedata);
if (triclinic) {
domain->x2lamda(xdata,lamda);
coord = lamda;
} else coord = xdata;
if (coord[0] >= sublo[0] && coord[0] < subhi[0] &&
coord[1] >= sublo[1] && coord[1] < subhi[1] &&
coord[2] >= sublo[2] && coord[2] < subhi[2]) {
avec->data_atom(xdata,imagedata,values);
if (id_offset) tag[nlocal-1] += id_offset;
if (type_offset) {
type[nlocal-1] += type_offset;
if (type[nlocal-1] > ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
}
}
buf = next + 1;
}
delete [] values;
}
/* ----------------------------------------------------------------------
unpack N lines from Velocity section of data file
check that atom IDs are > 0 and <= map_tag_max
call style-specific routine to parse line
------------------------------------------------------------------------- */
void Atom::data_vels(int n, char *buf, tagint id_offset)
{
int j,m;
tagint tagdata;
char *next;
next = strchr(buf,'\n');
*next = '\0';
int nwords = count_words(buf);
*next = '\n';
if (nwords != avec->size_data_vel)
error->all(FLERR,"Incorrect velocity format in data file");
char **values = new char*[nwords];
// loop over lines of atom velocities
// tokenize the line into values
// if I own atom tag, unpack its values
for (int i = 0; i < n; i++) {
next = strchr(buf,'\n');
values[0] = strtok(buf," \t\n\r\f");
for (j = 1; j < nwords; j++)
values[j] = strtok(NULL," \t\n\r\f");
tagdata = ATOTAGINT(values[0]) + id_offset;
if (tagdata <= 0 || tagdata > map_tag_max)
error->one(FLERR,"Invalid atom ID in Velocities section of data file");
if ((m = map(tagdata)) >= 0) avec->data_vel(m,&values[1]);
buf = next + 1;
}
delete [] values;
}
/* ----------------------------------------------------------------------
process N bonds read into buf from data files
if count is non-NULL, just count bonds per atom
else store them with atoms
check that atom IDs are > 0 and <= map_tag_max
------------------------------------------------------------------------- */
void Atom::data_bonds(int n, char *buf, int *count, tagint id_offset,
int type_offset)
{
int m,tmp,itype;
tagint atom1,atom2;
char *next;
int newton_bond = force->newton_bond;
for (int i = 0; i < n; i++) {
next = strchr(buf,'\n');
*next = '\0';
sscanf(buf,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT,
&tmp,&itype,&atom1,&atom2);
if (id_offset) {
atom1 += id_offset;
atom2 += id_offset;
}
itype += type_offset;
if (atom1 <= 0 || atom1 > map_tag_max ||
atom2 <= 0 || atom2 > map_tag_max)
error->one(FLERR,"Invalid atom ID in Bonds section of data file");
if (itype <= 0 || itype > nbondtypes)
error->one(FLERR,"Invalid bond type in Bonds section of data file");
if ((m = map(atom1)) >= 0) {
if (count) count[m]++;
else {
bond_type[m][num_bond[m]] = itype;
bond_atom[m][num_bond[m]] = atom2;
num_bond[m]++;
}
}
if (newton_bond == 0) {
if ((m = map(atom2)) >= 0) {
if (count) count[m]++;
else {
bond_type[m][num_bond[m]] = itype;
bond_atom[m][num_bond[m]] = atom1;
num_bond[m]++;
}
}
}
buf = next + 1;
}
}
/* ----------------------------------------------------------------------
process N angles read into buf from data files
if count is non-NULL, just count angles per atom
else store them with atoms
check that atom IDs are > 0 and <= map_tag_max
------------------------------------------------------------------------- */
void Atom::data_angles(int n, char *buf, int *count, tagint id_offset,
int type_offset)
{
int m,tmp,itype;
tagint atom1,atom2,atom3;
char *next;
int newton_bond = force->newton_bond;
for (int i = 0; i < n; i++) {
next = strchr(buf,'\n');
*next = '\0';
sscanf(buf,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT,
&tmp,&itype,&atom1,&atom2,&atom3);
if (id_offset) {
atom1 += id_offset;
atom2 += id_offset;
atom3 += id_offset;
}
itype += type_offset;
if (atom1 <= 0 || atom1 > map_tag_max ||
atom2 <= 0 || atom2 > map_tag_max ||
atom3 <= 0 || atom3 > map_tag_max)
error->one(FLERR,"Invalid atom ID in Angles section of data file");
if (itype <= 0 || itype > nangletypes)
error->one(FLERR,"Invalid angle type in Angles section of data file");
if ((m = map(atom2)) >= 0) {
if (count) count[m]++;
else {
angle_type[m][num_angle[m]] = itype;
angle_atom1[m][num_angle[m]] = atom1;
angle_atom2[m][num_angle[m]] = atom2;
angle_atom3[m][num_angle[m]] = atom3;
num_angle[m]++;
}
}
if (newton_bond == 0) {
if ((m = map(atom1)) >= 0) {
if (count) count[m]++;
else {
angle_type[m][num_angle[m]] = itype;
angle_atom1[m][num_angle[m]] = atom1;
angle_atom2[m][num_angle[m]] = atom2;
angle_atom3[m][num_angle[m]] = atom3;
num_angle[m]++;
}
}
if ((m = map(atom3)) >= 0) {
if (count) count[m]++;
else {
angle_type[m][num_angle[m]] = itype;
angle_atom1[m][num_angle[m]] = atom1;
angle_atom2[m][num_angle[m]] = atom2;
angle_atom3[m][num_angle[m]] = atom3;
num_angle[m]++;
}
}
}
buf = next + 1;
}
}
/* ----------------------------------------------------------------------
process N dihedrals read into buf from data files
if count is non-NULL, just count diihedrals per atom
else store them with atoms
check that atom IDs are > 0 and <= map_tag_max
------------------------------------------------------------------------- */
void Atom::data_dihedrals(int n, char *buf, int *count, tagint id_offset,
int type_offset)
{
int m,tmp,itype;
tagint atom1,atom2,atom3,atom4;
char *next;
int newton_bond = force->newton_bond;
for (int i = 0; i < n; i++) {
next = strchr(buf,'\n');
*next = '\0';
sscanf(buf,"%d %d "
TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT,
&tmp,&itype,&atom1,&atom2,&atom3,&atom4);
if (id_offset) {
atom1 += id_offset;
atom2 += id_offset;
atom3 += id_offset;
atom4 += id_offset;
}
itype += type_offset;
if (atom1 <= 0 || atom1 > map_tag_max ||
atom2 <= 0 || atom2 > map_tag_max ||
atom3 <= 0 || atom3 > map_tag_max ||
atom4 <= 0 || atom4 > map_tag_max)
error->one(FLERR,"Invalid atom ID in Dihedrals section of data file");
if (itype <= 0 || itype > ndihedraltypes)
error->one(FLERR,
"Invalid dihedral type in Dihedrals section of data file");
if ((m = map(atom2)) >= 0) {
if (count) count[m]++;
else {
dihedral_type[m][num_dihedral[m]] = itype;
dihedral_atom1[m][num_dihedral[m]] = atom1;
dihedral_atom2[m][num_dihedral[m]] = atom2;
dihedral_atom3[m][num_dihedral[m]] = atom3;
dihedral_atom4[m][num_dihedral[m]] = atom4;
num_dihedral[m]++;
}
}
if (newton_bond == 0) {
if ((m = map(atom1)) >= 0) {
if (count) count[m]++;
else {
dihedral_type[m][num_dihedral[m]] = itype;
dihedral_atom1[m][num_dihedral[m]] = atom1;
dihedral_atom2[m][num_dihedral[m]] = atom2;
dihedral_atom3[m][num_dihedral[m]] = atom3;
dihedral_atom4[m][num_dihedral[m]] = atom4;
num_dihedral[m]++;
}
}
if ((m = map(atom3)) >= 0) {
if (count) count[m]++;
else {
dihedral_type[m][num_dihedral[m]] = itype;
dihedral_atom1[m][num_dihedral[m]] = atom1;
dihedral_atom2[m][num_dihedral[m]] = atom2;
dihedral_atom3[m][num_dihedral[m]] = atom3;
dihedral_atom4[m][num_dihedral[m]] = atom4;
num_dihedral[m]++;
}
}
if ((m = map(atom4)) >= 0) {
if (count) count[m]++;
else {
dihedral_type[m][num_dihedral[m]] = itype;
dihedral_atom1[m][num_dihedral[m]] = atom1;
dihedral_atom2[m][num_dihedral[m]] = atom2;
dihedral_atom3[m][num_dihedral[m]] = atom3;
dihedral_atom4[m][num_dihedral[m]] = atom4;
num_dihedral[m]++;
}
}
}
buf = next + 1;
}
}
/* ----------------------------------------------------------------------
process N impropers read into buf from data files
if count is non-NULL, just count impropers per atom
else store them with atoms
check that atom IDs are > 0 and <= map_tag_max
------------------------------------------------------------------------- */
void Atom::data_impropers(int n, char *buf, int *count, tagint id_offset,
int type_offset)
{
int m,tmp,itype;
tagint atom1,atom2,atom3,atom4;
char *next;
int newton_bond = force->newton_bond;
for (int i = 0; i < n; i++) {
next = strchr(buf,'\n');
*next = '\0';
sscanf(buf,"%d %d "
TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT,
&tmp,&itype,&atom1,&atom2,&atom3,&atom4);
if (id_offset) {
atom1 += id_offset;
atom2 += id_offset;
atom3 += id_offset;
atom4 += id_offset;
}
itype += type_offset;
if (atom1 <= 0 || atom1 > map_tag_max ||
atom2 <= 0 || atom2 > map_tag_max ||
atom3 <= 0 || atom3 > map_tag_max ||
atom4 <= 0 || atom4 > map_tag_max)
error->one(FLERR,"Invalid atom ID in Impropers section of data file");
if (itype <= 0 || itype > nimpropertypes)
error->one(FLERR,
"Invalid improper type in Impropers section of data file");
if ((m = map(atom2)) >= 0) {
if (count) count[m]++;
else {
improper_type[m][num_improper[m]] = itype;
improper_atom1[m][num_improper[m]] = atom1;
improper_atom2[m][num_improper[m]] = atom2;
improper_atom3[m][num_improper[m]] = atom3;
improper_atom4[m][num_improper[m]] = atom4;
num_improper[m]++;
}
}
if (newton_bond == 0) {
if ((m = map(atom1)) >= 0) {
if (count) count[m]++;
else {
improper_type[m][num_improper[m]] = itype;
improper_atom1[m][num_improper[m]] = atom1;
improper_atom2[m][num_improper[m]] = atom2;
improper_atom3[m][num_improper[m]] = atom3;
improper_atom4[m][num_improper[m]] = atom4;
num_improper[m]++;
}
}
if ((m = map(atom3)) >= 0) {
if (count) count[m]++;
else {
improper_type[m][num_improper[m]] = itype;
improper_atom1[m][num_improper[m]] = atom1;
improper_atom2[m][num_improper[m]] = atom2;
improper_atom3[m][num_improper[m]] = atom3;
improper_atom4[m][num_improper[m]] = atom4;
num_improper[m]++;
}
}
if ((m = map(atom4)) >= 0) {
if (count) count[m]++;
else {
improper_type[m][num_improper[m]] = itype;
improper_atom1[m][num_improper[m]] = atom1;
improper_atom2[m][num_improper[m]] = atom2;
improper_atom3[m][num_improper[m]] = atom3;
improper_atom4[m][num_improper[m]] = atom4;
num_improper[m]++;
}
}
}
buf = next + 1;
}
}
/* ----------------------------------------------------------------------
unpack N lines from atom-style specific bonus section of data file
check that atom IDs are > 0 and <= map_tag_max
call style-specific routine to parse line
------------------------------------------------------------------------- */
void Atom::data_bonus(int n, char *buf, AtomVec *avec_bonus, tagint id_offset)
{
int j,m,tagdata;
char *next;
next = strchr(buf,'\n');
*next = '\0';
int nwords = count_words(buf);
*next = '\n';
if (nwords != avec_bonus->size_data_bonus)
error->all(FLERR,"Incorrect bonus data format in data file");
char **values = new char*[nwords];
// loop over lines of bonus atom data
// tokenize the line into values
// if I own atom tag, unpack its values
for (int i = 0; i < n; i++) {
next = strchr(buf,'\n');
values[0] = strtok(buf," \t\n\r\f");
for (j = 1; j < nwords; j++)
values[j] = strtok(NULL," \t\n\r\f");
tagdata = ATOTAGINT(values[0]) + id_offset;
if (tagdata <= 0 || tagdata > map_tag_max)
error->one(FLERR,"Invalid atom ID in Bonus section of data file");
// ok to call child's data_atom_bonus() method thru parent avec_bonus,
// since data_bonus() was called with child ptr, and method is virtual
if ((m = map(tagdata)) >= 0) avec_bonus->data_atom_bonus(m,&values[1]);
buf = next + 1;
}
delete [] values;
}
/* ----------------------------------------------------------------------
unpack N bodies from Bodies section of data file
each body spans multiple lines
check that atom IDs are > 0 and <= map_tag_max
call style-specific routine to parse line
------------------------------------------------------------------------- */
void Atom::data_bodies(int n, char *buf, AtomVecBody *avec_body,
tagint id_offset)
{
- int j,m,tagdata,ninteger,ndouble;
+ int j,m,nvalues,tagdata,ninteger,ndouble;
int maxint = 0;
int maxdouble = 0;
- char **ivalues = NULL;
- char **dvalues = NULL;
+ int *ivalues = NULL;
+ double *dvalues = NULL;
// loop over lines of body data
- // tokenize the lines into ivalues and dvalues
- // if I own atom tag, unpack its values
+ // if I own atom tag, tokenize lines into ivalues/dvalues, call data_body()
+ // else skip values
for (int i = 0; i < n; i++) {
if (i == 0) tagdata = ATOTAGINT(strtok(buf," \t\n\r\f")) + id_offset;
else tagdata = ATOTAGINT(strtok(NULL," \t\n\r\f")) + id_offset;
- ninteger = atoi(strtok(NULL," \t\n\r\f"));
- ndouble = atoi(strtok(NULL," \t\n\r\f"));
-
- if (ninteger > maxint) {
- delete [] ivalues;
- maxint = ninteger;
- ivalues = new char*[maxint];
- }
- if (ndouble > maxdouble) {
- delete [] dvalues;
- maxdouble = ndouble;
- dvalues = new char*[maxdouble];
- }
-
- for (j = 0; j < ninteger; j++)
- ivalues[j] = strtok(NULL," \t\n\r\f");
- for (j = 0; j < ndouble; j++)
- dvalues[j] = strtok(NULL," \t\n\r\f");
-
if (tagdata <= 0 || tagdata > map_tag_max)
error->one(FLERR,"Invalid atom ID in Bodies section of data file");
- if ((m = map(tagdata)) >= 0)
+ ninteger = force->inumeric(FLERR,strtok(NULL," \t\n\r\f"));
+ ndouble = force->inumeric(FLERR,strtok(NULL," \t\n\r\f"));
+
+ if ((m = map(tagdata)) >= 0) {
+ if (ninteger > maxint) {
+ delete [] ivalues;
+ maxint = ninteger;
+ ivalues = new int[maxint];
+ }
+ if (ndouble > maxdouble) {
+ delete [] dvalues;
+ maxdouble = ndouble;
+ dvalues = new double[maxdouble];
+ }
+
+ for (j = 0; j < ninteger; j++)
+ ivalues[j] = force->inumeric(FLERR,strtok(NULL," \t\n\r\f"));
+ for (j = 0; j < ndouble; j++)
+ dvalues[j] = force->numeric(FLERR,strtok(NULL," \t\n\r\f"));
+
avec_body->data_body(m,ninteger,ndouble,ivalues,dvalues);
+
+ } else {
+ nvalues = ninteger + ndouble; // number of values to skip
+ for (j = 0; j < nvalues; j++)
+ strtok(NULL," \t\n\r\f");
+ }
}
delete [] ivalues;
delete [] dvalues;
}
/* ----------------------------------------------------------------------
allocate arrays of length ntypes
only done after ntypes is set
------------------------------------------------------------------------- */
void Atom::allocate_type_arrays()
{
if (avec->mass_type) {
mass = new double[ntypes+1];
mass_setflag = new int[ntypes+1];
for (int itype = 1; itype <= ntypes; itype++) mass_setflag[itype] = 0;
}
}
/* ----------------------------------------------------------------------
set a mass and flag it as set
called from reading of data file
type_offset may be used when reading multiple data files
------------------------------------------------------------------------- */
void Atom::set_mass(const char *str, int type_offset)
{
if (mass == NULL) error->all(FLERR,"Cannot set mass for this atom style");
int itype;
double mass_one;
int n = sscanf(str,"%d %lg",&itype,&mass_one);
if (n != 2) error->all(FLERR,"Invalid mass line in data file");
itype += type_offset;
if (itype < 1 || itype > ntypes)
error->all(FLERR,"Invalid type for mass set");
mass[itype] = mass_one;
mass_setflag[itype] = 1;
if (mass[itype] <= 0.0) error->all(FLERR,"Invalid mass value");
}
/* ----------------------------------------------------------------------
set a mass and flag it as set
called from EAM pair routine
------------------------------------------------------------------------- */
void Atom::set_mass(int itype, double value)
{
if (mass == NULL) error->all(FLERR,"Cannot set mass for this atom style");
if (itype < 1 || itype > ntypes)
error->all(FLERR,"Invalid type for mass set");
mass[itype] = value;
mass_setflag[itype] = 1;
if (mass[itype] <= 0.0) error->all(FLERR,"Invalid mass value");
}
/* ----------------------------------------------------------------------
set one or more masses and flag them as set
called from reading of input script
------------------------------------------------------------------------- */
void Atom::set_mass(int narg, char **arg)
{
if (mass == NULL) error->all(FLERR,"Cannot set mass for this atom style");
int lo,hi;
force->bounds(arg[0],ntypes,lo,hi);
if (lo < 1 || hi > ntypes) error->all(FLERR,"Invalid type for mass set");
for (int itype = lo; itype <= hi; itype++) {
mass[itype] = atof(arg[1]);
mass_setflag[itype] = 1;
if (mass[itype] <= 0.0) error->all(FLERR,"Invalid mass value");
}
}
/* ----------------------------------------------------------------------
set all masses as read in from restart file
------------------------------------------------------------------------- */
void Atom::set_mass(double *values)
{
for (int itype = 1; itype <= ntypes; itype++) {
mass[itype] = values[itype];
mass_setflag[itype] = 1;
}
}
/* ----------------------------------------------------------------------
check that all masses have been set
------------------------------------------------------------------------- */
void Atom::check_mass()
{
if (mass == NULL) return;
for (int itype = 1; itype <= ntypes; itype++)
if (mass_setflag[itype] == 0) error->all(FLERR,"All masses are not set");
}
/* ----------------------------------------------------------------------
check that radii of all particles of itype are the same
return 1 if true, else return 0
also return the radius value for that type
------------------------------------------------------------------------- */
int Atom::radius_consistency(int itype, double &rad)
{
double value = -1.0;
int flag = 0;
for (int i = 0; i < nlocal; i++) {
if (type[i] != itype) continue;
if (value < 0.0) value = radius[i];
else if (value != radius[i]) flag = 1;
}
int flagall;
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
if (flagall) return 0;
MPI_Allreduce(&value,&rad,1,MPI_DOUBLE,MPI_MAX,world);
return 1;
}
/* ----------------------------------------------------------------------
check that shape of all particles of itype are the same
return 1 if true, else return 0
also return the 3 shape params for itype
------------------------------------------------------------------------- */
int Atom::shape_consistency(int itype,
double &shapex, double &shapey, double &shapez)
{
double zero[3] = {0.0, 0.0, 0.0};
double one[3] = {-1.0, -1.0, -1.0};
double *shape;
AtomVecEllipsoid *avec_ellipsoid =
(AtomVecEllipsoid *) style_match("ellipsoid");
AtomVecEllipsoid::Bonus *bonus = avec_ellipsoid->bonus;
int flag = 0;
for (int i = 0; i < nlocal; i++) {
if (type[i] != itype) continue;
if (ellipsoid[i] < 0) shape = zero;
else shape = bonus[ellipsoid[i]].shape;
if (one[0] < 0.0) {
one[0] = shape[0];
one[1] = shape[1];
one[2] = shape[2];
} else if (one[0] != shape[0] || one[1] != shape[1] || one[2] != shape[2])
flag = 1;
}
int flagall;
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
if (flagall) return 0;
double oneall[3];
MPI_Allreduce(one,oneall,3,MPI_DOUBLE,MPI_MAX,world);
shapex = oneall[0];
shapey = oneall[1];
shapez = oneall[2];
return 1;
}
/* ----------------------------------------------------------------------
add a new molecule template = set of molecules
------------------------------------------------------------------------- */
void Atom::add_molecule(int narg, char **arg)
{
if (narg < 1) error->all(FLERR,"Illegal molecule command");
if (find_molecule(arg[0]) >= 0)
error->all(FLERR,"Reuse of molecule template ID");
// 1st molecule in set stores nset = # of mols, others store nset = 0
// ifile = count of molecules in set
// index = argument index where next molecule starts, updated by constructor
int ifile = 1;
int index = 1;
while (1) {
molecules = (Molecule **)
memory->srealloc(molecules,(nmolecule+1)*sizeof(Molecule *),
"atom::molecules");
molecules[nmolecule] = new Molecule(lmp,narg,arg,index);
molecules[nmolecule]->nset = 0;
molecules[nmolecule-ifile+1]->nset++;
nmolecule++;
if (molecules[nmolecule-1]->last) break;
ifile++;
}
}
/* ----------------------------------------------------------------------
find first molecule in set with template ID
return -1 if does not exist
------------------------------------------------------------------------- */
int Atom::find_molecule(char *id)
{
int imol;
for (imol = 0; imol < nmolecule; imol++)
if (strcmp(id,molecules[imol]->id) == 0) return imol;
return -1;
}
/* ----------------------------------------------------------------------
add info to current atom ilocal from molecule template onemol and its iatom
offset = atom ID preceeding IDs of atoms in this molecule
called by fixes and commands that add molecules
------------------------------------------------------------------------- */
void Atom::add_molecule_atom(Molecule *onemol, int iatom,
int ilocal, tagint offset)
{
if (onemol->qflag && q_flag) q[ilocal] = onemol->q[iatom];
if (onemol->radiusflag && radius_flag) radius[ilocal] = onemol->radius[iatom];
if (onemol->rmassflag && rmass_flag) rmass[ilocal] = onemol->rmass[iatom];
else if (rmass_flag)
rmass[ilocal] = 4.0*MY_PI/3.0 *
radius[ilocal]*radius[ilocal]*radius[ilocal];
-
+ if (onemol->bodyflag) {
+ body[ilocal] = 0; // as if a body read from data file
+ onemol->avec_body->data_body(ilocal,onemol->nibody,onemol->ndbody,
+ onemol->ibodyparams,onemol->dbodyparams);
+ onemol->avec_body->set_quat(ilocal,onemol->quat_external);
+ }
+
if (molecular != 1) return;
// add bond topology info
// for molecular atom styles, but not atom style template
if (avec->bonds_allow) {
num_bond[ilocal] = onemol->num_bond[iatom];
for (int i = 0; i < num_bond[ilocal]; i++) {
bond_type[ilocal][i] = onemol->bond_type[iatom][i];
bond_atom[ilocal][i] = onemol->bond_atom[iatom][i] + offset;
}
}
if (avec->angles_allow) {
num_angle[ilocal] = onemol->num_angle[iatom];
for (int i = 0; i < num_angle[ilocal]; i++) {
angle_type[ilocal][i] = onemol->angle_type[iatom][i];
angle_atom1[ilocal][i] = onemol->angle_atom1[iatom][i] + offset;
angle_atom2[ilocal][i] = onemol->angle_atom2[iatom][i] + offset;
angle_atom3[ilocal][i] = onemol->angle_atom3[iatom][i] + offset;
}
}
if (avec->dihedrals_allow) {
num_dihedral[ilocal] = onemol->num_dihedral[iatom];
for (int i = 0; i < num_dihedral[ilocal]; i++) {
dihedral_type[ilocal][i] = onemol->dihedral_type[iatom][i];
dihedral_atom1[ilocal][i] = onemol->dihedral_atom1[iatom][i] + offset;
dihedral_atom2[ilocal][i] = onemol->dihedral_atom2[iatom][i] + offset;
dihedral_atom3[ilocal][i] = onemol->dihedral_atom3[iatom][i] + offset;
dihedral_atom4[ilocal][i] = onemol->dihedral_atom4[iatom][i] + offset;
}
}
if (avec->impropers_allow) {
num_improper[ilocal] = onemol->num_improper[iatom];
for (int i = 0; i < num_improper[ilocal]; i++) {
improper_type[ilocal][i] = onemol->improper_type[iatom][i];
improper_atom1[ilocal][i] = onemol->improper_atom1[iatom][i] + offset;
improper_atom2[ilocal][i] = onemol->improper_atom2[iatom][i] + offset;
improper_atom3[ilocal][i] = onemol->improper_atom3[iatom][i] + offset;
improper_atom4[ilocal][i] = onemol->improper_atom4[iatom][i] + offset;
}
}
if (onemol->specialflag) {
nspecial[ilocal][0] = onemol->nspecial[iatom][0];
nspecial[ilocal][1] = onemol->nspecial[iatom][1];
int n = nspecial[ilocal][2] = onemol->nspecial[iatom][2];
for (int i = 0; i < n; i++)
special[ilocal][i] = onemol->special[iatom][i] + offset;
}
}
/* ----------------------------------------------------------------------
reorder owned atoms so those in firstgroup appear first
called by comm->exchange() if atom_modify first group is set
only owned atoms exist at this point, no ghost atoms
------------------------------------------------------------------------- */
void Atom::first_reorder()
{
// insure there is one extra atom location at end of arrays for swaps
if (nlocal == nmax) avec->grow(0);
// loop over owned atoms
// nfirst = index of first atom not in firstgroup
// when find firstgroup atom out of place, swap it with atom nfirst
int bitmask = group->bitmask[firstgroup];
nfirst = 0;
while (nfirst < nlocal && mask[nfirst] & bitmask) nfirst++;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & bitmask && i > nfirst) {
avec->copy(i,nlocal,0);
avec->copy(nfirst,i,0);
avec->copy(nlocal,nfirst,0);
while (nfirst < nlocal && mask[nfirst] & bitmask) nfirst++;
}
}
}
/* ----------------------------------------------------------------------
perform spatial sort of atoms within my sub-domain
always called between comm->exchange() and comm->borders()
don't have to worry about clearing/setting atom->map since done in comm
------------------------------------------------------------------------- */
void Atom::sort()
{
int i,m,n,ix,iy,iz,ibin,empty;
// set next timestep for sorting to take place
nextsort = (update->ntimestep/sortfreq)*sortfreq + sortfreq;
// download data from GPU if necessary
if (lmp->cuda && !lmp->cuda->oncpu) lmp->cuda->downloadAll();
// re-setup sort bins if needed
if (domain->box_change) setup_sort_bins();
if (nbins == 1) return;
// reallocate per-atom vectors if needed
if (nlocal > maxnext) {
memory->destroy(next);
memory->destroy(permute);
maxnext = atom->nmax;
memory->create(next,maxnext,"atom:next");
memory->create(permute,maxnext,"atom:permute");
}
// insure there is one extra atom location at end of arrays for swaps
if (nlocal == nmax) avec->grow(0);
// bin atoms in reverse order so linked list will be in forward order
for (i = 0; i < nbins; i++) binhead[i] = -1;
for (i = nlocal-1; i >= 0; i--) {
ix = static_cast<int> ((x[i][0]-bboxlo[0])*bininvx);
iy = static_cast<int> ((x[i][1]-bboxlo[1])*bininvy);
iz = static_cast<int> ((x[i][2]-bboxlo[2])*bininvz);
ix = MAX(ix,0);
iy = MAX(iy,0);
iz = MAX(iz,0);
ix = MIN(ix,nbinx-1);
iy = MIN(iy,nbiny-1);
iz = MIN(iz,nbinz-1);
ibin = iz*nbiny*nbinx + iy*nbinx + ix;
next[i] = binhead[ibin];
binhead[ibin] = i;
}
// permute = desired permutation of atoms
// permute[I] = J means Ith new atom will be Jth old atom
n = 0;
for (m = 0; m < nbins; m++) {
i = binhead[m];
while (i >= 0) {
permute[n++] = i;
i = next[i];
}
}
// current = current permutation, just reuse next vector
// current[I] = J means Ith current atom is Jth old atom
int *current = next;
for (i = 0; i < nlocal; i++) current[i] = i;
// reorder local atom list, when done, current = permute
// perform "in place" using copy() to extra atom location at end of list
// inner while loop processes one cycle of the permutation
// copy before inner-loop moves an atom to end of atom list
// copy after inner-loop moves atom at end of list back into list
// empty = location in atom list that is currently empty
for (i = 0; i < nlocal; i++) {
if (current[i] == permute[i]) continue;
avec->copy(i,nlocal,0);
empty = i;
while (permute[empty] != i) {
avec->copy(permute[empty],empty,0);
empty = current[empty] = permute[empty];
}
avec->copy(nlocal,empty,0);
current[empty] = permute[empty];
}
// upload data back to GPU if necessary
if (lmp->cuda && !lmp->cuda->oncpu) lmp->cuda->uploadAll();
// sanity check that current = permute
//int flag = 0;
//for (i = 0; i < nlocal; i++)
// if (current[i] != permute[i]) flag = 1;
//int flagall;
//MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
//if (flagall) error->all(FLERR,"Atom sort did not operate correctly");
}
/* ----------------------------------------------------------------------
setup bins for spatial sorting of atoms
------------------------------------------------------------------------- */
void Atom::setup_sort_bins()
{
// binsize:
// user setting if explicitly set
// 1/2 of neighbor cutoff for non-CUDA
// CUDA_CHUNK atoms/proc for CUDA
// check if neighbor cutoff = 0.0
double binsize;
if (userbinsize > 0.0) binsize = userbinsize;
else if (!lmp->cuda) binsize = 0.5 * neighbor->cutneighmax;
else {
if (domain->dimension == 3) {
double vol = (domain->boxhi[0]-domain->boxlo[0]) *
(domain->boxhi[1]-domain->boxlo[1]) *
(domain->boxhi[2]-domain->boxlo[2]);
binsize = pow(1.0*CUDA_CHUNK/natoms*vol,1.0/3.0);
} else {
double area = (domain->boxhi[0]-domain->boxlo[0]) *
(domain->boxhi[1]-domain->boxlo[1]);
binsize = pow(1.0*CUDA_CHUNK/natoms*area,1.0/2.0);
}
}
if (binsize == 0.0) error->all(FLERR,"Atom sorting has bin size = 0.0");
double bininv = 1.0/binsize;
// nbin xyz = local bins
// bbox lo/hi = bounding box of my sub-domain
if (domain->triclinic)
domain->bbox(domain->sublo_lamda,domain->subhi_lamda,bboxlo,bboxhi);
else {
bboxlo[0] = domain->sublo[0];
bboxlo[1] = domain->sublo[1];
bboxlo[2] = domain->sublo[2];
bboxhi[0] = domain->subhi[0];
bboxhi[1] = domain->subhi[1];
bboxhi[2] = domain->subhi[2];
}
nbinx = static_cast<int> ((bboxhi[0]-bboxlo[0]) * bininv);
nbiny = static_cast<int> ((bboxhi[1]-bboxlo[1]) * bininv);
nbinz = static_cast<int> ((bboxhi[2]-bboxlo[2]) * bininv);
if (domain->dimension == 2) nbinz = 1;
if (nbinx == 0) nbinx = 1;
if (nbiny == 0) nbiny = 1;
if (nbinz == 0) nbinz = 1;
bininvx = nbinx / (bboxhi[0]-bboxlo[0]);
bininvy = nbiny / (bboxhi[1]-bboxlo[1]);
bininvz = nbinz / (bboxhi[2]-bboxlo[2]);
if (1.0*nbinx*nbiny*nbinz > INT_MAX)
error->one(FLERR,"Too many atom sorting bins");
nbins = nbinx*nbiny*nbinz;
// reallocate per-bin memory if needed
if (nbins > maxbin) {
memory->destroy(binhead);
maxbin = nbins;
memory->create(binhead,maxbin,"atom:binhead");
}
}
/* ----------------------------------------------------------------------
register a callback to a fix so it can manage atom-based arrays
happens when fix is created
flag = 0 for grow, 1 for restart, 2 for border comm
------------------------------------------------------------------------- */
void Atom::add_callback(int flag)
{
int ifix;
// find the fix
// if find NULL ptr:
// it's this one, since it is being replaced and has just been deleted
// at this point in re-creation
// if don't find NULL ptr:
// i is set to nfix = new one currently being added at end of list
for (ifix = 0; ifix < modify->nfix; ifix++)
if (modify->fix[ifix] == NULL) break;
// add callback to lists, reallocating if necessary
if (flag == 0) {
if (nextra_grow == nextra_grow_max) {
nextra_grow_max += DELTA;
memory->grow(extra_grow,nextra_grow_max,"atom:extra_grow");
}
extra_grow[nextra_grow] = ifix;
nextra_grow++;
} else if (flag == 1) {
if (nextra_restart == nextra_restart_max) {
nextra_restart_max += DELTA;
memory->grow(extra_restart,nextra_restart_max,"atom:extra_restart");
}
extra_restart[nextra_restart] = ifix;
nextra_restart++;
} else if (flag == 2) {
if (nextra_border == nextra_border_max) {
nextra_border_max += DELTA;
memory->grow(extra_border,nextra_border_max,"atom:extra_border");
}
extra_border[nextra_border] = ifix;
nextra_border++;
}
}
/* ----------------------------------------------------------------------
unregister a callback to a fix
happens when fix is deleted, called by its destructor
flag = 0 for grow, 1 for restart
------------------------------------------------------------------------- */
void Atom::delete_callback(const char *id, int flag)
{
int ifix;
for (ifix = 0; ifix < modify->nfix; ifix++)
if (strcmp(id,modify->fix[ifix]->id) == 0) break;
// compact the list of callbacks
if (flag == 0) {
int match;
for (match = 0; match < nextra_grow; match++)
if (extra_grow[match] == ifix) break;
for (int i = match; i < nextra_grow-1; i++)
extra_grow[i] = extra_grow[i+1];
nextra_grow--;
} else if (flag == 1) {
int match;
for (match = 0; match < nextra_restart; match++)
if (extra_restart[match] == ifix) break;
for (int i = match; i < nextra_restart-1; i++)
extra_restart[i] = extra_restart[i+1];
nextra_restart--;
} else if (flag == 2) {
int match;
for (match = 0; match < nextra_border; match++)
if (extra_border[match] == ifix) break;
for (int i = match; i < nextra_border-1; i++)
extra_border[i] = extra_border[i+1];
nextra_border--;
}
}
/* ----------------------------------------------------------------------
decrement ptrs in callback lists to fixes beyond the deleted ifix
happens after fix is deleted
------------------------------------------------------------------------- */
void Atom::update_callback(int ifix)
{
for (int i = 0; i < nextra_grow; i++)
if (extra_grow[i] > ifix) extra_grow[i]--;
for (int i = 0; i < nextra_restart; i++)
if (extra_restart[i] > ifix) extra_restart[i]--;
for (int i = 0; i < nextra_border; i++)
if (extra_border[i] > ifix) extra_border[i]--;
}
/* ----------------------------------------------------------------------
find custom per-atom vector with name
return index if found, and flag = 0/1 for int/double
return -1 if not found
------------------------------------------------------------------------- */
int Atom::find_custom(char *name, int &flag)
{
for (int i = 0; i < nivector; i++)
if (iname[i] && strcmp(iname[i],name) == 0) {
flag = 0;
return i;
}
for (int i = 0; i < ndvector; i++)
if (dname[i] && strcmp(dname[i],name) == 0) {
flag = 1;
return i;
}
return -1;
}
/* ----------------------------------------------------------------------
add a custom variable with name of type flag = 0/1 for int/double
assumes name does not already exist
return index in ivector or dvector of its location
------------------------------------------------------------------------- */
int Atom::add_custom(char *name, int flag)
{
int index;
if (flag == 0) {
index = nivector;
nivector++;
iname = (char **) memory->srealloc(iname,nivector*sizeof(char *),
"atom:iname");
int n = strlen(name) + 1;
iname[index] = new char[n];
strcpy(iname[index],name);
ivector = (int **) memory->srealloc(ivector,nivector*sizeof(int *),
"atom:ivector");
memory->create(ivector[index],nmax,"atom:ivector");
} else {
index = ndvector;
ndvector++;
dname = (char **) memory->srealloc(dname,ndvector*sizeof(char *),
"atom:dname");
int n = strlen(name) + 1;
dname[index] = new char[n];
strcpy(dname[index],name);
dvector = (double **) memory->srealloc(dvector,ndvector*sizeof(double *),
"atom:dvector");
memory->create(dvector[index],nmax,"atom:dvector");
}
return index;
}
/* ----------------------------------------------------------------------
remove a custom variable of type flag = 0/1 for int/double at index
free memory for vector and name and set ptrs to NULL
ivector/dvector and iname/dname lists never shrink
------------------------------------------------------------------------- */
void Atom::remove_custom(int flag, int index)
{
if (flag == 0) {
memory->destroy(ivector[index]);
ivector[index] = NULL;
delete [] iname[index];
iname[index] = NULL;
} else {
memory->destroy(dvector[index]);
dvector[index] = NULL;
delete [] dname[index];
dname[index] = NULL;
}
}
/* ----------------------------------------------------------------------
return a pointer to a named internal variable
if don't recognize name, return NULL
customize by adding names
------------------------------------------------------------------------- */
void *Atom::extract(char *name)
{
if (strcmp(name,"mass") == 0) return (void *) mass;
if (strcmp(name,"id") == 0) return (void *) tag;
if (strcmp(name,"type") == 0) return (void *) type;
if (strcmp(name,"mask") == 0) return (void *) mask;
if (strcmp(name,"image") == 0) return (void *) image;
if (strcmp(name,"x") == 0) return (void *) x;
if (strcmp(name,"v") == 0) return (void *) v;
if (strcmp(name,"f") == 0) return (void *) f;
if (strcmp(name,"molecule") == 0) return (void *) molecule;
if (strcmp(name,"q") == 0) return (void *) q;
if (strcmp(name,"mu") == 0) return (void *) mu;
if (strcmp(name,"omega") == 0) return (void *) omega;
if (strcmp(name,"angmom") == 0) return (void *) angmom;
if (strcmp(name,"torque") == 0) return (void *) torque;
if (strcmp(name,"radius") == 0) return (void *) radius;
if (strcmp(name,"rmass") == 0) return (void *) rmass;
if (strcmp(name,"ellipsoid") == 0) return (void *) ellipsoid;
if (strcmp(name,"line") == 0) return (void *) line;
if (strcmp(name,"tri") == 0) return (void *) tri;
if (strcmp(name,"vfrac") == 0) return (void *) vfrac;
if (strcmp(name,"s0") == 0) return (void *) s0;
if (strcmp(name,"x0") == 0) return (void *) x0;
if (strcmp(name,"spin") == 0) return (void *) spin;
if (strcmp(name,"eradius") == 0) return (void *) eradius;
if (strcmp(name,"ervel") == 0) return (void *) ervel;
if (strcmp(name,"erforce") == 0) return (void *) erforce;
if (strcmp(name,"ervelforce") == 0) return (void *) ervelforce;
if (strcmp(name,"cs") == 0) return (void *) cs;
if (strcmp(name,"csforce") == 0) return (void *) csforce;
if (strcmp(name,"vforce") == 0) return (void *) vforce;
if (strcmp(name,"etag") == 0) return (void *) etag;
if (strcmp(name,"rho") == 0) return (void *) rho;
if (strcmp(name,"drho") == 0) return (void *) drho;
if (strcmp(name,"e") == 0) return (void *) e;
if (strcmp(name,"de") == 0) return (void *) de;
if (strcmp(name,"cv") == 0) return (void *) cv;
if (strcmp(name,"vest") == 0) return (void *) vest;
if (strcmp(name, "contact_radius") == 0) return (void *) contact_radius;
if (strcmp(name, "smd_data_9") == 0) return (void *) smd_data_9;
if (strcmp(name, "smd_stress") == 0) return (void *) smd_stress;
if (strcmp(name, "eff_plastic_strain") == 0)
return (void *) eff_plastic_strain;
if (strcmp(name, "eff_plastic_strain_rate") == 0)
return (void *) eff_plastic_strain_rate;
if (strcmp(name, "damage") == 0) return (void *) damage;
return NULL;
}
/* ----------------------------------------------------------------------
return # of bytes of allocated memory
call to avec tallies per-atom vectors
add in global to local mapping storage
------------------------------------------------------------------------- */
bigint Atom::memory_usage()
{
memlength = DELTA_MEMSTR;
memory->create(memstr,memlength,"atom:memstr");
memstr[0] = '\0';
bigint bytes = avec->memory_usage();
memory->destroy(memstr);
bytes += max_same*sizeof(int);
if (map_style == 1 && map_tag_max >= 0)
bytes += memory->usage(map_array,map_maxarray);
else if (map_style == 2 && map_nhash >=0) {
bytes += map_nbucket*sizeof(int);
bytes += map_nhash*sizeof(HashElem);
}
if (maxnext) {
bytes += memory->usage(next,maxnext);
bytes += memory->usage(permute,maxnext);
}
return bytes;
}
/* ----------------------------------------------------------------------
accumulate per-atom vec names in memstr, padded by spaces
return 1 if padded str is not already in memlist, else 0
------------------------------------------------------------------------- */
int Atom::memcheck(const char *str)
{
int n = strlen(str) + 3;
char *padded = new char[n];
strcpy(padded," ");
strcat(padded,str);
strcat(padded," ");
if (strstr(memstr,padded)) {
delete [] padded;
return 0;
}
if (strlen(memstr) + n >= memlength) {
memlength += DELTA_MEMSTR;
memory->grow(memstr,memlength,"atom:memstr");
}
strcat(memstr,padded);
delete [] padded;
return 1;
}
diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp
index 2f6c4e48b..27fdaa1a7 100644
--- a/src/atom_vec_body.cpp
+++ b/src/atom_vec_body.cpp
@@ -1,1532 +1,1584 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "atom_vec_body.h"
#include "style_body.h"
#include "body.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "modify.h"
#include "force.h"
#include "fix.h"
#include "memory.h"
#include "error.h"
+// debug
+#include "update.h"
+
+
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
AtomVecBody::AtomVecBody(LAMMPS *lmp) : AtomVec(lmp)
{
molecular = 0;
// size_forward and size_border set in settings(), via Body class
comm_x_only = comm_f_only = 0;
size_forward = 0;
size_reverse = 6;
size_border = 0;
size_velocity = 6;
size_data_atom = 7;
size_data_vel = 7;
xcol_data = 5;
atom->body_flag = 1;
atom->rmass_flag = 1;
atom->angmom_flag = atom->torque_flag = 1;
+ atom->radius_flag = 1;
nlocal_bonus = nghost_bonus = nmax_bonus = 0;
bonus = NULL;
bptr = NULL;
if (sizeof(double) == sizeof(int)) intdoubleratio = 1;
else if (sizeof(double) == 2*sizeof(int)) intdoubleratio = 2;
else error->all(FLERR,"Internal error in atom_style body");
}
/* ---------------------------------------------------------------------- */
AtomVecBody::~AtomVecBody()
{
int nall = nlocal_bonus + nghost_bonus;
for (int i = 0; i < nall; i++) {
icp->put(bonus[i].iindex);
dcp->put(bonus[i].dindex);
}
memory->sfree(bonus);
delete bptr;
}
/* ----------------------------------------------------------------------
process additional args
instantiate Body class
set size_forward and size_border to max sizes
------------------------------------------------------------------------- */
void AtomVecBody::process_args(int narg, char **arg)
{
if (narg < 1) error->all(FLERR,"Invalid atom_style body command");
if (0) bptr = NULL;
#define BODY_CLASS
#define BodyStyle(key,Class) \
else if (strcmp(arg[0],#key) == 0) bptr = new Class(lmp,narg,arg);
#include "style_body.h"
#undef BodyStyle
#undef BODY_CLASS
else error->all(FLERR,"Unknown body style");
bptr->avec = this;
icp = bptr->icp;
dcp = bptr->dcp;
// max size of forward/border comm
// 7,16 are packed in pack_comm/pack_border
// bptr values = max number of additional ivalues/dvalues from Body class
size_forward = 7 + bptr->size_forward;
- size_border = 16 + bptr->size_border;
+ size_border = 18 + bptr->size_border;
}
/* ----------------------------------------------------------------------
grow atom arrays
n = 0 grows arrays by a chunk
n > 0 allocates arrays to size n
------------------------------------------------------------------------- */
void AtomVecBody::grow(int n)
{
if (n == 0) grow_nmax();
else nmax = n;
atom->nmax = nmax;
if (nmax < 0)
error->one(FLERR,"Per-processor system is too big");
tag = memory->grow(atom->tag,nmax,"atom:tag");
type = memory->grow(atom->type,nmax,"atom:type");
mask = memory->grow(atom->mask,nmax,"atom:mask");
image = memory->grow(atom->image,nmax,"atom:image");
x = memory->grow(atom->x,nmax,3,"atom:x");
v = memory->grow(atom->v,nmax,3,"atom:v");
f = memory->grow(atom->f,nmax*comm->nthreads,3,"atom:f");
+ radius = memory->grow(atom->radius,nmax,"atom:radius");
rmass = memory->grow(atom->rmass,nmax,"atom:rmass");
angmom = memory->grow(atom->angmom,nmax,3,"atom:angmom");
torque = memory->grow(atom->torque,nmax*comm->nthreads,3,"atom:torque");
body = memory->grow(atom->body,nmax,"atom:body");
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecBody::grow_reset()
{
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
- rmass = atom->rmass; angmom = atom->angmom; torque = atom->torque;
+ radius = atom->radius; rmass = atom->rmass;
+ angmom = atom->angmom; torque = atom->torque;
body = atom->body;
}
/* ----------------------------------------------------------------------
grow bonus data structure
------------------------------------------------------------------------- */
void AtomVecBody::grow_bonus()
{
nmax_bonus = grow_nmax_bonus(nmax_bonus);
if (nmax_bonus < 0)
error->one(FLERR,"Per-processor system is too big");
bonus = (Bonus *) memory->srealloc(bonus,nmax_bonus*sizeof(Bonus),
"atom:bonus");
}
/* ----------------------------------------------------------------------
copy atom I info to atom J
if delflag and atom J has bonus data, then delete it
------------------------------------------------------------------------- */
void AtomVecBody::copy(int i, int j, int delflag)
{
tag[j] = tag[i];
type[j] = type[i];
mask[j] = mask[i];
image[j] = image[i];
x[j][0] = x[i][0];
x[j][1] = x[i][1];
x[j][2] = x[i][2];
v[j][0] = v[i][0];
v[j][1] = v[i][1];
v[j][2] = v[i][2];
+ radius[j] = radius[i];
rmass[j] = rmass[i];
angmom[j][0] = angmom[i][0];
angmom[j][1] = angmom[i][1];
angmom[j][2] = angmom[i][2];
// if deleting atom J via delflag and J has bonus data, then delete it
if (delflag && body[j] >= 0) {
icp->put(bonus[body[j]].iindex);
dcp->put(bonus[body[j]].dindex);
copy_bonus(nlocal_bonus-1,body[j]);
nlocal_bonus--;
}
// if atom I has bonus data, reset I's bonus.ilocal to loc J
// do NOT do this if self-copy (I=J) since I's bonus data is already deleted
if (body[i] >= 0 && i != j) bonus[body[i]].ilocal = j;
body[j] = body[i];
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j,delflag);
}
/* ----------------------------------------------------------------------
copy bonus data from I to J, effectively deleting the J entry
also reset body that points to I to now point to J
------------------------------------------------------------------------- */
void AtomVecBody::copy_bonus(int i, int j)
{
body[bonus[i].ilocal] = j;
memcpy(&bonus[j],&bonus[i],sizeof(Bonus));
}
/* ----------------------------------------------------------------------
clear ghost info in bonus data
called before ghosts are recommunicated in comm and irregular
------------------------------------------------------------------------- */
void AtomVecBody::clear_bonus()
{
int nall = nlocal_bonus + nghost_bonus;
for (int i = nlocal_bonus; i < nall; i++) {
icp->put(bonus[i].iindex);
dcp->put(bonus[i].dindex);
}
nghost_bonus = 0;
}
/* ---------------------------------------------------------------------- */
int AtomVecBody::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
double *quat;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
if (body[j] >= 0) {
quat = bonus[body[j]].quat;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
m += bptr->pack_comm_body(&bonus[body[j]],&buf[m]);
}
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
dz = pbc[2]*domain->zprd;
}
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
if (body[j] >= 0) {
quat = bonus[body[j]].quat;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
m += bptr->pack_comm_body(&bonus[body[j]],&buf[m]);
}
}
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecBody::pack_comm_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz,dvx,dvy,dvz;
double *quat;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
if (body[j] >= 0) {
quat = bonus[body[j]].quat;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
m += bptr->pack_comm_body(&bonus[body[j]],&buf[m]);
}
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
buf[m++] = angmom[j][0];
buf[m++] = angmom[j][1];
buf[m++] = angmom[j][2];
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
dz = pbc[2]*domain->zprd;
}
if (!deform_vremap) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
if (body[j] >= 0) {
quat = bonus[body[j]].quat;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
m += bptr->pack_comm_body(&bonus[body[j]],&buf[m]);
}
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
buf[m++] = angmom[j][0];
buf[m++] = angmom[j][1];
buf[m++] = angmom[j][2];
}
} else {
dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
dvz = pbc[2]*h_rate[2];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
if (body[j] >= 0) {
quat = bonus[body[j]].quat;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
m += bptr->pack_comm_body(&bonus[body[j]],&buf[m]);
}
if (mask[i] & deform_groupbit) {
buf[m++] = v[j][0] + dvx;
buf[m++] = v[j][1] + dvy;
buf[m++] = v[j][2] + dvz;
} else {
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
}
buf[m++] = angmom[j][0];
buf[m++] = angmom[j][1];
buf[m++] = angmom[j][2];
}
}
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecBody::pack_comm_hybrid(int n, int *list, double *buf)
{
int i,j,m;
double *quat;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
if (body[j] >= 0) {
quat = bonus[body[j]].quat;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
m += bptr->pack_comm_body(&bonus[body[j]],&buf[m]);
}
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecBody::unpack_comm(int n, int first, double *buf)
{
int i,m,last;
double *quat;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
if (body[i] >= 0) {
quat = bonus[body[i]].quat;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
m += bptr->unpack_comm_body(&bonus[body[i]],&buf[m]);
}
}
}
/* ---------------------------------------------------------------------- */
void AtomVecBody::unpack_comm_vel(int n, int first, double *buf)
{
int i,m,last;
double *quat;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
if (body[i] >= 0) {
quat = bonus[body[i]].quat;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
m += bptr->unpack_comm_body(&bonus[body[i]],&buf[m]);
}
v[i][0] = buf[m++];
v[i][1] = buf[m++];
v[i][2] = buf[m++];
angmom[i][0] = buf[m++];
angmom[i][1] = buf[m++];
angmom[i][2] = buf[m++];
}
}
/* ---------------------------------------------------------------------- */
int AtomVecBody::unpack_comm_hybrid(int n, int first, double *buf)
{
int i,m,last;
double *quat;
m = 0;
last = first + n;
for (i = first; i < last; i++)
if (body[i] >= 0) {
quat = bonus[body[i]].quat;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
m += bptr->unpack_comm_body(&bonus[body[i]],&buf[m]);
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecBody::pack_reverse(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
buf[m++] = f[i][0];
buf[m++] = f[i][1];
buf[m++] = f[i][2];
buf[m++] = torque[i][0];
buf[m++] = torque[i][1];
buf[m++] = torque[i][2];
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecBody::pack_reverse_hybrid(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
buf[m++] = torque[i][0];
buf[m++] = torque[i][1];
buf[m++] = torque[i][2];
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecBody::unpack_reverse(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
f[j][0] += buf[m++];
f[j][1] += buf[m++];
f[j][2] += buf[m++];
torque[j][0] += buf[m++];
torque[j][1] += buf[m++];
torque[j][2] += buf[m++];
}
}
/* ---------------------------------------------------------------------- */
int AtomVecBody::unpack_reverse_hybrid(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
torque[j][0] += buf[m++];
torque[j][1] += buf[m++];
torque[j][2] += buf[m++];
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecBody::pack_border(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
double *quat,*inertia;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (body[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
quat = bonus[body[j]].quat;
inertia = bonus[body[j]].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
buf[m++] = ubuf(bonus[body[j]].ninteger).d;
buf[m++] = ubuf(bonus[body[j]].ndouble).d;
m += bptr->pack_border_body(&bonus[body[j]],&buf[m]);
}
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0];
dy = pbc[1];
dz = pbc[2];
}
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (body[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
quat = bonus[body[j]].quat;
inertia = bonus[body[j]].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
buf[m++] = ubuf(bonus[body[j]].ninteger).d;
buf[m++] = ubuf(bonus[body[j]].ndouble).d;
m += bptr->pack_border_body(&bonus[body[j]],&buf[m]);
}
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->pack_border(n,list,&buf[m]);
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecBody::pack_border_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz,dvx,dvy,dvz;
double *quat,*inertia;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (body[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
quat = bonus[body[j]].quat;
inertia = bonus[body[j]].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
buf[m++] = ubuf(bonus[body[j]].ninteger).d;
buf[m++] = ubuf(bonus[body[j]].ndouble).d;
m += bptr->pack_border_body(&bonus[body[j]],&buf[m]);
}
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
buf[m++] = angmom[j][0];
buf[m++] = angmom[j][1];
buf[m++] = angmom[j][2];
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0];
dy = pbc[1];
dz = pbc[2];
}
if (!deform_vremap) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (body[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
quat = bonus[body[j]].quat;
inertia = bonus[body[j]].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
buf[m++] = ubuf(bonus[body[j]].ninteger).d;
buf[m++] = ubuf(bonus[body[j]].ndouble).d;
m += bptr->pack_border_body(&bonus[body[j]],&buf[m]);
}
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
buf[m++] = angmom[j][0];
buf[m++] = angmom[j][1];
buf[m++] = angmom[j][2];
}
} else {
dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
dvz = pbc[2]*h_rate[2];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
if (body[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
quat = bonus[body[j]].quat;
inertia = bonus[body[j]].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
buf[m++] = ubuf(bonus[body[j]].ninteger).d;
buf[m++] = ubuf(bonus[body[j]].ndouble).d;
m += bptr->pack_border_body(&bonus[body[j]],&buf[m]);
}
if (mask[i] & deform_groupbit) {
buf[m++] = v[j][0] + dvx;
buf[m++] = v[j][1] + dvy;
buf[m++] = v[j][2] + dvz;
} else {
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
}
buf[m++] = angmom[j][0];
buf[m++] = angmom[j][1];
buf[m++] = angmom[j][2];
}
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->pack_border(n,list,&buf[m]);
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecBody::pack_border_hybrid(int n, int *list, double *buf)
{
int i,j,m;
double *quat,*inertia;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (body[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
quat = bonus[body[j]].quat;
inertia = bonus[body[j]].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
buf[m++] = ubuf(bonus[body[j]].ninteger).d;
buf[m++] = ubuf(bonus[body[j]].ndouble).d;
m += bptr->pack_border_body(&bonus[body[j]],&buf[m]);
}
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecBody::unpack_border(int n, int first, double *buf)
{
int i,j,m,last;
double *quat,*inertia;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
if (i == nmax) grow(0);
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
+ radius[i] = buf[m++];
+ rmass[i] = buf[m++];
body[i] = (int) ubuf(buf[m++]).i;
if (body[i] == 0) body[i] = -1;
else {
j = nlocal_bonus + nghost_bonus;
if (j == nmax_bonus) grow_bonus();
quat = bonus[j].quat;
inertia = bonus[j].inertia;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
inertia[0] = buf[m++];
inertia[1] = buf[m++];
inertia[2] = buf[m++];
bonus[j].ninteger = (int) ubuf(buf[m++]).i;
bonus[j].ndouble = (int) ubuf(buf[m++]).i;
bonus[j].ivalue = icp->get(bonus[j].ninteger,bonus[j].iindex);
bonus[j].dvalue = dcp->get(bonus[j].ndouble,bonus[j].dindex);
m += bptr->unpack_border_body(&bonus[j],&buf[m]);
bonus[j].ilocal = i;
body[i] = j;
nghost_bonus++;
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->
unpack_border(n,first,&buf[m]);
}
/* ---------------------------------------------------------------------- */
void AtomVecBody::unpack_border_vel(int n, int first, double *buf)
{
int i,j,m,last;
double *quat,*inertia;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
if (i == nmax) grow(0);
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
+ radius[i] = buf[m++];
+ rmass[i] = buf[m++];
body[i] = (int) ubuf(buf[m++]).i;
if (body[i] == 0) body[i] = -1;
else {
j = nlocal_bonus + nghost_bonus;
if (j == nmax_bonus) grow_bonus();
quat = bonus[j].quat;
inertia = bonus[j].inertia;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
inertia[0] = buf[m++];
inertia[1] = buf[m++];
inertia[2] = buf[m++];
bonus[j].ninteger = (int) ubuf(buf[m++]).i;
bonus[j].ndouble = (int) ubuf(buf[m++]).i;
bonus[j].ivalue = icp->get(bonus[j].ninteger,bonus[j].iindex);
bonus[j].dvalue = dcp->get(bonus[j].ndouble,bonus[j].dindex);
m += bptr->unpack_border_body(&bonus[j],&buf[m]);
bonus[j].ilocal = i;
body[i] = j;
nghost_bonus++;
}
v[i][0] = buf[m++];
v[i][1] = buf[m++];
v[i][2] = buf[m++];
angmom[i][0] = buf[m++];
angmom[i][1] = buf[m++];
angmom[i][2] = buf[m++];
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->
unpack_border(n,first,&buf[m]);
}
/* ---------------------------------------------------------------------- */
int AtomVecBody::unpack_border_hybrid(int n, int first, double *buf)
{
int i,j,m,last;
double *quat,*inertia;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
+ radius[i] = buf[m++];
+ rmass[i] = buf[m++];
body[i] = (int) ubuf(buf[m++]).i;
if (body[i] == 0) body[i] = -1;
else {
j = nlocal_bonus + nghost_bonus;
if (j == nmax_bonus) grow_bonus();
quat = bonus[j].quat;
inertia = bonus[j].inertia;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
inertia[0] = buf[m++];
inertia[1] = buf[m++];
inertia[2] = buf[m++];
bonus[j].ninteger = (int) ubuf(buf[m++]).i;
bonus[j].ndouble = (int) ubuf(buf[m++]).i;
bonus[j].ivalue = icp->get(bonus[j].ninteger,bonus[j].iindex);
bonus[j].dvalue = dcp->get(bonus[j].ndouble,bonus[j].dindex);
m += bptr->unpack_border_body(&bonus[j],&buf[m]);
bonus[j].ilocal = i;
body[i] = j;
nghost_bonus++;
}
}
return m;
}
/* ----------------------------------------------------------------------
pack data for atom I for sending to another proc
xyz must be 1st 3 values, so comm::exchange() can test on them
------------------------------------------------------------------------- */
int AtomVecBody::pack_exchange(int i, double *buf)
{
int m = 1;
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
buf[m++] = v[i][0];
buf[m++] = v[i][1];
buf[m++] = v[i][2];
buf[m++] = ubuf(tag[i]).d;
buf[m++] = ubuf(type[i]).d;
buf[m++] = ubuf(mask[i]).d;
buf[m++] = ubuf(image[i]).d;
-
+ buf[m++] = radius[i];
buf[m++] = rmass[i];
buf[m++] = angmom[i][0];
buf[m++] = angmom[i][1];
buf[m++] = angmom[i][2];
if (body[i] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
int j = body[i];
double *quat = bonus[j].quat;
double *inertia = bonus[j].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
buf[m++] = ubuf(bonus[j].ninteger).d;
buf[m++] = ubuf(bonus[j].ndouble).d;
memcpy(&buf[m],bonus[j].ivalue,bonus[j].ninteger*sizeof(int));
if (intdoubleratio == 1) m += bonus[j].ninteger;
else m += (bonus[j].ninteger+1)/2;
memcpy(&buf[m],bonus[j].dvalue,bonus[j].ndouble*sizeof(double));
m += bonus[j].ndouble;
}
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
buf[0] = m;
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecBody::unpack_exchange(double *buf)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
int m = 1;
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
-
+ radius[nlocal] = buf[m++];
rmass[nlocal] = buf[m++];
angmom[nlocal][0] = buf[m++];
angmom[nlocal][1] = buf[m++];
angmom[nlocal][2] = buf[m++];
body[nlocal] = (int) ubuf(buf[m++]).i;
if (body[nlocal] == 0) body[nlocal] = -1;
else {
if (nlocal_bonus == nmax_bonus) grow_bonus();
double *quat = bonus[nlocal_bonus].quat;
double *inertia = bonus[nlocal_bonus].inertia;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
inertia[0] = buf[m++];
inertia[1] = buf[m++];
inertia[2] = buf[m++];
bonus[nlocal_bonus].ninteger = (int) ubuf(buf[m++]).i;
bonus[nlocal_bonus].ndouble = (int) ubuf(buf[m++]).i;
bonus[nlocal_bonus].ivalue = icp->get(bonus[nlocal_bonus].ninteger,
bonus[nlocal_bonus].iindex);
bonus[nlocal_bonus].dvalue = dcp->get(bonus[nlocal_bonus].ndouble,
bonus[nlocal_bonus].dindex);
memcpy(bonus[nlocal_bonus].ivalue,&buf[m],
bonus[nlocal_bonus].ninteger*sizeof(int));
if (intdoubleratio == 1) m += bonus[nlocal_bonus].ninteger;
else m += (bonus[nlocal_bonus].ninteger+1)/2;
memcpy(bonus[nlocal_bonus].dvalue,&buf[m],
bonus[nlocal_bonus].ndouble*sizeof(double));
m += bonus[nlocal_bonus].ndouble;
bonus[nlocal_bonus].ilocal = nlocal;
body[nlocal] = nlocal_bonus++;
}
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
m += modify->fix[atom->extra_grow[iextra]]->
unpack_exchange(nlocal,&buf[m]);
atom->nlocal++;
return m;
}
/* ----------------------------------------------------------------------
size of restart data for all atoms owned by this proc
include extra data stored by fixes
------------------------------------------------------------------------- */
int AtomVecBody::size_restart()
{
int i;
int n = 0;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++)
if (body[i] >= 0) {
- n += 25;
+ n += 26;
if (intdoubleratio == 1) n += bonus[body[i]].ninteger;
else n += (bonus[body[i]].ninteger+1)/2;
n += bonus[body[i]].ndouble;
- } else n += 16;
+ } else n += 17;
if (atom->nextra_restart)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
for (i = 0; i < nlocal; i++)
n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
return n;
}
/* ----------------------------------------------------------------------
pack atom I's data for restart file including extra quantities
xyz must be 1st 3 values, so that read_restart can test on them
molecular types may be negative, but write as positive
------------------------------------------------------------------------- */
int AtomVecBody::pack_restart(int i, double *buf)
{
int m = 1;
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
buf[m++] = ubuf(tag[i]).d;
buf[m++] = ubuf(type[i]).d;
buf[m++] = ubuf(mask[i]).d;
buf[m++] = ubuf(image[i]).d;
buf[m++] = v[i][0];
buf[m++] = v[i][1];
buf[m++] = v[i][2];
+ buf[m++] = radius[i];
buf[m++] = rmass[i];
buf[m++] = angmom[i][0];
buf[m++] = angmom[i][1];
buf[m++] = angmom[i][2];
if (body[i] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
int j = body[i];
double *quat = bonus[j].quat;
double *inertia = bonus[j].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
buf[m++] = ubuf(bonus[j].ninteger).d;
buf[m++] = ubuf(bonus[j].ndouble).d;
memcpy(&buf[m],bonus[j].ivalue,bonus[j].ninteger*sizeof(int));
if (intdoubleratio == 1) m += bonus[j].ninteger;
else m += (bonus[j].ninteger+1)/2;
memcpy(&buf[m],bonus[j].dvalue,bonus[j].ndouble*sizeof(double));
m += bonus[j].ndouble;
}
if (atom->nextra_restart)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
buf[0] = m;
return m;
}
/* ----------------------------------------------------------------------
unpack data for one atom from restart file including extra quantities
------------------------------------------------------------------------- */
int AtomVecBody::unpack_restart(double *buf)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
+ radius[nlocal] = buf[m++];
rmass[nlocal] = buf[m++];
angmom[nlocal][0] = buf[m++];
angmom[nlocal][1] = buf[m++];
angmom[nlocal][2] = buf[m++];
body[nlocal] = (int) ubuf(buf[m++]).i;
if (body[nlocal] == 0) body[nlocal] = -1;
else {
if (nlocal_bonus == nmax_bonus) grow_bonus();
double *quat = bonus[nlocal_bonus].quat;
double *inertia = bonus[nlocal_bonus].inertia;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
inertia[0] = buf[m++];
inertia[1] = buf[m++];
inertia[2] = buf[m++];
bonus[nlocal_bonus].ninteger = (int) ubuf(buf[m++]).i;
bonus[nlocal_bonus].ndouble = (int) ubuf(buf[m++]).i;
bonus[nlocal_bonus].ivalue = icp->get(bonus[nlocal_bonus].ninteger,
bonus[nlocal_bonus].iindex);
bonus[nlocal_bonus].dvalue = dcp->get(bonus[nlocal_bonus].ndouble,
bonus[nlocal_bonus].dindex);
memcpy(bonus[nlocal_bonus].ivalue,&buf[m],
bonus[nlocal_bonus].ninteger*sizeof(int));
if (intdoubleratio == 1) m += bonus[nlocal_bonus].ninteger;
else m += (bonus[nlocal_bonus].ninteger+1)/2;
memcpy(bonus[nlocal_bonus].dvalue,&buf[m],
bonus[nlocal_bonus].ndouble*sizeof(double));
m += bonus[nlocal_bonus].ndouble;
bonus[nlocal_bonus].ilocal = nlocal;
body[nlocal] = nlocal_bonus++;
}
double **extra = atom->extra;
if (atom->nextra_store) {
int size = static_cast<int> (buf[0]) - m;
for (int i = 0; i < size; i++) extra[nlocal][i] = buf[m++];
}
atom->nlocal++;
return m;
}
/* ----------------------------------------------------------------------
create one atom of itype at coord
set other values to defaults
------------------------------------------------------------------------- */
void AtomVecBody::create_atom(int itype, double *coord)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
tag[nlocal] = 0;
type[nlocal] = itype;
x[nlocal][0] = coord[0];
x[nlocal][1] = coord[1];
x[nlocal][2] = coord[2];
mask[nlocal] = 1;
image[nlocal] = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
v[nlocal][0] = 0.0;
v[nlocal][1] = 0.0;
v[nlocal][2] = 0.0;
+ radius[nlocal] = 0.5;
rmass[nlocal] = 1.0;
angmom[nlocal][0] = 0.0;
angmom[nlocal][1] = 0.0;
angmom[nlocal][2] = 0.0;
body[nlocal] = -1;
atom->nlocal++;
}
/* ----------------------------------------------------------------------
unpack one line from Atoms section of data file
initialize other atom quantities
------------------------------------------------------------------------- */
void AtomVecBody::data_atom(double *coord, imageint imagetmp, char **values)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
tag[nlocal] = ATOTAGINT(values[0]);
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
body[nlocal] = atoi(values[2]);
if (body[nlocal] == 0) body[nlocal] = -1;
else if (body[nlocal] == 1) body[nlocal] = 0;
else error->one(FLERR,"Invalid atom type in Atoms section of data file");
rmass[nlocal] = atof(values[3]);
if (rmass[nlocal] <= 0.0)
error->one(FLERR,"Invalid density in Atoms section of data file");
x[nlocal][0] = coord[0];
x[nlocal][1] = coord[1];
x[nlocal][2] = coord[2];
image[nlocal] = imagetmp;
mask[nlocal] = 1;
v[nlocal][0] = 0.0;
v[nlocal][1] = 0.0;
v[nlocal][2] = 0.0;
angmom[nlocal][0] = 0.0;
angmom[nlocal][1] = 0.0;
angmom[nlocal][2] = 0.0;
+ radius[nlocal] = 0.5;
atom->nlocal++;
}
/* ----------------------------------------------------------------------
unpack hybrid quantities from one line in Atoms section of data file
initialize other atom quantities for this sub-style
------------------------------------------------------------------------- */
int AtomVecBody::data_atom_hybrid(int nlocal, char **values)
{
body[nlocal] = atoi(values[0]);
if (body[nlocal] == 0) body[nlocal] = -1;
else if (body[nlocal] == 1) body[nlocal] = 0;
else error->one(FLERR,"Invalid atom type in Atoms section of data file");
rmass[nlocal] = atof(values[1]);
if (rmass[nlocal] <= 0.0)
error->one(FLERR,"Invalid density in Atoms section of data file");
return 2;
}
/* ----------------------------------------------------------------------
unpack one body from Bodies section of data file
------------------------------------------------------------------------- */
void AtomVecBody::data_body(int m, int ninteger, int ndouble,
- char **ivalues, char **dvalues)
+ int *ivalues, double *dvalues)
{
if (body[m]) error->one(FLERR,"Assigning body parameters to non-body atom");
if (nlocal_bonus == nmax_bonus) grow_bonus();
- bptr->data_body(nlocal_bonus,ninteger,ndouble,ivalues,dvalues);
bonus[nlocal_bonus].ilocal = m;
+ bptr->data_body(nlocal_bonus,ninteger,ndouble,ivalues,dvalues);
body[m] = nlocal_bonus++;
}
/* ----------------------------------------------------------------------
unpack one tri from Velocities section of data file
------------------------------------------------------------------------- */
void AtomVecBody::data_vel(int m, char **values)
{
v[m][0] = atof(values[0]);
v[m][1] = atof(values[1]);
v[m][2] = atof(values[2]);
angmom[m][0] = atof(values[3]);
angmom[m][1] = atof(values[4]);
angmom[m][2] = atof(values[5]);
}
/* ----------------------------------------------------------------------
unpack hybrid quantities from one body in Velocities section of data file
------------------------------------------------------------------------- */
int AtomVecBody::data_vel_hybrid(int m, char **values)
{
angmom[m][0] = atof(values[0]);
angmom[m][1] = atof(values[1]);
angmom[m][2] = atof(values[2]);
return 3;
}
/* ----------------------------------------------------------------------
pack atom info for data file including 3 image flags
------------------------------------------------------------------------- */
void AtomVecBody::pack_data(double **buf)
{
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
buf[i][0] = ubuf(tag[i]).d;
buf[i][1] = ubuf(type[i]).d;
if (body[i] < 0) buf[i][2] = ubuf(0).d;
else buf[i][2] = ubuf(1).d;
buf[i][3] = rmass[i];
buf[i][4] = x[i][0];
buf[i][5] = x[i][1];
buf[i][6] = x[i][2];
buf[i][7] = ubuf((image[i] & IMGMASK) - IMGMAX).d;
buf[i][8] = ubuf((image[i] >> IMGBITS & IMGMASK) - IMGMAX).d;
buf[i][9] = ubuf((image[i] >> IMG2BITS) - IMGMAX).d;
}
}
/* ----------------------------------------------------------------------
pack hybrid atom info for data file
------------------------------------------------------------------------- */
int AtomVecBody::pack_data_hybrid(int i, double *buf)
{
if (body[i] < 0) buf[0] = ubuf(0).d;
else buf[0] = ubuf(1).d;
buf[1] = rmass[i];
return 2;
}
/* ----------------------------------------------------------------------
write atom info to data file including 3 image flags
------------------------------------------------------------------------- */
void AtomVecBody::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
fprintf(fp,TAGINT_FORMAT " %d %d %g %g %g %g %d %d %d\n",
(tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
(int) ubuf(buf[i][2]).i,
buf[i][3],buf[i][4],buf[i][5],buf[i][6],
(int) ubuf(buf[i][7]).i,(int) ubuf(buf[i][8]).i,
(int) ubuf(buf[i][9]).i);
}
/* ----------------------------------------------------------------------
write hybrid atom info to data file
------------------------------------------------------------------------- */
int AtomVecBody::write_data_hybrid(FILE *fp, double *buf)
{
fprintf(fp," %d %g",(int) ubuf(buf[0]).i,buf[1]);
return 2;
}
/* ----------------------------------------------------------------------
pack velocity info for data file
------------------------------------------------------------------------- */
void AtomVecBody::pack_vel(double **buf)
{
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
buf[i][0] = ubuf(tag[i]).d;
buf[i][1] = v[i][0];
buf[i][2] = v[i][1];
buf[i][3] = v[i][2];
buf[i][4] = angmom[i][0];
buf[i][5] = angmom[i][1];
buf[i][6] = angmom[i][2];
}
}
/* ----------------------------------------------------------------------
pack hybrid velocity info for data file
------------------------------------------------------------------------- */
int AtomVecBody::pack_vel_hybrid(int i, double *buf)
{
buf[0] = angmom[i][0];
buf[1] = angmom[i][1];
buf[2] = angmom[i][2];
return 3;
}
/* ----------------------------------------------------------------------
write velocity info to data file
------------------------------------------------------------------------- */
void AtomVecBody::write_vel(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
fprintf(fp,TAGINT_FORMAT " %g %g %g %g %g %g\n",
(tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
buf[i][4],buf[i][5],buf[i][6]);
}
/* ----------------------------------------------------------------------
write hybrid velocity info to data file
------------------------------------------------------------------------- */
int AtomVecBody::write_vel_hybrid(FILE *fp, double *buf)
{
fprintf(fp," %g %g %g",buf[0],buf[1],buf[2]);
return 3;
}
+/* ----------------------------------------------------------------------
+ body computes its size based on ivalues/dvalues and returns it
+------------------------------------------------------------------------- */
+
+double AtomVecBody::radius_body(int ninteger, int ndouble,
+ int *ivalues, double *dvalues)
+{
+ return bptr->radius_body(ninteger,ndouble,ivalues,dvalues);
+}
+
+/* ----------------------------------------------------------------------
+ reset quat orientation for atom M to quat_external
+ called by Atom:add_molecule_atom()
+------------------------------------------------------------------------- */
+
+void AtomVecBody::set_quat(int m, double *quat_external)
+{
+ if (body[m] < 0) error->one(FLERR,"Assigning quat to non-body atom");
+ double *quat = bonus[body[m]].quat;
+ quat[0] = quat_external[0]; quat[1] = quat_external[1];
+ quat[2] = quat_external[2]; quat[3] = quat_external[3];
+}
+
/* ----------------------------------------------------------------------
return # of bytes of allocated memory
------------------------------------------------------------------------- */
bigint AtomVecBody::memory_usage()
{
bigint bytes = 0;
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax*comm->nthreads,3);
+ if (atom->memcheck("radius")) bytes += memory->usage(radius,nmax);
if (atom->memcheck("rmass")) bytes += memory->usage(rmass,nmax);
if (atom->memcheck("angmom")) bytes += memory->usage(angmom,nmax,3);
if (atom->memcheck("torque")) bytes +=
memory->usage(torque,nmax*comm->nthreads,3);
if (atom->memcheck("body")) bytes += memory->usage(body,nmax);
bytes += nmax_bonus*sizeof(Bonus);
bytes += icp->size + dcp->size;
int nall = nlocal_bonus + nghost_bonus;
for (int i = 0; i < nall; i++) {
bytes += bonus[i].ninteger * sizeof(int);
bytes += bonus[i].ndouble * sizeof(double);
}
return bytes;
}
/* ----------------------------------------------------------------------
debug method for sanity checking of own/bonus data pointers
------------------------------------------------------------------------- */
/*
void AtomVecBody::check(int flag)
{
for (int i = 0; i < atom->nlocal; i++) {
if (atom->body[i] >= 0 && atom->body[i] >= nlocal_bonus) {
printf("Proc %d, step %ld, flag %d\n",comm->me,update->ntimestep,flag);
errorx->one(FLERR,"BAD AAA");
}
}
for (int i = atom->nlocal; i < atom->nlocal+atom->nghost; i++) {
if (atom->body[i] >= 0 &&
(atom->body[i] < nlocal_bonus ||
atom->body[i] >= nlocal_bonus+nghost_bonus)) {
printf("Proc %d, step %ld, flag %d\n",comm->me,update->ntimestep,flag);
errorx->one(FLERR,"BAD BBB");
}
}
for (int i = 0; i < nlocal_bonus; i++) {
if (bonus[i].ilocal < 0 || bonus[i].ilocal >= atom->nlocal) {
printf("Proc %d, step %ld, flag %d\n",comm->me,update->ntimestep,flag);
errorx->one(FLERR,"BAD CCC");
}
}
for (int i = 0; i < nlocal_bonus; i++) {
if (atom->body[bonus[i].ilocal] != i) {
printf("Proc %d, step %ld, flag %d\n",comm->me,update->ntimestep,flag);
errorx->one(FLERR,"BAD DDD");
}
}
for (int i = nlocal_bonus; i < nlocal_bonus+nghost_bonus; i++) {
if (bonus[i].ilocal < atom->nlocal ||
bonus[i].ilocal >= atom->nlocal+atom->nghost) {
printf("Proc %d, step %ld, flag %d\n",comm->me,update->ntimestep,flag);
errorx->one(FLERR,"BAD EEE");
}
}
for (int i = nlocal_bonus; i < nlocal_bonus+nghost_bonus; i++) {
if (atom->body[bonus[i].ilocal] != i) {
printf("Proc %d, step %ld, flag %d\n",comm->me,update->ntimestep,flag);
errorx->one(FLERR,"BAD FFF");
}
}
}
*/
diff --git a/src/atom_vec_body.h b/src/atom_vec_body.h
index e35f695ed..4ed27f616 100644
--- a/src/atom_vec_body.h
+++ b/src/atom_vec_body.h
@@ -1,146 +1,152 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef ATOM_CLASS
AtomStyle(body,AtomVecBody)
#else
#ifndef LMP_ATOM_VEC_BODY_H
#define LMP_ATOM_VEC_BODY_H
#include "atom_vec.h"
#include "my_pool_chunk.h"
namespace LAMMPS_NS {
class AtomVecBody : public AtomVec {
public:
class Body *bptr;
struct Bonus {
double quat[4];
double inertia[3];
int ninteger,ndouble;
int iindex,dindex;
int *ivalue;
double *dvalue;
int ilocal;
};
struct Bonus *bonus;
AtomVecBody(class LAMMPS *);
~AtomVecBody();
void process_args(int, char **);
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
int pack_comm_hybrid(int, int *, double *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int unpack_comm_hybrid(int, int, double *);
int pack_reverse(int, int, double *);
int pack_reverse_hybrid(int, int, double *);
void unpack_reverse(int, int *, double *);
int unpack_reverse_hybrid(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, int, double *);
int pack_exchange(int, double *);
int unpack_exchange(double *);
int size_restart();
int pack_restart(int, double *);
int unpack_restart(double *);
void create_atom(int, double *);
void data_atom(double *, imageint, char **);
int data_atom_hybrid(int, char **);
void data_vel(int, char **);
int data_vel_hybrid(int, char **);
void pack_data(double **);
int pack_data_hybrid(int, double *);
void write_data(FILE *, int, double **);
int write_data_hybrid(FILE *, double *);
void pack_vel(double **);
int pack_vel_hybrid(int, double *);
void write_vel(FILE *, int, double **);
int write_vel_hybrid(FILE *, double *);
bigint memory_usage();
// manipulate Bonus data structure for extra atom info
void clear_bonus();
- void data_body(int, int, int, char **, char **);
+ void data_body(int, int, int, int *, double *);
+ // methods used by other classes to query/set body info
+
+ double radius_body(int, int, int *, double *);
+ void set_quat(int, double *);
+
private:
tagint *tag;
int *type,*mask;
imageint *image;
double **x,**v,**f;
+ double *radius;
double *rmass;
double **angmom,**torque;
int *body;
int nlocal_bonus,nghost_bonus,nmax_bonus;
int intdoubleratio; // sizeof(double) / sizeof(int)
MyPoolChunk<int> *icp;
MyPoolChunk<double> *dcp;
void grow_bonus();
void copy_bonus(int, int);
//void check(int);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Internal error in atom_style body
This error should not occur. Contact the developers.
E: Invalid atom_style body command
No body style argument was provided.
E: Unknown body style
The choice of body style is unknown.
E: Per-processor system is too big
The number of owned atoms plus ghost atoms on a single
processor must fit in 32-bit integer.
E: Invalid atom type in Atoms section of data file
Atom types must range from 1 to specified # of types.
E: Invalid density in Atoms section of data file
Density value cannot be <= 0.0.
E: Assigning body parameters to non-body atom
Self-explanatory.
*/
diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp
index 3c2272cc6..0839530e4 100644
--- a/src/atom_vec_line.cpp
+++ b/src/atom_vec_line.cpp
@@ -1,1303 +1,1353 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "atom_vec_line.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "modify.h"
#include "force.h"
#include "fix.h"
+#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
+using namespace MathConst;
#define EPSILON 0.001
/* ---------------------------------------------------------------------- */
AtomVecLine::AtomVecLine(LAMMPS *lmp) : AtomVec(lmp)
{
molecular = 0;
comm_x_only = comm_f_only = 0;
size_forward = 4;
size_reverse = 6;
- size_border = 10;
+ size_border = 12;
size_velocity = 6;
size_data_atom = 8;
size_data_vel = 7;
size_data_bonus = 5;
xcol_data = 6;
atom->line_flag = 1;
atom->molecule_flag = atom->rmass_flag = 1;
- atom->omega_flag = atom->torque_flag = 1;
+ atom->radius_flag = atom->omega_flag = atom->torque_flag = 1;
+ atom->sphere_flag = 1;
nlocal_bonus = nghost_bonus = nmax_bonus = 0;
bonus = NULL;
}
/* ---------------------------------------------------------------------- */
AtomVecLine::~AtomVecLine()
{
memory->sfree(bonus);
}
/* ---------------------------------------------------------------------- */
void AtomVecLine::init()
{
AtomVec::init();
if (domain->dimension != 2)
error->all(FLERR,"Atom_style line can only be used in 2d simulations");
}
/* ----------------------------------------------------------------------
grow atom arrays
n = 0 grows arrays by a chunk
n > 0 allocates arrays to size n
------------------------------------------------------------------------- */
void AtomVecLine::grow(int n)
{
if (n == 0) grow_nmax();
else nmax = n;
atom->nmax = nmax;
if (nmax < 0)
error->one(FLERR,"Per-processor system is too big");
tag = memory->grow(atom->tag,nmax,"atom:tag");
type = memory->grow(atom->type,nmax,"atom:type");
mask = memory->grow(atom->mask,nmax,"atom:mask");
image = memory->grow(atom->image,nmax,"atom:image");
x = memory->grow(atom->x,nmax,3,"atom:x");
v = memory->grow(atom->v,nmax,3,"atom:v");
f = memory->grow(atom->f,nmax*comm->nthreads,3,"atom:f");
molecule = memory->grow(atom->molecule,nmax,"atom:molecule");
rmass = memory->grow(atom->rmass,nmax,"atom:rmass");
+ radius = memory->grow(atom->radius,nmax,"atom:radius");
omega = memory->grow(atom->omega,nmax,3,"atom:omega");
torque = memory->grow(atom->torque,nmax*comm->nthreads,3,"atom:torque");
line = memory->grow(atom->line,nmax,"atom:line");
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecLine::grow_reset()
{
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
molecule = atom->molecule; rmass = atom->rmass;
- omega = atom->omega; torque = atom->torque;
+ radius = atom->radius; omega = atom->omega; torque = atom->torque;
line = atom->line;
}
/* ----------------------------------------------------------------------
grow bonus data structure
------------------------------------------------------------------------- */
void AtomVecLine::grow_bonus()
{
nmax_bonus = grow_nmax_bonus(nmax_bonus);
if (nmax_bonus < 0)
error->one(FLERR,"Per-processor system is too big");
bonus = (Bonus *) memory->srealloc(bonus,nmax_bonus*sizeof(Bonus),
"atom:bonus");
}
/* ----------------------------------------------------------------------
copy atom I info to atom J
------------------------------------------------------------------------- */
void AtomVecLine::copy(int i, int j, int delflag)
{
tag[j] = tag[i];
type[j] = type[i];
mask[j] = mask[i];
image[j] = image[i];
x[j][0] = x[i][0];
x[j][1] = x[i][1];
x[j][2] = x[i][2];
v[j][0] = v[i][0];
v[j][1] = v[i][1];
v[j][2] = v[i][2];
molecule[j] = molecule[i];
rmass[j] = rmass[i];
+ radius[j] = radius[i];
omega[j][0] = omega[i][0];
omega[j][1] = omega[i][1];
omega[j][2] = omega[i][2];
// if deleting atom J via delflag and J has bonus data, then delete it
if (delflag && line[j] >= 0) {
copy_bonus(nlocal_bonus-1,line[j]);
nlocal_bonus--;
}
// if atom I has bonus data, reset I's bonus.ilocal to loc J
// do NOT do this if self-copy (I=J) since I's bonus data is already deleted
if (line[i] >= 0 && i != j) bonus[line[i]].ilocal = j;
line[j] = line[i];
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j,delflag);
}
/* ----------------------------------------------------------------------
copy bonus data from I to J, effectively deleting the J entry
also reset ine that points to I to now point to J
------------------------------------------------------------------------- */
void AtomVecLine::copy_bonus(int i, int j)
{
line[bonus[i].ilocal] = j;
memcpy(&bonus[j],&bonus[i],sizeof(Bonus));
}
/* ----------------------------------------------------------------------
clear ghost info in bonus data
called before ghosts are recommunicated in comm and irregular
------------------------------------------------------------------------- */
void AtomVecLine::clear_bonus()
{
nghost_bonus = 0;
}
/* ----------------------------------------------------------------------
set length value in bonus data for particle I
oriented along x axis
this may create or delete entry in bonus data
------------------------------------------------------------------------- */
void AtomVecLine::set_length(int i, double value)
{
if (line[i] < 0) {
if (value == 0.0) return;
if (nlocal_bonus == nmax_bonus) grow_bonus();
bonus[nlocal_bonus].length = value;
bonus[nlocal_bonus].theta = 0.0;
bonus[nlocal_bonus].ilocal = i;
line[i] = nlocal_bonus++;
} else if (value == 0.0) {
copy_bonus(nlocal_bonus-1,line[i]);
nlocal_bonus--;
line[i] = -1;
} else bonus[line[i]].length = value;
+
+ // also set radius = half of length
+ // unless value = 0.0, then set diameter = 1.0
+
+ radius[i] = 0.5 * value;
+ if (value == 0.0) radius[i] = 0.5;
}
/* ---------------------------------------------------------------------- */
int AtomVecLine::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
if (line[j] >= 0) buf[m++] = bonus[line[j]].theta;
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
dz = pbc[2]*domain->zprd;
}
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
if (line[j] >= 0) buf[m++] = bonus[line[j]].theta;
}
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecLine::pack_comm_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz,dvx,dvy,dvz;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
if (line[j] >= 0) buf[m++] = bonus[line[j]].theta;
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
buf[m++] = omega[j][0];
buf[m++] = omega[j][1];
buf[m++] = omega[j][2];
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
dz = pbc[2]*domain->zprd;
}
if (!deform_vremap) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
if (line[j] >= 0) buf[m++] = bonus[line[j]].theta;
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
buf[m++] = omega[j][0];
buf[m++] = omega[j][1];
buf[m++] = omega[j][2];
}
} else {
dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
dvz = pbc[2]*h_rate[2];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
if (line[j] >= 0) buf[m++] = bonus[line[j]].theta;
if (mask[i] & deform_groupbit) {
buf[m++] = v[j][0] + dvx;
buf[m++] = v[j][1] + dvy;
buf[m++] = v[j][2] + dvz;
} else {
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
}
buf[m++] = omega[j][0];
buf[m++] = omega[j][1];
buf[m++] = omega[j][2];
}
}
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecLine::pack_comm_hybrid(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
if (line[j] >= 0) buf[m++] = bonus[line[j]].theta;
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecLine::unpack_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
if (line[i] >= 0) bonus[line[i]].theta = buf[m++];
}
}
/* ---------------------------------------------------------------------- */
void AtomVecLine::unpack_comm_vel(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
if (line[i] >= 0) bonus[line[i]].theta = buf[m++];
v[i][0] = buf[m++];
v[i][1] = buf[m++];
v[i][2] = buf[m++];
omega[i][0] = buf[m++];
omega[i][1] = buf[m++];
omega[i][2] = buf[m++];
}
}
/* ---------------------------------------------------------------------- */
int AtomVecLine::unpack_comm_hybrid(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++)
if (line[i] >= 0) bonus[line[i]].theta = buf[m++];
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecLine::pack_reverse(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
buf[m++] = f[i][0];
buf[m++] = f[i][1];
buf[m++] = f[i][2];
buf[m++] = torque[i][0];
buf[m++] = torque[i][1];
buf[m++] = torque[i][2];
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecLine::pack_reverse_hybrid(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
buf[m++] = torque[i][0];
buf[m++] = torque[i][1];
buf[m++] = torque[i][2];
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecLine::unpack_reverse(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
f[j][0] += buf[m++];
f[j][1] += buf[m++];
f[j][2] += buf[m++];
torque[j][0] += buf[m++];
torque[j][1] += buf[m++];
torque[j][2] += buf[m++];
}
}
/* ---------------------------------------------------------------------- */
int AtomVecLine::unpack_reverse_hybrid(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
torque[j][0] += buf[m++];
torque[j][1] += buf[m++];
torque[j][2] += buf[m++];
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecLine::pack_border(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
buf[m++] = ubuf(molecule[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (line[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
buf[m++] = bonus[line[j]].length;
buf[m++] = bonus[line[j]].theta;
}
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0];
dy = pbc[1];
dz = pbc[2];
}
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
buf[m++] = ubuf(molecule[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (line[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
buf[m++] = bonus[line[j]].length;
buf[m++] = bonus[line[j]].theta;
}
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->pack_border(n,list,&buf[m]);
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecLine::pack_border_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz,dvx,dvy,dvz;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
buf[m++] = ubuf(molecule[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (line[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
buf[m++] = bonus[line[j]].length;
buf[m++] = bonus[line[j]].theta;
}
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
buf[m++] = omega[j][0];
buf[m++] = omega[j][1];
buf[m++] = omega[j][2];
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0];
dy = pbc[1];
dz = pbc[2];
}
if (!deform_vremap) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
buf[m++] = ubuf(molecule[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (line[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
buf[m++] = bonus[line[j]].length;
buf[m++] = bonus[line[j]].theta;
}
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
buf[m++] = omega[j][0];
buf[m++] = omega[j][1];
buf[m++] = omega[j][2];
}
} else {
dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
dvz = pbc[2]*h_rate[2];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
buf[m++] = ubuf(molecule[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (line[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
buf[m++] = bonus[line[j]].length;
buf[m++] = bonus[line[j]].theta;
}
if (mask[i] & deform_groupbit) {
buf[m++] = v[j][0] + dvx;
buf[m++] = v[j][1] + dvy;
buf[m++] = v[j][2] + dvz;
} else {
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
}
buf[m++] = omega[j][0];
buf[m++] = omega[j][1];
buf[m++] = omega[j][2];
}
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->pack_border(n,list,&buf[m]);
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecLine::pack_border_hybrid(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = ubuf(molecule[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (line[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
buf[m++] = bonus[line[j]].length;
buf[m++] = bonus[line[j]].theta;
}
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecLine::unpack_border(int n, int first, double *buf)
{
int i,j,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
if (i == nmax) grow(0);
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (tagint) ubuf(buf[m++]).i;
+ radius[i] = buf[m++];
+ rmass[i] = buf[m++];
line[i] = (int) ubuf(buf[m++]).i;
if (line[i] == 0) line[i] = -1;
else {
j = nlocal_bonus + nghost_bonus;
if (j == nmax_bonus) grow_bonus();
bonus[j].length = buf[m++];
bonus[j].theta = buf[m++];
bonus[j].ilocal = i;
line[i] = j;
nghost_bonus++;
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->
unpack_border(n,first,&buf[m]);
}
/* ---------------------------------------------------------------------- */
void AtomVecLine::unpack_border_vel(int n, int first, double *buf)
{
int i,j,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
if (i == nmax) grow(0);
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (tagint) ubuf(buf[m++]).i;
+ radius[i] = buf[m++];
+ rmass[i] = buf[m++];
line[i] = (int) ubuf(buf[m++]).i;
if (line[i] == 0) line[i] = -1;
else {
j = nlocal_bonus + nghost_bonus;
if (j == nmax_bonus) grow_bonus();
bonus[j].length = buf[m++];
bonus[j].theta = buf[m++];
bonus[j].ilocal = i;
line[i] = j;
nghost_bonus++;
}
v[i][0] = buf[m++];
v[i][1] = buf[m++];
v[i][2] = buf[m++];
omega[i][0] = buf[m++];
omega[i][1] = buf[m++];
omega[i][2] = buf[m++];
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->
unpack_border(n,first,&buf[m]);
}
/* ---------------------------------------------------------------------- */
int AtomVecLine::unpack_border_hybrid(int n, int first, double *buf)
{
int i,j,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
molecule[i] = (tagint) ubuf(buf[m++]).i;
+ radius[i] = buf[m++];
+ rmass[i] = buf[m++];
line[i] = (int) ubuf(buf[m++]).i;
if (line[i] == 0) line[i] = -1;
else {
j = nlocal_bonus + nghost_bonus;
if (j == nmax_bonus) grow_bonus();
bonus[j].length = buf[m++];
bonus[j].theta = buf[m++];
bonus[j].ilocal = i;
line[i] = j;
nghost_bonus++;
}
}
return m;
}
/* ----------------------------------------------------------------------
pack data for atom I for sending to another proc
xyz must be 1st 3 values, so comm::exchange() can test on them
------------------------------------------------------------------------- */
int AtomVecLine::pack_exchange(int i, double *buf)
{
int m = 1;
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
buf[m++] = v[i][0];
buf[m++] = v[i][1];
buf[m++] = v[i][2];
buf[m++] = ubuf(tag[i]).d;
buf[m++] = ubuf(type[i]).d;
buf[m++] = ubuf(mask[i]).d;
buf[m++] = ubuf(image[i]).d;
buf[m++] = ubuf(molecule[i]).d;
buf[m++] = rmass[i];
+ buf[m++] = radius[i];
buf[m++] = omega[i][0];
buf[m++] = omega[i][1];
buf[m++] = omega[i][2];
if (line[i] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
int j = line[i];
buf[m++] = bonus[j].length;
buf[m++] = bonus[j].theta;
}
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
buf[0] = m;
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecLine::unpack_exchange(double *buf)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
int m = 1;
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
molecule[nlocal] = (tagint) ubuf(buf[m++]).i;
rmass[nlocal] = buf[m++];
+ radius[nlocal] = buf[m++];
omega[nlocal][0] = buf[m++];
omega[nlocal][1] = buf[m++];
omega[nlocal][2] = buf[m++];
line[nlocal] = (int) ubuf(buf[m++]).i;
if (line[nlocal] == 0) line[nlocal] = -1;
else {
if (nlocal_bonus == nmax_bonus) grow_bonus();
bonus[nlocal_bonus].length = buf[m++];
bonus[nlocal_bonus].theta = buf[m++];
bonus[nlocal_bonus].ilocal = nlocal;
line[nlocal] = nlocal_bonus++;
}
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
m += modify->fix[atom->extra_grow[iextra]]->
unpack_exchange(nlocal,&buf[m]);
atom->nlocal++;
return m;
}
/* ----------------------------------------------------------------------
size of restart data for all atoms owned by this proc
include extra data stored by fixes
------------------------------------------------------------------------- */
int AtomVecLine::size_restart()
{
int i;
int n = 0;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++)
- if (line[i] >= 0) n += 19;
- else n += 17;
+ if (line[i] >= 0) n += 20;
+ else n += 18;
if (atom->nextra_restart)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
for (i = 0; i < nlocal; i++)
n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
return n;
}
/* ----------------------------------------------------------------------
pack atom I's data for restart file including extra quantities
xyz must be 1st 3 values, so that read_restart can test on them
molecular types may be negative, but write as positive
------------------------------------------------------------------------- */
int AtomVecLine::pack_restart(int i, double *buf)
{
int m = 1;
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
buf[m++] = ubuf(tag[i]).d;
buf[m++] = ubuf(type[i]).d;
buf[m++] = ubuf(mask[i]).d;
buf[m++] = ubuf(image[i]).d;
buf[m++] = v[i][0];
buf[m++] = v[i][1];
buf[m++] = v[i][2];
buf[m++] = ubuf(molecule[i]).d;
buf[m++] = rmass[i];
+ buf[m++] = radius[i];
buf[m++] = omega[i][0];
buf[m++] = omega[i][1];
buf[m++] = omega[i][2];
if (line[i] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
int j = line[i];
buf[m++] = bonus[j].length;
buf[m++] = bonus[j].theta;
}
if (atom->nextra_restart)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
buf[0] = m;
return m;
}
/* ----------------------------------------------------------------------
unpack data for one atom from restart file including extra quantities
------------------------------------------------------------------------- */
int AtomVecLine::unpack_restart(double *buf)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
molecule[nlocal] = (tagint) ubuf(buf[m++]).i;
rmass[nlocal] = buf[m++];
+ radius[nlocal] = buf[m++];
omega[nlocal][0] = buf[m++];
omega[nlocal][1] = buf[m++];
omega[nlocal][2] = buf[m++];
line[nlocal] = (int) ubuf(buf[m++]).i;
if (line[nlocal] == 0) line[nlocal] = -1;
else {
if (nlocal_bonus == nmax_bonus) grow_bonus();
bonus[nlocal_bonus].length = buf[m++];
bonus[nlocal_bonus].theta = buf[m++];
bonus[nlocal_bonus].ilocal = nlocal;
line[nlocal] = nlocal_bonus++;
}
double **extra = atom->extra;
if (atom->nextra_store) {
int size = static_cast<int> (buf[0]) - m;
for (int i = 0; i < size; i++) extra[nlocal][i] = buf[m++];
}
atom->nlocal++;
return m;
}
/* ----------------------------------------------------------------------
create one atom of itype at coord
set other values to defaults
------------------------------------------------------------------------- */
void AtomVecLine::create_atom(int itype, double *coord)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
tag[nlocal] = 0;
type[nlocal] = itype;
x[nlocal][0] = coord[0];
x[nlocal][1] = coord[1];
x[nlocal][2] = coord[2];
mask[nlocal] = 1;
image[nlocal] = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
v[nlocal][0] = 0.0;
v[nlocal][1] = 0.0;
v[nlocal][2] = 0.0;
molecule[nlocal] = 0;
- rmass[nlocal] = 1.0;
+ radius[nlocal] = 0.5;
+ rmass[nlocal] = 4.0*MY_PI/3.0 * radius[nlocal]*radius[nlocal]*radius[nlocal];
omega[nlocal][0] = 0.0;
omega[nlocal][1] = 0.0;
omega[nlocal][2] = 0.0;
line[nlocal] = -1;
atom->nlocal++;
}
/* ----------------------------------------------------------------------
unpack one line from Atoms section of data file
initialize other atom quantities
------------------------------------------------------------------------- */
void AtomVecLine::data_atom(double *coord, imageint imagetmp, char **values)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
tag[nlocal] = ATOTAGINT(values[0]);
molecule[nlocal] = ATOTAGINT(values[1]);
type[nlocal] = atoi(values[2]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
line[nlocal] = atoi(values[3]);
if (line[nlocal] == 0) line[nlocal] = -1;
else if (line[nlocal] == 1) line[nlocal] = 0;
else error->one(FLERR,"Invalid atom type in Atoms section of data file");
rmass[nlocal] = atof(values[4]);
if (rmass[nlocal] <= 0.0)
error->one(FLERR,"Invalid density in Atoms section of data file");
+ if (line[nlocal] < 0) {
+ radius[nlocal] = 0.5;
+ rmass[nlocal] *= 4.0*MY_PI/3.0 *
+ radius[nlocal]*radius[nlocal]*radius[nlocal];
+ } else radius[nlocal] = 0.0;
+
x[nlocal][0] = coord[0];
x[nlocal][1] = coord[1];
x[nlocal][2] = coord[2];
image[nlocal] = imagetmp;
mask[nlocal] = 1;
v[nlocal][0] = 0.0;
v[nlocal][1] = 0.0;
v[nlocal][2] = 0.0;
omega[nlocal][0] = 0.0;
omega[nlocal][1] = 0.0;
omega[nlocal][2] = 0.0;
atom->nlocal++;
}
/* ----------------------------------------------------------------------
unpack hybrid quantities from one line in Atoms section of data file
initialize other atom quantities for this sub-style
------------------------------------------------------------------------- */
int AtomVecLine::data_atom_hybrid(int nlocal, char **values)
{
molecule[nlocal] = ATOTAGINT(values[0]);
line[nlocal] = atoi(values[1]);
if (line[nlocal] == 0) line[nlocal] = -1;
else if (line[nlocal] == 1) line[nlocal] = 0;
else error->one(FLERR,"Invalid atom type in Atoms section of data file");
rmass[nlocal] = atof(values[2]);
if (rmass[nlocal] <= 0.0)
error->one(FLERR,"Invalid density in Atoms section of data file");
+ if (line[nlocal] < 0) {
+ radius[nlocal] = 0.5;
+ rmass[nlocal] *= 4.0*MY_PI/3.0 *
+ radius[nlocal]*radius[nlocal]*radius[nlocal];
+ } else radius[nlocal] = 0.0;
+
return 3;
}
/* ----------------------------------------------------------------------
unpack one line from Lines section of data file
------------------------------------------------------------------------- */
void AtomVecLine::data_atom_bonus(int m, char **values)
{
if (line[m]) error->one(FLERR,"Assigning line parameters to non-line atom");
if (nlocal_bonus == nmax_bonus) grow_bonus();
double x1 = atof(values[0]);
double y1 = atof(values[1]);
double x2 = atof(values[2]);
double y2 = atof(values[3]);
double dx = x2 - x1;
double dy = y2 - y1;
double length = sqrt(dx*dx + dy*dy);
bonus[nlocal_bonus].length = length;
if (dy >= 0.0) bonus[nlocal_bonus].theta = acos(dx/length);
else bonus[nlocal_bonus].theta = -acos(dx/length);
double xc = 0.5*(x1+x2);
double yc = 0.5*(y1+y2);
dx = xc - x[m][0];
dy = yc - x[m][1];
double delta = sqrt(dx*dx + dy*dy);
if (delta/length > EPSILON)
error->one(FLERR,"Inconsistent line segment in data file");
x[m][0] = xc;
x[m][1] = yc;
- // reset line mass
- // previously stored density in rmass
+ // reset line radius and mass
+ // rmass currently holds density
+ radius[m] = 0.5 * length;
rmass[m] *= length;
bonus[nlocal_bonus].ilocal = m;
line[m] = nlocal_bonus++;
}
/* ----------------------------------------------------------------------
unpack one line from Velocities section of data file
------------------------------------------------------------------------- */
void AtomVecLine::data_vel(int m, char **values)
{
v[m][0] = atof(values[0]);
v[m][1] = atof(values[1]);
v[m][2] = atof(values[2]);
omega[m][0] = atof(values[3]);
omega[m][1] = atof(values[4]);
omega[m][2] = atof(values[5]);
}
/* ----------------------------------------------------------------------
unpack hybrid quantities from one line in Velocities section of data file
------------------------------------------------------------------------- */
int AtomVecLine::data_vel_hybrid(int m, char **values)
{
omega[m][0] = atof(values[0]);
omega[m][1] = atof(values[1]);
omega[m][2] = atof(values[2]);
return 3;
}
/* ----------------------------------------------------------------------
pack atom info for data file including 3 image flags
------------------------------------------------------------------------- */
void AtomVecLine::pack_data(double **buf)
{
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
buf[i][0] = ubuf(tag[i]).d;
buf[i][1] = ubuf(molecule[i]).d;
buf[i][2] = ubuf(type[i]).d;
if (line[i] < 0) buf[i][3] = ubuf(0).d;
else buf[i][3] = ubuf(1).d;
- if (line[i] < 0) buf[i][4] = rmass[i];
+ if (line[i] < 0)
+ buf[i][4] = rmass[i] / (4.0*MY_PI/3.0 * radius[i]*radius[i]*radius[i]);
else buf[i][4] = rmass[i]/bonus[line[i]].length;
buf[i][5] = x[i][0];
buf[i][6] = x[i][1];
buf[i][7] = x[i][2];
buf[i][8] = ubuf((image[i] & IMGMASK) - IMGMAX).d;
buf[i][9] = ubuf((image[i] >> IMGBITS & IMGMASK) - IMGMAX).d;
buf[i][10] = ubuf((image[i] >> IMG2BITS) - IMGMAX).d;
}
}
/* ----------------------------------------------------------------------
pack hybrid atom info for data file
------------------------------------------------------------------------- */
int AtomVecLine::pack_data_hybrid(int i, double *buf)
{
buf[0] = ubuf(molecule[i]).d;
if (line[i] < 0) buf[1] = ubuf(0).d;
else buf[1] = ubuf(1).d;
- if (line[i] < 0) buf[2] = rmass[i];
+ if (line[i] < 0)
+ buf[2] = rmass[i] / (4.0*MY_PI/3.0 * radius[i]*radius[i]*radius[i]);
else buf[2] = rmass[i]/bonus[line[i]].length;
return 3;
}
/* ----------------------------------------------------------------------
write atom info to data file including 3 image flags
------------------------------------------------------------------------- */
void AtomVecLine::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
fprintf(fp,TAGINT_FORMAT " " TAGINT_FORMAT
" %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
(tagint) ubuf(buf[i][0]).i,(tagint) ubuf(buf[i][1]).i,
(int) ubuf(buf[i][2]).i,(int) ubuf(buf[i][3]).i,
buf[i][4],buf[i][5],buf[i][6],buf[i][7],
(int) ubuf(buf[i][8]).i,(int) ubuf(buf[i][9]).i,
(int) ubuf(buf[i][10]).i);
}
/* ----------------------------------------------------------------------
write hybrid atom info to data file
------------------------------------------------------------------------- */
int AtomVecLine::write_data_hybrid(FILE *fp, double *buf)
{
fprintf(fp," " TAGINT_FORMAT " %d %-1.16e",
(tagint) ubuf(buf[0]).i,(int) ubuf(buf[1]).i,buf[2]);
return 3;
}
/* ----------------------------------------------------------------------
pack velocity info for data file
------------------------------------------------------------------------- */
void AtomVecLine::pack_vel(double **buf)
{
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
buf[i][0] = ubuf(tag[i]).d;
buf[i][1] = v[i][0];
buf[i][2] = v[i][1];
buf[i][3] = v[i][2];
buf[i][4] = omega[i][0];
buf[i][5] = omega[i][1];
buf[i][6] = omega[i][2];
}
}
/* ----------------------------------------------------------------------
pack hybrid velocity info for data file
------------------------------------------------------------------------- */
int AtomVecLine::pack_vel_hybrid(int i, double *buf)
{
buf[0] = omega[i][0];
buf[1] = omega[i][1];
buf[2] = omega[i][2];
return 3;
}
/* ----------------------------------------------------------------------
write velocity info to data file
------------------------------------------------------------------------- */
void AtomVecLine::write_vel(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
fprintf(fp,TAGINT_FORMAT
" %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e\n",
(tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
buf[i][4],buf[i][5],buf[i][6]);
}
/* ----------------------------------------------------------------------
write hybrid velocity info to data file
------------------------------------------------------------------------- */
int AtomVecLine::write_vel_hybrid(FILE *fp, double *buf)
{
fprintf(fp," %-1.16e %-1.16e %-1.16e",buf[0],buf[1],buf[2]);
return 3;
}
/* ----------------------------------------------------------------------
return # of bytes of allocated memory
------------------------------------------------------------------------- */
bigint AtomVecLine::memory_usage()
{
bigint bytes = 0;
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax*comm->nthreads,3);
if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
if (atom->memcheck("rmass")) bytes += memory->usage(rmass,nmax);
+ if (atom->memcheck("radius")) bytes += memory->usage(radius,nmax);
if (atom->memcheck("omega")) bytes += memory->usage(omega,nmax,3);
if (atom->memcheck("torque"))
bytes += memory->usage(torque,nmax*comm->nthreads,3);
if (atom->memcheck("line")) bytes += memory->usage(line,nmax);
bytes += nmax_bonus*sizeof(Bonus);
return bytes;
}
/* ----------------------------------------------------------------------
check consistency of internal Bonus data structure
n = # of atoms in regular structure to check against
------------------------------------------------------------------------- */
/*
void AtomVecLine::consistency_check(int n, char *str)
{
int iflag = 0;
int count = 0;
for (int i = 0; i < n; i++) {
if (line[i] >= 0) {
count++;
if (line[i] >= nlocal_bonus) iflag++;
if (bonus[line[i]].ilocal != i) iflag++;
//if (comm->me == 1 && update->ntimestep == 873)
// printf("CCHK %s: %d %d: %d %d: %d %d\n",
// str,i,n,line[i],nlocal_bonus,bonus[line[i]].ilocal,iflag);
}
}
if (iflag) {
printf("BAD vecline ptrs: %s: %d %d: %d\n",str,comm->me,
update->ntimestep,iflag);
MPI_Abort(world,1);
}
if (count != nlocal_bonus) {
char msg[128];
printf("BAD vecline count: %s: %d %d: %d %d\n",
str,comm->me,update->ntimestep,count,nlocal_bonus);
MPI_Abort(world,1);
}
}
*/
diff --git a/src/atom_vec_line.h b/src/atom_vec_line.h
index de7c04444..7f07532fa 100644
--- a/src/atom_vec_line.h
+++ b/src/atom_vec_line.h
@@ -1,136 +1,136 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef ATOM_CLASS
AtomStyle(line,AtomVecLine)
#else
#ifndef LMP_ATOM_VEC_LINE_H
#define LMP_ATOM_VEC_LINE_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecLine : public AtomVec {
public:
struct Bonus {
double length,theta;
int ilocal;
};
struct Bonus *bonus;
AtomVecLine(class LAMMPS *);
~AtomVecLine();
void init();
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
int pack_comm_hybrid(int, int *, double *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int unpack_comm_hybrid(int, int, double *);
int pack_reverse(int, int, double *);
int pack_reverse_hybrid(int, int, double *);
void unpack_reverse(int, int *, double *);
int unpack_reverse_hybrid(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, int, double *);
int pack_exchange(int, double *);
int unpack_exchange(double *);
int size_restart();
int pack_restart(int, double *);
int unpack_restart(double *);
void create_atom(int, double *);
void data_atom(double *, imageint, char **);
int data_atom_hybrid(int, char **);
void data_vel(int, char **);
int data_vel_hybrid(int, char **);
void pack_data(double **);
int pack_data_hybrid(int, double *);
void write_data(FILE *, int, double **);
int write_data_hybrid(FILE *, double *);
void pack_vel(double **);
int pack_vel_hybrid(int, double *);
void write_vel(FILE *, int, double **);
int write_vel_hybrid(FILE *, double *);
bigint memory_usage();
// manipulate Bonus data structure for extra atom info
void clear_bonus();
void data_atom_bonus(int, char **);
// unique to AtomVecLine
void set_length(int, double);
private:
tagint *tag;
int *type,*mask;
imageint *image;
double **x,**v,**f;
tagint *molecule;
- double *rmass;
+ double *rmass,*radius;
double **omega,**torque;
int *line;
int nlocal_bonus,nghost_bonus,nmax_bonus;
void grow_bonus();
void copy_bonus(int, int);
// void consistency_check(int, char *);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Atom_style line can only be used in 2d simulations
Self-explanatory.
E: Per-processor system is too big
The number of owned atoms plus ghost atoms on a single
processor must fit in 32-bit integer.
E: Invalid atom type in Atoms section of data file
Atom types must range from 1 to specified # of types.
E: Invalid density in Atoms section of data file
Density value cannot be <= 0.0.
E: Assigning line parameters to non-line atom
Self-explanatory.
E: Inconsistent line segment in data file
The end points of the line segment are not equal distances from the
center point which is the atom coordinate.
*/
diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp
index f95255ee3..cbfb5af8e 100644
--- a/src/atom_vec_tri.cpp
+++ b/src/atom_vec_tri.cpp
@@ -1,1714 +1,1774 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "atom_vec_tri.h"
#include "math_extra.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "modify.h"
#include "force.h"
#include "fix.h"
+#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
+using namespace MathConst;
#define EPSILON 0.001
/* ---------------------------------------------------------------------- */
AtomVecTri::AtomVecTri(LAMMPS *lmp) : AtomVec(lmp)
{
molecular = 0;
comm_x_only = comm_f_only = 0;
size_forward = 7;
size_reverse = 6;
- size_border = 24;
+ size_border = 26;
size_velocity = 6;
size_data_atom = 8;
size_data_vel = 7;
size_data_bonus = 10;
xcol_data = 6;
atom->tri_flag = 1;
atom->molecule_flag = atom->rmass_flag = 1;
- atom->angmom_flag = atom->torque_flag = 1;
+ atom->radius_flag = atom->angmom_flag = atom->torque_flag = 1;
nlocal_bonus = nghost_bonus = nmax_bonus = 0;
bonus = NULL;
+
+ if (domain->dimension != 3)
+ error->all(FLERR,"Atom_style tri can only be used in 3d simulations");
}
/* ---------------------------------------------------------------------- */
AtomVecTri::~AtomVecTri()
{
memory->sfree(bonus);
}
/* ---------------------------------------------------------------------- */
void AtomVecTri::init()
{
AtomVec::init();
if (domain->dimension != 3)
error->all(FLERR,"Atom_style tri can only be used in 3d simulations");
}
/* ----------------------------------------------------------------------
grow atom arrays
n = 0 grows arrays by a chunk
n > 0 allocates arrays to size n
------------------------------------------------------------------------- */
void AtomVecTri::grow(int n)
{
if (n == 0) grow_nmax();
else nmax = n;
atom->nmax = nmax;
if (nmax < 0)
error->one(FLERR,"Per-processor system is too big");
tag = memory->grow(atom->tag,nmax,"atom:tag");
type = memory->grow(atom->type,nmax,"atom:type");
mask = memory->grow(atom->mask,nmax,"atom:mask");
image = memory->grow(atom->image,nmax,"atom:image");
x = memory->grow(atom->x,nmax,3,"atom:x");
v = memory->grow(atom->v,nmax,3,"atom:v");
f = memory->grow(atom->f,nmax*comm->nthreads,3,"atom:f");
molecule = memory->grow(atom->molecule,nmax,"atom:molecule");
rmass = memory->grow(atom->rmass,nmax,"atom:rmass");
+ radius = memory->grow(atom->radius,nmax,"atom:radius");
angmom = memory->grow(atom->angmom,nmax,3,"atom:angmom");
torque = memory->grow(atom->torque,nmax*comm->nthreads,3,"atom:torque");
tri = memory->grow(atom->tri,nmax,"atom:tri");
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecTri::grow_reset()
{
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
molecule = atom->molecule; rmass = atom->rmass;
- angmom = atom->angmom; torque = atom->torque;
+ radius = atom->radius; angmom = atom->angmom; torque = atom->torque;
tri = atom->tri;
}
/* ----------------------------------------------------------------------
grow bonus data structure
------------------------------------------------------------------------- */
void AtomVecTri::grow_bonus()
{
nmax_bonus = grow_nmax_bonus(nmax_bonus);
if (nmax_bonus < 0)
error->one(FLERR,"Per-processor system is too big");
bonus = (Bonus *) memory->srealloc(bonus,nmax_bonus*sizeof(Bonus),
"atom:bonus");
}
/* ----------------------------------------------------------------------
copy atom I info to atom J
if delflag and atom J has bonus data, then delete it
------------------------------------------------------------------------- */
void AtomVecTri::copy(int i, int j, int delflag)
{
tag[j] = tag[i];
type[j] = type[i];
mask[j] = mask[i];
image[j] = image[i];
x[j][0] = x[i][0];
x[j][1] = x[i][1];
x[j][2] = x[i][2];
v[j][0] = v[i][0];
v[j][1] = v[i][1];
v[j][2] = v[i][2];
molecule[j] = molecule[i];
rmass[j] = rmass[i];
+ radius[j] = radius[i];
angmom[j][0] = angmom[i][0];
angmom[j][1] = angmom[i][1];
angmom[j][2] = angmom[i][2];
// if deleting atom J via delflag and J has bonus data, then delete it
if (delflag && tri[j] >= 0) {
copy_bonus(nlocal_bonus-1,tri[j]);
nlocal_bonus--;
}
// if atom I has bonus data, reset I's bonus.ilocal to loc J
// do NOT do this if self-copy (I=J) since I's bonus data is already deleted
if (tri[i] >= 0 && i != j) bonus[tri[i]].ilocal = j;
tri[j] = tri[i];
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j,delflag);
}
/* ----------------------------------------------------------------------
copy bonus data from I to J, effectively deleting the J entry
also reset tri that points to I to now point to J
------------------------------------------------------------------------- */
void AtomVecTri::copy_bonus(int i, int j)
{
tri[bonus[i].ilocal] = j;
memcpy(&bonus[j],&bonus[i],sizeof(Bonus));
}
/* ----------------------------------------------------------------------
clear ghost info in bonus data
called before ghosts are recommunicated in comm and irregular
------------------------------------------------------------------------- */
void AtomVecTri::clear_bonus()
{
nghost_bonus = 0;
}
/* ----------------------------------------------------------------------
set equilateral tri of size in bonus data for particle I
oriented symmetrically in xy plane
this may create or delete entry in bonus data
------------------------------------------------------------------------- */
void AtomVecTri::set_equilateral(int i, double size)
{
+ // also set radius = distance from center to corner-pt = len(c1)
+ // unless size = 0.0, then set diameter = 1.0
+
if (tri[i] < 0) {
if (size == 0.0) return;
if (nlocal_bonus == nmax_bonus) grow_bonus();
double *quat = bonus[nlocal_bonus].quat;
double *c1 = bonus[nlocal_bonus].c1;
double *c2 = bonus[nlocal_bonus].c2;
double *c3 = bonus[nlocal_bonus].c3;
double *inertia = bonus[nlocal_bonus].inertia;
quat[0] = 1.0;
quat[1] = 0.0;
quat[2] = 0.0;
quat[3] = 0.0;
c1[0] = -size/2.0;
c1[1] = -sqrt(3.0)/2.0 * size / 3.0;
c1[2] = 0.0;
c2[0] = size/2.0;
c2[1] = -sqrt(3.0)/2.0 * size / 3.0;
c2[2] = 0.0;
c3[0] = 0.0;
c3[1] = sqrt(3.0)/2.0 * size * 2.0/3.0;
c3[2] = 0.0;
inertia[0] = sqrt(3.0)/96.0 * size*size*size*size;
inertia[1] = sqrt(3.0)/96.0 * size*size*size*size;
inertia[2] = sqrt(3.0)/48.0 * size*size*size*size;
+ radius[i] = MathExtra::len3(c1);
bonus[nlocal_bonus].ilocal = i;
tri[i] = nlocal_bonus++;
} else if (size == 0.0) {
+ radius[i] = 0.5;
copy_bonus(nlocal_bonus-1,tri[i]);
nlocal_bonus--;
tri[i] = -1;
} else {
double *c1 = bonus[tri[i]].c1;
double *c2 = bonus[tri[i]].c2;
double *c3 = bonus[tri[i]].c3;
double *inertia = bonus[tri[i]].inertia;
c1[0] = -size/2.0;
c1[1] = -sqrt(3.0)/2.0 * size / 3.0;
c1[2] = 0.0;
c2[0] = size/2.0;
c2[1] = -sqrt(3.0)/2.0 * size / 3.0;
c2[2] = 0.0;
c3[0] = 0.0;
c3[1] = sqrt(3.0)/2.0 * size * 2.0/3.0;
c3[2] = 0.0;
inertia[0] = sqrt(3.0)/96.0 * size*size*size*size;
inertia[1] = sqrt(3.0)/96.0 * size*size*size*size;
inertia[2] = sqrt(3.0)/48.0 * size*size*size*size;
+ radius[i] = MathExtra::len3(c1);
}
}
/* ---------------------------------------------------------------------- */
int AtomVecTri::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
double *quat;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
if (tri[j] >= 0) {
quat = bonus[tri[j]].quat;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
}
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
dz = pbc[2]*domain->zprd;
}
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
if (tri[j] >= 0) {
quat = bonus[tri[j]].quat;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
}
}
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecTri::pack_comm_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz,dvx,dvy,dvz;
double *quat;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
if (tri[j] >= 0) {
quat = bonus[tri[j]].quat;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
}
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
buf[m++] = angmom[j][0];
buf[m++] = angmom[j][1];
buf[m++] = angmom[j][2];
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
dz = pbc[2]*domain->zprd;
}
if (!deform_vremap) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
if (tri[j] >= 0) {
quat = bonus[tri[j]].quat;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
}
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
buf[m++] = angmom[j][0];
buf[m++] = angmom[j][1];
buf[m++] = angmom[j][2];
}
} else {
dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
dvz = pbc[2]*h_rate[2];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
if (tri[j] >= 0) {
quat = bonus[tri[j]].quat;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
}
if (mask[i] & deform_groupbit) {
buf[m++] = v[j][0] + dvx;
buf[m++] = v[j][1] + dvy;
buf[m++] = v[j][2] + dvz;
} else {
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
}
buf[m++] = angmom[j][0];
buf[m++] = angmom[j][1];
buf[m++] = angmom[j][2];
}
}
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecTri::pack_comm_hybrid(int n, int *list, double *buf)
{
int i,j,m;
double *quat;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
if (tri[j] >= 0) {
quat = bonus[tri[j]].quat;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
}
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecTri::unpack_comm(int n, int first, double *buf)
{
int i,m,last;
double *quat;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
if (tri[i] >= 0) {
quat = bonus[tri[i]].quat;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
}
}
}
/* ---------------------------------------------------------------------- */
void AtomVecTri::unpack_comm_vel(int n, int first, double *buf)
{
int i,m,last;
double *quat;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
if (tri[i] >= 0) {
quat = bonus[tri[i]].quat;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
}
v[i][0] = buf[m++];
v[i][1] = buf[m++];
v[i][2] = buf[m++];
angmom[i][0] = buf[m++];
angmom[i][1] = buf[m++];
angmom[i][2] = buf[m++];
}
}
/* ---------------------------------------------------------------------- */
int AtomVecTri::unpack_comm_hybrid(int n, int first, double *buf)
{
int i,m,last;
double *quat;
m = 0;
last = first + n;
for (i = first; i < last; i++)
if (tri[i] >= 0) {
quat = bonus[tri[i]].quat;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecTri::pack_reverse(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
buf[m++] = f[i][0];
buf[m++] = f[i][1];
buf[m++] = f[i][2];
buf[m++] = torque[i][0];
buf[m++] = torque[i][1];
buf[m++] = torque[i][2];
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecTri::pack_reverse_hybrid(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
buf[m++] = torque[i][0];
buf[m++] = torque[i][1];
buf[m++] = torque[i][2];
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecTri::unpack_reverse(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
f[j][0] += buf[m++];
f[j][1] += buf[m++];
f[j][2] += buf[m++];
torque[j][0] += buf[m++];
torque[j][1] += buf[m++];
torque[j][2] += buf[m++];
}
}
/* ---------------------------------------------------------------------- */
int AtomVecTri::unpack_reverse_hybrid(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
torque[j][0] += buf[m++];
torque[j][1] += buf[m++];
torque[j][2] += buf[m++];
}
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecTri::pack_border(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
double *quat,*c1,*c2,*c3,*inertia;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
buf[m++] = ubuf(molecule[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (tri[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
quat = bonus[tri[j]].quat;
c1 = bonus[tri[j]].c1;
c2 = bonus[tri[j]].c2;
c3 = bonus[tri[j]].c3;
inertia = bonus[tri[j]].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = c1[0];
buf[m++] = c1[1];
buf[m++] = c1[2];
buf[m++] = c2[0];
buf[m++] = c2[1];
buf[m++] = c2[2];
buf[m++] = c3[0];
buf[m++] = c3[1];
buf[m++] = c3[2];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
}
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0];
dy = pbc[1];
dz = pbc[2];
}
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
buf[m++] = ubuf(molecule[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (tri[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
quat = bonus[tri[j]].quat;
c1 = bonus[tri[j]].c1;
c2 = bonus[tri[j]].c2;
c3 = bonus[tri[j]].c3;
inertia = bonus[tri[j]].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = c1[0];
buf[m++] = c1[1];
buf[m++] = c1[2];
buf[m++] = c2[0];
buf[m++] = c2[1];
buf[m++] = c2[2];
buf[m++] = c3[0];
buf[m++] = c3[1];
buf[m++] = c3[2];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
}
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->pack_border(n,list,&buf[m]);
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecTri::pack_border_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz,dvx,dvy,dvz;
double *quat,*c1,*c2,*c3,*inertia;
m = 0;
if (pbc_flag == 0) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
buf[m++] = ubuf(molecule[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (tri[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
quat = bonus[tri[j]].quat;
c1 = bonus[tri[j]].c1;
c2 = bonus[tri[j]].c2;
c3 = bonus[tri[j]].c3;
inertia = bonus[tri[j]].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = c1[0];
buf[m++] = c1[1];
buf[m++] = c1[2];
buf[m++] = c2[0];
buf[m++] = c2[1];
buf[m++] = c2[2];
buf[m++] = c3[0];
buf[m++] = c3[1];
buf[m++] = c3[2];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
}
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
buf[m++] = angmom[j][0];
buf[m++] = angmom[j][1];
buf[m++] = angmom[j][2];
}
} else {
if (domain->triclinic == 0) {
dx = pbc[0]*domain->xprd;
dy = pbc[1]*domain->yprd;
dz = pbc[2]*domain->zprd;
} else {
dx = pbc[0];
dy = pbc[1];
dz = pbc[2];
}
if (!deform_vremap) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
buf[m++] = ubuf(molecule[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (tri[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
quat = bonus[tri[j]].quat;
c1 = bonus[tri[j]].c1;
c2 = bonus[tri[j]].c2;
c3 = bonus[tri[j]].c3;
inertia = bonus[tri[j]].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = c1[0];
buf[m++] = c1[1];
buf[m++] = c1[2];
buf[m++] = c2[0];
buf[m++] = c2[1];
buf[m++] = c2[2];
buf[m++] = c3[0];
buf[m++] = c3[1];
buf[m++] = c3[2];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
}
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
buf[m++] = angmom[j][0];
buf[m++] = angmom[j][1];
buf[m++] = angmom[j][2];
}
} else {
dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
dvz = pbc[2]*h_rate[2];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
buf[m++] = ubuf(molecule[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (tri[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
quat = bonus[tri[j]].quat;
c1 = bonus[tri[j]].c1;
c2 = bonus[tri[j]].c2;
c3 = bonus[tri[j]].c3;
inertia = bonus[tri[j]].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = c1[0];
buf[m++] = c1[1];
buf[m++] = c1[2];
buf[m++] = c2[0];
buf[m++] = c2[1];
buf[m++] = c2[2];
buf[m++] = c3[0];
buf[m++] = c3[1];
buf[m++] = c3[2];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
}
if (mask[i] & deform_groupbit) {
buf[m++] = v[j][0] + dvx;
buf[m++] = v[j][1] + dvy;
buf[m++] = v[j][2] + dvz;
} else {
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
}
buf[m++] = angmom[j][0];
buf[m++] = angmom[j][1];
buf[m++] = angmom[j][2];
}
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->pack_border(n,list,&buf[m]);
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecTri::pack_border_hybrid(int n, int *list, double *buf)
{
int i,j,m;
double *quat,*c1,*c2,*c3,*inertia;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = ubuf(molecule[j]).d;
+ buf[m++] = radius[j];
+ buf[m++] = rmass[j];
if (tri[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
quat = bonus[tri[j]].quat;
c1 = bonus[tri[j]].c1;
c2 = bonus[tri[j]].c2;
c3 = bonus[tri[j]].c3;
inertia = bonus[tri[j]].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = c1[0];
buf[m++] = c1[1];
buf[m++] = c1[2];
buf[m++] = c2[0];
buf[m++] = c2[1];
buf[m++] = c2[2];
buf[m++] = c3[0];
buf[m++] = c3[1];
buf[m++] = c3[2];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
}
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecTri::unpack_border(int n, int first, double *buf)
{
int i,j,m,last;
double *quat,*c1,*c2,*c3,*inertia;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
if (i == nmax) grow(0);
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (tagint) ubuf(buf[m++]).i;
+ radius[i] = buf[m++];
+ rmass[i] = buf[m++];
tri[i] = (int) ubuf(buf[m++]).i;
if (tri[i] == 0) tri[i] = -1;
else {
j = nlocal_bonus + nghost_bonus;
if (j == nmax_bonus) grow_bonus();
quat = bonus[j].quat;
c1 = bonus[j].c1;
c2 = bonus[j].c2;
c3 = bonus[j].c3;
inertia = bonus[j].inertia;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
c1[0] = buf[m++];
c1[1] = buf[m++];
c1[2] = buf[m++];
c2[0] = buf[m++];
c2[1] = buf[m++];
c2[2] = buf[m++];
c3[0] = buf[m++];
c3[1] = buf[m++];
c3[2] = buf[m++];
inertia[0] = buf[m++];
inertia[1] = buf[m++];
inertia[2] = buf[m++];
bonus[j].ilocal = i;
tri[i] = j;
nghost_bonus++;
}
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->
unpack_border(n,first,&buf[m]);
}
/* ---------------------------------------------------------------------- */
void AtomVecTri::unpack_border_vel(int n, int first, double *buf)
{
int i,j,m,last;
double *quat,*c1,*c2,*c3,*inertia;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
if (i == nmax) grow(0);
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (tagint) ubuf(buf[m++]).i;
+ radius[i] = buf[m++];
+ rmass[i] = buf[m++];
tri[i] = (int) ubuf(buf[m++]).i;
if (tri[i] == 0) tri[i] = -1;
else {
j = nlocal_bonus + nghost_bonus;
if (j == nmax_bonus) grow_bonus();
quat = bonus[j].quat;
c1 = bonus[j].c1;
c2 = bonus[j].c2;
c3 = bonus[j].c3;
inertia = bonus[j].inertia;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
c1[0] = buf[m++];
c1[1] = buf[m++];
c1[2] = buf[m++];
c2[0] = buf[m++];
c2[1] = buf[m++];
c2[2] = buf[m++];
c3[0] = buf[m++];
c3[1] = buf[m++];
c3[2] = buf[m++];
inertia[0] = buf[m++];
inertia[1] = buf[m++];
inertia[2] = buf[m++];
bonus[j].ilocal = i;
tri[i] = j;
nghost_bonus++;
}
v[i][0] = buf[m++];
v[i][1] = buf[m++];
v[i][2] = buf[m++];
angmom[i][0] = buf[m++];
angmom[i][1] = buf[m++];
angmom[i][2] = buf[m++];
}
if (atom->nextra_border)
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
m += modify->fix[atom->extra_border[iextra]]->
unpack_border(n,first,&buf[m]);
}
/* ---------------------------------------------------------------------- */
int AtomVecTri::unpack_border_hybrid(int n, int first, double *buf)
{
int i,j,m,last;
double *quat,*c1,*c2,*c3,*inertia;
m = 0;
last = first + n;
for (i = first; i < last; i++) {
molecule[i] = (tagint) ubuf(buf[m++]).i;
+ radius[i] = buf[m++];
+ rmass[i] = buf[m++];
tri[i] = (int) ubuf(buf[m++]).i;
if (tri[i] == 0) tri[i] = -1;
else {
j = nlocal_bonus + nghost_bonus;
if (j == nmax_bonus) grow_bonus();
quat = bonus[j].quat;
c1 = bonus[j].c1;
c2 = bonus[j].c2;
c3 = bonus[j].c3;
inertia = bonus[j].inertia;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
c1[0] = buf[m++];
c1[1] = buf[m++];
c1[2] = buf[m++];
c2[0] = buf[m++];
c2[1] = buf[m++];
c2[2] = buf[m++];
c3[0] = buf[m++];
c3[1] = buf[m++];
c3[2] = buf[m++];
inertia[0] = buf[m++];
inertia[1] = buf[m++];
inertia[2] = buf[m++];
bonus[j].ilocal = i;
tri[i] = j;
nghost_bonus++;
}
}
return m;
}
/* ----------------------------------------------------------------------
pack data for atom I for sending to another proc
xyz must be 1st 3 values, so comm::exchange() can test on them
------------------------------------------------------------------------- */
int AtomVecTri::pack_exchange(int i, double *buf)
{
int m = 1;
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
buf[m++] = v[i][0];
buf[m++] = v[i][1];
buf[m++] = v[i][2];
buf[m++] = ubuf(tag[i]).d;
buf[m++] = ubuf(type[i]).d;
buf[m++] = ubuf(mask[i]).d;
buf[m++] = ubuf(image[i]).d;
buf[m++] = ubuf(molecule[i]).d;
buf[m++] = rmass[i];
+ buf[m++] = radius[i];
buf[m++] = angmom[i][0];
buf[m++] = angmom[i][1];
buf[m++] = angmom[i][2];
if (tri[i] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
int j = tri[i];
double *quat = bonus[j].quat;
double *c1 = bonus[j].c1;
double *c2 = bonus[j].c2;
double *c3 = bonus[j].c3;
double *inertia = bonus[j].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = c1[0];
buf[m++] = c1[1];
buf[m++] = c1[2];
buf[m++] = c2[0];
buf[m++] = c2[1];
buf[m++] = c2[2];
buf[m++] = c3[0];
buf[m++] = c3[1];
buf[m++] = c3[2];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
}
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
buf[0] = m;
return m;
}
/* ---------------------------------------------------------------------- */
int AtomVecTri::unpack_exchange(double *buf)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
int m = 1;
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
molecule[nlocal] = (tagint) ubuf(buf[m++]).i;
rmass[nlocal] = buf[m++];
+ radius[nlocal] = buf[m++];
angmom[nlocal][0] = buf[m++];
angmom[nlocal][1] = buf[m++];
angmom[nlocal][2] = buf[m++];
tri[nlocal] = (int) ubuf(buf[m++]).i;
if (tri[nlocal] == 0) tri[nlocal] = -1;
else {
if (nlocal_bonus == nmax_bonus) grow_bonus();
double *quat = bonus[nlocal_bonus].quat;
double *c1 = bonus[nlocal_bonus].c1;
double *c2 = bonus[nlocal_bonus].c2;
double *c3 = bonus[nlocal_bonus].c3;
double *inertia = bonus[nlocal_bonus].inertia;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
c1[0] = buf[m++];
c1[1] = buf[m++];
c1[2] = buf[m++];
c2[0] = buf[m++];
c2[1] = buf[m++];
c2[2] = buf[m++];
c3[0] = buf[m++];
c3[1] = buf[m++];
c3[2] = buf[m++];
inertia[0] = buf[m++];
inertia[1] = buf[m++];
inertia[2] = buf[m++];
bonus[nlocal_bonus].ilocal = nlocal;
tri[nlocal] = nlocal_bonus++;
}
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
m += modify->fix[atom->extra_grow[iextra]]->
unpack_exchange(nlocal,&buf[m]);
atom->nlocal++;
return m;
}
/* ----------------------------------------------------------------------
size of restart data for all atoms owned by this proc
include extra data stored by fixes
------------------------------------------------------------------------- */
int AtomVecTri::size_restart()
{
int i;
int n = 0;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++)
- if (tri[i] >= 0) n += 33;
- else n += 17;
+ if (tri[i] >= 0) n += 34;
+ else n += 18;
if (atom->nextra_restart)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
for (i = 0; i < nlocal; i++)
n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
return n;
}
/* ----------------------------------------------------------------------
pack atom I's data for restart file including extra quantities
xyz must be 1st 3 values, so that read_restart can test on them
molecular types may be negative, but write as positive
------------------------------------------------------------------------- */
int AtomVecTri::pack_restart(int i, double *buf)
{
int m = 1;
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
buf[m++] = ubuf(tag[i]).d;
buf[m++] = ubuf(type[i]).d;
buf[m++] = ubuf(mask[i]).d;
buf[m++] = ubuf(image[i]).d;
buf[m++] = v[i][0];
buf[m++] = v[i][1];
buf[m++] = v[i][2];
buf[m++] = ubuf(molecule[i]).d;
buf[m++] = rmass[i];
+ buf[m++] = radius[i];
buf[m++] = angmom[i][0];
buf[m++] = angmom[i][1];
buf[m++] = angmom[i][2];
if (tri[i] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = ubuf(1).d;
int j = tri[i];
double *quat = bonus[j].quat;
double *c1 = bonus[j].c1;
double *c2 = bonus[j].c2;
double *c3 = bonus[j].c3;
double *inertia = bonus[j].inertia;
buf[m++] = quat[0];
buf[m++] = quat[1];
buf[m++] = quat[2];
buf[m++] = quat[3];
buf[m++] = c1[0];
buf[m++] = c1[1];
buf[m++] = c1[2];
buf[m++] = c2[0];
buf[m++] = c2[1];
buf[m++] = c2[2];
buf[m++] = c3[0];
buf[m++] = c3[1];
buf[m++] = c3[2];
buf[m++] = inertia[0];
buf[m++] = inertia[1];
buf[m++] = inertia[2];
}
if (atom->nextra_restart)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
buf[0] = m;
return m;
}
/* ----------------------------------------------------------------------
unpack data for one atom from restart file including extra quantities
------------------------------------------------------------------------- */
int AtomVecTri::unpack_restart(double *buf)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) {
grow(0);
if (atom->nextra_store)
memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
}
int m = 1;
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
molecule[nlocal] = (tagint) ubuf(buf[m++]).i;
rmass[nlocal] = buf[m++];
+ radius[nlocal] = buf[m++];
angmom[nlocal][0] = buf[m++];
angmom[nlocal][1] = buf[m++];
angmom[nlocal][2] = buf[m++];
tri[nlocal] = (int) ubuf(buf[m++]).i;
if (tri[nlocal] == 0) tri[nlocal] = -1;
else {
if (nlocal_bonus == nmax_bonus) grow_bonus();
double *quat = bonus[nlocal_bonus].quat;
double *c1 = bonus[nlocal_bonus].c1;
double *c2 = bonus[nlocal_bonus].c2;
double *c3 = bonus[nlocal_bonus].c3;
double *inertia = bonus[nlocal_bonus].inertia;
quat[0] = buf[m++];
quat[1] = buf[m++];
quat[2] = buf[m++];
quat[3] = buf[m++];
c1[0] = buf[m++];
c1[1] = buf[m++];
c1[2] = buf[m++];
c2[0] = buf[m++];
c2[1] = buf[m++];
c2[2] = buf[m++];
c3[0] = buf[m++];
c3[1] = buf[m++];
c3[2] = buf[m++];
inertia[0] = buf[m++];
inertia[1] = buf[m++];
inertia[2] = buf[m++];
bonus[nlocal_bonus].ilocal = nlocal;
tri[nlocal] = nlocal_bonus++;
}
double **extra = atom->extra;
if (atom->nextra_store) {
int size = static_cast<int> (buf[0]) - m;
for (int i = 0; i < size; i++) extra[nlocal][i] = buf[m++];
}
atom->nlocal++;
return m;
}
/* ----------------------------------------------------------------------
create one atom of itype at coord
set other values to defaults
------------------------------------------------------------------------- */
void AtomVecTri::create_atom(int itype, double *coord)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
tag[nlocal] = 0;
type[nlocal] = itype;
x[nlocal][0] = coord[0];
x[nlocal][1] = coord[1];
x[nlocal][2] = coord[2];
mask[nlocal] = 1;
image[nlocal] = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
v[nlocal][0] = 0.0;
v[nlocal][1] = 0.0;
v[nlocal][2] = 0.0;
molecule[nlocal] = 0;
- rmass[nlocal] = 1.0;
+ radius[nlocal] = 0.5;
+ rmass[nlocal] = 4.0*MY_PI/3.0 * radius[nlocal]*radius[nlocal]*radius[nlocal];
angmom[nlocal][0] = 0.0;
angmom[nlocal][1] = 0.0;
angmom[nlocal][2] = 0.0;
tri[nlocal] = -1;
atom->nlocal++;
}
/* ----------------------------------------------------------------------
unpack one line from Atoms section of data file
initialize other atom quantities
------------------------------------------------------------------------- */
void AtomVecTri::data_atom(double *coord, imageint imagetmp, char **values)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
tag[nlocal] = ATOTAGINT(values[0]);
molecule[nlocal] = ATOTAGINT(values[1]);
type[nlocal] = atoi(values[2]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
tri[nlocal] = atoi(values[3]);
if (tri[nlocal] == 0) tri[nlocal] = -1;
else if (tri[nlocal] == 1) tri[nlocal] = 0;
else error->one(FLERR,"Invalid atom type in Atoms section of data file");
rmass[nlocal] = atof(values[4]);
if (rmass[nlocal] <= 0.0)
error->one(FLERR,"Invalid density in Atoms section of data file");
+ if (tri[nlocal] < 0) {
+ radius[nlocal] = 0.5;
+ rmass[nlocal] *= 4.0*MY_PI/3.0 *
+ radius[nlocal]*radius[nlocal]*radius[nlocal];
+ } else radius[nlocal] = 0.0;
+
x[nlocal][0] = coord[0];
x[nlocal][1] = coord[1];
x[nlocal][2] = coord[2];
image[nlocal] = imagetmp;
mask[nlocal] = 1;
v[nlocal][0] = 0.0;
v[nlocal][1] = 0.0;
v[nlocal][2] = 0.0;
angmom[nlocal][0] = 0.0;
angmom[nlocal][1] = 0.0;
angmom[nlocal][2] = 0.0;
atom->nlocal++;
}
/* ----------------------------------------------------------------------
unpack hybrid quantities from one tri in Atoms section of data file
initialize other atom quantities for this sub-style
------------------------------------------------------------------------- */
int AtomVecTri::data_atom_hybrid(int nlocal, char **values)
{
molecule[nlocal] = ATOTAGINT(values[0]);
tri[nlocal] = atoi(values[1]);
if (tri[nlocal] == 0) tri[nlocal] = -1;
else if (tri[nlocal] == 1) tri[nlocal] = 0;
else error->one(FLERR,"Invalid atom type in Atoms section of data file");
rmass[nlocal] = atof(values[2]);
if (rmass[nlocal] <= 0.0)
error->one(FLERR,"Invalid density in Atoms section of data file");
+ if (tri[nlocal] < 0) {
+ radius[nlocal] = 0.5;
+ rmass[nlocal] *= 4.0*MY_PI/3.0 *
+ radius[nlocal]*radius[nlocal]*radius[nlocal];
+ } else radius[nlocal] = 0.0;
+
return 3;
}
/* ----------------------------------------------------------------------
unpack one line from Tris section of data file
------------------------------------------------------------------------- */
void AtomVecTri::data_atom_bonus(int m, char **values)
{
if (tri[m]) error->one(FLERR,"Assigning tri parameters to non-tri atom");
if (nlocal_bonus == nmax_bonus) grow_bonus();
double c1[3],c2[3],c3[3];
c1[0] = atof(values[0]);
c1[1] = atof(values[1]);
c1[2] = atof(values[2]);
c2[0] = atof(values[3]);
c2[1] = atof(values[4]);
c2[2] = atof(values[5]);
c3[0] = atof(values[6]);
c3[1] = atof(values[7]);
c3[2] = atof(values[8]);
// check for duplicate points
if (c1[0] == c2[0] && c1[1] == c2[1] && c1[2] == c2[2])
error->one(FLERR,"Invalid shape in Triangles section of data file");
if (c1[0] == c3[0] && c1[1] == c3[1] && c1[2] == c3[2])
error->one(FLERR,"Invalid shape in Triangles section of data file");
if (c2[0] == c3[0] && c2[1] == c3[1] && c2[2] == c3[2])
error->one(FLERR,"Invalid shape in Triangles section of data file");
// size = length of one edge
double c2mc1[3],c3mc1[3];
MathExtra::sub3(c2,c1,c2mc1);
MathExtra::sub3(c3,c1,c3mc1);
double size = MAX(MathExtra::len3(c2mc1),MathExtra::len3(c3mc1));
// centroid = 1/3 of sum of vertices
double centroid[3];
centroid[0] = (c1[0]+c2[0]+c3[0]) / 3.0;
centroid[1] = (c1[1]+c2[1]+c3[1]) / 3.0;
centroid[2] = (c1[2]+c2[2]+c3[2]) / 3.0;
double dx = centroid[0] - x[m][0];
double dy = centroid[1] - x[m][1];
double dz = centroid[2] - x[m][2];
double delta = sqrt(dx*dx + dy*dy + dz*dz);
if (delta/size > EPSILON)
error->one(FLERR,"Inconsistent triangle in data file");
x[m][0] = centroid[0];
x[m][1] = centroid[1];
x[m][2] = centroid[2];
- // reset tri mass
- // previously stored density in rmass
+ // reset tri radius and mass
+ // rmass currently holds density
// tri area = 0.5 len(U x V), where U,V are edge vectors from one vertex
+ double c4[3];
+ MathExtra::sub3(c1,centroid,c4);
+ radius[m] = MathExtra::lensq3(c4);
+ MathExtra::sub3(c2,centroid,c4);
+ radius[m] = MAX(radius[m],MathExtra::lensq3(c4));
+ MathExtra::sub3(c3,centroid,c4);
+ radius[m] = MAX(radius[m],MathExtra::lensq3(c4));
+ radius[m] = sqrt(radius[m]);
+
double norm[3];
MathExtra::cross3(c2mc1,c3mc1,norm);
double area = 0.5 * MathExtra::len3(norm);
rmass[m] *= area;
// inertia = inertia tensor of triangle as 6-vector in Voigt notation
double inertia[6];
MathExtra::inertia_triangle(c1,c2,c3,rmass[m],inertia);
// diagonalize inertia tensor via Jacobi rotations
// bonus[].inertia = 3 eigenvalues = principal moments of inertia
// evectors and exzy_space = 3 evectors = principal axes of triangle
double tensor[3][3],evectors[3][3];
tensor[0][0] = inertia[0];
tensor[1][1] = inertia[1];
tensor[2][2] = inertia[2];
tensor[1][2] = tensor[2][1] = inertia[3];
tensor[0][2] = tensor[2][0] = inertia[4];
tensor[0][1] = tensor[1][0] = inertia[5];
int ierror = MathExtra::jacobi(tensor,bonus[nlocal_bonus].inertia,evectors);
if (ierror) error->one(FLERR,"Insufficient Jacobi rotations for triangle");
double ex_space[3],ey_space[3],ez_space[3];
ex_space[0] = evectors[0][0];
ex_space[1] = evectors[1][0];
ex_space[2] = evectors[2][0];
ey_space[0] = evectors[0][1];
ey_space[1] = evectors[1][1];
ey_space[2] = evectors[2][1];
ez_space[0] = evectors[0][2];
ez_space[1] = evectors[1][2];
ez_space[2] = evectors[2][2];
// enforce 3 orthogonal vectors as a right-handed coordinate system
// flip 3rd vector if needed
MathExtra::cross3(ex_space,ey_space,norm);
if (MathExtra::dot3(norm,ez_space) < 0.0) MathExtra::negate3(ez_space);
// create initial quaternion
MathExtra::exyz_to_q(ex_space,ey_space,ez_space,bonus[nlocal_bonus].quat);
// bonus c1,c2,c3 = displacement of c1,c2,c3 from centroid
// in basis of principal axes
double disp[3];
MathExtra::sub3(c1,centroid,disp);
MathExtra::transpose_matvec(ex_space,ey_space,ez_space,
disp,bonus[nlocal_bonus].c1);
MathExtra::sub3(c2,centroid,disp);
MathExtra::transpose_matvec(ex_space,ey_space,ez_space,
disp,bonus[nlocal_bonus].c2);
MathExtra::sub3(c3,centroid,disp);
MathExtra::transpose_matvec(ex_space,ey_space,ez_space,
disp,bonus[nlocal_bonus].c3);
bonus[nlocal_bonus].ilocal = m;
tri[m] = nlocal_bonus++;
}
/* ----------------------------------------------------------------------
unpack one line from Velocities section of data file
------------------------------------------------------------------------- */
void AtomVecTri::data_vel(int m, char **values)
{
v[m][0] = atof(values[0]);
v[m][1] = atof(values[1]);
v[m][2] = atof(values[2]);
angmom[m][0] = atof(values[3]);
angmom[m][1] = atof(values[4]);
angmom[m][2] = atof(values[5]);
}
/* ----------------------------------------------------------------------
unpack hybrid quantities from one tri in Velocities section of data file
------------------------------------------------------------------------- */
int AtomVecTri::data_vel_hybrid(int m, char **values)
{
angmom[m][0] = atof(values[0]);
angmom[m][1] = atof(values[1]);
angmom[m][2] = atof(values[2]);
return 3;
}
/* ----------------------------------------------------------------------
pack atom info for data file including 3 image flags
------------------------------------------------------------------------- */
void AtomVecTri::pack_data(double **buf)
{
double c2mc1[3],c3mc1[3],norm[3];
double area;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
buf[i][0] = ubuf(tag[i]).d;
buf[i][1] = ubuf(molecule[i]).d;
buf[i][2] = ubuf(type[i]).d;
if (tri[i] < 0) buf[i][3] = ubuf(0).d;
else buf[i][3] = ubuf(1).d;
- if (tri[i] < 0) buf[i][4] = rmass[i];
+ if (tri[i] < 0)
+ buf[i][4] = rmass[i] / (4.0*MY_PI/3.0 * radius[i]*radius[i]*radius[i]);
else {
MathExtra::sub3(bonus[tri[i]].c2,bonus[tri[i]].c1,c2mc1);
MathExtra::sub3(bonus[tri[i]].c3,bonus[tri[i]].c1,c3mc1);
MathExtra::cross3(c2mc1,c3mc1,norm);
area = 0.5 * MathExtra::len3(norm);
buf[i][4] = rmass[i]/area;
}
buf[i][5] = x[i][0];
buf[i][6] = x[i][1];
buf[i][7] = x[i][2];
buf[i][8] = ubuf((image[i] & IMGMASK) - IMGMAX).d;
buf[i][9] = ubuf((image[i] >> IMGBITS & IMGMASK) - IMGMAX).d;
buf[i][10] = ubuf((image[i] >> IMG2BITS) - IMGMAX).d;
}
}
/* ----------------------------------------------------------------------
pack hybrid atom info for data file
------------------------------------------------------------------------- */
int AtomVecTri::pack_data_hybrid(int i, double *buf)
{
buf[0] = ubuf(molecule[i]).d;
if (tri[i] < 0) buf[1] = ubuf(0).d;
else buf[1] = ubuf(1).d;
- if (tri[i] < 0) buf[2] = rmass[i];
+ if (tri[i] < 0)
+ buf[2] = rmass[i] / (4.0*MY_PI/3.0 * radius[i]*radius[i]*radius[i]);
else {
double c2mc1[3],c3mc1[3],norm[3];
MathExtra::sub3(bonus[tri[i]].c2,bonus[tri[i]].c1,c2mc1);
MathExtra::sub3(bonus[tri[i]].c3,bonus[tri[i]].c1,c3mc1);
MathExtra::cross3(c2mc1,c3mc1,norm);
double area = 0.5 * MathExtra::len3(norm);
buf[2] = rmass[i]/area;
}
return 3;
}
/* ----------------------------------------------------------------------
write atom info to data file including 3 image flags
------------------------------------------------------------------------- */
void AtomVecTri::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
fprintf(fp,TAGINT_FORMAT " " TAGINT_FORMAT
" %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
(tagint) ubuf(buf[i][0]).i,(tagint) ubuf(buf[i][1]).i,
(int) ubuf(buf[i][2]).i,(int) ubuf(buf[i][3]).i,
buf[i][4],buf[i][5],buf[i][6],buf[i][7],
(int) ubuf(buf[i][8]).i,(int) ubuf(buf[i][9]).i,
(int) ubuf(buf[i][10]).i);
}
/* ----------------------------------------------------------------------
write hybrid atom info to data file
------------------------------------------------------------------------- */
int AtomVecTri::write_data_hybrid(FILE *fp, double *buf)
{
fprintf(fp," " TAGINT_FORMAT " %d %-1.16e",
(tagint) ubuf(buf[0]).i,(int) ubuf(buf[1]).i,buf[2]);
return 3;
}
/* ----------------------------------------------------------------------
pack velocity info for data file
------------------------------------------------------------------------- */
void AtomVecTri::pack_vel(double **buf)
{
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
buf[i][0] = ubuf(tag[i]).d;
buf[i][1] = v[i][0];
buf[i][2] = v[i][1];
buf[i][3] = v[i][2];
buf[i][4] = angmom[i][0];
buf[i][5] = angmom[i][1];
buf[i][6] = angmom[i][2];
}
}
/* ----------------------------------------------------------------------
pack hybrid velocity info for data file
------------------------------------------------------------------------- */
int AtomVecTri::pack_vel_hybrid(int i, double *buf)
{
buf[0] = angmom[i][0];
buf[1] = angmom[i][1];
buf[2] = angmom[i][2];
return 3;
}
/* ----------------------------------------------------------------------
write velocity info to data file
------------------------------------------------------------------------- */
void AtomVecTri::write_vel(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
fprintf(fp,TAGINT_FORMAT
" %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e\n",
(tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
buf[i][4],buf[i][5],buf[i][6]);
}
/* ----------------------------------------------------------------------
write hybrid velocity info to data file
------------------------------------------------------------------------- */
int AtomVecTri::write_vel_hybrid(FILE *fp, double *buf)
{
fprintf(fp," %-1.16e %-1.16e %-1.16e",buf[0],buf[1],buf[2]);
return 3;
}
/* ----------------------------------------------------------------------
return # of bytes of allocated memory
------------------------------------------------------------------------- */
bigint AtomVecTri::memory_usage()
{
bigint bytes = 0;
if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
if (atom->memcheck("f")) bytes += memory->usage(f,nmax*comm->nthreads,3);
if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
if (atom->memcheck("rmass")) bytes += memory->usage(rmass,nmax);
+ if (atom->memcheck("radius")) bytes += memory->usage(radius,nmax);
if (atom->memcheck("angmom")) bytes += memory->usage(angmom,nmax,3);
if (atom->memcheck("torque")) bytes +=
memory->usage(torque,nmax*comm->nthreads,3);
if (atom->memcheck("tri")) bytes += memory->usage(tri,nmax);
bytes += nmax_bonus*sizeof(Bonus);
return bytes;
}
diff --git a/src/atom_vec_tri.h b/src/atom_vec_tri.h
index 60e0c1f35..ce08ecc2b 100644
--- a/src/atom_vec_tri.h
+++ b/src/atom_vec_tri.h
@@ -1,146 +1,146 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef ATOM_CLASS
AtomStyle(tri,AtomVecTri)
#else
#ifndef LMP_ATOM_VEC_TRI_H
#define LMP_ATOM_VEC_TRI_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecTri : public AtomVec {
public:
struct Bonus {
double quat[4];
double c1[3],c2[3],c3[3];
double inertia[3];
int ilocal;
};
struct Bonus *bonus;
AtomVecTri(class LAMMPS *);
~AtomVecTri();
void init();
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
int pack_comm_hybrid(int, int *, double *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int unpack_comm_hybrid(int, int, double *);
int pack_reverse(int, int, double *);
int pack_reverse_hybrid(int, int, double *);
void unpack_reverse(int, int *, double *);
int unpack_reverse_hybrid(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, int, double *);
int pack_exchange(int, double *);
int unpack_exchange(double *);
int size_restart();
int pack_restart(int, double *);
int unpack_restart(double *);
void create_atom(int, double *);
void data_atom(double *, imageint, char **);
int data_atom_hybrid(int, char **);
void data_vel(int, char **);
int data_vel_hybrid(int, char **);
void pack_data(double **);
int pack_data_hybrid(int, double *);
void write_data(FILE *, int, double **);
int write_data_hybrid(FILE *, double *);
void pack_vel(double **);
int pack_vel_hybrid(int, double *);
void write_vel(FILE *, int, double **);
int write_vel_hybrid(FILE *, double *);
bigint memory_usage();
// manipulate Bonus data structure for extra atom info
void clear_bonus();
void data_atom_bonus(int, char **);
// unique to AtomVecTri
void set_equilateral(int, double);
private:
tagint *tag;
int *type,*mask;
imageint *image;
double **x,**v,**f;
tagint *molecule;
- double *rmass;
+ double *rmass,*radius;
double **angmom,**torque;
int *tri;
int nlocal_bonus,nghost_bonus,nmax_bonus;
void grow_bonus();
void copy_bonus(int, int);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Atom_style tri can only be used in 3d simulations
Self-explanatory.
E: Per-processor system is too big
The number of owned atoms plus ghost atoms on a single
processor must fit in 32-bit integer.
E: Invalid atom type in Atoms section of data file
Atom types must range from 1 to specified # of types.
E: Invalid density in Atoms section of data file
Density value cannot be <= 0.0.
E: Assigning tri parameters to non-tri atom
Self-explanatory.
E: Invalid shape in Triangles section of data file
Two or more of the triangle corners are duplicate points.
E: Inconsistent triangle in data file
The centroid of the triangle as defined by the corner points is not
the atom coordinate.
E: Insufficient Jacobi rotations for triangle
The calculation of the intertia tensor of the triangle failed. This
should not happen if it is a reasonably shaped triangle.
*/
diff --git a/src/body.h b/src/body.h
index 35e261283..59001620f 100644
--- a/src/body.h
+++ b/src/body.h
@@ -1,63 +1,65 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_BODY_H
#define LMP_BODY_H
#include "pointers.h"
#include "atom_vec_body.h"
#include "my_pool_chunk.h"
namespace LAMMPS_NS {
class Body : protected Pointers {
public:
MyPoolChunk<int> *icp;
MyPoolChunk<double> *dcp;
char *style;
int size_forward; // max extra values packed for comm
int size_border; // max extra values packed for border comm
AtomVecBody *avec; // ptr to class that stores body bonus info
Body(class LAMMPS *, int, char **);
virtual ~Body();
// methods implemented by child classes
virtual int pack_comm_body(struct AtomVecBody::Bonus *, double *) {return 0;}
virtual int unpack_comm_body(struct AtomVecBody::Bonus *, double *) {return 0;}
virtual int pack_border_body(struct AtomVecBody::Bonus *, double *) {return 0;}
virtual int unpack_border_body(struct AtomVecBody::Bonus *,
double *) {return 0;}
- virtual void data_body(int, int, int, char **, char **) = 0;
+ virtual void data_body(int, int, int, int*, double *) = 0;
virtual int noutrow(int) = 0;
virtual int noutcol() = 0;
virtual void output(int, int, double *) = 0;
virtual int image(int, double, double, int *&, double **&) = 0;
+
+ virtual double radius_body(int, int, int *, double *) {return 0.0;}
};
}
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
*/
diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp
index 971760411..3a9f043ed 100644
--- a/src/compute_chunk_atom.cpp
+++ b/src/compute_chunk_atom.cpp
@@ -1,1909 +1,1997 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
// NOTE: allow for bin center to be variables for sphere/cylinder
#include <mpi.h>
#include <string.h>
#include <stdlib.h>
#include "compute_chunk_atom.h"
#include "atom.h"
#include "update.h"
#include "force.h"
#include "domain.h"
#include "region.h"
#include "lattice.h"
#include "modify.h"
#include "fix_store.h"
#include "comm.h"
#include "group.h"
#include "input.h"
#include "variable.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
#include <map>
using namespace LAMMPS_NS;
using namespace MathConst;
enum{BIN1D,BIN2D,BIN3D,BINSPHERE,BINCYLINDER,
TYPE,MOLECULE,COMPUTE,FIX,VARIABLE};
enum{LOWER,CENTER,UPPER,COORD};
enum{BOX,LATTICE,REDUCED};
enum{NODISCARD,MIXED,YESDISCARD};
enum{ONCE,NFREQ,EVERY}; // used in several files
enum{LIMITMAX,LIMITEXACT};
#define IDMAX 1024*1024
#define INVOKED_PERATOM 8
// allocate space for static class variable
ComputeChunkAtom *ComputeChunkAtom::cptr;
/* ---------------------------------------------------------------------- */
ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal compute chunk/atom command");
peratom_flag = 1;
size_peratom_cols = 0;
create_attribute = 1;
// chunk style and its args
int iarg;
binflag = 0;
ncoord = 0;
cfvid = NULL;
if (strcmp(arg[3],"bin/1d") == 0) {
binflag = 1;
which = BIN1D;
ncoord = 1;
iarg = 4;
readdim(narg,arg,iarg,0);
iarg += 3;
} else if (strcmp(arg[3],"bin/2d") == 0) {
binflag = 1;
which = BIN2D;
ncoord = 2;
iarg = 4;
readdim(narg,arg,iarg,0);
readdim(narg,arg,iarg+3,1);
iarg += 6;
} else if (strcmp(arg[3],"bin/3d") == 0) {
binflag = 1;
which = BIN3D;
ncoord = 3;
iarg = 4;
readdim(narg,arg,iarg,0);
readdim(narg,arg,iarg+3,1);
readdim(narg,arg,iarg+6,2);
iarg += 9;
} else if (strcmp(arg[3],"bin/sphere") == 0) {
binflag = 1;
which = BINSPHERE;
ncoord = 1;
iarg = 4;
if (iarg+6 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
sorigin_user[0] = force->numeric(FLERR,arg[iarg]);
sorigin_user[1] = force->numeric(FLERR,arg[iarg+1]);
sorigin_user[2] = force->numeric(FLERR,arg[iarg+2]);
sradmin_user = force->numeric(FLERR,arg[iarg+3]);
sradmax_user = force->numeric(FLERR,arg[iarg+4]);
nsbin = force->inumeric(FLERR,arg[iarg+5]);
iarg += 6;
} else if (strcmp(arg[3],"bin/cylinder") == 0) {
binflag = 1;
which = BINCYLINDER;
ncoord = 2;
iarg = 4;
readdim(narg,arg,iarg,0);
iarg += 3;
if (dim[0] == 0) {
cdim1 = 1;
cdim2 = 2;
} else if (dim[0] == 1) {
cdim1 = 0;
cdim2 = 2;
} else {
cdim1 = 0;
cdim2 = 1;
}
if (iarg+5 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
corigin_user[dim[0]] = 0.0;
corigin_user[cdim1] = force->numeric(FLERR,arg[iarg]);
corigin_user[cdim2] = force->numeric(FLERR,arg[iarg+1]);
cradmin_user = force->numeric(FLERR,arg[iarg+2]);
cradmax_user = force->numeric(FLERR,arg[iarg+3]);
ncbin = force->inumeric(FLERR,arg[iarg+4]);
iarg += 5;
} else if (strcmp(arg[3],"type") == 0) {
which = TYPE;
iarg = 4;
} else if (strcmp(arg[3],"molecule") == 0) {
which = MOLECULE;
iarg = 4;
} else if (strstr(arg[3],"c_") == arg[3] ||
strstr(arg[3],"f_") == arg[3] ||
strstr(arg[3],"v_") == arg[3]) {
if (arg[3][0] == 'c') which = COMPUTE;
else if (arg[3][0] == 'f') which = FIX;
else if (arg[3][0] == 'v') which = VARIABLE;
iarg = 4;
int n = strlen(arg[3]);
char *suffix = new char[n];
strcpy(suffix,&arg[3][2]);
char *ptr = strchr(suffix,'[');
if (ptr) {
if (suffix[strlen(suffix)-1] != ']')
error->all(FLERR,"Illegal fix ave/atom command");
argindex = atoi(ptr+1);
*ptr = '\0';
} else argindex = 0;
n = strlen(suffix) + 1;
cfvid = new char[n];
strcpy(cfvid,suffix);
delete [] suffix;
} else error->all(FLERR,"Illegal compute chunk/atom command");
// optional args
regionflag = 0;
idregion = NULL;
nchunksetflag = 0;
nchunkflag = EVERY;
limit = 0;
limitstyle = LIMITMAX;
limitfirst = 0;
idsflag = EVERY;
compress = 0;
int discardsetflag = 0;
discard = MIXED;
minflag[0] = LOWER;
minflag[1] = LOWER;
minflag[2] = LOWER;
maxflag[0] = UPPER;
maxflag[1] = UPPER;
maxflag[2] = UPPER;
scaleflag = LATTICE;
+ pbcflag = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"region") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
int iregion = domain->find_region(arg[iarg+1]);
if (iregion == -1)
error->all(FLERR,"Region ID for compute chunk/atom does not exist");
int n = strlen(arg[iarg+1]) + 1;
idregion = new char[n];
strcpy(idregion,arg[iarg+1]);
regionflag = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"nchunk") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
if (strcmp(arg[iarg+1],"once") == 0) nchunkflag = ONCE;
else if (strcmp(arg[iarg+1],"every") == 0) nchunkflag = EVERY;
else error->all(FLERR,"Illegal compute chunk/atom command");
nchunksetflag = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"limit") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
limit = force->inumeric(FLERR,arg[iarg+1]);
if (limit < 0) error->all(FLERR,"Illegal compute chunk/atom command");
if (limit && !compress) limitfirst = 1;
iarg += 2;
if (limit) {
if (iarg+1 > narg)
error->all(FLERR,"Illegal compute chunk/atom command");
if (strcmp(arg[iarg+1],"max") == 0) limitstyle = LIMITMAX;
else if (strcmp(arg[iarg+1],"exact") == 0) limitstyle = LIMITEXACT;
else error->all(FLERR,"Illegal compute chunk/atom command");
iarg++;
}
} else if (strcmp(arg[iarg],"ids") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
if (strcmp(arg[iarg+1],"once") == 0) idsflag = ONCE;
else if (strcmp(arg[iarg+1],"nfreq") == 0) idsflag = NFREQ;
else if (strcmp(arg[iarg+1],"every") == 0) idsflag = EVERY;
else error->all(FLERR,"Illegal compute chunk/atom command");
iarg += 2;
} else if (strcmp(arg[iarg],"compress") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
else if (strcmp(arg[iarg+1],"no") == 0) compress = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) compress = 1;
else error->all(FLERR,"Illegal compute chunk/atom command");
iarg += 2;
} else if (strcmp(arg[iarg],"discard") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
if (strcmp(arg[iarg+1],"mixed") == 0) discard = MIXED;
else if (strcmp(arg[iarg+1],"no") == 0) discard = NODISCARD;
else if (strcmp(arg[iarg+1],"yes") == 0) discard = YESDISCARD;
else error->all(FLERR,"Illegal compute chunk/atom command");
discardsetflag = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"bound") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
int idim;
if (strcmp(arg[iarg+1],"x") == 0) idim = 0;
else if (strcmp(arg[iarg+1],"y") == 0) idim = 1;
else if (strcmp(arg[iarg+1],"z") == 0) idim = 2;
else error->all(FLERR,"Illegal compute chunk/atom command");
if (strcmp(arg[iarg+2],"lower") == 0) minflag[idim] = LOWER;
else minflag[idim] = COORD;
if (minflag[idim] == COORD)
minvalue[idim] = force->numeric(FLERR,arg[iarg+2]);
if (strcmp(arg[iarg+3],"upper") == 0) maxflag[idim] = UPPER;
else maxflag[idim] = COORD;
if (maxflag[idim] == COORD)
maxvalue[idim] = force->numeric(FLERR,arg[iarg+3]);
else error->all(FLERR,"Illegal compute chunk/atom command");
iarg += 4;
} else if (strcmp(arg[iarg],"units") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
if (strcmp(arg[iarg+1],"box") == 0) scaleflag = BOX;
else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = LATTICE;
else if (strcmp(arg[iarg+1],"reduced") == 0) scaleflag = REDUCED;
else error->all(FLERR,"Illegal compute chunk/atom command");
iarg += 2;
+ } else if (strcmp(arg[iarg],"pbc") == 0) {
+ if (iarg+2 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
+ if (strcmp(arg[iarg+1],"no") == 0) pbcflag = 0;
+ else if (strcmp(arg[iarg+1],"yes") == 0) pbcflag = 1;
+ else error->all(FLERR,"Illegal compute chunk/atom command");
+ iarg += 2;
} else error->all(FLERR,"Illegal compute chunk/atom command");
}
// set nchunkflag and discard to default values if not explicitly set
// for binning style, also check in init() if simulation box is static,
// which sets nchunkflag = ONCE
if (!nchunksetflag) {
if (binflag) {
if (scaleflag == REDUCED) nchunkflag = ONCE;
else nchunkflag = EVERY;
}
if (which == TYPE) nchunkflag = ONCE;
if (which == MOLECULE) {
if (regionflag) nchunkflag = EVERY;
else nchunkflag = ONCE;
}
if (compress) nchunkflag = EVERY;
}
if (!discardsetflag) {
if (binflag) discard = MIXED;
else discard = YESDISCARD;
}
// error checks
if (which == MOLECULE && !atom->molecule_flag)
error->all(FLERR,"Compute chunk/atom molecule for non-molecular system");
if (!binflag && discard == MIXED)
error->all(FLERR,"Compute chunk/atom without bins "
"cannot use discard mixed");
if (which == BIN1D && delta[0] <= 0.0)
error->all(FLERR,"Illegal compute chunk/atom command");
if (which == BIN2D && (delta[0] <= 0.0 || delta[1] <= 0.0))
error->all(FLERR,"Illegal compute chunk/atom command");
if (which == BIN3D &&
(delta[0] <= 0.0 || delta[1] <= 0.0 || delta[2] <= 0.0))
error->all(FLERR,"Illegal compute chunk/atom command");
if (which == BINSPHERE) {
if (domain->dimension == 2 && sorigin_user[2] != 0.0)
error->all(FLERR,"Compute chunk/atom sphere z origin must be 0.0 for 2d");
if (sradmin_user < 0.0 || sradmin_user >= sradmax_user || nsbin < 1)
error->all(FLERR,"Illegal compute chunk/atom command");
}
if (which == BINCYLINDER) {
if (delta[0] <= 0.0)
error->all(FLERR,"Illegal compute chunk/atom command");
if (domain->dimension == 2 && dim[0] != 2)
error->all(FLERR,"Compute chunk/atom cylinder axis must be z for 2d");
if (cradmin_user < 0.0 || cradmin_user >= cradmax_user || ncbin < 1)
error->all(FLERR,"Illegal compute chunk/atom command");
}
if (which == COMPUTE) {
int icompute = modify->find_compute(cfvid);
if (icompute < 0)
error->all(FLERR,"Compute ID for compute chunk /atom does not exist");
if (modify->compute[icompute]->peratom_flag == 0)
error->all(FLERR,
"Compute chunk/atom compute does not calculate "
"per-atom values");
if (argindex == 0 &&
modify->compute[icompute]->size_peratom_cols != 0)
error->all(FLERR,"Compute chunk/atom compute does not "
"calculate a per-atom vector");
if (argindex && modify->compute[icompute]->size_peratom_cols == 0)
error->all(FLERR,"Compute chunk/atom compute does not "
"calculate a per-atom array");
if (argindex &&
argindex > modify->compute[icompute]->size_peratom_cols)
error->all(FLERR,"Compute chunk/atom compute array is "
"accessed out-of-range");
}
if (which == FIX) {
int ifix = modify->find_fix(cfvid);
if (ifix < 0)
error->all(FLERR,"Fix ID for compute chunk/atom does not exist");
if (modify->fix[ifix]->peratom_flag == 0)
error->all(FLERR,"Compute chunk/atom fix does not calculate "
"per-atom values");
if (argindex == 0 && modify->fix[ifix]->size_peratom_cols != 0)
error->all(FLERR,
"Compute chunk/atom fix does not calculate a per-atom vector");
if (argindex && modify->fix[ifix]->size_peratom_cols == 0)
error->all(FLERR,
"Compute chunk/atom fix does not calculate a per-atom array");
if (argindex && argindex > modify->fix[ifix]->size_peratom_cols)
error->all(FLERR,"Compute chunk/atom fix array is accessed out-of-range");
}
if (which == VARIABLE) {
int ivariable = input->variable->find(cfvid);
if (ivariable < 0)
error->all(FLERR,"Variable name for compute chunk/atom does not exist");
if (input->variable->atomstyle(ivariable) == 0)
error->all(FLERR,"Compute chunk/atom variable is not "
"atom-style variable");
}
// setup scaling
if (binflag) {
if (domain->triclinic == 1 && scaleflag != REDUCED)
error->all(FLERR,"Compute chunk/atom for triclinic boxes "
"requires units reduced");
}
if (scaleflag == LATTICE) {
xscale = domain->lattice->xlattice;
yscale = domain->lattice->ylattice;
zscale = domain->lattice->zlattice;
} else xscale = yscale = zscale = 1.0;
// apply scaling factors and cylinder dims orthogonal to axis
if (binflag) {
double scale;
if (which == BIN1D || which == BIN2D || which == BIN3D ||
which == BINCYLINDER) {
if (which == BIN1D || BINCYLINDER) ndim = 1;
if (which == BIN2D) ndim = 2;
if (which == BIN3D) ndim = 3;
for (int idim = 0; idim < ndim; idim++) {
if (dim[idim] == 0) scale = xscale;
else if (dim[idim] == 1) scale = yscale;
else if (dim[idim] == 2) scale = zscale;
delta[idim] *= scale;
invdelta[idim] = 1.0/delta[idim];
if (originflag[idim] == COORD) origin[idim] *= scale;
if (minflag[idim] == COORD) minvalue[idim] *= scale;
if (maxflag[idim] == COORD) maxvalue[idim] *= scale;
}
} else if (which == BINSPHERE) {
sorigin_user[0] *= xscale;
sorigin_user[1] *= yscale;
sorigin_user[2] *= zscale;
sradmin_user *= xscale; // radii are scaled by xscale
sradmax_user *= xscale;
} else if (which == BINCYLINDER) {
if (dim[0] == 0) {
corigin_user[cdim1] *= yscale;
corigin_user[cdim2] *= zscale;
cradmin_user *= yscale; // radii are scaled by first non-axis dim
cradmax_user *= yscale;
} else if (dim[0] == 1) {
corigin_user[cdim1] *= xscale;
corigin_user[cdim2] *= zscale;
cradmin_user *= xscale;
cradmax_user *= xscale;
} else {
corigin_user[cdim1] *= xscale;
corigin_user[cdim2] *= yscale;
cradmin_user *= xscale;
cradmax_user *= xscale;
}
}
}
// initialize chunk vector and per-chunk info
nmax = 0;
chunk = NULL;
nmaxint = 0;
ichunk = NULL;
exclude = NULL;
nchunk = 0;
chunk_volume_scalar = 1.0;
chunk_volume_vec = NULL;
coord = NULL;
chunkID = NULL;
// computeflag = 1 if this compute might invoke another compute
// during assign_chunk_ids()
if (which == COMPUTE || which == FIX || which == VARIABLE) computeflag = 1;
else computeflag = 0;
// other initializations
invoked_setup = -1;
invoked_ichunk = -1;
id_fix = NULL;
fixstore = NULL;
if (compress) hash = new std::map<tagint,int>();
else hash = NULL;
maxvar = 0;
varatom = NULL;
lockcount = 0;
lockfix = NULL;
if (which == MOLECULE) molcheck = 1;
else molcheck = 0;
}
/* ---------------------------------------------------------------------- */
ComputeChunkAtom::~ComputeChunkAtom()
{
// check nfix in case all fixes have already been deleted
if (modify->nfix) modify->delete_fix(id_fix);
delete [] id_fix;
memory->destroy(chunk);
memory->destroy(ichunk);
memory->destroy(exclude);
memory->destroy(chunk_volume_vec);
memory->destroy(coord);
memory->destroy(chunkID);
delete [] idregion;
delete [] cfvid;
delete hash;
memory->destroy(varatom);
}
/* ---------------------------------------------------------------------- */
void ComputeChunkAtom::init()
{
// set and check validity of region
if (regionflag) {
int iregion = domain->find_region(idregion);
if (iregion == -1)
error->all(FLERR,"Region ID for compute chunk/atom does not exist");
region = domain->regions[iregion];
}
// set compute,fix,variable
if (which == COMPUTE) {
int icompute = modify->find_compute(cfvid);
if (icompute < 0)
error->all(FLERR,"Compute ID for compute chunk/atom does not exist");
cchunk = modify->compute[icompute];
} else if (which == FIX) {
int ifix = modify->find_fix(cfvid);
if (ifix < 0)
error->all(FLERR,"Fix ID for compute chunk/atom does not exist");
fchunk = modify->fix[ifix];
} else if (which == VARIABLE) {
int ivariable = input->variable->find(cfvid);
if (ivariable < 0)
error->all(FLERR,"Variable name for compute chunk/atom does not exist");
vchunk = ivariable;
}
// for style MOLECULE, check that no mol IDs exceed MAXSMALLINT
// don't worry about group or optional region
if (which == MOLECULE) {
tagint *molecule = atom->molecule;
int nlocal = atom->nlocal;
tagint maxone = -1;
for (int i = 0; i < nlocal; i++)
if (molecule[i] > maxone) maxone = molecule[i];
tagint maxall;
MPI_Allreduce(&maxone,&maxall,1,MPI_LMP_TAGINT,MPI_MAX,world);
if (maxall > MAXSMALLINT)
error->all(FLERR,"Molecule IDs too large for compute chunk/atom");
}
// for binning, if nchunkflag not already set, set it to ONCE or EVERY
// depends on whether simulation box size is static or dynamic
// reset invoked_setup if this is not first run and box just became static
if (binflag && !nchunksetflag && !compress && scaleflag != REDUCED) {
if (domain->box_change_size == 0) {
if (nchunkflag == EVERY && invoked_setup >= 0) invoked_setup = -1;
nchunkflag = ONCE;
} else nchunkflag = EVERY;
}
// require nchunkflag = ONCE if idsflag = ONCE
// b/c nchunk cannot change if chunk IDs are frozen
// can't check until now since nchunkflag may have been adjusted in init()
if (idsflag == ONCE && nchunkflag != ONCE)
error->all(FLERR,"Compute chunk/atom ids once but nchunk is not once");
// create/destroy fix STORE for persistent chunk IDs as needed
// need to do this if idsflag = ONCE or locks will be used by other commands
// need to wait until init() so that fix ave/chunk command(s) are in place
// they increment lockcount if they lock this compute
// fixstore ID = compute-ID + COMPUTE_STORE, fix group = compute group
// fixstore initializes all values to 0.0
if ((idsflag == ONCE || lockcount) && !fixstore) {
int n = strlen(id) + strlen("_COMPUTE_STORE") + 1;
id_fix = new char[n];
strcpy(id_fix,id);
strcat(id_fix,"_COMPUTE_STORE");
- char **newarg = new char*[5];
+ char **newarg = new char*[6];
newarg[0] = id_fix;
newarg[1] = group->names[igroup];
newarg[2] = (char *) "STORE";
- newarg[3] = (char *) "1";
+ newarg[3] = (char *) "peratom";
newarg[4] = (char *) "1";
- modify->add_fix(5,newarg);
+ newarg[5] = (char *) "1";
+ modify->add_fix(6,newarg);
fixstore = (FixStore *) modify->fix[modify->nfix-1];
delete [] newarg;
}
if ((idsflag != ONCE && !lockcount) && fixstore) {
modify->delete_fix(id_fix);
fixstore = NULL;
}
}
/* ----------------------------------------------------------------------
invoke setup_chunks and/or compute_ichunk if only done ONCE
so that nchunks or chunk IDs are assigned when this compute was specified
as opposed to first times compute_peratom() or compute_ichunk() is called
------------------------------------------------------------------------- */
void ComputeChunkAtom::setup()
{
if (nchunkflag == ONCE) setup_chunks();
if (idsflag == ONCE) compute_ichunk();
}
/* ----------------------------------------------------------------------
only called by classes that use per-atom computes in standard way
dump, variable, thermo output, other computes, etc
not called by fix ave/chunk or compute chunk commands
they invoke setup_chunks() and compute_ichunk() directly
------------------------------------------------------------------------- */
void ComputeChunkAtom::compute_peratom()
{
invoked_peratom = update->ntimestep;
// grow floating point chunk vector if necessary
if (atom->nlocal > nmax) {
memory->destroy(chunk);
nmax = atom->nmax;
memory->create(chunk,nmax,"chunk/atom:chunk");
vector_atom = chunk;
}
setup_chunks();
compute_ichunk();
// copy integer indices into floating-point chunk vector
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) chunk[i] = ichunk[i];
}
/* ----------------------------------------------------------------------
set lock, so that nchunk will not change from startstep to stopstep
called by fix ave/chunk for duration of its Nfreq epoch
OK if called by multiple fix ave/chunk commands
error if all callers do not have same duration
last caller holds the lock, so it can also unlock
lockstop can be positive for final step of finite-size time window
or can be -1 for infinite-size time window
------------------------------------------------------------------------- */
void ComputeChunkAtom::lock(Fix *fixptr, bigint startstep, bigint stopstep)
{
if (lockfix == NULL) {
lockfix = fixptr;
lockstart = startstep;
lockstop = stopstep;
return;
}
if (startstep != lockstart || stopstep != lockstop)
error->all(FLERR,"Two fix ave commands using "
"same compute chunk/atom command in incompatible ways");
// set lock to last calling Fix, since it will be last to unlock()
lockfix = fixptr;
}
/* ----------------------------------------------------------------------
unset lock
can only be done by fix ave/chunk command that holds the lock
------------------------------------------------------------------------- */
void ComputeChunkAtom::unlock(Fix *fixptr)
{
if (fixptr != lockfix) return;
lockfix = NULL;
}
/* ----------------------------------------------------------------------
assign chunk IDs from 1 to Nchunk to every atom, or 0 if not in chunk
------------------------------------------------------------------------- */
void ComputeChunkAtom::compute_ichunk()
{
int i;
// skip if already done on this step
if (invoked_ichunk == update->ntimestep) return;
// if old IDs persist via storage in fixstore, then just retrieve them
// yes if idsflag = ONCE, and already done once
// or if idsflag = NFREQ and lock is in place and are on later timestep
// else proceed to recalculate per-atom chunk assignments
int restore = 0;
if (idsflag == ONCE && invoked_ichunk >= 0) restore = 1;
if (idsflag == NFREQ && lockfix && update->ntimestep > lockstart) restore = 1;
if (restore) {
invoked_ichunk = update->ntimestep;
double *vstore = fixstore->vstore;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++) ichunk[i] = static_cast<int> (vstore[i]);
return;
}
invoked_ichunk = update->ntimestep;
// assign chunk IDs to atoms
// will exclude atoms not in group or in optional region
// already invoked if this is same timestep as last setup_chunks()
if (update->ntimestep > invoked_setup) assign_chunk_ids();
// compress chunk IDs via hash of the original uncompressed IDs
// also apply discard rule except for binning styles which already did
int nlocal = atom->nlocal;
if (compress) {
if (binflag) {
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
if (hash->find(ichunk[i]) == hash->end()) exclude[i] = 1;
else ichunk[i] = hash->find(ichunk[i])->second;
}
} else if (discard == NODISCARD) {
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
if (hash->find(ichunk[i]) == hash->end()) ichunk[i] = nchunk;
else ichunk[i] = hash->find(ichunk[i])->second;
}
} else {
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
if (hash->find(ichunk[i]) == hash->end()) exclude[i] = 1;
else ichunk[i] = hash->find(ichunk[i])->second;
}
}
// else if no compression apply discard rule by itself
} else {
if (discard == NODISCARD) {
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
if (ichunk[i] < 1 || ichunk[i] > nchunk) ichunk[i] = nchunk;;
}
} else {
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
if (ichunk[i] < 1 || ichunk[i] > nchunk) exclude[i] = 1;
}
}
}
// set ichunk = 0 for excluded atoms
// this should set any ichunk values which have not yet been set
for (i = 0; i < nlocal; i++)
if (exclude[i]) ichunk[i] = 0;
// if newly calculated IDs need to persist, store them in fixstore
// yes if idsflag = ONCE or idsflag = NFREQ and lock is in place
if (idsflag == ONCE || (idsflag == NFREQ && lockfix)) {
double *vstore = fixstore->vstore;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) vstore[i] = ichunk[i];
}
// one-time check if which = MOLECULE and
// any chunks do not contain all atoms in the molecule
if (molcheck) {
check_molecules();
molcheck = 0;
}
}
/* ----------------------------------------------------------------------
setup chunks
return nchunk = # of chunks
all atoms will be assigned a chunk ID from 1 to Nchunk, or 0
also setup any internal state needed to quickly assign atoms to chunks
called from compute_peratom() and also directly from
fix ave/chunk and compute chunk commands
------------------------------------------------------------------------- */
int ComputeChunkAtom::setup_chunks()
{
if (invoked_setup == update->ntimestep) return nchunk;
// check if setup needs to be done
// no if lock is in place
// no if nchunkflag = ONCE, and already done once
// otherwise yes
// even if no, check if need to re-compute bin volumes
// so that fix ave/chunk can do proper density normalization
int flag = 0;
if (lockfix) flag = 1;
if (nchunkflag == ONCE && invoked_setup >= 0) flag = 1;
if (flag) {
if (binflag && scaleflag == REDUCED && domain->box_change_size)
bin_volumes();
return nchunk;
}
invoked_setup = update->ntimestep;
// assign chunk IDs to atoms
// will exclude atoms not in group or in optional region
// for binning styles, need to setup bins and their volume first
// else chunk_volume_scalar = entire box volume
// IDs are needed to scan for max ID and for compress()
if (binflag) {
if (which == BIN1D || which == BIN2D || which == BIN3D)
nchunk = setup_xyz_bins();
else if (which == BINSPHERE) nchunk = setup_sphere_bins();
else if (which == BINCYLINDER) nchunk = setup_cylinder_bins();
bin_volumes();
} else {
chunk_volume_scalar = domain->xprd * domain->yprd;
if (domain->dimension == 3) chunk_volume_scalar *= domain->zprd;
}
assign_chunk_ids();
// set nchunk for chunk styles other than binning
// for styles other than TYPE, scan for max ID
if (which == TYPE) nchunk = atom->ntypes;
else if (!binflag) {
int nlocal = atom->nlocal;
int hi = -1;
for (int i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
if (ichunk[i] > hi) hi = ichunk[i];
}
MPI_Allreduce(&hi,&nchunk,1,MPI_INT,MPI_MAX,world);
if (nchunk <= 0) nchunk = 1;
}
// apply limit setting as well as compression of chunks with no atoms
// if limit is set, there are 3 cases:
// no compression, limit specified before compression, or vice versa
if (limit && !binflag) {
if (!compress) {
if (limitstyle == LIMITMAX) nchunk = MIN(nchunk,limit);
else if (limitstyle == LIMITEXACT) nchunk = limit;
} else if (limitfirst) {
nchunk = MIN(nchunk,limit);
}
}
if (compress) compress_chunk_ids();
if (limit && !binflag && compress) {
if (limitstyle == LIMITMAX) nchunk = MIN(nchunk,limit);
else if (limitstyle == LIMITEXACT) nchunk = limit;
}
return nchunk;
}
/* ----------------------------------------------------------------------
assign chunk IDs for all atoms, via ichunk vector
except excluded atoms, their chunk IDs are set to 0 later
also set exclude vector to 0/1 for all atoms
excluded atoms are those not in group or in optional region
called from compute_ichunk() and setup_chunks()
------------------------------------------------------------------------- */
void ComputeChunkAtom::assign_chunk_ids()
{
int i;
// grow integer chunk index vector if necessary
if (atom->nlocal > nmaxint) {
memory->destroy(ichunk);
memory->destroy(exclude);
nmaxint = atom->nmax;
memory->create(ichunk,nmaxint,"chunk/atom:ichunk");
memory->create(exclude,nmaxint,"chunk/atom:exclude");
}
// update region if necessary
if (regionflag) region->prematch();
// exclude = 1 if atom is not assigned to a chunk
// exclude atoms not in group or not in optional region
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (regionflag) {
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit &&
region->match(x[i][0],x[i][1],x[i][2])) exclude[i] = 0;
else exclude[i] = 1;
}
} else {
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) exclude[i] = 0;
else exclude[i] = 1;
}
}
// set ichunk to style value for included atoms
// binning styles apply discard rule, others do not yet
if (binflag) {
if (which == BIN1D) atom2bin1d();
else if (which == BIN2D) atom2bin2d();
else if (which == BIN3D) atom2bin3d();
else if (which == BINSPHERE) atom2binsphere();
else if (which == BINCYLINDER) atom2bincylinder();
} else if (which == TYPE) {
int *type = atom->type;
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
ichunk[i] = type[i];
}
} else if (which == MOLECULE) {
tagint *molecule = atom->molecule;
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
ichunk[i] = static_cast<int> (molecule[i]);
}
} else if (which == COMPUTE) {
if (!(cchunk->invoked_flag & INVOKED_PERATOM)) {
cchunk->compute_peratom();
cchunk->invoked_flag |= INVOKED_PERATOM;
}
if (argindex == 0) {
double *vec = cchunk->vector_atom;
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
ichunk[i] = static_cast<int> (vec[i]);
}
} else {
double **array = cchunk->array_atom;
int argm1 = argindex - 1;
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
ichunk[i] = static_cast<int> (array[i][argm1]);
}
}
} else if (which == FIX) {
if (update->ntimestep % fchunk->peratom_freq)
error->all(FLERR,"Fix used in compute chunk/atom not "
"computed at compatible time");
if (argindex == 0) {
double *vec = fchunk->vector_atom;
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
ichunk[i] = static_cast<int> (vec[i]);
}
} else {
double **array = fchunk->array_atom;
int argm1 = argindex - 1;
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
ichunk[i] = static_cast<int> (array[i][argm1]);
}
}
} else if (which == VARIABLE) {
if (nlocal > maxvar) {
maxvar = atom->nmax;
memory->destroy(varatom);
memory->create(varatom,maxvar,"chunk/atom:varatom");
}
input->variable->compute_atom(vchunk,igroup,varatom,1,0);
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
ichunk[i] = static_cast<int> (varatom[i]);
}
}
}
/* ----------------------------------------------------------------------
compress chunk IDs currently assigned to atoms across all processors
by removing those with no atoms assigned
current assignment excludes atoms not in group or in optional region
current Nchunk = max ID
operation:
use hash to store list of populated IDs that I own
add new IDs to populated lists communicated from all other procs
final hash has global list of populated ideas
reset Nchunk = length of global list
called by setup_chunks() when setting Nchunk
remapping of chunk IDs to smaller Nchunk occurs later in compute_ichunk()
------------------------------------------------------------------------- */
void ComputeChunkAtom::compress_chunk_ids()
{
hash->clear();
// put my IDs into hash
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
if (hash->find(ichunk[i]) == hash->end()) (*hash)[ichunk[i]] = 0;
}
// n = # of my populated IDs
// nall = n summed across all procs
int n = hash->size();
bigint nbone = n;
bigint nball;
MPI_Allreduce(&nbone,&nball,1,MPI_LMP_BIGINT,MPI_SUM,world);
// create my list of populated IDs
int *list = NULL;
memory->create(list,n,"chunk/atom:list");
n = 0;
std::map<tagint,int>::iterator pos;
for (pos = hash->begin(); pos != hash->end(); ++pos)
list[n++] = pos->first;
// if nall < 1M, just allgather all ID lists on every proc
// else perform ring comm
// add IDs from all procs to my hash
if (nball <= IDMAX) {
// setup for allgatherv
int nprocs = comm->nprocs;
int nall = nball;
int *recvcounts,*displs,*listall;
memory->create(recvcounts,nprocs,"chunk/atom:recvcounts");
memory->create(displs,nprocs,"chunk/atom:displs");
memory->create(listall,nall,"chunk/atom:listall");
MPI_Allgather(&n,1,MPI_INT,recvcounts,1,MPI_INT,world);
displs[0] = 0;
for (int iproc = 1; iproc < nprocs; iproc++)
displs[iproc] = displs[iproc-1] + recvcounts[iproc-1];
// allgatherv acquires list of populated IDs from all procs
MPI_Allgatherv(list,n,MPI_INT,listall,recvcounts,displs,MPI_INT,world);
// add all unique IDs in listall to my hash
for (int i = 0; i < nall; i++)
if (hash->find(listall[i]) == hash->end()) (*hash)[listall[i]] = 0;
// clean up
memory->destroy(recvcounts);
memory->destroy(displs);
memory->destroy(listall);
} else {
cptr = this;
comm->ring(n,sizeof(int),list,1,idring,NULL,0);
}
memory->destroy(list);
// nchunk = length of hash containing populated IDs from all procs
nchunk = hash->size();
// reset hash value of each original chunk ID to ordered index
// ordered index = new compressed chunk ID (1 to Nchunk)
// leverages fact that map stores keys in ascending order
// also allocate and set chunkID = list of original chunk IDs
// used by fix ave/chunk and compute property/chunk
memory->destroy(chunkID);
memory->create(chunkID,nchunk,"chunk/atom:chunkID");
n = 0;
for (pos = hash->begin(); pos != hash->end(); ++pos) {
chunkID[n] = pos->first;
(*hash)[pos->first] = ++n;
}
}
/* ----------------------------------------------------------------------
callback from comm->ring()
cbuf = list of N chunk IDs from another proc
loop over the list, add each to my hash
hash ends up storing all unique IDs across all procs
------------------------------------------------------------------------- */
void ComputeChunkAtom::idring(int n, char *cbuf)
{
tagint *list = (tagint *) cbuf;
std::map<tagint,int> *hash = cptr->hash;
for (int i = 0; i < n; i++) (*hash)[list[i]] = 0;
}
/* ----------------------------------------------------------------------
one-time check for which = MOLECULE to check
if each chunk contains all atoms in the molecule
issue warning if not
note that this check is without regard to discard rule
if discard == NODISCARD, there is no easy way to check that all
atoms in an out-of-bounds molecule were added to a chunk,
some could have been excluded by group or region, others not
------------------------------------------------------------------------- */
void ComputeChunkAtom::check_molecules()
{
tagint *molecule = atom->molecule;
int nlocal = atom->nlocal;
int flag = 0;
if (!compress) {
for (int i = 0; i < nlocal; i++) {
if (molecule[i] > 0 && molecule[i] <= nchunk &&
ichunk[i] == 0) flag = 1;
}
} else {
int molid;
for (int i = 0; i < nlocal; i++) {
molid = static_cast<int> (molecule[i]);
if (hash->find(molid) != hash->end() && ichunk[i] == 0) flag = 1;
}
}
int flagall;
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
if (flagall && comm->me == 0)
error->warning(FLERR,
"One or more chunks do not contain all atoms in molecule");
}
/* ----------------------------------------------------------------------
setup xyz spatial bins and their extent and coordinates
return nbins = # of bins, will become # of chunks
called from setup_chunks()
------------------------------------------------------------------------- */
int ComputeChunkAtom::setup_xyz_bins()
{
int i,j,k,m,n,idim;
double lo,hi,coord1,coord2;
// lo = bin boundary immediately below boxlo or minvalue
// hi = bin boundary immediately above boxhi or maxvalue
// allocate and initialize arrays based on new bin count
double binlo[3],binhi[3];
if (scaleflag == REDUCED) {
binlo[0] = domain->boxlo_lamda[0];
binlo[1] = domain->boxlo_lamda[1];
binlo[2] = domain->boxlo_lamda[2];
binhi[0] = domain->boxhi_lamda[0];
binhi[1] = domain->boxhi_lamda[1];
binhi[2] = domain->boxhi_lamda[2];
} else {
binlo[0] = domain->boxlo[0];
binlo[1] = domain->boxlo[1];
binlo[2] = domain->boxlo[2];
binhi[0] = domain->boxhi[0];
binhi[1] = domain->boxhi[1];
binhi[2] = domain->boxhi[2];
}
if (minflag[0] == COORD) binlo[0] = minvalue[0];
if (minflag[1] == COORD) binlo[1] = minvalue[1];
if (minflag[2] == COORD) binlo[2] = minvalue[2];
if (maxflag[0] == COORD) binhi[0] = maxvalue[0];
if (maxflag[1] == COORD) binhi[1] = maxvalue[1];
if (maxflag[2] == COORD) binhi[2] = maxvalue[2];
int nbins = 1;
for (m = 0; m < ndim; m++) {
idim = dim[m];
if (originflag[m] == LOWER) origin[m] = binlo[idim];
else if (originflag[m] == UPPER) origin[m] = binhi[idim];
else if (originflag[m] == CENTER)
origin[m] = 0.5 * (binlo[idim] + binhi[idim]);
if (origin[m] < binlo[idim]) {
n = static_cast<int> ((binlo[idim] - origin[m]) * invdelta[m]);
lo = origin[m] + n*delta[m];
} else {
n = static_cast<int> ((origin[m] - binlo[idim]) * invdelta[m]);
lo = origin[m] - n*delta[m];
if (lo > binlo[idim]) lo -= delta[m];
}
if (origin[m] < binhi[idim]) {
n = static_cast<int> ((binhi[idim] - origin[m]) * invdelta[m]);
hi = origin[m] + n*delta[m];
if (hi < binhi[idim]) hi += delta[m];
} else {
n = static_cast<int> ((origin[m] - binhi[idim]) * invdelta[m]);
hi = origin[m] - n*delta[m];
}
if (lo > hi) error->all(FLERR,"Invalid bin bounds in compute chunk/atom");
offset[m] = lo;
nlayers[m] = static_cast<int> ((hi-lo) * invdelta[m] + 0.5);
nbins *= nlayers[m];
}
// allocate and set bin coordinates
memory->destroy(coord);
memory->create(coord,nbins,ndim,"chunk/atom:coord");
if (ndim == 1) {
for (i = 0; i < nlayers[0]; i++)
coord[i][0] = offset[0] + (i+0.5)*delta[0];
} else if (ndim == 2) {
m = 0;
for (i = 0; i < nlayers[0]; i++) {
coord1 = offset[0] + (i+0.5)*delta[0];
for (j = 0; j < nlayers[1]; j++) {
coord[m][0] = coord1;
coord[m][1] = offset[1] + (j+0.5)*delta[1];
m++;
}
}
} else if (ndim == 3) {
m = 0;
for (i = 0; i < nlayers[0]; i++) {
coord1 = offset[0] + (i+0.5)*delta[0];
for (j = 0; j < nlayers[1]; j++) {
coord2 = offset[1] + (j+0.5)*delta[1];
for (k = 0; k < nlayers[2]; k++) {
coord[m][0] = coord1;
coord[m][1] = coord2;
coord[m][2] = offset[2] + (k+0.5)*delta[2];
m++;
}
}
}
}
return nbins;
}
/* ----------------------------------------------------------------------
setup spherical spatial bins and their single coordinate
return nsphere = # of bins, will become # of chunks
called from setup_chunks()
------------------------------------------------------------------------- */
int ComputeChunkAtom::setup_sphere_bins()
{
// convert sorigin_user to sorigin
- // sorigin is always in box units, for orthogonal or triclinic domains
+ // sorigin,srad are always in box units, for orthogonal or triclinic domains
// lamda2x works for either orthogonal or triclinic
if (scaleflag == REDUCED) {
domain->lamda2x(sorigin_user,sorigin);
sradmin = sradmin_user * (domain->boxhi[0]-domain->boxlo[0]);
sradmax = sradmax_user * (domain->boxhi[0]-domain->boxlo[0]);
} else {
sorigin[0] = sorigin_user[0];
sorigin[1] = sorigin_user[1];
sorigin[2] = sorigin_user[2];
sradmin = sradmin_user;
sradmax = sradmax_user;
}
+ // if pbcflag set, sradmax must be < 1/2 box in any periodic dim
+ // treat orthongonal and triclinic the same
+ // check every time bins are created
+
+ if (pbcflag) {
+ double *prd_half = domain->prd_half;
+ int *periodicity = domain->periodicity;
+ int flag = 0;
+ if (periodicity[0] && sradmax > prd_half[0]) flag = 1;
+ if (periodicity[1] && sradmax > prd_half[1]) flag = 1;
+ if (domain->dimension == 3 &&
+ periodicity[2] && sradmax > prd_half[2]) flag = 1;
+ if (flag)
+ error->all(FLERR,"Compute chunk/atom bin/sphere radius "
+ "is too large for periodic box");
+ }
+
sinvrad = nsbin / (sradmax-sradmin);
// allocate and set bin coordinates
// coord = midpt of radii for a spherical shell
memory->destroy(coord);
memory->create(coord,nsbin,1,"chunk/atom:coord");
double rlo,rhi;
for (int i = 0; i < nsbin; i++) {
rlo = sradmin + i * (sradmax-sradmin) / nsbin;
rhi = sradmin + (i+1) * (sradmax-sradmin) / nsbin;
if (i == nsbin-1) rhi = sradmax;
coord[i][0] = 0.5 * (rlo+rhi);
}
return nsbin;
}
/* ----------------------------------------------------------------------
setup cylindrical spatial bins and their single coordinate
return nsphere = # of bins, will become # of chunks
called from setup_chunks()
------------------------------------------------------------------------- */
int ComputeChunkAtom::setup_cylinder_bins()
{
// setup bins along cylinder axis
// ncplane = # of axis bins
ncplane = setup_xyz_bins();
// convert corigin_user to corigin
// corigin is always in box units, for orthogonal or triclinic domains
// lamda2x works for either orthogonal or triclinic
if (scaleflag == REDUCED) {
domain->lamda2x(corigin_user,corigin);
cradmin = cradmin_user * (domain->boxhi[cdim1]-domain->boxlo[cdim1]);
cradmax = cradmax_user * (domain->boxhi[cdim1]-domain->boxlo[cdim1]);
} else {
corigin[cdim1] = corigin_user[cdim1];
corigin[cdim2] = corigin_user[cdim2];
cradmin = cradmin_user;
cradmax = cradmax_user;
}
+ // if pbcflag set, sradmax must be < 1/2 box in any periodic non-axis dim
+ // treat orthongonal and triclinic the same
+ // check every time bins are created
+
+ if (pbcflag) {
+ double *prd_half = domain->prd_half;
+ int *periodicity = domain->periodicity;
+ int flag = 0;
+ if (periodicity[cdim1] && sradmax > prd_half[cdim1]) flag = 1;
+ if (periodicity[cdim2] && sradmax > prd_half[cdim2]) flag = 1;
+ if (flag)
+ error->all(FLERR,"Compute chunk/atom bin/cylinder radius "
+ "is too large for periodic box");
+ }
+
cinvrad = ncbin / (cradmax-cradmin);
// allocate and set radial bin coordinates
// radial coord = midpt of radii for a cylindrical shell
// axiscoord = saved bin coords along cylndrical axis
// radcoord = saved bin coords in radial direction
double **axiscoord = coord;
memory->create(coord,ncbin,1,"chunk/atom:coord");
double **radcoord = coord;
double rlo,rhi;
for (int i = 0; i < ncbin; i++) {
rlo = cradmin + i * (cradmax-cradmin) / ncbin;
rhi = cradmin + (i+1) * (cradmax-cradmin) / ncbin;
if (i == ncbin-1) rhi = cradmax;
coord[i][0] = 0.5 * (rlo+rhi);
}
// create array of combined coords for all bins
memory->create(coord,ncbin*ncplane,2,"chunk/atom:coord");
int m = 0;
for (int i = 0; i < ncbin; i++)
for (int j = 0; j < ncplane; j++) {
coord[m][0] = radcoord[i][0];
coord[m][1] = axiscoord[j][0];
m++;
}
memory->destroy(axiscoord);
memory->destroy(radcoord);
return ncbin*ncplane;
}
/* ----------------------------------------------------------------------
calculate chunk volumes = bin volumes
scalar if all bins have same volume
vector if per-bin volumes are different
------------------------------------------------------------------------- */
void ComputeChunkAtom::bin_volumes()
{
if (which == BIN1D || which == BIN2D || which == BIN3D) {
if (domain->dimension == 3)
chunk_volume_scalar = domain->xprd * domain->yprd * domain->zprd;
else chunk_volume_scalar = domain->xprd * domain->yprd;
double *prd;
if (scaleflag == REDUCED) prd = domain->prd_lamda;
else prd = domain->prd;
for (int m = 0; m < ndim; m++)
chunk_volume_scalar *= delta[m]/prd[dim[m]];
} else if (which == BINSPHERE) {
memory->destroy(chunk_volume_vec);
memory->create(chunk_volume_vec,nchunk,"chunk/atom:chunk_volume_vec");
double rlo,rhi,vollo,volhi;
for (int i = 0; i < nchunk; i++) {
rlo = sradmin + i * (sradmax-sradmin) / nsbin;
rhi = sradmin + (i+1) * (sradmax-sradmin) / nsbin;
if (i == nchunk-1) rhi = sradmax;
vollo = 4.0/3.0 * MY_PI * rlo*rlo*rlo;
volhi = 4.0/3.0 * MY_PI * rhi*rhi*rhi;
chunk_volume_vec[i] = volhi - vollo;
}
} else if (which == BINCYLINDER) {
memory->destroy(chunk_volume_vec);
memory->create(chunk_volume_vec,nchunk,"chunk/atom:chunk_volume_vec");
// slabthick = delta of bins along cylinder axis
double *prd;
if (scaleflag == REDUCED) prd = domain->prd_lamda;
else prd = domain->prd;
double slabthick = domain->prd[dim[0]] * delta[0]/prd[dim[0]];
// area lo/hi of concentric circles in radial direction
int iradbin;
double rlo,rhi,arealo,areahi;
for (int i = 0; i < nchunk; i++) {
iradbin = i / ncplane;
rlo = cradmin + iradbin * (cradmax-cradmin) / ncbin;
rhi = cradmin + (iradbin+1) * (cradmax-cradmin) / ncbin;
if (iradbin == ncbin-1) rhi = cradmax;
arealo = MY_PI * rlo*rlo;
areahi = MY_PI * rhi*rhi;
chunk_volume_vec[i] = (areahi-arealo) * slabthick;
}
}
}
/* ----------------------------------------------------------------------
assign each atom to a 1d spatial bin (layer)
------------------------------------------------------------------------- */
void ComputeChunkAtom::atom2bin1d()
{
int i,ibin;
double *boxlo,*boxhi,*prd;
double xremap;
double **x = atom->x;
int nlocal = atom->nlocal;
int idim = dim[0];
int nlayer1m1 = nlayers[0] - 1;
int periodicity = domain->periodicity[idim];
if (periodicity) {
if (scaleflag == REDUCED) {
boxlo = domain->boxlo_lamda;
boxhi = domain->boxhi_lamda;
prd = domain->prd_lamda;
} else {
boxlo = domain->boxlo;
boxhi = domain->boxhi;
prd = domain->prd;
}
}
// remap each atom's relevant coord back into box via PBC if necessary
// if scaleflag = REDUCED, box coords -> lamda coords
// apply discard rule
if (scaleflag == REDUCED) domain->x2lamda(nlocal);
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
xremap = x[i][idim];
if (periodicity) {
if (xremap < boxlo[idim]) xremap += prd[idim];
if (xremap >= boxhi[idim]) xremap -= prd[idim];
}
ibin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
if (xremap < offset[0]) ibin--;
if (discard == MIXED) {
if (!minflag[idim]) ibin = MAX(ibin,0);
else if (ibin < 0) {
exclude[i] = 1;
continue;
}
if (!maxflag[idim]) ibin = MIN(ibin,nlayer1m1);
else if (ibin > nlayer1m1) {
exclude[i] = 1;
continue;
}
} else if (discard == NODISCARD) {
ibin = MAX(ibin,0);
ibin = MIN(ibin,nlayer1m1);
} else if (ibin < 0 || ibin > nlayer1m1) {
exclude[i] = 1;
continue;
}
ichunk[i] = ibin+1;
}
if (scaleflag == REDUCED) domain->lamda2x(nlocal);
}
/* ----------------------------------------------------------------------
assign each atom to a 2d spatial bin (pencil)
------------------------------------------------------------------------- */
void ComputeChunkAtom::atom2bin2d()
{
int i,ibin,i1bin,i2bin;
double *boxlo,*boxhi,*prd;
double xremap,yremap;
double **x = atom->x;
int nlocal = atom->nlocal;
int idim = dim[0];
int jdim = dim[1];
int nlayer1m1 = nlayers[0] - 1;
int nlayer2m1 = nlayers[1] - 1;
int *periodicity = domain->periodicity;
if (periodicity[idim] || periodicity[jdim]) {
if (scaleflag == REDUCED) {
boxlo = domain->boxlo_lamda;
boxhi = domain->boxhi_lamda;
prd = domain->prd_lamda;
} else {
boxlo = domain->boxlo;
boxhi = domain->boxhi;
prd = domain->prd;
}
}
// remap each atom's relevant coord back into box via PBC if necessary
// if scaleflag = REDUCED, box coords -> lamda coords
// apply discard rule
if (scaleflag == REDUCED) domain->x2lamda(nlocal);
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
xremap = x[i][idim];
if (periodicity[idim]) {
if (xremap < boxlo[idim]) xremap += prd[idim];
if (xremap >= boxhi[idim]) xremap -= prd[idim];
}
i1bin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
if (xremap < offset[0]) i1bin--;
if (discard == MIXED) {
if (!minflag[idim]) i1bin = MAX(i1bin,0);
else if (i1bin < 0) {
exclude[i] = 1;
continue;
}
if (!maxflag[idim]) i1bin = MIN(i1bin,nlayer1m1);
else if (i1bin > nlayer1m1) {
exclude[i] = 1;
continue;
}
} else if (discard == NODISCARD) {
i1bin = MAX(i1bin,0);
i1bin = MIN(i1bin,nlayer1m1);
} else if (i1bin < 0 || i1bin > nlayer1m1) {
exclude[i] = 1;
continue;
}
yremap = x[i][jdim];
if (periodicity[jdim]) {
if (yremap < boxlo[jdim]) yremap += prd[jdim];
if (yremap >= boxhi[jdim]) yremap -= prd[jdim];
}
i2bin = static_cast<int> ((yremap - offset[1]) * invdelta[1]);
if (yremap < offset[1]) i2bin--;
if (discard == MIXED) {
if (!minflag[jdim]) i2bin = MAX(i2bin,0);
else if (i2bin < 0) {
exclude[i] = 1;
continue;
}
if (!maxflag[jdim]) i2bin = MIN(i2bin,nlayer2m1);
else if (i2bin > nlayer2m1) {
exclude[i] = 1;
continue;
}
} else if (discard == NODISCARD) {
i2bin = MAX(i2bin,0);
i2bin = MIN(i2bin,nlayer2m1);
} else if (i2bin < 0 || i2bin > nlayer2m1) {
exclude[i] = 1;
continue;
}
ibin = i1bin*nlayers[1] + i2bin;
ichunk[i] = ibin+1;
}
if (scaleflag == REDUCED) domain->lamda2x(nlocal);
}
/* ----------------------------------------------------------------------
assign each atom to a 3d spatial bin (brick)
------------------------------------------------------------------------- */
void ComputeChunkAtom::atom2bin3d()
{
int i,ibin,i1bin,i2bin,i3bin;
double *boxlo,*boxhi,*prd;
double xremap,yremap,zremap;
double **x = atom->x;
int nlocal = atom->nlocal;
int idim = dim[0];
int jdim = dim[1];
int kdim = dim[2];
int nlayer1m1 = nlayers[0] - 1;
int nlayer2m1 = nlayers[1] - 1;
int nlayer3m1 = nlayers[2] - 1;
int *periodicity = domain->periodicity;
if (periodicity[idim] || periodicity[jdim] || periodicity[kdim]) {
if (scaleflag == REDUCED) {
boxlo = domain->boxlo_lamda;
boxhi = domain->boxhi_lamda;
prd = domain->prd_lamda;
} else {
boxlo = domain->boxlo;
boxhi = domain->boxhi;
prd = domain->prd;
}
}
// remap each atom's relevant coord back into box via PBC if necessary
// if scaleflag = REDUCED, box coords -> lamda coords
// apply discard rule
if (scaleflag == REDUCED) domain->x2lamda(nlocal);
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
xremap = x[i][idim];
if (periodicity[idim]) {
if (xremap < boxlo[idim]) xremap += prd[idim];
if (xremap >= boxhi[idim]) xremap -= prd[idim];
}
i1bin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
if (xremap < offset[0]) i1bin--;
if (discard == MIXED) {
if (!minflag[idim]) i1bin = MAX(i1bin,0);
else if (i1bin < 0) {
exclude[i] = 1;
continue;
}
if (!maxflag[idim]) i1bin = MIN(i1bin,nlayer1m1);
else if (i1bin > nlayer1m1) {
exclude[i] = 1;
continue;
}
} else if (discard == NODISCARD) {
i1bin = MAX(i1bin,0);
i1bin = MIN(i1bin,nlayer1m1);
} else if (i1bin < 0 || i1bin > nlayer1m1) {
exclude[i] = 1;
continue;
}
yremap = x[i][jdim];
if (periodicity[jdim]) {
if (yremap < boxlo[jdim]) yremap += prd[jdim];
if (yremap >= boxhi[jdim]) yremap -= prd[jdim];
}
i2bin = static_cast<int> ((yremap - offset[1]) * invdelta[1]);
if (yremap < offset[1]) i2bin--;
if (discard == MIXED) {
if (!minflag[jdim]) i2bin = MAX(i2bin,0);
else if (i2bin < 0) {
exclude[i] = 1;
continue;
}
if (!maxflag[jdim]) i2bin = MIN(i2bin,nlayer2m1);
else if (i2bin > nlayer2m1) {
exclude[i] = 1;
continue;
}
} else if (discard == NODISCARD) {
i2bin = MAX(i2bin,0);
i2bin = MIN(i2bin,nlayer2m1);
} else if (i2bin < 0 || i2bin > nlayer2m1) {
exclude[i] = 1;
continue;
}
zremap = x[i][kdim];
if (periodicity[kdim]) {
if (zremap < boxlo[kdim]) zremap += prd[kdim];
if (zremap >= boxhi[kdim]) zremap -= prd[kdim];
}
i3bin = static_cast<int> ((zremap - offset[2]) * invdelta[2]);
if (zremap < offset[2]) i3bin--;
if (discard == MIXED) {
if (!minflag[kdim]) i3bin = MAX(i3bin,0);
else if (i3bin < 0) {
exclude[i] = 1;
continue;
}
if (!maxflag[kdim]) i3bin = MIN(i3bin,nlayer3m1);
else if (i3bin > nlayer3m1) {
exclude[i] = 1;
continue;
}
} else if (discard == NODISCARD) {
i3bin = MAX(i3bin,0);
i3bin = MIN(i3bin,nlayer3m1);
} else if (i3bin < 0 || i3bin > nlayer3m1) {
exclude[i] = 1;
continue;
}
ibin = i1bin*nlayers[1]*nlayers[2] + i2bin*nlayers[2] + i3bin;
ichunk[i] = ibin+1;
}
if (scaleflag == REDUCED) domain->lamda2x(nlocal);
}
/* ----------------------------------------------------------------------
assign each atom to a spherical bin
------------------------------------------------------------------------- */
void ComputeChunkAtom::atom2binsphere()
{
int i,ibin;
double dx,dy,dz,r;
double xremap,yremap,zremap;
double *boxlo = domain->boxlo;
double *boxhi = domain->boxhi;
double *prd = domain->prd;
+ double *prd_half = domain->prd_half;
int *periodicity = domain->periodicity;
// remap each atom's relevant coords back into box via PBC if necessary
// apply discard rule based on rmin and rmax
double **x = atom->x;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
xremap = x[i][0];
if (periodicity[0]) {
if (xremap < boxlo[0]) xremap += prd[0];
if (xremap >= boxhi[0]) xremap -= prd[0];
}
yremap = x[i][1];
if (periodicity[1]) {
if (xremap < boxlo[1]) yremap += prd[1];
if (xremap >= boxhi[1]) yremap -= prd[1];
}
zremap = x[i][2];
if (periodicity[2]) {
if (xremap < boxlo[2]) zremap += prd[2];
if (xremap >= boxhi[2]) zremap -= prd[2];
}
dx = xremap - sorigin[0];
dy = yremap - sorigin[1];
dz = zremap - sorigin[2];
+
+ // if requested, apply PBC to distance from sphere center
+ // treat orthogonal and triclinic the same
+ // with dx,dy,dz = lengths independent of each other
+ // so do not use domain->minimum_image() which couples for triclinic
+
+ if (pbcflag) {
+ if (periodicity[0]) {
+ if (fabs(dx) > prd_half[0]) {
+ if (dx < 0.0) dx += prd[0];
+ else dx -= prd[0];
+ }
+ }
+ if (periodicity[1]) {
+ if (fabs(dy) > prd_half[1]) {
+ if (dy < 0.0) dy += prd[1];
+ else dy -= prd[1];
+ }
+ }
+ if (periodicity[2]) {
+ if (fabs(dz) > prd_half[2]) {
+ if (dz < 0.0) dz += prd[2];
+ else dz -= prd[2];
+ }
+ }
+ }
+
r = sqrt(dx*dx + dy*dy + dz*dz);
ibin = static_cast<int> ((r - sradmin) * sinvrad);
if (r < sradmin) ibin--;
if (discard == MIXED || discard == NODISCARD) {
ibin = MAX(ibin,0);
ibin = MIN(ibin,nchunk-1);
} else if (ibin < 0 || ibin >= nchunk) {
exclude[i] = 1;
continue;
}
ichunk[i] = ibin+1;
}
}
/* ----------------------------------------------------------------------
assign each atom to a cylindrical bin
-
------------------------------------------------------------------------- */
void ComputeChunkAtom::atom2bincylinder()
{
int i,rbin,kbin;
double d1,d2,r;
double remap1,remap2;
// first use atom2bin1d() to bin all atoms along cylinder axis
atom2bin1d();
// now bin in radial direction
// kbin = bin along cylinder axis
// rbin = bin in radial direction
double *boxlo = domain->boxlo;
double *boxhi = domain->boxhi;
double *prd = domain->prd;
+ double *prd_half = domain->prd_half;
int *periodicity = domain->periodicity;
// remap each atom's relevant coords back into box via PBC if necessary
// apply discard rule based on rmin and rmax
double **x = atom->x;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++) {
if (exclude[i]) continue;
kbin = ichunk[i] - 1;
remap1 = x[i][cdim1];
if (periodicity[cdim1]) {
if (remap1 < boxlo[cdim1]) remap1 += prd[cdim1];
if (remap1 >= boxhi[cdim1]) remap1 -= prd[cdim1];
}
remap2 = x[i][cdim2];
if (periodicity[cdim2]) {
if (remap2 < boxlo[cdim2]) remap2 += prd[cdim2];
if (remap2 >= boxhi[cdim2]) remap2 -= prd[cdim2];
}
d1 = remap1 - corigin[cdim1];
d2 = remap2 - corigin[cdim2];
+
+ // if requested, apply PBC to distance from cylinder axis
+ // treat orthogonal and triclinic the same
+ // with d1,d2 = lengths independent of each other
+
+ if (pbcflag) {
+ if (periodicity[cdim1]) {
+ if (fabs(d1) > prd_half[cdim1]) {
+ if (d1 < 0.0) d1 += prd[cdim1];
+ else d1 -= prd[cdim1];
+ }
+ }
+ if (periodicity[cdim2]) {
+ if (fabs(d2) > prd_half[cdim2]) {
+ if (d2 < 0.0) d2 += prd[cdim2];
+ else d2 -= prd[cdim2];
+ }
+ }
+ }
+
r = sqrt(d1*d1 + d2*d2);
rbin = static_cast<int> ((r - cradmin) * cinvrad);
if (r < cradmin) rbin--;
if (discard == MIXED || discard == NODISCARD) {
rbin = MAX(rbin,0);
rbin = MIN(rbin,ncbin-1);
} else if (rbin < 0 || rbin >= ncbin) {
exclude[i] = 1;
continue;
}
// combine axis and radial bin indices to set ichunk
ichunk[i] = rbin*ncplane + kbin + 1;
}
}
/* ----------------------------------------------------------------------
process args for one dimension of binning info
set dim, originflag, origin, delta
------------------------------------------------------------------------- */
void ComputeChunkAtom::readdim(int narg, char **arg, int iarg, int idim)
{
if (narg < iarg+3) error->all(FLERR,"Illegal compute chunk/atom command");
if (strcmp(arg[iarg],"x") == 0) dim[idim] = 0;
else if (strcmp(arg[iarg],"y") == 0) dim[idim] = 1;
else if (strcmp(arg[iarg],"z") == 0) dim[idim] = 2;
else error->all(FLERR,"Illegal compute chunk/atom command");
if (dim[idim] == 2 && domain->dimension == 2)
error->all(FLERR,"Cannot use compute chunk/atom bin z for 2d model");
if (strcmp(arg[iarg+1],"lower") == 0) originflag[idim] = LOWER;
else if (strcmp(arg[iarg+1],"center") == 0) originflag[idim] = CENTER;
else if (strcmp(arg[iarg+1],"upper") == 0) originflag[idim] = UPPER;
else originflag[idim] = COORD;
if (originflag[idim] == COORD)
origin[idim] = force->numeric(FLERR,arg[iarg+1]);
delta[idim] = force->numeric(FLERR,arg[iarg+2]);
}
/* ----------------------------------------------------------------------
initialize one atom's storage values, called when atom is created
just set chunkID to 0 for new atom
------------------------------------------------------------------------- */
void ComputeChunkAtom::set_arrays(int i)
{
if (!fixstore) return;
double *vstore = fixstore->vstore;
vstore[i] = 0.0;
}
/* ----------------------------------------------------------------------
memory usage of local atom-based arrays and per-chunk arrays
note: nchunk is actually 0 until first call
------------------------------------------------------------------------- */
double ComputeChunkAtom::memory_usage()
{
double bytes = 2*nmaxint * sizeof(int); // ichunk,exclude
bytes += nmax * sizeof(double); // chunk
bytes += ncoord*nchunk * sizeof(double); // coord
if (compress) bytes += nchunk * sizeof(int); // chunkID
return bytes;
}
diff --git a/src/compute_chunk_atom.h b/src/compute_chunk_atom.h
index c1609ff6b..6330a37ad 100644
--- a/src/compute_chunk_atom.h
+++ b/src/compute_chunk_atom.h
@@ -1,241 +1,241 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(chunk/atom,ComputeChunkAtom)
#else
#ifndef LMP_COMPUTE_CHUNK_ATOM_H
#define LMP_COMPUTE_CHUNK_ATOM_H
#include "compute.h"
#include <map>
namespace LAMMPS_NS {
class ComputeChunkAtom : public Compute {
public:
int nchunk,ncoord,compress,idsflag,lockcount;
int computeflag; // 1 if this compute invokes other computes
double chunk_volume_scalar;
double *chunk_volume_vec;
double **coord;
int *ichunk,*chunkID;
ComputeChunkAtom(class LAMMPS *, int, char **);
~ComputeChunkAtom();
void init();
void setup();
void compute_peratom();
void set_arrays(int);
double memory_usage();
void lock(class Fix *, bigint, bigint);
void unlock(class Fix *);
int setup_chunks();
void compute_ichunk();
private:
int which,binflag;
int regionflag,nchunksetflag,nchunkflag,discard;
int limit,limitstyle,limitfirst;
- int scaleflag;
+ int scaleflag,pbcflag;
double xscale,yscale,zscale;
int argindex;
char *cfvid;
// xyz spatial bins
int ndim;
int dim[3],originflag[3],nlayers[3];
int minflag[3],maxflag[3];
double origin[3],delta[3];
double offset[3],invdelta[3];
double minvalue[3],maxvalue[3];
// spherical spatial bins
double sorigin_user[3];
double sorigin[3];
double sradmin_user,sradmax_user;
double sradmin,sradmax,sinvrad;
int nsbin;
// cylindrical spatial bins
double corigin_user[3];
double corigin[3];
double cradmin_user,cradmax_user;
double cradmin,cradmax,cinvrad;
int cdim1,cdim2;
int ncbin,ncplane;
char *idregion;
class Region *region;
class Compute *cchunk;
class Fix *fchunk;
int vchunk;
int maxvar;
double *varatom;
char *id_fix;
class FixStore *fixstore;
class Fix *lockfix; // ptr to FixAveChunk that is locking out setups
// NULL if no lock currently in place
bigint lockstart,lockstop; // timesteps for start and stop of locking
bigint invoked_setup; // last timestep setup_chunks and nchunk calculated
bigint invoked_ichunk; // last timestep ichunk values calculated
int nmax,nmaxint;
double *chunk;
int molcheck; // one-time check if all molecule atoms in chunk
int *exclude; // 1 if atom is not assigned to any chunk
std::map<tagint,int> *hash; // store original chunks IDs before compression
// static variable for ring communication callback to access class data
// callback functions for ring communication
static ComputeChunkAtom *cptr;
static void idring(int, char *);
void assign_chunk_ids();
void compress_chunk_ids();
void check_molecules();
int setup_xyz_bins();
int setup_sphere_bins();
int setup_cylinder_bins();
void bin_volumes();
void atom2bin1d();
void atom2bin2d();
void atom2bin3d();
void atom2binsphere();
void atom2bincylinder();
void readdim(int, char **, int, int);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Region ID for compute chunk/atom does not exist
Self-explanatory.
E: Compute chunk/atom molecule for non-molecular system
Self-explanatory.
E: Compute chunk/atom without bins cannot use discard mixed
That discard option only applies to the binning styles.
E: Compute ID for compute chunk/atom does not exist
Self-explanatory.
E: Compute chunk/atom compute does not calculate per-atom values
Self-explanatory.
E: Compute chunk/atom compute does not calculate a per-atom vector
Self-explanatory.
E: Compute chunk/atom compute does not calculate a per-atom array
Self-explanatory.
E: Compute chunk/atom compute array is accessed out-of-range
The index for the array is out of bounds.
E: Fix ID for compute chunk/atom does not exist
Self-explanatory.
E: Compute chunk/atom fix does not calculate per-atom values
Self-explanatory.
E: Compute chunk/atom fix does not calculate a per-atom vector
Self-explanatory.
E: Compute chunk/atom fix does not calculate a per-atom array
Self-explanatory.
E: Compute chunk/atom fix array is accessed out-of-range
the index for the array is out of bounds.
E: Variable name for compute chunk/atom does not exist
Self-explanatory.
E: Compute chunk/atom variable is not atom-style variable
Self-explanatory.
E: Compute chunk/atom for triclinic boxes requires units reduced
Self-explanatory.
E: Molecule IDs too large for compute chunk/atom
The IDs must not be larger than can be stored in a 32-bit integer
since chunk IDs are 32-bit integers.
E: Compute chunk/atom ids once but nchunk is not once
You cannot assign chunks IDs to atom permanently if the number of
chunks may change.
E: Two fix ave commands using same compute chunk/atom command in incompatible ways
They are both attempting to "lock" the chunk/atom command so that the
chunk assignments persist for some number of timesteps, but are doing
it in different ways.
E: Fix used in compute chunk/atom not computed at compatible time
The chunk/atom compute cannot query the output of the fix on a timestep
it is needed.
W: One or more chunks do not contain all atoms in molecule
This may not be what you intended.
E: Invalid bin bounds in compute chunk/atom
The lo/hi values are inconsistent.
E: Cannot use compute chunk/atom bin z for 2d model
Self-explanatory.
*/
diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp
index a95a64563..51d8ab22d 100644
--- a/src/compute_displace_atom.cpp
+++ b/src/compute_displace_atom.cpp
@@ -1,193 +1,194 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <string.h>
#include "compute_displace_atom.h"
#include "atom.h"
#include "update.h"
#include "group.h"
#include "domain.h"
#include "modify.h"
#include "fix.h"
#include "fix_store.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg != 3) error->all(FLERR,"Illegal compute displace/atom command");
peratom_flag = 1;
size_peratom_cols = 4;
create_attribute = 1;
// create a new fix STORE style
// id = compute-ID + COMPUTE_STORE, fix group = compute group
int n = strlen(id) + strlen("_COMPUTE_STORE") + 1;
id_fix = new char[n];
strcpy(id_fix,id);
strcat(id_fix,"_COMPUTE_STORE");
- char **newarg = new char*[5];
+ char **newarg = new char*[6];
newarg[0] = id_fix;
newarg[1] = group->names[igroup];
newarg[2] = (char *) "STORE";
- newarg[3] = (char *) "1";
- newarg[4] = (char *) "3";
- modify->add_fix(5,newarg);
+ newarg[3] = (char *) "peratom";
+ newarg[4] = (char *) "1";
+ newarg[5] = (char *) "3";
+ modify->add_fix(6,newarg);
fix = (FixStore *) modify->fix[modify->nfix-1];
delete [] newarg;
// calculate xu,yu,zu for fix store array
// skip if reset from restart file
if (fix->restart_reset) fix->restart_reset = 0;
else {
double **xoriginal = fix->astore;
double **x = atom->x;
int *mask = atom->mask;
imageint *image = atom->image;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) domain->unmap(x[i],image[i],xoriginal[i]);
else xoriginal[i][0] = xoriginal[i][1] = xoriginal[i][2] = 0.0;
}
// per-atom displacement array
nmax = 0;
displace = NULL;
}
/* ---------------------------------------------------------------------- */
ComputeDisplaceAtom::~ComputeDisplaceAtom()
{
// check nfix in case all fixes have already been deleted
if (modify->nfix) modify->delete_fix(id_fix);
delete [] id_fix;
memory->destroy(displace);
}
/* ---------------------------------------------------------------------- */
void ComputeDisplaceAtom::init()
{
// set fix which stores original atom coords
int ifix = modify->find_fix(id_fix);
if (ifix < 0) error->all(FLERR,"Could not find compute displace/atom fix ID");
fix = (FixStore *) modify->fix[ifix];
}
/* ---------------------------------------------------------------------- */
void ComputeDisplaceAtom::compute_peratom()
{
invoked_peratom = update->ntimestep;
// grow local displacement array if necessary
if (atom->nlocal > nmax) {
memory->destroy(displace);
nmax = atom->nmax;
memory->create(displace,nmax,4,"displace/atom:displace");
array_atom = displace;
}
// dx,dy,dz = displacement of atom from original position
// original unwrapped position is stored by fix
// for triclinic, need to unwrap current atom coord via h matrix
double **xoriginal = fix->astore;
double **x = atom->x;
int *mask = atom->mask;
imageint *image = atom->image;
int nlocal = atom->nlocal;
double *h = domain->h;
double xprd = domain->xprd;
double yprd = domain->yprd;
double zprd = domain->zprd;
int xbox,ybox,zbox;
double dx,dy,dz;
if (domain->triclinic == 0) {
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
xbox = (image[i] & IMGMASK) - IMGMAX;
ybox = (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
zbox = (image[i] >> IMG2BITS) - IMGMAX;
dx = x[i][0] + xbox*xprd - xoriginal[i][0];
dy = x[i][1] + ybox*yprd - xoriginal[i][1];
dz = x[i][2] + zbox*zprd - xoriginal[i][2];
displace[i][0] = dx;
displace[i][1] = dy;
displace[i][2] = dz;
displace[i][3] = sqrt(dx*dx + dy*dy + dz*dz);
} else displace[i][0] = displace[i][1] =
displace[i][2] = displace[i][3] = 0.0;
} else {
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
xbox = (image[i] & IMGMASK) - IMGMAX;
ybox = (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
zbox = (image[i] >> IMG2BITS) - IMGMAX;
dx = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox - xoriginal[i][0];
dy = x[i][1] + h[1]*ybox + h[3]*zbox - xoriginal[i][1];
dz = x[i][2] + h[2]*zbox - xoriginal[i][2];
displace[i][0] = dx;
displace[i][1] = dy;
displace[i][2] = dz;
displace[i][3] = sqrt(dx*dx + dy*dy + dz*dz);
} else displace[i][0] = displace[i][1] =
displace[i][2] = displace[i][3] = 0.0;
}
}
/* ----------------------------------------------------------------------
initialize one atom's storage values, called when atom is created
------------------------------------------------------------------------- */
void ComputeDisplaceAtom::set_arrays(int i)
{
double **xoriginal = fix->astore;
double **x = atom->x;
xoriginal[i][0] = x[i][0];
xoriginal[i][1] = x[i][1];
xoriginal[i][2] = x[i][2];
}
/* ----------------------------------------------------------------------
memory usage of local atom-based array
------------------------------------------------------------------------- */
double ComputeDisplaceAtom::memory_usage()
{
double bytes = nmax*4 * sizeof(double);
return bytes;
}
diff --git a/src/compute_msd.cpp b/src/compute_msd.cpp
index 3634e6817..32d93f933 100644
--- a/src/compute_msd.cpp
+++ b/src/compute_msd.cpp
@@ -1,267 +1,268 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <string.h>
#include "compute_msd.h"
#include "atom.h"
#include "update.h"
#include "group.h"
#include "domain.h"
#include "modify.h"
#include "fix_store.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg < 3) error->all(FLERR,"Illegal compute msd command");
vector_flag = 1;
size_vector = 4;
extvector = 0;
create_attribute = 1;
// optional args
comflag = 0;
avflag = 0;
int iarg = 3;
while (iarg < narg) {
if (strcmp(arg[iarg],"com") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute msd command");
if (strcmp(arg[iarg+1],"no") == 0) comflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) comflag = 1;
else error->all(FLERR,"Illegal compute msd command");
iarg += 2;
} else if (strcmp(arg[iarg],"average") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute msd command");
if (strcmp(arg[iarg+1],"no") == 0) avflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) avflag = 1;
else error->all(FLERR,"Illegal compute msd command");
iarg += 2;
} else error->all(FLERR,"Illegal compute msd command");
}
// create a new fix STORE style for reference positions
// id = compute-ID + COMPUTE_STORE, fix group = compute group
int n = strlen(id) + strlen("_COMPUTE_STORE") + 1;
id_fix = new char[n];
strcpy(id_fix,id);
strcat(id_fix,"_COMPUTE_STORE");
- char **newarg = new char*[5];
+ char **newarg = new char*[6];
newarg[0] = id_fix;
newarg[1] = group->names[igroup];
newarg[2] = (char *) "STORE";
- newarg[3] = (char *) "1";
- newarg[4] = (char *) "3";
- modify->add_fix(5,newarg);
+ newarg[3] = (char *) "peratom";
+ newarg[4] = (char *) "1";
+ newarg[5] = (char *) "3";
+ modify->add_fix(6,newarg);
fix = (FixStore *) modify->fix[modify->nfix-1];
delete [] newarg;
// calculate xu,yu,zu for fix store array
// skip if reset from restart file
if (fix->restart_reset) fix->restart_reset = 0;
else {
double **xoriginal = fix->astore;
double **x = atom->x;
int *mask = atom->mask;
imageint *image = atom->image;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) domain->unmap(x[i],image[i],xoriginal[i]);
else xoriginal[i][0] = xoriginal[i][1] = xoriginal[i][2] = 0.0;
// adjust for COM if requested
if (comflag) {
double cm[3];
masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,cm);
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
xoriginal[i][0] -= cm[0];
xoriginal[i][1] -= cm[1];
xoriginal[i][2] -= cm[2];
}
}
// initialize counter for average positions if requested
naverage = 0;
}
// displacement vector
vector = new double[4];
}
/* ---------------------------------------------------------------------- */
ComputeMSD::~ComputeMSD()
{
// check nfix in case all fixes have already been deleted
if (modify->nfix) modify->delete_fix(id_fix);
delete [] id_fix;
delete [] vector;
}
/* ---------------------------------------------------------------------- */
void ComputeMSD::init()
{
// set fix which stores reference atom coords
int ifix = modify->find_fix(id_fix);
if (ifix < 0) error->all(FLERR,"Could not find compute msd fix ID");
fix = (FixStore *) modify->fix[ifix];
// nmsd = # of atoms in group
nmsd = group->count(igroup);
masstotal = group->mass(igroup);
}
/* ---------------------------------------------------------------------- */
void ComputeMSD::compute_vector()
{
invoked_vector = update->ntimestep;
// cm = current center of mass
double cm[3];
if (comflag) group->xcm(igroup,masstotal,cm);
else cm[0] = cm[1] = cm[2] = 0.0;
// dx,dy,dz = displacement of atom from reference position
// reference unwrapped position is stored by fix
// relative to center of mass if comflag is set
// for triclinic, need to unwrap current atom coord via h matrix
double **xoriginal = fix->astore;
double **x = atom->x;
int *mask = atom->mask;
imageint *image = atom->image;
int nlocal = atom->nlocal;
double *h = domain->h;
double xprd = domain->xprd;
double yprd = domain->yprd;
double zprd = domain->zprd;
double dx,dy,dz;
int xbox,ybox,zbox;
double msd[4];
msd[0] = msd[1] = msd[2] = msd[3] = 0.0;
double xtmp, ytmp, ztmp;
// update number of averages if requested
double navfac;
if (avflag) {
naverage++;
navfac = 1.0/(naverage+1);
}
if (domain->triclinic == 0) {
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
xbox = (image[i] & IMGMASK) - IMGMAX;
ybox = (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
zbox = (image[i] >> IMG2BITS) - IMGMAX;
xtmp = x[i][0] + xbox*xprd - cm[0];
ytmp = x[i][1] + ybox*yprd - cm[1];
ztmp = x[i][2] + zbox*zprd - cm[2];
// use running average position for reference if requested
if (avflag) {
xoriginal[i][0] = (xoriginal[i][0]*naverage + xtmp)*navfac;
xoriginal[i][1] = (xoriginal[i][1]*naverage + ytmp)*navfac;
xoriginal[i][2] = (xoriginal[i][2]*naverage + ztmp)*navfac;
}
dx = xtmp - xoriginal[i][0];
dy = ytmp - xoriginal[i][1];
dz = ztmp - xoriginal[i][2];
msd[0] += dx*dx;
msd[1] += dy*dy;
msd[2] += dz*dz;
msd[3] += dx*dx + dy*dy + dz*dz;
}
} else {
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
xbox = (image[i] & IMGMASK) - IMGMAX;
ybox = (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
zbox = (image[i] >> IMG2BITS) - IMGMAX;
xtmp = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox - cm[0];
ytmp = x[i][1] + h[1]*ybox + h[3]*zbox - cm[1];
ztmp = x[i][2] + h[2]*zbox - cm[2];
// use running average position for reference if requested
if (avflag) {
xoriginal[i][0] = (xoriginal[i][0]*naverage + xtmp)*navfac;
xoriginal[i][1] = (xoriginal[i][0]*naverage + xtmp)*navfac;
xoriginal[i][2] = (xoriginal[i][0]*naverage + xtmp)*navfac;
}
dx = xtmp - xoriginal[i][0];
dy = ytmp - xoriginal[i][1];
dz = ztmp - xoriginal[i][2];
msd[0] += dx*dx;
msd[1] += dy*dy;
msd[2] += dz*dz;
msd[3] += dx*dx + dy*dy + dz*dz;
}
}
MPI_Allreduce(msd,vector,4,MPI_DOUBLE,MPI_SUM,world);
if (nmsd) {
vector[0] /= nmsd;
vector[1] /= nmsd;
vector[2] /= nmsd;
vector[3] /= nmsd;
}
}
/* ----------------------------------------------------------------------
initialize one atom's storage values, called when atom is created
------------------------------------------------------------------------- */
void ComputeMSD::set_arrays(int i)
{
double **xoriginal = fix->astore;
double **x = atom->x;
xoriginal[i][0] = x[i][0];
xoriginal[i][1] = x[i][1];
xoriginal[i][2] = x[i][2];
}
diff --git a/src/compute_msd_chunk.cpp b/src/compute_msd_chunk.cpp
index 81603f2e4..9d9ddcb3b 100644
--- a/src/compute_msd_chunk.cpp
+++ b/src/compute_msd_chunk.cpp
@@ -1,264 +1,308 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <string.h>
#include "compute_msd_chunk.h"
#include "atom.h"
+#include "group.h"
#include "update.h"
#include "modify.h"
#include "compute_chunk_atom.h"
#include "domain.h"
+#include "fix_store.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeMSDChunk::ComputeMSDChunk(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg != 4) error->all(FLERR,"Illegal compute msd/chunk command");
array_flag = 1;
size_array_cols = 4;
size_array_rows = 0;
size_array_rows_variable = 1;
extarray = 0;
// ID of compute chunk/atom
int n = strlen(arg[3]) + 1;
idchunk = new char[n];
strcpy(idchunk,arg[3]);
+ firstflag = 1;
init();
massproc = masstotal = NULL;
- com = comall = cominit = NULL;
+ com = comall = NULL;
msd = NULL;
- firstflag = 1;
+ // create a new fix STORE style for reference positions
+ // id = compute-ID + COMPUTE_STORE, fix group = compute group
+ // do not know size of array at this point, just allocate 1x3 array
+ // fix creation must be done now so that a restart run can
+ // potentially re-populate the fix array (and change it to correct size)
+ // otherwise size reset and init will be done in setup()
+
+ n = strlen(id) + strlen("_COMPUTE_STORE") + 1;
+ id_fix = new char[n];
+ strcpy(id_fix,id);
+ strcat(id_fix,"_COMPUTE_STORE");
+
+ char **newarg = new char*[6];
+ newarg[0] = id_fix;
+ newarg[1] = group->names[igroup];
+ newarg[2] = (char *) "STORE";
+ newarg[3] = (char *) "global";
+ newarg[4] = (char *) "1";
+ newarg[5] = (char *) "1";
+ modify->add_fix(6,newarg);
+ fix = (FixStore *) modify->fix[modify->nfix-1];
+ delete [] newarg;
}
/* ---------------------------------------------------------------------- */
ComputeMSDChunk::~ComputeMSDChunk()
{
+ // check nfix in case all fixes have already been deleted
+
+ if (modify->nfix) modify->delete_fix(id_fix);
+
+ delete [] id_fix;
delete [] idchunk;
memory->destroy(massproc);
memory->destroy(masstotal);
memory->destroy(com);
memory->destroy(comall);
- memory->destroy(cominit);
memory->destroy(msd);
}
/* ---------------------------------------------------------------------- */
void ComputeMSDChunk::init()
{
int icompute = modify->find_compute(idchunk);
if (icompute < 0)
error->all(FLERR,"Chunk/atom compute does not exist for compute msd/chunk");
cchunk = (ComputeChunkAtom *) modify->compute[icompute];
if (strcmp(cchunk->style,"chunk/atom") != 0)
error->all(FLERR,"Compute msd/chunk does not use chunk/atom compute");
+
+ // set fix which stores reference atom coords
+ // if firstflag, will be created in setup()
+
+ if (!firstflag) {
+ int ifix = modify->find_fix(id_fix);
+ if (ifix < 0) error->all(FLERR,"Could not find compute msd/chunk fix ID");
+ fix = (FixStore *) modify->fix[ifix];
+ }
}
/* ----------------------------------------------------------------------
compute initial COM for each chunk
only once on timestep compute is defined, when firstflag = 1
------------------------------------------------------------------------- */
void ComputeMSDChunk::setup()
{
if (!firstflag) return;
compute_array();
firstflag = 0;
+ // if fix->astore is already correct size, restart file set it up
+ // otherwise reset its size now and initialize to current COM
+
+ if (fix->nrow == nchunk && fix->ncol == 3) return;
+ fix->reset_global(nchunk,3);
+
+ double **cominit = fix->astore;
for (int i = 0; i < nchunk; i++) {
cominit[i][0] = comall[i][0];
cominit[i][1] = comall[i][1];
cominit[i][2] = comall[i][2];
msd[i][0] = msd[i][1] = msd[i][2] = msd[i][3] = 0.0;
}
}
/* ---------------------------------------------------------------------- */
void ComputeMSDChunk::compute_array()
{
int index;
double massone;
double unwrap[3];
invoked_array = update->ntimestep;
// compute chunk/atom assigns atoms to chunk IDs
// extract ichunk index vector from compute
// ichunk = 1 to Nchunk for included atoms, 0 for excluded atoms
int n = cchunk->setup_chunks();
cchunk->compute_ichunk();
int *ichunk = cchunk->ichunk;
// first time call, allocate per-chunk arrays
// thereafter, require nchunk remain the same
if (firstflag) {
nchunk = n;
allocate();
size_array_rows = nchunk;
} else if (n != nchunk)
error->all(FLERR,"Compute msd/chunk nchunk is not static");
// zero local per-chunk values
for (int i = 0; i < nchunk; i++) {
massproc[i] = 0.0;
com[i][0] = com[i][1] = com[i][2] = 0.0;
}
// compute current COM for each chunk
double **x = atom->x;
int *mask = atom->mask;
int *type = atom->type;
imageint *image = atom->image;
double *mass = atom->mass;
double *rmass = atom->rmass;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
index = ichunk[i]-1;
if (index < 0) continue;
if (rmass) massone = rmass[i];
else massone = mass[type[i]];
domain->unmap(x[i],image[i],unwrap);
massproc[index] += massone;
com[index][0] += unwrap[0] * massone;
com[index][1] += unwrap[1] * massone;
com[index][2] += unwrap[2] * massone;
}
MPI_Allreduce(massproc,masstotal,nchunk,MPI_DOUBLE,MPI_SUM,world);
MPI_Allreduce(&com[0][0],&comall[0][0],3*nchunk,MPI_DOUBLE,MPI_SUM,world);
for (int i = 0; i < nchunk; i++) {
comall[i][0] /= masstotal[i];
comall[i][1] /= masstotal[i];
comall[i][2] /= masstotal[i];
}
// MSD is difference between current and initial COM
- // cominit does not yet exist when called first time from setup()
+ // cominit is initilialized by setup() when firstflag is set
if (firstflag) return;
double dx,dy,dz;
+ double **cominit = fix->astore;
for (int i = 0; i < nchunk; i++) {
dx = comall[i][0] - cominit[i][0];
dy = comall[i][1] - cominit[i][1];
dz = comall[i][2] - cominit[i][2];
msd[i][0] = dx*dx;
msd[i][1] = dy*dy;
msd[i][2] = dz*dz;
msd[i][3] = dx*dx + dy*dy + dz*dz;
}
}
/* ----------------------------------------------------------------------
lock methods: called by fix ave/time
these methods insure vector/array size is locked for Nfreq epoch
by passing lock info along to compute chunk/atom
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
increment lock counter
------------------------------------------------------------------------- */
void ComputeMSDChunk::lock_enable()
{
cchunk->lockcount++;
}
/* ----------------------------------------------------------------------
decrement lock counter in compute chunk/atom, it if still exists
------------------------------------------------------------------------- */
void ComputeMSDChunk::lock_disable()
{
int icompute = modify->find_compute(idchunk);
if (icompute >= 0) {
cchunk = (ComputeChunkAtom *) modify->compute[icompute];
cchunk->lockcount--;
}
}
/* ----------------------------------------------------------------------
calculate and return # of chunks = length of vector/array
------------------------------------------------------------------------- */
int ComputeMSDChunk::lock_length()
{
nchunk = cchunk->setup_chunks();
return nchunk;
}
/* ----------------------------------------------------------------------
set the lock from startstep to stopstep
------------------------------------------------------------------------- */
void ComputeMSDChunk::lock(Fix *fixptr, bigint startstep, bigint stopstep)
{
cchunk->lock(fixptr,startstep,stopstep);
}
/* ----------------------------------------------------------------------
unset the lock
------------------------------------------------------------------------- */
void ComputeMSDChunk::unlock(Fix *fixptr)
{
cchunk->unlock(fixptr);
}
/* ----------------------------------------------------------------------
one-time allocate of per-chunk arrays
------------------------------------------------------------------------- */
void ComputeMSDChunk::allocate()
{
memory->create(massproc,nchunk,"msd/chunk:massproc");
memory->create(masstotal,nchunk,"msd/chunk:masstotal");
memory->create(com,nchunk,3,"msd/chunk:com");
memory->create(comall,nchunk,3,"msd/chunk:comall");
- memory->create(cominit,nchunk,3,"msd/chunk:cominit");
memory->create(msd,nchunk,4,"msd/chunk:msd");
array = msd;
}
/* ----------------------------------------------------------------------
memory usage of local data
------------------------------------------------------------------------- */
double ComputeMSDChunk::memory_usage()
{
double bytes = (bigint) nchunk * 2 * sizeof(double);
- bytes += (bigint) nchunk * 3*3 * sizeof(double);
+ bytes += (bigint) nchunk * 2*3 * sizeof(double);
bytes += (bigint) nchunk * 4 * sizeof(double);
return bytes;
}
diff --git a/src/compute_msd_chunk.h b/src/compute_msd_chunk.h
index f220fde23..6706755e1 100644
--- a/src/compute_msd_chunk.h
+++ b/src/compute_msd_chunk.h
@@ -1,84 +1,85 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(msd/chunk,ComputeMSDChunk)
#else
#ifndef LMP_COMPUTE_MSD_CHUNK_H
#define LMP_COMPUTE_MSD_CHUNK_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeMSDChunk : public Compute {
public:
ComputeMSDChunk(class LAMMPS *, int, char **);
~ComputeMSDChunk();
void init();
void setup();
void compute_array();
void lock_enable();
void lock_disable();
int lock_length();
void lock(class Fix *, bigint, bigint);
void unlock(class Fix *);
double memory_usage();
private:
int nchunk;
char *idchunk;
class ComputeChunkAtom *cchunk;
+ char *id_fix;
+ class FixStore *fix;
+ int firstflag;
double *massproc,*masstotal;
- double **com,**comall,**cominit;
+ double **com,**comall;
double **msd;
- int firstflag;
-
void allocate();
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Chunk/atom compute does not exist for compute msd/chunk
Self-explanatory.
E: Compute msd/chunk does not use chunk/atom compute
The style of the specified compute is not chunk/atom.
E: Compute msd/chunk nchunk is not static
This is required because the MSD cannot be computed consistently if
the number of chunks is changing. Compute chunk/atom allows setting
nchunk to be static.
*/
diff --git a/src/compute_vacf.cpp b/src/compute_vacf.cpp
index bc3ffbd21..c06113a77 100644
--- a/src/compute_vacf.cpp
+++ b/src/compute_vacf.cpp
@@ -1,154 +1,155 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government ret
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <string.h>
#include "compute_vacf.h"
#include "atom.h"
#include "update.h"
#include "group.h"
#include "modify.h"
#include "fix_store.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeVACF::ComputeVACF(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg < 3) error->all(FLERR,"Illegal compute vacf command");
vector_flag = 1;
size_vector = 4;
extvector = 0;
create_attribute = 1;
// create a new fix STORE style
// id = compute-ID + COMPUTE_STORE, fix group = compute group
int n = strlen(id) + strlen("_COMPUTE_STORE") + 1;
id_fix = new char[n];
strcpy(id_fix,id);
strcat(id_fix,"_COMPUTE_STORE");
- char **newarg = new char*[5];
+ char **newarg = new char*[6];
newarg[0] = id_fix;
newarg[1] = group->names[igroup];
newarg[2] = (char *) "STORE";
- newarg[3] = (char *) "1";
- newarg[4] = (char *) "3";
- modify->add_fix(5,newarg);
+ newarg[3] = (char *) "peratom";
+ newarg[4] = (char *) "1";
+ newarg[5] = (char *) "3";
+ modify->add_fix(6,newarg);
fix = (FixStore *) modify->fix[modify->nfix-1];
delete [] newarg;
// store current velocities in fix store array
// skip if reset from restart file
if (fix->restart_reset) fix->restart_reset = 0;
else {
double **voriginal = fix->astore;
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
voriginal[i][0] = v[i][0];
voriginal[i][1] = v[i][1];
voriginal[i][2] = v[i][2];
} else voriginal[i][0] = voriginal[i][1] = voriginal[i][2] = 0.0;
}
// displacement vector
vector = new double[4];
}
/* ---------------------------------------------------------------------- */
ComputeVACF::~ComputeVACF()
{
// check nfix in case all fixes have already been deleted
if (modify->nfix) modify->delete_fix(id_fix);
delete [] id_fix;
delete [] vector;
}
/* ---------------------------------------------------------------------- */
void ComputeVACF::init()
{
// set fix which stores original atom velocities
int ifix = modify->find_fix(id_fix);
if (ifix < 0) error->all(FLERR,"Could not find compute vacf fix ID");
fix = (FixStore *) modify->fix[ifix];
// nvacf = # of atoms in group
nvacf = group->count(igroup);
}
/* ---------------------------------------------------------------------- */
void ComputeVACF::compute_vector()
{
invoked_vector = update->ntimestep;
double **voriginal = fix->astore;
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double vxsq,vysq,vzsq;
double vacf[4];
vacf[0] = vacf[1] = vacf[2] = vacf[3] = 0.0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
vxsq = v[i][0] * voriginal[i][0];
vysq = v[i][1] * voriginal[i][1];
vzsq = v[i][2] * voriginal[i][2];
vacf[0] += vxsq;
vacf[1] += vysq;
vacf[2] += vzsq;
vacf[3] += vxsq + vysq + vzsq;
}
MPI_Allreduce(vacf,vector,4,MPI_DOUBLE,MPI_SUM,world);
if (nvacf) {
vector[0] /= nvacf;
vector[1] /= nvacf;
vector[2] /= nvacf;
vector[3] /= nvacf;
}
}
/* ----------------------------------------------------------------------
initialize one atom's storage values, called when atom is created
------------------------------------------------------------------------- */
void ComputeVACF::set_arrays(int i)
{
double **voriginal = fix->astore;
double **v = atom->v;
voriginal[i][0] = v[i][0];
voriginal[i][1] = v[i][1];
voriginal[i][2] = v[i][2];
}
diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp
index f3fb24ce1..f14f1ffa5 100644
--- a/src/create_atoms.cpp
+++ b/src/create_atoms.cpp
@@ -1,862 +1,872 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "create_atoms.h"
#include "atom.h"
#include "atom_vec.h"
#include "molecule.h"
#include "comm.h"
#include "irregular.h"
#include "modify.h"
#include "force.h"
#include "special.h"
#include "fix.h"
#include "compute.h"
#include "domain.h"
#include "lattice.h"
#include "region.h"
#include "input.h"
#include "variable.h"
#include "random_park.h"
#include "random_mars.h"
#include "math_extra.h"
#include "math_const.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define BIG 1.0e30
#define EPSILON 1.0e-6
enum{BOX,REGION,SINGLE,RANDOM};
enum{ATOM,MOLECULE};
enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files
/* ---------------------------------------------------------------------- */
CreateAtoms::CreateAtoms(LAMMPS *lmp) : Pointers(lmp) {}
/* ---------------------------------------------------------------------- */
void CreateAtoms::command(int narg, char **arg)
{
if (domain->box_exist == 0)
error->all(FLERR,"Create_atoms command before simulation box is defined");
if (modify->nfix_restart_peratom)
error->all(FLERR,"Cannot create_atoms after "
"reading restart file with per-atom info");
// parse arguments
if (narg < 2) error->all(FLERR,"Illegal create_atoms command");
ntype = force->inumeric(FLERR,arg[0]);
int iarg;
if (strcmp(arg[1],"box") == 0) {
style = BOX;
iarg = 2;
} else if (strcmp(arg[1],"region") == 0) {
style = REGION;
if (narg < 3) error->all(FLERR,"Illegal create_atoms command");
nregion = domain->find_region(arg[2]);
if (nregion == -1) error->all(FLERR,
"Create_atoms region ID does not exist");
domain->regions[nregion]->init();
domain->regions[nregion]->prematch();
iarg = 3;;
} else if (strcmp(arg[1],"single") == 0) {
style = SINGLE;
if (narg < 5) error->all(FLERR,"Illegal create_atoms command");
xone[0] = force->numeric(FLERR,arg[2]);
xone[1] = force->numeric(FLERR,arg[3]);
xone[2] = force->numeric(FLERR,arg[4]);
iarg = 5;
} else if (strcmp(arg[1],"random") == 0) {
style = RANDOM;
if (narg < 5) error->all(FLERR,"Illegal create_atoms command");
nrandom = force->inumeric(FLERR,arg[2]);
seed = force->inumeric(FLERR,arg[3]);
if (strcmp(arg[4],"NULL") == 0) nregion = -1;
else {
nregion = domain->find_region(arg[4]);
if (nregion == -1) error->all(FLERR,
"Create_atoms region ID does not exist");
domain->regions[nregion]->init();
domain->regions[nregion]->prematch();
}
iarg = 5;
} else error->all(FLERR,"Illegal create_atoms command");
// process optional keywords
int scaleflag = 1;
remapflag = 0;
mode = ATOM;
int molseed;
varflag = 0;
vstr = xstr = ystr = zstr = NULL;
quatone[0] = quatone[1] = quatone[2] = 0.0;
nbasis = domain->lattice->nbasis;
basistype = new int[nbasis];
for (int i = 0; i < nbasis; i++) basistype[i] = ntype;
while (iarg < narg) {
if (strcmp(arg[iarg],"basis") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command");
int ibasis = force->inumeric(FLERR,arg[iarg+1]);
int itype = force->inumeric(FLERR,arg[iarg+2]);
if (ibasis <= 0 || ibasis > nbasis || itype <= 0 || itype > atom->ntypes)
error->all(FLERR,"Invalid basis setting in create_atoms command");
basistype[ibasis-1] = itype;
iarg += 3;
} else if (strcmp(arg[iarg],"remap") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal create_atoms command");
if (strcmp(arg[iarg+1],"yes") == 0) remapflag = 1;
else if (strcmp(arg[iarg+1],"no") == 0) remapflag = 0;
else error->all(FLERR,"Illegal create_atoms command");
iarg += 2;
} else if (strcmp(arg[iarg],"mol") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command");
int imol = atom->find_molecule(arg[iarg+1]);
if (imol == -1) error->all(FLERR,"Molecule template ID for "
"create_atoms does not exist");
if (atom->molecules[imol]->nset > 1 && comm->me == 0)
error->warning(FLERR,"Molecule template for "
"create_atoms has multiple molecules");
mode = MOLECULE;
onemol = atom->molecules[imol];
molseed = force->inumeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"units") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal create_atoms command");
if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
else error->all(FLERR,"Illegal create_atoms command");
iarg += 2;
} else if (strcmp(arg[iarg],"var") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal create_atoms command");
delete [] vstr;
int n = strlen(arg[iarg+1]) + 1;
vstr = new char[n];
strcpy(vstr,arg[iarg+1]);
varflag = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"set") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command");
if (strcmp(arg[iarg+1],"x") == 0) {
delete [] xstr;
int n = strlen(arg[iarg+2]) + 1;
xstr = new char[n];
strcpy(xstr,arg[iarg+2]);
} else if (strcmp(arg[iarg+1],"y") == 0) {
delete [] ystr;
int n = strlen(arg[iarg+2]) + 1;
ystr = new char[n];
strcpy(ystr,arg[iarg+2]);
} else if (strcmp(arg[iarg+1],"z") == 0) {
delete [] zstr;
int n = strlen(arg[iarg+2]) + 1;
zstr = new char[n];
strcpy(zstr,arg[iarg+2]);
} else error->all(FLERR,"Illegal create_atoms command");
iarg += 3;
} else if (strcmp(arg[iarg],"rotate") == 0) {
if (style != SINGLE)
error->all(FLERR,"Cannot use create_atoms rotate unless single style");
if (iarg+5 > narg) error->all(FLERR,"Illegal create_atoms command");
double thetaone;
double axisone[3];
thetaone = force->numeric(FLERR,arg[iarg+1]);
axisone[0] = force->numeric(FLERR,arg[iarg+2]);
axisone[1] = force->numeric(FLERR,arg[iarg+3]);
axisone[2] = force->numeric(FLERR,arg[iarg+4]);
if (axisone[0] == 0.0 && axisone[1] == 0.0 && axisone[2] == 0.0)
error->all(FLERR,"Illegal create_atoms command");
if (domain->dimension == 2 && (axisone[0] != 0.0 || axisone[1] != 0.0))
error->all(FLERR,"Invalid create_atoms rotation vector for 2d model");
MathExtra::norm3(axisone);
MathExtra::axisangle_to_quat(axisone,thetaone,quatone);
iarg += 5;
} else error->all(FLERR,"Illegal create_atoms command");
}
// error checks
if (mode == ATOM && (ntype <= 0 || ntype > atom->ntypes))
error->all(FLERR,"Invalid atom type in create_atoms command");
if (style == RANDOM) {
if (nrandom < 0) error->all(FLERR,"Illegal create_atoms command");
if (seed <= 0) error->all(FLERR,"Illegal create_atoms command");
}
// error check and further setup for mode = MOLECULE
ranmol = NULL;
if (mode == MOLECULE) {
if (onemol->xflag == 0)
error->all(FLERR,"Create_atoms molecule must have coordinates");
if (onemol->typeflag == 0)
error->all(FLERR,"Create_atoms molecule must have atom types");
if (ntype+onemol->ntypes <= 0 || ntype+onemol->ntypes > atom->ntypes)
error->all(FLERR,"Invalid atom type in create_atoms mol command");
if (onemol->tag_require && !atom->tag_enable)
error->all(FLERR,
"Create_atoms molecule has atom IDs, but system does not");
onemol->check_attributes(0);
// create_atoms uses geoemetric center of molecule for insertion
onemol->compute_center();
// molecule random number generator, different for each proc
ranmol = new RanMars(lmp,molseed+comm->me);
}
// error check and further setup for variable test
// save local copy of each equal variable string so can restore at end
if (!vstr && (xstr || ystr || zstr))
error->all(FLERR,"Incomplete use of variables in create_atoms command");
if (vstr && (!xstr && !ystr && !zstr))
error->all(FLERR,"Incomplete use of variables in create_atoms command");
if (varflag) {
vvar = input->variable->find(vstr);
if (vvar < 0)
error->all(FLERR,"Variable name for create_atoms does not exist");
if (!input->variable->equalstyle(vvar))
error->all(FLERR,"Variable for create_atoms is invalid style");
if (xstr) {
xvar = input->variable->find(xstr);
if (xvar < 0)
error->all(FLERR,"Variable name for create_atoms does not exist");
if (!input->variable->equalstyle(xvar))
error->all(FLERR,"Variable for create_atoms is invalid style");
input->variable->equal_save(xvar,xstr_copy);
}
if (ystr) {
yvar = input->variable->find(ystr);
if (yvar < 0)
error->all(FLERR,"Variable name for create_atoms does not exist");
if (!input->variable->equalstyle(yvar))
error->all(FLERR,"Variable for create_atoms is invalid style");
input->variable->equal_save(yvar,ystr_copy);
}
if (zstr) {
zvar = input->variable->find(zstr);
if (zvar < 0)
error->all(FLERR,"Variable name for create_atoms does not exist");
if (!input->variable->equalstyle(zvar))
error->all(FLERR,"Variable for create_atoms is invalid style");
input->variable->equal_save(zvar,zstr_copy);
}
}
// demand non-none lattice be defined for BOX and REGION
// else setup scaling for SINGLE and RANDOM
// could use domain->lattice->lattice2box() to do conversion of
// lattice to box, but not consistent with other uses of units=lattice
// triclinic remapping occurs in add_single()
if (style == BOX || style == REGION) {
if (nbasis == 0)
error->all(FLERR,"Cannot create atoms with undefined lattice");
} else if (scaleflag == 1) {
xone[0] *= domain->lattice->xlattice;
xone[1] *= domain->lattice->ylattice;
xone[2] *= domain->lattice->zlattice;
}
// set bounds for my proc in sublo[3] & subhi[3]
// if periodic and style = BOX or REGION, i.e. using lattice:
// should create exactly 1 atom when 2 images are both "on" the boundary
// either image may be slightly inside/outside true box due to round-off
// if I am lo proc, decrement lower bound by EPSILON
// this will insure lo image is created
// if I am hi proc, decrement upper bound by 2.0*EPSILON
// this will insure hi image is not created
// thus insertion box is EPSILON smaller than true box
// and is shifted away from true boundary
// which is where atoms are likely to be generated
triclinic = domain->triclinic;
double epsilon[3];
if (triclinic) epsilon[0] = epsilon[1] = epsilon[2] = EPSILON;
else {
epsilon[0] = domain->prd[0] * EPSILON;
epsilon[1] = domain->prd[1] * EPSILON;
epsilon[2] = domain->prd[2] * EPSILON;
}
if (triclinic == 0) {
sublo[0] = domain->sublo[0]; subhi[0] = domain->subhi[0];
sublo[1] = domain->sublo[1]; subhi[1] = domain->subhi[1];
sublo[2] = domain->sublo[2]; subhi[2] = domain->subhi[2];
} else {
sublo[0] = domain->sublo_lamda[0]; subhi[0] = domain->subhi_lamda[0];
sublo[1] = domain->sublo_lamda[1]; subhi[1] = domain->subhi_lamda[1];
sublo[2] = domain->sublo_lamda[2]; subhi[2] = domain->subhi_lamda[2];
}
if (style == BOX || style == REGION) {
if (comm->layout != LAYOUT_TILED) {
if (domain->xperiodic) {
if (comm->myloc[0] == 0) sublo[0] -= epsilon[0];
if (comm->myloc[0] == comm->procgrid[0]-1) subhi[0] -= 2.0*epsilon[0];
}
if (domain->yperiodic) {
if (comm->myloc[1] == 0) sublo[1] -= epsilon[1];
if (comm->myloc[1] == comm->procgrid[1]-1) subhi[1] -= 2.0*epsilon[1];
}
if (domain->zperiodic) {
if (comm->myloc[2] == 0) sublo[2] -= epsilon[2];
if (comm->myloc[2] == comm->procgrid[2]-1) subhi[2] -= 2.0*epsilon[2];
}
} else {
if (domain->xperiodic) {
if (comm->mysplit[0][0] == 0.0) sublo[0] -= epsilon[0];
if (comm->mysplit[0][1] == 1.0) subhi[0] -= 2.0*epsilon[0];
}
if (domain->yperiodic) {
if (comm->mysplit[1][0] == 0.0) sublo[1] -= epsilon[1];
if (comm->mysplit[1][1] == 1.0) subhi[1] -= 2.0*epsilon[1];
}
if (domain->zperiodic) {
if (comm->mysplit[2][0] == 0.0) sublo[2] -= epsilon[2];
if (comm->mysplit[2][1] == 1.0) subhi[2] -= 2.0*epsilon[2];
}
}
}
+ // clear ghost count and any ghost bonus data internal to AtomVec
+ // same logic as beginning of Comm::exchange()
+ // do it now b/c creating atoms will overwrite ghost atoms
+
+ atom->nghost = 0;
+ atom->avec->clear_bonus();
+
// add atoms/molecules in one of 3 ways
bigint natoms_previous = atom->natoms;
int nlocal_previous = atom->nlocal;
if (style == SINGLE) add_single();
else if (style == RANDOM) add_random();
else add_lattice();
// invoke set_arrays() for fixes/computes/variables
// that need initialization of attributes of new atoms
// don't use modify->create_attributes() since would be inefficient
// for large number of atoms
// note that for typical early use of create_atoms,
// no fixes/computes/variables exist yet
int nlocal = atom->nlocal;
for (int m = 0; m < modify->nfix; m++) {
Fix *fix = modify->fix[m];
if (fix->create_attribute)
for (int i = nlocal_previous; i < nlocal; i++)
fix->set_arrays(i);
}
for (int m = 0; m < modify->ncompute; m++) {
Compute *compute = modify->compute[m];
if (compute->create_attribute)
for (int i = nlocal_previous; i < nlocal; i++)
compute->set_arrays(i);
}
for (int i = nlocal_previous; i < nlocal; i++)
input->variable->set_arrays(i);
// restore each equal variable string previously saved
if (varflag) {
if (xstr) input->variable->equal_restore(xvar,xstr_copy);
if (ystr) input->variable->equal_restore(yvar,ystr_copy);
if (zstr) input->variable->equal_restore(zvar,zstr_copy);
}
// set new total # of atoms and error check
bigint nblocal = atom->nlocal;
MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (atom->natoms < 0 || atom->natoms >= MAXBIGINT)
error->all(FLERR,"Too many total atoms");
// add IDs for newly created atoms
// check that atom IDs are valid
if (atom->tag_enable) atom->tag_extend();
atom->tag_check();
- // create global mapping of atoms
- // zero nghost in case are adding new atoms to existing atoms
+ // if global map exists, reset it
+ // invoke map_init() b/c atom count has grown
if (atom->map_style) {
- atom->nghost = 0;
atom->map_init();
atom->map_set();
}
// for MOLECULE mode:
- // set molecule IDs for created atoms if used
- // reset new molecule bond,angle,etc and special values
+ // molecule can mean just a mol ID or bonds/angles/etc or mol templates
+ // set molecule IDs for created atoms if atom->molecule_flag is set
+ // reset new molecule bond,angle,etc and special values if defined
// send atoms to new owning procs via irregular comm
// since not all atoms I created will be within my sub-domain
// perform special list build if needed
if (mode == MOLECULE) {
+ int molecule_flag = atom->molecule_flag;
+ int molecular = atom->molecular;
+ tagint *molecule = atom->molecule;
+
// molcreate = # of molecules I created
int molcreate = (atom->nlocal - nlocal_previous) / onemol->natoms;
// increment total bonds,angles,etc
bigint nmolme = molcreate;
bigint nmoltotal;
MPI_Allreduce(&nmolme,&nmoltotal,1,MPI_LMP_BIGINT,MPI_SUM,world);
atom->nbonds += nmoltotal * onemol->nbonds;
atom->nangles += nmoltotal * onemol->nangles;
atom->ndihedrals += nmoltotal * onemol->ndihedrals;
atom->nimpropers += nmoltotal * onemol->nimpropers;
// if atom style template
// maxmol = max molecule ID across all procs, for previous atoms
// moloffset = max molecule ID for all molecules owned by previous procs
// including molecules existing before this creation
tagint moloffset;
- tagint *molecule = atom->molecule;
- if (molecule) {
+ if (molecule_flag) {
tagint max = 0;
for (int i = 0; i < nlocal_previous; i++) max = MAX(max,molecule[i]);
tagint maxmol;
MPI_Allreduce(&max,&maxmol,1,MPI_LMP_TAGINT,MPI_MAX,world);
MPI_Scan(&molcreate,&moloffset,1,MPI_INT,MPI_SUM,world);
moloffset = moloffset - molcreate + maxmol;
}
// loop over molecules I created
// set their molecule ID
// reset their bond,angle,etc and special values
int natoms = onemol->natoms;
tagint offset = 0;
tagint *tag = atom->tag;
int *num_bond = atom->num_bond;
int *num_angle = atom->num_angle;
int *num_dihedral = atom->num_dihedral;
int *num_improper = atom->num_improper;
tagint **bond_atom = atom->bond_atom;
tagint **angle_atom1 = atom->angle_atom1;
tagint **angle_atom2 = atom->angle_atom2;
tagint **angle_atom3 = atom->angle_atom3;
tagint **dihedral_atom1 = atom->dihedral_atom1;
tagint **dihedral_atom2 = atom->dihedral_atom2;
tagint **dihedral_atom3 = atom->dihedral_atom3;
tagint **dihedral_atom4 = atom->dihedral_atom4;
tagint **improper_atom1 = atom->improper_atom1;
tagint **improper_atom2 = atom->improper_atom2;
tagint **improper_atom3 = atom->improper_atom3;
tagint **improper_atom4 = atom->improper_atom4;
int **nspecial = atom->nspecial;
tagint **special = atom->special;
- int molecular = atom->molecular;
int ilocal = nlocal_previous;
for (int i = 0; i < molcreate; i++) {
if (tag) offset = tag[ilocal]-1;
for (int m = 0; m < natoms; m++) {
- if (molecular) molecule[ilocal] = moloffset + i+1;
+ if (molecule_flag) molecule[ilocal] = moloffset + i+1;
if (molecular == 2) {
atom->molindex[ilocal] = 0;
atom->molatom[ilocal] = m;
} else if (molecular) {
if (onemol->bondflag)
for (int j = 0; j < num_bond[ilocal]; j++)
bond_atom[ilocal][j] += offset;
if (onemol->angleflag)
for (int j = 0; j < num_angle[ilocal]; j++) {
angle_atom1[ilocal][j] += offset;
angle_atom2[ilocal][j] += offset;
angle_atom3[ilocal][j] += offset;
}
if (onemol->dihedralflag)
for (int j = 0; j < num_dihedral[ilocal]; j++) {
dihedral_atom1[ilocal][j] += offset;
dihedral_atom2[ilocal][j] += offset;
dihedral_atom3[ilocal][j] += offset;
dihedral_atom4[ilocal][j] += offset;
}
if (onemol->improperflag)
for (int j = 0; j < num_improper[ilocal]; j++) {
improper_atom1[ilocal][j] += offset;
improper_atom2[ilocal][j] += offset;
improper_atom3[ilocal][j] += offset;
improper_atom4[ilocal][j] += offset;
}
if (onemol->specialflag)
for (int j = 0; j < nspecial[ilocal][2]; j++)
special[ilocal][j] += offset;
}
ilocal++;
}
}
// perform irregular comm to migrate atoms to new owning procs
double **x = atom->x;
imageint *image = atom->image;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) domain->remap(x[i],image[i]);
if (domain->triclinic) domain->x2lamda(atom->nlocal);
domain->reset_box();
Irregular *irregular = new Irregular(lmp);
irregular->migrate_atoms(1);
delete irregular;
if (domain->triclinic) domain->lamda2x(atom->nlocal);
}
// clean up
delete ranmol;
if (domain->lattice) delete [] basistype;
delete [] vstr;
delete [] xstr;
delete [] ystr;
delete [] zstr;
// print status
if (comm->me == 0) {
if (screen)
fprintf(screen,"Created " BIGINT_FORMAT " atoms\n",
atom->natoms-natoms_previous);
if (logfile)
fprintf(logfile,"Created " BIGINT_FORMAT " atoms\n",
atom->natoms-natoms_previous);
}
// for MOLECULE mode:
// create special bond lists for molecular systems,
// but not for atom style template
// only if onemol added bonds but not special info
if (mode == MOLECULE) {
if (atom->molecular == 1 && onemol->bondflag && !onemol->specialflag) {
Special special(lmp);
special.build();
}
}
}
/* ----------------------------------------------------------------------
add single atom with coords at xone if it's in my sub-box
if triclinic, xone is in lamda coords
------------------------------------------------------------------------- */
void CreateAtoms::add_single()
{
// remap atom if requested
if (remapflag) {
imageint imagetmp = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
domain->remap(xone,imagetmp);
}
// if triclinic, convert to lamda coords (0-1)
double lamda[3],*coord;
if (triclinic) {
domain->x2lamda(xone,lamda);
coord = lamda;
} else coord = xone;
// if atom/molecule is in my subbox, create it
if (coord[0] >= sublo[0] && coord[0] < subhi[0] &&
coord[1] >= sublo[1] && coord[1] < subhi[1] &&
coord[2] >= sublo[2] && coord[2] < subhi[2]) {
if (mode == ATOM) atom->avec->create_atom(ntype,xone);
else if (quatone[0] == 0.0 && quatone[1] == 0.0 && quatone[2] == 0.0)
add_molecule(xone);
- else add_molecule(xone,&quatone[0]);
+ else add_molecule(xone,quatone);
}
}
/* ----------------------------------------------------------------------
add Nrandom atoms at random locations
------------------------------------------------------------------------- */
void CreateAtoms::add_random()
{
double xlo,ylo,zlo,xhi,yhi,zhi,zmid;
double lamda[3],*coord;
double *boxlo,*boxhi;
// random number generator, same for all procs
RanPark *random = new RanPark(lmp,seed);
// bounding box for atom creation
// in real units, even if triclinic
// only limit bbox by region if its bboxflag is set (interior region)
if (triclinic == 0) {
xlo = domain->boxlo[0]; xhi = domain->boxhi[0];
ylo = domain->boxlo[1]; yhi = domain->boxhi[1];
zlo = domain->boxlo[2]; zhi = domain->boxhi[2];
zmid = zlo + 0.5*(zhi-zlo);
} else {
xlo = domain->boxlo_bound[0]; xhi = domain->boxhi_bound[0];
ylo = domain->boxlo_bound[1]; yhi = domain->boxhi_bound[1];
zlo = domain->boxlo_bound[2]; zhi = domain->boxhi_bound[2];
zmid = zlo + 0.5*(zhi-zlo);
boxlo = domain->boxlo_lamda;
boxhi = domain->boxhi_lamda;
}
if (nregion >= 0 && domain->regions[nregion]->bboxflag) {
xlo = MAX(xlo,domain->regions[nregion]->extent_xlo);
xhi = MIN(xhi,domain->regions[nregion]->extent_xhi);
ylo = MAX(ylo,domain->regions[nregion]->extent_ylo);
yhi = MIN(yhi,domain->regions[nregion]->extent_yhi);
zlo = MAX(zlo,domain->regions[nregion]->extent_zlo);
zhi = MIN(zhi,domain->regions[nregion]->extent_zhi);
}
// generate random positions for each new atom/molecule within bounding box
// iterate until atom is within region, variable, and triclinic simulation box
// if final atom position is in my subbox, create it
if (xlo > xhi || ylo > yhi || zlo > zhi)
error->all(FLERR,"No overlap of box and region for create_atoms");
int valid;
for (int i = 0; i < nrandom; i++) {
while (1) {
xone[0] = xlo + random->uniform() * (xhi-xlo);
xone[1] = ylo + random->uniform() * (yhi-ylo);
xone[2] = zlo + random->uniform() * (zhi-zlo);
if (domain->dimension == 2) xone[2] = zmid;
valid = 1;
if (nregion >= 0 &&
domain->regions[nregion]->match(xone[0],xone[1],xone[2]) == 0)
valid = 0;
if (varflag && vartest(xone) == 0) valid = 0;
if (triclinic) {
domain->x2lamda(xone,lamda);
coord = lamda;
if (coord[0] < boxlo[0] || coord[0] >= boxhi[0] ||
coord[1] < boxlo[1] || coord[1] >= boxhi[1] ||
coord[2] < boxlo[2] || coord[2] >= boxhi[2]) valid = 0;
} else coord = xone;
if (valid) break;
}
// if triclinic, coord is now in lamda units
if (coord[0] >= sublo[0] && coord[0] < subhi[0] &&
coord[1] >= sublo[1] && coord[1] < subhi[1] &&
coord[2] >= sublo[2] && coord[2] < subhi[2]) {
if (mode == ATOM) atom->avec->create_atom(ntype,xone);
else add_molecule(xone);
}
}
// clean-up
delete random;
}
/* ----------------------------------------------------------------------
add many atoms by looping over lattice
------------------------------------------------------------------------- */
void CreateAtoms::add_lattice()
{
// convert 8 corners of my subdomain from box coords to lattice coords
// for orthogonal, use corner pts of my subbox
// for triclinic, use bounding box of my subbox
// xyz min to max = bounding box around the domain corners in lattice space
double bboxlo[3],bboxhi[3];
if (triclinic == 0) {
bboxlo[0] = domain->sublo[0]; bboxhi[0] = domain->subhi[0];
bboxlo[1] = domain->sublo[1]; bboxhi[1] = domain->subhi[1];
bboxlo[2] = domain->sublo[2]; bboxhi[2] = domain->subhi[2];
} else domain->bbox(domain->sublo_lamda,domain->subhi_lamda,bboxlo,bboxhi);
double xmin,ymin,zmin,xmax,ymax,zmax;
xmin = ymin = zmin = BIG;
xmax = ymax = zmax = -BIG;
domain->lattice->bbox(1,bboxlo[0],bboxlo[1],bboxlo[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxhi[0],bboxlo[1],bboxlo[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxlo[0],bboxhi[1],bboxlo[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxhi[0],bboxhi[1],bboxlo[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxlo[0],bboxlo[1],bboxhi[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxhi[0],bboxlo[1],bboxhi[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxlo[0],bboxhi[1],bboxhi[2],
xmin,ymin,zmin,xmax,ymax,zmax);
domain->lattice->bbox(1,bboxhi[0],bboxhi[1],bboxhi[2],
xmin,ymin,zmin,xmax,ymax,zmax);
// ilo:ihi,jlo:jhi,klo:khi = loop bounds for lattice overlap of my subbox
// overlap = any part of a unit cell (face,edge,pt) in common with my subbox
// in lattice space, subbox is a tilted box
// but bbox of subbox is aligned with lattice axes
// so ilo:khi unit cells should completely tile bounding box
// decrement lo, increment hi to avoid round-off issues in lattice->bbox(),
// which can lead to missing atoms in rare cases
// extra decrement of lo if min < 0, since static_cast(-1.5) = -1
int ilo,ihi,jlo,jhi,klo,khi;
ilo = static_cast<int> (xmin) - 1;
jlo = static_cast<int> (ymin) - 1;
klo = static_cast<int> (zmin) - 1;
ihi = static_cast<int> (xmax) + 1;
jhi = static_cast<int> (ymax) + 1;
khi = static_cast<int> (zmax) + 1;
if (xmin < 0.0) ilo--;
if (ymin < 0.0) jlo--;
if (zmin < 0.0) klo--;
// iterate on 3d periodic lattice of unit cells using loop bounds
// iterate on nbasis atoms in each unit cell
// convert lattice coords to box coords
// add atom or molecule (on each basis point) if it meets all criteria
double **basis = domain->lattice->basis;
double x[3],lamda[3];
double *coord;
int i,j,k,m;
for (k = klo; k <= khi; k++)
for (j = jlo; j <= jhi; j++)
for (i = ilo; i <= ihi; i++)
for (m = 0; m < nbasis; m++) {
x[0] = i + basis[m][0];
x[1] = j + basis[m][1];
x[2] = k + basis[m][2];
// convert from lattice coords to box coords
domain->lattice->lattice2box(x[0],x[1],x[2]);
// if a region was specified, test if atom is in it
if (style == REGION)
if (!domain->regions[nregion]->match(x[0],x[1],x[2])) continue;
// if variable test specified, eval variable
if (varflag && vartest(x) == 0) continue;
// test if atom/molecule position is in my subbox
if (triclinic) {
domain->x2lamda(x,lamda);
coord = lamda;
} else coord = x;
if (coord[0] < sublo[0] || coord[0] >= subhi[0] ||
coord[1] < sublo[1] || coord[1] >= subhi[1] ||
coord[2] < sublo[2] || coord[2] >= subhi[2]) continue;
// add the atom or entire molecule to my list of atoms
if (mode == ATOM) atom->avec->create_atom(basistype[m],x);
else add_molecule(x);
}
}
/* ----------------------------------------------------------------------
add a randomly rotated molecule with its center at center
if quat_user set, perform requested rotation
------------------------------------------------------------------------- */
void CreateAtoms::add_molecule(double *center, double *quat_user)
{
int n;
double r[3],rotmat[3][3],quat[4],xnew[3];
- if (domain->dimension == 3) {
- r[0] = ranmol->uniform() - 0.5;
- r[1] = ranmol->uniform() - 0.5;
- r[2] = ranmol->uniform() - 0.5;
- } else {
- r[0] = r[1] = 0.0;
- r[2] = 1.0;
- }
-
if (quat_user) {
quat[0] = quat_user[0]; quat[1] = quat_user[1];
quat[2] = quat_user[2]; quat[3] = quat_user[3];
} else {
- double theta = ranmol->uniform() * MY_2PI;
+ if (domain->dimension == 3) {
+ r[0] = ranmol->uniform() - 0.5;
+ r[1] = ranmol->uniform() - 0.5;
+ r[2] = ranmol->uniform() - 0.5;
+ } else {
+ r[0] = r[1] = 0.0;
+ r[2] = 1.0;
+ }
MathExtra::norm3(r);
+ double theta = ranmol->uniform() * MY_2PI;
MathExtra::axisangle_to_quat(r,theta,quat);
}
+
MathExtra::quat_to_mat(quat,rotmat);
+ onemol->quat_external = quat;
// create atoms in molecule with atom ID = 0 and mol ID = 0
// reset in caller after all moleclues created by all procs
// pass add_molecule_atom an offset of 0 since don't know
// max tag of atoms in previous molecules at this point
int natoms = onemol->natoms;
for (int m = 0; m < natoms; m++) {
MathExtra::matvec(rotmat,onemol->dx[m],xnew);
MathExtra::add3(xnew,center,xnew);
atom->avec->create_atom(ntype+onemol->type[m],xnew);
n = atom->nlocal - 1;
atom->add_molecule_atom(onemol,m,n,0);
}
atom->nbonds += onemol->nbonds;
atom->nangles += onemol->nangles;
atom->ndihedrals += onemol->ndihedrals;
atom->nimpropers += onemol->nimpropers;
}
/* ----------------------------------------------------------------------
test a generated atom position against variable evaluation
first plug in x,y,z values as requested
------------------------------------------------------------------------- */
int CreateAtoms::vartest(double *x)
{
if (xstr) input->variable->equal_override(xvar,x[0]);
if (ystr) input->variable->equal_override(yvar,x[1]);
if (zstr) input->variable->equal_override(zvar,x[2]);
double value = input->variable->compute_equal(vvar);
if (value == 0.0) return 0;
return 1;
}
diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp
index 3c86702a9..8d2e50164 100644
--- a/src/displace_atoms.cpp
+++ b/src/displace_atoms.cpp
@@ -1,340 +1,402 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <mpi.h>
#include <stdlib.h>
#include <string.h>
#include "displace_atoms.h"
#include "atom.h"
#include "modify.h"
#include "domain.h"
#include "lattice.h"
#include "comm.h"
#include "irregular.h"
#include "group.h"
#include "math_const.h"
#include "random_park.h"
-#include "error.h"
#include "force.h"
#include "input.h"
#include "variable.h"
+#include "atom_vec_ellipsoid.h"
+#include "atom_vec_line.h"
+#include "atom_vec_tri.h"
+#include "atom_vec_body.h"
+#include "math_extra.h"
#include "memory.h"
+#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
enum{MOVE,RAMP,RANDOM,ROTATE};
/* ---------------------------------------------------------------------- */
DisplaceAtoms::DisplaceAtoms(LAMMPS *lmp) : Pointers(lmp)
{
mvec = NULL;
}
/* ---------------------------------------------------------------------- */
DisplaceAtoms::~DisplaceAtoms()
{
memory->destroy(mvec);
}
/* ---------------------------------------------------------------------- */
void DisplaceAtoms::command(int narg, char **arg)
{
int i;
if (domain->box_exist == 0)
error->all(FLERR,"Displace_atoms command before simulation box is defined");
if (narg < 2) error->all(FLERR,"Illegal displace_atoms command");
if (modify->nfix_restart_peratom)
error->all(FLERR,"Cannot displace_atoms after "
"reading restart file with per-atom info");
if (comm->me == 0 && screen) fprintf(screen,"Displacing atoms ...\n");
// group and style
igroup = group->find(arg[0]);
if (igroup == -1) error->all(FLERR,"Could not find displace_atoms group ID");
groupbit = group->bitmask[igroup];
int style = -1;
if (strcmp(arg[1],"move") == 0) style = MOVE;
else if (strcmp(arg[1],"ramp") == 0) style = RAMP;
else if (strcmp(arg[1],"random") == 0) style = RANDOM;
else if (strcmp(arg[1],"rotate") == 0) style = ROTATE;
else error->all(FLERR,"Illegal displace_atoms command");
// set option defaults
scaleflag = 1;
// read options from end of input line
if (style == MOVE) options(narg-5,&arg[5]);
else if (style == RAMP) options(narg-8,&arg[8]);
else if (style == RANDOM) options(narg-6,&arg[6]);
else if (style == ROTATE) options(narg-9,&arg[9]);
// setup scaling
double xscale,yscale,zscale;
if (scaleflag) {
xscale = domain->lattice->xlattice;
yscale = domain->lattice->ylattice;
zscale = domain->lattice->zlattice;
}
else xscale = yscale = zscale = 1.0;
// move atoms by 3-vector or specified variable(s)
if (style == MOVE) {
move(0,arg[2],xscale);
move(1,arg[3],yscale);
move(2,arg[4],zscale);
}
// move atoms in ramped fashion
if (style == RAMP) {
int d_dim;
if (strcmp(arg[2],"x") == 0) d_dim = 0;
else if (strcmp(arg[2],"y") == 0) d_dim = 1;
else if (strcmp(arg[2],"z") == 0) d_dim = 2;
else error->all(FLERR,"Illegal displace_atoms ramp command");
double d_lo,d_hi;
if (d_dim == 0) {
d_lo = xscale*force->numeric(FLERR,arg[3]);
d_hi = xscale*force->numeric(FLERR,arg[4]);
} else if (d_dim == 1) {
d_lo = yscale*force->numeric(FLERR,arg[3]);
d_hi = yscale*force->numeric(FLERR,arg[4]);
} else if (d_dim == 2) {
d_lo = zscale*force->numeric(FLERR,arg[3]);
d_hi = zscale*force->numeric(FLERR,arg[4]);
}
int coord_dim;
if (strcmp(arg[5],"x") == 0) coord_dim = 0;
else if (strcmp(arg[5],"y") == 0) coord_dim = 1;
else if (strcmp(arg[5],"z") == 0) coord_dim = 2;
else error->all(FLERR,"Illegal displace_atoms ramp command");
double coord_lo,coord_hi;
if (coord_dim == 0) {
coord_lo = xscale*force->numeric(FLERR,arg[6]);
coord_hi = xscale*force->numeric(FLERR,arg[7]);
} else if (coord_dim == 1) {
coord_lo = yscale*force->numeric(FLERR,arg[6]);
coord_hi = yscale*force->numeric(FLERR,arg[7]);
} else if (coord_dim == 2) {
coord_lo = zscale*force->numeric(FLERR,arg[6]);
coord_hi = zscale*force->numeric(FLERR,arg[7]);
}
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double fraction,dramp;
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
fraction = (x[i][coord_dim] - coord_lo) / (coord_hi - coord_lo);
fraction = MAX(fraction,0.0);
fraction = MIN(fraction,1.0);
dramp = d_lo + fraction*(d_hi - d_lo);
x[i][d_dim] += dramp;
}
}
}
// move atoms randomly
// makes atom result independent of what proc owns it via random->reset()
if (style == RANDOM) {
RanPark *random = new RanPark(lmp,1);
double dx = xscale*force->numeric(FLERR,arg[2]);
double dy = yscale*force->numeric(FLERR,arg[3]);
double dz = zscale*force->numeric(FLERR,arg[4]);
int seed = force->inumeric(FLERR,arg[5]);
if (seed <= 0) error->all(FLERR,"Illegal displace_atoms random command");
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
random->reset(seed,x[i]);
x[i][0] += dx * 2.0*(random->uniform()-0.5);
x[i][1] += dy * 2.0*(random->uniform()-0.5);
x[i][2] += dz * 2.0*(random->uniform()-0.5);
}
}
delete random;
}
// rotate atoms by right-hand rule by theta around R
// P = point = vector = point of rotation
// R = vector = axis of rotation
// R0 = runit = unit vector for R
// D = X - P = vector from P to X
// C = (D dot R0) R0 = projection of atom coord onto R line
// A = D - C = vector from R line to X
// B = R0 cross A = vector perp to A in plane of rotation
// A,B define plane of circular rotation around R line
// X = P + C + A cos(theta) + B sin(theta)
if (style == ROTATE) {
- double axis[3],point[3];
+ double theta_new;
+ double axis[3],point[3],qrotate[4],qnew[4];
double a[3],b[3],c[3],d[3],disp[3],runit[3];
+ double *quat;
int dim = domain->dimension;
point[0] = xscale*force->numeric(FLERR,arg[2]);
point[1] = yscale*force->numeric(FLERR,arg[3]);
point[2] = zscale*force->numeric(FLERR,arg[4]);
axis[0] = force->numeric(FLERR,arg[5]);
axis[1] = force->numeric(FLERR,arg[6]);
axis[2] = force->numeric(FLERR,arg[7]);
double theta = force->numeric(FLERR,arg[8]);
if (dim == 2 && (axis[0] != 0.0 || axis[1] != 0.0))
error->all(FLERR,"Invalid displace_atoms rotate axis for 2d");
double len = sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]);
if (len == 0.0)
error->all(FLERR,"Zero length rotation vector with displace_atoms");
runit[0] = axis[0]/len;
runit[1] = axis[1]/len;
runit[2] = axis[2]/len;
- double sine = sin(MY_PI*theta/180.0);
- double cosine = cos(MY_PI*theta/180.0);
+ double angle = MY_PI*theta/180.0;
+ double sine = sin(angle);
+ double cosine = cos(angle);
double ddotr;
+ // flags for additional orientation info stored by some atom styles
+
+ int ellipsoid_flag = atom->ellipsoid_flag;
+ int line_flag = atom->line_flag;
+ int tri_flag = atom->tri_flag;
+ int body_flag = atom->body_flag;
+
+ int theta_flag = 0;
+ int quat_flag = 0;
+ if (line_flag) theta_flag = 1;
+ if (ellipsoid_flag || tri_flag || body_flag) quat_flag = 1;
+
+ // AtomVec pointers to retrieve per-atom storage of extra quantities
+
+ AtomVecEllipsoid *avec_ellipsoid =
+ (AtomVecEllipsoid *) atom->style_match("ellipsoid");
+ AtomVecLine *avec_line = (AtomVecLine *) atom->style_match("line");
+ AtomVecTri *avec_tri = (AtomVecTri *) atom->style_match("tri");
+ AtomVecBody *avec_body = (AtomVecBody *) atom->style_match("body");
+
double **x = atom->x;
+ int *ellipsoid = atom->ellipsoid;
+ int *line = atom->line;
+ int *tri = atom->tri;
+ int *body = atom->body;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
d[0] = x[i][0] - point[0];
d[1] = x[i][1] - point[1];
d[2] = x[i][2] - point[2];
ddotr = d[0]*runit[0] + d[1]*runit[1] + d[2]*runit[2];
c[0] = ddotr*runit[0];
c[1] = ddotr*runit[1];
c[2] = ddotr*runit[2];
a[0] = d[0] - c[0];
a[1] = d[1] - c[1];
a[2] = d[2] - c[2];
b[0] = runit[1]*a[2] - runit[2]*a[1];
b[1] = runit[2]*a[0] - runit[0]*a[2];
b[2] = runit[0]*a[1] - runit[1]*a[0];
disp[0] = a[0]*cosine + b[0]*sine;
disp[1] = a[1]*cosine + b[1]*sine;
disp[2] = a[2]*cosine + b[2]*sine;
x[i][0] = point[0] + c[0] + disp[0];
x[i][1] = point[1] + c[1] + disp[1];
if (dim == 3) x[i][2] = point[2] + c[2] + disp[2];
+
+ // theta for lines
+
+ if (theta_flag && line[i] >= 0.0) {
+ theta_new = fmod(avec_line->bonus[line[i]].theta+angle,MY_2PI);
+ avec_line->bonus[atom->line[i]].theta = theta_new;
+ }
+
+ // quats for ellipsoids, tris, and bodies
+
+ if (quat_flag) {
+ quat = NULL;
+ if (ellipsoid_flag && ellipsoid[i] >= 0)
+ quat = avec_ellipsoid->bonus[ellipsoid[i]].quat;
+ else if (tri_flag && tri[i] >= 0)
+ quat = avec_tri->bonus[tri[i]].quat;
+ else if (body_flag && body[i] >= 0)
+ quat = avec_body->bonus[body[i]].quat;
+ if (quat) {
+ qrotate[0] = cosine;
+ qrotate[1] = runit[0]*sine;
+ qrotate[2] = runit[1]*sine;
+ qrotate[3] = runit[2]*sine;
+ MathExtra::quatquat(qrotate,quat,qnew);
+ quat[0] = qnew[0];
+ quat[1] = qnew[1];
+ quat[2] = qnew[2];
+ quat[3] = qnew[3];
+ }
+ }
}
}
}
// move atoms back inside simulation box and to new processors
// use remap() instead of pbc() in case atoms moved a long distance
// use irregular() in case atoms moved a long distance
double **x = atom->x;
imageint *image = atom->image;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++) domain->remap(x[i],image[i]);
if (domain->triclinic) domain->x2lamda(atom->nlocal);
domain->reset_box();
Irregular *irregular = new Irregular(lmp);
irregular->migrate_atoms(1);
delete irregular;
if (domain->triclinic) domain->lamda2x(atom->nlocal);
// check if any atoms were lost
bigint natoms;
bigint nblocal = atom->nlocal;
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (natoms != atom->natoms && comm->me == 0) {
char str[128];
sprintf(str,"Lost atoms via displace_atoms: original " BIGINT_FORMAT
" current " BIGINT_FORMAT,atom->natoms,natoms);
error->warning(FLERR,str);
}
}
/* ----------------------------------------------------------------------
move atoms either by specified numeric displacement or variable evaluation
------------------------------------------------------------------------- */
void DisplaceAtoms::move(int idim, char *arg, double scale)
{
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (strstr(arg,"v_") != arg) {
double delta = scale*force->numeric(FLERR,arg);
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) x[i][idim] += delta;
} else {
int ivar = input->variable->find(arg+2);
if (ivar < 0)
error->all(FLERR,"Variable name for displace_atoms does not exist");
if (input->variable->equalstyle(ivar)) {
double delta = scale * input->variable->compute_equal(ivar);
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) x[i][idim] += delta;
} else if (input->variable->atomstyle(ivar)) {
if (mvec == NULL) memory->create(mvec,nlocal,"displace_atoms:mvec");
input->variable->compute_atom(ivar,igroup,mvec,1,0);
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) x[i][idim] += scale*mvec[i];
} else error->all(FLERR,"Variable for displace_atoms is invalid style");
}
}
/* ----------------------------------------------------------------------
parse optional parameters at end of displace_atoms input line
------------------------------------------------------------------------- */
void DisplaceAtoms::options(int narg, char **arg)
{
if (narg < 0) error->all(FLERR,"Illegal displace_atoms command");
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"units") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal displace_atoms command");
if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
else error->all(FLERR,"Illegal displace_atoms command");
iarg += 2;
} else error->all(FLERR,"Illegal displace_atoms command");
}
}
diff --git a/src/dump_image.cpp b/src/dump_image.cpp
index fa0fa12be..e587e661c 100644
--- a/src/dump_image.cpp
+++ b/src/dump_image.cpp
@@ -1,1178 +1,1304 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "dump_image.h"
#include "image.h"
#include "atom.h"
-#include "atom_vec.h"
+#include "atom_vec_line.h"
+#include "atom_vec_tri.h"
#include "atom_vec_body.h"
#include "body.h"
#include "molecule.h"
#include "domain.h"
#include "group.h"
#include "force.h"
#include "comm.h"
#include "input.h"
#include "variable.h"
#include "math_const.h"
+#include "math_extra.h"
#include "error.h"
#include "memory.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define BIG 1.0e20
enum{NUMERIC,ATOM,TYPE,ELEMENT,ATTRIBUTE};
enum{SPHERE,LINE}; // also in Body child classes
enum{STATIC,DYNAMIC};
enum{NO,YES};
/* ---------------------------------------------------------------------- */
DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
DumpCustom(lmp, narg, arg)
{
if (binary || multiproc) error->all(FLERR,"Invalid dump image filename");
// force binary flag on to avoid corrupted output on Windows
binary = 1;
multifile_override = 0;
// set filetype based on filename suffix
int n = strlen(filename);
if (strlen(filename) > 4 && strcmp(&filename[n-4],".jpg") == 0)
filetype = JPG;
else if (strlen(filename) > 4 && strcmp(&filename[n-4],".JPG") == 0)
filetype = JPG;
else if (strlen(filename) > 5 && strcmp(&filename[n-5],".jpeg") == 0)
filetype = JPG;
else if (strlen(filename) > 5 && strcmp(&filename[n-5],".JPEG") == 0)
filetype = JPG;
else if (strlen(filename) > 4 && strcmp(&filename[n-4],".png") == 0)
filetype = PNG;
else if (strlen(filename) > 4 && strcmp(&filename[n-4],".PNG") == 0)
filetype = PNG;
else filetype = PPM;
#ifndef LAMMPS_JPEG
if (filetype == JPG)
error->all(FLERR,"Support for writing images in JPEG format not included");
#endif
#ifndef LAMMPS_PNG
if (filetype == PNG)
error->all(FLERR,"Support for writing images in PNG format not included");
#endif
// atom color,diameter settings
if (nfield != 2) error->all(FLERR,"Illegal dump image command");
acolor = ATTRIBUTE;
if (strcmp(arg[5],"type") == 0) acolor = TYPE;
else if (strcmp(arg[5],"element") == 0) acolor = ELEMENT;
adiam = ATTRIBUTE;
if (strcmp(arg[6],"type") == 0) adiam = TYPE;
else if (strcmp(arg[6],"element") == 0) adiam = ELEMENT;
// create Image class with single colormap for atoms
// change defaults for 2d
image = new Image(lmp,1);
if (domain->dimension == 2) {
image->theta = 0.0;
image->phi = 0.0;
image->up[0] = 0.0; image->up[1] = 1.0; image->up[2] = 0.0;
}
// set defaults for optional args
atomflag = YES;
- bodyflag = NO;
+ lineflag = triflag = bodyflag = NO;
if (atom->nbondtypes == 0) bondflag = NO;
else {
bondflag = YES;
bcolor = ATOM;
bdiam = NUMERIC;
bdiamvalue = 0.5;
}
thetastr = phistr = NULL;
cflag = STATIC;
cx = cy = cz = 0.5;
cxstr = cystr = czstr = NULL;
upxstr = upystr = upzstr = NULL;
zoomstr = NULL;
perspstr = NULL;
boxflag = YES;
boxdiam = 0.02;
axesflag = NO;
subboxflag = NO;
// parse optional args
int iarg = ioptional;
while (iarg < narg) {
- if (strcmp(arg[iarg],"adiam") == 0) {
- if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
- adiam = NUMERIC;
- adiamvalue = force->numeric(FLERR,arg[iarg+1]);
- if (adiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
- iarg += 2;
-
- } else if (strcmp(arg[iarg],"atom") == 0) {
+ if (strcmp(arg[iarg],"atom") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
if (strcmp(arg[iarg+1],"yes") == 0) atomflag = YES;
else if (strcmp(arg[iarg+1],"no") == 0) atomflag = NO;
else error->all(FLERR,"Illegal dump image command");
iarg += 2;
- } else if (strcmp(arg[iarg],"body") == 0) {
- if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
- if (strcmp(arg[iarg+1],"yes") == 0) bodyflag = YES;
- else if (strcmp(arg[iarg+1],"no") == 0) bodyflag = NO;
- else error->all(FLERR,"Illegal dump image command");
- bodyflag1 = force->numeric(FLERR,arg[iarg+2]);
- bodyflag2 = force->numeric(FLERR,arg[iarg+3]);
- iarg += 4;
+ } else if (strcmp(arg[iarg],"adiam") == 0) {
+ if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
+ adiam = NUMERIC;
+ adiamvalue = force->numeric(FLERR,arg[iarg+1]);
+ if (adiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
+ iarg += 2;
} else if (strcmp(arg[iarg],"bond") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (atom->nbondtypes == 0)
error->all(FLERR,"Dump image bond not allowed with no bond types");
bondflag = YES;
if (strcmp(arg[iarg+1],"none") == 0) bondflag = NO;
else if (strcmp(arg[iarg+1],"atom") == 0) bcolor = ATOM;
else if (strcmp(arg[iarg+1],"type") == 0) bcolor = TYPE;
else error->all(FLERR,"Illegal dump image command");
if (!islower(arg[iarg+2][0])) {
bdiam = NUMERIC;
bdiamvalue = force->numeric(FLERR,arg[iarg+2]);
if (bdiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
} else if (strcmp(arg[iarg+2],"atom") == 0) bdiam = ATOM;
else if (strcmp(arg[iarg+2],"type") == 0) bdiam = TYPE;
else if (strcmp(arg[iarg+2],"none") == 0) bondflag = NO;
else error->all(FLERR,"Illegal dump image command");
iarg += 3;
+
+ } else if (strcmp(arg[iarg],"line") == 0) {
+ if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
+ lineflag = YES;
+ if (strcmp(arg[iarg+1],"type") == 0) lcolor = TYPE;
+ else error->all(FLERR,"Illegal dump image command");
+ ldiam = NUMERIC;
+ ldiamvalue = force->numeric(FLERR,arg[iarg+2]);
+ iarg += 3;
+
+ } else if (strcmp(arg[iarg],"tri") == 0) {
+ if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
+ triflag = YES;
+ if (strcmp(arg[iarg+1],"type") == 0) tcolor = TYPE;
+ else error->all(FLERR,"Illegal dump image command");
+ iarg += 2;
+
+ } else if (strcmp(arg[iarg],"body") == 0) {
+ if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
+ bodyflag = YES;
+ if (strcmp(arg[iarg+1],"type") == 0) bodycolor = TYPE;
+ else error->all(FLERR,"Illegal dump image command");
+ bodyflag1 = force->numeric(FLERR,arg[iarg+2]);
+ bodyflag2 = force->numeric(FLERR,arg[iarg+3]);
+ iarg += 4;
+
} else if (strcmp(arg[iarg],"size") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
int width = force->inumeric(FLERR,arg[iarg+1]);
int height = force->inumeric(FLERR,arg[iarg+2]);
if (width <= 0 || height <= 0)
error->all(FLERR,"Illegal dump image command");
image->width = width;
image->height = height;
iarg += 3;
} else if (strcmp(arg[iarg],"view") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
int n = strlen(&arg[iarg+1][2]) + 1;
thetastr = new char[n];
strcpy(thetastr,&arg[iarg+1][2]);
} else {
double theta = force->numeric(FLERR,arg[iarg+1]);
if (theta < 0.0 || theta > 180.0)
error->all(FLERR,"Invalid dump image theta value");
theta *= MY_PI/180.0;
image->theta = theta;
}
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
phistr = new char[n];
strcpy(phistr,&arg[iarg+2][2]);
} else {
double phi = force->numeric(FLERR,arg[iarg+2]);
phi *= MY_PI/180.0;
image->phi = phi;
}
iarg += 3;
} else if (strcmp(arg[iarg],"center") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal dump image command");
if (strcmp(arg[iarg+1],"s") == 0) cflag = STATIC;
else if (strcmp(arg[iarg+1],"d") == 0) cflag = DYNAMIC;
else error->all(FLERR,"Illegal dump image command");
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
cxstr = new char[n];
strcpy(cxstr,&arg[iarg+2][2]);
cflag = DYNAMIC;
} else cx = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
cystr = new char[n];
strcpy(cystr,&arg[iarg+3][2]);
cflag = DYNAMIC;
} else cy = force->numeric(FLERR,arg[iarg+3]);
if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
int n = strlen(&arg[iarg+4][2]) + 1;
czstr = new char[n];
strcpy(czstr,&arg[iarg+4][2]);
cflag = DYNAMIC;
} else cz = force->numeric(FLERR,arg[iarg+4]);
iarg += 5;
} else if (strcmp(arg[iarg],"up") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
int n = strlen(&arg[iarg+1][2]) + 1;
upxstr = new char[n];
strcpy(upxstr,&arg[iarg+1][2]);
} else image->up[0] = force->numeric(FLERR,arg[iarg+1]);
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
upystr = new char[n];
strcpy(upystr,&arg[iarg+2][2]);
} else image->up[1] = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
upzstr = new char[n];
strcpy(upzstr,&arg[iarg+3][2]);
} else image->up[2] = force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"zoom") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
int n = strlen(&arg[iarg+1][2]) + 1;
zoomstr = new char[n];
strcpy(zoomstr,&arg[iarg+1][2]);
} else {
double zoom = force->numeric(FLERR,arg[iarg+1]);
if (zoom <= 0.0) error->all(FLERR,"Illegal dump image command");
image->zoom = zoom;
}
iarg += 2;
} else if (strcmp(arg[iarg],"persp") == 0) {
error->all(FLERR,"Dump image persp option is not yet supported");
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
int n = strlen(&arg[iarg+1][2]) + 1;
perspstr = new char[n];
strcpy(perspstr,&arg[iarg+1][2]);
} else {
double persp = force->numeric(FLERR,arg[iarg+1]);
if (persp < 0.0) error->all(FLERR,"Illegal dump image command");
image->persp = persp;
}
iarg += 2;
} else if (strcmp(arg[iarg],"box") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (strcmp(arg[iarg+1],"yes") == 0) boxflag = YES;
else if (strcmp(arg[iarg+1],"no") == 0) boxflag = NO;
else error->all(FLERR,"Illegal dump image command");
boxdiam = force->numeric(FLERR,arg[iarg+2]);
if (boxdiam < 0.0) error->all(FLERR,"Illegal dump image command");
iarg += 3;
} else if (strcmp(arg[iarg],"axes") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (strcmp(arg[iarg+1],"yes") == 0) axesflag = YES;
else if (strcmp(arg[iarg+1],"no") == 0) axesflag = NO;
else error->all(FLERR,"Illegal dump image command");
axeslen = force->numeric(FLERR,arg[iarg+2]);
axesdiam = force->numeric(FLERR,arg[iarg+3]);
if (axeslen < 0.0 || axesdiam < 0.0)
error->all(FLERR,"Illegal dump image command");
iarg += 4;
} else if (strcmp(arg[iarg],"subbox") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (strcmp(arg[iarg+1],"yes") == 0) subboxflag = YES;
else if (strcmp(arg[iarg+1],"no") == 0) subboxflag = NO;
else error->all(FLERR,"Illegal dump image command");
subboxdiam = force->numeric(FLERR,arg[iarg+2]);
if (subboxdiam < 0.0) error->all(FLERR,"Illegal dump image command");
iarg += 3;
} else if (strcmp(arg[iarg],"shiny") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
double shiny = force->numeric(FLERR,arg[iarg+1]);
if (shiny < 0.0 || shiny > 1.0)
error->all(FLERR,"Illegal dump image command");
image->shiny = shiny;
iarg += 2;
} else if (strcmp(arg[iarg],"ssao") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
if (strcmp(arg[iarg+1],"yes") == 0) image->ssao = YES;
else if (strcmp(arg[iarg+1],"no") == 0) image->ssao = NO;
else error->all(FLERR,"Illegal dump image command");
int seed = force->inumeric(FLERR,arg[iarg+2]);
if (seed <= 0) error->all(FLERR,"Illegal dump image command");
image->seed = seed;
double ssaoint = force->numeric(FLERR,arg[iarg+3]);
if (ssaoint < 0.0 || ssaoint > 1.0)
error->all(FLERR,"Illegal dump image command");
image->ssaoint = ssaoint;
iarg += 4;
} else error->all(FLERR,"Illegal dump image command");
}
- // error check for bodyflag
+ // error checks and setup for lineflag, triflag, bodyflag
+ if (lineflag) {
+ avec_line = (AtomVecLine *) atom->style_match("line");
+ if (!avec_line)
+ error->all(FLERR,"Dump image line requires atom style line");
+ }
+ if (triflag) {
+ avec_tri = (AtomVecTri *) atom->style_match("tri");
+ if (!avec_tri)
+ error->all(FLERR,"Dump image tri requires atom style tri");
+ }
if (bodyflag) {
- AtomVecBody *avec = (AtomVecBody *) atom->style_match("body");
- if (!avec) error->all(FLERR,"Dump image body yes requires atom style body");
- bptr = avec->bptr;
+ avec_body = (AtomVecBody *) atom->style_match("body");
+ if (!avec_body)
+ error->all(FLERR,"Dump image body yes requires atom style body");
}
+ extraflag = 0;
+ if (lineflag || triflag || bodyflag) extraflag = 1;
+
// allocate image buffer now that image size is known
image->buffers();
// communication neede for bonds colored by atoms
if (bondflag) {
if (bcolor == ATOM || bdiam == ATOM) comm_forward = 3;
else comm_forward = 1;
}
// additional defaults for dump_modify options
diamtype = new double[ntypes+1];
diamelement = new double[ntypes+1];
colortype = new double*[ntypes+1];
colorelement = new double*[ntypes+1];
for (int i = 1; i <= ntypes; i++) {
diamtype[i] = 1.0;
if (i % 6 == 1) colortype[i] = image->color2rgb("red");
else if (i % 6 == 2) colortype[i] = image->color2rgb("green");
else if (i % 6 == 3) colortype[i] = image->color2rgb("blue");
else if (i % 6 == 4) colortype[i] = image->color2rgb("yellow");
else if (i % 6 == 5) colortype[i] = image->color2rgb("aqua");
else if (i % 6 == 0) colortype[i] = image->color2rgb("cyan");
}
if (bondflag) {
bdiamtype = new double[atom->nbondtypes+1];
bcolortype = new double*[atom->nbondtypes+1];
for (int i = 1; i <= atom->nbondtypes; i++) {
bdiamtype[i] = 0.5;
if (i % 6 == 1) bcolortype[i] = image->color2rgb("red");
else if (i % 6 == 2) bcolortype[i] = image->color2rgb("green");
else if (i % 6 == 3) bcolortype[i] = image->color2rgb("blue");
else if (i % 6 == 4) bcolortype[i] = image->color2rgb("yellow");
else if (i % 6 == 5) bcolortype[i] = image->color2rgb("aqua");
else if (i % 6 == 0) bcolortype[i] = image->color2rgb("cyan");
}
} else {
bdiamtype = NULL;
bcolortype = NULL;
}
// viewflag = DYNAMIC if any view parameter is dynamic
viewflag = STATIC;
if (thetastr || phistr || cflag == DYNAMIC ||
upxstr || upystr || upzstr || zoomstr || perspstr) viewflag = DYNAMIC;
box_bounds();
if (cflag == STATIC) box_center();
if (viewflag == STATIC) view_params();
// local data
maxbufcopy = 0;
chooseghost = NULL;
bufcopy = NULL;
}
/* ---------------------------------------------------------------------- */
DumpImage::~DumpImage()
{
delete image;
delete [] diamtype;
delete [] diamelement;
delete [] colortype;
delete [] colorelement;
delete [] bdiamtype;
delete [] bcolortype;
memory->destroy(chooseghost);
memory->destroy(bufcopy);
}
/* ---------------------------------------------------------------------- */
void DumpImage::init_style()
{
if (multifile == 0 && !multifile_override)
error->all(FLERR,"Dump image requires one snapshot per file");
if (sort_flag) error->all(FLERR,"Dump image cannot perform sorting");
DumpCustom::init_style();
// check variables
if (thetastr) {
thetavar = input->variable->find(thetastr);
if (thetavar < 0)
error->all(FLERR,"Variable name for dump image theta does not exist");
if (!input->variable->equalstyle(thetavar))
error->all(FLERR,"Variable for dump image theta is invalid style");
}
if (phistr) {
phivar = input->variable->find(phistr);
if (phivar < 0)
error->all(FLERR,"Variable name for dump image phi does not exist");
if (!input->variable->equalstyle(phivar))
error->all(FLERR,"Variable for dump image phi is invalid style");
}
if (cxstr) {
cxvar = input->variable->find(cxstr);
if (cxvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
if (!input->variable->equalstyle(cxvar))
error->all(FLERR,"Variable for dump image center is invalid style");
}
if (cystr) {
cyvar = input->variable->find(cystr);
if (cyvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
if (!input->variable->equalstyle(cyvar))
error->all(FLERR,"Variable for dump image center is invalid style");
}
if (czstr) {
czvar = input->variable->find(czstr);
if (czvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
if (!input->variable->equalstyle(czvar))
error->all(FLERR,"Variable for dump image center is invalid style");
}
if (upxstr) {
upxvar = input->variable->find(upxstr);
if (upxvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
if (!input->variable->equalstyle(upxvar))
error->all(FLERR,"Variable for dump image center is invalid style");
}
if (upystr) {
upyvar = input->variable->find(upystr);
if (upyvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
if (!input->variable->equalstyle(upyvar))
error->all(FLERR,"Variable for dump image center is invalid style");
}
if (upzstr) {
upzvar = input->variable->find(upzstr);
if (upzvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
if (!input->variable->equalstyle(upzvar))
error->all(FLERR,"Variable for dump image center is invalid style");
}
if (zoomstr) {
zoomvar = input->variable->find(zoomstr);
if (zoomvar < 0)
error->all(FLERR,"Variable name for dump image zoom does not exist");
if (!input->variable->equalstyle(zoomvar))
error->all(FLERR,"Variable for dump image zoom is invalid style");
}
if (perspstr) {
perspvar = input->variable->find(perspstr);
if (perspvar < 0)
error->all(FLERR,"Variable name for dump image persp does not exist");
if (!input->variable->equalstyle(perspvar))
error->all(FLERR,"Variable for dump image persp is invalid style");
}
// set up type -> element mapping
if (atomflag && acolor == ELEMENT) {
for (int i = 1; i <= ntypes; i++) {
colorelement[i] = image->element2color(typenames[i]);
if (colorelement[i] == NULL)
error->all(FLERR,"Invalid dump image element name");
}
}
if (atomflag && adiam == ELEMENT) {
for (int i = 1; i <= ntypes; i++) {
diamelement[i] = image->element2diam(typenames[i]);
if (diamelement[i] == 0.0)
error->all(FLERR,"Invalid dump image element name");
}
}
}
/* ---------------------------------------------------------------------- */
void DumpImage::write()
{
// open new file
openfile();
// reset box center and view parameters if dynamic
box_bounds();
if (cflag == DYNAMIC) box_center();
if (viewflag == DYNAMIC) view_params();
// nme = # of atoms this proc will contribute to dump
nme = count();
if (nme > maxbuf) {
maxbuf = nme;
memory->destroy(buf);
memory->create(buf,maxbuf*size_one,"dump:buf");
}
// pack buf with color & diameter
pack(NULL);
// set minmax color range if using dynamic atom color map
if (acolor == ATTRIBUTE && image->map_dynamic(0)) {
double two[2],twoall[2];
double lo = BIG;
double hi = -BIG;
int m = 0;
for (int i = 0; i < nchoose; i++) {
lo = MIN(lo,buf[m]);
hi = MAX(hi,buf[m]);
m += size_one;
}
two[0] = -lo;
two[1] = hi;
MPI_Allreduce(two,twoall,2,MPI_DOUBLE,MPI_MAX,world);
int flag = image->map_minmax(0,-twoall[0],twoall[1]);
if (flag) error->all(FLERR,"Invalid color map min/max values");
}
// create image on each proc, then merge them
image->clear();
create_image();
image->merge();
// write image file
if (me == 0) {
if (filetype == JPG) image->write_JPG(fp);
else if (filetype == PNG) image->write_PNG(fp);
else image->write_PPM(fp);
if (multifile) {
fclose(fp);
fp = NULL;
}
}
}
/* ----------------------------------------------------------------------
simulation box bounds
------------------------------------------------------------------------- */
void DumpImage::box_bounds()
{
if (domain->triclinic == 0) {
boxxlo = domain->boxlo[0];
boxxhi = domain->boxhi[0];
boxylo = domain->boxlo[1];
boxyhi = domain->boxhi[1];
boxzlo = domain->boxlo[2];
boxzhi = domain->boxhi[2];
} else {
boxxlo = domain->boxlo_bound[0];
boxxhi = domain->boxhi_bound[0];
boxylo = domain->boxlo_bound[1];
boxyhi = domain->boxhi_bound[1];
boxzlo = domain->boxlo_bound[2];
boxzhi = domain->boxhi_bound[2];
boxxy = domain->xy;
boxxz = domain->xz;
boxyz = domain->yz;
}
}
/* ----------------------------------------------------------------------
reset view parameters
called once from constructor if view is STATIC
called every snapshot from write() if view is DYNAMIC
------------------------------------------------------------------------- */
void DumpImage::box_center()
{
if (cxstr) cx = input->variable->compute_equal(cxvar);
if (cystr) cy = input->variable->compute_equal(cyvar);
if (czstr) cz = input->variable->compute_equal(czvar);
image->xctr = boxxlo + cx*(boxxhi-boxxlo);
image->yctr = boxylo + cy*(boxyhi-boxylo);
image->zctr = boxzlo + cz*(boxzhi-boxzlo);
}
/* ----------------------------------------------------------------------
reset view parameters in Image class
called once from constructor if view is STATIC
called every snapshot from write() if view is DYNAMIC
------------------------------------------------------------------------- */
void DumpImage::view_params()
{
// view direction theta and phi
if (thetastr) {
double theta = input->variable->compute_equal(thetavar);
if (theta < 0.0 || theta > 180.0)
error->all(FLERR,"Invalid dump image theta value");
theta *= MY_PI/180.0;
image->theta = theta;
}
if (phistr) {
double phi = input->variable->compute_equal(phivar);
phi *= MY_PI/180.0;
image->phi = phi;
}
// up vector
if (upxstr) image->up[0] = input->variable->compute_equal(upxvar);
if (upystr) image->up[1] = input->variable->compute_equal(upyvar);
if (upzstr) image->up[2] = input->variable->compute_equal(upzvar);
// zoom and perspective
if (zoomstr) image->zoom = input->variable->compute_equal(zoomvar);
if (image->zoom <= 0.0) error->all(FLERR,"Invalid dump image zoom value");
if (perspstr) image->persp = input->variable->compute_equal(perspvar);
if (image->persp < 0.0) error->all(FLERR,"Invalid dump image persp value");
// remainder of view setup is internal to Image class
image->view_params(boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi);
}
/* ----------------------------------------------------------------------
create image for atoms on this proc
every pixel has depth
------------------------------------------------------------------------- */
void DumpImage::create_image()
{
- int i,j,k,m,n,itype,atom1,atom2,imol,iatom,btype,ibonus;
+ int i,j,k,m,n,itype,atom1,atom2,imol,iatom,btype,ibonus,drawflag;
tagint tagprev;
double diameter,delx,dely,delz;
int *bodyvec;
double **bodyarray;
double *color,*color1,*color2;
- double xmid[3];
+ double xmid[3],pt1[3],pt2[3],pt3[3];
+ double mat[3][3];
// render my atoms
if (atomflag) {
double **x = atom->x;
+ int *line = atom->line;
+ int *tri = atom->tri;
int *body = atom->body;
m = 0;
for (i = 0; i < nchoose; i++) {
j = clist[i];
if (acolor == TYPE) {
itype = static_cast<int> (buf[m]);
color = colortype[itype];
} else if (acolor == ELEMENT) {
itype = static_cast<int> (buf[m]);
color = colorelement[itype];
} else if (acolor == ATTRIBUTE) {
color = image->map_value2color(0,buf[m]);
} else color = image->color2rgb("white");
if (adiam == NUMERIC) {
diameter = adiamvalue;
} else if (adiam == TYPE) {
itype = static_cast<int> (buf[m+1]);
diameter = diamtype[itype];
} else if (adiam == ELEMENT) {
itype = static_cast<int> (buf[m+1]);
diameter = diamelement[itype];
} else if (adiam == ATTRIBUTE) {
diameter = buf[m+1];
}
- if (!body || !bodyflag || body[j] < 0)
- image->draw_sphere(x[j],color,diameter);
- else {
- ibonus = body[i];
- n = bptr->image(ibonus,bodyflag1,bodyflag2,bodyvec,bodyarray);
- for (k = 0; k < n; k++) {
- if (bodyvec[k] == SPHERE)
- image->draw_sphere(bodyarray[k],color,bodyarray[k][3]);
- else if (bodyvec[k] == LINE)
- image->draw_cylinder(&bodyarray[k][0],&bodyarray[k][3],
- color,bodyarray[k][6],3);
- }
+ // do not draw if line,tri,body keywords enabled and atom is one of those
+
+ drawflag = 1;
+ if (extraflag) {
+ if (lineflag && line[j] >= 0) drawflag = 0;
+ if (triflag && tri[j] >= 0) drawflag = 0;
+ if (bodyflag && body[j] >= 0) drawflag = 0;
+ }
+
+ if (drawflag) image->draw_sphere(x[j],color,diameter);
+
+ m += size_one;
+ }
+ }
+
+ // render atoms that are lines
+
+ if (lineflag) {
+ double length,theta,dx,dy;
+ double **x = atom->x;
+ int *line = atom->line;
+ int *type = atom->type;
+
+ for (i = 0; i < nchoose; i++) {
+ j = clist[i];
+ if (line[j] < 0) continue;
+
+ if (lcolor == TYPE) {
+ color = colortype[type[j]];
+ }
+
+ if (ldiam == NUMERIC) {
+ diameter = ldiamvalue;
+ }
+
+ length = avec_line->bonus[line[j]].length;
+ theta = avec_line->bonus[line[j]].theta;
+ dx = 0.5*length*cos(theta);
+ dy = 0.5*length*sin(theta);
+
+ pt1[0] = x[j][0] + dx;
+ pt1[1] = x[j][1] + dy;
+ pt1[2] = 0.0;
+ pt2[0] = x[j][0] - dx;
+ pt2[1] = x[j][1] - dy;
+ pt2[2] = 0.0;
+
+ image->draw_cylinder(pt1,pt2,color,ldiamvalue,3);
+ }
+ }
+
+ // render atoms that are triangles
+
+ if (triflag) {
+ double **x = atom->x;
+ int *tri = atom->tri;
+ int *type = atom->type;
+
+ for (i = 0; i < nchoose; i++) {
+ j = clist[i];
+ if (tri[j] < 0) continue;
+
+ if (tcolor == TYPE) {
+ color = colortype[type[j]];
+ }
+
+ MathExtra::quat_to_mat(avec_tri->bonus[tri[i]].quat,mat);
+ MathExtra::matvec(mat,avec_tri->bonus[tri[i]].c1,pt1);
+ MathExtra::matvec(mat,avec_tri->bonus[tri[i]].c2,pt2);
+ MathExtra::matvec(mat,avec_tri->bonus[tri[i]].c3,pt3);
+ MathExtra::add3(pt1,x[i],pt1);
+ MathExtra::add3(pt2,x[i],pt2);
+ MathExtra::add3(pt3,x[i],pt3);
+
+ image->draw_triangle(pt1,pt2,pt3,color);
+ }
+ }
+
+ // render atoms that are bodies
+
+ if (bodyflag) {
+ Body *bptr = avec_body->bptr;
+ double **x = atom->x;
+ int *body = atom->body;
+
+ m = 0;
+ for (i = 0; i < nchoose; i++) {
+ j = clist[i];
+ if (body[j] < 0) continue;
+
+ if (bodycolor == TYPE) {
+ itype = static_cast<int> (buf[m]);
+ color = colortype[itype];
+ }
+
+ ibonus = body[i];
+ n = bptr->image(ibonus,bodyflag1,bodyflag2,bodyvec,bodyarray);
+ for (k = 0; k < n; k++) {
+ if (bodyvec[k] == SPHERE)
+ image->draw_sphere(bodyarray[k],color,bodyarray[k][3]);
+ else if (bodyvec[k] == LINE)
+ image->draw_cylinder(&bodyarray[k][0],&bodyarray[k][3],
+ color,bodyarray[k][6],3);
}
m += size_one;
}
}
// render bonds for my atoms
// both atoms in bond must be selected for bond to be rendered
// if newton_bond is off, only render bond once
// render bond in 2 pieces if crosses periodic boundary
// if bond is deleted (type = 0), do not render
// if bond is turned off (type < 0), still render
if (bondflag) {
double **x = atom->x;
tagint *tag = atom->tag;
tagint **bond_atom = atom->bond_atom;
int **bond_type = atom->bond_type;
int *num_bond = atom->num_bond;
int *molindex = atom->molindex;
int *molatom = atom->molatom;
int *type = atom->type;
int nlocal = atom->nlocal;
int nall = atom->nlocal + atom->nghost;
int newton_bond = force->newton_bond;
int molecular = atom->molecular;
Molecule **onemols = atom->avec->onemols;
// communicate choose flag for ghost atoms to know if they are selected
// if bcolor/bdiam = ATOM, setup bufcopy to comm atom color/diam attributes
if (nall > maxbufcopy) {
maxbufcopy = atom->nmax;
memory->destroy(chooseghost);
memory->create(chooseghost,maxbufcopy,"dump:chooseghost");
if (comm_forward == 3) {
memory->destroy(bufcopy);
memory->create(bufcopy,maxbufcopy,2,"dump:bufcopy");
}
}
for (i = 0; i < nlocal; i++) chooseghost[i] = choose[i];
if (comm_forward == 3) {
for (i = 0; i < nlocal; i++) bufcopy[i][0] = bufcopy[i][1] = 0.0;
m = 0;
for (i = 0; i < nchoose; i++) {
j = clist[i];
bufcopy[j][0] = buf[m];
bufcopy[j][1] = buf[m+1];
m += size_one;
}
}
comm->forward_comm_dump(this);
for (i = 0; i < nchoose; i++) {
atom1 = clist[i];
if (molecular == 1) n = num_bond[atom1];
else {
if (molindex[atom1] < 0) continue;
imol = molindex[atom1];
iatom = molatom[atom1];
n = onemols[imol]->num_bond[iatom];
}
for (m = 0; m < n; m++) {
if (molecular == 1) {
btype = bond_type[atom1][m];
atom2 = atom->map(bond_atom[atom1][m]);
} else {
tagprev = tag[i] - iatom - 1;
btype = atom->map(onemols[imol]->bond_type[iatom][m]);
atom2 = atom->map(onemols[imol]->bond_atom[iatom][m]+tagprev);
}
if (atom2 < 0 || !chooseghost[atom2]) continue;
if (newton_bond == 0 && tag[atom1] > tag[atom2]) continue;
if (btype == 0) continue;
if (bcolor == ATOM) {
if (acolor == TYPE) {
color1 = colortype[type[atom1]];
color2 = colortype[type[atom2]];
} else if (acolor == ELEMENT) {
color1 = colorelement[type[atom1]];
color2 = colorelement[type[atom2]];
} else if (acolor == ATTRIBUTE) {
color1 = image->map_value2color(0,bufcopy[atom1][0]);
color2 = image->map_value2color(0,bufcopy[atom2][0]);
} else {
color1 = image->color2rgb("white");
color2 = image->color2rgb("white");
}
} else if (bcolor == TYPE) {
itype = btype;
if (itype < 0) itype = -itype;
color = bcolortype[itype];
}
if (bdiam == NUMERIC) {
diameter = bdiamvalue;
} else if (bdiam == ATOM) {
if (adiam == NUMERIC) {
diameter = adiamvalue;
} else if (adiam == TYPE) {
diameter = MIN(diamtype[type[atom1]],diamtype[type[atom1]]);
} else if (adiam == ELEMENT) {
diameter = MIN(diamelement[type[atom1]],diamelement[type[atom1]]);
} else if (adiam == ATTRIBUTE) {
diameter = MIN(bufcopy[atom1][1],bufcopy[atom2][1]);
}
} else if (bdiam == TYPE) {
itype = btype;
if (itype < 0) itype = -itype;
diameter = bdiamtype[itype];
}
// draw cylinder in 2 pieces if bcolor = ATOM
// or bond crosses periodic boundary
delx = x[atom2][0] - x[atom1][0];
dely = x[atom2][1] - x[atom1][1];
delz = x[atom2][2] - x[atom1][2];
if (bcolor == ATOM || domain->minimum_image_check(delx,dely,delz)) {
domain->minimum_image(delx,dely,delz);
xmid[0] = x[atom1][0] + 0.5*delx;
xmid[1] = x[atom1][1] + 0.5*dely;
xmid[2] = x[atom1][2] + 0.5*delz;
if (bcolor == ATOM)
image->draw_cylinder(x[atom1],xmid,color1,diameter,3);
else image->draw_cylinder(x[atom1],xmid,color,diameter,3);
xmid[0] = x[atom2][0] - 0.5*delx;
xmid[1] = x[atom2][1] - 0.5*dely;
xmid[2] = x[atom2][2] - 0.5*delz;
if (bcolor == ATOM)
image->draw_cylinder(xmid,x[atom2],color2,diameter,3);
else image->draw_cylinder(xmid,x[atom2],color,diameter,3);
} else image->draw_cylinder(x[atom1],x[atom2],color,diameter,3);
}
}
}
// render outline of my sub-box, orthogonal or triclinic
if (subboxflag) {
double diameter = MIN(boxxhi-boxxlo,boxyhi-boxylo);
if (domain->dimension == 3) diameter = MIN(diameter,boxzhi-boxzlo);
diameter *= subboxdiam;
double *sublo = domain->sublo;
double *subhi = domain->subhi;
double (*boxcorners)[3];
double box[8][3];
if (domain->triclinic == 0) {
box[0][0] = sublo[0]; box[0][1] = sublo[1]; box[0][2] = sublo[2];
box[1][0] = subhi[0]; box[1][1] = sublo[1]; box[1][2] = sublo[2];
box[2][0] = sublo[0]; box[2][1] = subhi[1]; box[2][2] = sublo[2];
box[3][0] = subhi[0]; box[3][1] = subhi[1]; box[3][2] = sublo[2];
box[4][0] = sublo[0]; box[4][1] = sublo[1]; box[4][2] = subhi[2];
box[5][0] = subhi[0]; box[5][1] = sublo[1]; box[5][2] = subhi[2];
box[6][0] = sublo[0]; box[6][1] = subhi[1]; box[6][2] = subhi[2];
box[7][0] = subhi[0]; box[7][1] = subhi[1]; box[7][2] = subhi[2];
boxcorners = box;
} else {
domain->subbox_corners();
boxcorners = domain->corners;
}
image->draw_box(boxcorners,diameter);
}
// render outline of simulation box, orthogonal or triclinic
if (boxflag) {
double diameter = MIN(boxxhi-boxxlo,boxyhi-boxylo);
if (domain->dimension == 3) diameter = MIN(diameter,boxzhi-boxzlo);
diameter *= boxdiam;
double (*boxcorners)[3];
double box[8][3];
if (domain->triclinic == 0) {
box[0][0] = boxxlo; box[0][1] = boxylo; box[0][2] = boxzlo;
box[1][0] = boxxhi; box[1][1] = boxylo; box[1][2] = boxzlo;
box[2][0] = boxxlo; box[2][1] = boxyhi; box[2][2] = boxzlo;
box[3][0] = boxxhi; box[3][1] = boxyhi; box[3][2] = boxzlo;
box[4][0] = boxxlo; box[4][1] = boxylo; box[4][2] = boxzhi;
box[5][0] = boxxhi; box[5][1] = boxylo; box[5][2] = boxzhi;
box[6][0] = boxxlo; box[6][1] = boxyhi; box[6][2] = boxzhi;
box[7][0] = boxxhi; box[7][1] = boxyhi; box[7][2] = boxzhi;
boxcorners = box;
} else {
domain->box_corners();
boxcorners = domain->corners;
}
image->draw_box(boxcorners,diameter);
}
// render XYZ axes in red/green/blue
// offset by 10% of box size and scale by axeslen
if (axesflag) {
double diameter = MIN(boxxhi-boxxlo,boxyhi-boxylo);
if (domain->dimension == 3) diameter = MIN(diameter,boxzhi-boxzlo);
diameter *= axesdiam;
double (*boxcorners)[3];
double axes[4][3];
if (domain->triclinic == 0) {
axes[0][0] = boxxlo; axes[0][1] = boxylo; axes[0][2] = boxzlo;
axes[1][0] = boxxhi; axes[1][1] = boxylo; axes[1][2] = boxzlo;
axes[2][0] = boxxlo; axes[2][1] = boxyhi; axes[2][2] = boxzlo;
axes[3][0] = boxxlo; axes[3][1] = boxylo; axes[3][2] = boxzhi;
} else {
domain->box_corners();
boxcorners = domain->corners;
axes[0][0] = boxcorners[0][0];
axes[0][1] = boxcorners[0][1];
axes[0][2] = boxcorners[0][2];
axes[1][0] = boxcorners[1][0];
axes[1][1] = boxcorners[1][1];
axes[1][2] = boxcorners[1][2];
axes[2][0] = boxcorners[2][0];
axes[2][1] = boxcorners[2][1];
axes[2][2] = boxcorners[2][2];
axes[3][0] = boxcorners[4][0];
axes[3][1] = boxcorners[4][1];
axes[3][2] = boxcorners[4][2];
}
double offset = MAX(boxxhi-boxxlo,boxyhi-boxylo);
if (domain->dimension == 3) offset = MAX(offset,boxzhi-boxzlo);
offset *= 0.1;
axes[0][0] -= offset; axes[0][1] -= offset; axes[0][2] -= offset;
axes[1][0] -= offset; axes[1][1] -= offset; axes[1][2] -= offset;
axes[2][0] -= offset; axes[2][1] -= offset; axes[2][2] -= offset;
axes[3][0] -= offset; axes[3][1] -= offset; axes[3][2] -= offset;
axes[1][0] = axes[0][0] + axeslen*(axes[1][0]-axes[0][0]);
axes[1][1] = axes[0][1] + axeslen*(axes[1][1]-axes[0][1]);
axes[1][2] = axes[0][2] + axeslen*(axes[1][2]-axes[0][2]);
axes[2][0] = axes[0][0] + axeslen*(axes[2][0]-axes[0][0]);
axes[2][1] = axes[0][1] + axeslen*(axes[2][1]-axes[0][1]);
axes[2][2] = axes[0][2] + axeslen*(axes[2][2]-axes[0][2]);
axes[3][0] = axes[0][0] + axeslen*(axes[3][0]-axes[0][0]);
axes[3][1] = axes[0][1] + axeslen*(axes[3][1]-axes[0][1]);
axes[3][2] = axes[0][2] + axeslen*(axes[3][2]-axes[0][2]);
image->draw_axes(axes,diameter);
}
}
/* ---------------------------------------------------------------------- */
int DumpImage::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
m = 0;
if (comm_forward == 1) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = chooseghost[j];
}
} else {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = chooseghost[j];
buf[m++] = bufcopy[j][0];
buf[m++] = bufcopy[j][1];
}
}
return m;
}
/* ---------------------------------------------------------------------- */
void DumpImage::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
if (comm_forward == 1)
for (i = first; i < last; i++) chooseghost[i] = static_cast<int> (buf[m++]);
else {
for (i = first; i < last; i++) {
chooseghost[i] = static_cast<int> (buf[m++]);
bufcopy[i][0] = buf[m++];
bufcopy[i][1] = buf[m++];
}
}
}
/* ---------------------------------------------------------------------- */
int DumpImage::modify_param(int narg, char **arg)
{
int n = DumpCustom::modify_param(narg,arg);
if (n) return n;
if (strcmp(arg[0],"acolor") == 0) {
if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
int nlo,nhi;
force->bounds(arg[1],atom->ntypes,nlo,nhi);
// ptrs = list of ncount colornames separated by '/'
int ncount = 1;
char *nextptr;
char *ptr = arg[2];
while ((nextptr = strchr(ptr,'/'))) {
ptr = nextptr + 1;
ncount++;
}
char **ptrs = new char*[ncount+1];
ncount = 0;
ptrs[ncount++] = strtok(arg[2],"/");
while ((ptrs[ncount++] = strtok(NULL,"/")));
ncount--;
// assign each of ncount colors in round-robin fashion to types
int m = 0;
for (int i = nlo; i <= nhi; i++) {
colortype[i] = image->color2rgb(ptrs[m%ncount]);
if (colortype[i] == NULL)
error->all(FLERR,"Invalid color in dump_modify command");
m++;
}
delete [] ptrs;
return 3;
}
if (strcmp(arg[0],"adiam") == 0) {
if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
int nlo,nhi;
force->bounds(arg[1],atom->ntypes,nlo,nhi);
double diam = force->numeric(FLERR,arg[2]);
if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command");
for (int i = nlo; i <= nhi; i++) diamtype[i] = diam;
return 3;
}
if (strcmp(arg[0],"amap") == 0) {
if (narg < 6) error->all(FLERR,"Illegal dump_modify command");
if (strlen(arg[3]) != 2) error->all(FLERR,"Illegal dump_modify command");
int factor;
if (arg[3][0] == 's') factor = 1;
else if (arg[3][0] == 'c') factor = 2;
else if (arg[3][0] == 'd') factor = 3;
else error->all(FLERR,"Illegal dump_modify command");
int nentry = force->inumeric(FLERR,arg[5]);
if (nentry < 1) error->all(FLERR,"Illegal dump_modify command");
int n = 6 + factor*nentry;
if (narg < n) error->all(FLERR,"Illegal dump_modify command");
int flag = image->map_reset(0,n-1,&arg[1]);
if (flag) error->all(FLERR,"Illegal dump_modify command");
return n;
}
if (strcmp(arg[0],"bcolor") == 0) {
if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
if (atom->nbondtypes == 0)
error->all(FLERR,"Dump modify bcolor not allowed with no bond types");
int nlo,nhi;
force->bounds(arg[1],atom->nbondtypes,nlo,nhi);
// ptrs = list of ncount colornames separated by '/'
int ncount = 1;
char *nextptr;
char *ptr = arg[2];
while ((nextptr = strchr(ptr,'/'))) {
ptr = nextptr + 1;
ncount++;
}
char **ptrs = new char*[ncount+1];
ncount = 0;
ptrs[ncount++] = strtok(arg[2],"/");
while ((ptrs[ncount++] = strtok(NULL,"/")));
ncount--;
// assign each of ncount colors in round-robin fashion to types
int m = 0;
for (int i = nlo; i <= nhi; i++) {
bcolortype[i] = image->color2rgb(ptrs[m%ncount]);
if (bcolortype[i] == NULL)
error->all(FLERR,"Invalid color in dump_modify command");
m++;
}
delete [] ptrs;
return 3;
}
if (strcmp(arg[0],"bdiam") == 0) {
if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
if (atom->nbondtypes == 0)
error->all(FLERR,"Dump modify bdiam not allowed with no bond types");
int nlo,nhi;
force->bounds(arg[1],atom->ntypes,nlo,nhi);
double diam = force->numeric(FLERR,arg[2]);
if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command");
for (int i = nlo; i <= nhi; i++) bdiamtype[i] = diam;
return 3;
}
if (strcmp(arg[0],"backcolor") == 0) {
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
double *color = image->color2rgb(arg[1]);
if (color == NULL) error->all(FLERR,"Invalid color in dump_modify command");
image->background[0] = static_cast<int> (color[0]*255.0);
image->background[1] = static_cast<int> (color[1]*255.0);
image->background[2] = static_cast<int> (color[2]*255.0);
return 2;
}
if (strcmp(arg[0],"boxcolor") == 0) {
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
image->boxcolor = image->color2rgb(arg[1]);
if (image->boxcolor == NULL)
error->all(FLERR,"Invalid color in dump_modify command");
return 2;
}
if (strcmp(arg[0],"color") == 0) {
if (narg < 5) error->all(FLERR,"Illegal dump_modify command");
int flag = image->addcolor(arg[1],force->numeric(FLERR,arg[2]),force->numeric(FLERR,arg[3]),force->numeric(FLERR,arg[4]));
if (flag) error->all(FLERR,"Illegal dump_modify command");
return 5;
}
return 0;
}
diff --git a/src/dump_image.h b/src/dump_image.h
index 9f3621d2c..af6652c3e 100644
--- a/src/dump_image.h
+++ b/src/dump_image.h
@@ -1,202 +1,216 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef DUMP_CLASS
DumpStyle(image,DumpImage)
#else
#ifndef LMP_DUMP_IMAGE_H
#define LMP_DUMP_IMAGE_H
#include "dump_custom.h"
namespace LAMMPS_NS {
class DumpImage : public DumpCustom {
public:
int multifile_override; // used by write_dump command
DumpImage(class LAMMPS *, int, char**);
virtual ~DumpImage();
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
protected:
int filetype;
enum{PPM,JPG,PNG};
+ int atomflag; // 0/1 for draw atoms
int acolor,adiam; // what determines color/diam of atoms
double adiamvalue; // atom diameter value
- int atomflag,bondflag; // 0/1 for draw atoms,bonds
+
+ int lineflag; // 0/1 for draw atoms as lines
+ int lcolor,ldiam; // what determines color/diam of lines
+ double ldiamvalue; // line diameter value
+ int triflag; // 0/1 for draw atoms as triangles
+ int tcolor; // what determines color of tris
int bodyflag; // 0/1 for draw atoms as bodies
- double bodyflag1,bodyflag2; // user params for drawing bodies
+ int bodycolor; // what determines color of bodies
+ double bodyflag1,bodyflag2; // user-specified params for drawing bodies
+
+ int bondflag; // 0/1 for draw bonds
int bcolor,bdiam; // what determines color/diam of bonds
double bdiamvalue; // bond diameter value
+
+ int extraflag; // 0/1 for any of line/tri/body flag set
char *thetastr,*phistr; // variables for view theta,phi
int thetavar,phivar; // index to theta,phi vars
int cflag; // static/dynamic box center
double cx,cy,cz; // fractional box center
char *cxstr,*cystr,*czstr; // variables for box center
int cxvar,cyvar,czvar; // index to box center vars
char *upxstr,*upystr,*upzstr; // view up vector variables
int upxvar,upyvar,upzvar; // index to up vector vars
char *zoomstr,*perspstr; // view zoom and perspective variables
int zoomvar,perspvar; // index to zoom,persp vars
int boxflag,axesflag; // 0/1 for draw box and axes
double boxdiam,axeslen,axesdiam; // params for drawing box and axes
int subboxflag;
double subboxdiam;
int viewflag; // overall view is static or dynamic
double *diamtype,*diamelement,*bdiamtype; // per-type diameters
double **colortype,**colorelement,**bcolortype; // per-type colors
+ class AtomVecLine *avec_line; // ptrs to atom style (sub)classes
+ class AtomVecTri *avec_tri;
+ class AtomVecBody *avec_body;
+
class Image *image; // class that renders each image
- class Body *bptr; // class for Body particles
int *chooseghost; // extended choose array for comm
double **bufcopy; // buffer for communicating bond/atom info
int maxbufcopy;
virtual void init_style();
int modify_param(int, char **);
void write();
void box_center();
void view_params();
void box_bounds();
void create_image();
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Invalid dump image filename
The file produced by dump image cannot be binary and must
be for a single processor.
E: Support for writing images in JPEG format not included
LAMMPS was not built with the -DLAMMPS_JPEG switch in the Makefile.
E: Support for writing images in PNG format not included
LAMMPS was not built with the -DLAMMPS_PNG switch in the Makefile.
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Dump image bond not allowed with no bond types
Self-explanatory.
E: Invalid dump image theta value
Theta must be between 0.0 and 180.0 inclusive.
E: Dump image persp option is not yet supported
Self-explanatory.
E: Dump image requires one snapshot per file
Use a "*" in the filename.
E: Dump image cannot perform sorting
Self-explanatory.
E: Variable name for dump image theta does not exist
Self-explanatory.
E: Variable for dump image theta is invalid style
Must be an equal-style variable.
E: Variable name for dump image phi does not exist
Self-explanatory.
E: Variable for dump image phi is invalid style
Must be an equal-style variable.
E: Variable name for dump image center does not exist
Self-explanatory.
E: Variable for dump image center is invalid style
Must be an equal-style variable.
E: Variable name for dump image zoom does not exist
Self-explanatory.
E: Variable for dump image zoom is invalid style
Must be an equal-style variable.
E: Variable name for dump image persp does not exist
Self-explanatory.
E: Variable for dump image persp is invalid style
Must be an equal-style variable.
E: Invalid dump image element name
The specified element name was not in the standard list of elements.
See the dump_modify doc page.
E: Invalid color map min/max values
The min/max values are not consistent with either each other or
with values in the color map.
E: Invalid dump image zoom value
Zoom value must be > 0.0.
E: Invalid dump image persp value
Persp value must be >= 0.0.
E: Invalid color in dump_modify command
The specified color name was not in the list of recognized colors.
See the dump_modify doc page.
E: Dump modify bcolor not allowed with no bond types
Self-explanatory.
E: Dump modify bdiam not allowed with no bond types
Self-explanatory.
*/
diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp
index a9e42ce6d..4cebdb14c 100644
--- a/src/fix_adapt.cpp
+++ b/src/fix_adapt.cpp
@@ -1,586 +1,596 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "fix_adapt.h"
#include "atom.h"
#include "update.h"
#include "group.h"
#include "modify.h"
#include "force.h"
#include "pair.h"
#include "pair_hybrid.h"
#include "kspace.h"
#include "fix_store.h"
#include "input.h"
#include "variable.h"
#include "respa.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
using namespace MathConst;
enum{PAIR,KSPACE,ATOM};
enum{DIAMETER,CHARGE};
/* ---------------------------------------------------------------------- */
FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
{
if (narg < 5) error->all(FLERR,"Illegal fix adapt command");
nevery = force->inumeric(FLERR,arg[3]);
if (nevery < 0) error->all(FLERR,"Illegal fix adapt command");
dynamic_group_allow = 1;
create_attribute = 1;
// count # of adaptations
nadapt = 0;
int iarg = 4;
while (iarg < narg) {
if (strcmp(arg[iarg],"pair") == 0) {
if (iarg+6 > narg) error->all(FLERR,"Illegal fix adapt command");
nadapt++;
iarg += 6;
} else if (strcmp(arg[iarg],"kspace") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt command");
nadapt++;
iarg += 2;
} else if (strcmp(arg[iarg],"atom") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix adapt command");
nadapt++;
iarg += 3;
} else break;
}
if (nadapt == 0) error->all(FLERR,"Illegal fix adapt command");
adapt = new Adapt[nadapt];
// parse keywords
nadapt = 0;
diamflag = 0;
chgflag = 0;
iarg = 4;
while (iarg < narg) {
if (strcmp(arg[iarg],"pair") == 0) {
if (iarg+6 > narg) error->all(FLERR,"Illegal fix adapt command");
adapt[nadapt].which = PAIR;
int n = strlen(arg[iarg+1]) + 1;
adapt[nadapt].pstyle = new char[n];
strcpy(adapt[nadapt].pstyle,arg[iarg+1]);
n = strlen(arg[iarg+2]) + 1;
adapt[nadapt].pparam = new char[n];
+ adapt[nadapt].pair = NULL;
strcpy(adapt[nadapt].pparam,arg[iarg+2]);
force->bounds(arg[iarg+3],atom->ntypes,
adapt[nadapt].ilo,adapt[nadapt].ihi);
force->bounds(arg[iarg+4],atom->ntypes,
adapt[nadapt].jlo,adapt[nadapt].jhi);
if (strstr(arg[iarg+5],"v_") == arg[iarg+5]) {
n = strlen(&arg[iarg+5][2]) + 1;
adapt[nadapt].var = new char[n];
strcpy(adapt[nadapt].var,&arg[iarg+5][2]);
} else error->all(FLERR,"Illegal fix adapt command");
nadapt++;
iarg += 6;
} else if (strcmp(arg[iarg],"kspace") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt command");
adapt[nadapt].which = KSPACE;
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
int n = strlen(&arg[iarg+1][2]) + 1;
adapt[nadapt].var = new char[n];
strcpy(adapt[nadapt].var,&arg[iarg+1][2]);
} else error->all(FLERR,"Illegal fix adapt command");
nadapt++;
iarg += 2;
} else if (strcmp(arg[iarg],"atom") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix adapt command");
adapt[nadapt].which = ATOM;
if (strcmp(arg[iarg+1],"diameter") == 0) {
adapt[nadapt].aparam = DIAMETER;
diamflag = 1;
} else if (strcmp(arg[iarg+1],"charge") == 0) {
adapt[nadapt].aparam = CHARGE;
chgflag = 1;
} else error->all(FLERR,"Illegal fix adapt command");
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
adapt[nadapt].var = new char[n];
strcpy(adapt[nadapt].var,&arg[iarg+2][2]);
} else error->all(FLERR,"Illegal fix adapt command");
nadapt++;
iarg += 3;
} else break;
}
// optional keywords
resetflag = 0;
scaleflag = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"reset") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt command");
if (strcmp(arg[iarg+1],"no") == 0) resetflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) resetflag = 1;
else error->all(FLERR,"Illegal fix adapt command");
iarg += 2;
} else if (strcmp(arg[iarg],"scale") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt command");
if (strcmp(arg[iarg+1],"no") == 0) scaleflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) scaleflag = 1;
else error->all(FLERR,"Illegal fix adapt command");
iarg += 2;
} else error->all(FLERR,"Illegal fix adapt command");
}
// allocate pair style arrays
int n = atom->ntypes;
for (int m = 0; m < nadapt; m++)
if (adapt[m].which == PAIR)
memory->create(adapt[m].array_orig,n+1,n+1,"adapt:array_orig");
id_fix_diam = id_fix_chg = NULL;
}
/* ---------------------------------------------------------------------- */
FixAdapt::~FixAdapt()
{
for (int m = 0; m < nadapt; m++) {
delete [] adapt[m].var;
if (adapt[m].which == PAIR) {
delete [] adapt[m].pstyle;
delete [] adapt[m].pparam;
memory->destroy(adapt[m].array_orig);
}
}
delete [] adapt;
// check nfix in case all fixes have already been deleted
if (id_fix_diam && modify->nfix) modify->delete_fix(id_fix_diam);
if (id_fix_chg && modify->nfix) modify->delete_fix(id_fix_chg);
delete [] id_fix_diam;
delete [] id_fix_chg;
}
/* ---------------------------------------------------------------------- */
int FixAdapt::setmask()
{
int mask = 0;
mask |= PRE_FORCE;
mask |= POST_RUN;
mask |= PRE_FORCE_RESPA;
return mask;
}
/* ----------------------------------------------------------------------
if need to restore per-atom quantities, create new fix STORE styles
------------------------------------------------------------------------- */
void FixAdapt::post_constructor()
{
if (!resetflag) return;
if (!diamflag && !chgflag) return;
// new id = fix-ID + FIX_STORE_ATTRIBUTE
// new fix group = group for this fix
id_fix_diam = NULL;
id_fix_chg = NULL;
- char **newarg = new char*[5];
+ char **newarg = new char*[6];
newarg[1] = group->names[igroup];
newarg[2] = (char *) "STORE";
- newarg[3] = (char *) "1";
+ newarg[3] = (char *) "peratom";
newarg[4] = (char *) "1";
+ newarg[5] = (char *) "1";
if (diamflag) {
int n = strlen(id) + strlen("_FIX_STORE_DIAM") + 1;
id_fix_diam = new char[n];
strcpy(id_fix_diam,id);
strcat(id_fix_diam,"_FIX_STORE_DIAM");
newarg[0] = id_fix_diam;
- modify->add_fix(5,newarg);
+ modify->add_fix(6,newarg);
fix_diam = (FixStore *) modify->fix[modify->nfix-1];
if (fix_diam->restart_reset) fix_diam->restart_reset = 0;
else {
double *vec = fix_diam->vstore;
double *radius = atom->radius;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vec[i] = radius[i];
else vec[i] = 0.0;
}
}
}
if (chgflag) {
int n = strlen(id) + strlen("_FIX_STORE_CHG") + 1;
id_fix_chg = new char[n];
strcpy(id_fix_chg,id);
strcat(id_fix_chg,"_FIX_STORE_CHG");
newarg[0] = id_fix_chg;
- modify->add_fix(5,newarg);
+ modify->add_fix(6,newarg);
fix_chg = (FixStore *) modify->fix[modify->nfix-1];
if (fix_chg->restart_reset) fix_chg->restart_reset = 0;
else {
double *vec = fix_chg->vstore;
double *q = atom->q;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vec[i] = q[i];
else vec[i] = 0.0;
}
}
}
delete [] newarg;
}
/* ---------------------------------------------------------------------- */
void FixAdapt::init()
{
int i,j;
// allow a dynamic group only if ATOM attribute not used
if (group->dynamic[igroup])
for (int i = 0; i < nadapt; i++)
if (adapt[i].which == ATOM)
error->all(FLERR,"Cannot use dynamic group with fix adapt atom");
// setup and error checks
anypair = 0;
for (int m = 0; m < nadapt; m++) {
Adapt *ad = &adapt[m];
ad->ivar = input->variable->find(ad->var);
if (ad->ivar < 0)
error->all(FLERR,"Variable name for fix adapt does not exist");
if (!input->variable->equalstyle(ad->ivar))
error->all(FLERR,"Variable for fix adapt is invalid style");
if (ad->which == PAIR) {
anypair = 1;
- Pair *pair = NULL;
+ ad->pair = NULL;
// if ad->pstyle has trailing sub-style annotation ":N",
// strip it for pstyle arg to pair_match() and set nsub = N
// this should work for appended suffixes as well
int n = strlen(ad->pstyle) + 1;
char *pstyle = new char[n];
strcpy(pstyle,ad->pstyle);
char *cptr;
int nsub = 0;
if ((cptr = strchr(pstyle,':'))) {
*cptr = '\0';
nsub = force->inumeric(FLERR,cptr+1);
}
if (lmp->suffix_enable) {
int len = 2 + strlen(pstyle) + strlen(lmp->suffix);
char *psuffix = new char[len];
strcpy(psuffix,pstyle);
strcat(psuffix,"/");
strcat(psuffix,lmp->suffix);
- pair = force->pair_match(psuffix,1,nsub);
+ ad->pair = force->pair_match(psuffix,1,nsub);
delete[] psuffix;
}
- if (pair == NULL) pair = force->pair_match(pstyle,1,nsub);
- if (pair == NULL) error->all(FLERR,"Fix adapt pair style does not exist");
- void *ptr = pair->extract(ad->pparam,ad->pdim);
+ if (ad->pair == NULL) ad->pair = force->pair_match(pstyle,1,nsub);
+ if (ad->pair == NULL) error->all(FLERR,"Fix adapt pair style does not exist");
+
+ void *ptr = ad->pair->extract(ad->pparam,ad->pdim);
if (ptr == NULL)
error->all(FLERR,"Fix adapt pair style param not supported");
- ad->pdim = 2;
- if (ad->pdim == 0) ad->scalar = (double *) ptr;
- if (ad->pdim == 2) ad->array = (double **) ptr;
+ // for pair styles only parameters that are 2-d arrays in atom types are supported
+ if (ad->pdim != 2)
+ error->all(FLERR,"Fix adapt pair style param is not compatible");
+ else ad->array = (double **) ptr;
// if pair hybrid, test that ilo,ihi,jlo,jhi are valid for sub-style
- if (ad->pdim == 2 && (strcmp(force->pair_style,"hybrid") == 0 ||
- strcmp(force->pair_style,"hybrid/overlay") == 0)) {
+ if (strcmp(force->pair_style,"hybrid") == 0 ||
+ strcmp(force->pair_style,"hybrid/overlay") == 0) {
PairHybrid *pair = (PairHybrid *) force->pair;
for (i = ad->ilo; i <= ad->ihi; i++)
for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
if (!pair->check_ijtype(i,j,pstyle))
error->all(FLERR,"Fix adapt type pair range is not valid for "
"pair hybrid sub-style");
}
delete [] pstyle;
} else if (ad->which == KSPACE) {
if (force->kspace == NULL)
error->all(FLERR,"Fix adapt kspace style does not exist");
kspace_scale = (double *) force->kspace->extract("scale");
} else if (ad->which == ATOM) {
if (ad->aparam == DIAMETER) {
if (!atom->radius_flag)
error->all(FLERR,"Fix adapt requires atom attribute diameter");
}
if (ad->aparam == CHARGE) {
if (!atom->q_flag)
error->all(FLERR,"Fix adapt requires atom attribute charge");
}
}
}
// make copy of original pair array values
for (int m = 0; m < nadapt; m++) {
Adapt *ad = &adapt[m];
if (ad->which == PAIR && ad->pdim == 2) {
for (i = ad->ilo; i <= ad->ihi; i++)
for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
ad->array_orig[i][j] = ad->array[i][j];
}
}
// fixes that store initial per-atom values
if (id_fix_diam) {
int ifix = modify->find_fix(id_fix_diam);
if (ifix < 0) error->all(FLERR,"Could not find fix adapt storage fix ID");
fix_diam = (FixStore *) modify->fix[ifix];
}
if (id_fix_chg) {
int ifix = modify->find_fix(id_fix_chg);
if (ifix < 0) error->all(FLERR,"Could not find fix adapt storage fix ID");
fix_chg = (FixStore *) modify->fix[ifix];
}
if (strstr(update->integrate_style,"respa"))
nlevels_respa = ((Respa *) update->integrate)->nlevels;
}
/* ---------------------------------------------------------------------- */
void FixAdapt::setup_pre_force(int vflag)
{
change_settings();
}
/* ---------------------------------------------------------------------- */
void FixAdapt::setup_pre_force_respa(int vflag, int ilevel)
{
if (ilevel < nlevels_respa-1) return;
setup_pre_force(vflag);
}
/* ---------------------------------------------------------------------- */
void FixAdapt::pre_force(int vflag)
{
if (nevery == 0) return;
if (update->ntimestep % nevery) return;
change_settings();
}
/* ---------------------------------------------------------------------- */
void FixAdapt::pre_force_respa(int vflag, int ilevel, int)
{
if (ilevel < nlevels_respa-1) return;
pre_force(vflag);
}
/* ---------------------------------------------------------------------- */
void FixAdapt::post_run()
{
if (resetflag) restore_settings();
}
/* ----------------------------------------------------------------------
change pair,kspace,atom parameters based on variable evaluation
------------------------------------------------------------------------- */
void FixAdapt::change_settings()
{
int i,j;
// variable evaluation may invoke computes so wrap with clear/add
modify->clearstep_compute();
for (int m = 0; m < nadapt; m++) {
Adapt *ad = &adapt[m];
double value = input->variable->compute_equal(ad->ivar);
// set global scalar or type pair array values
if (ad->which == PAIR) {
if (ad->pdim == 0) {
if (scaleflag) *ad->scalar = value * ad->scalar_orig;
else *ad->scalar = value;
} else if (ad->pdim == 2) {
if (scaleflag)
for (i = ad->ilo; i <= ad->ihi; i++)
for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
ad->array[i][j] = value*ad->array_orig[i][j];
else
for (i = ad->ilo; i <= ad->ihi; i++)
for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
ad->array[i][j] = value;
}
// set kspace scale factor
} else if (ad->which == KSPACE) {
*kspace_scale = value;
// set per atom values, also make changes for ghost atoms
} else if (ad->which == ATOM) {
// reset radius from diameter
// also scale rmass to new value
if (ad->aparam == DIAMETER) {
int mflag = 0;
if (atom->rmass_flag) mflag = 1;
double density;
double *radius = atom->radius;
double *rmass = atom->rmass;
int *mask = atom->mask;
int nlocal = atom->nlocal;
int nall = nlocal + atom->nghost;
if (mflag == 0) {
for (i = 0; i < nall; i++)
if (mask[i] & groupbit)
radius[i] = 0.5*value;
} else {
for (i = 0; i < nall; i++)
if (mask[i] & groupbit) {
density = rmass[i] / (4.0*MY_PI/3.0 *
radius[i]*radius[i]*radius[i]);
radius[i] = 0.5*value;
rmass[i] = 4.0*MY_PI/3.0 *
radius[i]*radius[i]*radius[i] * density;
}
}
} else if (ad->aparam == CHARGE) {
double *q = atom->q;
int *mask = atom->mask;
int nlocal = atom->nlocal;
int nall = nlocal + atom->nghost;
for (i = 0; i < nall; i++)
if (mask[i] & groupbit) q[i] = value;
}
}
}
modify->addstep_compute(update->ntimestep + nevery);
// re-initialize pair styles if any PAIR settings were changed
// this resets other coeffs that may depend on changed values,
// and also offset and tail corrections
-
- if (anypair) force->pair->reinit();
+ if (anypair) {
+ for (int m = 0; m < nadapt; m++) {
+ Adapt *ad = &adapt[m];
+ if (ad->which == PAIR) {
+ ad->pair->reinit();
+ }
+ }
+ }
// reset KSpace charges if charges have changed
if (chgflag && force->kspace) force->kspace->qsum_qsq();
}
/* ----------------------------------------------------------------------
restore pair,kspace,atom parameters to original values
------------------------------------------------------------------------- */
void FixAdapt::restore_settings()
{
for (int m = 0; m < nadapt; m++) {
Adapt *ad = &adapt[m];
if (ad->which == PAIR) {
if (ad->pdim == 0) *ad->scalar = ad->scalar_orig;
else if (ad->pdim == 2) {
for (int i = ad->ilo; i <= ad->ihi; i++)
for (int j = MAX(ad->jlo,i); j <= ad->jhi; j++)
ad->array[i][j] = ad->array_orig[i][j];
}
} else if (ad->which == KSPACE) {
*kspace_scale = 1.0;
} else if (ad->which == ATOM) {
if (diamflag) {
double density;
double *vec = fix_diam->vstore;
double *radius = atom->radius;
double *rmass = atom->rmass;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
density = rmass[i] / (4.0*MY_PI/3.0 *
radius[i]*radius[i]*radius[i]);
radius[i] = vec[i];
rmass[i] = 4.0*MY_PI/3.0 * radius[i]*radius[i]*radius[i] * density;
}
}
if (chgflag) {
double *vec = fix_chg->vstore;
double *q = atom->q;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) q[i] = vec[i];
}
}
}
if (anypair) force->pair->reinit();
if (chgflag && force->kspace) force->kspace->qsum_qsq();
}
/* ----------------------------------------------------------------------
initialize one atom's storage values, called when atom is created
------------------------------------------------------------------------- */
void FixAdapt::set_arrays(int i)
{
if (fix_diam) fix_diam->vstore[i] = atom->radius[i];
if (fix_chg) fix_chg->vstore[i] = atom->q[i];
}
diff --git a/src/fix_adapt.h b/src/fix_adapt.h
index 7ae659df4..a6d45c78c 100644
--- a/src/fix_adapt.h
+++ b/src/fix_adapt.h
@@ -1,123 +1,128 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(adapt,FixAdapt)
#else
#ifndef LMP_FIX_ADAPT_H
#define LMP_FIX_ADAPT_H
#include "fix.h"
namespace LAMMPS_NS {
class FixAdapt : public Fix {
public:
int diamflag; // 1 if atom diameters will vary, for AtomVecGranular
int chgflag;
FixAdapt(class LAMMPS *, int, char **);
~FixAdapt();
int setmask();
void post_constructor();
void init();
void setup_pre_force(int);
void pre_force(int);
void post_run();
void setup_pre_force_respa(int,int);
void pre_force_respa(int,int,int);
void set_arrays(int);
private:
int nadapt,resetflag,scaleflag;
int anypair;
int nlevels_respa;
char *id_fix_diam,*id_fix_chg;
class FixStore *fix_diam,*fix_chg;
struct Adapt {
int which,ivar;
char *var;
char *pstyle,*pparam;
int ilo,ihi,jlo,jhi;
int pdim;
double *scalar,scalar_orig;
double **array,**array_orig;
int aparam;
+ class Pair *pair;
};
Adapt *adapt;
double *kspace_scale;
void change_settings();
void restore_settings();
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Cannot use dynamic group with fix adapt atom
This is not yet supported.
E: Variable name for fix adapt does not exist
Self-explanatory.
E: Variable for fix adapt is invalid style
Only equal-style variables can be used.
E: Fix adapt pair style does not exist
Self-explanatory
E: Fix adapt pair style param not supported
The pair style does not know about the parameter you specified.
+E: Fix adapt pair style param is not compatible
+
+Self-explanatory
+
E: Fix adapt type pair range is not valid for pair hybrid sub-style
Self-explanatory.
E: Fix adapt kspace style does not exist
Self-explanatory.
E: Fix adapt requires atom attribute diameter
The atom style being used does not specify an atom diameter.
E: Fix adapt requires atom attribute charge
The atom style being used does not specify an atom charge.
E: Could not find fix adapt storage fix ID
This should not happen unless you explicitly deleted
a secondary fix that fix adapt created internally.
*/
diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp
index c71ffbc3f..9e857339b 100644
--- a/src/fix_langevin.cpp
+++ b/src/fix_langevin.cpp
@@ -1,919 +1,923 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing authors: Carolyn Phillips (U Mich), reservoir energy tally
Aidan Thompson (SNL) GJF formulation
------------------------------------------------------------------------- */
#include <mpi.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "fix_langevin.h"
#include "math_extra.h"
#include "atom.h"
#include "atom_vec_ellipsoid.h"
#include "force.h"
#include "update.h"
#include "modify.h"
#include "compute.h"
#include "domain.h"
#include "region.h"
#include "respa.h"
#include "comm.h"
#include "input.h"
#include "variable.h"
#include "random_mars.h"
#include "memory.h"
#include "error.h"
#include "group.h"
using namespace LAMMPS_NS;
using namespace FixConst;
enum{NOBIAS,BIAS};
enum{CONSTANT,EQUAL,ATOM};
#define SINERTIA 0.4 // moment of inertia prefactor for sphere
#define EINERTIA 0.2 // moment of inertia prefactor for ellipsoid
/* ---------------------------------------------------------------------- */
FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 7) error->all(FLERR,"Illegal fix langevin command");
dynamic_group_allow = 1;
scalar_flag = 1;
global_freq = 1;
extscalar = 1;
nevery = 1;
tstr = NULL;
if (strstr(arg[3],"v_") == arg[3]) {
int n = strlen(&arg[3][2]) + 1;
tstr = new char[n];
strcpy(tstr,&arg[3][2]);
} else {
t_start = force->numeric(FLERR,arg[3]);
t_target = t_start;
tstyle = CONSTANT;
}
t_stop = force->numeric(FLERR,arg[4]);
t_period = force->numeric(FLERR,arg[5]);
seed = force->inumeric(FLERR,arg[6]);
if (t_period <= 0.0) error->all(FLERR,"Fix langevin period must be > 0.0");
if (seed <= 0) error->all(FLERR,"Illegal fix langevin command");
// initialize Marsaglia RNG with processor-unique seed
random = new RanMars(lmp,seed + comm->me);
// allocate per-type arrays for force prefactors
gfactor1 = new double[atom->ntypes+1];
gfactor2 = new double[atom->ntypes+1];
ratio = new double[atom->ntypes+1];
// optional args
for (int i = 1; i <= atom->ntypes; i++) ratio[i] = 1.0;
ascale = 0.0;
gjfflag = 0;
oflag = 0;
tallyflag = 0;
zeroflag = 0;
int iarg = 7;
while (iarg < narg) {
if (strcmp(arg[iarg],"angmom") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command");
if (strcmp(arg[iarg+1],"no") == 0) ascale = 0.0;
else ascale = force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"gjf") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command");
if (strcmp(arg[iarg+1],"no") == 0) gjfflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) gjfflag = 1;
else error->all(FLERR,"Illegal fix langevin command");
iarg += 2;
} else if (strcmp(arg[iarg],"omega") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command");
if (strcmp(arg[iarg+1],"no") == 0) oflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) oflag = 1;
else error->all(FLERR,"Illegal fix langevin command");
iarg += 2;
} else if (strcmp(arg[iarg],"scale") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix langevin command");
int itype = force->inumeric(FLERR,arg[iarg+1]);
double scale = force->numeric(FLERR,arg[iarg+2]);
if (itype <= 0 || itype > atom->ntypes)
error->all(FLERR,"Illegal fix langevin command");
ratio[itype] = scale;
iarg += 3;
} else if (strcmp(arg[iarg],"tally") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command");
if (strcmp(arg[iarg+1],"no") == 0) tallyflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) tallyflag = 1;
else error->all(FLERR,"Illegal fix langevin command");
iarg += 2;
} else if (strcmp(arg[iarg],"zero") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command");
if (strcmp(arg[iarg+1],"no") == 0) zeroflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) zeroflag = 1;
else error->all(FLERR,"Illegal fix langevin command");
iarg += 2;
} else error->all(FLERR,"Illegal fix langevin command");
}
// set temperature = NULL, user can override via fix_modify if wants bias
id_temp = NULL;
temperature = NULL;
+ energy = 0.0;
+
// flangevin is unallocated until first call to setup()
- // compute_scalar checks for this and returns 0.0 if flangevin is NULL
+ // compute_scalar checks for this and returns 0.0
+ // if flangevin_allocated is not set
- energy = 0.0;
flangevin = NULL;
+ flangevin_allocated = 0;
franprev = NULL;
tforce = NULL;
maxatom1 = maxatom2 = 0;
// Setup atom-based array for franprev
// register with Atom class
// No need to set peratom_flag
// as this data is for internal use only
if (gjfflag) {
nvalues = 3;
grow_arrays(atom->nmax);
atom->add_callback(0);
// initialize franprev to zero
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
franprev[i][0] = 0.0;
franprev[i][1] = 0.0;
franprev[i][2] = 0.0;
}
}
if (tallyflag && zeroflag && comm->me == 0)
error->warning(FLERR,"Energy tally does not account for 'zero yes'");
}
/* ---------------------------------------------------------------------- */
FixLangevin::~FixLangevin()
{
delete random;
delete [] tstr;
delete [] gfactor1;
delete [] gfactor2;
delete [] ratio;
delete [] id_temp;
memory->destroy(flangevin);
memory->destroy(tforce);
if (gjfflag) {
memory->destroy(franprev);
atom->delete_callback(id,0);
}
}
/* ---------------------------------------------------------------------- */
int FixLangevin::setmask()
{
int mask = 0;
mask |= POST_FORCE;
mask |= POST_FORCE_RESPA;
mask |= END_OF_STEP;
mask |= THERMO_ENERGY;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixLangevin::init()
{
if (oflag && !atom->sphere_flag)
error->all(FLERR,"Fix langevin omega requires atom style sphere");
if (ascale && !atom->ellipsoid_flag)
error->all(FLERR,"Fix langevin angmom requires atom style ellipsoid");
// check variable
if (tstr) {
tvar = input->variable->find(tstr);
if (tvar < 0)
error->all(FLERR,"Variable name for fix langevin does not exist");
if (input->variable->equalstyle(tvar)) tstyle = EQUAL;
else if (input->variable->atomstyle(tvar)) tstyle = ATOM;
else error->all(FLERR,"Variable for fix langevin is invalid style");
}
// if oflag or ascale set, check that all group particles are finite-size
if (oflag) {
double *radius = atom->radius;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (radius[i] == 0.0)
error->one(FLERR,"Fix langevin omega requires extended particles");
}
if (ascale) {
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all(FLERR,"Fix langevin angmom requires atom style ellipsoid");
int *ellipsoid = atom->ellipsoid;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (ellipsoid[i] < 0)
error->one(FLERR,"Fix langevin angmom requires extended particles");
}
// set force prefactors
if (!atom->rmass) {
for (int i = 1; i <= atom->ntypes; i++) {
gfactor1[i] = -atom->mass[i] / t_period / force->ftm2v;
gfactor2[i] = sqrt(atom->mass[i]) *
sqrt(24.0*force->boltz/t_period/update->dt/force->mvv2e) /
force->ftm2v;
gfactor1[i] *= 1.0/ratio[i];
gfactor2[i] *= 1.0/sqrt(ratio[i]);
}
}
if (temperature && temperature->tempbias) tbiasflag = BIAS;
else tbiasflag = NOBIAS;
if (strstr(update->integrate_style,"respa"))
nlevels_respa = ((Respa *) update->integrate)->nlevels;
if (gjfflag) gjffac = 1.0/(1.0+update->dt/2.0/t_period);
}
/* ---------------------------------------------------------------------- */
void FixLangevin::setup(int vflag)
{
if (strstr(update->integrate_style,"verlet"))
post_force(vflag);
else {
((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1);
post_force_respa(vflag,nlevels_respa-1,0);
((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1);
}
}
/* ---------------------------------------------------------------------- */
void FixLangevin::post_force(int vflag)
{
double *rmass = atom->rmass;
// enumerate all 2^6 possibilities for template parameters
// this avoids testing them inside inner loop:
// TSTYLEATOM, GJF, TALLY, BIAS, RMASS, ZERO
#ifdef TEMPLATED_FIX_LANGEVIN
if (tstyle == ATOM)
if (gjfflag)
if (tallyflag)
if (tbiasflag == BIAS)
if (rmass)
if (zeroflag) post_force_templated<1,1,1,1,1,1>();
else post_force_templated<1,1,1,1,1,0>();
else
if (zeroflag) post_force_templated<1,1,1,1,0,1>();
else post_force_templated<1,1,1,1,0,0>();
else
if (rmass)
if (zeroflag) post_force_templated<1,1,1,0,1,1>();
else post_force_templated<1,1,1,0,1,0>();
else
if (zeroflag) post_force_templated<1,1,1,0,0,1>();
else post_force_templated<1,1,1,0,0,0>();
else
if (tbiasflag == BIAS)
if (rmass)
if (zeroflag) post_force_templated<1,1,0,1,1,1>();
else post_force_templated<1,1,0,1,1,0>();
else
if (zeroflag) post_force_templated<1,1,0,1,0,1>();
else post_force_templated<1,1,0,1,0,0>();
else
if (rmass)
if (zeroflag) post_force_templated<1,1,0,0,1,1>();
else post_force_templated<1,1,0,0,1,0>();
else
if (zeroflag) post_force_templated<1,1,0,0,0,1>();
else post_force_templated<1,1,0,0,0,0>();
else
if (tallyflag)
if (tbiasflag == BIAS)
if (rmass)
if (zeroflag) post_force_templated<1,0,1,1,1,1>();
else post_force_templated<1,0,1,1,1,0>();
else
if (zeroflag) post_force_templated<1,0,1,1,0,1>();
else post_force_templated<1,0,1,1,0,0>();
else
if (rmass)
if (zeroflag) post_force_templated<1,0,1,0,1,1>();
else post_force_templated<1,0,1,0,1,0>();
else
if (zeroflag) post_force_templated<1,0,1,0,0,1>();
else post_force_templated<1,0,1,0,0,0>();
else
if (tbiasflag == BIAS)
if (rmass)
if (zeroflag) post_force_templated<1,0,0,1,1,1>();
else post_force_templated<1,0,0,1,1,0>();
else
if (zeroflag) post_force_templated<1,0,0,1,0,1>();
else post_force_templated<1,0,0,1,0,0>();
else
if (rmass)
if (zeroflag) post_force_templated<1,0,0,0,1,1>();
else post_force_templated<1,0,0,0,1,0>();
else
if (zeroflag) post_force_templated<1,0,0,0,0,1>();
else post_force_templated<1,0,0,0,0,0>();
else
if (gjfflag)
if (tallyflag)
if (tbiasflag == BIAS)
if (rmass)
if (zeroflag) post_force_templated<0,1,1,1,1,1>();
else post_force_templated<0,1,1,1,1,0>();
else
if (zeroflag) post_force_templated<0,1,1,1,0,1>();
else post_force_templated<0,1,1,1,0,0>();
else
if (rmass)
if (zeroflag) post_force_templated<0,1,1,0,1,1>();
else post_force_templated<0,1,1,0,1,0>();
else
if (zeroflag) post_force_templated<0,1,1,0,0,1>();
else post_force_templated<0,1,1,0,0,0>();
else
if (tbiasflag == BIAS)
if (rmass)
if (zeroflag) post_force_templated<0,1,0,1,1,1>();
else post_force_templated<0,1,0,1,1,0>();
else
if (zeroflag) post_force_templated<0,1,0,1,0,1>();
else post_force_templated<0,1,0,1,0,0>();
else
if (rmass)
if (zeroflag) post_force_templated<0,1,0,0,1,1>();
else post_force_templated<0,1,0,0,1,0>();
else
if (zeroflag) post_force_templated<0,1,0,0,0,1>();
else post_force_templated<0,1,0,0,0,0>();
else
if (tallyflag)
if (tbiasflag == BIAS)
if (rmass)
if (zeroflag) post_force_templated<0,0,1,1,1,1>();
else post_force_templated<0,0,1,1,1,0>();
else
if (zeroflag) post_force_templated<0,0,1,1,0,1>();
else post_force_templated<0,0,1,1,0,0>();
else
if (rmass)
if (zeroflag) post_force_templated<0,0,1,0,1,1>();
else post_force_templated<0,0,1,0,1,0>();
else
if (zeroflag) post_force_templated<0,0,1,0,0,1>();
else post_force_templated<0,0,1,0,0,0>();
else
if (tbiasflag == BIAS)
if (rmass)
if (zeroflag) post_force_templated<0,0,0,1,1,1>();
else post_force_templated<0,0,0,1,1,0>();
else
if (zeroflag) post_force_templated<0,0,0,1,0,1>();
else post_force_templated<0,0,0,1,0,0>();
else
if (rmass)
if (zeroflag) post_force_templated<0,0,0,0,1,1>();
else post_force_templated<0,0,0,0,1,0>();
else
if (zeroflag) post_force_templated<0,0,0,0,0,1>();
else post_force_templated<0,0,0,0,0,0>();
#else
post_force_untemplated(int(tstyle==ATOM), gjfflag, tallyflag,
int(tbiasflag==BIAS), int(rmass!=NULL), zeroflag);
#endif
}
/* ---------------------------------------------------------------------- */
void FixLangevin::post_force_respa(int vflag, int ilevel, int iloop)
{
if (ilevel == nlevels_respa-1) post_force(vflag);
}
/* ----------------------------------------------------------------------
modify forces using one of the many Langevin styles
------------------------------------------------------------------------- */
#ifdef TEMPLATED_FIX_LANGEVIN
template < int Tp_TSTYLEATOM, int Tp_GJF, int Tp_TALLY,
int Tp_BIAS, int Tp_RMASS, int Tp_ZERO >
void FixLangevin::post_force_templated()
#else
void FixLangevin::post_force_untemplated
(int Tp_TSTYLEATOM, int Tp_GJF, int Tp_TALLY,
int Tp_BIAS, int Tp_RMASS, int Tp_ZERO)
#endif
{
double gamma1,gamma2;
double **v = atom->v;
double **f = atom->f;
double *rmass = atom->rmass;
int *type = atom->type;
int *mask = atom->mask;
int nlocal = atom->nlocal;
// apply damping and thermostat to atoms in group
// for Tp_TSTYLEATOM:
// use per-atom per-coord target temperature
// for Tp_GJF:
// use Gronbech-Jensen/Farago algorithm
// else use regular algorithm
// for Tp_TALLY:
// store drag plus random forces in flangevin[nlocal][3]
// for Tp_BIAS:
// calculate temperature since some computes require temp
// computed on current nlocal atoms to remove bias
// test v = 0 since some computes mask non-participating atoms via v = 0
// and added force has extra term not multiplied by v = 0
// for Tp_RMASS:
// use per-atom masses
// else use per-type masses
// for Tp_ZERO:
// sum random force over all atoms in group
// subtract sum/count from each atom in group
double fdrag[3],fran[3],fsum[3],fsumall[3];
bigint count;
double fswap;
double boltz = force->boltz;
double dt = update->dt;
double mvv2e = force->mvv2e;
double ftm2v = force->ftm2v;
compute_target();
if (Tp_ZERO) {
fsum[0] = fsum[1] = fsum[2] = 0.0;
count = group->count(igroup);
if (count == 0)
error->all(FLERR,"Cannot zero Langevin force of 0 atoms");
}
// reallocate flangevin if necessary
if (Tp_TALLY) {
if (atom->nlocal > maxatom1) {
memory->destroy(flangevin);
maxatom1 = atom->nmax;
memory->create(flangevin,maxatom1,3,"langevin:flangevin");
}
+ flangevin_allocated = 1;
}
if (Tp_BIAS) temperature->compute_scalar();
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
if (Tp_TSTYLEATOM) tsqrt = sqrt(tforce[i]);
if (Tp_RMASS) {
gamma1 = -rmass[i] / t_period / ftm2v;
gamma2 = sqrt(rmass[i]) * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
gamma1 *= 1.0/ratio[type[i]];
gamma2 *= 1.0/sqrt(ratio[type[i]]) * tsqrt;
} else {
gamma1 = gfactor1[type[i]];
gamma2 = gfactor2[type[i]] * tsqrt;
}
fran[0] = gamma2*(random->uniform()-0.5);
fran[1] = gamma2*(random->uniform()-0.5);
fran[2] = gamma2*(random->uniform()-0.5);
if (Tp_BIAS) {
temperature->remove_bias(i,v[i]);
fdrag[0] = gamma1*v[i][0];
fdrag[1] = gamma1*v[i][1];
fdrag[2] = gamma1*v[i][2];
if (v[i][0] == 0.0) fran[0] = 0.0;
if (v[i][1] == 0.0) fran[1] = 0.0;
if (v[i][2] == 0.0) fran[2] = 0.0;
temperature->restore_bias(i,v[i]);
} else {
fdrag[0] = gamma1*v[i][0];
fdrag[1] = gamma1*v[i][1];
fdrag[2] = gamma1*v[i][2];
}
if (Tp_GJF) {
fswap = 0.5*(fran[0]+franprev[i][0]);
franprev[i][0] = fran[0];
fran[0] = fswap;
fswap = 0.5*(fran[1]+franprev[i][1]);
franprev[i][1] = fran[1];
fran[1] = fswap;
fswap = 0.5*(fran[2]+franprev[i][2]);
franprev[i][2] = fran[2];
fran[2] = fswap;
fdrag[0] *= gjffac;
fdrag[1] *= gjffac;
fdrag[2] *= gjffac;
fran[0] *= gjffac;
fran[1] *= gjffac;
fran[2] *= gjffac;
f[i][0] *= gjffac;
f[i][1] *= gjffac;
f[i][2] *= gjffac;
}
f[i][0] += fdrag[0] + fran[0];
f[i][1] += fdrag[1] + fran[1];
f[i][2] += fdrag[2] + fran[2];
if (Tp_TALLY) {
flangevin[i][0] = fdrag[0] + fran[0];
flangevin[i][1] = fdrag[1] + fran[1];
flangevin[i][2] = fdrag[2] + fran[2];
}
if (Tp_ZERO) {
fsum[0] += fran[0];
fsum[1] += fran[1];
fsum[2] += fran[2];
}
}
}
// set total force to zero
if (Tp_ZERO) {
MPI_Allreduce(fsum,fsumall,3,MPI_DOUBLE,MPI_SUM,world);
fsumall[0] /= count;
fsumall[1] /= count;
fsumall[2] /= count;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
f[i][0] -= fsumall[0];
f[i][1] -= fsumall[1];
f[i][2] -= fsumall[2];
}
}
}
// thermostat omega and angmom
if (oflag) omega_thermostat();
if (ascale) angmom_thermostat();
}
/* ----------------------------------------------------------------------
set current t_target and t_sqrt
------------------------------------------------------------------------- */
void FixLangevin::compute_target()
{
int *mask = atom->mask;
int nlocal = atom->nlocal;
double delta = update->ntimestep - update->beginstep;
if (delta != 0.0) delta /= update->endstep - update->beginstep;
// if variable temp, evaluate variable, wrap with clear/add
// reallocate tforce array if necessary
if (tstyle == CONSTANT) {
t_target = t_start + delta * (t_stop-t_start);
tsqrt = sqrt(t_target);
} else {
modify->clearstep_compute();
if (tstyle == EQUAL) {
t_target = input->variable->compute_equal(tvar);
if (t_target < 0.0)
error->one(FLERR,"Fix langevin variable returned negative temperature");
tsqrt = sqrt(t_target);
} else {
if (nlocal > maxatom2) {
maxatom2 = atom->nmax;
memory->destroy(tforce);
memory->create(tforce,maxatom2,"langevin:tforce");
}
input->variable->compute_atom(tvar,igroup,tforce,1,0);
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (tforce[i] < 0.0)
error->one(FLERR,
"Fix langevin variable returned negative temperature");
}
modify->addstep_compute(update->ntimestep + 1);
}
}
/* ----------------------------------------------------------------------
thermostat rotational dof via omega
------------------------------------------------------------------------- */
void FixLangevin::omega_thermostat()
{
double gamma1,gamma2;
double boltz = force->boltz;
double dt = update->dt;
double mvv2e = force->mvv2e;
double ftm2v = force->ftm2v;
double **torque = atom->torque;
double **omega = atom->omega;
double *radius = atom->radius;
double *rmass = atom->rmass;
int *mask = atom->mask;
int *type = atom->type;
int nlocal = atom->nlocal;
// rescale gamma1/gamma2 by 10/3 & sqrt(10/3) for spherical particles
// does not affect rotational thermosatting
// gives correct rotational diffusivity behavior
double tendivthree = 10.0/3.0;
double tran[3];
double inertiaone;
for (int i = 0; i < nlocal; i++) {
if ((mask[i] & groupbit) && (radius[i] > 0.0)) {
inertiaone = SINERTIA*radius[i]*radius[i]*rmass[i];
if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
gamma1 = -tendivthree*inertiaone / t_period / ftm2v;
gamma2 = sqrt(inertiaone) * sqrt(80.0*boltz/t_period/dt/mvv2e) / ftm2v;
gamma1 *= 1.0/ratio[type[i]];
gamma2 *= 1.0/sqrt(ratio[type[i]]) * tsqrt;
tran[0] = gamma2*(random->uniform()-0.5);
tran[1] = gamma2*(random->uniform()-0.5);
tran[2] = gamma2*(random->uniform()-0.5);
torque[i][0] += gamma1*omega[i][0] + tran[0];
torque[i][1] += gamma1*omega[i][1] + tran[1];
torque[i][2] += gamma1*omega[i][2] + tran[2];
}
}
}
/* ----------------------------------------------------------------------
thermostat rotational dof via angmom
------------------------------------------------------------------------- */
void FixLangevin::angmom_thermostat()
{
double gamma1,gamma2;
double boltz = force->boltz;
double dt = update->dt;
double mvv2e = force->mvv2e;
double ftm2v = force->ftm2v;
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
double **torque = atom->torque;
double **angmom = atom->angmom;
double *rmass = atom->rmass;
int *ellipsoid = atom->ellipsoid;
int *mask = atom->mask;
int *type = atom->type;
int nlocal = atom->nlocal;
// rescale gamma1/gamma2 by ascale for aspherical particles
// does not affect rotational thermosatting
// gives correct rotational diffusivity behavior if (nearly) spherical
// any value will be incorrect for rotational diffusivity if aspherical
double inertia[3],omega[3],tran[3];
double *shape,*quat;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
shape = bonus[ellipsoid[i]].shape;
inertia[0] = EINERTIA*rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]);
inertia[1] = EINERTIA*rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]);
inertia[2] = EINERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]);
quat = bonus[ellipsoid[i]].quat;
MathExtra::mq_to_omega(angmom[i],quat,inertia,omega);
if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
gamma1 = -ascale / t_period / ftm2v;
gamma2 = sqrt(ascale*24.0*boltz/t_period/dt/mvv2e) / ftm2v;
gamma1 *= 1.0/ratio[type[i]];
gamma2 *= 1.0/sqrt(ratio[type[i]]) * tsqrt;
tran[0] = sqrt(inertia[0])*gamma2*(random->uniform()-0.5);
tran[1] = sqrt(inertia[1])*gamma2*(random->uniform()-0.5);
tran[2] = sqrt(inertia[2])*gamma2*(random->uniform()-0.5);
torque[i][0] += inertia[0]*gamma1*omega[0] + tran[0];
torque[i][1] += inertia[1]*gamma1*omega[1] + tran[1];
torque[i][2] += inertia[2]*gamma1*omega[2] + tran[2];
}
}
}
/* ----------------------------------------------------------------------
tally energy transfer to thermal reservoir
------------------------------------------------------------------------- */
void FixLangevin::end_of_step()
{
if (!tallyflag) return;
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
energy_onestep = 0.0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] +
flangevin[i][2]*v[i][2];
energy += energy_onestep*update->dt;
}
/* ---------------------------------------------------------------------- */
void FixLangevin::reset_target(double t_new)
{
t_target = t_start = t_stop = t_new;
}
/* ---------------------------------------------------------------------- */
void FixLangevin::reset_dt()
{
if (atom->mass) {
for (int i = 1; i <= atom->ntypes; i++) {
gfactor2[i] = sqrt(atom->mass[i]) *
sqrt(24.0*force->boltz/t_period/update->dt/force->mvv2e) /
force->ftm2v;
gfactor2[i] *= 1.0/sqrt(ratio[i]);
}
}
}
/* ---------------------------------------------------------------------- */
int FixLangevin::modify_param(int narg, char **arg)
{
if (strcmp(arg[0],"temp") == 0) {
if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
delete [] id_temp;
int n = strlen(arg[1]) + 1;
id_temp = new char[n];
strcpy(id_temp,arg[1]);
int icompute = modify->find_compute(id_temp);
if (icompute < 0)
error->all(FLERR,"Could not find fix_modify temperature ID");
temperature = modify->compute[icompute];
if (temperature->tempflag == 0)
error->all(FLERR,
"Fix_modify temperature ID does not compute temperature");
if (temperature->igroup != igroup && comm->me == 0)
error->warning(FLERR,"Group for fix_modify temp != fix group");
return 2;
}
return 0;
}
/* ---------------------------------------------------------------------- */
double FixLangevin::compute_scalar()
{
- if (!tallyflag || flangevin == NULL) return 0.0;
+ if (!tallyflag || !flangevin_allocated) return 0.0;
// capture the very first energy transfer to thermal reservoir
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (update->ntimestep == update->beginstep) {
energy_onestep = 0.0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] +
flangevin[i][2]*v[i][2];
energy = 0.5*energy_onestep*update->dt;
}
// convert midstep energy back to previous fullstep energy
double energy_me = energy - 0.5*energy_onestep*update->dt;
double energy_all;
MPI_Allreduce(&energy_me,&energy_all,1,MPI_DOUBLE,MPI_SUM,world);
return -energy_all;
}
/* ----------------------------------------------------------------------
extract thermostat properties
------------------------------------------------------------------------- */
void *FixLangevin::extract(const char *str, int &dim)
{
dim = 0;
if (strcmp(str,"t_target") == 0) {
return &t_target;
}
return NULL;
}
/* ----------------------------------------------------------------------
memory usage of tally array
------------------------------------------------------------------------- */
double FixLangevin::memory_usage()
{
double bytes = 0.0;
if (gjfflag) bytes += atom->nmax*3 * sizeof(double);
if (tallyflag) bytes += atom->nmax*3 * sizeof(double);
if (tforce) bytes += atom->nmax * sizeof(double);
return bytes;
}
/* ----------------------------------------------------------------------
allocate atom-based array for franprev
------------------------------------------------------------------------- */
void FixLangevin::grow_arrays(int nmax)
{
memory->grow(franprev,nmax,3,"fix_langevin:franprev");
}
/* ----------------------------------------------------------------------
copy values within local atom-based array
------------------------------------------------------------------------- */
void FixLangevin::copy_arrays(int i, int j, int delflag)
{
for (int m = 0; m < nvalues; m++)
franprev[j][m] = franprev[i][m];
}
/* ----------------------------------------------------------------------
pack values in local atom-based array for exchange with another proc
------------------------------------------------------------------------- */
int FixLangevin::pack_exchange(int i, double *buf)
{
for (int m = 0; m < nvalues; m++) buf[m] = franprev[i][m];
return nvalues;
}
/* ----------------------------------------------------------------------
unpack values in local atom-based array from exchange with another proc
------------------------------------------------------------------------- */
int FixLangevin::unpack_exchange(int nlocal, double *buf)
{
for (int m = 0; m < nvalues; m++) franprev[nlocal][m] = buf[m];
return nvalues;
}
diff --git a/src/fix_langevin.h b/src/fix_langevin.h
index 1e084c9e9..863c0f554 100644
--- a/src/fix_langevin.h
+++ b/src/fix_langevin.h
@@ -1,159 +1,160 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(langevin,FixLangevin)
#else
#ifndef LMP_FIX_LANGEVIN_H
#define LMP_FIX_LANGEVIN_H
#include "fix.h"
namespace LAMMPS_NS {
class FixLangevin : public Fix {
public:
FixLangevin(class LAMMPS *, int, char **);
virtual ~FixLangevin();
int setmask();
void init();
void setup(int);
virtual void post_force(int);
void post_force_respa(int, int, int);
virtual void end_of_step();
void reset_target(double);
void reset_dt();
int modify_param(int, char **);
virtual double compute_scalar();
double memory_usage();
virtual void *extract(const char *, int &);
void grow_arrays(int);
void copy_arrays(int, int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
protected:
int gjfflag,oflag,tallyflag,zeroflag,tbiasflag;
+ int flangevin_allocated;
double ascale;
double t_start,t_stop,t_period,t_target;
double *gfactor1,*gfactor2,*ratio;
double energy,energy_onestep;
double tsqrt;
int tstyle,tvar;
double gjffac;
char *tstr;
class AtomVecEllipsoid *avec;
int maxatom1,maxatom2;
double **flangevin;
double *tforce;
double **franprev;
int nvalues;
char *id_temp;
class Compute *temperature;
int nlevels_respa;
class RanMars *random;
int seed;
// comment next line to turn off templating
#define TEMPLATED_FIX_LANGEVIN
#ifdef TEMPLATED_FIX_LANGEVIN
template < int Tp_TSTYLEATOM, int Tp_GJF, int Tp_TALLY,
int Tp_BIAS, int Tp_RMASS, int Tp_ZERO >
void post_force_templated();
#else
void post_force_untemplated(int, int, int,
int, int, int);
#endif
void omega_thermostat();
void angmom_thermostat();
void compute_target();
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Fix langevin period must be > 0.0
The time window for temperature relaxation must be > 0
W: Energy tally does not account for 'zero yes'
The energy removed by using the 'zero yes' flag is not accounted
for in the energy tally and thus energy conservation cannot be
monitored in this case.
E: Fix langevin omega requires atom style sphere
Self-explanatory.
E: Fix langevin angmom requires atom style ellipsoid
Self-explanatory.
E: Variable name for fix langevin does not exist
Self-explanatory.
E: Variable for fix langevin is invalid style
It must be an equal-style variable.
E: Fix langevin omega requires extended particles
One of the particles has radius 0.0.
E: Fix langevin angmom requires extended particles
This fix option cannot be used with point paritlces.
E: Cannot zero Langevin force of 0 atoms
The group has zero atoms, so you cannot request its force
be zeroed.
E: Fix langevin variable returned negative temperature
Self-explanatory.
E: Could not find fix_modify temperature ID
The compute ID for computing temperature does not exist.
E: Fix_modify temperature ID does not compute temperature
The compute ID assigned to the fix must compute temperature.
W: Group for fix_modify temp != fix group
The fix_modify command is specifying a temperature computation that
computes a temperature on a different group of atoms than the fix
itself operates on. This is probably not what you want to do.
*/
diff --git a/src/fix_move.cpp b/src/fix_move.cpp
index e1f522177..a0530f220 100644
--- a/src/fix_move.cpp
+++ b/src/fix_move.cpp
@@ -1,1017 +1,1253 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "fix_move.h"
#include "atom.h"
#include "group.h"
#include "update.h"
#include "modify.h"
#include "force.h"
#include "domain.h"
#include "lattice.h"
#include "comm.h"
#include "respa.h"
#include "input.h"
#include "variable.h"
+#include "atom_vec_ellipsoid.h"
+#include "atom_vec_line.h"
+#include "atom_vec_tri.h"
+#include "atom_vec_body.h"
#include "math_const.h"
+#include "math_extra.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
using namespace MathConst;
enum{LINEAR,WIGGLE,ROTATE,VARIABLE};
enum{EQUAL,ATOM};
+#define INERTIA 0.2 // moment of inertia prefactor for ellipsoid
+
/* ---------------------------------------------------------------------- */
FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal fix move command");
restart_global = 1;
restart_peratom = 1;
peratom_flag = 1;
size_peratom_cols = 3;
peratom_freq = 1;
time_integrate = 1;
create_attribute = 1;
displaceflag = 0;
velocityflag = 0;
maxatom = 0;
// parse args
int iarg;
xvarstr = yvarstr = zvarstr = NULL;
vxvarstr = vyvarstr = vzvarstr = NULL;
if (strcmp(arg[3],"linear") == 0) {
if (narg < 7) error->all(FLERR,"Illegal fix move command");
iarg = 7;
mstyle = LINEAR;
if (strcmp(arg[4],"NULL") == 0) vxflag = 0;
else {
vxflag = 1;
vx = force->numeric(FLERR,arg[4]);
}
if (strcmp(arg[5],"NULL") == 0) vyflag = 0;
else {
vyflag = 1;
vy = force->numeric(FLERR,arg[5]);
}
if (strcmp(arg[6],"NULL") == 0) vzflag = 0;
else {
vzflag = 1;
vz = force->numeric(FLERR,arg[6]);
}
} else if (strcmp(arg[3],"wiggle") == 0) {
if (narg < 8) error->all(FLERR,"Illegal fix move command");
iarg = 8;
mstyle = WIGGLE;
if (strcmp(arg[4],"NULL") == 0) axflag = 0;
else {
axflag = 1;
ax = force->numeric(FLERR,arg[4]);
}
if (strcmp(arg[5],"NULL") == 0) ayflag = 0;
else {
ayflag = 1;
ay = force->numeric(FLERR,arg[5]);
}
if (strcmp(arg[6],"NULL") == 0) azflag = 0;
else {
azflag = 1;
az = force->numeric(FLERR,arg[6]);
}
period = force->numeric(FLERR,arg[7]);
} else if (strcmp(arg[3],"rotate") == 0) {
if (narg < 11) error->all(FLERR,"Illegal fix move command");
iarg = 11;
mstyle = ROTATE;
point[0] = force->numeric(FLERR,arg[4]);
point[1] = force->numeric(FLERR,arg[5]);
point[2] = force->numeric(FLERR,arg[6]);
axis[0] = force->numeric(FLERR,arg[7]);
axis[1] = force->numeric(FLERR,arg[8]);
axis[2] = force->numeric(FLERR,arg[9]);
period = force->numeric(FLERR,arg[10]);
} else if (strcmp(arg[3],"variable") == 0) {
if (narg < 10) error->all(FLERR,"Illegal fix move command");
iarg = 10;
mstyle = VARIABLE;
if (strcmp(arg[4],"NULL") == 0) xvarstr = NULL;
else if (strstr(arg[4],"v_") == arg[4]) {
int n = strlen(&arg[4][2]) + 1;
xvarstr = new char[n];
strcpy(xvarstr,&arg[4][2]);
} else error->all(FLERR,"Illegal fix move command");
if (strcmp(arg[5],"NULL") == 0) yvarstr = NULL;
else if (strstr(arg[5],"v_") == arg[5]) {
int n = strlen(&arg[5][2]) + 1;
yvarstr = new char[n];
strcpy(yvarstr,&arg[5][2]);
} else error->all(FLERR,"Illegal fix move command");
if (strcmp(arg[6],"NULL") == 0) zvarstr = NULL;
else if (strstr(arg[6],"v_") == arg[6]) {
int n = strlen(&arg[6][2]) + 1;
zvarstr = new char[n];
strcpy(zvarstr,&arg[6][2]);
} else error->all(FLERR,"Illegal fix move command");
if (strcmp(arg[7],"NULL") == 0) vxvarstr = NULL;
else if (strstr(arg[7],"v_") == arg[7]) {
int n = strlen(&arg[7][2]) + 1;
vxvarstr = new char[n];
strcpy(vxvarstr,&arg[7][2]);
} else error->all(FLERR,"Illegal fix move command");
if (strcmp(arg[8],"NULL") == 0) vyvarstr = NULL;
else if (strstr(arg[8],"v_") == arg[8]) {
int n = strlen(&arg[8][2]) + 1;
vyvarstr = new char[n];
strcpy(vyvarstr,&arg[8][2]);
} else error->all(FLERR,"Illegal fix move command");
if (strcmp(arg[9],"NULL") == 0) vzvarstr = NULL;
else if (strstr(arg[9],"v_") == arg[9]) {
int n = strlen(&arg[9][2]) + 1;
vzvarstr = new char[n];
strcpy(vzvarstr,&arg[9][2]);
} else error->all(FLERR,"Illegal fix move command");
} else error->all(FLERR,"Illegal fix move command");
// optional args
int scaleflag = 1;
while (iarg < narg) {
if (strcmp(arg[iarg],"units") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix move command");
if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
else error->all(FLERR,"Illegal fix move command");
iarg += 2;
} else error->all(FLERR,"Illegal fix move command");
}
// error checks and warnings
if (domain->dimension == 2) {
if (mstyle == LINEAR && vzflag && vz != 0.0)
error->all(FLERR,"Fix move cannot set linear z motion for 2d problem");
if (mstyle == WIGGLE && azflag && az != 0.0)
error->all(FLERR,"Fix move cannot set wiggle z motion for 2d problem");
if (mstyle == ROTATE && (axis[0] != 0.0 || axis[1] != 0.0))
error->all(FLERR,
"Fix move cannot rotate aroung non z-axis for 2d problem");
if (mstyle == VARIABLE && (zvarstr || vzvarstr))
error->all(FLERR,
"Fix move cannot define z or vz variable for 2d problem");
}
if (atom->angmom_flag && comm->me == 0)
error->warning(FLERR,"Fix move does not update angular momentum");
if (atom->ellipsoid_flag && comm->me == 0)
error->warning(FLERR,"Fix move does not update quaternions");
// setup scaling and apply scaling factors to velocity & amplitude
if ((mstyle == LINEAR || mstyle == WIGGLE || mstyle == ROTATE) &&
scaleflag) {
double xscale = domain->lattice->xlattice;
double yscale = domain->lattice->ylattice;
double zscale = domain->lattice->zlattice;
if (mstyle == LINEAR) {
if (vxflag) vx *= xscale;
if (vyflag) vy *= yscale;
if (vzflag) vz *= zscale;
} else if (mstyle == WIGGLE) {
if (axflag) ax *= xscale;
if (ayflag) ay *= yscale;
if (azflag) az *= zscale;
} else if (mstyle == ROTATE) {
point[0] *= xscale;
point[1] *= yscale;
point[2] *= zscale;
}
}
// set omega_rotate from period
- if (mstyle == WIGGLE || mstyle == ROTATE) omega_rotate = 2.0*MY_PI / period;
+ if (mstyle == WIGGLE || mstyle == ROTATE) omega_rotate = MY_2PI / period;
// runit = unit vector along rotation axis
if (mstyle == ROTATE) {
double len = sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]);
if (len == 0.0)
error->all(FLERR,"Zero length rotation vector with fix move");
runit[0] = axis[0]/len;
runit[1] = axis[1]/len;
runit[2] = axis[2]/len;
}
- // set omega_flag if particles store omega
-
+ // set flags for extra attributes particles may store
+ // relevant extra attributes = omega, angmom, theta, quat
+
omega_flag = atom->omega_flag;
+ angmom_flag = atom->angmom_flag;
+
+ radius_flag = atom->radius_flag;
+ ellipsoid_flag = atom->ellipsoid_flag;
+ line_flag = atom->line_flag;
+ tri_flag = atom->tri_flag;
+ body_flag = atom->body_flag;
+ theta_flag = quat_flag = 0;
+ if (line_flag) theta_flag = 1;
+ if (ellipsoid_flag || tri_flag || body_flag) quat_flag = 1;
+
+ extra_flag = 0;
+ if (omega_flag || angmom_flag || theta_flag || quat_flag) extra_flag = 1;
+
// perform initial allocation of atom-based array
// register with Atom class
xoriginal = NULL;
+ toriginal = NULL;
+ qoriginal = NULL;
grow_arrays(atom->nmax);
atom->add_callback(0);
atom->add_callback(1);
displace = velocity = NULL;
+ // AtomVec pointers to retrieve per-atom storage of extra quantities
+
+ avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
+ avec_line = (AtomVecLine *) atom->style_match("line");
+ avec_tri = (AtomVecTri *) atom->style_match("tri");
+ avec_body = (AtomVecBody *) atom->style_match("body");
+
// xoriginal = initial unwrapped positions of atoms
+ // toriginal = initial theta of lines
+ // qoriginal = initial quat of extended particles
double **x = atom->x;
imageint *image = atom->image;
+ int *ellipsoid = atom->ellipsoid;
+ int *line = atom->line;
+ int *tri = atom->tri;
+ int *body = atom->body;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) domain->unmap(x[i],image[i],xoriginal[i]);
else xoriginal[i][0] = xoriginal[i][1] = xoriginal[i][2] = 0.0;
}
+ if (theta_flag) {
+ for (int i = 0; i < nlocal; i++) {
+ if ((mask[i] & groupbit) && line[i] >= 0)
+ toriginal[i] = avec_line->bonus[line[i]].theta;
+ else toriginal[i] = 0.0;
+ }
+ }
+
+ if (quat_flag) {
+ double *quat;
+ for (int i = 0; i < nlocal; i++) {
+ quat = NULL;
+ if (mask[i] & groupbit) {
+ if (ellipsoid_flag && ellipsoid[i] >= 0)
+ quat = avec_ellipsoid->bonus[ellipsoid[i]].quat;
+ else if (tri_flag && tri[i] >= 0)
+ quat = avec_tri->bonus[tri[i]].quat;
+ else if (body_flag && body[i] >= 0)
+ quat = avec_body->bonus[body[i]].quat;
+ }
+ if (quat) {
+ qoriginal[i][0] = quat[0];
+ qoriginal[i][1] = quat[1];
+ qoriginal[i][2] = quat[2];
+ qoriginal[i][3] = quat[3];
+ } else qoriginal[i][0] = qoriginal[i][1] =
+ qoriginal[i][2] = qoriginal[i][3] = 0.0;
+ }
+ }
+
+ // nrestart = size of per-atom restart data
+ // nrestart = 1 + xorig + torig + qorig
+
+ nrestart = 4;
+ if (theta_flag) nrestart++;
+ if (quat_flag) nrestart += 4;
+
+ // time origin for movement = current timestep
+
time_origin = update->ntimestep;
}
/* ---------------------------------------------------------------------- */
FixMove::~FixMove()
{
// unregister callbacks to this fix from Atom class
atom->delete_callback(id,0);
atom->delete_callback(id,1);
// delete locally stored arrays
memory->destroy(xoriginal);
+ memory->destroy(toriginal);
+ memory->destroy(qoriginal);
memory->destroy(displace);
memory->destroy(velocity);
delete [] xvarstr;
delete [] yvarstr;
delete [] zvarstr;
delete [] vxvarstr;
delete [] vyvarstr;
delete [] vzvarstr;
}
/* ---------------------------------------------------------------------- */
int FixMove::setmask()
{
int mask = 0;
mask |= INITIAL_INTEGRATE;
mask |= INITIAL_INTEGRATE_RESPA;
mask |= FINAL_INTEGRATE;
mask |= FINAL_INTEGRATE_RESPA;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixMove::init()
{
dt = update->dt;
dtv = update->dt;
dtf = 0.5 * update->dt * force->ftm2v;
// set indices and style of all variables
displaceflag = velocityflag = 0;
if (mstyle == VARIABLE) {
if (xvarstr) {
xvar = input->variable->find(xvarstr);
if (xvar < 0) error->all(FLERR,
"Variable name for fix move does not exist");
if (input->variable->equalstyle(xvar)) xvarstyle = EQUAL;
else if (input->variable->atomstyle(xvar)) xvarstyle = ATOM;
else error->all(FLERR,"Variable for fix move is invalid style");
}
if (yvarstr) {
yvar = input->variable->find(yvarstr);
if (yvar < 0) error->all(FLERR,
"Variable name for fix move does not exist");
if (input->variable->equalstyle(yvar)) yvarstyle = EQUAL;
else if (input->variable->atomstyle(yvar)) yvarstyle = ATOM;
else error->all(FLERR,"Variable for fix move is invalid style");
}
if (zvarstr) {
zvar = input->variable->find(zvarstr);
if (zvar < 0) error->all(FLERR,
"Variable name for fix move does not exist");
if (input->variable->equalstyle(zvar)) zvarstyle = EQUAL;
else if (input->variable->atomstyle(zvar)) zvarstyle = ATOM;
else error->all(FLERR,"Variable for fix move is invalid style");
}
if (vxvarstr) {
vxvar = input->variable->find(vxvarstr);
if (vxvar < 0) error->all(FLERR,
"Variable name for fix move does not exist");
if (input->variable->equalstyle(vxvar)) vxvarstyle = EQUAL;
else if (input->variable->atomstyle(vxvar)) vxvarstyle = ATOM;
else error->all(FLERR,"Variable for fix move is invalid style");
}
if (vyvarstr) {
vyvar = input->variable->find(vyvarstr);
if (vyvar < 0) error->all(FLERR,
"Variable name for fix move does not exist");
if (input->variable->equalstyle(vyvar)) vyvarstyle = EQUAL;
else if (input->variable->atomstyle(vyvar)) vyvarstyle = ATOM;
else error->all(FLERR,"Variable for fix move is invalid style");
}
if (vzvarstr) {
vzvar = input->variable->find(vzvarstr);
if (vzvar < 0) error->all(FLERR,
"Variable name for fix move does not exist");
if (input->variable->equalstyle(vzvar)) vzvarstyle = EQUAL;
else if (input->variable->atomstyle(vzvar)) vzvarstyle = ATOM;
else error->all(FLERR,"Variable for fix move is invalid style");
}
if (xvarstr && xvarstyle == ATOM) displaceflag = 1;
if (yvarstr && yvarstyle == ATOM) displaceflag = 1;
if (zvarstr && zvarstyle == ATOM) displaceflag = 1;
if (vxvarstr && vxvarstyle == ATOM) velocityflag = 1;
if (vyvarstr && vyvarstyle == ATOM) velocityflag = 1;
if (vzvarstr && vzvarstyle == ATOM) velocityflag = 1;
}
maxatom = atom->nmax;
memory->destroy(displace);
memory->destroy(velocity);
if (displaceflag) memory->create(displace,maxatom,3,"move:displace");
else displace = NULL;
if (velocityflag) memory->create(velocity,maxatom,3,"move:velocity");
else velocity = NULL;
if (strstr(update->integrate_style,"respa"))
nlevels_respa = ((Respa *) update->integrate)->nlevels;
}
/* ----------------------------------------------------------------------
set x,v of particles
------------------------------------------------------------------------- */
void FixMove::initial_integrate(int vflag)
{
- double dtfm;
- double xold[3],a[3],b[3],c[3],d[3],disp[3];
+ int flag;
double ddotr,dx,dy,dz;
+ double dtfm,theta_new;
+ double xold[3],a[3],b[3],c[3],d[3],disp[3],w[3],ex[3],ey[3],ez[3];
+ double inertia_ellipsoid[3],qrotate[4];
+ double *quat,*inertia,*shape;
double delta = (update->ntimestep - time_origin) * dt;
double **x = atom->x;
double **v = atom->v;
double **f = atom->f;
double **omega = atom->omega;
+ double **angmom = atom->angmom;
+ double *radius = atom->radius;
double *rmass = atom->rmass;
double *mass = atom->mass;
int *type = atom->type;
+ int *ellipsoid = atom->ellipsoid;
+ int *line = atom->line;
+ int *tri = atom->tri;
+ int *body = atom->body;
int *mask = atom->mask;
+
int nlocal = atom->nlocal;
// for linear: X = X0 + V*dt
if (mstyle == LINEAR) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
xold[0] = x[i][0];
xold[1] = x[i][1];
xold[2] = x[i][2];
if (vxflag) {
v[i][0] = vx;
x[i][0] = xoriginal[i][0] + vx*delta;
} else if (rmass) {
dtfm = dtf / rmass[i];
v[i][0] += dtfm * f[i][0];
x[i][0] += dtv * v[i][0];
} else {
dtfm = dtf / mass[type[i]];
v[i][0] += dtfm * f[i][0];
x[i][0] += dtv * v[i][0];
}
if (vyflag) {
v[i][1] = vy;
x[i][1] = xoriginal[i][1] + vy*delta;
} else if (rmass) {
dtfm = dtf / rmass[i];
v[i][1] += dtfm * f[i][1];
x[i][1] += dtv * v[i][1];
} else {
dtfm = dtf / mass[type[i]];
v[i][1] += dtfm * f[i][1];
x[i][1] += dtv * v[i][1];
}
if (vzflag) {
v[i][2] = vz;
x[i][2] = xoriginal[i][2] + vz*delta;
} else if (rmass) {
dtfm = dtf / rmass[i];
v[i][2] += dtfm * f[i][2];
x[i][2] += dtv * v[i][2];
} else {
dtfm = dtf / mass[type[i]];
v[i][2] += dtfm * f[i][2];
x[i][2] += dtv * v[i][2];
}
domain->remap_near(x[i],xold);
}
}
// for wiggle: X = X0 + A sin(w*dt)
} else if (mstyle == WIGGLE) {
double arg = omega_rotate * delta;
double sine = sin(arg);
double cosine = cos(arg);
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
xold[0] = x[i][0];
xold[1] = x[i][1];
xold[2] = x[i][2];
if (axflag) {
v[i][0] = ax*omega_rotate*cosine;
x[i][0] = xoriginal[i][0] + ax*sine;
} else if (rmass) {
dtfm = dtf / rmass[i];
v[i][0] += dtfm * f[i][0];
x[i][0] += dtv * v[i][0];
} else {
dtfm = dtf / mass[type[i]];
v[i][0] += dtfm * f[i][0];
x[i][0] += dtv * v[i][0];
}
if (ayflag) {
v[i][1] = ay*omega_rotate*cosine;
x[i][1] = xoriginal[i][1] + ay*sine;
} else if (rmass) {
dtfm = dtf / rmass[i];
v[i][1] += dtfm * f[i][1];
x[i][1] += dtv * v[i][1];
} else {
dtfm = dtf / mass[type[i]];
v[i][1] += dtfm * f[i][1];
x[i][1] += dtv * v[i][1];
}
if (azflag) {
v[i][2] = az*omega_rotate*cosine;
x[i][2] = xoriginal[i][2] + az*sine;
} else if (rmass) {
dtfm = dtf / rmass[i];
v[i][2] += dtfm * f[i][2];
x[i][2] += dtv * v[i][2];
} else {
dtfm = dtf / mass[type[i]];
v[i][2] += dtfm * f[i][2];
x[i][2] += dtv * v[i][2];
}
domain->remap_near(x[i],xold);
}
}
// for rotate by right-hand rule around omega:
// P = point = vector = point of rotation
// R = vector = axis of rotation
// w = omega of rotation (from period)
// X0 = xoriginal = initial coord of atom
// R0 = runit = unit vector for R
// D = X0 - P = vector from P to X0
// C = (D dot R0) R0 = projection of atom coord onto R line
// A = D - C = vector from R line to X0
// B = R0 cross A = vector perp to A in plane of rotation
// A,B define plane of circular rotation around R line
// X = P + C + A cos(w*dt) + B sin(w*dt)
// V = w R0 cross (A cos(w*dt) + B sin(w*dt))
} else if (mstyle == ROTATE) {
double arg = omega_rotate * delta;
double sine = sin(arg);
double cosine = cos(arg);
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
xold[0] = x[i][0];
xold[1] = x[i][1];
xold[2] = x[i][2];
d[0] = xoriginal[i][0] - point[0];
d[1] = xoriginal[i][1] - point[1];
d[2] = xoriginal[i][2] - point[2];
ddotr = d[0]*runit[0] + d[1]*runit[1] + d[2]*runit[2];
c[0] = ddotr*runit[0];
c[1] = ddotr*runit[1];
c[2] = ddotr*runit[2];
a[0] = d[0] - c[0];
a[1] = d[1] - c[1];
a[2] = d[2] - c[2];
b[0] = runit[1]*a[2] - runit[2]*a[1];
b[1] = runit[2]*a[0] - runit[0]*a[2];
b[2] = runit[0]*a[1] - runit[1]*a[0];
disp[0] = a[0]*cosine + b[0]*sine;
disp[1] = a[1]*cosine + b[1]*sine;
disp[2] = a[2]*cosine + b[2]*sine;
x[i][0] = point[0] + c[0] + disp[0];
x[i][1] = point[1] + c[1] + disp[1];
x[i][2] = point[2] + c[2] + disp[2];
v[i][0] = omega_rotate * (runit[1]*disp[2] - runit[2]*disp[1]);
v[i][1] = omega_rotate * (runit[2]*disp[0] - runit[0]*disp[2]);
v[i][2] = omega_rotate * (runit[0]*disp[1] - runit[1]*disp[0]);
- if (omega_flag) {
- omega[i][0] = omega_rotate*runit[0];
- omega[i][1] = omega_rotate*runit[1];
- omega[i][2] = omega_rotate*runit[2];
+
+ // set any extra attributes affected by rotation
+
+ if (extra_flag) {
+
+ // omega for spheres and lines
+
+ if (omega_flag) {
+ flag = 0;
+ if (radius_flag && radius[i] > 0.0) flag = 1;
+ if (line_flag && line[i] >= 0.0) flag = 1;
+ if (flag) {
+ omega[i][0] = omega_rotate*runit[0];
+ omega[i][1] = omega_rotate*runit[1];
+ omega[i][2] = omega_rotate*runit[2];
+ }
+ }
+
+ // angmom for ellipsoids, tris, and bodies
+
+ if (angmom_flag) {
+ quat = inertia = NULL;
+ if (ellipsoid_flag && ellipsoid[i] >= 0) {
+ quat = avec_ellipsoid->bonus[ellipsoid[i]].quat;
+ shape = avec_ellipsoid->bonus[ellipsoid[i]].shape;
+ inertia_ellipsoid[0] =
+ INERTIA*rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]);
+ inertia_ellipsoid[1] =
+ INERTIA*rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]);
+ inertia_ellipsoid[2] =
+ INERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]);
+ inertia = inertia_ellipsoid;
+ } else if (tri_flag && tri[i] >= 0) {
+ quat = avec_tri->bonus[tri[i]].quat;
+ inertia = avec_tri->bonus[tri[i]].inertia;
+ } else if (body_flag && body[i] >= 0) {
+ quat = avec_body->bonus[body[i]].quat;
+ inertia = avec_body->bonus[body[i]].inertia;
+ }
+ if (quat) {
+ w[0] = omega_rotate*runit[0];
+ w[1] = omega_rotate*runit[1];
+ w[2] = omega_rotate*runit[2];
+ MathExtra::q_to_exyz(quat,ex,ey,ez);
+ MathExtra::omega_to_angmom(w,ex,ey,ez,inertia,angmom[i]);
+ }
+ }
+
+ // theta for lines
+
+ if (theta_flag && line[i] >= 0.0) {
+ theta_new = fmod(toriginal[i]+arg,MY_2PI);
+ avec_line->bonus[atom->line[i]].theta = theta_new;
+ }
+
+ // quats for ellipsoids, tris, and bodies
+
+ if (quat_flag) {
+ quat = NULL;
+ if (ellipsoid_flag && ellipsoid[i] >= 0)
+ quat = avec_ellipsoid->bonus[ellipsoid[i]].quat;
+ else if (tri_flag && tri[i] >= 0)
+ quat = avec_tri->bonus[tri[i]].quat;
+ else if (body_flag && body[i] >= 0)
+ quat = avec_body->bonus[body[i]].quat;
+ if (quat) {
+ qrotate[0] = cosine;
+ qrotate[1] = runit[0]*sine;
+ qrotate[2] = runit[1]*sine;
+ qrotate[3] = runit[2]*sine;
+ MathExtra::quatquat(qrotate,qoriginal[i],quat);
+ }
+ }
}
domain->remap_near(x[i],xold);
}
}
// for variable: compute x,v from variables
+ // NOTE: also allow for changes to extra attributes?
+ // omega, angmom, theta, quat
+ // only necessary if prescribed motion involves rotation
} else if (mstyle == VARIABLE) {
// reallocate displace and velocity arrays as necessary
if ((displaceflag || velocityflag) && nlocal > maxatom) {
maxatom = atom->nmax;
if (displaceflag) {
memory->destroy(displace);
memory->create(displace,maxatom,3,"move:displace");
}
if (velocityflag) {
memory->destroy(velocity);
memory->create(velocity,maxatom,3,"move:velocity");
}
}
// pre-compute variable values, wrap with clear/add
modify->clearstep_compute();
if (xvarstr) {
if (xvarstyle == EQUAL) dx = input->variable->compute_equal(xvar);
else input->variable->compute_atom(xvar,igroup,&displace[0][0],3,0);
}
if (yvarstr) {
if (yvarstyle == EQUAL) dy = input->variable->compute_equal(yvar);
else input->variable->compute_atom(yvar,igroup,&displace[0][1],3,0);
}
if (zvarstr) {
if (zvarstyle == EQUAL) dz = input->variable->compute_equal(zvar);
else input->variable->compute_atom(zvar,igroup,&displace[0][2],3,0);
}
if (vxvarstr) {
if (vxvarstyle == EQUAL) vx = input->variable->compute_equal(vxvar);
else input->variable->compute_atom(vxvar,igroup,&velocity[0][0],3,0);
}
if (vyvarstr) {
if (vyvarstyle == EQUAL) vy = input->variable->compute_equal(vyvar);
else input->variable->compute_atom(vyvar,igroup,&velocity[0][1],3,0);
}
if (vzvarstr) {
if (vzvarstyle == EQUAL) vz = input->variable->compute_equal(vzvar);
else input->variable->compute_atom(vzvar,igroup,&velocity[0][2],3,0);
}
modify->addstep_compute(update->ntimestep + 1);
// update x,v
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
xold[0] = x[i][0];
xold[1] = x[i][1];
xold[2] = x[i][2];
if (xvarstr && vxvarstr) {
if (vxvarstyle == EQUAL) v[i][0] = vx;
else v[i][0] = velocity[i][0];
if (xvarstyle == EQUAL) x[i][0] = xoriginal[i][0] + dx;
else x[i][0] = xoriginal[i][0] + displace[i][0];
} else if (xvarstr) {
if (xvarstyle == EQUAL) x[i][0] = xoriginal[i][0] + dx;
else x[i][0] = xoriginal[i][0] + displace[i][0];
} else if (vxvarstr) {
if (vxvarstyle == EQUAL) v[i][0] = vx;
else v[i][0] = velocity[i][0];
if (rmass) {
dtfm = dtf / rmass[i];
x[i][0] += dtv * v[i][0];
} else {
dtfm = dtf / mass[type[i]];
x[i][0] += dtv * v[i][0];
}
} else {
if (rmass) {
dtfm = dtf / rmass[i];
v[i][0] += dtfm * f[i][0];
x[i][0] += dtv * v[i][0];
} else {
dtfm = dtf / mass[type[i]];
v[i][0] += dtfm * f[i][0];
x[i][0] += dtv * v[i][0];
}
}
if (yvarstr && vyvarstr) {
if (vyvarstyle == EQUAL) v[i][1] = vy;
else v[i][1] = velocity[i][1];
if (yvarstyle == EQUAL) x[i][1] = xoriginal[i][1] + dy;
else x[i][1] = xoriginal[i][1] + displace[i][1];
} else if (yvarstr) {
if (yvarstyle == EQUAL) x[i][1] = xoriginal[i][1] + dy;
else x[i][1] = xoriginal[i][1] + displace[i][1];
} else if (vyvarstr) {
if (vyvarstyle == EQUAL) v[i][1] = vy;
else v[i][1] = velocity[i][1];
if (rmass) {
dtfm = dtf / rmass[i];
x[i][1] += dtv * v[i][1];
} else {
dtfm = dtf / mass[type[i]];
x[i][1] += dtv * v[i][1];
}
} else {
if (rmass) {
dtfm = dtf / rmass[i];
v[i][1] += dtfm * f[i][1];
x[i][1] += dtv * v[i][1];
} else {
dtfm = dtf / mass[type[i]];
v[i][1] += dtfm * f[i][1];
x[i][1] += dtv * v[i][1];
}
}
if (zvarstr && vzvarstr) {
if (vzvarstyle == EQUAL) v[i][2] = vz;
else v[i][2] = velocity[i][2];
if (zvarstyle == EQUAL) x[i][2] = xoriginal[i][2] + dz;
else x[i][2] = xoriginal[i][2] + displace[i][2];
} else if (zvarstr) {
if (zvarstyle == EQUAL) x[i][2] = xoriginal[i][2] + dz;
else x[i][2] = xoriginal[i][2] + displace[i][2];
} else if (vzvarstr) {
if (vzvarstyle == EQUAL) v[i][2] = vz;
else v[i][2] = velocity[i][2];
if (rmass) {
dtfm = dtf / rmass[i];
x[i][2] += dtv * v[i][2];
} else {
dtfm = dtf / mass[type[i]];
x[i][2] += dtv * v[i][2];
}
} else {
if (rmass) {
dtfm = dtf / rmass[i];
v[i][2] += dtfm * f[i][2];
x[i][2] += dtv * v[i][2];
} else {
dtfm = dtf / mass[type[i]];
v[i][2] += dtfm * f[i][2];
x[i][2] += dtv * v[i][2];
}
}
domain->remap_near(x[i],xold);
}
}
}
}
/* ----------------------------------------------------------------------
final NVE of particles with NULL components
------------------------------------------------------------------------- */
void FixMove::final_integrate()
{
double dtfm;
int xflag = 1;
if (mstyle == LINEAR && vxflag) xflag = 0;
else if (mstyle == WIGGLE && axflag) xflag = 0;
else if (mstyle == ROTATE) xflag = 0;
else if (mstyle == VARIABLE && (xvarstr || vxvarstr)) xflag = 0;
int yflag = 1;
if (mstyle == LINEAR && vyflag) yflag = 0;
else if (mstyle == WIGGLE && ayflag) yflag = 0;
else if (mstyle == ROTATE) yflag = 0;
else if (mstyle == VARIABLE && (yvarstr || vyvarstr)) yflag = 0;
int zflag = 1;
if (mstyle == LINEAR && vzflag) zflag = 0;
else if (mstyle == WIGGLE && azflag) zflag = 0;
else if (mstyle == ROTATE) zflag = 0;
else if (mstyle == VARIABLE && (zvarstr || vzvarstr)) zflag = 0;
double **v = atom->v;
double **f = atom->f;
double *rmass = atom->rmass;
double *mass = atom->mass;
int *type = atom->type;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
if (xflag) {
if (rmass) {
dtfm = dtf / rmass[i];
v[i][0] += dtfm * f[i][0];
} else {
dtfm = dtf / mass[type[i]];
v[i][0] += dtfm * f[i][0];
}
}
if (yflag) {
if (rmass) {
dtfm = dtf / rmass[i];
v[i][1] += dtfm * f[i][1];
} else {
dtfm = dtf / mass[type[i]];
v[i][1] += dtfm * f[i][1];
}
}
if (zflag) {
if (rmass) {
dtfm = dtf / rmass[i];
v[i][2] += dtfm * f[i][2];
} else {
dtfm = dtf / mass[type[i]];
v[i][2] += dtfm * f[i][2];
}
}
}
}
}
/* ---------------------------------------------------------------------- */
void FixMove::initial_integrate_respa(int vflag, int ilevel, int iloop)
{
// outermost level - update v and x
// all other levels - nothing
if (ilevel == nlevels_respa-1) initial_integrate(vflag);
}
/* ---------------------------------------------------------------------- */
void FixMove::final_integrate_respa(int ilevel, int iloop)
{
if (ilevel == nlevels_respa-1) final_integrate();
}
/* ----------------------------------------------------------------------
memory usage of local atom-based array
------------------------------------------------------------------------- */
double FixMove::memory_usage()
{
double bytes = atom->nmax*3 * sizeof(double);
+ if (theta_flag) bytes += atom->nmax * sizeof(double);
+ if (quat_flag) bytes += atom->nmax*4 * sizeof(double);
if (displaceflag) bytes += atom->nmax*3 * sizeof(double);
if (velocityflag) bytes += atom->nmax*3 * sizeof(double);
return bytes;
}
/* ----------------------------------------------------------------------
pack entire state of Fix into one write
------------------------------------------------------------------------- */
void FixMove::write_restart(FILE *fp)
{
int n = 0;
double list[1];
list[n++] = time_origin;
if (comm->me == 0) {
int size = n * sizeof(double);
fwrite(&size,sizeof(int),1,fp);
fwrite(list,sizeof(double),n,fp);
}
}
/* ----------------------------------------------------------------------
use state info from restart file to restart the Fix
------------------------------------------------------------------------- */
void FixMove::restart(char *buf)
{
int n = 0;
double *list = (double *) buf;
time_origin = static_cast<int> (list[n++]);
}
/* ----------------------------------------------------------------------
allocate atom-based array
------------------------------------------------------------------------- */
void FixMove::grow_arrays(int nmax)
{
memory->grow(xoriginal,nmax,3,"move:xoriginal");
+ if (theta_flag) memory->grow(toriginal,nmax,"move:toriginal");
+ if (quat_flag) memory->grow(qoriginal,nmax,4,"move:qoriginal");
array_atom = xoriginal;
}
/* ----------------------------------------------------------------------
copy values within local atom-based array
------------------------------------------------------------------------- */
void FixMove::copy_arrays(int i, int j, int delflag)
{
xoriginal[j][0] = xoriginal[i][0];
xoriginal[j][1] = xoriginal[i][1];
xoriginal[j][2] = xoriginal[i][2];
+ if (theta_flag) toriginal[j] = toriginal[i];
+ if (quat_flag) {
+ qoriginal[j][0] = qoriginal[i][0];
+ qoriginal[j][1] = qoriginal[i][1];
+ qoriginal[j][2] = qoriginal[i][2];
+ qoriginal[j][3] = qoriginal[i][3];
+ }
}
/* ----------------------------------------------------------------------
initialize one atom's array values, called when atom is created
------------------------------------------------------------------------- */
void FixMove::set_arrays(int i)
{
+ double theta;
+ double *quat;
+
double **x = atom->x;
imageint *image = atom->image;
+ int *ellipsoid = atom->ellipsoid;
+ int *line = atom->line;
+ int *tri = atom->tri;
+ int *body = atom->body;
int *mask = atom->mask;
// particle not in group
if (!(mask[i] & groupbit)) {
xoriginal[i][0] = xoriginal[i][1] = xoriginal[i][2] = 0.0;
return;
}
// current time still equal fix creation time
if (update->ntimestep == time_origin) {
domain->unmap(x[i],image[i],xoriginal[i]);
return;
}
// backup particle to time_origin
if (mstyle == VARIABLE)
error->all(FLERR,"Cannot add atoms to fix move variable");
domain->unmap(x[i],image[i],xoriginal[i]);
double delta = (update->ntimestep - time_origin) * update->dt;
if (mstyle == LINEAR) {
if (vxflag) xoriginal[i][0] -= vx * delta;
if (vyflag) xoriginal[i][1] -= vy * delta;
if (vzflag) xoriginal[i][2] -= vz * delta;
} else if (mstyle == WIGGLE) {
double arg = omega_rotate * delta;
double sine = sin(arg);
if (axflag) xoriginal[i][0] -= ax*sine;
if (ayflag) xoriginal[i][1] -= ay*sine;
if (azflag) xoriginal[i][2] -= az*sine;
} else if (mstyle == ROTATE) {
double a[3],b[3],c[3],d[3],disp[3],ddotr;
double arg = - omega_rotate * delta;
double sine = sin(arg);
double cosine = cos(arg);
d[0] = x[i][0] - point[0];
d[1] = x[i][1] - point[1];
d[2] = x[i][2] - point[2];
ddotr = d[0]*runit[0] + d[1]*runit[1] + d[2]*runit[2];
c[0] = ddotr*runit[0];
c[1] = ddotr*runit[1];
c[2] = ddotr*runit[2];
a[0] = d[0] - c[0];
a[1] = d[1] - c[1];
a[2] = d[2] - c[2];
b[0] = runit[1]*a[2] - runit[2]*a[1];
b[1] = runit[2]*a[0] - runit[0]*a[2];
b[2] = runit[0]*a[1] - runit[1]*a[0];
disp[0] = a[0]*cosine + b[0]*sine;
disp[1] = a[1]*cosine + b[1]*sine;
disp[2] = a[2]*cosine + b[2]*sine;
xoriginal[i][0] = point[0] + c[0] + disp[0];
xoriginal[i][1] = point[1] + c[1] + disp[1];
xoriginal[i][2] = point[2] + c[2] + disp[2];
+
+ // set theta and quat extra attributes affected by rotation
+
+ if (extra_flag) {
+
+ // theta for lines
+
+ if (theta_flag && line[i] >= 0.0) {
+ theta = avec_line->bonus[atom->line[i]].theta;
+ toriginal[i] = theta - 0.0; // NOTE: edit this line
+ }
+
+ // quats for ellipsoids, tris, and bodies
+
+ if (quat_flag) {
+ quat = NULL;
+ if (ellipsoid_flag && ellipsoid[i] >= 0)
+ quat = avec_ellipsoid->bonus[ellipsoid[i]].quat;
+ else if (tri_flag && tri[i] >= 0)
+ quat = avec_tri->bonus[tri[i]].quat;
+ else if (body_flag && body[i] >= 0)
+ quat = avec_body->bonus[body[i]].quat;
+ if (quat) {
+ // qoriginal = f(quat,-delta); // NOTE: edit this line
+ }
+ }
+ }
}
}
/* ----------------------------------------------------------------------
pack values in local atom-based array for exchange with another proc
------------------------------------------------------------------------- */
int FixMove::pack_exchange(int i, double *buf)
{
- buf[0] = xoriginal[i][0];
- buf[1] = xoriginal[i][1];
- buf[2] = xoriginal[i][2];
- return 3;
+ int n = 0;
+ buf[n++] = xoriginal[i][0];
+ buf[n++] = xoriginal[i][1];
+ buf[n++] = xoriginal[i][2];
+ if (theta_flag) buf[n++] = toriginal[i];
+ if (quat_flag) {
+ buf[n++] = qoriginal[i][0];
+ buf[n++] = qoriginal[i][1];
+ buf[n++] = qoriginal[i][2];
+ buf[n++] = qoriginal[i][3];
+ }
+ return n;
}
/* ----------------------------------------------------------------------
unpack values in local atom-based array from exchange with another proc
------------------------------------------------------------------------- */
int FixMove::unpack_exchange(int nlocal, double *buf)
{
- xoriginal[nlocal][0] = buf[0];
- xoriginal[nlocal][1] = buf[1];
- xoriginal[nlocal][2] = buf[2];
- return 3;
+ int n = 0;
+ xoriginal[nlocal][0] = buf[n++];
+ xoriginal[nlocal][1] = buf[n++];
+ xoriginal[nlocal][2] = buf[n++];
+ if (theta_flag) toriginal[nlocal] = buf[n++];
+ if (quat_flag) {
+ qoriginal[nlocal][0] = buf[n++];
+ qoriginal[nlocal][1] = buf[n++];
+ qoriginal[nlocal][2] = buf[n++];
+ qoriginal[nlocal][3] = buf[n++];
+ }
+ return n;
}
/* ----------------------------------------------------------------------
pack values in local atom-based arrays for restart file
------------------------------------------------------------------------- */
int FixMove::pack_restart(int i, double *buf)
{
- buf[0] = 4;
- buf[1] = xoriginal[i][0];
- buf[2] = xoriginal[i][1];
- buf[3] = xoriginal[i][2];
- return 4;
+ int n = 1;
+ buf[n++] = xoriginal[i][0];
+ buf[n++] = xoriginal[i][1];
+ buf[n++] = xoriginal[i][2];
+ if (theta_flag) buf[n++] = toriginal[i];
+ if (quat_flag) {
+ buf[n++] = qoriginal[i][0];
+ buf[n++] = qoriginal[i][1];
+ buf[n++] = qoriginal[i][2];
+ buf[n++] = qoriginal[i][3];
+ }
+ buf[0] = n;
+ return n;
}
/* ----------------------------------------------------------------------
unpack values from atom->extra array to restart the fix
------------------------------------------------------------------------- */
void FixMove::unpack_restart(int nlocal, int nth)
{
double **extra = atom->extra;
// skip to Nth set of extra values
int m = 0;
for (int i = 0; i < nth; i++) m += static_cast<int> (extra[nlocal][m]);
m++;
xoriginal[nlocal][0] = extra[nlocal][m++];
xoriginal[nlocal][1] = extra[nlocal][m++];
xoriginal[nlocal][2] = extra[nlocal][m++];
+ if (theta_flag) toriginal[nlocal] = extra[nlocal][m++];
+ if (quat_flag) {
+ qoriginal[nlocal][0] = extra[nlocal][m++];
+ qoriginal[nlocal][1] = extra[nlocal][m++];
+ qoriginal[nlocal][2] = extra[nlocal][m++];
+ qoriginal[nlocal][3] = extra[nlocal][m++];
+ }
}
/* ----------------------------------------------------------------------
maxsize of any atom's restart data
------------------------------------------------------------------------- */
int FixMove::maxsize_restart()
{
- return 4;
+ return nrestart;
}
/* ----------------------------------------------------------------------
size of atom nlocal's restart data
------------------------------------------------------------------------- */
int FixMove::size_restart(int nlocal)
{
- return 4;
+ return nrestart;
}
/* ---------------------------------------------------------------------- */
void FixMove::reset_dt()
{
error->all(FLERR,"Resetting timestep size is not allowed with fix move");
}
diff --git a/src/fix_move.h b/src/fix_move.h
index bcd877570..977ec88ea 100644
--- a/src/fix_move.h
+++ b/src/fix_move.h
@@ -1,130 +1,140 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(move,FixMove)
#else
#ifndef LMP_FIX_MOVE_H
#define LMP_FIX_MOVE_H
#include <stdio.h>
#include "fix.h"
namespace LAMMPS_NS {
class FixMove : public Fix {
public:
FixMove(class LAMMPS *, int, char **);
~FixMove();
int setmask();
void init();
void initial_integrate(int);
void final_integrate();
void initial_integrate_respa(int, int, int);
void final_integrate_respa(int, int);
double memory_usage();
void write_restart(FILE *);
void restart(char *);
void grow_arrays(int);
void copy_arrays(int, int, int);
void set_arrays(int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int maxsize_restart();
int size_restart(int);
void reset_dt();
private:
char *xvarstr,*yvarstr,*zvarstr,*vxvarstr,*vyvarstr,*vzvarstr;
int mstyle;
int vxflag,vyflag,vzflag,axflag,ayflag,azflag;
double vx,vy,vz,ax,ay,az;
double period,omega_rotate;
double point[3],axis[3],runit[3];
double dt,dtv,dtf;
int xvar,yvar,zvar,vxvar,vyvar,vzvar;
int xvarstyle,yvarstyle,zvarstyle,vxvarstyle,vyvarstyle,vzvarstyle;
- int omega_flag,nlevels_respa;
+ int extra_flag,omega_flag,angmom_flag;
+ int radius_flag,ellipsoid_flag,line_flag,tri_flag,body_flag;
+ int theta_flag,quat_flag;
+ int nlevels_respa,nrestart;
int time_origin;
double **xoriginal; // original coords of atoms
+ double *toriginal; // original theta of atoms
+ double **qoriginal; // original quat of atoms
int displaceflag,velocityflag;
int maxatom;
double **displace,**velocity;
+
+ class AtomVecEllipsoid *avec_ellipsoid;
+ class AtomVecLine *avec_line;
+ class AtomVecTri *avec_tri;
+ class AtomVecBody *avec_body;
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Fix move cannot set linear z motion for 2d problem
Self-explanatory.
E: Fix move cannot set wiggle z motion for 2d problem
Self-explanatory.
E: Fix move cannot rotate aroung non z-axis for 2d problem
Self-explanatory.
E: Fix move cannot define z or vz variable for 2d problem
Self-explanatory.
W: Fix move does not update angular momentum
Atoms store this quantity, but fix move does not (yet) update it.
W: Fix move does not update quaternions
Atoms store this quantity, but fix move does not (yet) update it.
E: Zero length rotation vector with fix move
Self-explanatory.
E: Variable name for fix move does not exist
Self-explanatory.
E: Variable for fix move is invalid style
Only equal-style variables can be used.
E: Cannot add atoms to fix move variable
Atoms can not be added afterwards to this fix option.
E: Resetting timestep size is not allowed with fix move
This is because fix move is moving atoms based on elapsed time.
*/
diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp
index 5f7bec658..89bd562e8 100644
--- a/src/fix_nh.cpp
+++ b/src/fix_nh.cpp
@@ -1,2304 +1,2317 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing authors: Mark Stevens (SNL), Aidan Thompson (SNL)
------------------------------------------------------------------------- */
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "fix_nh.h"
#include "math_extra.h"
#include "atom.h"
#include "force.h"
#include "group.h"
#include "comm.h"
#include "neighbor.h"
#include "irregular.h"
#include "modify.h"
#include "fix_deform.h"
#include "compute.h"
#include "kspace.h"
#include "update.h"
#include "respa.h"
#include "domain.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
#define DELTAFLIP 0.1
#define TILTMAX 1.5
enum{NOBIAS,BIAS};
enum{NONE,XYZ,XY,YZ,XZ};
enum{ISO,ANISO,TRICLINIC};
/* ----------------------------------------------------------------------
NVT,NPH,NPT integrators for improved Nose-Hoover equations of motion
---------------------------------------------------------------------- */
FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal fix nvt/npt/nph command");
restart_global = 1;
dynamic_group_allow = 1;
time_integrate = 1;
scalar_flag = 1;
vector_flag = 1;
global_freq = 1;
extscalar = 1;
extvector = 0;
// default values
pcouple = NONE;
drag = 0.0;
allremap = 1;
id_dilate = NULL;
mtchain = mpchain = 3;
nc_tchain = nc_pchain = 1;
mtk_flag = 1;
deviatoric_flag = 0;
nreset_h0 = 0;
eta_mass_flag = 1;
omega_mass_flag = 0;
etap_mass_flag = 0;
flipflag = 1;
+ dipole_flag = 0;
// turn on tilt factor scaling, whenever applicable
dimension = domain->dimension;
scaleyz = scalexz = scalexy = 0;
if (domain->yperiodic && domain->xy != 0.0) scalexy = 1;
if (domain->zperiodic && dimension == 3) {
if (domain->yz != 0.0) scaleyz = 1;
if (domain->xz != 0.0) scalexz = 1;
}
// set fixed-point to default = center of cell
fixedpoint[0] = 0.5*(domain->boxlo[0]+domain->boxhi[0]);
fixedpoint[1] = 0.5*(domain->boxlo[1]+domain->boxhi[1]);
fixedpoint[2] = 0.5*(domain->boxlo[2]+domain->boxhi[2]);
// used by FixNVTSllod to preserve non-default value
mtchain_default_flag = 1;
tstat_flag = 0;
double t_period = 0.0;
double p_period[6];
for (int i = 0; i < 6; i++) {
p_start[i] = p_stop[i] = p_period[i] = p_target[i] = 0.0;
p_flag[i] = 0;
}
// process keywords
int iarg = 3;
while (iarg < narg) {
if (strcmp(arg[iarg],"temp") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
tstat_flag = 1;
t_start = force->numeric(FLERR,arg[iarg+1]);
t_target = t_start;
t_stop = force->numeric(FLERR,arg[iarg+2]);
t_period = force->numeric(FLERR,arg[iarg+3]);
if (t_start < 0.0 || t_stop <= 0.0)
error->all(FLERR,
"Target temperature for fix nvt/npt/nph cannot be 0.0");
iarg += 4;
} else if (strcmp(arg[iarg],"iso") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
pcouple = XYZ;
p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] =
force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
if (dimension == 2) {
p_start[2] = p_stop[2] = p_period[2] = 0.0;
p_flag[2] = 0;
}
iarg += 4;
} else if (strcmp(arg[iarg],"aniso") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
pcouple = NONE;
p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] =
force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
if (dimension == 2) {
p_start[2] = p_stop[2] = p_period[2] = 0.0;
p_flag[2] = 0;
}
iarg += 4;
} else if (strcmp(arg[iarg],"tri") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
pcouple = NONE;
scalexy = scalexz = scaleyz = 0;
p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] =
force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
p_start[3] = p_start[4] = p_start[5] = 0.0;
p_stop[3] = p_stop[4] = p_stop[5] = 0.0;
p_period[3] = p_period[4] = p_period[5] =
force->numeric(FLERR,arg[iarg+3]);
p_flag[3] = p_flag[4] = p_flag[5] = 1;
if (dimension == 2) {
p_start[2] = p_stop[2] = p_period[2] = 0.0;
p_flag[2] = 0;
p_start[3] = p_stop[3] = p_period[3] = 0.0;
p_flag[3] = 0;
p_start[4] = p_stop[4] = p_period[4] = 0.0;
p_flag[4] = 0;
}
iarg += 4;
} else if (strcmp(arg[iarg],"x") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[0] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = 1;
deviatoric_flag = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"y") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[1] = force->numeric(FLERR,arg[iarg+1]);
p_stop[1] = force->numeric(FLERR,arg[iarg+2]);
p_period[1] = force->numeric(FLERR,arg[iarg+3]);
p_flag[1] = 1;
deviatoric_flag = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"z") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[2] = force->numeric(FLERR,arg[iarg+3]);
p_flag[2] = 1;
deviatoric_flag = 1;
iarg += 4;
if (dimension == 2)
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
} else if (strcmp(arg[iarg],"yz") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[3] = force->numeric(FLERR,arg[iarg+1]);
p_stop[3] = force->numeric(FLERR,arg[iarg+2]);
p_period[3] = force->numeric(FLERR,arg[iarg+3]);
p_flag[3] = 1;
deviatoric_flag = 1;
scaleyz = 0;
iarg += 4;
if (dimension == 2)
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
} else if (strcmp(arg[iarg],"xz") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[4] = force->numeric(FLERR,arg[iarg+1]);
p_stop[4] = force->numeric(FLERR,arg[iarg+2]);
p_period[4] = force->numeric(FLERR,arg[iarg+3]);
p_flag[4] = 1;
deviatoric_flag = 1;
scalexz = 0;
iarg += 4;
if (dimension == 2)
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
} else if (strcmp(arg[iarg],"xy") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[5] = force->numeric(FLERR,arg[iarg+1]);
p_stop[5] = force->numeric(FLERR,arg[iarg+2]);
p_period[5] = force->numeric(FLERR,arg[iarg+3]);
p_flag[5] = 1;
deviatoric_flag = 1;
scalexy = 0;
iarg += 4;
} else if (strcmp(arg[iarg],"couple") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"xyz") == 0) pcouple = XYZ;
else if (strcmp(arg[iarg+1],"xy") == 0) pcouple = XY;
else if (strcmp(arg[iarg+1],"yz") == 0) pcouple = YZ;
else if (strcmp(arg[iarg+1],"xz") == 0) pcouple = XZ;
else if (strcmp(arg[iarg+1],"none") == 0) pcouple = NONE;
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"drag") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
drag = force->numeric(FLERR,arg[iarg+1]);
if (drag < 0.0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"dilate") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"all") == 0) allremap = 1;
else {
allremap = 0;
delete [] id_dilate;
int n = strlen(arg[iarg+1]) + 1;
id_dilate = new char[n];
strcpy(id_dilate,arg[iarg+1]);
int idilate = group->find(id_dilate);
if (idilate == -1)
error->all(FLERR,"Fix nvt/npt/nph dilate group ID does not exist");
}
iarg += 2;
} else if (strcmp(arg[iarg],"tchain") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
mtchain = force->inumeric(FLERR,arg[iarg+1]);
// used by FixNVTSllod to preserve non-default value
mtchain_default_flag = 0;
if (mtchain < 1) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"pchain") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
mpchain = force->inumeric(FLERR,arg[iarg+1]);
if (mpchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"mtk") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"yes") == 0) mtk_flag = 1;
else if (strcmp(arg[iarg+1],"no") == 0) mtk_flag = 0;
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"tloop") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
nc_tchain = force->inumeric(FLERR,arg[iarg+1]);
if (nc_tchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"ploop") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
nc_pchain = force->inumeric(FLERR,arg[iarg+1]);
if (nc_pchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"nreset") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
nreset_h0 = force->inumeric(FLERR,arg[iarg+1]);
if (nreset_h0 < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"scalexy") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"yes") == 0) scalexy = 1;
else if (strcmp(arg[iarg+1],"no") == 0) scalexy = 0;
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"scalexz") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"yes") == 0) scalexz = 1;
else if (strcmp(arg[iarg+1],"no") == 0) scalexz = 0;
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"scaleyz") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"yes") == 0) scaleyz = 1;
else if (strcmp(arg[iarg+1],"no") == 0) scaleyz = 0;
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"flip") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
if (strcmp(arg[iarg+1],"yes") == 0) flipflag = 1;
else if (strcmp(arg[iarg+1],"no") == 0) flipflag = 0;
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
+ } else if (strcmp(arg[iarg],"update") == 0) {
+ if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
+ if (strcmp(arg[iarg+1],"dipole") == 0) dipole_flag = 1;
+ else error->all(FLERR,"Illegal fix nvt/npt/nph command");
+ iarg += 2;
} else if (strcmp(arg[iarg],"fixedpoint") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
fixedpoint[0] = force->numeric(FLERR,arg[iarg+1]);
fixedpoint[1] = force->numeric(FLERR,arg[iarg+2]);
fixedpoint[2] = force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else error->all(FLERR,"Illegal fix nvt/npt/nph command");
}
// error checks
if (dimension == 2 && (p_flag[2] || p_flag[3] || p_flag[4]))
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
if (dimension == 2 && (pcouple == YZ || pcouple == XZ))
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
if (dimension == 2 && (scalexz == 1 || scaleyz == 1 ))
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
if (pcouple == XYZ && (p_flag[0] == 0 || p_flag[1] == 0))
error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
if (pcouple == XYZ && dimension == 3 && p_flag[2] == 0)
error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
if (pcouple == XY && (p_flag[0] == 0 || p_flag[1] == 0))
error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
if (pcouple == YZ && (p_flag[1] == 0 || p_flag[2] == 0))
error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
if (pcouple == XZ && (p_flag[0] == 0 || p_flag[2] == 0))
error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
// require periodicity in tensile dimension
if (p_flag[0] && domain->xperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph on a non-periodic dimension");
if (p_flag[1] && domain->yperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph on a non-periodic dimension");
if (p_flag[2] && domain->zperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph on a non-periodic dimension");
// require periodicity in 2nd dim of off-diagonal tilt component
if (p_flag[3] && domain->zperiodic == 0)
error->all(FLERR,
"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
if (p_flag[4] && domain->zperiodic == 0)
error->all(FLERR,
"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
if (p_flag[5] && domain->yperiodic == 0)
error->all(FLERR,
"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
if (scaleyz == 1 && domain->zperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph "
"with yz scaling when z is non-periodic dimension");
if (scalexz == 1 && domain->zperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph "
"with xz scaling when z is non-periodic dimension");
if (scalexy == 1 && domain->yperiodic == 0)
error->all(FLERR,"Cannot use fix nvt/npt/nph "
"with xy scaling when y is non-periodic dimension");
if (p_flag[3] && scaleyz == 1)
error->all(FLERR,"Cannot use fix nvt/npt/nph with "
"both yz dynamics and yz scaling");
if (p_flag[4] && scalexz == 1)
error->all(FLERR,"Cannot use fix nvt/npt/nph with "
"both xz dynamics and xz scaling");
if (p_flag[5] && scalexy == 1)
error->all(FLERR,"Cannot use fix nvt/npt/nph with "
"both xy dynamics and xy scaling");
if (!domain->triclinic && (p_flag[3] || p_flag[4] || p_flag[5]))
error->all(FLERR,"Can not specify Pxy/Pxz/Pyz in "
"fix nvt/npt/nph with non-triclinic box");
if (pcouple == XYZ && dimension == 3 &&
(p_start[0] != p_start[1] || p_start[0] != p_start[2] ||
p_stop[0] != p_stop[1] || p_stop[0] != p_stop[2] ||
p_period[0] != p_period[1] || p_period[0] != p_period[2]))
error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
if (pcouple == XYZ && dimension == 2 &&
(p_start[0] != p_start[1] || p_stop[0] != p_stop[1] ||
p_period[0] != p_period[1]))
error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
if (pcouple == XY &&
(p_start[0] != p_start[1] || p_stop[0] != p_stop[1] ||
p_period[0] != p_period[1]))
error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
if (pcouple == YZ &&
(p_start[1] != p_start[2] || p_stop[1] != p_stop[2] ||
p_period[1] != p_period[2]))
error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
if (pcouple == XZ &&
(p_start[0] != p_start[2] || p_stop[0] != p_stop[2] ||
p_period[0] != p_period[2]))
error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
+ if (dipole_flag) {
+ if (!atom->sphere_flag)
+ error->all(FLERR,"Using update dipole flag requires atom style sphere");
+ if (!atom->mu_flag)
+ error->all(FLERR,"Using update dipole flag requires atom attribute mu");
+ }
+
if ((tstat_flag && t_period <= 0.0) ||
(p_flag[0] && p_period[0] <= 0.0) ||
(p_flag[1] && p_period[1] <= 0.0) ||
(p_flag[2] && p_period[2] <= 0.0) ||
(p_flag[3] && p_period[3] <= 0.0) ||
(p_flag[4] && p_period[4] <= 0.0) ||
(p_flag[5] && p_period[5] <= 0.0))
error->all(FLERR,"Fix nvt/npt/nph damping parameters must be > 0.0");
// set pstat_flag and box change and restart_pbc variables
pre_exchange_flag = 0;
pstat_flag = 0;
pstyle = ISO;
for (int i = 0; i < 6; i++)
if (p_flag[i]) pstat_flag = 1;
if (pstat_flag) {
if (p_flag[0] || p_flag[1] || p_flag[2]) box_change_size = 1;
if (p_flag[3] || p_flag[4] || p_flag[5]) box_change_shape = 1;
no_change_box = 1;
if (allremap == 0) restart_pbc = 1;
// pstyle = TRICLINIC if any off-diagonal term is controlled -> 6 dof
// else pstyle = ISO if XYZ coupling or XY coupling in 2d -> 1 dof
// else pstyle = ANISO -> 3 dof
if (p_flag[3] || p_flag[4] || p_flag[5]) pstyle = TRICLINIC;
else if (pcouple == XYZ || (dimension == 2 && pcouple == XY)) pstyle = ISO;
else pstyle = ANISO;
// pre_exchange only required if flips can occur due to shape changes
if (flipflag && (p_flag[3] || p_flag[4] || p_flag[5])) pre_exchange_flag = 1;
if (flipflag && (domain->yz != 0.0 || domain->xz != 0.0 || domain->xy != 0.0))
pre_exchange_flag = 1;
}
// convert input periods to frequencies
t_freq = 0.0;
p_freq[0] = p_freq[1] = p_freq[2] = p_freq[3] = p_freq[4] = p_freq[5] = 0.0;
if (tstat_flag) t_freq = 1.0 / t_period;
if (p_flag[0]) p_freq[0] = 1.0 / p_period[0];
if (p_flag[1]) p_freq[1] = 1.0 / p_period[1];
if (p_flag[2]) p_freq[2] = 1.0 / p_period[2];
if (p_flag[3]) p_freq[3] = 1.0 / p_period[3];
if (p_flag[4]) p_freq[4] = 1.0 / p_period[4];
if (p_flag[5]) p_freq[5] = 1.0 / p_period[5];
// Nose/Hoover temp and pressure init
size_vector = 0;
if (tstat_flag) {
int ich;
eta = new double[mtchain];
// add one extra dummy thermostat, set to zero
eta_dot = new double[mtchain+1];
eta_dot[mtchain] = 0.0;
eta_dotdot = new double[mtchain];
for (ich = 0; ich < mtchain; ich++) {
eta[ich] = eta_dot[ich] = eta_dotdot[ich] = 0.0;
}
eta_mass = new double[mtchain];
size_vector += 2*2*mtchain;
}
if (pstat_flag) {
omega[0] = omega[1] = omega[2] = 0.0;
omega_dot[0] = omega_dot[1] = omega_dot[2] = 0.0;
omega_mass[0] = omega_mass[1] = omega_mass[2] = 0.0;
omega[3] = omega[4] = omega[5] = 0.0;
omega_dot[3] = omega_dot[4] = omega_dot[5] = 0.0;
omega_mass[3] = omega_mass[4] = omega_mass[5] = 0.0;
if (pstyle == ISO) size_vector += 2*2*1;
else if (pstyle == ANISO) size_vector += 2*2*3;
else if (pstyle == TRICLINIC) size_vector += 2*2*6;
if (mpchain) {
int ich;
etap = new double[mpchain];
// add one extra dummy thermostat, set to zero
etap_dot = new double[mpchain+1];
etap_dot[mpchain] = 0.0;
etap_dotdot = new double[mpchain];
for (ich = 0; ich < mpchain; ich++) {
etap[ich] = etap_dot[ich] =
etap_dotdot[ich] = 0.0;
}
etap_mass = new double[mpchain];
size_vector += 2*2*mpchain;
}
if (deviatoric_flag) size_vector += 1;
}
nrigid = 0;
rfix = NULL;
if (pre_exchange_flag) irregular = new Irregular(lmp);
else irregular = NULL;
// initialize vol0,t0 to zero to signal uninitialized
// values then assigned in init(), if necessary
vol0 = t0 = 0.0;
}
/* ---------------------------------------------------------------------- */
FixNH::~FixNH()
{
if (copymode) return;
delete [] id_dilate;
delete [] rfix;
delete irregular;
// delete temperature and pressure if fix created them
if (tflag) modify->delete_compute(id_temp);
delete [] id_temp;
if (tstat_flag) {
delete [] eta;
delete [] eta_dot;
delete [] eta_dotdot;
delete [] eta_mass;
}
if (pstat_flag) {
if (pflag) modify->delete_compute(id_press);
delete [] id_press;
if (mpchain) {
delete [] etap;
delete [] etap_dot;
delete [] etap_dotdot;
delete [] etap_mass;
}
}
}
/* ---------------------------------------------------------------------- */
int FixNH::setmask()
{
int mask = 0;
mask |= INITIAL_INTEGRATE;
mask |= FINAL_INTEGRATE;
mask |= THERMO_ENERGY;
mask |= INITIAL_INTEGRATE_RESPA;
mask |= FINAL_INTEGRATE_RESPA;
if (pre_exchange_flag) mask |= PRE_EXCHANGE;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixNH::init()
{
// recheck that dilate group has not been deleted
if (allremap == 0) {
int idilate = group->find(id_dilate);
if (idilate == -1)
error->all(FLERR,"Fix nvt/npt/nph dilate group ID does not exist");
dilate_group_bit = group->bitmask[idilate];
}
// ensure no conflict with fix deform
if (pstat_flag)
for (int i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
int *dimflag = ((FixDeform *) modify->fix[i])->dimflag;
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
(p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) ||
(p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
error->all(FLERR,"Cannot use fix npt and fix deform on "
"same component of stress tensor");
}
// set temperature and pressure ptrs
int icompute = modify->find_compute(id_temp);
if (icompute < 0)
error->all(FLERR,"Temperature ID for fix nvt/npt does not exist");
temperature = modify->compute[icompute];
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
if (pstat_flag) {
icompute = modify->find_compute(id_press);
if (icompute < 0)
error->all(FLERR,"Pressure ID for fix npt/nph does not exist");
pressure = modify->compute[icompute];
}
// set timesteps and frequencies
dtv = update->dt;
dtf = 0.5 * update->dt * force->ftm2v;
dthalf = 0.5 * update->dt;
dt4 = 0.25 * update->dt;
dt8 = 0.125 * update->dt;
dto = dthalf;
p_freq_max = 0.0;
if (pstat_flag) {
p_freq_max = MAX(p_freq[0],p_freq[1]);
p_freq_max = MAX(p_freq_max,p_freq[2]);
if (pstyle == TRICLINIC) {
p_freq_max = MAX(p_freq_max,p_freq[3]);
p_freq_max = MAX(p_freq_max,p_freq[4]);
p_freq_max = MAX(p_freq_max,p_freq[5]);
}
pdrag_factor = 1.0 - (update->dt * p_freq_max * drag / nc_pchain);
}
if (tstat_flag)
tdrag_factor = 1.0 - (update->dt * t_freq * drag / nc_tchain);
// tally the number of dimensions that are barostatted
// set initial volume and reference cell, if not already done
if (pstat_flag) {
pdim = p_flag[0] + p_flag[1] + p_flag[2];
if (vol0 == 0.0) {
if (dimension == 3) vol0 = domain->xprd * domain->yprd * domain->zprd;
else vol0 = domain->xprd * domain->yprd;
h0_inv[0] = domain->h_inv[0];
h0_inv[1] = domain->h_inv[1];
h0_inv[2] = domain->h_inv[2];
h0_inv[3] = domain->h_inv[3];
h0_inv[4] = domain->h_inv[4];
h0_inv[5] = domain->h_inv[5];
}
}
boltz = force->boltz;
nktv2p = force->nktv2p;
if (force->kspace) kspace_flag = 1;
else kspace_flag = 0;
if (strstr(update->integrate_style,"respa")) {
nlevels_respa = ((Respa *) update->integrate)->nlevels;
step_respa = ((Respa *) update->integrate)->step;
dto = 0.5*step_respa[0];
}
// detect if any rigid fixes exist so rigid bodies move when box is remapped
// rfix[] = indices to each fix rigid
delete [] rfix;
nrigid = 0;
rfix = NULL;
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->rigid_flag) nrigid++;
if (nrigid) {
rfix = new int[nrigid];
nrigid = 0;
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->rigid_flag) rfix[nrigid++] = i;
}
}
/* ----------------------------------------------------------------------
compute T,P before integrator starts
------------------------------------------------------------------------- */
void FixNH::setup(int vflag)
{
// tdof needed by compute_temp_target()
t_current = temperature->compute_scalar();
tdof = temperature->dof;
// t_target is needed by NPH and NPT in compute_scalar()
// If no thermostat or using fix nphug,
// t_target must be defined by other means.
if (tstat_flag && strcmp(style,"nphug") != 0) {
compute_temp_target();
} else if (pstat_flag) {
// t0 = reference temperature for masses
// cannot be done in init() b/c temperature cannot be called there
// is b/c Modify::init() inits computes after fixes due to dof dependence
// guesstimate a unit-dependent t0 if actual T = 0.0
// if it was read in from a restart file, leave it be
if (t0 == 0.0) {
t0 = temperature->compute_scalar();
if (t0 == 0.0) {
if (strcmp(update->unit_style,"lj") == 0) t0 = 1.0;
else t0 = 300.0;
}
}
t_target = t0;
}
if (pstat_flag) compute_press_target();
if (pstat_flag) {
if (pstyle == ISO) pressure->compute_scalar();
else pressure->compute_vector();
couple();
pressure->addstep(update->ntimestep+1);
}
// masses and initial forces on thermostat variables
if (tstat_flag) {
eta_mass[0] = tdof * boltz * t_target / (t_freq*t_freq);
for (int ich = 1; ich < mtchain; ich++)
eta_mass[ich] = boltz * t_target / (t_freq*t_freq);
for (int ich = 1; ich < mtchain; ich++) {
eta_dotdot[ich] = (eta_mass[ich-1]*eta_dot[ich-1]*eta_dot[ich-1] -
boltz * t_target) / eta_mass[ich];
}
}
// masses and initial forces on barostat variables
if (pstat_flag) {
double kt = boltz * t_target;
double nkt = atom->natoms * kt;
for (int i = 0; i < 3; i++)
if (p_flag[i])
omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
if (pstyle == TRICLINIC) {
for (int i = 3; i < 6; i++)
if (p_flag[i]) omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
}
// masses and initial forces on barostat thermostat variables
if (mpchain) {
etap_mass[0] = boltz * t_target / (p_freq_max*p_freq_max);
for (int ich = 1; ich < mpchain; ich++)
etap_mass[ich] = boltz * t_target / (p_freq_max*p_freq_max);
for (int ich = 1; ich < mpchain; ich++)
etap_dotdot[ich] =
(etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] -
boltz * t_target) / etap_mass[ich];
}
}
}
/* ----------------------------------------------------------------------
1st half of Verlet update
------------------------------------------------------------------------- */
void FixNH::initial_integrate(int vflag)
{
// update eta_press_dot
if (pstat_flag && mpchain) nhc_press_integrate();
// update eta_dot
if (tstat_flag) {
compute_temp_target();
nhc_temp_integrate();
}
// need to recompute pressure to account for change in KE
// t_current is up-to-date, but compute_temperature is not
// compute appropriately coupled elements of mvv_current
if (pstat_flag) {
if (pstyle == ISO) {
temperature->compute_scalar();
pressure->compute_scalar();
} else {
temperature->compute_vector();
pressure->compute_vector();
}
couple();
pressure->addstep(update->ntimestep+1);
}
if (pstat_flag) {
compute_press_target();
nh_omega_dot();
nh_v_press();
}
nve_v();
// remap simulation box by 1/2 step
if (pstat_flag) remap();
nve_x();
// remap simulation box by 1/2 step
// redo KSpace coeffs since volume has changed
if (pstat_flag) {
remap();
if (kspace_flag) force->kspace->setup();
}
}
/* ----------------------------------------------------------------------
2nd half of Verlet update
------------------------------------------------------------------------- */
void FixNH::final_integrate()
{
nve_v();
// re-compute temp before nh_v_press()
// only needed for temperature computes with BIAS on reneighboring steps:
// b/c some biases store per-atom values (e.g. temp/profile)
// per-atom values are invalid if reneigh/comm occurred
// since temp->compute() in initial_integrate()
if (which == BIAS && neighbor->ago == 0)
t_current = temperature->compute_scalar();
if (pstat_flag) nh_v_press();
// compute new T,P after velocities rescaled by nh_v_press()
// compute appropriately coupled elements of mvv_current
t_current = temperature->compute_scalar();
tdof = temperature->dof;
if (pstat_flag) {
if (pstyle == ISO) pressure->compute_scalar();
else pressure->compute_vector();
couple();
pressure->addstep(update->ntimestep+1);
}
if (pstat_flag) nh_omega_dot();
// update eta_dot
// update eta_press_dot
if (tstat_flag) nhc_temp_integrate();
if (pstat_flag && mpchain) nhc_press_integrate();
}
/* ---------------------------------------------------------------------- */
void FixNH::initial_integrate_respa(int vflag, int ilevel, int iloop)
{
// set timesteps by level
dtv = step_respa[ilevel];
dtf = 0.5 * step_respa[ilevel] * force->ftm2v;
dthalf = 0.5 * step_respa[ilevel];
// outermost level - update eta_dot and omega_dot, apply to v
// all other levels - NVE update of v
// x,v updates only performed for atoms in group
if (ilevel == nlevels_respa-1) {
// update eta_press_dot
if (pstat_flag && mpchain) nhc_press_integrate();
// update eta_dot
if (tstat_flag) {
compute_temp_target();
nhc_temp_integrate();
}
// recompute pressure to account for change in KE
// t_current is up-to-date, but compute_temperature is not
// compute appropriately coupled elements of mvv_current
if (pstat_flag) {
if (pstyle == ISO) {
temperature->compute_scalar();
pressure->compute_scalar();
} else {
temperature->compute_vector();
pressure->compute_vector();
}
couple();
pressure->addstep(update->ntimestep+1);
}
if (pstat_flag) {
compute_press_target();
nh_omega_dot();
nh_v_press();
}
nve_v();
} else nve_v();
// innermost level - also update x only for atoms in group
// if barostat, perform 1/2 step remap before and after
if (ilevel == 0) {
if (pstat_flag) remap();
nve_x();
if (pstat_flag) remap();
}
// if barostat, redo KSpace coeffs at outermost level,
// since volume has changed
if (ilevel == nlevels_respa-1 && kspace_flag && pstat_flag)
force->kspace->setup();
}
/* ---------------------------------------------------------------------- */
void FixNH::final_integrate_respa(int ilevel, int iloop)
{
// set timesteps by level
dtf = 0.5 * step_respa[ilevel] * force->ftm2v;
dthalf = 0.5 * step_respa[ilevel];
// outermost level - update eta_dot and omega_dot, apply via final_integrate
// all other levels - NVE update of v
if (ilevel == nlevels_respa-1) final_integrate();
else nve_v();
}
/* ---------------------------------------------------------------------- */
void FixNH::couple()
{
double *tensor = pressure->vector;
if (pstyle == ISO)
p_current[0] = p_current[1] = p_current[2] = pressure->scalar;
else if (pcouple == XYZ) {
double ave = 1.0/3.0 * (tensor[0] + tensor[1] + tensor[2]);
p_current[0] = p_current[1] = p_current[2] = ave;
} else if (pcouple == XY) {
double ave = 0.5 * (tensor[0] + tensor[1]);
p_current[0] = p_current[1] = ave;
p_current[2] = tensor[2];
} else if (pcouple == YZ) {
double ave = 0.5 * (tensor[1] + tensor[2]);
p_current[1] = p_current[2] = ave;
p_current[0] = tensor[0];
} else if (pcouple == XZ) {
double ave = 0.5 * (tensor[0] + tensor[2]);
p_current[0] = p_current[2] = ave;
p_current[1] = tensor[1];
} else {
p_current[0] = tensor[0];
p_current[1] = tensor[1];
p_current[2] = tensor[2];
}
// switch order from xy-xz-yz to Voigt
if (pstyle == TRICLINIC) {
p_current[3] = tensor[5];
p_current[4] = tensor[4];
p_current[5] = tensor[3];
}
}
/* ----------------------------------------------------------------------
change box size
remap all atoms or dilate group atoms depending on allremap flag
if rigid bodies exist, scale rigid body centers-of-mass
------------------------------------------------------------------------- */
void FixNH::remap()
{
int i;
double oldlo,oldhi;
double expfac;
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double *h = domain->h;
// omega is not used, except for book-keeping
for (int i = 0; i < 6; i++) omega[i] += dto*omega_dot[i];
// convert pertinent atoms and rigid bodies to lamda coords
if (allremap) domain->x2lamda(nlocal);
else {
for (i = 0; i < nlocal; i++)
if (mask[i] & dilate_group_bit)
domain->x2lamda(x[i],x[i]);
}
if (nrigid)
for (i = 0; i < nrigid; i++)
modify->fix[rfix[i]]->deform(0);
// reset global and local box to new size/shape
// this operation corresponds to applying the
// translate and scale operations
// corresponding to the solution of the following ODE:
//
// h_dot = omega_dot * h
//
// where h_dot, omega_dot and h are all upper-triangular
// 3x3 tensors. In Voigt notation, the elements of the
// RHS product tensor are:
// h_dot = [0*0, 1*1, 2*2, 1*3+3*2, 0*4+5*3+4*2, 0*5+5*1]
//
// Ordering of operations preserves time symmetry.
double dto2 = dto/2.0;
double dto4 = dto/4.0;
double dto8 = dto/8.0;
// off-diagonal components, first half
if (pstyle == TRICLINIC) {
if (p_flag[4]) {
expfac = exp(dto8*omega_dot[0]);
h[4] *= expfac;
h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
h[4] *= expfac;
}
if (p_flag[3]) {
expfac = exp(dto4*omega_dot[1]);
h[3] *= expfac;
h[3] += dto2*(omega_dot[3]*h[2]);
h[3] *= expfac;
}
if (p_flag[5]) {
expfac = exp(dto4*omega_dot[0]);
h[5] *= expfac;
h[5] += dto2*(omega_dot[5]*h[1]);
h[5] *= expfac;
}
if (p_flag[4]) {
expfac = exp(dto8*omega_dot[0]);
h[4] *= expfac;
h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
h[4] *= expfac;
}
}
// scale diagonal components
// scale tilt factors with cell, if set
if (p_flag[0]) {
oldlo = domain->boxlo[0];
oldhi = domain->boxhi[0];
expfac = exp(dto*omega_dot[0]);
domain->boxlo[0] = (oldlo-fixedpoint[0])*expfac + fixedpoint[0];
domain->boxhi[0] = (oldhi-fixedpoint[0])*expfac + fixedpoint[0];
}
if (p_flag[1]) {
oldlo = domain->boxlo[1];
oldhi = domain->boxhi[1];
expfac = exp(dto*omega_dot[1]);
domain->boxlo[1] = (oldlo-fixedpoint[1])*expfac + fixedpoint[1];
domain->boxhi[1] = (oldhi-fixedpoint[1])*expfac + fixedpoint[1];
if (scalexy) h[5] *= expfac;
}
if (p_flag[2]) {
oldlo = domain->boxlo[2];
oldhi = domain->boxhi[2];
expfac = exp(dto*omega_dot[2]);
domain->boxlo[2] = (oldlo-fixedpoint[2])*expfac + fixedpoint[2];
domain->boxhi[2] = (oldhi-fixedpoint[2])*expfac + fixedpoint[2];
if (scalexz) h[4] *= expfac;
if (scaleyz) h[3] *= expfac;
}
// off-diagonal components, second half
if (pstyle == TRICLINIC) {
if (p_flag[4]) {
expfac = exp(dto8*omega_dot[0]);
h[4] *= expfac;
h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
h[4] *= expfac;
}
if (p_flag[3]) {
expfac = exp(dto4*omega_dot[1]);
h[3] *= expfac;
h[3] += dto2*(omega_dot[3]*h[2]);
h[3] *= expfac;
}
if (p_flag[5]) {
expfac = exp(dto4*omega_dot[0]);
h[5] *= expfac;
h[5] += dto2*(omega_dot[5]*h[1]);
h[5] *= expfac;
}
if (p_flag[4]) {
expfac = exp(dto8*omega_dot[0]);
h[4] *= expfac;
h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
h[4] *= expfac;
}
}
domain->yz = h[3];
domain->xz = h[4];
domain->xy = h[5];
// tilt factor to cell length ratio can not exceed TILTMAX in one step
if (domain->yz < -TILTMAX*domain->yprd ||
domain->yz > TILTMAX*domain->yprd ||
domain->xz < -TILTMAX*domain->xprd ||
domain->xz > TILTMAX*domain->xprd ||
domain->xy < -TILTMAX*domain->xprd ||
domain->xy > TILTMAX*domain->xprd)
error->all(FLERR,"Fix npt/nph has tilted box too far in one step - "
"periodic cell is too far from equilibrium state");
domain->set_global_box();
domain->set_local_box();
// convert pertinent atoms and rigid bodies back to box coords
if (allremap) domain->lamda2x(nlocal);
else {
for (i = 0; i < nlocal; i++)
if (mask[i] & dilate_group_bit)
domain->lamda2x(x[i],x[i]);
}
if (nrigid)
for (i = 0; i < nrigid; i++)
modify->fix[rfix[i]]->deform(1);
}
/* ----------------------------------------------------------------------
pack entire state of Fix into one write
------------------------------------------------------------------------- */
void FixNH::write_restart(FILE *fp)
{
int nsize = size_restart_global();
double *list;
memory->create(list,nsize,"nh:list");
pack_restart_data(list);
if (comm->me == 0) {
int size = nsize * sizeof(double);
fwrite(&size,sizeof(int),1,fp);
fwrite(list,sizeof(double),nsize,fp);
}
memory->destroy(list);
}
/* ----------------------------------------------------------------------
calculate the number of data to be packed
------------------------------------------------------------------------- */
int FixNH::size_restart_global()
{
int nsize = 2;
if (tstat_flag) nsize += 1 + 2*mtchain;
if (pstat_flag) {
nsize += 16 + 2*mpchain;
if (deviatoric_flag) nsize += 6;
}
return nsize;
}
/* ----------------------------------------------------------------------
pack restart data
------------------------------------------------------------------------- */
int FixNH::pack_restart_data(double *list)
{
int n = 0;
list[n++] = tstat_flag;
if (tstat_flag) {
list[n++] = mtchain;
for (int ich = 0; ich < mtchain; ich++)
list[n++] = eta[ich];
for (int ich = 0; ich < mtchain; ich++)
list[n++] = eta_dot[ich];
}
list[n++] = pstat_flag;
if (pstat_flag) {
list[n++] = omega[0];
list[n++] = omega[1];
list[n++] = omega[2];
list[n++] = omega[3];
list[n++] = omega[4];
list[n++] = omega[5];
list[n++] = omega_dot[0];
list[n++] = omega_dot[1];
list[n++] = omega_dot[2];
list[n++] = omega_dot[3];
list[n++] = omega_dot[4];
list[n++] = omega_dot[5];
list[n++] = vol0;
list[n++] = t0;
list[n++] = mpchain;
if (mpchain) {
for (int ich = 0; ich < mpchain; ich++)
list[n++] = etap[ich];
for (int ich = 0; ich < mpchain; ich++)
list[n++] = etap_dot[ich];
}
list[n++] = deviatoric_flag;
if (deviatoric_flag) {
list[n++] = h0_inv[0];
list[n++] = h0_inv[1];
list[n++] = h0_inv[2];
list[n++] = h0_inv[3];
list[n++] = h0_inv[4];
list[n++] = h0_inv[5];
}
}
return n;
}
/* ----------------------------------------------------------------------
use state info from restart file to restart the Fix
------------------------------------------------------------------------- */
void FixNH::restart(char *buf)
{
int n = 0;
double *list = (double *) buf;
int flag = static_cast<int> (list[n++]);
if (flag) {
int m = static_cast<int> (list[n++]);
if (tstat_flag && m == mtchain) {
for (int ich = 0; ich < mtchain; ich++)
eta[ich] = list[n++];
for (int ich = 0; ich < mtchain; ich++)
eta_dot[ich] = list[n++];
} else n += 2*m;
}
flag = static_cast<int> (list[n++]);
if (flag) {
omega[0] = list[n++];
omega[1] = list[n++];
omega[2] = list[n++];
omega[3] = list[n++];
omega[4] = list[n++];
omega[5] = list[n++];
omega_dot[0] = list[n++];
omega_dot[1] = list[n++];
omega_dot[2] = list[n++];
omega_dot[3] = list[n++];
omega_dot[4] = list[n++];
omega_dot[5] = list[n++];
vol0 = list[n++];
t0 = list[n++];
int m = static_cast<int> (list[n++]);
if (pstat_flag && m == mpchain) {
for (int ich = 0; ich < mpchain; ich++)
etap[ich] = list[n++];
for (int ich = 0; ich < mpchain; ich++)
etap_dot[ich] = list[n++];
} else n+=2*m;
flag = static_cast<int> (list[n++]);
if (flag) {
h0_inv[0] = list[n++];
h0_inv[1] = list[n++];
h0_inv[2] = list[n++];
h0_inv[3] = list[n++];
h0_inv[4] = list[n++];
h0_inv[5] = list[n++];
}
}
}
/* ---------------------------------------------------------------------- */
int FixNH::modify_param(int narg, char **arg)
{
if (strcmp(arg[0],"temp") == 0) {
if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
if (tflag) {
modify->delete_compute(id_temp);
tflag = 0;
}
delete [] id_temp;
int n = strlen(arg[1]) + 1;
id_temp = new char[n];
strcpy(id_temp,arg[1]);
int icompute = modify->find_compute(arg[1]);
if (icompute < 0)
error->all(FLERR,"Could not find fix_modify temperature ID");
temperature = modify->compute[icompute];
if (temperature->tempflag == 0)
error->all(FLERR,
"Fix_modify temperature ID does not compute temperature");
if (temperature->igroup != 0 && comm->me == 0)
error->warning(FLERR,"Temperature for fix modify is not for group all");
// reset id_temp of pressure to new temperature ID
if (pstat_flag) {
icompute = modify->find_compute(id_press);
if (icompute < 0)
error->all(FLERR,"Pressure ID for fix modify does not exist");
modify->compute[icompute]->reset_extra_compute_fix(id_temp);
}
return 2;
} else if (strcmp(arg[0],"press") == 0) {
if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
if (!pstat_flag) error->all(FLERR,"Illegal fix_modify command");
if (pflag) {
modify->delete_compute(id_press);
pflag = 0;
}
delete [] id_press;
int n = strlen(arg[1]) + 1;
id_press = new char[n];
strcpy(id_press,arg[1]);
int icompute = modify->find_compute(arg[1]);
if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
pressure = modify->compute[icompute];
if (pressure->pressflag == 0)
error->all(FLERR,"Fix_modify pressure ID does not compute pressure");
return 2;
}
return 0;
}
/* ---------------------------------------------------------------------- */
double FixNH::compute_scalar()
{
int i;
double volume;
double energy;
double kt = boltz * t_target;
double lkt_press = kt;
int ich;
if (dimension == 3) volume = domain->xprd * domain->yprd * domain->zprd;
else volume = domain->xprd * domain->yprd;
energy = 0.0;
// thermostat chain energy is equivalent to Eq. (2) in
// Martyna, Tuckerman, Tobias, Klein, Mol Phys, 87, 1117
// Sum(0.5*p_eta_k^2/Q_k,k=1,M) + L*k*T*eta_1 + Sum(k*T*eta_k,k=2,M),
// where L = tdof
// M = mtchain
// p_eta_k = Q_k*eta_dot[k-1]
// Q_1 = L*k*T/t_freq^2
// Q_k = k*T/t_freq^2, k > 1
if (tstat_flag) {
energy += ke_target * eta[0] + 0.5*eta_mass[0]*eta_dot[0]*eta_dot[0];
for (ich = 1; ich < mtchain; ich++)
energy += kt * eta[ich] + 0.5*eta_mass[ich]*eta_dot[ich]*eta_dot[ich];
}
// barostat energy is equivalent to Eq. (8) in
// Martyna, Tuckerman, Tobias, Klein, Mol Phys, 87, 1117
// Sum(0.5*p_omega^2/W + P*V),
// where N = natoms
// p_omega = W*omega_dot
// W = N*k*T/p_freq^2
// sum is over barostatted dimensions
if (pstat_flag) {
for (i = 0; i < 3; i++)
if (p_flag[i])
energy += 0.5*omega_dot[i]*omega_dot[i]*omega_mass[i] +
p_hydro*(volume-vol0) / (pdim*nktv2p);
if (pstyle == TRICLINIC) {
for (i = 3; i < 6; i++)
if (p_flag[i])
energy += 0.5*omega_dot[i]*omega_dot[i]*omega_mass[i];
}
// extra contributions from thermostat chain for barostat
if (mpchain) {
energy += lkt_press * etap[0] + 0.5*etap_mass[0]*etap_dot[0]*etap_dot[0];
for (ich = 1; ich < mpchain; ich++)
energy += kt * etap[ich] +
0.5*etap_mass[ich]*etap_dot[ich]*etap_dot[ich];
}
// extra contribution from strain energy
if (deviatoric_flag) energy += compute_strain_energy();
}
return energy;
}
/* ----------------------------------------------------------------------
return a single element of the following vectors, in this order:
eta[tchain], eta_dot[tchain], omega[ndof], omega_dot[ndof]
etap[pchain], etap_dot[pchain], PE_eta[tchain], KE_eta_dot[tchain]
PE_omega[ndof], KE_omega_dot[ndof], PE_etap[pchain], KE_etap_dot[pchain]
PE_strain[1]
if no thermostat exists, related quantities are omitted from the list
if no barostat exists, related quantities are omitted from the list
ndof = 1,3,6 degrees of freedom for pstyle = ISO,ANISO,TRI
------------------------------------------------------------------------- */
double FixNH::compute_vector(int n)
{
int ilen;
if (tstat_flag) {
ilen = mtchain;
if (n < ilen) return eta[n];
n -= ilen;
ilen = mtchain;
if (n < ilen) return eta_dot[n];
n -= ilen;
}
if (pstat_flag) {
if (pstyle == ISO) {
ilen = 1;
if (n < ilen) return omega[n];
n -= ilen;
} else if (pstyle == ANISO) {
ilen = 3;
if (n < ilen) return omega[n];
n -= ilen;
} else {
ilen = 6;
if (n < ilen) return omega[n];
n -= ilen;
}
if (pstyle == ISO) {
ilen = 1;
if (n < ilen) return omega_dot[n];
n -= ilen;
} else if (pstyle == ANISO) {
ilen = 3;
if (n < ilen) return omega_dot[n];
n -= ilen;
} else {
ilen = 6;
if (n < ilen) return omega_dot[n];
n -= ilen;
}
if (mpchain) {
ilen = mpchain;
if (n < ilen) return etap[n];
n -= ilen;
ilen = mpchain;
if (n < ilen) return etap_dot[n];
n -= ilen;
}
}
double volume;
double kt = boltz * t_target;
double lkt_press = kt;
int ich;
if (dimension == 3) volume = domain->xprd * domain->yprd * domain->zprd;
else volume = domain->xprd * domain->yprd;
if (tstat_flag) {
ilen = mtchain;
if (n < ilen) {
ich = n;
if (ich == 0)
return ke_target * eta[0];
else
return kt * eta[ich];
}
n -= ilen;
ilen = mtchain;
if (n < ilen) {
ich = n;
if (ich == 0)
return 0.5*eta_mass[0]*eta_dot[0]*eta_dot[0];
else
return 0.5*eta_mass[ich]*eta_dot[ich]*eta_dot[ich];
}
n -= ilen;
}
if (pstat_flag) {
if (pstyle == ISO) {
ilen = 1;
if (n < ilen)
return p_hydro*(volume-vol0) / nktv2p;
n -= ilen;
} else if (pstyle == ANISO) {
ilen = 3;
if (n < ilen) {
if (p_flag[n])
return p_hydro*(volume-vol0) / (pdim*nktv2p);
else
return 0.0;
}
n -= ilen;
} else {
ilen = 6;
if (n < ilen) {
if (n > 2) return 0.0;
else if (p_flag[n])
return p_hydro*(volume-vol0) / (pdim*nktv2p);
else
return 0.0;
}
n -= ilen;
}
if (pstyle == ISO) {
ilen = 1;
if (n < ilen)
return pdim*0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
n -= ilen;
} else if (pstyle == ANISO) {
ilen = 3;
if (n < ilen) {
if (p_flag[n])
return 0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
else return 0.0;
}
n -= ilen;
} else {
ilen = 6;
if (n < ilen) {
if (p_flag[n])
return 0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
else return 0.0;
}
n -= ilen;
}
if (mpchain) {
ilen = mpchain;
if (n < ilen) {
ich = n;
if (ich == 0) return lkt_press * etap[0];
else return kt * etap[ich];
}
n -= ilen;
ilen = mpchain;
if (n < ilen) {
ich = n;
if (ich == 0)
return 0.5*etap_mass[0]*etap_dot[0]*etap_dot[0];
else
return 0.5*etap_mass[ich]*etap_dot[ich]*etap_dot[ich];
}
n -= ilen;
}
if (deviatoric_flag) {
ilen = 1;
if (n < ilen)
return compute_strain_energy();
n -= ilen;
}
}
return 0.0;
}
/* ---------------------------------------------------------------------- */
void FixNH::reset_target(double t_new)
{
t_target = t_start = t_stop = t_new;
}
/* ---------------------------------------------------------------------- */
void FixNH::reset_dt()
{
dtv = update->dt;
dtf = 0.5 * update->dt * force->ftm2v;
dthalf = 0.5 * update->dt;
dt4 = 0.25 * update->dt;
dt8 = 0.125 * update->dt;
dto = dthalf;
// If using respa, then remap is performed in innermost level
if (strstr(update->integrate_style,"respa"))
dto = 0.5*step_respa[0];
if (pstat_flag)
pdrag_factor = 1.0 - (update->dt * p_freq_max * drag / nc_pchain);
if (tstat_flag)
tdrag_factor = 1.0 - (update->dt * t_freq * drag / nc_tchain);
}
/* ----------------------------------------------------------------------
extract thermostat properties
------------------------------------------------------------------------- */
void *FixNH::extract(const char *str, int &dim)
{
dim=0;
if (strcmp(str,"t_target") == 0) {
return &t_target;
} else if (strcmp(str,"mtchain") == 0) {
return &mtchain;
}
dim=1;
if (strcmp(str,"eta") == 0) {
return &eta;
}
return NULL;
}
/* ----------------------------------------------------------------------
perform half-step update of chain thermostat variables
------------------------------------------------------------------------- */
void FixNH::nhc_temp_integrate()
{
int ich;
double expfac;
double kecurrent = tdof * boltz * t_current;
// Update masses, to preserve initial freq, if flag set
if (eta_mass_flag) {
eta_mass[0] = tdof * boltz * t_target / (t_freq*t_freq);
for (int ich = 1; ich < mtchain; ich++)
eta_mass[ich] = boltz * t_target / (t_freq*t_freq);
}
if (eta_mass[0] > 0.0)
eta_dotdot[0] = (kecurrent - ke_target)/eta_mass[0];
else eta_dotdot[0] = 0.0;
double ncfac = 1.0/nc_tchain;
for (int iloop = 0; iloop < nc_tchain; iloop++) {
for (ich = mtchain-1; ich > 0; ich--) {
expfac = exp(-ncfac*dt8*eta_dot[ich+1]);
eta_dot[ich] *= expfac;
eta_dot[ich] += eta_dotdot[ich] * ncfac*dt4;
eta_dot[ich] *= tdrag_factor;
eta_dot[ich] *= expfac;
}
expfac = exp(-ncfac*dt8*eta_dot[1]);
eta_dot[0] *= expfac;
eta_dot[0] += eta_dotdot[0] * ncfac*dt4;
eta_dot[0] *= tdrag_factor;
eta_dot[0] *= expfac;
factor_eta = exp(-ncfac*dthalf*eta_dot[0]);
nh_v_temp();
// rescale temperature due to velocity scaling
// should not be necessary to explicitly recompute the temperature
t_current *= factor_eta*factor_eta;
kecurrent = tdof * boltz * t_current;
if (eta_mass[0] > 0.0)
eta_dotdot[0] = (kecurrent - ke_target)/eta_mass[0];
else eta_dotdot[0] = 0.0;
for (ich = 0; ich < mtchain; ich++)
eta[ich] += ncfac*dthalf*eta_dot[ich];
eta_dot[0] *= expfac;
eta_dot[0] += eta_dotdot[0] * ncfac*dt4;
eta_dot[0] *= expfac;
for (ich = 1; ich < mtchain; ich++) {
expfac = exp(-ncfac*dt8*eta_dot[ich+1]);
eta_dot[ich] *= expfac;
eta_dotdot[ich] = (eta_mass[ich-1]*eta_dot[ich-1]*eta_dot[ich-1]
- boltz * t_target)/eta_mass[ich];
eta_dot[ich] += eta_dotdot[ich] * ncfac*dt4;
eta_dot[ich] *= expfac;
}
}
}
/* ----------------------------------------------------------------------
perform half-step update of chain thermostat variables for barostat
scale barostat velocities
------------------------------------------------------------------------- */
void FixNH::nhc_press_integrate()
{
int ich,i;
double expfac,factor_etap,kecurrent;
double kt = boltz * t_target;
double lkt_press = kt;
// Update masses, to preserve initial freq, if flag set
if (omega_mass_flag) {
double nkt = atom->natoms * kt;
for (int i = 0; i < 3; i++)
if (p_flag[i])
omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
if (pstyle == TRICLINIC) {
for (int i = 3; i < 6; i++)
if (p_flag[i]) omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
}
}
if (etap_mass_flag) {
if (mpchain) {
etap_mass[0] = boltz * t_target / (p_freq_max*p_freq_max);
for (int ich = 1; ich < mpchain; ich++)
etap_mass[ich] = boltz * t_target / (p_freq_max*p_freq_max);
for (int ich = 1; ich < mpchain; ich++)
etap_dotdot[ich] =
(etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] -
boltz * t_target) / etap_mass[ich];
}
}
kecurrent = 0.0;
for (i = 0; i < 3; i++)
if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
if (pstyle == TRICLINIC) {
for (i = 3; i < 6; i++)
if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
}
etap_dotdot[0] = (kecurrent - lkt_press)/etap_mass[0];
double ncfac = 1.0/nc_pchain;
for (int iloop = 0; iloop < nc_pchain; iloop++) {
for (ich = mpchain-1; ich > 0; ich--) {
expfac = exp(-ncfac*dt8*etap_dot[ich+1]);
etap_dot[ich] *= expfac;
etap_dot[ich] += etap_dotdot[ich] * ncfac*dt4;
etap_dot[ich] *= pdrag_factor;
etap_dot[ich] *= expfac;
}
expfac = exp(-ncfac*dt8*etap_dot[1]);
etap_dot[0] *= expfac;
etap_dot[0] += etap_dotdot[0] * ncfac*dt4;
etap_dot[0] *= pdrag_factor;
etap_dot[0] *= expfac;
for (ich = 0; ich < mpchain; ich++)
etap[ich] += ncfac*dthalf*etap_dot[ich];
factor_etap = exp(-ncfac*dthalf*etap_dot[0]);
for (i = 0; i < 3; i++)
if (p_flag[i]) omega_dot[i] *= factor_etap;
if (pstyle == TRICLINIC) {
for (i = 3; i < 6; i++)
if (p_flag[i]) omega_dot[i] *= factor_etap;
}
kecurrent = 0.0;
for (i = 0; i < 3; i++)
if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
if (pstyle == TRICLINIC) {
for (i = 3; i < 6; i++)
if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
}
etap_dotdot[0] = (kecurrent - lkt_press)/etap_mass[0];
etap_dot[0] *= expfac;
etap_dot[0] += etap_dotdot[0] * ncfac*dt4;
etap_dot[0] *= expfac;
for (ich = 1; ich < mpchain; ich++) {
expfac = exp(-ncfac*dt8*etap_dot[ich+1]);
etap_dot[ich] *= expfac;
etap_dotdot[ich] =
(etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] - boltz*t_target) /
etap_mass[ich];
etap_dot[ich] += etap_dotdot[ich] * ncfac*dt4;
etap_dot[ich] *= expfac;
}
}
}
/* ----------------------------------------------------------------------
perform half-step barostat scaling of velocities
-----------------------------------------------------------------------*/
void FixNH::nh_v_press()
{
double factor[3];
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
factor[0] = exp(-dt4*(omega_dot[0]+mtk_term2));
factor[1] = exp(-dt4*(omega_dot[1]+mtk_term2));
factor[2] = exp(-dt4*(omega_dot[2]+mtk_term2));
if (which == NOBIAS) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
v[i][0] *= factor[0];
v[i][1] *= factor[1];
v[i][2] *= factor[2];
if (pstyle == TRICLINIC) {
v[i][0] += -dthalf*(v[i][1]*omega_dot[5] + v[i][2]*omega_dot[4]);
v[i][1] += -dthalf*v[i][2]*omega_dot[3];
}
v[i][0] *= factor[0];
v[i][1] *= factor[1];
v[i][2] *= factor[2];
}
}
} else if (which == BIAS) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
temperature->remove_bias(i,v[i]);
v[i][0] *= factor[0];
v[i][1] *= factor[1];
v[i][2] *= factor[2];
if (pstyle == TRICLINIC) {
v[i][0] += -dthalf*(v[i][1]*omega_dot[5] + v[i][2]*omega_dot[4]);
v[i][1] += -dthalf*v[i][2]*omega_dot[3];
}
v[i][0] *= factor[0];
v[i][1] *= factor[1];
v[i][2] *= factor[2];
temperature->restore_bias(i,v[i]);
}
}
}
}
/* ----------------------------------------------------------------------
perform half-step update of velocities
-----------------------------------------------------------------------*/
void FixNH::nve_v()
{
double dtfm;
double **v = atom->v;
double **f = atom->f;
double *rmass = atom->rmass;
double *mass = atom->mass;
int *type = atom->type;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
if (rmass) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
dtfm = dtf / rmass[i];
v[i][0] += dtfm*f[i][0];
v[i][1] += dtfm*f[i][1];
v[i][2] += dtfm*f[i][2];
}
}
} else {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
dtfm = dtf / mass[type[i]];
v[i][0] += dtfm*f[i][0];
v[i][1] += dtfm*f[i][1];
v[i][2] += dtfm*f[i][2];
}
}
}
}
/* ----------------------------------------------------------------------
perform full-step update of positions
-----------------------------------------------------------------------*/
void FixNH::nve_x()
{
double **x = atom->x;
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
// x update by full step only for atoms in group
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
x[i][0] += dtv * v[i][0];
x[i][1] += dtv * v[i][1];
x[i][2] += dtv * v[i][2];
}
}
}
/* ----------------------------------------------------------------------
perform half-step thermostat scaling of velocities
-----------------------------------------------------------------------*/
void FixNH::nh_v_temp()
{
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
if (which == NOBIAS) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
v[i][0] *= factor_eta;
v[i][1] *= factor_eta;
v[i][2] *= factor_eta;
}
}
} else if (which == BIAS) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
temperature->remove_bias(i,v[i]);
v[i][0] *= factor_eta;
v[i][1] *= factor_eta;
v[i][2] *= factor_eta;
temperature->restore_bias(i,v[i]);
}
}
}
}
/* ----------------------------------------------------------------------
compute sigma tensor
needed whenever p_target or h0_inv changes
-----------------------------------------------------------------------*/
void FixNH::compute_sigma()
{
// if nreset_h0 > 0, reset vol0 and h0_inv
// every nreset_h0 timesteps
if (nreset_h0 > 0) {
int delta = update->ntimestep - update->beginstep;
if (delta % nreset_h0 == 0) {
if (dimension == 3) vol0 = domain->xprd * domain->yprd * domain->zprd;
else vol0 = domain->xprd * domain->yprd;
h0_inv[0] = domain->h_inv[0];
h0_inv[1] = domain->h_inv[1];
h0_inv[2] = domain->h_inv[2];
h0_inv[3] = domain->h_inv[3];
h0_inv[4] = domain->h_inv[4];
h0_inv[5] = domain->h_inv[5];
}
}
// generate upper-triangular half of
// sigma = vol0*h0inv*(p_target-p_hydro)*h0inv^t
// units of sigma are are PV/L^2 e.g. atm.A
//
// [ 0 5 4 ] [ 0 5 4 ] [ 0 5 4 ] [ 0 - - ]
// [ 5 1 3 ] = [ - 1 3 ] [ 5 1 3 ] [ 5 1 - ]
// [ 4 3 2 ] [ - - 2 ] [ 4 3 2 ] [ 4 3 2 ]
sigma[0] =
vol0*(h0_inv[0]*((p_target[0]-p_hydro)*h0_inv[0] +
p_target[5]*h0_inv[5]+p_target[4]*h0_inv[4]) +
h0_inv[5]*(p_target[5]*h0_inv[0] +
(p_target[1]-p_hydro)*h0_inv[5]+p_target[3]*h0_inv[4]) +
h0_inv[4]*(p_target[4]*h0_inv[0]+p_target[3]*h0_inv[5] +
(p_target[2]-p_hydro)*h0_inv[4]));
sigma[1] =
vol0*(h0_inv[1]*((p_target[1]-p_hydro)*h0_inv[1] +
p_target[3]*h0_inv[3]) +
h0_inv[3]*(p_target[3]*h0_inv[1] +
(p_target[2]-p_hydro)*h0_inv[3]));
sigma[2] =
vol0*(h0_inv[2]*((p_target[2]-p_hydro)*h0_inv[2]));
sigma[3] =
vol0*(h0_inv[1]*(p_target[3]*h0_inv[2]) +
h0_inv[3]*((p_target[2]-p_hydro)*h0_inv[2]));
sigma[4] =
vol0*(h0_inv[0]*(p_target[4]*h0_inv[2]) +
h0_inv[5]*(p_target[3]*h0_inv[2]) +
h0_inv[4]*((p_target[2]-p_hydro)*h0_inv[2]));
sigma[5] =
vol0*(h0_inv[0]*(p_target[5]*h0_inv[1]+p_target[4]*h0_inv[3]) +
h0_inv[5]*((p_target[1]-p_hydro)*h0_inv[1]+p_target[3]*h0_inv[3]) +
h0_inv[4]*(p_target[3]*h0_inv[1]+(p_target[2]-p_hydro)*h0_inv[3]));
}
/* ----------------------------------------------------------------------
compute strain energy
-----------------------------------------------------------------------*/
double FixNH::compute_strain_energy()
{
// compute strain energy = 0.5*Tr(sigma*h*h^t) in energy units
double* h = domain->h;
double d0,d1,d2;
d0 =
sigma[0]*(h[0]*h[0]+h[5]*h[5]+h[4]*h[4]) +
sigma[5]*( h[1]*h[5]+h[3]*h[4]) +
sigma[4]*( h[2]*h[4]);
d1 =
sigma[5]*( h[5]*h[1]+h[4]*h[3]) +
sigma[1]*( h[1]*h[1]+h[3]*h[3]) +
sigma[3]*( h[2]*h[3]);
d2 =
sigma[4]*( h[4]*h[2]) +
sigma[3]*( h[3]*h[2]) +
sigma[2]*( h[2]*h[2]);
double energy = 0.5*(d0+d1+d2)/nktv2p;
return energy;
}
/* ----------------------------------------------------------------------
compute deviatoric barostat force = h*sigma*h^t
-----------------------------------------------------------------------*/
void FixNH::compute_deviatoric()
{
// generate upper-triangular part of h*sigma*h^t
// units of fdev are are PV, e.g. atm*A^3
// [ 0 5 4 ] [ 0 5 4 ] [ 0 5 4 ] [ 0 - - ]
// [ 5 1 3 ] = [ - 1 3 ] [ 5 1 3 ] [ 5 1 - ]
// [ 4 3 2 ] [ - - 2 ] [ 4 3 2 ] [ 4 3 2 ]
double* h = domain->h;
fdev[0] =
h[0]*(sigma[0]*h[0]+sigma[5]*h[5]+sigma[4]*h[4]) +
h[5]*(sigma[5]*h[0]+sigma[1]*h[5]+sigma[3]*h[4]) +
h[4]*(sigma[4]*h[0]+sigma[3]*h[5]+sigma[2]*h[4]);
fdev[1] =
h[1]*( sigma[1]*h[1]+sigma[3]*h[3]) +
h[3]*( sigma[3]*h[1]+sigma[2]*h[3]);
fdev[2] =
h[2]*( sigma[2]*h[2]);
fdev[3] =
h[1]*( sigma[3]*h[2]) +
h[3]*( sigma[2]*h[2]);
fdev[4] =
h[0]*( sigma[4]*h[2]) +
h[5]*( sigma[3]*h[2]) +
h[4]*( sigma[2]*h[2]);
fdev[5] =
h[0]*( sigma[5]*h[1]+sigma[4]*h[3]) +
h[5]*( sigma[1]*h[1]+sigma[3]*h[3]) +
h[4]*( sigma[3]*h[1]+sigma[2]*h[3]);
}
/* ----------------------------------------------------------------------
compute target temperature and kinetic energy
-----------------------------------------------------------------------*/
void FixNH::compute_temp_target()
{
double delta = update->ntimestep - update->beginstep;
if (delta != 0.0) delta /= update->endstep - update->beginstep;
t_target = t_start + delta * (t_stop-t_start);
ke_target = tdof * boltz * t_target;
}
/* ----------------------------------------------------------------------
compute hydrostatic target pressure
-----------------------------------------------------------------------*/
void FixNH::compute_press_target()
{
double delta = update->ntimestep - update->beginstep;
if (delta != 0.0) delta /= update->endstep - update->beginstep;
p_hydro = 0.0;
for (int i = 0; i < 3; i++)
if (p_flag[i]) {
p_target[i] = p_start[i] + delta * (p_stop[i]-p_start[i]);
p_hydro += p_target[i];
}
p_hydro /= pdim;
if (pstyle == TRICLINIC)
for (int i = 3; i < 6; i++)
p_target[i] = p_start[i] + delta * (p_stop[i]-p_start[i]);
// if deviatoric, recompute sigma each time p_target changes
if (deviatoric_flag) compute_sigma();
}
/* ----------------------------------------------------------------------
update omega_dot, omega
-----------------------------------------------------------------------*/
void FixNH::nh_omega_dot()
{
double f_omega,volume;
if (dimension == 3) volume = domain->xprd*domain->yprd*domain->zprd;
else volume = domain->xprd*domain->yprd;
if (deviatoric_flag) compute_deviatoric();
mtk_term1 = 0.0;
if (mtk_flag) {
if (pstyle == ISO) {
mtk_term1 = tdof * boltz * t_current;
mtk_term1 /= pdim * atom->natoms;
} else {
double *mvv_current = temperature->vector;
for (int i = 0; i < 3; i++)
if (p_flag[i])
mtk_term1 += mvv_current[i];
mtk_term1 /= pdim * atom->natoms;
}
}
for (int i = 0; i < 3; i++)
if (p_flag[i]) {
f_omega = (p_current[i]-p_hydro)*volume /
(omega_mass[i] * nktv2p) + mtk_term1 / omega_mass[i];
if (deviatoric_flag) f_omega -= fdev[i]/(omega_mass[i] * nktv2p);
omega_dot[i] += f_omega*dthalf;
omega_dot[i] *= pdrag_factor;
}
mtk_term2 = 0.0;
if (mtk_flag) {
for (int i = 0; i < 3; i++)
if (p_flag[i])
mtk_term2 += omega_dot[i];
mtk_term2 /= pdim * atom->natoms;
}
if (pstyle == TRICLINIC) {
for (int i = 3; i < 6; i++) {
if (p_flag[i]) {
f_omega = p_current[i]*volume/(omega_mass[i] * nktv2p);
if (deviatoric_flag)
f_omega -= fdev[i]/(omega_mass[i] * nktv2p);
omega_dot[i] += f_omega*dthalf;
omega_dot[i] *= pdrag_factor;
}
}
}
}
/* ----------------------------------------------------------------------
if any tilt ratios exceed limits, set flip = 1 and compute new tilt values
do not flip in x or y if non-periodic (can tilt but not flip)
this is b/c the box length would be changed (dramatically) by flip
if yz tilt exceeded, adjust C vector by one B vector
if xz tilt exceeded, adjust C vector by one A vector
if xy tilt exceeded, adjust B vector by one A vector
check yz first since it may change xz, then xz check comes after
if any flip occurs, create new box in domain
image_flip() adjusts image flags due to box shape change induced by flip
remap() puts atoms outside the new box back into the new box
perform irregular on atoms in lamda coords to migrate atoms to new procs
important that image_flip comes before remap, since remap may change
image flags to new values, making eqs in doc of Domain:image_flip incorrect
------------------------------------------------------------------------- */
void FixNH::pre_exchange()
{
double xprd = domain->xprd;
double yprd = domain->yprd;
// flip is only triggered when tilt exceeds 0.5 by DELTAFLIP
// this avoids immediate re-flipping due to tilt oscillations
double xtiltmax = (0.5+DELTAFLIP)*xprd;
double ytiltmax = (0.5+DELTAFLIP)*yprd;
int flipxy,flipxz,flipyz;
flipxy = flipxz = flipyz = 0;
if (domain->yperiodic) {
if (domain->yz < -ytiltmax) {
domain->yz += yprd;
domain->xz += domain->xy;
flipyz = 1;
} else if (domain->yz >= ytiltmax) {
domain->yz -= yprd;
domain->xz -= domain->xy;
flipyz = -1;
}
}
if (domain->xperiodic) {
if (domain->xz < -xtiltmax) {
domain->xz += xprd;
flipxz = 1;
} else if (domain->xz >= xtiltmax) {
domain->xz -= xprd;
flipxz = -1;
}
if (domain->xy < -xtiltmax) {
domain->xy += xprd;
flipxy = 1;
} else if (domain->xy >= xtiltmax) {
domain->xy -= xprd;
flipxy = -1;
}
}
int flip = 0;
if (flipxy || flipxz || flipyz) flip = 1;
if (flip) {
domain->set_global_box();
domain->set_local_box();
domain->image_flip(flipxy,flipxz,flipyz);
double **x = atom->x;
imageint *image = atom->image;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) domain->remap(x[i],image[i]);
domain->x2lamda(atom->nlocal);
irregular->migrate_atoms();
domain->lamda2x(atom->nlocal);
}
}
/* ----------------------------------------------------------------------
memory usage of Irregular
------------------------------------------------------------------------- */
double FixNH::memory_usage()
{
double bytes = 0.0;
if (irregular) bytes += irregular->memory_usage();
return bytes;
}
diff --git a/src/fix_nh.h b/src/fix_nh.h
index be645d0be..d2201e161 100644
--- a/src/fix_nh.h
+++ b/src/fix_nh.h
@@ -1,260 +1,261 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_FIX_NH_H
#define LMP_FIX_NH_H
#include "fix.h"
namespace LAMMPS_NS {
class FixNH : public Fix {
public:
FixNH(class LAMMPS *, int, char **);
virtual ~FixNH();
int setmask();
virtual void init();
virtual void setup(int);
virtual void initial_integrate(int);
virtual void final_integrate();
void initial_integrate_respa(int, int, int);
void final_integrate_respa(int, int);
virtual void pre_exchange();
double compute_scalar();
virtual double compute_vector(int);
void write_restart(FILE *);
virtual int pack_restart_data(double *); // pack restart data
virtual void restart(char *);
int modify_param(int, char **);
void reset_target(double);
void reset_dt();
virtual void *extract(const char*,int &);
double memory_usage();
protected:
int dimension,which;
double dtv,dtf,dthalf,dt4,dt8,dto;
double boltz,nktv2p,tdof;
double vol0; // reference volume
double t0; // reference temperature
// used for barostat mass
double t_start,t_stop;
double t_current,t_target,ke_target;
double t_freq;
int tstat_flag; // 1 if control T
int pstat_flag; // 1 if control P
int pstyle,pcouple,allremap;
int p_flag[6]; // 1 if control P on this dim, 0 if not
double p_start[6],p_stop[6];
double p_freq[6],p_target[6];
double omega[6],omega_dot[6];
double omega_mass[6];
double p_current[6];
double drag,tdrag_factor; // drag factor on particle thermostat
double pdrag_factor; // drag factor on barostat
int kspace_flag; // 1 if KSpace invoked, 0 if not
int nrigid; // number of rigid fixes
int dilate_group_bit; // mask for dilation group
int *rfix; // indices of rigid fixes
char *id_dilate; // group name to dilate
class Irregular *irregular; // for migrating atoms after box flips
int nlevels_respa;
double *step_respa;
char *id_temp,*id_press;
class Compute *temperature,*pressure;
int tflag,pflag;
double *eta,*eta_dot; // chain thermostat for particles
double *eta_dotdot;
double *eta_mass;
int mtchain; // length of chain
int mtchain_default_flag; // 1 = mtchain is default
double *etap; // chain thermostat for barostat
double *etap_dot;
double *etap_dotdot;
double *etap_mass;
int mpchain; // length of chain
int mtk_flag; // 0 if using Hoover barostat
int pdim; // number of barostatted dims
double p_freq_max; // maximum barostat frequency
double p_hydro; // hydrostatic target pressure
int nc_tchain,nc_pchain;
double factor_eta;
double sigma[6]; // scaled target stress
double fdev[6]; // deviatoric force on barostat
int deviatoric_flag; // 0 if target stress tensor is hydrostatic
double h0_inv[6]; // h_inv of reference (zero strain) box
int nreset_h0; // interval for resetting h0
double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections
int eta_mass_flag; // 1 if eta_mass updated, 0 if not.
int omega_mass_flag; // 1 if omega_mass updated, 0 if not.
int etap_mass_flag; // 1 if etap_mass updated, 0 if not.
+ int dipole_flag; // 1 if dipole is updated, 0 if not.
int scaleyz; // 1 if yz scaled with lz
int scalexz; // 1 if xz scaled with lz
int scalexy; // 1 if xy scaled with ly
int flipflag; // 1 if box flips are invoked as needed
int pre_exchange_flag; // set if pre_exchange needed for box flips
double fixedpoint[3]; // location of dilation fixed-point
void couple();
virtual void remap();
void nhc_temp_integrate();
void nhc_press_integrate();
virtual void nve_x(); // may be overwritten by child classes
virtual void nve_v();
virtual void nh_v_press();
virtual void nh_v_temp();
virtual void compute_temp_target();
virtual int size_restart_global();
void compute_sigma();
void compute_deviatoric();
double compute_strain_energy();
void compute_press_target();
void nh_omega_dot();
};
}
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Target temperature for fix nvt/npt/nph cannot be 0.0
Self-explanatory.
E: Invalid fix nvt/npt/nph command for a 2d simulation
Cannot control z dimension in a 2d model.
E: Fix nvt/npt/nph dilate group ID does not exist
Self-explanatory.
E: Invalid fix nvt/npt/nph command pressure settings
If multiple dimensions are coupled, those dimensions must be
specified.
E: Cannot use fix nvt/npt/nph on a non-periodic dimension
When specifying a diagonal pressure component, the dimension must be
periodic.
E: Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension
When specifying an off-diagonal pressure component, the 2nd of the two
dimensions must be periodic. E.g. if the xy component is specified,
then the y dimension must be periodic.
E: Cannot use fix nvt/npt/nph with yz scaling when z is non-periodic dimension
The 2nd dimension in the barostatted tilt factor must be periodic.
E: Cannot use fix nvt/npt/nph with xz scaling when z is non-periodic dimension
The 2nd dimension in the barostatted tilt factor must be periodic.
E: Cannot use fix nvt/npt/nph with xy scaling when y is non-periodic dimension
The 2nd dimension in the barostatted tilt factor must be periodic.
E: Cannot use fix nvt/npt/nph with both yz dynamics and yz scaling
Self-explanatory.
E: Cannot use fix nvt/npt/nph with both xz dynamics and xz scaling
Self-explanatory.
E: Cannot use fix nvt/npt/nph with both xy dynamics and xy scaling
Self-explanatory.
E: Can not specify Pxy/Pxz/Pyz in fix nvt/npt/nph with non-triclinic box
Only triclinic boxes can be used with off-diagonal pressure components.
See the region prism command for details.
E: Invalid fix nvt/npt/nph pressure settings
Settings for coupled dimensions must be the same.
E: Fix nvt/npt/nph damping parameters must be > 0.0
Self-explanatory.
E: Cannot use fix npt and fix deform on same component of stress tensor
This would be changing the same box dimension twice.
E: Temperature ID for fix nvt/npt does not exist
Self-explanatory.
E: Pressure ID for fix npt/nph does not exist
Self-explanatory.
E: Fix npt/nph has tilted box too far in one step - periodic cell is too far from equilibrium state
Self-explanatory. The change in the box tilt is too extreme
on a short timescale.
E: Could not find fix_modify temperature ID
The compute ID for computing temperature does not exist.
E: Fix_modify temperature ID does not compute temperature
The compute ID assigned to the fix must compute temperature.
W: Temperature for fix modify is not for group all
The temperature compute is being used with a pressure calculation
which does operate on group all, so this may be inconsistent.
E: Pressure ID for fix modify does not exist
Self-explanatory.
E: Could not find fix_modify pressure ID
The compute ID for computing pressure does not exist.
E: Fix_modify pressure ID does not compute pressure
The compute ID assigned to the fix must compute pressure.
*/
diff --git a/src/fix_nh_sphere.cpp b/src/fix_nh_sphere.cpp
index 9db1e34e3..f978b6766 100644
--- a/src/fix_nh_sphere.cpp
+++ b/src/fix_nh_sphere.cpp
@@ -1,116 +1,152 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Mike Brown (SNL)
------------------------------------------------------------------------- */
#include <math.h>
#include "fix_nh_sphere.h"
#include "atom.h"
#include "atom_vec.h"
#include "group.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
#define INERTIA 0.4 // moment of inertia prefactor for sphere
/* ---------------------------------------------------------------------- */
FixNHSphere::FixNHSphere(LAMMPS *lmp, int narg, char **arg) :
FixNH(lmp, narg, arg)
{
if (!atom->sphere_flag)
error->all(FLERR,"Fix nvt/nph/npt sphere requires atom style sphere");
}
/* ---------------------------------------------------------------------- */
void FixNHSphere::init()
{
// check that all particles are finite-size
// no point particles allowed
double *radius = atom->radius;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (radius[i] == 0.0)
error->one(FLERR,"Fix nvt/sphere requires extended particles");
FixNH::init();
}
/* ----------------------------------------------------------------------
perform half-step update of rotational velocities
-----------------------------------------------------------------------*/
void FixNHSphere::nve_v()
{
// standard nve_v velocity update
FixNH::nve_v();
double **omega = atom->omega;
double **torque = atom->torque;
double *radius = atom->radius;
double *rmass = atom->rmass;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
// set timestep here since dt may have changed or come via rRESPA
double dtfrotate = dtf / INERTIA;
double dtirotate;
// update omega for all particles
// d_omega/dt = torque / inertia
// 4 cases depending on radius vs shape and rmass vs mass
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
dtirotate = dtfrotate / (radius[i]*radius[i]*rmass[i]);
omega[i][0] += dtirotate*torque[i][0];
omega[i][1] += dtirotate*torque[i][1];
omega[i][2] += dtirotate*torque[i][2];
}
}
+/* ----------------------------------------------------------------------
+ perform full-step update of position with dipole orientation, if requested
+-----------------------------------------------------------------------*/
+
+void FixNHSphere::nve_x()
+{
+ // standard nve_x position update
+
+ FixNH::nve_x();
+
+ // update mu for dipoles
+ // d_mu/dt = omega cross mu
+ // renormalize mu to dipole length
+
+ if (dipole_flag) {
+ double msq,scale,g[3];
+ double **mu = atom->mu;
+ double **omega = atom->omega;
+ int *mask = atom->mask;
+ int nlocal = atom->nlocal;
+
+ for (int i = 0; i < nlocal; i++)
+ if (mask[i] & groupbit)
+ if (mu[i][3] > 0.0) {
+ g[0] = mu[i][0] + dtv * (omega[i][1]*mu[i][2]-omega[i][2]*mu[i][1]);
+ g[1] = mu[i][1] + dtv * (omega[i][2]*mu[i][0]-omega[i][0]*mu[i][2]);
+ g[2] = mu[i][2] + dtv * (omega[i][0]*mu[i][1]-omega[i][1]*mu[i][0]);
+ msq = g[0]*g[0] + g[1]*g[1] + g[2]*g[2];
+ scale = mu[i][3]/sqrt(msq);
+ mu[i][0] = g[0]*scale;
+ mu[i][1] = g[1]*scale;
+ mu[i][2] = g[2]*scale;
+ }
+ }
+}
+
/* ----------------------------------------------------------------------
perform half-step scaling of rotatonal velocities
-----------------------------------------------------------------------*/
void FixNHSphere::nh_v_temp()
{
// standard nh_v_temp scaling
FixNH::nh_v_temp();
double **omega = atom->omega;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
omega[i][0] *= factor_eta;
omega[i][1] *= factor_eta;
omega[i][2] *= factor_eta;
}
}
}
diff --git a/src/fix_nh_sphere.h b/src/fix_nh_sphere.h
index a98356055..0897f4a93 100644
--- a/src/fix_nh_sphere.h
+++ b/src/fix_nh_sphere.h
@@ -1,46 +1,47 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_FIX_NH_SPHERE_H
#define LMP_FIX_NH_SPHERE_H
#include "fix_nh.h"
namespace LAMMPS_NS {
class FixNHSphere : public FixNH {
public:
FixNHSphere(class LAMMPS *, int, char **);
virtual ~FixNHSphere() {}
void init();
protected:
void nve_v();
+ void nve_x();
void nh_v_temp();
};
}
#endif
/* ERROR/WARNING messages:
E: Fix nvt/nph/npt sphere requires atom style sphere
Self-explanatory.
E: Fix nvt/sphere requires extended particles
This fix can only be used for particles of a finite size.
*/
diff --git a/src/fix_nve_sphere.cpp b/src/fix_nve_sphere.cpp
index c72797b8c..304960553 100644
--- a/src/fix_nve_sphere.cpp
+++ b/src/fix_nve_sphere.cpp
@@ -1,180 +1,180 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "fix_nve_sphere.h"
#include "atom.h"
#include "atom_vec.h"
#include "update.h"
#include "respa.h"
#include "force.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
#define INERTIA 0.4 // moment of inertia prefactor for sphere
enum{NONE,DIPOLE};
/* ---------------------------------------------------------------------- */
FixNVESphere::FixNVESphere(LAMMPS *lmp, int narg, char **arg) :
FixNVE(lmp, narg, arg)
{
if (narg < 3) error->all(FLERR,"Illegal fix nve/sphere command");
time_integrate = 1;
// process extra keywords
extra = NONE;
int iarg = 3;
while (iarg < narg) {
if (strcmp(arg[iarg],"update") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nve/sphere command");
if (strcmp(arg[iarg+1],"dipole") == 0) extra = DIPOLE;
else error->all(FLERR,"Illegal fix nve/sphere command");
iarg += 2;
} else error->all(FLERR,"Illegal fix nve/sphere command");
}
// error checks
if (!atom->sphere_flag)
error->all(FLERR,"Fix nve/sphere requires atom style sphere");
if (extra == DIPOLE && !atom->mu_flag)
- error->all(FLERR,"Fix nve/sphere requires atom attribute mu");
+ error->all(FLERR,"Fix nve/sphere dipole requires atom attribute mu");
}
/* ---------------------------------------------------------------------- */
void FixNVESphere::init()
{
FixNVE::init();
// check that all particles are finite-size spheres
// no point particles allowed
double *radius = atom->radius;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (radius[i] == 0.0)
error->one(FLERR,"Fix nve/sphere requires extended particles");
}
/* ---------------------------------------------------------------------- */
void FixNVESphere::initial_integrate(int vflag)
{
double dtfm,dtirotate,msq,scale;
double g[3];
double **x = atom->x;
double **v = atom->v;
double **f = atom->f;
double **omega = atom->omega;
double **torque = atom->torque;
double *radius = atom->radius;
double *rmass = atom->rmass;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
// set timestep here since dt may have changed or come via rRESPA
double dtfrotate = dtf / INERTIA;
// update v,x,omega for all particles
// d_omega/dt = torque / inertia
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
dtfm = dtf / rmass[i];
v[i][0] += dtfm * f[i][0];
v[i][1] += dtfm * f[i][1];
v[i][2] += dtfm * f[i][2];
x[i][0] += dtv * v[i][0];
x[i][1] += dtv * v[i][1];
x[i][2] += dtv * v[i][2];
dtirotate = dtfrotate / (radius[i]*radius[i]*rmass[i]);
omega[i][0] += dtirotate * torque[i][0];
omega[i][1] += dtirotate * torque[i][1];
omega[i][2] += dtirotate * torque[i][2];
}
}
// update mu for dipoles
// d_mu/dt = omega cross mu
// renormalize mu to dipole length
if (extra == DIPOLE) {
double **mu = atom->mu;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (mu[i][3] > 0.0) {
g[0] = mu[i][0] + dtv * (omega[i][1]*mu[i][2]-omega[i][2]*mu[i][1]);
g[1] = mu[i][1] + dtv * (omega[i][2]*mu[i][0]-omega[i][0]*mu[i][2]);
g[2] = mu[i][2] + dtv * (omega[i][0]*mu[i][1]-omega[i][1]*mu[i][0]);
msq = g[0]*g[0] + g[1]*g[1] + g[2]*g[2];
scale = mu[i][3]/sqrt(msq);
mu[i][0] = g[0]*scale;
mu[i][1] = g[1]*scale;
mu[i][2] = g[2]*scale;
}
}
}
/* ---------------------------------------------------------------------- */
void FixNVESphere::final_integrate()
{
double dtfm,dtirotate;
double **v = atom->v;
double **f = atom->f;
double **omega = atom->omega;
double **torque = atom->torque;
double *rmass = atom->rmass;
double *radius = atom->radius;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
// set timestep here since dt may have changed or come via rRESPA
double dtfrotate = dtf / INERTIA;
// update v,omega for all particles
// d_omega/dt = torque / inertia
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
dtfm = dtf / rmass[i];
v[i][0] += dtfm * f[i][0];
v[i][1] += dtfm * f[i][1];
v[i][2] += dtfm * f[i][2];
dtirotate = dtfrotate / (radius[i]*radius[i]*rmass[i]);
omega[i][0] += dtirotate * torque[i][0];
omega[i][1] += dtirotate * torque[i][1];
omega[i][2] += dtirotate * torque[i][2];
}
}
diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp
index 10f73aa53..9b281938c 100644
--- a/src/fix_property_atom.cpp
+++ b/src/fix_property_atom.cpp
@@ -1,591 +1,604 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <stdlib.h>
#include <string.h>
#include "fix_property_atom.h"
#include "atom.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
#include "update.h"
using namespace LAMMPS_NS;
using namespace FixConst;
enum{MOLECULE,CHARGE,INTEGER,DOUBLE};
/* ---------------------------------------------------------------------- */
FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal fix property/atom command");
restart_peratom = 1;
wd_section = 1;
int iarg = 3;
nvalue = narg-iarg;
style = new int[nvalue];
index = new int[nvalue];
molecule_flag = 0;
q_flag = 0;
nvalue = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"mol") == 0) {
if (atom->molecule_flag)
error->all(FLERR,"Fix property/atom mol when atom_style "
"already has molecule attribute");
if (molecule_flag)
error->all(FLERR,"Fix property/atom cannot specify mol twice");
style[nvalue] = MOLECULE;
atom->molecule_flag = molecule_flag = 1;
nvalue++;
} else if (strcmp(arg[iarg],"q") == 0) {
if (atom->q_flag)
error->all(FLERR,"Fix property/atom q when atom_style "
"already has charge attribute");
if (q_flag)
error->all(FLERR,"Fix property/atom cannot specify q twice");
style[nvalue] = CHARGE;
atom->q_flag = q_flag = 1;
nvalue++;
} else if (strstr(arg[iarg],"i_") == arg[iarg]) {
style[nvalue] = INTEGER;
int tmp;
index[nvalue] = atom->find_custom(&arg[iarg][2],tmp);
if (index[nvalue] >= 0)
error->all(FLERR,"Fix property/atom vector name already exists");
index[nvalue] = atom->add_custom(&arg[iarg][2],0);
nvalue++;
} else if (strstr(arg[iarg],"d_") == arg[iarg]) {
style[nvalue] = DOUBLE;
int tmp;
index[nvalue] = atom->find_custom(&arg[iarg][2],tmp);
if (index[nvalue] >= 0)
error->all(FLERR,"Fix property/atom vector name already exists");
index[nvalue] = atom->add_custom(&arg[iarg][2],1);
nvalue++;
} else break;
iarg++;
}
// optional args
border = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"ghost") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix property/atom command");
if (strcmp(arg[iarg+1],"no") == 0) border = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) border = 1;
else error->all(FLERR,"Illegal fix property/atom command");
iarg += 2;
} else error->all(FLERR,"Illegal fix property/atom command");
}
if (border) comm_border = nvalue;
// warn if mol or charge keyword used without ghost yes
if (border == 0) {
int flag = 0;
for (int i = 0; i < nvalue; i++)
if (style[i] == MOLECULE || style[i] == CHARGE) flag = 1;
if (flag && comm->me == 0)
error->warning(FLERR,"Fix property/atom mol or charge w/out "
"ghost communication");
}
// store current atom style
int n = strlen(atom->atom_style) + 1;
astyle = new char[n];
strcpy(astyle,atom->atom_style);
// perform initial allocation of atom-based array
// register with Atom class
nmax_old = 0;
grow_arrays(atom->nmax);
atom->add_callback(0);
atom->add_callback(1);
if (border) atom->add_callback(2);
}
/* ---------------------------------------------------------------------- */
FixPropertyAtom::~FixPropertyAtom()
{
// unregister callbacks to this fix from Atom class
atom->delete_callback(id,0);
atom->delete_callback(id,1);
if (border) atom->delete_callback(id,2);
// deallocate per-atom vectors in Atom class
// set ptrs to NULL, so they no longer exist for Atom class
for (int m = 0; m < nvalue; m++) {
if (style[m] == MOLECULE) {
atom->molecule_flag = 0;
memory->destroy(atom->molecule);
atom->molecule = NULL;
} else if (style[m] == CHARGE) {
atom->q_flag = 0;
memory->destroy(atom->q);
atom->q = NULL;
} else if (style[m] == INTEGER) {
atom->remove_custom(0,index[m]);
} else if (style[m] == DOUBLE) {
atom->remove_custom(1,index[m]);
}
}
delete [] style;
delete [] index;
delete [] astyle;
}
/* ---------------------------------------------------------------------- */
int FixPropertyAtom::setmask()
{
int mask = 0;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixPropertyAtom::init()
{
// error if atom style has changed since fix was defined
// don't allow this b/c user could change to style that defines molecule,q
if (strcmp(astyle,atom->atom_style) != 0)
error->all(FLERR,"Atom style was redefined after using fix property/atom");
}
/* ----------------------------------------------------------------------
unpack N lines in buf from section of data file labeled by keyword
id_offset is applied to first atomID field if multiple data files are read
------------------------------------------------------------------------- */
void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf,
tagint id_offset)
{
int j,m;
tagint itag;
char *next;
int mapflag = 0;
if (atom->map_style == 0) {
mapflag = 1;
atom->map_init();
atom->map_set();
}
next = strchr(buf,'\n');
*next = '\0';
int nwords = atom->count_words(buf);
*next = '\n';
if (nwords != nvalue+1) {
char str[128];
sprintf(str,"Incorrect %s format in data file",keyword);
error->all(FLERR,str);
}
char **values = new char*[nwords];
// loop over lines of atom info
// tokenize the line into values
// if I own atom tag, unpack its values
tagint map_tag_max = atom->map_tag_max;
for (int i = 0; i < n; i++) {
next = strchr(buf,'\n');
values[0] = strtok(buf," \t\n\r\f");
- for (j = 1; j < nwords; j++)
+ if (values[0] == NULL) {
+ char str[128];
+ sprintf(str,"Too few lines in %s section of data file",keyword);
+ error->one(FLERR,str);
+ }
+ int format_ok = 1;
+ for (j = 1; j < nwords; j++) {
values[j] = strtok(NULL," \t\n\r\f");
+ if (values[j] == NULL) format_ok = 0;
+ }
+ if (!format_ok) {
+ char str[128];
+ sprintf(str,"Incorrect %s format in data file",keyword);
+ error->all(FLERR,str);
+ }
itag = ATOTAGINT(values[0]) + id_offset;
if (itag <= 0 || itag > map_tag_max) {
char str[128];
sprintf(str,"Invalid atom ID in %s section of data file",keyword);
error->one(FLERR,str);
}
// assign words in line to per-atom vectors
if ((m = atom->map(itag)) >= 0) {
for (j = 0; j < nvalue; j++) {
if (style[j] == MOLECULE) atom->molecule[m] = ATOTAGINT(values[j+1]);
else if (style[j] == CHARGE) atom->q[m] = atof(values[j+1]);
else if (style[j] == INTEGER)
atom->ivector[index[j]][m] = atoi(values[j+1]);
else if (style[j] == DOUBLE)
atom->dvector[index[j]][m] = atof(values[j+1]);
}
}
buf = next + 1;
}
delete [] values;
if (mapflag) {
atom->map_delete();
atom->map_style = 0;
}
}
/* ----------------------------------------------------------------------
return # of lines in section of data file labeled by keyword
------------------------------------------------------------------------- */
bigint FixPropertyAtom::read_data_skip_lines(char *keyword)
{
return atom->natoms;
}
/* ----------------------------------------------------------------------
return size I own for Mth data section
# of data sections = 1 for this fix
nx = # of local atoms
ny = columns = tag + nvalues
------------------------------------------------------------------------- */
void FixPropertyAtom::write_data_section_size(int mth, int &nx, int &ny)
{
nx = atom->nlocal;
ny = nvalue + 1;
}
/* ----------------------------------------------------------------------
pack values for Mth data section into 2d buf
buf allocated by caller as Nlocal by Nvalues+1
------------------------------------------------------------------------- */
void FixPropertyAtom::write_data_section_pack(int mth, double **buf)
{
int i;
// 1st column = atom tag
// rest of columns = per-atom values
tagint *tag = atom->tag;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++) buf[i][0] = ubuf(tag[i]).d;
for (int m = 0; m < nvalue; m++) {
int mp1 = m+1;
if (style[m] == MOLECULE) {
tagint *molecule = atom->molecule;
for (i = 0; i < nlocal; i++) buf[i][mp1] = ubuf(molecule[i]).d;
} else if (style[m] == CHARGE) {
double *q = atom->q;
for (i = 0; i < nlocal; i++) buf[i][mp1] = q[i];
} else if (style[m] == INTEGER) {
int *ivec = atom->ivector[index[m]];
for (i = 0; i < nlocal; i++) buf[i][mp1] = ubuf(ivec[i]).d;
} else if (style[m] == DOUBLE) {
double *dvec = atom->dvector[index[m]];
for (i = 0; i < nlocal; i++) buf[i][mp1] = dvec[i];
}
}
}
/* ----------------------------------------------------------------------
write section keyword for Mth data section to file
use Molecules or Charges if that is only field, else use fix ID
only called by proc 0
------------------------------------------------------------------------- */
void FixPropertyAtom::write_data_section_keyword(int mth, FILE *fp)
{
if (nvalue == 1 && style[0] == MOLECULE) fprintf(fp,"\nMolecules\n\n");
else if (nvalue == 1 && style[0] == CHARGE) fprintf(fp,"\nCharges\n\n");
else fprintf(fp,"\n%s\n\n",id);
}
/* ----------------------------------------------------------------------
write N lines from buf to file
convert buf fields to int or double depending on styles
index can be used to prepend global numbering
only called by proc 0
------------------------------------------------------------------------- */
void FixPropertyAtom::write_data_section(int mth, FILE *fp,
int n, double **buf, int index)
{
int m;
for (int i = 0; i < n; i++) {
fprintf(fp,TAGINT_FORMAT,(tagint) ubuf(buf[i][0]).i);
for (m = 0; m < nvalue; m++) {
if (style[m] == MOLECULE)
fprintf(fp," " TAGINT_FORMAT,(tagint) ubuf(buf[i][m+1]).i);
else if (style[m] == INTEGER)
fprintf(fp," %d",(int) ubuf(buf[i][m+1]).i);
else fprintf(fp," %g",buf[i][m+1]);
}
fprintf(fp,"\n");
}
}
/* ----------------------------------------------------------------------
memory usage of local atom-based array
------------------------------------------------------------------------- */
double FixPropertyAtom::memory_usage()
{
double bytes = 0.0;
for (int m = 0; m < nvalue; m++) {
if (style[m] == MOLECULE) bytes = atom->nmax * sizeof(tagint);
else if (style[m] == CHARGE) bytes = atom->nmax * sizeof(double);
else if (style[m] == INTEGER) bytes = atom->nmax * sizeof(int);
else if (style[m] == DOUBLE) bytes = atom->nmax * sizeof(double);
}
return bytes;
}
/* ----------------------------------------------------------------------
allocate atom-based arrays
initialize new values to 0,
since AtomVec class won't do it as atoms are added,
e.g. in create_atom() or data_atom()
------------------------------------------------------------------------- */
void FixPropertyAtom::grow_arrays(int nmax)
{
for (int m = 0; m < nvalue; m++) {
if (style[m] == MOLECULE) {
memory->grow(atom->molecule,nmax,"atom:molecule");
size_t nbytes = (nmax-nmax_old) * sizeof(tagint);
memset(&atom->molecule[nmax_old],0,nbytes);
} else if (style[m] == CHARGE) {
memory->grow(atom->q,nmax,"atom:q");
size_t nbytes = (nmax-nmax_old) * sizeof(double);
memset(&atom->q[nmax_old],0,nbytes);
} else if (style[m] == INTEGER) {
memory->grow(atom->ivector[index[m]],nmax,"atom:ivector");
size_t nbytes = (nmax-nmax_old) * sizeof(int);
memset(&atom->ivector[index[m]][nmax_old],0,nbytes);
} else if (style[m] == DOUBLE) {
memory->grow(atom->dvector[index[m]],nmax,"atom:dvector");
size_t nbytes = (nmax-nmax_old) * sizeof(double);
memset(&atom->dvector[index[m]][nmax_old],0,nbytes);
}
}
nmax_old = nmax;
}
/* ----------------------------------------------------------------------
copy values within local atom-based arrays
------------------------------------------------------------------------- */
void FixPropertyAtom::copy_arrays(int i, int j, int delflag)
{
for (int m = 0; m < nvalue; m++) {
if (style[m] == MOLECULE)
atom->molecule[j] = atom->molecule[i];
else if (style[m] == CHARGE)
atom->q[j] = atom->q[i];
else if (style[m] == INTEGER)
atom->ivector[index[m]][j] = atom->ivector[index[m]][i];
else if (style[m] == DOUBLE)
atom->dvector[index[m]][j] = atom->dvector[index[m]][i];
}
}
/* ----------------------------------------------------------------------
pack values for border communication at re-neighboring
------------------------------------------------------------------------- */
int FixPropertyAtom::pack_border(int n, int *list, double *buf)
{
int i,j,k;
int m = 0;
for (k = 0; k < nvalue; k++) {
if (style[k] == MOLECULE) {
tagint *molecule = atom->molecule;
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = ubuf(molecule[j]).d;
}
} else if (style[k] == CHARGE) {
double *q = atom->q;
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = q[j];
}
} else if (style[k] == INTEGER) {
int *ivector = atom->ivector[index[k]];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = ubuf(ivector[j]).d;
}
} else if (style[k] == DOUBLE) {
double *dvector = atom->dvector[index[k]];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = dvector[j];
}
}
}
return m;
}
/* ----------------------------------------------------------------------
unpack values for border communication at re-neighboring
------------------------------------------------------------------------- */
int FixPropertyAtom::unpack_border(int n, int first, double *buf)
{
int i,k,last;
int m = 0;
for (k = 0; k < nvalue; k++) {
if (style[k] == MOLECULE) {
tagint *molecule = atom->molecule;
last = first + n;
for (i = first; i < last; i++)
molecule[i] = (tagint) ubuf(buf[m++]).i;
} else if (style[k] == CHARGE) {
double *q = atom->q;
last = first + n;
for (i = first; i < last; i++)
q[i] = buf[m++];
} else if (style[k] == INTEGER) {
int *ivector = atom->ivector[index[k]];
last = first + n;
for (i = first; i < last; i++)
ivector[i] = (int) ubuf(buf[m++]).i;
} else if (style[k] == DOUBLE) {
double *dvector = atom->dvector[index[k]];
last = first + n;
for (i = first; i < last; i++)
dvector[i] = buf[m++];
}
}
return m;
}
/* ----------------------------------------------------------------------
pack values in local atom-based array for exchange with another proc
------------------------------------------------------------------------- */
int FixPropertyAtom::pack_exchange(int i, double *buf)
{
for (int m = 0; m < nvalue; m++) {
if (style[m] == MOLECULE) buf[m] = ubuf(atom->molecule[i]).d;
else if (style[m] == CHARGE) buf[m] = atom->q[i];
else if (style[m] == INTEGER) buf[m] = ubuf(atom->ivector[index[m]][i]).d;
else if (style[m] == DOUBLE) buf[m] = atom->dvector[index[m]][i];
}
return nvalue;
}
/* ----------------------------------------------------------------------
unpack values in local atom-based array from exchange with another proc
------------------------------------------------------------------------- */
int FixPropertyAtom::unpack_exchange(int nlocal, double *buf)
{
for (int m = 0; m < nvalue; m++) {
if (style[m] == MOLECULE)
atom->molecule[nlocal] = (tagint) ubuf(buf[m]).i;
else if (style[m] == CHARGE)
atom->q[nlocal] = buf[m];
else if (style[m] == INTEGER)
atom->ivector[index[m]][nlocal] = (int) ubuf(buf[m]).i;
else if (style[m] == DOUBLE)
atom->dvector[index[m]][nlocal] = buf[m];
}
return nvalue;
}
/* ----------------------------------------------------------------------
pack values in local atom-based arrays for restart file
------------------------------------------------------------------------- */
int FixPropertyAtom::pack_restart(int i, double *buf)
{
buf[0] = nvalue+1;
int m = 1;
for (int j = 0; j < nvalue; j++) {
if (style[j] == MOLECULE) buf[m++] = ubuf(atom->molecule[i]).d;
else if (style[j] == CHARGE) buf[m++] = atom->q[i];
else if (style[j] == INTEGER) buf[m++] = ubuf(atom->ivector[index[j]][i]).d;
else if (style[j] == DOUBLE) buf[m++] = atom->dvector[index[j]][i];
}
return nvalue+1;
}
/* ----------------------------------------------------------------------
unpack values from atom->extra array to restart the fix
------------------------------------------------------------------------- */
void FixPropertyAtom::unpack_restart(int nlocal, int nth)
{
double **extra = atom->extra;
// skip to Nth set of extra values
int m = 0;
for (int i = 0; i < nth; i++) m += static_cast<int> (extra[nlocal][m]);
m++;
for (int i = 0; i < nvalue; i++) {
if (style[i] == MOLECULE)
atom->molecule[nlocal] = (tagint) ubuf(extra[nlocal][m++]).i;
else if (style[i] == CHARGE)
atom->q[nlocal] = extra[nlocal][m++];
else if (style[i] == INTEGER)
atom->ivector[index[i]][nlocal] = (int) ubuf(extra[nlocal][m++]).i;
else if (style[i] == DOUBLE)
atom->dvector[index[i]][nlocal] = extra[nlocal][m++];
}
}
/* ----------------------------------------------------------------------
maxsize of any atom's restart data
------------------------------------------------------------------------- */
int FixPropertyAtom::maxsize_restart()
{
return nvalue+1;
}
/* ----------------------------------------------------------------------
size of atom nlocal's restart data
------------------------------------------------------------------------- */
int FixPropertyAtom::size_restart(int nlocal)
{
return nvalue+1;
}
diff --git a/src/fix_shear_history.h b/src/fix_shear_history.h
index 8b32f3fec..e21004deb 100644
--- a/src/fix_shear_history.h
+++ b/src/fix_shear_history.h
@@ -1,86 +1,87 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(SHEAR_HISTORY,FixShearHistory)
#else
#ifndef LMP_FIX_SHEAR_HISTORY_H
#define LMP_FIX_SHEAR_HISTORY_H
#include "fix.h"
#include "my_page.h"
namespace LAMMPS_NS {
class FixShearHistory : public Fix {
friend class Neighbor;
friend class PairGranHookeHistory;
+ friend class PairGranLine;
public:
FixShearHistory(class LAMMPS *, int, char **);
~FixShearHistory();
int setmask();
void init();
virtual void pre_exchange();
void min_pre_exchange();
void post_run();
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int, int);
void set_arrays(int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
protected:
int *npartner; // # of touching partners of each atom
tagint **partner; // global atom IDs for the partners
double (**shearpartner)[3]; // 3 shear values with the partner
int maxtouch; // max # of touching partners for my atoms
class Pair *pair;
int *computeflag; // computeflag in PairGranHookeHistory
int pgsize,oneatom; // copy of settings in Neighbor
MyPage<tagint> *ipage; // pages of partner atom IDs
MyPage<double[3]> *dpage; // pages of shear history with partners
void allocate_pages();
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Pair style granular with history requires atoms have IDs
Atoms in the simulation do not have IDs, so history effects
cannot be tracked by the granular pair potential.
E: Shear history overflow, boost neigh_modify one
There are too many neighbors of a single atom. Use the neigh_modify
command to increase the max number of neighbors allowed for one atom.
You may also want to boost the page size.
*/
diff --git a/src/fix_store.cpp b/src/fix_store.cpp
index 4e3d612cc..e3de462dd 100644
--- a/src/fix_store.cpp
+++ b/src/fix_store.cpp
@@ -1,191 +1,324 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <stdlib.h>
#include <string.h>
#include "fix_store.h"
#include "atom.h"
+#include "comm.h"
+#include "force.h"
#include "memory.h"
#include "error.h"
-#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
+enum{GLOBAL,PERATOM};
+
/* ---------------------------------------------------------------------- */
FixStore::FixStore(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
{
- if (narg != 5) error->all(FLERR,"Illegal fix store command");
-
- // syntax: id group style 0/1 nvalue
- // 0/1 flag = not-store or store values in restart file
-
- restart_peratom = force->inumeric(FLERR,arg[3]);
- nvalues = force->inumeric(FLERR,arg[4]);
-
- vecflag = 0;
- if (nvalues == 1) vecflag = 1;
-
- // perform initial allocation of atom-based array
- // register with Atom class
+ if (narg != 6) error->all(FLERR,"Illegal fix store command");
+
+ // 4th arg determines GLOBAL vs PERATOM values
+ // syntax: id group style global nrow ncol
+ // Nrow by Ncol array of global values
+ // Ncol=1 is vector, Nrow>1 is array
+ // syntax: id group style peratom 0/1 nvalue
+ // 0/1 flag = not-store or store peratom values in restart file
+ // nvalue = # of peratom values, N=1 is vector, N>1 is array
+
+ if (strcmp(arg[3],"global") == 0) flavor = GLOBAL;
+ else if (strcmp(arg[3],"peratom") == 0) flavor = PERATOM;
+ else error->all(FLERR,"Invalid fix store command");
+
+ // GLOBAL values are always written to restart file
+ // PERATOM restart_peratom is set by caller
+
+ if (flavor == GLOBAL) {
+ restart_global = 1;
+ nrow = force->inumeric(FLERR,arg[4]);
+ ncol = force->inumeric(FLERR,arg[5]);
+ if (nrow <= 0 || ncol <= 0)
+ error->all(FLERR,"Invalid fix store command");
+ vecflag = 0;
+ if (ncol == 1) vecflag = 1;
+ }
+ if (flavor == PERATOM) {
+ restart_peratom = force->inumeric(FLERR,arg[4]);
+ nvalues = force->inumeric(FLERR,arg[5]);
+ if (restart_peratom < 0 or restart_peratom > 1 || nvalues <= 0)
+ error->all(FLERR,"Invalid fix store command");
+ vecflag = 0;
+ if (nvalues == 1) vecflag = 1;
+ }
vstore = NULL;
astore = NULL;
- grow_arrays(atom->nmax);
- atom->add_callback(0);
- if (restart_peratom) atom->add_callback(1);
+
+ // allocate vector or array and restart buffer rbuf
+ // for PERATOM, register with Atom class
+
+ if (flavor == GLOBAL) {
+ if (vecflag) memory->create(vstore,nrow,"fix/store:vstore");
+ else memory->create(astore,nrow,ncol,"fix/store:astore");
+ memory->create(rbuf,nrow*ncol+2,"fix/store:rbuf");
+ }
+ if (flavor == PERATOM) {
+ grow_arrays(atom->nmax);
+ atom->add_callback(0);
+ if (restart_peratom) atom->add_callback(1);
+ rbuf = NULL;
+ }
// zero the storage
- // since may be exchanged before filled by caller
+ // PERATOM may be comm->exchanged before filled by caller
+
+ if (flavor == GLOBAL) {
+ if (vecflag)
+ for (int i = 0; i < nrow; i++) vstore[i] = 0.0;
+ else
+ for (int i = 0; i < nrow; i++)
+ for (int j = 0; j < ncol; j++)
+ astore[i][j] = 0.0;
+ }
+ if (flavor == PERATOM) {
+ int nlocal = atom->nlocal;
+ if (vecflag)
+ for (int i = 0; i < nlocal; i++) vstore[i] = 0.0;
+ else
+ for (int i = 0; i < nlocal; i++)
+ for (int j = 0; j < nvalues; j++)
+ astore[i][j] = 0.0;
+ }
- int nlocal = atom->nlocal;
- if (vecflag)
- for (int i = 0; i < nlocal; i++)
- vstore[i] = 0.0;
- else
- for (int i = 0; i < nlocal; i++)
- for (int j = 0; j < nvalues; j++)
- astore[i][j] = 0.0;
}
/* ---------------------------------------------------------------------- */
FixStore::~FixStore()
{
// unregister callbacks to this fix from Atom class
- atom->delete_callback(id,0);
- if (restart_peratom) atom->delete_callback(id,1);
+ if (flavor == PERATOM) {
+ atom->delete_callback(id,0);
+ if (restart_peratom) atom->delete_callback(id,1);
+ }
memory->destroy(vstore);
memory->destroy(astore);
+ memory->destroy(rbuf);
}
/* ---------------------------------------------------------------------- */
int FixStore::setmask()
{
int mask = 0;
return mask;
}
/* ----------------------------------------------------------------------
- memory usage of local atom-based array
+ reset size of global vector/array
+ invoked by caller if size is unknown at time this fix is instantiated
+ caller will do subsequent initialization
------------------------------------------------------------------------- */
-double FixStore::memory_usage()
+void FixStore::reset_global(int nrow_caller, int ncol_caller)
{
- double bytes = atom->nmax*nvalues * sizeof(double);
- return bytes;
+ memory->destroy(vstore);
+ memory->destroy(astore);
+ memory->destroy(rbuf);
+ vstore = NULL;
+ astore = NULL;
+
+ vecflag = 0;
+ if (ncol_caller == 1) vecflag = 1;
+ nrow = nrow_caller;
+ ncol = ncol_caller;
+ if (vecflag) memory->create(vstore,nrow,"fix/store:vstore");
+ else memory->create(astore,nrow,ncol,"fix/store:astore");
+ memory->create(rbuf,nrow*ncol+2,"fix/store:rbuf");
+}
+
+/* ----------------------------------------------------------------------
+ write global array to restart file
+------------------------------------------------------------------------- */
+
+void FixStore::write_restart(FILE *fp)
+{
+ // fill rbuf with size and vec/array values
+
+ rbuf[0] = nrow;
+ rbuf[1] = ncol;
+ if (vecflag) memcpy(&rbuf[2],vstore,nrow*sizeof(double));
+ else memcpy(&rbuf[2],&astore[0][0],nrow*ncol*sizeof(double));
+
+ int n = nrow*ncol + 2;
+ if (comm->me == 0) {
+ int size = n * sizeof(double);
+ fwrite(&size,sizeof(int),1,fp);
+ fwrite(rbuf,sizeof(double),n,fp);
+ }
+}
+
+/* ----------------------------------------------------------------------
+ use global array from restart file to restart the Fix
+------------------------------------------------------------------------- */
+
+void FixStore::restart(char *buf)
+{
+ // first 2 values in buf are vec/array sizes
+
+ double *dbuf = (double *) buf;
+ int nrow_restart = dbuf[0];
+ int ncol_restart = dbuf[1];
+
+ // if size of vec/array has changed,
+ // means the restart file is setting size of vec or array and doing init
+ // because caller did not know size at time this fix was instantiated
+ // reallocate vstore or astore accordingly
+
+ if (nrow != nrow_restart || ncol != ncol_restart) {
+ memory->destroy(vstore);
+ memory->destroy(astore);
+ memory->destroy(rbuf);
+ vstore = NULL;
+ astore = NULL;
+
+ vecflag = 0;
+ if (ncol_restart == 1) vecflag = 1;
+ nrow = nrow_restart;
+ ncol = ncol_restart;
+ if (vecflag) memory->create(vstore,nrow,"fix/store:vstore");
+ else memory->create(astore,nrow,ncol,"fix/store:astore");
+ memory->create(rbuf,nrow*ncol+2,"fix/store:rbuf");
+ }
+
+ int n = nrow*ncol;
+ if (vecflag) memcpy(vstore,&dbuf[2],n*sizeof(double));
+ else memcpy(&astore[0][0],&dbuf[2],n*sizeof(double));
}
/* ----------------------------------------------------------------------
allocate atom-based array
------------------------------------------------------------------------- */
void FixStore::grow_arrays(int nmax)
{
if (vecflag) memory->grow(vstore,nmax,"store:vstore");
else memory->grow(astore,nmax,nvalues,"store:astore");
}
/* ----------------------------------------------------------------------
copy values within local atom-based array
------------------------------------------------------------------------- */
void FixStore::copy_arrays(int i, int j, int delflag)
{
if (vecflag) vstore[j] = vstore[i];
else
for (int m = 0; m < nvalues; m++)
astore[j][m] = astore[i][m];
}
/* ----------------------------------------------------------------------
pack values in local atom-based array for exchange with another proc
------------------------------------------------------------------------- */
int FixStore::pack_exchange(int i, double *buf)
{
if (vecflag) buf[0] = vstore[i];
else
for (int m = 0; m < nvalues; m++)
buf[m] = astore[i][m];
return nvalues;
}
/* ----------------------------------------------------------------------
unpack values in local atom-based array from exchange with another proc
------------------------------------------------------------------------- */
int FixStore::unpack_exchange(int nlocal, double *buf)
{
if (vecflag) vstore[nlocal] = buf[0];
else
for (int m = 0; m < nvalues; m++)
astore[nlocal][m] = buf[m];
return nvalues;
}
/* ----------------------------------------------------------------------
pack values in local atom-based arrays for restart file
------------------------------------------------------------------------- */
int FixStore::pack_restart(int i, double *buf)
{
buf[0] = nvalues+1;
if (vecflag) buf[1] = vstore[i];
else
for (int m = 0; m < nvalues; m++)
buf[m+1] = astore[i][m];
return nvalues+1;
}
/* ----------------------------------------------------------------------
unpack values from atom->extra array to restart the fix
------------------------------------------------------------------------- */
void FixStore::unpack_restart(int nlocal, int nth)
{
double **extra = atom->extra;
// skip to Nth set of extra values
int m = 0;
for (int i = 0; i < nth; i++) m += static_cast<int> (extra[nlocal][m]);
m++;
if (vecflag) vstore[nlocal] = extra[nlocal][m];
else
for (int i = 0; i < nvalues; i++)
astore[nlocal][i] = extra[nlocal][m++];
}
/* ----------------------------------------------------------------------
maxsize of any atom's restart data
------------------------------------------------------------------------- */
int FixStore::maxsize_restart()
{
return nvalues+1;
}
/* ----------------------------------------------------------------------
size of atom nlocal's restart data
------------------------------------------------------------------------- */
int FixStore::size_restart(int nlocal)
{
return nvalues+1;
}
+
+/* ----------------------------------------------------------------------
+ memory usage of local atom-based array
+------------------------------------------------------------------------- */
+
+double FixStore::memory_usage()
+{
+ double bytes;
+ if (flavor == GLOBAL) bytes += nrow*ncol * sizeof(double);
+ if (flavor == PERATOM) bytes += atom->nmax*nvalues * sizeof(double);
+ return bytes;
+}
diff --git a/src/fix_store.h b/src/fix_store.h
index dab989990..9bdfc7d30 100644
--- a/src/fix_store.h
+++ b/src/fix_store.h
@@ -1,64 +1,74 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(STORE,FixStore)
#else
#ifndef LMP_FIX_STORE_H
#define LMP_FIX_STORE_H
+#include <stdio.h>
#include "fix.h"
namespace LAMMPS_NS {
class FixStore : public Fix {
public:
- double *vstore; // vector storage if nvalues = 1
- double **astore; // array storage if nvalues > 1
+ int nrow,ncol; // size of global data array
+ int nvalues; // number of per-atom values
+ double *vstore; // vector storage for GLOBAL or PERATOM
+ double **astore; // array storage for GLOBAL or PERATOM
FixStore(class LAMMPS *, int, char **);
~FixStore();
int setmask();
+ void reset_global(int, int);
+
+ void write_restart(FILE *);
+ void restart(char *);
- double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
+ double memory_usage();
+
private:
- int nvalues; // total # of values per atom
- int vecflag; // 1 if nvalues = 1
+ int flavor; // GLOBAL or PERATOM
+ int vecflag; // 1 if ncol=1 or nvalues=1
+
+ double *rbuf; // restart buffer for GLOBAL vec/array
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
*/
diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp
index efcc73f03..dc96afad5 100644
--- a/src/fix_store_state.cpp
+++ b/src/fix_store_state.cpp
@@ -1,1333 +1,1508 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <stdlib.h>
#include <string.h>
#include "fix_store_state.h"
#include "atom.h"
#include "domain.h"
#include "update.h"
#include "group.h"
#include "modify.h"
#include "compute.h"
#include "fix.h"
#include "input.h"
#include "variable.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
enum{KEYWORD,COMPUTE,FIX,VARIABLE,DNAME,INAME};
#define INVOKED_PERATOM 8
/* ---------------------------------------------------------------------- */
FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 5) error->all(FLERR,"Illegal fix store/state command");
restart_peratom = 1;
peratom_freq = 1;
nevery = force->inumeric(FLERR,arg[3]);
if (nevery < 0) error->all(FLERR,"Illegal fix store/state command");
// parse values until one isn't recognized
// customize a new keyword by adding to if statement
pack_choice = new FnPtrPack[narg-4];
which = new int[narg-4];
argindex = new int[narg-4];
ids = new char*[narg-4];
value2index = new int[narg-4];
nvalues = 0;
cfv_any = 0;
int iarg = 4;
while (iarg < narg) {
which[nvalues] = KEYWORD;
ids[nvalues] = NULL;
if (strcmp(arg[iarg],"id") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_id;
} else if (strcmp(arg[iarg],"mol") == 0) {
if (!atom->molecule_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_molecule;
} else if (strcmp(arg[iarg],"type") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_type;
} else if (strcmp(arg[iarg],"mass") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_mass;
} else if (strcmp(arg[iarg],"x") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_x;
} else if (strcmp(arg[iarg],"y") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_y;
} else if (strcmp(arg[iarg],"z") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_z;
} else if (strcmp(arg[iarg],"xs") == 0) {
if (domain->triclinic)
pack_choice[nvalues++] = &FixStoreState::pack_xs_triclinic;
else pack_choice[nvalues++] = &FixStoreState::pack_xs;
} else if (strcmp(arg[iarg],"ys") == 0) {
if (domain->triclinic)
pack_choice[nvalues++] = &FixStoreState::pack_ys_triclinic;
else pack_choice[nvalues++] = &FixStoreState::pack_ys;
} else if (strcmp(arg[iarg],"zs") == 0) {
if (domain->triclinic)
pack_choice[nvalues++] = &FixStoreState::pack_zs_triclinic;
else pack_choice[nvalues++] = &FixStoreState::pack_zs;
} else if (strcmp(arg[iarg],"xu") == 0) {
if (domain->triclinic)
pack_choice[nvalues++] = &FixStoreState::pack_xu_triclinic;
else pack_choice[nvalues++] = &FixStoreState::pack_xu;
} else if (strcmp(arg[iarg],"yu") == 0) {
if (domain->triclinic)
pack_choice[nvalues++] = &FixStoreState::pack_yu_triclinic;
else pack_choice[nvalues++] = &FixStoreState::pack_yu;
} else if (strcmp(arg[iarg],"zu") == 0) {
if (domain->triclinic)
pack_choice[nvalues++] = &FixStoreState::pack_zu_triclinic;
else pack_choice[nvalues++] = &FixStoreState::pack_zu;
+ } else if (strcmp(arg[iarg],"xsu") == 0) {
+ if (domain->triclinic)
+ pack_choice[nvalues++] = &FixStoreState::pack_xsu_triclinic;
+ else pack_choice[nvalues++] = &FixStoreState::pack_xsu;
+ } else if (strcmp(arg[iarg],"ysu") == 0) {
+ if (domain->triclinic)
+ pack_choice[nvalues++] = &FixStoreState::pack_ysu_triclinic;
+ else pack_choice[nvalues++] = &FixStoreState::pack_ysu;
+ } else if (strcmp(arg[iarg],"zsu") == 0) {
+ if (domain->triclinic)
+ pack_choice[nvalues++] = &FixStoreState::pack_zsu_triclinic;
+ else pack_choice[nvalues++] = &FixStoreState::pack_zsu;
+
} else if (strcmp(arg[iarg],"ix") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_ix;
} else if (strcmp(arg[iarg],"iy") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_iy;
} else if (strcmp(arg[iarg],"iz") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_iz;
} else if (strcmp(arg[iarg],"vx") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_vx;
} else if (strcmp(arg[iarg],"vy") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_vy;
} else if (strcmp(arg[iarg],"vz") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_vz;
} else if (strcmp(arg[iarg],"fx") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_fx;
} else if (strcmp(arg[iarg],"fy") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_fy;
} else if (strcmp(arg[iarg],"fz") == 0) {
pack_choice[nvalues++] = &FixStoreState::pack_fz;
} else if (strcmp(arg[iarg],"q") == 0) {
if (!atom->q_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_q;
} else if (strcmp(arg[iarg],"mux") == 0) {
if (!atom->mu_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_mux;
} else if (strcmp(arg[iarg],"muy") == 0) {
if (!atom->mu_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_muy;
} else if (strcmp(arg[iarg],"muz") == 0) {
if (!atom->mu_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_muz;
+ } else if (strcmp(arg[iarg],"mu") == 0) {
+ if (!atom->mu_flag)
+ error->all(FLERR,
+ "Fix store/state for atom property that isn't allocated");
+ pack_choice[nvalues++] = &FixStoreState::pack_mu;
} else if (strcmp(arg[iarg],"radius") == 0) {
if (!atom->radius_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_radius;
+ } else if (strcmp(arg[iarg],"diameter") == 0) {
+ if (!atom->radius_flag)
+ error->all(FLERR,
+ "Fix store/state for atom property that isn't allocated");
+ pack_choice[nvalues++] = &FixStoreState::pack_diameter;
} else if (strcmp(arg[iarg],"omegax") == 0) {
if (!atom->omega_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_omegax;
} else if (strcmp(arg[iarg],"omegay") == 0) {
if (!atom->omega_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_omegay;
} else if (strcmp(arg[iarg],"omegaz") == 0) {
if (!atom->omega_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_omegaz;
} else if (strcmp(arg[iarg],"angmomx") == 0) {
if (!atom->angmom_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_angmomx;
} else if (strcmp(arg[iarg],"angmomy") == 0) {
if (!atom->angmom_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_angmomy;
} else if (strcmp(arg[iarg],"angmomz") == 0) {
if (!atom->angmom_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_angmomz;
} else if (strcmp(arg[iarg],"tqx") == 0) {
if (!atom->torque_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_tqx;
} else if (strcmp(arg[iarg],"tqy") == 0) {
if (!atom->torque_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_tqy;
} else if (strcmp(arg[iarg],"tqz") == 0) {
if (!atom->torque_flag)
error->all(FLERR,
"Fix store/state for atom property that isn't allocated");
pack_choice[nvalues++] = &FixStoreState::pack_tqz;
} else if (strncmp(arg[iarg],"c_",2) == 0 ||
strncmp(arg[iarg],"d_",2) == 0 ||
strncmp(arg[iarg],"f_",2) == 0 ||
strncmp(arg[iarg],"i_",2) == 0 ||
strncmp(arg[iarg],"v_",2) == 0) {
cfv_any = 1;
if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE;
else if (arg[iarg][0] == 'd') which[nvalues] = DNAME;
else if (arg[iarg][0] == 'f') which[nvalues] = FIX;
else if (arg[iarg][0] == 'i') which[nvalues] = INAME;
else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE;
int n = strlen(arg[iarg]);
char *suffix = new char[n];
strcpy(suffix,&arg[iarg][2]);
char *ptr = strchr(suffix,'[');
if (ptr) {
if (suffix[strlen(suffix)-1] != ']')
error->all(FLERR,"Illegal fix store/state command");
argindex[nvalues] = atoi(ptr+1);
*ptr = '\0';
} else argindex[nvalues] = 0;
n = strlen(suffix) + 1;
ids[nvalues] = new char[n];
strcpy(ids[nvalues],suffix);
nvalues++;
delete [] suffix;
} else break;
iarg++;
}
// optional args
comflag = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"com") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix store/state command");
if (strcmp(arg[iarg+1],"no") == 0) comflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) comflag = 1;
else error->all(FLERR,"Illegal fix store/state command");
iarg += 2;
} else error->all(FLERR,"Illegal fix store/state command");
}
// error check
for (int i = 0; i < nvalues; i++) {
if (which[i] == COMPUTE) {
int icompute = modify->find_compute(ids[i]);
if (icompute < 0)
error->all(FLERR,"Compute ID for fix store/state does not exist");
if (modify->compute[icompute]->peratom_flag == 0)
error->all(FLERR,"Fix store/state compute "
"does not calculate per-atom values");
if (argindex[i] == 0 &&
modify->compute[icompute]->size_peratom_cols != 0)
error->all(FLERR,"Fix store/state compute does not "
"calculate a per-atom vector");
if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
error->all(FLERR,
"Fix store/state compute does not "
"calculate a per-atom array");
if (argindex[i] &&
argindex[i] > modify->compute[icompute]->size_peratom_cols)
error->all(FLERR,
"Fix store/state compute array is accessed out-of-range");
} else if (which[i] == INAME) {
int icustom,iflag;
icustom = atom->find_custom(ids[i],iflag);
if ((icustom < 0) || (iflag != 0))
error->all(FLERR,
"Custom integer vector for fix store/state does not exist");
} else if (which[i] == DNAME) {
int icustom,iflag;
icustom = atom->find_custom(ids[i],iflag);
if ((icustom < 0) || (iflag != 1))
error->all(FLERR,
"Custom floating point vector for fix store/state does not exist");
} else if (which[i] == FIX) {
int ifix = modify->find_fix(ids[i]);
if (ifix < 0)
error->all(FLERR,
"Fix ID for fix store/state does not exist");
if (modify->fix[ifix]->peratom_flag == 0)
error->all(FLERR,
"Fix store/state fix does not calculate per-atom values");
if (argindex[i] == 0 && modify->fix[ifix]->size_peratom_cols != 0)
error->all(FLERR,
"Fix store/state fix does not calculate a per-atom vector");
if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
error->all(FLERR,
"Fix store/state fix does not calculate a per-atom array");
if (argindex[i] && argindex[i] > modify->fix[ifix]->size_peratom_cols)
error->all(FLERR,
"Fix store/state fix array is accessed out-of-range");
if (nevery % modify->fix[ifix]->peratom_freq)
error->all(FLERR,
"Fix for fix store/state not computed at compatible time");
} else if (which[i] == VARIABLE) {
int ivariable = input->variable->find(ids[i]);
if (ivariable < 0)
error->all(FLERR,"Variable name for fix store/state does not exist");
if (input->variable->atomstyle(ivariable) == 0)
error->all(FLERR,"Fix store/state variable is not atom-style variable");
}
}
// this fix produces either a per-atom vector or array
peratom_flag = 1;
if (nvalues == 1) size_peratom_cols = 0;
else size_peratom_cols = nvalues;
// perform initial allocation of atom-based array
// register with Atom class
values = NULL;
grow_arrays(atom->nmax);
atom->add_callback(0);
atom->add_callback(1);
// zero the array since dump may access it on timestep 0
// zero the array since a variable may access it before first run
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
for (int m = 0; m < nvalues; m++)
values[i][m] = 0.0;
// store current values for keywords but not for compute, fix, variable
kflag = 1;
cfv_flag = 0;
end_of_step();
firstflag = 1;
}
/* ---------------------------------------------------------------------- */
FixStoreState::~FixStoreState()
{
// unregister callbacks to this fix from Atom class
atom->delete_callback(id,0);
atom->delete_callback(id,1);
delete [] which;
delete [] argindex;
for (int m = 0; m < nvalues; m++) delete [] ids[m];
delete [] ids;
delete [] value2index;
delete [] pack_choice;
memory->destroy(values);
}
/* ---------------------------------------------------------------------- */
int FixStoreState::setmask()
{
int mask = 0;
if (nevery) mask |= END_OF_STEP;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixStoreState::init()
{
// set indices and check validity of all computes,fixes,variables
// no error check if end_of_step() will not be called
if (!firstflag && nevery == 0) return;
for (int m = 0; m < nvalues; m++) {
if (which[m] == COMPUTE) {
int icompute = modify->find_compute(ids[m]);
if (icompute < 0)
error->all(FLERR,"Compute ID for fix store/state does not exist");
value2index[m] = icompute;
} else if (which[m] == INAME) {
int icustom,iflag;
icustom = atom->find_custom(ids[m],iflag);
if ((icustom < 0) || (iflag != 0))
error->all(FLERR,
"Custom integer vector for fix store/state does not exist");
value2index[m] = icustom;
} else if (which[m] == DNAME) {
int icustom,iflag;
icustom = atom->find_custom(ids[m],iflag);
if ((icustom < 0) || (iflag != 1))
error->all(FLERR,
"Custom floating point vector for fix store/state does not exist");
value2index[m] = icustom;
} else if (which[m] == FIX) {
int ifix = modify->find_fix(ids[m]);
if (ifix < 0)
error->all(FLERR,"Fix ID for fix store/state does not exist");
value2index[m] = ifix;
} else if (which[m] == VARIABLE) {
int ivariable = input->variable->find(ids[m]);
if (ivariable < 0)
error->all(FLERR,"Variable name for fix store/state does not exist");
value2index[m] = ivariable;
}
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::setup(int vflag)
{
// if first invocation, store current values for compute, fix, variable
if (firstflag) {
kflag = 0;
cfv_flag = 1;
end_of_step();
firstflag = 0;
kflag = cfv_flag = 1;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::end_of_step()
{
int i,j,n;
// compute com if comflag set
if (comflag) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,cm);
}
// if any compute/fix/variable and nevery, wrap with clear/add
if (cfv_any && nevery) modify->clearstep_compute();
// fill vector or array with per-atom values
if (values) vbuf = &values[0][0];
else vbuf = NULL;
for (int m = 0; m < nvalues; m++) {
if (which[m] == KEYWORD && kflag) (this->*pack_choice[m])(m);
else if (cfv_flag) {
n = value2index[m];
j = argindex[m];
int *mask = atom->mask;
int nlocal = atom->nlocal;
// invoke compute if not previously invoked
if (which[m] == COMPUTE) {
Compute *compute = modify->compute[n];
if (!(compute->invoked_flag & INVOKED_PERATOM)) {
compute->compute_peratom();
compute->invoked_flag |= INVOKED_PERATOM;
}
if (j == 0) {
double *compute_vector = compute->vector_atom;
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit) values[i][m] = compute_vector[i];
} else {
int jm1 = j - 1;
double **compute_array = compute->array_atom;
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit) values[i][m] = compute_array[i][jm1];
}
// access fix fields, guaranteed to be ready
} else if (which[m] == FIX) {
if (j == 0) {
double *fix_vector = modify->fix[n]->vector_atom;
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit) values[i][m] = fix_vector[i];
} else {
int jm1 = j - 1;
double **fix_array = modify->fix[n]->array_atom;
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit) values[i][m] = fix_array[i][jm1];
}
// access custom atom property fields
} else if (which[m] == INAME) {
int *ivector = atom->ivector[n];
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit) values[i][m] = ivector[i];
} else if (which[m] == DNAME) {
double *dvector = atom->dvector[n];
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit) values[i][m] = dvector[i];
// evaluate atom-style variable
} else if (which[m] == VARIABLE) {
input->variable->compute_atom(n,igroup,&values[0][m],nvalues,0);
}
}
}
// if any compute/fix/variable and nevery, wrap with clear/add
if (cfv_any && nevery) {
int nextstep = (update->ntimestep/nevery)*nevery + nevery;
modify->addstep_compute(nextstep);
}
}
/* ----------------------------------------------------------------------
memory usage of local atom-based array
------------------------------------------------------------------------- */
double FixStoreState::memory_usage()
{
double bytes = atom->nmax*nvalues * sizeof(double);
return bytes;
}
/* ----------------------------------------------------------------------
allocate atom-based array
------------------------------------------------------------------------- */
void FixStoreState::grow_arrays(int nmax)
{
memory->grow(values,nmax,nvalues,"store/state:values");
if (nvalues == 1) {
if (nmax) vector_atom = &values[0][0];
else vector_atom = NULL;
} else array_atom = values;
}
/* ----------------------------------------------------------------------
copy values within local atom-based array
------------------------------------------------------------------------- */
void FixStoreState::copy_arrays(int i, int j, int delflag)
{
for (int m = 0; m < nvalues; m++) values[j][m] = values[i][m];
}
/* ----------------------------------------------------------------------
pack values in local atom-based array for exchange with another proc
------------------------------------------------------------------------- */
int FixStoreState::pack_exchange(int i, double *buf)
{
for (int m = 0; m < nvalues; m++) buf[m] = values[i][m];
return nvalues;
}
/* ----------------------------------------------------------------------
unpack values in local atom-based array from exchange with another proc
------------------------------------------------------------------------- */
int FixStoreState::unpack_exchange(int nlocal, double *buf)
{
for (int m = 0; m < nvalues; m++) values[nlocal][m] = buf[m];
return nvalues;
}
/* ----------------------------------------------------------------------
pack values in local atom-based arrays for restart file
------------------------------------------------------------------------- */
int FixStoreState::pack_restart(int i, double *buf)
{
buf[0] = nvalues+1;
for (int m = 0; m < nvalues; m++) buf[m+1] = values[i][m];
return nvalues+1;
}
/* ----------------------------------------------------------------------
unpack values from atom->extra array to restart the fix
------------------------------------------------------------------------- */
void FixStoreState::unpack_restart(int nlocal, int nth)
{
double **extra = atom->extra;
// skip to Nth set of extra values
int m = 0;
for (int i = 0; i < nth; i++) m += static_cast<int> (extra[nlocal][m]);
m++;
for (int i = 0; i < nvalues; i++) values[nlocal][i] = extra[nlocal][m++];
}
/* ----------------------------------------------------------------------
maxsize of any atom's restart data
------------------------------------------------------------------------- */
int FixStoreState::maxsize_restart()
{
return nvalues+1;
}
/* ----------------------------------------------------------------------
size of atom nlocal's restart data
------------------------------------------------------------------------- */
int FixStoreState::size_restart(int nlocal)
{
return nvalues+1;
}
/* ----------------------------------------------------------------------
one method for every keyword fix store/state can archive
the atom property is packed into buf starting at n with stride nvalues
customize a new keyword by adding a method
------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_id(int n)
{
tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = tag[i];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_molecule(int n)
{
tagint *molecule = atom->molecule;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = molecule[i];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_type(int n)
{
int *type = atom->type;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = type[i];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_mass(int n)
{
int *type = atom->type;
double *mass = atom->mass;
double *rmass = atom->rmass;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (rmass) {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = rmass[i];
else vbuf[n] = 0.0;
n += nvalues;
}
} else {
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = mass[type[i]];
else vbuf[n] = 0.0;
n += nvalues;
}
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_x(int n)
{
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = x[i][0];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_y(int n)
{
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = x[i][1];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_z(int n)
{
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = x[i][2];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_xs(int n)
{
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double boxxlo = domain->boxlo[0];
double invxprd = 1.0/domain->xprd;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = (x[i][0] - boxxlo) * invxprd;
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_ys(int n)
{
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double boxylo = domain->boxlo[1];
double invyprd = 1.0/domain->yprd;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = (x[i][1] - boxylo) * invyprd;
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_zs(int n)
{
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double boxzlo = domain->boxlo[2];
double invzprd = 1.0/domain->zprd;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = (x[i][2] - boxzlo) * invzprd;
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_xs_triclinic(int n)
{
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double *boxlo = domain->boxlo;
double *h_inv = domain->h_inv;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit)
vbuf[n] = h_inv[0]*(x[i][0]-boxlo[0]) +
h_inv[5]*(x[i][1]-boxlo[1]) + h_inv[4]*(x[i][2]-boxlo[2]);
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_ys_triclinic(int n)
{
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double *boxlo = domain->boxlo;
double *h_inv = domain->h_inv;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit)
vbuf[n] = h_inv[1]*(x[i][1]-boxlo[1]) + h_inv[3]*(x[i][2]-boxlo[2]);
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_zs_triclinic(int n)
{
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double *boxlo = domain->boxlo;
double *h_inv = domain->h_inv;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit)
vbuf[n] = h_inv[2]*(x[i][2]-boxlo[2]);
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_xu(int n)
{
double **x = atom->x;
imageint *image = atom->image;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double xprd = domain->xprd;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
vbuf[n] = x[i][0] + ((image[i] & IMGMASK) - IMGMAX) * xprd;
if (comflag) vbuf[n] -= cm[0];
} else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_yu(int n)
{
double **x = atom->x;
imageint *image = atom->image;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double yprd = domain->yprd;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
vbuf[n] = x[i][1] + ((image[i] >> IMGBITS & IMGMASK) - IMGMAX) * yprd;
if (comflag) vbuf[n] -= cm[1];
} else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_zu(int n)
{
double **x = atom->x;
imageint *image = atom->image;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double zprd = domain->zprd;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
vbuf[n] = x[i][2] + ((image[i] >> IMG2BITS) - IMGMAX) * zprd;
if (comflag) vbuf[n] -= cm[2];
} else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_xu_triclinic(int n)
{
double **x = atom->x;
imageint *image = atom->image;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double *h = domain->h;
int xbox,ybox,zbox;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
xbox = (image[i] & IMGMASK) - IMGMAX;
ybox = (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
zbox = (image[i] >> IMG2BITS) - IMGMAX;
vbuf[n] = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox;
if (comflag) vbuf[n] -= cm[0];
} else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_yu_triclinic(int n)
{
double **x = atom->x;
imageint *image = atom->image;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double *h = domain->h;
int ybox,zbox;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
ybox = (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
zbox = (image[i] >> IMG2BITS) - IMGMAX;
vbuf[n] = x[i][1] + h[1]*ybox + h[3]*zbox;
if (comflag) vbuf[n] -= cm[1];
} else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_zu_triclinic(int n)
{
double **x = atom->x;
imageint *image = atom->image;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double *h = domain->h;
int zbox;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
zbox = (image[i] >> IMG2BITS) - IMGMAX;
vbuf[n] = x[i][2] + h[2]*zbox;
if (comflag) vbuf[n] -= cm[2];
} else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
+void FixStoreState::pack_xsu(int n)
+{
+ double **x = atom->x;
+ imageint *image = atom->image;
+ int *mask = atom->mask;
+ int nlocal = atom->nlocal;
+
+ double boxxlo = domain->boxlo[0];
+ double invxprd = 1.0/domain->xprd;
+
+ for (int i = 0; i < nlocal; i++) {
+ if (mask[i] & groupbit)
+ vbuf[n] = (x[i][0]-boxxlo)*invxprd + ((image[i] & IMGMASK) - IMGMAX);
+ else vbuf[n] = 0.0;
+ n += nvalues;
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
+void FixStoreState::pack_ysu(int n)
+{
+ double **x = atom->x;
+ imageint *image = atom->image;
+ int *mask = atom->mask;
+ int nlocal = atom->nlocal;
+
+ double boxylo = domain->boxlo[1];
+ double invyprd = 1.0/domain->yprd;
+
+ for (int i = 0; i < nlocal; i++) {
+ if (mask[i] & groupbit)
+ vbuf[n] = (x[i][1]-boxylo)*invyprd + (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
+ else vbuf[n] = 0.0;
+ n += nvalues;
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
+void FixStoreState::pack_zsu(int n)
+{
+ double **x = atom->x;
+ imageint *image = atom->image;
+ int *mask = atom->mask;
+ int nlocal = atom->nlocal;
+
+ double boxzlo = domain->boxlo[2];
+ double invzprd = 1.0/domain->zprd;
+
+ for (int i = 0; i < nlocal; i++) {
+ if (mask[i] & groupbit)
+ vbuf[n] = (x[i][2]-boxzlo)*invzprd + (image[i] >> IMG2BITS) - IMGMAX;
+ else vbuf[n] = 0.0;
+ n += nvalues;
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
+void FixStoreState::pack_xsu_triclinic(int n)
+{
+ double **x = atom->x;
+ imageint *image = atom->image;
+ int *mask = atom->mask;
+ int nlocal = atom->nlocal;
+
+ double *boxlo = domain->boxlo;
+ double *h_inv = domain->h_inv;
+
+ for (int i = 0; i < nlocal; i++) {
+ if (mask[i] & groupbit)
+ vbuf[n] = h_inv[0]*(x[i][0]-boxlo[0]) + h_inv[5]*(x[i][1]-boxlo[1]) +
+ h_inv[4]*(x[i][2]-boxlo[2]) + (image[i] & IMGMASK) - IMGMAX;
+ else vbuf[n] = 0.0;
+ n += nvalues;
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
+void FixStoreState::pack_ysu_triclinic(int n)
+{
+ double **x = atom->x;
+ imageint *image = atom->image;
+ int *mask = atom->mask;
+ int nlocal = atom->nlocal;
+
+ double *boxlo = domain->boxlo;
+ double *h_inv = domain->h_inv;
+
+ for (int i = 0; i < nlocal; i++) {
+ if (mask[i] & groupbit)
+ vbuf[n] = h_inv[1]*(x[i][1]-boxlo[1]) + h_inv[3]*(x[i][2]-boxlo[2]) +
+ (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
+ else vbuf[n] = 0.0;
+ n += nvalues;
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
+void FixStoreState::pack_zsu_triclinic(int n)
+{
+ double **x = atom->x;
+ imageint *image = atom->image;
+ int *mask = atom->mask;
+ int nlocal = atom->nlocal;
+
+ double *boxlo = domain->boxlo;
+ double *h_inv = domain->h_inv;
+
+ for (int i = 0; i < nlocal; i++) {
+ if (mask[i] & groupbit)
+ vbuf[n] = h_inv[2]*(x[i][2]-boxlo[2]) + (image[i] >> IMG2BITS) - IMGMAX;
+ else vbuf[n] = 0.0;
+ n += nvalues;
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
void FixStoreState::pack_ix(int n)
{
imageint *image = atom->image;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = (image[i] & IMGMASK) - IMGMAX;
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_iy(int n)
{
imageint *image = atom->image;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_iz(int n)
{
imageint *image = atom->image;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = (image[i] >> IMG2BITS) - IMGMAX;
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_vx(int n)
{
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = v[i][0];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_vy(int n)
{
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = v[i][1];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_vz(int n)
{
double **v = atom->v;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = v[i][2];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_fx(int n)
{
double **f = atom->f;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = f[i][0];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_fy(int n)
{
double **f = atom->f;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = f[i][1];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_fz(int n)
{
double **f = atom->f;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = f[i][2];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_q(int n)
{
double *q = atom->q;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = q[i];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_mux(int n)
{
double **mu = atom->mu;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = mu[i][0];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_muy(int n)
{
double **mu = atom->mu;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = mu[i][1];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_muz(int n)
{
double **mu = atom->mu;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = mu[i][2];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
+void FixStoreState::pack_mu(int n)
+{
+ double **mu = atom->mu;
+ int *mask = atom->mask;
+ int nlocal = atom->nlocal;
+
+ for (int i = 0; i < nlocal; i++) {
+ if (mask[i] & groupbit) vbuf[n] = mu[i][3];
+ else vbuf[n] = 0.0;
+ n += nvalues;
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
void FixStoreState::pack_radius(int n)
{
double *radius = atom->radius;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = radius[i];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
+void FixStoreState::pack_diameter(int n)
+{
+ double *radius = atom->radius;
+ int *mask = atom->mask;
+ int nlocal = atom->nlocal;
+
+ for (int i = 0; i < nlocal; i++) {
+ if (mask[i] & groupbit) vbuf[n] = 2.0*radius[i];
+ else vbuf[n] = 0.0;
+ n += nvalues;
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
void FixStoreState::pack_omegax(int n)
{
double **omega = atom->omega;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = omega[i][0];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_omegay(int n)
{
double **omega = atom->omega;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = omega[i][1];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_omegaz(int n)
{
double **omega = atom->omega;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = omega[i][2];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_angmomx(int n)
{
double **angmom = atom->angmom;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = angmom[i][0];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_angmomy(int n)
{
double **angmom = atom->angmom;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = angmom[i][1];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_angmomz(int n)
{
double **angmom = atom->angmom;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = angmom[i][2];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_tqx(int n)
{
double **torque = atom->torque;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = torque[i][0];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_tqy(int n)
{
double **torque = atom->torque;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = torque[i][1];
else vbuf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void FixStoreState::pack_tqz(int n)
{
double **torque = atom->torque;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) vbuf[n] = torque[i][2];
else vbuf[n] = 0.0;
n += nvalues;
}
}
diff --git a/src/fix_store_state.h b/src/fix_store_state.h
index d7523d46b..6397f16ef 100644
--- a/src/fix_store_state.h
+++ b/src/fix_store_state.h
@@ -1,190 +1,199 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(store/state,FixStoreState)
#else
#ifndef LMP_FIX_STORE_STATE_H
#define LMP_FIX_STORE_STATE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixStoreState : public Fix {
public:
FixStoreState(class LAMMPS *, int, char **);
~FixStoreState();
int setmask();
void init();
void setup(int);
void end_of_step();
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
private:
int nvalues;
int *which,*argindex,*value2index;
char **ids;
double **values; // archived atom properties
double *vbuf; // 1d ptr to values
int comflag;
double cm[3]; // center of mass
int kflag,cfv_flag,firstflag;
int cfv_any; // 1 if any compute/fix/variable specified
typedef void (FixStoreState::*FnPtrPack)(int);
FnPtrPack *pack_choice; // ptrs to pack functions
void pack_id(int);
void pack_molecule(int);
void pack_type(int);
void pack_mass(int);
void pack_x(int);
void pack_y(int);
void pack_z(int);
void pack_xs(int);
void pack_ys(int);
void pack_zs(int);
void pack_xs_triclinic(int);
void pack_ys_triclinic(int);
void pack_zs_triclinic(int);
void pack_xu(int);
void pack_yu(int);
void pack_zu(int);
void pack_xu_triclinic(int);
void pack_yu_triclinic(int);
void pack_zu_triclinic(int);
+ void pack_xsu(int);
+ void pack_ysu(int);
+ void pack_zsu(int);
+ void pack_xsu_triclinic(int);
+ void pack_ysu_triclinic(int);
+ void pack_zsu_triclinic(int);
+
void pack_ix(int);
void pack_iy(int);
void pack_iz(int);
void pack_vx(int);
void pack_vy(int);
void pack_vz(int);
void pack_fx(int);
void pack_fy(int);
void pack_fz(int);
void pack_q(int);
void pack_mux(int);
void pack_muy(int);
void pack_muz(int);
+ void pack_mu(int);
void pack_radius(int);
+ void pack_diameter(int);
void pack_omegax(int);
void pack_omegay(int);
void pack_omegaz(int);
void pack_angmomx(int);
void pack_angmomy(int);
void pack_angmomz(int);
void pack_tqx(int);
void pack_tqy(int);
void pack_tqz(int);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Fix store/state for atom property that isn't allocated
Self-explanatory.
E: Compute ID for fix store/state does not exist
Self-explanatory.
E: Fix store/state compute does not calculate per-atom values
Computes that calculate global or local quantities cannot be used
with fix store/state.
E: Fix store/state compute does not calculate a per-atom vector
The compute calculates a per-atom vector.
E: Fix store/state compute does not calculate a per-atom array
The compute calculates a per-atom vector.
E: Fix store/state compute array is accessed out-of-range
Self-explanatory.
E: Custom integer vector for fix store/state does not exist
The command is accessing a vector added by the fix property/atom
command, that does not exist.
E: Custom floating point vector for fix store/state does not exist
The command is accessing a vector added by the fix property/atom
command, that does not exist.
E: Fix ID for fix store/state does not exist
Self-explanatory
E: Fix store/state fix does not calculate per-atom values
Fixes that calculate global or local quantities cannot be used with
fix store/state.
E: Fix store/state fix does not calculate a per-atom vector
The fix calculates a per-atom array.
E: Fix store/state fix does not calculate a per-atom array
The fix calculates a per-atom vector.
E: Fix store/state fix array is accessed out-of-range
Self-explanatory.
E: Fix for fix store/state not computed at compatible time
Fixes generate their values on specific timesteps. Fix store/state
is requesting a value on a non-allowed timestep.
E: Variable name for fix store/state does not exist
Self-explanatory.
E: Fix store/state variable is not atom-style variable
Only atom-style variables calculate per-atom quantities.
*/
diff --git a/src/force.cpp b/src/force.cpp
index b31b8eda4..25efc6e0c 100644
--- a/src/force.cpp
+++ b/src/force.cpp
@@ -1,1023 +1,1030 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "force.h"
#include "style_bond.h"
#include "style_angle.h"
#include "style_dihedral.h"
#include "style_improper.h"
#include "style_pair.h"
#include "style_kspace.h"
#include "atom.h"
#include "comm.h"
#include "pair.h"
#include "pair_hybrid.h"
#include "pair_hybrid_overlay.h"
#include "bond.h"
#include "bond_hybrid.h"
#include "angle.h"
#include "dihedral.h"
#include "improper.h"
#include "kspace.h"
#include "group.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define MAXLINE 1024
/* ---------------------------------------------------------------------- */
Force::Force(LAMMPS *lmp) : Pointers(lmp)
{
newton = newton_pair = newton_bond = 1;
special_lj[0] = special_coul[0] = 1.0;
special_lj[1] = special_lj[2] = special_lj[3] = 0.0;
special_coul[1] = special_coul[2] = special_coul[3] = 0.0;
special_angle = special_dihedral = 0;
special_extra = 0;
dielectric = 1.0;
pair = NULL;
bond = NULL;
angle = NULL;
dihedral = NULL;
improper = NULL;
kspace = NULL;
char *str = (char *) "none";
int n = strlen(str) + 1;
pair_style = new char[n];
strcpy(pair_style,str);
bond_style = new char[n];
strcpy(bond_style,str);
angle_style = new char[n];
strcpy(angle_style,str);
dihedral_style = new char[n];
strcpy(dihedral_style,str);
improper_style = new char[n];
strcpy(improper_style,str);
kspace_style = new char[n];
strcpy(kspace_style,str);
// fill pair map with pair styles listed in style_pair.h
pair_map = new std::map<std::string,PairCreator>();
#define PAIR_CLASS
#define PairStyle(key,Class) \
(*pair_map)[#key] = &pair_creator<Class>;
#include "style_pair.h"
#undef PairStyle
#undef PAIR_CLASS
}
/* ---------------------------------------------------------------------- */
Force::~Force()
{
delete [] pair_style;
delete [] bond_style;
delete [] angle_style;
delete [] dihedral_style;
delete [] improper_style;
delete [] kspace_style;
if (pair) delete pair;
if (bond) delete bond;
if (angle) delete angle;
if (dihedral) delete dihedral;
if (improper) delete improper;
if (kspace) delete kspace;
pair = NULL;
bond = NULL;
angle = NULL;
dihedral = NULL;
improper = NULL;
kspace = NULL;
delete pair_map;
}
/* ---------------------------------------------------------------------- */
void Force::init()
{
qqrd2e = qqr2e/dielectric;
if (kspace) kspace->init(); // kspace must come before pair
if (pair) pair->init(); // so g_ewald is defined
if (bond) bond->init();
if (angle) angle->init();
if (dihedral) dihedral->init();
if (improper) improper->init();
}
+/* ---------------------------------------------------------------------- */
+
+void Force::setup()
+{
+ if (pair) pair->setup();
+}
+
/* ----------------------------------------------------------------------
create a pair style, called from input script or restart file
------------------------------------------------------------------------- */
void Force::create_pair(const char *style, int trysuffix)
{
delete [] pair_style;
if (pair) delete pair;
int sflag;
pair = new_pair(style,trysuffix,sflag);
store_style(pair_style,style,sflag);
}
/* ----------------------------------------------------------------------
generate a pair class
if trysuffix = 1, try first with suffix1/2 appended
return sflag = 0 for no suffix added, 1 or 2 for suffix1/2 added
------------------------------------------------------------------------- */
Pair *Force::new_pair(const char *style, int trysuffix, int &sflag)
{
if (trysuffix && lmp->suffix_enable) {
if (lmp->suffix) {
sflag = 1;
char estyle[256];
sprintf(estyle,"%s/%s",style,lmp->suffix);
if (pair_map->find(estyle) != pair_map->end()) {
PairCreator pair_creator = (*pair_map)[estyle];
return pair_creator(lmp);
}
}
if (lmp->suffix2) {
sflag = 2;
char estyle[256];
sprintf(estyle,"%s/%s",style,lmp->suffix2);
if (pair_map->find(estyle) != pair_map->end()) {
PairCreator pair_creator = (*pair_map)[estyle];
return pair_creator(lmp);
}
}
}
sflag = 0;
if (strcmp(style,"none") == 0) return NULL;
if (pair_map->find(style) != pair_map->end()) {
PairCreator pair_creator = (*pair_map)[style];
return pair_creator(lmp);
}
error->all(FLERR,"Unknown pair style");
return NULL;
}
/* ----------------------------------------------------------------------
one instance per pair style in style_pair.h
------------------------------------------------------------------------- */
template <typename T>
Pair *Force::pair_creator(LAMMPS *lmp)
{
return new T(lmp);
}
/* ----------------------------------------------------------------------
return ptr to Pair class if matches word or matches hybrid sub-style
if exact, then style name must be exact match to word
if not exact, style name must contain word
if nsub > 0, match Nth hybrid sub-style
return NULL if no match or if nsub=0 and multiple sub-styles match
------------------------------------------------------------------------- */
Pair *Force::pair_match(const char *word, int exact, int nsub)
{
int iwhich,count;
if (exact && strcmp(pair_style,word) == 0) return pair;
else if (!exact && strstr(pair_style,word)) return pair;
else if (strstr(pair_style,"hybrid/overlay")) {
PairHybridOverlay *hybrid = (PairHybridOverlay *) pair;
count = 0;
for (int i = 0; i < hybrid->nstyles; i++)
if ((exact && strcmp(hybrid->keywords[i],word) == 0) ||
(!exact && strstr(hybrid->keywords[i],word))) {
iwhich = i;
count++;
if (nsub == count) return hybrid->styles[iwhich];
}
if (count == 1) return hybrid->styles[iwhich];
} else if (strstr(pair_style,"hybrid")) {
PairHybrid *hybrid = (PairHybrid *) pair;
count = 0;
for (int i = 0; i < hybrid->nstyles; i++)
if ((exact && strcmp(hybrid->keywords[i],word) == 0) ||
(!exact && strstr(hybrid->keywords[i],word))) {
iwhich = i;
count++;
if (nsub == count) return hybrid->styles[iwhich];
}
if (count == 1) return hybrid->styles[iwhich];
}
return NULL;
}
/* ----------------------------------------------------------------------
create a bond style, called from input script or restart file
------------------------------------------------------------------------- */
void Force::create_bond(const char *style, int trysuffix)
{
delete [] bond_style;
if (bond) delete bond;
int sflag;
bond = new_bond(style,trysuffix,sflag);
store_style(bond_style,style,sflag);
}
/* ----------------------------------------------------------------------
generate a bond class, fist with suffix appended
------------------------------------------------------------------------- */
Bond *Force::new_bond(const char *style, int trysuffix, int &sflag)
{
if (trysuffix && lmp->suffix_enable) {
if (lmp->suffix) {
sflag = 1;
char estyle[256];
sprintf(estyle,"%s/%s",style,lmp->suffix);
if (0) return NULL;
#define BOND_CLASS
#define BondStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) return new Class(lmp);
#include "style_bond.h"
#undef BondStyle
#undef BOND_CLASS
}
if (lmp->suffix2) {
sflag = 2;
char estyle[256];
sprintf(estyle,"%s/%s",style,lmp->suffix2);
if (0) return NULL;
#define BOND_CLASS
#define BondStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) return new Class(lmp);
#include "style_bond.h"
#undef BondStyle
#undef BOND_CLASS
}
}
sflag = 0;
if (strcmp(style,"none") == 0) return NULL;
#define BOND_CLASS
#define BondStyle(key,Class) \
else if (strcmp(style,#key) == 0) return new Class(lmp);
#include "style_bond.h"
#undef BOND_CLASS
else error->all(FLERR,"Unknown bond style");
return NULL;
}
/* ----------------------------------------------------------------------
return ptr to current bond class or hybrid sub-class if matches style
------------------------------------------------------------------------- */
Bond *Force::bond_match(const char *style)
{
if (strcmp(bond_style,style) == 0) return bond;
else if (strcmp(bond_style,"hybrid") == 0) {
BondHybrid *hybrid = (BondHybrid *) bond;
for (int i = 0; i < hybrid->nstyles; i++)
if (strcmp(hybrid->keywords[i],style) == 0) return hybrid->styles[i];
}
return NULL;
}
/* ----------------------------------------------------------------------
create an angle style, called from input script or restart file
------------------------------------------------------------------------- */
void Force::create_angle(const char *style, int trysuffix)
{
delete [] angle_style;
if (angle) delete angle;
int sflag;
angle = new_angle(style,trysuffix,sflag);
store_style(angle_style,style,sflag);
}
/* ----------------------------------------------------------------------
generate an angle class
------------------------------------------------------------------------- */
Angle *Force::new_angle(const char *style, int trysuffix, int &sflag)
{
if (trysuffix && lmp->suffix_enable) {
if (lmp->suffix) {
sflag = 1;
char estyle[256];
sprintf(estyle,"%s/%s",style,lmp->suffix);
if (0) return NULL;
#define ANGLE_CLASS
#define AngleStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) return new Class(lmp);
#include "style_angle.h"
#undef AngleStyle
#undef ANGLE_CLASS
}
if (lmp->suffix2) {
sflag = 2;
char estyle[256];
sprintf(estyle,"%s/%s",style,lmp->suffix);
if (0) return NULL;
#define ANGLE_CLASS
#define AngleStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) return new Class(lmp);
#include "style_angle.h"
#undef AngleStyle
#undef ANGLE_CLASS
}
}
sflag = 0;
if (strcmp(style,"none") == 0) return NULL;
#define ANGLE_CLASS
#define AngleStyle(key,Class) \
else if (strcmp(style,#key) == 0) return new Class(lmp);
#include "style_angle.h"
#undef ANGLE_CLASS
else error->all(FLERR,"Unknown angle style");
return NULL;
}
/* ----------------------------------------------------------------------
create a dihedral style, called from input script or restart file
------------------------------------------------------------------------- */
void Force::create_dihedral(const char *style, int trysuffix)
{
delete [] dihedral_style;
if (dihedral) delete dihedral;
int sflag;
dihedral = new_dihedral(style,trysuffix,sflag);
store_style(dihedral_style,style,sflag);
}
/* ----------------------------------------------------------------------
generate a dihedral class
------------------------------------------------------------------------- */
Dihedral *Force::new_dihedral(const char *style, int trysuffix, int &sflag)
{
if (trysuffix && lmp->suffix_enable) {
if (lmp->suffix) {
sflag = 1;
char estyle[256];
sprintf(estyle,"%s/%s",style,lmp->suffix);
if (0) return NULL;
#define DIHEDRAL_CLASS
#define DihedralStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) return new Class(lmp);
#include "style_dihedral.h"
#undef DihedralStyle
#undef DIHEDRAL_CLASS
}
if (lmp->suffix2) {
sflag = 2;
char estyle[256];
sprintf(estyle,"%s/%s",style,lmp->suffix2);
if (0) return NULL;
#define DIHEDRAL_CLASS
#define DihedralStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) return new Class(lmp);
#include "style_dihedral.h"
#undef DihedralStyle
#undef DIHEDRAL_CLASS
}
}
sflag = 0;
if (strcmp(style,"none") == 0) return NULL;
#define DIHEDRAL_CLASS
#define DihedralStyle(key,Class) \
else if (strcmp(style,#key) == 0) return new Class(lmp);
#include "style_dihedral.h"
#undef DihedralStyle
#undef DIHEDRAL_CLASS
else error->all(FLERR,"Unknown dihedral style");
return NULL;
}
/* ----------------------------------------------------------------------
create an improper style, called from input script or restart file
------------------------------------------------------------------------- */
void Force::create_improper(const char *style, int trysuffix)
{
delete [] improper_style;
if (improper) delete improper;
int sflag;
improper = new_improper(style,trysuffix,sflag);
store_style(improper_style,style,sflag);
}
/* ----------------------------------------------------------------------
generate a improper class
------------------------------------------------------------------------- */
Improper *Force::new_improper(const char *style, int trysuffix, int &sflag)
{
if (trysuffix && lmp->suffix_enable) {
if (lmp->suffix) {
sflag = 1;
char estyle[256];
sprintf(estyle,"%s/%s",style,lmp->suffix);
if (0) return NULL;
#define IMPROPER_CLASS
#define ImproperStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) return new Class(lmp);
#include "style_improper.h"
#undef ImproperStyle
#undef IMPROPER_CLASS
}
if (lmp->suffix2) {
sflag = 2;
char estyle[256];
sprintf(estyle,"%s/%s",style,lmp->suffix2);
if (0) return NULL;
#define IMPROPER_CLASS
#define ImproperStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) return new Class(lmp);
#include "style_improper.h"
#undef ImproperStyle
#undef IMPROPER_CLASS
}
}
sflag = 0;
if (strcmp(style,"none") == 0) return NULL;
#define IMPROPER_CLASS
#define ImproperStyle(key,Class) \
else if (strcmp(style,#key) == 0) return new Class(lmp);
#include "style_improper.h"
#undef IMPROPER_CLASS
else error->all(FLERR,"Unknown improper style");
return NULL;
}
/* ----------------------------------------------------------------------
return ptr to current improper class or hybrid sub-class if matches style
------------------------------------------------------------------------- */
Improper *Force::improper_match(const char *style)
{
if (strcmp(improper_style,style) == 0) return improper;
else if (strcmp(improper_style,"hybrid") == 0) {
ImproperHybrid *hybrid = (ImproperHybrid *) bond;
for (int i = 0; i < hybrid->nstyles; i++)
if (strcmp(hybrid->keywords[i],style) == 0) return hybrid->styles[i];
}
return NULL;
}
/* ----------------------------------------------------------------------
new kspace style
------------------------------------------------------------------------- */
void Force::create_kspace(int narg, char **arg, int trysuffix)
{
delete [] kspace_style;
if (kspace) delete kspace;
int sflag;
kspace = new_kspace(narg,arg,trysuffix,sflag);
store_style(kspace_style,arg[0],sflag);
if (comm->style == 1 && !kspace_match("ewald",0))
error->all(FLERR,
"Cannot yet use KSpace solver with grid with comm style tiled");
}
/* ----------------------------------------------------------------------
generate a kspace class
------------------------------------------------------------------------- */
KSpace *Force::new_kspace(int narg, char **arg, int trysuffix, int &sflag)
{
if (trysuffix && lmp->suffix_enable) {
if (lmp->suffix) {
sflag = 1;
char estyle[256];
sprintf(estyle,"%s/%s",arg[0],lmp->suffix);
if (0) return NULL;
#define KSPACE_CLASS
#define KSpaceStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) return new Class(lmp,narg-1,&arg[1]);
#include "style_kspace.h"
#undef KSpaceStyle
#undef KSPACE_CLASS
}
if (lmp->suffix2) {
sflag = 1;
char estyle[256];
sprintf(estyle,"%s/%s",arg[0],lmp->suffix2);
if (0) return NULL;
#define KSPACE_CLASS
#define KSpaceStyle(key,Class) \
else if (strcmp(estyle,#key) == 0) return new Class(lmp,narg-1,&arg[1]);
#include "style_kspace.h"
#undef KSpaceStyle
#undef KSPACE_CLASS
}
}
sflag = 0;
if (strcmp(arg[0],"none") == 0) return NULL;
#define KSPACE_CLASS
#define KSpaceStyle(key,Class) \
else if (strcmp(arg[0],#key) == 0) return new Class(lmp,narg-1,&arg[1]);
#include "style_kspace.h"
#undef KSPACE_CLASS
else error->all(FLERR,"Unknown kspace style");
return NULL;
}
/* ----------------------------------------------------------------------
return ptr to Kspace class if matches word
if exact, then style name must be exact match to word
if not exact, style name must contain word
return NULL if no match
------------------------------------------------------------------------- */
KSpace *Force::kspace_match(const char *word, int exact)
{
if (exact && strcmp(kspace_style,word) == 0) return kspace;
else if (!exact && strstr(kspace_style,word)) return kspace;
return NULL;
}
/* ----------------------------------------------------------------------
store style name in str allocated here
if sflag = 0, no suffix
if sflag = 1/2, append suffix or suffix2 to style
------------------------------------------------------------------------- */
void Force::store_style(char *&str, const char *style, int sflag)
{
if (sflag) {
char estyle[256];
if (sflag == 1) sprintf(estyle,"%s/%s",style,lmp->suffix);
else sprintf(estyle,"%s/%s",style,lmp->suffix2);
int n = strlen(estyle) + 1;
str = new char[n];
strcpy(str,estyle);
} else {
int n = strlen(style) + 1;
str = new char[n];
strcpy(str,style);
}
}
/* ----------------------------------------------------------------------
set special bond values
------------------------------------------------------------------------- */
void Force::set_special(int narg, char **arg)
{
if (narg == 0) error->all(FLERR,"Illegal special_bonds command");
// defaults, but do not reset special_extra
special_lj[1] = special_lj[2] = special_lj[3] = 0.0;
special_coul[1] = special_coul[2] = special_coul[3] = 0.0;
special_angle = special_dihedral = 0;
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"amber") == 0) {
if (iarg+1 > narg) error->all(FLERR,"Illegal special_bonds command");
special_lj[1] = 0.0;
special_lj[2] = 0.0;
special_lj[3] = 0.5;
special_coul[1] = 0.0;
special_coul[2] = 0.0;
special_coul[3] = 5.0/6.0;
iarg += 1;
} else if (strcmp(arg[iarg],"charmm") == 0) {
if (iarg+1 > narg) error->all(FLERR,"Illegal special_bonds command");
special_lj[1] = 0.0;
special_lj[2] = 0.0;
special_lj[3] = 0.0;
special_coul[1] = 0.0;
special_coul[2] = 0.0;
special_coul[3] = 0.0;
iarg += 1;
} else if (strcmp(arg[iarg],"dreiding") == 0) {
if (iarg+1 > narg) error->all(FLERR,"Illegal special_bonds command");
special_lj[1] = 0.0;
special_lj[2] = 0.0;
special_lj[3] = 1.0;
special_coul[1] = 0.0;
special_coul[2] = 0.0;
special_coul[3] = 1.0;
iarg += 1;
} else if (strcmp(arg[iarg],"fene") == 0) {
if (iarg+1 > narg) error->all(FLERR,"Illegal special_bonds command");
special_lj[1] = 0.0;
special_lj[2] = 1.0;
special_lj[3] = 1.0;
special_coul[1] = 0.0;
special_coul[2] = 1.0;
special_coul[3] = 1.0;
iarg += 1;
} else if (strcmp(arg[iarg],"lj/coul") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal special_bonds command");
special_lj[1] = special_coul[1] = numeric(FLERR,arg[iarg+1]);
special_lj[2] = special_coul[2] = numeric(FLERR,arg[iarg+2]);
special_lj[3] = special_coul[3] = numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"lj") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal special_bonds command");
special_lj[1] = numeric(FLERR,arg[iarg+1]);
special_lj[2] = numeric(FLERR,arg[iarg+2]);
special_lj[3] = numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"coul") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal special_bonds command");
special_coul[1] = numeric(FLERR,arg[iarg+1]);
special_coul[2] = numeric(FLERR,arg[iarg+2]);
special_coul[3] = numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"angle") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal special_bonds command");
if (strcmp(arg[iarg+1],"no") == 0) special_angle = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) special_angle = 1;
else error->all(FLERR,"Illegal special_bonds command");
iarg += 2;
} else if (strcmp(arg[iarg],"dihedral") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal special_bonds command");
if (strcmp(arg[iarg+1],"no") == 0) special_dihedral = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) special_dihedral = 1;
else error->all(FLERR,"Illegal special_bonds command");
iarg += 2;
} else if (strcmp(arg[iarg],"extra") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal special_bonds command");
special_extra = atoi(arg[iarg+1]);
iarg += 2;
} else error->all(FLERR,"Illegal special_bonds command");
}
for (int i = 1; i <= 3; i++)
if (special_lj[i] < 0.0 || special_lj[i] > 1.0 ||
special_coul[i] < 0.0 || special_coul[i] > 1.0)
error->all(FLERR,"Illegal special_bonds command");
if (special_extra < 0) error->all(FLERR,"Illegal special_bonds command");
}
/* ----------------------------------------------------------------------
compute bounds implied by numeric str with a possible wildcard asterik
1 = lower bound, nmax = upper bound
5 possibilities:
(1) i = i to i, (2) * = nmin to nmax,
(3) i* = i to nmax, (4) *j = nmin to j, (5) i*j = i to j
return nlo,nhi
------------------------------------------------------------------------- */
void Force::bounds(char *str, int nmax, int &nlo, int &nhi, int nmin)
{
char *ptr = strchr(str,'*');
if (ptr == NULL) {
nlo = nhi = atoi(str);
} else if (strlen(str) == 1) {
nlo = nmin;
nhi = nmax;
} else if (ptr == str) {
nlo = nmin;
nhi = atoi(ptr+1);
} else if (strlen(ptr+1) == 0) {
nlo = atoi(str);
nhi = nmax;
} else {
nlo = atoi(str);
nhi = atoi(ptr+1);
}
if (nlo < nmin || nhi > nmax || nlo > nhi)
error->all(FLERR,"Numeric index is out of bounds");
}
/* ----------------------------------------------------------------------
compute bounds implied by numeric str with a possible wildcard asterik
1 = lower bound, nmax = upper bound
5 possibilities:
(1) i = i to i, (2) * = nmin to nmax,
(3) i* = i to nmax, (4) *j = nmin to j, (5) i*j = i to j
return nlo,nhi
------------------------------------------------------------------------- */
void Force::boundsbig(char *str, bigint nmax, bigint &nlo, bigint &nhi,
bigint nmin)
{
char *ptr = strchr(str,'*');
if (ptr == NULL) {
nlo = nhi = ATOBIGINT(str);
} else if (strlen(str) == 1) {
nlo = nmin;
nhi = nmax;
} else if (ptr == str) {
nlo = nmin;
nhi = ATOBIGINT(ptr+1);
} else if (strlen(ptr+1) == 0) {
nlo = ATOBIGINT(str);
nhi = nmax;
} else {
nlo = ATOBIGINT(str);
nhi = ATOBIGINT(ptr+1);
}
if (nlo < nmin || nhi > nmax || nlo > nhi)
error->all(FLERR,"Numeric index is out of bounds");
}
/* ----------------------------------------------------------------------
read a floating point value from a string
generate an error if not a legitimate floating point value
called by various commands to check validity of their arguments
------------------------------------------------------------------------- */
double Force::numeric(const char *file, int line, char *str)
{
if (!str)
error->all(file,line,"Expected floating point parameter "
"in input script or data file");
int n = strlen(str);
if (n == 0)
error->all(file,line,"Expected floating point parameter "
"in input script or data file");
for (int i = 0; i < n; i++) {
if (isdigit(str[i])) continue;
if (str[i] == '-' || str[i] == '+' || str[i] == '.') continue;
if (str[i] == 'e' || str[i] == 'E') continue;
error->all(file,line,"Expected floating point parameter "
"in input script or data file");
}
return atof(str);
}
/* ----------------------------------------------------------------------
read an integer value from a string
generate an error if not a legitimate integer value
called by various commands to check validity of their arguments
------------------------------------------------------------------------- */
int Force::inumeric(const char *file, int line, char *str)
{
if (!str)
error->all(file,line,
"Expected integer parameter in input script or data file");
int n = strlen(str);
if (n == 0)
error->all(file,line,
"Expected integer parameter in input script or data file");
for (int i = 0; i < n; i++) {
if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue;
error->all(file,line,
"Expected integer parameter in input script or data file");
}
return atoi(str);
}
/* ----------------------------------------------------------------------
read a big integer value from a string
generate an error if not a legitimate integer value
called by various commands to check validity of their arguments
------------------------------------------------------------------------- */
bigint Force::bnumeric(const char *file, int line, char *str)
{
if (!str)
error->all(file,line,
"Expected integer parameter in input script or data file");
int n = strlen(str);
if (n == 0)
error->all(file,line,
"Expected integer parameter in input script or data file");
for (int i = 0; i < n; i++) {
if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue;
error->all(file,line,
"Expected integer parameter in input script or data file");
}
return ATOBIGINT(str);
}
/* ----------------------------------------------------------------------
read a tag integer value from a string
generate an error if not a legitimate integer value
called by various commands to check validity of their arguments
------------------------------------------------------------------------- */
tagint Force::tnumeric(const char *file, int line, char *str)
{
if (!str)
error->all(file,line,
"Expected integer parameter in input script or data file");
int n = strlen(str);
if (n == 0)
error->all(file,line,
"Expected integer parameter in input script or data file");
for (int i = 0; i < n; i++) {
if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue;
error->all(file,line,
"Expected integer parameter in input script or data file");
}
return ATOTAGINT(str);
}
/* ----------------------------------------------------------------------
open a potential file as specified by name
if fails, search in dir specified by env variable LAMMPS_POTENTIALS
------------------------------------------------------------------------- */
FILE *Force::open_potential(const char *name)
{
FILE *fp;
if (name == NULL) return NULL;
// attempt to open file directly
// if successful, return ptr
fp = fopen(name,"r");
if (fp) {
if (comm->me == 0) potential_date(fp,name);
rewind(fp);
return fp;
}
// try the environment variable directory
const char *path = getenv("LAMMPS_POTENTIALS");
if (path == NULL) return NULL;
const char *pot = potential_name(name);
if (pot == NULL) return NULL;
size_t len1 = strlen(path);
size_t len2 = strlen(pot);
char *newpath = new char[len1+len2+2];
strcpy(newpath,path);
#if defined(_WIN32)
newpath[len1] = '\\';
newpath[len1+1] = 0;
#else
newpath[len1] = '/';
newpath[len1+1] = 0;
#endif
strcat(newpath,pot);
fp = fopen(newpath,"r");
if (fp) {
if (comm->me == 0) potential_date(fp,name);
rewind(fp);
}
delete [] newpath;
return fp;
}
/* ----------------------------------------------------------------------
strip off leading part of path, return just the filename
------------------------------------------------------------------------- */
const char *Force::potential_name(const char *path)
{
const char *pot;
if (path == NULL) return NULL;
#if defined(_WIN32)
// skip over the disk drive part of windows pathnames
if (isalpha(path[0]) && path[1] == ':')
path += 2;
#endif
for (pot = path; *path != '\0'; ++path) {
#if defined(_WIN32)
if ((*path == '\\') || (*path == '/')) pot = path + 1;
#else
if (*path == '/') pot = path + 1;
#endif
}
return pot;
}
/* ----------------------------------------------------------------------
read first line of potential file
if has DATE field, print following word
------------------------------------------------------------------------- */
void Force::potential_date(FILE *fp, const char *name)
{
char line[MAXLINE];
char *ptr = fgets(line,MAXLINE,fp);
if (ptr == NULL) return;
char *word;
word = strtok(line," \t\n\r\f");
while (word) {
if (strcmp(word,"DATE:") == 0) {
word = strtok(NULL," \t\n\r\f");
if (word == NULL) return;
if (screen)
fprintf(screen,"Reading potential file %s with DATE: %s\n",name,word);
if (logfile)
fprintf(logfile,"Reading potential file %s with DATE: %s\n",name,word);
return;
}
word = strtok(NULL," \t\n\r\f");
}
}
/* ----------------------------------------------------------------------
memory usage of force classes
------------------------------------------------------------------------- */
bigint Force::memory_usage()
{
bigint bytes = 0;
if (pair) bytes += static_cast<bigint> (pair->memory_usage());
if (bond) bytes += static_cast<bigint> (bond->memory_usage());
if (angle) bytes += static_cast<bigint> (angle->memory_usage());
if (dihedral) bytes += static_cast<bigint> (dihedral->memory_usage());
if (improper) bytes += static_cast<bigint> (improper->memory_usage());
if (kspace) bytes += static_cast<bigint> (kspace->memory_usage());
return bytes;
}
diff --git a/src/force.h b/src/force.h
index 7ff668f81..0726d9c9a 100644
--- a/src/force.h
+++ b/src/force.h
@@ -1,168 +1,169 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_FORCE_H
#define LMP_FORCE_H
#include "pointers.h"
#include <stdio.h>
#include <map>
#include <string>
namespace LAMMPS_NS {
class Force : protected Pointers {
public:
double boltz; // Boltzmann constant (eng/degree-K)
double hplanck; // Planck's constant (energy-time)
double mvv2e; // conversion of mv^2 to energy
double ftm2v; // conversion of ft/m to velocity
double mv2d; // conversion of mass/volume to density
double nktv2p; // conversion of NkT/V to pressure
double qqr2e; // conversion of q^2/r to energy
double qe2f; // conversion of qE to force
double vxmu2f; // conversion of vx dynamic-visc to force
double xxt2kmu; // conversion of xx/t to kinematic-visc
double dielectric; // dielectric constant
double qqrd2e; // q^2/r to energy w/ dielectric constant
double e_mass; // electron mass
double hhmrr2e; // conversion of (hbar)^2/(mr^2) to energy
double mvh2r; // conversion of mv/hbar to distance
// hbar = h/(2*pi)
double angstrom; // 1 angstrom in native units
double femtosecond; // 1 femtosecond in native units
double qelectron; // 1 electron charge abs() in native units
int newton,newton_pair,newton_bond; // Newton's 3rd law settings
class Pair *pair;
char *pair_style;
typedef Pair *(*PairCreator)(LAMMPS *);
std::map<std::string,PairCreator> *pair_map;
class Bond *bond;
char *bond_style;
class Angle *angle;
char *angle_style;
class Dihedral *dihedral;
char *dihedral_style;
class Improper *improper;
char *improper_style;
class KSpace *kspace;
char *kspace_style;
// index [0] is not used in these arrays
double special_lj[4]; // 1-2, 1-3, 1-4 prefactors for LJ
double special_coul[4]; // 1-2, 1-3, 1-4 prefactors for Coulombics
int special_angle; // 0 if defined angles are ignored
// 1 if only weight 1,3 atoms if in an angle
int special_dihedral; // 0 if defined dihedrals are ignored
// 1 if only weight 1,4 atoms if in a dihedral
int special_extra; // extra space for added bonds
Force(class LAMMPS *);
~Force();
void init();
+ void setup();
void create_pair(const char *, int);
class Pair *new_pair(const char *, int, int &);
class Pair *pair_match(const char *, int, int nsub=0);
void create_bond(const char *, int);
class Bond *new_bond(const char *, int, int &);
class Bond *bond_match(const char *);
void create_angle(const char *, int);
class Angle *new_angle(const char *, int, int &);
void create_dihedral(const char *, int);
class Dihedral *new_dihedral(const char *, int, int &);
void create_improper(const char *, int);
class Improper *new_improper(const char *, int, int &);
class Improper *improper_match(const char *);
void create_kspace(int, char **, int);
class KSpace *new_kspace(int, char **, int, int &);
class KSpace *kspace_match(const char *, int);
void store_style(char *&, const char *, int);
void set_special(int, char **);
void bounds(char *, int, int &, int &, int nmin=1);
void boundsbig(char *, bigint, bigint &, bigint &, bigint nmin=1);
double numeric(const char *, int, char *);
int inumeric(const char *, int, char *);
bigint bnumeric(const char *, int, char *);
tagint tnumeric(const char *, int, char *);
FILE *open_potential(const char *);
const char *potential_name(const char *);
void potential_date(FILE *, const char *);
bigint memory_usage();
private:
template <typename T> static Pair *pair_creator(LAMMPS *);
};
}
#endif
/* ERROR/WARNING messages:
E: Unknown pair style
The choice of pair style is unknown.
E: Unknown bond style
The choice of bond style is unknown.
E: Unknown angle style
The choice of angle style is unknown.
E: Unknown dihedral style
The choice of dihedral style is unknown.
E: Unknown improper style
The choice of improper style is unknown.
E: Cannot yet use KSpace solver with grid with comm style tiled
This is current restriction in LAMMPS.
E: Unknown kspace style
The choice of kspace style is unknown.
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Numeric index is out of bounds
A command with an argument that specifies an integer or range of
integers is using a value that is less than 1 or greater than the
maximum allowed limit.
*/
diff --git a/src/info.cpp b/src/info.cpp
index e2f3eab99..bb53fa5fe 100644
--- a/src/info.cpp
+++ b/src/info.cpp
@@ -1,676 +1,677 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include <string.h>
#include "info.h"
#include "accelerator_cuda.h"
#include "accelerator_kokkos.h"
#include "atom.h"
#include "comm.h"
#include "compute.h"
#include "domain.h"
#include "dump.h"
#include "fix.h"
#include "force.h"
#include "pair.h"
#include "group.h"
#include "input.h"
#include "modify.h"
#include "neighbor.h"
#include "output.h"
#include "region.h"
#include "universe.h"
#include "variable.h"
#include "update.h"
#include "error.h"
#include <time.h>
#ifdef _WIN32
#define PSAPI_VERSION=1
#include <windows.h>
#include <stdint.h>
#include <psapi.h>
#else
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/utsname.h>
#endif
#if defined __linux
#include <malloc.h>
#endif
namespace LAMMPS_NS {
// same as in variable.cpp
enum {INDEX,LOOP,WORLD,UNIVERSE,ULOOP,STRING,GETENV,
SCALARFILE,ATOMFILE,FORMAT,EQUAL,ATOM,PYTHON};
enum {COMPUTES=1<<0,
DUMPS=1<<1,
FIXES=1<<2,
GROUPS=1<<3,
REGIONS=1<<4,
CONFIG=1<<5,
TIME=1<<6,
VARIABLES=1<<7,
SYSTEM=1<<8,
COMM=1<<9,
ALL=~0};
}
static const char *varstyles[] = {
"index", "loop", "world", "universe", "uloop", "string", "getenv",
"file", "atomfile", "format", "equal", "atom", "python", "(unknown)"};
static const char *mapstyles[] = { "none", "array", "hash" };
static const char *commstyles[] = { "brick", "tiled" };
static const char *commlayout[] = { "uniform", "nonuniform", "irregular" };
static const char bstyles[] = "pfsm";
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
void Info::command(int narg, char **arg)
{
FILE *out=screen;
int flags=0;
if (comm->me != 0) return;
// parse arguments
int idx = 0;
while (idx < narg) {
if (strncmp(arg[idx],"all",3) == 0) {
flags |= ALL;
++idx;
} else if ((idx+1 < narg) && (strncmp(arg[idx],"out",3) == 0)
&& (strncmp(arg[idx+1],"screen",3) == 0)) {
if ((out != screen) && (out != logfile)) fclose(out);
out = screen;
idx += 2;
} else if ((idx+1 < narg) && (strncmp(arg[idx],"out",3) == 0)
&& (strncmp(arg[idx+1],"log",3) == 0)) {
if ((out != screen) && (out != logfile)) fclose(out);
out = logfile;
idx += 2;
} else if ((idx+2 < narg) && (strncmp(arg[idx],"out",3) == 0)
&& (strncmp(arg[idx+1],"append",3) == 0)) {
if ((out != screen) && (out != logfile)) fclose(out);
out = fopen(arg[idx+2],"a");
idx += 3;
} else if ((idx+2 < narg) && (strncmp(arg[idx],"out",3) == 0)
&& (strncmp(arg[idx+1],"overwrite",3) == 0)) {
if ((out != screen) && (out != logfile)) fclose(out);
out = fopen(arg[idx+2],"w");
idx += 3;
} else if (strncmp(arg[idx],"communication",4) == 0) {
flags |= COMM;
++idx;
} else if (strncmp(arg[idx],"computes",4) == 0) {
flags |= COMPUTES;
++idx;
} else if (strncmp(arg[idx],"dumps",3) == 0) {
flags |= DUMPS;
++idx;
} else if (strncmp(arg[idx],"fixes",3) == 0) {
flags |= FIXES;
++idx;
} else if (strncmp(arg[idx],"groups",3) == 0) {
flags |= GROUPS;
++idx;
} else if (strncmp(arg[idx],"regions",3) == 0) {
flags |= REGIONS;
++idx;
} else if (strncmp(arg[idx],"config",3) == 0) {
flags |= CONFIG;
++idx;
} else if (strncmp(arg[idx],"time",3) == 0) {
flags |= TIME;
++idx;
} else if (strncmp(arg[idx],"variables",3) == 0) {
flags |= VARIABLES;
++idx;
} else if (strncmp(arg[idx],"system",3) == 0) {
flags |= SYSTEM;
++idx;
} else {
error->warning(FLERR,"Ignoring unknown or incorrect info command flag");
++idx;
}
}
if (out == NULL) return;
fputs("\nInfo-Info-Info-Info-Info-Info-Info-Info-Info-Info-Info\n",out);
time_t now = time(NULL);
fprintf(out,"Printed on %s\n",ctime(&now));
if (flags & CONFIG) {
fprintf(out,"\nLAMMPS version: %s / %s\n",
universe->version, universe->num_ver);
fprintf(out,"sizeof(smallint): %3d-bit\n",(int)sizeof(smallint)*8);
fprintf(out,"sizeof(imageint): %3d-bit\n",(int)sizeof(imageint)*8);
fprintf(out,"sizeof(tagint): %3d-bit\n",(int)sizeof(tagint)*8);
fprintf(out,"sizeof(bigint): %3d-bit\n",(int)sizeof(bigint)*8);
#if defined(_WIN32)
DWORD fullversion,majorv,minorv,buildv=0;
fullversion = GetVersion();
majorv = (DWORD) (LOBYTE(LOWORD(fullversion)));
minorv = (DWORD) (HIBYTE(LOWORD(fullversion)));
if (fullversion < 0x80000000)
buildv = (DWORD) (HIWORD(fullversion));
SYSTEM_INFO si;
GetSystemInfo(&si);
const char *machine;
switch (si.wProcessorArchitecture) {
case PROCESSOR_ARCHITECTURE_AMD64:
machine = (const char *) "x86_64";
break;
case PROCESSOR_ARCHITECTURE_ARM:
machine = (const char *) "arm";
break;
case PROCESSOR_ARCHITECTURE_IA64:
machine = (const char *) "ia64";
break;
case PROCESSOR_ARCHITECTURE_INTEL:
machine = (const char *) "i386";
break;
default:
machine = (const char *) "(unknown)";
}
fprintf(out,"\nOS information: Windows %d.%d (%d) on %s\n",
majorv,minorv,buildv,machine);
#else
struct utsname ut;
uname(&ut);
fprintf(out,"\nOS information: %s %s on %s\n",
ut.sysname, ut.release, ut.machine);
#endif
fprintf(out,"\nMemory allocation information (MPI rank 0)\n");
#if defined(_WIN32)
HANDLE phandle = GetCurrentProcess();
PROCESS_MEMORY_COUNTERS_EX pmc;
GetProcessMemoryInfo(phandle,(PROCESS_MEMORY_COUNTERS *)&pmc,sizeof(pmc));
fprintf(out,"Non-shared memory use: %.3g Mbyte\n",
(double)pmc.PrivateUsage/1048576.0);
fprintf(out,"Maximum working set size: %.3g Mbyte\n",
(double)pmc.PeakWorkingSetSize/1048576.0);
#else
#if defined(__linux)
struct mallinfo mi;
mi = mallinfo();
fprintf(out,"Total dynamically allocated memory: %.3g Mbyte\n",
(double)mi.uordblks/1048576.0);
#endif
struct rusage ru;
if (getrusage(RUSAGE_SELF, &ru) == 0) {
fprintf(out,"Maximum resident set size: %.3g Mbyte\n",
(double)ru.ru_maxrss/1024.0);
}
#endif
}
if (flags & COMM) {
int major,minor;
MPI_Get_version(&major,&minor);
fprintf(out,"\nCommunication information:\n");
fprintf(out,"MPI library level: MPI v%d.%d\n",major,minor);
fprintf(out,"Comm style = %s, Comm layout = %s\n",
commstyles[comm->style], commlayout[comm->layout]);
fprintf(out,"Communicate velocities for ghost atoms = %s\n",
comm->ghost_velocity ? "yes" : "no");
if (comm->mode == 0) {
fprintf(out,"Communication mode = single\n");
fprintf(out,"Communication cutoff = %g\n",
MAX(comm->cutghostuser,neighbor->cutneighmax));
}
if (comm->mode == 1) {
fprintf(out,"Communication mode = multi\n");
double cut;
for (int i=1; i <= atom->ntypes && neighbor->cuttype; ++i) {
cut = neighbor->cuttype[i];
if (comm->cutusermulti) cut = MAX(cut,comm->cutusermulti[i]);
fprintf(out,"Communication cutoff for type %d = %g\n", i, cut);
}
}
fprintf(out,"Nprocs = %d Nthreads = %d\n",
comm->nprocs, comm->nthreads);
fprintf(out,"Processor grid = %d x %d x %d\n",comm->procgrid[0],
comm->procgrid[1], comm->procgrid[2]);
}
if (flags & SYSTEM) {
fprintf(out,"\nSystem information:\n");
fprintf(out,"Units = %s\n",update->unit_style);
fprintf(out,"Atom style = %s\n", atom->atom_style);
fprintf(out,"Atom map = %s\n", mapstyles[atom->map_style]);
if (atom->molecular > 0) {
const char *msg;
msg = (atom->molecular == 2) ? "template" : "standard";
fprintf(out,"Molecule type = %s\n",msg);
}
fprintf(out,"Atoms = " BIGINT_FORMAT ", types = %d, style = %s\n",
atom->natoms, atom->ntypes, force->pair_style);
if (atom->molecular > 0) {
const char *msg;
msg = force->bond_style ? force->bond_style : "none";
fprintf(out,"Bonds = " BIGINT_FORMAT ", types = %d, style = %s\n",
atom->nbonds, atom->nbondtypes, msg);
msg = force->angle_style ? force->angle_style : "none";
fprintf(out,"Angles = " BIGINT_FORMAT ", types = %d, style = %s\n",
atom->nangles, atom->nangletypes, msg);
msg = force->dihedral_style ? force->dihedral_style : "none";
fprintf(out,"Dihedrals = " BIGINT_FORMAT ", types = %d, style = %s\n",
atom->ndihedrals, atom->ndihedraltypes, msg);
msg = force->improper_style ? force->improper_style : "none";
fprintf(out,"Impropers = " BIGINT_FORMAT ", types = %d, style = %s\n",
atom->nimpropers, atom->nimpropertypes, msg);
const double * const special_lj = force->special_lj;
const double * const special_coul = force->special_coul;
fprintf(out,"Special bond factors lj = %-10g %-10g %-10g\n"
"Special bond factors coul = %-10g %-10g %-10g\n",
special_lj[1],special_lj[2],special_lj[3],
special_coul[1],special_coul[2],special_coul[3]);
}
fprintf(out,"Kspace style = %s\n",
force->kspace ? force->kspace_style : "none");
if (domain->box_exist) {
fprintf(out,"\nDimensions = %d\n",domain->dimension);
fprintf(out,"%s box = %g x %g x %g\n",
domain->triclinic ? "Triclinic" : "Orthogonal",
domain->xprd, domain->yprd, domain->zprd);
fprintf(out,"Boundaries = %c,%c %c,%c %c,%c\n",
bstyles[domain->boundary[0][0]],bstyles[domain->boundary[0][1]],
bstyles[domain->boundary[1][0]],bstyles[domain->boundary[1][1]],
bstyles[domain->boundary[2][0]],bstyles[domain->boundary[2][1]]);
fprintf(out,"Xlo, zhi = %g, %g\n", domain->boxlo[0], domain->boxhi[0]);
fprintf(out,"Ylo, zhi = %g, %g\n", domain->boxlo[1], domain->boxhi[1]);
fprintf(out,"Zlo, zhi = %g, %g\n", domain->boxlo[2], domain->boxhi[2]);
if (domain->triclinic)
fprintf(out,"Xy, xz, yz = %g, %g, %g\n",
domain->xy, domain->xz, domain->yz);
} else {
fputs("\nBox has not yet been created\n",out);
}
}
if (flags & GROUPS) {
int ngroup = group->ngroup;
char **names = group->names;
int *dynamic = group->dynamic;
fprintf(out,"\nGroup information:\n");
for (int i=0; i < ngroup; ++i) {
- fprintf(out,"Group[%2d]: %s (%s)\n",
- i, names[i], dynamic[i] ? "dynamic" : "static");
+ if (names[i])
+ fprintf(out,"Group[%2d]: %s (%s)\n",
+ i, names[i], dynamic[i] ? "dynamic" : "static");
}
}
if (flags & REGIONS) {
int nreg = domain->nregion;
Region **regs = domain->regions;
fprintf(out,"\nRegion information:\n");
for (int i=0; i < nreg; ++i) {
fprintf(out,"Region[%3d]: %s, style = %s, side = %s\n",
i, regs[i]->id, regs[i]->style,
regs[i]->interior ? "in" : "out");
}
}
if (flags & COMPUTES) {
int ncompute = modify->ncompute;
Compute **compute = modify->compute;
char **names = group->names;
fprintf(out,"\nCompute information:\n");
for (int i=0; i < ncompute; ++i) {
fprintf(out,"Compute[%3d]: %s, style = %s, group = %s\n",
i, compute[i]->id, compute[i]->style,
names[compute[i]->igroup]);
}
}
if (flags & DUMPS) {
int ndump = output->ndump;
Dump **dump = output->dump;
int *nevery = output->every_dump; \
char **vnames = output->var_dump;
char **names = group->names;
fprintf(out,"\nDump information:\n");
for (int i=0; i < ndump; ++i) {
fprintf(out,"Dump[%3d]: %s, file = %s, style = %s, group = %s, ",
i, dump[i]->id, dump[i]->filename,
dump[i]->style, names[dump[i]->igroup]);
if (nevery[i]) {
fprintf(out,"every = %d\n", nevery[i]);
} else {
fprintf(out,"every = %s\n", vnames[i]);
}
}
}
if (flags & FIXES) {
int nfix = modify->nfix;
Fix **fix = modify->fix;
char **names = group->names;
fprintf(out,"\nFix information:\n");
for (int i=0; i < nfix; ++i) {
fprintf(out,"Fix[%3d]: %s, style = %s, group = %s\n",
i, fix[i]->id, fix[i]->style, names[fix[i]->igroup]);
}
}
if (flags & VARIABLES) {
int nvar = input->variable->nvar;
int *style = input->variable->style;
char **names = input->variable->names;
char ***data = input->variable->data;
fprintf(out,"\nVariable information:\n");
for (int i=0; i < nvar; ++i) {
int ndata = 1;
fprintf(out,"Variable[%3d]: %-10s style = %-10s def =",
i,names[i],varstyles[style[i]]);
if ((style[i] != LOOP) && (style[i] != ULOOP))
ndata = input->variable->num[i];
for (int j=0; j < ndata; ++j)
fprintf(out," %s",data[i][j]);
fputs("\n",out);
}
}
if (flags & TIME) {
double wallclock = MPI_Wtime() - lmp->initclock;
double cpuclock = 0.0;
#if defined(_WIN32)
// from MSD docs.
FILETIME ct,et,kt,ut;
union { FILETIME ft; uint64_t ui; } cpu;
if (GetProcessTimes(GetCurrentProcess(),&ct,&et,&kt,&ut)) {
cpu.ft = ut;
cpuclock = cpu.ui * 0.0000001;
}
#else /* POSIX */
struct rusage ru;
if (getrusage(RUSAGE_SELF, &ru) == 0) {
cpuclock = (double) ru.ru_utime.tv_sec;
cpuclock += (double) ru.ru_utime.tv_usec * 0.000001;
}
#endif /* ! _WIN32 */
int cpuh,cpum,cpus,wallh,wallm,walls;
cpus = fmod(cpuclock,60.0);
cpuclock = (cpuclock - cpus) / 60.0;
cpum = fmod(cpuclock,60.0);
cpuh = (cpuclock - cpum) / 60.0;
walls = fmod(wallclock,60.0);
wallclock = (wallclock - walls) / 60.0;
wallm = fmod(wallclock,60.0);
wallh = (wallclock - wallm) / 60.0;
fprintf(out,"\nTotal time information (MPI rank 0):\n"
" CPU time: %4d:%02d:%02d\n"
" Wall time: %4d:%02d:%02d\n",
cpuh,cpum,cpus,wallh,wallm,walls);
}
fputs("\nInfo-Info-Info-Info-Info-Info-Info-Info-Info-Info-Info\n\n",out);
// close output file pointer if opened locally thus forcing a hard sync.
if ((out != screen) && (out != logfile))
fclose(out);
}
/* ---------------------------------------------------------------------- */
// the is_active() function returns true if the selected style or name
// in the selected category is currently in use.
bool Info::is_active(const char *category, const char *name)
{
if ((category == NULL) || (name == NULL)) return false;
const char *style = "none";
const int len = strlen(name);
if (strcmp(category,"package") == 0) {
if (strcmp(name,"cuda") == 0) {
return (lmp->cuda && lmp->cuda->cuda_exists) ? true : false;
} else if (strcmp(name,"gpu") == 0) {
return (modify->find_fix("package_gpu") >= 0) ? true : false;
} else if (strcmp(name,"intel") == 0) {
return (modify->find_fix("package_intel") >= 0) ? true : false;
} else if (strcmp(name,"kokkos") == 0) {
return (lmp->kokkos && lmp->kokkos->kokkos_exists) ? true : false;
} else if (strcmp(name,"omp") == 0) {
return (modify->find_fix("package_omp") >= 0) ? true : false;
} else error->all(FLERR,"Unknown name for package category");
} else if (strcmp(category,"newton") == 0) {
if (strcmp(name,"pair") == 0) return (force->newton_pair != 0);
else if (strcmp(name,"bond") == 0) return (force->newton_bond != 0);
else if (strcmp(name,"any") == 0) return (force->newton != 0);
else error->all(FLERR,"Unknown name for newton category");
} else if (strcmp(category,"pair") == 0) {
if (force->pair == NULL) return false;
if (strcmp(name,"single") == 0) return (force->pair->single_enable != 0);
else if (strcmp(name,"respa") == 0) return (force->pair->respa_enable != 0);
else if (strcmp(name,"manybody") == 0) return (force->pair->manybody_flag != 0);
else if (strcmp(name,"tail") == 0) return (force->pair->tail_flag != 0);
else if (strcmp(name,"shift") == 0) return (force->pair->offset_flag != 0);
else error->all(FLERR,"Unknown name for pair category");
} else if (strcmp(category,"comm_style") == 0) {
style = commstyles[comm->style];
} else if (strcmp(category,"min_style") == 0) {
style = update->minimize_style;
} else if (strcmp(category,"run_style") == 0) {
style = update->integrate_style;
} else if (strcmp(category,"atom_style") == 0) {
style = atom->atom_style;
} else if (strcmp(category,"pair_style") == 0) {
style = force->pair_style;
} else if (strcmp(category,"bond_style") == 0) {
style = force->bond_style;
} else if (strcmp(category,"angle_style") == 0) {
style = force->angle_style;
} else if (strcmp(category,"dihedral_style") == 0) {
style = force->dihedral_style;
} else if (strcmp(category,"improper_style") == 0) {
style = force->improper_style;
} else if (strcmp(category,"kspace_style") == 0) {
style = force->kspace_style;
} else error->all(FLERR,"Unknown category for is_active()");
int match = 0;
if (strcmp(style,name) == 0) match = 1;
if (!match && lmp->suffix_enable) {
if (lmp->suffix) {
char *name_w_suffix = new char [len + 2 + strlen(lmp->suffix)];
sprintf(name_w_suffix,"%s/%s",name,lmp->suffix);
if (strcmp(style,name_w_suffix) == 0) match = 1;
delete[] name_w_suffix;
}
if (!match && lmp->suffix2) {
char *name_w_suffix = new char [len + 2 + strlen(lmp->suffix2)];
sprintf(name_w_suffix,"%s/%s",name,lmp->suffix2);
if (strcmp(style,name_w_suffix) == 0) match = 1;
delete[] name_w_suffix;
}
}
return match ? true : false;
}
/* ---------------------------------------------------------------------- */
// the is_available() function returns true if the selected style
// or name in the selected category is available for use (but need
// not be currently active).
bool Info::is_available(const char *category, const char *name)
{
if ((category == NULL) || (name == NULL)) return false;
const int len = strlen(name);
int match = 0;
if (strcmp(category,"command") == 0) {
if (input->command_map->find(name) != input->command_map->end())
match = 1;
} else if (strcmp(category,"compute") == 0) {
if (modify->compute_map->find(name) != modify->compute_map->end())
match = 1;
if (!match && lmp->suffix_enable) {
if (lmp->suffix) {
char *name_w_suffix = new char [len + 2 + strlen(lmp->suffix)];
sprintf(name_w_suffix,"%s/%s",name,lmp->suffix);
if (modify->compute_map->find(name_w_suffix) != modify->compute_map->end())
match = 1;
delete[] name_w_suffix;
}
if (!match && lmp->suffix2) {
char *name_w_suffix = new char [len + 2 + strlen(lmp->suffix2)];
sprintf(name_w_suffix,"%s/%s",name,lmp->suffix2);
if (modify->compute_map->find(name_w_suffix) != modify->compute_map->end())
match = 1;
delete[] name_w_suffix;
}
}
} else if (strcmp(category,"fix") == 0) {
if (modify->fix_map->find(name) != modify->fix_map->end())
match = 1;
if (!match && lmp->suffix_enable) {
if (lmp->suffix) {
char *name_w_suffix = new char [len + 2 + strlen(lmp->suffix)];
sprintf(name_w_suffix,"%s/%s",name,lmp->suffix);
if (modify->fix_map->find(name_w_suffix) != modify->fix_map->end())
match = 1;
delete[] name_w_suffix;
}
if (!match && lmp->suffix2) {
char *name_w_suffix = new char [len + 2 + strlen(lmp->suffix2)];
sprintf(name_w_suffix,"%s/%s",name,lmp->suffix2);
if (modify->fix_map->find(name_w_suffix) != modify->fix_map->end())
match = 1;
delete[] name_w_suffix;
}
}
} else if (strcmp(category,"pair_style") == 0) {
if (force->pair_map->find(name) != force->pair_map->end())
match = 1;
if (!match && lmp->suffix_enable) {
if (lmp->suffix) {
char *name_w_suffix = new char [len + 2 + strlen(lmp->suffix)];
sprintf(name_w_suffix,"%s/%s",name,lmp->suffix);
if (force->pair_map->find(name_w_suffix) != force->pair_map->end())
match = 1;
delete[] name_w_suffix;
}
if (!match && lmp->suffix2) {
char *name_w_suffix = new char [len + 2 + strlen(lmp->suffix2)];
sprintf(name_w_suffix,"%s/%s",name,lmp->suffix2);
if (force->pair_map->find(name_w_suffix) != force->pair_map->end())
match = 1;
delete[] name_w_suffix;
}
}
} else error->all(FLERR,"Unknown category for is_available()");
return match ? true : false;
}
/* ---------------------------------------------------------------------- */
// the is_defined() function returns true if a particular ID of the
// selected category (e.g. fix ID, group ID, region ID etc.) has been
// defined and thus can be accessed. It does *NOT* check whether a
// particular ID has a particular style.
bool Info::is_defined(const char *category, const char *name)
{
if ((category == NULL) || (name == NULL)) return false;
if (strcmp(category,"compute") == 0) {
int ncompute = modify->ncompute;
Compute **compute = modify->compute;
for (int i=0; i < ncompute; ++i) {
if (strcmp(compute[i]->id,name) == 0)
return true;
}
} else if (strcmp(category,"dump") == 0) {
int ndump = output->ndump;
Dump **dump = output->dump;
for (int i=0; i < ndump; ++i) {
if (strcmp(dump[i]->id,name) == 0)
return true;
}
} else if (strcmp(category,"fix") == 0) {
int nfix = modify->nfix;
Fix **fix = modify->fix;
for (int i=0; i < nfix; ++i) {
if (strcmp(fix[i]->id,name) == 0)
return true;
}
} else if (strcmp(category,"group") == 0) {
int ngroup = group->ngroup;
char **names = group->names;
for (int i=0; i < ngroup; ++i) {
if (strcmp(names[i],name) == 0)
return true;
}
} else if (strcmp(category,"region") == 0) {
int nreg = domain->nregion;
Region **regs = domain->regions;
for (int i=0; i < nreg; ++i) {
if (strcmp(regs[i]->id,name) == 0)
return true;
}
} else if (strcmp(category,"variable") == 0) {
int nvar = input->variable->nvar;
char **names = input->variable->names;
for (int i=0; i < nvar; ++i) {
if (strcmp(names[i],name) == 0)
return true;
}
} else error->all(FLERR,"Unknown category for is_defined()");
return false;
}
diff --git a/src/math_extra.cpp b/src/math_extra.cpp
index 0b33fc59c..7095412b3 100644
--- a/src/math_extra.cpp
+++ b/src/math_extra.cpp
@@ -1,611 +1,612 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Mike Brown (SNL)
------------------------------------------------------------------------- */
#include <stdio.h>
#include <string.h>
#include "math_extra.h"
#define MAXJACOBI 50
namespace MathExtra {
/* ----------------------------------------------------------------------
output a matrix
------------------------------------------------------------------------- */
void write3(const double mat[3][3])
{
for (unsigned i = 0; i < 3; i++) {
for (unsigned j = 0; j < 3; j++) printf("%g ",mat[i][j]);
printf("\n");
}
}
/* ----------------------------------------------------------------------
solve Ax = b or M ans = v
use gaussian elimination & partial pivoting on matrix
------------------------------------------------------------------------- */
int mldivide3(const double m[3][3], const double *v, double *ans)
{
// create augmented matrix for pivoting
double aug[3][4];
for (unsigned i = 0; i < 3; i++) {
aug[i][3] = v[i];
for (unsigned j = 0; j < 3; j++) aug[i][j] = m[i][j];
}
for (unsigned i = 0; i < 2; i++) {
unsigned p = i;
for (unsigned j = i+1; j < 3; j++) {
if (fabs(aug[j][i]) > fabs(aug[i][i])) {
double tempv[4];
memcpy(tempv,aug[i],4*sizeof(double));
memcpy(aug[i],aug[j],4*sizeof(double));
memcpy(aug[j],tempv,4*sizeof(double));
}
}
while (p < 3 && aug[p][i] == 0.0) p++;
if (p == 3) return 1;
else
if (p != i) {
double tempv[4];
memcpy(tempv,aug[i],4*sizeof(double));
memcpy(aug[i],aug[p],4*sizeof(double));
memcpy(aug[p],tempv,4*sizeof(double));
}
for (unsigned j = i+1; j < 3; j++) {
double m = aug[j][i]/aug[i][i];
for (unsigned k=i+1; k<4; k++) aug[j][k]-=m*aug[i][k];
}
}
if (aug[2][2] == 0.0) return 1;
// back substitution
ans[2] = aug[2][3]/aug[2][2];
for (int i = 1; i >= 0; i--) {
double sumax = 0.0;
for (unsigned j = i+1; j < 3; j++) sumax += aug[i][j]*ans[j];
ans[i] = (aug[i][3]-sumax) / aug[i][i];
}
return 0;
}
/* ----------------------------------------------------------------------
compute evalues and evectors of 3x3 real symmetric matrix
based on Jacobi rotations
adapted from Numerical Recipes jacobi() function
------------------------------------------------------------------------- */
int jacobi(double matrix[3][3], double *evalues, double evectors[3][3])
{
int i,j,k;
double tresh,theta,tau,t,sm,s,h,g,c,b[3],z[3];
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) evectors[i][j] = 0.0;
evectors[i][i] = 1.0;
}
for (i = 0; i < 3; i++) {
b[i] = evalues[i] = matrix[i][i];
z[i] = 0.0;
}
for (int iter = 1; iter <= MAXJACOBI; iter++) {
sm = 0.0;
for (i = 0; i < 2; i++)
for (j = i+1; j < 3; j++)
sm += fabs(matrix[i][j]);
if (sm == 0.0) return 0;
if (iter < 4) tresh = 0.2*sm/(3*3);
else tresh = 0.0;
for (i = 0; i < 2; i++) {
for (j = i+1; j < 3; j++) {
g = 100.0*fabs(matrix[i][j]);
if (iter > 4 && fabs(evalues[i])+g == fabs(evalues[i])
&& fabs(evalues[j])+g == fabs(evalues[j]))
matrix[i][j] = 0.0;
else if (fabs(matrix[i][j]) > tresh) {
h = evalues[j]-evalues[i];
if (fabs(h)+g == fabs(h)) t = (matrix[i][j])/h;
else {
theta = 0.5*h/(matrix[i][j]);
t = 1.0/(fabs(theta)+sqrt(1.0+theta*theta));
if (theta < 0.0) t = -t;
}
c = 1.0/sqrt(1.0+t*t);
s = t*c;
tau = s/(1.0+c);
h = t*matrix[i][j];
z[i] -= h;
z[j] += h;
evalues[i] -= h;
evalues[j] += h;
matrix[i][j] = 0.0;
for (k = 0; k < i; k++) rotate(matrix,k,i,k,j,s,tau);
for (k = i+1; k < j; k++) rotate(matrix,i,k,k,j,s,tau);
for (k = j+1; k < 3; k++) rotate(matrix,i,k,j,k,s,tau);
for (k = 0; k < 3; k++) rotate(evectors,k,i,k,j,s,tau);
}
}
}
for (i = 0; i < 3; i++) {
evalues[i] = b[i] += z[i];
z[i] = 0.0;
}
}
return 1;
}
/* ----------------------------------------------------------------------
perform a single Jacobi rotation
------------------------------------------------------------------------- */
void rotate(double matrix[3][3], int i, int j, int k, int l,
double s, double tau)
{
double g = matrix[i][j];
double h = matrix[k][l];
matrix[i][j] = g-s*(h+g*tau);
matrix[k][l] = h+s*(g-h*tau);
}
/* ----------------------------------------------------------------------
Richardson iteration to update quaternion from angular momentum
return new normalized quaternion q
also returns updated omega at 1/2 step
------------------------------------------------------------------------- */
void richardson(double *q, double *m, double *w, double *moments, double dtq)
{
// full update from dq/dt = 1/2 w q
double wq[4];
MathExtra::vecquat(w,q,wq);
double qfull[4];
qfull[0] = q[0] + dtq * wq[0];
qfull[1] = q[1] + dtq * wq[1];
qfull[2] = q[2] + dtq * wq[2];
qfull[3] = q[3] + dtq * wq[3];
MathExtra::qnormalize(qfull);
// 1st half update from dq/dt = 1/2 w q
double qhalf[4];
qhalf[0] = q[0] + 0.5*dtq * wq[0];
qhalf[1] = q[1] + 0.5*dtq * wq[1];
qhalf[2] = q[2] + 0.5*dtq * wq[2];
qhalf[3] = q[3] + 0.5*dtq * wq[3];
MathExtra::qnormalize(qhalf);
// re-compute omega at 1/2 step from m at 1/2 step and q at 1/2 step
// recompute wq
MathExtra::mq_to_omega(m,qhalf,moments,w);
MathExtra::vecquat(w,qhalf,wq);
// 2nd half update from dq/dt = 1/2 w q
qhalf[0] += 0.5*dtq * wq[0];
qhalf[1] += 0.5*dtq * wq[1];
qhalf[2] += 0.5*dtq * wq[2];
qhalf[3] += 0.5*dtq * wq[3];
MathExtra::qnormalize(qhalf);
// corrected Richardson update
q[0] = 2.0*qhalf[0] - qfull[0];
q[1] = 2.0*qhalf[1] - qfull[1];
q[2] = 2.0*qhalf[2] - qfull[2];
q[3] = 2.0*qhalf[3] - qfull[3];
MathExtra::qnormalize(q);
}
/* ----------------------------------------------------------------------
apply evolution operators to quat, quat momentum
Miller et al., J Chem Phys. 116, 8649-8659 (2002)
------------------------------------------------------------------------- */
+
void no_squish_rotate(int k, double *p, double *q, double *inertia,
double dt)
{
double phi,c_phi,s_phi,kp[4],kq[4];
// apply permuation operator on p and q, get kp and kq
if (k == 1) {
kq[0] = -q[1]; kp[0] = -p[1];
kq[1] = q[0]; kp[1] = p[0];
kq[2] = q[3]; kp[2] = p[3];
kq[3] = -q[2]; kp[3] = -p[2];
} else if (k == 2) {
kq[0] = -q[2]; kp[0] = -p[2];
kq[1] = -q[3]; kp[1] = -p[3];
kq[2] = q[0]; kp[2] = p[0];
kq[3] = q[1]; kp[3] = p[1];
} else if (k == 3) {
kq[0] = -q[3]; kp[0] = -p[3];
kq[1] = q[2]; kp[1] = p[2];
kq[2] = -q[1]; kp[2] = -p[1];
kq[3] = q[0]; kp[3] = p[0];
}
// obtain phi, cosines and sines
phi = p[0]*kq[0] + p[1]*kq[1] + p[2]*kq[2] + p[3]*kq[3];
if (fabs(inertia[k-1]) < 1e-6) phi *= 0.0;
else phi /= 4.0 * inertia[k-1];
c_phi = cos(dt * phi);
s_phi = sin(dt * phi);
// advance p and q
p[0] = c_phi*p[0] + s_phi*kp[0];
p[1] = c_phi*p[1] + s_phi*kp[1];
p[2] = c_phi*p[2] + s_phi*kp[2];
p[3] = c_phi*p[3] + s_phi*kp[3];
q[0] = c_phi*q[0] + s_phi*kq[0];
q[1] = c_phi*q[1] + s_phi*kq[1];
q[2] = c_phi*q[2] + s_phi*kq[2];
q[3] = c_phi*q[3] + s_phi*kq[3];
}
/* ----------------------------------------------------------------------
compute omega from angular momentum, both in space frame
only know Idiag so need to do M = Iw in body frame
ex,ey,ez are column vectors of rotation matrix P
Mbody = P_transpose Mspace
wbody = Mbody / Idiag
wspace = P wbody
set wbody component to 0.0 if inertia component is 0.0
otherwise body can spin easily around that axis
------------------------------------------------------------------------- */
void angmom_to_omega(double *m, double *ex, double *ey, double *ez,
double *idiag, double *w)
{
double wbody[3];
if (idiag[0] == 0.0) wbody[0] = 0.0;
else wbody[0] = (m[0]*ex[0] + m[1]*ex[1] + m[2]*ex[2]) / idiag[0];
if (idiag[1] == 0.0) wbody[1] = 0.0;
else wbody[1] = (m[0]*ey[0] + m[1]*ey[1] + m[2]*ey[2]) / idiag[1];
if (idiag[2] == 0.0) wbody[2] = 0.0;
else wbody[2] = (m[0]*ez[0] + m[1]*ez[1] + m[2]*ez[2]) / idiag[2];
w[0] = wbody[0]*ex[0] + wbody[1]*ey[0] + wbody[2]*ez[0];
w[1] = wbody[0]*ex[1] + wbody[1]*ey[1] + wbody[2]*ez[1];
w[2] = wbody[0]*ex[2] + wbody[1]*ey[2] + wbody[2]*ez[2];
}
/* ----------------------------------------------------------------------
compute omega from angular momentum
w = omega = angular velocity in space frame
wbody = angular velocity in body frame
project space-frame angular momentum onto body axes
and divide by principal moments
------------------------------------------------------------------------- */
void mq_to_omega(double *m, double *q, double *moments, double *w)
{
double wbody[3];
double rot[3][3];
MathExtra::quat_to_mat(q,rot);
MathExtra::transpose_matvec(rot,m,wbody);
if (moments[0] == 0.0) wbody[0] = 0.0;
else wbody[0] /= moments[0];
if (moments[1] == 0.0) wbody[1] = 0.0;
else wbody[1] /= moments[1];
if (moments[2] == 0.0) wbody[2] = 0.0;
else wbody[2] /= moments[2];
MathExtra::matvec(rot,wbody,w);
}
/* ----------------------------------------------------------------------
compute angular momentum from omega, both in space frame
only know Idiag so need to do M = Iw in body frame
ex,ey,ez are column vectors of rotation matrix P
wbody = P_transpose wspace
Mbody = Idiag wbody
Mspace = P Mbody
------------------------------------------------------------------------- */
void omega_to_angmom(double *w, double *ex, double *ey, double *ez,
double *idiag, double *m)
{
double mbody[3];
mbody[0] = (w[0]*ex[0] + w[1]*ex[1] + w[2]*ex[2]) * idiag[0];
mbody[1] = (w[0]*ey[0] + w[1]*ey[1] + w[2]*ey[2]) * idiag[1];
mbody[2] = (w[0]*ez[0] + w[1]*ez[1] + w[2]*ez[2]) * idiag[2];
m[0] = mbody[0]*ex[0] + mbody[1]*ey[0] + mbody[2]*ez[0];
m[1] = mbody[0]*ex[1] + mbody[1]*ey[1] + mbody[2]*ez[1];
m[2] = mbody[0]*ex[2] + mbody[1]*ey[2] + mbody[2]*ez[2];
}
/* ----------------------------------------------------------------------
create unit quaternion from space-frame ex,ey,ez
ex,ey,ez are columns of a rotation matrix
------------------------------------------------------------------------- */
void exyz_to_q(double *ex, double *ey, double *ez, double *q)
{
// squares of quaternion components
double q0sq = 0.25 * (ex[0] + ey[1] + ez[2] + 1.0);
double q1sq = q0sq - 0.5 * (ey[1] + ez[2]);
double q2sq = q0sq - 0.5 * (ex[0] + ez[2]);
double q3sq = q0sq - 0.5 * (ex[0] + ey[1]);
// some component must be greater than 1/4 since they sum to 1
// compute other components from it
if (q0sq >= 0.25) {
q[0] = sqrt(q0sq);
q[1] = (ey[2] - ez[1]) / (4.0*q[0]);
q[2] = (ez[0] - ex[2]) / (4.0*q[0]);
q[3] = (ex[1] - ey[0]) / (4.0*q[0]);
} else if (q1sq >= 0.25) {
q[1] = sqrt(q1sq);
q[0] = (ey[2] - ez[1]) / (4.0*q[1]);
q[2] = (ey[0] + ex[1]) / (4.0*q[1]);
q[3] = (ex[2] + ez[0]) / (4.0*q[1]);
} else if (q2sq >= 0.25) {
q[2] = sqrt(q2sq);
q[0] = (ez[0] - ex[2]) / (4.0*q[2]);
q[1] = (ey[0] + ex[1]) / (4.0*q[2]);
q[3] = (ez[1] + ey[2]) / (4.0*q[2]);
} else if (q3sq >= 0.25) {
q[3] = sqrt(q3sq);
q[0] = (ex[1] - ey[0]) / (4.0*q[3]);
q[1] = (ez[0] + ex[2]) / (4.0*q[3]);
q[2] = (ez[1] + ey[2]) / (4.0*q[3]);
}
qnormalize(q);
}
/* ----------------------------------------------------------------------
compute space-frame ex,ey,ez from current quaternion q
ex,ey,ez = space-frame coords of 1st,2nd,3rd principal axis
operation is ex = q' d q = Q d, where d is (1,0,0) = 1st axis in body frame
------------------------------------------------------------------------- */
void q_to_exyz(double *q, double *ex, double *ey, double *ez)
{
ex[0] = q[0]*q[0] + q[1]*q[1] - q[2]*q[2] - q[3]*q[3];
ex[1] = 2.0 * (q[1]*q[2] + q[0]*q[3]);
ex[2] = 2.0 * (q[1]*q[3] - q[0]*q[2]);
ey[0] = 2.0 * (q[1]*q[2] - q[0]*q[3]);
ey[1] = q[0]*q[0] - q[1]*q[1] + q[2]*q[2] - q[3]*q[3];
ey[2] = 2.0 * (q[2]*q[3] + q[0]*q[1]);
ez[0] = 2.0 * (q[1]*q[3] + q[0]*q[2]);
ez[1] = 2.0 * (q[2]*q[3] - q[0]*q[1]);
ez[2] = q[0]*q[0] - q[1]*q[1] - q[2]*q[2] + q[3]*q[3];
}
/* ----------------------------------------------------------------------
compute rotation matrix from quaternion
quat = [w i j k]
------------------------------------------------------------------------- */
void quat_to_mat(const double *quat, double mat[3][3])
{
double w2 = quat[0]*quat[0];
double i2 = quat[1]*quat[1];
double j2 = quat[2]*quat[2];
double k2 = quat[3]*quat[3];
double twoij = 2.0*quat[1]*quat[2];
double twoik = 2.0*quat[1]*quat[3];
double twojk = 2.0*quat[2]*quat[3];
double twoiw = 2.0*quat[1]*quat[0];
double twojw = 2.0*quat[2]*quat[0];
double twokw = 2.0*quat[3]*quat[0];
mat[0][0] = w2+i2-j2-k2;
mat[0][1] = twoij-twokw;
mat[0][2] = twojw+twoik;
mat[1][0] = twoij+twokw;
mat[1][1] = w2-i2+j2-k2;
mat[1][2] = twojk-twoiw;
mat[2][0] = twoik-twojw;
mat[2][1] = twojk+twoiw;
mat[2][2] = w2-i2-j2+k2;
}
/* ----------------------------------------------------------------------
compute rotation matrix from quaternion conjugate
quat = [w i j k]
------------------------------------------------------------------------- */
void quat_to_mat_trans(const double *quat, double mat[3][3])
{
double w2 = quat[0]*quat[0];
double i2 = quat[1]*quat[1];
double j2 = quat[2]*quat[2];
double k2 = quat[3]*quat[3];
double twoij = 2.0*quat[1]*quat[2];
double twoik = 2.0*quat[1]*quat[3];
double twojk = 2.0*quat[2]*quat[3];
double twoiw = 2.0*quat[1]*quat[0];
double twojw = 2.0*quat[2]*quat[0];
double twokw = 2.0*quat[3]*quat[0];
mat[0][0] = w2+i2-j2-k2;
mat[1][0] = twoij-twokw;
mat[2][0] = twojw+twoik;
mat[0][1] = twoij+twokw;
mat[1][1] = w2-i2+j2-k2;
mat[2][1] = twojk-twoiw;
mat[0][2] = twoik-twojw;
mat[1][2] = twojk+twoiw;
mat[2][2] = w2-i2-j2+k2;
}
/* ----------------------------------------------------------------------
compute space-frame inertia tensor of an ellipsoid
radii = 3 radii of ellipsoid
quat = orientiation quaternion of ellipsoid
return symmetric inertia tensor as 6-vector in Voigt notation
------------------------------------------------------------------------- */
void inertia_ellipsoid(double *radii, double *quat, double mass,
double *inertia)
{
double p[3][3],ptrans[3][3],itemp[3][3],tensor[3][3];
double idiag[3];
quat_to_mat(quat,p);
quat_to_mat_trans(quat,ptrans);
idiag[0] = 0.2*mass * (radii[1]*radii[1] + radii[2]*radii[2]);
idiag[1] = 0.2*mass * (radii[0]*radii[0] + radii[2]*radii[2]);
idiag[2] = 0.2*mass * (radii[0]*radii[0] + radii[1]*radii[1]);
diag_times3(idiag,ptrans,itemp);
times3(p,itemp,tensor);
inertia[0] = tensor[0][0];
inertia[1] = tensor[1][1];
inertia[2] = tensor[2][2];
inertia[3] = tensor[1][2];
inertia[4] = tensor[0][2];
inertia[5] = tensor[0][1];
}
/* ----------------------------------------------------------------------
compute space-frame inertia tensor of a line segment in 2d
length = length of line
theta = orientiation of line
return symmetric inertia tensor as 6-vector in Voigt notation
------------------------------------------------------------------------- */
void inertia_line(double length, double theta, double mass, double *inertia)
{
double p[3][3],ptrans[3][3],itemp[3][3],tensor[3][3];
double q[4],idiag[3];
q[0] = cos(0.5*theta);
q[1] = q[2] = 0.0;
q[3] = sin(0.5*theta);
MathExtra::quat_to_mat(q,p);
MathExtra::quat_to_mat_trans(q,ptrans);
idiag[0] = 0.0;
idiag[1] = 1.0/12.0 * mass * length*length;
idiag[2] = 1.0/12.0 * mass * length*length;
MathExtra::diag_times3(idiag,ptrans,itemp);
MathExtra::times3(p,itemp,tensor);
inertia[0] = tensor[0][0];
inertia[1] = tensor[1][1];
inertia[2] = tensor[2][2];
inertia[3] = tensor[1][2];
inertia[4] = tensor[0][2];
inertia[5] = tensor[0][1];
}
/* ----------------------------------------------------------------------
compute space-frame inertia tensor of a triangle
v0,v1,v2 = 3 vertices of triangle
from http://en.wikipedia.org/wiki/Inertia_tensor_of_triangle
inertia tensor = a/24 (v0^2 + v1^2 + v2^2 + (v0+v1+v2)^2) I - a Vt S V
a = 2*area of tri = |(v1-v0) x (v2-v0)|
I = 3x3 identity matrix
V = 3x3 matrix with v0,v1,v2 as rows
Vt = 3x3 matrix with v0,v1,v2 as columns
S = 1/24 [2 1 1]
[1 2 1]
[1 1 2]
return symmetric inertia tensor as 6-vector in Voigt notation
------------------------------------------------------------------------- */
void inertia_triangle(double *v0, double *v1, double *v2,
double mass, double *inertia)
{
double s[3][3] = {{2.0, 1.0, 1.0}, {1.0, 2.0, 1.0}, {1.0, 1.0, 2.0}};
double v[3][3],sv[3][3],vtsv[3][3];
double vvv[3],v1mv0[3],v2mv0[3],normal[3];
v[0][0] = v0[0]; v[0][1] = v0[1]; v[0][2] = v0[2];
v[1][0] = v1[0]; v[1][1] = v1[1]; v[1][2] = v1[2];
v[2][0] = v2[0]; v[2][1] = v2[1]; v[2][2] = v2[2];
times3(s,v,sv);
transpose_times3(v,sv,vtsv);
double sum = lensq3(v0) + lensq3(v1) + lensq3(v2);
vvv[0] = v0[0] + v1[0] + v2[0];
vvv[1] = v0[1] + v1[1] + v2[1];
vvv[2] = v0[2] + v1[2] + v2[2];
sum += lensq3(vvv);
sub3(v1,v0,v1mv0);
sub3(v2,v0,v2mv0);
cross3(v1mv0,v2mv0,normal);
double a = len3(normal);
double inv24 = mass/24.0;
inertia[0] = inv24*a*(sum-vtsv[0][0]);
inertia[1] = inv24*a*(sum-vtsv[1][1]);
inertia[2] = inv24*a*(sum-vtsv[2][2]);
inertia[3] = -inv24*a*vtsv[1][2];
inertia[4] = -inv24*a*vtsv[0][2];
inertia[5] = -inv24*a*vtsv[0][1];
}
/* ----------------------------------------------------------------------
compute space-frame inertia tensor of a triangle
idiag = previously computed diagonal inertia tensor
quat = orientiation quaternion of triangle
return symmetric inertia tensor as 6-vector in Voigt notation
------------------------------------------------------------------------- */
void inertia_triangle(double *idiag, double *quat, double mass,
double *inertia)
{
double p[3][3],ptrans[3][3],itemp[3][3],tensor[3][3];
quat_to_mat(quat,p);
quat_to_mat_trans(quat,ptrans);
diag_times3(idiag,ptrans,itemp);
times3(p,itemp,tensor);
inertia[0] = tensor[0][0];
inertia[1] = tensor[1][1];
inertia[2] = tensor[2][2];
inertia[3] = tensor[1][2];
inertia[4] = tensor[0][2];
inertia[5] = tensor[0][1];
}
/* ---------------------------------------------------------------------- */
}
diff --git a/src/math_extra.h b/src/math_extra.h
index f768715ca..7f0db9079 100644
--- a/src/math_extra.h
+++ b/src/math_extra.h
@@ -1,651 +1,656 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Mike Brown (SNL)
------------------------------------------------------------------------- */
#ifndef LMP_MATH_EXTRA_H
#define LMP_MATH_EXTRA_H
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "error.h"
namespace MathExtra {
// 3 vector operations
inline void norm3(double *v);
inline void normalize3(const double *v, double *ans);
inline void snormalize3(const double, const double *v, double *ans);
inline void negate3(double *v);
inline void scale3(double s, double *v);
inline void add3(const double *v1, const double *v2, double *ans);
inline void sub3(const double *v1, const double *v2, double *ans);
inline double len3(const double *v);
inline double lensq3(const double *v);
inline double dot3(const double *v1, const double *v2);
inline void cross3(const double *v1, const double *v2, double *ans);
// 3x3 matrix operations
inline void col2mat(const double *ex, const double *ey, const double *ez,
double m[3][3]);
inline double det3(const double mat[3][3]);
inline void diag_times3(const double *d, const double m[3][3],
double ans[3][3]);
inline void times3_diag(const double m[3][3], const double *d,
double ans[3][3]);
inline void plus3(const double m[3][3], const double m2[3][3],
double ans[3][3]);
inline void times3(const double m[3][3], const double m2[3][3],
double ans[3][3]);
inline void transpose_times3(const double m[3][3], const double m2[3][3],
double ans[3][3]);
inline void times3_transpose(const double m[3][3], const double m2[3][3],
double ans[3][3]);
inline void invert3(const double mat[3][3], double ans[3][3]);
inline void matvec(const double mat[3][3], const double *vec, double *ans);
inline void matvec(const double *ex, const double *ey, const double *ez,
const double *vec, double *ans);
inline void transpose_matvec(const double mat[3][3], const double *vec,
double *ans);
inline void transpose_matvec(const double *ex, const double *ey,
const double *ez, const double *v,
double *ans);
inline void transpose_diag3(const double m[3][3], const double *d,
double ans[3][3]);
inline void vecmat(const double *v, const double m[3][3], double *ans);
inline void scalar_times3(const double f, double m[3][3]);
void write3(const double mat[3][3]);
int mldivide3(const double mat[3][3], const double *vec, double *ans);
int jacobi(double matrix[3][3], double *evalues, double evectors[3][3]);
void rotate(double matrix[3][3], int i, int j, int k, int l,
double s, double tau);
void richardson(double *q, double *m, double *w, double *moments, double dtq);
- void no_squish_rotate(int k, double *p, double *q, double *inertia, double dt);
+ void no_squish_rotate(int k, double *p, double *q, double *inertia,
+ double dt);
// shape matrix operations
// upper-triangular 3x3 matrix stored in Voigt notation as 6-vector
inline void multiply_shape_shape(const double *one, const double *two,
double *ans);
// quaternion operations
inline void qnormalize(double *q);
inline void qconjugate(double *q, double *qc);
inline void vecquat(double *a, double *b, double *c);
inline void quatvec(double *a, double *b, double *c);
inline void quatquat(double *a, double *b, double *c);
inline void invquatvec(double *a, double *b, double *c);
inline void axisangle_to_quat(const double *v, const double angle,
double *quat);
void angmom_to_omega(double *m, double *ex, double *ey, double *ez,
double *idiag, double *w);
void omega_to_angmom(double *w, double *ex, double *ey, double *ez,
double *idiag, double *m);
void mq_to_omega(double *m, double *q, double *moments, double *w);
void exyz_to_q(double *ex, double *ey, double *ez, double *q);
void q_to_exyz(double *q, double *ex, double *ey, double *ez);
void quat_to_mat(const double *quat, double mat[3][3]);
void quat_to_mat_trans(const double *quat, double mat[3][3]);
// rotation operations
inline void rotation_generator_x(const double m[3][3], double ans[3][3]);
inline void rotation_generator_y(const double m[3][3], double ans[3][3]);
inline void rotation_generator_z(const double m[3][3], double ans[3][3]);
// moment of inertia operations
void inertia_ellipsoid(double *shape, double *quat, double mass,
double *inertia);
void inertia_line(double length, double theta, double mass,
double *inertia);
void inertia_triangle(double *v0, double *v1, double *v2,
double mass, double *inertia);
void inertia_triangle(double *idiag, double *quat, double mass,
double *inertia);
}
/* ----------------------------------------------------------------------
normalize a vector in place
------------------------------------------------------------------------- */
inline void MathExtra::norm3(double *v)
{
double scale = 1.0/sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]);
v[0] *= scale;
v[1] *= scale;
v[2] *= scale;
}
/* ----------------------------------------------------------------------
normalize a vector, return in ans
------------------------------------------------------------------------- */
inline void MathExtra::normalize3(const double *v, double *ans)
{
double scale = 1.0/sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]);
ans[0] = v[0]*scale;
ans[1] = v[1]*scale;
ans[2] = v[2]*scale;
}
/* ----------------------------------------------------------------------
scale a vector to length
------------------------------------------------------------------------- */
-inline void MathExtra::snormalize3(const double length, const double *v, double *ans)
+inline void MathExtra::snormalize3(const double length, const double *v,
+ double *ans)
{
double scale = length/sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]);
ans[0] = v[0]*scale;
ans[1] = v[1]*scale;
ans[2] = v[2]*scale;
}
/* ----------------------------------------------------------------------
negate vector v
------------------------------------------------------------------------- */
inline void MathExtra::negate3(double *v)
{
v[0] = -v[0];
v[1] = -v[1];
v[2] = -v[2];
}
/* ----------------------------------------------------------------------
scale vector v by s
------------------------------------------------------------------------- */
inline void MathExtra::scale3(double s, double *v)
{
v[0] *= s;
v[1] *= s;
v[2] *= s;
}
/* ----------------------------------------------------------------------
ans = v1 + v2
------------------------------------------------------------------------- */
inline void MathExtra::add3(const double *v1, const double *v2, double *ans)
{
ans[0] = v1[0] + v2[0];
ans[1] = v1[1] + v2[1];
ans[2] = v1[2] + v2[2];
}
/* ----------------------------------------------------------------------
ans = v1 - v2
------------------------------------------------------------------------- */
inline void MathExtra::sub3(const double *v1, const double *v2, double *ans)
{
ans[0] = v1[0] - v2[0];
ans[1] = v1[1] - v2[1];
ans[2] = v1[2] - v2[2];
}
/* ----------------------------------------------------------------------
length of vector v
------------------------------------------------------------------------- */
inline double MathExtra::len3(const double *v)
{
return sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
}
/* ----------------------------------------------------------------------
squared length of vector v, or dot product of v with itself
------------------------------------------------------------------------- */
inline double MathExtra::lensq3(const double *v)
{
return v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
}
/* ----------------------------------------------------------------------
dot product of 2 vectors
------------------------------------------------------------------------- */
inline double MathExtra::dot3(const double *v1, const double *v2)
{
return v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2];
}
/* ----------------------------------------------------------------------
cross product of 2 vectors
------------------------------------------------------------------------- */
inline void MathExtra::cross3(const double *v1, const double *v2, double *ans)
{
ans[0] = v1[1]*v2[2] - v1[2]*v2[1];
ans[1] = v1[2]*v2[0] - v1[0]*v2[2];
ans[2] = v1[0]*v2[1] - v1[1]*v2[0];
}
/* ----------------------------------------------------------------------
construct matrix from 3 column vectors
------------------------------------------------------------------------- */
void MathExtra::col2mat(const double *ex, const double *ey, const double *ez,
double m[3][3])
{
m[0][0] = ex[0];
m[1][0] = ex[1];
m[2][0] = ex[2];
m[0][1] = ey[0];
m[1][1] = ey[1];
m[2][1] = ey[2];
m[0][2] = ez[0];
m[1][2] = ez[1];
m[2][2] = ez[2];
}
/* ----------------------------------------------------------------------
determinant of a matrix
------------------------------------------------------------------------- */
inline double MathExtra::det3(const double m[3][3])
{
double ans = m[0][0]*m[1][1]*m[2][2] - m[0][0]*m[1][2]*m[2][1] -
m[1][0]*m[0][1]*m[2][2] + m[1][0]*m[0][2]*m[2][1] +
m[2][0]*m[0][1]*m[1][2] - m[2][0]*m[0][2]*m[1][1];
return ans;
}
/* ----------------------------------------------------------------------
diagonal matrix times a full matrix
------------------------------------------------------------------------- */
inline void MathExtra::diag_times3(const double *d, const double m[3][3],
- double ans[3][3])
+ double ans[3][3])
{
ans[0][0] = d[0]*m[0][0];
ans[0][1] = d[0]*m[0][1];
ans[0][2] = d[0]*m[0][2];
ans[1][0] = d[1]*m[1][0];
ans[1][1] = d[1]*m[1][1];
ans[1][2] = d[1]*m[1][2];
ans[2][0] = d[2]*m[2][0];
ans[2][1] = d[2]*m[2][1];
ans[2][2] = d[2]*m[2][2];
}
/* ----------------------------------------------------------------------
full matrix times a diagonal matrix
------------------------------------------------------------------------- */
void MathExtra::times3_diag(const double m[3][3], const double *d,
double ans[3][3])
{
ans[0][0] = m[0][0]*d[0];
ans[0][1] = m[0][1]*d[1];
ans[0][2] = m[0][2]*d[2];
ans[1][0] = m[1][0]*d[0];
ans[1][1] = m[1][1]*d[1];
ans[1][2] = m[1][2]*d[2];
ans[2][0] = m[2][0]*d[0];
ans[2][1] = m[2][1]*d[1];
ans[2][2] = m[2][2]*d[2];
}
/* ----------------------------------------------------------------------
add two matrices
------------------------------------------------------------------------- */
inline void MathExtra::plus3(const double m[3][3], const double m2[3][3],
- double ans[3][3])
+ double ans[3][3])
{
ans[0][0] = m[0][0]+m2[0][0];
ans[0][1] = m[0][1]+m2[0][1];
ans[0][2] = m[0][2]+m2[0][2];
ans[1][0] = m[1][0]+m2[1][0];
ans[1][1] = m[1][1]+m2[1][1];
ans[1][2] = m[1][2]+m2[1][2];
ans[2][0] = m[2][0]+m2[2][0];
ans[2][1] = m[2][1]+m2[2][1];
ans[2][2] = m[2][2]+m2[2][2];
}
/* ----------------------------------------------------------------------
multiply mat1 times mat2
------------------------------------------------------------------------- */
inline void MathExtra::times3(const double m[3][3], const double m2[3][3],
- double ans[3][3])
+ double ans[3][3])
{
ans[0][0] = m[0][0]*m2[0][0] + m[0][1]*m2[1][0] + m[0][2]*m2[2][0];
ans[0][1] = m[0][0]*m2[0][1] + m[0][1]*m2[1][1] + m[0][2]*m2[2][1];
ans[0][2] = m[0][0]*m2[0][2] + m[0][1]*m2[1][2] + m[0][2]*m2[2][2];
ans[1][0] = m[1][0]*m2[0][0] + m[1][1]*m2[1][0] + m[1][2]*m2[2][0];
ans[1][1] = m[1][0]*m2[0][1] + m[1][1]*m2[1][1] + m[1][2]*m2[2][1];
ans[1][2] = m[1][0]*m2[0][2] + m[1][1]*m2[1][2] + m[1][2]*m2[2][2];
ans[2][0] = m[2][0]*m2[0][0] + m[2][1]*m2[1][0] + m[2][2]*m2[2][0];
ans[2][1] = m[2][0]*m2[0][1] + m[2][1]*m2[1][1] + m[2][2]*m2[2][1];
ans[2][2] = m[2][0]*m2[0][2] + m[2][1]*m2[1][2] + m[2][2]*m2[2][2];
}
/* ----------------------------------------------------------------------
multiply the transpose of mat1 times mat2
------------------------------------------------------------------------- */
inline void MathExtra::transpose_times3(const double m[3][3], const double m2[3][3],
double ans[3][3])
{
ans[0][0] = m[0][0]*m2[0][0] + m[1][0]*m2[1][0] + m[2][0]*m2[2][0];
ans[0][1] = m[0][0]*m2[0][1] + m[1][0]*m2[1][1] + m[2][0]*m2[2][1];
ans[0][2] = m[0][0]*m2[0][2] + m[1][0]*m2[1][2] + m[2][0]*m2[2][2];
ans[1][0] = m[0][1]*m2[0][0] + m[1][1]*m2[1][0] + m[2][1]*m2[2][0];
ans[1][1] = m[0][1]*m2[0][1] + m[1][1]*m2[1][1] + m[2][1]*m2[2][1];
ans[1][2] = m[0][1]*m2[0][2] + m[1][1]*m2[1][2] + m[2][1]*m2[2][2];
ans[2][0] = m[0][2]*m2[0][0] + m[1][2]*m2[1][0] + m[2][2]*m2[2][0];
ans[2][1] = m[0][2]*m2[0][1] + m[1][2]*m2[1][1] + m[2][2]*m2[2][1];
ans[2][2] = m[0][2]*m2[0][2] + m[1][2]*m2[1][2] + m[2][2]*m2[2][2];
}
/* ----------------------------------------------------------------------
multiply mat1 times transpose of mat2
------------------------------------------------------------------------- */
inline void MathExtra::times3_transpose(const double m[3][3], const double m2[3][3],
double ans[3][3])
{
ans[0][0] = m[0][0]*m2[0][0] + m[0][1]*m2[0][1] + m[0][2]*m2[0][2];
ans[0][1] = m[0][0]*m2[1][0] + m[0][1]*m2[1][1] + m[0][2]*m2[1][2];
ans[0][2] = m[0][0]*m2[2][0] + m[0][1]*m2[2][1] + m[0][2]*m2[2][2];
ans[1][0] = m[1][0]*m2[0][0] + m[1][1]*m2[0][1] + m[1][2]*m2[0][2];
ans[1][1] = m[1][0]*m2[1][0] + m[1][1]*m2[1][1] + m[1][2]*m2[1][2];
ans[1][2] = m[1][0]*m2[2][0] + m[1][1]*m2[2][1] + m[1][2]*m2[2][2];
ans[2][0] = m[2][0]*m2[0][0] + m[2][1]*m2[0][1] + m[2][2]*m2[0][2];
ans[2][1] = m[2][0]*m2[1][0] + m[2][1]*m2[1][1] + m[2][2]*m2[1][2];
ans[2][2] = m[2][0]*m2[2][0] + m[2][1]*m2[2][1] + m[2][2]*m2[2][2];
}
/* ----------------------------------------------------------------------
invert a matrix
does NOT checks for singular or badly scaled matrix
------------------------------------------------------------------------- */
inline void MathExtra::invert3(const double m[3][3], double ans[3][3])
{
double den = m[0][0]*m[1][1]*m[2][2]-m[0][0]*m[1][2]*m[2][1];
den += -m[1][0]*m[0][1]*m[2][2]+m[1][0]*m[0][2]*m[2][1];
den += m[2][0]*m[0][1]*m[1][2]-m[2][0]*m[0][2]*m[1][1];
ans[0][0] = (m[1][1]*m[2][2]-m[1][2]*m[2][1]) / den;
ans[0][1] = -(m[0][1]*m[2][2]-m[0][2]*m[2][1]) / den;
ans[0][2] = (m[0][1]*m[1][2]-m[0][2]*m[1][1]) / den;
ans[1][0] = -(m[1][0]*m[2][2]-m[1][2]*m[2][0]) / den;
ans[1][1] = (m[0][0]*m[2][2]-m[0][2]*m[2][0]) / den;
ans[1][2] = -(m[0][0]*m[1][2]-m[0][2]*m[1][0]) / den;
ans[2][0] = (m[1][0]*m[2][1]-m[1][1]*m[2][0]) / den;
ans[2][1] = -(m[0][0]*m[2][1]-m[0][1]*m[2][0]) / den;
ans[2][2] = (m[0][0]*m[1][1]-m[0][1]*m[1][0]) / den;
}
/* ----------------------------------------------------------------------
matrix times vector
------------------------------------------------------------------------- */
-inline void MathExtra::matvec(const double m[3][3], const double *v, double *ans)
+inline void MathExtra::matvec(const double m[3][3], const double *v,
+ double *ans)
{
ans[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2];
ans[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2];
ans[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2];
}
/* ----------------------------------------------------------------------
matrix times vector
------------------------------------------------------------------------- */
-inline void MathExtra::matvec(const double *ex, const double *ey, const double *ez,
- const double *v, double *ans)
+inline void MathExtra::matvec(const double *ex, const double *ey,
+ const double *ez, const double *v, double *ans)
{
ans[0] = ex[0]*v[0] + ey[0]*v[1] + ez[0]*v[2];
ans[1] = ex[1]*v[0] + ey[1]*v[1] + ez[1]*v[2];
ans[2] = ex[2]*v[0] + ey[2]*v[1] + ez[2]*v[2];
}
/* ----------------------------------------------------------------------
transposed matrix times vector
------------------------------------------------------------------------- */
inline void MathExtra::transpose_matvec(const double m[3][3], const double *v,
double *ans)
{
ans[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2];
ans[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2];
ans[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2];
}
/* ----------------------------------------------------------------------
transposed matrix times vector
------------------------------------------------------------------------- */
inline void MathExtra::transpose_matvec(const double *ex, const double *ey,
const double *ez, const double *v,
double *ans)
{
ans[0] = ex[0]*v[0] + ex[1]*v[1] + ex[2]*v[2];
ans[1] = ey[0]*v[0] + ey[1]*v[1] + ey[2]*v[2];
ans[2] = ez[0]*v[0] + ez[1]*v[1] + ez[2]*v[2];
}
/* ----------------------------------------------------------------------
transposed matrix times diagonal matrix
------------------------------------------------------------------------- */
inline void MathExtra::transpose_diag3(const double m[3][3], const double *d,
double ans[3][3])
{
ans[0][0] = m[0][0]*d[0];
ans[0][1] = m[1][0]*d[1];
ans[0][2] = m[2][0]*d[2];
ans[1][0] = m[0][1]*d[0];
ans[1][1] = m[1][1]*d[1];
ans[1][2] = m[2][1]*d[2];
ans[2][0] = m[0][2]*d[0];
ans[2][1] = m[1][2]*d[1];
ans[2][2] = m[2][2]*d[2];
}
/* ----------------------------------------------------------------------
row vector times matrix
------------------------------------------------------------------------- */
-inline void MathExtra::vecmat(const double *v, const double m[3][3], double *ans)
+inline void MathExtra::vecmat(const double *v, const double m[3][3],
+ double *ans)
{
ans[0] = v[0]*m[0][0] + v[1]*m[1][0] + v[2]*m[2][0];
ans[1] = v[0]*m[0][1] + v[1]*m[1][1] + v[2]*m[2][1];
ans[2] = v[0]*m[0][2] + v[1]*m[1][2] + v[2]*m[2][2];
}
/* ----------------------------------------------------------------------
matrix times scalar, in place
------------------------------------------------------------------------- */
inline void MathExtra::scalar_times3(const double f, double m[3][3])
{
m[0][0] *= f; m[0][1] *= f; m[0][2] *= f;
m[1][0] *= f; m[1][1] *= f; m[1][2] *= f;
m[2][0] *= f; m[2][1] *= f; m[2][2] *= f;
}
/* ----------------------------------------------------------------------
multiply 2 shape matrices
upper-triangular 3x3, stored as 6-vector in Voigt notation
------------------------------------------------------------------------- */
-inline void MathExtra::multiply_shape_shape(const double *one, const double *two,
- double *ans)
+inline void MathExtra::multiply_shape_shape(const double *one,
+ const double *two, double *ans)
{
ans[0] = one[0]*two[0];
ans[1] = one[1]*two[1];
ans[2] = one[2]*two[2];
ans[3] = one[1]*two[3] + one[3]*two[2];
ans[4] = one[0]*two[4] + one[5]*two[3] + one[4]*two[2];
ans[5] = one[0]*two[5] + one[5]*two[1];
}
/* ----------------------------------------------------------------------
normalize a quaternion
------------------------------------------------------------------------- */
inline void MathExtra::qnormalize(double *q)
{
double norm = 1.0 / sqrt(q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]);
q[0] *= norm;
q[1] *= norm;
q[2] *= norm;
q[3] *= norm;
}
/* ----------------------------------------------------------------------
conjugate of a quaternion: qc = conjugate of q
assume q is of unit length
------------------------------------------------------------------------- */
inline void MathExtra::qconjugate(double *q, double *qc)
{
qc[0] = q[0];
qc[1] = -q[1];
qc[2] = -q[2];
qc[3] = -q[3];
}
/* ----------------------------------------------------------------------
vector-quaternion multiply: c = a*b, where a = (0,a)
------------------------------------------------------------------------- */
inline void MathExtra::vecquat(double *a, double *b, double *c)
{
c[0] = -a[0]*b[1] - a[1]*b[2] - a[2]*b[3];
c[1] = b[0]*a[0] + a[1]*b[3] - a[2]*b[2];
c[2] = b[0]*a[1] + a[2]*b[1] - a[0]*b[3];
c[3] = b[0]*a[2] + a[0]*b[2] - a[1]*b[1];
}
/* ----------------------------------------------------------------------
quaternion-vector multiply: c = a*b, where b = (0,b)
------------------------------------------------------------------------- */
inline void MathExtra::quatvec(double *a, double *b, double *c)
{
c[0] = -a[1]*b[0] - a[2]*b[1] - a[3]*b[2];
c[1] = a[0]*b[0] + a[2]*b[2] - a[3]*b[1];
c[2] = a[0]*b[1] + a[3]*b[0] - a[1]*b[2];
c[3] = a[0]*b[2] + a[1]*b[1] - a[2]*b[0];
}
/* ----------------------------------------------------------------------
quaternion-quaternion multiply: c = a*b
------------------------------------------------------------------------- */
inline void MathExtra::quatquat(double *a, double *b, double *c)
{
c[0] = a[0]*b[0] - a[1]*b[1] - a[2]*b[2] - a[3]*b[3];
c[1] = a[0]*b[1] + b[0]*a[1] + a[2]*b[3] - a[3]*b[2];
c[2] = a[0]*b[2] + b[0]*a[2] + a[3]*b[1] - a[1]*b[3];
c[3] = a[0]*b[3] + b[0]*a[3] + a[1]*b[2] - a[2]*b[1];
}
/* ----------------------------------------------------------------------
quaternion multiply: c = inv(a)*b
a is a quaternion
b is a four component vector
c is a three component vector
------------------------------------------------------------------------- */
inline void MathExtra::invquatvec(double *a, double *b, double *c)
{
c[0] = -a[1]*b[0] + a[0]*b[1] + a[3]*b[2] - a[2]*b[3];
c[1] = -a[2]*b[0] - a[3]*b[1] + a[0]*b[2] + a[1]*b[3];
c[2] = -a[3]*b[0] + a[2]*b[1] - a[1]*b[2] + a[0]*b[3];
}
/* ----------------------------------------------------------------------
compute quaternion from axis-angle rotation
v MUST be a unit vector
------------------------------------------------------------------------- */
inline void MathExtra::axisangle_to_quat(const double *v, const double angle,
double *quat)
{
double halfa = 0.5*angle;
double sina = sin(halfa);
quat[0] = cos(halfa);
quat[1] = v[0]*sina;
quat[2] = v[1]*sina;
quat[3] = v[2]*sina;
}
/* ----------------------------------------------------------------------
Apply principal rotation generator about x to rotation matrix m
------------------------------------------------------------------------- */
-inline void MathExtra::rotation_generator_x(const double m[3][3], double ans[3][3])
+inline void MathExtra::rotation_generator_x(const double m[3][3],
+ double ans[3][3])
{
ans[0][0] = 0;
ans[0][1] = -m[0][2];
ans[0][2] = m[0][1];
ans[1][0] = 0;
ans[1][1] = -m[1][2];
ans[1][2] = m[1][1];
ans[2][0] = 0;
ans[2][1] = -m[2][2];
ans[2][2] = m[2][1];
}
/* ----------------------------------------------------------------------
Apply principal rotation generator about y to rotation matrix m
------------------------------------------------------------------------- */
inline void MathExtra::rotation_generator_y(const double m[3][3], double ans[3][3])
{
ans[0][0] = m[0][2];
ans[0][1] = 0;
ans[0][2] = -m[0][0];
ans[1][0] = m[1][2];
ans[1][1] = 0;
ans[1][2] = -m[1][0];
ans[2][0] = m[2][2];
ans[2][1] = 0;
ans[2][2] = -m[2][0];
}
/* ----------------------------------------------------------------------
Apply principal rotation generator about z to rotation matrix m
------------------------------------------------------------------------- */
inline void MathExtra::rotation_generator_z(const double m[3][3], double ans[3][3])
{
ans[0][0] = -m[0][1];
ans[0][1] = m[0][0];
ans[0][2] = 0;
ans[1][0] = -m[1][1];
ans[1][1] = m[1][0];
ans[1][2] = 0;
ans[2][0] = -m[2][1];
ans[2][1] = m[2][0];
ans[2][2] = 0;
}
#endif
diff --git a/src/min.cpp b/src/min.cpp
index e5e92467a..664b72030 100644
--- a/src/min.cpp
+++ b/src/min.cpp
@@ -1,797 +1,798 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Aidan Thompson (SNL)
improved CG and backtrack ls, added quadratic ls
Sources: Numerical Recipes frprmn routine
"Conjugate Gradient Method Without the Agonizing Pain" by
JR Shewchuk, http://www-2.cs.cmu.edu/~jrs/jrspapers.html#cg
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "min.h"
#include "atom.h"
#include "atom_vec.h"
#include "domain.h"
#include "comm.h"
#include "update.h"
#include "modify.h"
#include "fix_minimize.h"
#include "compute.h"
#include "neighbor.h"
#include "force.h"
#include "pair.h"
#include "bond.h"
#include "angle.h"
#include "dihedral.h"
#include "improper.h"
#include "kspace.h"
#include "output.h"
#include "thermo.h"
#include "timer.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
Min::Min(LAMMPS *lmp) : Pointers(lmp)
{
dmax = 0.1;
searchflag = 0;
linestyle = 1;
elist_global = elist_atom = NULL;
vlist_global = vlist_atom = NULL;
nextra_global = 0;
fextra = NULL;
nextra_atom = 0;
xextra_atom = fextra_atom = NULL;
extra_peratom = extra_nlen = NULL;
extra_max = NULL;
requestor = NULL;
external_force_clear = 0;
}
/* ---------------------------------------------------------------------- */
Min::~Min()
{
delete [] elist_global;
delete [] elist_atom;
delete [] vlist_global;
delete [] vlist_atom;
delete [] fextra;
memory->sfree(xextra_atom);
memory->sfree(fextra_atom);
memory->destroy(extra_peratom);
memory->destroy(extra_nlen);
memory->destroy(extra_max);
memory->sfree(requestor);
}
/* ---------------------------------------------------------------------- */
void Min::init()
{
// create fix needed for storing atom-based quantities
// will delete it at end of run
char **fixarg = new char*[3];
fixarg[0] = (char *) "MINIMIZE";
fixarg[1] = (char *) "all";
fixarg[2] = (char *) "MINIMIZE";
modify->add_fix(3,fixarg);
delete [] fixarg;
fix_minimize = (FixMinimize *) modify->fix[modify->nfix-1];
// clear out extra global and per-atom dof
// will receive requests for new per-atom dof during pair init()
// can then add vectors to fix_minimize in setup()
nextra_global = 0;
delete [] fextra;
fextra = NULL;
nextra_atom = 0;
memory->sfree(xextra_atom);
memory->sfree(fextra_atom);
memory->destroy(extra_peratom);
memory->destroy(extra_nlen);
memory->destroy(extra_max);
memory->sfree(requestor);
xextra_atom = fextra_atom = NULL;
extra_peratom = extra_nlen = NULL;
extra_max = NULL;
requestor = NULL;
// virial_style:
// 1 if computed explicitly by pair->compute via sum over pair interactions
// 2 if computed implicitly by pair->virial_compute via sum over ghost atoms
if (force->newton_pair) virial_style = 2;
else virial_style = 1;
// setup lists of computes for global and per-atom PE and pressure
ev_setup();
// detect if fix omp is present for clearing force arrays
int ifix = modify->find_fix("package_omp");
if (ifix >= 0) external_force_clear = 1;
// set flags for arrays to clear in force_clear()
torqueflag = extraflag = 0;
if (atom->torque_flag) torqueflag = 1;
if (atom->avec->forceclearflag) extraflag = 1;
// allow pair and Kspace compute() to be turned off via modify flags
if (force->pair && force->pair->compute_flag) pair_compute_flag = 1;
else pair_compute_flag = 0;
if (force->kspace && force->kspace->compute_flag) kspace_compute_flag = 1;
else kspace_compute_flag = 0;
// orthogonal vs triclinic simulation box
triclinic = domain->triclinic;
// reset reneighboring criteria if necessary
neigh_every = neighbor->every;
neigh_delay = neighbor->delay;
neigh_dist_check = neighbor->dist_check;
if (neigh_every != 1 || neigh_delay != 0 || neigh_dist_check != 1) {
if (comm->me == 0)
error->warning(FLERR,
"Resetting reneighboring criteria during minimization");
}
neighbor->every = 1;
neighbor->delay = 0;
neighbor->dist_check = 1;
niter = neval = 0;
}
/* ----------------------------------------------------------------------
setup before run
------------------------------------------------------------------------- */
void Min::setup()
{
if (comm->me == 0 && screen) {
fprintf(screen,"Setting up %s style minimization ...\n",
update->minimize_style);
fprintf(screen," Unit style : %s\n", update->unit_style);
timer->print_timeout(screen);
}
update->setupflag = 1;
// setup extra global dof due to fixes
// cannot be done in init() b/c update init() is before modify init()
nextra_global = modify->min_dof();
if (nextra_global) fextra = new double[nextra_global];
// compute for potential energy
int id = modify->find_compute("thermo_pe");
if (id < 0) error->all(FLERR,"Minimization could not find thermo_pe compute");
pe_compute = modify->compute[id];
// style-specific setup does two tasks
// setup extra global dof vectors
// setup extra per-atom dof vectors due to requests from Pair classes
// cannot be done in init() b/c update init() is before modify/pair init()
setup_style();
// ndoftotal = total dof for entire minimization problem
// dof for atoms, extra per-atom, extra global
bigint ndofme = 3 * static_cast<bigint>(atom->nlocal);
for (int m = 0; m < nextra_atom; m++)
ndofme += extra_peratom[m]*atom->nlocal;
MPI_Allreduce(&ndofme,&ndoftotal,1,MPI_LMP_BIGINT,MPI_SUM,world);
ndoftotal += nextra_global;
// setup domain, communication and neighboring
// acquire ghosts
// build neighbor lists
atom->setup();
modify->setup_pre_exchange();
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
comm->exchange();
if (atom->sortfreq > 0) atom->sort();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
domain->image_check();
domain->box_too_small_check();
modify->setup_pre_neighbor();
neighbor->build();
neighbor->ncalls = 0;
// remove these restriction eventually
if (nextra_global && searchflag == 0)
error->all(FLERR,
"Cannot use a damped dynamics min style with fix box/relax");
if (nextra_atom && searchflag == 0)
error->all(FLERR,
"Cannot use a damped dynamics min style with per-atom DOF");
// atoms may have migrated in comm->exchange()
reset_vectors();
// compute all forces
+ force->setup();
ev_set(update->ntimestep);
force_clear();
modify->setup_pre_force(vflag);
if (pair_compute_flag) force->pair->compute(eflag,vflag);
else if (force->pair) force->pair->compute_dummy(eflag,vflag);
if (atom->molecular) {
if (force->bond) force->bond->compute(eflag,vflag);
if (force->angle) force->angle->compute(eflag,vflag);
if (force->dihedral) force->dihedral->compute(eflag,vflag);
if (force->improper) force->improper->compute(eflag,vflag);
}
if (force->kspace) {
force->kspace->setup();
if (kspace_compute_flag) force->kspace->compute(eflag,vflag);
else force->kspace->compute_dummy(eflag,vflag);
}
if (force->newton) comm->reverse_comm();
// update per-atom minimization variables stored by pair styles
if (nextra_atom)
for (int m = 0; m < nextra_atom; m++)
requestor[m]->min_xf_get(m);
modify->setup(vflag);
output->setup();
update->setupflag = 0;
// stats for initial thermo output
ecurrent = pe_compute->compute_scalar();
if (nextra_global) ecurrent += modify->min_energy(fextra);
if (output->thermo->normflag) ecurrent /= atom->natoms;
einitial = ecurrent;
fnorm2_init = sqrt(fnorm_sqr());
fnorminf_init = fnorm_inf();
}
/* ----------------------------------------------------------------------
setup without output or one-time post-init setup
flag = 0 = just force calculation
flag = 1 = reneighbor and force calculation
------------------------------------------------------------------------- */
void Min::setup_minimal(int flag)
{
update->setupflag = 1;
// setup domain, communication and neighboring
// acquire ghosts
// build neighbor lists
if (flag) {
modify->setup_pre_exchange();
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
comm->exchange();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
domain->image_check();
domain->box_too_small_check();
modify->setup_pre_neighbor();
neighbor->build();
neighbor->ncalls = 0;
}
// atoms may have migrated in comm->exchange()
reset_vectors();
// compute all forces
ev_set(update->ntimestep);
force_clear();
modify->setup_pre_force(vflag);
if (pair_compute_flag) force->pair->compute(eflag,vflag);
else if (force->pair) force->pair->compute_dummy(eflag,vflag);
if (atom->molecular) {
if (force->bond) force->bond->compute(eflag,vflag);
if (force->angle) force->angle->compute(eflag,vflag);
if (force->dihedral) force->dihedral->compute(eflag,vflag);
if (force->improper) force->improper->compute(eflag,vflag);
}
if (force->kspace) {
force->kspace->setup();
if (kspace_compute_flag) force->kspace->compute(eflag,vflag);
else force->kspace->compute_dummy(eflag,vflag);
}
if (force->newton) comm->reverse_comm();
// update per-atom minimization variables stored by pair styles
if (nextra_atom)
for (int m = 0; m < nextra_atom; m++)
requestor[m]->min_xf_get(m);
modify->setup(vflag);
update->setupflag = 0;
// stats for Finish to print
ecurrent = pe_compute->compute_scalar();
if (nextra_global) ecurrent += modify->min_energy(fextra);
if (output->thermo->normflag) ecurrent /= atom->natoms;
einitial = ecurrent;
fnorm2_init = sqrt(fnorm_sqr());
fnorminf_init = fnorm_inf();
}
/* ----------------------------------------------------------------------
perform minimization, calling iterate() for N steps
------------------------------------------------------------------------- */
void Min::run(int n)
{
// minimizer iterations
stop_condition = iterate(n);
stopstr = stopstrings(stop_condition);
// if early exit from iterate loop:
// set update->nsteps to niter for Finish stats to print
// set output->next values to this timestep
// call energy_force() to insure vflag is set when forces computed
// output->write does final output for thermo, dump, restart files
// add ntimestep to all computes that store invocation times
// since are hardwiring call to thermo/dumps and computes may not be ready
if (stop_condition != MAXITER) {
update->nsteps = niter;
if (update->restrict_output == 0) {
for (int idump = 0; idump < output->ndump; idump++)
output->next_dump[idump] = update->ntimestep;
output->next_dump_any = update->ntimestep;
if (output->restart_flag) {
output->next_restart = update->ntimestep;
if (output->restart_every_single)
output->next_restart_single = update->ntimestep;
if (output->restart_every_double)
output->next_restart_double = update->ntimestep;
}
}
output->next_thermo = update->ntimestep;
modify->addstep_compute_all(update->ntimestep);
ecurrent = energy_force(0);
output->write(update->ntimestep);
}
}
/* ---------------------------------------------------------------------- */
void Min::cleanup()
{
modify->post_run();
// stats for Finish to print
efinal = ecurrent;
fnorm2_final = sqrt(fnorm_sqr());
fnorminf_final = fnorm_inf();
// reset reneighboring criteria
neighbor->every = neigh_every;
neighbor->delay = neigh_delay;
neighbor->dist_check = neigh_dist_check;
// delete fix at end of run, so its atom arrays won't persist
modify->delete_fix("MINIMIZE");
domain->box_too_small_check();
}
/* ----------------------------------------------------------------------
evaluate potential energy and forces
may migrate atoms due to reneighboring
return new energy, which should include nextra_global dof
return negative gradient stored in atom->f
return negative gradient for nextra_global dof in fextra
------------------------------------------------------------------------- */
double Min::energy_force(int resetflag)
{
// check for reneighboring
// always communicate since minimizer moved atoms
int nflag = neighbor->decide();
if (nflag == 0) {
timer->stamp();
comm->forward_comm();
timer->stamp(Timer::COMM);
} else {
if (modify->n_min_pre_exchange) {
timer->stamp();
modify->min_pre_exchange();
timer->stamp(Timer::MODIFY);
}
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
if (domain->box_change) {
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
}
timer->stamp();
comm->exchange();
if (atom->sortfreq > 0 &&
update->ntimestep >= atom->nextsort) atom->sort();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
timer->stamp(Timer::COMM);
neighbor->build();
timer->stamp(Timer::NEIGH);
}
ev_set(update->ntimestep);
force_clear();
timer->stamp();
if (modify->n_min_pre_force) {
modify->min_pre_force(vflag);
timer->stamp(Timer::MODIFY);
}
if (pair_compute_flag) {
force->pair->compute(eflag,vflag);
timer->stamp(Timer::PAIR);
}
if (atom->molecular) {
if (force->bond) force->bond->compute(eflag,vflag);
if (force->angle) force->angle->compute(eflag,vflag);
if (force->dihedral) force->dihedral->compute(eflag,vflag);
if (force->improper) force->improper->compute(eflag,vflag);
timer->stamp(Timer::BOND);
}
if (kspace_compute_flag) {
force->kspace->compute(eflag,vflag);
timer->stamp(Timer::KSPACE);
}
if (force->newton) {
comm->reverse_comm();
timer->stamp(Timer::COMM);
}
// update per-atom minimization variables stored by pair styles
if (nextra_atom)
for (int m = 0; m < nextra_atom; m++)
requestor[m]->min_xf_get(m);
// fixes that affect minimization
if (modify->n_min_post_force) {
timer->stamp();
modify->min_post_force(vflag);
timer->stamp(Timer::MODIFY);
}
// compute potential energy of system
// normalize if thermo PE does
double energy = pe_compute->compute_scalar();
if (nextra_global) energy += modify->min_energy(fextra);
if (output->thermo->normflag) energy /= atom->natoms;
// if reneighbored, atoms migrated
// if resetflag = 1, update x0 of atoms crossing PBC
// reset vectors used by lo-level minimizer
if (nflag) {
if (resetflag) fix_minimize->reset_coords();
reset_vectors();
}
return energy;
}
/* ----------------------------------------------------------------------
clear force on own & ghost atoms
clear other arrays as needed
------------------------------------------------------------------------- */
void Min::force_clear()
{
if (external_force_clear) return;
// clear global force array
// if either newton flag is set, also include ghosts
size_t nbytes = sizeof(double) * atom->nlocal;
if (force->newton) nbytes += sizeof(double) * atom->nghost;
if (nbytes) {
memset(&atom->f[0][0],0,3*nbytes);
if (torqueflag) memset(&atom->torque[0][0],0,3*nbytes);
if (extraflag) atom->avec->force_clear(0,nbytes);
}
}
/* ----------------------------------------------------------------------
pair style makes request to add a per-atom variables to minimization
requestor stores callback to pair class to invoke during min
to get current variable and forces on it and to update the variable
return flag that pair can use if it registers multiple variables
------------------------------------------------------------------------- */
int Min::request(Pair *pair, int peratom, double maxvalue)
{
int n = nextra_atom + 1;
xextra_atom = (double **) memory->srealloc(xextra_atom,n*sizeof(double *),
"min:xextra_atom");
fextra_atom = (double **) memory->srealloc(fextra_atom,n*sizeof(double *),
"min:fextra_atom");
memory->grow(extra_peratom,n,"min:extra_peratom");
memory->grow(extra_nlen,n,"min:extra_nlen");
memory->grow(extra_max,n,"min:extra_max");
requestor = (Pair **) memory->srealloc(requestor,n*sizeof(Pair *),
"min:requestor");
requestor[nextra_atom] = pair;
extra_peratom[nextra_atom] = peratom;
extra_max[nextra_atom] = maxvalue;
nextra_atom++;
return nextra_atom-1;
}
/* ---------------------------------------------------------------------- */
void Min::modify_params(int narg, char **arg)
{
if (narg == 0) error->all(FLERR,"Illegal min_modify command");
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"dmax") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
dmax = force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"line") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
if (strcmp(arg[iarg+1],"backtrack") == 0) linestyle = 0;
else if (strcmp(arg[iarg+1],"quadratic") == 0) linestyle = 1;
else if (strcmp(arg[iarg+1],"forcezero") == 0) linestyle = 2;
else error->all(FLERR,"Illegal min_modify command");
iarg += 2;
} else error->all(FLERR,"Illegal min_modify command");
}
}
/* ----------------------------------------------------------------------
setup lists of computes for global and per-atom PE and pressure
------------------------------------------------------------------------- */
void Min::ev_setup()
{
delete [] elist_global;
delete [] elist_atom;
delete [] vlist_global;
delete [] vlist_atom;
elist_global = elist_atom = NULL;
vlist_global = vlist_atom = NULL;
nelist_global = nelist_atom = 0;
nvlist_global = nvlist_atom = 0;
for (int i = 0; i < modify->ncompute; i++) {
if (modify->compute[i]->peflag) nelist_global++;
if (modify->compute[i]->peatomflag) nelist_atom++;
if (modify->compute[i]->pressflag) nvlist_global++;
if (modify->compute[i]->pressatomflag) nvlist_atom++;
}
if (nelist_global) elist_global = new Compute*[nelist_global];
if (nelist_atom) elist_atom = new Compute*[nelist_atom];
if (nvlist_global) vlist_global = new Compute*[nvlist_global];
if (nvlist_atom) vlist_atom = new Compute*[nvlist_atom];
nelist_global = nelist_atom = 0;
nvlist_global = nvlist_atom = 0;
for (int i = 0; i < modify->ncompute; i++) {
if (modify->compute[i]->peflag)
elist_global[nelist_global++] = modify->compute[i];
if (modify->compute[i]->peatomflag)
elist_atom[nelist_atom++] = modify->compute[i];
if (modify->compute[i]->pressflag)
vlist_global[nvlist_global++] = modify->compute[i];
if (modify->compute[i]->pressatomflag)
vlist_atom[nvlist_atom++] = modify->compute[i];
}
}
/* ----------------------------------------------------------------------
set eflag,vflag for current iteration
invoke matchstep() on all timestep-dependent computes to clear their arrays
eflag/vflag based on computes that need info on this ntimestep
always set eflag_global = 1, since need energy every iteration
eflag = 0 = no energy computation
eflag = 1 = global energy only
eflag = 2 = per-atom energy only
eflag = 3 = both global and per-atom energy
vflag = 0 = no virial computation (pressure)
vflag = 1 = global virial with pair portion via sum of pairwise interactions
vflag = 2 = global virial with pair portion via F dot r including ghosts
vflag = 4 = per-atom virial only
vflag = 5 or 6 = both global and per-atom virial
------------------------------------------------------------------------- */
void Min::ev_set(bigint ntimestep)
{
int i,flag;
int eflag_global = 1;
for (i = 0; i < nelist_global; i++)
elist_global[i]->matchstep(ntimestep);
flag = 0;
int eflag_atom = 0;
for (i = 0; i < nelist_atom; i++)
if (elist_atom[i]->matchstep(ntimestep)) flag = 1;
if (flag) eflag_atom = 2;
if (eflag_global) update->eflag_global = update->ntimestep;
if (eflag_atom) update->eflag_atom = update->ntimestep;
eflag = eflag_global + eflag_atom;
flag = 0;
int vflag_global = 0;
for (i = 0; i < nvlist_global; i++)
if (vlist_global[i]->matchstep(ntimestep)) flag = 1;
if (flag) vflag_global = virial_style;
flag = 0;
int vflag_atom = 0;
for (i = 0; i < nvlist_atom; i++)
if (vlist_atom[i]->matchstep(ntimestep)) flag = 1;
if (flag) vflag_atom = 4;
if (vflag_global) update->vflag_global = update->ntimestep;
if (vflag_atom) update->vflag_atom = update->ntimestep;
vflag = vflag_global + vflag_atom;
}
/* ----------------------------------------------------------------------
compute and return ||force||_2^2
------------------------------------------------------------------------- */
double Min::fnorm_sqr()
{
int i,n;
double *fatom;
double local_norm2_sqr = 0.0;
for (i = 0; i < nvec; i++) local_norm2_sqr += fvec[i]*fvec[i];
if (nextra_atom) {
for (int m = 0; m < nextra_atom; m++) {
fatom = fextra_atom[m];
n = extra_nlen[m];
for (i = 0; i < n; i++)
local_norm2_sqr += fatom[i]*fatom[i];
}
}
double norm2_sqr = 0.0;
MPI_Allreduce(&local_norm2_sqr,&norm2_sqr,1,MPI_DOUBLE,MPI_SUM,world);
if (nextra_global)
for (i = 0; i < nextra_global; i++)
norm2_sqr += fextra[i]*fextra[i];
return norm2_sqr;
}
/* ----------------------------------------------------------------------
compute and return ||force||_inf
------------------------------------------------------------------------- */
double Min::fnorm_inf()
{
int i,n;
double *fatom;
double local_norm_inf = 0.0;
for (i = 0; i < nvec; i++)
local_norm_inf = MAX(fabs(fvec[i]),local_norm_inf);
if (nextra_atom) {
for (int m = 0; m < nextra_atom; m++) {
fatom = fextra_atom[m];
n = extra_nlen[m];
for (i = 0; i < n; i++)
local_norm_inf = MAX(fabs(fatom[i]),local_norm_inf);
}
}
double norm_inf = 0.0;
MPI_Allreduce(&local_norm_inf,&norm_inf,1,MPI_DOUBLE,MPI_MAX,world);
if (nextra_global)
for (i = 0; i < nextra_global; i++)
norm_inf = MAX(fabs(fextra[i]),norm_inf);
return norm_inf;
}
/* ----------------------------------------------------------------------
possible stop conditions
------------------------------------------------------------------------- */
char *Min::stopstrings(int n)
{
const char *strings[] = {"max iterations",
"max force evaluations",
"energy tolerance",
"force tolerance",
"search direction is not downhill",
"linesearch alpha is zero",
"forces are zero",
"quadratic factors are zero",
"trust region too small",
"HFTN minimizer error",
"walltime limit reached"};
return (char *) strings[n];
}
diff --git a/src/molecule.cpp b/src/molecule.cpp
index 8e772218c..8ac2c037e 100644
--- a/src/molecule.cpp
+++ b/src/molecule.cpp
@@ -1,1702 +1,1794 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <stdlib.h>
#include <string.h>
#include "molecule.h"
#include "atom.h"
#include "atom_vec.h"
+#include "atom_vec_body.h"
#include "force.h"
#include "comm.h"
#include "domain.h"
#include "math_extra.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define MAXLINE 256
#define EPSILON 1.0e-7
#define BIG 1.0e20
#define SINERTIA 0.4 // moment of inertia prefactor for sphere
/* ---------------------------------------------------------------------- */
Molecule::Molecule(LAMMPS *lmp, int narg, char **arg, int &index) :
Pointers(lmp)
{
me = comm->me;
if (index >= narg) error->all(FLERR,"Illegal molecule command");
int n = strlen(arg[0]) + 1;
id = new char[n];
strcpy(id,arg[0]);
for (int i = 0; i < n-1; i++)
if (!isalnum(id[i]) && id[i] != '_')
error->all(FLERR,"Molecule template ID must be "
"alphanumeric or underscore characters");
// parse args until reach unknown arg (next file)
toffset = 0;
boffset = aoffset = doffset = ioffset = 0;
sizescale = 1.0;
int ifile = index;
int iarg = ifile+1;
while (iarg < narg) {
if (strcmp(arg[iarg],"offset") == 0) {
if (iarg+6 > narg) error->all(FLERR,"Illegal molecule command");
toffset = force->inumeric(FLERR,arg[iarg+1]);
boffset = force->inumeric(FLERR,arg[iarg+2]);
aoffset = force->inumeric(FLERR,arg[iarg+3]);
doffset = force->inumeric(FLERR,arg[iarg+4]);
ioffset = force->inumeric(FLERR,arg[iarg+5]);
if (toffset < 0 || boffset < 0 || aoffset < 0 ||
doffset < 0 || ioffset < 0)
error->all(FLERR,"Illegal molecule command");
iarg += 6;
} else if (strcmp(arg[iarg],"toff") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command");
toffset = force->inumeric(FLERR,arg[iarg+1]);
if (toffset < 0) error->all(FLERR,"Illegal molecule command");
iarg += 2;
} else if (strcmp(arg[iarg],"boff") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command");
boffset = force->inumeric(FLERR,arg[iarg+1]);
if (boffset < 0) error->all(FLERR,"Illegal molecule command");
iarg += 2;
} else if (strcmp(arg[iarg],"aoff") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command");
aoffset = force->inumeric(FLERR,arg[iarg+1]);
if (aoffset < 0) error->all(FLERR,"Illegal molecule command");
iarg += 2;
} else if (strcmp(arg[iarg],"doff") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command");
doffset = force->inumeric(FLERR,arg[iarg+1]);
if (doffset < 0) error->all(FLERR,"Illegal molecule command");
iarg += 2;
} else if (strcmp(arg[iarg],"ioff") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command");
ioffset = force->inumeric(FLERR,arg[iarg+1]);
if (ioffset < 0) error->all(FLERR,"Illegal molecule command");
iarg += 2;
} else if (strcmp(arg[iarg],"scale") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command");
sizescale = force->numeric(FLERR,arg[iarg+1]);
if (sizescale <= 0.0) error->all(FLERR,"Illegal molecule command");
iarg += 2;
} else break;
}
index = iarg;
// last molecule if have scanned all args
if (iarg == narg) last = 1;
else last = 0;
// initialize all fields to empty
initialize();
// scan file for sizes of all fields and allocate them
if (me == 0) open(arg[ifile]);
read(0);
if (me == 0) fclose(fp);
allocate();
// read file again to populate all fields
if (me == 0) open(arg[ifile]);
read(1);
if (me == 0) fclose(fp);
// stats
if (me == 0) {
if (screen)
fprintf(screen,"Read molecule %s:\n"
" %d atoms with %d types\n %d bonds with %d types\n"
" %d angles with %d types\n %d dihedrals with %d types\n"
" %d impropers with %d types\n",
id,natoms,ntypes,
nbonds,nbondtypes,nangles,nangletypes,
ndihedrals,ndihedraltypes,nimpropers,nimpropertypes);
if (logfile)
fprintf(logfile,"Read molecule %s:\n"
" %d atoms with %d types\n %d bonds with %d types\n"
" %d angles with %d types\n %d dihedrals with %d types\n"
" %d impropers with %d types\n",
id,natoms,ntypes,
nbonds,nbondtypes,nangles,nangletypes,
ndihedrals,ndihedraltypes,nimpropers,nimpropertypes);
}
}
/* ---------------------------------------------------------------------- */
Molecule::~Molecule()
{
delete [] id;
deallocate();
}
/* ----------------------------------------------------------------------
compute center = geometric center of molecule
also compute:
dx = displacement of each atom from center
- molradius = radius of molecule from center including finite-size particles
+ molradius = radius of molecule from center
+ including finite-size particles or body particles
------------------------------------------------------------------------- */
void Molecule::compute_center()
{
if (centerflag) return;
centerflag = 1;
center[0] = center[1] = center[2] = 0.0;
for (int i = 0; i < natoms; i++) {
center[0] += x[i][0];
center[1] += x[i][1];
center[2] += x[i][2];
}
center[0] /= natoms;
center[1] /= natoms;
center[2] /= natoms;
memory->destroy(dx);
memory->create(dx,natoms,3,"molecule:dx");
for (int i = 0; i < natoms; i++) {
dx[i][0] = x[i][0] - center[0];
dx[i][1] = x[i][1] - center[1];
dx[i][2] = x[i][2] - center[2];
}
molradius = 0.0;
for (int i = 0; i < natoms; i++) {
double rad = MathExtra::len3(dx[i]);
if (radiusflag) rad += radius[i];
molradius = MAX(molradius,rad);
}
}
/* ----------------------------------------------------------------------
compute masstotal = total mass of molecule
could have been set by user, otherwise calculate it
------------------------------------------------------------------------- */
void Molecule::compute_mass()
{
if (massflag) return;
massflag = 1;
if (!rmassflag) atom->check_mass();
masstotal = 0.0;
for (int i = 0; i < natoms; i++) {
if (rmassflag) masstotal += rmass[i];
else masstotal += atom->mass[type[i]];
}
}
/* ----------------------------------------------------------------------
compute com = center of mass of molecule
could have been set by user, otherwise calculate it
works for finite size particles assuming no overlap
also compute:
dxcom = displacement of each atom from COM
comatom = which atom (1-Natom) is nearest the COM
maxextent = furthest any atom in molecule is from comatom (not COM)
------------------------------------------------------------------------- */
void Molecule::compute_com()
{
if (!comflag) {
comflag = 1;
if (!rmassflag) atom->check_mass();
double onemass;
com[0] = com[1] = com[2] = 0.0;
for (int i = 0; i < natoms; i++) {
if (rmassflag) onemass = rmass[i];
else onemass = atom->mass[type[i]];
com[0] += x[i][0]*onemass;
com[1] += x[i][1]*onemass;
com[2] += x[i][2]*onemass;
}
com[0] /= masstotal;
com[1] /= masstotal;
com[2] /= masstotal;
}
memory->destroy(dxcom);
memory->create(dxcom,natoms,3,"molecule:dxcom");
for (int i = 0; i < natoms; i++) {
dxcom[i][0] = x[i][0] - com[0];
dxcom[i][1] = x[i][1] - com[1];
dxcom[i][2] = x[i][2] - com[2];
}
double rsqmin = BIG;
for (int i = 0; i < natoms; i++) {
double rsq = MathExtra::lensq3(dxcom[i]);
if (rsq < rsqmin) {
comatom = i;
rsqmin = rsq;
}
}
double rsqmax = 0.0;
for (int i = 0; i < natoms; i++) {
double dx = x[comatom][0] - x[i][0];
double dy = x[comatom][1] - x[i][1];
double dz = x[comatom][2] - x[i][2];
double rsq = dx*dx + dy*dy + dz*dz;
rsqmax = MAX(rsqmax,rsq);
}
comatom++;
maxextent = sqrt(rsqmax);
}
/* ----------------------------------------------------------------------
compute itensor = 6 moments of inertia of molecule around xyz axes
could have been set by user, otherwise calculate it
accounts for finite size spheres, assuming no overlap
also compute:
inertia = 3 principal components of inertia
ex,ey,ez = principal axes in space coords
quat = quaternion for orientation of molecule
dxbody = displacement of each atom from COM in body frame
------------------------------------------------------------------------- */
void Molecule::compute_inertia()
{
if (!inertiaflag) {
inertiaflag = 1;
if (!rmassflag) atom->check_mass();
double onemass,dx,dy,dz;
for (int i = 0; i < 6; i++) itensor[i] = 0.0;
for (int i = 0; i < natoms; i++) {
if (rmassflag) onemass = rmass[i];
else onemass = atom->type[type[i]];
dx = dxcom[i][0];
dy = dxcom[i][1];
dz = dxcom[i][2];
itensor[0] += onemass * (dy*dy + dz*dz);
itensor[1] += onemass * (dx*dx + dz*dz);
itensor[2] += onemass * (dx*dx + dy*dy);
itensor[3] -= onemass * dy*dz;
itensor[4] -= onemass * dx*dz;
itensor[5] -= onemass * dx*dy;
}
if (radiusflag) {
for (int i = 0; i < natoms; i++) {
if (rmassflag) onemass = rmass[i];
else onemass = atom->type[type[i]];
itensor[0] += SINERTIA*onemass * radius[i]*radius[i];
itensor[1] += SINERTIA*onemass * radius[i]*radius[i];
itensor[2] += SINERTIA*onemass * radius[i]*radius[i];
}
}
}
// diagonalize inertia tensor for each body via Jacobi rotations
// inertia = 3 eigenvalues = principal moments of inertia
// evectors and exzy = 3 evectors = principal axes of rigid body
double cross[3];
double tensor[3][3],evectors[3][3];
tensor[0][0] = itensor[0];
tensor[1][1] = itensor[1];
tensor[2][2] = itensor[2];
tensor[1][2] = tensor[2][1] = itensor[3];
tensor[0][2] = tensor[2][0] = itensor[4];
tensor[0][1] = tensor[1][0] = itensor[5];
if (MathExtra::jacobi(tensor,inertia,evectors))
error->all(FLERR,"Insufficient Jacobi rotations for rigid molecule");
ex[0] = evectors[0][0];
ex[1] = evectors[1][0];
ex[2] = evectors[2][0];
ey[0] = evectors[0][1];
ey[1] = evectors[1][1];
ey[2] = evectors[2][1];
ez[0] = evectors[0][2];
ez[1] = evectors[1][2];
ez[2] = evectors[2][2];
// if any principal moment < scaled EPSILON, set to 0.0
double max;
max = MAX(inertia[0],inertia[1]);
max = MAX(max,inertia[2]);
if (inertia[0] < EPSILON*max) inertia[0] = 0.0;
if (inertia[1] < EPSILON*max) inertia[1] = 0.0;
if (inertia[2] < EPSILON*max) inertia[2] = 0.0;
// enforce 3 evectors as a right-handed coordinate system
// flip 3rd vector if needed
MathExtra::cross3(ex,ey,cross);
if (MathExtra::dot3(cross,ez) < 0.0) MathExtra::negate3(ez);
// create quaternion
MathExtra::exyz_to_q(ex,ey,ez,quat);
// compute displacements in body frame defined by quat
memory->destroy(dxbody);
memory->create(dxbody,natoms,3,"molecule:dxbody");
for (int i = 0; i < natoms; i++)
MathExtra::transpose_matvec(ex,ey,ez,dxcom[i],dxbody[i]);
}
/* ----------------------------------------------------------------------
read molecule info from file
flag = 0, just scan for sizes of fields
flag = 1, read and store fields
------------------------------------------------------------------------- */
void Molecule::read(int flag)
{
char line[MAXLINE],keyword[MAXLINE];
char *eof,*ptr;
// skip 1st line of file
if (me == 0) {
eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of molecule file");
}
// read header lines
// skip blank lines or lines that start with "#"
// stop when read an unrecognized line
while (1) {
readline(line);
// trim anything from '#' onward
// if line is blank, continue
if ((ptr = strchr(line,'#'))) *ptr = '\0';
if (strspn(line," \t\n\r") == strlen(line)) continue;
// search line for header keywords and set corresponding variable
if (strstr(line,"atoms")) sscanf(line,"%d",&natoms);
else if (strstr(line,"bonds")) sscanf(line,"%d",&nbonds);
else if (strstr(line,"angles")) sscanf(line,"%d",&nangles);
else if (strstr(line,"dihedrals")) sscanf(line,"%d",&ndihedrals);
else if (strstr(line,"impropers")) sscanf(line,"%d",&nimpropers);
else if (strstr(line,"mass")) {
massflag = 1;
sscanf(line,"%lg",&masstotal);
masstotal *= sizescale*sizescale*sizescale;
}
else if (strstr(line,"com")) {
comflag = 1;
sscanf(line,"%lg %lg %lg",&com[0],&com[1],&com[2]);
com[0] *= sizescale;
com[1] *= sizescale;
com[2] *= sizescale;
if (domain->dimension == 2 && com[2] != 0.0)
error->all(FLERR,"Molecule file z center-of-mass must be 0.0 for 2d");
}
else if (strstr(line,"inertia")) {
inertiaflag = 1;
sscanf(line,"%lg %lg %lg %lg %lg %lg",
&itensor[0],&itensor[1],&itensor[2],
&itensor[3],&itensor[4],&itensor[5]);
itensor[0] *= sizescale*sizescale*sizescale*sizescale*sizescale;
itensor[1] *= sizescale*sizescale*sizescale*sizescale*sizescale;
itensor[2] *= sizescale*sizescale*sizescale*sizescale*sizescale;
itensor[3] *= sizescale*sizescale*sizescale*sizescale*sizescale;
itensor[4] *= sizescale*sizescale*sizescale*sizescale*sizescale;
itensor[5] *= sizescale*sizescale*sizescale*sizescale*sizescale;
}
+ else if (strstr(line,"body")) {
+ bodyflag = 1;
+ avec_body = (AtomVecBody *) atom->style_match("body");
+ if (!avec_body)
+ error->all(FLERR,"Molecule file requires atom style body");
+ sscanf(line,"%d %d",&nibody,&ndbody);
+ }
else break;
}
// error checks
if (natoms < 1) error->all(FLERR,"No or invalid atom count in molecule file");
if (nbonds < 0) error->all(FLERR,"Invalid bond count in molecule file");
if (nangles < 0) error->all(FLERR,"Invalid angle count in molecule file");
if (ndihedrals < 0)
error->all(FLERR,"Invalid dihedral count in molecule file");
if (nimpropers < 0)
error->all(FLERR,"Invalid improper count in molecule file");
// count = vector for tallying bonds,angles,etc per atom
if (flag == 0) memory->create(count,natoms,"molecule:count");
else count = NULL;
// grab keyword and skip next line
parse_keyword(0,line,keyword);
readline(line);
// loop over sections of molecule file
while (strlen(keyword)) {
if (strcmp(keyword,"Coords") == 0) {
xflag = 1;
if (flag) coords(line);
else skip_lines(natoms,line);
} else if (strcmp(keyword,"Types") == 0) {
typeflag = 1;
if (flag) types(line);
else skip_lines(natoms,line);
} else if (strcmp(keyword,"Charges") == 0) {
qflag = 1;
if (flag) charges(line);
else skip_lines(natoms,line);
} else if (strcmp(keyword,"Diameters") == 0) {
radiusflag = 1;
if (flag) diameters(line);
else skip_lines(natoms,line);
} else if (strcmp(keyword,"Masses") == 0) {
rmassflag = 1;
if (flag) masses(line);
else skip_lines(natoms,line);
} else if (strcmp(keyword,"Bonds") == 0) {
if (nbonds == 0)
error->all(FLERR,"Molecule file has bonds but no nbonds setting");
bondflag = tag_require = 1;
bonds(flag,line);
} else if (strcmp(keyword,"Angles") == 0) {
if (nangles == 0)
error->all(FLERR,"Molecule file has angles but no nangles setting");
angleflag = tag_require = 1;
angles(flag,line);
} else if (strcmp(keyword,"Dihedrals") == 0) {
if (ndihedrals == 0) error->all(FLERR,"Molecule file has dihedrals "
"but no ndihedrals setting");
dihedralflag = tag_require = 1;
dihedrals(flag,line);
} else if (strcmp(keyword,"Impropers") == 0) {
if (nimpropers == 0) error->all(FLERR,"Molecule file has impropers "
"but no nimpropers setting");
improperflag = tag_require = 1;
impropers(flag,line);
} else if (strcmp(keyword,"Special Bond Counts") == 0) {
nspecialflag = 1;
nspecial_read(flag,line);
} else if (strcmp(keyword,"Special Bonds") == 0) {
specialflag = tag_require = 1;
if (flag) special_read(line);
else skip_lines(natoms,line);
} else if (strcmp(keyword,"Shake Flags") == 0) {
shakeflagflag = 1;
if (flag) shakeflag_read(line);
else skip_lines(natoms,line);
} else if (strcmp(keyword,"Shake Atoms") == 0) {
shakeatomflag = tag_require = 1;
if (shaketypeflag) shakeflag = 1;
if (!shakeflagflag)
error->all(FLERR,"Molecule file shake flags not before shake atoms");
if (flag) shakeatom_read(line);
else skip_lines(natoms,line);
} else if (strcmp(keyword,"Shake Bond Types") == 0) {
shaketypeflag = 1;
if (shakeatomflag) shakeflag = 1;
if (!shakeflagflag)
error->all(FLERR,"Molecule file shake flags not before shake bonds");
if (flag) shaketype_read(line);
else skip_lines(natoms,line);
+ } else if (strcmp(keyword,"Body Integers") == 0) {
+ if (bodyflag == 0 || nibody == 0)
+ error->all(FLERR,"Molecule file has body params "
+ "but no setting for them");
+ ibodyflag = 1;
+ body(flag,0,line);
+ } else if (strcmp(keyword,"Body Doubles") == 0) {
+ if (bodyflag == 0 || ndbody == 0)
+ error->all(FLERR,"Molecule file has body params "
+ "but no setting for them");
+ dbodyflag = 1;
+ body(flag,1,line);
+
} else error->one(FLERR,"Unknown section in molecule file");
parse_keyword(1,line,keyword);
}
// clean up
memory->destroy(count);
// error check
if (flag == 0) {
if ((nspecialflag && !specialflag) || (!nspecialflag && specialflag))
error->all(FLERR,"Molecule file needs both Special Bond sections");
if (specialflag && !bondflag)
error->all(FLERR,"Molecule file has special flags but no bonds");
if ((shakeflagflag || shakeatomflag || shaketypeflag) && !shakeflag)
error->all(FLERR,"Molecule file shake info is incomplete");
+ if (bodyflag && nibody && ibodyflag == 0)
+ error->all(FLERR,"Molecule file has no Body Integers section");
+ if (bodyflag && ndbody && dbodyflag == 0)
+ error->all(FLERR,"Molecule file has no Body Doubles section");
}
// auto-generate special bonds
if (bondflag && !specialflag) {
specialflag = 1;
nspecialflag = 1;
maxspecial = atom->maxspecial;
if (flag) special_generate();
}
+
+ // body particle must have natom = 1
+ // set radius by having body class compute its own radius
+
+ if (bodyflag) {
+ radiusflag = 1;
+ if (natoms != 1)
+ error->all(FLERR,"Molecule natoms must be 1 for body particle");
+ if (sizescale != 1.0)
+ error->all(FLERR,"Molecule sizescale must be 1.0 for body particle");
+ if (flag) {
+ radius[0] = avec_body->radius_body(nibody,ndbody,ibodyparams,dbodyparams);
+ maxradius = radius[0];
+ }
+ }
}
/* ----------------------------------------------------------------------
read coords from file
------------------------------------------------------------------------- */
void Molecule::coords(char *line)
{
int tmp;
for (int i = 0; i < natoms; i++) {
readline(line);
if (i == 0) {
int nwords = atom->count_words(line);
if (nwords != 4)
error->all(FLERR,"Invalid Coords section in molecule file");
}
sscanf(line,"%d %lg %lg %lg",&tmp,&x[i][0],&x[i][1],&x[i][2]);
x[i][0] *= sizescale;
x[i][1] *= sizescale;
x[i][2] *= sizescale;
}
if (domain->dimension == 2) {
for (int i = 0; i < natoms; i++)
if (x[i][2] != 0.0)
error->all(FLERR,"Molecule file z coord must be 0.0 for 2d");
}
}
/* ----------------------------------------------------------------------
read types from file
set ntypes = max of any atom type
------------------------------------------------------------------------- */
void Molecule::types(char *line)
{
int tmp;
for (int i = 0; i < natoms; i++) {
readline(line);
if (i == 0) {
int nwords = atom->count_words(line);
if (nwords != 2)
error->all(FLERR,"Invalid Types section in molecule file");
}
sscanf(line,"%d %d",&tmp,&type[i]);
type[i] += toffset;
}
for (int i = 0; i < natoms; i++)
if (type[i] <= 0)
error->all(FLERR,"Invalid atom type in molecule file");
for (int i = 0; i < natoms; i++)
ntypes = MAX(ntypes,type[i]);
}
/* ----------------------------------------------------------------------
read charges from file
------------------------------------------------------------------------- */
void Molecule::charges(char *line)
{
int tmp;
for (int i = 0; i < natoms; i++) {
readline(line);
if (i == 0) {
int nwords = atom->count_words(line);
if (nwords != 2)
error->all(FLERR,"Invalid Charges section in molecule file");
}
sscanf(line,"%d %lg",&tmp,&q[i]);
}
}
/* ----------------------------------------------------------------------
read diameters from file and set radii
------------------------------------------------------------------------- */
void Molecule::diameters(char *line)
{
int tmp;
maxradius = 0.0;
for (int i = 0; i < natoms; i++) {
readline(line);
if (i == 0) {
int nwords = atom->count_words(line);
if (nwords != 2)
error->all(FLERR,"Invalid Diameters section in molecule file");
}
sscanf(line,"%d %lg",&tmp,&radius[i]);
radius[i] *= sizescale;
radius[i] *= 0.5;
maxradius = MAX(maxradius,radius[i]);
}
for (int i = 0; i < natoms; i++)
if (radius[i] < 0.0)
error->all(FLERR,"Invalid atom diameter in molecule file");
}
/* ----------------------------------------------------------------------
read masses from file
------------------------------------------------------------------------- */
void Molecule::masses(char *line)
{
int tmp;
for (int i = 0; i < natoms; i++) {
readline(line);
if (i == 0) {
int nwords = atom->count_words(line);
if (nwords != 2)
error->all(FLERR,"Invalid Masses section in molecule file");
}
sscanf(line,"%d %lg",&tmp,&rmass[i]);
rmass[i] *= sizescale*sizescale*sizescale;
}
for (int i = 0; i < natoms; i++)
if (rmass[i] <= 0.0) error->all(FLERR,"Invalid atom mass in molecule file");
}
/* ----------------------------------------------------------------------
read bonds from file
set nbondtypes = max type of any bond
store each with both atoms if newton_bond = 0
if flag = 0, just count bonds/atom
if flag = 1, store them with atoms
------------------------------------------------------------------------- */
void Molecule::bonds(int flag, char *line)
{
int tmp,itype;
tagint m,atom1,atom2;
int newton_bond = force->newton_bond;
if (flag == 0)
for (int i = 0; i < natoms; i++) count[i] = 0;
else
for (int i = 0; i < natoms; i++) num_bond[i] = 0;
for (int i = 0; i < nbonds; i++) {
readline(line);
if (i == 0) {
int nwords = atom->count_words(line);
if (nwords != 4)
error->all(FLERR,"Invalid Bonds section in molecule file");
}
sscanf(line,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT,
&tmp,&itype,&atom1,&atom2);
itype += boffset;
if (atom1 <= 0 || atom1 > natoms ||
atom2 <= 0 || atom2 > natoms)
error->one(FLERR,"Invalid atom ID in Bonds section of molecule file");
if (itype <= 0)
error->one(FLERR,"Invalid bond type in Bonds section of molecule file");
if (flag) {
m = atom1-1;
nbondtypes = MAX(nbondtypes,itype);
bond_type[m][num_bond[m]] = itype;
bond_atom[m][num_bond[m]] = atom2;
num_bond[m]++;
if (newton_bond == 0) {
m = atom2-1;
bond_type[m][num_bond[m]] = itype;
bond_atom[m][num_bond[m]] = atom1;
num_bond[m]++;
}
} else {
count[atom1-1]++;
if (newton_bond == 0) count[atom2-1]++;
}
}
// bond_per_atom = max of count vector
if (flag == 0) {
bond_per_atom = 0;
for (int i = 0; i < natoms; i++)
bond_per_atom = MAX(bond_per_atom,count[i]);
}
}
/* ----------------------------------------------------------------------
read angles from file
store each with all 3 atoms if newton_bond = 0
if flag = 0, just count angles/atom
if flag = 1, store them with atoms
------------------------------------------------------------------------- */
void Molecule::angles(int flag, char *line)
{
int tmp,itype;
tagint m,atom1,atom2,atom3;
int newton_bond = force->newton_bond;
if (flag == 0)
for (int i = 0; i < natoms; i++) count[i] = 0;
else
for (int i = 0; i < natoms; i++) num_angle[i] = 0;
for (int i = 0; i < nangles; i++) {
readline(line);
if (i == 0) {
int nwords = atom->count_words(line);
if (nwords != 5)
error->all(FLERR,"Invalid Angles section in molecule file");
}
sscanf(line,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT,
&tmp,&itype,&atom1,&atom2,&atom3);
itype += aoffset;
if (atom1 <= 0 || atom1 > natoms ||
atom2 <= 0 || atom2 > natoms ||
atom3 <= 0 || atom3 > natoms)
error->one(FLERR,"Invalid atom ID in Angles section of molecule file");
if (itype <= 0)
error->one(FLERR,"Invalid angle type in Angles section of molecule file");
if (flag) {
m = atom2-1;
nangletypes = MAX(nangletypes,itype);
angle_type[m][num_angle[m]] = itype;
angle_atom1[m][num_angle[m]] = atom1;
angle_atom2[m][num_angle[m]] = atom2;
angle_atom3[m][num_angle[m]] = atom3;
num_angle[m]++;
if (newton_bond == 0) {
m = atom1-1;
angle_type[m][num_angle[m]] = itype;
angle_atom1[m][num_angle[m]] = atom1;
angle_atom2[m][num_angle[m]] = atom2;
angle_atom3[m][num_angle[m]] = atom3;
num_angle[m]++;
m = atom3-1;
angle_type[m][num_angle[m]] = itype;
angle_atom1[m][num_angle[m]] = atom1;
angle_atom2[m][num_angle[m]] = atom2;
angle_atom3[m][num_angle[m]] = atom3;
num_angle[m]++;
}
} else {
count[atom2-1]++;
if (newton_bond == 0) {
count[atom1-1]++;
count[atom3-1]++;
}
}
}
// angle_per_atom = max of count vector
if (flag == 0) {
angle_per_atom = 0;
for (int i = 0; i < natoms; i++)
angle_per_atom = MAX(angle_per_atom,count[i]);
}
}
/* ----------------------------------------------------------------------
read dihedrals from file
store each with all 4 atoms if newton_bond = 0
if flag = 0, just count dihedrals/atom
if flag = 1, store them with atoms
------------------------------------------------------------------------- */
void Molecule::dihedrals(int flag, char *line)
{
int tmp,itype;
tagint m,atom1,atom2,atom3,atom4;
int newton_bond = force->newton_bond;
if (flag == 0)
for (int i = 0; i < natoms; i++) count[i] = 0;
else
for (int i = 0; i < natoms; i++) num_dihedral[i] = 0;
for (int i = 0; i < ndihedrals; i++) {
readline(line);
if (i == 0) {
int nwords = atom->count_words(line);
if (nwords != 6)
error->all(FLERR,"Invalid Dihedrals section in molecule file");
}
sscanf(line,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT " "
TAGINT_FORMAT " " TAGINT_FORMAT " ",
&tmp,&itype,&atom1,&atom2,&atom3,&atom4);
itype += doffset;
if (atom1 <= 0 || atom1 > natoms ||
atom2 <= 0 || atom2 > natoms ||
atom3 <= 0 || atom3 > natoms ||
atom4 <= 0 || atom4 > natoms)
error->one(FLERR,
"Invalid atom ID in dihedrals section of molecule file");
if (itype <= 0)
error->one(FLERR,
"Invalid dihedral type in dihedrals section of molecule file");
if (flag) {
m = atom2-1;
ndihedraltypes = MAX(ndihedraltypes,itype);
dihedral_type[m][num_dihedral[m]] = itype;
dihedral_atom1[m][num_dihedral[m]] = atom1;
dihedral_atom2[m][num_dihedral[m]] = atom2;
dihedral_atom3[m][num_dihedral[m]] = atom3;
dihedral_atom4[m][num_dihedral[m]] = atom4;
num_dihedral[m]++;
if (newton_bond == 0) {
m = atom1-1;
dihedral_type[m][num_dihedral[m]] = itype;
dihedral_atom1[m][num_dihedral[m]] = atom1;
dihedral_atom2[m][num_dihedral[m]] = atom2;
dihedral_atom3[m][num_dihedral[m]] = atom3;
dihedral_atom4[m][num_dihedral[m]] = atom4;
num_dihedral[m]++;
m = atom3-1;
dihedral_type[m][num_dihedral[m]] = itype;
dihedral_atom1[m][num_dihedral[m]] = atom1;
dihedral_atom2[m][num_dihedral[m]] = atom2;
dihedral_atom3[m][num_dihedral[m]] = atom3;
dihedral_atom4[m][num_dihedral[m]] = atom4;
num_dihedral[m]++;
m = atom4-1;
dihedral_type[m][num_dihedral[m]] = itype;
dihedral_atom1[m][num_dihedral[m]] = atom1;
dihedral_atom2[m][num_dihedral[m]] = atom2;
dihedral_atom3[m][num_dihedral[m]] = atom3;
dihedral_atom4[m][num_dihedral[m]] = atom4;
num_dihedral[m]++;
}
} else {
count[atom2-1]++;
if (newton_bond == 0) {
count[atom1-1]++;
count[atom3-1]++;
count[atom4-1]++;
}
}
}
// dihedral_per_atom = max of count vector
if (flag == 0) {
dihedral_per_atom = 0;
for (int i = 0; i < natoms; i++)
dihedral_per_atom = MAX(dihedral_per_atom,count[i]);
}
}
/* ----------------------------------------------------------------------
read impropers from file
store each with all 4 atoms if newton_bond = 0
if flag = 0, just count impropers/atom
if flag = 1, store them with atoms
------------------------------------------------------------------------- */
void Molecule::impropers(int flag, char *line)
{
int tmp,itype;
tagint m,atom1,atom2,atom3,atom4;
int newton_bond = force->newton_bond;
if (flag == 0)
for (int i = 0; i < natoms; i++) count[i] = 0;
else
for (int i = 0; i < natoms; i++) num_improper[i] = 0;
for (int i = 0; i < nimpropers; i++) {
readline(line);
if (i == 0) {
int nwords = atom->count_words(line);
if (nwords != 6)
error->all(FLERR,"Invalid Impropers section in molecule file");
}
sscanf(line,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT " "
TAGINT_FORMAT " " TAGINT_FORMAT " ",
&tmp,&itype,&atom1,&atom2,&atom3,&atom4);
itype += ioffset;
if (atom1 <= 0 || atom1 > natoms ||
atom2 <= 0 || atom2 > natoms ||
atom3 <= 0 || atom3 > natoms ||
atom4 <= 0 || atom4 > natoms)
error->one(FLERR,
"Invalid atom ID in impropers section of molecule file");
if (itype <= 0)
error->one(FLERR,
"Invalid improper type in impropers section of molecule file");
if (flag) {
m = atom2-1;
nimpropertypes = MAX(nimpropertypes,itype);
improper_type[m][num_improper[m]] = itype;
improper_atom1[m][num_improper[m]] = atom1;
improper_atom2[m][num_improper[m]] = atom2;
improper_atom3[m][num_improper[m]] = atom3;
improper_atom4[m][num_improper[m]] = atom4;
num_improper[m]++;
if (newton_bond == 0) {
m = atom1-1;
improper_type[m][num_improper[m]] = itype;
improper_atom1[m][num_improper[m]] = atom1;
improper_atom2[m][num_improper[m]] = atom2;
improper_atom3[m][num_improper[m]] = atom3;
improper_atom4[m][num_improper[m]] = atom4;
num_improper[m]++;
m = atom3-1;
improper_type[m][num_improper[m]] = itype;
improper_atom1[m][num_improper[m]] = atom1;
improper_atom2[m][num_improper[m]] = atom2;
improper_atom3[m][num_improper[m]] = atom3;
improper_atom4[m][num_improper[m]] = atom4;
num_improper[m]++;
m = atom4-1;
improper_type[m][num_improper[m]] = itype;
improper_atom1[m][num_improper[m]] = atom1;
improper_atom2[m][num_improper[m]] = atom2;
improper_atom3[m][num_improper[m]] = atom3;
improper_atom4[m][num_improper[m]] = atom4;
num_improper[m]++;
}
} else {
count[atom2-1]++;
if (newton_bond == 0) {
count[atom1-1]++;
count[atom3-1]++;
count[atom4-1]++;
}
}
}
// improper_per_atom = max of count vector
if (flag == 0) {
improper_per_atom = 0;
for (int i = 0; i < natoms; i++)
improper_per_atom = MAX(improper_per_atom,count[i]);
}
}
/* ----------------------------------------------------------------------
read 3 special bonds counts from file
if flag = 0, just tally maxspecial
if flag = 1, store them with atoms
------------------------------------------------------------------------- */
void Molecule::nspecial_read(int flag, char *line)
{
int tmp,c1,c2,c3;
if (flag == 0) maxspecial = 0;
for (int i = 0; i < natoms; i++) {
readline(line);
if (i == 0) {
int nwords = atom->count_words(line);
if (nwords != 4)
error->all(FLERR,"Invalid Special Bond Counts section in "
"molecule file");
}
sscanf(line,"%d %d %d %d",&tmp,&c1,&c2,&c3);
if (flag) {
nspecial[i][0] = c1;
nspecial[i][1] = c1+c2;
nspecial[i][2] = c1+c2+c3;
} else maxspecial = MAX(maxspecial,c1+c2+c3);
}
}
/* ----------------------------------------------------------------------
read special bond indices from file
------------------------------------------------------------------------- */
void Molecule::special_read(char *line)
{
int m,nwords;
char **words = new char*[maxspecial+1];
for (int i = 0; i < natoms; i++) {
readline(line);
nwords = parse(line,words,maxspecial+1);
if (nwords != nspecial[i][2]+1)
error->all(FLERR,"Molecule file special list "
"does not match special count");
for (m = 1; m < nwords; m++) {
special[i][m-1] = ATOTAGINT(words[m]);
if (special[i][m-1] <= 0 || special[i][m-1] > natoms ||
special[i][m-1] == i+1)
error->all(FLERR,"Invalid special atom index in molecule file");
}
}
delete [] words;
}
/* ----------------------------------------------------------------------
auto generate special bond info
------------------------------------------------------------------------- */
void Molecule::special_generate()
{
int newton_bond = force->newton_bond;
tagint atom1,atom2;
int count[natoms];
for (int i = 0; i < natoms; i++) count[i] = 0;
// 1-2 neighbors
if (newton_bond) {
for (int i = 0; i < natoms; i++) {
for (int j = 0; j < num_bond[i]; j++) {
atom1 = i;
atom2 = bond_atom[i][j]-1;
nspecial[i][0]++;
nspecial[atom2][0]++;
if (count[i] >= maxspecial || count[atom2] >= maxspecial)
error->one(FLERR,"Molecule auto special bond generation overflow");
special[i][count[i]++] = atom2 + 1;
special[atom2][count[atom2]++] = i + 1;
}
}
} else {
for (int i = 0; i < natoms; i++) {
nspecial[i][0] = num_bond[i];
for (int j = 0; j < num_bond[i]; j++) {
atom1 = i;
atom2 = bond_atom[i][j];
if (count[atom1] >= maxspecial)
error->one(FLERR,"");
special[i][count[atom1]++] = atom2;
}
}
}
// 1-3 neighbors with no duplicates
for (int i = 0; i < natoms; i++) nspecial[i][1] = nspecial[i][0];
int dedup;
for (int i = 0; i < natoms; i++) {
for (int m = 0; m < nspecial[i][0]; m++) {
for (int j = 0; j < nspecial[special[i][m]-1][0]; j++) {
dedup = 0;
for (int k =0; k < count[i]; k++) {
if (special[special[i][m]-1][j] == special[i][k] ||
special[special[i][m]-1][j] == i+1) {
dedup = 1;
}
}
if (!dedup) {
if (count[i] >= maxspecial)
error->one(FLERR,"");
special[i][count[i]++] = special[special[i][m]-1][j];
nspecial[i][1]++;
}
}
}
}
// 1-4 neighbors with no duplicates
for (int i = 0; i < natoms; i++) nspecial[i][2] = nspecial[i][1];
for (int i = 0; i < natoms; i++) {
for (int m = nspecial[i][0]; m < nspecial[i][1]; m++) {
for (int j = 0; j < nspecial[special[i][m]-1][0]; j++) {
dedup = 0;
for (int k =0; k < count[i]; k++) {
if (special[special[i][m]-1][j] == special[i][k] ||
special[special[i][m]-1][j] == i+1) {
dedup = 1;
}
}
if (!dedup) {
if (count[i] >= maxspecial)
error->one(FLERR,"");
special[i][count[i]++] = special[special[i][m]-1][j];
nspecial[i][2]++;
}
}
}
}
}
/* ----------------------------------------------------------------------
read SHAKE flags from file
------------------------------------------------------------------------- */
void Molecule::shakeflag_read(char *line)
{
int tmp;
for (int i = 0; i < natoms; i++) {
readline(line);
sscanf(line,"%d %d",&tmp,&shake_flag[i]);
}
for (int i = 0; i < natoms; i++)
if (shake_flag[i] < 0 || shake_flag[i] > 4)
error->all(FLERR,"Invalid shake flag in molecule file");
}
/* ----------------------------------------------------------------------
read SHAKE atom info from file
------------------------------------------------------------------------- */
void Molecule::shakeatom_read(char *line)
{
int tmp;
for (int i = 0; i < natoms; i++) {
readline(line);
if (shake_flag[i] == 1)
sscanf(line,"%d " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT,
&tmp,&shake_atom[i][0],&shake_atom[i][1],&shake_atom[i][2]);
else if (shake_flag[i] == 2)
sscanf(line,"%d " TAGINT_FORMAT " " TAGINT_FORMAT,
&tmp,&shake_atom[i][0],&shake_atom[i][1]);
else if (shake_flag[i] == 3)
sscanf(line,"%d " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT,
&tmp,&shake_atom[i][0],&shake_atom[i][1],&shake_atom[i][2]);
else if (shake_flag[i] == 4)
sscanf(line,"%d " TAGINT_FORMAT " " TAGINT_FORMAT " "
TAGINT_FORMAT " " TAGINT_FORMAT,
&tmp,&shake_atom[i][0],&shake_atom[i][1],
&shake_atom[i][2],&shake_atom[i][3]);
}
for (int i = 0; i < natoms; i++) {
int m = shake_flag[i];
if (m == 1) m = 3;
for (int j = 0; j < m; j++)
if (shake_atom[i][j] <= 0 || shake_atom[i][j] > natoms)
error->all(FLERR,"Invalid shake atom in molecule file");
}
}
/* ----------------------------------------------------------------------
read SHAKE bond type info from file
------------------------------------------------------------------------- */
void Molecule::shaketype_read(char *line)
{
int tmp;
for (int i = 0; i < natoms; i++) {
readline(line);
if (shake_flag[i] == 1)
sscanf(line,"%d %d %d %d",&tmp,
&shake_type[i][0],&shake_type[i][1],&shake_type[i][2]);
else if (shake_flag[i] == 2)
sscanf(line,"%d %d",&tmp,&shake_type[i][0]);
else if (shake_flag[i] == 3)
sscanf(line,"%d %d %d",&tmp,&shake_type[i][0],&shake_type[i][1]);
else if (shake_flag[i] == 4)
sscanf(line,"%d %d %d %d",&tmp,
&shake_type[i][0],&shake_type[i][1],&shake_type[i][2]);
}
for (int i = 0; i < natoms; i++) {
int m = shake_flag[i];
if (m == 1) m = 3;
for (int j = 0; j < m-1; j++)
if (shake_type[i][j] <= 0)
error->all(FLERR,"Invalid shake bond type in molecule file");
if (shake_flag[i] == 1)
if (shake_type[i][2] <= 0)
error->all(FLERR,"Invalid shake angle type in molecule file");
}
}
+/* ----------------------------------------------------------------------
+ read body params from file
+ pflag = 0/1 for integer/double params
+------------------------------------------------------------------------- */
+
+void Molecule::body(int flag, int pflag, char *line)
+{
+ int i,ncount;
+
+ int nparam = nibody;
+ if (pflag) nparam = ndbody;
+
+ int nword = 0;
+ while (nword < nparam) {
+ readline(line);
+
+ ncount = atom->count_words(line);
+ if (ncount == 0)
+ error->one(FLERR,"Too few values in body section of molecule file");
+ if (nword+ncount > nparam)
+ error->all(FLERR,"Too many values in body section of molecule file");
+
+ if (flag) {
+ if (pflag == 0) {
+ ibodyparams[nword++] = force->inumeric(FLERR,strtok(line," \t\n\r\f"));
+ for (i = 1; i < ncount; i++)
+ ibodyparams[nword++] =
+ force->inumeric(FLERR,strtok(NULL," \t\n\r\f"));
+ } else {
+ dbodyparams[nword++] = force->numeric(FLERR,strtok(line," \t\n\r\f"));
+ for (i = 1; i < ncount; i++)
+ dbodyparams[nword++] =
+ force->numeric(FLERR,strtok(NULL," \t\n\r\f"));
+ }
+ } else nword += ncount;
+ }
+}
+
/* ----------------------------------------------------------------------
error check molecule attributes and topology against system settings
flag = 0, just check this molecule
flag = 1, check all molecules in set, this is 1st molecule in set
------------------------------------------------------------------------- */
void Molecule::check_attributes(int flag)
{
int n = 1;
if (flag) n = nset;
int imol = atom->find_molecule(id);
for (int i = imol; i < imol+n; i++) {
Molecule *onemol = atom->molecules[imol];
// check per-atom attributes of molecule
// warn if not a match
int mismatch = 0;
if (onemol->qflag && !atom->q_flag) mismatch = 1;
if (onemol->radiusflag && !atom->radius_flag) mismatch = 1;
if (onemol->rmassflag && !atom->rmass_flag) mismatch = 1;
if (mismatch && me == 0)
error->warning(FLERR,
"Molecule attributes do not match system attributes");
// for all atom styles, check nbondtype,etc
mismatch = 0;
if (atom->nbondtypes < onemol->nbondtypes) mismatch = 1;
if (atom->nangletypes < onemol->nangletypes) mismatch = 1;
if (atom->ndihedraltypes < onemol->ndihedraltypes) mismatch = 1;
if (atom->nimpropertypes < onemol->nimpropertypes) mismatch = 1;
if (mismatch)
error->all(FLERR,"Molecule topology type exceeds system topology type");
// for molecular atom styles, check bond_per_atom,etc + maxspecial
// do not check for atom style template, since nothing stored per atom
if (atom->molecular == 1) {
if (atom->avec->bonds_allow &&
atom->bond_per_atom < onemol->bond_per_atom) mismatch = 1;
if (atom->avec->angles_allow &&
atom->angle_per_atom < onemol->angle_per_atom) mismatch = 1;
if (atom->avec->dihedrals_allow &&
atom->dihedral_per_atom < onemol->dihedral_per_atom) mismatch = 1;
if (atom->avec->impropers_allow &&
atom->improper_per_atom < onemol->improper_per_atom) mismatch = 1;
if (atom->maxspecial < onemol->maxspecial) mismatch = 1;
if (mismatch)
error->all(FLERR,"Molecule toplogy/atom exceeds system topology/atom");
}
// warn if molecule topology defined but no special settings
if (onemol->bondflag && !onemol->specialflag)
if (me == 0) error->warning(FLERR,"Molecule has bond topology "
"but no special bond settings");
}
}
/* ----------------------------------------------------------------------
init all data structures to empty
------------------------------------------------------------------------- */
void Molecule::initialize()
{
natoms = 0;
nbonds = nangles = ndihedrals = nimpropers = 0;
ntypes = 0;
nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0;
+ nibody = ndbody = 0;
bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0;
maxspecial = 0;
xflag = typeflag = qflag = radiusflag = rmassflag = 0;
bondflag = angleflag = dihedralflag = improperflag = 0;
nspecialflag = specialflag = 0;
shakeflag = shakeflagflag = shakeatomflag = shaketypeflag = 0;
+ bodyflag = ibodyflag = dbodyflag = 0;
centerflag = massflag = comflag = inertiaflag = 0;
tag_require = 0;
x = NULL;
type = NULL;
q = NULL;
radius = NULL;
rmass = NULL;
num_bond = NULL;
bond_type = NULL;
bond_atom = NULL;
num_angle = NULL;
angle_type = NULL;
angle_atom1 = angle_atom2 = angle_atom3 = NULL;
num_dihedral = NULL;
dihedral_type = NULL;
dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = NULL;
num_improper = NULL;
improper_type = NULL;
improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = NULL;
nspecial = NULL;
special = NULL;
shake_flag = NULL;
shake_atom = NULL;
shake_type = NULL;
+ ibodyparams = NULL;
+ dbodyparams = NULL;
+
dx = NULL;
dxcom = NULL;
dxbody = NULL;
}
/* ----------------------------------------------------------------------
allocate all data structures
also initialize values for data structures that are always allocated
------------------------------------------------------------------------- */
void Molecule::allocate()
{
if (xflag) memory->create(x,natoms,3,"molecule:x");
if (typeflag) memory->create(type,natoms,"molecule:type");
if (qflag) memory->create(q,natoms,"molecule:q");
if (radiusflag) memory->create(radius,natoms,"molecule:radius");
if (rmassflag) memory->create(rmass,natoms,"molecule:rmass");
// always allocate num_bond,num_angle,etc and special+nspecial
// even if not in molecule file, initialize to 0
// this is so methods that use these arrays don't have to check they exist
memory->create(num_bond,natoms,"molecule:num_bond");
for (int i = 0; i < natoms; i++) num_bond[i] = 0;
memory->create(num_angle,natoms,"molecule:num_angle");
for (int i = 0; i < natoms; i++) num_angle[i] = 0;
memory->create(num_dihedral,natoms,"molecule:num_dihedral");
for (int i = 0; i < natoms; i++) num_dihedral[i] = 0;
memory->create(num_improper,natoms,"molecule:num_improper");
for (int i = 0; i < natoms; i++) num_improper[i] = 0;
memory->create(special,natoms,maxspecial,"molecule:special");
memory->create(nspecial,natoms,3,"molecule:nspecial");
for (int i = 0; i < natoms; i++)
nspecial[i][0] = nspecial[i][1] = nspecial[i][2] = 0;
if (bondflag) {
memory->create(bond_type,natoms,bond_per_atom,
"molecule:bond_type");
memory->create(bond_atom,natoms,bond_per_atom,
"molecule:bond_atom");
}
if (angleflag) {
memory->create(angle_type,natoms,angle_per_atom,
"molecule:angle_type");
memory->create(angle_atom1,natoms,angle_per_atom,
"molecule:angle_atom1");
memory->create(angle_atom2,natoms,angle_per_atom,
"molecule:angle_atom2");
memory->create(angle_atom3,natoms,angle_per_atom,
"molecule:angle_atom3");
}
if (dihedralflag) {
memory->create(dihedral_type,natoms,dihedral_per_atom,
"molecule:dihedral_type");
memory->create(dihedral_atom1,natoms,dihedral_per_atom,
"molecule:dihedral_atom1");
memory->create(dihedral_atom2,natoms,dihedral_per_atom,
"molecule:dihedral_atom2");
memory->create(dihedral_atom3,natoms,dihedral_per_atom,
"molecule:dihedral_atom3");
memory->create(dihedral_atom4,natoms,dihedral_per_atom,
"molecule:dihedral_atom4");
}
if (improperflag) {
memory->create(improper_type,natoms,improper_per_atom,
"molecule:improper_type");
memory->create(improper_atom1,natoms,improper_per_atom,
"molecule:improper_atom1");
memory->create(improper_atom2,natoms,improper_per_atom,
"molecule:improper_atom2");
memory->create(improper_atom3,natoms,improper_per_atom,
"molecule:improper_atom3");
memory->create(improper_atom4,natoms,improper_per_atom,
"molecule:improper_atom4");
}
if (shakeflag) {
memory->create(shake_flag,natoms,"molecule:shake_flag");
memory->create(shake_atom,natoms,4,"molecule:shake_flag");
memory->create(shake_type,natoms,3,"molecule:shake_flag");
}
+
+ if (bodyflag) {
+ if (nibody) memory->create(ibodyparams,nibody,"molecule:ibodyparams");
+ if (ndbody) memory->create(dbodyparams,ndbody,"molecule:dbodyparams");
+ }
}
/* ----------------------------------------------------------------------
deallocate all data structures
------------------------------------------------------------------------- */
void Molecule::deallocate()
{
memory->destroy(x);
memory->destroy(type);
memory->destroy(q);
memory->destroy(radius);
memory->destroy(rmass);
memory->destroy(num_bond);
memory->destroy(bond_type);
memory->destroy(bond_atom);
memory->destroy(num_angle);
memory->destroy(angle_type);
memory->destroy(angle_atom1);
memory->destroy(angle_atom2);
memory->destroy(angle_atom3);
memory->destroy(num_dihedral);
memory->destroy(dihedral_type);
memory->destroy(dihedral_atom1);
memory->destroy(dihedral_atom2);
memory->destroy(dihedral_atom3);
memory->destroy(dihedral_atom4);
memory->destroy(num_improper);
memory->destroy(improper_type);
memory->destroy(improper_atom1);
memory->destroy(improper_atom2);
memory->destroy(improper_atom3);
memory->destroy(improper_atom4);
memory->destroy(nspecial);
memory->destroy(special);
memory->destroy(shake_flag);
memory->destroy(shake_atom);
memory->destroy(shake_type);
memory->destroy(dx);
memory->destroy(dxcom);
memory->destroy(dxbody);
+
+ memory->destroy(ibodyparams);
+ memory->destroy(dbodyparams);
}
/* ----------------------------------------------------------------------
open molecule file
------------------------------------------------------------------------- */
void Molecule::open(char *file)
{
fp = fopen(file,"r");
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open molecule file %s",file);
error->one(FLERR,str);
}
}
/* ----------------------------------------------------------------------
read and bcast a line
------------------------------------------------------------------------- */
void Molecule::readline(char *line)
{
int n;
if (me == 0) {
if (fgets(line,MAXLINE,fp) == NULL) n = 0;
else n = strlen(line) + 1;
}
MPI_Bcast(&n,1,MPI_INT,0,world);
if (n == 0) error->all(FLERR,"Unexpected end of molecule file");
MPI_Bcast(line,n,MPI_CHAR,0,world);
}
/* ----------------------------------------------------------------------
extract keyword from line
flag = 0, read and bcast line
flag = 1, line has already been read
------------------------------------------------------------------------- */
void Molecule::parse_keyword(int flag, char *line, char *keyword)
{
if (flag) {
// read upto non-blank line plus 1 following line
// eof is set to 1 if any read hits end-of-file
int eof = 0;
if (me == 0) {
if (fgets(line,MAXLINE,fp) == NULL) eof = 1;
while (eof == 0 && strspn(line," \t\n\r") == strlen(line)) {
if (fgets(line,MAXLINE,fp) == NULL) eof = 1;
}
if (fgets(keyword,MAXLINE,fp) == NULL) eof = 1;
}
// if eof, set keyword empty and return
MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) {
keyword[0] = '\0';
return;
}
// bcast keyword line to all procs
int n;
if (me == 0) n = strlen(line) + 1;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
}
// copy non-whitespace portion of line into keyword
int start = strspn(line," \t\n\r");
int stop = strlen(line) - 1;
while (line[stop] == ' ' || line[stop] == '\t'
|| line[stop] == '\n' || line[stop] == '\r') stop--;
line[stop+1] = '\0';
strcpy(keyword,&line[start]);
}
/* ----------------------------------------------------------------------
skip N lines of file
------------------------------------------------------------------------- */
void Molecule::skip_lines(int n, char *line)
{
for (int i = 0; i < n; i++) readline(line);
}
/* ----------------------------------------------------------------------
parse line into words separated by whitespace
return # of words
max = max pointers storable in words
------------------------------------------------------------------------- */
int Molecule::parse(char *line, char **words, int max)
{
char *ptr;
int nwords = 0;
words[nwords++] = strtok(line," \t\n\r\f");
while ((ptr = strtok(NULL," \t\n\r\f"))) {
if (nwords < max) words[nwords] = ptr;
nwords++;
}
return nwords;
}
/* ----------------------------------------------------------------------
proc 0 prints molecule params
------------------------------------------------------------------------- */
/*
void Molecule::print()
{
printf("MOLECULE %s\n",id);
printf(" %d natoms\n",natoms);
if (nbonds) printf(" %d nbonds\n",nbonds);
if (nangles) printf(" %d nangles\n",nangles);
if (ndihedrals) printf(" %d ndihedrals\n",ndihedrals);
if (nimpropers) printf(" %d nimpropers\n",nimpropers);
if (xflag) {
printf( "Coords:\n");
for (int i = 0; i < natoms; i++)
printf(" %d %g %g %g\n",i+1,x[i][0],x[i][1],x[i][2]);
}
if (typeflag) {
printf( "Types:\n");
for (int i = 0; i < natoms; i++)
printf(" %d %d\n",i+1,type[i]);
}
if (qflag) {
printf( "Charges:\n");
for (int i = 0; i < natoms; i++)
printf(" %d %g\n",i+1,q[i]);
}
if (radiusflag) {
printf( "Radii:\n");
for (int i = 0; i < natoms; i++)
printf(" %d %g\n",i+1,radius[i]);
}
if (rmassflag) {
printf( "Masses:\n");
for (int i = 0; i < natoms; i++)
printf(" %d %g\n",i+1,rmass[i]);
}
if (bondflag) {
printf( "Bonds:\n");
for (int i = 0; i < natoms; i++) {
printf(" %d %d\n",i+1,num_bond[i]);
for (int j = 0; j < num_bond[i]; j++)
printf(" %d %d %d %d\n",j+1,bond_type[i][j],i+1,bond_atom[i][j]);
}
}
if (angleflag) {
printf( "Angles:\n");
for (int i = 0; i < natoms; i++) {
printf(" %d %d\n",i+1,num_angle[i]);
for (int j = 0; j < num_angle[i]; j++)
printf(" %d %d %d %d %d\n",
j+1,angle_type[i][j],
angle_atom1[i][j],angle_atom2[i][j],angle_atom3[i][j]);
}
}
if (dihedralflag) {
printf( "Dihedrals:\n");
for (int i = 0; i < natoms; i++) {
printf(" %d %d\n",i+1,num_dihedral[i]);
for (int j = 0; j < num_dihedral[i]; j++)
printf(" %d %d %d %d %d %d\n",
j+1,dihedral_type[i][j],
dihedral_atom1[i][j],dihedral_atom2[i][j],
dihedral_atom3[i][j],dihedral_atom4[i][j]);
}
}
if (improperflag) {
printf( "Impropers:\n");
for (int i = 0; i < natoms; i++) {
printf(" %d %d\n",i+1,num_improper[i]);
for (int j = 0; j < num_improper[i]; j++)
printf(" %d %d %d %d %d %d\n",
j+1,improper_type[i][j],
improper_atom1[i][j],improper_atom2[i][j],
improper_atom3[i][j],improper_atom4[i][j]);
}
}
if (specialflag) {
printf( "Special neighs:\n");
for (int i = 0; i < natoms; i++) {
printf(" %d %d %d %d\n",i+1,
nspecial[i][0],nspecial[i][1]-nspecial[i][0],
nspecial[i][2]-nspecial[i][1]);
printf(" ");
for (int j = 0; j < nspecial[i][2]; j++)
printf(" %d",special[i][j]);
printf("\n");
}
}
}
*/
diff --git a/src/molecule.h b/src/molecule.h
index 35b25edf8..5f45a47d2 100644
--- a/src/molecule.h
+++ b/src/molecule.h
@@ -1,320 +1,331 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_ONE_MOLECULE_H
#define LMP_ONE_MOLECULE_H
#include "pointers.h"
namespace LAMMPS_NS {
class Molecule : protected Pointers {
public:
char *id; // template id of this molecule, same for all molecules in set
int nset; // if first in set, # of molecules in this set
// else 0 if not first in set
int last; // 1 if last molecule in set, else 0
// number of atoms,bonds,etc in molecule
+ // nibody,ndbody = # of integer/double fields in body
int natoms;
int nbonds,nangles,ndihedrals,nimpropers;
int ntypes;
int nbondtypes,nangletypes,ndihedraltypes,nimpropertypes;
+ int nibody,ndbody;
// max bond,angle,etc per atom
int bond_per_atom,angle_per_atom,dihedral_per_atom,improper_per_atom;
int maxspecial;
// 1 if attribute defined in file, 0 if not
int xflag,typeflag,qflag,radiusflag,rmassflag;
int bondflag,angleflag,dihedralflag,improperflag;
int nspecialflag,specialflag;
int shakeflag,shakeflagflag,shakeatomflag,shaketypeflag;
+ int bodyflag,ibodyflag,dbodyflag;
// 1 if attribute defined or computed, 0 if not
int centerflag,massflag,comflag,inertiaflag;
// 1 if molecule fields require atom IDs
int tag_require;
// attributes
double **x; // displacement of each atom from origin
int *type; // type of each atom
double *q; // charge on each atom
double *radius; // radius of each atom
double *rmass; // mass of each atom
int *num_bond; // bonds, angles, dihedrals, impropers for each atom
int **bond_type;
tagint **bond_atom;
int *num_angle;
int **angle_type;
tagint **angle_atom1,**angle_atom2,**angle_atom3;
int *num_dihedral;
int **dihedral_type;
tagint **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
int *num_improper;
int **improper_type;
tagint **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
int **nspecial;
tagint **special;
int *shake_flag;
tagint **shake_atom;
int **shake_type;
+ class AtomVecBody *avec_body;
+ int *ibodyparams; // integer and double body params
+ double *dbodyparams;
+
double center[3]; // geometric center of molecule
double masstotal; // total mass of molecule
double com[3]; // center of mass of molecule
double itensor[6]; // moments of inertia of molecule
double inertia[3]; // principal moments of inertia of molecule
double ex[3],ey[3],ez[3]; // principal axes of molecule in space coords
double quat[4]; // quaternion for orientation of molecule
double maxradius; // max radius of any atom in molecule
double molradius; // radius of molecule from geometric center
// including finite-size particle radii
int comatom; // index (1-Natom) of atom closest to COM
double maxextent; // furthest any atom in molecule is from comatom
double **dx; // displacement of each atom relative to center
double **dxcom; // displacement of each atom relative to COM
double **dxbody; // displacement of each atom relative to COM
// in body frame (diagonalized interia tensor)
+ double *quat_external; // orientation imposed by external class
+ // e.g. FixPour or CreateAtoms
+
Molecule(class LAMMPS *, int, char **, int &);
~Molecule();
void compute_center();
void compute_mass();
void compute_com();
void compute_inertia();
void check_attributes(int);
private:
int me;
FILE *fp;
int *count;
int toffset,boffset,aoffset,doffset,ioffset;
int autospecial;
double sizescale;
-
+
void read(int);
void coords(char *);
void types(char *);
void charges(char *);
void diameters(char *);
void masses(char *);
void bonds(int, char *);
void angles(int, char *);
void dihedrals(int, char *);
void impropers(int, char *);
void nspecial_read(int, char *);
void special_read(char *);
void special_generate();
void shakeflag_read(char *);
void shakeatom_read(char *);
void shaketype_read(char *);
+ void body(int, int, char *);
void initialize();
void allocate();
void deallocate();
void open(char *);
void readline(char *);
void parse_keyword(int, char *, char *);
void skip_lines(int, char *);
int parse(char *, char **, int);
// void print();
};
}
#endif
/* ERROR/WARNING messages:
E: Molecule template ID must be alphanumeric or underscore characters
Self-explanatory.
E: Insufficient Jacobi rotations for rigid molecule
Eigensolve for rigid body was not sufficiently accurate.
E: Unexpected end of molecule file
Self-explanatory.
E: Molecule file z center-of-mass must be 0.0 for 2d
Self-explanatory.
E: No atom count in molecule file
Self-explanatory.
E: Molecule file has bonds but no nbonds setting
Self-explanatory.
E: Molecule file has angles but no nangles setting
Self-explanatory.
E: Molecule file has dihedrals but no ndihedrals setting
Self-explanatory.
E: Molecule file has impropers but no nimpropers setting
Self-explanatory.
E: Molecule file shake flags not before shake atoms
The order of the two sections is important.
E: Molecule file shake flags not before shake bonds
The order of the two sections is important.
E: Unknown section in molecule file
Self-explanatory.
E: Molecule file needs both Special Bond sections
Self-explanatory.
E: Molecule file has special flags but no bonds
Self-explanatory.
E: Molecule file has bonds but no special flags
Self-explanatory.
E: Molecule file shake info is incomplete
All 3 SHAKE sections are needed.
E: Molecule file z coord must be 0.0 for 2d
Self-explanatory.
E: Invalid atom type in molecule file
Atom types must range from 1 to specified # of types.
E: Invalid atom diameter in molecule file
Diameters must be >= 0.0.
E: Invalid atom mass in molecule file
Masses must be > 0.0.
E: Invalid atom ID in Bonds section of molecule file
Self-explanatory.
E: Invalid bond type in Bonds section of molecule file
Self-explanatory.
E: Invalid atom ID in Angles section of molecule file
Self-explanatory.
E: Invalid angle type in Angles section of molecule file
Self-explanatory.
E: Invalid atom ID in dihedrals section of molecule file
Self-explanatory.
E: Invalid dihedral type in dihedrals section of molecule file
Self-explanatory.
E: Invalid atom ID in impropers section of molecule file
Self-explanatory.
E: Invalid improper type in impropers section of molecule file
Self-explanatory.
E: Molecule file special list does not match special count
The number of values in an atom's special list does not match count.
E: Invalid special atom index in molecule file
Self-explanatory.
E: Invalid shake flag in molecule file
Self-explanatory.
E: Invalid shake atom in molecule file
Self-explanatory.
E: Invalid shake bond type in molecule file
Self-explanatory.
E: Invalid shake angle type in molecule file
Self-explanatory.
W: Molecule attributes do not match system attributes
An attribute is specified (e.g. diameter, charge) that is
not defined for the specified atom style.
E: Molecule topology type exceeds system topology type
The number of bond, angle, etc types in the molecule exceeds the
system setting. See the create_box command for how to specify these
values.
E: Molecule toplogy/atom exceeds system topology/atom
The number of bonds, angles, etc per-atom in the molecule exceeds the
system setting. See the create_box command for how to specify these
values.
W: Molecule has bond topology but no special bond settings
This means the bonded atoms will not be excluded in pair-wise
interactions.
E: Cannot open molecule file %s
The specified file cannot be opened. Check that the path and name are
correct.
*/
diff --git a/src/pair.h b/src/pair.h
index 86b07ece4..9927c0423 100644
--- a/src/pair.h
+++ b/src/pair.h
@@ -1,342 +1,354 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_PAIR_H
#define LMP_PAIR_H
#include "pointers.h"
#include "accelerator_kokkos.h"
namespace LAMMPS_NS {
class Pair : protected Pointers {
friend class AngleSDK;
friend class AngleSDKOMP;
friend class BondQuartic;
friend class BondQuarticOMP;
friend class DihedralCharmm;
friend class DihedralCharmmOMP;
friend class FixGPU;
friend class FixOMP;
friend class ThrOMP;
friend class Info;
public:
static int instance_total; // # of Pair classes ever instantiated
double eng_vdwl,eng_coul; // accumulated energies
double virial[6]; // accumulated virial
double *eatom,**vatom; // accumulated per-atom energy/virial
double cutforce; // max cutoff for all atom pairs
double **cutsq; // cutoff sq for each atom pair
int **setflag; // 0/1 = whether each i,j has been set
int comm_forward; // size of forward communication (0 if none)
int comm_reverse; // size of reverse communication (0 if none)
int comm_reverse_off; // size of reverse comm even if newton off
int single_enable; // 1 if single() routine exists
int restartinfo; // 1 if pair style writes restart info
int respa_enable; // 1 if inner/middle/outer rRESPA routines
int one_coeff; // 1 if allows only one coeff * * call
int manybody_flag; // 1 if a manybody potential
int no_virial_fdotr_compute; // 1 if does not invoke virial_fdotr_compute()
int writedata; // 1 if writes coeffs to data file
int ghostneigh; // 1 if pair style needs neighbors of ghosts
double **cutghost; // cutoff for each ghost pair
int ewaldflag; // 1 if compatible with Ewald solver
int pppmflag; // 1 if compatible with PPPM solver
int msmflag; // 1 if compatible with MSM solver
int dispersionflag; // 1 if compatible with LJ/dispersion solver
int tip4pflag; // 1 if compatible with TIP4P solver
int dipoleflag; // 1 if compatible with dipole solver
int reinitflag; // 1 if compatible with fix adapt and alike
int tail_flag; // pair_modify flag for LJ tail correction
double etail,ptail; // energy/pressure tail corrections
double etail_ij,ptail_ij;
int evflag; // energy,virial settings
int eflag_either,eflag_global,eflag_atom;
int vflag_either,vflag_global,vflag_atom;
int ncoultablebits; // size of Coulomb table, accessed by KSpace
int ndisptablebits; // size of dispersion table
double tabinnersq;
double tabinnerdispsq;
double *rtable,*drtable,*ftable,*dftable,*ctable,*dctable;
double *etable,*detable,*ptable,*dptable,*vtable,*dvtable;
double *rdisptable, *drdisptable, *fdisptable, *dfdisptable;
double *edisptable, *dedisptable;
int ncoulshiftbits,ncoulmask;
int ndispshiftbits, ndispmask;
int nextra; // # of extra quantities pair style calculates
double *pvector; // vector of extra pair quantities
int single_extra; // number of extra single values calculated
double *svector; // vector of extra single quantities
class NeighList *list; // standard neighbor list used by most pairs
class NeighList *listhalf; // half list used by some pairs
class NeighList *listfull; // full list used by some pairs
class NeighList *listgranhistory; // granular history list used by some pairs
class NeighList *listinner; // rRESPA lists used by some pairs
class NeighList *listmiddle;
class NeighList *listouter;
unsigned int datamask;
unsigned int datamask_ext;
int allocated; // 0/1 = whether arrays are allocated
// public so external driver can check
int compute_flag; // 0 if skip compute()
// KOKKOS host/device flag and data masks
ExecutionSpace execution_space;
unsigned int datamask_read,datamask_modify;
Pair(class LAMMPS *);
virtual ~Pair();
// top-level Pair methods
void init();
virtual void reinit();
+ virtual void setup() {}
double mix_energy(double, double, double, double);
double mix_distance(double, double);
void write_file(int, char **);
void init_bitmap(double, double, int, int &, int &, int &, int &);
virtual void modify_params(int, char **);
void compute_dummy(int, int);
// need to be public, so can be called by pair_style reaxc
void v_tally(int, double *, double *);
void ev_tally(int, int, int, int, double, double, double,
double, double, double);
void ev_tally3(int, int, int, double, double,
double *, double *, double *, double *);
void v_tally3(int, int, int, double *, double *, double *, double *);
void v_tally4(int, int, int, int, double *, double *, double *,
double *, double *, double *);
void ev_tally_xyz(int, int, int, int, double, double,
double, double, double, double, double, double);
// general child-class methods
virtual void compute(int, int) = 0;
virtual void compute_inner() {}
virtual void compute_middle() {}
virtual void compute_outer(int, int) {}
virtual double single(int, int, int, int,
double, double, double,
double& fforce) {
fforce = 0.0;
return 0.0;
}
virtual void settings(int, char **) = 0;
virtual void coeff(int, char **) = 0;
virtual void init_style();
virtual void init_list(int, class NeighList *);
virtual double init_one(int, int) {return 0.0;}
virtual void init_tables(double, double *);
virtual void init_tables_disp(double);
virtual void free_tables();
virtual void free_disp_tables();
virtual void write_restart(FILE *) {}
virtual void read_restart(FILE *) {}
virtual void write_restart_settings(FILE *) {}
virtual void read_restart_settings(FILE *) {}
virtual void write_data(FILE *) {}
virtual void write_data_all(FILE *) {}
virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;}
virtual void unpack_forward_comm(int, int, double *) {}
virtual int pack_forward_comm_kokkos(int, DAT::tdual_int_2d, int, DAT::tdual_xfloat_1d&, int, int *) {return 0;};
virtual void unpack_forward_comm_kokkos(int, int, DAT::tdual_xfloat_1d&) {}
virtual int pack_reverse_comm(int, int, double *) {return 0;}
virtual void unpack_reverse_comm(int, int *, double *) {}
virtual double memory_usage();
// specific child-class methods for certain Pair styles
virtual void *extract(const char *, int &) {return NULL;}
virtual void swap_eam(double *, double **) {}
virtual void reset_dt() {}
virtual void min_xf_pointers(int, double **, double **) {}
virtual void min_xf_get(int) {}
virtual void min_x_set(int) {}
virtual unsigned int data_mask() {return datamask;}
virtual unsigned int data_mask_ext() {return datamask_ext;}
// management of callbacks to be run from ev_tally()
protected:
int num_tally_compute;
class Compute **list_tally_compute;
public:
void add_tally_callback(class Compute *);
void del_tally_callback(class Compute *);
protected:
int instance_me; // which Pair class instantiation I am
enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER}; // mixing options
int special_lj[4]; // copied from force->special_lj for Kokkos
int suffix_flag; // suffix compatibility flag
// pair_modify settings
int offset_flag,mix_flag; // flags for offset and mixing
double tabinner; // inner cutoff for Coulomb table
double tabinner_disp; // inner cutoff for dispersion table
// custom data type for accessing Coulomb tables
typedef union {int i; float f;} union_int_float_t;
double THIRD;
int vflag_fdotr;
int maxeatom,maxvatom;
int copymode; // if set, do not deallocate during destruction
// required when classes are used as functors by Kokkos
virtual void ev_setup(int, int);
void ev_unset();
void ev_tally_full(int, double, double, double, double, double, double);
void ev_tally_xyz_full(int, double, double,
double, double, double, double, double, double);
void ev_tally4(int, int, int, int, double,
double *, double *, double *, double *, double *, double *);
void ev_tally_tip4p(int, int *, double *, double, double);
void v_tally2(int, int, double, double *);
void v_tally_tensor(int, int, int, int,
double, double, double, double, double, double);
void virial_fdotr_compute();
+ // union data struct for packing 32-bit and 64-bit ints into double bufs
+ // see atom_vec.h for documentation
+
+ union ubuf {
+ double d;
+ int64_t i;
+ ubuf(double arg) : d(arg) {}
+ ubuf(int64_t arg) : i(arg) {}
+ ubuf(int arg) : i(arg) {}
+ };
+
inline int sbmask(int j) {
return j >> SBBITS & 3;
}
};
}
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Too many total bits for bitmapped lookup table
Table size specified via pair_modify command is too large. Note that
a value of N generates a 2^N size table.
E: Cannot have both pair_modify shift and tail set to yes
These 2 options are contradictory.
E: Cannot use pair tail corrections with 2d simulations
The correction factors are only currently defined for 3d systems.
W: Using pair tail corrections with nonperiodic system
This is probably a bogus thing to do, since tail corrections are
computed by integrating the density of a periodic system out to
infinity.
W: Using a manybody potential with bonds/angles/dihedrals and special_bond exclusions
This is likely not what you want to do. The exclusion settings will
eliminate neighbors in the neighbor list, which the manybody potential
needs to calculated its terms correctly.
E: All pair coeffs are not set
All pair coefficients must be set in the data file or by the
pair_coeff command before running a simulation.
E: Fix adapt interface to this pair style not supported
New coding for the pair style would need to be done.
E: Pair style requires a KSpace style
No kspace style is defined.
E: Pair style does not support pair_write
The pair style does not have a single() function, so it can
not be invoked by pair write.
E: Invalid atom types in pair_write command
Atom types must range from 1 to Ntypes inclusive.
E: Invalid style in pair_write command
Self-explanatory. Check the input script.
E: Invalid cutoffs in pair_write command
Inner cutoff must be larger than 0.0 and less than outer cutoff.
E: Cannot open pair_write file
The specified output file for pair energies and forces cannot be
opened. Check that the path and name are correct.
E: Bitmapped lookup tables require int/float be same size
Cannot use pair tables on this machine, because of word sizes. Use
the pair_modify command with table 0 instead.
W: Table inner cutoff >= outer cutoff
You specified an inner cutoff for a Coulombic table that is longer
than the global cutoff. Probably not what you wanted.
E: Too many exponent bits for lookup table
Table size specified via pair_modify command does not work with your
machine's floating point representation.
E: Too many mantissa bits for lookup table
Table size specified via pair_modify command does not work with your
machine's floating point representation.
E: Too few bits for lookup table
Table size specified via pair_modify command does not work with your
machine's floating point representation.
*/
diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp
index 1493a8e16..a2aa82fe0 100644
--- a/src/pair_hybrid.cpp
+++ b/src/pair_hybrid.cpp
@@ -1,979 +1,988 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "pair_hybrid.h"
#include "atom.h"
#include "force.h"
#include "pair.h"
#include "neighbor.h"
#include "neigh_request.h"
#include "update.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
#include "respa.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PairHybrid::PairHybrid(LAMMPS *lmp) : Pair(lmp)
{
nstyles = 0;
styles = NULL;
keywords = NULL;
multiple = NULL;
special_lj = NULL;
special_coul = NULL;
outerflag = 0;
respaflag = 0;
}
/* ---------------------------------------------------------------------- */
PairHybrid::~PairHybrid()
{
if (nstyles) {
for (int m = 0; m < nstyles; m++) {
delete styles[m];
delete [] keywords[m];
if (special_lj[m]) delete [] special_lj[m];
if (special_coul[m]) delete [] special_coul[m];
}
}
delete [] styles;
delete [] keywords;
delete [] multiple;
delete [] special_lj;
delete [] special_coul;
delete [] svector;
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cutghost);
memory->destroy(nmap);
memory->destroy(map);
}
}
/* ----------------------------------------------------------------------
call each sub-style's compute() or compute_outer() function
accumulate sub-style global/peratom energy/virial in hybrid
for global vflag = 1:
each sub-style computes own virial[6]
sum sub-style virial[6] to hybrid's virial[6]
for global vflag = 2:
call sub-style with adjusted vflag to prevent it calling
virial_fdotr_compute()
hybrid calls virial_fdotr_compute() on final accumulated f
------------------------------------------------------------------------- */
void PairHybrid::compute(int eflag, int vflag)
{
int i,j,m,n;
// if no_virial_fdotr_compute is set and global component of
// incoming vflag = 2, then
// reset vflag as if global component were 1
// necessary since one or more sub-styles cannot compute virial as F dot r
if (no_virial_fdotr_compute && vflag % 4 == 2) vflag = 1 + vflag/4 * 4;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = eflag_global = vflag_global =
eflag_atom = vflag_atom = 0;
// check if global component of incoming vflag = 2
// if so, reset vflag passed to substyle as if it were 0
// necessary so substyle will not invoke virial_fdotr_compute()
int vflag_substyle;
if (vflag % 4 == 2) vflag_substyle = vflag/4 * 4;
else vflag_substyle = vflag;
double *saved_special = save_special();
// check if we are running with r-RESPA using the hybrid keyword
Respa *respa = NULL;
respaflag = 0;
if (strstr(update->integrate_style,"respa")) {
respa = (Respa *) update->integrate;
if (respa->nhybrid_styles > 0) respaflag = 1;
}
for (m = 0; m < nstyles; m++) {
set_special(m);
if (!respaflag || (respaflag && respa->hybrid_compute[m])) {
// invoke compute() unless compute flag is turned off or
// outerflag is set and sub-style has a compute_outer() method
if (styles[m]->compute_flag == 0) continue;
if (outerflag && styles[m]->respa_enable)
styles[m]->compute_outer(eflag,vflag_substyle);
else styles[m]->compute(eflag,vflag_substyle);
}
restore_special(saved_special);
// jump to next sub-style if r-RESPA does not want global accumulated data
if (respaflag && !respa->tally_global) continue;
if (eflag_global) {
eng_vdwl += styles[m]->eng_vdwl;
eng_coul += styles[m]->eng_coul;
}
if (vflag_global) {
for (n = 0; n < 6; n++) virial[n] += styles[m]->virial[n];
}
if (eflag_atom) {
n = atom->nlocal;
if (force->newton_pair) n += atom->nghost;
double *eatom_substyle = styles[m]->eatom;
for (i = 0; i < n; i++) eatom[i] += eatom_substyle[i];
}
if (vflag_atom) {
n = atom->nlocal;
if (force->newton_pair) n += atom->nghost;
double **vatom_substyle = styles[m]->vatom;
for (i = 0; i < n; i++)
for (j = 0; j < 6; j++)
vatom[i][j] += vatom_substyle[i][j];
}
}
delete [] saved_special;
if (vflag_fdotr) virial_fdotr_compute();
}
/* ---------------------------------------------------------------------- */
void PairHybrid::compute_inner()
{
for (int m = 0; m < nstyles; m++)
if (styles[m]->respa_enable) styles[m]->compute_inner();
}
/* ---------------------------------------------------------------------- */
void PairHybrid::compute_middle()
{
for (int m = 0; m < nstyles; m++)
if (styles[m]->respa_enable) styles[m]->compute_middle();
}
/* ---------------------------------------------------------------------- */
void PairHybrid::compute_outer(int eflag, int vflag)
{
outerflag = 1;
compute(eflag,vflag);
outerflag = 0;
}
/* ----------------------------------------------------------------------
allocate all arrays
------------------------------------------------------------------------- */
void PairHybrid::allocate()
{
allocated = 1;
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cutghost,n+1,n+1,"pair:cutghost");
memory->create(nmap,n+1,n+1,"pair:nmap");
memory->create(map,n+1,n+1,nstyles,"pair:map");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
nmap[i][j] = 0;
}
/* ----------------------------------------------------------------------
create one pair style for each arg in list
------------------------------------------------------------------------- */
void PairHybrid::settings(int narg, char **arg)
{
if (narg < 1) error->all(FLERR,"Illegal pair_style command");
// delete old lists, since cannot just change settings
if (nstyles) {
for (int m = 0; m < nstyles; m++) delete styles[m];
delete [] styles;
for (int m = 0; m < nstyles; m++) delete [] keywords[m];
delete [] keywords;
}
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(cutghost);
memory->destroy(nmap);
memory->destroy(map);
}
allocated = 0;
// allocate list of sub-styles as big as possibly needed if no extra args
styles = new Pair*[narg];
keywords = new char*[narg];
multiple = new int[narg];
special_lj = new double*[narg];
special_coul = new double*[narg];
// allocate each sub-style
// allocate uses suffix, but don't store suffix version in keywords,
// else syntax in coeff() will not match
// call settings() with set of args that are not pair style names
// use force->pair_map to determine which args these are
int iarg,jarg,dummy;
iarg = 0;
nstyles = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"hybrid") == 0)
error->all(FLERR,"Pair style hybrid cannot have hybrid as an argument");
if (strcmp(arg[iarg],"none") == 0)
error->all(FLERR,"Pair style hybrid cannot have none as an argument");
styles[nstyles] = force->new_pair(arg[iarg],1,dummy);
force->store_style(keywords[nstyles],arg[iarg],0);
special_lj[nstyles] = special_coul[nstyles] = NULL;
jarg = iarg + 1;
while (jarg < narg && !force->pair_map->count(arg[jarg])) jarg++;
styles[nstyles]->settings(jarg-iarg-1,&arg[iarg+1]);
iarg = jarg;
nstyles++;
}
// multiple[i] = 1 to M if sub-style used multiple times, else 0
for (int i = 0; i < nstyles; i++) {
int count = 0;
for (int j = 0; j < nstyles; j++) {
if (strcmp(keywords[j],keywords[i]) == 0) count++;
if (j == i) multiple[i] = count;
}
if (count == 1) multiple[i] = 0;
}
// set pair flags from sub-style flags
flags();
}
/* ----------------------------------------------------------------------
set top-level pair flags from sub-style flags
------------------------------------------------------------------------- */
void PairHybrid::flags()
{
int m;
// set comm_forward, comm_reverse, comm_reverse_off to max of any sub-style
for (m = 0; m < nstyles; m++) {
if (styles[m]) comm_forward = MAX(comm_forward,styles[m]->comm_forward);
if (styles[m]) comm_reverse = MAX(comm_reverse,styles[m]->comm_reverse);
if (styles[m]) comm_reverse_off = MAX(comm_reverse_off,
styles[m]->comm_reverse_off);
}
// single_enable = 1 if any sub-style is set
// respa_enable = 1 if any sub-style is set
// manybody_flag = 1 if any sub-style is set
// no_virial_fdotr_compute = 1 if any sub-style is set
// ghostneigh = 1 if any sub-style is set
// ewaldflag, pppmflag, msmflag, dipoleflag, dispersionflag, tip4pflag = 1
// if any sub-style is set
// compute_flag = 1 if any sub-style is set
single_enable = 0;
compute_flag = 0;
for (m = 0; m < nstyles; m++) {
if (styles[m]->single_enable) single_enable = 1;
if (styles[m]->respa_enable) respa_enable = 1;
if (styles[m]->manybody_flag) manybody_flag = 1;
if (styles[m]->no_virial_fdotr_compute) no_virial_fdotr_compute = 1;
if (styles[m]->ghostneigh) ghostneigh = 1;
if (styles[m]->ewaldflag) ewaldflag = 1;
if (styles[m]->pppmflag) pppmflag = 1;
if (styles[m]->msmflag) msmflag = 1;
if (styles[m]->dipoleflag) dipoleflag = 1;
if (styles[m]->dispersionflag) dispersionflag = 1;
if (styles[m]->tip4pflag) tip4pflag = 1;
if (styles[m]->compute_flag) compute_flag = 1;
}
// single_extra = min of all sub-style single_extra
// allocate svector
single_extra = styles[0]->single_extra;
for (m = 1; m < nstyles; m++)
single_extra = MIN(single_extra,styles[m]->single_extra);
if (single_extra) {
delete [] svector;
svector = new double[single_extra];
}
}
/* ----------------------------------------------------------------------
set coeffs for one or more type pairs
------------------------------------------------------------------------- */
void PairHybrid::coeff(int narg, char **arg)
{
if (narg < 3) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
// 3rd arg = pair sub-style name
// 4th arg = pair sub-style index if name used multiple times
// allow for "none" as valid sub-style name
int multflag;
int m;
for (m = 0; m < nstyles; m++) {
multflag = 0;
if (strcmp(arg[2],keywords[m]) == 0) {
if (multiple[m]) {
multflag = 1;
if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients");
if (!isdigit(arg[3][0]))
error->all(FLERR,"Incorrect args for pair coefficients");
int index = force->inumeric(FLERR,arg[3]);
if (index == multiple[m]) break;
else continue;
} else break;
}
}
int none = 0;
if (m == nstyles) {
if (strcmp(arg[2],"none") == 0) none = 1;
else error->all(FLERR,"Pair coeff for hybrid has invalid style");
}
// move 1st/2nd args to 2nd/3rd args
// if multflag: move 1st/2nd args to 3rd/4th args
// just copy ptrs, since arg[] points into original input line
arg[2+multflag] = arg[1];
arg[1+multflag] = arg[0];
// invoke sub-style coeff() starting with 1st remaining arg
if (!none) styles[m]->coeff(narg-1-multflag,&arg[1+multflag]);
// if sub-style only allows one pair coeff call (with * * and type mapping)
// then unset setflag/map assigned to that style before setting it below
// in case pair coeff for this sub-style is being called for 2nd time
if (!none && styles[m]->one_coeff)
for (int i = 1; i <= atom->ntypes; i++)
for (int j = i; j <= atom->ntypes; j++)
if (nmap[i][j] && map[i][j][0] == m) {
setflag[i][j] = 0;
nmap[i][j] = 0;
}
// set setflag and which type pairs map to which sub-style
// if sub-style is none: set hybrid setflag, wipe out map
// else: set hybrid setflag & map only if substyle setflag is set
// previous mappings are wiped out
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
if (none) {
setflag[i][j] = 1;
nmap[i][j] = 0;
count++;
} else if (styles[m]->setflag[i][j]) {
setflag[i][j] = 1;
nmap[i][j] = 1;
map[i][j][0] = m;
count++;
}
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairHybrid::init_style()
{
int i,m,itype,jtype,used,istyle,skip;
// error if a sub-style is not used
int ntypes = atom->ntypes;
for (istyle = 0; istyle < nstyles; istyle++) {
used = 0;
for (itype = 1; itype <= ntypes; itype++)
for (jtype = itype; jtype <= ntypes; jtype++)
for (m = 0; m < nmap[itype][jtype]; m++)
if (map[itype][jtype][m] == istyle) used = 1;
if (used == 0) error->all(FLERR,"Pair hybrid sub-style is not used");
}
// check if special_lj/special_coul overrides are compatible
for (istyle = 0; istyle < nstyles; istyle++) {
if (special_lj[istyle]) {
for (i = 1; i < 4; ++i) {
if (((force->special_lj[i] == 0.0) || (force->special_lj[i] == 1.0))
&& (force->special_lj[i] != special_lj[istyle][i]))
error->all(FLERR,"Pair_modify special setting incompatible with"
" global special_bonds setting");
}
}
if (special_coul[istyle]) {
for (i = 1; i < 4; ++i) {
if (((force->special_coul[i] == 0.0)
|| (force->special_coul[i] == 1.0))
&& (force->special_coul[i] != special_coul[istyle][i]))
error->all(FLERR,"Pair_modify special setting incompatible with"
"global special_bonds setting");
}
}
}
// each sub-style makes its neighbor list request(s)
for (istyle = 0; istyle < nstyles; istyle++) styles[istyle]->init_style();
// create skip lists for each pair neigh request
// any kind of list can have its skip flag set at this stage
for (i = 0; i < neighbor->nrequest; i++) {
if (!neighbor->requests[i]->pair) continue;
// istyle = associated sub-style for that request
for (istyle = 0; istyle < nstyles; istyle++)
if (styles[istyle] == neighbor->requests[i]->requestor) break;
// allocate iskip and ijskip
// initialize so as to skip all pair types
// set ijskip = 0 if type pair matches any entry in sub-style map
// set ijskip = 0 if mixing will assign type pair to this sub-style
// will occur if type pair is currently unassigned
// and both I,I and J,J are assigned to single sub-style
// and sub-style for both I,I and J,J match istyle
// set iskip = 1 only if all ijskip for itype are 1
int *iskip = new int[ntypes+1];
int **ijskip;
memory->create(ijskip,ntypes+1,ntypes+1,"pair_hybrid:ijskip");
for (itype = 1; itype <= ntypes; itype++)
for (jtype = 1; jtype <= ntypes; jtype++)
ijskip[itype][jtype] = 1;
for (itype = 1; itype <= ntypes; itype++)
for (jtype = itype; jtype <= ntypes; jtype++) {
for (m = 0; m < nmap[itype][jtype]; m++)
if (map[itype][jtype][m] == istyle)
ijskip[itype][jtype] = ijskip[jtype][itype] = 0;
if (nmap[itype][jtype] == 0 &&
nmap[itype][itype] == 1 && map[itype][itype][0] == istyle &&
nmap[jtype][jtype] == 1 && map[jtype][jtype][0] == istyle)
ijskip[itype][jtype] = ijskip[jtype][itype] = 0;
}
for (itype = 1; itype <= ntypes; itype++) {
iskip[itype] = 1;
for (jtype = 1; jtype <= ntypes; jtype++)
if (ijskip[itype][jtype] == 0) iskip[itype] = 0;
}
// if any skipping occurs
// set request->skip and copy iskip and ijskip into request
// else delete iskip and ijskip
skip = 0;
for (itype = 1; itype <= ntypes; itype++)
for (jtype = 1; jtype <= ntypes; jtype++)
if (ijskip[itype][jtype] == 1) skip = 1;
if (skip) {
neighbor->requests[i]->skip = 1;
neighbor->requests[i]->iskip = iskip;
neighbor->requests[i]->ijskip = ijskip;
} else {
delete [] iskip;
memory->destroy(ijskip);
}
}
// combine sub-style neigh list requests and create new ones if needed
modify_requests();
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairHybrid::init_one(int i, int j)
{
// if I,J is not set explicitly:
// perform mixing only if I,I sub-style = J,J sub-style
// also require I,I and J,J are both assigned to single sub-style
if (setflag[i][j] == 0) {
if (nmap[i][i] != 1 || nmap[j][j] != 1 || map[i][i][0] != map[j][j][0])
error->one(FLERR,"All pair coeffs are not set");
nmap[i][j] = 1;
map[i][j][0] = map[i][i][0];
}
// call init/mixing for all sub-styles of I,J
// set cutsq in sub-style just as Pair::init() does via call to init_one()
// set cutghost for I,J and J,I just as sub-style does
// sum tail corrections for I,J
// return max cutoff of all sub-styles assigned to I,J
// if no sub-styles assigned to I,J (pair_coeff none), cutmax = 0.0 returned
double cutmax = 0.0;
cutghost[i][j] = cutghost[j][i] = 0.0;
if (tail_flag) etail_ij = ptail_ij = 0.0;
nmap[j][i] = nmap[i][j];
for (int k = 0; k < nmap[i][j]; k++) {
map[j][i][k] = map[i][j][k];
double cut = styles[map[i][j][k]]->init_one(i,j);
styles[map[i][j][k]]->cutsq[i][j] =
styles[map[i][j][k]]->cutsq[j][i] = cut*cut;
if (styles[map[i][j][k]]->ghostneigh)
cutghost[i][j] = cutghost[j][i] =
MAX(cutghost[i][j],styles[map[i][j][k]]->cutghost[i][j]);
if (tail_flag) {
etail_ij += styles[map[i][j][k]]->etail_ij;
ptail_ij += styles[map[i][j][k]]->ptail_ij;
}
cutmax = MAX(cutmax,cut);
}
return cutmax;
}
+/* ----------------------------------------------------------------------
+ invoke setup for each sub-style
+------------------------------------------------------------------------- */
+
+void PairHybrid::setup()
+{
+ for (int m = 0; m < nstyles; m++) styles[m]->setup();
+}
+
/* ----------------------------------------------------------------------
combine sub-style neigh list requests and create new ones if needed
------------------------------------------------------------------------- */
void PairHybrid::modify_requests()
{
int i,j;
NeighRequest *irq,*jrq;
// loop over pair requests only
// if list is skip list and not copy, look for non-skip list of same kind
// if one exists, point at that one via otherlist
// else make new non-skip request of same kind and point at that one
// don't bother to set ID for new request, since pair hybrid ignores list
// only exception is half_from_full:
// ignore it, turn off skip, since it will derive from its skip parent
// after possible new request creation, unset skip flag and otherlist
// for these derived lists: granhistory, rRESPA inner/middle
// this prevents neighbor from treating them as skip lists
// copy list check is for pair style = hybrid/overlay
// which invokes this routine
for (i = 0; i < neighbor->nrequest; i++) {
if (!neighbor->requests[i]->pair) continue;
irq = neighbor->requests[i];
if (irq->skip == 0 || irq->copy) continue;
if (irq->half_from_full) {
irq->skip = 0;
continue;
}
for (j = 0; j < neighbor->nrequest; j++) {
if (!neighbor->requests[j]->pair) continue;
jrq = neighbor->requests[j];
if (irq->same_kind(jrq) && jrq->skip == 0) break;
}
if (j < neighbor->nrequest) irq->otherlist = j;
else {
int newrequest = neighbor->request(this,instance_me);
neighbor->requests[newrequest]->copy_request(irq);
irq->otherlist = newrequest;
}
if (irq->granhistory || irq->respainner || irq->respamiddle) {
irq->skip = 0;
irq->otherlist = -1;
}
}
}
/* ----------------------------------------------------------------------
proc 0 writes to restart file
------------------------------------------------------------------------- */
void PairHybrid::write_restart(FILE *fp)
{
fwrite(&nstyles,sizeof(int),1,fp);
// each sub-style writes its settings, but no coeff info
int n;
for (int m = 0; m < nstyles; m++) {
n = strlen(keywords[m]) + 1;
fwrite(&n,sizeof(int),1,fp);
fwrite(keywords[m],sizeof(char),n,fp);
styles[m]->write_restart_settings(fp);
// write out per style special settings, if present
n = (special_lj[m] == NULL) ? 0 : 1;
fwrite(&n,sizeof(int),1,fp);
if (n) fwrite(special_lj[m],sizeof(double),4,fp);
n = (special_coul[m] == NULL) ? 0 : 1;
fwrite(&n,sizeof(int),1,fp);
if (n) fwrite(special_coul[m],sizeof(double),4,fp);
}
}
/* ----------------------------------------------------------------------
proc 0 reads from restart file, bcasts
------------------------------------------------------------------------- */
void PairHybrid::read_restart(FILE *fp)
{
int me = comm->me;
if (me == 0) fread(&nstyles,sizeof(int),1,fp);
MPI_Bcast(&nstyles,1,MPI_INT,0,world);
// allocate list of sub-styles
styles = new Pair*[nstyles];
keywords = new char*[nstyles];
multiple = new int[nstyles];
special_lj = new double*[nstyles];
special_coul = new double*[nstyles];
// each sub-style is created via new_pair()
// each reads its settings, but no coeff info
int n,dummy;
for (int m = 0; m < nstyles; m++) {
if (me == 0) fread(&n,sizeof(int),1,fp);
MPI_Bcast(&n,1,MPI_INT,0,world);
keywords[m] = new char[n];
if (me == 0) fread(keywords[m],sizeof(char),n,fp);
MPI_Bcast(keywords[m],n,MPI_CHAR,0,world);
styles[m] = force->new_pair(keywords[m],0,dummy);
styles[m]->read_restart_settings(fp);
// read back per style special settings, if present
special_lj[m] = special_coul[m] = NULL;
if (me == 0) fread(&n,sizeof(int),1,fp);
MPI_Bcast(&n,1,MPI_INT,0,world);
if (n > 0 ) {
special_lj[m] = new double[4];
if (me == 0) fread(special_lj[m],sizeof(double),4,fp);
MPI_Bcast(special_lj[m],4,MPI_DOUBLE,0,world);
}
if (me == 0) fread(&n,sizeof(int),1,fp);
MPI_Bcast(&n,1,MPI_INT,0,world);
if (n > 0 ) {
special_coul[m] = new double[4];
if (me == 0) fread(special_coul[m],sizeof(double),4,fp);
MPI_Bcast(special_coul[m],4,MPI_DOUBLE,0,world);
}
}
// multiple[i] = 1 to M if sub-style used multiple times, else 0
for (int i = 0; i < nstyles; i++) {
int count = 0;
for (int j = 0; j < nstyles; j++) {
if (strcmp(keywords[j],keywords[i]) == 0) count++;
if (j == i) multiple[i] = count;
}
if (count == 1) multiple[i] = 0;
}
// set pair flags from sub-style flags
flags();
}
/* ----------------------------------------------------------------------
call sub-style to compute single interaction
error if sub-style does not support single() call
since overlay could have multiple sub-styles, sum results explicitly
------------------------------------------------------------------------- */
double PairHybrid::single(int i, int j, int itype, int jtype,
double rsq, double factor_coul, double factor_lj,
double &fforce)
{
if (nmap[itype][jtype] == 0)
error->one(FLERR,"Invoked pair single on pair style none");
double fone;
fforce = 0.0;
double esum = 0.0;
for (int m = 0; m < nmap[itype][jtype]; m++) {
if (rsq < styles[map[itype][jtype][m]]->cutsq[itype][jtype]) {
if (styles[map[itype][jtype][m]]->single_enable == 0)
error->one(FLERR,"Pair hybrid sub-style does not support single call");
if ((special_lj[map[itype][jtype][m]] != NULL) ||
(special_coul[map[itype][jtype][m]] != NULL))
error->one(FLERR,"Pair hybrid single calls do not support"
" per sub-style special bond values");
esum += styles[map[itype][jtype][m]]->
single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fone);
fforce += fone;
// copy substyle extra values into hybrid's svector
if (single_extra && styles[map[itype][jtype][m]]->single_extra)
for (m = 0; m < single_extra; m++)
svector[m] = styles[map[itype][jtype][m]]->svector[m];
}
}
return esum;
}
/* ----------------------------------------------------------------------
modify parameters of the pair style and its sub-styles
------------------------------------------------------------------------- */
void PairHybrid::modify_params(int narg, char **arg)
{
if (narg == 0) error->all(FLERR,"Illegal pair_modify command");
// if 1st keyword is pair, apply other keywords to one sub-style
if (strcmp(arg[0],"pair") == 0) {
if (narg < 2) error->all(FLERR,"Illegal pair_modify command");
int m;
for (m = 0; m < nstyles; m++)
if (strcmp(arg[1],keywords[m]) == 0) break;
if (m == nstyles) error->all(FLERR,"Unknown pair_modify hybrid sub-style");
int iarg = 2;
if (multiple[m]) {
if (narg < 3) error->all(FLERR,"Illegal pair_modify command");
int multiflag = force->inumeric(FLERR,arg[2]);
for (m = 0; m < nstyles; m++)
if (strcmp(arg[1],keywords[m]) == 0 && multiflag == multiple[m]) break;
if (m == nstyles)
error->all(FLERR,"Unknown pair_modify hybrid sub-style");
iarg = 3;
}
// if 2nd keyword (after pair) is special:
// invoke modify_special() for the sub-style
if (iarg < narg && strcmp(arg[iarg],"special") == 0) {
if (narg < iarg+5)
error->all(FLERR,"Illegal pair_modify special command");
modify_special(m,narg-iarg,&arg[iarg+1]);
iarg += 5;
}
// apply the remaining keywords to the base pair style itself and the
// sub-style except for "pair" and "special".
// the former is important for some keywords like "tail" or "compute"
if (narg-iarg > 0) {
Pair::modify_params(narg-iarg,&arg[iarg]);
styles[m]->modify_params(narg-iarg,&arg[iarg]);
}
// apply all keywords to pair hybrid itself and every sub-style
} else {
Pair::modify_params(narg,arg);
for (int m = 0; m < nstyles; m++) styles[m]->modify_params(narg,arg);
}
}
/* ----------------------------------------------------------------------
store a local per pair style override for special_lj and special_coul
------------------------------------------------------------------------- */
void PairHybrid::modify_special(int m, int narg, char **arg)
{
double special[4];
int i;
special[0] = 1.0;
special[1] = force->numeric(FLERR,arg[1]);
special[2] = force->numeric(FLERR,arg[2]);
special[3] = force->numeric(FLERR,arg[3]);
if (strcmp(arg[0],"lj/coul") == 0) {
if (!special_lj[m]) special_lj[m] = new double[4];
if (!special_coul[m]) special_coul[m] = new double[4];
for (i = 0; i < 4; ++i)
special_lj[m][i] = special_coul[m][i] = special[i];
} else if (strcmp(arg[0],"lj") == 0) {
if (!special_lj[m]) special_lj[m] = new double[4];
for (i = 0; i < 4; ++i)
special_lj[m][i] = special[i];
} else if (strcmp(arg[0],"coul") == 0) {
if (!special_coul[m]) special_coul[m] = new double[4];
for (i = 0; i < 4; ++i)
special_coul[m][i] = special[i];
} else error->all(FLERR,"Illegal pair_modify special command");
}
/* ----------------------------------------------------------------------
override global special bonds settings with per substyle values
------------------------------------------------------------------------- */
void PairHybrid::set_special(int m)
{
int i;
if (special_lj[m])
for (i = 0; i < 4; ++i) force->special_lj[i] = special_lj[m][i];
if (special_coul[m])
for (i = 0; i < 4; ++i) force->special_coul[i] = special_coul[m][i];
}
/* ----------------------------------------------------------------------
store global special settings
------------------------------------------------------------------------- */
double * PairHybrid::save_special()
{
double *saved = new double[8];
for (int i = 0; i < 4; ++i) {
saved[i] = force->special_lj[i];
saved[i+4] = force->special_coul[i];
}
return saved;
}
/* ----------------------------------------------------------------------
restore global special settings from saved data
------------------------------------------------------------------------- */
void PairHybrid::restore_special(double *saved)
{
for (int i = 0; i < 4; ++i) {
force->special_lj[i] = saved[i];
force->special_coul[i] = saved[i+4];
}
}
/* ----------------------------------------------------------------------
extract a ptr to a particular quantity stored by pair
pass request thru to sub-styles
return first non-NULL result except for cut_coul request
for cut_coul, insure all non-NULL results are equal since required by Kspace
------------------------------------------------------------------------- */
void *PairHybrid::extract(const char *str, int &dim)
{
void *cutptr = NULL;
void *ptr;
double cutvalue = 0.0;
for (int m = 0; m < nstyles; m++) {
ptr = styles[m]->extract(str,dim);
if (ptr && strcmp(str,"cut_coul") == 0) {
double *p_newvalue = (double *) ptr;
double newvalue = *p_newvalue;
if (cutptr && newvalue != cutvalue)
error->all(FLERR,
"Coulomb cutoffs of pair hybrid sub-styles do not match");
cutptr = ptr;
cutvalue = newvalue;
} else if (ptr) return ptr;
}
if (strcmp(str,"cut_coul") == 0) return cutptr;
return NULL;
}
/* ---------------------------------------------------------------------- */
void PairHybrid::reset_dt()
{
for (int m = 0; m < nstyles; m++) styles[m]->reset_dt();
}
/* ----------------------------------------------------------------------
check if itype,jtype maps to sub-style
------------------------------------------------------------------------- */
int PairHybrid::check_ijtype(int itype, int jtype, char *substyle)
{
for (int m = 0; m < nmap[itype][jtype]; m++)
if (strcmp(keywords[map[itype][jtype][m]],substyle) == 0) return 1;
return 0;
}
/* ----------------------------------------------------------------------
memory usage of each sub-style
------------------------------------------------------------------------- */
double PairHybrid::memory_usage()
{
double bytes = maxeatom * sizeof(double);
bytes += maxvatom*6 * sizeof(double);
for (int m = 0; m < nstyles; m++) bytes += styles[m]->memory_usage();
return bytes;
}
diff --git a/src/pair_hybrid.h b/src/pair_hybrid.h
index 1be07d1ef..006c70664 100644
--- a/src/pair_hybrid.h
+++ b/src/pair_hybrid.h
@@ -1,141 +1,142 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(hybrid,PairHybrid)
#else
#ifndef LMP_PAIR_HYBRID_H
#define LMP_PAIR_HYBRID_H
#include <stdio.h>
#include "pair.h"
namespace LAMMPS_NS {
class PairHybrid : public Pair {
friend class FixGPU;
friend class FixIntel;
friend class FixOMP;
friend class Force;
friend class Respa;
public:
PairHybrid(class LAMMPS *);
virtual ~PairHybrid();
void compute(int, int);
void settings(int, char **);
virtual void coeff(int, char **);
void init_style();
double init_one(int, int);
+ void setup();
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, int, int, int, double, double, double, double &);
void modify_params(int narg, char **arg);
double memory_usage();
void compute_inner();
void compute_middle();
void compute_outer(int, int);
void *extract(const char *, int &);
void reset_dt();
int check_ijtype(int, int, char *);
protected:
int nstyles; // # of sub-styles
Pair **styles; // list of Pair style classes
char **keywords; // style name of each Pair style
int *multiple; // 0 if style used once, else Mth instance
int outerflag; // toggle compute() when invoked by outer()
int respaflag; // 1 if different substyles are assigned to
// different r-RESPA levels
int **nmap; // # of sub-styles itype,jtype points to
int ***map; // list of sub-styles itype,jtype points to
double **special_lj; // list of per style LJ exclusion factors
double **special_coul; // list of per style Coulomb exclusion factors
void allocate();
void flags();
void modify_special(int, int, char**);
double *save_special();
void set_special(int);
void restore_special(double *);
virtual void modify_requests();
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Pair style hybrid cannot have hybrid as an argument
Self-explanatory.
E: Pair style hybrid cannot have none as an argument
Self-explanatory.
E: Incorrect args for pair coefficients
Self-explanatory. Check the input script or data file.
E: Pair coeff for hybrid has invalid style
Style in pair coeff must have been listed in pair_style command.
E: Pair hybrid sub-style is not used
No pair_coeff command used a sub-style specified in the pair_style
command.
E: All pair coeffs are not set
All pair coefficients must be set in the data file or by the
pair_coeff command before running a simulation.
E: Invoked pair single on pair style none
A command (e.g. a dump) attempted to invoke the single() function on a
pair style none, which is illegal. You are probably attempting to
compute per-atom quantities with an undefined pair style.
E: Pair hybrid sub-style does not support single call
You are attempting to invoke a single() call on a pair style
that doesn't support it.
E: Unknown pair_modify hybrid sub-style
The choice of sub-style is unknown.
E: Coulomb cutoffs of pair hybrid sub-styles do not match
If using a Kspace solver, all Coulomb cutoffs of long pair styles must
be the same.
*/
diff --git a/src/read_data.cpp b/src/read_data.cpp
index 7e02f56ed..b0af40140 100644
--- a/src/read_data.cpp
+++ b/src/read_data.cpp
@@ -1,1950 +1,1955 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
// lmptype.h must be first b/c this file uses MAXBIGINT and includes mpi.h
// due to OpenMPI bug which sets INT64_MAX via its mpi.h
// before lmptype.h can set flags to insure it is done correctly
#include "lmptype.h"
#include <mpi.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "read_data.h"
#include "atom.h"
#include "atom_vec.h"
#include "atom_vec_ellipsoid.h"
#include "atom_vec_line.h"
#include "atom_vec_tri.h"
#include "force.h"
#include "molecule.h"
#include "group.h"
#include "comm.h"
#include "update.h"
#include "modify.h"
#include "fix.h"
#include "force.h"
#include "pair.h"
#include "domain.h"
#include "bond.h"
#include "angle.h"
#include "dihedral.h"
#include "improper.h"
#include "special.h"
#include "irregular.h"
#include "error.h"
#include "memory.h"
using namespace LAMMPS_NS;
#define MAXLINE 256
#define LB_FACTOR 1.1
#define CHUNK 1024
#define DELTA 4 // must be 2 or larger
#define MAXBODY 32 // max # of lines in one body
// customize for new sections
#define NSECTIONS 25 // change when add to header::section_keywords
enum{NONE,APPEND,VALUE,MERGE};
// pair style suffixes to ignore
// when matching Pair Coeffs comment to currently-defined pair style
const char *suffixes[] = {"/cuda","/gpu","/opt","/omp","/kk",
"/coul/cut","/coul/long","/coul/msm",
"/coul/dsf","/coul/debye","/coul/charmm",
NULL};
/* ---------------------------------------------------------------------- */
ReadData::ReadData(LAMMPS *lmp) : Pointers(lmp)
{
MPI_Comm_rank(world,&me);
line = new char[MAXLINE];
copy = new char[MAXLINE];
keyword = new char[MAXLINE];
style = new char[MAXLINE];
buffer = new char[CHUNK*MAXLINE];
narg = maxarg = 0;
arg = NULL;
fp = NULL;
// customize for new sections
// pointers to atom styles that store extra info
nellipsoids = 0;
avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
nlines = 0;
avec_line = (AtomVecLine *) atom->style_match("line");
ntris = 0;
avec_tri = (AtomVecTri *) atom->style_match("tri");
nbodies = 0;
avec_body = (AtomVecBody *) atom->style_match("body");
}
/* ---------------------------------------------------------------------- */
ReadData::~ReadData()
{
delete [] line;
delete [] copy;
delete [] keyword;
delete [] style;
delete [] buffer;
memory->sfree(arg);
for (int i = 0; i < nfix; i++) {
delete [] fix_header[i];
delete [] fix_section[i];
}
memory->destroy(fix_index);
memory->sfree(fix_header);
memory->sfree(fix_section);
}
/* ---------------------------------------------------------------------- */
void ReadData::command(int narg, char **arg)
{
if (narg < 1) error->all(FLERR,"Illegal read_data command");
// optional args
addflag = NONE;
id_offset = 0;
offsetflag = shiftflag = 0;
toffset = boffset = aoffset = doffset = ioffset = 0;
shift[0] = shift[1] = shift[2] = 0.0;
extra_atom_types = extra_bond_types = extra_angle_types =
extra_dihedral_types = extra_improper_types = 0;
groupbit = 0;
nfix = 0;
fix_index = NULL;
fix_header = NULL;
fix_section = NULL;
int iarg = 1;
while (iarg < narg) {
if (strcmp(arg[iarg],"add") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command");
if (strcmp(arg[iarg+1],"append") == 0) addflag = APPEND;
else if (strcmp(arg[iarg+1],"merge") == 0) addflag = MERGE;
else {
addflag = VALUE;
bigint offset = force->bnumeric(FLERR,arg[iarg+1]);
if (offset > MAXTAGINT)
error->all(FLERR,"Read data add offset is too big");
id_offset = offset;
}
iarg += 2;
} else if (strcmp(arg[iarg],"offset") == 0) {
if (iarg+6 > narg) error->all(FLERR,"Illegal read_data command");
offsetflag = 1;
toffset = force->inumeric(FLERR,arg[iarg+1]);
boffset = force->inumeric(FLERR,arg[iarg+2]);
aoffset = force->inumeric(FLERR,arg[iarg+3]);
doffset = force->inumeric(FLERR,arg[iarg+4]);
ioffset = force->inumeric(FLERR,arg[iarg+5]);
if (toffset < 0 || boffset < 0 || aoffset < 0 ||
doffset < 0 || ioffset < 0)
error->all(FLERR,"Illegal read_data command");
iarg += 6;
} else if (strcmp(arg[iarg],"shift") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal read_data command");
shiftflag = 1;
shift[0] = force->numeric(FLERR,arg[iarg+1]);
shift[1] = force->numeric(FLERR,arg[iarg+2]);
shift[2] = force->numeric(FLERR,arg[iarg+3]);
if (domain->dimension == 2 && shift[2] != 0.0)
error->all(FLERR,"Non-zero read_data shift z value for 2d simulation");
iarg += 4;
} else if (strcmp(arg[iarg],"extra/atom/types") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command");
extra_atom_types = force->inumeric(FLERR,arg[iarg+1]);
if (extra_atom_types < 0) error->all(FLERR,"Illegal read_data command");
iarg += 2;
} else if (strcmp(arg[iarg],"extra/bond/types") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command");
if (!atom->avec->bonds_allow)
error->all(FLERR,"No bonds allowed with this atom style");
extra_bond_types = force->inumeric(FLERR,arg[iarg+1]);
if (extra_bond_types < 0) error->all(FLERR,"Illegal read_data command");
iarg += 2;
} else if (strcmp(arg[iarg],"extra/angle/types") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command");
if (!atom->avec->angles_allow)
error->all(FLERR,"No angles allowed with this atom style");
extra_angle_types = force->inumeric(FLERR,arg[iarg+1]);
if (extra_angle_types < 0) error->all(FLERR,"Illegal read_data command");
iarg += 2;
} else if (strcmp(arg[iarg],"extra/dihedral/types") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command");
if (!atom->avec->dihedrals_allow)
error->all(FLERR,"No dihedrals allowed with this atom style");
extra_dihedral_types = force->inumeric(FLERR,arg[iarg+1]);
if (extra_dihedral_types < 0)
error->all(FLERR,"Illegal read_data command");
iarg += 2;
} else if (strcmp(arg[iarg],"extra/improper/types") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command");
if (!atom->avec->impropers_allow)
error->all(FLERR,"No impropers allowed with this atom style");
extra_improper_types = force->inumeric(FLERR,arg[iarg+1]);
if (extra_improper_types < 0)
error->all(FLERR,"Illegal read_data command");
iarg += 2;
} else if (strcmp(arg[iarg],"group") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command");
int igroup = group->find_or_create(arg[iarg+1]);
groupbit = group->bitmask[igroup];
iarg += 2;
} else if (strcmp(arg[iarg],"fix") == 0) {
if (iarg+4 > narg)
error->all(FLERR,"Illegal read_data command");
memory->grow(fix_index,nfix+1,"read_data:fix_index");
fix_header = (char **)
memory->srealloc(fix_header,(nfix+1)*sizeof(char *),
"read_data:fix_header");
fix_section = (char **)
memory->srealloc(fix_section,(nfix+1)*sizeof(char *),
"read_data:fix_section");
fix_index[nfix] = modify->find_fix(arg[iarg+1]);
if (fix_index[nfix] < 0)
error->all(FLERR,"Fix ID for read_data does not exist");
if (strcmp(arg[iarg+2],"NULL") == 0) fix_header[nfix] = NULL;
else {
int n = strlen(arg[iarg+2]) + 1;
fix_header[nfix] = new char[n];
strcpy(fix_header[nfix],arg[iarg+2]);
}
int n = strlen(arg[iarg+3]) + 1;
fix_section[nfix] = new char[n];
strcpy(fix_section[nfix],arg[iarg+3]);
nfix++;
iarg += 4;
} else error->all(FLERR,"Illegal read_data command");
}
// error checks
if (domain->dimension == 2 && domain->zperiodic == 0)
error->all(FLERR,"Cannot run 2d simulation with nonperiodic Z dimension");
if (domain->box_exist && !addflag)
error->all(FLERR,"Cannot read_data without add keyword "
"after simulation box is defined");
if (!domain->box_exist && addflag)
error->all(FLERR,"Cannot use read_data add before "
"simulation box is defined");
if (offsetflag && addflag == NONE)
error->all(FLERR,"Cannot use read_data offset without add flag");
if (shiftflag && addflag == NONE)
error->all(FLERR,"Cannot use read_data shift without add flag");
if (addflag != NONE &&
(extra_atom_types || extra_bond_types || extra_angle_types ||
extra_dihedral_types || extra_improper_types))
error->all(FLERR,"Cannot use read_data extra with add flag");
// first time system initialization
if (addflag == NONE) {
domain->box_exist = 1;
update->ntimestep = 0;
}
// compute atomID offset for addflag = MERGE
if (addflag == APPEND) {
tagint *tag = atom->tag;
int nlocal = atom->nlocal;
tagint max = 0;
for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
MPI_Allreduce(&max,&id_offset,1,MPI_LMP_TAGINT,MPI_MAX,world);
}
// -----------------------------------------------------------------
// perform 1-pass read if no molecular topology in file
// perform 2-pass read if molecular topology,
// first pass calculates max topology/atom
// flags for this data file
int atomflag,topoflag;
int bondflag,angleflag,dihedralflag,improperflag;
int ellipsoidflag,lineflag,triflag,bodyflag;
atomflag = topoflag = 0;
bondflag = angleflag = dihedralflag = improperflag = 0;
ellipsoidflag = lineflag = triflag = bodyflag = 0;
// values in this data file
natoms = ntypes = 0;
nbonds = nangles = ndihedrals = nimpropers = 0;
nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0;
triclinic = 0;
keyword[0] = '\0';
nlocal_previous = atom->nlocal;
int firstpass = 1;
while (1) {
// open file on proc 0
if (me == 0) {
if (firstpass && screen) fprintf(screen,"Reading data file ...\n");
open(arg[0]);
} else fp = NULL;
// read header info
header(firstpass);
// problem setup using info from header
// only done once, if firstpass and first data file
// apply extra settings before grow(), even if no topology in file
// deallocate() insures new settings are used for topology arrays
// if per-atom topology is in file, another grow() is done below
if (firstpass && addflag == NONE) {
atom->bond_per_atom = atom->extra_bond_per_atom;
atom->angle_per_atom = atom->extra_angle_per_atom;
atom->dihedral_per_atom = atom->extra_dihedral_per_atom;
atom->improper_per_atom = atom->extra_improper_per_atom;
int n;
if (comm->nprocs == 1) n = static_cast<int> (atom->natoms);
else n = static_cast<int> (LB_FACTOR * atom->natoms / comm->nprocs);
atom->allocate_type_arrays();
atom->deallocate_topology();
atom->avec->grow(n);
domain->boxlo[0] = boxlo[0]; domain->boxhi[0] = boxhi[0];
domain->boxlo[1] = boxlo[1]; domain->boxhi[1] = boxhi[1];
domain->boxlo[2] = boxlo[2]; domain->boxhi[2] = boxhi[2];
if (triclinic) {
domain->triclinic = 1;
domain->xy = xy; domain->xz = xz; domain->yz = yz;
}
domain->print_box(" ");
domain->set_initial_box();
domain->set_global_box();
comm->set_proc_grid();
domain->set_local_box();
}
// change simulation box to be union of existing box and new box + shift
// only done if firstpass and not first data file
if (firstpass && addflag != NONE) {
domain->boxlo[0] = MIN(domain->boxlo[0],boxlo[0]+shift[0]);
domain->boxhi[0] = MAX(domain->boxhi[0],boxhi[0]+shift[0]);
domain->boxlo[1] = MIN(domain->boxlo[1],boxlo[1]+shift[1]);
domain->boxhi[1] = MAX(domain->boxhi[1],boxhi[1]+shift[1]);
domain->boxlo[2] = MIN(domain->boxlo[2],boxlo[2]+shift[2]);
domain->boxhi[2] = MAX(domain->boxhi[2],boxhi[2]+shift[2]);
// NOTE: not sure what to do about tilt value in subsequent data files
//if (triclinic) {
// domain->xy = xy; domain->xz = xz; domain->yz = yz;
// }
domain->print_box(" ");
domain->set_initial_box();
domain->set_global_box();
comm->set_proc_grid();
domain->set_local_box();
}
// customize for new sections
// read rest of file in free format
while (strlen(keyword)) {
// if special fix matches, it processes section
if (nfix) {
int i;
for (i = 0; i < nfix; i++)
if (strcmp(keyword,fix_section[i]) == 0) {
if (firstpass) fix(fix_index[i],keyword);
else skip_lines(modify->fix[fix_index[i]]->
read_data_skip_lines(keyword));
parse_keyword(0);
break;
}
if (i < nfix) continue;
}
if (strcmp(keyword,"Atoms") == 0) {
atomflag = 1;
if (firstpass) {
if (me == 0 && !style_match(style,atom->atom_style))
error->warning(FLERR,"Atom style in data file differs "
"from currently defined atom style");
atoms();
} else skip_lines(natoms);
} else if (strcmp(keyword,"Velocities") == 0) {
if (atomflag == 0)
error->all(FLERR,"Must read Atoms before Velocities");
if (firstpass) velocities();
else skip_lines(natoms);
} else if (strcmp(keyword,"Bonds") == 0) {
topoflag = bondflag = 1;
if (nbonds == 0)
error->all(FLERR,"Invalid data file section: Bonds");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Bonds");
bonds(firstpass);
} else if (strcmp(keyword,"Angles") == 0) {
topoflag = angleflag = 1;
if (nangles == 0)
error->all(FLERR,"Invalid data file section: Angles");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Angles");
angles(firstpass);
} else if (strcmp(keyword,"Dihedrals") == 0) {
topoflag = dihedralflag = 1;
if (ndihedrals == 0)
error->all(FLERR,"Invalid data file section: Dihedrals");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Dihedrals");
dihedrals(firstpass);
} else if (strcmp(keyword,"Impropers") == 0) {
topoflag = improperflag = 1;
if (nimpropers == 0)
error->all(FLERR,"Invalid data file section: Impropers");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Impropers");
impropers(firstpass);
} else if (strcmp(keyword,"Ellipsoids") == 0) {
ellipsoidflag = 1;
if (!avec_ellipsoid)
error->all(FLERR,"Invalid data file section: Ellipsoids");
if (atomflag == 0)
error->all(FLERR,"Must read Atoms before Ellipsoids");
if (firstpass)
bonus(nellipsoids,(AtomVec *) avec_ellipsoid,"ellipsoids");
else skip_lines(nellipsoids);
} else if (strcmp(keyword,"Lines") == 0) {
lineflag = 1;
if (!avec_line)
error->all(FLERR,"Invalid data file section: Lines");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Lines");
if (firstpass) bonus(nlines,(AtomVec *) avec_line,"lines");
else skip_lines(nlines);
} else if (strcmp(keyword,"Triangles") == 0) {
triflag = 1;
if (!avec_tri)
error->all(FLERR,"Invalid data file section: Triangles");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Triangles");
if (firstpass) bonus(ntris,(AtomVec *) avec_tri,"triangles");
else skip_lines(ntris);
} else if (strcmp(keyword,"Bodies") == 0) {
bodyflag = 1;
if (!avec_body)
error->all(FLERR,"Invalid data file section: Bodies");
if (atomflag == 0) error->all(FLERR,"Must read Atoms before Bodies");
bodies(firstpass);
} else if (strcmp(keyword,"Masses") == 0) {
if (firstpass) mass();
else skip_lines(ntypes);
} else if (strcmp(keyword,"Pair Coeffs") == 0) {
if (force->pair == NULL)
error->all(FLERR,"Must define pair_style before Pair Coeffs");
if (firstpass) {
if (me == 0 && !style_match(style,force->pair_style))
error->warning(FLERR,"Pair style in data file differs "
"from currently defined pair style");
paircoeffs();
} else skip_lines(ntypes);
} else if (strcmp(keyword,"PairIJ Coeffs") == 0) {
if (force->pair == NULL)
error->all(FLERR,"Must define pair_style before PairIJ Coeffs");
if (firstpass) {
if (me == 0 && !style_match(style,force->pair_style))
error->warning(FLERR,"Pair style in data file differs "
"from currently defined pair style");
pairIJcoeffs();
} else skip_lines(ntypes*(ntypes+1)/2);
} else if (strcmp(keyword,"Bond Coeffs") == 0) {
if (atom->avec->bonds_allow == 0)
error->all(FLERR,"Invalid data file section: Bond Coeffs");
if (force->bond == NULL)
error->all(FLERR,"Must define bond_style before Bond Coeffs");
if (firstpass) {
if (me == 0 && !style_match(style,force->bond_style))
error->warning(FLERR,"Bond style in data file differs "
"from currently defined bond style");
bondcoeffs();
} else skip_lines(nbondtypes);
} else if (strcmp(keyword,"Angle Coeffs") == 0) {
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Invalid data file section: Angle Coeffs");
if (force->angle == NULL)
error->all(FLERR,"Must define angle_style before Angle Coeffs");
if (firstpass) {
if (me == 0 && !style_match(style,force->angle_style))
error->warning(FLERR,"Angle style in data file differs "
"from currently defined angle style");
anglecoeffs(0);
} else skip_lines(nangletypes);
} else if (strcmp(keyword,"Dihedral Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: Dihedral Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,"Must define dihedral_style before Dihedral Coeffs");
if (firstpass) {
if (me == 0 && !style_match(style,force->dihedral_style))
error->warning(FLERR,"Dihedral style in data file differs "
"from currently defined dihedral style");
dihedralcoeffs(0);
} else skip_lines(ndihedraltypes);
} else if (strcmp(keyword,"Improper Coeffs") == 0) {
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Invalid data file section: Improper Coeffs");
if (force->improper == NULL)
error->all(FLERR,"Must define improper_style before Improper Coeffs");
if (firstpass) {
if (me == 0 && !style_match(style,force->improper_style))
error->warning(FLERR,"Improper style in data file differs "
"from currently defined improper style");
impropercoeffs(0);
} else skip_lines(nimpropertypes);
} else if (strcmp(keyword,"BondBond Coeffs") == 0) {
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Invalid data file section: BondBond Coeffs");
if (force->angle == NULL)
error->all(FLERR,"Must define angle_style before BondBond Coeffs");
if (firstpass) anglecoeffs(1);
else skip_lines(nangletypes);
} else if (strcmp(keyword,"BondAngle Coeffs") == 0) {
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Invalid data file section: BondAngle Coeffs");
if (force->angle == NULL)
error->all(FLERR,"Must define angle_style before BondAngle Coeffs");
if (firstpass) anglecoeffs(2);
else skip_lines(nangletypes);
} else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,
"Invalid data file section: MiddleBondTorsion Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before "
"MiddleBondTorsion Coeffs");
if (firstpass) dihedralcoeffs(1);
else skip_lines(ndihedraltypes);
} else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before EndBondTorsion Coeffs");
if (firstpass) dihedralcoeffs(2);
else skip_lines(ndihedraltypes);
} else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: AngleTorsion Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before AngleTorsion Coeffs");
if (firstpass) dihedralcoeffs(3);
else skip_lines(ndihedraltypes);
} else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,
"Invalid data file section: AngleAngleTorsion Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before "
"AngleAngleTorsion Coeffs");
if (firstpass) dihedralcoeffs(4);
else skip_lines(ndihedraltypes);
} else if (strcmp(keyword,"BondBond13 Coeffs") == 0) {
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Invalid data file section: BondBond13 Coeffs");
if (force->dihedral == NULL)
error->all(FLERR,
"Must define dihedral_style before BondBond13 Coeffs");
if (firstpass) dihedralcoeffs(5);
else skip_lines(ndihedraltypes);
} else if (strcmp(keyword,"AngleAngle Coeffs") == 0) {
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Invalid data file section: AngleAngle Coeffs");
if (force->improper == NULL)
error->all(FLERR,
"Must define improper_style before AngleAngle Coeffs");
if (firstpass) impropercoeffs(1);
else skip_lines(nimpropertypes);
} else {
char str[128];
sprintf(str,"Unknown identifier in data file: %s",keyword);
error->all(FLERR,str);
}
parse_keyword(0);
}
// error if natoms > 0 yet no atoms were read
if (natoms > 0 && atomflag == 0)
error->all(FLERR,"No atoms in data file");
// close file
if (me == 0) {
if (compressed) pclose(fp);
else fclose(fp);
fp = NULL;
}
// done if this was 2nd pass
if (!firstpass) break;
// at end of 1st pass, error check for required sections
// customize for new sections
if ((nbonds && !bondflag) || (nangles && !angleflag) ||
(ndihedrals && !dihedralflag) || (nimpropers && !improperflag))
error->one(FLERR,"Needed molecular topology not in data file");
if ((nellipsoids && !ellipsoidflag) || (nlines && !lineflag) ||
(ntris && !triflag) || (nbodies && !bodyflag))
error->one(FLERR,"Needed bonus data not in data file");
// break out of loop if no molecular topology in file
// else make 2nd pass
if (!topoflag) break;
firstpass = 0;
// reallocate bond,angle,diehdral,improper arrays via grow()
// will use new bond,angle,dihedral,improper per-atom values from 1st pass
// will also observe extra settings even if bond/etc topology not in file
// leaves other atom arrays unchanged, since already nmax in length
if (addflag == NONE) atom->deallocate_topology();
atom->avec->grow(atom->nmax);
}
// assign atoms added by this data file to specified group
if (groupbit) {
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = nlocal_previous; i < nlocal; i++)
mask[i] |= groupbit;
}
// create special bond lists for molecular systems
if (atom->molecular == 1) {
Special special(lmp);
special.build();
}
// for atom style template systems, count total bonds,angles,etc
if (atom->molecular == 2) {
Molecule **onemols = atom->avec->onemols;
int *molindex = atom->molindex;
int *molatom = atom->molatom;
int nlocal = atom->nlocal;
int imol,iatom;
bigint nbonds,nangles,ndihedrals,nimpropers;
nbonds = nangles = ndihedrals = nimpropers = 0;
for (int i = 0; i < nlocal; i++) {
imol = molindex[i];
iatom = molatom[i];
nbonds += onemols[imol]->num_bond[iatom];
nangles += onemols[imol]->num_angle[iatom];
ndihedrals += onemols[imol]->num_dihedral[iatom];
nimpropers += onemols[imol]->num_improper[iatom];
}
MPI_Allreduce(&nbonds,&atom->nbonds,1,MPI_LMP_BIGINT,MPI_SUM,world);
MPI_Allreduce(&nangles,&atom->nangles,1,MPI_LMP_BIGINT,MPI_SUM,world);
MPI_Allreduce(&ndihedrals,&atom->ndihedrals,1,MPI_LMP_BIGINT,MPI_SUM,world);
MPI_Allreduce(&nimpropers,&atom->nimpropers,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (!force->newton_bond) {
atom->nbonds /= 2;
atom->nangles /= 3;
atom->ndihedrals /= 4;
atom->nimpropers /= 4;
}
if (me == 0) {
if (atom->nbonds) {
if (screen)
fprintf(screen," " BIGINT_FORMAT " template bonds\n",atom->nbonds);
if (logfile)
fprintf(logfile," " BIGINT_FORMAT " template bonds\n",atom->nbonds);
}
if (atom->nangles) {
if (screen)
fprintf(screen," " BIGINT_FORMAT " template angles\n",
atom->nangles);
if (logfile)
fprintf(logfile," " BIGINT_FORMAT " template angles\n",
atom->nangles);
}
if (atom->ndihedrals) {
if (screen)
fprintf(screen," " BIGINT_FORMAT " template dihedrals\n",
atom->nbonds);
if (logfile)
fprintf(logfile," " BIGINT_FORMAT " template bonds\n",
atom->ndihedrals);
}
if (atom->nimpropers) {
if (screen)
fprintf(screen," " BIGINT_FORMAT " template impropers\n",
atom->nimpropers);
if (logfile)
fprintf(logfile," " BIGINT_FORMAT " template impropers\n",
atom->nimpropers);
}
}
}
// for atom style template systems
// insure nbondtypes,etc are still consistent with template molecules,
// in case data file re-defined them
if (atom->molecular == 2) atom->avec->onemols[0]->check_attributes(1);
// if adding atoms, migrate atoms to new processors
// use irregular() b/c box size could have changed dramaticaly
// resulting in procs now owning very different subboxes
// with their previously owned atoms now far outside the subbox
if (addflag != NONE) {
if (domain->triclinic) domain->x2lamda(atom->nlocal);
Irregular *irregular = new Irregular(lmp);
irregular->migrate_atoms(1);
delete irregular;
if (domain->triclinic) domain->lamda2x(atom->nlocal);
}
// shrink-wrap the box if necessary and move atoms to new procs
// if atoms are lost is b/c data file box was far from shrink-wrapped
// do not use irregular() comm, which would not lose atoms,
// b/c then user could specify data file box as far too big and empty
// do comm->init() but not comm->setup() b/c pair/neigh cutoffs not yet set
// need call to map_set() b/c comm->exchange clears atom map
if (domain->nonperiodic == 2) {
if (domain->triclinic) domain->x2lamda(atom->nlocal);
domain->reset_box();
comm->init();
comm->exchange();
if (atom->map_style) atom->map_set();
if (domain->triclinic) domain->lamda2x(atom->nlocal);
bigint natoms;
bigint nblocal = atom->nlocal;
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (natoms != atom->natoms)
error->all(FLERR,
"Read_data shrink wrap did not assign all atoms correctly");
}
}
/* ----------------------------------------------------------------------
read free-format header of data file
1st line and blank lines are skipped
non-blank lines are checked for header keywords and leading value is read
header ends with EOF or non-blank line containing no header keyword
if EOF, line is set to blank line
else line has first keyword line for rest of file
some logic differs if adding atoms
------------------------------------------------------------------------- */
void ReadData::header(int firstpass)
{
int n;
char *ptr;
// customize for new sections
const char *section_keywords[NSECTIONS] =
{"Atoms","Velocities","Ellipsoids","Lines","Triangles","Bodies",
"Bonds","Angles","Dihedrals","Impropers",
"Masses","Pair Coeffs","PairIJ Coeffs","Bond Coeffs","Angle Coeffs",
"Dihedral Coeffs","Improper Coeffs",
"BondBond Coeffs","BondAngle Coeffs","MiddleBondTorsion Coeffs",
"EndBondTorsion Coeffs","AngleTorsion Coeffs",
"AngleAngleTorsion Coeffs","BondBond13 Coeffs","AngleAngle Coeffs"};
// skip 1st line of file
if (me == 0) {
char *eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
}
while (1) {
// read a line and bcast length
if (me == 0) {
if (fgets(line,MAXLINE,fp) == NULL) n = 0;
else n = strlen(line) + 1;
}
MPI_Bcast(&n,1,MPI_INT,0,world);
// if n = 0 then end-of-file so return with blank line
if (n == 0) {
line[0] = '\0';
return;
}
MPI_Bcast(line,n,MPI_CHAR,0,world);
// trim anything from '#' onward
// if line is blank, continue
if ((ptr = strchr(line,'#'))) *ptr = '\0';
if (strspn(line," \t\n\r") == strlen(line)) continue;
// allow special fixes first chance to match and process the line
// if fix matches, continue to next header line
if (nfix) {
for (n = 0; n < nfix; n++) {
if (!fix_header[n]) continue;
if (strstr(line,fix_header[n])) {
modify->fix[fix_index[n]]->read_data_header(line);
break;
}
}
if (n < nfix) continue;
}
// search line for header keyword and set corresponding variable
// customize for new header lines
if (strstr(line,"atoms")) {
sscanf(line,BIGINT_FORMAT,&natoms);
if (addflag == NONE) atom->natoms = natoms;
else if (firstpass) atom->natoms += natoms;
// check for these first
// otherwise "triangles" will be matched as "angles"
} else if (strstr(line,"ellipsoids")) {
if (!avec_ellipsoid)
error->all(FLERR,"No ellipsoids allowed with this atom style");
sscanf(line,BIGINT_FORMAT,&nellipsoids);
} else if (strstr(line,"lines")) {
if (!avec_line)
error->all(FLERR,"No lines allowed with this atom style");
sscanf(line,BIGINT_FORMAT,&nlines);
} else if (strstr(line,"triangles")) {
if (!avec_tri)
error->all(FLERR,"No triangles allowed with this atom style");
sscanf(line,BIGINT_FORMAT,&ntris);
} else if (strstr(line,"bodies")) {
if (!avec_body)
error->all(FLERR,"No bodies allowed with this atom style");
sscanf(line,BIGINT_FORMAT,&nbodies);
} else if (strstr(line,"bonds")) {
sscanf(line,BIGINT_FORMAT,&nbonds);
if (addflag == NONE) atom->nbonds = nbonds;
else if (firstpass) atom->nbonds += nbonds;
} else if (strstr(line,"angles")) {
sscanf(line,BIGINT_FORMAT,&nangles);
if (addflag == NONE) atom->nangles = nangles;
else if (firstpass) atom->nangles += nangles;
} else if (strstr(line,"dihedrals")) {
sscanf(line,BIGINT_FORMAT,&ndihedrals);
if (addflag == NONE) atom->ndihedrals = ndihedrals;
else if (firstpass) atom->ndihedrals += ndihedrals;
} else if (strstr(line,"impropers")) {
sscanf(line,BIGINT_FORMAT,&nimpropers);
if (addflag == NONE) atom->nimpropers = nimpropers;
else if (firstpass) atom->nimpropers += nimpropers;
// Atom class type settings are only set by first data file
} else if (strstr(line,"atom types")) {
sscanf(line,"%d",&ntypes);
if (addflag == NONE) atom->ntypes = ntypes + extra_atom_types;
} else if (strstr(line,"bond types")) {
sscanf(line,"%d",&nbondtypes);
if (addflag == NONE) atom->nbondtypes = nbondtypes + extra_bond_types;
} else if (strstr(line,"angle types")) {
sscanf(line,"%d",&nangletypes);
if (addflag == NONE) atom->nangletypes = nangletypes + extra_angle_types;
} else if (strstr(line,"dihedral types")) {
sscanf(line,"%d",&ndihedraltypes);
if (addflag == NONE)
atom->ndihedraltypes = ndihedraltypes + extra_dihedral_types;
} else if (strstr(line,"improper types")) {
sscanf(line,"%d",&nimpropertypes);
if (addflag == NONE)
atom->nimpropertypes = nimpropertypes + extra_improper_types;
// these settings only used by first data file
} else if (strstr(line,"extra bond per atom")) {
if (addflag == NONE) sscanf(line,"%d",&atom->extra_bond_per_atom);
} else if (strstr(line,"extra angle per atom")) {
if (addflag == NONE) sscanf(line,"%d",&atom->extra_angle_per_atom);
} else if (strstr(line,"extra dihedral per atom")) {
if (addflag == NONE) sscanf(line,"%d",&atom->extra_dihedral_per_atom);
} else if (strstr(line,"extra improper per atom")) {
if (addflag == NONE) sscanf(line,"%d",&atom->extra_improper_per_atom);
} else if (strstr(line,"extra special per atom")) {
if (addflag == NONE) sscanf(line,"%d",&force->special_extra);
// local copy of box info
// so can treat differently for first vs subsequent data files
} else if (strstr(line,"xlo xhi")) {
sscanf(line,"%lg %lg",&boxlo[0],&boxhi[0]);
} else if (strstr(line,"ylo yhi")) {
sscanf(line,"%lg %lg",&boxlo[1],&boxhi[1]);
} else if (strstr(line,"zlo zhi")) {
sscanf(line,"%lg %lg",&boxlo[2],&boxhi[2]);
} else if (strstr(line,"xy xz yz")) {
triclinic = 1;
sscanf(line,"%lg %lg %lg",&xy,&xz,&yz);
} else break;
}
// error check on total system size
if (atom->natoms < 0 || atom->natoms >= MAXBIGINT ||
atom->nbonds < 0 || atom->nbonds >= MAXBIGINT ||
atom->nangles < 0 || atom->nangles >= MAXBIGINT ||
atom->ndihedrals < 0 || atom->ndihedrals >= MAXBIGINT ||
atom->nimpropers < 0 || atom->nimpropers >= MAXBIGINT)
error->all(FLERR,"System in data file is too big");
// check that exiting string is a valid section keyword
parse_keyword(1);
for (n = 0; n < NSECTIONS; n++)
if (strcmp(keyword,section_keywords[n]) == 0) break;
if (n == NSECTIONS) {
char str[128];
sprintf(str,"Unknown identifier in data file: %s",keyword);
error->all(FLERR,str);
}
// error checks on header values
// must be consistent with atom style and other header values
if ((atom->nbonds || atom->nbondtypes) &&
atom->avec->bonds_allow == 0)
error->all(FLERR,"No bonds allowed with this atom style");
if ((atom->nangles || atom->nangletypes) &&
atom->avec->angles_allow == 0)
error->all(FLERR,"No angles allowed with this atom style");
if ((atom->ndihedrals || atom->ndihedraltypes) &&
atom->avec->dihedrals_allow == 0)
error->all(FLERR,"No dihedrals allowed with this atom style");
if ((atom->nimpropers || atom->nimpropertypes) &&
atom->avec->impropers_allow == 0)
error->all(FLERR,"No impropers allowed with this atom style");
if (atom->nbonds > 0 && atom->nbondtypes <= 0)
error->all(FLERR,"Bonds defined but no bond types");
if (atom->nangles > 0 && atom->nangletypes <= 0)
error->all(FLERR,"Angles defined but no angle types");
if (atom->ndihedrals > 0 && atom->ndihedraltypes <= 0)
error->all(FLERR,"Dihedrals defined but no dihedral types");
if (atom->nimpropers > 0 && atom->nimpropertypes <= 0)
error->all(FLERR,"Impropers defined but no improper types");
if (atom->molecular == 2) {
if (atom->nbonds || atom->nangles || atom->ndihedrals || atom->nimpropers)
error->all(FLERR,"No molecule topology allowed with atom style template");
}
}
/* ----------------------------------------------------------------------
read all atoms
------------------------------------------------------------------------- */
void ReadData::atoms()
{
int nchunk,eof;
if (me == 0) {
if (screen) fprintf(screen," reading atoms ...\n");
if (logfile) fprintf(logfile," reading atoms ...\n");
}
bigint nread = 0;
while (nread < natoms) {
nchunk = MIN(natoms-nread,CHUNK);
eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
if (eof) error->all(FLERR,"Unexpected end of data file");
atom->data_atoms(nchunk,buffer,id_offset,toffset,shiftflag,shift);
nread += nchunk;
}
// check that all atoms were assigned correctly
bigint n = atom->nlocal;
bigint sum;
MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
bigint nassign = sum - (atom->natoms - natoms);
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " atoms\n",nassign);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " atoms\n",nassign);
}
if (sum != atom->natoms)
error->all(FLERR,"Did not assign all atoms correctly");
// check that atom IDs are valid
atom->tag_check();
// create global mapping of atoms
if (atom->map_style) {
atom->map_init();
atom->map_set();
}
}
/* ----------------------------------------------------------------------
read all velocities
to find atoms, must build atom map if not a molecular system
------------------------------------------------------------------------- */
void ReadData::velocities()
{
int nchunk,eof;
if (me == 0) {
if (screen) fprintf(screen," reading velocities ...\n");
if (logfile) fprintf(logfile," reading velocities ...\n");
}
int mapflag = 0;
if (atom->map_style == 0) {
mapflag = 1;
atom->map_init();
atom->map_set();
}
bigint nread = 0;
while (nread < natoms) {
nchunk = MIN(natoms-nread,CHUNK);
eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
if (eof) error->all(FLERR,"Unexpected end of data file");
atom->data_vels(nchunk,buffer,id_offset);
nread += nchunk;
}
if (mapflag) {
atom->map_delete();
atom->map_style = 0;
}
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " velocities\n",natoms);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " velocities\n",natoms);
}
}
/* ----------------------------------------------------------------------
scan or read all bonds
------------------------------------------------------------------------- */
void ReadData::bonds(int firstpass)
{
int nchunk,eof;
if (me == 0) {
if (firstpass) {
if (screen) fprintf(screen," scanning bonds ...\n");
if (logfile) fprintf(logfile," scanning bonds ...\n");
} else {
if (screen) fprintf(screen," reading bonds ...\n");
if (logfile) fprintf(logfile," reading bonds ...\n");
}
}
// allocate count if firstpass
int nlocal = atom->nlocal;
int *count = NULL;
if (firstpass) {
memory->create(count,nlocal,"read_data:count");
for (int i = 0; i < nlocal; i++) count[i] = 0;
}
// read and process bonds
bigint nread = 0;
while (nread < nbonds) {
nchunk = MIN(nbonds-nread,CHUNK);
eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
if (eof) error->all(FLERR,"Unexpected end of data file");
atom->data_bonds(nchunk,buffer,count,id_offset,boffset);
nread += nchunk;
}
// if firstpass: tally max bond/atom and return
// if addflag = NONE, store max bond/atom with extra
// else just check actual max does not exceed existing max
if (firstpass) {
int max = 0;
for (int i = nlocal_previous; i < nlocal; i++) max = MAX(max,count[i]);
int maxall;
MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
if (addflag == NONE) maxall += atom->extra_bond_per_atom;
if (me == 0) {
if (screen) fprintf(screen," %d = max bonds/atom\n",maxall);
if (logfile) fprintf(logfile," %d = max bonds/atom\n",maxall);
}
if (addflag != NONE) {
if (maxall > atom->bond_per_atom)
error->all(FLERR,"Subsequent read data induced "
"too many bonds per atom");
} else atom->bond_per_atom = maxall;
memory->destroy(count);
return;
}
// if 2nd pass: check that bonds were assigned correctly
bigint n = 0;
for (int i = nlocal_previous; i < nlocal; i++) n += atom->num_bond[i];
bigint sum;
MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
int factor = 1;
if (!force->newton_bond) factor = 2;
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " bonds\n",sum/factor);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " bonds\n",sum/factor);
}
if (sum != factor*nbonds)
error->all(FLERR,"Bonds assigned incorrectly");
}
/* ----------------------------------------------------------------------
scan or read all angles
------------------------------------------------------------------------- */
void ReadData::angles(int firstpass)
{
int nchunk,eof;
if (me == 0) {
if (firstpass) {
if (screen) fprintf(screen," scanning angles ...\n");
if (logfile) fprintf(logfile," scanning angles ...\n");
} else {
if (screen) fprintf(screen," reading angles ...\n");
if (logfile) fprintf(logfile," reading angles ...\n");
}
}
// allocate count if firstpass
int nlocal = atom->nlocal;
int *count = NULL;
if (firstpass) {
memory->create(count,nlocal,"read_data:count");
for (int i = 0; i < nlocal; i++) count[i] = 0;
}
// read and process angles
bigint nread = 0;
while (nread < nangles) {
nchunk = MIN(nangles-nread,CHUNK);
eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
if (eof) error->all(FLERR,"Unexpected end of data file");
atom->data_angles(nchunk,buffer,count,id_offset,aoffset);
nread += nchunk;
}
// if firstpass: tally max angle/atom and return
// if addflag = NONE, store max angle/atom with extra
// else just check actual max does not exceed existing max
if (firstpass) {
int max = 0;
for (int i = nlocal_previous; i < nlocal; i++) max = MAX(max,count[i]);
int maxall;
MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
if (addflag == NONE) maxall += atom->extra_angle_per_atom;
if (me == 0) {
if (screen) fprintf(screen," %d = max angles/atom\n",maxall);
if (logfile) fprintf(logfile," %d = max angles/atom\n",maxall);
}
if (addflag != NONE) {
if (maxall > atom->angle_per_atom)
error->all(FLERR,"Subsequent read data induced "
"too many angles per atom");
} else atom->angle_per_atom = maxall;
memory->destroy(count);
return;
}
// if 2nd pass: check that angles were assigned correctly
bigint n = 0;
for (int i = nlocal_previous; i < nlocal; i++) n += atom->num_angle[i];
bigint sum;
MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
int factor = 1;
if (!force->newton_bond) factor = 3;
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " angles\n",sum/factor);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " angles\n",sum/factor);
}
if (sum != factor*nangles)
error->all(FLERR,"Angles assigned incorrectly");
}
/* ----------------------------------------------------------------------
scan or read all dihedrals
------------------------------------------------------------------------- */
void ReadData::dihedrals(int firstpass)
{
int nchunk,eof;
if (me == 0) {
if (firstpass) {
if (screen) fprintf(screen," scanning dihedrals ...\n");
if (logfile) fprintf(logfile," scanning dihedrals ...\n");
} else {
if (screen) fprintf(screen," reading dihedrals ...\n");
if (logfile) fprintf(logfile," reading dihedrals ...\n");
}
}
// allocate count if firstpass
int nlocal = atom->nlocal;
int *count = NULL;
if (firstpass) {
memory->create(count,nlocal,"read_data:count");
for (int i = 0; i < nlocal; i++) count[i] = 0;
}
// read and process dihedrals
bigint nread = 0;
while (nread < ndihedrals) {
nchunk = MIN(ndihedrals-nread,CHUNK);
eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
if (eof) error->all(FLERR,"Unexpected end of data file");
atom->data_dihedrals(nchunk,buffer,count,id_offset,doffset);
nread += nchunk;
}
// if firstpass: tally max dihedral/atom and return
// if addflag = NONE, store max dihedral/atom with extra
// else just check actual max does not exceed existing max
if (firstpass) {
int max = 0;
for (int i = 0; i < nlocal; i++) max = MAX(max,count[i]);
int maxall;
MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
if (addflag == NONE) maxall += atom->extra_dihedral_per_atom;
if (me == 0) {
if (screen) fprintf(screen," %d = max dihedrals/atom\n",maxall);
if (logfile) fprintf(logfile," %d = max dihedrals/atom\n",maxall);
}
if (addflag != NONE) {
if (maxall > atom->dihedral_per_atom)
error->all(FLERR,"Subsequent read data induced "
"too many dihedrals per atom");
} else atom->dihedral_per_atom = maxall;
atom->dihedral_per_atom = maxall;
memory->destroy(count);
return;
}
// if 2nd pass: check that dihedrals were assigned correctly
bigint n = 0;
for (int i = nlocal_previous; i < nlocal; i++) n += atom->num_dihedral[i];
bigint sum;
MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
int factor = 1;
if (!force->newton_bond) factor = 4;
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " dihedrals\n",sum/factor);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " dihedrals\n",sum/factor);
}
if (sum != factor*ndihedrals)
error->all(FLERR,"Dihedrals assigned incorrectly");
}
/* ----------------------------------------------------------------------
scan or read all impropers
------------------------------------------------------------------------- */
void ReadData::impropers(int firstpass)
{
int nchunk,eof;
if (me == 0) {
if (firstpass) {
if (screen) fprintf(screen," scanning impropers ...\n");
if (logfile) fprintf(logfile," scanning impropers ...\n");
} else {
if (screen) fprintf(screen," reading impropers ...\n");
if (logfile) fprintf(logfile," reading impropers ...\n");
}
}
// allocate count if firstpass
int nlocal = atom->nlocal;
int *count = NULL;
if (firstpass) {
memory->create(count,nlocal,"read_data:count");
for (int i = 0; i < nlocal; i++) count[i] = 0;
}
// read and process impropers
bigint nread = 0;
while (nread < nimpropers) {
nchunk = MIN(nimpropers-nread,CHUNK);
eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
if (eof) error->all(FLERR,"Unexpected end of data file");
atom->data_impropers(nchunk,buffer,count,id_offset,ioffset);
nread += nchunk;
}
// if firstpass: tally max improper/atom and return
// if addflag = NONE, store max improper/atom
// else just check it does not exceed existing max
if (firstpass) {
int max = 0;
for (int i = nlocal_previous; i < nlocal; i++) max = MAX(max,count[i]);
int maxall;
MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
if (addflag == NONE) maxall += atom->extra_improper_per_atom;
if (me == 0) {
if (screen) fprintf(screen," %d = max impropers/atom\n",maxall);
if (logfile) fprintf(logfile," %d = max impropers/atom\n",maxall);
}
if (addflag != NONE) {
if (maxall > atom->improper_per_atom)
error->all(FLERR,"Subsequent read data induced "
"too many impropers per atom");
} else atom->improper_per_atom = maxall;
memory->destroy(count);
return;
}
// if 2nd pass: check that impropers were assigned correctly
bigint n = 0;
for (int i = nlocal_previous; i < nlocal; i++) n += atom->num_improper[i];
bigint sum;
MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
int factor = 1;
if (!force->newton_bond) factor = 4;
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " impropers\n",sum/factor);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " impropers\n",sum/factor);
}
if (sum != factor*nimpropers)
error->all(FLERR,"Impropers assigned incorrectly");
}
/* ----------------------------------------------------------------------
read all bonus data
to find atoms, must build atom map if not a molecular system
------------------------------------------------------------------------- */
void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type)
{
int nchunk,eof;
int mapflag = 0;
if (atom->map_style == 0) {
mapflag = 1;
atom->map_init();
atom->map_set();
}
bigint nread = 0;
bigint natoms = nbonus;
while (nread < natoms) {
nchunk = MIN(natoms-nread,CHUNK);
eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
if (eof) error->all(FLERR,"Unexpected end of data file");
atom->data_bonus(nchunk,buffer,ptr,id_offset);
nread += nchunk;
}
if (mapflag) {
atom->map_delete();
atom->map_style = 0;
}
if (me == 0) {
if (screen) fprintf(screen," " BIGINT_FORMAT " %s\n",natoms,type);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " %s\n",natoms,type);
}
}
/* ----------------------------------------------------------------------
read all body data
variable amount of info per body, described by ninteger and ndouble
to find atoms, must build atom map if not a molecular system
if not firstpass, just read past data, but no processing of data
------------------------------------------------------------------------- */
void ReadData::bodies(int firstpass)
{
- int i,m,nchunk,nline,nmax,ninteger,ndouble,nword,onebody,tmp;
+ int i,m,nchunk,nline,nmax,ninteger,ndouble,nword,ncount,onebody,tmp;
char *eof;
int mapflag = 0;
if (atom->map_style == 0 && firstpass) {
mapflag = 1;
atom->map_init();
atom->map_set();
}
// nmax = max # of bodies to read in this chunk
// nchunk = actual # read
bigint nread = 0;
bigint natoms = nbodies;
while (nread < natoms) {
if (natoms-nread > CHUNK) nmax = CHUNK;
else nmax = natoms-nread;
if (me == 0) {
nchunk = 0;
nline = 0;
m = 0;
while (nchunk < nmax && nline <= CHUNK-MAXBODY) {
eof = fgets(&buffer[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
sscanf(&buffer[m],"%d %d %d",&tmp,&ninteger,&ndouble);
m += strlen(&buffer[m]);
- // read lines one at a time into buffer
- // make copy of line and count words
+ // read lines one at a time into buffer and count words
// count to ninteger and ndouble until have enough lines
onebody = 0;
nword = 0;
while (nword < ninteger) {
eof = fgets(&buffer[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
- nword += atom->count_words(&buffer[m],copy);
+ ncount = atom->count_words(&buffer[m],copy);
+ if (ncount == 0)
+ error->one(FLERR,"Too few values in body lines in data file");
+ nword += ncount;
m += strlen(&buffer[m]);
onebody++;
}
if (nword > ninteger)
- error->one(FLERR,"Too many value in body lines in data file");
+ error->one(FLERR,"Too many values in body lines in data file");
nword = 0;
while (nword < ndouble) {
eof = fgets(&buffer[m],MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
- nword += atom->count_words(&buffer[m],copy);
+ ncount = atom->count_words(&buffer[m],copy);
+ if (ncount == 0)
+ error->one(FLERR,"Too few values in body lines in data file");
+ nword += ncount;
m += strlen(&buffer[m]);
onebody++;
}
if (nword > ndouble)
- error->one(FLERR,"Too many value in body lines in data file");
+ error->one(FLERR,"Too many values in body lines in data file");
if (onebody+1 > MAXBODY)
error->one(FLERR,
"Too many lines in one body in data file - boost MAXBODY");
nchunk++;
nline += onebody+1;
}
if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n");
m++;
}
MPI_Bcast(&nchunk,1,MPI_INT,0,world);
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buffer,m,MPI_CHAR,0,world);
if (firstpass) atom->data_bodies(nchunk,buffer,avec_body,id_offset);
nread += nchunk;
}
if (mapflag && firstpass) {
atom->map_delete();
atom->map_style = 0;
}
if (me == 0 && firstpass) {
if (screen) fprintf(screen," " BIGINT_FORMAT " bodies\n",natoms);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " bodies\n",natoms);
}
}
/* ---------------------------------------------------------------------- */
void ReadData::mass()
{
char *next;
char *buf = new char[ntypes*MAXLINE];
int eof = comm->read_lines_from_file(fp,ntypes,MAXLINE,buf);
if (eof) error->all(FLERR,"Unexpected end of data file");
char *original = buf;
for (int i = 0; i < ntypes; i++) {
next = strchr(buf,'\n');
*next = '\0';
atom->set_mass(buf,toffset);
buf = next + 1;
}
delete [] original;
}
/* ---------------------------------------------------------------------- */
void ReadData::paircoeffs()
{
char *next;
char *buf = new char[ntypes*MAXLINE];
int eof = comm->read_lines_from_file(fp,ntypes,MAXLINE,buf);
if (eof) error->all(FLERR,"Unexpected end of data file");
char *original = buf;
for (int i = 0; i < ntypes; i++) {
next = strchr(buf,'\n');
*next = '\0';
parse_coeffs(buf,NULL,1,2,toffset);
if (narg == 0) error->all(FLERR,"Unexpected end of PairCoeffs section");
force->pair->coeff(narg,arg);
buf = next + 1;
}
delete [] original;
}
/* ---------------------------------------------------------------------- */
void ReadData::pairIJcoeffs()
{
int i,j;
char *next;
int nsq = ntypes * (ntypes+1) / 2;
char *buf = new char[nsq * MAXLINE];
int eof = comm->read_lines_from_file(fp,nsq,MAXLINE,buf);
if (eof) error->all(FLERR,"Unexpected end of data file");
char *original = buf;
for (i = 0; i < ntypes; i++)
for (j = i; j < ntypes; j++) {
next = strchr(buf,'\n');
*next = '\0';
parse_coeffs(buf,NULL,0,2,toffset);
if (narg == 0) error->all(FLERR,"Unexpected end of PairCoeffs section");
force->pair->coeff(narg,arg);
buf = next + 1;
}
delete [] original;
}
/* ---------------------------------------------------------------------- */
void ReadData::bondcoeffs()
{
char *next;
char *buf = new char[nbondtypes*MAXLINE];
int eof = comm->read_lines_from_file(fp,nbondtypes,MAXLINE,buf);
if (eof) error->all(FLERR,"Unexpected end of data file");
char *original = buf;
for (int i = 0; i < nbondtypes; i++) {
next = strchr(buf,'\n');
*next = '\0';
parse_coeffs(buf,NULL,0,1,boffset);
if (narg == 0) error->all(FLERR,"Unexpected end of BondCoeffs section");
force->bond->coeff(narg,arg);
buf = next + 1;
}
delete [] original;
}
/* ---------------------------------------------------------------------- */
void ReadData::anglecoeffs(int which)
{
char *next;
char *buf = new char[nangletypes*MAXLINE];
int eof = comm->read_lines_from_file(fp,nangletypes,MAXLINE,buf);
if (eof) error->all(FLERR,"Unexpected end of data file");
char *original = buf;
for (int i = 0; i < nangletypes; i++) {
next = strchr(buf,'\n');
*next = '\0';
if (which == 0) parse_coeffs(buf,NULL,0,1,aoffset);
else if (which == 1) parse_coeffs(buf,"bb",0,1,aoffset);
else if (which == 2) parse_coeffs(buf,"ba",0,1,aoffset);
if (narg == 0) error->all(FLERR,"Unexpected end of AngleCoeffs section");
force->angle->coeff(narg,arg);
buf = next + 1;
}
delete [] original;
}
/* ---------------------------------------------------------------------- */
void ReadData::dihedralcoeffs(int which)
{
char *next;
char *buf = new char[ndihedraltypes*MAXLINE];
int eof = comm->read_lines_from_file(fp,ndihedraltypes,MAXLINE,buf);
if (eof) error->all(FLERR,"Unexpected end of data file");
char *original = buf;
for (int i = 0; i < ndihedraltypes; i++) {
next = strchr(buf,'\n');
*next = '\0';
if (which == 0) parse_coeffs(buf,NULL,0,1,doffset);
else if (which == 1) parse_coeffs(buf,"mbt",0,1,doffset);
else if (which == 2) parse_coeffs(buf,"ebt",0,1,doffset);
else if (which == 3) parse_coeffs(buf,"at",0,1,doffset);
else if (which == 4) parse_coeffs(buf,"aat",0,1,doffset);
else if (which == 5) parse_coeffs(buf,"bb13",0,1,doffset);
if (narg == 0) error->all(FLERR,"Unexpected end of DihedralCoeffs section");
force->dihedral->coeff(narg,arg);
buf = next + 1;
}
delete [] original;
}
/* ---------------------------------------------------------------------- */
void ReadData::impropercoeffs(int which)
{
char *next;
char *buf = new char[nimpropertypes*MAXLINE];
int eof = comm->read_lines_from_file(fp,nimpropertypes,MAXLINE,buf);
if (eof) error->all(FLERR,"Unexpected end of data file");
char *original = buf;
for (int i = 0; i < nimpropertypes; i++) {
next = strchr(buf,'\n');
*next = '\0';
if (which == 0) parse_coeffs(buf,NULL,0,1,ioffset);
else if (which == 1) parse_coeffs(buf,"aa",0,1,ioffset);
if (narg == 0) error->all(FLERR,"Unexpected end of ImproperCoeffs section");
force->improper->coeff(narg,arg);
buf = next + 1;
}
delete [] original;
}
/* ----------------------------------------------------------------------
read fix section, pass lines to fix to process
n = index of fix
------------------------------------------------------------------------- */
void ReadData::fix(int ifix, char *keyword)
{
int nchunk,eof;
bigint nline = modify->fix[ifix]->read_data_skip_lines(keyword);
bigint nread = 0;
while (nread < nline) {
nchunk = MIN(nline-nread,CHUNK);
eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
if (eof) error->all(FLERR,"Unexpected end of data file");
modify->fix[ifix]->read_data_section(keyword,nchunk,buffer,id_offset);
nread += nchunk;
}
}
/* ----------------------------------------------------------------------
reallocate the count vector from cmax to amax+1 and return new length
zero new locations
------------------------------------------------------------------------- */
int ReadData::reallocate(int **pcount, int cmax, int amax)
{
int *count = *pcount;
memory->grow(count,amax+1,"read_data:count");
for (int i = cmax; i <= amax; i++) count[i] = 0;
*pcount = count;
return amax+1;
}
/* ----------------------------------------------------------------------
proc 0 opens data file
test if gzipped
------------------------------------------------------------------------- */
void ReadData::open(char *file)
{
compressed = 0;
char *suffix = file + strlen(file) - 3;
if (suffix > file && strcmp(suffix,".gz") == 0) compressed = 1;
if (!compressed) fp = fopen(file,"r");
else {
#ifdef LAMMPS_GZIP
char gunzip[128];
sprintf(gunzip,"gzip -c -d %s",file);
#ifdef _WIN32
fp = _popen(gunzip,"rb");
#else
fp = popen(gunzip,"r");
#endif
#else
error->one(FLERR,"Cannot open gzipped file");
#endif
}
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open file %s",file);
error->one(FLERR,str);
}
}
/* ----------------------------------------------------------------------
grab next keyword
read lines until one is non-blank
keyword is all text on line w/out leading & trailing white space
optional style can be appended after comment char '#'
read one additional line (assumed blank)
if any read hits EOF, set keyword to empty
if first = 1, line variable holds non-blank line that ended header
------------------------------------------------------------------------- */
void ReadData::parse_keyword(int first)
{
int eof = 0;
int done = 0;
// proc 0 reads upto non-blank line plus 1 following line
// eof is set to 1 if any read hits end-of-file
if (me == 0) {
if (!first) {
if (fgets(line,MAXLINE,fp) == NULL) eof = 1;
}
while (eof == 0 && done == 0) {
int blank = strspn(line," \t\n\r");
if ((blank == strlen(line)) || (line[blank] == '#')) {
if (fgets(line,MAXLINE,fp) == NULL) eof = 1;
} else done = 1;
}
if (fgets(buffer,MAXLINE,fp) == NULL) {
eof = 1;
buffer[0] = '\0';
}
}
// if eof, set keyword empty and return
MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) {
keyword[0] = '\0';
return;
}
// bcast keyword line to all procs
int n;
if (me == 0) n = strlen(line) + 1;
MPI_Bcast(&n,1,MPI_INT,0,world);
MPI_Bcast(line,n,MPI_CHAR,0,world);
// store optional "style" following comment char '#' after keyword
char *ptr;
if ((ptr = strchr(line,'#'))) {
*ptr++ = '\0';
while (*ptr == ' ' || *ptr == '\t') ptr++;
int stop = strlen(ptr) - 1;
while (ptr[stop] == ' ' || ptr[stop] == '\t'
|| ptr[stop] == '\n' || ptr[stop] == '\r') stop--;
ptr[stop+1] = '\0';
strcpy(style,ptr);
} else style[0] = '\0';
// copy non-whitespace portion of line into keyword
int start = strspn(line," \t\n\r");
int stop = strlen(line) - 1;
while (line[stop] == ' ' || line[stop] == '\t'
|| line[stop] == '\n' || line[stop] == '\r') stop--;
line[stop+1] = '\0';
strcpy(keyword,&line[start]);
}
/* ----------------------------------------------------------------------
proc 0 reads N lines from file
could be skipping Natoms lines, so use bigints
------------------------------------------------------------------------- */
void ReadData::skip_lines(bigint n)
{
if (me) return;
if (n <= 0) return;
char *eof = NULL;
for (bigint i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
}
/* ----------------------------------------------------------------------
parse a line of coeffs into words, storing them in narg,arg
trim anything from '#' onward
word strings remain in line, are not copied
if addstr != NULL, add addstr as extra arg for class2 angle/dihedral/improper
if 2nd word starts with letter, then is hybrid style, add addstr after it
else add addstr before 2nd word
if dupflag, duplicate 1st word, so pair_coeff "2" becomes "2 2"
if noffset, add offset to first noffset args, which are atom/bond/etc types
------------------------------------------------------------------------- */
void ReadData::parse_coeffs(char *line, const char *addstr,
int dupflag, int noffset, int offset)
{
char *ptr;
if ((ptr = strchr(line,'#'))) *ptr = '\0';
narg = 0;
char *word = strtok(line," \t\n\r\f");
while (word) {
if (narg == maxarg) {
maxarg += DELTA;
arg = (char **)
memory->srealloc(arg,maxarg*sizeof(char *),"read_data:arg");
}
if (addstr && narg == 1 && !islower(word[0])) arg[narg++] = (char *) addstr;
arg[narg++] = word;
if (addstr && narg == 2 && islower(word[0])) arg[narg++] = (char *) addstr;
if (dupflag && narg == 1) arg[narg++] = word;
word = strtok(NULL," \t\n\r\f");
}
if (noffset) {
int value = force->inumeric(FLERR,arg[0]);
sprintf(argoffset1,"%d",value+offset);
arg[0] = argoffset1;
if (noffset == 2) {
value = force->inumeric(FLERR,arg[1]);
sprintf(argoffset2,"%d",value+offset);
arg[1] = argoffset2;
}
}
}
/* ----------------------------------------------------------------------
compare two style strings if they both exist
one = comment in data file section, two = currently-defined style
ignore suffixes listed in suffixes array at top of file
------------------------------------------------------------------------- */
int ReadData::style_match(const char *one, const char *two)
{
int i,delta,len,len1,len2;
if ((one == NULL) || (two == NULL)) return 1;
len1 = strlen(one);
len2 = strlen(two);
for (i = 0; suffixes[i] != NULL; i++) {
len = strlen(suffixes[i]);
if ((delta = len1 - len) > 0)
if (strcmp(one+delta,suffixes[i]) == 0) len1 = delta;
if ((delta = len2 - len) > 0)
if (strcmp(two+delta,suffixes[i]) == 0) len2 = delta;
}
if ((len1 == 0) || (len1 == len2) || (strncmp(one,two,len1) == 0)) return 1;
return 0;
}
diff --git a/src/respa.cpp b/src/respa.cpp
index e8381b829..37b3fef32 100644
--- a/src/respa.cpp
+++ b/src/respa.cpp
@@ -1,854 +1,855 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing authors: Mark Stevens (SNL), Paul Crozier (SNL)
------------------------------------------------------------------------- */
#include <stdlib.h>
#include <string.h>
#include "respa.h"
#include "neighbor.h"
#include "atom.h"
#include "atom_vec.h"
#include "domain.h"
#include "comm.h"
#include "force.h"
#include "pair.h"
#include "bond.h"
#include "angle.h"
#include "dihedral.h"
#include "improper.h"
#include "kspace.h"
#include "output.h"
#include "update.h"
#include "modify.h"
#include "compute.h"
#include "fix_respa.h"
#include "timer.h"
#include "memory.h"
#include "error.h"
#include "pair_hybrid.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg)
{
if (narg < 1) error->all(FLERR,"Illegal run_style respa command");
nlevels = force->inumeric(FLERR,arg[0]);
if (nlevels < 1) error->all(FLERR,"Respa levels must be >= 1");
if (narg < nlevels) error->all(FLERR,"Illegal run_style respa command");
loop = new int[nlevels];
for (int iarg = 1; iarg < nlevels; iarg++) {
loop[iarg-1] = force->inumeric(FLERR,arg[iarg]);
if (loop[iarg-1] <= 0) error->all(FLERR,"Illegal run_style respa command");
}
loop[nlevels-1] = 1;
// set level at which each force is computed
// argument settings override defaults
level_bond = level_angle = level_dihedral = level_improper = -1;
level_pair = level_kspace = -1;
level_inner = level_middle = level_outer = -1;
// defaults for hybrid pair styles
nhybrid_styles = 0;
tally_global = 1;
pair_compute = 1;
int iarg = nlevels;
while (iarg < narg) {
if (strcmp(arg[iarg],"bond") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
level_bond = force->inumeric(FLERR,arg[iarg+1]) - 1;
iarg += 2;
} else if (strcmp(arg[iarg],"angle") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
level_angle = force->inumeric(FLERR,arg[iarg+1]) - 1;
iarg += 2;
} else if (strcmp(arg[iarg],"dihedral") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
level_dihedral = force->inumeric(FLERR,arg[iarg+1]) - 1;
iarg += 2;
} else if (strcmp(arg[iarg],"improper") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
level_improper = force->inumeric(FLERR,arg[iarg+1]) - 1;
iarg += 2;
} else if (strcmp(arg[iarg],"pair") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
level_pair = force->inumeric(FLERR,arg[iarg+1]) - 1;
iarg += 2;
} else if (strcmp(arg[iarg],"inner") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal run_style respa command");
level_inner = force->inumeric(FLERR,arg[iarg+1]) - 1;
cutoff[0] = force->numeric(FLERR,arg[iarg+2]);
cutoff[1] = force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"middle") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal run_style respa command");
level_middle = force->inumeric(FLERR,arg[iarg+1]) - 1;
cutoff[2] = force->numeric(FLERR,arg[iarg+2]);
cutoff[3] = force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"outer") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
level_outer = force->inumeric(FLERR,arg[iarg+1]) - 1;
iarg += 2;
} else if (strcmp(arg[iarg],"kspace") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
level_kspace = force->inumeric(FLERR,arg[iarg+1]) - 1;
iarg += 2;
} else if (strcmp(arg[iarg],"hybrid") == 0) {
// the hybrid keyword requires a hybrid pair style
if (!strstr(force->pair_style,"hybrid"))
error->all(FLERR,"Illegal run_style respa command");
PairHybrid *hybrid = (PairHybrid *) force->pair;
nhybrid_styles = hybrid->nstyles;
// each hybrid sub-style needs to be assigned to a respa level
if (iarg+nhybrid_styles > narg)
error->all(FLERR,"Illegal run_style respa command");
hybrid_level = new int[nhybrid_styles];
hybrid_compute = new int[nhybrid_styles];
for (int i=0; i < nhybrid_styles; ++i) {
++iarg;
hybrid_level[i] = force->inumeric(FLERR,arg[iarg])-1;
}
++iarg;
} else error->all(FLERR,"Illegal run_style respa command");
}
// cannot specify both pair and inner/middle/outer
if (level_pair >= 0 &&
(level_inner >= 0 || level_middle >= 0 || level_outer >= 0))
error->all(FLERR,"Cannot set both respa pair and inner/middle/outer");
// if either inner and outer is specified, then both must be
if ((level_inner >= 0 && level_outer == -1) ||
(level_outer >= 0 && level_inner == -1))
error->all(FLERR,"Must set both respa inner and outer");
// middle cannot be set without inner/outer
if (level_middle >= 0 && level_inner == -1)
error->all(FLERR,"Cannot set respa middle without inner/outer");
// cannot combine hybrid with any of pair/inner/middle/outer
if ((nhybrid_styles > 0) && (level_pair >= 0 || level_inner >= 0
|| level_middle >= 0 || level_outer >= 0))
error->all(FLERR,"Cannot set respa hybrid and any of pair/inner/middle/outer");
// set defaults if user did not specify level
// bond to innermost level
// angle same as bond, dihedral same as angle, improper same as dihedral
// pair to outermost level if no inner/middle/outer
// inner/middle/outer have no defaults
// kspace same as pair or outer
if (level_bond == -1) level_bond = 0;
if (level_angle == -1) level_angle = level_bond;
if (level_dihedral == -1) level_dihedral = level_angle;
if (level_improper == -1) level_improper = level_dihedral;
if (level_pair == -1 && level_inner == -1 && nhybrid_styles < 1)
level_pair = nlevels-1;
if (level_kspace == -1 && level_pair >= 0) level_kspace = level_pair;
if (level_kspace == -1 && level_pair == -1) {
if (nhybrid_styles < 1) {
level_kspace = level_outer;
} else {
int max_hybrid_level = -1;
for (int i=0; i < nhybrid_styles; ++i) {
if (max_hybrid_level < hybrid_level[i])
max_hybrid_level = hybrid_level[i];
}
level_kspace = max_hybrid_level;
}
}
// print respa levels
if (comm->me == 0) {
if (screen) {
fprintf(screen,"Respa levels:\n");
for (int i = 0; i < nlevels; i++) {
fprintf(screen," %d =",i+1);
if (level_bond == i) fprintf(screen," bond");
if (level_angle == i) fprintf(screen," angle");
if (level_dihedral == i) fprintf(screen," dihedral");
if (level_improper == i) fprintf(screen," improper");
if (level_pair == i) fprintf(screen," pair");
if (level_inner == i) fprintf(screen," pair-inner");
if (level_middle == i) fprintf(screen," pair-middle");
if (level_outer == i) fprintf(screen," pair-outer");
for (int j=0;j<nhybrid_styles;j++) {
if (hybrid_level[j] == i) fprintf(screen, " hybrid-%d",j+1);
}
if (level_kspace == i) fprintf(screen," kspace");
fprintf(screen,"\n");
}
}
if (logfile) {
fprintf(logfile,"Respa levels:\n");
for (int i = 0; i < nlevels; i++) {
fprintf(logfile," %d =",i+1);
if (level_bond == i) fprintf(logfile," bond");
if (level_angle == i) fprintf(logfile," angle");
if (level_dihedral == i) fprintf(logfile," dihedral");
if (level_improper == i) fprintf(logfile," improper");
if (level_pair == i) fprintf(logfile," pair");
if (level_inner == i) fprintf(logfile," pair-inner");
if (level_middle == i) fprintf(logfile," pair-middle");
if (level_outer == i) fprintf(logfile," pair-outer");
for (int j=0;j<nhybrid_styles;j++) {
if (hybrid_level[j] == i) fprintf(logfile, " hybrid-%d",j+1);
}
if (level_kspace == i) fprintf(logfile," kspace");
fprintf(logfile,"\n");
}
}
}
// check that levels are in correct order
if (level_angle < level_bond || level_dihedral < level_angle ||
level_improper < level_dihedral)
error->all(FLERR,"Invalid order of forces within respa levels");
if (level_pair >= 0) {
if (level_pair < level_improper || level_kspace < level_pair)
error->all(FLERR,"Invalid order of forces within respa levels");
}
if (level_pair == -1 && level_middle == -1 && nhybrid_styles < 1) {
if (level_inner < level_improper || level_outer < level_inner ||
level_kspace < level_outer)
error->all(FLERR,"Invalid order of forces within respa levels");
}
if (level_pair == -1 && level_middle >= 0) {
if (level_inner < level_improper || level_middle < level_inner ||
level_outer < level_inner || level_kspace < level_outer)
error->all(FLERR,"Invalid order of forces within respa levels");
}
// warn if any levels are devoid of forces
int flag = 0;
for (int i = 0; i < nlevels; i++)
if (level_bond != i && level_angle != i && level_dihedral != i &&
level_improper != i && level_pair != i && level_inner != i &&
level_middle != i && level_outer != i && level_kspace != i) flag = 1;
if (flag && comm->me == 0)
error->warning(FLERR,"One or more respa levels compute no forces");
// check cutoff consistency if inner/middle/outer are enabled
if (level_inner >= 0 && cutoff[1] < cutoff[0])
error->all(FLERR,"Respa inner cutoffs are invalid");
if (level_middle >= 0 && (cutoff[3] < cutoff[2] || cutoff[2] < cutoff[1]))
error->all(FLERR,"Respa middle cutoffs are invalid");
// set outer pair of cutoffs to inner pair if middle is not enabled
if (level_inner >= 0 && level_middle < 0) {
cutoff[2] = cutoff[0];
cutoff[3] = cutoff[1];
}
// ensure that pair->compute() is run properly when the "hybrid" keyword is not used.
if (nhybrid_styles < 1) {
pair_compute = 1;
tally_global = 1;
}
// allocate other needed arrays
newton = new int[nlevels];
step = new double[nlevels];
}
/* ---------------------------------------------------------------------- */
Respa::~Respa()
{
delete [] loop;
delete [] newton;
delete [] step;
if (nhybrid_styles > 0) {
delete [] hybrid_level;
delete [] hybrid_compute;
}
}
/* ----------------------------------------------------------------------
initialization before run
------------------------------------------------------------------------- */
void Respa::init()
{
Integrate::init();
// warn if no fixes
if (modify->nfix == 0 && comm->me == 0)
error->warning(FLERR,"No fixes defined, atoms won't move");
// create fix needed for storing atom-based respa level forces
// will delete it at end of run
char **fixarg = new char*[5];
fixarg[0] = (char *) "RESPA";
fixarg[1] = (char *) "all";
fixarg[2] = (char *) "RESPA";
fixarg[3] = new char[8];
sprintf(fixarg[3],"%d",nlevels);
// if supported, we also store torques on a per-level basis
if (atom->torque_flag) {
fixarg[4] = (char *) "torque";
modify->add_fix(5,fixarg);
} else {
modify->add_fix(4,fixarg);
}
delete [] fixarg[3];
delete [] fixarg;
fix_respa = (FixRespa *) modify->fix[modify->nfix-1];
// insure respa inner/middle/outer is using Pair class that supports it
if (level_inner >= 0)
if (force->pair && force->pair->respa_enable == 0)
error->all(FLERR,"Pair style does not support rRESPA inner/middle/outer");
// virial_style = 1 (explicit) since never computed implicitly like Verlet
virial_style = 1;
// setup lists of computes for global and per-atom PE and pressure
ev_setup();
// detect if fix omp is present and will clear force arrays
int ifix = modify->find_fix("package_omp");
if (ifix >= 0) external_force_clear = 1;
// set flags for arrays to clear in force_clear()
torqueflag = extraflag = 0;
if (atom->torque_flag) torqueflag = 1;
if (atom->avec->forceclearflag) extraflag = 1;
// step[] = timestep for each level
step[nlevels-1] = update->dt;
for (int ilevel = nlevels-2; ilevel >= 0; ilevel--)
step[ilevel] = step[ilevel+1]/loop[ilevel];
// set newton flag for each level
for (int ilevel = 0; ilevel < nlevels; ilevel++) {
newton[ilevel] = 0;
if (force->newton_bond) {
if (level_bond == ilevel || level_angle == ilevel ||
level_dihedral == ilevel || level_improper == ilevel)
newton[ilevel] = 1;
}
if (force->newton_pair) {
if (level_pair == ilevel || level_inner == ilevel ||
level_middle == ilevel || level_outer == ilevel)
newton[ilevel] = 1;
if (nhybrid_styles > 0) {
set_compute_flags(ilevel);
if (pair_compute) newton[ilevel] = 1;
}
}
}
// orthogonal vs triclinic simulation box
triclinic = domain->triclinic;
}
/* ----------------------------------------------------------------------
setup before run
------------------------------------------------------------------------- */
void Respa::setup()
{
if (comm->me == 0 && screen) {
fprintf(screen,"Setting up r-RESPA run ...\n");
fprintf(screen," Unit style : %s\n", update->unit_style);
fprintf(screen," Current step : " BIGINT_FORMAT "\n", update->ntimestep);
fprintf(screen," OuterTime step: %g\n", update->dt);
timer->print_timeout(screen);
}
update->setupflag = 1;
// setup domain, communication and neighboring
// acquire ghosts
// build neighbor lists
atom->setup();
modify->setup_pre_exchange();
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
comm->exchange();
if (atom->sortfreq > 0) atom->sort();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
domain->image_check();
domain->box_too_small_check();
modify->setup_pre_neighbor();
neighbor->build();
neighbor->ncalls = 0;
// compute all forces
+ force->setup();
ev_set(update->ntimestep);
for (int ilevel = 0; ilevel < nlevels; ilevel++) {
force_clear(newton[ilevel]);
modify->setup_pre_force_respa(vflag,ilevel);
if (nhybrid_styles > 0) {
set_compute_flags(ilevel);
force->pair->compute(eflag,vflag);
}
if (level_pair == ilevel && pair_compute_flag)
force->pair->compute(eflag,vflag);
if (level_inner == ilevel && pair_compute_flag)
force->pair->compute_inner();
if (level_middle == ilevel && pair_compute_flag)
force->pair->compute_middle();
if (level_outer == ilevel && pair_compute_flag)
force->pair->compute_outer(eflag,vflag);
if (level_bond == ilevel && force->bond)
force->bond->compute(eflag,vflag);
if (level_angle == ilevel && force->angle)
force->angle->compute(eflag,vflag);
if (level_dihedral == ilevel && force->dihedral)
force->dihedral->compute(eflag,vflag);
if (level_improper == ilevel && force->improper)
force->improper->compute(eflag,vflag);
if (level_kspace == ilevel && force->kspace) {
force->kspace->setup();
if (kspace_compute_flag) force->kspace->compute(eflag,vflag);
}
modify->pre_reverse(eflag,vflag);
if (newton[ilevel]) comm->reverse_comm();
copy_f_flevel(ilevel);
}
sum_flevel_f();
modify->setup(vflag);
output->setup();
update->setupflag = 0;
}
/* ----------------------------------------------------------------------
setup without output
flag = 0 = just force calculation
flag = 1 = reneighbor and force calculation
------------------------------------------------------------------------- */
void Respa::setup_minimal(int flag)
{
update->setupflag = 1;
// setup domain, communication and neighboring
// acquire ghosts
// build neighbor lists
if (flag) {
modify->setup_pre_exchange();
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
comm->exchange();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
domain->image_check();
domain->box_too_small_check();
modify->setup_pre_neighbor();
neighbor->build();
neighbor->ncalls = 0;
}
// compute all forces
ev_set(update->ntimestep);
for (int ilevel = 0; ilevel < nlevels; ilevel++) {
force_clear(newton[ilevel]);
modify->setup_pre_force_respa(vflag,ilevel);
if (nhybrid_styles > 0) {
set_compute_flags(ilevel);
force->pair->compute(eflag,vflag);
}
if (level_pair == ilevel && pair_compute_flag)
force->pair->compute(eflag,vflag);
if (level_inner == ilevel && pair_compute_flag)
force->pair->compute_inner();
if (level_middle == ilevel && pair_compute_flag)
force->pair->compute_middle();
if (level_outer == ilevel && pair_compute_flag)
force->pair->compute_outer(eflag,vflag);
if (level_bond == ilevel && force->bond)
force->bond->compute(eflag,vflag);
if (level_angle == ilevel && force->angle)
force->angle->compute(eflag,vflag);
if (level_dihedral == ilevel && force->dihedral)
force->dihedral->compute(eflag,vflag);
if (level_improper == ilevel && force->improper)
force->improper->compute(eflag,vflag);
if (level_kspace == ilevel && force->kspace) {
force->kspace->setup();
if (kspace_compute_flag) force->kspace->compute(eflag,vflag);
}
modify->pre_reverse(eflag,vflag);
if (newton[ilevel]) comm->reverse_comm();
copy_f_flevel(ilevel);
}
sum_flevel_f();
modify->setup(vflag);
update->setupflag = 0;
}
/* ----------------------------------------------------------------------
run for N steps
------------------------------------------------------------------------- */
void Respa::run(int n)
{
bigint ntimestep;
for (int i = 0; i < n; i++) {
if (timer->check_timeout(i)) {
update->nsteps = i;
break;
}
ntimestep = ++update->ntimestep;
ev_set(ntimestep);
recurse(nlevels-1);
// needed in case end_of_step() or output() use total force
sum_flevel_f();
if (modify->n_end_of_step) {
timer->stamp();
modify->end_of_step();
timer->stamp(Timer::MODIFY);
}
if (ntimestep == output->next) {
timer->stamp();
output->write(update->ntimestep);
timer->stamp(Timer::OUTPUT);
}
}
}
/* ----------------------------------------------------------------------
delete rRESPA fix at end of run, so its atom arrays won't persist
------------------------------------------------------------------------- */
void Respa::cleanup()
{
modify->post_run();
modify->delete_fix("RESPA");
domain->box_too_small_check();
update->update_time();
}
/* ---------------------------------------------------------------------- */
void Respa::reset_dt()
{
step[nlevels-1] = update->dt;
for (int ilevel = nlevels-2; ilevel >= 0; ilevel--)
step[ilevel] = step[ilevel+1]/loop[ilevel];
}
/* ---------------------------------------------------------------------- */
void Respa::recurse(int ilevel)
{
copy_flevel_f(ilevel);
for (int iloop = 0; iloop < loop[ilevel]; iloop++) {
timer->stamp();
modify->initial_integrate_respa(vflag,ilevel,iloop);
if (modify->n_post_integrate_respa)
modify->post_integrate_respa(ilevel,iloop);
timer->stamp(Timer::MODIFY);
// at outermost level, check on rebuilding neighbor list
// at innermost level, communicate
// at middle levels, do nothing
if (ilevel == nlevels-1) {
int nflag = neighbor->decide();
if (nflag) {
if (modify->n_pre_exchange) {
timer->stamp();
modify->pre_exchange();
timer->stamp(Timer::MODIFY);
}
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
if (domain->box_change) {
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
}
timer->stamp();
comm->exchange();
if (atom->sortfreq > 0 &&
update->ntimestep >= atom->nextsort) atom->sort();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
timer->stamp(Timer::COMM);
if (modify->n_pre_neighbor) {
modify->pre_neighbor();
timer->stamp(Timer::MODIFY);
}
neighbor->build();
timer->stamp(Timer::NEIGH);
} else if (ilevel == 0) {
timer->stamp();
comm->forward_comm();
timer->stamp(Timer::COMM);
}
} else if (ilevel == 0) {
timer->stamp();
comm->forward_comm();
timer->stamp(Timer::COMM);
}
// rRESPA recursion thru all levels
// this used to be before neigh list build,
// which prevented per-atom energy/stress being tallied correctly
// b/c atoms migrated to new procs between short/long force calls
// now they migrate at very start of rRESPA timestep, before all forces
if (ilevel) recurse(ilevel-1);
// force computations
// important that ordering is same as Verlet
// so that any order dependencies are the same
// when potentials are invoked at same level
force_clear(newton[ilevel]);
if (modify->n_pre_force_respa) {
timer->stamp();
modify->pre_force_respa(vflag,ilevel,iloop);
timer->stamp(Timer::MODIFY);
}
timer->stamp();
if (nhybrid_styles > 0) {
set_compute_flags(ilevel);
force->pair->compute(eflag,vflag);
timer->stamp(Timer::PAIR);
}
if (level_pair == ilevel && pair_compute_flag) {
force->pair->compute(eflag,vflag);
timer->stamp(Timer::PAIR);
}
if (level_inner == ilevel && pair_compute_flag) {
force->pair->compute_inner();
timer->stamp(Timer::PAIR);
}
if (level_middle == ilevel && pair_compute_flag) {
force->pair->compute_middle();
timer->stamp(Timer::PAIR);
}
if (level_outer == ilevel && pair_compute_flag) {
force->pair->compute_outer(eflag,vflag);
timer->stamp(Timer::PAIR);
}
if (level_bond == ilevel && force->bond) {
force->bond->compute(eflag,vflag);
timer->stamp(Timer::BOND);
}
if (level_angle == ilevel && force->angle) {
force->angle->compute(eflag,vflag);
timer->stamp(Timer::BOND);
}
if (level_dihedral == ilevel && force->dihedral) {
force->dihedral->compute(eflag,vflag);
timer->stamp(Timer::BOND);
}
if (level_improper == ilevel && force->improper) {
force->improper->compute(eflag,vflag);
timer->stamp(Timer::BOND);
}
if (level_kspace == ilevel && kspace_compute_flag) {
force->kspace->compute(eflag,vflag);
timer->stamp(Timer::KSPACE);
}
if (modify->n_pre_reverse) {
modify->pre_reverse(eflag,vflag);
timer->stamp(Timer::MODIFY);
}
if (newton[ilevel]) {
comm->reverse_comm();
timer->stamp(Timer::COMM);
}
timer->stamp();
if (modify->n_post_force_respa)
modify->post_force_respa(vflag,ilevel,iloop);
modify->final_integrate_respa(ilevel,iloop);
timer->stamp(Timer::MODIFY);
}
copy_f_flevel(ilevel);
}
/* ----------------------------------------------------------------------
clear force on own & ghost atoms
clear other arrays as needed
------------------------------------------------------------------------- */
void Respa::force_clear(int newtonflag)
{
if (external_force_clear) return;
// clear global force array
// if either newton flag is set, also include ghosts
size_t nbytes = sizeof(double) * atom->nlocal;
if (force->newton) nbytes += sizeof(double) * atom->nghost;
if (nbytes) {
memset(&atom->f[0][0],0,3*nbytes);
if (torqueflag) memset(&atom->torque[0][0],0,3*nbytes);
if (extraflag) atom->avec->force_clear(0,nbytes);
}
}
/* ----------------------------------------------------------------------
copy force components from atom->f to FixRespa->f_level
------------------------------------------------------------------------- */
void Respa::copy_f_flevel(int ilevel)
{
double ***f_level = fix_respa->f_level;
double **f = atom->f;
double ***t_level = fix_respa->t_level;
double **t = atom->torque;
int n = atom->nlocal;
for (int i = 0; i < n; i++) {
f_level[i][ilevel][0] = f[i][0];
f_level[i][ilevel][1] = f[i][1];
f_level[i][ilevel][2] = f[i][2];
if (fix_respa->store_torque) {
t_level[i][ilevel][0] = t[i][0];
t_level[i][ilevel][1] = t[i][1];
t_level[i][ilevel][2] = t[i][2];
}
}
}
/* ----------------------------------------------------------------------
copy force components from FixRespa->f_level to atom->f
------------------------------------------------------------------------- */
void Respa::copy_flevel_f(int ilevel)
{
double ***f_level = fix_respa->f_level;
double **f = atom->f;
double ***t_level = fix_respa->t_level;
double **t = atom->torque;
int n = atom->nlocal;
for (int i = 0; i < n; i++) {
f[i][0] = f_level[i][ilevel][0];
f[i][1] = f_level[i][ilevel][1];
f[i][2] = f_level[i][ilevel][2];
if (fix_respa->store_torque) {
t[i][0] = t_level[i][ilevel][0];
t[i][1] = t_level[i][ilevel][1];
t[i][2] = t_level[i][ilevel][2];
}
}
}
/* ----------------------------------------------------------------------
sum all force components from FixRespa->f_level to create full atom->f
------------------------------------------------------------------------- */
void Respa::sum_flevel_f()
{
copy_flevel_f(0);
double ***f_level = fix_respa->f_level;
double **f = atom->f;
double ***t_level = fix_respa->t_level;
double **t = atom->torque;
int n = atom->nlocal;
for (int ilevel = 1; ilevel < nlevels; ilevel++) {
for (int i = 0; i < n; i++) {
f[i][0] += f_level[i][ilevel][0];
f[i][1] += f_level[i][ilevel][1];
f[i][2] += f_level[i][ilevel][2];
if (fix_respa->store_torque) {
t[i][0] += t_level[i][ilevel][0];
t[i][1] += t_level[i][ilevel][1];
t[i][2] += t_level[i][ilevel][2];
}
}
}
}
/*-----------------------------------------------------------------------
set flags for when some hybrid forces should be computed
------------------------------------------------------------------------- */
void Respa::set_compute_flags(int ilevel)
{
if (nhybrid_styles < 1) return;
pair_compute = 0;
for (int i=0; i<nhybrid_styles; ++i) {
hybrid_compute[i] = (hybrid_level[i] == ilevel) ? 1 : 0;
if (hybrid_compute[i]) pair_compute = 1;
}
tally_global = (ilevel == nlevels-1) ? 1 : 0;
}
diff --git a/src/set.cpp b/src/set.cpp
index 33f6b77dc..182fe528a 100644
--- a/src/set.cpp
+++ b/src/set.cpp
@@ -1,1015 +1,1054 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <mpi.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "set.h"
#include "atom.h"
#include "atom_vec.h"
#include "atom_vec_ellipsoid.h"
#include "atom_vec_line.h"
#include "atom_vec_tri.h"
+#include "atom_vec_body.h"
#include "domain.h"
#include "region.h"
#include "group.h"
#include "comm.h"
#include "neighbor.h"
#include "force.h"
#include "pair.h"
#include "input.h"
#include "variable.h"
#include "random_park.h"
#include "math_extra.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
enum{ATOM_SELECT,MOL_SELECT,TYPE_SELECT,GROUP_SELECT,REGION_SELECT};
enum{TYPE,TYPE_FRACTION,MOLECULE,X,Y,Z,CHARGE,MASS,SHAPE,LENGTH,TRI,
- DIPOLE,DIPOLE_RANDOM,QUAT,QUAT_RANDOM,THETA,ANGMOM,OMEGA,
+ DIPOLE,DIPOLE_RANDOM,QUAT,QUAT_RANDOM,THETA,THETA_RANDOM,ANGMOM,OMEGA,
DIAMETER,DENSITY,VOLUME,IMAGE,BOND,ANGLE,DIHEDRAL,IMPROPER,
MESO_E,MESO_CV,MESO_RHO,SMD_MASS_DENSITY,SMD_CONTACT_RADIUS,INAME,DNAME};
#define BIG INT_MAX
/* ---------------------------------------------------------------------- */
void Set::command(int narg, char **arg)
{
if (domain->box_exist == 0)
error->all(FLERR,"Set command before simulation box is defined");
if (atom->natoms == 0)
error->all(FLERR,"Set command with no atoms existing");
if (narg < 3) error->all(FLERR,"Illegal set command");
// style and ID info
if (strcmp(arg[0],"atom") == 0) style = ATOM_SELECT;
else if (strcmp(arg[0],"mol") == 0) style = MOL_SELECT;
else if (strcmp(arg[0],"type") == 0) style = TYPE_SELECT;
else if (strcmp(arg[0],"group") == 0) style = GROUP_SELECT;
else if (strcmp(arg[0],"region") == 0) style = REGION_SELECT;
else error->all(FLERR,"Illegal set command");
int n = strlen(arg[1]) + 1;
id = new char[n];
strcpy(id,arg[1]);
select = NULL;
selection(atom->nlocal);
// loop over keyword/value pairs
// call appropriate routine to reset attributes
if (comm->me == 0 && screen) fprintf(screen,"Setting atom values ...\n");
int allcount,origarg;
int iarg = 2;
while (iarg < narg) {
varflag = varflag1 = varflag2 = varflag3 = varflag4 = 0;
count = 0;
origarg = iarg;
if (strcmp(arg[iarg],"type") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else ivalue = force->inumeric(FLERR,arg[iarg+1]);
set(TYPE);
iarg += 2;
} else if (strcmp(arg[iarg],"type/fraction") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
newtype = force->inumeric(FLERR,arg[iarg+1]);
fraction = force->numeric(FLERR,arg[iarg+2]);
ivalue = force->inumeric(FLERR,arg[iarg+3]);
if (newtype <= 0 || newtype > atom->ntypes)
error->all(FLERR,"Invalid value in set command");
if (fraction < 0.0 || fraction > 1.0)
error->all(FLERR,"Invalid value in set command");
if (ivalue <= 0)
error->all(FLERR,"Invalid random number seed in set command");
setrandom(TYPE_FRACTION);
iarg += 4;
} else if (strcmp(arg[iarg],"mol") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else ivalue = force->inumeric(FLERR,arg[iarg+1]);
if (!atom->molecule_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(MOLECULE);
iarg += 2;
} else if (strcmp(arg[iarg],"x") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
set(X);
iarg += 2;
} else if (strcmp(arg[iarg],"y") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
set(Y);
iarg += 2;
} else if (strcmp(arg[iarg],"z") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
set(Z);
iarg += 2;
} else if (strcmp(arg[iarg],"charge") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->q_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(CHARGE);
iarg += 2;
} else if (strcmp(arg[iarg],"mass") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->rmass_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(MASS);
iarg += 2;
} else if (strcmp(arg[iarg],"shape") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else xvalue = force->numeric(FLERR,arg[iarg+1]);
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2);
else yvalue = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3);
else zvalue = force->numeric(FLERR,arg[iarg+3]);
if (!atom->ellipsoid_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(SHAPE);
iarg += 4;
} else if (strcmp(arg[iarg],"length") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->line_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(LENGTH);
iarg += 2;
} else if (strcmp(arg[iarg],"tri") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->tri_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(TRI);
iarg += 2;
} else if (strcmp(arg[iarg],"dipole") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else xvalue = force->numeric(FLERR,arg[iarg+1]);
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2);
else yvalue = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3);
else zvalue = force->numeric(FLERR,arg[iarg+3]);
if (!atom->mu_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(DIPOLE);
iarg += 4;
} else if (strcmp(arg[iarg],"dipole/random") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal set command");
ivalue = force->inumeric(FLERR,arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+2]);
if (!atom->mu_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (ivalue <= 0)
error->all(FLERR,"Invalid random number seed in set command");
if (dvalue <= 0.0)
error->all(FLERR,"Invalid dipole length in set command");
setrandom(DIPOLE_RANDOM);
iarg += 3;
} else if (strcmp(arg[iarg],"quat") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else xvalue = force->numeric(FLERR,arg[iarg+1]);
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2);
else yvalue = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3);
else zvalue = force->numeric(FLERR,arg[iarg+3]);
if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) varparse(arg[iarg+4],4);
else wvalue = force->numeric(FLERR,arg[iarg+4]);
- if (!atom->ellipsoid_flag && !atom->tri_flag)
+ if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(QUAT);
iarg += 5;
} else if (strcmp(arg[iarg],"quat/random") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
ivalue = force->inumeric(FLERR,arg[iarg+1]);
- if (!atom->ellipsoid_flag && !atom->tri_flag)
+ if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (ivalue <= 0)
error->all(FLERR,"Invalid random number seed in set command");
setrandom(QUAT_RANDOM);
iarg += 2;
} else if (strcmp(arg[iarg],"theta") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else {
dvalue = force->numeric(FLERR,arg[iarg+1]);
dvalue *= MY_PI/180.0;
}
if (!atom->line_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(THETA);
iarg += 2;
+ } else if (strcmp(arg[iarg],"theta/random") == 0) {
+ if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
+ ivalue = force->inumeric(FLERR,arg[iarg+1]);
+ if (!atom->line_flag)
+ error->all(FLERR,"Cannot set this attribute for this atom style");
+ if (ivalue <= 0)
+ error->all(FLERR,"Invalid random number seed in set command");
+ set(THETA_RANDOM);
+ iarg += 2;
+
} else if (strcmp(arg[iarg],"angmom") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else xvalue = force->numeric(FLERR,arg[iarg+1]);
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2);
else yvalue = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3);
else zvalue = force->numeric(FLERR,arg[iarg+3]);
- if (!atom->ellipsoid_flag && !atom->tri_flag)
+ if (!atom->angmom_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(ANGMOM);
iarg += 4;
} else if (strcmp(arg[iarg],"omega") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else xvalue = force->numeric(FLERR,arg[iarg+1]);
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2);
else yvalue = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3);
else zvalue = force->numeric(FLERR,arg[iarg+3]);
- if (!atom->sphere_flag)
+ if (!atom->omega_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(OMEGA);
iarg += 4;
} else if (strcmp(arg[iarg],"diameter") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->radius_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(DIAMETER);
iarg += 2;
} else if (strcmp(arg[iarg],"density") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->rmass_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (dvalue <= 0.0) error->all(FLERR,"Invalid density in set command");
set(DENSITY);
iarg += 2;
} else if (strcmp(arg[iarg],"volume") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->vfrac_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (dvalue <= 0.0) error->all(FLERR,"Invalid volume in set command");
set(VOLUME);
iarg += 2;
} else if (strcmp(arg[iarg],"image") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
ximageflag = yimageflag = zimageflag = 0;
if (strcmp(arg[iarg+1],"NULL") != 0) {
ximageflag = 1;
ximage = force->inumeric(FLERR,arg[iarg+1]);
}
if (strcmp(arg[iarg+2],"NULL") != 0) {
yimageflag = 1;
yimage = force->inumeric(FLERR,arg[iarg+2]);
}
if (strcmp(arg[iarg+3],"NULL") != 0) {
zimageflag = 1;
zimage = force->inumeric(FLERR,arg[iarg+3]);
}
if (ximageflag && ximage && !domain->xperiodic)
error->all(FLERR,
"Cannot set non-zero image flag for non-periodic dimension");
if (yimageflag && yimage && !domain->yperiodic)
error->all(FLERR,
"Cannot set non-zero image flag for non-periodic dimension");
if (zimageflag && zimage && !domain->zperiodic)
error->all(FLERR,
"Cannot set non-zero image flag for non-periodic dimension");
set(IMAGE);
iarg += 4;
} else if (strcmp(arg[iarg],"bond") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
ivalue = force->inumeric(FLERR,arg[iarg+1]);
if (atom->avec->bonds_allow == 0)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (ivalue <= 0 || ivalue > atom->nbondtypes)
error->all(FLERR,"Invalid value in set command");
topology(BOND);
iarg += 2;
} else if (strcmp(arg[iarg],"angle") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
ivalue = force->inumeric(FLERR,arg[iarg+1]);
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (ivalue <= 0 || ivalue > atom->nangletypes)
error->all(FLERR,"Invalid value in set command");
topology(ANGLE);
iarg += 2;
} else if (strcmp(arg[iarg],"dihedral") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
ivalue = force->inumeric(FLERR,arg[iarg+1]);
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (ivalue <= 0 || ivalue > atom->ndihedraltypes)
error->all(FLERR,"Invalid value in set command");
topology(DIHEDRAL);
iarg += 2;
} else if (strcmp(arg[iarg],"improper") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
ivalue = force->inumeric(FLERR,arg[iarg+1]);
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (ivalue <= 0 || ivalue > atom->nimpropertypes)
error->all(FLERR,"Invalid value in set command");
topology(IMPROPER);
iarg += 2;
} else if (strcmp(arg[iarg],"meso_e") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->e_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(MESO_E);
iarg += 2;
} else if (strcmp(arg[iarg],"meso_cv") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->cv_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(MESO_CV);
iarg += 2;
} else if (strcmp(arg[iarg],"meso_rho") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->rho_flag)
error->all(FLERR,"Cannot set meso_rho for this atom style");
set(MESO_RHO);
iarg += 2;
} else if (strcmp(arg[iarg],"smd_mass_density") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->smd_flag)
error->all(FLERR,"Cannot set smd_mass_density for this atom style");
set(SMD_MASS_DENSITY);
iarg += 2;
} else if (strcmp(arg[iarg],"smd_contact_radius") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->smd_flag)
error->all(FLERR,"Cannot set smd_contact_radius for this atom style");
set(SMD_CONTACT_RADIUS);
iarg += 2;
} else if (strstr(arg[iarg],"i_") == arg[iarg]) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else ivalue = force->inumeric(FLERR,arg[iarg+1]);
int flag;
index_custom = atom->find_custom(&arg[iarg][2],flag);
if (index_custom < 0 || flag != 0)
error->all(FLERR,"Set command integer vector does not exist");
set(INAME);
iarg += 2;
} else if (strstr(arg[iarg],"d_") == arg[iarg]) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
int flag;
index_custom = atom->find_custom(&arg[iarg][2],flag);
if (index_custom < 0 || flag != 1)
error->all(FLERR,"Set command floating point vector does not exist");
set(DNAME);
iarg += 2;
} else error->all(FLERR,"Illegal set command");
// statistics
MPI_Allreduce(&count,&allcount,1,MPI_INT,MPI_SUM,world);
if (comm->me == 0) {
if (screen) fprintf(screen," %d settings made for %s\n",
allcount,arg[origarg]);
if (logfile) fprintf(logfile," %d settings made for %s\n",
allcount,arg[origarg]);
}
}
// free local memory
delete [] id;
delete [] select;
}
/* ----------------------------------------------------------------------
select atoms according to ATOM, MOLECULE, TYPE, GROUP, REGION style
n = nlocal or nlocal+nghost depending on keyword
------------------------------------------------------------------------- */
void Set::selection(int n)
{
delete [] select;
select = new int[n];
int nlo,nhi;
if (style == ATOM_SELECT) {
if (atom->tag_enable == 0)
error->all(FLERR,"Cannot use set atom with no atom IDs defined");
bigint nlobig,nhibig;
force->boundsbig(id,MAXTAGINT,nlobig,nhibig);
tagint *tag = atom->tag;
for (int i = 0; i < n; i++)
if (tag[i] >= nlobig && tag[i] <= nhibig) select[i] = 1;
else select[i] = 0;
} else if (style == MOL_SELECT) {
if (atom->molecule_flag == 0)
error->all(FLERR,"Cannot use set mol with no molecule IDs defined");
bigint nlobig,nhibig;
force->boundsbig(id,MAXTAGINT,nlobig,nhibig);
tagint *molecule = atom->molecule;
for (int i = 0; i < n; i++)
if (molecule[i] >= nlobig && molecule[i] <= nhibig) select[i] = 1;
else select[i] = 0;
} else if (style == TYPE_SELECT) {
force->bounds(id,atom->ntypes,nlo,nhi);
int *type = atom->type;
for (int i = 0; i < n; i++)
if (type[i] >= nlo && type[i] <= nhi) select[i] = 1;
else select[i] = 0;
} else if (style == GROUP_SELECT) {
int igroup = group->find(id);
if (igroup == -1) error->all(FLERR,"Could not find set group ID");
int groupbit = group->bitmask[igroup];
int *mask = atom->mask;
for (int i = 0; i < n; i++)
if (mask[i] & groupbit) select[i] = 1;
else select[i] = 0;
} else if (style == REGION_SELECT) {
int iregion = domain->find_region(id);
if (iregion == -1) error->all(FLERR,"Set region ID does not exist");
domain->regions[iregion]->prematch();
double **x = atom->x;
for (int i = 0; i < n; i++)
if (domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
select[i] = 1;
else select[i] = 0;
}
}
/* ----------------------------------------------------------------------
set owned atom properties directly
either scalar or per-atom values from atom-style variable(s)
------------------------------------------------------------------------- */
void Set::set(int keyword)
{
// evaluate atom-style variable(s) if necessary
vec1 = vec2 = vec3 = vec4 = NULL;
if (varflag) {
int nlocal = atom->nlocal;
if (varflag1) {
memory->create(vec1,nlocal,"set:vec1");
input->variable->compute_atom(ivar1,0,vec1,1,0);
}
if (varflag2) {
memory->create(vec2,nlocal,"set:vec2");
input->variable->compute_atom(ivar2,0,vec2,1,0);
}
if (varflag3) {
memory->create(vec3,nlocal,"set:vec3");
input->variable->compute_atom(ivar3,0,vec3,1,0);
}
if (varflag4) {
memory->create(vec4,nlocal,"set:vec4");
input->variable->compute_atom(ivar4,0,vec4,1,0);
}
}
// loop over selected atoms
AtomVecEllipsoid *avec_ellipsoid =
(AtomVecEllipsoid *) atom->style_match("ellipsoid");
AtomVecLine *avec_line = (AtomVecLine *) atom->style_match("line");
AtomVecTri *avec_tri = (AtomVecTri *) atom->style_match("tri");
+ AtomVecBody *avec_body = (AtomVecBody *) atom->style_match("body");
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (!select[i]) continue;
// overwrite dvalue, ivalue, xyzw value if variables defined
// else the input script scalar value remains in place
if (varflag) {
if (varflag1) {
dvalue = xvalue = vec1[i];
ivalue = static_cast<int> (dvalue);
}
if (varflag2) yvalue = vec2[i];
if (varflag3) zvalue = vec3[i];
if (varflag4) wvalue = vec4[i];
}
// set values in per-atom arrays
// error check here in case atom-style variables generated bogus value
if (keyword == TYPE) {
if (ivalue <= 0 || ivalue > atom->ntypes)
error->one(FLERR,"Invalid value in set command");
atom->type[i] = ivalue;
}
else if (keyword == MOLECULE) atom->molecule[i] = ivalue;
else if (keyword == X) atom->x[i][0] = dvalue;
else if (keyword == Y) atom->x[i][1] = dvalue;
else if (keyword == Z) atom->x[i][2] = dvalue;
else if (keyword == CHARGE) atom->q[i] = dvalue;
else if (keyword == MASS) {
if (dvalue <= 0.0) error->one(FLERR,"Invalid mass in set command");
atom->rmass[i] = dvalue;
}
else if (keyword == DIAMETER) {
if (dvalue < 0.0) error->one(FLERR,"Invalid diameter in set command");
atom->radius[i] = 0.5 * dvalue;
}
else if (keyword == VOLUME) {
if (dvalue <= 0.0) error->one(FLERR,"Invalid volume in set command");
atom->vfrac[i] = dvalue;
}
else if (keyword == MESO_E) atom->e[i] = dvalue;
else if (keyword == MESO_CV) atom->cv[i] = dvalue;
else if (keyword == MESO_RHO) atom->rho[i] = dvalue;
- else if (keyword == SMD_MASS_DENSITY) { // set mass from volume and supplied mass density
- atom->rmass[i] = atom->vfrac[i] * dvalue;
+ else if (keyword == SMD_MASS_DENSITY) {
+ // set mass from volume and supplied mass density
+ atom->rmass[i] = atom->vfrac[i] * dvalue;
}
else if (keyword == SMD_CONTACT_RADIUS) atom->contact_radius[i] = dvalue;
// set shape of ellipsoidal particle
else if (keyword == SHAPE) {
if (xvalue < 0.0 || yvalue < 0.0 || zvalue < 0.0)
error->one(FLERR,"Invalid shape in set command");
if (xvalue > 0.0 || yvalue > 0.0 || zvalue > 0.0) {
if (xvalue == 0.0 || yvalue == 0.0 || zvalue == 0.0)
error->one(FLERR,"Invalid shape in set command");
}
avec_ellipsoid->set_shape(i,0.5*xvalue,0.5*yvalue,0.5*zvalue);
}
// set length of line particle
else if (keyword == LENGTH) {
if (dvalue < 0.0) error->one(FLERR,"Invalid length in set command");
avec_line->set_length(i,dvalue);
}
// set corners of tri particle
else if (keyword == TRI) {
if (dvalue < 0.0) error->one(FLERR,"Invalid length in set command");
avec_tri->set_equilateral(i,dvalue);
}
// set rmass via density
// if radius > 0.0, treat as sphere
// if shape > 0.0, treat as ellipsoid
// if length > 0.0, treat as line
// if area > 0.0, treat as tri
// else set rmass to density directly
else if (keyword == DENSITY) {
if (dvalue <= 0.0) error->one(FLERR,"Invalid density in set command");
if (atom->radius_flag && atom->radius[i] > 0.0)
atom->rmass[i] = 4.0*MY_PI/3.0 *
atom->radius[i]*atom->radius[i]*atom->radius[i] * dvalue;
else if (atom->ellipsoid_flag && atom->ellipsoid[i] >= 0) {
double *shape = avec_ellipsoid->bonus[atom->ellipsoid[i]].shape;
atom->rmass[i] = 4.0*MY_PI/3.0 * shape[0]*shape[1]*shape[2] * dvalue;
} else if (atom->line_flag && atom->line[i] >= 0) {
double length = avec_line->bonus[atom->line[i]].length;
atom->rmass[i] = length * dvalue;
} else if (atom->tri_flag && atom->tri[i] >= 0) {
double *c1 = avec_tri->bonus[atom->tri[i]].c1;
double *c2 = avec_tri->bonus[atom->tri[i]].c2;
double *c3 = avec_tri->bonus[atom->tri[i]].c3;
double c2mc1[3],c3mc1[3];
MathExtra::sub3(c2,c1,c2mc1);
MathExtra::sub3(c3,c1,c3mc1);
double norm[3];
MathExtra::cross3(c2mc1,c3mc1,norm);
double area = 0.5 * MathExtra::len3(norm);
atom->rmass[i] = area * dvalue;
} else atom->rmass[i] = dvalue;
}
// set dipole moment
else if (keyword == DIPOLE) {
double **mu = atom->mu;
mu[i][0] = xvalue;
mu[i][1] = yvalue;
mu[i][2] = zvalue;
mu[i][3] = sqrt(mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1] +
mu[i][2]*mu[i][2]);
}
- // set quaternion orientation of ellipsoid or tri particle
-
+ // set quaternion orientation of ellipsoid or tri or body particle
+ // enforce quat rotation vector in z dir for 2d systems
+
else if (keyword == QUAT) {
double *quat;
if (avec_ellipsoid && atom->ellipsoid[i] >= 0)
quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat;
else if (avec_tri && atom->tri[i] >= 0)
quat = avec_tri->bonus[atom->tri[i]].quat;
+ else if (avec_body && atom->body[i] >= 0)
+ quat = avec_body->bonus[atom->body[i]].quat;
else
error->one(FLERR,"Cannot set quaternion for atom that has none");
-
+ if (domain->dimension == 2 && (xvalue != 0.0 || yvalue != 0.0))
+ error->one(FLERR,"Cannot set quaternion with xy components "
+ "for 2d system");
+
double theta2 = MY_PI2 * wvalue/180.0;
double sintheta2 = sin(theta2);
quat[0] = cos(theta2);
quat[1] = xvalue * sintheta2;
quat[2] = yvalue * sintheta2;
quat[3] = zvalue * sintheta2;
MathExtra::qnormalize(quat);
}
// set theta of line particle
else if (keyword == THETA) {
if (atom->line[i] < 0)
error->one(FLERR,"Cannot set theta for atom that is not a line");
avec_line->bonus[atom->line[i]].theta = dvalue;
}
- // set angmom of ellipsoidal or tri particle
+ // set angmom or omega of particle
else if (keyword == ANGMOM) {
atom->angmom[i][0] = xvalue;
atom->angmom[i][1] = yvalue;
atom->angmom[i][2] = zvalue;
}
else if (keyword == OMEGA) {
atom->omega[i][0] = xvalue;
atom->omega[i][1] = yvalue;
atom->omega[i][2] = zvalue;
}
-
// reset any or all of 3 image flags
else if (keyword == IMAGE) {
int xbox = (atom->image[i] & IMGMASK) - IMGMAX;
int ybox = (atom->image[i] >> IMGBITS & IMGMASK) - IMGMAX;
int zbox = (atom->image[i] >> IMG2BITS) - IMGMAX;
if (ximageflag) xbox = ximage;
if (yimageflag) ybox = yimage;
if (zimageflag) zbox = zimage;
atom->image[i] = ((imageint) (xbox + IMGMAX) & IMGMASK) |
(((imageint) (ybox + IMGMAX) & IMGMASK) << IMGBITS) |
(((imageint) (zbox + IMGMAX) & IMGMASK) << IMG2BITS);
}
// set value for custom integer or double vector
else if (keyword == INAME) {
atom->ivector[index_custom][i] = ivalue;
}
else if (keyword == DNAME) {
atom->dvector[index_custom][i] = dvalue;
}
count++;
}
// clear up per-atom memory if allocated
memory->destroy(vec1);
memory->destroy(vec2);
memory->destroy(vec3);
memory->destroy(vec4);
}
/* ----------------------------------------------------------------------
set an owned atom property randomly
set seed based on atom coordinates
make atom result independent of what proc owns it
------------------------------------------------------------------------- */
void Set::setrandom(int keyword)
{
int i;
AtomVecEllipsoid *avec_ellipsoid =
(AtomVecEllipsoid *) atom->style_match("ellipsoid");
+ AtomVecLine *avec_line = (AtomVecLine *) atom->style_match("line");
AtomVecTri *avec_tri = (AtomVecTri *) atom->style_match("tri");
+ AtomVecBody *avec_body = (AtomVecBody *) atom->style_match("body");
RanPark *random = new RanPark(lmp,1);
double **x = atom->x;
int seed = ivalue;
// set fraction of atom types to newtype
if (keyword == TYPE_FRACTION) {
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++)
if (select[i]) {
random->reset(seed,x[i]);
if (random->uniform() > fraction) continue;
atom->type[i] = newtype;
count++;
}
// set dipole moments to random orientations in 3d or 2d
// dipole length is determined by dipole type array
} else if (keyword == DIPOLE_RANDOM) {
double **mu = atom->mu;
int nlocal = atom->nlocal;
double msq,scale;
if (domain->dimension == 3) {
for (i = 0; i < nlocal; i++)
if (select[i]) {
random->reset(seed,x[i]);
mu[i][0] = random->uniform() - 0.5;
mu[i][1] = random->uniform() - 0.5;
mu[i][2] = random->uniform() - 0.5;
msq = mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1] + mu[i][2]*mu[i][2];
scale = dvalue/sqrt(msq);
mu[i][0] *= scale;
mu[i][1] *= scale;
mu[i][2] *= scale;
mu[i][3] = dvalue;
count++;
}
} else {
for (i = 0; i < nlocal; i++)
if (select[i]) {
random->reset(seed,x[i]);
mu[i][0] = random->uniform() - 0.5;
mu[i][1] = random->uniform() - 0.5;
mu[i][2] = 0.0;
msq = mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1];
scale = dvalue/sqrt(msq);
mu[i][0] *= scale;
mu[i][1] *= scale;
mu[i][3] = dvalue;
count++;
}
}
- // set quaternions to random orientations in 3d or 2d
+ // set quaternions to random orientations in 3d and 2d
} else if (keyword == QUAT_RANDOM) {
int nlocal = atom->nlocal;
double *quat;
if (domain->dimension == 3) {
double s,t1,t2,theta1,theta2;
for (i = 0; i < nlocal; i++)
if (select[i]) {
if (avec_ellipsoid && atom->ellipsoid[i] >= 0)
quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat;
else if (avec_tri && atom->tri[i] >= 0)
quat = avec_tri->bonus[atom->tri[i]].quat;
+ else if (avec_body && atom->body[i] >= 0)
+ quat = avec_body->bonus[atom->body[i]].quat;
else
error->one(FLERR,"Cannot set quaternion for atom that has none");
random->reset(seed,x[i]);
s = random->uniform();
t1 = sqrt(1.0-s);
t2 = sqrt(s);
theta1 = 2.0*MY_PI*random->uniform();
theta2 = 2.0*MY_PI*random->uniform();
quat[0] = cos(theta2)*t2;
quat[1] = sin(theta1)*t1;
quat[2] = cos(theta1)*t1;
quat[3] = sin(theta2)*t2;
count++;
}
} else {
double theta2;
for (i = 0; i < nlocal; i++)
if (select[i]) {
if (avec_ellipsoid && atom->ellipsoid[i] >= 0)
quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat;
+ else if (avec_body && atom->body[i] >= 0)
+ quat = avec_body->bonus[atom->body[i]].quat;
else
error->one(FLERR,"Cannot set quaternion for atom that has none");
random->reset(seed,x[i]);
theta2 = MY_PI*random->uniform();
quat[0] = cos(theta2);
quat[1] = 0.0;
quat[2] = 0.0;
quat[3] = sin(theta2);
count++;
}
}
+
+ // set theta to random orientation in 2d
+
+ } else if (keyword == THETA_RANDOM) {
+ int nlocal = atom->nlocal;
+ double theta;
+ for (i = 0; i < nlocal; i++) {
+ if (select[i]) {
+ if (atom->line[i] < 0)
+ error->one(FLERR,"Cannot set theta for atom that is not a line");
+ random->reset(seed,x[i]);
+ avec_line->bonus[atom->line[i]].theta = MY_2PI*random->uniform();
+ count++;
+ }
+ }
}
delete random;
}
/* ---------------------------------------------------------------------- */
void Set::topology(int keyword)
{
int m,atom1,atom2,atom3,atom4;
// error check
if (atom->molecular == 2)
error->all(FLERR,"Cannot set bond topology types for atom style template");
// border swap to acquire ghost atom info
// enforce PBC before in case atoms are outside box
// init entire system since comm->exchange is done
// comm::init needs neighbor::init needs pair::init needs kspace::init, etc
if (comm->me == 0 && screen) fprintf(screen," system init for set ...\n");
lmp->init();
if (domain->triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
domain->reset_box();
comm->setup();
comm->exchange();
comm->borders();
if (domain->triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
// select both owned and ghost atoms
selection(atom->nlocal + atom->nghost);
// for BOND, each of 2 atoms must be in group
if (keyword == BOND) {
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
for (m = 0; m < atom->num_bond[i]; m++) {
atom1 = atom->map(atom->bond_atom[i][m]);
if (atom1 == -1) error->one(FLERR,"Bond atom missing in set command");
if (select[i] && select[atom1]) {
atom->bond_type[i][m] = ivalue;
count++;
}
}
}
// for ANGLE, each of 3 atoms must be in group
if (keyword == ANGLE) {
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
for (m = 0; m < atom->num_angle[i]; m++) {
atom1 = atom->map(atom->angle_atom1[i][m]);
atom2 = atom->map(atom->angle_atom2[i][m]);
atom3 = atom->map(atom->angle_atom3[i][m]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1)
error->one(FLERR,"Angle atom missing in set command");
if (select[atom1] && select[atom2] && select[atom3]) {
atom->angle_type[i][m] = ivalue;
count++;
}
}
}
// for DIHEDRAL, each of 4 atoms must be in group
if (keyword == DIHEDRAL) {
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
for (m = 0; m < atom->num_dihedral[i]; m++) {
atom1 = atom->map(atom->dihedral_atom1[i][m]);
atom2 = atom->map(atom->dihedral_atom2[i][m]);
atom3 = atom->map(atom->dihedral_atom3[i][m]);
atom4 = atom->map(atom->dihedral_atom4[i][m]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
error->one(FLERR,"Dihedral atom missing in set command");
if (select[atom1] && select[atom2] && select[atom3] && select[atom4]) {
atom->dihedral_type[i][m] = ivalue;
count++;
}
}
}
// for IMPROPER, each of 4 atoms must be in group
if (keyword == IMPROPER) {
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
for (m = 0; m < atom->num_improper[i]; m++) {
atom1 = atom->map(atom->improper_atom1[i][m]);
atom2 = atom->map(atom->improper_atom2[i][m]);
atom3 = atom->map(atom->improper_atom3[i][m]);
atom4 = atom->map(atom->improper_atom4[i][m]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
error->one(FLERR,"Improper atom missing in set command");
if (select[atom1] && select[atom2] && select[atom3] && select[atom4]) {
atom->improper_type[i][m] = ivalue;
count++;
}
}
}
}
/* ---------------------------------------------------------------------- */
void Set::varparse(char *name, int m)
{
varflag = 1;
name = &name[2];
int n = strlen(name) + 1;
char *str = new char[n];
strcpy(str,name);
int ivar = input->variable->find(str);
delete [] str;
if (ivar < 0)
error->all(FLERR,"Variable name for set command does not exist");
if (!input->variable->atomstyle(ivar))
error->all(FLERR,"Variable for set command is invalid style");
if (m == 1) {
varflag1 = 1; ivar1 = ivar;
} else if (m == 2) {
varflag2 = 1; ivar2 = ivar;
} else if (m == 3) {
varflag3 = 1; ivar3 = ivar;
} else if (m == 4) {
varflag4 = 1; ivar4 = ivar;
}
}
diff --git a/src/variable.cpp b/src/variable.cpp
index 5db4ee29c..d024223be 100644
--- a/src/variable.cpp
+++ b/src/variable.cpp
@@ -1,4613 +1,4614 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include "variable.h"
#include "universe.h"
#include "atom.h"
#include "update.h"
#include "group.h"
#include "domain.h"
#include "comm.h"
#include "region.h"
#include "modify.h"
#include "compute.h"
#include "fix.h"
#include "fix_store.h"
#include "force.h"
#include "output.h"
#include "thermo.h"
#include "random_mars.h"
#include "math_const.h"
#include "atom_masks.h"
#include "python_wrapper.h"
#include "memory.h"
#include "info.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
#define VARDELTA 4
#define MAXLEVEL 4
#define MAXLINE 256
#define CHUNK 1024
#define VALUELENGTH 64 // also in python.cpp
#define MAXFUNCARG 6
#define MYROUND(a) (( a-floor(a) ) >= .5) ? ceil(a) : floor(a)
enum{INDEX,LOOP,WORLD,UNIVERSE,ULOOP,STRING,GETENV,
SCALARFILE,ATOMFILE,FORMAT,EQUAL,ATOM,PYTHON};
enum{ARG,OP};
// customize by adding a function
// if add before OR,
// also set precedence level in constructor and precedence length in *.h
enum{DONE,ADD,SUBTRACT,MULTIPLY,DIVIDE,CARAT,MODULO,UNARY,
NOT,EQ,NE,LT,LE,GT,GE,AND,OR,
SQRT,EXP,LN,LOG,ABS,SIN,COS,TAN,ASIN,ACOS,ATAN,ATAN2,
RANDOM,NORMAL,CEIL,FLOOR,ROUND,RAMP,STAGGER,LOGFREQ,LOGFREQ2,
STRIDE,STRIDE2,VDISPLACE,SWIGGLE,CWIGGLE,GMASK,RMASK,GRMASK,
IS_ACTIVE,IS_DEFINED,IS_AVAILABLE,
VALUE,ATOMARRAY,TYPEARRAY,INTARRAY,BIGINTARRAY};
// customize by adding a special function
enum{SUM,XMIN,XMAX,AVE,TRAP,SLOPE};
#define INVOKED_SCALAR 1
#define INVOKED_VECTOR 2
#define INVOKED_ARRAY 4
#define INVOKED_PERATOM 8
#define BIG 1.0e20
/* ---------------------------------------------------------------------- */
Variable::Variable(LAMMPS *lmp) : Pointers(lmp)
{
MPI_Comm_rank(world,&me);
nvar = maxvar = 0;
names = NULL;
style = NULL;
num = NULL;
which = NULL;
pad = NULL;
reader = NULL;
data = NULL;
eval_in_progress = NULL;
randomequal = NULL;
randomatom = NULL;
// customize by assigning a precedence level
precedence[DONE] = 0;
precedence[OR] = 1;
precedence[AND] = 2;
precedence[EQ] = precedence[NE] = 3;
precedence[LT] = precedence[LE] = precedence[GT] = precedence[GE] = 4;
precedence[ADD] = precedence[SUBTRACT] = 5;
precedence[MULTIPLY] = precedence[DIVIDE] = precedence[MODULO] = 6;
precedence[CARAT] = 7;
precedence[UNARY] = precedence[NOT] = 8;
// Python wrapper, real or dummy
python = new Python(lmp);
}
/* ---------------------------------------------------------------------- */
Variable::~Variable()
{
for (int i = 0; i < nvar; i++) {
delete [] names[i];
delete reader[i];
if (style[i] == LOOP || style[i] == ULOOP) delete [] data[i][0];
else for (int j = 0; j < num[i]; j++) delete [] data[i][j];
delete [] data[i];
}
memory->sfree(names);
memory->destroy(style);
memory->destroy(num);
memory->destroy(which);
memory->destroy(pad);
memory->sfree(reader);
memory->sfree(data);
memory->destroy(eval_in_progress);
delete randomequal;
delete randomatom;
delete python;
}
/* ----------------------------------------------------------------------
called by variable command in input script
------------------------------------------------------------------------- */
void Variable::set(int narg, char **arg)
{
if (narg < 2) error->all(FLERR,"Illegal variable command");
int replaceflag = 0;
// DELETE
// doesn't matter if variable no longer exists
if (strcmp(arg[1],"delete") == 0) {
if (narg != 2) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) remove(find(arg[0]));
return;
// INDEX
// num = listed args, which = 1st value, data = copied args
} else if (strcmp(arg[1],"index") == 0) {
if (narg < 3) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) grow();
style[nvar] = INDEX;
num[nvar] = narg - 2;
which[nvar] = 0;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(num[nvar],&arg[2],data[nvar]);
// LOOP
// 1 arg + pad: num = N, which = 1st value, data = single string
// 2 args + pad: num = N2, which = N1, data = single string
} else if (strcmp(arg[1],"loop") == 0) {
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) grow();
style[nvar] = LOOP;
int nfirst,nlast;
if (narg == 3 || (narg == 4 && strcmp(arg[3],"pad") == 0)) {
nfirst = 1;
nlast = force->inumeric(FLERR,arg[2]);
if (nlast <= 0) error->all(FLERR,"Illegal variable command");
if (narg == 4 && strcmp(arg[3],"pad") == 0) {
char digits[12];
sprintf(digits,"%d",nlast);
pad[nvar] = strlen(digits);
} else pad[nvar] = 0;
} else if (narg == 4 || (narg == 5 && strcmp(arg[4],"pad") == 0)) {
nfirst = force->inumeric(FLERR,arg[2]);
nlast = force->inumeric(FLERR,arg[3]);
if (nfirst > nlast || nlast < 0)
error->all(FLERR,"Illegal variable command");
if (narg == 5 && strcmp(arg[4],"pad") == 0) {
char digits[12];
sprintf(digits,"%d",nlast);
pad[nvar] = strlen(digits);
} else pad[nvar] = 0;
} else error->all(FLERR,"Illegal variable command");
num[nvar] = nlast;
which[nvar] = nfirst-1;
data[nvar] = new char*[1];
data[nvar][0] = NULL;
// WORLD
// num = listed args, which = partition this proc is in, data = copied args
// error check that num = # of worlds in universe
} else if (strcmp(arg[1],"world") == 0) {
if (narg < 3) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) grow();
style[nvar] = WORLD;
num[nvar] = narg - 2;
if (num[nvar] != universe->nworlds)
error->all(FLERR,"World variable count doesn't match # of partitions");
which[nvar] = universe->iworld;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(num[nvar],&arg[2],data[nvar]);
// UNIVERSE and ULOOP
// for UNIVERSE: num = listed args, data = copied args
// for ULOOP: num = N, data = single string
// which = partition this proc is in
// universe proc 0 creates lock file
// error check that all other universe/uloop variables are same length
} else if (strcmp(arg[1],"universe") == 0 || strcmp(arg[1],"uloop") == 0) {
if (strcmp(arg[1],"universe") == 0) {
if (narg < 3) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) grow();
style[nvar] = UNIVERSE;
num[nvar] = narg - 2;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(num[nvar],&arg[2],data[nvar]);
} else if (strcmp(arg[1],"uloop") == 0) {
if (narg < 3 || narg > 4 || (narg == 4 && strcmp(arg[3],"pad") != 0))
error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) grow();
style[nvar] = ULOOP;
num[nvar] = force->inumeric(FLERR,arg[2]);
data[nvar] = new char*[1];
data[nvar][0] = NULL;
if (narg == 4) {
char digits[12];
sprintf(digits,"%d",num[nvar]);
pad[nvar] = strlen(digits);
} else pad[nvar] = 0;
}
if (num[nvar] < universe->nworlds)
error->all(FLERR,"Universe/uloop variable count < # of partitions");
which[nvar] = universe->iworld;
if (universe->me == 0) {
FILE *fp = fopen("tmp.lammps.variable","w");
if (fp == NULL)
error->one(FLERR,"Cannot open temporary file for world counter.");
fprintf(fp,"%d\n",universe->nworlds);
fclose(fp);
fp = NULL;
}
for (int jvar = 0; jvar < nvar; jvar++)
if (num[jvar] && (style[jvar] == UNIVERSE || style[jvar] == ULOOP) &&
num[nvar] != num[jvar])
error->all(FLERR,
"All universe/uloop variables must have same # of values");
// STRING
// replace pre-existing var if also style STRING (allows it to be reset)
// num = 1, which = 1st value
// data = 1 value, string to eval
} else if (strcmp(arg[1],"string") == 0) {
if (narg != 3) error->all(FLERR,"Illegal variable command");
int ivar = find(arg[0]);
if (ivar >= 0) {
if (style[ivar] != STRING)
error->all(FLERR,"Cannot redefine variable as a different style");
delete [] data[ivar][0];
copy(1,&arg[2],data[ivar]);
replaceflag = 1;
} else {
if (nvar == maxvar) grow();
style[nvar] = STRING;
num[nvar] = 1;
which[nvar] = 0;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(1,&arg[2],data[nvar]);
}
// GETENV
// remove pre-existing var if also style GETENV (allows it to be reset)
// num = 1, which = 1st value
// data = 1 value, string to eval
} else if (strcmp(arg[1],"getenv") == 0) {
if (narg != 3) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) {
if (style[find(arg[0])] != GETENV)
error->all(FLERR,"Cannot redefine variable as a different style");
remove(find(arg[0]));
}
if (nvar == maxvar) grow();
style[nvar] = GETENV;
num[nvar] = 1;
which[nvar] = 0;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(1,&arg[2],data[nvar]);
data[nvar][1] = new char[VALUELENGTH];
strcpy(data[nvar][1],"(undefined)");
// SCALARFILE for strings or numbers
// which = 1st value
// data = 1 value, string to eval
} else if (strcmp(arg[1],"file") == 0) {
if (narg != 3) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) grow();
style[nvar] = SCALARFILE;
num[nvar] = 1;
which[nvar] = 0;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
data[nvar][0] = new char[MAXLINE];
reader[nvar] = new VarReader(lmp,arg[0],arg[2],SCALARFILE);
int flag = reader[nvar]->read_scalar(data[nvar][0]);
if (flag) error->all(FLERR,"File variable could not read value");
// ATOMFILE for numbers
// which = 1st value
// data = NULL
} else if (strcmp(arg[1],"atomfile") == 0) {
if (narg != 3) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) grow();
style[nvar] = ATOMFILE;
num[nvar] = 1;
which[nvar] = 0;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
data[nvar][0] = NULL;
reader[nvar] = new VarReader(lmp,arg[0],arg[2],ATOMFILE);
int flag = reader[nvar]->read_peratom();
if (flag) error->all(FLERR,"Atomfile variable could not read values");
// FORMAT
// num = 3, which = 1st value
// data = 3 values
// 1st is name of variable to eval, 2nd is format string,
// 3rd is filled on retrieval
} else if (strcmp(arg[1],"format") == 0) {
if (narg != 4) error->all(FLERR,"Illegal variable command");
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) grow();
style[nvar] = FORMAT;
num[nvar] = 3;
which[nvar] = 0;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(2,&arg[2],data[nvar]);
data[nvar][2] = new char[VALUELENGTH];
strcpy(data[nvar][2],"(undefined)");
// EQUAL
// replace pre-existing var if also style EQUAL (allows it to be reset)
// num = 2, which = 1st value
// data = 2 values, 1st is string to eval, 2nd is filled on retrieval
} else if (strcmp(arg[1],"equal") == 0) {
if (narg != 3) error->all(FLERR,"Illegal variable command");
int ivar = find(arg[0]);
if (ivar >= 0) {
if (style[ivar] != EQUAL)
error->all(FLERR,"Cannot redefine variable as a different style");
delete [] data[ivar][0];
copy(1,&arg[2],data[ivar]);
replaceflag = 1;
} else {
if (nvar == maxvar) grow();
style[nvar] = EQUAL;
num[nvar] = 2;
which[nvar] = 0;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(1,&arg[2],data[nvar]);
data[nvar][1] = new char[VALUELENGTH];
strcpy(data[nvar][1],"(undefined)");
}
// ATOM
// replace pre-existing var if also style ATOM (allows it to be reset)
// num = 1, which = 1st value
// data = 1 value, string to eval
} else if (strcmp(arg[1],"atom") == 0) {
if (narg != 3) error->all(FLERR,"Illegal variable command");
int ivar = find(arg[0]);
if (ivar >= 0) {
if (style[ivar] != ATOM)
error->all(FLERR,"Cannot redefine variable as a different style");
delete [] data[ivar][0];
copy(1,&arg[2],data[ivar]);
replaceflag = 1;
} else {
if (nvar == maxvar) grow();
style[nvar] = ATOM;
num[nvar] = 1;
which[nvar] = 0;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(1,&arg[2],data[nvar]);
}
// PYTHON
// replace pre-existing var if also style PYTHON (allows it to be reset)
// num = 2, which = 1st value
// data = 2 values, 1st is Python func to invoke, 2nd is filled by invoke
} else if (strcmp(arg[1],"python") == 0) {
if (narg != 3) error->all(FLERR,"Illegal variable command");
if (!python->python_exists)
error->all(FLERR,"LAMMPS is not built with Python embedded");
int ivar = find(arg[0]);
if (ivar >= 0) {
if (style[ivar] != PYTHON)
error->all(FLERR,"Cannot redefine variable as a different style");
delete [] data[ivar][0];
copy(1,&arg[2],data[ivar]);
replaceflag = 1;
} else {
if (nvar == maxvar) grow();
style[nvar] = PYTHON;
num[nvar] = 2;
which[nvar] = 1;
pad[nvar] = 0;
data[nvar] = new char*[num[nvar]];
copy(1,&arg[2],data[nvar]);
data[nvar][1] = new char[VALUELENGTH];
strcpy(data[nvar][1],"(undefined)");
}
} else error->all(FLERR,"Illegal variable command");
// set name of variable, if not replacing (EQUAL/ATOM/STRING/PYTHON)
// name must be all alphanumeric chars or underscores
if (replaceflag) return;
int n = strlen(arg[0]) + 1;
names[nvar] = new char[n];
strcpy(names[nvar],arg[0]);
for (int i = 0; i < n-1; i++)
if (!isalnum(names[nvar][i]) && names[nvar][i] != '_')
error->all(FLERR,"Variable name must be alphanumeric or "
"underscore characters");
nvar++;
}
/* ----------------------------------------------------------------------
INDEX variable created by command-line argument
make it INDEX rather than STRING so cannot be re-defined in input script
------------------------------------------------------------------------- */
void Variable::set(char *name, int narg, char **arg)
{
char **newarg = new char*[2+narg];
newarg[0] = name;
newarg[1] = (char *) "index";
for (int i = 0; i < narg; i++) newarg[2+i] = arg[i];
set(2+narg,newarg);
delete [] newarg;
}
/* ----------------------------------------------------------------------
set existing STRING variable to str
return 0 if successful
return -1 if variable doesn't exist or isn't a STRING variable
called via library interface, so external programs can set variables
------------------------------------------------------------------------- */
int Variable::set_string(char *name, char *str)
{
int ivar = find(name);
if (ivar < 0) return -1;
if (style[ivar] != STRING) return -1;
delete [] data[ivar][0];
copy(1,&str,data[ivar]);
return 0;
}
/* ----------------------------------------------------------------------
increment variable(s)
return 0 if OK if successfully incremented
return 1 if any variable is exhausted, free the variable to allow re-use
------------------------------------------------------------------------- */
int Variable::next(int narg, char **arg)
{
int ivar;
if (narg == 0) error->all(FLERR,"Illegal next command");
// check that variables exist and are all the same style
// exception: UNIVERSE and ULOOP variables can be mixed in same next command
for (int iarg = 0; iarg < narg; iarg++) {
ivar = find(arg[iarg]);
if (ivar < 0) error->all(FLERR,"Invalid variable in next command");
if (style[ivar] == ULOOP && style[find(arg[0])] == UNIVERSE) continue;
else if (style[ivar] == UNIVERSE && style[find(arg[0])] == ULOOP) continue;
else if (style[ivar] != style[find(arg[0])])
error->all(FLERR,"All variables in next command must be same style");
}
// invalid styles: STRING, EQUAL, WORLD, ATOM, GETENV, FORMAT, PYTHON
int istyle = style[find(arg[0])];
if (istyle == STRING || istyle == EQUAL || istyle == WORLD ||
istyle == GETENV || istyle == ATOM || istyle == FORMAT ||
istyle == PYTHON)
error->all(FLERR,"Invalid variable style with next command");
// if istyle = UNIVERSE or ULOOP, insure all such variables are incremented
if (istyle == UNIVERSE || istyle == ULOOP)
for (int i = 0; i < nvar; i++) {
if (style[i] != UNIVERSE && style[i] != ULOOP) continue;
int iarg = 0;
for (iarg = 0; iarg < narg; iarg++)
if (strcmp(arg[iarg],names[i]) == 0) break;
if (iarg == narg)
error->universe_one(FLERR,"Next command must list all "
"universe and uloop variables");
}
// increment all variables in list
// if any variable is exhausted, set flag = 1 and remove var to allow re-use
int flag = 0;
if (istyle == INDEX || istyle == LOOP) {
for (int iarg = 0; iarg < narg; iarg++) {
ivar = find(arg[iarg]);
which[ivar]++;
if (which[ivar] >= num[ivar]) {
flag = 1;
remove(ivar);
}
}
} else if (istyle == SCALARFILE) {
for (int iarg = 0; iarg < narg; iarg++) {
ivar = find(arg[iarg]);
int done = reader[ivar]->read_scalar(data[ivar][0]);
if (done) {
flag = 1;
remove(ivar);
}
}
} else if (istyle == ATOMFILE) {
for (int iarg = 0; iarg < narg; iarg++) {
ivar = find(arg[iarg]);
int done = reader[ivar]->read_peratom();
if (done) {
flag = 1;
remove(ivar);
}
}
} else if (istyle == UNIVERSE || istyle == ULOOP) {
// wait until lock file can be created and owned by proc 0 of this world
// rename() is not atomic in practice, but no known simple fix
// means multiple procs can read/write file at the same time (bad!)
// random delays help
// delay for random fraction of 1 second before first rename() call
// delay for random fraction of 1 second before subsequent tries
// when successful, read next available index and Bcast it within my world
int nextindex;
if (me == 0) {
int seed = 12345 + universe->me + which[find(arg[0])];
RanMars *random = new RanMars(lmp,seed);
int delay = (int) (1000000*random->uniform());
usleep(delay);
while (1) {
if (!rename("tmp.lammps.variable","tmp.lammps.variable.lock")) break;
delay = (int) (1000000*random->uniform());
usleep(delay);
}
delete random;
FILE *fp = fopen("tmp.lammps.variable.lock","r");
fscanf(fp,"%d",&nextindex);
//printf("READ %d %d\n",universe->me,nextindex);
fclose(fp);
fp = fopen("tmp.lammps.variable.lock","w");
fprintf(fp,"%d\n",nextindex+1);
//printf("WRITE %d %d\n",universe->me,nextindex+1);
fclose(fp);
fp = NULL;
rename("tmp.lammps.variable.lock","tmp.lammps.variable");
if (universe->uscreen)
fprintf(universe->uscreen,
"Increment via next: value %d on partition %d\n",
nextindex+1,universe->iworld);
if (universe->ulogfile)
fprintf(universe->ulogfile,
"Increment via next: value %d on partition %d\n",
nextindex+1,universe->iworld);
}
MPI_Bcast(&nextindex,1,MPI_INT,0,world);
// set all variables in list to nextindex
// must increment all UNIVERSE and ULOOP variables here
// error check above tested for this
for (int iarg = 0; iarg < narg; iarg++) {
ivar = find(arg[iarg]);
which[ivar] = nextindex;
if (which[ivar] >= num[ivar]) {
flag = 1;
remove(ivar);
}
}
}
return flag;
}
/* ----------------------------------------------------------------------
search for name in list of variables names
return index or -1 if not found
------------------------------------------------------------------------- */
int Variable::find(char *name)
{
for (int i = 0; i < nvar; i++)
if (strcmp(name,names[i]) == 0) return i;
return -1;
}
/* ----------------------------------------------------------------------
initialize one atom's storage values in all VarReaders via fix STORE
called when atom is created
------------------------------------------------------------------------- */
void Variable::set_arrays(int i)
{
for (int i = 0; i < nvar; i++)
if (reader[i] && style[i] == ATOMFILE)
reader[i]->fixstore->vstore[i] = 0.0;
}
/* ----------------------------------------------------------------------
called by python command in input script
simply pass input script line args to Python class
------------------------------------------------------------------------- */
void Variable::python_command(int narg, char **arg)
{
if (!python->python_exists)
error->all(FLERR,"LAMMPS is not built with Python embedded");
python->command(narg,arg);
}
/* ----------------------------------------------------------------------
return 1 if variable is EQUAL or PYTHON numeric style, 0 if not
this is checked before call to compute_equal() to return a double
------------------------------------------------------------------------- */
int Variable::equalstyle(int ivar)
{
if (style[ivar] == EQUAL) return 1;
if (style[ivar] == PYTHON) {
int ifunc = python->variable_match(data[ivar][0],names[ivar],1);
if (ifunc < 0) return 0;
else return 1;
}
return 0;
}
/* ----------------------------------------------------------------------
return 1 if variable is ATOM or ATOMFILE style, 0 if not
this is checked before call to compute_atom() to return a vector of doubles
------------------------------------------------------------------------- */
int Variable::atomstyle(int ivar)
{
if (style[ivar] == ATOM || style[ivar] == ATOMFILE) return 1;
return 0;
}
/* ----------------------------------------------------------------------
check if variable with name is PYTHON and matches funcname
called by Python class before it invokes a Python function
return data storage so Python function can return a value for this variable
return NULL if not a match
------------------------------------------------------------------------- */
char *Variable::pythonstyle(char *name, char *funcname)
{
int ivar = find(name);
if (ivar < 0) return NULL;
if (style[ivar] != PYTHON) return NULL;
if (strcmp(data[ivar][0],funcname) != 0) return NULL;
return data[ivar][1];
}
/* ----------------------------------------------------------------------
return ptr to the data text associated with a variable
if INDEX or WORLD or UNIVERSE or STRING or SCALARFILE,
return ptr to stored string
if LOOP or ULOOP, write int to data[0] and return ptr to string
if EQUAL, evaluate variable and put result in str
if FORMAT, evaluate its variable and put formatted result in str
if GETENV, query environment and put result in str
if PYTHON, evaluate Python function, it will put result in str
if ATOM or ATOMFILE, return NULL
return NULL if no variable with name, or which value is bad,
caller must respond
------------------------------------------------------------------------- */
char *Variable::retrieve(char *name)
{
int ivar = find(name);
if (ivar < 0) return NULL;
if (which[ivar] >= num[ivar]) return NULL;
if (eval_in_progress[ivar])
error->all(FLERR,"Variable has circular dependency");
eval_in_progress[ivar] = 1;
char *str = NULL;
if (style[ivar] == INDEX || style[ivar] == WORLD ||
style[ivar] == UNIVERSE || style[ivar] == STRING ||
style[ivar] == SCALARFILE) {
str = data[ivar][which[ivar]];
} else if (style[ivar] == LOOP || style[ivar] == ULOOP) {
char result[16];
if (pad[ivar] == 0) sprintf(result,"%d",which[ivar]+1);
else {
char padstr[16];
sprintf(padstr,"%%0%dd",pad[ivar]);
sprintf(result,padstr,which[ivar]+1);
}
int n = strlen(result) + 1;
delete [] data[ivar][0];
data[ivar][0] = new char[n];
strcpy(data[ivar][0],result);
str = data[ivar][0];
} else if (style[ivar] == EQUAL) {
double answer = evaluate(data[ivar][0],NULL);
sprintf(data[ivar][1],"%.15g",answer);
str = data[ivar][1];
} else if (style[ivar] == FORMAT) {
int jvar = find(data[ivar][0]);
if (jvar == -1) return NULL;
if (!equalstyle(jvar)) return NULL;
double answer = compute_equal(jvar);
sprintf(data[ivar][2],data[ivar][1],answer);
str = data[ivar][2];
} else if (style[ivar] == GETENV) {
const char *result = getenv(data[ivar][0]);
if (result == NULL) result = (const char *) "";
int n = strlen(result) + 1;
if (n > VALUELENGTH) {
delete [] data[ivar][1];
data[ivar][1] = new char[n];
}
strcpy(data[ivar][1],result);
str = data[ivar][1];
} else if (style[ivar] == PYTHON) {
int ifunc = python->variable_match(data[ivar][0],names[ivar],0);
if (ifunc < 0)
error->all(FLERR,"Python variable does not match Python function");
python->invoke_function(ifunc,data[ivar][1]);
str = data[ivar][1];
} else if (style[ivar] == ATOM || style[ivar] == ATOMFILE) return NULL;
eval_in_progress[ivar] = 0;
return str;
}
/* ----------------------------------------------------------------------
return result of equal-style variable evaluation
can be EQUAL style or PYTHON numeric style
for PYTHON, don't need to check python->variable_match() error return,
since caller will have already checked via equalstyle()
------------------------------------------------------------------------- */
double Variable::compute_equal(int ivar)
{
if (eval_in_progress[ivar])
error->all(FLERR,"Variable has circular dependency");
eval_in_progress[ivar] = 1;
double value = 0.0;
if (style[ivar] == EQUAL) value = evaluate(data[ivar][0],NULL);
else if (style[ivar] == PYTHON) {
int ifunc = python->find(data[ivar][0]);
if (ifunc < 0) error->all(FLERR,"Python variable has no function");
python->invoke_function(ifunc,data[ivar][1]);
value = atof(data[ivar][1]);
}
eval_in_progress[ivar] = 0;
return value;
}
/* ----------------------------------------------------------------------
return result of immediate equal-style variable evaluation
called from Input::substitute()
don't need to flag eval_in_progress since is an immediate variable
------------------------------------------------------------------------- */
double Variable::compute_equal(char *str)
{
return evaluate(str,NULL);
}
/* ----------------------------------------------------------------------
compute result of atom-style and atomfile-style variable evaluation
only computed for atoms in igroup, else result is 0.0
answers are placed every stride locations into result
if sumflag, add variable values to existing result
------------------------------------------------------------------------- */
void Variable::compute_atom(int ivar, int igroup,
double *result, int stride, int sumflag)
{
Tree *tree;
double *vstore;
if (eval_in_progress[ivar])
error->all(FLERR,"Variable has circular dependency");
eval_in_progress[ivar] = 1;
if (style[ivar] == ATOM) {
evaluate(data[ivar][0],&tree);
collapse_tree(tree);
} else vstore = reader[ivar]->fixstore->vstore;
if (result == NULL) {
eval_in_progress[ivar] = 0;
return;
}
int groupbit = group->bitmask[igroup];
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (style[ivar] == ATOM) {
if (sumflag == 0) {
int m = 0;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) result[m] = eval_tree(tree,i);
else result[m] = 0.0;
m += stride;
}
} else {
int m = 0;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) result[m] += eval_tree(tree,i);
m += stride;
}
}
} else {
if (sumflag == 0) {
int m = 0;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) result[m] = vstore[i];
else result[m] = 0.0;
m += stride;
}
} else {
int m = 0;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) result[m] += vstore[i];
m += stride;
}
}
}
if (style[ivar] == ATOM) free_tree(tree);
eval_in_progress[ivar] = 0;
}
/* ----------------------------------------------------------------------
save copy of EQUAL style ivar formula in copy
allocate copy here, later equal_restore() call will free it
insure data[ivar][0] is of VALUELENGTH since will be overridden
next 3 functions are used by create_atoms to temporarily override variables
------------------------------------------------------------------------- */
void Variable::equal_save(int ivar, char *&copy)
{
int n = strlen(data[ivar][0]) + 1;
copy = new char[n];
strcpy(copy,data[ivar][0]);
delete [] data[ivar][0];
data[ivar][0] = new char[VALUELENGTH];
}
/* ----------------------------------------------------------------------
restore formula string of EQUAL style ivar from copy
then free copy, allocated in equal_save()
------------------------------------------------------------------------- */
void Variable::equal_restore(int ivar, char *copy)
{
delete [] data[ivar][0];
int n = strlen(copy) + 1;
data[ivar][0] = new char[n];
strcpy(data[ivar][0],copy);
delete [] copy;
}
/* ----------------------------------------------------------------------
override EQUAL style ivar formula with value converted to string
data[ivar][0] was set to length 64 in equal_save()
------------------------------------------------------------------------- */
void Variable::equal_override(int ivar, double value)
{
sprintf(data[ivar][0],"%.15g",value);
}
/* ----------------------------------------------------------------------
remove Nth variable from list and compact list
delete reader explicitly if it exists
------------------------------------------------------------------------- */
void Variable::remove(int n)
{
delete [] names[n];
if (style[n] == LOOP || style[n] == ULOOP) delete [] data[n][0];
else for (int i = 0; i < num[n]; i++) delete [] data[n][i];
delete [] data[n];
delete reader[n];
for (int i = n+1; i < nvar; i++) {
names[i-1] = names[i];
style[i-1] = style[i];
num[i-1] = num[i];
which[i-1] = which[i];
pad[i-1] = pad[i];
reader[i-1] = reader[i];
data[i-1] = data[i];
}
nvar--;
}
/* ----------------------------------------------------------------------
make space in arrays for new variable
------------------------------------------------------------------------- */
void Variable::grow()
{
int old = maxvar;
maxvar += VARDELTA;
names = (char **) memory->srealloc(names,maxvar*sizeof(char *),"var:names");
memory->grow(style,maxvar,"var:style");
memory->grow(num,maxvar,"var:num");
memory->grow(which,maxvar,"var:which");
memory->grow(pad,maxvar,"var:pad");
reader = (VarReader **)
memory->srealloc(reader,maxvar*sizeof(VarReader *),"var:reader");
for (int i = old; i < maxvar; i++) reader[i] = NULL;
data = (char ***) memory->srealloc(data,maxvar*sizeof(char **),"var:data");
memory->grow(eval_in_progress,maxvar,"var:eval_in_progress");
for (int i = 0; i < maxvar; i++) eval_in_progress[i] = 0;
}
/* ----------------------------------------------------------------------
copy narg strings from **from to **to, and allocate space for them
------------------------------------------------------------------------- */
void Variable::copy(int narg, char **from, char **to)
{
int n;
for (int i = 0; i < narg; i++) {
n = strlen(from[i]) + 1;
to[i] = new char[n];
strcpy(to[i],from[i]);
}
}
/* ----------------------------------------------------------------------
recursive evaluation of a string str
str is an equal-style or atom-style formula containing one or more items:
number = 0.0, -5.45, 2.8e-4, ...
constant = PI, version, yes, no, on, off
thermo keyword = ke, vol, atoms, ...
math operation = (),-x,x+y,x-y,x*y,x/y,x^y,
x==y,x!=y,x<y,x<=y,x>y,x>=y,x&&y,x||y,
sqrt(x),exp(x),ln(x),log(x),abs(x),
sin(x),cos(x),tan(x),asin(x),atan2(y,x),...
group function = count(group), mass(group), xcm(group,x), ...
special function = sum(x),min(x), ...
atom value = x[i], y[i], vx[i], ...
atom vector = x, y, vx, ...
compute = c_ID, c_ID[i], c_ID[i][j]
fix = f_ID, f_ID[i], f_ID[i][j]
variable = v_name, v_name[i]
equal-style variables passes in tree = NULL:
evaluate the formula, return result as a double
atom-style variable passes in tree = non-NULL:
parse the formula but do not evaluate it
create a parse tree and return it
------------------------------------------------------------------------- */
double Variable::evaluate(char *str, Tree **tree)
{
int op,opprevious;
double value1,value2;
char onechar;
char *ptr;
double argstack[MAXLEVEL];
Tree *treestack[MAXLEVEL];
int opstack[MAXLEVEL];
int nargstack = 0;
int ntreestack = 0;
int nopstack = 0;
int i = 0;
int expect = ARG;
while (1) {
onechar = str[i];
// whitespace: just skip
if (isspace(onechar)) i++;
// ----------------
// parentheses: recursively evaluate contents of parens
// ----------------
else if (onechar == '(') {
if (expect == OP) error->all(FLERR,"Invalid syntax in variable formula");
expect = OP;
char *contents;
i = find_matching_paren(str,i,contents);
i++;
// evaluate contents and push on stack
if (tree) {
Tree *newtree;
evaluate(contents,&newtree);
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = evaluate(contents,NULL);
delete [] contents;
// ----------------
// number: push value onto stack
// ----------------
} else if (isdigit(onechar) || onechar == '.') {
if (expect == OP) error->all(FLERR,"Invalid syntax in variable formula");
expect = OP;
// istop = end of number, including scientific notation
int istart = i;
while (isdigit(str[i]) || str[i] == '.') i++;
if (str[i] == 'e' || str[i] == 'E') {
i++;
if (str[i] == '+' || str[i] == '-') i++;
while (isdigit(str[i])) i++;
}
int istop = i - 1;
int n = istop - istart + 1;
char *number = new char[n+1];
strncpy(number,&str[istart],n);
number[n] = '\0';
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = atof(number);
newtree->first = newtree->second = NULL;
newtree->extra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = atof(number);
delete [] number;
// ----------------
// letter: c_ID, c_ID[], c_ID[][], f_ID, f_ID[], f_ID[][],
// v_name, v_name[], exp(), xcm(,), x, x[], PI, vol
// ----------------
} else if (isalpha(onechar)) {
if (expect == OP) error->all(FLERR,"Invalid syntax in variable formula");
expect = OP;
// istop = end of word
// word = all alphanumeric or underscore
int istart = i;
while (isalnum(str[i]) || str[i] == '_') i++;
int istop = i-1;
int n = istop - istart + 1;
char *word = new char[n+1];
strncpy(word,&str[istart],n);
word[n] = '\0';
// ----------------
// compute
// ----------------
if (strncmp(word,"c_",2) == 0) {
if (domain->box_exist == 0)
error->all(FLERR,
"Variable evaluation before simulation box is defined");
int icompute = modify->find_compute(word+2);
if (icompute < 0)
error->all(FLERR,"Invalid compute ID in variable formula");
Compute *compute = modify->compute[icompute];
// parse zero or one or two trailing brackets
// point i beyond last bracket
// nbracket = # of bracket pairs
// index1,index2 = int inside each bracket pair, possibly an atom ID
int nbracket;
tagint index1,index2;
if (str[i] != '[') nbracket = 0;
else {
nbracket = 1;
ptr = &str[i];
index1 = int_between_brackets(ptr,1);
i = ptr-str+1;
if (str[i] == '[') {
nbracket = 2;
ptr = &str[i];
index2 = int_between_brackets(ptr,1);
i = ptr-str+1;
}
}
// c_ID = scalar from global scalar
if (nbracket == 0 && compute->scalar_flag) {
if (update->whichflag == 0) {
if (compute->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_SCALAR)) {
compute->compute_scalar();
compute->invoked_flag |= INVOKED_SCALAR;
}
value1 = compute->scalar;
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// c_ID[i] = scalar from global vector
} else if (nbracket == 1 && compute->vector_flag) {
if (index1 > compute->size_vector &&
compute->size_vector_variable == 0)
error->all(FLERR,"Variable formula compute vector "
"is accessed out-of-range");
if (update->whichflag == 0) {
if (compute->invoked_vector != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_VECTOR)) {
compute->compute_vector();
compute->invoked_flag |= INVOKED_VECTOR;
}
if (compute->size_vector_variable &&
index1 > compute->size_vector) value1 = 0.0;
else value1 = compute->vector[index1-1];
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// c_ID[i][j] = scalar from global array
} else if (nbracket == 2 && compute->array_flag) {
if (index1 > compute->size_array_rows &&
compute->size_array_rows_variable == 0)
error->all(FLERR,"Variable formula compute array "
"is accessed out-of-range");
if (index2 > compute->size_array_cols)
error->all(FLERR,"Variable formula compute array "
"is accessed out-of-range");
if (update->whichflag == 0) {
if (compute->invoked_array != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_ARRAY)) {
compute->compute_array();
compute->invoked_flag |= INVOKED_ARRAY;
}
if (compute->size_array_rows_variable &&
index1 > compute->size_array_rows) value1 = 0.0;
else value1 = compute->array[index1-1][index2-1];
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// c_ID[i] = scalar from per-atom vector
} else if (nbracket == 1 && compute->peratom_flag &&
compute->size_peratom_cols == 0) {
if (update->whichflag == 0) {
if (compute->invoked_peratom != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
compute->compute_peratom();
compute->invoked_flag |= INVOKED_PERATOM;
}
peratom2global(1,NULL,compute->vector_atom,1,index1,
tree,treestack,ntreestack,argstack,nargstack);
// c_ID[i][j] = scalar from per-atom array
} else if (nbracket == 2 && compute->peratom_flag &&
compute->size_peratom_cols > 0) {
if (index2 > compute->size_peratom_cols)
error->all(FLERR,"Variable formula compute array "
"is accessed out-of-range");
if (update->whichflag == 0) {
if (compute->invoked_peratom != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
compute->compute_peratom();
compute->invoked_flag |= INVOKED_PERATOM;
}
if (compute->array_atom)
peratom2global(1,NULL,&compute->array_atom[0][index2-1],
compute->size_peratom_cols,index1,
tree,treestack,ntreestack,argstack,nargstack);
else
peratom2global(1,NULL,NULL,
compute->size_peratom_cols,index1,
tree,treestack,ntreestack,argstack,nargstack);
// c_ID = vector from per-atom vector
} else if (nbracket == 0 && compute->peratom_flag &&
compute->size_peratom_cols == 0) {
if (tree == NULL)
error->all(FLERR,
"Per-atom compute in equal-style variable formula");
if (update->whichflag == 0) {
if (compute->invoked_peratom != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
compute->compute_peratom();
compute->invoked_flag |= INVOKED_PERATOM;
}
Tree *newtree = new Tree();
newtree->type = ATOMARRAY;
newtree->array = compute->vector_atom;
newtree->nstride = 1;
newtree->selfalloc = 0;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
// c_ID[i] = vector from per-atom array
} else if (nbracket == 1 && compute->peratom_flag &&
compute->size_peratom_cols > 0) {
if (tree == NULL)
error->all(FLERR,
"Per-atom compute in equal-style variable formula");
if (index1 > compute->size_peratom_cols)
error->all(FLERR,"Variable formula compute array "
"is accessed out-of-range");
if (update->whichflag == 0) {
if (compute->invoked_peratom != update->ntimestep)
error->all(FLERR,"Compute used in variable between runs "
"is not current");
} else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
compute->compute_peratom();
compute->invoked_flag |= INVOKED_PERATOM;
}
Tree *newtree = new Tree();
newtree->type = ATOMARRAY;
if (compute->array_atom)
newtree->array = &compute->array_atom[0][index1-1];
else
newtree->array = NULL;
newtree->nstride = compute->size_peratom_cols;
newtree->selfalloc = 0;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else error->all(FLERR,"Mismatched compute in variable formula");
// ----------------
// fix
// ----------------
} else if (strncmp(word,"f_",2) == 0) {
if (domain->box_exist == 0)
error->all(FLERR,
"Variable evaluation before simulation box is defined");
int ifix = modify->find_fix(word+2);
if (ifix < 0) error->all(FLERR,"Invalid fix ID in variable formula");
Fix *fix = modify->fix[ifix];
// parse zero or one or two trailing brackets
// point i beyond last bracket
// nbracket = # of bracket pairs
// index1,index2 = int inside each bracket pair, possibly an atom ID
int nbracket;
tagint index1,index2;
if (str[i] != '[') nbracket = 0;
else {
nbracket = 1;
ptr = &str[i];
index1 = int_between_brackets(ptr,1);
i = ptr-str+1;
if (str[i] == '[') {
nbracket = 2;
ptr = &str[i];
index2 = int_between_brackets(ptr,1);
i = ptr-str+1;
}
}
// f_ID = scalar from global scalar
if (nbracket == 0 && fix->scalar_flag) {
if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
value1 = fix->compute_scalar();
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// f_ID[i] = scalar from global vector
} else if (nbracket == 1 && fix->vector_flag) {
if (index1 > fix->size_vector &&
fix->size_vector_variable == 0)
error->all(FLERR,"Variable formula fix vector is "
"accessed out-of-range");
if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
value1 = fix->compute_vector(index1-1);
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// f_ID[i][j] = scalar from global array
} else if (nbracket == 2 && fix->array_flag) {
if (index1 > fix->size_array_rows &&
fix->size_array_rows_variable == 0)
error->all(FLERR,
"Variable formula fix array is accessed out-of-range");
if (index2 > fix->size_array_cols)
error->all(FLERR,
"Variable formula fix array is accessed out-of-range");
if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
value1 = fix->compute_array(index1-1,index2-1);
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// f_ID[i] = scalar from per-atom vector
} else if (nbracket == 1 && fix->peratom_flag &&
fix->size_peratom_cols == 0) {
if (update->whichflag > 0 &&
update->ntimestep % fix->peratom_freq)
error->all(FLERR,
"Fix in variable not computed at compatible time");
peratom2global(1,NULL,fix->vector_atom,1,index1,
tree,treestack,ntreestack,argstack,nargstack);
// f_ID[i][j] = scalar from per-atom array
} else if (nbracket == 2 && fix->peratom_flag &&
fix->size_peratom_cols > 0) {
if (index2 > fix->size_peratom_cols)
error->all(FLERR,
"Variable formula fix array is accessed out-of-range");
if (update->whichflag > 0 &&
update->ntimestep % fix->peratom_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
if (fix->array_atom)
peratom2global(1,NULL,&fix->array_atom[0][index2-1],
fix->size_peratom_cols,index1,
tree,treestack,ntreestack,argstack,nargstack);
else
peratom2global(1,NULL,NULL,
fix->size_peratom_cols,index1,
tree,treestack,ntreestack,argstack,nargstack);
// f_ID = vector from per-atom vector
} else if (nbracket == 0 && fix->peratom_flag &&
fix->size_peratom_cols == 0) {
if (tree == NULL)
error->all(FLERR,"Per-atom fix in equal-style variable formula");
if (update->whichflag > 0 &&
update->ntimestep % fix->peratom_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
Tree *newtree = new Tree();
newtree->type = ATOMARRAY;
newtree->array = fix->vector_atom;
newtree->nstride = 1;
newtree->selfalloc = 0;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
// f_ID[i] = vector from per-atom array
} else if (nbracket == 1 && fix->peratom_flag &&
fix->size_peratom_cols > 0) {
if (tree == NULL)
error->all(FLERR,"Per-atom fix in equal-style variable formula");
if (index1 > fix->size_peratom_cols)
error->all(FLERR,
"Variable formula fix array is accessed out-of-range");
if (update->whichflag > 0 &&
update->ntimestep % fix->peratom_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
Tree *newtree = new Tree();
newtree->type = ATOMARRAY;
if (fix->array_atom)
newtree->array = &fix->array_atom[0][index1-1];
else
newtree->array = NULL;
newtree->nstride = fix->size_peratom_cols;
newtree->selfalloc = 0;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else error->all(FLERR,"Mismatched fix in variable formula");
// ----------------
// variable
// ----------------
} else if (strncmp(word,"v_",2) == 0) {
int ivar = find(word+2);
if (ivar < 0)
error->all(FLERR,"Invalid variable name in variable formula");
if (eval_in_progress[ivar])
error->all(FLERR,"Variable has circular dependency");
// parse zero or one trailing brackets
// point i beyond last bracket
// nbracket = # of bracket pairs
// index = int inside bracket, possibly an atom ID
int nbracket;
tagint index;
if (str[i] != '[') nbracket = 0;
else {
nbracket = 1;
ptr = &str[i];
index = int_between_brackets(ptr,1);
i = ptr-str+1;
}
// v_name = scalar from non atom/atomfile variable
if (nbracket == 0 && style[ivar] != ATOM && style[ivar] != ATOMFILE) {
char *var = retrieve(word+2);
if (var == NULL)
error->all(FLERR,"Invalid variable evaluation in variable formula");
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = atof(var);
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = atof(var);
// v_name = per-atom vector from atom-style variable
// evaluate the atom-style variable as newtree
} else if (nbracket == 0 && style[ivar] == ATOM) {
if (tree == NULL)
error->all(FLERR,
"Atom-style variable in equal-style variable formula");
Tree *newtree;
evaluate(data[ivar][0],&newtree);
treestack[ntreestack++] = newtree;
// v_name = per-atom vector from atomfile-style variable
} else if (nbracket == 0 && style[ivar] == ATOMFILE) {
if (tree == NULL)
error->all(FLERR,"Atomfile-style variable in "
"equal-style variable formula");
Tree *newtree = new Tree();
newtree->type = ATOMARRAY;
newtree->array = reader[ivar]->fixstore->vstore;
newtree->nstride = 1;
newtree->selfalloc = 0;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
// v_name[N] = scalar from atom-style variable
// compute the per-atom variable in result
// use peratom2global to extract single value from result
} else if (nbracket && style[ivar] == ATOM) {
double *result;
memory->create(result,atom->nlocal,"variable:result");
compute_atom(ivar,0,result,1,0);
peratom2global(1,NULL,result,1,index,
tree,treestack,ntreestack,argstack,nargstack);
memory->destroy(result);
// v_name[N] = scalar from atomfile-style variable
} else if (nbracket && style[ivar] == ATOMFILE) {
peratom2global(1,NULL,reader[ivar]->fixstore->vstore,1,index,
tree,treestack,ntreestack,argstack,nargstack);
} else error->all(FLERR,"Mismatched variable in variable formula");
// ----------------
// math/group/special function or atom value/vector or
// constant or thermo keyword
// ----------------
} else {
// ----------------
// math or group or special function
// ----------------
if (str[i] == '(') {
char *contents;
i = find_matching_paren(str,i,contents);
i++;
if (math_function(word,contents,tree,
treestack,ntreestack,argstack,nargstack));
else if (group_function(word,contents,tree,
treestack,ntreestack,argstack,nargstack));
else if (special_function(word,contents,tree,
treestack,ntreestack,argstack,nargstack));
else error->all(FLERR,"Invalid math/group/special function "
"in variable formula");
delete [] contents;
// ----------------
// atom value
// ----------------
} else if (str[i] == '[') {
if (domain->box_exist == 0)
error->all(FLERR,
"Variable evaluation before simulation box is defined");
ptr = &str[i];
tagint id = int_between_brackets(ptr,1);
i = ptr-str+1;
peratom2global(0,word,NULL,0,id,
tree,treestack,ntreestack,argstack,nargstack);
// ----------------
// atom vector
// ----------------
} else if (is_atom_vector(word)) {
if (domain->box_exist == 0)
error->all(FLERR,
"Variable evaluation before simulation box is defined");
atom_vector(word,tree,treestack,ntreestack);
// ----------------
// constant
// ----------------
} else if (is_constant(word)) {
value1 = constant(word);
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
// ----------------
// thermo keyword
// ----------------
} else {
if (domain->box_exist == 0)
error->all(FLERR,
"Variable evaluation before simulation box is defined");
int flag = output->thermo->evaluate_keyword(word,&value1);
if (flag)
error->all(FLERR,"Invalid thermo keyword in variable formula");
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value1;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value1;
}
}
delete [] word;
// ----------------
// math operator, including end-of-string
// ----------------
} else if (strchr("+-*/^<>=!&|%\0",onechar)) {
if (onechar == '+') op = ADD;
else if (onechar == '-') op = SUBTRACT;
else if (onechar == '*') op = MULTIPLY;
else if (onechar == '/') op = DIVIDE;
else if (onechar == '%') op = MODULO;
else if (onechar == '^') op = CARAT;
else if (onechar == '=') {
if (str[i+1] != '=')
error->all(FLERR,"Invalid syntax in variable formula");
op = EQ;
i++;
} else if (onechar == '!') {
if (str[i+1] == '=') {
op = NE;
i++;
} else op = NOT;
} else if (onechar == '<') {
if (str[i+1] != '=') op = LT;
else {
op = LE;
i++;
}
} else if (onechar == '>') {
if (str[i+1] != '=') op = GT;
else {
op = GE;
i++;
}
} else if (onechar == '&') {
if (str[i+1] != '&')
error->all(FLERR,"Invalid syntax in variable formula");
op = AND;
i++;
} else if (onechar == '|') {
if (str[i+1] != '|')
error->all(FLERR,"Invalid syntax in variable formula");
op = OR;
i++;
} else op = DONE;
i++;
if (op == SUBTRACT && expect == ARG) {
opstack[nopstack++] = UNARY;
continue;
}
if (op == NOT && expect == ARG) {
opstack[nopstack++] = op;
continue;
}
if (expect == ARG) error->all(FLERR,"Invalid syntax in variable formula");
expect = ARG;
// evaluate stack as deep as possible while respecting precedence
// before pushing current op onto stack
while (nopstack && precedence[opstack[nopstack-1]] >= precedence[op]) {
opprevious = opstack[--nopstack];
if (tree) {
Tree *newtree = new Tree();
newtree->type = opprevious;
if (opprevious == UNARY) {
newtree->first = treestack[--ntreestack];
newtree->second = NULL;
newtree->nextra = 0;
} else {
newtree->second = treestack[--ntreestack];
newtree->first = treestack[--ntreestack];
newtree->nextra = 0;
}
treestack[ntreestack++] = newtree;
} else {
value2 = argstack[--nargstack];
if (opprevious != UNARY && opprevious != NOT)
value1 = argstack[--nargstack];
if (opprevious == ADD)
argstack[nargstack++] = value1 + value2;
else if (opprevious == SUBTRACT)
argstack[nargstack++] = value1 - value2;
else if (opprevious == MULTIPLY)
argstack[nargstack++] = value1 * value2;
else if (opprevious == DIVIDE) {
if (value2 == 0.0)
error->all(FLERR,"Divide by 0 in variable formula");
argstack[nargstack++] = value1 / value2;
} else if (opprevious == MODULO) {
if (value2 == 0.0)
error->all(FLERR,"Modulo 0 in variable formula");
argstack[nargstack++] = fmod(value1,value2);
} else if (opprevious == CARAT) {
if (value2 == 0.0)
error->all(FLERR,"Power by 0 in variable formula");
argstack[nargstack++] = pow(value1,value2);
} else if (opprevious == UNARY) {
argstack[nargstack++] = -value2;
} else if (opprevious == NOT) {
if (value2 == 0.0) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == EQ) {
if (value1 == value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == NE) {
if (value1 != value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == LT) {
if (value1 < value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == LE) {
if (value1 <= value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == GT) {
if (value1 > value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == GE) {
if (value1 >= value2) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == AND) {
if (value1 != 0.0 && value2 != 0.0) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
} else if (opprevious == OR) {
if (value1 != 0.0 || value2 != 0.0) argstack[nargstack++] = 1.0;
else argstack[nargstack++] = 0.0;
}
}
}
// if end-of-string, break out of entire formula evaluation loop
if (op == DONE) break;
// push current operation onto stack
opstack[nopstack++] = op;
} else error->all(FLERR,"Invalid syntax in variable formula");
}
if (nopstack) error->all(FLERR,"Invalid syntax in variable formula");
// for atom-style variable, return remaining tree
// for equal-style variable, return remaining arg
if (tree) {
if (ntreestack != 1) error->all(FLERR,"Invalid syntax in variable formula");
*tree = treestack[0];
return 0.0;
} else {
if (nargstack != 1) error->all(FLERR,"Invalid syntax in variable formula");
return argstack[0];
}
}
/* ----------------------------------------------------------------------
one-time collapse of an atom-style variable parse tree
tree was created by one-time parsing of formula string via evaluate()
only keep tree nodes that depend on
ATOMARRAY, TYPEARRAY, INTARRAY, BIGINTARRAY
remainder is converted to single VALUE
this enables optimal eval_tree loop over atoms
customize by adding a function:
sqrt(),exp(),ln(),log(),abs(),sin(),cos(),tan(),asin(),acos(),atan(),
atan2(y,x),random(x,y,z),normal(x,y,z),ceil(),floor(),round(),
ramp(x,y),stagger(x,y),logfreq(x,y,z),logfreq2(x,y,z),
stride(x,y,z),vdisplace(x,y),swiggle(x,y,z),cwiggle(x,y,z),
gmask(x),rmask(x),grmask(x,y)
---------------------------------------------------------------------- */
double Variable::collapse_tree(Tree *tree)
{
double arg1,arg2;
if (tree->type == VALUE) return tree->value;
if (tree->type == ATOMARRAY) return 0.0;
if (tree->type == TYPEARRAY) return 0.0;
if (tree->type == INTARRAY) return 0.0;
if (tree->type == BIGINTARRAY) return 0.0;
if (tree->type == ADD) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = arg1 + arg2;
return tree->value;
}
if (tree->type == SUBTRACT) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = arg1 - arg2;
return tree->value;
}
if (tree->type == MULTIPLY) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = arg1 * arg2;
return tree->value;
}
if (tree->type == DIVIDE) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg2 == 0.0) error->one(FLERR,"Divide by 0 in variable formula");
tree->value = arg1 / arg2;
return tree->value;
}
if (tree->type == MODULO) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg2 == 0.0) error->one(FLERR,"Modulo 0 in variable formula");
tree->value = fmod(arg1,arg2);
return tree->value;
}
if (tree->type == CARAT) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg2 == 0.0) error->one(FLERR,"Power by 0 in variable formula");
tree->value = pow(arg1,arg2);
return tree->value;
}
if (tree->type == UNARY) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = -arg1;
return tree->value;
}
if (tree->type == NOT) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 == 0.0) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == EQ) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 == arg2) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == NE) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 != arg2) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == LT) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 < arg2) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == LE) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 <= arg2) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == GT) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 > arg2) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == GE) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 >= arg2) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == AND) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 != 0.0 && arg2 != 0.0) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == OR) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 != 0.0 || arg2 != 0.0) tree->value = 1.0;
else tree->value = 0.0;
return tree->value;
}
if (tree->type == SQRT) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 < 0.0)
error->one(FLERR,"Sqrt of negative value in variable formula");
tree->value = sqrt(arg1);
return tree->value;
}
if (tree->type == EXP) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = exp(arg1);
return tree->value;
}
if (tree->type == LN) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 <= 0.0)
error->one(FLERR,"Log of zero/negative value in variable formula");
tree->value = log(arg1);
return tree->value;
}
if (tree->type == LOG) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 <= 0.0)
error->one(FLERR,"Log of zero/negative value in variable formula");
tree->value = log10(arg1);
return tree->value;
}
if (tree->type == ABS) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = fabs(arg1);
return tree->value;
}
if (tree->type == SIN) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = sin(arg1);
return tree->value;
}
if (tree->type == COS) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = cos(arg1);
return tree->value;
}
if (tree->type == TAN) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = tan(arg1);
return tree->value;
}
if (tree->type == ASIN) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 < -1.0 || arg1 > 1.0)
error->one(FLERR,"Arcsin of invalid value in variable formula");
tree->value = asin(arg1);
return tree->value;
}
if (tree->type == ACOS) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg1 < -1.0 || arg1 > 1.0)
error->one(FLERR,"Arccos of invalid value in variable formula");
tree->value = acos(arg1);
return tree->value;
}
if (tree->type == ATAN) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = atan(arg1);
return tree->value;
}
if (tree->type == ATAN2) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = atan2(arg1,arg2);
return tree->value;
}
// random() or normal() do not become a single collapsed value
if (tree->type == RANDOM) {
collapse_tree(tree->first);
collapse_tree(tree->second);
if (randomatom == NULL) {
int seed = static_cast<int> (collapse_tree(tree->extra[0]));
if (seed <= 0)
error->one(FLERR,"Invalid math function in variable formula");
randomatom = new RanMars(lmp,seed+me);
}
return 0.0;
}
if (tree->type == NORMAL) {
collapse_tree(tree->first);
double sigma = collapse_tree(tree->second);
if (sigma < 0.0)
error->one(FLERR,"Invalid math function in variable formula");
if (randomatom == NULL) {
int seed = static_cast<int> (collapse_tree(tree->extra[0]));
if (seed <= 0)
error->one(FLERR,"Invalid math function in variable formula");
randomatom = new RanMars(lmp,seed+me);
}
return 0.0;
}
if (tree->type == CEIL) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = ceil(arg1);
return tree->value;
}
if (tree->type == FLOOR) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = floor(arg1);
return tree->value;
}
if (tree->type == ROUND) {
arg1 = collapse_tree(tree->first);
if (tree->first->type != VALUE) return 0.0;
tree->type = VALUE;
tree->value = MYROUND(arg1);
return tree->value;
}
if (tree->type == RAMP) {
arg1 = collapse_tree(tree->first);
arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
double delta = update->ntimestep - update->beginstep;
if (delta != 0.0) delta /= update->endstep - update->beginstep;
tree->value = arg1 + delta*(arg2-arg1);
return tree->value;
}
if (tree->type == STAGGER) {
int ivalue1 = static_cast<int> (collapse_tree(tree->first));
int ivalue2 = static_cast<int> (collapse_tree(tree->second));
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
int lower = update->ntimestep/ivalue1 * ivalue1;
int delta = update->ntimestep - lower;
if (delta < ivalue2) tree->value = lower+ivalue2;
else tree->value = lower+ivalue1;
return tree->value;
}
if (tree->type == LOGFREQ) {
int ivalue1 = static_cast<int> (collapse_tree(tree->first));
int ivalue2 = static_cast<int> (collapse_tree(tree->second));
int ivalue3 = static_cast<int> (collapse_tree(tree->extra[0]));
if (tree->first->type != VALUE || tree->second->type != VALUE ||
tree->extra[0]->type != VALUE) return 0.0;
tree->type = VALUE;
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3)
error->one(FLERR,"Invalid math function in variable formula");
if (update->ntimestep < ivalue1) tree->value = ivalue1;
else {
int lower = ivalue1;
while (update->ntimestep >= ivalue3*lower) lower *= ivalue3;
int multiple = update->ntimestep/lower;
if (multiple < ivalue2) tree->value = (multiple+1)*lower;
else tree->value = lower*ivalue3;
}
return tree->value;
}
if (tree->type == LOGFREQ2) {
int ivalue1 = static_cast<int> (collapse_tree(tree->first));
int ivalue2 = static_cast<int> (collapse_tree(tree->second));
int ivalue3 = static_cast<int> (collapse_tree(tree->extra[0]));
if (tree->first->type != VALUE || tree->second->type != VALUE ||
tree->extra[0]->type != VALUE) return 0.0;
tree->type = VALUE;
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 )
error->all(FLERR,"Invalid math function in variable formula");
if (update->ntimestep < ivalue1) tree->value = ivalue1;
else {
tree->value = ivalue1;
double delta = ivalue1*(ivalue3-1.0)/ivalue2;
int count = 0;
while (update->ntimestep >= tree->value) {
tree->value += delta;
count++;
if (count % ivalue2 == 0) delta *= ivalue3;
}
}
tree->value = ceil(tree->value);
return tree->value;
}
if (tree->type == STRIDE) {
int ivalue1 = static_cast<int> (collapse_tree(tree->first));
int ivalue2 = static_cast<int> (collapse_tree(tree->second));
int ivalue3 = static_cast<int> (collapse_tree(tree->extra[0]));
if (tree->first->type != VALUE || tree->second->type != VALUE ||
tree->extra[0]->type != VALUE) return 0.0;
tree->type = VALUE;
if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
if (update->ntimestep < ivalue1) tree->value = ivalue1;
else if (update->ntimestep < ivalue2) {
int offset = update->ntimestep - ivalue1;
tree->value = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (tree->value > ivalue2) tree->value = MAXBIGINT;
} else tree->value = MAXBIGINT;
return tree->value;
}
if (tree->type == STRIDE2) {
int ivalue1 = static_cast<int> (collapse_tree(tree->first));
int ivalue2 = static_cast<int> (collapse_tree(tree->second));
int ivalue3 = static_cast<int> (collapse_tree(tree->extra[0]));
int ivalue4 = static_cast<int> (collapse_tree(tree->extra[1]));
int ivalue5 = static_cast<int> (collapse_tree(tree->extra[2]));
int ivalue6 = static_cast<int> (collapse_tree(tree->extra[3]));
if (tree->first->type != VALUE || tree->second->type != VALUE ||
tree->extra[0]->type != VALUE || tree->extra[1]->type != VALUE ||
tree->extra[2]->type != VALUE || tree->extra[3]->type != VALUE)
return 0.0;
tree->type = VALUE;
if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
if (ivalue4 < 0 || ivalue5 < 0 || ivalue6 <= 0 || ivalue4 > ivalue5)
error->one(FLERR,"Invalid math function in variable formula");
if (ivalue4 < ivalue1 || ivalue5 > ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
bigint istep;
if (update->ntimestep < ivalue1) istep = ivalue1;
else if (update->ntimestep < ivalue2) {
if (update->ntimestep < ivalue4 || update->ntimestep > ivalue5) {
int offset = update->ntimestep - ivalue1;
istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (update->ntimestep < ivalue2 && istep > ivalue4)
tree->value = ivalue4;
} else {
int offset = update->ntimestep - ivalue4;
istep = ivalue4 + (offset/ivalue6)*ivalue6 + ivalue6;
if (istep > ivalue5) {
int offset = ivalue5 - ivalue1;
istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (istep > ivalue2) istep = MAXBIGINT;
}
}
} else istep = MAXBIGINT;
tree->value = istep;
return tree->value;
}
if (tree->type == VDISPLACE) {
double arg1 = collapse_tree(tree->first);
double arg2 = collapse_tree(tree->second);
if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0;
tree->type = VALUE;
double delta = update->ntimestep - update->beginstep;
tree->value = arg1 + arg2*delta*update->dt;
return tree->value;
}
if (tree->type == SWIGGLE) {
double arg1 = collapse_tree(tree->first);
double arg2 = collapse_tree(tree->second);
double arg3 = collapse_tree(tree->extra[0]);
if (tree->first->type != VALUE || tree->second->type != VALUE ||
tree->extra[0]->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg3 == 0.0)
error->one(FLERR,"Invalid math function in variable formula");
double delta = update->ntimestep - update->beginstep;
double omega = 2.0*MY_PI/arg3;
tree->value = arg1 + arg2*sin(omega*delta*update->dt);
return tree->value;
}
if (tree->type == CWIGGLE) {
double arg1 = collapse_tree(tree->first);
double arg2 = collapse_tree(tree->second);
double arg3 = collapse_tree(tree->extra[0]);
if (tree->first->type != VALUE || tree->second->type != VALUE ||
tree->extra[0]->type != VALUE) return 0.0;
tree->type = VALUE;
if (arg3 == 0.0)
error->one(FLERR,"Invalid math function in variable formula");
double delta = update->ntimestep - update->beginstep;
double omega = 2.0*MY_PI/arg3;
tree->value = arg1 + arg2*(1.0-cos(omega*delta*update->dt));
return tree->value;
}
// mask functions do not become a single collapsed value
if (tree->type == GMASK) return 0.0;
if (tree->type == RMASK) return 0.0;
if (tree->type == GRMASK) return 0.0;
return 0.0;
}
/* ----------------------------------------------------------------------
evaluate an atom-style variable parse tree for atom I
tree was created by one-time parsing of formula string via evaulate()
customize by adding a function:
sqrt(),exp(),ln(),log(),sin(),cos(),tan(),asin(),acos(),atan(),
atan2(y,x),random(x,y,z),normal(x,y,z),ceil(),floor(),round(),
ramp(x,y),stagger(x,y),logfreq(x,y,z),logfreq2(x,y,z),
stride(x,y,z),stride2(x,y,z),vdisplace(x,y),swiggle(x,y,z),
cwiggle(x,y,z),gmask(x),rmask(x),grmask(x,y)
---------------------------------------------------------------------- */
double Variable::eval_tree(Tree *tree, int i)
{
double arg,arg1,arg2,arg3;
if (tree->type == VALUE) return tree->value;
if (tree->type == ATOMARRAY) return tree->array[i*tree->nstride];
if (tree->type == TYPEARRAY) return tree->array[atom->type[i]];
if (tree->type == INTARRAY) return (double) tree->iarray[i*tree->nstride];
if (tree->type == BIGINTARRAY) return (double) tree->barray[i*tree->nstride];
if (tree->type == ADD)
return eval_tree(tree->first,i) + eval_tree(tree->second,i);
if (tree->type == SUBTRACT)
return eval_tree(tree->first,i) - eval_tree(tree->second,i);
if (tree->type == MULTIPLY)
return eval_tree(tree->first,i) * eval_tree(tree->second,i);
if (tree->type == DIVIDE) {
double denom = eval_tree(tree->second,i);
if (denom == 0.0) error->one(FLERR,"Divide by 0 in variable formula");
return eval_tree(tree->first,i) / denom;
}
if (tree->type == MODULO) {
double denom = eval_tree(tree->second,i);
if (denom == 0.0) error->one(FLERR,"Modulo 0 in variable formula");
return fmod(eval_tree(tree->first,i),denom);
}
if (tree->type == CARAT) {
double exponent = eval_tree(tree->second,i);
if (exponent == 0.0) error->one(FLERR,"Power by 0 in variable formula");
return pow(eval_tree(tree->first,i),exponent);
}
if (tree->type == UNARY) return -eval_tree(tree->first,i);
if (tree->type == NOT) {
if (eval_tree(tree->first,i) == 0.0) return 1.0;
else return 0.0;
}
if (tree->type == EQ) {
if (eval_tree(tree->first,i) == eval_tree(tree->second,i)) return 1.0;
else return 0.0;
}
if (tree->type == NE) {
if (eval_tree(tree->first,i) != eval_tree(tree->second,i)) return 1.0;
else return 0.0;
}
if (tree->type == LT) {
if (eval_tree(tree->first,i) < eval_tree(tree->second,i)) return 1.0;
else return 0.0;
}
if (tree->type == LE) {
if (eval_tree(tree->first,i) <= eval_tree(tree->second,i)) return 1.0;
else return 0.0;
}
if (tree->type == GT) {
if (eval_tree(tree->first,i) > eval_tree(tree->second,i)) return 1.0;
else return 0.0;
}
if (tree->type == GE) {
if (eval_tree(tree->first,i) >= eval_tree(tree->second,i)) return 1.0;
else return 0.0;
}
if (tree->type == AND) {
if (eval_tree(tree->first,i) != 0.0 && eval_tree(tree->second,i) != 0.0)
return 1.0;
else return 0.0;
}
if (tree->type == OR) {
if (eval_tree(tree->first,i) != 0.0 || eval_tree(tree->second,i) != 0.0)
return 1.0;
else return 0.0;
}
if (tree->type == SQRT) {
arg1 = eval_tree(tree->first,i);
if (arg1 < 0.0)
error->one(FLERR,"Sqrt of negative value in variable formula");
return sqrt(arg1);
}
if (tree->type == EXP)
return exp(eval_tree(tree->first,i));
if (tree->type == LN) {
arg1 = eval_tree(tree->first,i);
if (arg1 <= 0.0)
error->one(FLERR,"Log of zero/negative value in variable formula");
return log(arg1);
}
if (tree->type == LOG) {
arg1 = eval_tree(tree->first,i);
if (arg1 <= 0.0)
error->one(FLERR,"Log of zero/negative value in variable formula");
return log10(arg1);
}
if (tree->type == ABS)
return fabs(eval_tree(tree->first,i));
if (tree->type == SIN)
return sin(eval_tree(tree->first,i));
if (tree->type == COS)
return cos(eval_tree(tree->first,i));
if (tree->type == TAN)
return tan(eval_tree(tree->first,i));
if (tree->type == ASIN) {
arg1 = eval_tree(tree->first,i);
if (arg1 < -1.0 || arg1 > 1.0)
error->one(FLERR,"Arcsin of invalid value in variable formula");
return asin(arg1);
}
if (tree->type == ACOS) {
arg1 = eval_tree(tree->first,i);
if (arg1 < -1.0 || arg1 > 1.0)
error->one(FLERR,"Arccos of invalid value in variable formula");
return acos(arg1);
}
if (tree->type == ATAN)
return atan(eval_tree(tree->first,i));
if (tree->type == ATAN2)
return atan2(eval_tree(tree->first,i),eval_tree(tree->second,i));
if (tree->type == RANDOM) {
double lower = eval_tree(tree->first,i);
double upper = eval_tree(tree->second,i);
if (randomatom == NULL) {
int seed = static_cast<int> (eval_tree(tree->extra[0],i));
if (seed <= 0)
error->one(FLERR,"Invalid math function in variable formula");
randomatom = new RanMars(lmp,seed+me);
}
return randomatom->uniform()*(upper-lower)+lower;
}
if (tree->type == NORMAL) {
double mu = eval_tree(tree->first,i);
double sigma = eval_tree(tree->second,i);
if (sigma < 0.0)
error->one(FLERR,"Invalid math function in variable formula");
if (randomatom == NULL) {
int seed = static_cast<int> (eval_tree(tree->extra[0],i));
if (seed <= 0)
error->one(FLERR,"Invalid math function in variable formula");
randomatom = new RanMars(lmp,seed+me);
}
return mu + sigma*randomatom->gaussian();
}
if (tree->type == CEIL)
return ceil(eval_tree(tree->first,i));
if (tree->type == FLOOR)
return floor(eval_tree(tree->first,i));
if (tree->type == ROUND)
return MYROUND(eval_tree(tree->first,i));
if (tree->type == RAMP) {
arg1 = eval_tree(tree->first,i);
arg2 = eval_tree(tree->second,i);
double delta = update->ntimestep - update->beginstep;
if (delta != 0.0) delta /= update->endstep - update->beginstep;
arg = arg1 + delta*(arg2-arg1);
return arg;
}
if (tree->type == STAGGER) {
int ivalue1 = static_cast<int> (eval_tree(tree->first,i));
int ivalue2 = static_cast<int> (eval_tree(tree->second,i));
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
int lower = update->ntimestep/ivalue1 * ivalue1;
int delta = update->ntimestep - lower;
if (delta < ivalue2) arg = lower+ivalue2;
else arg = lower+ivalue1;
return arg;
}
if (tree->type == LOGFREQ) {
int ivalue1 = static_cast<int> (eval_tree(tree->first,i));
int ivalue2 = static_cast<int> (eval_tree(tree->second,i));
int ivalue3 = static_cast<int> (eval_tree(tree->extra[0],i));
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3)
error->one(FLERR,"Invalid math function in variable formula");
if (update->ntimestep < ivalue1) arg = ivalue1;
else {
int lower = ivalue1;
while (update->ntimestep >= ivalue3*lower) lower *= ivalue3;
int multiple = update->ntimestep/lower;
if (multiple < ivalue2) arg = (multiple+1)*lower;
else arg = lower*ivalue3;
}
return arg;
}
if (tree->type == LOGFREQ2) {
int ivalue1 = static_cast<int> (eval_tree(tree->first,i));
int ivalue2 = static_cast<int> (eval_tree(tree->second,i));
int ivalue3 = static_cast<int> (eval_tree(tree->extra[0],i));
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 )
error->all(FLERR,"Invalid math function in variable formula");
if (update->ntimestep < ivalue1) arg = ivalue1;
else {
arg = ivalue1;
double delta = ivalue1*(ivalue3-1.0)/ivalue2;
int count = 0;
while (update->ntimestep >= arg) {
arg += delta;
count++;
if (count % ivalue2 == 0) delta *= ivalue3;
}
}
arg = ceil(arg);
return arg;
}
if (tree->type == STRIDE) {
int ivalue1 = static_cast<int> (eval_tree(tree->first,i));
int ivalue2 = static_cast<int> (eval_tree(tree->second,i));
int ivalue3 = static_cast<int> (eval_tree(tree->extra[0],i));
if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
if (update->ntimestep < ivalue1) arg = ivalue1;
else if (update->ntimestep < ivalue2) {
int offset = update->ntimestep - ivalue1;
arg = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (arg > ivalue2) arg = MAXBIGINT;
} else arg = MAXBIGINT;
return arg;
}
if (tree->type == STRIDE2) {
int ivalue1 = static_cast<int> (eval_tree(tree->first,i));
int ivalue2 = static_cast<int> (eval_tree(tree->second,i));
int ivalue3 = static_cast<int> (eval_tree(tree->extra[0],i));
int ivalue4 = static_cast<int> (eval_tree(tree->extra[1],i));
int ivalue5 = static_cast<int> (eval_tree(tree->extra[2],i));
int ivalue6 = static_cast<int> (eval_tree(tree->extra[3],i));
if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
if (ivalue4 < 0 || ivalue5 < 0 || ivalue6 <= 0 || ivalue4 > ivalue5)
error->one(FLERR,"Invalid math function in variable formula");
if (ivalue4 < ivalue1 || ivalue5 > ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
bigint istep;
if (update->ntimestep < ivalue1) istep = ivalue1;
else if (update->ntimestep < ivalue2) {
if (update->ntimestep < ivalue4 || update->ntimestep > ivalue5) {
int offset = update->ntimestep - ivalue1;
istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (update->ntimestep < ivalue2 && istep > ivalue4)
tree->value = ivalue4;
} else {
int offset = update->ntimestep - ivalue4;
istep = ivalue4 + (offset/ivalue6)*ivalue6 + ivalue6;
if (istep > ivalue5) {
int offset = ivalue5 - ivalue1;
istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (istep > ivalue2) istep = MAXBIGINT;
}
}
} else istep = MAXBIGINT;
arg = istep;
return arg;
}
if (tree->type == VDISPLACE) {
arg1 = eval_tree(tree->first,i);
arg2 = eval_tree(tree->second,i);
double delta = update->ntimestep - update->beginstep;
arg = arg1 + arg2*delta*update->dt;
return arg;
}
if (tree->type == SWIGGLE) {
arg1 = eval_tree(tree->first,i);
arg2 = eval_tree(tree->second,i);
arg3 = eval_tree(tree->extra[0],i);
if (arg3 == 0.0)
error->one(FLERR,"Invalid math function in variable formula");
double delta = update->ntimestep - update->beginstep;
double omega = 2.0*MY_PI/arg3;
arg = arg1 + arg2*sin(omega*delta*update->dt);
return arg;
}
if (tree->type == CWIGGLE) {
arg1 = eval_tree(tree->first,i);
arg2 = eval_tree(tree->second,i);
arg3 = eval_tree(tree->extra[0],i);
if (arg3 == 0.0)
error->one(FLERR,"Invalid math function in variable formula");
double delta = update->ntimestep - update->beginstep;
double omega = 2.0*MY_PI/arg3;
arg = arg1 + arg2*(1.0-cos(omega*delta*update->dt));
return arg;
}
if (tree->type == GMASK) {
if (atom->mask[i] & tree->ivalue1) return 1.0;
else return 0.0;
}
if (tree->type == RMASK) {
if (domain->regions[tree->ivalue1]->match(atom->x[i][0],
atom->x[i][1],
atom->x[i][2])) return 1.0;
else return 0.0;
}
if (tree->type == GRMASK) {
if ((atom->mask[i] & tree->ivalue1) &&
(domain->regions[tree->ivalue2]->match(atom->x[i][0],
atom->x[i][1],
atom->x[i][2]))) return 1.0;
else return 0.0;
}
return 0.0;
}
/* ---------------------------------------------------------------------- */
void Variable::free_tree(Tree *tree)
{
if (tree->first) free_tree(tree->first);
if (tree->second) free_tree(tree->second);
if (tree->nextra) {
for (int i = 0; i < tree->nextra; i++) free_tree(tree->extra[i]);
delete [] tree->extra;
}
if (tree->type == ATOMARRAY && tree->selfalloc)
memory->destroy(tree->array);
delete tree;
}
/* ----------------------------------------------------------------------
find matching parenthesis in str, allocate contents = str between parens
i = left paren
return loc or right paren
------------------------------------------------------------------------- */
int Variable::find_matching_paren(char *str, int i,char *&contents)
{
// istop = matching ')' at same level, allowing for nested parens
int istart = i;
int ilevel = 0;
while (1) {
i++;
if (!str[i]) break;
if (str[i] == '(') ilevel++;
else if (str[i] == ')' && ilevel) ilevel--;
else if (str[i] == ')') break;
}
if (!str[i]) error->all(FLERR,"Invalid syntax in variable formula");
int istop = i;
int n = istop - istart - 1;
contents = new char[n+1];
strncpy(contents,&str[istart+1],n);
contents[n] = '\0';
return istop;
}
/* ----------------------------------------------------------------------
find int between brackets and return it
return a tagint, since value can be an atom ID
ptr initially points to left bracket
return it pointing to right bracket
error if no right bracket or brackets are empty or index = 0
if varallow = 0: error if any between-bracket chars are non-digits
if varallow = 1: also allow for v_name, where name is variable name
------------------------------------------------------------------------- */
tagint Variable::int_between_brackets(char *&ptr, int varallow)
{
int varflag;
tagint index;
char *start = ++ptr;
if (varallow && strstr(ptr,"v_") == ptr) {
varflag = 1;
while (*ptr && *ptr != ']') {
if (!isalnum(*ptr) && *ptr != '_')
error->all(FLERR,"Variable name between brackets must be "
"alphanumeric or underscore characters");
ptr++;
}
} else {
varflag = 0;
while (*ptr && *ptr != ']') {
if (!isdigit(*ptr))
error->all(FLERR,"Non digit character between brackets in variable");
ptr++;
}
}
if (*ptr != ']') error->all(FLERR,"Mismatched brackets in variable");
if (ptr == start) error->all(FLERR,"Empty brackets in variable");
*ptr = '\0';
// evaluate index as floating point variable or as tagint via ATOTAGINT()
if (varflag) {
char *id = start+2;
int ivar = find(id);
if (ivar < 0)
error->all(FLERR,"Invalid variable name in variable formula");
char *var = retrieve(id);
if (var == NULL)
error->all(FLERR,"Invalid variable evaluation in variable formula");
index = static_cast<tagint> (atof(var));
} else index = ATOTAGINT(start);
*ptr = ']';
if (index == 0)
error->all(FLERR,"Index between variable brackets must be positive");
return index;
}
/* ----------------------------------------------------------------------
process a math function in formula
push result onto tree or arg stack
word = math function
contents = str between parentheses with comma-separated args
return 0 if not a match, 1 if successfully processed
customize by adding a math function:
sqrt(),exp(),ln(),log(),abs(),sin(),cos(),tan(),asin(),acos(),atan(),
atan2(y,x),random(x,y,z),normal(x,y,z),ceil(),floor(),round(),
ramp(x,y),stagger(x,y),logfreq(x,y,z),logfreq2(x,y,z),
stride(x,y,z),stride2(x,y,z,a,b,c),vdisplace(x,y),swiggle(x,y,z),
cwiggle(x,y,z)
------------------------------------------------------------------------- */
int Variable::math_function(char *word, char *contents, Tree **tree,
Tree **treestack, int &ntreestack,
double *argstack, int &nargstack)
{
// word not a match to any math function
if (strcmp(word,"sqrt") && strcmp(word,"exp") &&
strcmp(word,"ln") && strcmp(word,"log") &&
strcmp(word,"abs") &&
strcmp(word,"sin") && strcmp(word,"cos") &&
strcmp(word,"tan") && strcmp(word,"asin") &&
strcmp(word,"acos") && strcmp(word,"atan") &&
strcmp(word,"atan2") && strcmp(word,"random") &&
strcmp(word,"normal") && strcmp(word,"ceil") &&
strcmp(word,"floor") && strcmp(word,"round") &&
strcmp(word,"ramp") && strcmp(word,"stagger") &&
strcmp(word,"logfreq") && strcmp(word,"logfreq2") &&
strcmp(word,"stride") && strcmp(word,"stride2") &&
strcmp(word,"vdisplace") && strcmp(word,"swiggle") &&
strcmp(word,"cwiggle"))
return 0;
// parse contents for comma-separated args
// narg = number of args, args = strings between commas
char *args[MAXFUNCARG];
int narg = parse_args(contents,args);
Tree *newtree;
double value1,value2;
double values[MAXFUNCARG-2];
if (tree) {
newtree = new Tree();
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
Tree *argtree;
evaluate(args[0],&argtree);
newtree->first = argtree;
if (narg > 1) {
evaluate(args[1],&argtree);
newtree->second = argtree;
if (narg > 2) {
newtree->nextra = narg-2;
newtree->extra = new Tree*[narg-2];
for (int i = 2; i < narg; i++) {
evaluate(args[i],&argtree);
newtree->extra[i-2] = argtree;
}
}
}
treestack[ntreestack++] = newtree;
} else {
value1 = evaluate(args[0],NULL);
if (narg > 1) {
value2 = evaluate(args[1],NULL);
if (narg > 2) {
for (int i = 2; i < narg; i++)
values[i-2] = evaluate(args[i],NULL);
}
}
}
// individual math functions
// customize by adding a function
if (strcmp(word,"sqrt") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = SQRT;
else {
if (value1 < 0.0)
error->all(FLERR,"Sqrt of negative value in variable formula");
argstack[nargstack++] = sqrt(value1);
}
} else if (strcmp(word,"exp") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = EXP;
else argstack[nargstack++] = exp(value1);
} else if (strcmp(word,"ln") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = LN;
else {
if (value1 <= 0.0)
error->all(FLERR,"Log of zero/negative value in variable formula");
argstack[nargstack++] = log(value1);
}
} else if (strcmp(word,"log") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = LOG;
else {
if (value1 <= 0.0)
error->all(FLERR,"Log of zero/negative value in variable formula");
argstack[nargstack++] = log10(value1);
}
} else if (strcmp(word,"abs") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = ABS;
else argstack[nargstack++] = fabs(value1);
} else if (strcmp(word,"sin") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = SIN;
else argstack[nargstack++] = sin(value1);
} else if (strcmp(word,"cos") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = COS;
else argstack[nargstack++] = cos(value1);
} else if (strcmp(word,"tan") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = TAN;
else argstack[nargstack++] = tan(value1);
} else if (strcmp(word,"asin") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = ASIN;
else {
if (value1 < -1.0 || value1 > 1.0)
error->all(FLERR,"Arcsin of invalid value in variable formula");
argstack[nargstack++] = asin(value1);
}
} else if (strcmp(word,"acos") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = ACOS;
else {
if (value1 < -1.0 || value1 > 1.0)
error->all(FLERR,"Arccos of invalid value in variable formula");
argstack[nargstack++] = acos(value1);
}
} else if (strcmp(word,"atan") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = ATAN;
else argstack[nargstack++] = atan(value1);
} else if (strcmp(word,"atan2") == 0) {
if (narg != 2)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = ATAN2;
else argstack[nargstack++] = atan2(value1,value2);
} else if (strcmp(word,"random") == 0) {
if (narg != 3)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = RANDOM;
else {
if (randomequal == NULL) {
int seed = static_cast<int> (values[0]);
if (seed <= 0)
error->all(FLERR,"Invalid math function in variable formula");
randomequal = new RanMars(lmp,seed);
}
argstack[nargstack++] = randomequal->uniform()*(value2-value1) + value1;
}
} else if (strcmp(word,"normal") == 0) {
if (narg != 3)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = NORMAL;
else {
if (value2 < 0.0)
error->all(FLERR,"Invalid math function in variable formula");
if (randomequal == NULL) {
int seed = static_cast<int> (values[0]);
if (seed <= 0)
error->all(FLERR,"Invalid math function in variable formula");
randomequal = new RanMars(lmp,seed);
}
argstack[nargstack++] = value1 + value2*randomequal->gaussian();
}
} else if (strcmp(word,"ceil") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = CEIL;
else argstack[nargstack++] = ceil(value1);
} else if (strcmp(word,"floor") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = FLOOR;
else argstack[nargstack++] = floor(value1);
} else if (strcmp(word,"round") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = ROUND;
else argstack[nargstack++] = MYROUND(value1);
} else if (strcmp(word,"ramp") == 0) {
if (narg != 2)
error->all(FLERR,"Invalid math function in variable formula");
if (update->whichflag == 0)
error->all(FLERR,"Cannot use ramp in variable formula between runs");
if (tree) newtree->type = RAMP;
else {
double delta = update->ntimestep - update->beginstep;
if (delta != 0.0) delta /= update->endstep - update->beginstep;
double value = value1 + delta*(value2-value1);
argstack[nargstack++] = value;
}
} else if (strcmp(word,"stagger") == 0) {
if (narg != 2)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = STAGGER;
else {
int ivalue1 = static_cast<int> (value1);
int ivalue2 = static_cast<int> (value2);
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2)
error->all(FLERR,"Invalid math function in variable formula");
int lower = update->ntimestep/ivalue1 * ivalue1;
int delta = update->ntimestep - lower;
double value;
if (delta < ivalue2) value = lower+ivalue2;
else value = lower+ivalue1;
argstack[nargstack++] = value;
}
} else if (strcmp(word,"logfreq") == 0) {
if (narg != 3)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = LOGFREQ;
else {
int ivalue1 = static_cast<int> (value1);
int ivalue2 = static_cast<int> (value2);
int ivalue3 = static_cast<int> (values[0]);
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3)
error->all(FLERR,"Invalid math function in variable formula");
double value;
if (update->ntimestep < ivalue1) value = ivalue1;
else {
int lower = ivalue1;
while (update->ntimestep >= ivalue3*lower) lower *= ivalue3;
int multiple = update->ntimestep/lower;
if (multiple < ivalue2) value = (multiple+1)*lower;
else value = lower*ivalue3;
}
argstack[nargstack++] = value;
}
} else if (strcmp(word,"logfreq2") == 0) {
if (narg != 3)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = LOGFREQ2;
else {
int ivalue1 = static_cast<int> (value1);
int ivalue2 = static_cast<int> (value2);
int ivalue3 = static_cast<int> (values[0]);
if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 )
error->all(FLERR,"Invalid math function in variable formula");
double value;
if (update->ntimestep < ivalue1) value = ivalue1;
else {
value = ivalue1;
double delta = ivalue1*(ivalue3-1.0)/ivalue2;
int count = 0;
while (update->ntimestep >= value) {
value += delta;
count++;
if (count % ivalue2 == 0) delta *= ivalue3;
}
}
argstack[nargstack++] = ceil(value);
}
} else if (strcmp(word,"stride") == 0) {
if (narg != 3)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = STRIDE;
else {
int ivalue1 = static_cast<int> (value1);
int ivalue2 = static_cast<int> (value2);
int ivalue3 = static_cast<int> (values[0]);
if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
double value;
if (update->ntimestep < ivalue1) value = ivalue1;
else if (update->ntimestep < ivalue2) {
int offset = update->ntimestep - ivalue1;
value = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (value > ivalue2) value = MAXBIGINT;
} else value = MAXBIGINT;
argstack[nargstack++] = value;
}
} else if (strcmp(word,"stride2") == 0) {
if (narg != 6)
error->all(FLERR,"Invalid math function in variable formula");
if (tree) newtree->type = STRIDE2;
else {
int ivalue1 = static_cast<int> (value1);
int ivalue2 = static_cast<int> (value2);
int ivalue3 = static_cast<int> (values[0]);
int ivalue4 = static_cast<int> (values[1]);
int ivalue5 = static_cast<int> (values[2]);
int ivalue6 = static_cast<int> (values[3]);
if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
if (ivalue4 < 0 || ivalue5 < 0 || ivalue6 <= 0 || ivalue4 > ivalue5)
error->one(FLERR,"Invalid math function in variable formula");
if (ivalue4 < ivalue1 || ivalue5 > ivalue2)
error->one(FLERR,"Invalid math function in variable formula");
bigint istep;
if (update->ntimestep < ivalue1) istep = ivalue1;
else if (update->ntimestep < ivalue2) {
if (update->ntimestep < ivalue4 || update->ntimestep > ivalue5) {
int offset = update->ntimestep - ivalue1;
istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (update->ntimestep < ivalue4 && istep > ivalue4) istep = ivalue4;
} else {
int offset = update->ntimestep - ivalue4;
istep = ivalue4 + (offset/ivalue6)*ivalue6 + ivalue6;
if (istep > ivalue5) {
int offset = ivalue5 - ivalue1;
istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (istep > ivalue2) istep = MAXBIGINT;
}
}
} else istep = MAXBIGINT;
double value = istep;
argstack[nargstack++] = value;
}
} else if (strcmp(word,"vdisplace") == 0) {
if (narg != 2)
error->all(FLERR,"Invalid math function in variable formula");
if (update->whichflag == 0)
error->all(FLERR,"Cannot use vdisplace in variable formula between runs");
if (tree) newtree->type = VDISPLACE;
else {
double delta = update->ntimestep - update->beginstep;
double value = value1 + value2*delta*update->dt;
argstack[nargstack++] = value;
}
} else if (strcmp(word,"swiggle") == 0) {
if (narg != 3)
error->all(FLERR,"Invalid math function in variable formula");
if (update->whichflag == 0)
error->all(FLERR,"Cannot use swiggle in variable formula between runs");
if (tree) newtree->type = CWIGGLE;
else {
if (values[0] == 0.0)
error->all(FLERR,"Invalid math function in variable formula");
double delta = update->ntimestep - update->beginstep;
double omega = 2.0*MY_PI/values[0];
double value = value1 + value2*sin(omega*delta*update->dt);
argstack[nargstack++] = value;
}
} else if (strcmp(word,"cwiggle") == 0) {
if (narg != 3)
error->all(FLERR,"Invalid math function in variable formula");
if (update->whichflag == 0)
error->all(FLERR,"Cannot use cwiggle in variable formula between runs");
if (tree) newtree->type = CWIGGLE;
else {
if (values[0] == 0.0)
error->all(FLERR,"Invalid math function in variable formula");
double delta = update->ntimestep - update->beginstep;
double omega = 2.0*MY_PI/values[0];
double value = value1 + value2*(1.0-cos(omega*delta*update->dt));
argstack[nargstack++] = value;
}
}
// delete stored args
for (int i = 0; i < narg; i++) delete [] args[i];
return 1;
}
/* ----------------------------------------------------------------------
process a group function in formula with optional region arg
push result onto tree or arg stack
word = group function
contents = str between parentheses with one,two,three args
return 0 if not a match, 1 if successfully processed
customize by adding a group function with optional region arg:
count(group),mass(group),charge(group),
xcm(group,dim),vcm(group,dim),fcm(group,dim),
bound(group,xmin),gyration(group),ke(group),angmom(group,dim),
torque(group,dim),inertia(group,dim),omega(group,dim)
------------------------------------------------------------------------- */
int Variable::group_function(char *word, char *contents, Tree **tree,
Tree **treestack, int &ntreestack,
double *argstack, int &nargstack)
{
// word not a match to any group function
if (strcmp(word,"count") && strcmp(word,"mass") &&
strcmp(word,"charge") && strcmp(word,"xcm") &&
strcmp(word,"vcm") && strcmp(word,"fcm") &&
strcmp(word,"bound") && strcmp(word,"gyration") &&
strcmp(word,"ke") && strcmp(word,"angmom") &&
strcmp(word,"torque") && strcmp(word,"inertia") &&
strcmp(word,"omega"))
return 0;
// parse contents for comma-separated args
// narg = number of args, args = strings between commas
char *args[MAXFUNCARG];
int narg = parse_args(contents,args);
// group to operate on
int igroup = group->find(args[0]);
if (igroup == -1)
error->all(FLERR,"Group ID in variable formula does not exist");
// match word to group function
double value;
if (strcmp(word,"count") == 0) {
if (narg == 1) value = group->count(igroup);
else if (narg == 2) value = group->count(igroup,region_function(args[1]));
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"mass") == 0) {
if (narg == 1) value = group->mass(igroup);
else if (narg == 2) value = group->mass(igroup,region_function(args[1]));
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"charge") == 0) {
if (narg == 1) value = group->charge(igroup);
else if (narg == 2) value = group->charge(igroup,region_function(args[1]));
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"xcm") == 0) {
atom->check_mass();
double xcm[3];
if (narg == 2) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
} else if (narg == 3) {
int iregion = region_function(args[2]);
double masstotal = group->mass(igroup,iregion);
group->xcm(igroup,masstotal,xcm,iregion);
} else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(args[1],"x") == 0) value = xcm[0];
else if (strcmp(args[1],"y") == 0) value = xcm[1];
else if (strcmp(args[1],"z") == 0) value = xcm[2];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"vcm") == 0) {
atom->check_mass();
double vcm[3];
if (narg == 2) {
double masstotal = group->mass(igroup);
group->vcm(igroup,masstotal,vcm);
} else if (narg == 3) {
int iregion = region_function(args[2]);
double masstotal = group->mass(igroup,iregion);
group->vcm(igroup,masstotal,vcm,iregion);
} else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(args[1],"x") == 0) value = vcm[0];
else if (strcmp(args[1],"y") == 0) value = vcm[1];
else if (strcmp(args[1],"z") == 0) value = vcm[2];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"fcm") == 0) {
double fcm[3];
if (narg == 2) group->fcm(igroup,fcm);
else if (narg == 3) group->fcm(igroup,fcm,region_function(args[2]));
else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(args[1],"x") == 0) value = fcm[0];
else if (strcmp(args[1],"y") == 0) value = fcm[1];
else if (strcmp(args[1],"z") == 0) value = fcm[2];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"bound") == 0) {
double minmax[6];
if (narg == 2) group->bounds(igroup,minmax);
else if (narg == 3) group->bounds(igroup,minmax,region_function(args[2]));
else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(args[1],"xmin") == 0) value = minmax[0];
else if (strcmp(args[1],"xmax") == 0) value = minmax[1];
else if (strcmp(args[1],"ymin") == 0) value = minmax[2];
else if (strcmp(args[1],"ymax") == 0) value = minmax[3];
else if (strcmp(args[1],"zmin") == 0) value = minmax[4];
else if (strcmp(args[1],"zmax") == 0) value = minmax[5];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"gyration") == 0) {
atom->check_mass();
double xcm[3];
if (narg == 1) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
value = group->gyration(igroup,masstotal,xcm);
} else if (narg == 2) {
int iregion = region_function(args[1]);
double masstotal = group->mass(igroup,iregion);
group->xcm(igroup,masstotal,xcm,iregion);
value = group->gyration(igroup,masstotal,xcm,iregion);
} else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"ke") == 0) {
if (narg == 1) value = group->ke(igroup);
else if (narg == 2) value = group->ke(igroup,region_function(args[1]));
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"angmom") == 0) {
atom->check_mass();
double xcm[3],lmom[3];
if (narg == 2) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
group->angmom(igroup,xcm,lmom);
} else if (narg == 3) {
int iregion = region_function(args[2]);
double masstotal = group->mass(igroup,iregion);
group->xcm(igroup,masstotal,xcm,iregion);
group->angmom(igroup,xcm,lmom,iregion);
} else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(args[1],"x") == 0) value = lmom[0];
else if (strcmp(args[1],"y") == 0) value = lmom[1];
else if (strcmp(args[1],"z") == 0) value = lmom[2];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"torque") == 0) {
atom->check_mass();
double xcm[3],tq[3];
if (narg == 2) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
group->torque(igroup,xcm,tq);
} else if (narg == 3) {
int iregion = region_function(args[2]);
double masstotal = group->mass(igroup,iregion);
group->xcm(igroup,masstotal,xcm,iregion);
group->torque(igroup,xcm,tq,iregion);
} else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(args[1],"x") == 0) value = tq[0];
else if (strcmp(args[1],"y") == 0) value = tq[1];
else if (strcmp(args[1],"z") == 0) value = tq[2];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"inertia") == 0) {
atom->check_mass();
double xcm[3],inertia[3][3];
if (narg == 2) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
group->inertia(igroup,xcm,inertia);
} else if (narg == 3) {
int iregion = region_function(args[2]);
double masstotal = group->mass(igroup,iregion);
group->xcm(igroup,masstotal,xcm,iregion);
group->inertia(igroup,xcm,inertia,iregion);
} else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(args[1],"xx") == 0) value = inertia[0][0];
else if (strcmp(args[1],"yy") == 0) value = inertia[1][1];
else if (strcmp(args[1],"zz") == 0) value = inertia[2][2];
else if (strcmp(args[1],"xy") == 0) value = inertia[0][1];
else if (strcmp(args[1],"yz") == 0) value = inertia[1][2];
else if (strcmp(args[1],"xz") == 0) value = inertia[0][2];
else error->all(FLERR,"Invalid group function in variable formula");
} else if (strcmp(word,"omega") == 0) {
atom->check_mass();
double xcm[3],angmom[3],inertia[3][3],omega[3];
if (narg == 2) {
double masstotal = group->mass(igroup);
group->xcm(igroup,masstotal,xcm);
group->angmom(igroup,xcm,angmom);
group->inertia(igroup,xcm,inertia);
group->omega(angmom,inertia,omega);
} else if (narg == 3) {
int iregion = region_function(args[2]);
double masstotal = group->mass(igroup,iregion);
group->xcm(igroup,masstotal,xcm,iregion);
group->angmom(igroup,xcm,angmom,iregion);
group->inertia(igroup,xcm,inertia,iregion);
group->omega(angmom,inertia,omega);
} else error->all(FLERR,"Invalid group function in variable formula");
if (strcmp(args[1],"x") == 0) value = omega[0];
else if (strcmp(args[1],"y") == 0) value = omega[1];
else if (strcmp(args[1],"z") == 0) value = omega[2];
else error->all(FLERR,"Invalid group function in variable formula");
}
// delete stored args
for (int i = 0; i < narg; i++) delete [] args[i];
// save value in tree or on argstack
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value;
return 1;
}
/* ---------------------------------------------------------------------- */
int Variable::region_function(char *id)
{
int iregion = domain->find_region(id);
if (iregion == -1)
error->all(FLERR,"Region ID in variable formula does not exist");
// init region in case sub-regions have been deleted
domain->regions[iregion]->init();
return iregion;
}
/* ----------------------------------------------------------------------
process a special function in formula
push result onto tree or arg stack
word = special function
contents = str between parentheses with one,two,three args
return 0 if not a match, 1 if successfully processed
customize by adding a special function:
sum(x),min(x),max(x),ave(x),trap(x),slope(x),
gmask(x),rmask(x),grmask(x,y),next(x)
------------------------------------------------------------------------- */
int Variable::special_function(char *word, char *contents, Tree **tree,
Tree **treestack, int &ntreestack,
double *argstack, int &nargstack)
{
double value,xvalue,sx,sy,sxx,sxy;
// word not a match to any special function
if (strcmp(word,"sum") && strcmp(word,"min") && strcmp(word,"max") &&
strcmp(word,"ave") && strcmp(word,"trap") && strcmp(word,"slope") &&
strcmp(word,"gmask") && strcmp(word,"rmask") &&
strcmp(word,"grmask") && strcmp(word,"next") &&
strcmp(word,"is_active") && strcmp(word,"is_defined") &&
strcmp(word,"is_available"))
return 0;
// parse contents for comma-separated args
// narg = number of args, args = strings between commas
char *args[MAXFUNCARG];
int narg = parse_args(contents,args);
// special functions that operate on global vectors
if (strcmp(word,"sum") == 0 || strcmp(word,"min") == 0 ||
strcmp(word,"max") == 0 || strcmp(word,"ave") == 0 ||
strcmp(word,"trap") == 0 || strcmp(word,"slope") == 0) {
int method;
if (strcmp(word,"sum") == 0) method = SUM;
else if (strcmp(word,"min") == 0) method = XMIN;
else if (strcmp(word,"max") == 0) method = XMAX;
else if (strcmp(word,"ave") == 0) method = AVE;
else if (strcmp(word,"trap") == 0) method = TRAP;
else if (strcmp(word,"slope") == 0) method = SLOPE;
if (narg != 1)
error->all(FLERR,"Invalid special function in variable formula");
Compute *compute = NULL;
Fix *fix = NULL;
int index,nvec,nstride;
char *ptr1,*ptr2;
if (strstr(args[0],"c_") == args[0]) {
ptr1 = strchr(args[0],'[');
if (ptr1) {
ptr2 = ptr1;
index = (int) int_between_brackets(ptr2,0);
*ptr1 = '\0';
} else index = 0;
int icompute = modify->find_compute(&args[0][2]);
if (icompute < 0)
error->all(FLERR,"Invalid compute ID in variable formula");
compute = modify->compute[icompute];
if (index == 0 && compute->vector_flag) {
if (update->whichflag == 0) {
if (compute->invoked_vector != update->ntimestep)
error->all(FLERR,
"Compute used in variable between runs is not current");
} else if (!(compute->invoked_flag & INVOKED_VECTOR)) {
compute->compute_vector();
compute->invoked_flag |= INVOKED_VECTOR;
}
nvec = compute->size_vector;
nstride = 1;
} else if (index && compute->array_flag) {
if (index > compute->size_array_cols)
error->all(FLERR,"Variable formula compute array "
"is accessed out-of-range");
if (update->whichflag == 0) {
if (compute->invoked_array != update->ntimestep)
error->all(FLERR,
"Compute used in variable between runs is not current");
} else if (!(compute->invoked_flag & INVOKED_ARRAY)) {
compute->compute_array();
compute->invoked_flag |= INVOKED_ARRAY;
}
nvec = compute->size_array_rows;
nstride = compute->size_array_cols;
} else error->all(FLERR,"Mismatched compute in variable formula");
} else if (strstr(args[0],"f_") == args[0]) {
ptr1 = strchr(args[0],'[');
if (ptr1) {
ptr2 = ptr1;
index = (int) int_between_brackets(ptr2,0);
*ptr1 = '\0';
} else index = 0;
int ifix = modify->find_fix(&args[0][2]);
if (ifix < 0) error->all(FLERR,"Invalid fix ID in variable formula");
fix = modify->fix[ifix];
if (index == 0 && fix->vector_flag) {
if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
nvec = fix->size_vector;
nstride = 1;
} else if (index && fix->array_flag) {
if (index > fix->size_array_cols)
error->all(FLERR,
"Variable formula fix array is accessed out-of-range");
if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
error->all(FLERR,"Fix in variable not computed at compatible time");
nvec = fix->size_array_rows;
nstride = fix->size_array_cols;
} else error->all(FLERR,"Mismatched fix in variable formula");
} else error->all(FLERR,"Invalid special function in variable formula");
value = 0.0;
if (method == SLOPE) sx = sy = sxx = sxy = 0.0;
if (method == XMIN) value = BIG;
if (method == XMAX) value = -BIG;
if (compute) {
double *vec;
if (index) {
if (compute->array) vec = &compute->array[0][index-1];
else vec = NULL;
} else vec = compute->vector;
int j = 0;
for (int i = 0; i < nvec; i++) {
if (method == SUM) value += vec[j];
else if (method == XMIN) value = MIN(value,vec[j]);
else if (method == XMAX) value = MAX(value,vec[j]);
else if (method == AVE) value += vec[j];
else if (method == TRAP) value += vec[j];
else if (method == SLOPE) {
if (nvec > 1) xvalue = (double) i / (nvec-1);
else xvalue = 0.0;
sx += xvalue;
sy += vec[j];
sxx += xvalue*xvalue;
sxy += xvalue*vec[j];
}
j += nstride;
}
if (method == TRAP) value -= 0.5*vec[0] + 0.5*vec[nvec-1];
}
if (fix) {
double one;
for (int i = 0; i < nvec; i++) {
if (index) one = fix->compute_array(i,index-1);
else one = fix->compute_vector(i);
if (method == SUM) value += one;
else if (method == XMIN) value = MIN(value,one);
else if (method == XMAX) value = MAX(value,one);
else if (method == AVE) value += one;
else if (method == TRAP) value += one;
else if (method == SLOPE) {
if (nvec > 1) xvalue = (double) i / (nvec-1);
else xvalue = 0.0;
sx += xvalue;
sy += one;
sxx += xvalue*xvalue;
sxy += xvalue*one;
}
}
if (method == TRAP) {
if (index) value -= 0.5*fix->compute_array(0,index-1) +
0.5*fix->compute_array(nvec-1,index-1);
else value -= 0.5*fix->compute_vector(0) +
0.5*fix->compute_vector(nvec-1);
}
}
if (method == AVE) value /= nvec;
if (method == SLOPE) {
double numerator = sxy - sx*sy;
double denominator = sxx - sx*sx;
if (denominator != 0.0) value = numerator/denominator / nvec;
else value = BIG;
}
// save value in tree or on argstack
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value;
// mask special functions
} else if (strcmp(word,"gmask") == 0) {
if (tree == NULL)
error->all(FLERR,"Gmask function in equal-style variable formula");
if (narg != 1)
error->all(FLERR,"Invalid special function in variable formula");
int igroup = group->find(args[0]);
if (igroup == -1)
error->all(FLERR,"Group ID in variable formula does not exist");
Tree *newtree = new Tree();
newtree->type = GMASK;
newtree->ivalue1 = group->bitmask[igroup];
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else if (strcmp(word,"rmask") == 0) {
if (tree == NULL)
error->all(FLERR,"Rmask function in equal-style variable formula");
if (narg != 1)
error->all(FLERR,"Invalid special function in variable formula");
int iregion = region_function(args[0]);
domain->regions[iregion]->prematch();
Tree *newtree = new Tree();
newtree->type = RMASK;
newtree->ivalue1 = iregion;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else if (strcmp(word,"grmask") == 0) {
if (tree == NULL)
error->all(FLERR,"Grmask function in equal-style variable formula");
if (narg != 2)
error->all(FLERR,"Invalid special function in variable formula");
int igroup = group->find(args[0]);
if (igroup == -1)
error->all(FLERR,"Group ID in variable formula does not exist");
int iregion = region_function(args[1]);
domain->regions[iregion]->prematch();
Tree *newtree = new Tree();
newtree->type = GRMASK;
newtree->ivalue1 = group->bitmask[igroup];
newtree->ivalue2 = iregion;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
// special function for file-style or atomfile-style variables
} else if (strcmp(word,"next") == 0) {
if (narg != 1)
error->all(FLERR,"Invalid special function in variable formula");
int ivar = find(args[0]);
if (ivar < 0)
error->all(FLERR,"Variable ID in variable formula does not exist");
// SCALARFILE has single current value, read next one
// save value in tree or on argstack
if (style[ivar] == SCALARFILE) {
double value = atof(data[ivar][0]);
int done = reader[ivar]->read_scalar(data[ivar][0]);
if (done) remove(ivar);
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value;
// ATOMFILE has per-atom values, save values in tree
// copy current per-atom values into result so can read next ones
// set selfalloc = 1 so result will be deleted by free_tree() after eval
} else if (style[ivar] == ATOMFILE) {
if (tree == NULL)
error->all(FLERR,"Atomfile variable in equal-style variable formula");
double *result;
memory->create(result,atom->nlocal,"variable:result");
memcpy(result,reader[ivar]->fixstore->vstore,atom->nlocal*sizeof(double));
int done = reader[ivar]->read_peratom();
if (done) remove(ivar);
Tree *newtree = new Tree();
newtree->type = ATOMARRAY;
newtree->array = result;
newtree->nstride = 1;
newtree->selfalloc = 1;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else error->all(FLERR,"Invalid variable style in special function next");
} else if (strcmp(word,"is_active") == 0) {
if (narg != 2)
error->all(FLERR,"Invalid is_active() function in variable formula");
Info info(lmp);
value = (info.is_active(args[0],args[1])) ? 1.0 : 0.0;
// save value in tree or on argstack
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value;
} else if (strcmp(word,"is_available") == 0) {
if (narg != 2)
error->all(FLERR,"Invalid is_available() function in variable formula");
Info info(lmp);
value = (info.is_available(args[0],args[1])) ? 1.0 : 0.0;
// save value in tree or on argstack
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value;
} else if (strcmp(word,"is_defined") == 0) {
if (narg != 2)
error->all(FLERR,"Invalid is_defined() function in variable formula");
Info info(lmp);
value = (info.is_defined(args[0],args[1])) ? 1.0 : 0.0;
// save value in tree or on argstack
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value;
}
// delete stored args
for (int i = 0; i < narg; i++) delete [] args[i];
return 1;
}
/* ----------------------------------------------------------------------
extract a global value from a per-atom quantity in a formula
flag = 0 -> word is an atom vector
flag = 1 -> vector is a per-atom compute or fix quantity with nstride
id = global ID of atom, converted to local index
push result onto tree or arg stack
customize by adding an atom vector:
id,mass,type,mol,x,y,z,vx,vy,vz,fx,fy,fz,q
------------------------------------------------------------------------- */
void Variable::peratom2global(int flag, char *word,
double *vector, int nstride, tagint id,
Tree **tree, Tree **treestack, int &ntreestack,
double *argstack, int &nargstack)
{
// error check for ID larger than any atom
// int_between_brackets() already checked for ID <= 0
if (atom->map_style == 0)
error->all(FLERR,
"Indexed per-atom vector in variable formula without atom map");
if (id > atom->map_tag_max)
error->all(FLERR,"Variable atom ID is too large");
// if ID does not exist, index will be -1 for all procs,
// and mine will be set to 0.0
int index = atom->map(id);
double mine;
if (index >= 0 && index < atom->nlocal) {
if (flag == 0) {
if (strcmp(word,"id") == 0) mine = atom->tag[index];
else if (strcmp(word,"mass") == 0) {
if (atom->rmass) mine = atom->rmass[index];
else mine = atom->mass[atom->type[index]];
}
else if (strcmp(word,"type") == 0) mine = atom->type[index];
else if (strcmp(word,"mol") == 0) {
if (!atom->molecule_flag)
error->one(FLERR,"Variable uses atom property that isn't allocated");
mine = atom->molecule[index];
}
else if (strcmp(word,"x") == 0) mine = atom->x[index][0];
else if (strcmp(word,"y") == 0) mine = atom->x[index][1];
else if (strcmp(word,"z") == 0) mine = atom->x[index][2];
else if (strcmp(word,"vx") == 0) mine = atom->v[index][0];
else if (strcmp(word,"vy") == 0) mine = atom->v[index][1];
else if (strcmp(word,"vz") == 0) mine = atom->v[index][2];
else if (strcmp(word,"fx") == 0) mine = atom->f[index][0];
else if (strcmp(word,"fy") == 0) mine = atom->f[index][1];
else if (strcmp(word,"fz") == 0) mine = atom->f[index][2];
else if (strcmp(word,"q") == 0) {
if (!atom->q_flag)
error->one(FLERR,"Variable uses atom property that isn't allocated");
mine = atom->q[index];
}
else error->one(FLERR,"Invalid atom vector in variable formula");
} else mine = vector[index*nstride];
} else mine = 0.0;
double value;
MPI_Allreduce(&mine,&value,1,MPI_DOUBLE,MPI_SUM,world);
if (tree) {
Tree *newtree = new Tree();
newtree->type = VALUE;
newtree->value = value;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
} else argstack[nargstack++] = value;
}
/* ----------------------------------------------------------------------
check if word matches an atom vector
return 1 if yes, else 0
customize by adding an atom vector:
id,mass,type,mol,x,y,z,vx,vy,vz,fx,fy,fz,q
------------------------------------------------------------------------- */
int Variable::is_atom_vector(char *word)
{
if (strcmp(word,"id") == 0) return 1;
if (strcmp(word,"mass") == 0) return 1;
if (strcmp(word,"type") == 0) return 1;
if (strcmp(word,"mol") == 0) return 1;
if (strcmp(word,"x") == 0) return 1;
if (strcmp(word,"y") == 0) return 1;
if (strcmp(word,"z") == 0) return 1;
if (strcmp(word,"vx") == 0) return 1;
if (strcmp(word,"vy") == 0) return 1;
if (strcmp(word,"vz") == 0) return 1;
if (strcmp(word,"fx") == 0) return 1;
if (strcmp(word,"fy") == 0) return 1;
if (strcmp(word,"fz") == 0) return 1;
if (strcmp(word,"q") == 0) return 1;
return 0;
}
/* ----------------------------------------------------------------------
process an atom vector in formula
push result onto tree
word = atom vector
customize by adding an atom vector:
id,mass,type,mol,x,y,z,vx,vy,vz,fx,fy,fz,q
------------------------------------------------------------------------- */
void Variable::atom_vector(char *word, Tree **tree,
Tree **treestack, int &ntreestack)
{
if (tree == NULL)
error->all(FLERR,"Atom vector in equal-style variable formula");
Tree *newtree = new Tree();
newtree->type = ATOMARRAY;
newtree->nstride = 3;
newtree->selfalloc = 0;
newtree->first = newtree->second = NULL;
newtree->nextra = 0;
treestack[ntreestack++] = newtree;
if (strcmp(word,"id") == 0) {
if (sizeof(tagint) == sizeof(smallint)) {
newtree->type = INTARRAY;
newtree->iarray = (int *) atom->tag;
} else {
newtree->type = BIGINTARRAY;
newtree->barray = (bigint *) atom->tag;
}
newtree->nstride = 1;
} else if (strcmp(word,"mass") == 0) {
if (atom->rmass) {
newtree->nstride = 1;
newtree->array = atom->rmass;
} else {
newtree->type = TYPEARRAY;
newtree->array = atom->mass;
}
} else if (strcmp(word,"type") == 0) {
newtree->type = INTARRAY;
newtree->nstride = 1;
newtree->iarray = atom->type;
} else if (strcmp(word,"mol") == 0) {
if (!atom->molecule_flag)
error->one(FLERR,"Variable uses atom property that isn't allocated");
if (sizeof(tagint) == sizeof(smallint)) {
newtree->type = INTARRAY;
newtree->iarray = (int *) atom->molecule;
} else {
newtree->type = BIGINTARRAY;
newtree->barray = (bigint *) atom->molecule;
}
newtree->nstride = 1;
}
else if (strcmp(word,"x") == 0) newtree->array = &atom->x[0][0];
else if (strcmp(word,"y") == 0) newtree->array = &atom->x[0][1];
else if (strcmp(word,"z") == 0) newtree->array = &atom->x[0][2];
else if (strcmp(word,"vx") == 0) newtree->array = &atom->v[0][0];
else if (strcmp(word,"vy") == 0) newtree->array = &atom->v[0][1];
else if (strcmp(word,"vz") == 0) newtree->array = &atom->v[0][2];
else if (strcmp(word,"fx") == 0) newtree->array = &atom->f[0][0];
else if (strcmp(word,"fy") == 0) newtree->array = &atom->f[0][1];
else if (strcmp(word,"fz") == 0) newtree->array = &atom->f[0][2];
else if (strcmp(word,"q") == 0) {
newtree->nstride = 1;
newtree->array = atom->q;
}
}
/* ----------------------------------------------------------------------
check if word matches a constant
return 1 if yes, else 0
customize by adding a constant: PI, version
------------------------------------------------------------------------- */
int Variable::is_constant(char *word)
{
if (strcmp(word,"PI") == 0) return 1;
if (strcmp(word,"version") == 0) return 1;
if (strcmp(word,"yes") == 0) return 1;
if (strcmp(word,"no") == 0) return 1;
if (strcmp(word,"on") == 0) return 1;
if (strcmp(word,"off") == 0) return 1;
if (strcmp(word,"true") == 0) return 1;
if (strcmp(word,"false") == 0) return 1;
return 0;
}
/* ----------------------------------------------------------------------
process a constant in formula
customize by adding a constant: PI, version
------------------------------------------------------------------------- */
double Variable::constant(char *word)
{
if (strcmp(word,"PI") == 0) return MY_PI;
if (strcmp(word,"version") == 0) return atof(universe->num_ver);
if (strcmp(word,"yes") == 0) return 1.0;
if (strcmp(word,"no") == 0) return 0.0;
if (strcmp(word,"on") == 0) return 1.0;
if (strcmp(word,"off") == 0) return 0.0;
if (strcmp(word,"true") == 0) return 1.0;
if (strcmp(word,"false") == 0) return 0.0;
return 0.0;
}
/* ----------------------------------------------------------------------
parse string for comma-separated args
store copy of each arg in args array
max allowed # of args = MAXFUNCARG
------------------------------------------------------------------------- */
int Variable::parse_args(char *str, char **args)
{
int n;
char *ptrnext;
int narg = 0;
char *ptr = str;
while (ptr && narg < MAXFUNCARG) {
ptrnext = find_next_comma(ptr);
if (ptrnext) *ptrnext = '\0';
n = strlen(ptr) + 1;
args[narg] = new char[n];
strcpy(args[narg],ptr);
narg++;
ptr = ptrnext;
if (ptr) ptr++;
}
if (ptr) error->all(FLERR,"Too many args in variable function");
return narg;
}
/* ----------------------------------------------------------------------
find next comma in str
skip commas inside one or more nested parenthesis
only return ptr to comma at level 0, else NULL if not found
------------------------------------------------------------------------- */
char *Variable::find_next_comma(char *str)
{
int level = 0;
for (char *p = str; *p; ++p) {
if ('(' == *p) level++;
else if (')' == *p) level--;
else if (',' == *p && !level) return p;
}
return NULL;
}
/* ----------------------------------------------------------------------
debug routine for printing formula tree recursively
------------------------------------------------------------------------- */
void Variable::print_tree(Tree *tree, int level)
{
printf("TREE %d: %d %g\n",level,tree->type,tree->value);
if (tree->first) print_tree(tree->first,level+1);
if (tree->second) print_tree(tree->second,level+1);
if (tree->nextra)
for (int i = 0; i < tree->nextra; i++) print_tree(tree->extra[i],level+1);
return;
}
/* ----------------------------------------------------------------------
recursive evaluation of string str
called from "if" command in input script
str is a boolean expression containing one or more items:
number = 0.0, -5.45, 2.8e-4, ...
math operation = (),x==y,x!=y,x<y,x<=y,x>y,x>=y,x&&y,x||y
------------------------------------------------------------------------- */
double Variable::evaluate_boolean(char *str)
{
int op,opprevious,flag1,flag2;
double value1,value2;
char onechar;
char *str1,*str2;
struct Arg {
int flag; // 0 for numeric value, 1 for string
double value; // stored numeric value
char *str; // stored string
};
Arg argstack[MAXLEVEL];
int opstack[MAXLEVEL];
int nargstack = 0;
int nopstack = 0;
int i = 0;
int expect = ARG;
while (1) {
onechar = str[i];
// whitespace: just skip
if (isspace(onechar)) i++;
// ----------------
// parentheses: recursively evaluate contents of parens
// ----------------
else if (onechar == '(') {
if (expect == OP)
error->all(FLERR,"Invalid Boolean syntax in if command");
expect = OP;
char *contents;
i = find_matching_paren(str,i,contents);
i++;
// evaluate contents and push on stack
argstack[nargstack].value = evaluate_boolean(contents);
argstack[nargstack].flag = 0;
nargstack++;
delete [] contents;
// ----------------
// number: push value onto stack
// ----------------
} else if (isdigit(onechar) || onechar == '.' || onechar == '-') {
if (expect == OP)
error->all(FLERR,"Invalid Boolean syntax in if command");
expect = OP;
// set I to end of number, including scientific notation
int istart = i++;
while (isdigit(str[i]) || str[i] == '.') i++;
if (str[i] == 'e' || str[i] == 'E') {
i++;
if (str[i] == '+' || str[i] == '-') i++;
while (isdigit(str[i])) i++;
}
onechar = str[i];
str[i] = '\0';
argstack[nargstack].value = atof(&str[istart]);
str[i] = onechar;
argstack[nargstack++].flag = 0;
// ----------------
// string: push string onto stack
// ----------------
} else if (isalpha(onechar)) {
if (expect == OP)
error->all(FLERR,"Invalid Boolean syntax in if command");
expect = OP;
// set I to end of string
int istart = i++;
while (isalnum(str[i]) || str[i] == '_') i++;
int n = i - istart + 1;
argstack[nargstack].str = new char[n];
onechar = str[i];
str[i] = '\0';
strcpy(argstack[nargstack].str,&str[istart]);
str[i] = onechar;
argstack[nargstack++].flag = 1;
// ----------------
// Boolean operator, including end-of-string
// ----------------
} else if (strchr("<>=!&|\0",onechar)) {
if (onechar == '=') {
if (str[i+1] != '=')
error->all(FLERR,"Invalid Boolean syntax in if command");
op = EQ;
i++;
} else if (onechar == '!') {
if (str[i+1] == '=') {
op = NE;
i++;
} else op = NOT;
} else if (onechar == '<') {
if (str[i+1] != '=') op = LT;
else {
op = LE;
i++;
}
} else if (onechar == '>') {
if (str[i+1] != '=') op = GT;
else {
op = GE;
i++;
}
} else if (onechar == '&') {
if (str[i+1] != '&')
error->all(FLERR,"Invalid Boolean syntax in if command");
op = AND;
i++;
} else if (onechar == '|') {
if (str[i+1] != '|')
error->all(FLERR,"Invalid Boolean syntax in if command");
op = OR;
i++;
} else op = DONE;
i++;
if (op == NOT && expect == ARG) {
opstack[nopstack++] = op;
continue;
}
if (expect == ARG)
error->all(FLERR,"Invalid Boolean syntax in if command");
expect = ARG;
// evaluate stack as deep as possible while respecting precedence
// before pushing current op onto stack
while (nopstack && precedence[opstack[nopstack-1]] >= precedence[op]) {
opprevious = opstack[--nopstack];
nargstack--;
flag2 = argstack[nargstack].flag;
value2 = argstack[nargstack].value;
str2 = argstack[nargstack].str;
if (opprevious != NOT) {
nargstack--;
flag1 = argstack[nargstack].flag;
value1 = argstack[nargstack].value;
str1 = argstack[nargstack].str;
}
if (opprevious == NOT) {
if (flag2) error->all(FLERR,"Invalid Boolean syntax in if command");
if (value2 == 0.0) argstack[nargstack].value = 1.0;
else argstack[nargstack].value = 0.0;
} else if (opprevious == EQ) {
if (flag1 != flag2)
error->all(FLERR,"Invalid Boolean syntax in if command");
if (flag2 == 0) {
if (value1 == value2) argstack[nargstack].value = 1.0;
else argstack[nargstack].value = 0.0;
} else {
if (strcmp(str1,str2) == 0) argstack[nargstack].value = 1.0;
else argstack[nargstack].value = 0.0;
delete [] str1;
delete [] str2;
}
} else if (opprevious == NE) {
if (flag1 != flag2)
error->all(FLERR,"Invalid Boolean syntax in if command");
if (flag2 == 0) {
if (value1 != value2) argstack[nargstack].value = 1.0;
else argstack[nargstack].value = 0.0;
} else {
if (strcmp(str1,str2) != 0) argstack[nargstack].value = 1.0;
else argstack[nargstack].value = 0.0;
delete [] str1;
delete [] str2;
}
} else if (opprevious == LT) {
if (flag2) error->all(FLERR,"Invalid Boolean syntax in if command");
if (value1 < value2) argstack[nargstack].value = 1.0;
else argstack[nargstack].value = 0.0;
} else if (opprevious == LE) {
if (flag2) error->all(FLERR,"Invalid Boolean syntax in if command");
if (value1 <= value2) argstack[nargstack].value = 1.0;
else argstack[nargstack].value = 0.0;
} else if (opprevious == GT) {
if (flag2) error->all(FLERR,"Invalid Boolean syntax in if command");
if (value1 > value2) argstack[nargstack].value = 1.0;
else argstack[nargstack].value = 0.0;
} else if (opprevious == GE) {
if (flag2) error->all(FLERR,"Invalid Boolean syntax in if command");
if (value1 >= value2) argstack[nargstack].value = 1.0;
else argstack[nargstack].value = 0.0;
} else if (opprevious == AND) {
if (flag2) error->all(FLERR,"Invalid Boolean syntax in if command");
if (value1 != 0.0 && value2 != 0.0) argstack[nargstack].value = 1.0;
else argstack[nargstack].value = 0.0;
} else if (opprevious == OR) {
if (flag2) error->all(FLERR,"Invalid Boolean syntax in if command");
if (value1 != 0.0 || value2 != 0.0) argstack[nargstack].value = 1.0;
else argstack[nargstack].value = 0.0;
}
argstack[nargstack++].flag = 0;
}
// if end-of-string, break out of entire formula evaluation loop
if (op == DONE) break;
// push current operation onto stack
opstack[nopstack++] = op;
} else error->all(FLERR,"Invalid Boolean syntax in if command");
}
if (nopstack) error->all(FLERR,"Invalid Boolean syntax in if command");
if (nargstack != 1) error->all(FLERR,"Invalid Boolean syntax in if command");
return argstack[0].value;
}
/* ---------------------------------------------------------------------- */
unsigned int Variable::data_mask(int ivar)
{
if (eval_in_progress[ivar]) return EMPTY_MASK;
eval_in_progress[ivar] = 1;
unsigned int datamask = data_mask(data[ivar][0]);
eval_in_progress[ivar] = 0;
return datamask;
}
/* ---------------------------------------------------------------------- */
unsigned int Variable::data_mask(char *str)
{
unsigned int datamask = EMPTY_MASK;
for (unsigned int i = 0; i < strlen(str)-2; i++) {
int istart = i;
while (isalnum(str[i]) || str[i] == '_') i++;
int istop = i-1;
int n = istop - istart + 1;
char *word = new char[n+1];
strncpy(word,&str[istart],n);
word[n] = '\0';
// ----------------
// compute
// ----------------
if ((strncmp(word,"c_",2) == 0) && (i>0) && (!isalnum(str[i-1]))) {
if (domain->box_exist == 0)
error->all(FLERR,
"Variable evaluation before simulation box is defined");
int icompute = modify->find_compute(word+2);
if (icompute < 0)
error->all(FLERR,"Invalid compute ID in variable formula");
datamask &= modify->compute[icompute]->data_mask();
}
if ((strncmp(word,"f_",2) == 0) && (i>0) && (!isalnum(str[i-1]))) {
if (domain->box_exist == 0)
error->all(FLERR,
"Variable evaluation before simulation box is defined");
int ifix = modify->find_fix(word+2);
if (ifix < 0) error->all(FLERR,"Invalid fix ID in variable formula");
datamask &= modify->fix[ifix]->data_mask();
}
if ((strncmp(word,"v_",2) == 0) && (i>0) && (!isalnum(str[i-1]))) {
int ivar = find(word+2);
if (ivar < 0) error->all(FLERR,"Invalid variable name in variable formula");
datamask &= data_mask(ivar);
}
delete [] word;
}
return datamask;
}
/* ----------------------------------------------------------------------
class to read variable values from a file
for flag = SCALARFILE, reads one value per line
for flag = ATOMFILE, reads set of one value per atom
------------------------------------------------------------------------- */
VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) :
Pointers(lmp)
{
me = comm->me;
style = flag;
fp = NULL;
if (me == 0) {
fp = fopen(file,"r");
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open file variable file %s",file);
error->one(FLERR,str);
}
}
// if atomfile-style variable, must store per-atom values read from file
// allocate a new fix STORE, so they persist
// id = variable-ID + VARIABLE_STORE, fix group = all
fixstore = NULL;
id_fix = NULL;
buffer = NULL;
if (style == ATOMFILE) {
if (atom->map_style == 0)
error->all(FLERR,
"Cannot use atomfile-style variable unless atom map exists");
int n = strlen(name) + strlen("_VARIABLE_STORE") + 1;
id_fix = new char[n];
strcpy(id_fix,name);
strcat(id_fix,"_VARIABLE_STORE");
- char **newarg = new char*[5];
+ char **newarg = new char*[6];
newarg[0] = id_fix;
newarg[1] = (char *) "all";
newarg[2] = (char *) "STORE";
- newarg[3] = (char *) "0";
- newarg[4] = (char *) "1";
- modify->add_fix(5,newarg);
+ newarg[3] = (char *) "peratom";
+ newarg[4] = (char *) "0";
+ newarg[5] = (char *) "1";
+ modify->add_fix(6,newarg);
fixstore = (FixStore *) modify->fix[modify->nfix-1];
delete [] newarg;
buffer = new char[CHUNK*MAXLINE];
}
}
/* ---------------------------------------------------------------------- */
VarReader::~VarReader()
{
if (me == 0) {
fclose(fp);
fp = NULL;
}
// check modify in case all fixes have already been deleted
if (fixstore) {
if (modify) modify->delete_fix(id_fix);
delete [] id_fix;
delete [] buffer;
}
}
/* ----------------------------------------------------------------------
read for SCALARFILE style
read next value from file into str for file-style variable
strip comments, skip blank lines
return 0 if successful, 1 if end-of-file
------------------------------------------------------------------------- */
int VarReader::read_scalar(char *str)
{
int n;
char *ptr;
// read one string from file
if (me == 0) {
while (1) {
if (fgets(str,MAXLINE,fp) == NULL) n = 0;
else n = strlen(str);
if (n == 0) break; // end of file
str[n-1] = '\0'; // strip newline
if ((ptr = strchr(str,'#'))) *ptr = '\0'; // strip comment
if (strtok(str," \t\n\r\f") == NULL) continue; // skip if blank
n = strlen(str) + 1;
break;
}
}
MPI_Bcast(&n,1,MPI_INT,0,world);
if (n == 0) return 1;
MPI_Bcast(str,n,MPI_CHAR,0,world);
return 0;
}
/* ----------------------------------------------------------------------
read snapshot of per-atom values from file
into str for atomfile-style variable
return 0 if successful, 1 if end-of-file
------------------------------------------------------------------------- */
int VarReader::read_peratom()
{
int i,m,n,nchunk,eof;
tagint tag;
char *ptr,*next;
double value;
// set all per-atom values to 0.0
// values that appear in file will overwrite this
double *vstore = fixstore->vstore;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++) vstore[i] = 0.0;
// read one string from file, convert to Nlines
char str[MAXLINE];
if (me == 0) {
while (1) {
if (fgets(str,MAXLINE,fp) == NULL) n = 0;
else n = strlen(str);
if (n == 0) break; // end of file
str[n-1] = '\0'; // strip newline
if ((ptr = strchr(str,'#'))) *ptr = '\0'; // strip comment
if (strtok(str," \t\n\r\f") == NULL) continue; // skip if blank
n = strlen(str) + 1;
break;
}
}
MPI_Bcast(&n,1,MPI_INT,0,world);
if (n == 0) return 1;
MPI_Bcast(str,n,MPI_CHAR,0,world);
bigint nlines = force->bnumeric(FLERR,str);
tagint map_tag_max = atom->map_tag_max;
bigint nread = 0;
while (nread < nlines) {
nchunk = MIN(nlines-nread,CHUNK);
eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
if (eof) return 1;
char *buf = buffer;
for (i = 0; i < nchunk; i++) {
next = strchr(buf,'\n');
*next = '\0';
sscanf(buf,TAGINT_FORMAT " %lg",&tag,&value);
if (tag <= 0 || tag > map_tag_max)
error->one(FLERR,"Invalid atom ID in variable file");
if ((m = atom->map(tag)) >= 0) vstore[m] = value;
buf = next + 1;
}
nread += nchunk;
}
return 0;
}
diff --git a/src/verlet.cpp b/src/verlet.cpp
index f7e71f1d3..ce06a1c45 100644
--- a/src/verlet.cpp
+++ b/src/verlet.cpp
@@ -1,402 +1,403 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include <string.h>
#include "verlet.h"
#include "neighbor.h"
#include "domain.h"
#include "comm.h"
#include "atom.h"
#include "atom_vec.h"
#include "force.h"
#include "pair.h"
#include "bond.h"
#include "angle.h"
#include "dihedral.h"
#include "improper.h"
#include "kspace.h"
#include "output.h"
#include "update.h"
#include "modify.h"
#include "compute.h"
#include "fix.h"
#include "timer.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
Verlet::Verlet(LAMMPS *lmp, int narg, char **arg) :
Integrate(lmp, narg, arg) {}
/* ----------------------------------------------------------------------
initialization before run
------------------------------------------------------------------------- */
void Verlet::init()
{
Integrate::init();
// warn if no fixes
if (modify->nfix == 0 && comm->me == 0)
error->warning(FLERR,"No fixes defined, atoms won't move");
// virial_style:
// 1 if computed explicitly by pair->compute via sum over pair interactions
// 2 if computed implicitly by pair->virial_fdotr_compute via sum over ghosts
if (force->newton_pair) virial_style = 2;
else virial_style = 1;
// setup lists of computes for global and per-atom PE and pressure
ev_setup();
// detect if fix omp is present for clearing force arrays
int ifix = modify->find_fix("package_omp");
if (ifix >= 0) external_force_clear = 1;
// set flags for arrays to clear in force_clear()
torqueflag = extraflag = 0;
if (atom->torque_flag) torqueflag = 1;
if (atom->avec->forceclearflag) extraflag = 1;
// orthogonal vs triclinic simulation box
triclinic = domain->triclinic;
}
/* ----------------------------------------------------------------------
setup before run
------------------------------------------------------------------------- */
void Verlet::setup()
{
if (comm->me == 0 && screen) {
fprintf(screen,"Setting up Verlet run ...\n");
fprintf(screen," Unit style : %s\n", update->unit_style);
fprintf(screen," Current step : " BIGINT_FORMAT "\n", update->ntimestep);
fprintf(screen," Time step : %g\n", update->dt);
timer->print_timeout(screen);
}
update->setupflag = 1;
// setup domain, communication and neighboring
// acquire ghosts
// build neighbor lists
atom->setup();
modify->setup_pre_exchange();
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
comm->exchange();
if (atom->sortfreq > 0) atom->sort();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
domain->image_check();
domain->box_too_small_check();
modify->setup_pre_neighbor();
neighbor->build();
neighbor->ncalls = 0;
// compute all forces
+ force->setup();
ev_set(update->ntimestep);
force_clear();
modify->setup_pre_force(vflag);
if (pair_compute_flag) force->pair->compute(eflag,vflag);
else if (force->pair) force->pair->compute_dummy(eflag,vflag);
if (atom->molecular) {
if (force->bond) force->bond->compute(eflag,vflag);
if (force->angle) force->angle->compute(eflag,vflag);
if (force->dihedral) force->dihedral->compute(eflag,vflag);
if (force->improper) force->improper->compute(eflag,vflag);
}
if (force->kspace) {
force->kspace->setup();
if (kspace_compute_flag) force->kspace->compute(eflag,vflag);
else force->kspace->compute_dummy(eflag,vflag);
}
modify->pre_reverse(eflag,vflag);
if (force->newton) comm->reverse_comm();
modify->setup(vflag);
output->setup();
update->setupflag = 0;
}
/* ----------------------------------------------------------------------
setup without output
flag = 0 = just force calculation
flag = 1 = reneighbor and force calculation
------------------------------------------------------------------------- */
void Verlet::setup_minimal(int flag)
{
update->setupflag = 1;
// setup domain, communication and neighboring
// acquire ghosts
// build neighbor lists
if (flag) {
modify->setup_pre_exchange();
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
comm->exchange();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
domain->image_check();
domain->box_too_small_check();
modify->setup_pre_neighbor();
neighbor->build();
neighbor->ncalls = 0;
}
// compute all forces
ev_set(update->ntimestep);
force_clear();
modify->setup_pre_force(vflag);
if (pair_compute_flag) force->pair->compute(eflag,vflag);
else if (force->pair) force->pair->compute_dummy(eflag,vflag);
if (atom->molecular) {
if (force->bond) force->bond->compute(eflag,vflag);
if (force->angle) force->angle->compute(eflag,vflag);
if (force->dihedral) force->dihedral->compute(eflag,vflag);
if (force->improper) force->improper->compute(eflag,vflag);
}
if (force->kspace) {
force->kspace->setup();
if (kspace_compute_flag) force->kspace->compute(eflag,vflag);
else force->kspace->compute_dummy(eflag,vflag);
}
modify->pre_reverse(eflag,vflag);
if (force->newton) comm->reverse_comm();
modify->setup(vflag);
update->setupflag = 0;
}
/* ----------------------------------------------------------------------
run for N steps
------------------------------------------------------------------------- */
void Verlet::run(int n)
{
bigint ntimestep;
int nflag,sortflag;
int n_post_integrate = modify->n_post_integrate;
int n_pre_exchange = modify->n_pre_exchange;
int n_pre_neighbor = modify->n_pre_neighbor;
int n_pre_force = modify->n_pre_force;
int n_pre_reverse = modify->n_pre_reverse;
int n_post_force = modify->n_post_force;
int n_end_of_step = modify->n_end_of_step;
if (atom->sortfreq > 0) sortflag = 1;
else sortflag = 0;
for (int i = 0; i < n; i++) {
if (timer->check_timeout(i)) {
update->nsteps = i;
break;
}
ntimestep = ++update->ntimestep;
ev_set(ntimestep);
// initial time integration
timer->stamp();
modify->initial_integrate(vflag);
if (n_post_integrate) modify->post_integrate();
timer->stamp(Timer::MODIFY);
// regular communication vs neighbor list rebuild
nflag = neighbor->decide();
if (nflag == 0) {
timer->stamp();
comm->forward_comm();
timer->stamp(Timer::COMM);
} else {
if (n_pre_exchange) {
timer->stamp();
modify->pre_exchange();
timer->stamp(Timer::MODIFY);
}
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
if (domain->box_change) {
domain->reset_box();
comm->setup();
if (neighbor->style) neighbor->setup_bins();
}
timer->stamp();
comm->exchange();
if (sortflag && ntimestep >= atom->nextsort) atom->sort();
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
timer->stamp(Timer::COMM);
if (n_pre_neighbor) {
modify->pre_neighbor();
timer->stamp(Timer::MODIFY);
}
neighbor->build();
timer->stamp(Timer::NEIGH);
}
// force computations
// important for pair to come before bonded contributions
// since some bonded potentials tally pairwise energy/virial
// and Pair:ev_tally() needs to be called before any tallying
force_clear();
timer->stamp();
if (n_pre_force) {
modify->pre_force(vflag);
timer->stamp(Timer::MODIFY);
}
if (pair_compute_flag) {
force->pair->compute(eflag,vflag);
timer->stamp(Timer::PAIR);
}
if (atom->molecular) {
if (force->bond) force->bond->compute(eflag,vflag);
if (force->angle) force->angle->compute(eflag,vflag);
if (force->dihedral) force->dihedral->compute(eflag,vflag);
if (force->improper) force->improper->compute(eflag,vflag);
timer->stamp(Timer::BOND);
}
if (kspace_compute_flag) {
force->kspace->compute(eflag,vflag);
timer->stamp(Timer::KSPACE);
}
if (n_pre_reverse) {
modify->pre_reverse(eflag,vflag);
timer->stamp(Timer::MODIFY);
}
// reverse communication of forces
if (force->newton) {
comm->reverse_comm();
timer->stamp(Timer::COMM);
}
// force modifications, final time integration, diagnostics
if (n_post_force) modify->post_force(vflag);
modify->final_integrate();
if (n_end_of_step) modify->end_of_step();
timer->stamp(Timer::MODIFY);
// all output
if (ntimestep == output->next) {
timer->stamp();
output->write(ntimestep);
timer->stamp(Timer::OUTPUT);
}
}
}
/* ---------------------------------------------------------------------- */
void Verlet::cleanup()
{
modify->post_run();
domain->box_too_small_check();
update->update_time();
}
/* ----------------------------------------------------------------------
clear force on own & ghost atoms
clear other arrays as needed
------------------------------------------------------------------------- */
void Verlet::force_clear()
{
size_t nbytes;
if (external_force_clear) return;
// clear force on all particles
// if either newton flag is set, also include ghosts
// when using threads always clear all forces.
int nlocal = atom->nlocal;
if (neighbor->includegroup == 0) {
nbytes = sizeof(double) * nlocal;
if (force->newton) nbytes += sizeof(double) * atom->nghost;
if (nbytes) {
memset(&atom->f[0][0],0,3*nbytes);
if (torqueflag) memset(&atom->torque[0][0],0,3*nbytes);
if (extraflag) atom->avec->force_clear(0,nbytes);
}
// neighbor includegroup flag is set
// clear force only on initial nfirst particles
// if either newton flag is set, also include ghosts
} else {
nbytes = sizeof(double) * atom->nfirst;
if (nbytes) {
memset(&atom->f[0][0],0,3*nbytes);
if (torqueflag) memset(&atom->torque[0][0],0,3*nbytes);
if (extraflag) atom->avec->force_clear(0,nbytes);
}
if (force->newton) {
nbytes = sizeof(double) * atom->nghost;
if (nbytes) {
memset(&atom->f[nlocal][0],0,3*nbytes);
if (torqueflag) memset(&atom->torque[nlocal][0],0,3*nbytes);
if (extraflag) atom->avec->force_clear(nlocal,nbytes);
}
}
}
}
diff --git a/src/version.h b/src/version.h
index 41f50484c..16b5c3f34 100644
--- a/src/version.h
+++ b/src/version.h
@@ -1 +1 @@
-#define LAMMPS_VERSION "19 Dec 2015"
+#define LAMMPS_VERSION "22 Jan 2016"
diff --git a/tools/ch2lmp/charmm2lammps.pl b/tools/ch2lmp/charmm2lammps.pl
index 41342a401..af056f0af 100644
--- a/tools/ch2lmp/charmm2lammps.pl
+++ b/tools/ch2lmp/charmm2lammps.pl
@@ -1,1455 +1,1465 @@
#!/usr/bin/perl
#
# program: charmm2lammps.pl
# author: Pieter J. in 't Veld,
# pjintve@sandia.gov, veld@verizon.net
# date: February 12-23, April 5, 2005.
# purpose: Translation of charmm input to lammps input
#
# Notes: Copyright by author for Sandia National Laboratories
# 20050212 Needed (in the same directory):
# - $project.crd ; Assumed to be correct and running
# - $project.psf ; CHARMM configs
# - top_$forcefield.rtf ;
# - par_$forcefield.prm ;
# Ouput:
# - $project.data ; LAMMPS data file
# - $project.in ; LAMMPS input file
# - $project_ctrl.pdb ; PDB control file
# - $project_ctrl.psf ; PSF control file
# 20050218 Optimized for memory usage
# 20050221 Rotation added
# 20050222 Water added
# 20050223 Ions added
# 20050405 Water bug fixed; addition of .pdb input
# 20050407 project_ctrl.psf bug fixed; addition of -border
# 20050519 Added interpretation of charmm xplor psfs
# 20050603 Fixed centering issues
# 20050630 Fixed symbol issues arising from salt addition
# 20060818 Changed reading of pdb format to read exact columns
# 20070109 Changed AddMass() to use $max_id correctly
+# 20160114 Added compatibility for parameter files that use IMPROPERS instead of IMPROPER
+# Print warning when not all parameters are detected. Set correct number of atom types.
#
# General Many thanks to Paul S. Crozier for checking script validity
# against his projects.
# Initialization
sub Test
{
my $name = shift(@_);
printf("Error: file %s not found\n", $name) if (!scalar(stat($name)));
return !scalar(stat($name));
}
sub Initialize # initialization
{
my $k = 0;
my @dir = ("x", "y", "z");
my @options = ("-help", "-charmm", "-water", "-ions", "-center",
"-quiet", "-pdb_ctrl", "-l", "-lx", "-ly", "-lz",
"-border", "-ax", "-ay", "-az");
my @remarks = ("display this message",
"add charmm types to LAMMPS data file",
"add TIP3P water [default: 1 g/cc]",
"add (counter)ions using Na+ and Cl- [default: 0 mol/l]",
"recenter atoms",
"do not print info",
"output project_ctrl.pdb [default: on]",
"set x-, y-, and z-dimensions simultaneously",
"x-dimension of simulation box",
"y-dimension of simulation box",
"z-dimension of simulation box",
"add border to all sides of simulation box [default: 0 A]",
"rotation around x-axis",
"rotation around y-axis",
"rotation around z-axis"
);
my $notes;
$program = "charmm2lammps";
- $version = "1.8.1";
- $year = "2007";
+ $version = "1.8.2";
+ $year = "2016";
$add = 0;
$water_dens = 0;
$ions = 0;
$info = 1;
$center = 0;
$net_charge = 0;
$ion_molar = 0;
$pdb_ctrl = 1;
$border = 0;
$L = (0, 0, 0);
@R = M_Unit();
$notes = " * The average of extremes is used as the origin\n";
$notes .= " * Residues are numbered sequentially\n";
$notes .= " * Water is added on an FCC lattice: allow 5 ps for";
$notes .= " equilibration\n";
$notes .= " * Ions are added randomly and only when water is present\n";
$notes .= " * CHARMM force field v2.7 parameters used for";
$notes .= " water and NaCl\n";
$notes .= " * Rotation angles are in degrees\n";
$notes .= " * Rotations are executed consecutively: -ax -ay != -ay -ax\n";
$notes .= " * CHARMM files needed in execution directory:\n";
$notes .= " - project.crd coordinates\n";
$notes .= " - project.pdb when project.crd is absent\n";
$notes .= " - project.psf connectivity\n";
$notes .= " - top_forcefield.rtf topology\n";
$notes .= " - par_forcefield.prm parameters\n";
$notes .= " * Output files written to execution directory:\n";
$notes .= " - project.data LAMMPS data file\n";
$notes .= " - project.in suggested LAMMPS input script\n";
$notes .= " - project_ctrl.pdb control file when requested\n";
foreach (@ARGV)
{
if (substr($_, 0, 1) eq "-")
{
my $k = 0;
my @tmp = split("=");
my $switch = ($arg[1] eq "")||($arg[1] eq "on")||($arg[1]!=0);
$tmp[0] = lc($tmp[0]);
foreach (@options)
{
last if ($tmp[0] eq substr($_, 0 , length($tmp[0])));
++$k;
}
$help = 1 if (!$k--);
$add = 1 if (!$k--);
$water_dens = ($tmp[1] ne "" ? $tmp[1] : 1) if (!$k--);
$ion_molar = abs($tmp[1]) if (!$k);
$ions = 1 if (!$k--);
$center = 1 if (!$k--);
$info = 0 if (!$k--);
$pdb_ctrl = $switch if (!$k--);
my $flag = $k--;
$L[0] = abs($tmp[1]) if (!($flag && $k--));
$L[1] = abs($tmp[1]) if (!($flag && $k--));
$L[2] = abs($tmp[1]) if (!($flag && $k--));
$border = abs($tmp[1]) if (!$k--);
@R = M_Dot(M_Rotate(0, $tmp[1]), @R) if (!$k--);
@R = M_Dot(M_Rotate(1, $tmp[1]), @R) if (!$k--);
@R = M_Dot(M_Rotate(2, $tmp[1]), @R) if (!$k--);
}
else
{
$forcefield = $_ if (!$k);
$project = $_ if ($k++ == 1);
}
}
$water_dens = 1 if ($ions && !$water_dens);
if (($k<2)||$help)
{
printf("%s v%s (c)%s by Pieter J. in \'t Veld for SNL\n\n",
$program, $version, $year);
printf("Usage:\n %s.pl [-option[=#] ..] forcefield project\n\n",$program);
printf("Options:\n");
for (my $i=0; $i<scalar(@options); ++$i)
{
printf(" %-10.10s %s\n", $options[$i], $remarks[$i]);
}
printf("\nNotes:\n%s\n", $notes);
exit(-1);
}
else { printf("%s v%s (c)%s\n\n", $program, $version, $year) if ($info); }
my $flag = Test($Parameters = "par_$forcefield.prm");
$flag |= Test($Topology = "top_$forcefield.rtf");
$flag |= Test($Pdb = "$project.pdb")
if (!scalar(stat($Crd = "$project.crd")));
$flag |= Test($Psf = "$project.psf") if ($look eq "");
$pdb = ($Pdb ne "") ? 1 : 0;
printf("Conversion aborted\n\n") if ($flag);
exit(-1) if ($flag);
printf("Info: using $Pdb instead of $Crd\n") if (!scalar(stat($Crd)));
for (my $i=0; $i<3; ++$i)
{
printf("Info: l%s not set: will use extremes\n",
("x", "y", "z")[$i]) if ($info&&!$L[$i]);
}
open(PARAMETERS, "<par_$forcefield.prm");
}
# Vector manipulation
sub V_String
{
my @v = @_;
return "{".$v[0].", ".$v[1].", ".$v[2]."}";
}
sub V_Add
{
my @v1 = splice(@_, 0, 3);
my @v2 = splice(@_, 0, 3);
return ($v1[0]+$v2[0], $v1[1]+$v2[1], $v1[2]+$v2[2]);
}
sub V_Subtr
{
my @v1 = splice(@_, 0, 3);
my @v2 = splice(@_, 0, 3);
return ($v1[0]-$v2[0], $v1[1]-$v2[1], $v1[2]-$v2[2]);
}
sub V_Dot
{
my @v1 = splice(@_, 0, 3);
my @v2 = splice(@_, 0, 3);
return $v1[0]*$v2[0]+$v1[1]*$v2[1]+$v1[2]*$v2[2];
}
sub V_Mult
{
my @v = splice(@_, 0, 3);
my $f = shift(@_);
return ($f*$v[0], $f*$v[1], $f*$v[2]);
}
sub M_String
{
my $string;
for (my $i=0; $i<3; ++$i)
{
$string .= ", " if ($i);
$string .= V_String(splice(@_, 0, 3));
}
return "{".$string."}";
}
sub M_Transpose
{
return
(@_[0], @_[3], @_[6],
@_[1], @_[4], @_[7],
@_[2], @_[5], @_[8]);
}
sub M_Dot
{
my @v11 = splice(@_, 0, 3);
my @v12 = splice(@_, 0, 3);
my @v13 = splice(@_, 0, 3);
my @m = M_Transpose(splice(@_, 0, 9));
my @v21 = splice(@m, 0, 3);
my @v22 = splice(@m, 0, 3);
my @v23 = splice(@m, 0, 3);
return (
V_Dot(@v11, @v21), V_Dot(@v11, @v22), V_Dot(@v11, @v23),
V_Dot(@v12, @v21), V_Dot(@v12, @v22), V_Dot(@v12, @v23),
V_Dot(@v13, @v21), V_Dot(@v13, @v22), V_Dot(@v13, @v23));
}
sub M_Unit { return (1,0,0, 0,1,0, 0,0,1); }
sub PI { return 4*atan2(1,1); }
sub M_Rotate
{ # vmd convention
my $n = shift(@_);
my $alpha = shift(@_)*PI()/180;
my $cos = cos($alpha);
my $sin = sin($alpha);
$cos = 0 if (abs($cos)<1e-16);
$sin = 0 if (abs($sin)<1e-16);
return (1,0,0, 0,$cos,-$sin, 0,$sin,$cos) if ($n==0); # around x-axis
return ($cos,0,$sin, 0,1,0, -$sin,0,$cos) if ($n==1); # around y-axis
return ($cos,-$sin,0, $sin,$cos,0, 0,0,1) if ($n==2); # around z-axis
return M_Unit();
}
sub MV_Dot
{
my @v11 = splice(@_, 0, 3);
my @v12 = splice(@_, 0, 3);
my @v13 = splice(@_, 0, 3);
my @v2 = splice(@_, 0, 3);
return (V_Dot(@v11, @v2), V_Dot(@v12, @v2), V_Dot(@v13, @v2));
}
# CHARMM input
sub PSFConnectivity
{
my $n = PSFGoto(bonds);
return if (scalar(@nconnect));
printf("Info: creating connectivity\n") if ($info);
for (my $i=0; $i<$n; ++$i)
{
my @bond = PSFGet(2);
$connect[$bond[0]][$nconnect[$bond[0]]++] = $bond[1];
$connect[$bond[1]][$nconnect[$bond[1]]++] = $bond[0];
}
}
sub PSFDihedrals # hack to accomodate
{ # LAMMPS' way of calc
$idihedral = 0; # LJ 1-4 interactions
return $ndihedral if (($dihedral_flag = $ndihedral ? 1 : 0));
PSFConnectivity();
printf("Info: creating dihedrals\n") if ($info);
my $n = scalar(@nconnect);
my @bonded = ();
for (my $i=1; $i<=$n; ++$i)
{
$bonded[0] = $i;
for (my $i=0; $i<scalar($nconnect[$bonded[0]]); ++$i)
{
$bonded[1] = $connect[$bonded[0]][$i];
for (my $i=0; $i<scalar($nconnect[$bonded[1]]); ++$i)
{
next if (($bonded[2] = $connect[$bonded[1]][$i])==$bonded[0]);
for (my $i=0; $i<scalar($nconnect[$bonded[2]]); ++$i)
{
next if (($bonded[3] = $connect[$bonded[2]][$i])==$bonded[1]);
next if ($bonded[3]<$bonded[0]);
$dihedral[$ndihedral++] = join(" ", @bonded);
}
}
}
}
$dihedral_flag = 1;
return $ndihedral;
}
sub CreatePSFIndex # make an index of id
{ # locations
my @psf_ids = ("!NATOM","!NBOND:","!NTHETA:","!NPHI:","!NIMPHI:");
my @ids = (atoms, bonds, angles, dihedrals, impropers);
my $k = 0;
my %hash;
printf("Info: creating PSF index\n") if ($info);
open(PSF, "<$project.psf") if (fileno(PSF) eq "");
foreach (@psf_ids) { $hash{$_} = shift(@ids); };
while (<PSF>)
{
chop();
my @tmp = split(" ");
my $n = $hash{$tmp[1]};
$PSFIndex{$n} = tell(PSF)." ".$tmp[0] if ($n ne "");
}
}
sub PSFGoto # goto $ident in <PSF>
{
CreatePSFIndex() if (!scalar(%PSFIndex));
my $id = shift(@_);
my @n = split(" ", $PSFIndex{$id});
@PSFBuffer = ();
# return PSFDihedrals() if ($id eq "dihedrals");
if (!scalar(@n))
{
printf("Warning: PSF index for $id not found\n");
seek(PSF, 0, SEEK_END);
return -1;
}
seek(PSF, $n[0], SEEK_SET);
return $n[1];
}
sub PSFGet
{
if ($dihedral_flag)
{
$dihedral_flag = $idihedral+1<$ndihedral ? 1 : 0;
return split(" ", $dihedral[$idihedral++]);
}
if (!scalar(@PSFBuffer))
{
my $line = <PSF>;
chop($line);
@PSFBuffer = split(" ", $line);
}
return splice(@PSFBuffer, 0, shift(@_));
}
sub PSFWrite
{
my $items = shift(@_);
my $n = $items;
if ($psf_ncols>7) { printf(PSF_CTRL "\n"); $psf_ncols = 0; }
foreach(@_)
{
printf(PSF_CTRL " %7d", $_);
++$psf_ncols;
if ((!--$n) && ($psf_ncols>7))
{
printf(PSF_CTRL "\n");
$psf_ncols = 0;
$n = $items;
}
}
}
sub CRDGoto
{
my $n;
return if (shift(@_) ne "atoms");
open(CRD, "<".($pdb ? $Pdb : $Crd)) if (fileno(CRD) eq "");
seek(CRD, 0, SEEK_SET);
return PSFGoto(atoms) if ($pdb);
while (substr($n = <CRD>, 0, 1) eq "*") {}
chop($n);
return $n;
}
sub NextPDB2CRD
{
my @n = (6,5,1,4,1,3,1,1,4,1,3,8,8,8,6,6,6,4,2,2);
my @data = ();
my $c = 0;
my $line;
while (substr($line = <CRD>, 0, 4) ne "ATOM") {};
chop($line);
foreach (@n) { push(@data, substr($line, ($c += $_)-$_, $_)); }
return @data[1, 8, 5, 3, 11, 12, 13, 17, 8, 15];
}
sub Delete
{
my $item = shift(@_);
my $k = 0;
my @list;
foreach (@_)
{
my @tmp = split(" ");
delete($tmp[$item]);
$list[$k++] = join(" ", @tmp);
}
return @list;
}
sub CreateID # create id from list
{
my $n = scalar(@_);
my @list = @_;
my $id = "";
my $flag = $list[0] gt $list[-1];
my $j = $n;
my $tmp;
return "" if (scalar(@list)<$n);
$flag = $list[1] gt $list[-2]
if ((scalar(@list)>3)&&($list[0] eq $list[-1]));
for (my $i=0; $i<$n; ++$i)
{
$id .= ($i ? " " : "").($tmp = $list[$flag ? --$j : $i]);
$id .= substr(" ", 0, 4-length($tmp));
}
return $id;
}
sub AtomTypes
{
my $n = PSFGoto(atoms);
my %list;
return () if ($n<1);
$atom_types[0] = -1;
for (my $i=0; $i<$n; ++$i)
{
my @tmp = split(" ", <PSF>);
$tmp[5] = $symbols{$tmp[5]}
if ((substr($tmp[5],0,1) lt '0')||(substr($tmp[5],0,1) gt '9'));
push(@atom_types, $tmp[5]);
++$list{$tmp[5]};
}
if ($water_dens)
{
push(@atom_types, $symbols{HT}); ++$list{$symbols{HT}};
push(@atom_types, $symbols{OT}); ++$list{$symbols{OT}};
}
if ($ions)
{
push(@atom_types, $symbols{CLA}); ++$list{$symbols{CLA}};
push(@atom_types, $symbols{SOD}); ++$list{$symbols{SOD}};
}
return sort({$a<=>$b} keys(%list));
}
sub Markers
{
- my %markers;
- my $n = 0;
-
- foreach ("NONBONDED", "BONDS", "ANGLES", "DIHEDRALS", "IMPROPER") {
- $markers{$_} = $n++; }
+ my %markers = (
+ NONBONDED => '0',
+ BONDS => '1',
+ ANGLES => '2',
+ DIHEDRALS => '3',
+ IMPROPERS => '4',
+ IMPROPER => '4'
+ );
return %markers;
}
sub NonBond
{
my @cols = @_;
my $f = (scalar(@cols)>3)&&(substr($cols[3],0,1) ne "!");
my @tmp = (-$cols[1], $cols[2],
$f ? -$cols[4]:-$cols[1], $f ? $cols[5]:$cols[2]);
$tmp[1] *= 2.0**(5/6); # adjust sigma
$tmp[3] *= 2.0**(5/6); # adjust sigma 1-4
return join(" ", @tmp);
}
sub AtomParameters # non-bonded parameters
{
my @types;
my @list;
my $k = 0;
my $read = 0;
my %markers = Markers();
foreach(@_) { $types{$ids{$_}} = $k++; }
seek(PARAMETERS, 0, 0);
while (<PARAMETERS>)
{
chop();
my @cols = split(" ");
if ($read&&(scalar(@cols)>1)&&
(substr($cols[0],0,1) ne "!")&&($cols[1] lt "A"))
{
my $k = $types{shift(@cols)};
$list[$k] = NonBond(@cols) if ($k ne "");
}
if ($markers{$cols[0]} ne "") {
$read = ($markers{$cols[0]} eq "0") ? 1 : 0; }
}
$list[$types{HT}] = NonBond(0, -0.046, 0.2245)
if ($water_dens&&($list[$types{HT}] eq ""));
$list[$types{OT}] = NonBond(0, -0.152100, 1.768200)
if ($water_dens&&($list[$types{OT}] eq ""));
$list[$types{CLA}] = NonBond(0, -0.150, 2.27)
if ($ions&&($list[$types{CLA}] eq ""));
$list[$types{SOD}] = NonBond(0, -0.0469, 1.36375)
if ($ions&&($list[$types{SOD}] eq ""));
return @list;
}
sub BondedTypes # create bonded types
{
my $mode = shift(@_); # operation mode
my $items = (2, 3, 4, 4)[$mode]; # items per entry
my $id = (bonds, angles, dihedrals, impropers)[$mode];
my $n = PSFGoto($id);
my %list;
for (my $i=0; $i<$n; ++$i)
{
my @tmp = ();
foreach (PSFGet($items)) { push(@tmp, $ids{$atom_types[$_]}); }
++$list{CreateID(@tmp)};
}
++$list{CreateID(HT, OT)} if ($water_dens&&($mode==0));
++$list{CreateID(HT, OT, HT)} if ($water_dens&&($mode==1));
@types = sort(keys(%list));
}
sub Parameters # parms from columns
{
my $items = shift(@_);
my @cols = @_;
my $parms = "";
for (my $i=$items; ($i<scalar(@cols))&&(substr($cols[$i],0,1)ne"!"); ++$i)
{
$parms = $parms.($i>$items ? " " : "").$cols[$i];
}
return $parms;
}
sub BondedParameters # distil parms from
{ # <PARAMETERS>
my $mode = shift(@_); # bonded mode
return if (($mode>3)||($mode<0));
my $items = (2, 3, 4, 4)[$mode]; # items per entry
my $name = ("bond", "angle", "dihedral", "improper")[$mode];
my $read = 0;
my $k = 0;
my %markers = Markers();
my @set;
my @tmp;
my $f;
my %list;
my %link;
@parms = ();
foreach(@types) { $link{$_} = $k++; }
seek(PARAMETERS, 0, 0);
while (<PARAMETERS>)
{
chomp();
my @cols = split(" ");
if ($read&&(scalar(@cols)>$items)&&($cols[$items] lt "A"))
{
if (($items==4)&&(($f = ($cols[1] eq "X")&&($cols[2] eq "X"))||
(($cols[0] eq "X")&&($cols[3] eq "X")))) # wildcards
{
my $id = CreateID(($cols[1-$f], $cols[2+$f]));
for ($k=0; $k<scalar(@types); ++$k)
{
if (!$set[$k])
{
my @tmp = split(" ", $types[$k]);
if (CreateID($tmp[1-$f], $tmp[2+$f]) eq $id)
{
if ($mode==2)
{
if ($parms[$k] eq "") {
$parms[$k] = Parameters($items,@cols)." 1"; }
else {
$parms[$k] .= ":".Parameters($items,@cols)." 0"; }
}
else {
$parms[$k] .= Parameters($items,@cols); }
}
}
}
}
else # regular
{
for (my $i=0; $i<$items; ++$i) { $tmp[$i] = $cols[$i]; };
$k = $link{CreateID(@tmp)};
if ($k ne "")
{
$parms[$k] = "" if (!$set[$k]);
$parms[$k] .= ($set[$k]++ ? ":" : "").Parameters($items,@cols);
$parms[$k] .= ($set[$k]-1 ? " 0" : " 1") if ($mode==2);
}
}
}
if ($markers{$cols[0]}) {
$read = ($markers{$cols[0]} eq $mode+1) ? 1 : 0; }
}
if ($water_dens)
{
$parms[$link{CreateID(HT, OT)}] = "450 0.9572" if ($mode==0);
$parms[$link{CreateID(HT, OT, HT)}] = "55 104.52" if ($mode==1);
}
for (my $i=0; $i<scalar(@types); ++$i)
{
printf("Warning: %s parameter %4d for [%s] was not found\n",
$name, $i+1, $types[$i]) if ($parms[$i] eq "");
}
}
sub SetScreeningFactor # set screening factor
{
my $id = shift(@_);
my $value = shift(@_);
my $new = "";
foreach (split(":", $parms[$id]))
{
my @tmp = split(" ");
$tmp[-1] = $value if ($tmp[-1]);
$new .= ":" if ($new ne "");
$new .= join(" ", @tmp);
}
$parms[$id] = $new;
}
sub CorrectDihedralParameters
{
my $n = PSFGoto(dihedrals);
my %hash;
my $hash_id;
my $id1;
my $id2;
my $first;
my $last;
for (my $i=0; $i<$n; ++$i)
{
my @bonded = PSFGet(4);
my @tmp = ();
foreach (@bonded) { push(@tmp, $ids{$atom_types[$_]}); }
$id1 = $link{CreateID(@tmp)}-1;
$first = $bonded[0];
$last = $bonded[3];
if ($first>$last) { my $tmp = $first; $first = $last; $last = $tmp; }
if (($id2 = $hash{$hash_id = $first." ".$last}) eq "")
{
$hash{$hash_id} = $id1; # add id to hash
}
else
{
SetScreeningFactor($id1, 0.5); # 6-ring: shared 1-4
SetScreeningFactor($id2, 0.5);
}
}
$n = PSFGoto(angles);
for (my $i=0; $i<$n; ++$i)
{
my @bonded = PSFGet(3);
$first = $bonded[0];
$last = $bonded[2];
if ($first>$last) { my $tmp = $first; $first = $last; $last = $tmp; }
if (($id1 = $hash{$first." ".$last}) ne "")
{
SetScreeningFactor($id1, 0); # 5-ring: no 1-4
}
}
}
sub AddMass
{
my $symbol = shift(@_);
my $mass = shift(@_);
return if ($symbols{$symbol} ne "");
$ids{++$max_id} = $symbol;
$masses{$max_id} = $mass;
$symbols{$symbol} = $max_id;
}
sub ReadTopology # read topology links
{
my $id = shift(@_);
my $item = shift(@_);
my $read = 0;
my @tmp;
open(TOPOLOGY, "<top_$forcefield.rtf");
$max_id = 0;
while (<TOPOLOGY>)
{
chop(); # delete CR at end
my @tmp = split(" ");
$read = 1 if ($tmp[0] eq "MASS");
if ($read&&($tmp[0] eq "MASS"))
{
$symbols{$tmp[2]} = $tmp[1];
$ids{$tmp[1]} = $tmp[2];
$masses{$tmp[1]} = $tmp[3];
$max_id = $tmp[1] if ($max_id<$tmp[1]);
}
# $names{$tmp[1]} = $tmp[4] if ($read&&($tmp[0] eq "MASS"));
last if ($read&&!scalar(@tmp)); # quit reading
}
AddMass(HT, 1.00800);
AddMass(OT, 15.99940);
AddMass(CLA, 35.450000);
AddMass(SOD, 22.989770);
close(TOPOLOGY);
}
sub CrossLink # symbolic cross-links
{
my @list = @_;
my $n = scalar(@list);
my %hash;
for (my $i=0; $i<$n; ++$i) { $hash{$list[$i]} = $i+1; }
return %hash;
}
sub CharacterizeBox
{
my $flag = 1;
my @x = (-$L[0]/2, $L[0]/2);
my @y = (-$L[1]/2, $L[1]/2);
my @z = (-$L[2]/2, $L[2]/2);
my $n = CRDGoto(atoms);
my $extremes = !($L[0] && $L[1] && $L[2]);
@Center = (0, 0, 0);
return if (!$n);
for (my $i=0; $i<$n; ++$i)
{
my @tmp = $pdb ? NextPDB2CRD() : split(" ", <CRD>);
my @p = @tmp[-6, -5, -4];
@p = MV_Dot(@R, @p);
$x[0] = $p[0] if ($flag||($p[0]<$x[0]));
$x[1] = $p[0] if ($flag||($p[0]>$x[1]));
$y[0] = $p[1] if ($flag||($p[1]<$y[0]));
$y[1] = $p[1] if ($flag||($p[1]>$y[1]));
$z[0] = $p[2] if ($flag||($p[2]<$z[0]));
$z[1] = $p[2] if ($flag||($p[2]>$z[1]));
$flag = 0 if ($flag);
}
$L[0] = $x[1]-$x[0] if (!$L[0]);
$L[1] = $y[1]-$y[0] if (!$L[1]);
$L[2] = $z[1]-$z[0] if (!$L[2]);
$L[0] += $border;
$L[1] += $border;
$L[2] += $border;
@Center = (($x[1]+$x[0])/2, ($y[1]+$y[0])/2, ($z[1]+$z[0])/2);
printf("Info: recentering atoms\n") if ($info&&$center);
}
sub SetupWater
{
return if (!$water_dens);
my $dens = 1000*$water_dens; # kg/m^3
my $m = 0.018; # kg/mol
my $loh = 0.9572; # l[O-H] in [A]
my $s_OT = 1.7682; # CHARMM sigma [A]
my $ahoh = (180-104.52)/360*PI();
my @p = ($loh*cos($ahoh), $loh*sin($ahoh), 0);
printf("Info: creating fcc water\n") if ($info);
$n_water = 4; # molecules/cell
$nav = 6.022e23; # 1/mol
$v_water = $m/$nav/$dens*1e30; # water volume [A^3]
$r_water = $s_OT*2**(-1/6); # sigma_OT in [A]
@p_water = (0,0,0, @p, -$p[0],$p[1],0);
$v_fcc = $n_water*$v_water; # cell volume
$l_fcc = $v_fcc**(1/3); # cell length
@p_fcc = (0.00,0.00,0.00, 0.50,0.50,0.00,
0.50,0.00,0.50, 0.00,0.50,0.50);
@n_fcc = ();
for (my $i=0; $i<scalar(@L); ++$i)
{
my $n = $L[$i]/$l_fcc; # calculate n_fcc
$n = int($n-int($n) ? $n+1 : $n); # ceil($n)
$L[$i] = $n*$l_fcc; # adjust box length
printf("Info: changed l%s to %g A\n", ("x","y","z")[$i], $L[$i])
if ($info);
push(@n_fcc, $n);
}
foreach (@p_fcc) { $_ = ($_+0.25)*$l_fcc; } # p_fcc in [A]
for (my $x=0; $x<$n_fcc[0]; ++$x) { # initialize flags
for (my $y=0; $y<$n_fcc[1]; ++$y) {
for (my $z=0; $z<$n_fcc[2]; ++$z) {
$flags_fcc[$x][$y][$z] = 15; } } } # turn on all fcc sites
}
sub floor
{
my $x = shift(@_);
return $x>0 ? int($x) : int($x)-1;
}
sub Periodic
{
my @p = splice(@_, 0, 3);
return (
$p[0]-floor($p[0]/$L[0]+0.5)*$L[0],
$p[1]-floor($p[1]/$L[1]+0.5)*$L[1],
$p[2]-floor($p[2]/$L[2]+0.5)*$L[2]);
}
sub EraseWater
{
my $r = shift(@_)/2;
my @p = splice(@_, 0, 3);
@p = V_Subtr(@p, @Center) if (!$center);
my @edges = (
$p[0]-$r,$p[1]-$r,$p[2]-$r, $p[0]-$r,$p[1]-$r,$p[2]+$r,
$p[0]-$r,$p[1]+$r,$p[2]-$r, $p[0]-$r,$p[1]+$r,$p[2]+$r,
$p[0]+$r,$p[1]-$r,$p[2]-$r, $p[0]+$r,$p[1]-$r,$p[2]+$r,
$p[0]+$r,$p[1]+$r,$p[2]-$r, $p[0]+$r,$p[1]+$r,$p[2]+$r);
my %list;
my @n;
my $d2 = ($r_water+$r)**2;
my @l = ($L[0]/2, $L[1]/2, $L[2]/2);
for (my $i=0; $i<scalar(@edges); $i+=3) # determine candidates
{
my @q = Periodic(@edges[$i, $i+1, $i+2]);
my @n = (int(($q[0]+$l[0])/$l_fcc),int(($q[1]+$l[1])/$l_fcc),
int(($q[2]+$l[2])/$l_fcc));
++$list{join(" ", @n)};
}
foreach (sort(keys(%list))) # check overlap
{
my @n = split(" ");
my @corner = ($n[0]*$l_fcc-$l[0]+$p_water[0],
$n[1]*$l_fcc-$l[1]+$p_water[1],
$n[2]*$l_fcc-$l[2]+$p_water[2]);
my $bit = 1;
my $flags = 0;
for (my $i=0; $i<scalar(@p_fcc); $i+=3)
{
my @q = V_Add(@corner, @p_fcc[$i,$i+1,$i+2]);
my @dp = Periodic(V_Subtr(@q, @p));
$flags |= $bit if (V_Dot(@dp, @dp)>$d2); # turn on fcc
$bit *= 2;
}
$flags_fcc[$n[0]][$n[1]][$n[2]] &= $flags; # set flags
}
}
sub CountFCC
{
my $n = 0;
return $n_fccs = 0 if (!$water_dens);
for (my $x=0; $x<$n_fcc[0]; ++$x) { # count water
for (my $y=0; $y<$n_fcc[1]; ++$y) {
for (my $z=0; $z<$n_fcc[2]; ++$z) {
my $bit = 1;
my $flags = $flags_fcc[$x][$y][$z];
for (my $i=0; $i<$n_water; ++$i) {
++$n if ($flags & $bit);
$bit *= 2; } } } }
return ($n_fccs = $n);
}
sub AddIons
{
my $n = ($n_waters = CountFCC())-int(abs($net_charge));
return if (!$ions);
printf("Warning: charge not neutralized: too little water\n") if ($n<0);
return if ($n<0);
printf(
"Warning: charge not neutralized: net charge (%g) is not an integer\n",
$net_charge) if ($net_charge!=int($net_charge));
my $n_na = $net_charge<0 ? int(abs($net_charge)) : 0;
my $n_cl = $net_charge>0 ? int(abs($net_charge)) : 0;
my $n_mol = int($ion_molar*$n*$v_water*1e-27*$nav+0.5);
my $n_atoms = ($n_na += $n_mol)+($n_cl += $n_mol);
$n_waters -= $n_atoms;
printf(
"Info: adding ions: [NaCl] = %g mol/l (%d Na+, %d Cl-)\n",
$n_mol/$n/$v_water/$nav/1e-27, $n_na, $n_cl) if ($info);
$n += int(abs($net_charge));
my $salt = 2**$n_water;
srand(time()); # seed random number
for (my $x=0; $x<$n_fcc[0]; ++$x) # replace water by ions
{
for (my $y=0; $y<$n_fcc[1]; ++$y)
{
for (my $z=0; $z<$n_fcc[2]; ++$z)
{
my $bit = 1;
my $flags = $flags_fcc[$x][$y][$z];
for (my $i=0; $i<$n_water; ++$i)
{
if ($flags & $bit)
{
my $prob = $n_atoms/$n;
--$n;
if (rand()<$prob)
{
my $na = rand()<$n_na/$n_atoms ? 1 : 0;
--$n_atoms;
if ($na) { --$n_na; } else { --$n_cl; }
$flags |= $salt*(1+$salt*$na)*$bit; # set type of ion
}
};
$bit *= 2;
}
$flags_fcc[$x][$y][$z] = $flags;
}
}
}
}
# LAMMPS output
sub WriteLAMMPSHeader # print lammps header
{
printf(LAMMPS "Created by $program v$version on %s\n", `date`);
printf(LAMMPS "%12d atoms\n", $natoms);
printf(LAMMPS "%12d bonds\n", $nbonds);
printf(LAMMPS "%12d angles\n", $nangles);
printf(LAMMPS "%12d dihedrals\n", $ndihedrals);
printf(LAMMPS "%12d impropers\n\n", $nimpropers);
printf(LAMMPS "%12d atom types\n", $natom_types);
printf(LAMMPS "%12d bond types\n", $nbond_types);
printf(LAMMPS "%12d angle types\n", $nangle_types);
printf(LAMMPS "%12d dihedral types\n", $ndihedral_types);
printf(LAMMPS "%12d improper types\n\n", $nimproper_types);
}
sub WriteControlHeader
{
printf(PDB_CTRL "REMARK \n");
printf(PDB_CTRL "REMARK CONTROL PDB %s_ctrl.pdb\n", $project);
printf(PDB_CTRL "REMARK CREATED BY %s v%s ON %s",
$program, $version, `date`);
printf(PDB_CTRL "REMARK \n");
printf(PSF_CTRL "PSF\n");
printf(PSF_CTRL "\n");
printf(PSF_CTRL "%8d !NTITLE\n", 2);
printf(PSF_CTRL " REMARKS CONTROL PSF %s_ctrl.psf\n", $project);
printf(PSF_CTRL " REMARKS CREATED BY %s v%s ON %s",
$program, $version, `date`);
printf(PSF_CTRL "\n");
}
sub WriteBoxSize # print box limits
{
my @lo = V_Mult(@L[0,1,2], -1/2);
my @hi = V_Mult(@L[0,1,2], 1/2);
@lo = V_Add(@lo, @Center) if (!$center);
@hi = V_Add(@hi, @Center) if (!$center);
printf(LAMMPS "%12.8g %12.8g xlo xhi\n", $lo[0], $hi[0]);
printf(LAMMPS "%12.8g %12.8g ylo yhi\n", $lo[1], $hi[1]);
printf(LAMMPS "%12.8g %12.8g zlo zhi\n\n", $lo[2], $hi[2]);
}
sub WriteMasses # print mass list
{
my $k = 0;
printf(LAMMPS "Masses\n\n");
foreach (@types)
{
printf(LAMMPS "%8d %10.7g%s\n",
++$k, $masses{$_}, $add ? " # ".$ids{$_} : "");
}
printf(LAMMPS "\n");
}
sub WriteFCCAtoms
{
my $k = shift(@_);
my $res = shift(@_);
return $k if (!$water_dens);
$k_fcc = $k+1;
my @id = ($symbols{OT}, $symbols{HT}, $symbols{HT},
$symbols{SOD}, $symbols{CLA});
my @par = ();
my @charge = (-0.834, 0.417, 0.417, 1, -1);
my $salt = 2**$n_water;
my @l = ($L[0]/2, $L[1]/2, $L[2]/2);
my $iwater = 0;
my $isalt = 0;
foreach(@id) { push(@par, $link{$_}); }
for (my $x=0; $x<$n_fcc[0]; ++$x)
{
for (my $y=0; $y<$n_fcc[1]; ++$y)
{
for (my $z=0; $z<$n_fcc[2]; ++$z)
{
my @corner = ($x*$l_fcc-$l[0], $y*$l_fcc-$l[1], $z*$l_fcc-$l[2]);
my $flags = $flags_fcc[$x][$y][$z];
my $bit = 1;
for (my $i=0; $i<scalar(@p_fcc); $i+=3)
{
my $pair = $bit;
if ($flags & $pair)
{
my @p = V_Add(@corner, @p_fcc[$i,$i+1,$i+2]);
my $j = 0; # print water
my $n = scalar(@p_water);
++$res;
if ($flags & ($pair *= $salt)) # print salt ion
{ # sodium if highest
$j = $flags & ($pair*$salt) ? 3 : 4;
$n = 1;
$counter = ++$isalt;
}
else { $counter = ++$iwater; }
for (my $i=0; $i<$n; $i+=3)
{
my @xyz = V_Add(@p, @p_water[$i,$i+1,$i+2]);
@xyz = V_Add(@xyz, @Center) if (!$center);
printf(LAMMPS "%8d %7d %5d %9.6g %11.8g %11.8g %11.8g%s\n",
++$k, $res, $par[$j], $charge[$j], $xyz[0], $xyz[1],
$xyz[2], $add ? " # ".$types[$par[$j]-1] : "");
printf(PDB_CTRL "ATOM %6.6s %-4.4s %-3.3s %5.5s %3.3s ".
"%7.7s %7.7s %7.7s %5.5s %5.5s %4.4s %s\n", $k,
$types[$par[$j]-1], $n-1 ? "HOH" : "ION", $res, "",
$xyz[0], $xyz[1], $xyz[2], "1.00", "0.00", "",
$n-1 ? "WATR" : "SALT") if ($pdb_ctrl);
printf(PSF_CTRL "%8d %4.4s %-4.4s %-4.4s %-4.4s %4.4s ".
"%16.8e %7.7s %9.9s 0\n", $k, $n-1 ? "WATR" : "SALT",
$counter, $n-1 ? "HOH" : "ION", $types[$par[$j]-1], $id[$j],
$charge[$j], $masses{$id[$j]}, "") if ($pdb_ctrl);
++$j;
}
}
$bit *= 2;
}
}
}
}
return $k;
}
sub WritePSFAtoms()
{
my $n = PSFGoto(atoms);
my @res = (0, 0);
printf(PSF_CTRL "%8d !NATOM\n", $n+2*$n_waters+$n_fccs);
while (<PSF>)
{
last if (!$n--);
my @psf = split(" ");
if ($res[1]!=$psf[2]) { ++$res[0]; $res[1] = $psf[2]; }
printf(PSF_CTRL "%8d %4.4s %-4.4s %-4.4s %-4.4s %-4.4s ".
"%16.8e %7.7s %9.9s %s\n", $psf[0], $psf[1], $res[0],
$psf[3], $psf[4], $psf[5], $psf[6], $psf[7], "", $psf[8]);
}
}
sub WriteAtoms # print positions etc.
{
my $n = PSFGoto(atoms);
my $k = 0;
my @res = (0, 0);
CRDGoto(atoms);
$net_charge = 0;
printf(LAMMPS "Atoms\n\n") if ($n>0);
for (my $i=0; $i<$n; ++$i)
{
my @crd = $pdb ? NextPDB2CRD() : split(" ", <CRD>);
my @psf = split(" ", <PSF>);
my @xyz = MV_Dot(@R, @crd[-6, -5, -4]);
@xyz = V_Subtr(@xyz, @Center) if ($center);
if ($crd[-2]!=$res[1]) { ++$res[0]; $res[1] = $crd[-2]; }
printf(LAMMPS "%8d %7d %5d %9.6g %11.7g %11.7g %11.7g%s\n", ++$k,
$res[0], $link{$atom_types[$k]}, $psf[6], $xyz[0], $xyz[1], $xyz[2],
$add ? " # ".$types[$link{$atom_types[$k]}-1] : "");
printf(PDB_CTRL "ATOM %6.6s %-4.4s %-4.4s %4.4s %3.3s ".
"%7.7s %7.7s %7.7s %5.5s %5.5s %4.4s %s\n", $k,
$crd[-7], $crd[-8], $res[0], "", $xyz[0], $xyz[1], $xyz[2],
"1.00", $crd[-1], "", $crd[-3]) if ($pdb_ctrl);
next if (!$water_dens); # is water added?
$net_charge += $psf[6];
my @c = split(" ", $parms[$link{$atom_types[$k]}-1]);
EraseWater($c[1], @xyz);
}
$net_charge = int($net_charge*1e5+($net_charge>0?0.5:-0.5))/1e5;
AddIons() if ($water_dens);
WritePSFAtoms() if ($pdb_ctrl);
$k = WriteFCCAtoms($k, $res[0]+$res[1]);
printf(PDB_CTRL "END\n") if ($pdb_ctrl);
printf(LAMMPS "\n");
return $k;
}
sub WriteParameters # print parameters
{
my $mode = shift(@_)+1;
my $header = ("Pair","Bond","Angle","Dihedral","Improper")[$mode];
my $n = (4, 2, 4, 4, 2)[$mode];
my $k = 0;
printf("Info: converting ".lc($mode ? $header : "Atom")."s\n") if ($info);
if ($mode--)
{
BondedTypes($mode);
BondedParameters($mode);
%link = CrossLink(@types);
CorrectDihedralParameters() if ($mode==2);
@parms = Delete(1, @parms) if ($mode==3);
}
return 0 if (!scalar(@parms));
printf(LAMMPS "%s Coeffs\n\n", $header);
for (my $i=0; $i<scalar(@parms); ++$i)
{
if ($parms[$i] ne "")
{
foreach (split(":", $parms[$i]))
{
my @tmp = split(" ");
printf(LAMMPS "%8d", ++$k);
for (my $j=0; $j<$n; ++$j) {
printf(LAMMPS " %10.7g", $j<scalar(@tmp) ? $tmp[$j] : 0); }
printf(LAMMPS "%s\n", $add ? " # ".$types[$i] : "");
}
} else { ++$k; }
}
printf(LAMMPS "\n");
return $k;
}
sub WriteFCCBonded
{
my $mode = shift(@_);
my $k = shift(@_);
my $atom = $k_fcc;
return $k if (($mode>1)||!$water_dens);
my $type = $mode ? CreateID(HT, OT, HT) : CreateID(HT, OT);
my $id = $link{$type};
my $salt = 2**$n_water;
for (my $x=0; $x<$n_fcc[0]; ++$x)
{
for (my $y=0; $y<$n_fcc[1]; ++$y)
{
for (my $z=0; $z<$n_fcc[2]; ++$z)
{
my @corner = ($x*$l_fcc-$L[0]/2, $y*$l_fcc-$L[1]/2,
$z*$l_fcc-$L[2]/2);
my $flags = $flags_fcc[$x][$y][$z];
my $bit = 1;
for (my $i=0; $i<scalar(@p_fcc); $i+=3)
{
if ($flags&$bit)
{
if ($flags&($bit*$salt)) { ++$atom; }
else
{
printf(LAMMPS "%8d %7d %7d %7d%s\n", ++$k, $id, $atom,
$atom+1, $add ? " # ".$type : "") if (!$mode);
printf(LAMMPS "%8d %7d %7d %7d%s\n", ++$k, $id, $atom,
$atom+2, $add ? " # ".$type : "") if (!$mode);
printf(LAMMPS "%8d %7d %7d %7d %7d%s\n", ++$k, $id, $atom+1,
$atom, $atom+2, $add ? " # ".$type : "") if ($mode);
if ($pdb_ctrl)
{
PSFWrite(2, $atom, $atom+1, $atom, $atom+2) if (!$mode);
PSFWrite(3, $atom+1, $atom, $atom+2) if ($mode);
}
$atom += 3;
}
}
$bit *= 2;
}
}
}
}
return $k;
}
sub WriteBonded # print bonded list
{
my $mode = shift(@_);
my $psf_id = ("!NBOND:", "!NTHETA:", "!NPHI:", "!NIMPHI:")[$mode];
my $title = ("bonds", "angles", "dihedrals", "impropers")[$mode];
my $items = (2, 3, 4, 4)[$mode];
my $n = PSFGoto($title);
my $k = 0;
my @delta;
my @tmp;
return 0 if ($n<1);
printf(LAMMPS "%s\n\n", ucfirst($title));
printf(PSF_CTRL "\n%8d %s %s\n", $n+($mode ? ($mode==1 ? $n_waters : 0)
: 2*$n_waters), $psf_id, $title) if ($pdb_ctrl);
$psf_ncols = 0 if ($pdb_ctrl);
foreach (@parms)
{
push(@delta, $k);
$k += scalar(split(":"))-1 if ($_ ne "");
}
$k = 0;
for (my $i=0; $i<$n; ++$i)
{
my @bonded = PSFGet($items);
my @tmp = ();
foreach (@bonded) { push(@tmp, $ids{$atom_types[$_]}); }
my $id = $link{CreateID(@tmp)}-1;
my $m = 0;
if ($parms[$id] ne "")
{
foreach (split(":", $parms[$id]))
{
++$m;
my @const = split(" ");
next if (($const[0]==0)&&($mode==2 ? $const[-1]==0 : 1));
printf(LAMMPS "%8d %7d", ++$k, $id+$delta[$id]+$m);
foreach (@bonded) { printf(LAMMPS " %7d", $_); }
printf(LAMMPS "%s\n", $add ? " # ".CreateID(@tmp) : "");
}
}
else
{
printf(LAMMPS "%8d %7d", ++$k, $id+$delta[$id]+$m);
foreach (@bonded) { printf(LAMMPS " %7d", $_); }
printf(LAMMPS "%s\n", $add ? " # ".CreateID(@tmp) : "");
}
PSFWrite($items, @bonded) if ($pdb_ctrl);
}
$k = WriteFCCBonded($mode, $k);
printf(PSF_CTRL "\n") if ($pdb_ctrl && $psf_ncols);
printf(LAMMPS "\n");
return $k;
}
sub CreateCorrectedPairCoefficients
{
my $read = 0;
my $k = 0;
my %id;
my %type;
$coefficients = "";
foreach (@types) { $id{$ids{$_}} = $_; $type{$_} = ++$k; }
seek(PARAMETERS, 0, 0);
while (<PARAMETERS>)
{
chop();
my @cols = split(" ");
if ($read&&(scalar(@cols)>3)&&
(substr($cols[0],0,1) ne "!")&&($cols[2] lt 'A'))
{
my $id1 = $id{$cols[0]};
my $id2 = $id{$cols[1]};
if (($id1 ne "")&&($id2 ne ""))
{
my @c = (abs($cols[2]), $cols[3]*2.0**(-1/6));
if ($type{$id2}<$type{$id1})
{
my $tmp = $id1; $id1 = $id2; $id2 = $tmp;
}
$coefficients .= ":" if ($coefficients ne "");
$coefficients .= $type{$id1}." ".$type{$id2}." ";
$coefficients .= $c[0]." ".$c[1]." ".$c[0]." ".$c[1];
}
}
$read = 1 if ($cols[0] eq "NBFIX");
last if ($read&&!scalar(@cols));
}
}
sub WriteData
{
open(LAMMPS, ">$project.in"); # use .in for temporary
open(PDB_CTRL, ">".$project."_ctrl.pdb") if ($pdb_ctrl);
open(PSF_CTRL, ">".$project."_ctrl.psf") if ($pdb_ctrl);
WriteControlHeader() if ($pdb_ctrl);
ReadTopology();
CharacterizeBox();
SetupWater() if ($water_dens);
WriteBoxSize(); # body storage
@types = AtomTypes(); # atoms
@parms = AtomParameters(@types);
WriteMasses();
%link = CrossLink(@types);
CreateCorrectedPairCoefficients();
for (my $i=0; $i<scalar(@types); ++$i) { $types[$i] = $ids{$types[$i]}; }
$natom_types = WriteParameters(-1); # pairs
+ if ($#types != $natom_types) {
+ print "Warning: $#types atom types present, but only $natom_types pair coeffs found\n";
+ # reset to what is found while determining the number of atom types.
+ $natom_types = $#types;
+ }
$natoms = WriteAtoms();
$nbond_types = WriteParameters(0); # bonds
$nbonds = WriteBonded(0);
$nangle_types = WriteParameters(1); # angles
$nangles = WriteBonded(1);
$shake = $link{CreateID(("HT", "OT", "HT"))};
$ndihedral_types = WriteParameters(2); # dihedrals
$ndihedrals = WriteBonded(2);
$nimproper_types = WriteParameters(3); # impropers
$nimpropers = WriteBonded(3);
close(LAMMPS); # close temp file
open(LAMMPS, ">$project.data"); # open data file
WriteLAMMPSHeader(); # header
open(TMP, "<$project.in"); # open temp file
while (<TMP>) { printf(LAMMPS "%s", $_); } # spool body
close(TMP); # close temp file
if ($pdb_ctrl)
{
#while (<PSF>) { printf(PSF_CTRL "%s", $_); }
close(PSF_CTRL); close(PDB_CTRL);
}
close(LAMMPS); # close data file
}
sub WriteLAMMPSInput
{
open(LAMMPS, ">$project.in"); # input file
printf(LAMMPS "# Created by $program v$version on %s\n", `date`);
printf(LAMMPS "units real\n"); # general
printf(LAMMPS "neigh_modify delay 2 every 1\n\n");
printf(LAMMPS "atom_style full\n"); # styles
printf(LAMMPS "bond_style harmonic\n") if ($nbond_types);
printf(LAMMPS "angle_style charmm\n") if ($nangle_types);
printf(LAMMPS "dihedral_style charmm\n") if ($ndihedral_types);
printf(LAMMPS "improper_style harmonic\n\n") if ($nimproper_types);
printf(LAMMPS "pair_style lj/charmm/coul/long 8 10\n");
printf(LAMMPS "pair_modify mix arithmetic\n");
printf(LAMMPS "kspace_style pppm 1e-4\n\n");
printf(LAMMPS "read_data $project.data\n\n"); # read data
if ($coefficients ne "") # corrected coeffs
{
foreach (split(":", $coefficients))
{
printf(LAMMPS "pair_coeff %s\n", $_);
}
printf(LAMMPS "\n");
}
printf(LAMMPS "special_bonds charmm\n"); # invoke charmm
printf(LAMMPS "fix 1 all nve\n");
printf(LAMMPS "fix 2 all shake 1e-6 500 0 m 1.0\n")
if ($shake eq ""); # shake all H-bonds
printf(LAMMPS "fix 2 all shake 1e-6 500 0 m 1.0 a %s\n",$shake)
if ($shake ne ""); # add water if present
printf(LAMMPS "velocity all create 0.0 12345678 dist uniform\n\n");
printf(LAMMPS "thermo 1\n"); # set thermo style
printf(LAMMPS "thermo_style multi\n");
printf(LAMMPS "timestep 0.5\n\n"); # 0.5 ps time step
printf(LAMMPS "restart 10 $project.restart1 $project.restart2\n");
printf(LAMMPS "dump 1 all atom 10 $project.dump\n");
printf(LAMMPS "dump_modify 1 image yes scale yes\n\n");
printf(LAMMPS "run 20\n"); # run for 20 time steps
close(LAMMPS);
}
# main
Initialize();
WriteData();
WriteLAMMPSInput();
printf("Info: conversion complete\n\n") if ($info);
diff --git a/tools/msi2lmp/test/pmma-poly-class2c.car b/tools/msi2lmp/test/pmma-poly-class2c.car
new file mode 100644
index 000000000..594337438
--- /dev/null
+++ b/tools/msi2lmp/test/pmma-poly-class2c.car
@@ -0,0 +1,158 @@
+!BIOSYM archive 3
+PBC=OFF
+Materials Studio Generated CAR File
+!DATE Sun Jan 03 19:12:49 2016
+C1 -0.633418 3.634698 -0.520447 C5H9 1 c C 0.000
+C2 -1.681078 4.738564 -0.675925 C5H9 1 c3 C -0.159
+C3 -1.387493 2.511538 0.201451 C5H9 1 c_1 C 0.266
+O1 -0.833117 2.333802 1.415262 C5H9 1 o_2 O -0.266
+C4 -1.417542 1.295223 2.194265 C5H9 1 c3 C -0.026
+H1 -2.476360 1.527665 2.374308 C5H9 1 hc H 0.053
+H2 -2.531181 4.392408 -1.284049 C5H9 1 hc H 0.053
+H3 -0.886560 1.228488 3.153585 C5H9 1 hc H 0.053
+H4 -1.228588 5.610202 -1.173631 C5H9 1 hc H 0.053
+H5 -2.070284 5.062610 0.301509 C5H9 1 hc H 0.053
+H6 -1.325591 0.341689 1.655498 C5H9 1 hc H 0.053
+C5 0.512831 4.150735 0.351569 C5H9 1 c3 C -0.159
+H7 1.055972 4.940079 -0.192088 C5H9 1 hc H 0.053
+H8 1.238964 3.371721 0.627844 C5H9 1 hc H 0.053
+H9 0.117814 4.600272 1.276936 C5H9 1 hc H 0.053
+O2 -2.322596 1.880616 -0.204263 C5H9 1 o_1 O -0.133
+C1 0.804693 2.145964 -2.336744 C5H8 2 c C 0.000
+C2 -0.294421 3.170838 -1.953678 C5H8 2 c2 C -0.106
+C3 2.138571 2.832879 -2.103460 C5H8 2 c_1 C 0.266
+O1 2.372145 3.671394 -3.131947 C5H8 2 o_2 O -0.266
+C4 3.602748 4.383361 -3.054350 C5H8 2 c3 C -0.026
+H1 3.610506 4.998838 -2.143924 C5H8 2 hc H 0.053
+H2 3.694800 5.030836 -3.937109 C5H8 2 hc H 0.053
+H3 -1.235915 2.773341 -2.374311 C5H8 2 hc H 0.053
+H4 -0.081285 4.091302 -2.526023 C5H8 2 hc H 0.053
+H5 4.436044 3.667105 -3.035015 C5H8 2 hc H 0.053
+C5 0.611666 1.991584 -3.851496 C5H8 2 c3 C -0.159
+H6 -0.289273 1.387825 -4.043900 C5H8 2 hc H 0.053
+H7 1.463121 1.506181 -4.351096 C5H8 2 hc H 0.053
+H8 0.447238 2.968089 -4.333583 C5H8 2 hc H 0.053
+O2 2.890594 2.696257 -1.179564 C5H8 2 o_1 O -0.133
+C1 1.397177 -0.496953 -1.800162 C5H8 3 c C 0.000
+C2 0.691539 0.852868 -1.495129 C5H8 3 c2 C -0.106
+C3 0.695638 -1.078791 -3.017470 C5H8 3 c_1 C 0.266
+O1 -0.433002 -1.685271 -2.599657 C5H8 3 o_2 O -0.266
+C4 -1.200644 -2.295669 -3.631502 C5H8 3 c3 C -0.026
+H1 -1.507749 -1.530598 -4.358027 C5H8 3 hc H 0.053
+H2 -2.091554 -2.757962 -3.184979 C5H8 3 hc H 0.053
+H3 0.980971 1.115979 -0.462722 C5H8 3 hc H 0.053
+H4 -0.384900 0.614574 -1.458910 C5H8 3 hc H 0.053
+H5 -0.594468 -3.067094 -4.126610 C5H8 3 hc H 0.053
+C5 1.017164 -1.351769 -0.581861 C5H8 3 c3 C -0.159
+H6 1.624485 -1.039640 0.282512 C5H8 3 hc H 0.053
+H7 1.174800 -2.428888 -0.737066 C5H8 3 hc H 0.053
+H8 -0.036762 -1.199383 -0.300261 C5H8 3 hc H 0.053
+O2 1.027390 -1.028862 -4.168218 C5H8 3 o_1 O -0.133
+C1 3.966949 -1.439368 -2.191285 C5H8 4 c C 0.000
+C2 2.913413 -0.313606 -2.028563 C5H8 4 c2 C -0.106
+C3 3.989592 -2.240375 -0.907672 C5H8 4 c_1 C 0.266
+O1 4.599493 -1.508560 0.045550 C5H8 4 o_2 O -0.266
+C4 4.686298 -2.139943 1.318815 C5H8 4 c3 C -0.026
+H1 3.673589 -2.349798 1.690021 C5H8 4 hc H 0.053
+H2 5.200688 -1.464754 2.016189 C5H8 4 hc H 0.053
+H3 3.037439 0.331225 -2.915449 C5H8 4 hc H 0.053
+H4 3.252029 0.280214 -1.163342 C5H8 4 hc H 0.053
+H5 5.255838 -3.074913 1.223300 C5H8 4 hc H 0.053
+C5 5.282529 -0.651603 -2.269945 C5H8 4 c3 C -0.159
+H6 5.346025 -0.148371 -3.247479 C5H8 4 hc H 0.053
+H7 6.171959 -1.287625 -2.151011 C5H8 4 hc H 0.053
+H8 5.331038 0.138310 -1.504257 C5H8 4 hc H 0.053
+O2 3.545053 -3.337606 -0.715715 C5H8 4 o_1 O -0.133
+C1 4.620833 -3.326693 -4.109533 C5H8 5 c C 0.000
+C2 3.652503 -2.337506 -3.407769 C5H8 5 c2 C -0.106
+C3 5.653604 -2.472614 -4.831647 C5H8 5 c_1 C 0.266
+O1 5.111475 -2.022075 -5.980401 C5H8 5 o_2 O -0.266
+C4 5.971771 -1.203306 -6.765481 C5H8 5 c3 C -0.026
+H1 6.260026 -0.316003 -6.184475 C5H8 5 hc H 0.053
+H2 5.435290 -0.890960 -7.671954 C5H8 5 hc H 0.053
+H3 2.753672 -2.924820 -3.151292 C5H8 5 hc H 0.053
+H4 3.352208 -1.638604 -4.206128 C5H8 5 hc H 0.053
+H5 6.864808 -1.779197 -7.046079 C5H8 5 hc H 0.053
+C5 3.708002 -3.959156 -5.169887 C5H8 5 c3 C -0.159
+H6 3.031714 -4.679313 -4.682555 C5H8 5 hc H 0.053
+H7 4.256861 -4.488719 -5.962328 C5H8 5 hc H 0.053
+H8 3.068976 -3.201001 -5.649870 C5H8 5 hc H 0.053
+O2 6.768331 -2.204430 -4.480250 C5H8 5 o_1 O -0.133
+C1 6.093263 -5.587913 -3.560636 C5H8 6 c C 0.000
+C2 5.308751 -4.312834 -3.138300 C5H8 6 c2 C -0.106
+C3 5.049508 -6.603485 -4.003777 C5H8 6 c_1 C 0.266
+O1 4.554427 -7.203560 -2.902940 C5H8 6 o_2 O -0.266
+C4 3.562981 -8.192962 -3.156902 C5H8 6 c3 C -0.026
+H1 2.705493 -7.727344 -3.662190 C5H8 6 hc H 0.053
+H2 3.237173 -8.622824 -2.199861 C5H8 6 hc H 0.053
+H3 5.995489 -3.722546 -2.507421 C5H8 6 hc H 0.053
+H4 4.514555 -4.679531 -2.467788 C5H8 6 hc H 0.053
+H5 3.991532 -8.983665 -3.788604 C5H8 6 hc H 0.053
+C5 6.684506 -6.073042 -2.229026 C5H8 6 c3 C -0.159
+H6 7.545290 -5.439783 -1.961956 C5H8 6 hc H 0.053
+H7 7.027618 -7.117413 -2.257204 C5H8 6 hc H 0.053
+H8 5.953601 -5.976673 -1.410522 C5H8 6 hc H 0.053
+O2 4.679701 -6.860981 -5.114546 C5H8 6 o_1 O -0.133
+C1 8.191866 -6.276687 -5.226719 C5H8 7 c C 0.000
+C2 7.125233 -5.298659 -4.672132 C5H8 7 c2 C -0.106
+C3 9.135855 -6.617834 -4.092568 C5H8 7 c_1 C 0.266
+O1 9.934906 -5.557047 -3.864645 C5H8 7 o_2 O -0.266
+C4 10.892382 -5.742399 -2.827400 C5H8 7 c3 C -0.026
+H1 11.553396 -6.580327 -3.089232 C5H8 7 hc H 0.053
+H2 10.370519 -5.952330 -1.883435 C5H8 7 hc H 0.053
+H3 6.567923 -4.948063 -5.557544 C5H8 7 hc H 0.053
+H4 7.696444 -4.433111 -4.298730 C5H8 7 hc H 0.053
+H5 11.485685 -4.823608 -2.723420 C5H8 7 hc H 0.053
+C5 8.957459 -5.391017 -6.221052 C5H8 7 c3 C -0.159
+H6 8.333050 -5.226114 -7.113266 C5H8 7 hc H 0.053
+H7 9.910684 -5.832380 -6.545212 C5H8 7 hc H 0.053
+H8 9.175643 -4.397358 -5.799012 C5H8 7 hc H 0.053
+O2 9.199344 -7.640210 -3.468747 C5H8 7 o_1 O -0.133
+C1 8.262760 -8.564497 -6.769855 C5H8 8 c C 0.000
+C2 7.556560 -7.548515 -5.830486 C5H8 8 c2 C -0.106
+C3 8.456504 -7.871008 -8.103271 C5H8 8 c_1 C 0.266
+O1 7.266992 -7.835138 -8.736810 C5H8 8 o_2 O -0.266
+C4 7.283962 -7.192355 -10.006775 C5H8 8 c3 C -0.026
+H1 6.270957 -7.218684 -10.431104 C5H8 8 hc H 0.053
+H2 7.976685 -7.723474 -10.674386 C5H8 8 hc H 0.053
+H3 7.154862 -8.142299 -4.991093 C5H8 8 hc H 0.053
+H4 6.685583 -7.189461 -6.402577 C5H8 8 hc H 0.053
+H5 7.603477 -6.148355 -9.881849 C5H8 8 hc H 0.053
+C5 7.166774 -9.625239 -6.960353 C5H8 8 c3 C -0.159
+H6 7.098119 -10.241527 -6.050359 C5H8 8 hc H 0.053
+H7 7.344500 -10.294304 -7.814393 C5H8 8 hc H 0.053
+H8 6.177875 -9.159550 -7.097847 C5H8 8 hc H 0.053
+O2 9.457828 -7.401923 -8.564177 C5H8 8 o_1 O -0.133
+C1 10.528174 -10.165533 -6.728540 C5H8 9 c C 0.000
+C2 9.586302 -9.079899 -6.157574 C5H8 9 c2 C -0.106
+C3 9.693571 -11.386060 -7.060668 C5H8 9 c_1 C 0.266
+O1 9.222904 -11.936493 -5.924360 C5H8 9 o_2 O -0.266
+C4 8.442799 -13.113503 -6.108579 C5H8 9 c3 C -0.026
+H1 8.109656 -13.475726 -5.126573 C5H8 9 hc H 0.053
+H2 9.056854 -13.883047 -6.596524 C5H8 9 hc H 0.053
+H3 10.218024 -8.201376 -5.957354 C5H8 9 hc H 0.053
+H4 9.284047 -9.466335 -5.169165 C5H8 9 hc H 0.053
+H5 7.568042 -12.877858 -6.730325 C5H8 9 hc H 0.053
+C5 11.397504 -10.560489 -5.522103 C5H8 9 c3 C -0.159
+H6 12.053299 -9.720169 -5.250118 C5H8 9 hc H 0.053
+H7 12.029275 -11.435398 -5.737741 C5H8 9 hc H 0.053
+H8 10.802796 -10.790915 -4.624592 C5H8 9 hc H 0.053
+O2 9.465161 -11.823378 -8.154997 C5H8 9 o_1 O -0.133
+H1 12.889411 -8.809349 -9.008053 C5H9 10 hc H 0.053
+C1 12.617346 -8.953444 -7.946761 C5H9 10 c1 C -0.053
+C2 11.358317 -9.861743 -7.993068 C5H9 10 c2 C -0.106
+C3 13.813210 -9.651723 -7.309744 C5H9 10 c_1 C 0.266
+O1 13.878794 -10.934779 -7.716185 C5H9 10 o_2 O -0.266
+C4 14.959498 -11.682905 -7.168796 C5H9 10 c3 C -0.026
+H2 14.919297 -12.707115 -7.564129 C5H9 10 hc H 0.053
+H3 14.866795 -11.707441 -6.074044 C5H9 10 hc H 0.053
+H4 11.681983 -10.834435 -8.402314 C5H9 10 hc H 0.053
+H5 10.693673 -9.457714 -8.772422 C5H9 10 hc H 0.053
+H6 15.910415 -11.213947 -7.457781 C5H9 10 hc H 0.053
+C5 12.527455 -7.566814 -7.315882 C5H9 10 c3 C -0.159
+H7 11.733374 -6.969615 -7.782074 C5H9 10 hc H 0.053
+H8 13.478407 -7.035564 -7.479820 C5H9 10 hc H 0.053
+H9 12.347673 -7.613591 -6.232621 C5H9 10 hc H 0.053
+O2 14.596719 -9.153044 -6.549874 C5H9 10 o_1 O -0.133
+end
+end
diff --git a/tools/msi2lmp/test/pmma-poly-class2c.mdf b/tools/msi2lmp/test/pmma-poly-class2c.mdf
new file mode 100644
index 000000000..878a16c18
--- /dev/null
+++ b/tools/msi2lmp/test/pmma-poly-class2c.mdf
@@ -0,0 +1,191 @@
+!BIOSYM molecular_data 4
+
+!Date: Sun Jan 03 19:12:49 2016 Materials Studio Generated MDF file
+
+#topology
+
+@column 1 element
+@column 2 atom_type
+@column 3 charge_group
+@column 4 isotope
+@column 5 formal_charge
+@column 6 charge
+@column 7 switching_atom
+@column 8 oop_flag
+@column 9 chirality_flag
+@column 10 occupancy
+@column 11 xray_temp_factor
+@column 12 connections
+
+@molecule Polypmma
+
+C5H9_1:C1 C c ? 0 0 0.0000 0 0 8 1.0000 0.0000 C3 C2 C5 C5H8_2:C2
+C5H9_1:C2 C c3 ? 0 0 -0.1590 0 0 8 1.0000 0.0000 H2 H4 H5 C1
+C5H9_1:C3 C c_1 ? 0 0 0.2660 0 0 8 1.0000 0.0000 C1 O1 O2
+C5H9_1:O1 O o_2 ? 0 0 -0.2660 0 0 8 1.0000 0.0000 C3 C4
+C5H9_1:C4 C c3 ? 0 0 -0.0260 0 0 8 1.0000 0.0000 O1 H1 H3 H6
+C5H9_1:H1 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H9_1:H2 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H9_1:H3 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H9_1:H4 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H9_1:H5 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H9_1:H6 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H9_1:C5 C c3 ? 0 0 -0.1590 0 0 8 1.0000 0.0000 H7 H8 H9 C1
+C5H9_1:H7 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H9_1:H8 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H9_1:H9 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H9_1:O2 O o_1 ? 0 1- -0.1330 0 0 8 1.0000 0.0000 C3
+C5H8_2:C1 C c ? 0 0 0.0000 0 0 8 1.0000 0.0000 C3 C2 C5 C5H8_3:C2
+C5H8_2:C2 C c2 ? 0 0 -0.1060 0 0 8 1.0000 0.0000 H3 H4 C1 C5H9_1:C1
+C5H8_2:C3 C c_1 ? 0 0 0.2660 0 0 8 1.0000 0.0000 C1 O1 O2
+C5H8_2:O1 O o_2 ? 0 0 -0.2660 0 0 8 1.0000 0.0000 C3 C4
+C5H8_2:C4 C c3 ? 0 0 -0.0260 0 0 8 1.0000 0.0000 O1 H1 H2 H5
+C5H8_2:H1 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_2:H2 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_2:H3 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_2:H4 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_2:H5 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_2:C5 C c3 ? 0 0 -0.1590 0 0 8 1.0000 0.0000 H6 H7 H8 C1
+C5H8_2:H6 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_2:H7 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_2:H8 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_2:O2 O o_1 ? 0 1- -0.1330 0 0 8 1.0000 0.0000 C3
+C5H8_3:C1 C c ? 0 0 0.0000 0 0 8 1.0000 0.0000 C3 C2 C5 C5H8_4:C2
+C5H8_3:C2 C c2 ? 0 0 -0.1060 0 0 8 1.0000 0.0000 H3 H4 C1 C5H8_2:C1
+C5H8_3:C3 C c_1 ? 0 0 0.2660 0 0 8 1.0000 0.0000 C1 O1 O2
+C5H8_3:O1 O o_2 ? 0 0 -0.2660 0 0 8 1.0000 0.0000 C3 C4
+C5H8_3:C4 C c3 ? 0 0 -0.0260 0 0 8 1.0000 0.0000 O1 H1 H2 H5
+C5H8_3:H1 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_3:H2 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_3:H3 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_3:H4 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_3:H5 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_3:C5 C c3 ? 0 0 -0.1590 0 0 8 1.0000 0.0000 H6 H7 H8 C1
+C5H8_3:H6 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_3:H7 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_3:H8 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_3:O2 O o_1 ? 0 1- -0.1330 0 0 8 1.0000 0.0000 C3
+C5H8_4:C1 C c ? 0 0 0.0000 0 0 8 1.0000 0.0000 C3 C2 C5 C5H8_5:C2
+C5H8_4:C2 C c2 ? 0 0 -0.1060 0 0 8 1.0000 0.0000 H3 H4 C1 C5H8_3:C1
+C5H8_4:C3 C c_1 ? 0 0 0.2660 0 0 8 1.0000 0.0000 C1 O1 O2
+C5H8_4:O1 O o_2 ? 0 0 -0.2660 0 0 8 1.0000 0.0000 C3 C4
+C5H8_4:C4 C c3 ? 0 0 -0.0260 0 0 8 1.0000 0.0000 O1 H1 H2 H5
+C5H8_4:H1 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_4:H2 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_4:H3 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_4:H4 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_4:H5 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_4:C5 C c3 ? 0 0 -0.1590 0 0 8 1.0000 0.0000 H6 H7 H8 C1
+C5H8_4:H6 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_4:H7 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_4:H8 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_4:O2 O o_1 ? 0 1- -0.1330 0 0 8 1.0000 0.0000 C3
+C5H8_5:C1 C c ? 0 0 0.0000 0 0 8 1.0000 0.0000 C3 C2 C5 C5H8_6:C2
+C5H8_5:C2 C c2 ? 0 0 -0.1060 0 0 8 1.0000 0.0000 H3 H4 C1 C5H8_4:C1
+C5H8_5:C3 C c_1 ? 0 0 0.2660 0 0 8 1.0000 0.0000 C1 O1 O2
+C5H8_5:O1 O o_2 ? 0 0 -0.2660 0 0 8 1.0000 0.0000 C3 C4
+C5H8_5:C4 C c3 ? 0 0 -0.0260 0 0 8 1.0000 0.0000 O1 H1 H2 H5
+C5H8_5:H1 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_5:H2 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_5:H3 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_5:H4 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_5:H5 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_5:C5 C c3 ? 0 0 -0.1590 0 0 8 1.0000 0.0000 H6 H7 H8 C1
+C5H8_5:H6 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_5:H7 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_5:H8 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_5:O2 O o_1 ? 0 1- -0.1330 0 0 8 1.0000 0.0000 C3
+C5H8_6:C1 C c ? 0 0 0.0000 0 0 8 1.0000 0.0000 C3 C2 C5 C5H8_7:C2
+C5H8_6:C2 C c2 ? 0 0 -0.1060 0 0 8 1.0000 0.0000 H3 H4 C1 C5H8_5:C1
+C5H8_6:C3 C c_1 ? 0 0 0.2660 0 0 8 1.0000 0.0000 C1 O1 O2
+C5H8_6:O1 O o_2 ? 0 0 -0.2660 0 0 8 1.0000 0.0000 C3 C4
+C5H8_6:C4 C c3 ? 0 0 -0.0260 0 0 8 1.0000 0.0000 O1 H1 H2 H5
+C5H8_6:H1 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_6:H2 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_6:H3 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_6:H4 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_6:H5 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_6:C5 C c3 ? 0 0 -0.1590 0 0 8 1.0000 0.0000 H6 H7 H8 C1
+C5H8_6:H6 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_6:H7 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_6:H8 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_6:O2 O o_1 ? 0 1- -0.1330 0 0 8 1.0000 0.0000 C3
+C5H8_7:C1 C c ? 0 0 0.0000 0 0 8 1.0000 0.0000 C3 C2 C5 C5H8_8:C2
+C5H8_7:C2 C c2 ? 0 0 -0.1060 0 0 8 1.0000 0.0000 H3 H4 C1 C5H8_6:C1
+C5H8_7:C3 C c_1 ? 0 0 0.2660 0 0 8 1.0000 0.0000 C1 O1 O2
+C5H8_7:O1 O o_2 ? 0 0 -0.2660 0 0 8 1.0000 0.0000 C3 C4
+C5H8_7:C4 C c3 ? 0 0 -0.0260 0 0 8 1.0000 0.0000 O1 H1 H2 H5
+C5H8_7:H1 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_7:H2 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_7:H3 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_7:H4 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_7:H5 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_7:C5 C c3 ? 0 0 -0.1590 0 0 8 1.0000 0.0000 H6 H7 H8 C1
+C5H8_7:H6 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_7:H7 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_7:H8 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_7:O2 O o_1 ? 0 1- -0.1330 0 0 8 1.0000 0.0000 C3
+C5H8_8:C1 C c ? 0 0 0.0000 0 0 8 1.0000 0.0000 C3 C2 C5 C5H8_9:C2
+C5H8_8:C2 C c2 ? 0 0 -0.1060 0 0 8 1.0000 0.0000 H3 H4 C1 C5H8_7:C1
+C5H8_8:C3 C c_1 ? 0 0 0.2660 0 0 8 1.0000 0.0000 C1 O1 O2
+C5H8_8:O1 O o_2 ? 0 0 -0.2660 0 0 8 1.0000 0.0000 C3 C4
+C5H8_8:C4 C c3 ? 0 0 -0.0260 0 0 8 1.0000 0.0000 O1 H1 H2 H5
+C5H8_8:H1 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_8:H2 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_8:H3 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_8:H4 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_8:H5 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_8:C5 C c3 ? 0 0 -0.1590 0 0 8 1.0000 0.0000 H6 H7 H8 C1
+C5H8_8:H6 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_8:H7 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_8:H8 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_8:O2 O o_1 ? 0 1- -0.1330 0 0 8 1.0000 0.0000 C3
+C5H8_9:C1 C c ? 0 0 0.0000 0 0 8 1.0000 0.0000 C3 C2 C5 C5H9_10:C2
+C5H8_9:C2 C c2 ? 0 0 -0.1060 0 0 8 1.0000 0.0000 H3 H4 C1 C5H8_8:C1
+C5H8_9:C3 C c_1 ? 0 0 0.2660 0 0 8 1.0000 0.0000 C1 O1 O2
+C5H8_9:O1 O o_2 ? 0 0 -0.2660 0 0 8 1.0000 0.0000 C3 C4
+C5H8_9:C4 C c3 ? 0 0 -0.0260 0 0 8 1.0000 0.0000 O1 H1 H2 H5
+C5H8_9:H1 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_9:H2 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_9:H3 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_9:H4 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H8_9:H5 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H8_9:C5 C c3 ? 0 0 -0.1590 0 0 8 1.0000 0.0000 H6 H7 H8 C1
+C5H8_9:H6 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_9:H7 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_9:H8 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H8_9:O2 O o_1 ? 0 1- -0.1330 0 0 8 1.0000 0.0000 C3
+C5H9_10:H1 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C1
+C5H9_10:C1 C c1 ? 0 0 -0.0530 0 0 8 1.0000 0.0000 H1 C3 C2 C5
+C5H9_10:C2 C c2 ? 0 0 -0.1060 0 0 8 1.0000 0.0000 H4 H5 C1 C5H8_9:C1
+C5H9_10:C3 C c_1 ? 0 0 0.2660 0 0 8 1.0000 0.0000 C1 O1 O2
+C5H9_10:O1 O o_2 ? 0 0 -0.2660 0 0 8 1.0000 0.0000 C3 C4
+C5H9_10:C4 C c3 ? 0 0 -0.0260 0 0 8 1.0000 0.0000 O1 H2 H3 H6
+C5H9_10:H2 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H9_10:H3 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H9_10:H4 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H9_10:H5 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C2
+C5H9_10:H6 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C4
+C5H9_10:C5 C c3 ? 0 0 -0.1590 0 0 8 1.0000 0.0000 H7 H8 H9 C1
+C5H9_10:H7 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H9_10:H8 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H9_10:H9 H hc ? 0 0 0.0530 0 0 8 1.0000 0.0000 C5
+C5H9_10:O2 O o_1 ? 0 1- -0.1330 0 0 8 1.0000 0.0000 C3
+
+
+#atomset
+
+@list backbone Polypmma
+
+Polypmma:C5H9_1:H2 C2 C1
+C5H8_2:C2 C1
+C5H8_3:C2 C1
+C5H8_4:C2 C1
+C5H8_5:C2 C1
+C5H8_6:C2 C1
+C5H8_7:C2 C1
+C5H8_8:C2 C1
+C5H8_9:C2 C1
+C5H9_10:C2 C1 H1
+
+#end
diff --git a/tools/msi2lmp/test/reference/pmma-poly-class2c.data b/tools/msi2lmp/test/reference/pmma-poly-class2c.data
new file mode 100644
index 000000000..957b6d24d
--- /dev/null
+++ b/tools/msi2lmp/test/reference/pmma-poly-class2c.data
@@ -0,0 +1,1553 @@
+LAMMPS data file. msi2lmp v3.9.7 / 24 Oct 2015 / CGCMM for pmma-poly-class2c
+
+ 152 atoms
+ 151 bonds
+ 280 angles
+ 371 dihedrals
+ 170 impropers
+
+ 8 atom types
+ 12 bond types
+ 26 angle types
+ 35 dihedral types
+ 19 improper types
+
+ -3.031181000 16.410415000 xlo xhi
+ -14.383047000 6.110202000 ylo yhi
+ -11.174386000 3.653585000 zlo zhi
+
+Masses
+
+ 1 12.011150 # c
+ 2 12.011150 # c3
+ 3 12.011150 # c_1
+ 4 15.999400 # o_2
+ 5 1.007970 # hc
+ 6 15.999400 # o_1
+ 7 12.011150 # c2
+ 8 12.011150 # c1
+
+Pair Coeffs # lj/class2/coul/long
+
+ 1 0.0540000000 4.0100000000 # c
+ 2 0.0540000000 4.0100000000 # c3
+ 3 0.1200000000 3.8100000000 # c_1
+ 4 0.2400000000 3.4200000000 # o_2
+ 5 0.0200000000 2.9950000000 # hc
+ 6 0.2670000000 3.3000000000 # o_1
+ 7 0.0540000000 4.0100000000 # c2
+ 8 0.0540000000 4.0100000000 # c1
+
+Bond Coeffs # class2
+
+ 1 1.5202 253.7067 -423.0370 396.9000 # c-c_1
+ 2 1.5300 299.6700 -501.7700 679.8100 # c-c3
+ 3 1.5300 299.6700 -501.7700 679.8100 # c-c2
+ 4 1.1010 345.0000 -691.8900 844.6000 # c3-hc
+ 5 1.3683 367.1481 -794.7908 1055.2319 # c_1-o_2
+ 6 1.2020 851.1403 -1918.4882 2160.7659 # c_1-o_1
+ 7 1.4300 326.7273 -608.5306 689.0333 # c3-o_2
+ 8 1.1010 345.0000 -691.8900 844.6000 # hc-c2
+ 9 1.1010 345.0000 -691.8900 844.6000 # hc-c1
+ 10 1.5202 253.7067 -423.0370 396.9000 # c_1-c1
+ 11 1.5300 299.6700 -501.7700 679.8100 # c2-c1
+ 12 1.5300 299.6700 -501.7700 679.8100 # c3-c1
+
+Angle Coeffs # class2
+
+ 1 108.5295 51.9747 -9.4851 -10.9985 # c3-c-c_1
+ 2 108.5295 51.9747 -9.4851 -10.9985 # c_1-c-c2
+ 3 112.6700 39.5160 -7.4430 -9.5583 # c3-c-c3
+ 4 112.6700 39.5160 -7.4430 -9.5583 # c3-c-c2
+ 5 107.6600 39.6410 -12.9210 -2.4318 # hc-c3-hc
+ 6 110.7700 41.4530 -10.6040 5.1290 # c-c3-hc
+ 7 100.3182 38.8631 -3.8323 -7.9802 # c-c_1-o_2
+ 8 123.1451 55.5431 -17.2123 0.1348 # c-c_1-o_1
+ 9 120.7970 95.3446 -32.2869 6.3778 # o_2-c_1-o_1
+ 10 113.2880 61.2868 -28.9786 7.9929 # c3-o_2-c_1
+ 11 107.6880 65.4801 -10.3498 5.8866 # o_2-c3-hc
+ 12 112.6700 39.5160 -7.4430 -9.5583 # c2-c-c2
+ 13 107.6600 39.6410 -12.9210 -2.4318 # hc-c2-hc
+ 14 110.7700 41.4530 -10.6040 5.1290 # c-c2-hc
+ 15 112.6700 39.5160 -7.4430 -9.5583 # c-c2-c
+ 16 107.7336 40.6099 -28.8121 0.0000 # c_1-c1-hc
+ 17 110.7700 41.4530 -10.6040 5.1290 # hc-c1-c2
+ 18 110.7700 41.4530 -10.6040 5.1290 # c3-c1-hc
+ 19 108.5295 51.9747 -9.4851 -10.9985 # c_1-c1-c2
+ 20 108.5295 51.9747 -9.4851 -10.9985 # c3-c1-c_1
+ 21 112.6700 39.5160 -7.4430 -9.5583 # c3-c1-c2
+ 22 110.7700 41.4530 -10.6040 5.1290 # hc-c2-c1
+ 23 112.6700 39.5160 -7.4430 -9.5583 # c-c2-c1
+ 24 100.3182 38.8631 -3.8323 -7.9802 # o_2-c_1-c1
+ 25 123.1451 55.5431 -17.2123 0.1348 # o_1-c_1-c1
+ 26 110.7700 41.4530 -10.6040 5.1290 # hc-c3-c1
+
+Dihedral Coeffs # class2
+
+ 1 1.8341 0.0000 2.0603 0.0000 -0.0195 0.0000# c3-c-c_1-o_2
+ 2 0.0442 0.0000 0.0292 0.0000 0.0562 0.0000# c3-c-c_1-o_1
+ 3 1.8341 0.0000 2.0603 0.0000 -0.0195 0.0000# c2-c-c_1-o_2
+ 4 0.0442 0.0000 0.0292 0.0000 0.0562 0.0000# c2-c-c_1-o_1
+ 5 -0.0228 0.0000 0.0280 0.0000 -0.1863 0.0000# c_1-c-c3-hc
+ 6 0.0000 0.0000 0.0316 0.0000 -0.1681 0.0000# c3-c-c3-hc
+ 7 0.0000 0.0000 0.0316 0.0000 -0.1681 0.0000# c2-c-c3-hc
+ 8 -0.0228 0.0000 0.0280 0.0000 -0.1863 0.0000# c_1-c-c2-hc
+ 9 0.0972 0.0000 0.0722 0.0000 -0.2581 0.0000# c_1-c-c2-c
+ 10 0.0000 0.0000 0.0316 0.0000 -0.1681 0.0000# c3-c-c2-hc
+ 11 0.0000 0.0000 0.0514 0.0000 -0.1430 0.0000# c3-c-c2-c
+ 12 -2.5594 0.0000 2.2013 0.0000 0.0325 0.0000# c-c_1-o_2-c3
+ 13 -2.5594 0.0000 2.2013 0.0000 0.0325 0.0000# o_1-c_1-o_2-c3
+ 14 0.0000 0.0000 0.0000 0.0000 -0.1932 0.0000# hc-c3-o_2-c_1
+ 15 0.0000 0.0000 0.0316 0.0000 -0.1681 0.0000# c2-c-c2-hc
+ 16 0.0000 0.0000 0.0514 0.0000 -0.1430 0.0000# c2-c-c2-c
+ 17 0.0972 0.0000 0.0722 0.0000 -0.2581 0.0000# c_1-c-c2-c1
+ 18 0.0000 0.0000 0.0514 0.0000 -0.1430 0.0000# c2-c-c2-c1
+ 19 0.0000 0.0000 0.0514 0.0000 -0.1430 0.0000# c3-c-c2-c1
+ 20 -0.6359 0.0000 1.4807 0.0000 -0.0438 0.0000# o_2-c_1-c1-hc
+ 21 -0.1804 0.0000 0.0012 0.0000 0.0371 0.0000# o_1-c_1-c1-hc
+ 22 1.8341 0.0000 2.0603 0.0000 -0.0195 0.0000# o_2-c_1-c1-c2
+ 23 0.0442 0.0000 0.0292 0.0000 0.0562 0.0000# o_1-c_1-c1-c2
+ 24 1.8341 0.0000 2.0603 0.0000 -0.0195 0.0000# o_2-c_1-c1-c3
+ 25 0.0442 0.0000 0.0292 0.0000 0.0562 0.0000# o_1-c_1-c1-c3
+ 26 -0.1432 0.0000 0.0617 0.0000 -0.1083 0.0000# hc-c2-c1-hc
+ 27 0.0000 0.0000 0.0316 0.0000 -0.1681 0.0000# c-c2-c1-hc
+ 28 -0.0228 0.0000 0.0280 0.0000 -0.1863 0.0000# hc-c2-c1-c_1
+ 29 0.0972 0.0000 0.0722 0.0000 -0.2581 0.0000# c-c2-c1-c_1
+ 30 0.0000 0.0000 0.0316 0.0000 -0.1681 0.0000# hc-c2-c1-c3
+ 31 0.0000 0.0000 0.0514 0.0000 -0.1430 0.0000# c-c2-c1-c3
+ 32 -0.1432 0.0000 0.0617 0.0000 -0.1083 0.0000# hc-c3-c1-hc
+ 33 -0.0228 0.0000 0.0280 0.0000 -0.1863 0.0000# hc-c3-c1-c_1
+ 34 0.0000 0.0000 0.0316 0.0000 -0.1681 0.0000# hc-c3-c1-c2
+ 35 -2.5594 0.0000 2.2013 0.0000 0.0325 0.0000# c1-c_1-o_2-c3
+
+Improper Coeffs # class2
+
+ 1 46.9264 0.0000 # c-c_1-o_2-o_1
+ 2 46.9264 0.0000 # o_2-c_1-o_1-c1
+ 3 0.0000 0.0000
+ 4 0.0000 0.0000
+ 5 0.0000 0.0000
+ 6 0.0000 0.0000
+ 7 0.0000 0.0000
+ 8 0.0000 0.0000
+ 9 0.0000 0.0000
+ 10 0.0000 0.0000
+ 11 0.0000 0.0000
+ 12 0.0000 0.0000
+ 13 0.0000 0.0000
+ 14 0.0000 0.0000
+ 15 0.0000 0.0000
+ 16 0.0000 0.0000
+ 17 0.0000 0.0000
+ 18 0.0000 0.0000
+ 19 0.0000 0.0000
+
+BondBond Coeffs
+
+ 1 5.4199 1.5300 1.5202
+ 2 5.4199 1.5202 1.5300
+ 3 0.0000 1.5300 1.5300
+ 4 0.0000 1.5300 1.5300
+ 5 5.3316 1.1010 1.1010
+ 6 3.3872 1.5300 1.1010
+ 7 19.1069 1.5202 1.3683
+ 8 46.0685 1.5202 1.2020
+ 9 121.4880 1.3683 1.2020
+ 10 45.4503 1.4300 1.3683
+ 11 5.6454 1.4300 1.1010
+ 12 0.0000 1.5300 1.5300
+ 13 5.3316 1.1010 1.1010
+ 14 3.3872 1.5300 1.1010
+ 15 0.0000 1.5300 1.5300
+ 16 0.7115 1.5202 1.1010
+ 17 3.3872 1.1010 1.5300
+ 18 3.3872 1.5300 1.1010
+ 19 5.4199 1.5202 1.5300
+ 20 5.4199 1.5300 1.5202
+ 21 0.0000 1.5300 1.5300
+ 22 3.3872 1.1010 1.5300
+ 23 0.0000 1.5300 1.5300
+ 24 19.1069 1.3683 1.5202
+ 25 46.0685 1.2020 1.5202
+ 26 3.3872 1.1010 1.5300
+
+BondAngle Coeffs
+
+ 1 18.1678 15.8758 1.5300 1.5202
+ 2 15.8758 18.1678 1.5202 1.5300
+ 3 8.0160 8.0160 1.5300 1.5300
+ 4 8.0160 8.0160 1.5300 1.5300
+ 5 18.1030 18.1030 1.1010 1.1010
+ 6 20.7540 11.4210 1.5300 1.1010
+ 7 1.3435 4.6978 1.5202 1.3683
+ 8 34.9982 37.1298 1.5202 1.2020
+ 9 71.8761 76.2614 1.3683 1.2020
+ 10 41.9116 46.4608 1.4300 1.3683
+ 11 57.4975 8.6864 1.4300 1.1010
+ 12 8.0160 8.0160 1.5300 1.5300
+ 13 18.1030 18.1030 1.1010 1.1010
+ 14 20.7540 11.4210 1.5300 1.1010
+ 15 8.0160 8.0160 1.5300 1.5300
+ 16 12.4632 9.1765 1.5202 1.1010
+ 17 11.4210 20.7540 1.1010 1.5300
+ 18 20.7540 11.4210 1.5300 1.1010
+ 19 15.8758 18.1678 1.5202 1.5300
+ 20 18.1678 15.8758 1.5300 1.5202
+ 21 8.0160 8.0160 1.5300 1.5300
+ 22 11.4210 20.7540 1.1010 1.5300
+ 23 8.0160 8.0160 1.5300 1.5300
+ 24 4.6978 1.3435 1.3683 1.5202
+ 25 37.1298 34.9982 1.2020 1.5202
+ 26 11.4210 20.7540 1.1010 1.5300
+
+AngleAngle Coeffs
+
+ 1 0.0000 0.0000 0.0000 100.3182 120.7970 123.1451
+ 2 0.0000 0.0000 0.0000 120.7970 123.1451 100.3182
+ 3 0.0000 0.0000 0.0000 112.6700 108.5295 108.5295
+ 4 0.0000 0.0000 0.0000 108.5295 108.5295 112.6700
+ 5 -0.1729 -0.1729 -0.1729 112.6700 112.6700 112.6700
+ 6 -0.3157 -0.3157 -0.3157 107.6600 107.6600 107.6600
+ 7 0.2738 -0.4825 0.2738 110.7700 107.6600 110.7700
+ 8 0.0000 0.0000 0.0000 107.6880 107.6600 107.6880
+ 9 0.0000 0.0000 0.0000 108.5295 112.6700 108.5295
+ 10 -0.1729 -0.1729 -0.1729 112.6700 112.6700 112.6700
+ 11 0.2738 -0.4825 0.2738 110.7700 107.6600 110.7700
+ 12 -1.3199 -1.3199 0.1184 112.6700 110.7700 110.7700
+ 13 1.0827 2.0403 -1.8202 107.7336 110.7700 108.5295
+ 14 2.0403 -1.8202 1.0827 108.5295 107.7336 110.7700
+ 15 0.1184 -1.3199 -1.3199 110.7700 110.7700 112.6700
+ 16 0.0000 0.0000 0.0000 108.5295 108.5295 112.6700
+ 17 0.2738 0.2738 -0.4825 107.6600 110.7700 110.7700
+ 18 0.1184 -1.3199 -1.3199 110.7700 110.7700 112.6700
+ 19 0.2738 0.2738 -0.4825 107.6600 110.7700 110.7700
+
+AngleAngleTorsion Coeffs
+
+ 1 0.0000 108.5295 100.3182
+ 2 -8.0190 108.5295 123.1451
+ 3 0.0000 108.5295 100.3182
+ 4 -8.0190 108.5295 123.1451
+ 5 -5.3624 108.5295 110.7700
+ 6 -16.1640 112.6700 110.7700
+ 7 -16.1640 112.6700 110.7700
+ 8 -5.3624 108.5295 110.7700
+ 9 -0.3801 108.5295 112.6700
+ 10 -16.1640 112.6700 110.7700
+ 11 -22.0450 112.6700 112.6700
+ 12 0.0000 100.3182 113.2880
+ 13 0.0000 120.7970 113.2880
+ 14 0.0000 107.6880 113.2880
+ 15 -16.1640 112.6700 110.7700
+ 16 -22.0450 112.6700 112.6700
+ 17 -0.3801 108.5295 112.6700
+ 18 -22.0450 112.6700 112.6700
+ 19 -22.0450 112.6700 112.6700
+ 20 0.0000 100.3182 107.7336
+ 21 -15.3496 123.1451 107.7336
+ 22 0.0000 100.3182 108.5295
+ 23 -8.0190 123.1451 108.5295
+ 24 0.0000 100.3182 108.5295
+ 25 -8.0190 123.1451 108.5295
+ 26 -12.5640 110.7700 110.7700
+ 27 -16.1640 112.6700 110.7700
+ 28 -5.3624 110.7700 108.5295
+ 29 -0.3801 112.6700 108.5295
+ 30 -16.1640 110.7700 112.6700
+ 31 -22.0450 112.6700 112.6700
+ 32 -12.5640 110.7700 110.7700
+ 33 -5.3624 110.7700 108.5295
+ 34 -16.1640 110.7700 112.6700
+ 35 0.0000 100.3182 113.2880
+
+EndBondTorsion Coeffs
+
+1 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.5300 1.3683
+2 0.2654 0.0503 0.1046 -0.2810 0.0816 -0.1522 1.5300 1.2020
+3 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.5300 1.3683
+4 0.2654 0.0503 0.1046 -0.2810 0.0816 -0.1522 1.5300 1.2020
+5 -0.0204 0.3628 -0.4426 -0.0097 -0.0315 -0.0755 1.5202 1.1010
+6 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.5300 1.1010
+7 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.5300 1.1010
+8 -0.0204 0.3628 -0.4426 -0.0097 -0.0315 -0.0755 1.5202 1.1010
+9 0.0055 0.0060 -0.0009 0.0062 -0.0002 0.0036 1.5202 1.5300
+10 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.5300 1.1010
+11 -0.0732 0.0000 0.0000 -0.0732 0.0000 0.0000 1.5300 1.5300
+12 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.5202 1.4300
+13 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.2020 1.4300
+14 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.1010 1.3683
+15 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.5300 1.1010
+16 -0.0732 0.0000 0.0000 -0.0732 0.0000 0.0000 1.5300 1.5300
+17 0.0055 0.0060 -0.0009 0.0062 -0.0002 0.0036 1.5202 1.5300
+18 -0.0732 0.0000 0.0000 -0.0732 0.0000 0.0000 1.5300 1.5300
+19 -0.0732 0.0000 0.0000 -0.0732 0.0000 0.0000 1.5300 1.5300
+20 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.3683 1.1010
+21 -0.2298 0.0354 0.3853 1.2143 0.2831 0.3916 1.2020 1.1010
+22 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.3683 1.5300
+23 -0.2810 0.0816 -0.1522 0.2654 0.0503 0.1046 1.2020 1.5300
+24 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.3683 1.5300
+25 -0.2810 0.0816 -0.1522 0.2654 0.0503 0.1046 1.2020 1.5300
+26 0.2130 0.3120 0.0777 0.2130 0.3120 0.0777 1.1010 1.1010
+27 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.5300 1.1010
+28 -0.0097 -0.0315 -0.0755 -0.0204 0.3628 -0.4426 1.1010 1.5202
+29 0.0062 -0.0002 0.0036 0.0055 0.0060 -0.0009 1.5300 1.5202
+30 0.0814 0.0591 0.2219 0.2486 0.2422 -0.0925 1.1010 1.5300
+31 -0.0732 0.0000 0.0000 -0.0732 0.0000 0.0000 1.5300 1.5300
+32 0.2130 0.3120 0.0777 0.2130 0.3120 0.0777 1.1010 1.1010
+33 -0.0097 -0.0315 -0.0755 -0.0204 0.3628 -0.4426 1.1010 1.5202
+34 0.0814 0.0591 0.2219 0.2486 0.2422 -0.0925 1.1010 1.5300
+35 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.5202 1.4300
+
+MiddleBondTorsion Coeffs
+
+ 1 -17.3280 -5.7900 -3.2114 1.5202
+ 2 0.3388 -0.1096 0.1219 1.5202
+ 3 -17.3280 -5.7900 -3.2114 1.5202
+ 4 0.3388 -0.1096 0.1219 1.5202
+ 5 -3.5039 1.2458 -0.7610 1.5300
+ 6 -14.8790 -3.6581 -0.3138 1.5300
+ 7 -14.8790 -3.6581 -0.3138 1.5300
+ 8 -3.5039 1.2458 -0.7610 1.5300
+ 9 -1.5945 0.2267 -0.6911 1.5300
+ 10 -14.8790 -3.6581 -0.3138 1.5300
+ 11 -17.7870 -7.1877 0.0000 1.5300
+ 12 1.3445 3.5515 -4.9202 1.3683
+ 13 4.2600 0.0000 0.0000 1.3683
+ 14 0.0000 0.0000 0.0000 1.4300
+ 15 -14.8790 -3.6581 -0.3138 1.5300
+ 16 -17.7870 -7.1877 0.0000 1.5300
+ 17 -1.5945 0.2267 -0.6911 1.5300
+ 18 -17.7870 -7.1877 0.0000 1.5300
+ 19 -17.7870 -7.1877 0.0000 1.5300
+ 20 -13.7686 -2.5959 1.1934 1.5202
+ 21 0.2359 0.9139 0.9594 1.5202
+ 22 -17.3280 -5.7900 -3.2114 1.5202
+ 23 0.3388 -0.1096 0.1219 1.5202
+ 24 -17.3280 -5.7900 -3.2114 1.5202
+ 25 0.3388 -0.1096 0.1219 1.5202
+ 26 -14.2610 -0.5322 -0.4864 1.5300
+ 27 -14.8790 -3.6581 -0.3138 1.5300
+ 28 -3.5039 1.2458 -0.7610 1.5300
+ 29 -1.5945 0.2267 -0.6911 1.5300
+ 30 -14.8790 -3.6581 -0.3138 1.5300
+ 31 -17.7870 -7.1877 0.0000 1.5300
+ 32 -14.2610 -0.5322 -0.4864 1.5300
+ 33 -3.5039 1.2458 -0.7610 1.5300
+ 34 -14.8790 -3.6581 -0.3138 1.5300
+ 35 1.3445 3.5515 -4.9202 1.3683
+
+BondBond13 Coeffs
+
+ 1 0.0000 1.5300 1.3683
+ 2 0.0000 1.5300 1.2020
+ 3 0.0000 1.5300 1.3683
+ 4 0.0000 1.5300 1.2020
+ 5 0.0000 1.5202 1.1010
+ 6 0.0000 1.5300 1.1010
+ 7 0.0000 1.5300 1.1010
+ 8 0.0000 1.5202 1.1010
+ 9 0.0000 1.5202 1.5300
+ 10 0.0000 1.5300 1.1010
+ 11 0.0000 1.5300 1.5300
+ 12 0.0000 1.5202 1.4300
+ 13 0.0000 1.2020 1.4300
+ 14 0.0000 1.1010 1.3683
+ 15 0.0000 1.5300 1.1010
+ 16 0.0000 1.5300 1.5300
+ 17 0.0000 1.5202 1.5300
+ 18 0.0000 1.5300 1.5300
+ 19 0.0000 1.5300 1.5300
+ 20 0.0000 1.3683 1.1010
+ 21 0.0000 1.2020 1.1010
+ 22 0.0000 1.3683 1.5300
+ 23 0.0000 1.2020 1.5300
+ 24 0.0000 1.3683 1.5300
+ 25 0.0000 1.2020 1.5300
+ 26 0.0000 1.1010 1.1010
+ 27 0.0000 1.5300 1.1010
+ 28 0.0000 1.1010 1.5202
+ 29 0.0000 1.5300 1.5202
+ 30 0.0000 1.1010 1.5300
+ 31 0.0000 1.5300 1.5300
+ 32 0.0000 1.1010 1.1010
+ 33 0.0000 1.1010 1.5202
+ 34 0.0000 1.1010 1.5300
+ 35 0.0000 1.5202 1.4300
+
+AngleTorsion Coeffs
+
+ 1 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 108.5295 100.3182
+ 2 0.0885 -1.3703 -0.5452 0.6750 0.5965 0.6725 108.5295 123.1451
+ 3 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 108.5295 100.3182
+ 4 0.0885 -1.3703 -0.5452 0.6750 0.5965 0.6725 108.5295 123.1451
+ 5 -0.7466 -0.9448 -0.6321 0.0162 1.4211 -1.4092 108.5295 110.7700
+ 6 -0.2454 0.0000 -0.1136 0.3113 0.4516 -0.1988 112.6700 110.7700
+ 7 -0.2454 0.0000 -0.1136 0.3113 0.4516 -0.1988 112.6700 110.7700
+ 8 -0.7466 -0.9448 -0.6321 0.0162 1.4211 -1.4092 108.5295 110.7700
+ 9 0.0515 -0.0674 -0.0474 -0.2607 0.3203 -0.2283 108.5295 112.6700
+ 10 -0.2454 0.0000 -0.1136 0.3113 0.4516 -0.1988 112.6700 110.7700
+ 11 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.6700 112.6700
+ 12 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 100.3182 113.2880
+ 13 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 120.7970 113.2880
+ 14 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 107.6880 113.2880
+ 15 -0.2454 0.0000 -0.1136 0.3113 0.4516 -0.1988 112.6700 110.7700
+ 16 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.6700 112.6700
+ 17 0.0515 -0.0674 -0.0474 -0.2607 0.3203 -0.2283 108.5295 112.6700
+ 18 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.6700 112.6700
+ 19 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.6700 112.6700
+ 20 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 100.3182 107.7336
+ 21 -1.4946 0.7308 -0.2083 9.1299 -0.4847 0.3582 123.1451 107.7336
+ 22 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 100.3182 108.5295
+ 23 0.6750 0.5965 0.6725 0.0885 -1.3703 -0.5452 123.1451 108.5295
+ 24 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 100.3182 108.5295
+ 25 0.6750 0.5965 0.6725 0.0885 -1.3703 -0.5452 123.1451 108.5295
+ 26 -0.8085 0.5569 -0.2466 -0.8085 0.5569 -0.2466 110.7700 110.7700
+ 27 -0.2454 0.0000 -0.1136 0.3113 0.4516 -0.1988 112.6700 110.7700
+ 28 0.0162 1.4211 -1.4092 -0.7466 -0.9448 -0.6321 110.7700 108.5295
+ 29 -0.2607 0.3203 -0.2283 0.0515 -0.0674 -0.0474 112.6700 108.5295
+ 30 0.3113 0.4516 -0.1988 -0.2454 0.0000 -0.1136 110.7700 112.6700
+ 31 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.6700 112.6700
+ 32 -0.8085 0.5569 -0.2466 -0.8085 0.5569 -0.2466 110.7700 110.7700
+ 33 0.0162 1.4211 -1.4092 -0.7466 -0.9448 -0.6321 110.7700 108.5295
+ 34 0.3113 0.4516 -0.1988 -0.2454 0.0000 -0.1136 110.7700 112.6700
+ 35 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 100.3182 113.2880
+
+Atoms # full
+
+ 1 1 1 0.000000 -0.633418000 3.634698000 -0.520447000 0 0 0 # c
+ 2 1 2 -0.159000 -1.681078000 4.738564000 -0.675925000 0 0 0 # c3
+ 3 1 3 0.266000 -1.387493000 2.511538000 0.201451000 0 0 0 # c_1
+ 4 1 4 -0.266000 -0.833117000 2.333802000 1.415262000 0 0 0 # o_2
+ 5 1 2 -0.026000 -1.417542000 1.295223000 2.194265000 0 0 0 # c3
+ 6 1 5 0.053000 -2.476360000 1.527665000 2.374308000 0 0 0 # hc
+ 7 1 5 0.053000 -2.531181000 4.392408000 -1.284049000 0 0 0 # hc
+ 8 1 5 0.053000 -0.886560000 1.228488000 3.153585000 0 0 0 # hc
+ 9 1 5 0.053000 -1.228588000 5.610202000 -1.173631000 0 0 0 # hc
+ 10 1 5 0.053000 -2.070284000 5.062610000 0.301509000 0 0 0 # hc
+ 11 1 5 0.053000 -1.325591000 0.341689000 1.655498000 0 0 0 # hc
+ 12 1 2 -0.159000 0.512831000 4.150735000 0.351569000 0 0 0 # c3
+ 13 1 5 0.053000 1.055972000 4.940079000 -0.192088000 0 0 0 # hc
+ 14 1 5 0.053000 1.238964000 3.371721000 0.627844000 0 0 0 # hc
+ 15 1 5 0.053000 0.117814000 4.600272000 1.276936000 0 0 0 # hc
+ 16 1 6 -0.133000 -2.322596000 1.880616000 -0.204263000 0 0 0 # o_1
+ 17 2 1 0.000000 0.804693000 2.145964000 -2.336744000 0 0 0 # c
+ 18 2 7 -0.106000 -0.294421000 3.170838000 -1.953678000 0 0 0 # c2
+ 19 2 3 0.266000 2.138571000 2.832879000 -2.103460000 0 0 0 # c_1
+ 20 2 4 -0.266000 2.372145000 3.671394000 -3.131947000 0 0 0 # o_2
+ 21 2 2 -0.026000 3.602748000 4.383361000 -3.054350000 0 0 0 # c3
+ 22 2 5 0.053000 3.610506000 4.998838000 -2.143924000 0 0 0 # hc
+ 23 2 5 0.053000 3.694800000 5.030836000 -3.937109000 0 0 0 # hc
+ 24 2 5 0.053000 -1.235915000 2.773341000 -2.374311000 0 0 0 # hc
+ 25 2 5 0.053000 -0.081285000 4.091302000 -2.526023000 0 0 0 # hc
+ 26 2 5 0.053000 4.436044000 3.667105000 -3.035015000 0 0 0 # hc
+ 27 2 2 -0.159000 0.611666000 1.991584000 -3.851496000 0 0 0 # c3
+ 28 2 5 0.053000 -0.289273000 1.387825000 -4.043900000 0 0 0 # hc
+ 29 2 5 0.053000 1.463121000 1.506181000 -4.351096000 0 0 0 # hc
+ 30 2 5 0.053000 0.447238000 2.968089000 -4.333583000 0 0 0 # hc
+ 31 2 6 -0.133000 2.890594000 2.696257000 -1.179564000 0 0 0 # o_1
+ 32 3 1 0.000000 1.397177000 -0.496953000 -1.800162000 0 0 0 # c
+ 33 3 7 -0.106000 0.691539000 0.852868000 -1.495129000 0 0 0 # c2
+ 34 3 3 0.266000 0.695638000 -1.078791000 -3.017470000 0 0 0 # c_1
+ 35 3 4 -0.266000 -0.433002000 -1.685271000 -2.599657000 0 0 0 # o_2
+ 36 3 2 -0.026000 -1.200644000 -2.295669000 -3.631502000 0 0 0 # c3
+ 37 3 5 0.053000 -1.507749000 -1.530598000 -4.358027000 0 0 0 # hc
+ 38 3 5 0.053000 -2.091554000 -2.757962000 -3.184979000 0 0 0 # hc
+ 39 3 5 0.053000 0.980971000 1.115979000 -0.462722000 0 0 0 # hc
+ 40 3 5 0.053000 -0.384900000 0.614574000 -1.458910000 0 0 0 # hc
+ 41 3 5 0.053000 -0.594468000 -3.067094000 -4.126610000 0 0 0 # hc
+ 42 3 2 -0.159000 1.017164000 -1.351769000 -0.581861000 0 0 0 # c3
+ 43 3 5 0.053000 1.624485000 -1.039640000 0.282512000 0 0 0 # hc
+ 44 3 5 0.053000 1.174800000 -2.428888000 -0.737066000 0 0 0 # hc
+ 45 3 5 0.053000 -0.036762000 -1.199383000 -0.300261000 0 0 0 # hc
+ 46 3 6 -0.133000 1.027390000 -1.028862000 -4.168218000 0 0 0 # o_1
+ 47 4 1 0.000000 3.966949000 -1.439368000 -2.191285000 0 0 0 # c
+ 48 4 7 -0.106000 2.913413000 -0.313606000 -2.028563000 0 0 0 # c2
+ 49 4 3 0.266000 3.989592000 -2.240375000 -0.907672000 0 0 0 # c_1
+ 50 4 4 -0.266000 4.599493000 -1.508560000 0.045550000 0 0 0 # o_2
+ 51 4 2 -0.026000 4.686298000 -2.139943000 1.318815000 0 0 0 # c3
+ 52 4 5 0.053000 3.673589000 -2.349798000 1.690021000 0 0 0 # hc
+ 53 4 5 0.053000 5.200688000 -1.464754000 2.016189000 0 0 0 # hc
+ 54 4 5 0.053000 3.037439000 0.331225000 -2.915449000 0 0 0 # hc
+ 55 4 5 0.053000 3.252029000 0.280214000 -1.163342000 0 0 0 # hc
+ 56 4 5 0.053000 5.255838000 -3.074913000 1.223300000 0 0 0 # hc
+ 57 4 2 -0.159000 5.282529000 -0.651603000 -2.269945000 0 0 0 # c3
+ 58 4 5 0.053000 5.346025000 -0.148371000 -3.247479000 0 0 0 # hc
+ 59 4 5 0.053000 6.171959000 -1.287625000 -2.151011000 0 0 0 # hc
+ 60 4 5 0.053000 5.331038000 0.138310000 -1.504257000 0 0 0 # hc
+ 61 4 6 -0.133000 3.545053000 -3.337606000 -0.715715000 0 0 0 # o_1
+ 62 5 1 0.000000 4.620833000 -3.326693000 -4.109533000 0 0 0 # c
+ 63 5 7 -0.106000 3.652503000 -2.337506000 -3.407769000 0 0 0 # c2
+ 64 5 3 0.266000 5.653604000 -2.472614000 -4.831647000 0 0 0 # c_1
+ 65 5 4 -0.266000 5.111475000 -2.022075000 -5.980401000 0 0 0 # o_2
+ 66 5 2 -0.026000 5.971771000 -1.203306000 -6.765481000 0 0 0 # c3
+ 67 5 5 0.053000 6.260026000 -0.316003000 -6.184475000 0 0 0 # hc
+ 68 5 5 0.053000 5.435290000 -0.890960000 -7.671954000 0 0 0 # hc
+ 69 5 5 0.053000 2.753672000 -2.924820000 -3.151292000 0 0 0 # hc
+ 70 5 5 0.053000 3.352208000 -1.638604000 -4.206128000 0 0 0 # hc
+ 71 5 5 0.053000 6.864808000 -1.779197000 -7.046079000 0 0 0 # hc
+ 72 5 2 -0.159000 3.708002000 -3.959156000 -5.169887000 0 0 0 # c3
+ 73 5 5 0.053000 3.031714000 -4.679313000 -4.682555000 0 0 0 # hc
+ 74 5 5 0.053000 4.256861000 -4.488719000 -5.962328000 0 0 0 # hc
+ 75 5 5 0.053000 3.068976000 -3.201001000 -5.649870000 0 0 0 # hc
+ 76 5 6 -0.133000 6.768331000 -2.204430000 -4.480250000 0 0 0 # o_1
+ 77 6 1 0.000000 6.093263000 -5.587913000 -3.560636000 0 0 0 # c
+ 78 6 7 -0.106000 5.308751000 -4.312834000 -3.138300000 0 0 0 # c2
+ 79 6 3 0.266000 5.049508000 -6.603485000 -4.003777000 0 0 0 # c_1
+ 80 6 4 -0.266000 4.554427000 -7.203560000 -2.902940000 0 0 0 # o_2
+ 81 6 2 -0.026000 3.562981000 -8.192962000 -3.156902000 0 0 0 # c3
+ 82 6 5 0.053000 2.705493000 -7.727344000 -3.662190000 0 0 0 # hc
+ 83 6 5 0.053000 3.237173000 -8.622824000 -2.199861000 0 0 0 # hc
+ 84 6 5 0.053000 5.995489000 -3.722546000 -2.507421000 0 0 0 # hc
+ 85 6 5 0.053000 4.514555000 -4.679531000 -2.467788000 0 0 0 # hc
+ 86 6 5 0.053000 3.991532000 -8.983665000 -3.788604000 0 0 0 # hc
+ 87 6 2 -0.159000 6.684506000 -6.073042000 -2.229026000 0 0 0 # c3
+ 88 6 5 0.053000 7.545290000 -5.439783000 -1.961956000 0 0 0 # hc
+ 89 6 5 0.053000 7.027618000 -7.117413000 -2.257204000 0 0 0 # hc
+ 90 6 5 0.053000 5.953601000 -5.976673000 -1.410522000 0 0 0 # hc
+ 91 6 6 -0.133000 4.679701000 -6.860981000 -5.114546000 0 0 0 # o_1
+ 92 7 1 0.000000 8.191866000 -6.276687000 -5.226719000 0 0 0 # c
+ 93 7 7 -0.106000 7.125233000 -5.298659000 -4.672132000 0 0 0 # c2
+ 94 7 3 0.266000 9.135855000 -6.617834000 -4.092568000 0 0 0 # c_1
+ 95 7 4 -0.266000 9.934906000 -5.557047000 -3.864645000 0 0 0 # o_2
+ 96 7 2 -0.026000 10.892382000 -5.742399000 -2.827400000 0 0 0 # c3
+ 97 7 5 0.053000 11.553396000 -6.580327000 -3.089232000 0 0 0 # hc
+ 98 7 5 0.053000 10.370519000 -5.952330000 -1.883435000 0 0 0 # hc
+ 99 7 5 0.053000 6.567923000 -4.948063000 -5.557544000 0 0 0 # hc
+ 100 7 5 0.053000 7.696444000 -4.433111000 -4.298730000 0 0 0 # hc
+ 101 7 5 0.053000 11.485685000 -4.823608000 -2.723420000 0 0 0 # hc
+ 102 7 2 -0.159000 8.957459000 -5.391017000 -6.221052000 0 0 0 # c3
+ 103 7 5 0.053000 8.333050000 -5.226114000 -7.113266000 0 0 0 # hc
+ 104 7 5 0.053000 9.910684000 -5.832380000 -6.545212000 0 0 0 # hc
+ 105 7 5 0.053000 9.175643000 -4.397358000 -5.799012000 0 0 0 # hc
+ 106 7 6 -0.133000 9.199344000 -7.640210000 -3.468747000 0 0 0 # o_1
+ 107 8 1 0.000000 8.262760000 -8.564497000 -6.769855000 0 0 0 # c
+ 108 8 7 -0.106000 7.556560000 -7.548515000 -5.830486000 0 0 0 # c2
+ 109 8 3 0.266000 8.456504000 -7.871008000 -8.103271000 0 0 0 # c_1
+ 110 8 4 -0.266000 7.266992000 -7.835138000 -8.736810000 0 0 0 # o_2
+ 111 8 2 -0.026000 7.283962000 -7.192355000 -10.006775000 0 0 0 # c3
+ 112 8 5 0.053000 6.270957000 -7.218684000 -10.431104000 0 0 0 # hc
+ 113 8 5 0.053000 7.976685000 -7.723474000 -10.674386000 0 0 0 # hc
+ 114 8 5 0.053000 7.154862000 -8.142299000 -4.991093000 0 0 0 # hc
+ 115 8 5 0.053000 6.685583000 -7.189461000 -6.402577000 0 0 0 # hc
+ 116 8 5 0.053000 7.603477000 -6.148355000 -9.881849000 0 0 0 # hc
+ 117 8 2 -0.159000 7.166774000 -9.625239000 -6.960353000 0 0 0 # c3
+ 118 8 5 0.053000 7.098119000 -10.241527000 -6.050359000 0 0 0 # hc
+ 119 8 5 0.053000 7.344500000 -10.294304000 -7.814393000 0 0 0 # hc
+ 120 8 5 0.053000 6.177875000 -9.159550000 -7.097847000 0 0 0 # hc
+ 121 8 6 -0.133000 9.457828000 -7.401923000 -8.564177000 0 0 0 # o_1
+ 122 9 1 0.000000 10.528174000 -10.165533000 -6.728540000 0 0 0 # c
+ 123 9 7 -0.106000 9.586302000 -9.079899000 -6.157574000 0 0 0 # c2
+ 124 9 3 0.266000 9.693571000 -11.386060000 -7.060668000 0 0 0 # c_1
+ 125 9 4 -0.266000 9.222904000 -11.936493000 -5.924360000 0 0 0 # o_2
+ 126 9 2 -0.026000 8.442799000 -13.113503000 -6.108579000 0 0 0 # c3
+ 127 9 5 0.053000 8.109656000 -13.475726000 -5.126573000 0 0 0 # hc
+ 128 9 5 0.053000 9.056854000 -13.883047000 -6.596524000 0 0 0 # hc
+ 129 9 5 0.053000 10.218024000 -8.201376000 -5.957354000 0 0 0 # hc
+ 130 9 5 0.053000 9.284047000 -9.466335000 -5.169165000 0 0 0 # hc
+ 131 9 5 0.053000 7.568042000 -12.877858000 -6.730325000 0 0 0 # hc
+ 132 9 2 -0.159000 11.397504000 -10.560489000 -5.522103000 0 0 0 # c3
+ 133 9 5 0.053000 12.053299000 -9.720169000 -5.250118000 0 0 0 # hc
+ 134 9 5 0.053000 12.029275000 -11.435398000 -5.737741000 0 0 0 # hc
+ 135 9 5 0.053000 10.802796000 -10.790915000 -4.624592000 0 0 0 # hc
+ 136 9 6 -0.133000 9.465161000 -11.823378000 -8.154997000 0 0 0 # o_1
+ 137 10 5 0.053000 12.889411000 -8.809349000 -9.008053000 0 0 0 # hc
+ 138 10 8 -0.053000 12.617346000 -8.953444000 -7.946761000 0 0 0 # c1
+ 139 10 7 -0.106000 11.358317000 -9.861743000 -7.993068000 0 0 0 # c2
+ 140 10 3 0.266000 13.813210000 -9.651723000 -7.309744000 0 0 0 # c_1
+ 141 10 4 -0.266000 13.878794000 -10.934779000 -7.716185000 0 0 0 # o_2
+ 142 10 2 -0.026000 14.959498000 -11.682905000 -7.168796000 0 0 0 # c3
+ 143 10 5 0.053000 14.919297000 -12.707115000 -7.564129000 0 0 0 # hc
+ 144 10 5 0.053000 14.866795000 -11.707441000 -6.074044000 0 0 0 # hc
+ 145 10 5 0.053000 11.681983000 -10.834435000 -8.402314000 0 0 0 # hc
+ 146 10 5 0.053000 10.693673000 -9.457714000 -8.772422000 0 0 0 # hc
+ 147 10 5 0.053000 15.910415000 -11.213947000 -7.457781000 0 0 0 # hc
+ 148 10 2 -0.159000 12.527455000 -7.566814000 -7.315882000 0 0 0 # c3
+ 149 10 5 0.053000 11.733374000 -6.969615000 -7.782074000 0 0 0 # hc
+ 150 10 5 0.053000 13.478407000 -7.035564000 -7.479820000 0 0 0 # hc
+ 151 10 5 0.053000 12.347673000 -7.613591000 -6.232621000 0 0 0 # hc
+ 152 10 6 -0.133000 14.596719000 -9.153044000 -6.549874000 0 0 0 # o_1
+
+Bonds
+
+ 1 1 1 3
+ 2 2 1 2
+ 3 2 1 12
+ 4 3 1 18
+ 5 4 2 7
+ 6 4 2 9
+ 7 4 2 10
+ 8 5 3 4
+ 9 6 3 16
+ 10 7 5 4
+ 11 4 5 6
+ 12 4 5 8
+ 13 4 5 11
+ 14 4 12 13
+ 15 4 12 14
+ 16 4 12 15
+ 17 1 17 19
+ 18 3 17 18
+ 19 2 17 27
+ 20 3 17 33
+ 21 8 24 18
+ 22 8 25 18
+ 23 5 19 20
+ 24 6 19 31
+ 25 7 21 20
+ 26 4 21 22
+ 27 4 21 23
+ 28 4 21 26
+ 29 4 27 28
+ 30 4 27 29
+ 31 4 27 30
+ 32 1 32 34
+ 33 3 32 33
+ 34 2 32 42
+ 35 3 32 48
+ 36 8 39 33
+ 37 8 40 33
+ 38 5 34 35
+ 39 6 34 46
+ 40 7 36 35
+ 41 4 36 37
+ 42 4 36 38
+ 43 4 36 41
+ 44 4 42 43
+ 45 4 42 44
+ 46 4 42 45
+ 47 1 47 49
+ 48 3 47 48
+ 49 2 47 57
+ 50 3 47 63
+ 51 8 54 48
+ 52 8 55 48
+ 53 5 49 50
+ 54 6 49 61
+ 55 7 51 50
+ 56 4 51 52
+ 57 4 51 53
+ 58 4 51 56
+ 59 4 57 58
+ 60 4 57 59
+ 61 4 57 60
+ 62 1 62 64
+ 63 3 62 63
+ 64 2 62 72
+ 65 3 62 78
+ 66 8 69 63
+ 67 8 70 63
+ 68 5 64 65
+ 69 6 64 76
+ 70 7 66 65
+ 71 4 66 67
+ 72 4 66 68
+ 73 4 66 71
+ 74 4 72 73
+ 75 4 72 74
+ 76 4 72 75
+ 77 1 77 79
+ 78 3 77 78
+ 79 2 77 87
+ 80 3 77 93
+ 81 8 84 78
+ 82 8 85 78
+ 83 5 79 80
+ 84 6 79 91
+ 85 7 81 80
+ 86 4 81 82
+ 87 4 81 83
+ 88 4 81 86
+ 89 4 87 88
+ 90 4 87 89
+ 91 4 87 90
+ 92 1 92 94
+ 93 3 92 93
+ 94 2 92 102
+ 95 3 92 108
+ 96 8 99 93
+ 97 8 100 93
+ 98 5 94 95
+ 99 6 94 106
+ 100 7 96 95
+ 101 4 96 97
+ 102 4 96 98
+ 103 4 96 101
+ 104 4 102 103
+ 105 4 102 104
+ 106 4 102 105
+ 107 1 107 109
+ 108 3 107 108
+ 109 2 107 117
+ 110 3 107 123
+ 111 8 114 108
+ 112 8 115 108
+ 113 5 109 110
+ 114 6 109 121
+ 115 7 111 110
+ 116 4 111 112
+ 117 4 111 113
+ 118 4 111 116
+ 119 4 117 118
+ 120 4 117 119
+ 121 4 117 120
+ 122 1 122 124
+ 123 3 122 123
+ 124 2 122 132
+ 125 3 122 139
+ 126 8 129 123
+ 127 8 130 123
+ 128 5 124 125
+ 129 6 124 136
+ 130 7 126 125
+ 131 4 126 127
+ 132 4 126 128
+ 133 4 126 131
+ 134 4 132 133
+ 135 4 132 134
+ 136 4 132 135
+ 137 9 137 138
+ 138 10 140 138
+ 139 11 139 138
+ 140 12 148 138
+ 141 8 145 139
+ 142 8 146 139
+ 143 5 140 141
+ 144 6 140 152
+ 145 7 142 141
+ 146 4 142 143
+ 147 4 142 144
+ 148 4 142 147
+ 149 4 148 149
+ 150 4 148 150
+ 151 4 148 151
+
+Angles
+
+ 1 1 2 1 3
+ 2 1 12 1 3
+ 3 2 3 1 18
+ 4 3 2 1 12
+ 5 4 2 1 18
+ 6 4 12 1 18
+ 7 5 7 2 9
+ 8 5 7 2 10
+ 9 6 1 2 7
+ 10 5 9 2 10
+ 11 6 1 2 9
+ 12 6 1 2 10
+ 13 7 1 3 4
+ 14 8 1 3 16
+ 15 9 4 3 16
+ 16 10 5 4 3
+ 17 11 4 5 6
+ 18 11 4 5 8
+ 19 11 4 5 11
+ 20 5 6 5 8
+ 21 5 6 5 11
+ 22 5 8 5 11
+ 23 5 13 12 14
+ 24 5 13 12 15
+ 25 6 1 12 13
+ 26 5 14 12 15
+ 27 6 1 12 14
+ 28 6 1 12 15
+ 29 2 19 17 18
+ 30 1 27 17 19
+ 31 2 19 17 33
+ 32 4 27 17 18
+ 33 12 18 17 33
+ 34 4 27 17 33
+ 35 13 24 18 25
+ 36 14 17 18 24
+ 37 14 1 18 24
+ 38 14 17 18 25
+ 39 14 1 18 25
+ 40 15 17 18 1
+ 41 7 17 19 20
+ 42 8 17 19 31
+ 43 9 20 19 31
+ 44 10 21 20 19
+ 45 11 20 21 22
+ 46 11 20 21 23
+ 47 11 20 21 26
+ 48 5 22 21 23
+ 49 5 22 21 26
+ 50 5 23 21 26
+ 51 5 28 27 29
+ 52 5 28 27 30
+ 53 6 17 27 28
+ 54 5 29 27 30
+ 55 6 17 27 29
+ 56 6 17 27 30
+ 57 2 34 32 33
+ 58 1 42 32 34
+ 59 2 34 32 48
+ 60 4 42 32 33
+ 61 12 33 32 48
+ 62 4 42 32 48
+ 63 13 39 33 40
+ 64 14 32 33 39
+ 65 14 17 33 39
+ 66 14 32 33 40
+ 67 14 17 33 40
+ 68 15 32 33 17
+ 69 7 32 34 35
+ 70 8 32 34 46
+ 71 9 35 34 46
+ 72 10 36 35 34
+ 73 11 35 36 37
+ 74 11 35 36 38
+ 75 11 35 36 41
+ 76 5 37 36 38
+ 77 5 37 36 41
+ 78 5 38 36 41
+ 79 5 43 42 44
+ 80 5 43 42 45
+ 81 6 32 42 43
+ 82 5 44 42 45
+ 83 6 32 42 44
+ 84 6 32 42 45
+ 85 2 49 47 48
+ 86 1 57 47 49
+ 87 2 49 47 63
+ 88 4 57 47 48
+ 89 12 48 47 63
+ 90 4 57 47 63
+ 91 13 54 48 55
+ 92 14 47 48 54
+ 93 14 32 48 54
+ 94 14 47 48 55
+ 95 14 32 48 55
+ 96 15 47 48 32
+ 97 7 47 49 50
+ 98 8 47 49 61
+ 99 9 50 49 61
+ 100 10 51 50 49
+ 101 11 50 51 52
+ 102 11 50 51 53
+ 103 11 50 51 56
+ 104 5 52 51 53
+ 105 5 52 51 56
+ 106 5 53 51 56
+ 107 5 58 57 59
+ 108 5 58 57 60
+ 109 6 47 57 58
+ 110 5 59 57 60
+ 111 6 47 57 59
+ 112 6 47 57 60
+ 113 2 64 62 63
+ 114 1 72 62 64
+ 115 2 64 62 78
+ 116 4 72 62 63
+ 117 12 63 62 78
+ 118 4 72 62 78
+ 119 13 69 63 70
+ 120 14 62 63 69
+ 121 14 47 63 69
+ 122 14 62 63 70
+ 123 14 47 63 70
+ 124 15 62 63 47
+ 125 7 62 64 65
+ 126 8 62 64 76
+ 127 9 65 64 76
+ 128 10 66 65 64
+ 129 11 65 66 67
+ 130 11 65 66 68
+ 131 11 65 66 71
+ 132 5 67 66 68
+ 133 5 67 66 71
+ 134 5 68 66 71
+ 135 5 73 72 74
+ 136 5 73 72 75
+ 137 6 62 72 73
+ 138 5 74 72 75
+ 139 6 62 72 74
+ 140 6 62 72 75
+ 141 2 79 77 78
+ 142 1 87 77 79
+ 143 2 79 77 93
+ 144 4 87 77 78
+ 145 12 78 77 93
+ 146 4 87 77 93
+ 147 13 84 78 85
+ 148 14 77 78 84
+ 149 14 62 78 84
+ 150 14 77 78 85
+ 151 14 62 78 85
+ 152 15 77 78 62
+ 153 7 77 79 80
+ 154 8 77 79 91
+ 155 9 80 79 91
+ 156 10 81 80 79
+ 157 11 80 81 82
+ 158 11 80 81 83
+ 159 11 80 81 86
+ 160 5 82 81 83
+ 161 5 82 81 86
+ 162 5 83 81 86
+ 163 5 88 87 89
+ 164 5 88 87 90
+ 165 6 77 87 88
+ 166 5 89 87 90
+ 167 6 77 87 89
+ 168 6 77 87 90
+ 169 2 94 92 93
+ 170 1 102 92 94
+ 171 2 94 92 108
+ 172 4 102 92 93
+ 173 12 93 92 108
+ 174 4 102 92 108
+ 175 13 99 93 100
+ 176 14 92 93 99
+ 177 14 77 93 99
+ 178 14 92 93 100
+ 179 14 77 93 100
+ 180 15 92 93 77
+ 181 7 92 94 95
+ 182 8 92 94 106
+ 183 9 95 94 106
+ 184 10 96 95 94
+ 185 11 95 96 97
+ 186 11 95 96 98
+ 187 11 95 96 101
+ 188 5 97 96 98
+ 189 5 97 96 101
+ 190 5 98 96 101
+ 191 5 103 102 104
+ 192 5 103 102 105
+ 193 6 92 102 103
+ 194 5 104 102 105
+ 195 6 92 102 104
+ 196 6 92 102 105
+ 197 2 109 107 108
+ 198 1 117 107 109
+ 199 2 109 107 123
+ 200 4 117 107 108
+ 201 12 108 107 123
+ 202 4 117 107 123
+ 203 13 114 108 115
+ 204 14 107 108 114
+ 205 14 92 108 114
+ 206 14 107 108 115
+ 207 14 92 108 115
+ 208 15 107 108 92
+ 209 7 107 109 110
+ 210 8 107 109 121
+ 211 9 110 109 121
+ 212 10 111 110 109
+ 213 11 110 111 112
+ 214 11 110 111 113
+ 215 11 110 111 116
+ 216 5 112 111 113
+ 217 5 112 111 116
+ 218 5 113 111 116
+ 219 5 118 117 119
+ 220 5 118 117 120
+ 221 6 107 117 118
+ 222 5 119 117 120
+ 223 6 107 117 119
+ 224 6 107 117 120
+ 225 2 124 122 123
+ 226 1 132 122 124
+ 227 2 124 122 139
+ 228 4 132 122 123
+ 229 12 123 122 139
+ 230 4 132 122 139
+ 231 13 129 123 130
+ 232 14 122 123 129
+ 233 14 107 123 129
+ 234 14 122 123 130
+ 235 14 107 123 130
+ 236 15 122 123 107
+ 237 7 122 124 125
+ 238 8 122 124 136
+ 239 9 125 124 136
+ 240 10 126 125 124
+ 241 11 125 126 127
+ 242 11 125 126 128
+ 243 11 125 126 131
+ 244 5 127 126 128
+ 245 5 127 126 131
+ 246 5 128 126 131
+ 247 5 133 132 134
+ 248 5 133 132 135
+ 249 6 122 132 133
+ 250 5 134 132 135
+ 251 6 122 132 134
+ 252 6 122 132 135
+ 253 16 140 138 137
+ 254 17 137 138 139
+ 255 18 148 138 137
+ 256 19 140 138 139
+ 257 20 148 138 140
+ 258 21 148 138 139
+ 259 13 145 139 146
+ 260 22 145 139 138
+ 261 14 122 139 145
+ 262 22 146 139 138
+ 263 14 122 139 146
+ 264 23 122 139 138
+ 265 24 141 140 138
+ 266 25 152 140 138
+ 267 9 141 140 152
+ 268 10 142 141 140
+ 269 11 141 142 143
+ 270 11 141 142 144
+ 271 11 141 142 147
+ 272 5 143 142 144
+ 273 5 143 142 147
+ 274 5 144 142 147
+ 275 5 149 148 150
+ 276 5 149 148 151
+ 277 26 149 148 138
+ 278 5 150 148 151
+ 279 26 150 148 138
+ 280 26 151 148 138
+
+Dihedrals
+
+ 1 1 2 1 3 4
+ 2 2 2 1 3 16
+ 3 1 12 1 3 4
+ 4 2 12 1 3 16
+ 5 3 18 1 3 4
+ 6 4 18 1 3 16
+ 7 5 3 1 2 7
+ 8 5 3 1 2 9
+ 9 5 3 1 2 10
+ 10 6 12 1 2 7
+ 11 6 12 1 2 9
+ 12 6 12 1 2 10
+ 13 7 18 1 2 7
+ 14 7 18 1 2 9
+ 15 7 18 1 2 10
+ 16 5 3 1 12 13
+ 17 5 3 1 12 14
+ 18 5 3 1 12 15
+ 19 6 2 1 12 13
+ 20 6 2 1 12 14
+ 21 6 2 1 12 15
+ 22 7 18 1 12 13
+ 23 7 18 1 12 14
+ 24 7 18 1 12 15
+ 25 8 3 1 18 24
+ 26 8 3 1 18 25
+ 27 9 3 1 18 17
+ 28 10 2 1 18 24
+ 29 10 2 1 18 25
+ 30 11 2 1 18 17
+ 31 10 12 1 18 24
+ 32 10 12 1 18 25
+ 33 11 12 1 18 17
+ 34 12 1 3 4 5
+ 35 13 16 3 4 5
+ 36 14 6 5 4 3
+ 37 14 8 5 4 3
+ 38 14 11 5 4 3
+ 39 3 18 17 19 20
+ 40 4 18 17 19 31
+ 41 1 27 17 19 20
+ 42 2 27 17 19 31
+ 43 3 33 17 19 20
+ 44 4 33 17 19 31
+ 45 8 19 17 18 24
+ 46 8 19 17 18 25
+ 47 9 19 17 18 1
+ 48 10 27 17 18 24
+ 49 10 27 17 18 25
+ 50 11 27 17 18 1
+ 51 15 33 17 18 24
+ 52 15 33 17 18 25
+ 53 16 33 17 18 1
+ 54 5 19 17 27 28
+ 55 5 19 17 27 29
+ 56 5 19 17 27 30
+ 57 7 18 17 27 28
+ 58 7 18 17 27 29
+ 59 7 18 17 27 30
+ 60 7 33 17 27 28
+ 61 7 33 17 27 29
+ 62 7 33 17 27 30
+ 63 8 19 17 33 39
+ 64 8 19 17 33 40
+ 65 9 19 17 33 32
+ 66 15 18 17 33 39
+ 67 15 18 17 33 40
+ 68 16 18 17 33 32
+ 69 10 27 17 33 39
+ 70 10 27 17 33 40
+ 71 11 27 17 33 32
+ 72 12 17 19 20 21
+ 73 13 31 19 20 21
+ 74 14 22 21 20 19
+ 75 14 23 21 20 19
+ 76 14 26 21 20 19
+ 77 3 33 32 34 35
+ 78 4 33 32 34 46
+ 79 1 42 32 34 35
+ 80 2 42 32 34 46
+ 81 3 48 32 34 35
+ 82 4 48 32 34 46
+ 83 8 34 32 33 39
+ 84 8 34 32 33 40
+ 85 9 34 32 33 17
+ 86 10 42 32 33 39
+ 87 10 42 32 33 40
+ 88 11 42 32 33 17
+ 89 15 48 32 33 39
+ 90 15 48 32 33 40
+ 91 16 48 32 33 17
+ 92 5 34 32 42 43
+ 93 5 34 32 42 44
+ 94 5 34 32 42 45
+ 95 7 33 32 42 43
+ 96 7 33 32 42 44
+ 97 7 33 32 42 45
+ 98 7 48 32 42 43
+ 99 7 48 32 42 44
+ 100 7 48 32 42 45
+ 101 8 34 32 48 54
+ 102 8 34 32 48 55
+ 103 9 34 32 48 47
+ 104 15 33 32 48 54
+ 105 15 33 32 48 55
+ 106 16 33 32 48 47
+ 107 10 42 32 48 54
+ 108 10 42 32 48 55
+ 109 11 42 32 48 47
+ 110 12 32 34 35 36
+ 111 13 46 34 35 36
+ 112 14 37 36 35 34
+ 113 14 38 36 35 34
+ 114 14 41 36 35 34
+ 115 3 48 47 49 50
+ 116 4 48 47 49 61
+ 117 1 57 47 49 50
+ 118 2 57 47 49 61
+ 119 3 63 47 49 50
+ 120 4 63 47 49 61
+ 121 8 49 47 48 54
+ 122 8 49 47 48 55
+ 123 9 49 47 48 32
+ 124 10 57 47 48 54
+ 125 10 57 47 48 55
+ 126 11 57 47 48 32
+ 127 15 63 47 48 54
+ 128 15 63 47 48 55
+ 129 16 63 47 48 32
+ 130 5 49 47 57 58
+ 131 5 49 47 57 59
+ 132 5 49 47 57 60
+ 133 7 48 47 57 58
+ 134 7 48 47 57 59
+ 135 7 48 47 57 60
+ 136 7 63 47 57 58
+ 137 7 63 47 57 59
+ 138 7 63 47 57 60
+ 139 8 49 47 63 69
+ 140 8 49 47 63 70
+ 141 9 49 47 63 62
+ 142 15 48 47 63 69
+ 143 15 48 47 63 70
+ 144 16 48 47 63 62
+ 145 10 57 47 63 69
+ 146 10 57 47 63 70
+ 147 11 57 47 63 62
+ 148 12 47 49 50 51
+ 149 13 61 49 50 51
+ 150 14 52 51 50 49
+ 151 14 53 51 50 49
+ 152 14 56 51 50 49
+ 153 3 63 62 64 65
+ 154 4 63 62 64 76
+ 155 1 72 62 64 65
+ 156 2 72 62 64 76
+ 157 3 78 62 64 65
+ 158 4 78 62 64 76
+ 159 8 64 62 63 69
+ 160 8 64 62 63 70
+ 161 9 64 62 63 47
+ 162 10 72 62 63 69
+ 163 10 72 62 63 70
+ 164 11 72 62 63 47
+ 165 15 78 62 63 69
+ 166 15 78 62 63 70
+ 167 16 78 62 63 47
+ 168 5 64 62 72 73
+ 169 5 64 62 72 74
+ 170 5 64 62 72 75
+ 171 7 63 62 72 73
+ 172 7 63 62 72 74
+ 173 7 63 62 72 75
+ 174 7 78 62 72 73
+ 175 7 78 62 72 74
+ 176 7 78 62 72 75
+ 177 8 64 62 78 84
+ 178 8 64 62 78 85
+ 179 9 64 62 78 77
+ 180 15 63 62 78 84
+ 181 15 63 62 78 85
+ 182 16 63 62 78 77
+ 183 10 72 62 78 84
+ 184 10 72 62 78 85
+ 185 11 72 62 78 77
+ 186 12 62 64 65 66
+ 187 13 76 64 65 66
+ 188 14 67 66 65 64
+ 189 14 68 66 65 64
+ 190 14 71 66 65 64
+ 191 3 78 77 79 80
+ 192 4 78 77 79 91
+ 193 1 87 77 79 80
+ 194 2 87 77 79 91
+ 195 3 93 77 79 80
+ 196 4 93 77 79 91
+ 197 8 79 77 78 84
+ 198 8 79 77 78 85
+ 199 9 79 77 78 62
+ 200 10 87 77 78 84
+ 201 10 87 77 78 85
+ 202 11 87 77 78 62
+ 203 15 93 77 78 84
+ 204 15 93 77 78 85
+ 205 16 93 77 78 62
+ 206 5 79 77 87 88
+ 207 5 79 77 87 89
+ 208 5 79 77 87 90
+ 209 7 78 77 87 88
+ 210 7 78 77 87 89
+ 211 7 78 77 87 90
+ 212 7 93 77 87 88
+ 213 7 93 77 87 89
+ 214 7 93 77 87 90
+ 215 8 79 77 93 99
+ 216 8 79 77 93 100
+ 217 9 79 77 93 92
+ 218 15 78 77 93 99
+ 219 15 78 77 93 100
+ 220 16 78 77 93 92
+ 221 10 87 77 93 99
+ 222 10 87 77 93 100
+ 223 11 87 77 93 92
+ 224 12 77 79 80 81
+ 225 13 91 79 80 81
+ 226 14 82 81 80 79
+ 227 14 83 81 80 79
+ 228 14 86 81 80 79
+ 229 3 93 92 94 95
+ 230 4 93 92 94 106
+ 231 1 102 92 94 95
+ 232 2 102 92 94 106
+ 233 3 108 92 94 95
+ 234 4 108 92 94 106
+ 235 8 94 92 93 99
+ 236 8 94 92 93 100
+ 237 9 94 92 93 77
+ 238 10 102 92 93 99
+ 239 10 102 92 93 100
+ 240 11 102 92 93 77
+ 241 15 108 92 93 99
+ 242 15 108 92 93 100
+ 243 16 108 92 93 77
+ 244 5 94 92 102 103
+ 245 5 94 92 102 104
+ 246 5 94 92 102 105
+ 247 7 93 92 102 103
+ 248 7 93 92 102 104
+ 249 7 93 92 102 105
+ 250 7 108 92 102 103
+ 251 7 108 92 102 104
+ 252 7 108 92 102 105
+ 253 8 94 92 108 114
+ 254 8 94 92 108 115
+ 255 9 94 92 108 107
+ 256 15 93 92 108 114
+ 257 15 93 92 108 115
+ 258 16 93 92 108 107
+ 259 10 102 92 108 114
+ 260 10 102 92 108 115
+ 261 11 102 92 108 107
+ 262 12 92 94 95 96
+ 263 13 106 94 95 96
+ 264 14 97 96 95 94
+ 265 14 98 96 95 94
+ 266 14 101 96 95 94
+ 267 3 108 107 109 110
+ 268 4 108 107 109 121
+ 269 1 117 107 109 110
+ 270 2 117 107 109 121
+ 271 3 123 107 109 110
+ 272 4 123 107 109 121
+ 273 8 109 107 108 114
+ 274 8 109 107 108 115
+ 275 9 109 107 108 92
+ 276 10 117 107 108 114
+ 277 10 117 107 108 115
+ 278 11 117 107 108 92
+ 279 15 123 107 108 114
+ 280 15 123 107 108 115
+ 281 16 123 107 108 92
+ 282 5 109 107 117 118
+ 283 5 109 107 117 119
+ 284 5 109 107 117 120
+ 285 7 108 107 117 118
+ 286 7 108 107 117 119
+ 287 7 108 107 117 120
+ 288 7 123 107 117 118
+ 289 7 123 107 117 119
+ 290 7 123 107 117 120
+ 291 8 109 107 123 129
+ 292 8 109 107 123 130
+ 293 9 109 107 123 122
+ 294 15 108 107 123 129
+ 295 15 108 107 123 130
+ 296 16 108 107 123 122
+ 297 10 117 107 123 129
+ 298 10 117 107 123 130
+ 299 11 117 107 123 122
+ 300 12 107 109 110 111
+ 301 13 121 109 110 111
+ 302 14 112 111 110 109
+ 303 14 113 111 110 109
+ 304 14 116 111 110 109
+ 305 3 123 122 124 125
+ 306 4 123 122 124 136
+ 307 1 132 122 124 125
+ 308 2 132 122 124 136
+ 309 3 139 122 124 125
+ 310 4 139 122 124 136
+ 311 8 124 122 123 129
+ 312 8 124 122 123 130
+ 313 9 124 122 123 107
+ 314 10 132 122 123 129
+ 315 10 132 122 123 130
+ 316 11 132 122 123 107
+ 317 15 139 122 123 129
+ 318 15 139 122 123 130
+ 319 16 139 122 123 107
+ 320 5 124 122 132 133
+ 321 5 124 122 132 134
+ 322 5 124 122 132 135
+ 323 7 123 122 132 133
+ 324 7 123 122 132 134
+ 325 7 123 122 132 135
+ 326 7 139 122 132 133
+ 327 7 139 122 132 134
+ 328 7 139 122 132 135
+ 329 8 124 122 139 145
+ 330 8 124 122 139 146
+ 331 17 124 122 139 138
+ 332 15 123 122 139 145
+ 333 15 123 122 139 146
+ 334 18 123 122 139 138
+ 335 10 132 122 139 145
+ 336 10 132 122 139 146
+ 337 19 132 122 139 138
+ 338 12 122 124 125 126
+ 339 13 136 124 125 126
+ 340 14 127 126 125 124
+ 341 14 128 126 125 124
+ 342 14 131 126 125 124
+ 343 20 141 140 138 137
+ 344 21 152 140 138 137
+ 345 22 141 140 138 139
+ 346 23 152 140 138 139
+ 347 24 141 140 138 148
+ 348 25 152 140 138 148
+ 349 26 145 139 138 137
+ 350 26 146 139 138 137
+ 351 27 122 139 138 137
+ 352 28 145 139 138 140
+ 353 28 146 139 138 140
+ 354 29 122 139 138 140
+ 355 30 145 139 138 148
+ 356 30 146 139 138 148
+ 357 31 122 139 138 148
+ 358 32 149 148 138 137
+ 359 32 150 148 138 137
+ 360 32 151 148 138 137
+ 361 33 149 148 138 140
+ 362 33 150 148 138 140
+ 363 33 151 148 138 140
+ 364 34 149 148 138 139
+ 365 34 150 148 138 139
+ 366 34 151 148 138 139
+ 367 35 138 140 141 142
+ 368 13 152 140 141 142
+ 369 14 143 142 141 140
+ 370 14 144 142 141 140
+ 371 14 147 142 141 140
+
+Impropers
+
+ 1 1 1 3 4 16
+ 2 1 17 19 20 31
+ 3 1 32 34 35 46
+ 4 1 47 49 50 61
+ 5 1 62 64 65 76
+ 6 1 77 79 80 91
+ 7 1 92 94 95 106
+ 8 1 107 109 110 121
+ 9 1 122 124 125 136
+ 10 2 141 140 152 138
+ 11 3 2 1 12 3
+ 12 4 2 1 3 18
+ 13 4 12 1 3 18
+ 14 5 2 1 12 18
+ 15 6 7 2 9 10
+ 16 7 1 2 9 7
+ 17 7 1 2 10 7
+ 18 7 1 2 10 9
+ 19 8 4 5 6 8
+ 20 8 4 5 6 11
+ 21 8 4 5 8 11
+ 22 6 6 5 8 11
+ 23 6 13 12 14 15
+ 24 7 1 12 14 13
+ 25 7 1 12 15 13
+ 26 7 1 12 15 14
+ 27 4 27 17 19 18
+ 28 9 19 17 18 33
+ 29 4 27 17 19 33
+ 30 10 27 17 18 33
+ 31 11 17 18 25 24
+ 32 11 1 18 25 24
+ 33 12 17 18 1 24
+ 34 12 17 18 1 25
+ 35 8 20 21 22 23
+ 36 8 20 21 22 26
+ 37 8 20 21 23 26
+ 38 6 22 21 23 26
+ 39 6 28 27 29 30
+ 40 7 17 27 29 28
+ 41 7 17 27 30 28
+ 42 7 17 27 30 29
+ 43 4 42 32 34 33
+ 44 9 34 32 33 48
+ 45 4 42 32 34 48
+ 46 10 42 32 33 48
+ 47 11 32 33 40 39
+ 48 11 17 33 40 39
+ 49 12 32 33 17 39
+ 50 12 32 33 17 40
+ 51 8 35 36 37 38
+ 52 8 35 36 37 41
+ 53 8 35 36 38 41
+ 54 6 37 36 38 41
+ 55 6 43 42 44 45
+ 56 7 32 42 44 43
+ 57 7 32 42 45 43
+ 58 7 32 42 45 44
+ 59 4 57 47 49 48
+ 60 9 49 47 48 63
+ 61 4 57 47 49 63
+ 62 10 57 47 48 63
+ 63 11 47 48 55 54
+ 64 11 32 48 55 54
+ 65 12 47 48 32 54
+ 66 12 47 48 32 55
+ 67 8 50 51 52 53
+ 68 8 50 51 52 56
+ 69 8 50 51 53 56
+ 70 6 52 51 53 56
+ 71 6 58 57 59 60
+ 72 7 47 57 59 58
+ 73 7 47 57 60 58
+ 74 7 47 57 60 59
+ 75 4 72 62 64 63
+ 76 9 64 62 63 78
+ 77 4 72 62 64 78
+ 78 10 72 62 63 78
+ 79 11 62 63 70 69
+ 80 11 47 63 70 69
+ 81 12 62 63 47 69
+ 82 12 62 63 47 70
+ 83 8 65 66 67 68
+ 84 8 65 66 67 71
+ 85 8 65 66 68 71
+ 86 6 67 66 68 71
+ 87 6 73 72 74 75
+ 88 7 62 72 74 73
+ 89 7 62 72 75 73
+ 90 7 62 72 75 74
+ 91 4 87 77 79 78
+ 92 9 79 77 78 93
+ 93 4 87 77 79 93
+ 94 10 87 77 78 93
+ 95 11 77 78 85 84
+ 96 11 62 78 85 84
+ 97 12 77 78 62 84
+ 98 12 77 78 62 85
+ 99 8 80 81 82 83
+ 100 8 80 81 82 86
+ 101 8 80 81 83 86
+ 102 6 82 81 83 86
+ 103 6 88 87 89 90
+ 104 7 77 87 89 88
+ 105 7 77 87 90 88
+ 106 7 77 87 90 89
+ 107 4 102 92 94 93
+ 108 9 94 92 93 108
+ 109 4 102 92 94 108
+ 110 10 102 92 93 108
+ 111 11 92 93 100 99
+ 112 11 77 93 100 99
+ 113 12 92 93 77 99
+ 114 12 92 93 77 100
+ 115 8 95 96 97 98
+ 116 8 95 96 97 101
+ 117 8 95 96 98 101
+ 118 6 97 96 98 101
+ 119 6 103 102 104 105
+ 120 7 92 102 104 103
+ 121 7 92 102 105 103
+ 122 7 92 102 105 104
+ 123 4 117 107 109 108
+ 124 9 109 107 108 123
+ 125 4 117 107 109 123
+ 126 10 117 107 108 123
+ 127 11 107 108 115 114
+ 128 11 92 108 115 114
+ 129 12 107 108 92 114
+ 130 12 107 108 92 115
+ 131 8 110 111 112 113
+ 132 8 110 111 112 116
+ 133 8 110 111 113 116
+ 134 6 112 111 113 116
+ 135 6 118 117 119 120
+ 136 7 107 117 119 118
+ 137 7 107 117 120 118
+ 138 7 107 117 120 119
+ 139 4 132 122 124 123
+ 140 9 124 122 123 139
+ 141 4 132 122 124 139
+ 142 10 132 122 123 139
+ 143 11 122 123 130 129
+ 144 11 107 123 130 129
+ 145 12 122 123 107 129
+ 146 12 122 123 107 130
+ 147 8 125 126 127 128
+ 148 8 125 126 127 131
+ 149 8 125 126 128 131
+ 150 6 127 126 128 131
+ 151 6 133 132 134 135
+ 152 7 122 132 134 133
+ 153 7 122 132 135 133
+ 154 7 122 132 135 134
+ 155 13 140 138 137 139
+ 156 14 148 138 140 137
+ 157 15 148 138 137 139
+ 158 16 148 138 140 139
+ 159 17 145 139 146 138
+ 160 11 122 139 146 145
+ 161 18 122 139 145 138
+ 162 18 122 139 146 138
+ 163 8 141 142 143 144
+ 164 8 141 142 143 147
+ 165 8 141 142 144 147
+ 166 6 143 142 144 147
+ 167 6 149 148 150 151
+ 168 19 149 148 150 138
+ 169 19 149 148 151 138
+ 170 19 150 148 151 138
+
diff --git a/tools/msi2lmp/test/reference/pmma-poly-class2c.data2 b/tools/msi2lmp/test/reference/pmma-poly-class2c.data2
new file mode 100644
index 000000000..b6a864db2
--- /dev/null
+++ b/tools/msi2lmp/test/reference/pmma-poly-class2c.data2
@@ -0,0 +1,1706 @@
+LAMMPS data file via write_data, version 6 Nov 2015-ICMS, timestep = 100
+
+152 atoms
+8 atom types
+151 bonds
+12 bond types
+280 angles
+26 angle types
+371 dihedrals
+35 dihedral types
+170 impropers
+19 improper types
+
+-3.0311810000000001e+00 1.6410415000000000e+01 xlo xhi
+-1.4383046999999999e+01 6.1102020000000001e+00 ylo yhi
+-1.1174386000000000e+01 3.6535850000000001e+00 zlo zhi
+
+Masses
+
+1 12.0112
+2 12.0112
+3 12.0112
+4 15.9994
+5 1.00797
+6 15.9994
+7 12.0112
+8 12.0112
+
+Pair Coeffs # lj/class2/coul/long
+
+1 0.054 4.01
+2 0.054 4.01
+3 0.12 3.81
+4 0.24 3.42
+5 0.02 2.995
+6 0.267 3.3
+7 0.054 4.01
+8 0.054 4.01
+
+Bond Coeffs # class2
+
+1 1.5202 253.707 -423.037 396.9
+2 1.53 299.67 -501.77 679.81
+3 1.53 299.67 -501.77 679.81
+4 1.101 345 -691.89 844.6
+5 1.3683 367.148 -794.791 1055.23
+6 1.202 851.14 -1918.49 2160.77
+7 1.43 326.727 -608.531 689.033
+8 1.101 345 -691.89 844.6
+9 1.101 345 -691.89 844.6
+10 1.5202 253.707 -423.037 396.9
+11 1.53 299.67 -501.77 679.81
+12 1.53 299.67 -501.77 679.81
+
+Angle Coeffs # class2
+
+1 108.53 51.9747 -9.4851 -10.9985
+2 108.53 51.9747 -9.4851 -10.9985
+3 112.67 39.516 -7.443 -9.5583
+4 112.67 39.516 -7.443 -9.5583
+5 107.66 39.641 -12.921 -2.4318
+6 110.77 41.453 -10.604 5.129
+7 100.318 38.8631 -3.8323 -7.9802
+8 123.145 55.5431 -17.2123 0.1348
+9 120.797 95.3446 -32.2869 6.3778
+10 113.288 61.2868 -28.9786 7.9929
+11 107.688 65.4801 -10.3498 5.8866
+12 112.67 39.516 -7.443 -9.5583
+13 107.66 39.641 -12.921 -2.4318
+14 110.77 41.453 -10.604 5.129
+15 112.67 39.516 -7.443 -9.5583
+16 107.734 40.6099 -28.8121 0
+17 110.77 41.453 -10.604 5.129
+18 110.77 41.453 -10.604 5.129
+19 108.53 51.9747 -9.4851 -10.9985
+20 108.53 51.9747 -9.4851 -10.9985
+21 112.67 39.516 -7.443 -9.5583
+22 110.77 41.453 -10.604 5.129
+23 112.67 39.516 -7.443 -9.5583
+24 100.318 38.8631 -3.8323 -7.9802
+25 123.145 55.5431 -17.2123 0.1348
+26 110.77 41.453 -10.604 5.129
+
+BondBond Coeffs
+
+1 5.4199 1.53 1.5202
+2 5.4199 1.5202 1.53
+3 0 1.53 1.53
+4 0 1.53 1.53
+5 5.3316 1.101 1.101
+6 3.3872 1.53 1.101
+7 19.1069 1.5202 1.3683
+8 46.0685 1.5202 1.202
+9 121.488 1.3683 1.202
+10 45.4503 1.43 1.3683
+11 5.6454 1.43 1.101
+12 0 1.53 1.53
+13 5.3316 1.101 1.101
+14 3.3872 1.53 1.101
+15 0 1.53 1.53
+16 0.7115 1.5202 1.101
+17 3.3872 1.101 1.53
+18 3.3872 1.53 1.101
+19 5.4199 1.5202 1.53
+20 5.4199 1.53 1.5202
+21 0 1.53 1.53
+22 3.3872 1.101 1.53
+23 0 1.53 1.53
+24 19.1069 1.3683 1.5202
+25 46.0685 1.202 1.5202
+26 3.3872 1.101 1.53
+
+BondAngle Coeffs
+
+1 18.1678 15.8758 1.53 1.5202
+2 15.8758 18.1678 1.5202 1.53
+3 8.016 8.016 1.53 1.53
+4 8.016 8.016 1.53 1.53
+5 18.103 18.103 1.101 1.101
+6 20.754 11.421 1.53 1.101
+7 1.3435 4.6978 1.5202 1.3683
+8 34.9982 37.1298 1.5202 1.202
+9 71.8761 76.2614 1.3683 1.202
+10 41.9116 46.4608 1.43 1.3683
+11 57.4975 8.6864 1.43 1.101
+12 8.016 8.016 1.53 1.53
+13 18.103 18.103 1.101 1.101
+14 20.754 11.421 1.53 1.101
+15 8.016 8.016 1.53 1.53
+16 12.4632 9.1765 1.5202 1.101
+17 11.421 20.754 1.101 1.53
+18 20.754 11.421 1.53 1.101
+19 15.8758 18.1678 1.5202 1.53
+20 18.1678 15.8758 1.53 1.5202
+21 8.016 8.016 1.53 1.53
+22 11.421 20.754 1.101 1.53
+23 8.016 8.016 1.53 1.53
+24 4.6978 1.3435 1.3683 1.5202
+25 37.1298 34.9982 1.202 1.5202
+26 11.421 20.754 1.101 1.53
+
+Dihedral Coeffs # class2
+
+1 1.8341 0 2.0603 0 -0.0195 0
+2 0.0442 0 0.0292 0 0.0562 0
+3 1.8341 0 2.0603 0 -0.0195 0
+4 0.0442 0 0.0292 0 0.0562 0
+5 -0.0228 0 0.028 0 -0.1863 0
+6 0 0 0.0316 0 -0.1681 0
+7 0 0 0.0316 0 -0.1681 0
+8 -0.0228 0 0.028 0 -0.1863 0
+9 0.0972 0 0.0722 0 -0.2581 0
+10 0 0 0.0316 0 -0.1681 0
+11 0 0 0.0514 0 -0.143 0
+12 -2.5594 0 2.2013 0 0.0325 0
+13 -2.5594 0 2.2013 0 0.0325 0
+14 0 0 0 0 -0.1932 0
+15 0 0 0.0316 0 -0.1681 0
+16 0 0 0.0514 0 -0.143 0
+17 0.0972 0 0.0722 0 -0.2581 0
+18 0 0 0.0514 0 -0.143 0
+19 0 0 0.0514 0 -0.143 0
+20 -0.6359 0 1.4807 0 -0.0438 0
+21 -0.1804 0 0.0012 0 0.0371 0
+22 1.8341 0 2.0603 0 -0.0195 0
+23 0.0442 0 0.0292 0 0.0562 0
+24 1.8341 0 2.0603 0 -0.0195 0
+25 0.0442 0 0.0292 0 0.0562 0
+26 -0.1432 0 0.0617 0 -0.1083 0
+27 0 0 0.0316 0 -0.1681 0
+28 -0.0228 0 0.028 0 -0.1863 0
+29 0.0972 0 0.0722 0 -0.2581 0
+30 0 0 0.0316 0 -0.1681 0
+31 0 0 0.0514 0 -0.143 0
+32 -0.1432 0 0.0617 0 -0.1083 0
+33 -0.0228 0 0.028 0 -0.1863 0
+34 0 0 0.0316 0 -0.1681 0
+35 -2.5594 0 2.2013 0 0.0325 0
+
+AngleAngleTorsion Coeffs
+
+1 0 108.53 100.318
+2 -8.019 108.53 123.145
+3 0 108.53 100.318
+4 -8.019 108.53 123.145
+5 -5.3624 108.53 110.77
+6 -16.164 112.67 110.77
+7 -16.164 112.67 110.77
+8 -5.3624 108.53 110.77
+9 -0.3801 108.53 112.67
+10 -16.164 112.67 110.77
+11 -22.045 112.67 112.67
+12 0 100.318 113.288
+13 0 120.797 113.288
+14 0 107.688 113.288
+15 -16.164 112.67 110.77
+16 -22.045 112.67 112.67
+17 -0.3801 108.53 112.67
+18 -22.045 112.67 112.67
+19 -22.045 112.67 112.67
+20 0 100.318 107.734
+21 -15.3496 123.145 107.734
+22 0 100.318 108.53
+23 -8.019 123.145 108.53
+24 0 100.318 108.53
+25 -8.019 123.145 108.53
+26 -12.564 110.77 110.77
+27 -16.164 112.67 110.77
+28 -5.3624 110.77 108.53
+29 -0.3801 112.67 108.53
+30 -16.164 110.77 112.67
+31 -22.045 112.67 112.67
+32 -12.564 110.77 110.77
+33 -5.3624 110.77 108.53
+34 -16.164 110.77 112.67
+35 0 100.318 113.288
+
+EndBondTorsion Coeffs
+
+1 0 0 0 0 0 0 1.53 1.3683
+2 0.2654 0.0503 0.1046 -0.281 0.0816 -0.1522 1.53 1.202
+3 0 0 0 0 0 0 1.53 1.3683
+4 0.2654 0.0503 0.1046 -0.281 0.0816 -0.1522 1.53 1.202
+5 -0.0204 0.3628 -0.4426 -0.0097 -0.0315 -0.0755 1.5202 1.101
+6 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.53 1.101
+7 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.53 1.101
+8 -0.0204 0.3628 -0.4426 -0.0097 -0.0315 -0.0755 1.5202 1.101
+9 0.0055 0.006 -0.0009 0.0062 -0.0002 0.0036 1.5202 1.53
+10 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.53 1.101
+11 -0.0732 0 0 -0.0732 0 0 1.53 1.53
+12 0 0 0 0 0 0 1.5202 1.43
+13 0 0 0 0 0 0 1.202 1.43
+14 0 0 0 0 0 0 1.101 1.3683
+15 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.53 1.101
+16 -0.0732 0 0 -0.0732 0 0 1.53 1.53
+17 0.0055 0.006 -0.0009 0.0062 -0.0002 0.0036 1.5202 1.53
+18 -0.0732 0 0 -0.0732 0 0 1.53 1.53
+19 -0.0732 0 0 -0.0732 0 0 1.53 1.53
+20 0 0 0 0 0 0 1.3683 1.101
+21 -0.2298 0.0354 0.3853 1.2143 0.2831 0.3916 1.202 1.101
+22 0 0 0 0 0 0 1.3683 1.53
+23 -0.281 0.0816 -0.1522 0.2654 0.0503 0.1046 1.202 1.53
+24 0 0 0 0 0 0 1.3683 1.53
+25 -0.281 0.0816 -0.1522 0.2654 0.0503 0.1046 1.202 1.53
+26 0.213 0.312 0.0777 0.213 0.312 0.0777 1.101 1.101
+27 0.2486 0.2422 -0.0925 0.0814 0.0591 0.2219 1.53 1.101
+28 -0.0097 -0.0315 -0.0755 -0.0204 0.3628 -0.4426 1.101 1.5202
+29 0.0062 -0.0002 0.0036 0.0055 0.006 -0.0009 1.53 1.5202
+30 0.0814 0.0591 0.2219 0.2486 0.2422 -0.0925 1.101 1.53
+31 -0.0732 0 0 -0.0732 0 0 1.53 1.53
+32 0.213 0.312 0.0777 0.213 0.312 0.0777 1.101 1.101
+33 -0.0097 -0.0315 -0.0755 -0.0204 0.3628 -0.4426 1.101 1.5202
+34 0.0814 0.0591 0.2219 0.2486 0.2422 -0.0925 1.101 1.53
+35 0 0 0 0 0 0 1.5202 1.43
+
+MiddleBondTorsion Coeffs
+
+1 -17.328 -5.79 -3.2114 1.5202
+2 0.3388 -0.1096 0.1219 1.5202
+3 -17.328 -5.79 -3.2114 1.5202
+4 0.3388 -0.1096 0.1219 1.5202
+5 -3.5039 1.2458 -0.761 1.53
+6 -14.879 -3.6581 -0.3138 1.53
+7 -14.879 -3.6581 -0.3138 1.53
+8 -3.5039 1.2458 -0.761 1.53
+9 -1.5945 0.2267 -0.6911 1.53
+10 -14.879 -3.6581 -0.3138 1.53
+11 -17.787 -7.1877 0 1.53
+12 1.3445 3.5515 -4.9202 1.3683
+13 4.26 0 0 1.3683
+14 0 0 0 1.43
+15 -14.879 -3.6581 -0.3138 1.53
+16 -17.787 -7.1877 0 1.53
+17 -1.5945 0.2267 -0.6911 1.53
+18 -17.787 -7.1877 0 1.53
+19 -17.787 -7.1877 0 1.53
+20 -13.7686 -2.5959 1.1934 1.5202
+21 0.2359 0.9139 0.9594 1.5202
+22 -17.328 -5.79 -3.2114 1.5202
+23 0.3388 -0.1096 0.1219 1.5202
+24 -17.328 -5.79 -3.2114 1.5202
+25 0.3388 -0.1096 0.1219 1.5202
+26 -14.261 -0.5322 -0.4864 1.53
+27 -14.879 -3.6581 -0.3138 1.53
+28 -3.5039 1.2458 -0.761 1.53
+29 -1.5945 0.2267 -0.6911 1.53
+30 -14.879 -3.6581 -0.3138 1.53
+31 -17.787 -7.1877 0 1.53
+32 -14.261 -0.5322 -0.4864 1.53
+33 -3.5039 1.2458 -0.761 1.53
+34 -14.879 -3.6581 -0.3138 1.53
+35 1.3445 3.5515 -4.9202 1.3683
+
+BondBond13 Coeffs
+
+1 0 1.53 1.3683
+2 0 1.53 1.202
+3 0 1.53 1.3683
+4 0 1.53 1.202
+5 0 1.5202 1.101
+6 0 1.53 1.101
+7 0 1.53 1.101
+8 0 1.5202 1.101
+9 0 1.5202 1.53
+10 0 1.53 1.101
+11 0 1.53 1.53
+12 0 1.5202 1.43
+13 0 1.202 1.43
+14 0 1.101 1.3683
+15 0 1.53 1.101
+16 0 1.53 1.53
+17 0 1.5202 1.53
+18 0 1.53 1.53
+19 0 1.53 1.53
+20 0 1.3683 1.101
+21 0 1.202 1.101
+22 0 1.3683 1.53
+23 0 1.202 1.53
+24 0 1.3683 1.53
+25 0 1.202 1.53
+26 0 1.101 1.101
+27 0 1.53 1.101
+28 0 1.101 1.5202
+29 0 1.53 1.5202
+30 0 1.101 1.53
+31 0 1.53 1.53
+32 0 1.101 1.101
+33 0 1.101 1.5202
+34 0 1.101 1.53
+35 0 1.5202 1.43
+
+AngleTorsion Coeffs
+
+1 0 0 0 0 0 0 108.53 100.318
+2 0.0885 -1.3703 -0.5452 0.675 0.5965 0.6725 108.53 123.145
+3 0 0 0 0 0 0 108.53 100.318
+4 0.0885 -1.3703 -0.5452 0.675 0.5965 0.6725 108.53 123.145
+5 -0.7466 -0.9448 -0.6321 0.0162 1.4211 -1.4092 108.53 110.77
+6 -0.2454 0 -0.1136 0.3113 0.4516 -0.1988 112.67 110.77
+7 -0.2454 0 -0.1136 0.3113 0.4516 -0.1988 112.67 110.77
+8 -0.7466 -0.9448 -0.6321 0.0162 1.4211 -1.4092 108.53 110.77
+9 0.0515 -0.0674 -0.0474 -0.2607 0.3203 -0.2283 108.53 112.67
+10 -0.2454 0 -0.1136 0.3113 0.4516 -0.1988 112.67 110.77
+11 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.67 112.67
+12 0 0 0 0 0 0 100.318 113.288
+13 0 0 0 0 0 0 120.797 113.288
+14 0 0 0 0 0 0 107.688 113.288
+15 -0.2454 0 -0.1136 0.3113 0.4516 -0.1988 112.67 110.77
+16 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.67 112.67
+17 0.0515 -0.0674 -0.0474 -0.2607 0.3203 -0.2283 108.53 112.67
+18 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.67 112.67
+19 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.67 112.67
+20 0 0 0 0 0 0 100.318 107.734
+21 -1.4946 0.7308 -0.2083 9.1299 -0.4847 0.3582 123.145 107.734
+22 0 0 0 0 0 0 100.318 108.53
+23 0.675 0.5965 0.6725 0.0885 -1.3703 -0.5452 123.145 108.53
+24 0 0 0 0 0 0 100.318 108.53
+25 0.675 0.5965 0.6725 0.0885 -1.3703 -0.5452 123.145 108.53
+26 -0.8085 0.5569 -0.2466 -0.8085 0.5569 -0.2466 110.77 110.77
+27 -0.2454 0 -0.1136 0.3113 0.4516 -0.1988 112.67 110.77
+28 0.0162 1.4211 -1.4092 -0.7466 -0.9448 -0.6321 110.77 108.53
+29 -0.2607 0.3203 -0.2283 0.0515 -0.0674 -0.0474 112.67 108.53
+30 0.3113 0.4516 -0.1988 -0.2454 0 -0.1136 110.77 112.67
+31 0.3886 -0.3139 0.1389 0.3886 -0.3139 0.1389 112.67 112.67
+32 -0.8085 0.5569 -0.2466 -0.8085 0.5569 -0.2466 110.77 110.77
+33 0.0162 1.4211 -1.4092 -0.7466 -0.9448 -0.6321 110.77 108.53
+34 0.3113 0.4516 -0.1988 -0.2454 0 -0.1136 110.77 112.67
+35 0 0 0 0 0 0 100.318 113.288
+
+Improper Coeffs # class2
+
+1 46.9264 0
+2 46.9264 0
+3 0 0
+4 0 0
+5 0 0
+6 0 0
+7 0 0
+8 0 0
+9 0 0
+10 0 0
+11 0 0
+12 0 0
+13 0 0
+14 0 0
+15 0 0
+16 0 0
+17 0 0
+18 0 0
+19 0 0
+
+AngleAngle Coeffs
+
+1 0 0 0 100.318 120.797 123.145
+2 0 0 0 120.797 123.145 100.318
+3 0 0 0 112.67 108.53 108.53
+4 0 0 0 108.53 108.53 112.67
+5 -0.1729 -0.1729 -0.1729 112.67 112.67 112.67
+6 -0.3157 -0.3157 -0.3157 107.66 107.66 107.66
+7 0.2738 -0.4825 0.2738 110.77 107.66 110.77
+8 0 0 0 107.688 107.66 107.688
+9 0 0 0 108.53 112.67 108.53
+10 -0.1729 -0.1729 -0.1729 112.67 112.67 112.67
+11 0.2738 -0.4825 0.2738 110.77 107.66 110.77
+12 -1.3199 -1.3199 0.1184 112.67 110.77 110.77
+13 1.0827 2.0403 -1.8202 107.734 110.77 108.53
+14 2.0403 -1.8202 1.0827 108.53 107.734 110.77
+15 0.1184 -1.3199 -1.3199 110.77 110.77 112.67
+16 0 0 0 108.53 108.53 112.67
+17 0.2738 0.2738 -0.4825 107.66 110.77 110.77
+18 0.1184 -1.3199 -1.3199 110.77 110.77 112.67
+19 0.2738 0.2738 -0.4825 107.66 110.77 110.77
+
+Atoms # full
+
+86 6 5 5.2999999999999999e-02 3.9902220372093988e+00 -8.9828006041352602e+00 -3.7874107590467911e+00 0 0 0
+107 8 1 0.0000000000000000e+00 8.2633282363978804e+00 -8.5648528116481373e+00 -6.7699466004144258e+00 0 0 0
+109 8 3 2.6600000000000001e-01 8.4569207335879391e+00 -7.8711051275377768e+00 -8.1037872679957967e+00 0 0 0
+110 8 4 -2.6600000000000001e-01 7.2671361241254901e+00 -7.8357751479238393e+00 -8.7377589011371857e+00 0 0 0
+113 8 5 5.2999999999999999e-02 7.9768069272106379e+00 -7.7240509881408999e+00 -1.0675250604051049e+01 0 0 0
+114 8 5 5.2999999999999999e-02 7.1543125419736677e+00 -8.1424161271508630e+00 -4.9915385388336446e+00 0 0 0
+117 8 2 -1.5900000000000000e-01 7.1677351877642206e+00 -9.6261265060448462e+00 -6.9601981639404666e+00 0 0 0
+118 8 5 5.2999999999999999e-02 7.0990161689369620e+00 -1.0242592415438528e+01 -6.0502226573680487e+00 0 0 0
+119 8 5 5.2999999999999999e-02 7.3462821036928450e+00 -1.0295247417834481e+01 -7.8140393191832400e+00 0 0 0
+120 8 5 5.2999999999999999e-02 6.1788346933739380e+00 -9.1608384779998211e+00 -7.0984245834741921e+00 0 0 0
+123 9 7 -1.0600000000000000e-01 9.5869331314513104e+00 -9.0798030281090547e+00 -6.1575132022082562e+00 0 0 0
+124 9 3 2.6600000000000001e-01 9.6946139186144809e+00 -1.1386423162944650e+01 -7.0591337742242013e+00 0 0 0
+125 9 4 -2.6600000000000001e-01 9.2234949595202327e+00 -1.1935996050982855e+01 -5.9223131448028390e+00 0 0 0
+126 9 2 -2.5999999999999999e-02 8.4427704390964564e+00 -1.3112786624031001e+01 -6.1055443076468494e+00 0 0 0
+127 9 5 5.2999999999999999e-02 8.1103727141932538e+00 -1.3475292379338027e+01 -5.1232327535360200e+00 0 0 0
+128 9 5 5.2999999999999999e-02 9.0560702779960440e+00 -1.3882624854491683e+01 -6.5941721784825553e+00 0 0 0
+130 9 5 5.2999999999999999e-02 9.2844743027100733e+00 -9.4659743568253116e+00 -5.1691010568738376e+00 0 0 0
+131 9 5 5.2999999999999999e-02 7.5672635432483881e+00 -1.2876768612875996e+01 -6.7262153623659051e+00 0 0 0
+136 9 6 -1.3300000000000001e-01 9.4663588995793138e+00 -1.1823913919909026e+01 -8.1532910848118618e+00 0 0 0
+122 9 1 0.0000000000000000e+00 1.0529280374781957e+01 -1.0165592322483350e+01 -6.7276792175796416e+00 0 0 0
+129 9 5 5.2999999999999999e-02 1.0218852454041704e+01 -8.2012977690972750e+00 -5.9581146302643573e+00 0 0 0
+132 9 2 -1.5900000000000000e-01 1.1398625354585612e+01 -1.0560520118533523e+01 -5.5215496579237149e+00 0 0 0
+133 9 5 5.2999999999999999e-02 1.2055607178228499e+01 -9.7209111001256385e+00 -5.2504565548414730e+00 0 0 0
+134 9 5 5.2999999999999999e-02 1.2029082605788490e+01 -1.1436232924980825e+01 -5.7372981823494191e+00 0 0 0
+135 9 5 5.2999999999999999e-02 1.0803846101807263e+01 -1.0789823496034620e+01 -4.6239136577543345e+00 0 0 0
+137 10 5 5.2999999999999999e-02 1.2890859521823060e+01 -8.8101946147992045e+00 -9.0088271245901073e+00 0 0 0
+138 10 8 -5.2999999999999999e-02 1.2618538626289070e+01 -8.9543838459654683e+00 -7.9472173948065805e+00 0 0 0
+139 10 7 -1.0600000000000000e-01 1.1359524709470909e+01 -9.8629022231599333e+00 -7.9925810083300579e+00 0 0 0
+140 10 3 2.6600000000000001e-01 1.3814468845214556e+01 -9.6513683515034021e+00 -7.3098551412059507e+00 0 0 0
+141 10 4 -2.6600000000000001e-01 1.3878806669288046e+01 -1.0934645534670711e+01 -7.7149785818661840e+00 0 0 0
+142 10 2 -2.5999999999999999e-02 1.4959085544276796e+01 -1.1683383675003901e+01 -7.1677808822414866e+00 0 0 0
+143 10 5 5.2999999999999999e-02 1.4917147767508867e+01 -1.2707957063302977e+01 -7.5621979846458469e+00 0 0 0
+144 10 5 5.2999999999999999e-02 1.4867367968251058e+01 -1.1706646527099769e+01 -6.0729593203923109e+00 0 0 0
+145 10 5 5.2999999999999999e-02 1.1682556358457488e+01 -1.0835936408980064e+01 -8.4017090832845867e+00 0 0 0
+146 10 5 5.2999999999999999e-02 1.0694703435270332e+01 -9.4590697257622427e+00 -8.7718558391085999e+00 0 0 0
+147 10 5 5.2999999999999999e-02 1.5910092315653802e+01 -1.1215733155291305e+01 -7.4582688828252479e+00 0 0 0
+148 10 2 -1.5900000000000000e-01 1.2528563924906949e+01 -7.5681199173505895e+00 -7.3157403048828904e+00 0 0 0
+151 10 5 5.2999999999999999e-02 1.2349336006395569e+01 -7.6159721080943257e+00 -6.2326051514605592e+00 0 0 0
+152 10 6 -1.3300000000000001e-01 1.4598767304333006e+01 -9.1521758083925260e+00 -6.5511000799551509e+00 0 0 0
+37 3 5 5.2999999999999999e-02 -1.5103549036479871e+00 -1.5275117880083993e+00 -4.3571978835773733e+00 0 0 0
+41 3 5 5.2999999999999999e-02 -5.9575075038510228e-01 -3.0638604226540789e+00 -4.1299108674727298e+00 0 0 0
+46 3 6 -1.3300000000000001e-01 1.0270157907970527e+00 -1.0276540686350590e+00 -4.1689262591014291e+00 0 0 0
+70 5 5 5.2999999999999999e-02 3.3515958718305101e+00 -1.6382443977706445e+00 -4.2059949862762895e+00 0 0 0
+73 5 5 5.2999999999999999e-02 3.0311425076247955e+00 -4.6791602588217867e+00 -4.6824943589947452e+00 0 0 0
+75 5 5 5.2999999999999999e-02 3.0678151900082908e+00 -3.2010843720187960e+00 -5.6504683374532014e+00 0 0 0
+62 5 1 0.0000000000000000e+00 4.6203533356123039e+00 -3.3262980497687491e+00 -4.1103242262989896e+00 0 0 0
+64 5 3 2.6600000000000001e-01 5.6531331609336881e+00 -2.4727189518671193e+00 -4.8328653810657185e+00 0 0 0
+65 5 4 -2.6600000000000001e-01 5.1105279741705489e+00 -2.0222890956873458e+00 -5.9813232973565809e+00 0 0 0
+66 5 2 -2.5999999999999999e-02 5.9707299282388000e+00 -1.2036495263308828e+00 -6.7666373050847621e+00 0 0 0
+68 5 5 5.2999999999999999e-02 5.4347414982701920e+00 -8.9255480721442959e-01 -7.6737592310829355e+00 0 0 0
+71 5 5 5.2999999999999999e-02 6.8645144384547425e+00 -1.7788722222601550e+00 -7.0459298332663503e+00 0 0 0
+72 5 2 -1.5900000000000000e-01 3.7070045194809600e+00 -3.9591038390551567e+00 -5.1705374411137193e+00 0 0 0
+74 5 5 5.2999999999999999e-02 4.2553710602335828e+00 -4.4887663093042365e+00 -5.9631646620213861e+00 0 0 0
+76 5 6 -1.3300000000000001e-01 6.7682921762358523e+00 -2.2057115890479859e+00 -4.4819935372282664e+00 0 0 0
+79 6 3 2.6600000000000001e-01 5.0491547367775977e+00 -6.6028584004712254e+00 -4.0040863408708089e+00 0 0 0
+91 6 6 -1.3300000000000001e-01 4.6804090312929052e+00 -6.8607530002422417e+00 -5.1150727810652956e+00 0 0 0
+92 7 1 0.0000000000000000e+00 8.1915130616879690e+00 -6.2762007497572290e+00 -5.2274591375141775e+00 0 0 0
+93 7 7 -1.0600000000000000e-01 7.1246914825870453e+00 -5.2984984879168460e+00 -4.6729809436919965e+00 0 0 0
+94 7 3 2.6600000000000001e-01 9.1352405775114942e+00 -6.6173289102723318e+00 -4.0930394577756548e+00 0 0 0
+99 7 5 5.2999999999999999e-02 6.5676368474596183e+00 -4.9473161047412706e+00 -5.5583393820157605e+00 0 0 0
+100 7 5 5.2999999999999999e-02 7.6959144983464816e+00 -4.4333002923523086e+00 -4.2987732374633021e+00 0 0 0
+102 7 2 -1.5900000000000000e-01 8.9565751139108070e+00 -5.3909224092396153e+00 -6.2221291239070338e+00 0 0 0
+103 7 5 5.2999999999999999e-02 8.3312550805224692e+00 -5.2259974474205366e+00 -7.1136855611413639e+00 0 0 0
+104 7 5 5.2999999999999999e-02 9.9091341985993626e+00 -5.8329389205141204e+00 -6.5472472902655960e+00 0 0 0
+105 7 5 5.2999999999999999e-02 9.1755771822428454e+00 -4.3975743089236419e+00 -5.8001893287162414e+00 0 0 0
+108 8 7 -1.0600000000000000e-01 7.5566510800420783e+00 -7.5487313159389586e+00 -5.8309640690227962e+00 0 0 0
+111 8 2 -2.5999999999999999e-02 7.2838846544035754e+00 -7.1930304939428380e+00 -1.0007852478505272e+01 0 0 0
+112 8 5 5.2999999999999999e-02 6.2710615343372842e+00 -7.2195313560877397e+00 -1.0432786029146078e+01 0 0 0
+115 8 5 5.2999999999999999e-02 6.6857055447016158e+00 -7.1900642060013533e+00 -6.4034901318327986e+00 0 0 0
+116 8 5 5.2999999999999999e-02 7.6028363426666896e+00 -6.1488980542603073e+00 -9.8828717649474314e+00 0 0 0
+121 8 6 -1.3300000000000001e-01 9.4577243013932204e+00 -7.4016997612928925e+00 -8.5643610923878395e+00 0 0 0
+95 7 4 -2.6600000000000001e-01 9.9354811976634689e+00 -5.5572043262084767e+00 -3.8661503019766372e+00 0 0 0
+149 10 5 5.2999999999999999e-02 1.1733926311800024e+01 -6.9711242142093326e+00 -7.7811512729399874e+00 0 0 0
+150 10 5 5.2999999999999999e-02 1.3479173539642288e+01 -7.0360198496004180e+00 -7.4794973443300199e+00 0 0 0
+27 2 2 -1.5900000000000000e-01 6.1179491039827671e-01 1.9926048560334255e+00 -3.8510343957265722e+00 0 0 0
+28 2 5 5.2999999999999999e-02 -2.8908988308960132e-01 1.3890151601783345e+00 -4.0439752535042626e+00 0 0 0
+29 2 5 5.2999999999999999e-02 1.4631907611756072e+00 1.5070638437236141e+00 -4.3503714533012925e+00 0 0 0
+30 2 5 5.2999999999999999e-02 4.4759045167320122e-01 2.9693592145194727e+00 -4.3327187917888788e+00 0 0 0
+23 2 5 5.2999999999999999e-02 3.6964181288556932e+00 5.0315017379470275e+00 -3.9357057569591816e+00 0 0 0
+67 5 5 5.2999999999999999e-02 6.2575163980225170e+00 -3.1573816387448106e-01 -6.1861313621512695e+00 0 0 0
+82 6 5 5.2999999999999999e-02 2.7044538657773254e+00 -7.7256789320914896e+00 -3.6642443876781030e+00 0 0 0
+83 6 5 5.2999999999999999e-02 3.2337316587421610e+00 -8.6200352425176145e+00 -2.2002520846381994e+00 0 0 0
+81 6 2 -2.5999999999999999e-02 3.5610659280494961e+00 -8.1912316937263512e+00 -3.1573199589617333e+00 0 0 0
+106 7 6 -1.3300000000000001e-01 9.1971358685458284e+00 -7.6392880533611720e+00 -3.4682455308757629e+00 0 0 0
+34 3 3 2.6600000000000001e-01 6.9532481614926422e-01 -1.0779581369332500e+00 -3.0181555190563256e+00 0 0 0
+35 3 4 -2.6600000000000001e-01 -4.3352512623237294e-01 -1.6845270457082107e+00 -2.6003462986240966e+00 0 0 0
+36 3 2 -2.5999999999999999e-02 -1.2017740690629182e+00 -2.2937281424144094e+00 -3.6325092128587841e+00 0 0 0
+38 3 5 5.2999999999999999e-02 -2.0920086478950877e+00 -2.7577002338317986e+00 -3.1861776383703027e+00 0 0 0
+42 3 2 -1.5900000000000000e-01 1.0174861707131899e+00 -1.3519627304505786e+00 -5.8308180200153881e-01 0 0 0
+43 3 5 5.2999999999999999e-02 1.6251994224424540e+00 -1.0405357431749069e+00 2.8128430602870119e-01 0 0 0
+44 3 5 5.2999999999999999e-02 1.1746361390107580e+00 -2.4290346371354121e+00 -7.3902499676230704e-01 0 0 0
+45 3 5 5.2999999999999999e-02 -3.6418640693223731e-02 -1.1998800214602452e+00 -3.0108048755022587e-01 0 0 0
+69 5 5 5.2999999999999999e-02 2.7534828020157276e+00 -2.9249797865426528e+00 -3.1516296309472760e+00 0 0 0
+47 4 1 0.0000000000000000e+00 3.9670095039410582e+00 -1.4391826220942840e+00 -2.1915624079179121e+00 0 0 0
+49 4 3 2.6600000000000001e-01 3.9900296529496906e+00 -2.2401226090088739e+00 -9.0791636752877913e-01 0 0 0
+50 4 4 -2.6600000000000001e-01 4.5994579264259956e+00 -1.5080856324525853e+00 4.5387879330358968e-02 0 0 0
+51 4 2 -2.5999999999999999e-02 4.6872746646272514e+00 -2.1395255233944610e+00 1.3184715851285687e+00 0 0 0
+52 4 5 5.2999999999999999e-02 3.6749704931074580e+00 -2.3514321906752302e+00 1.6898664578996707e+00 0 0 0
+53 4 5 5.2999999999999999e-02 5.2007438210292918e+00 -1.4635333107619137e+00 2.0158409832676640e+00 0 0 0
+56 4 5 5.2999999999999999e-02 5.2586584680163835e+00 -3.0732976549275173e+00 1.2226065778872983e+00 0 0 0
+59 4 5 5.2999999999999999e-02 6.1720611859840515e+00 -1.2878029110558318e+00 -2.1516214885543081e+00 0 0 0
+61 4 6 -1.3300000000000001e-01 3.5466829434504046e+00 -3.3378716142720775e+00 -7.1630838699775634e-01 0 0 0
+63 5 7 -1.0600000000000000e-01 3.6521685580297953e+00 -2.3373102103787367e+00 -3.4080901856004626e+00 0 0 0
+77 6 1 0.0000000000000000e+00 6.0929997728826359e+00 -5.5877938642785354e+00 -3.5611240446201062e+00 0 0 0
+78 6 7 -1.0600000000000000e-01 5.3086256095581437e+00 -4.3123875902505739e+00 -3.1389392859975378e+00 0 0 0
+80 6 4 -2.6600000000000001e-01 4.5528412731043897e+00 -7.2020023306905339e+00 -2.9033991932977670e+00 0 0 0
+84 6 5 5.2999999999999999e-02 5.9952594719574508e+00 -3.7225235298446351e+00 -2.5072320331123525e+00 0 0 0
+85 6 5 5.2999999999999999e-02 4.5145586769652946e+00 -4.6792839662559080e+00 -2.4685083177103677e+00 0 0 0
+87 6 2 -1.5900000000000000e-01 6.6837676314242209e+00 -6.0726399404922189e+00 -2.2292264449530066e+00 0 0 0
+88 6 5 5.2999999999999999e-02 7.5447277916766122e+00 -5.4392519408218654e+00 -1.9628311576868951e+00 0 0 0
+89 6 5 5.2999999999999999e-02 7.0265984309396909e+00 -7.1171303299539046e+00 -2.2572547601085389e+00 0 0 0
+90 6 5 5.2999999999999999e-02 5.9523838690030999e+00 -5.9757580088599243e+00 -1.4110631651176633e+00 0 0 0
+96 7 2 -2.5999999999999999e-02 1.0892056369390902e+01 -5.7424833641753095e+00 -2.8281341789504535e+00 0 0 0
+97 7 5 5.2999999999999999e-02 1.1552036334233501e+01 -6.5818264926789061e+00 -3.0882557681933243e+00 0 0 0
+98 7 5 5.2999999999999999e-02 1.0369305279174972e+01 -5.9500586478103390e+00 -1.8841094177248696e+00 0 0 0
+101 7 5 5.2999999999999999e-02 1.1486943700241840e+01 -4.8246421760037643e+00 -2.7250193588640670e+00 0 0 0
+1 1 1 0.0000000000000000e+00 -6.3317681994073616e-01 3.6339854834621317e+00 -5.1956496762028048e-01 0 0 0
+2 1 2 -1.5900000000000000e-01 -1.6806990209283306e+00 4.7376228077208866e+00 -6.7446006433153094e-01 0 0 0
+3 1 3 2.6600000000000001e-01 -1.3874607903420040e+00 2.5108516079766123e+00 2.0256336220388116e-01 0 0 0
+4 1 4 -2.6600000000000001e-01 -8.3325131202230474e-01 2.3328885429893598e+00 1.4163825394336609e+00 0 0 0
+5 1 2 -2.5999999999999999e-02 -1.4174840484640518e+00 1.2936324082727060e+00 2.1946645611116242e+00 0 0 0
+6 1 5 5.2999999999999999e-02 -2.4764776900748280e+00 1.5251404168519431e+00 2.3744846267978645e+00 0 0 0
+7 1 5 5.2999999999999999e-02 -2.5306891362912820e+00 4.3916337115827311e+00 -1.2824244429574714e+00 0 0 0
+8 1 5 5.2999999999999999e-02 -8.8679444508441951e-01 1.2270400403697985e+00 3.1543045597020787e+00 0 0 0
+9 1 5 5.2999999999999999e-02 -1.2284748585938523e+00 5.6094949040682911e+00 -1.1718614776197103e+00 0 0 0
+10 1 5 5.2999999999999999e-02 -2.0700974523222242e+00 5.0612099365731975e+00 3.0305385297949289e-01 0 0 0
+11 1 5 5.2999999999999999e-02 -1.3243152083177734e+00 3.4040899187543633e-01 1.6558129898934559e+00 0 0 0
+12 1 2 -1.5900000000000000e-01 5.1277407515114271e-01 4.1497438340348021e+00 3.5263000127670785e-01 0 0 0
+13 1 5 5.2999999999999999e-02 1.0559239007071495e+00 4.9397931035156804e+00 -1.8981686827702954e-01 0 0 0
+14 1 5 5.2999999999999999e-02 1.2392287678287268e+00 3.3713577647593600e+00 6.2871306746891575e-01 0 0 0
+15 1 5 5.2999999999999999e-02 1.1752356456927671e-01 4.5985050338081246e+00 1.2781133703463374e+00 0 0 0
+16 1 6 -1.3300000000000001e-01 -2.3226976339700274e+00 1.8803316047459502e+00 -2.0358328849276122e-01 0 0 0
+17 2 1 0.0000000000000000e+00 8.0476233742571179e-01 2.1462014311789588e+00 -2.3362385842719919e+00 0 0 0
+18 2 7 -1.0600000000000000e-01 -2.9430197234065564e-01 3.1708427815979188e+00 -1.9528803198103732e+00 0 0 0
+19 2 3 2.6600000000000001e-01 2.1386907463574030e+00 2.8334814363066818e+00 -2.1028476298665413e+00 0 0 0
+20 2 4 -2.6600000000000001e-01 2.3728369507173603e+00 3.6722062886711586e+00 -3.1314615924061813e+00 0 0 0
+24 2 5 5.2999999999999999e-02 -1.2359567006001086e+00 2.7743819478511509e+00 -2.3739128005661945e+00 0 0 0
+25 2 5 5.2999999999999999e-02 -8.0224204496077034e-02 4.0915915990617844e+00 -2.5241861410658903e+00 0 0 0
+31 2 6 -1.3300000000000001e-01 2.8903336445784484e+00 2.6971927655338814e+00 -1.1785176144482163e+00 0 0 0
+32 3 1 0.0000000000000000e+00 1.3971440656156973e+00 -4.9643277226313820e-01 -1.8007235433008550e+00 0 0 0
+33 3 7 -1.0600000000000000e-01 6.9166490125953228e-01 8.5309801832292009e-01 -1.4945588149290958e+00 0 0 0
+39 3 5 5.2999999999999999e-02 9.8092607864122361e-01 1.1158022830233183e+00 -4.6198636349922034e-01 0 0 0
+40 3 5 5.2999999999999999e-02 -3.8492835242245782e-01 6.1478299152813720e-01 -1.4580529327224727e+00 0 0 0
+48 4 7 -1.0600000000000000e-01 2.9134291335965270e+00 -3.1319686991835666e-01 -2.0297760228535973e+00 0 0 0
+54 4 5 5.2999999999999999e-02 3.0381449259019440e+00 3.3162114330050130e-01 -2.9167677866535326e+00 0 0 0
+55 4 5 5.2999999999999999e-02 3.2514328565821793e+00 2.8090959303395657e-01 -1.1646139763336827e+00 0 0 0
+21 2 2 -2.5999999999999999e-02 3.6034831598907493e+00 4.3838688893812643e+00 -3.0531452828179995e+00 0 0 0
+22 2 5 5.2999999999999999e-02 3.6105936908462835e+00 4.9991191722280313e+00 -2.1426571611089851e+00 0 0 0
+26 2 5 5.2999999999999999e-02 4.4366624295197656e+00 3.6675254423361245e+00 -3.0329261630118207e+00 0 0 0
+57 4 2 -1.5900000000000000e-01 5.2827157776945590e+00 -6.5165278302143659e-01 -2.2704093452638463e+00 0 0 0
+58 4 5 5.2999999999999999e-02 5.3455504621319054e+00 -1.4861286579121391e-01 -3.2481650941479265e+00 0 0 0
+60 4 5 5.2999999999999999e-02 5.3316836719804970e+00 1.3808113882220788e-01 -1.5044373000705702e+00 0 0 0
+
+Velocities
+
+86 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+107 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+109 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+110 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+113 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+114 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+117 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+118 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+119 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+120 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+123 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+124 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+125 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+126 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+127 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+128 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+130 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+131 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+136 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+122 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+129 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+132 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+133 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+134 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+135 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+137 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+138 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+139 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+140 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+141 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+142 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+143 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+144 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+145 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+146 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+147 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+148 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+151 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+152 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+37 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+41 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+46 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+70 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+73 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+75 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+62 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+64 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+65 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+66 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+68 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+71 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+72 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+74 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+76 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+79 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+91 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+92 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+93 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+94 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+99 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+100 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+102 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+103 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+104 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+105 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+108 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+111 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+112 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+115 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+116 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+121 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+95 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+149 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+150 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+30 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+67 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+82 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+83 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+81 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+106 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+34 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+35 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+36 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+38 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+42 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+43 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+44 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+45 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+69 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+47 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+49 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+50 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+51 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+52 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+53 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+56 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+59 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+61 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+63 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+77 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+78 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+80 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+84 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+85 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+87 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+88 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+89 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+90 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+96 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+97 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+98 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+101 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+3 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+6 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+7 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+8 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+9 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+10 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+31 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+32 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+33 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+39 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+40 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+48 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+54 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+55 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+57 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+58 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+60 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
+
+Bonds
+
+1 1 107 109
+2 3 107 108
+3 2 107 117
+4 3 107 123
+5 5 109 110
+6 6 109 121
+7 8 114 108
+8 4 117 118
+9 4 117 119
+10 4 117 120
+11 5 124 125
+12 6 124 136
+13 7 126 125
+14 4 126 127
+15 4 126 128
+16 4 126 131
+17 8 130 123
+18 1 122 124
+19 3 122 123
+20 2 122 132
+21 3 122 139
+22 8 129 123
+23 4 132 133
+24 4 132 134
+25 4 132 135
+26 9 137 138
+27 11 139 138
+28 10 140 138
+29 5 140 141
+30 6 140 152
+31 7 142 141
+32 4 142 143
+33 4 142 144
+34 4 142 147
+35 8 145 139
+36 8 146 139
+37 12 148 138
+38 4 148 149
+39 4 148 150
+40 4 148 151
+41 8 70 63
+42 1 62 64
+43 3 62 63
+44 2 62 72
+45 3 62 78
+46 5 64 65
+47 6 64 76
+48 7 66 65
+49 4 66 67
+50 4 66 68
+51 4 66 71
+52 4 72 73
+53 4 72 74
+54 4 72 75
+55 5 79 80
+56 6 79 91
+57 1 92 94
+58 3 92 93
+59 2 92 102
+60 3 92 108
+61 5 94 95
+62 6 94 106
+63 8 99 93
+64 8 100 93
+65 4 102 103
+66 4 102 104
+67 4 102 105
+68 7 111 110
+69 4 111 112
+70 4 111 113
+71 4 111 116
+72 8 115 108
+73 4 27 28
+74 4 27 29
+75 4 27 30
+76 7 81 80
+77 4 81 82
+78 4 81 83
+79 4 81 86
+80 5 34 35
+81 6 34 46
+82 7 36 35
+83 4 36 37
+84 4 36 38
+85 4 36 41
+86 4 42 43
+87 4 42 44
+88 4 42 45
+89 8 69 63
+90 1 47 49
+91 3 47 48
+92 2 47 57
+93 3 47 63
+94 5 49 50
+95 6 49 61
+96 7 51 50
+97 4 51 52
+98 4 51 53
+99 4 51 56
+100 1 77 79
+101 3 77 78
+102 2 77 87
+103 3 77 93
+104 8 84 78
+105 8 85 78
+106 4 87 88
+107 4 87 89
+108 4 87 90
+109 7 96 95
+110 4 96 97
+111 4 96 98
+112 4 96 101
+113 1 1 3
+114 2 1 2
+115 2 1 12
+116 3 1 18
+117 4 2 7
+118 4 2 9
+119 4 2 10
+120 5 3 4
+121 6 3 16
+122 7 5 4
+123 4 5 6
+124 4 5 8
+125 4 5 11
+126 4 12 13
+127 4 12 14
+128 4 12 15
+129 1 17 19
+130 3 17 18
+131 2 17 27
+132 3 17 33
+133 5 19 20
+134 6 19 31
+135 8 24 18
+136 8 25 18
+137 1 32 34
+138 3 32 33
+139 2 32 42
+140 3 32 48
+141 8 39 33
+142 8 40 33
+143 8 54 48
+144 8 55 48
+145 7 21 20
+146 4 21 22
+147 4 21 23
+148 4 21 26
+149 4 57 58
+150 4 57 59
+151 4 57 60
+
+Angles
+
+1 2 109 107 108
+2 1 117 107 109
+3 2 109 107 123
+4 4 117 107 108
+5 12 108 107 123
+6 4 117 107 123
+7 7 107 109 110
+8 8 107 109 121
+9 9 110 109 121
+10 10 111 110 109
+11 5 118 117 119
+12 5 118 117 120
+13 6 107 117 118
+14 5 119 117 120
+15 6 107 117 119
+16 6 107 117 120
+17 13 129 123 130
+18 14 122 123 129
+19 14 107 123 129
+20 14 122 123 130
+21 14 107 123 130
+22 15 122 123 107
+23 7 122 124 125
+24 8 122 124 136
+25 9 125 124 136
+26 10 126 125 124
+27 11 125 126 127
+28 11 125 126 128
+29 11 125 126 131
+30 5 127 126 128
+31 5 127 126 131
+32 5 128 126 131
+33 2 124 122 123
+34 1 132 122 124
+35 2 124 122 139
+36 4 132 122 123
+37 12 123 122 139
+38 4 132 122 139
+39 5 133 132 134
+40 5 133 132 135
+41 6 122 132 133
+42 5 134 132 135
+43 6 122 132 134
+44 6 122 132 135
+45 16 140 138 137
+46 17 137 138 139
+47 18 148 138 137
+48 19 140 138 139
+49 20 148 138 140
+50 21 148 138 139
+51 13 145 139 146
+52 22 145 139 138
+53 14 122 139 145
+54 22 146 139 138
+55 14 122 139 146
+56 23 122 139 138
+57 24 141 140 138
+58 25 152 140 138
+59 9 141 140 152
+60 10 142 141 140
+61 11 141 142 143
+62 11 141 142 144
+63 11 141 142 147
+64 5 143 142 144
+65 5 143 142 147
+66 5 144 142 147
+67 5 149 148 150
+68 5 149 148 151
+69 26 149 148 138
+70 5 150 148 151
+71 26 150 148 138
+72 26 151 148 138
+73 2 64 62 63
+74 1 72 62 64
+75 2 64 62 78
+76 4 72 62 63
+77 12 63 62 78
+78 4 72 62 78
+79 7 62 64 65
+80 8 62 64 76
+81 9 65 64 76
+82 10 66 65 64
+83 11 65 66 67
+84 11 65 66 68
+85 11 65 66 71
+86 5 67 66 68
+87 5 67 66 71
+88 5 68 66 71
+89 5 73 72 74
+90 5 73 72 75
+91 6 62 72 73
+92 5 74 72 75
+93 6 62 72 74
+94 6 62 72 75
+95 7 77 79 80
+96 8 77 79 91
+97 9 80 79 91
+98 2 94 92 93
+99 1 102 92 94
+100 2 94 92 108
+101 4 102 92 93
+102 12 93 92 108
+103 4 102 92 108
+104 13 99 93 100
+105 14 92 93 99
+106 14 77 93 99
+107 14 92 93 100
+108 14 77 93 100
+109 15 92 93 77
+110 7 92 94 95
+111 8 92 94 106
+112 9 95 94 106
+113 5 103 102 104
+114 5 103 102 105
+115 6 92 102 103
+116 5 104 102 105
+117 6 92 102 104
+118 6 92 102 105
+119 13 114 108 115
+120 14 107 108 114
+121 14 92 108 114
+122 14 107 108 115
+123 14 92 108 115
+124 15 107 108 92
+125 11 110 111 112
+126 11 110 111 113
+127 11 110 111 116
+128 5 112 111 113
+129 5 112 111 116
+130 5 113 111 116
+131 10 96 95 94
+132 5 28 27 29
+133 5 28 27 30
+134 6 17 27 28
+135 5 29 27 30
+136 6 17 27 29
+137 6 17 27 30
+138 11 80 81 82
+139 11 80 81 83
+140 11 80 81 86
+141 5 82 81 83
+142 5 82 81 86
+143 5 83 81 86
+144 7 32 34 35
+145 8 32 34 46
+146 9 35 34 46
+147 10 36 35 34
+148 11 35 36 37
+149 11 35 36 38
+150 11 35 36 41
+151 5 37 36 38
+152 5 37 36 41
+153 5 38 36 41
+154 5 43 42 44
+155 5 43 42 45
+156 6 32 42 43
+157 5 44 42 45
+158 6 32 42 44
+159 6 32 42 45
+160 2 49 47 48
+161 1 57 47 49
+162 2 49 47 63
+163 4 57 47 48
+164 12 48 47 63
+165 4 57 47 63
+166 7 47 49 50
+167 8 47 49 61
+168 9 50 49 61
+169 10 51 50 49
+170 11 50 51 52
+171 11 50 51 53
+172 11 50 51 56
+173 5 52 51 53
+174 5 52 51 56
+175 5 53 51 56
+176 13 69 63 70
+177 14 62 63 69
+178 14 47 63 69
+179 14 62 63 70
+180 14 47 63 70
+181 15 62 63 47
+182 2 79 77 78
+183 1 87 77 79
+184 2 79 77 93
+185 4 87 77 78
+186 12 78 77 93
+187 4 87 77 93
+188 13 84 78 85
+189 14 77 78 84
+190 14 62 78 84
+191 14 77 78 85
+192 14 62 78 85
+193 15 77 78 62
+194 10 81 80 79
+195 5 88 87 89
+196 5 88 87 90
+197 6 77 87 88
+198 5 89 87 90
+199 6 77 87 89
+200 6 77 87 90
+201 11 95 96 97
+202 11 95 96 98
+203 11 95 96 101
+204 5 97 96 98
+205 5 97 96 101
+206 5 98 96 101
+207 1 2 1 3
+208 1 12 1 3
+209 2 3 1 18
+210 3 2 1 12
+211 4 2 1 18
+212 4 12 1 18
+213 5 7 2 9
+214 5 7 2 10
+215 6 1 2 7
+216 5 9 2 10
+217 6 1 2 9
+218 6 1 2 10
+219 7 1 3 4
+220 8 1 3 16
+221 9 4 3 16
+222 10 5 4 3
+223 11 4 5 6
+224 11 4 5 8
+225 11 4 5 11
+226 5 6 5 8
+227 5 6 5 11
+228 5 8 5 11
+229 5 13 12 14
+230 5 13 12 15
+231 6 1 12 13
+232 5 14 12 15
+233 6 1 12 14
+234 6 1 12 15
+235 2 19 17 18
+236 1 27 17 19
+237 2 19 17 33
+238 4 27 17 18
+239 12 18 17 33
+240 4 27 17 33
+241 13 24 18 25
+242 14 17 18 24
+243 14 1 18 24
+244 14 17 18 25
+245 14 1 18 25
+246 15 17 18 1
+247 7 17 19 20
+248 8 17 19 31
+249 9 20 19 31
+250 10 21 20 19
+251 2 34 32 33
+252 1 42 32 34
+253 2 34 32 48
+254 4 42 32 33
+255 12 33 32 48
+256 4 42 32 48
+257 13 39 33 40
+258 14 32 33 39
+259 14 17 33 39
+260 14 32 33 40
+261 14 17 33 40
+262 15 32 33 17
+263 13 54 48 55
+264 14 47 48 54
+265 14 32 48 54
+266 14 47 48 55
+267 14 32 48 55
+268 15 47 48 32
+269 11 20 21 22
+270 11 20 21 23
+271 11 20 21 26
+272 5 22 21 23
+273 5 22 21 26
+274 5 23 21 26
+275 5 58 57 59
+276 5 58 57 60
+277 6 47 57 58
+278 5 59 57 60
+279 6 47 57 59
+280 6 47 57 60
+
+Dihedrals
+
+1 3 108 107 109 110
+2 4 108 107 109 121
+3 1 117 107 109 110
+4 2 117 107 109 121
+5 3 123 107 109 110
+6 4 123 107 109 121
+7 8 109 107 108 114
+8 8 109 107 108 115
+9 9 109 107 108 92
+10 10 117 107 108 114
+11 10 117 107 108 115
+12 11 117 107 108 92
+13 15 123 107 108 114
+14 15 123 107 108 115
+15 16 123 107 108 92
+16 5 109 107 117 118
+17 5 109 107 117 119
+18 5 109 107 117 120
+19 7 108 107 117 118
+20 7 108 107 117 119
+21 7 108 107 117 120
+22 7 123 107 117 118
+23 7 123 107 117 119
+24 7 123 107 117 120
+25 8 109 107 123 129
+26 8 109 107 123 130
+27 9 109 107 123 122
+28 15 108 107 123 129
+29 15 108 107 123 130
+30 16 108 107 123 122
+31 10 117 107 123 129
+32 10 117 107 123 130
+33 11 117 107 123 122
+34 12 107 109 110 111
+35 13 121 109 110 111
+36 12 122 124 125 126
+37 13 136 124 125 126
+38 14 127 126 125 124
+39 14 128 126 125 124
+40 14 131 126 125 124
+41 3 123 122 124 125
+42 4 123 122 124 136
+43 1 132 122 124 125
+44 2 132 122 124 136
+45 3 139 122 124 125
+46 4 139 122 124 136
+47 8 124 122 123 129
+48 8 124 122 123 130
+49 9 124 122 123 107
+50 10 132 122 123 129
+51 10 132 122 123 130
+52 11 132 122 123 107
+53 15 139 122 123 129
+54 15 139 122 123 130
+55 16 139 122 123 107
+56 5 124 122 132 133
+57 5 124 122 132 134
+58 5 124 122 132 135
+59 7 123 122 132 133
+60 7 123 122 132 134
+61 7 123 122 132 135
+62 7 139 122 132 133
+63 7 139 122 132 134
+64 7 139 122 132 135
+65 8 124 122 139 145
+66 8 124 122 139 146
+67 17 124 122 139 138
+68 15 123 122 139 145
+69 15 123 122 139 146
+70 18 123 122 139 138
+71 10 132 122 139 145
+72 10 132 122 139 146
+73 19 132 122 139 138
+74 26 145 139 138 137
+75 26 146 139 138 137
+76 27 122 139 138 137
+77 28 145 139 138 140
+78 28 146 139 138 140
+79 29 122 139 138 140
+80 30 145 139 138 148
+81 30 146 139 138 148
+82 31 122 139 138 148
+83 20 141 140 138 137
+84 21 152 140 138 137
+85 22 141 140 138 139
+86 23 152 140 138 139
+87 24 141 140 138 148
+88 25 152 140 138 148
+89 35 138 140 141 142
+90 13 152 140 141 142
+91 14 143 142 141 140
+92 14 144 142 141 140
+93 14 147 142 141 140
+94 32 149 148 138 137
+95 32 150 148 138 137
+96 32 151 148 138 137
+97 33 149 148 138 140
+98 33 150 148 138 140
+99 33 151 148 138 140
+100 34 149 148 138 139
+101 34 150 148 138 139
+102 34 151 148 138 139
+103 3 63 62 64 65
+104 4 63 62 64 76
+105 1 72 62 64 65
+106 2 72 62 64 76
+107 3 78 62 64 65
+108 4 78 62 64 76
+109 8 64 62 63 69
+110 8 64 62 63 70
+111 9 64 62 63 47
+112 10 72 62 63 69
+113 10 72 62 63 70
+114 11 72 62 63 47
+115 15 78 62 63 69
+116 15 78 62 63 70
+117 16 78 62 63 47
+118 5 64 62 72 73
+119 5 64 62 72 74
+120 5 64 62 72 75
+121 7 63 62 72 73
+122 7 63 62 72 74
+123 7 63 62 72 75
+124 7 78 62 72 73
+125 7 78 62 72 74
+126 7 78 62 72 75
+127 8 64 62 78 84
+128 8 64 62 78 85
+129 9 64 62 78 77
+130 15 63 62 78 84
+131 15 63 62 78 85
+132 16 63 62 78 77
+133 10 72 62 78 84
+134 10 72 62 78 85
+135 11 72 62 78 77
+136 12 62 64 65 66
+137 13 76 64 65 66
+138 14 67 66 65 64
+139 14 68 66 65 64
+140 14 71 66 65 64
+141 12 77 79 80 81
+142 13 91 79 80 81
+143 3 93 92 94 95
+144 4 93 92 94 106
+145 1 102 92 94 95
+146 2 102 92 94 106
+147 3 108 92 94 95
+148 4 108 92 94 106
+149 8 94 92 93 99
+150 8 94 92 93 100
+151 9 94 92 93 77
+152 10 102 92 93 99
+153 10 102 92 93 100
+154 11 102 92 93 77
+155 15 108 92 93 99
+156 15 108 92 93 100
+157 16 108 92 93 77
+158 5 94 92 102 103
+159 5 94 92 102 104
+160 5 94 92 102 105
+161 7 93 92 102 103
+162 7 93 92 102 104
+163 7 93 92 102 105
+164 7 108 92 102 103
+165 7 108 92 102 104
+166 7 108 92 102 105
+167 8 94 92 108 114
+168 8 94 92 108 115
+169 9 94 92 108 107
+170 15 93 92 108 114
+171 15 93 92 108 115
+172 16 93 92 108 107
+173 10 102 92 108 114
+174 10 102 92 108 115
+175 11 102 92 108 107
+176 12 92 94 95 96
+177 13 106 94 95 96
+178 14 112 111 110 109
+179 14 113 111 110 109
+180 14 116 111 110 109
+181 14 82 81 80 79
+182 14 83 81 80 79
+183 14 86 81 80 79
+184 12 32 34 35 36
+185 13 46 34 35 36
+186 14 37 36 35 34
+187 14 38 36 35 34
+188 14 41 36 35 34
+189 3 48 47 49 50
+190 4 48 47 49 61
+191 1 57 47 49 50
+192 2 57 47 49 61
+193 3 63 47 49 50
+194 4 63 47 49 61
+195 8 49 47 48 54
+196 8 49 47 48 55
+197 9 49 47 48 32
+198 10 57 47 48 54
+199 10 57 47 48 55
+200 11 57 47 48 32
+201 15 63 47 48 54
+202 15 63 47 48 55
+203 16 63 47 48 32
+204 5 49 47 57 58
+205 5 49 47 57 59
+206 5 49 47 57 60
+207 7 48 47 57 58
+208 7 48 47 57 59
+209 7 48 47 57 60
+210 7 63 47 57 58
+211 7 63 47 57 59
+212 7 63 47 57 60
+213 8 49 47 63 69
+214 8 49 47 63 70
+215 9 49 47 63 62
+216 15 48 47 63 69
+217 15 48 47 63 70
+218 16 48 47 63 62
+219 10 57 47 63 69
+220 10 57 47 63 70
+221 11 57 47 63 62
+222 12 47 49 50 51
+223 13 61 49 50 51
+224 14 52 51 50 49
+225 14 53 51 50 49
+226 14 56 51 50 49
+227 3 78 77 79 80
+228 4 78 77 79 91
+229 1 87 77 79 80
+230 2 87 77 79 91
+231 3 93 77 79 80
+232 4 93 77 79 91
+233 8 79 77 78 84
+234 8 79 77 78 85
+235 9 79 77 78 62
+236 10 87 77 78 84
+237 10 87 77 78 85
+238 11 87 77 78 62
+239 15 93 77 78 84
+240 15 93 77 78 85
+241 16 93 77 78 62
+242 5 79 77 87 88
+243 5 79 77 87 89
+244 5 79 77 87 90
+245 7 78 77 87 88
+246 7 78 77 87 89
+247 7 78 77 87 90
+248 7 93 77 87 88
+249 7 93 77 87 89
+250 7 93 77 87 90
+251 8 79 77 93 99
+252 8 79 77 93 100
+253 9 79 77 93 92
+254 15 78 77 93 99
+255 15 78 77 93 100
+256 16 78 77 93 92
+257 10 87 77 93 99
+258 10 87 77 93 100
+259 11 87 77 93 92
+260 14 97 96 95 94
+261 14 98 96 95 94
+262 14 101 96 95 94
+263 1 2 1 3 4
+264 2 2 1 3 16
+265 1 12 1 3 4
+266 2 12 1 3 16
+267 3 18 1 3 4
+268 4 18 1 3 16
+269 5 3 1 2 7
+270 5 3 1 2 9
+271 5 3 1 2 10
+272 6 12 1 2 7
+273 6 12 1 2 9
+274 6 12 1 2 10
+275 7 18 1 2 7
+276 7 18 1 2 9
+277 7 18 1 2 10
+278 5 3 1 12 13
+279 5 3 1 12 14
+280 5 3 1 12 15
+281 6 2 1 12 13
+282 6 2 1 12 14
+283 6 2 1 12 15
+284 7 18 1 12 13
+285 7 18 1 12 14
+286 7 18 1 12 15
+287 8 3 1 18 24
+288 8 3 1 18 25
+289 9 3 1 18 17
+290 10 2 1 18 24
+291 10 2 1 18 25
+292 11 2 1 18 17
+293 10 12 1 18 24
+294 10 12 1 18 25
+295 11 12 1 18 17
+296 12 1 3 4 5
+297 13 16 3 4 5
+298 14 6 5 4 3
+299 14 8 5 4 3
+300 14 11 5 4 3
+301 3 18 17 19 20
+302 4 18 17 19 31
+303 1 27 17 19 20
+304 2 27 17 19 31
+305 3 33 17 19 20
+306 4 33 17 19 31
+307 8 19 17 18 24
+308 8 19 17 18 25
+309 9 19 17 18 1
+310 10 27 17 18 24
+311 10 27 17 18 25
+312 11 27 17 18 1
+313 15 33 17 18 24
+314 15 33 17 18 25
+315 16 33 17 18 1
+316 5 19 17 27 28
+317 5 19 17 27 29
+318 5 19 17 27 30
+319 7 18 17 27 28
+320 7 18 17 27 29
+321 7 18 17 27 30
+322 7 33 17 27 28
+323 7 33 17 27 29
+324 7 33 17 27 30
+325 8 19 17 33 39
+326 8 19 17 33 40
+327 9 19 17 33 32
+328 15 18 17 33 39
+329 15 18 17 33 40
+330 16 18 17 33 32
+331 10 27 17 33 39
+332 10 27 17 33 40
+333 11 27 17 33 32
+334 12 17 19 20 21
+335 13 31 19 20 21
+336 3 33 32 34 35
+337 4 33 32 34 46
+338 1 42 32 34 35
+339 2 42 32 34 46
+340 3 48 32 34 35
+341 4 48 32 34 46
+342 8 34 32 33 39
+343 8 34 32 33 40
+344 9 34 32 33 17
+345 10 42 32 33 39
+346 10 42 32 33 40
+347 11 42 32 33 17
+348 15 48 32 33 39
+349 15 48 32 33 40
+350 16 48 32 33 17
+351 5 34 32 42 43
+352 5 34 32 42 44
+353 5 34 32 42 45
+354 7 33 32 42 43
+355 7 33 32 42 44
+356 7 33 32 42 45
+357 7 48 32 42 43
+358 7 48 32 42 44
+359 7 48 32 42 45
+360 8 34 32 48 54
+361 8 34 32 48 55
+362 9 34 32 48 47
+363 15 33 32 48 54
+364 15 33 32 48 55
+365 16 33 32 48 47
+366 10 42 32 48 54
+367 10 42 32 48 55
+368 11 42 32 48 47
+369 14 22 21 20 19
+370 14 23 21 20 19
+371 14 26 21 20 19
+
+Impropers
+
+1 4 117 107 109 108
+2 9 109 107 108 123
+3 4 117 107 109 123
+4 10 117 107 108 123
+5 1 107 109 110 121
+6 6 118 117 119 120
+7 7 107 117 119 118
+8 7 107 117 120 118
+9 7 107 117 120 119
+10 11 122 123 130 129
+11 11 107 123 130 129
+12 12 122 123 107 129
+13 12 122 123 107 130
+14 1 122 124 125 136
+15 8 125 126 127 128
+16 8 125 126 127 131
+17 8 125 126 128 131
+18 6 127 126 128 131
+19 4 132 122 124 123
+20 9 124 122 123 139
+21 4 132 122 124 139
+22 10 132 122 123 139
+23 6 133 132 134 135
+24 7 122 132 134 133
+25 7 122 132 135 133
+26 7 122 132 135 134
+27 13 140 138 137 139
+28 14 148 138 140 137
+29 15 148 138 137 139
+30 16 148 138 140 139
+31 17 145 139 146 138
+32 11 122 139 146 145
+33 18 122 139 145 138
+34 18 122 139 146 138
+35 2 141 140 152 138
+36 8 141 142 143 144
+37 8 141 142 143 147
+38 8 141 142 144 147
+39 6 143 142 144 147
+40 6 149 148 150 151
+41 19 149 148 150 138
+42 19 149 148 151 138
+43 19 150 148 151 138
+44 4 72 62 64 63
+45 9 64 62 63 78
+46 4 72 62 64 78
+47 10 72 62 63 78
+48 1 62 64 65 76
+49 8 65 66 67 68
+50 8 65 66 67 71
+51 8 65 66 68 71
+52 6 67 66 68 71
+53 6 73 72 74 75
+54 7 62 72 74 73
+55 7 62 72 75 73
+56 7 62 72 75 74
+57 1 77 79 80 91
+58 4 102 92 94 93
+59 9 94 92 93 108
+60 4 102 92 94 108
+61 10 102 92 93 108
+62 11 92 93 100 99
+63 11 77 93 100 99
+64 12 92 93 77 99
+65 12 92 93 77 100
+66 1 92 94 95 106
+67 6 103 102 104 105
+68 7 92 102 104 103
+69 7 92 102 105 103
+70 7 92 102 105 104
+71 11 107 108 115 114
+72 11 92 108 115 114
+73 12 107 108 92 114
+74 12 107 108 92 115
+75 8 110 111 112 113
+76 8 110 111 112 116
+77 8 110 111 113 116
+78 6 112 111 113 116
+79 6 28 27 29 30
+80 7 17 27 29 28
+81 7 17 27 30 28
+82 7 17 27 30 29
+83 8 80 81 82 83
+84 8 80 81 82 86
+85 8 80 81 83 86
+86 6 82 81 83 86
+87 1 32 34 35 46
+88 8 35 36 37 38
+89 8 35 36 37 41
+90 8 35 36 38 41
+91 6 37 36 38 41
+92 6 43 42 44 45
+93 7 32 42 44 43
+94 7 32 42 45 43
+95 7 32 42 45 44
+96 4 57 47 49 48
+97 9 49 47 48 63
+98 4 57 47 49 63
+99 10 57 47 48 63
+100 1 47 49 50 61
+101 8 50 51 52 53
+102 8 50 51 52 56
+103 8 50 51 53 56
+104 6 52 51 53 56
+105 11 62 63 70 69
+106 11 47 63 70 69
+107 12 62 63 47 69
+108 12 62 63 47 70
+109 4 87 77 79 78
+110 9 79 77 78 93
+111 4 87 77 79 93
+112 10 87 77 78 93
+113 11 77 78 85 84
+114 11 62 78 85 84
+115 12 77 78 62 84
+116 12 77 78 62 85
+117 6 88 87 89 90
+118 7 77 87 89 88
+119 7 77 87 90 88
+120 7 77 87 90 89
+121 8 95 96 97 98
+122 8 95 96 97 101
+123 8 95 96 98 101
+124 6 97 96 98 101
+125 3 2 1 12 3
+126 4 2 1 3 18
+127 4 12 1 3 18
+128 5 2 1 12 18
+129 6 7 2 9 10
+130 7 1 2 9 7
+131 7 1 2 10 7
+132 7 1 2 10 9
+133 1 1 3 4 16
+134 8 4 5 6 8
+135 8 4 5 6 11
+136 8 4 5 8 11
+137 6 6 5 8 11
+138 6 13 12 14 15
+139 7 1 12 14 13
+140 7 1 12 15 13
+141 7 1 12 15 14
+142 4 27 17 19 18
+143 9 19 17 18 33
+144 4 27 17 19 33
+145 10 27 17 18 33
+146 11 17 18 25 24
+147 11 1 18 25 24
+148 12 17 18 1 24
+149 12 17 18 1 25
+150 1 17 19 20 31
+151 4 42 32 34 33
+152 9 34 32 33 48
+153 4 42 32 34 48
+154 10 42 32 33 48
+155 11 32 33 40 39
+156 11 17 33 40 39
+157 12 32 33 17 39
+158 12 32 33 17 40
+159 11 47 48 55 54
+160 11 32 48 55 54
+161 12 47 48 32 54
+162 12 47 48 32 55
+163 8 20 21 22 23
+164 8 20 21 22 26
+165 8 20 21 23 26
+166 6 22 21 23 26
+167 6 58 57 59 60
+168 7 47 57 59 58
+169 7 47 57 60 58
+170 7 47 57 60 59
diff --git a/tools/msi2lmp/test/runtests.sh b/tools/msi2lmp/test/runtests.sh
index f72df0c1b..ce86ea2ae 100755
--- a/tools/msi2lmp/test/runtests.sh
+++ b/tools/msi2lmp/test/runtests.sh
@@ -1,189 +1,189 @@
#!/bin/sh
MSI2LMP_LIBRARY=../frc_files
VALGRIND='valgrind -v --track-origins=yes --show-reachable=yes --leak-check=full'
MSI2LMP=../src/msi2lmp.exe
LAMMPS=../../../src/lmp_serial
CHECKDATA=./data-compare.pl
if [ ! -x $MSI2LMP ]
then
echo "No executable $MSI2LMP"
exit 1
fi
if [ ! -d $MSI2LMP_LIBRARY ]
then
echo "No directory $MSI2LMP_LIBRARY"
exit 1
fi
if [ ! -x $LAMMPS ]
then
echo "No executable $LAMMPS"
exit 1
fi
verbose=1
counter=0
errors=0
# Class1 tests with cvff
for m in hydrogen water h2-h2o ethane benzene naphthalene cnt-hexagonal crambin nylon phen3_cff97 hap_crystal
do \
before=$errors
vglog=${m}-class1.chk
${VALGRIND} --log-file=${vglog} \
${MSI2LMP} ${m}-class1 -c 1 -p ${verbose} \
|| errors=$(expr $errors + 1)
${LAMMPS} -log none -screen none -in in.${m}-class1 \
|| errors=$(expr $errors + 1)
${CHECKDATA} ${m}-class1.data reference/${m}-class1.data \
|| errors=$(expr $errors + 1)
${CHECKDATA} ${m}-class1.data2 reference/${m}-class1.data2 \
|| errors=$(expr $errors + 1)
[ $before -eq $errors ] && rm ${m}-class1.data ${m}-class1.data2 log.${m}-class1
leak=$(awk '/in use at exit:/ {num=$6;} END {print num;}' $vglog)
[ $leak != 0 ] && echo "Memory still used: $leak" \
&& errors=$(expr $errors + 1)
viol=$(awk '/ERROR SUMMARY/ {num=$4;} END {print num;}' $vglog)
[ $viol != 0 ] && echo "Valgrind errors: $viol" \
&& errors=$(expr $errors + 1)
[ $leak = 0 ] && [ $viol = 0 ] && rm ${vglog}
counter=$(expr $counter + 6)
done
# Class1 tests with clayff
for m in PyAC_bulk
do \
before=$errors
vglog=${m}-clayff.chk
${VALGRIND} --log-file=${vglog} \
${MSI2LMP} ${m}-clayff -c 1 -p ${verbose} -f clayff -n \
|| errors=$(expr $errors + 1)
${LAMMPS} -log none -screen none -in in.${m}-clayff \
|| errors=$(expr $errors + 1)
${CHECKDATA} ${m}-clayff.data reference/${m}-clayff.data \
|| errors=$(expr $errors + 1)
${CHECKDATA} ${m}-clayff.data2 reference/${m}-clayff.data2 \
|| errors=$(expr $errors + 1)
[ $before -eq $errors ] && rm ${m}-clayff.data ${m}-clayff.data2 log.${m}-clayff
leak=$(awk '/in use at exit:/ {num=$6;} END {print num;}' $vglog)
[ $leak != 0 ] && echo "Memory still used: $leak" \
&& errors=$(expr $errors + 1)
viol=$(awk '/ERROR SUMMARY/ {num=$4;} END {print num;}' $vglog)
[ $viol != 0 ] && echo "Valgrind errors: $viol" \
&& errors=$(expr $errors + 1)
[ $leak = 0 ] && [ $viol = 0 ] && rm ${vglog}
counter=$(expr $counter + 6)
done
# OPLS-AA tests
for m in ethane decane
do \
before=$errors
vglog=${m}-oplsaa.chk
${VALGRIND} --log-file=${vglog} \
${MSI2LMP} ${m}-oplsaa -c 0 -p ${verbose} -f oplsaa -n \
|| errors=$(expr $errors + 1)
${LAMMPS} -log none -screen none -in in.${m}-oplsaa \
|| errors=$(expr $errors + 1)
${CHECKDATA} ${m}-oplsaa.data reference/${m}-oplsaa.data \
|| errors=$(expr $errors + 1)
${CHECKDATA} ${m}-oplsaa.data2 reference/${m}-oplsaa.data2 \
|| errors=$(expr $errors + 1)
[ $before -eq $errors ] && rm ${m}-oplsaa.data ${m}-oplsaa.data2 log.${m}-oplsaa
leak=$(awk '/in use at exit:/ {num=$6;} END {print num;}' $vglog)
[ $leak != 0 ] && echo "Memory still used: $leak" \
&& errors=$(expr $errors + 1)
viol=$(awk '/ERROR SUMMARY/ {num=$4;} END {print num;}' $vglog)
[ $viol != 0 ] && echo "Valgrind errors: $viol" \
&& errors=$(expr $errors + 1)
[ $leak = 0 ] && [ $viol = 0 ] && rm ${vglog}
counter=$(expr $counter + 6)
done
# Class2 tests with compass
for m in hydrogen ethane benzene naphthalene cnt-hexagonal
do \
before=$errors
vglog=${m}-class2a.chk
${VALGRIND} --log-file=${vglog} \
${MSI2LMP} ${m}-class2a -c 2 -p ${verbose} -f compass_published \
|| errors=$(expr $errors + 1)
${LAMMPS} -log none -screen none -in in.${m}-class2a \
|| errors=$(expr $errors + 1)
${CHECKDATA} ${m}-class2a.data reference/${m}-class2a.data \
|| errors=$(expr $errors + 1)
${CHECKDATA} ${m}-class2a.data2 reference/${m}-class2a.data2 \
|| errors=$(expr $errors + 1)
[ $before -eq $errors ] && rm ${m}-class2a.data ${m}-class2a.data2 log.${m}-class2a
leak=$(awk '/in use at exit:/ {num=$6;} END {print num;}' $vglog)
[ $leak != 0 ] && echo "Memory still used: $leak" \
&& errors=$(expr $errors + 1)
viol=$(awk '/ERROR SUMMARY/ {num=$4;} END {print num;}' $vglog)
[ $viol != 0 ] && echo "Valgrind errors: $viol" \
&& errors=$(expr $errors + 1)
[ $leak = 0 ] && [ $viol = 0 ] && rm ${vglog}
counter=$(expr $counter + 6)
done
# Class2 tests with pcff
for m in water h2-h2o ethane benzene naphthalene cnt-hexagonal hap_crystal
do \
before=$errors
vglog=${m}-class2b.chk
${VALGRIND} --log-file=${vglog} \
${MSI2LMP} ${m}-class2b -c 2 -p ${verbose} -f pcff \
|| errors=$(expr $errors + 1)
${LAMMPS} -log none -screen none -in in.${m}-class2b \
|| errors=$(expr $errors + 1)
${CHECKDATA} ${m}-class2b.data reference/${m}-class2b.data \
|| errors=$(expr $errors + 1)
${CHECKDATA} ${m}-class2b.data2 reference/${m}-class2b.data2 \
|| errors=$(expr $errors + 1)
[ $before -eq $errors ] && rm ${m}-class2b.data ${m}-class2b.data2 log.${m}-class2b
leak=$(awk '/in use at exit:/ {num=$6;} END {print num;}' $vglog)
[ $leak != 0 ] && echo "Memory still used: $leak" \
&& errors=$(expr $errors + 1)
viol=$(awk '/ERROR SUMMARY/ {num=$4;} END {print num;}' $vglog)
[ $viol != 0 ] && echo "Valgrind errors: $viol" \
&& errors=$(expr $errors + 1)
[ $leak = 0 ] && [ $viol = 0 ] && rm ${vglog}
counter=$(expr $counter + 6)
done
# Class2 tests with pcff with ignore flag set
-for m in solv-poly
+for m in pmma-poly solv-poly
do \
before=$errors
vglog=${m}-class2c.chk
${VALGRIND} --log-file=${vglog} \
${MSI2LMP} ${m}-class2c -i -c 2 -p ${verbose} -f pcff \
|| errors=$(expr $errors + 1)
${LAMMPS} -log none -screen none -in in.${m}-class2c \
|| errors=$(expr $errors + 1)
${CHECKDATA} ${m}-class2c.data reference/${m}-class2c.data \
|| errors=$(expr $errors + 1)
${CHECKDATA} ${m}-class2c.data2 reference/${m}-class2c.data2 \
|| errors=$(expr $errors + 1)
[ $before -eq $errors ] && rm ${m}-class2c.data ${m}-class2c.data2 log.${m}-class2c
leak=$(awk '/in use at exit:/ {num=$6;} END {print num;}' $vglog)
[ $leak != 0 ] && echo "Memory still used: $leak" \
&& errors=$(expr $errors + 1)
viol=$(awk '/ERROR SUMMARY/ {num=$4;} END {print num;}' $vglog)
[ $viol != 0 ] && echo "Valgrind errors: $viol" \
&& errors=$(expr $errors + 1)
[ $leak = 0 ] && [ $viol = 0 ] && rm ${vglog}
counter=$(expr $counter + 6)
done
echo "Total error count: $errors / $counter"
echo
echo "Total error count: $errors / $counter"
echo
echo "Total error count: $errors / $counter"
echo

Event Timeline