854 lines
74 KiB
HTML
854 lines
74 KiB
HTML
<!DOCTYPE html>
|
||
<html class="writer-html5" lang="en" >
|
||
<head>
|
||
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<title>1.1.5. Compute, fixes, variables — LAMMPS documentation</title>
|
||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||
<link rel="stylesheet" href="_static/sphinx-design.min.css" type="text/css" />
|
||
<link rel="stylesheet" href="_static/css/lammps.css" type="text/css" />
|
||
<link rel="shortcut icon" href="_static/lammps.ico"/>
|
||
<link rel="canonical" href="https://docs.lammps.org/Library_objects.html" />
|
||
<!--[if lt IE 9]>
|
||
<script src="_static/js/html5shiv.min.js"></script>
|
||
<![endif]-->
|
||
|
||
<script src="_static/jquery.js?v=5d32c60e"></script>
|
||
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
||
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
||
<script src="_static/doctools.js?v=9bcbadda"></script>
|
||
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
||
<script src="_static/design-tabs.js?v=f930bc37"></script>
|
||
<script async="async" src="_static/mathjax/es5/tex-mml-chtml.js?v=cadf963e"></script>
|
||
<script src="_static/js/theme.js"></script>
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
<link rel="next" title="1.1.6. Scatter/gather operations" href="Library_scatter.html" />
|
||
<link rel="prev" title="1.1.4. Per-atom properties" href="Library_atoms.html" />
|
||
</head>
|
||
|
||
<body class="wy-body-for-nav">
|
||
<div class="wy-grid-for-nav">
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||
<div class="wy-side-scroll">
|
||
<div class="wy-side-nav-search" >
|
||
|
||
|
||
|
||
<a href="Manual.html">
|
||
|
||
<img src="_static/lammps-logo.png" class="logo" alt="Logo"/>
|
||
</a>
|
||
<div class="lammps_version">Version: <b>19 Nov 2024</b></div>
|
||
<div class="lammps_release">git info: </div>
|
||
<div role="search">
|
||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
||
<p class="caption" role="heading"><span class="caption-text">User Guide</span></p>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="Intro.html">1. Introduction</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Install.html">2. Install LAMMPS</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Build.html">3. Build LAMMPS</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Run_head.html">4. Run LAMMPS</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Commands.html">5. Commands</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Packages.html">6. Optional packages</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Speed.html">7. Accelerate performance</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Howto.html">8. Howto discussions</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Examples.html">9. Example scripts</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Tools.html">10. Auxiliary tools</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Errors.html">11. Errors</a></li>
|
||
</ul>
|
||
<p class="caption" role="heading"><span class="caption-text">Programmer Guide</span></p>
|
||
<ul class="current">
|
||
<li class="toctree-l1 current"><a class="reference internal" href="Library.html">1. LAMMPS Library Interfaces</a><ul class="current">
|
||
<li class="toctree-l2 current"><a class="reference internal" href="Library.html#lammps-c-library-api">1.1. LAMMPS C Library API</a><ul class="current">
|
||
<li class="toctree-l3"><a class="reference internal" href="Library_create.html">1.1.1. Creating or deleting a LAMMPS object</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="Library_execute.html">1.1.2. Executing commands</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="Library_properties.html">1.1.3. System properties</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="Library_atoms.html">1.1.4. Per-atom properties</a></li>
|
||
<li class="toctree-l3 current"><a class="current reference internal" href="#">1.1.5. Compute, fixes, variables</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="Library_scatter.html">1.1.6. Scatter/gather operations</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="Library_neighbor.html">1.1.7. Neighbor list access</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="Library_config.html">1.1.8. Configuration information</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="Library_utility.html">1.1.9. Utility functions</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="Library_add.html">1.1.10. Extending the C API</a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l2"><a class="reference internal" href="Library.html#lammps-python-apis">1.2. LAMMPS Python APIs</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="Library.html#lammps-fortran-api">1.3. LAMMPS Fortran API</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="Library.html#lammps-cplusplus-api">1.4. LAMMPS C++ API</a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Python_head.html">2. Use Python with LAMMPS</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Modify.html">3. Modifying & extending LAMMPS</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Developer.html">4. Information for Developers</a></li>
|
||
</ul>
|
||
<p class="caption" role="heading"><span class="caption-text">Command Reference</span></p>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="commands_list.html">Commands</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="fixes.html">Fix Styles</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="computes.html">Compute Styles</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="pairs.html">Pair Styles</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="bonds.html">Bond Styles</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="angles.html">Angle Styles</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="dihedrals.html">Dihedral Styles</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="impropers.html">Improper Styles</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="dumps.html">Dump Styles</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="fix_modify_atc_commands.html">fix_modify AtC commands</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="Bibliography.html">Bibliography</a></li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||
<a href="Manual.html">LAMMPS</a>
|
||
</nav>
|
||
|
||
<div class="wy-nav-content">
|
||
<div class="rst-content style-external-links">
|
||
<div role="navigation" aria-label="Page navigation">
|
||
<ul class="wy-breadcrumbs">
|
||
<li><a href="Manual.html" class="icon icon-home" aria-label="Home"></a></li>
|
||
<li class="breadcrumb-item"><a href="Library.html"><span class="section-number">1. </span>LAMMPS Library Interfaces</a></li>
|
||
<li class="breadcrumb-item active"><span class="section-number">1.1.5. </span>Compute, fixes, variables</li>
|
||
<li class="wy-breadcrumbs-aside">
|
||
<a href="https://www.lammps.org"><img src="_static/lammps-logo.png" width="64" height="16" alt="LAMMPS Homepage"></a> | <a href="Commands_all.html">Commands</a>
|
||
</li>
|
||
</ul><div class="rst-breadcrumbs-buttons" role="navigation" aria-label="Sequential page navigation">
|
||
<a href="Library_atoms.html" class="btn btn-neutral float-left" title="1.1.4. Per-atom properties" accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||
<a href="Library_scatter.html" class="btn btn-neutral float-right" title="1.1.6. Scatter/gather operations" accesskey="n">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||
</div>
|
||
<hr/>
|
||
</div>
|
||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||
<div itemprop="articleBody">
|
||
|
||
<p><span class="math notranslate nohighlight">\(\renewcommand{\AA}{\text{Å}}\)</span></p>
|
||
<section id="compute-fixes-variables">
|
||
<h1><span class="section-number">1.1.5. </span>Compute, fixes, variables<a class="headerlink" href="#compute-fixes-variables" title="Link to this heading"></a></h1>
|
||
<p>This section documents accessing or modifying data stored by computes,
|
||
fixes, or variables in LAMMPS using the following functions:</p>
|
||
<ul class="simple">
|
||
<li><p><a class="reference internal" href="#_CPPv422lammps_extract_computePvPKcii" title="lammps_extract_compute"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">lammps_extract_compute()</span></code></a></p></li>
|
||
<li><p><a class="reference internal" href="#_CPPv418lammps_extract_fixPvPKciiii" title="lammps_extract_fix"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">lammps_extract_fix()</span></code></a></p></li>
|
||
<li><p><a class="reference internal" href="#_CPPv432lammps_extract_variable_datatypePvPKc" title="lammps_extract_variable_datatype"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">lammps_extract_variable_datatype()</span></code></a></p></li>
|
||
<li><p><a class="reference internal" href="#_CPPv423lammps_extract_variablePvPKcPKc" title="lammps_extract_variable"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">lammps_extract_variable()</span></code></a></p></li>
|
||
<li><p><a class="reference internal" href="#_CPPv419lammps_set_variablePvPKcPKc" title="lammps_set_variable"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">lammps_set_variable()</span></code></a></p></li>
|
||
<li><p><a class="reference internal" href="#_CPPv426lammps_set_string_variablePvPKcPKc" title="lammps_set_string_variable"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">lammps_set_string_variable()</span></code></a></p></li>
|
||
<li><p><a class="reference internal" href="#_CPPv428lammps_set_internal_variablePvPKcd" title="lammps_set_internal_variable"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">lammps_set_internal_variable()</span></code></a></p></li>
|
||
<li><p><a class="reference internal" href="#_CPPv420lammps_variable_infoPviPci" title="lammps_variable_info"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">lammps_variable_info()</span></code></a></p></li>
|
||
</ul>
|
||
<hr class="docutils" />
|
||
<dl class="cpp function">
|
||
<dt class="sig sig-object cpp" id="_CPPv422lammps_extract_computePvPKcii">
|
||
<span id="_CPPv322lammps_extract_computePvPKcii"></span><span id="_CPPv222lammps_extract_computePvPKcii"></span><span id="lammps_extract_compute__voidP.cCP.i.i"></span><span class="target" id="library_8h_1a494c3aa6290bd2f3c05b3e5f65862e32"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">lammps_extract_compute</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">handle</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">id</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">style</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">type</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv422lammps_extract_computePvPKcii" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>Get pointer to data from a LAMMPS compute.</p>
|
||
<p><p>This function returns a pointer to the location of data provided by a
|
||
<a class="reference internal" href="compute.html"><span class="doc">compute command</span></a> instance identified by the compute-ID. Computes may
|
||
provide global, per-atom, or local data, and those may be a scalar, a
|
||
vector, or an array or they may provide the information about the
|
||
dimensions of the respective data. Since computes may provide multiple
|
||
kinds of data, it is required to set style and type flags representing
|
||
what specific data is desired. This also determines to what kind of
|
||
pointer the returned pointer needs to be cast to access the data
|
||
correctly. The function returns <code class="docutils literal notranslate"><span class="pre">NULL</span></code> if the compute ID is not found
|
||
or the requested data is not available or current. The following table
|
||
lists the available options.</p>
|
||
<table class="docutils align-default">
|
||
<colgroup>
|
||
<col style="width: 25.0%" />
|
||
<col style="width: 24.0%" />
|
||
<col style="width: 14.0%" />
|
||
<col style="width: 37.0%" />
|
||
</colgroup>
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p>Style (see <a class="reference internal" href="#_CPPv416_LMP_STYLE_CONST" title="_LMP_STYLE_CONST"><code class="xref cpp cpp-enum docutils literal notranslate"><span class="pre">_LMP_STYLE_CONST</span></code></a>)</p></th>
|
||
<th class="head"><p>Type (see <a class="reference internal" href="#_CPPv415_LMP_TYPE_CONST" title="_LMP_TYPE_CONST"><code class="xref cpp cpp-enum docutils literal notranslate"><span class="pre">_LMP_TYPE_CONST</span></code></a>)</p></th>
|
||
<th class="head"><p>Returned type</p></th>
|
||
<th class="head"><p>Returned data</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p>LMP_STYLE_GLOBAL</p></td>
|
||
<td><p>LMP_TYPE_SCALAR</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Global scalar</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_GLOBAL</p></td>
|
||
<td><p>LMP_TYPE_VECTOR</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Global vector</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>LMP_STYLE_GLOBAL</p></td>
|
||
<td><p>LMP_TYPE_ARRAY</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">**</span></code></p></td>
|
||
<td><p>Global array</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_GLOBAL</p></td>
|
||
<td><p>LMP_SIZE_VECTOR</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Length of global vector</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>LMP_STYLE_GLOBAL</p></td>
|
||
<td><p>LMP_SIZE_ROWS</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Rows of global array</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_GLOBAL</p></td>
|
||
<td><p>LMP_SIZE_COLS</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Columns of global array</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>LMP_STYLE_ATOM</p></td>
|
||
<td><p>LMP_TYPE_VECTOR</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Per-atom value</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_ATOM</p></td>
|
||
<td><p>LMP_TYPE_ARRAY</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">**</span></code></p></td>
|
||
<td><p>Per-atom vector</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>LMP_STYLE_ATOM</p></td>
|
||
<td><p>LMP_SIZE_COLS</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Columns in per-atom array, 0 if vector</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_LOCAL</p></td>
|
||
<td><p>LMP_TYPE_VECTOR</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Local data vector</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>LMP_STYLE_LOCAL</p></td>
|
||
<td><p>LMP_TYPE_ARRAY</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">**</span></code></p></td>
|
||
<td><p>Local data array</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_LOCAL</p></td>
|
||
<td><p>LMP_SIZE_VECTOR</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Alias for LMP_SIZE_ROWS</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>LMP_STYLE_LOCAL</p></td>
|
||
<td><p>LMP_SIZE_ROWS</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Number of local array rows or length of vector</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_LOCAL</p></td>
|
||
<td><p>LMP_SIZE_COLS</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Number of local array columns, 0 if vector</p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</p>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>If the compute’s data is not computed for the current step, the
|
||
compute will be invoked. LAMMPS cannot easily check at that time, if
|
||
it is valid to invoke a compute, so it may fail with an error. The
|
||
caller has to check to avoid such an error.</p>
|
||
</div>
|
||
<div class="admonition warning">
|
||
<p class="admonition-title">Warning</p>
|
||
<p>The pointers returned by this function are generally not persistent
|
||
since the computed data may be re-distributed, re-allocated, and
|
||
re-ordered at every invocation. It is advisable to re-invoke this
|
||
function before the data is accessed, or make a copy if the data shall
|
||
be used after other LAMMPS commands have been issued.</p>
|
||
</div>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>handle</strong> – pointer to a previously created LAMMPS instance </p></li>
|
||
<li><p><strong>id</strong> – string with ID of the compute </p></li>
|
||
<li><p><strong>style</strong> – constant indicating the style of data requested (global, per-atom, or local) </p></li>
|
||
<li><p><strong>type</strong> – constant indicating type of data (scalar, vector, or array) or size of rows or columns </p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>pointer (cast to <code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">*</span></code>) to the location of the requested data or <code class="docutils literal notranslate"><span class="pre">NULL</span></code> if not found. </p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<hr class="docutils" />
|
||
<dl class="cpp function">
|
||
<dt class="sig sig-object cpp" id="_CPPv418lammps_extract_fixPvPKciiii">
|
||
<span id="_CPPv318lammps_extract_fixPvPKciiii"></span><span id="_CPPv218lammps_extract_fixPvPKciiii"></span><span id="lammps_extract_fix__voidP.cCP.i.i.i.i"></span><span class="target" id="library_8h_1abf1f4c59970775f24893ad1eb41e35a2"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">lammps_extract_fix</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">handle</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">id</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">style</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">type</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">nrow</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">ncol</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv418lammps_extract_fixPvPKciiii" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>Get pointer to data from a LAMMPS fix.</p>
|
||
<p><p>This function returns a pointer to data provided by a <a class="reference internal" href="fix.html"><span class="doc">fix command</span></a>
|
||
instance identified by its fix-ID. Fixes may provide global, per-atom,
|
||
or local data, and those may be a scalar, a vector, or an array, or they
|
||
may provide the information about the dimensions of the respective data.
|
||
Since individual fixes may provide multiple kinds of data, it is
|
||
required to set style and type flags representing what specific data is
|
||
desired. This also determines to what kind of pointer the returned
|
||
pointer needs to be cast to access the data correctly. The function
|
||
returns <code class="docutils literal notranslate"><span class="pre">NULL</span></code> if the fix ID is not found or the requested data is not
|
||
available.</p>
|
||
<p>The following table lists the available options.</p>
|
||
<table class="docutils align-default">
|
||
<colgroup>
|
||
<col style="width: 25.0%" />
|
||
<col style="width: 24.0%" />
|
||
<col style="width: 14.0%" />
|
||
<col style="width: 37.0%" />
|
||
</colgroup>
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p>Style (see <a class="reference internal" href="#_CPPv416_LMP_STYLE_CONST" title="_LMP_STYLE_CONST"><code class="xref cpp cpp-enum docutils literal notranslate"><span class="pre">_LMP_STYLE_CONST</span></code></a>)</p></th>
|
||
<th class="head"><p>Type (see <a class="reference internal" href="#_CPPv415_LMP_TYPE_CONST" title="_LMP_TYPE_CONST"><code class="xref cpp cpp-enum docutils literal notranslate"><span class="pre">_LMP_TYPE_CONST</span></code></a>)</p></th>
|
||
<th class="head"><p>Returned type</p></th>
|
||
<th class="head"><p>Returned data</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p>LMP_STYLE_GLOBAL</p></td>
|
||
<td><p>LMP_TYPE_SCALAR</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Copy of global scalar</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_GLOBAL</p></td>
|
||
<td><p>LMP_TYPE_VECTOR</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Copy of global vector element at index nrow</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>LMP_STYLE_GLOBAL</p></td>
|
||
<td><p>LMP_TYPE_ARRAY</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Copy of global array element at nrow, ncol</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_GLOBAL</p></td>
|
||
<td><p>LMP_SIZE_VECTOR</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Length of global vector</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>LMP_STYLE_GLOBAL</p></td>
|
||
<td><p>LMP_SIZE_ROWS</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Rows in global array</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_GLOBAL</p></td>
|
||
<td><p>LMP_SIZE_COLS</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Columns in global array</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>LMP_STYLE_ATOM</p></td>
|
||
<td><p>LMP_TYPE_VECTOR</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Per-atom value</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_ATOM</p></td>
|
||
<td><p>LMP_TYPE_ARRAY</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">**</span></code></p></td>
|
||
<td><p>Per-atom vector</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>LMP_STYLE_ATOM</p></td>
|
||
<td><p>LMP_SIZE_COLS</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Columns of per-atom array, 0 if vector</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_LOCAL</p></td>
|
||
<td><p>LMP_TYPE_VECTOR</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Local data vector</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>LMP_STYLE_LOCAL</p></td>
|
||
<td><p>LMP_TYPE_ARRAY</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">double</span> <span class="pre">**</span></code></p></td>
|
||
<td><p>Local data array</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>LMP_STYLE_LOCAL</p></td>
|
||
<td><p>LMP_SIZE_ROWS</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Number of local data rows</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>LMP_STYLE_LOCAL</p></td>
|
||
<td><p>LMP_SIZE_COLS</p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">*</span></code></p></td>
|
||
<td><p>Number of local data columns</p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</p>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>When requesting global data, the fix data can only be accessed one
|
||
item at a time without access to the pointer itself. Thus this
|
||
function will allocate storage for a single double value, copy the
|
||
returned value to it, and returns a pointer to the location of the
|
||
copy. Therefore the allocated storage needs to be freed after its
|
||
use to avoid a memory leak. Example:</p>
|
||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">double</span><span class="w"> </span><span class="o">*</span><span class="n">dptr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="kt">double</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="n">lammps_extract_fix</span><span class="p">(</span><span class="n">handle</span><span class="p">,</span><span class="w"> </span><span class="n">name</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="n">LMP_STYLE_GLOBAL</span><span class="p">,</span><span class="w"> </span><span class="n">LMP_TYPE_VECTOR</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span>
|
||
<span class="kt">double</span><span class="w"> </span><span class="n">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">*</span><span class="n">dptr</span><span class="p">;</span>
|
||
<span class="n">lammps_free</span><span class="p">((</span><span class="kt">void</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="n">dptr</span><span class="p">);</span>
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>LAMMPS cannot easily check if it is valid to access the data, so it
|
||
may fail with an error. The caller has to avoid such an error.</p>
|
||
</div>
|
||
<div class="admonition warning">
|
||
<p class="admonition-title">Warning</p>
|
||
<p>The pointers returned by this function for per-atom or local data are
|
||
generally not persistent, since the computed data may be re-distributed,
|
||
re-allocated, and re-ordered at every invocation of the fix. It is thus
|
||
advisable to re-invoke this function before the data is accessed, or
|
||
make a copy, if the data shall be used after other LAMMPS commands have
|
||
been issued.</p>
|
||
</div>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>handle</strong> – pointer to a previously created LAMMPS instance </p></li>
|
||
<li><p><strong>id</strong> – string with ID of the fix </p></li>
|
||
<li><p><strong>style</strong> – constant indicating the style of data requested (global, per-atom, or local) </p></li>
|
||
<li><p><strong>type</strong> – constant indicating type of data (scalar, vector, or array) or size of rows or columns </p></li>
|
||
<li><p><strong>nrow</strong> – row index (only used for global vectors and arrays) </p></li>
|
||
<li><p><strong>ncol</strong> – column index (only used for global arrays) </p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>pointer (cast to <code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">*</span></code>) to the location of the requested data or <code class="docutils literal notranslate"><span class="pre">NULL</span></code> if not found. </p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<hr class="docutils" />
|
||
<dl class="cpp function">
|
||
<dt class="sig sig-object cpp" id="_CPPv432lammps_extract_variable_datatypePvPKc">
|
||
<span id="_CPPv332lammps_extract_variable_datatypePvPKc"></span><span id="_CPPv232lammps_extract_variable_datatypePvPKc"></span><span id="lammps_extract_variable_datatype__voidP.cCP"></span><span class="target" id="library_8h_1a5725944733b98157d3f6993c2f6499ce"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">lammps_extract_variable_datatype</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">handle</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">name</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv432lammps_extract_variable_datatypePvPKc" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>Get data type of a LAMMPS variable.</p>
|
||
<p><div class="versionadded">
|
||
<p><span class="versionmodified added">Added in version 3Nov2022.</span></p>
|
||
</div>
|
||
<p>This function returns an integer that encodes the data type of the variable
|
||
with the specified name. See <a class="reference internal" href="#_CPPv414_LMP_VAR_CONST" title="_LMP_VAR_CONST"><code class="xref cpp cpp-enum docutils literal notranslate"><span class="pre">_LMP_VAR_CONST</span></code></a> for valid values.
|
||
Callers of <a class="reference internal" href="#_CPPv423lammps_extract_variablePvPKcPKc" title="lammps_extract_variable"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">lammps_extract_variable()</span></code></a> can use this information to
|
||
decide how to cast the <code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">*</span></code> pointer and access the data.</p>
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>handle</strong> – pointer to a previously created LAMMPS instance </p></li>
|
||
<li><p><strong>name</strong> – string with the name of the extracted variable </p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>integer constant encoding the data type of the property or -1 if not found. </p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<hr class="docutils" />
|
||
<dl class="cpp function">
|
||
<dt class="sig sig-object cpp" id="_CPPv423lammps_extract_variablePvPKcPKc">
|
||
<span id="_CPPv323lammps_extract_variablePvPKcPKc"></span><span id="_CPPv223lammps_extract_variablePvPKcPKc"></span><span id="lammps_extract_variable__voidP.cCP.cCP"></span><span class="target" id="library_8h_1a93437a9fed4a4dec044d010e9df52d7f"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">lammps_extract_variable</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">handle</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">group</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv423lammps_extract_variablePvPKcPKc" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>Get pointer to data from a LAMMPS variable.</p>
|
||
<p><p>This function returns a pointer to data from a LAMMPS <a class="reference internal" href="variable.html"><span class="doc">variable command</span></a>
|
||
identified by its name. When the variable is either an <em>equal</em>-style
|
||
compatible variable, a <em>vector</em>-style variable, or an <em>atom</em>-style
|
||
variable, the variable is evaluated and the corresponding value(s) returned.
|
||
Variables of style <em>internal</em> are compatible with <em>equal</em>-style variables and
|
||
so are <em>python</em>-style variables, if they return a numeric value. For other
|
||
variable styles, their string value is returned. The function returns
|
||
<code class="docutils literal notranslate"><span class="pre">NULL</span></code> when a variable of the provided <em>name</em> is not found or of an
|
||
incompatible style. The <em>group</em> argument is only used for <em>atom</em>-style variables and ignored otherwise, with one exception: for style <em>vector</em>,
|
||
if <em>group</em> is “GET_VECTOR_SIZE”, the returned pointer will yield the length
|
||
of the vector to be returned when dereferenced. This pointer must be
|
||
deallocated after the value is read to avoid a memory leak.
|
||
If <em>group</em> is set to <code class="docutils literal notranslate"><span class="pre">NULL</span></code> when extracting data from an <em>atom</em>-style
|
||
variable, the group is assumed to be “all”.</p>
|
||
<p>When requesting data from an <em>equal</em>-style or compatible variable
|
||
this function allocates storage for a single double value, copies the
|
||
returned value to it, and returns a pointer to the location of the
|
||
copy. Therefore the allocated storage needs to be freed after its
|
||
use to avoid a memory leak. Example:</p>
|
||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">double</span><span class="w"> </span><span class="o">*</span><span class="n">dptr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="kt">double</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="n">lammps_extract_variable</span><span class="p">(</span><span class="n">handle</span><span class="p">,</span><span class="w"> </span><span class="n">name</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span>
|
||
<span class="kt">double</span><span class="w"> </span><span class="n">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">*</span><span class="n">dptr</span><span class="p">;</span>
|
||
<span class="n">lammps_free</span><span class="p">((</span><span class="kt">void</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="n">dptr</span><span class="p">);</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>For <em>atom</em>-style variables, the return value is a pointer to an
|
||
allocated block of storage of double of the length <code class="docutils literal notranslate"><span class="pre">atom->nlocal</span></code>.
|
||
Since the data returned are a copy, the location will persist, but its
|
||
content will not be updated in case the variable is re-evaluated.
|
||
To avoid a memory leak, this pointer needs to be freed after use in
|
||
the calling program.</p>
|
||
<p>For <em>vector</em>-style variables, the returned pointer points to actual
|
||
LAMMPS data and thus it should <strong>not</strong> be deallocated. Its length
|
||
depends on the variable, compute, or fix data used to construct the
|
||
<em>vector</em>-style variable. This length can be fetched by calling this
|
||
function with <em>group</em> set to a non-NULL pointer (NULL returns the vector).
|
||
In that case it will return the vector length as an allocated int
|
||
pointer cast to a <code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">*</span></code> pointer. That pointer can be recast and
|
||
dereferenced to an integer yielding the length of the vector. This pointer
|
||
must be deallocated when finished with it to avoid memory leaks. Example:</p>
|
||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">double</span><span class="w"> </span><span class="o">*</span><span class="n">vectvals</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="kt">double</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="n">lammps_extract_variable</span><span class="p">(</span><span class="n">handle</span><span class="p">,</span><span class="w"> </span><span class="n">name</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span>
|
||
<span class="kt">int</span><span class="w"> </span><span class="o">*</span><span class="n">intptr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="n">lammps_extract_variable</span><span class="p">(</span><span class="n">handle</span><span class="p">,</span><span class="w"> </span><span class="n">name</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">);</span>
|
||
<span class="kt">int</span><span class="w"> </span><span class="n">vectlen</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">*</span><span class="n">intptr</span><span class="p">;</span>
|
||
<span class="n">lammps_free</span><span class="p">((</span><span class="kt">void</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="n">intptr</span><span class="p">);</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>For other variable styles the returned pointer needs to be cast to
|
||
a char pointer and it should <strong>not</strong> be deallocated. Example:</p>
|
||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">cptr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="n">lammps_extract_variable</span><span class="p">(</span><span class="n">handle</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="nb">NULL</span><span class="p">);</span>
|
||
<span class="n">printf</span><span class="p">(</span><span class="s">"The value of variable %s is %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">name</span><span class="p">,</span><span class="w"> </span><span class="n">cptr</span><span class="p">);</span>
|
||
</pre></div>
|
||
</div>
|
||
</p>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>LAMMPS cannot easily check if it is valid to access the data
|
||
referenced by the variables (e.g., computes, fixes, or thermodynamic
|
||
info), so it may fail with an error. The caller has to make certain
|
||
that the data is extracted only when it safe to evaluate the variable
|
||
and thus an error or crash are avoided.</p>
|
||
</div>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>handle</strong> – pointer to a previously created LAMMPS instance </p></li>
|
||
<li><p><strong>name</strong> – name of the variable </p></li>
|
||
<li><p><strong>group</strong> – group-ID for atom style variable or <code class="docutils literal notranslate"><span class="pre">NULL</span></code> or non-NULL to get vector length </p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>pointer (cast to <code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">*</span></code>) to the location of the requested data or <code class="docutils literal notranslate"><span class="pre">NULL</span></code> if not found. </p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<hr class="docutils" />
|
||
<dl class="cpp function">
|
||
<dt class="sig sig-object cpp" id="_CPPv419lammps_set_variablePvPKcPKc">
|
||
<span id="_CPPv319lammps_set_variablePvPKcPKc"></span><span id="_CPPv219lammps_set_variablePvPKcPKc"></span><span id="lammps_set_variable__voidP.cCP.cCP"></span><span class="target" id="library_8h_1ab3cc202eaec7472181870b4747b3d577"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">lammps_set_variable</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">handle</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">str</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv419lammps_set_variablePvPKcPKc" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>Set the value of a string-style variable. <p><div class="deprecated">
|
||
<p><span class="versionmodified deprecated">Deprecated since version 7Feb2024.</span></p>
|
||
</div>
|
||
<p>This function assigns a new value from the string str to the
|
||
string-style variable <em>name</em>. This is a way to directly change the
|
||
string value of a LAMMPS variable that was previous defined with a
|
||
<a class="reference internal" href="variable.html"><span class="doc">variable name string</span></a> command without using any
|
||
LAMMPS commands to delete and redefine the variable.</p>
|
||
<p>Returns -1 if a variable of that name does not exist or if it is not
|
||
a string-style variable, otherwise 0.</p>
|
||
</p>
|
||
</p>
|
||
<div class="admonition warning">
|
||
<p class="admonition-title">Warning</p>
|
||
<p>This function is deprecated and <a class="reference internal" href="#_CPPv426lammps_set_string_variablePvPKcPKc" title="lammps_set_string_variable"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">lammps_set_string_variable()</span></code></a>
|
||
should be used instead.</p>
|
||
</div>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>handle</strong> – pointer to a previously created LAMMPS instance </p></li>
|
||
<li><p><strong>name</strong> – name of the variable </p></li>
|
||
<li><p><strong>str</strong> – new value of the variable </p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>0 on success or -1 on failure </p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<hr class="docutils" />
|
||
<dl class="cpp function">
|
||
<dt class="sig sig-object cpp" id="_CPPv426lammps_set_string_variablePvPKcPKc">
|
||
<span id="_CPPv326lammps_set_string_variablePvPKcPKc"></span><span id="_CPPv226lammps_set_string_variablePvPKcPKc"></span><span id="lammps_set_string_variable__voidP.cCP.cCP"></span><span class="target" id="library_8h_1a540ffa539718883760eb6fafab3627bc"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">lammps_set_string_variable</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">handle</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">str</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv426lammps_set_string_variablePvPKcPKc" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>Set the value of a string-style variable. <p><div class="versionadded">
|
||
<p><span class="versionmodified added">Added in version 7Feb2024.</span></p>
|
||
</div>
|
||
<p>This function assigns a new value from the string str to the
|
||
string-style variable <em>name</em>. This is a way to directly change the
|
||
string value of a LAMMPS variable that was previous defined with a
|
||
<a class="reference internal" href="variable.html"><span class="doc">variable name string</span></a> command without using any
|
||
LAMMPS commands to delete and redefine the variable.</p>
|
||
<p>Returns -1 if a variable of that name does not exist or if it is not
|
||
a string-style variable, otherwise 0.</p>
|
||
</p>
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>handle</strong> – pointer to a previously created LAMMPS instance </p></li>
|
||
<li><p><strong>name</strong> – name of the variable </p></li>
|
||
<li><p><strong>str</strong> – new value of the variable </p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>0 on success or -1 on failure </p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<hr class="docutils" />
|
||
<dl class="cpp function">
|
||
<dt class="sig sig-object cpp" id="_CPPv428lammps_set_internal_variablePvPKcd">
|
||
<span id="_CPPv328lammps_set_internal_variablePvPKcd"></span><span id="_CPPv228lammps_set_internal_variablePvPKcd"></span><span id="lammps_set_internal_variable__voidP.cCP.double"></span><span class="target" id="library_8h_1a250fd1b00f6b69daf98cc4a879c78059"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">lammps_set_internal_variable</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">handle</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">name</span></span>, <span class="kt"><span class="pre">double</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">value</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv428lammps_set_internal_variablePvPKcd" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>Set the value of an internal-style variable.</p>
|
||
<p><div class="versionadded">
|
||
<p><span class="versionmodified added">Added in version 7Feb2024.</span></p>
|
||
</div>
|
||
<p>This function assigns a new value from the floating point number <em>value</em>
|
||
to the internal-style variable <em>name</em>. This is a way to directly change
|
||
the numerical value of such a LAMMPS variable that was previous defined
|
||
with a <a class="reference internal" href="variable.html"><span class="doc">variable name internal</span></a> command without using
|
||
any LAMMPS commands to delete and redefine the variable.</p>
|
||
<p>Returns -1 if a variable of that name does not exist or is not an
|
||
internal-style variable, otherwise 0.</p>
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>handle</strong> – pointer to a previously created LAMMPS instance </p></li>
|
||
<li><p><strong>name</strong> – name of the variable </p></li>
|
||
<li><p><strong>value</strong> – new value of the variable </p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>0 on success or -1 on failure </p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<hr class="docutils" />
|
||
<dl class="cpp function">
|
||
<dt class="sig sig-object cpp" id="_CPPv420lammps_variable_infoPviPci">
|
||
<span id="_CPPv320lammps_variable_infoPviPci"></span><span id="_CPPv220lammps_variable_infoPviPci"></span><span id="lammps_variable_info__voidP.i.cP.i"></span><span class="target" id="library_8h_1a7d42a4fb49036f76e6042ca8302aa567"></span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">lammps_variable_info</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">handle</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">idx</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">buf</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">bufsize</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv420lammps_variable_infoPviPci" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>Retrieve informational string for a variable.</p>
|
||
<p><div class="versionadded">
|
||
<p><span class="versionmodified added">Added in version 21Nov2023.</span></p>
|
||
</div>
|
||
<p>This function copies a string with human readable information about
|
||
a defined variable: name, style, current value(s) into the provided
|
||
C-style string buffer. That is the same info as produced by the
|
||
<a class="reference internal" href="info.html"><span class="doc">info variables</span></a> command. The length of the buffer must
|
||
be provided as <em>buf_size</em> argument. If the info exceeds the length
|
||
of the buffer, it will be truncated accordingly. If the index is
|
||
out of range, the function returns 0 and <em>buffer</em> is set to an empty
|
||
string, otherwise 1.</p>
|
||
</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>handle</strong> – pointer to a previously created LAMMPS instance cast to <code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">*</span></code>. </p></li>
|
||
<li><p><strong>idx</strong> – index of the variable (0 <= idx < nvar) </p></li>
|
||
<li><p><strong>buffer</strong> – string buffer to copy the info to </p></li>
|
||
<li><p><strong>buf_size</strong> – size of the provided string buffer </p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>1 if successful, otherwise 0 </p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<hr class="docutils" />
|
||
<dl class="cpp enum">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONSTE">
|
||
<span id="_CPPv3N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONSTE"></span><span id="_CPPv2N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONSTE"></span><span class="target" id="structLAMMPS__NS_1_1multitype_1a8f60df5cd520b67959d22185afcdacc5"></span><span class="k"><span class="pre">enum</span></span><span class="w"> </span><span class="sig-prename descclassname"><span class="n"><span class="pre">LAMMPS_NS</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">multitype</span></span><span class="p"><span class="pre">::</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">_LMP_DATATYPE_CONST</span></span></span><a class="headerlink" href="#_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONSTE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>Data type constants for extracting data from atoms, computes and fixes</p>
|
||
<p>This enum must be kept in sync with the corresponding enum or constants in <code class="docutils literal notranslate"><span class="pre">python/lammps/constants.py</span></code>, <code class="docutils literal notranslate"><span class="pre">fortran/lammps.f90</span></code>, <code class="docutils literal notranslate"><span class="pre">tools/swig/lammps.i</span></code>, <code class="docutils literal notranslate"><span class="pre">src/library.h</span></code>, and <code class="docutils literal notranslate"><span class="pre">examples/COUPLE/plugin/liblammpsplugin.h</span></code></p>
|
||
<p><em>Values:</em></p>
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST11LAMMPS_NONEE">
|
||
<span id="_CPPv3N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST11LAMMPS_NONEE"></span><span id="_CPPv2N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST11LAMMPS_NONEE"></span><span class="target" id="structLAMMPS__NS_1_1multitype_1a8f60df5cd520b67959d22185afcdacc5a2092f040c8fd7fd46efa6591c4f03515"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LAMMPS_NONE</span></span></span><a class="headerlink" href="#_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST11LAMMPS_NONEE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>no data type assigned (yet) </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST10LAMMPS_INTE">
|
||
<span id="_CPPv3N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST10LAMMPS_INTE"></span><span id="_CPPv2N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST10LAMMPS_INTE"></span><span class="target" id="structLAMMPS__NS_1_1multitype_1a8f60df5cd520b67959d22185afcdacc5a6f4597ad5c533e63a78fe90151d4d348"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LAMMPS_INT</span></span></span><a class="headerlink" href="#_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST10LAMMPS_INTE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>32-bit integer (array) </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST13LAMMPS_INT_2DE">
|
||
<span id="_CPPv3N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST13LAMMPS_INT_2DE"></span><span id="_CPPv2N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST13LAMMPS_INT_2DE"></span><span class="target" id="structLAMMPS__NS_1_1multitype_1a8f60df5cd520b67959d22185afcdacc5acdc5b9e5771b685c0f5c0377a06380da"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LAMMPS_INT_2D</span></span></span><a class="headerlink" href="#_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST13LAMMPS_INT_2DE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>two-dimensional 32-bit integer array </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST13LAMMPS_DOUBLEE">
|
||
<span id="_CPPv3N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST13LAMMPS_DOUBLEE"></span><span id="_CPPv2N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST13LAMMPS_DOUBLEE"></span><span class="target" id="structLAMMPS__NS_1_1multitype_1a8f60df5cd520b67959d22185afcdacc5a5a6c3a30d227047ab64e210c8a2fd468"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LAMMPS_DOUBLE</span></span></span><a class="headerlink" href="#_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST13LAMMPS_DOUBLEE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>64-bit double (array) </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST16LAMMPS_DOUBLE_2DE">
|
||
<span id="_CPPv3N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST16LAMMPS_DOUBLE_2DE"></span><span id="_CPPv2N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST16LAMMPS_DOUBLE_2DE"></span><span class="target" id="structLAMMPS__NS_1_1multitype_1a8f60df5cd520b67959d22185afcdacc5a515e6e960fa5de1f4e22596ede33fdeb"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LAMMPS_DOUBLE_2D</span></span></span><a class="headerlink" href="#_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST16LAMMPS_DOUBLE_2DE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>two-dimensional 64-bit double array </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST12LAMMPS_INT64E">
|
||
<span id="_CPPv3N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST12LAMMPS_INT64E"></span><span id="_CPPv2N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST12LAMMPS_INT64E"></span><span class="target" id="structLAMMPS__NS_1_1multitype_1a8f60df5cd520b67959d22185afcdacc5a3e0db9f4dfd611ebb971372cc245e80c"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LAMMPS_INT64</span></span></span><a class="headerlink" href="#_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST12LAMMPS_INT64E" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>64-bit integer (array) </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST15LAMMPS_INT64_2DE">
|
||
<span id="_CPPv3N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST15LAMMPS_INT64_2DE"></span><span id="_CPPv2N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST15LAMMPS_INT64_2DE"></span><span class="target" id="structLAMMPS__NS_1_1multitype_1a8f60df5cd520b67959d22185afcdacc5abfc022018c51b292be00cbc87760ab60"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LAMMPS_INT64_2D</span></span></span><a class="headerlink" href="#_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST15LAMMPS_INT64_2DE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>two-dimensional 64-bit integer array </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST13LAMMPS_STRINGE">
|
||
<span id="_CPPv3N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST13LAMMPS_STRINGE"></span><span id="_CPPv2N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST13LAMMPS_STRINGE"></span><span class="target" id="structLAMMPS__NS_1_1multitype_1a8f60df5cd520b67959d22185afcdacc5ae8c997bf96560c2d658a3d2a01518d72"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LAMMPS_STRING</span></span></span><a class="headerlink" href="#_CPPv4N9LAMMPS_NS9multitype19_LMP_DATATYPE_CONST13LAMMPS_STRINGE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>C-String </p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enum">
|
||
<dt class="sig sig-object cpp" id="_CPPv416_LMP_STYLE_CONST">
|
||
<span id="_CPPv316_LMP_STYLE_CONST"></span><span id="_CPPv216_LMP_STYLE_CONST"></span><span class="target" id="library_8h_1af78e950523b27d0aa9b74ccf93666d36"></span><span class="k"><span class="pre">enum</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">_LMP_STYLE_CONST</span></span></span><a class="headerlink" href="#_CPPv416_LMP_STYLE_CONST" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>Style constants for extracting data from computes and fixes.</p>
|
||
<p>Must be kept in sync with the equivalent constants in <code class="docutils literal notranslate"><span class="pre">python/lammps/constants.py</span></code>, <code class="docutils literal notranslate"><span class="pre">fortran/lammps.f90</span></code>, <code class="docutils literal notranslate"><span class="pre">tools/swig/lammps.i</span></code>, and <code class="docutils literal notranslate"><span class="pre">examples/COUPLE/plugin/liblammpsplugin.h</span></code></p>
|
||
<p><em>Values:</em></p>
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N16_LMP_STYLE_CONST16LMP_STYLE_GLOBALE">
|
||
<span id="_CPPv3N16_LMP_STYLE_CONST16LMP_STYLE_GLOBALE"></span><span id="_CPPv2N16_LMP_STYLE_CONST16LMP_STYLE_GLOBALE"></span><span class="target" id="library_8h_1af78e950523b27d0aa9b74ccf93666d36a5d9f763d2a7c13c4aea83405aaf4b3f3"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_STYLE_GLOBAL</span></span></span><a class="headerlink" href="#_CPPv4N16_LMP_STYLE_CONST16LMP_STYLE_GLOBALE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>return global data </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N16_LMP_STYLE_CONST14LMP_STYLE_ATOME">
|
||
<span id="_CPPv3N16_LMP_STYLE_CONST14LMP_STYLE_ATOME"></span><span id="_CPPv2N16_LMP_STYLE_CONST14LMP_STYLE_ATOME"></span><span class="target" id="library_8h_1af78e950523b27d0aa9b74ccf93666d36aa1e72b0a28e28261262774733cdbadfa"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_STYLE_ATOM</span></span></span><a class="headerlink" href="#_CPPv4N16_LMP_STYLE_CONST14LMP_STYLE_ATOME" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>return per-atom data </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N16_LMP_STYLE_CONST15LMP_STYLE_LOCALE">
|
||
<span id="_CPPv3N16_LMP_STYLE_CONST15LMP_STYLE_LOCALE"></span><span id="_CPPv2N16_LMP_STYLE_CONST15LMP_STYLE_LOCALE"></span><span class="target" id="library_8h_1af78e950523b27d0aa9b74ccf93666d36a9b74ce240cd632e21f8c1a5a1cf07ed0"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_STYLE_LOCAL</span></span></span><a class="headerlink" href="#_CPPv4N16_LMP_STYLE_CONST15LMP_STYLE_LOCALE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>return local data </p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enum">
|
||
<dt class="sig sig-object cpp" id="_CPPv415_LMP_TYPE_CONST">
|
||
<span id="_CPPv315_LMP_TYPE_CONST"></span><span id="_CPPv215_LMP_TYPE_CONST"></span><span class="target" id="library_8h_1a30cd6a0606720be7addec2816760879e"></span><span class="k"><span class="pre">enum</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">_LMP_TYPE_CONST</span></span></span><a class="headerlink" href="#_CPPv415_LMP_TYPE_CONST" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>Type and size constants for extracting data from computes and fixes.</p>
|
||
<p>Must be kept in sync with the equivalent constants in <code class="docutils literal notranslate"><span class="pre">python/lammps/constants.py</span></code>, <code class="docutils literal notranslate"><span class="pre">fortran/lammps.f90</span></code>, <code class="docutils literal notranslate"><span class="pre">tools/swig/lammps.i</span></code>, and <code class="docutils literal notranslate"><span class="pre">examples/COUPLE/plugin/liblammpsplugin.h</span></code></p>
|
||
<p><em>Values:</em></p>
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N15_LMP_TYPE_CONST15LMP_TYPE_SCALARE">
|
||
<span id="_CPPv3N15_LMP_TYPE_CONST15LMP_TYPE_SCALARE"></span><span id="_CPPv2N15_LMP_TYPE_CONST15LMP_TYPE_SCALARE"></span><span class="target" id="library_8h_1a30cd6a0606720be7addec2816760879ea3a0d5e6c49cc929d953b366ed58c821b"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_TYPE_SCALAR</span></span></span><a class="headerlink" href="#_CPPv4N15_LMP_TYPE_CONST15LMP_TYPE_SCALARE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>return scalar </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N15_LMP_TYPE_CONST15LMP_TYPE_VECTORE">
|
||
<span id="_CPPv3N15_LMP_TYPE_CONST15LMP_TYPE_VECTORE"></span><span id="_CPPv2N15_LMP_TYPE_CONST15LMP_TYPE_VECTORE"></span><span class="target" id="library_8h_1a30cd6a0606720be7addec2816760879ead7beec11786a3dc637fcdd2ac62506e8"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_TYPE_VECTOR</span></span></span><a class="headerlink" href="#_CPPv4N15_LMP_TYPE_CONST15LMP_TYPE_VECTORE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>return vector </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N15_LMP_TYPE_CONST14LMP_TYPE_ARRAYE">
|
||
<span id="_CPPv3N15_LMP_TYPE_CONST14LMP_TYPE_ARRAYE"></span><span id="_CPPv2N15_LMP_TYPE_CONST14LMP_TYPE_ARRAYE"></span><span class="target" id="library_8h_1a30cd6a0606720be7addec2816760879eaaacd44f7a32b76b06051cb01ff40451a"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_TYPE_ARRAY</span></span></span><a class="headerlink" href="#_CPPv4N15_LMP_TYPE_CONST14LMP_TYPE_ARRAYE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>return array </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N15_LMP_TYPE_CONST15LMP_SIZE_VECTORE">
|
||
<span id="_CPPv3N15_LMP_TYPE_CONST15LMP_SIZE_VECTORE"></span><span id="_CPPv2N15_LMP_TYPE_CONST15LMP_SIZE_VECTORE"></span><span class="target" id="library_8h_1a30cd6a0606720be7addec2816760879eab7e39a6a361f8bc210064c9d853b4ded"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_SIZE_VECTOR</span></span></span><a class="headerlink" href="#_CPPv4N15_LMP_TYPE_CONST15LMP_SIZE_VECTORE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>return length of vector </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N15_LMP_TYPE_CONST13LMP_SIZE_ROWSE">
|
||
<span id="_CPPv3N15_LMP_TYPE_CONST13LMP_SIZE_ROWSE"></span><span id="_CPPv2N15_LMP_TYPE_CONST13LMP_SIZE_ROWSE"></span><span class="target" id="library_8h_1a30cd6a0606720be7addec2816760879eaa65d78d0215fbb5d1f8cf6dfa05ed485"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_SIZE_ROWS</span></span></span><a class="headerlink" href="#_CPPv4N15_LMP_TYPE_CONST13LMP_SIZE_ROWSE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>return number of rows </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N15_LMP_TYPE_CONST13LMP_SIZE_COLSE">
|
||
<span id="_CPPv3N15_LMP_TYPE_CONST13LMP_SIZE_COLSE"></span><span id="_CPPv2N15_LMP_TYPE_CONST13LMP_SIZE_COLSE"></span><span class="target" id="library_8h_1a30cd6a0606720be7addec2816760879ea0213053b1c6d4283bb6d662a00fecc16"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_SIZE_COLS</span></span></span><a class="headerlink" href="#_CPPv4N15_LMP_TYPE_CONST13LMP_SIZE_COLSE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>return number of columns </p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enum">
|
||
<dt class="sig sig-object cpp" id="_CPPv414_LMP_VAR_CONST">
|
||
<span id="_CPPv314_LMP_VAR_CONST"></span><span id="_CPPv214_LMP_VAR_CONST"></span><span class="target" id="library_8h_1a09d7d9d1e5512d11257c5b6fce67ee37"></span><span class="k"><span class="pre">enum</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">_LMP_VAR_CONST</span></span></span><a class="headerlink" href="#_CPPv414_LMP_VAR_CONST" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>Variable style constants for extracting data from variables.</p>
|
||
<p>Must be kept in sync with the equivalent constants in <code class="docutils literal notranslate"><span class="pre">python/lammps/constants.py</span></code>, <code class="docutils literal notranslate"><span class="pre">fortran/lammps.f90</span></code>, <code class="docutils literal notranslate"><span class="pre">tools/swig/lammps.i</span></code>, and <code class="docutils literal notranslate"><span class="pre">examples/COUPLE/plugin/liblammpsplugin.h</span></code></p>
|
||
<p><em>Values:</em></p>
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N14_LMP_VAR_CONST13LMP_VAR_EQUALE">
|
||
<span id="_CPPv3N14_LMP_VAR_CONST13LMP_VAR_EQUALE"></span><span id="_CPPv2N14_LMP_VAR_CONST13LMP_VAR_EQUALE"></span><span class="target" id="library_8h_1a09d7d9d1e5512d11257c5b6fce67ee37aeb6a1c0a08cdfb496bcaef2cc37d5047"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_VAR_EQUAL</span></span></span><a class="headerlink" href="#_CPPv4N14_LMP_VAR_CONST13LMP_VAR_EQUALE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>compatible with equal-style variables </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N14_LMP_VAR_CONST12LMP_VAR_ATOME">
|
||
<span id="_CPPv3N14_LMP_VAR_CONST12LMP_VAR_ATOME"></span><span id="_CPPv2N14_LMP_VAR_CONST12LMP_VAR_ATOME"></span><span class="target" id="library_8h_1a09d7d9d1e5512d11257c5b6fce67ee37a4a336ec13f20754d421f7d0d218cc1a4"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_VAR_ATOM</span></span></span><a class="headerlink" href="#_CPPv4N14_LMP_VAR_CONST12LMP_VAR_ATOME" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>compatible with atom-style variables </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N14_LMP_VAR_CONST14LMP_VAR_VECTORE">
|
||
<span id="_CPPv3N14_LMP_VAR_CONST14LMP_VAR_VECTORE"></span><span id="_CPPv2N14_LMP_VAR_CONST14LMP_VAR_VECTORE"></span><span class="target" id="library_8h_1a09d7d9d1e5512d11257c5b6fce67ee37a381da764a4e3a5f1bc183cc9905be43c"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_VAR_VECTOR</span></span></span><a class="headerlink" href="#_CPPv4N14_LMP_VAR_CONST14LMP_VAR_VECTORE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>compatible with vector-style variables </p>
|
||
</dd></dl>
|
||
|
||
<dl class="cpp enumerator">
|
||
<dt class="sig sig-object cpp" id="_CPPv4N14_LMP_VAR_CONST14LMP_VAR_STRINGE">
|
||
<span id="_CPPv3N14_LMP_VAR_CONST14LMP_VAR_STRINGE"></span><span id="_CPPv2N14_LMP_VAR_CONST14LMP_VAR_STRINGE"></span><span class="target" id="library_8h_1a09d7d9d1e5512d11257c5b6fce67ee37a52551a127731cf3f7e193b9d1d83e6e8"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">LMP_VAR_STRING</span></span></span><a class="headerlink" href="#_CPPv4N14_LMP_VAR_CONST14LMP_VAR_STRINGE" title="Link to this definition"></a><br /></dt>
|
||
<dd><p>return value will be a string (catch-all) </p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
</section>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
|
||
<a href="Library_atoms.html" class="btn btn-neutral float-left" title="1.1.4. Per-atom properties" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||
<a href="Library_scatter.html" class="btn btn-neutral float-right" title="1.1.6. Scatter/gather operations" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||
</div>
|
||
|
||
<hr/>
|
||
|
||
<div role="contentinfo">
|
||
<p>© Copyright 2003-2025 Sandia Corporation.</p>
|
||
</div>
|
||
|
||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||
|
||
|
||
</footer>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
<script>
|
||
jQuery(function () {
|
||
SphinxRtdTheme.Navigation.enable(false);
|
||
});
|
||
</script>
|
||
|
||
</body>
|
||
</html> |