Merge branch 'integration' into vashishta-tabulation

This commit is contained in:
Axel Kohlmeyer 2016-09-01 08:25:31 -04:00
commit b12ad2cecf
121 changed files with 560 additions and 332 deletions

View File

@ -42,7 +42,9 @@ html: $(OBJECTS)
cp -r src/* $(RSTDIR)/ ;\
sphinx-build -j 8 -b html -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
deactivate ;\
)
)
-rm html/searchindex.js
-rm -rf html/_sources
@echo "Build finished. The HTML pages are in doc/html."
pdf: utils/txt2html/txt2html.exe

View File

@ -14,8 +14,8 @@ make clean-all # remove entire build folder and any cached data
## Installing prerequisites
To run the documention build toolchain Python 3 and virtualenv have to be
installed. Here are instructions for common setups:
To run the documention build toolchain, Python 3 and virtualenv have
to be installed. Here are instructions for common setups:
### Ubuntu
@ -23,10 +23,16 @@ installed. Here are instructions for common setups:
sudo apt-get install python-virtualenv
```
### Fedora
### Fedora (up to version 21), Red Hat Enterprise Linux or CentOS (up to version 7.x)
```bash
sudo yum install python3-virtualenv
```
sudo yum install python-virtualenv
### Fedora (since version 22)
```bash
sudo dnf install python3-virtualenv
```
### MacOS X

2
doc/html/.gitignore vendored
View File

@ -1,2 +1,4 @@
.buildinfo
objects.inv
searchindex.js
_sources

View File

@ -2333,20 +2333,20 @@ velocity:</p>
</ol>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">compute</span> <span class="n">myChunk</span> <span class="nb">all</span> <span class="n">com</span><span class="o">/</span><span class="n">chunk</span> <span class="n">cc1</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span><span class="p">[</span><span class="o">*</span><span class="p">]</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
</pre></div>
</div>
<ol class="arabic simple" start="4">
<li>Total force on each molecule and ave/max across all molecules:</li>
</ol>
<pre class="literal-block">
compute cc1 all chunk/atom molecule
fix 1 all ave/chunk 1000 1 1000 cc1 fx fy fz file tmp.out
variable xave equal ave(f_1<strong>2</strong>)
variable xmax equal max(f_1<strong>2</strong>)
thermo 1000
thermo_style custom step temp v_xave v_xmax
</pre>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">chunk</span> <span class="mi">1000</span> <span class="mi">1</span> <span class="mi">1000</span> <span class="n">cc1</span> <span class="n">fx</span> <span class="n">fy</span> <span class="n">fz</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span>
<span class="n">variable</span> <span class="n">xave</span> <span class="n">equal</span> <span class="n">ave</span><span class="p">(</span><span class="n">f_1</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
<span class="n">variable</span> <span class="n">xmax</span> <span class="n">equal</span> <span class="nb">max</span><span class="p">(</span><span class="n">f_1</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
<span class="n">thermo</span> <span class="mi">1000</span>
<span class="n">thermo_style</span> <span class="n">custom</span> <span class="n">step</span> <span class="n">temp</span> <span class="n">v_xave</span> <span class="n">v_xmax</span>
</pre></div>
</div>
<ol class="arabic simple" start="5">
<li>Histogram of cluster sizes:</li>
</ol>

View File

@ -389,6 +389,7 @@ within the LAMMPS code. The options that are currently recogized are:</p>
<li>-DLAMMPS_BIGBIG</li>
<li>-DLAMMPS_SMALLSMALL</li>
<li>-DLAMMPS_LONGLONG_TO_LONG</li>
<li>-DLAMMPS_EXCEPTIONS</li>
<li>-DPACK_ARRAY</li>
<li>-DPACK_POINTER</li>
<li>-DPACK_MEMCPY</li>
@ -457,6 +458,13 @@ be compiled with the same setting, or the link will fail.</p>
MPI version does not recognize &#8220;long long&#8221; data types. In this case a
&#8220;long&#8221; data type is likely already 64-bits, in which case this setting
will convert to that data type.</p>
<p>The -DLAMMPS_EXCEPTIONS setting can be used to activate alternative
versions of error handling inside of LAMMPS. This is useful when
external codes drive LAMMPS as a library. Using this option, LAMMPS
errors do not kill the caller. Instead, the call stack is unwound and
control returns to the caller. The library interface provides the
lammps_has_error() and lammps_get_last_error_message() functions to
detect and find out more about a LAMMPS error.</p>
<p>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

View File

@ -180,7 +180,7 @@ calculation to a file is to use the <a class="reference internal" href="fix_ave_
command, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">compute</span> <span class="n">myChunk</span> <span class="nb">all</span> <span class="n">angmom</span><span class="o">/</span><span class="n">chunk</span> <span class="n">cc1</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span><span class="p">[</span><span class="o">*</span><span class="p">]</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
</pre></div>
</div>
<p><strong>Output info:</strong></p>

View File

@ -178,7 +178,7 @@ calculation to a file is to use the <a class="reference internal" href="fix_ave_
command, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">compute</span> <span class="n">myChunk</span> <span class="nb">all</span> <span class="n">com</span><span class="o">/</span><span class="n">chunk</span> <span class="n">cc1</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span><span class="p">[</span><span class="o">*</span><span class="p">]</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
</pre></div>
</div>
<p><strong>Output info:</strong></p>

View File

@ -183,7 +183,7 @@ calculation to a file is to use the <a class="reference internal" href="fix_ave_
command, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">compute</span> <span class="n">myChunk</span> <span class="nb">all</span> <span class="n">dipole</span><span class="o">/</span><span class="n">chunk</span> <span class="n">cc1</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span><span class="p">[</span><span class="o">*</span><span class="p">]</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
</pre></div>
</div>
<p><strong>Output info:</strong></p>

View File

@ -179,7 +179,7 @@ calculation to a file is to use the <a class="reference internal" href="fix_ave_
command, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">compute</span> <span class="n">myChunk</span> <span class="nb">all</span> <span class="n">inertia</span><span class="o">/</span><span class="n">chunk</span> <span class="n">cc1</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span><span class="p">[</span><span class="o">*</span><span class="p">]</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
</pre></div>
</div>
<p><strong>Output info:</strong></p>

View File

@ -215,7 +215,7 @@ calculation to a file is to use the <a class="reference internal" href="fix_ave_
command, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">compute</span> <span class="n">myChunk</span> <span class="nb">all</span> <span class="n">com</span><span class="o">/</span><span class="n">msd</span> <span class="n">cc1</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span><span class="p">[</span><span class="o">*</span><span class="p">]</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
</pre></div>
</div>
<p><strong>Output info:</strong></p>

View File

@ -180,7 +180,7 @@ calculation to a file is to use the <a class="reference internal" href="fix_ave_
command, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">compute</span> <span class="n">myChunk</span> <span class="nb">all</span> <span class="n">omega</span><span class="o">/</span><span class="n">chunk</span> <span class="n">cc1</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span><span class="p">[</span><span class="o">*</span><span class="p">]</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
</pre></div>
</div>
<p><strong>Output info:</strong></p>

View File

@ -193,9 +193,9 @@ will be in unitless reduced units (0-1).</p>
calculation to a file is to use the <a class="reference internal" href="fix_ave_time.html"><span class="doc">fix ave/time</span></a>
command, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">compute</span> <span class="n">myChunk1</span> <span class="nb">all</span> <span class="nb">property</span><span class="o">/</span><span class="n">chunk</span> <span class="n">cc1</span>
<span class="n">compute</span> <span class="n">myChunk1</span> <span class="nb">all</span> <span class="nb">property</span><span class="o">/</span><span class="n">chunk</span> <span class="n">cc1</span> <span class="n">count</span>
<span class="n">compute</span> <span class="n">myChunk2</span> <span class="nb">all</span> <span class="n">com</span><span class="o">/</span><span class="n">chunk</span> <span class="n">cc1</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk1</span> <span class="n">c_myChunk2</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk1</span> <span class="n">c_myChunk2</span><span class="p">[</span><span class="o">*</span><span class="p">]</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
</pre></div>
</div>
<p><strong>Output info:</strong></p>

View File

@ -179,7 +179,7 @@ calculation to a file is to use the <a class="reference internal" href="fix_ave_
command, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">compute</span> <span class="n">myChunk</span> <span class="nb">all</span> <span class="n">torque</span><span class="o">/</span><span class="n">chunk</span> <span class="n">cc1</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span><span class="p">[</span><span class="o">*</span><span class="p">]</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
</pre></div>
</div>
<p><strong>Output info:</strong></p>

View File

@ -169,7 +169,7 @@ calculation to a file is to use the <a class="reference internal" href="fix_ave_
command, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">compute</span> <span class="n">myChunk</span> <span class="nb">all</span> <span class="n">vcm</span><span class="o">/</span><span class="n">chunk</span> <span class="n">cc1</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span><span class="p">[</span><span class="o">*</span><span class="p">]</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
</pre></div>
</div>
<p><strong>Output info:</strong></p>

View File

@ -156,25 +156,32 @@ keyword = <em>every</em>
<div class="section" id="description">
<h2>Description</h2>
<p>Perform constant NVE integration to update position and velocity for
atoms constrained to a curved surface (manifold) in the group each timestep. The constraint
is handled by RATTLE <a class="reference internal" href="fix_shake.html#andersen"><span class="std std-ref">(Andersen)</span></a> written out for the special case of
single-particle constraints as explained in <a class="reference internal" href="manifolds.html#paquay"><span class="std std-ref">(Paquay)</span></a>.
V is volume; E is energy. This way, the dynamics of particles constrained to
curved surfaces can be studied. If combined with <a class="reference internal" href="fix_langevin.html"><span class="doc">fix langevin</span></a>, this generates
Brownian motion of particles constrained to a curved surface. For a list of currently supported
manifolds and their parameters, see <a class="reference internal" href="manifolds.html"><span class="doc">manifolds</span></a>.</p>
<p>Note that the particles must initially be close to the manifold in question. If not, RATTLE will
not be able to iterate until the constraint is satisfied, and an error is generated. For simple
manifolds this can be achieved with <em>region</em> and <em>create_atoms</em> commands, but for more complex
surfaces it might be more useful to write a script.</p>
atoms constrained to a curved surface (manifold) in the group each
timestep. The constraint is handled by RATTLE <a class="reference internal" href="fix_shake.html#andersen"><span class="std std-ref">(Andersen)</span></a>
written out for the special case of single-particle constraints as
explained in <a class="reference internal" href="fix_nvt_manifold_rattle.html#paquay"><span class="std std-ref">(Paquay)</span></a>. V is volume; E is energy. This way,
the dynamics of particles constrained to curved surfaces can be
studied. If combined with <a class="reference internal" href="fix_langevin.html"><span class="doc">fix langevin</span></a>, this
generates Brownian motion of particles constrained to a curved
surface. For a list of currently supported manifolds and their
parameters, see <a class="reference internal" href="manifolds.html"><span class="doc">manifolds</span></a>.</p>
<p>Note that the particles must initially be close to the manifold in
question. If not, RATTLE will not be able to iterate until the
constraint is satisfied, and an error is generated. For simple
manifolds this can be achieved with <em>region</em> and <em>create_atoms</em>
commands, but for more complex surfaces it might be more useful to
write a script.</p>
<p>The manifold args may be equal-style variables, like so:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">variable</span> <span class="n">R</span> <span class="n">equal</span> <span class="s2">&quot;ramp(5.0,3.0)&quot;</span>
<span class="n">fix</span> <span class="n">shrink_sphere</span> <span class="nb">all</span> <span class="n">nve</span><span class="o">/</span><span class="n">manifold</span><span class="o">/</span><span class="n">rattle</span> <span class="mi">1</span><span class="n">e</span><span class="o">-</span><span class="mi">4</span> <span class="mi">10</span> <span class="n">sphere</span> <span class="n">v_R</span>
</pre></div>
</div>
<p>In this case, the manifold parameter will change in time according to the variable.
This is not a problem for the time integrator as long as the change of the manifold is slow with respect to the dynamics of the particles.
Note that if the manifold has to exert work on the particles because of these changes, the total energy might not be conserved.</p>
<p>In this case, the manifold parameter will change in time according to
the variable. This is not a problem for the time integrator as long
as the change of the manifold is slow with respect to the dynamics of
the particles. Note that if the manifold has to exert work on the
particles because of these changes, the total energy might not be
conserved.</p>
</div>
<hr class="docutils" />
<div class="section" id="restart-fix-modify-output-run-start-stop-minimize-info">
@ -188,12 +195,8 @@ This fix is not invoked during <a class="reference internal" href="minimize.html
<hr class="docutils" />
<div class="section" id="restrictions">
<h2>Restrictions</h2>
<p>This fix is part of the USER-MANIFOLD 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 class="std std-ref">Making LAMMPS</span></a>
section for more info.</p>
<p>Only use this with <em>min_style hftn</em> or <em>min_style quickmin</em>. If not, the constraints
will not be satisfied very well at all. A warning is generated if the <em>min_style</em> is
incompatible but no error.</p>
<p>This fix is part of the USER-MANIFOLD 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 class="std std-ref">Making LAMMPS</span></a> section for more info.</p>
</div>
<hr class="docutils" />
<div class="section" id="related-commands">
@ -202,7 +205,7 @@ incompatible but no error.</p>
<p><strong>Default:</strong> every = 0, tchain = 3</p>
<hr class="docutils" />
<p id="andersen"><strong>(Andersen)</strong> Andersen, J. Comp. Phys. 52, 24, (1983).</p>
<p id="paquay"><strong>(Paquay)</strong> Paquay and Kusters, Biophys. J., 110, ???, (2016), to be published,
<p id="paquay"><strong>(Paquay)</strong> Paquay and Kusters, Biophys. J., 110, 6, (2016).
preprint available at <a class="reference external" href="http://arxiv.org/abs/1411.3019/">arXiv:1411.3019</a>.</p>
</div>
</div>

View File

@ -157,7 +157,7 @@ keyword = <em>temp</em> or <em>tchain</em> or <em>every</em>
</div>
<div class="section" id="description">
<h2>Description</h2>
<p>This fix combines the RATTLE-based <a class="reference internal" href="fix_shake.html#andersen"><span class="std std-ref">(Andersen)</span></a> time integrator of <a class="reference internal" href="fix_nve_manifold_rattle.html"><span class="doc">fix nve/manifold/rattle</span></a> <a class="reference internal" href="manifolds.html#paquay"><span class="std std-ref">(Paquay)</span></a> with a Nose-Hoover-chain thermostat to sample the
<p>This fix combines the RATTLE-based <a class="reference internal" href="fix_shake.html#andersen"><span class="std std-ref">(Andersen)</span></a> time integrator of <a class="reference internal" href="fix_nve_manifold_rattle.html"><span class="doc">fix nve/manifold/rattle</span></a> <a class="reference internal" href="#paquay"><span class="std std-ref">(Paquay)</span></a> with a Nose-Hoover-chain thermostat to sample the
canonical ensemble of particles constrained to a curved surface (manifold). This sampling does suffer from discretization bias of O(dt).
For a list of currently supported manifolds and their parameters, see <a class="reference internal" href="manifolds.html"><span class="doc">manifolds</span></a></p>
</div>
@ -176,9 +176,6 @@ This fix is not invoked during <a class="reference internal" href="minimize.html
<p>This fix is part of the USER-MANIFOLD 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 class="std std-ref">Making LAMMPS</span></a>
section for more info.</p>
<p>Only use this with <em>min_style hftn</em> or <em>min_style quickmin</em>. If not, the constraints
will not be satisfied very well at all. A warning is generated if the <em>min_style</em> is
incompatible but no error.</p>
</div>
<hr class="docutils" />
<div class="section" id="related-commands">
@ -187,7 +184,7 @@ incompatible but no error.</p>
<strong>Default:</strong> every = 0</p>
<hr class="docutils" />
<p id="andersen"><strong>(Andersen)</strong> Andersen, J. Comp. Phys. 52, 24, (1983).</p>
<p id="paquay"><strong>(Paquay)</strong> Paquay and Kusters, Biophys. J., 110, ???, (2016), to be published,
<p id="paquay"><strong>(Paquay)</strong> Paquay and Kusters, Biophys. J., 110, 6, (2016).
preprint available at <a class="reference external" href="http://arxiv.org/abs/1411.3019/">arXiv:1411.3019</a>.</p>
</div>
</div>

File diff suppressed because one or more lines are too long

View File

@ -2297,14 +2297,14 @@ fix 1 all ave/chunk 100 10 1000 cc1 temp bias vbias file tmp.out :pre
compute cc1 all chunk/atom molecule
compute myChunk all com/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
fix 1 all ave/time 100 1 100 c_myChunk\[*\] file tmp.out mode vector :pre
(4) Total force on each molecule and ave/max across all molecules:
compute cc1 all chunk/atom molecule
fix 1 all ave/chunk 1000 1 1000 cc1 fx fy fz file tmp.out
variable xave equal ave(f_1[2])
variable xmax equal max(f_1[2])
variable xave equal ave(f_1\[2\])
variable xmax equal max(f_1\[2\])
thermo 1000
thermo_style custom step temp v_xave v_xmax :pre

View File

@ -262,6 +262,7 @@ within the LAMMPS code. The options that are currently recogized are:
-DLAMMPS_BIGBIG
-DLAMMPS_SMALLSMALL
-DLAMMPS_LONGLONG_TO_LONG
-DLAMMPS_EXCEPTIONS
-DPACK_ARRAY
-DPACK_POINTER
-DPACK_MEMCPY :ul
@ -334,6 +335,14 @@ 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.
The -DLAMMPS_EXCEPTIONS setting can be used to activate alternative
versions of error handling inside of LAMMPS. This is useful when
external codes drive LAMMPS as a library. Using this option, LAMMPS
errors do not kill the caller. Instead, the call stack is unwound and
control returns to the caller. The library interface provides the
lammps_has_error() and lammps_get_last_error_message() functions to
detect and find out more about a LAMMPS error.
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

View File

@ -64,7 +64,7 @@ command, for example:
compute cc1 all chunk/atom molecule
compute myChunk all angmom/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
fix 1 all ave/time 100 1 100 c_myChunk\[*\] file tmp.out mode vector :pre
[Output info:]

View File

@ -62,7 +62,7 @@ command, for example:
compute cc1 all chunk/atom molecule
compute myChunk all com/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
fix 1 all ave/time 100 1 100 c_myChunk\[*\] file tmp.out mode vector :pre
[Output info:]

View File

@ -67,7 +67,7 @@ command, for example:
compute cc1 all chunk/atom molecule
compute myChunk all dipole/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
fix 1 all ave/time 100 1 100 c_myChunk\[*\] file tmp.out mode vector :pre
[Output info:]

View File

@ -63,7 +63,7 @@ command, for example:
compute cc1 all chunk/atom molecule
compute myChunk all inertia/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
fix 1 all ave/time 100 1 100 c_myChunk\[*\] file tmp.out mode vector :pre
[Output info:]

View File

@ -97,7 +97,7 @@ 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
fix 1 all ave/time 100 1 100 c_myChunk\[*\] file tmp.out mode vector :pre
[Output info:]

View File

@ -64,7 +64,7 @@ command, for example:
compute cc1 all chunk/atom molecule
compute myChunk all omega/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
fix 1 all ave/time 100 1 100 c_myChunk\[*\] file tmp.out mode vector :pre
[Output info:]

View File

@ -86,9 +86,9 @@ 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 myChunk1 all property/chunk cc1
compute myChunk1 all property/chunk cc1 count
compute myChunk2 all com/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk1 c_myChunk2 file tmp.out mode vector :pre
fix 1 all ave/time 100 1 100 c_myChunk1 c_myChunk2\[*\] file tmp.out mode vector :pre
[Output info:]

View File

@ -63,7 +63,7 @@ command, for example:
compute cc1 all chunk/atom molecule
compute myChunk all torque/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
fix 1 all ave/time 100 1 100 c_myChunk\[*\] file tmp.out mode vector :pre
[Output info:]

View File

@ -54,7 +54,7 @@ command, for example:
compute cc1 all chunk/atom molecule
compute myChunk all vcm/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
fix 1 all ave/time 100 1 100 c_myChunk\[*\] file tmp.out mode vector :pre
[Output info:]

View File

@ -22,7 +22,6 @@ one or more keyword/value pairs may be appended :l
keyword = {every}
{every} values = N
N = print info about iteration every N steps. N = 0 means no output :pre
:ule
[Examples:]
@ -33,28 +32,34 @@ fix step all nve/manifold/rattle 1e-8 100 ellipsoid 2.5 2.5 5.0 every 25 :pre
[Description:]
Perform constant NVE integration to update position and velocity for
atoms constrained to a curved surface (manifold) in the group each timestep. The constraint
is handled by RATTLE "(Andersen)"_#Andersen written out for the special case of
single-particle constraints as explained in "(Paquay)"_#Paquay.
V is volume; E is energy. This way, the dynamics of particles constrained to
curved surfaces can be studied. If combined with "fix langevin"_fix_langevin.html, this generates
Brownian motion of particles constrained to a curved surface. For a list of currently supported
manifolds and their parameters, see "manifolds"_manifolds.html.
atoms constrained to a curved surface (manifold) in the group each
timestep. The constraint is handled by RATTLE "(Andersen)"_#Andersen
written out for the special case of single-particle constraints as
explained in "(Paquay)"_#Paquay. V is volume; E is energy. This way,
the dynamics of particles constrained to curved surfaces can be
studied. If combined with "fix langevin"_fix_langevin.html, this
generates Brownian motion of particles constrained to a curved
surface. For a list of currently supported manifolds and their
parameters, see "manifolds"_manifolds.html.
Note that the particles must initially be close to the manifold in question. If not, RATTLE will
not be able to iterate until the constraint is satisfied, and an error is generated. For simple
manifolds this can be achieved with {region} and {create_atoms} commands, but for more complex
surfaces it might be more useful to write a script.
Note that the particles must initially be close to the manifold in
question. If not, RATTLE will not be able to iterate until the
constraint is satisfied, and an error is generated. For simple
manifolds this can be achieved with {region} and {create_atoms}
commands, but for more complex surfaces it might be more useful to
write a script.
The manifold args may be equal-style variables, like so:
variable R equal "ramp(5.0,3.0)"
fix shrink_sphere all nve/manifold/rattle 1e-4 10 sphere v_R :pre
In this case, the manifold parameter will change in time according to the variable.
This is not a problem for the time integrator as long as the change of the manifold is slow with respect to the dynamics of the particles.
Note that if the manifold has to exert work on the particles because of these changes, the total energy might not be conserved.
In this case, the manifold parameter will change in time according to
the variable. This is not a problem for the time integrator as long
as the change of the manifold is slow with respect to the dynamics of
the particles. Note that if the manifold has to exert work on the
particles because of these changes, the total energy might not be
conserved.
:line
@ -72,19 +77,16 @@ This fix is not invoked during "energy minimization"_minimize.html.
[Restrictions:]
This fix is part of the USER-MANIFOLD 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.
Only use this with {min_style hftn} or {min_style quickmin}. If not, the constraints
will not be satisfied very well at all. A warning is generated if the {min_style} is
incompatible but no error.
This fix is part of the USER-MANIFOLD 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.
:line
[Related commands:]
"fix nvt/manifold/rattle"_fix_nvt_manifold_rattle.html, "fix manifoldforce"_fix_manifoldforce.html
"fix nvt/manifold/rattle"_fix_nvt_manifold_rattle.html, "fix
manifoldforce"_fix_manifoldforce.html
[Default:] every = 0, tchain = 3
@ -94,7 +96,7 @@ incompatible but no error.
[(Andersen)] Andersen, J. Comp. Phys. 52, 24, (1983).
:link(Paquay)
[(Paquay)] Paquay and Kusters, Biophys. J., 110, ???, (2016), to be published,
[(Paquay)] Paquay and Kusters, Biophys. J., 110, 6, (2016).
preprint available at "arXiv:1411.3019"_http://arxiv.org/abs/1411.3019/.

View File

@ -62,10 +62,6 @@ This fix is part of the USER-MANIFOLD 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.
Only use this with {min_style hftn} or {min_style quickmin}. If not, the constraints
will not be satisfied very well at all. A warning is generated if the {min_style} is
incompatible but no error.
:line
@ -80,6 +76,6 @@ incompatible but no error.
[(Andersen)] Andersen, J. Comp. Phys. 52, 24, (1983).
:link(Paquay)
[(Paquay)] Paquay and Kusters, Biophys. J., 110, ???, (2016), to be published,
[(Paquay)] Paquay and Kusters, Biophys. J., 110, 6, (2016).
preprint available at "arXiv:1411.3019"_http://arxiv.org/abs/1411.3019/.

View File

@ -1,50 +1,20 @@
{#
basic/search.html
~~~~~~~~~~~~~~~~~
Template for the search page.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
#}
{%- extends "layout.html" %}
{% set title = _('Search') %}
{% set script_files = script_files + ['_static/searchtools.js'] %}
{% block footer %}
<script type="text/javascript">
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
</script>
{# this is used when loading the search index using $.ajax fails,
such as on Chrome for documents on localhost #}
<script type="text/javascript" id="searchindexloader"></script>
{{ super() }}
{% endblock %}
{% block body %}
<noscript>
<div id="fallback" class="admonition warning">
<p class="last">
{% trans %}Please activate JavaScript to enable the search
functionality.{% endtrans %}
</p>
</div>
</noscript>
{% if search_performed %}
<h2>{{ _('Search Results') }}</h2>
{% if not search_results %}
<p>{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}</p>
{% endif %}
{% endif %}
<div id="search-results">
{% if search_results %}
<ul>
{% for href, caption, context in search_results %}
<li>
<a href="{{ pathto(item.href) }}">{{ caption }}</a>
<p class="context">{{ context|e }}</p>
</li>
{% endfor %}
</ul>
{% endif %}
<script>
(function() {
var cx = '012685039201307511604:um7if1hinba';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:searchresults-only></gcse:searchresults-only>
</div>
{% endblock %}

View File

@ -16,7 +16,7 @@ KOKKOS_USE_TPLS ?= ""
#Options: c++11
KOKKOS_CXX_STANDARD ?= "c++11"
#Options: aggressive_vectorization,disable_profiling
KOKKOS_OPTIONS ?= "aggressive_vectorization"
KOKKOS_OPTIONS ?= ""
#Default settings specific options
#Options: force_uvm,use_ldg,rdc,enable_lambda

View File

@ -438,9 +438,17 @@ c use precomputed values
rho0_2 = rho0_meam(b)*Z2*G2
endif
Gam1 = (t11av*rho11+t21av*rho21+t31av*rho31)
Gam1 = Gam1/(rho01*rho01)
if (rho01 < 1.0d-14) then
Gam1 = 0.0d0
else
Gam1 = Gam1/(rho01*rho01)
endif
Gam2 = (t12av*rho12+t22av*rho22+t32av*rho32)
Gam2 = Gam2/(rho02*rho02)
if (rho02 < 1.0d-14) then
Gam2 = 0.0d0
else
Gam2 = Gam2/(rho02*rho02)
endif
call G_gam(Gam1,ibar_meam(a),gsmooth_factor,G1,errorflag)
call G_gam(Gam2,ibar_meam(b),gsmooth_factor,G2,errorflag)
if (mix_ref_t.eq.1) then

View File

@ -150,6 +150,11 @@ class lammps(object):
if cmd: cmd = cmd.encode()
self.lib.lammps_command(self.lmp,cmd)
if self.lib.lammps_has_error(self.lmp):
sb = create_string_buffer(100)
self.lib.lammps_get_last_error_message(self.lmp, sb, 100)
raise Exception(sb.value.decode().strip())
def extract_global(self,name,type):
if name: name = name.encode()
if type == 0:
@ -304,6 +309,9 @@ class OutputCapture(object):
def __exit__(self, type, value, tracebac):
os.dup2(self.stdout, self.stdout_fd)
os.close(self.stdout)
os.close(self.stdout_pipe_read)
os.close(self.stdout_pipe_write)
# check if we have more to read from the pipe
def more_data(self, pipe):
@ -345,8 +353,11 @@ class AtomList(object):
def __init__(self, lammps_wrapper_instance):
self.lmp = lammps_wrapper_instance
self.natoms = self.lmp.system.natoms
self.dimensions = self.lmp.system.dimensions
def __getitem__(self, index):
if self.dimensions == 2:
return Atom2D(self.lmp, index + 1)
return Atom(self.lmp, index + 1)
@ -377,6 +388,12 @@ class Atom(object):
self.lmp.eval("y[%d]" % self.index),
self.lmp.eval("z[%d]" % self.index))
@position.setter
def position(self, value):
self.lmp.set("atom", self.index, "x", value[0])
self.lmp.set("atom", self.index, "y", value[1])
self.lmp.set("atom", self.index, "z", value[2])
@property
def velocity(self):
return (self.lmp.eval("vx[%d]" % self.index),
@ -394,6 +411,31 @@ class Atom(object):
return self.lmp.eval("q[%d]" % self.index)
class Atom2D(Atom):
def __init__(self, lammps_wrapper_instance, index):
super(Atom2D, self).__init__(lammps_wrapper_instance, index)
@property
def position(self):
return (self.lmp.eval("x[%d]" % self.index),
self.lmp.eval("y[%d]" % self.index))
@position.setter
def position(self, value):
self.lmp.set("atom", self.index, "x", value[0])
self.lmp.set("atom", self.index, "y", value[1])
@property
def velocity(self):
return (self.lmp.eval("vx[%d]" % self.index),
self.lmp.eval("vy[%d]" % self.index))
@property
def force(self):
return (self.lmp.eval("fx[%d]" % self.index),
self.lmp.eval("fy[%d]" % self.index))
class PyLammps(object):
"""
More Python-like wrapper for LAMMPS (e.g., for iPython)
@ -603,6 +645,10 @@ class PyLammps(object):
with OutputCapture() as capture:
self.lmp.command(' '.join(cmd_args))
output = capture.output
if 'verbose' in kwargs and kwargs['verbose']:
print(output)
lines = output.splitlines()
if len(lines) > 1:
@ -657,3 +703,7 @@ class IPyLammps(PyLammps):
self.write_dump(*cmd_args)
from IPython.core.display import Image
return Image('snapshot.png')
def video(self, filename):
from IPython.display import HTML
return HTML("<video controls><source src=\"" + filename + "\"></video>")

View File

@ -37,8 +37,6 @@ class ComputeBodyLocal : public Compute {
int *which,*index;
int nmax;
double *vector;
double **array;
class AtomVecBody *avec;
class Body *bptr;

View File

@ -3878,14 +3878,16 @@ void PairReaxCKokkos<DeviceType>::ev_setup(int eflag, int vflag)
// reallocate per-atom arrays if necessary
if (eflag_atom && atom->nmax > maxeatom) {
memory->destroy_kokkos(k_eatom,eatom);
memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom");
v_eatom = k_eatom.view<DeviceType>();
maxeatom = atom->nmax;
memory->destroy_kokkos(k_eatom,eatom);
memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom");
v_eatom = k_eatom.view<DeviceType>();
}
if (vflag_atom && atom->nmax > maxvatom) {
memory->destroy_kokkos(k_vatom,vatom);
memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom");
v_vatom = k_vatom.view<DeviceType>();
maxvatom = atom->nmax;
memory->destroy_kokkos(k_vatom,vatom);
memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom");
v_vatom = k_vatom.view<DeviceType>();
}
// zero accumulators

View File

@ -38,7 +38,8 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg),
fp(NULL), qf(NULL), q1(NULL), q2(NULL)
{
if (narg < 5) error->all(FLERR,"Illegal fix qeq/comb command");
@ -58,8 +59,6 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
// optional args
fp = NULL;
int iarg = 5;
while (iarg < narg) {
if (strcmp(arg[iarg],"file") == 0) {

View File

@ -56,7 +56,8 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */
FixAtomSwap::FixAtomSwap(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
idregion(NULL), type_list(NULL), mu(NULL), qtype(NULL), sqrt_mass_ratio(NULL), random_equal(NULL), random_unequal(NULL)
{
if (narg < 10) error->all(FLERR,"Illegal fix atom/swap command");
@ -68,9 +69,7 @@ FixAtomSwap::FixAtomSwap(LAMMPS *lmp, int narg, char **arg) :
extvector = 0;
restart_global = 1;
time_depend = 1;
type_list = NULL;
qtype = NULL;
// required args
nevery = force->inumeric(FLERR,arg[3]);

View File

@ -36,7 +36,8 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
partner(NULL), finalpartner(NULL), distsq(NULL), broken(NULL), copy(NULL), random(NULL)
{
if (narg < 6) error->all(FLERR,"Illegal fix bond/break command");
@ -98,11 +99,8 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) :
// allocate arrays local to this fix
nmax = 0;
partner = finalpartner = NULL;
distsq = NULL;
maxbreak = 0;
broken = NULL;
// copy = special list for one atom
// size = ms^2 + ms is sufficient

View File

@ -39,7 +39,8 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
bondcount(NULL), partner(NULL), finalpartner(NULL), distsq(NULL), created(NULL), copy(NULL), random(NULL)
{
if (narg < 8) error->all(FLERR,"Illegal fix bond/create command");

View File

@ -52,7 +52,8 @@ static const char cite_fix_bond_swap[] =
/* ---------------------------------------------------------------------- */
FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
tflag(0), alist(NULL), id_temp(NULL)
{
if (lmp->citeme) lmp->citeme->add(cite_fix_bond_swap);

View File

@ -58,7 +58,10 @@ enum{ATOM,MOLECULE};
/* ---------------------------------------------------------------------- */
FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
idregion(NULL), full_flag(0), ngroups(0), groupstrings(NULL), ngrouptypes(0), grouptypestrings(NULL),
grouptypebits(NULL), grouptypes(NULL), local_gas_list(NULL), atom_coord(NULL), random_equal(NULL), random_unequal(NULL),
coords(NULL), imageflags(NULL), idshake(NULL)
{
if (narg < 11) error->all(FLERR,"Illegal fix gcmc command");

View File

@ -37,7 +37,8 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
xd(NULL), rotflag(0)
{
if (narg < 6) error->all(FLERR,"Illegal fix tfmc command");

View File

@ -41,8 +41,6 @@ class ComputeRigidLocal : public Compute {
class FixRigidSmall *fixrigid;
int nmax;
double *vector;
double **array;
int compute_rigid(int);
void reallocate(int);

View File

@ -47,7 +47,7 @@ static const char cite_flow_gauss[] =
"pages = {1907--1912}\n"
"}\n\n";
FixFlowGauss::FixFlowGauss(LAMMPS *lmp, int narg, char **arg) :
FixFlowGauss::FixFlowGauss(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (lmp->citeme) lmp->citeme->add(cite_flow_gauss);
@ -77,7 +77,7 @@ FixFlowGauss::FixFlowGauss(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Constraint flags must be 1 or 0");
}
//by default, do not compute work done
// by default, do not compute work done
workflag=0;
// process optional keyword
@ -86,7 +86,7 @@ FixFlowGauss::FixFlowGauss(LAMMPS *lmp, int narg, char **arg) :
if ( strcmp(arg[iarg],"energy") == 0 ) {
if ( iarg+2 > narg ) error->all(FLERR,"Illegal energy keyword");
if ( strcmp(arg[iarg+1],"yes") == 0 ) workflag = 1;
else if ( strcmp(arg[iarg+1],"no") == 1 )
else if ( strcmp(arg[iarg+1],"no") != 0 )
error->all(FLERR,"Illegal energy keyword");
iarg += 2;
} else error->all(FLERR,"Illegal fix flow/gauss command");
@ -136,7 +136,6 @@ void FixFlowGauss::setup(int vflag)
void FixFlowGauss::post_force(int vflag)
{
double **f = atom->f;
double **x = atom->x;
double **v = atom->v;
int *mask = atom->mask;

View File

@ -36,8 +36,6 @@ class ComputeSpecAtom : public Compute {
private:
int nvalues;
int nmax;
double *vector;
double **array;
double *buf;
double *vbuf;

View File

@ -1589,6 +1589,7 @@ void Atom::add_molecule(int narg, char **arg)
int Atom::find_molecule(char *id)
{
if(id == NULL) return -1;
int imol;
for (imol = 0; imol < nmolecule; imol++)
if (strcmp(id,molecules[imol]->id) == 0) return imol;
@ -1913,6 +1914,8 @@ void Atom::add_callback(int flag)
void Atom::delete_callback(const char *id, int flag)
{
if(id==NULL) return;
int ifix;
for (ifix = 0; ifix < modify->nfix; ifix++)
if (strcmp(id,modify->fix[ifix]->id) == 0) break;
@ -1968,6 +1971,8 @@ void Atom::update_callback(int ifix)
int Atom::find_custom(const char *name, int &flag)
{
if(name == NULL) return -1;
for (int i = 0; i < nivector; i++)
if (iname[i] && strcmp(iname[i],name) == 0) {
flag = 0;

View File

@ -33,8 +33,7 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */
ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
vector(NULL), array(NULL)
Compute(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal compute angle/local command");

View File

@ -37,8 +37,6 @@ class ComputeAngleLocal : public Compute {
int ncount;
int nmax;
double *vector;
double **array;
int compute_angles(int);
void reallocate(int);

View File

@ -34,7 +34,7 @@ enum{DIST,ENG,FORCE};
ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
bstyle(NULL), vector(NULL), array(NULL)
bstyle(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal compute bond/local command");

View File

@ -39,8 +39,6 @@ class ComputeBondLocal : public Compute {
int singleflag;
int nmax;
double *vector;
double **array;
int compute_bonds(int);
void reallocate(int);

View File

@ -57,9 +57,10 @@ ComputeChunkAtom *ComputeChunkAtom::cptr;
ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
id_fix(NULL), chunk(NULL), ichunk(NULL), exclude(NULL),
chunk_volume_vec(NULL), coord(NULL), chunkID(NULL), idregion(NULL), cfvid(NULL),
hash(NULL), varatom(NULL)
chunk_volume_vec(NULL), coord(NULL), ichunk(NULL), chunkID(NULL),
cfvid(NULL), idregion(NULL), region(NULL), cchunk(NULL), fchunk(NULL),
varatom(NULL), id_fix(NULL), fixstore(NULL), lockfix(NULL), chunk(NULL),
exclude(NULL), hash(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal compute chunk/atom command");

View File

@ -279,7 +279,7 @@ void ComputeCNAAtom::compute_peratom()
for (n = 0; n < ncommon; n++) bonds[n] = 0;
nbonds = 0;
for (jj = 0; jj < ncommon; jj++) {
for (jj = 0; jj < ncommon-1; jj++) {
j = common[jj];
xtmp = x[j][0];
ytmp = x[j][1];

View File

@ -34,8 +34,7 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */
ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
vector(NULL), array(NULL)
Compute(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal compute dihedral/local command");

View File

@ -37,8 +37,6 @@ class ComputeDihedralLocal : public Compute {
int ncount;
int nmax;
double *vector;
double **array;
int compute_dihedrals(int);
void reallocate(int);

View File

@ -30,7 +30,7 @@ using namespace LAMMPS_NS;
ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
id_fix(NULL), displace(NULL)
displace(NULL), id_fix(NULL)
{
if (narg != 3) error->all(FLERR,"Illegal compute displace/atom command");

View File

@ -35,8 +35,7 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */
ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
vector(NULL), array(NULL)
Compute(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal compute improper/local command");

View File

@ -37,8 +37,6 @@ class ComputeImproperLocal : public Compute {
int ncount;
int nmax;
double *vector;
double **array;
int compute_impropers(int);
void reallocate(int);

View File

@ -27,7 +27,8 @@ using namespace LAMMPS_NS;
ComputeOmegaChunk::ComputeOmegaChunk(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), angmom(NULL), angmomall(NULL)
idchunk(NULL),massproc(NULL),masstotal(NULL),com(NULL),comall(NULL),
inertia(NULL),inertiaall(NULL),angmom(NULL),angmomall(NULL),omega(NULL)
{
if (narg != 4) error->all(FLERR,"Illegal compute omega/chunk command");
@ -63,6 +64,9 @@ ComputeOmegaChunk::~ComputeOmegaChunk()
memory->destroy(comall);
memory->destroy(angmom);
memory->destroy(angmomall);
memory->destroy(inertia);
memory->destroy(inertiaall);
memory->destroy(omega);
}
/* ---------------------------------------------------------------------- */
@ -82,7 +86,7 @@ void ComputeOmegaChunk::init()
void ComputeOmegaChunk::compute_array()
{
int i,j,index;
int i,j,m,index;
double dx,dy,dz,massone;
double unwrap[3];
@ -192,13 +196,13 @@ void ComputeOmegaChunk::compute_array()
double ione[3][3],inverse[3][3];
for (i = 0; i < nchunk; i++) {
ione[0][0] = inertiaall[i][0];
ione[1][1] = inertiaall[i][1];
ione[2][2] = inertiaall[i][2];
ione[0][1] = inertiaall[i][3];
ione[1][2] = inertiaall[i][4];
ione[0][2] = inertiaall[i][5];
for (m = 0; m < nchunk; m++) {
ione[0][0] = inertiaall[m][0];
ione[1][1] = inertiaall[m][1];
ione[2][2] = inertiaall[m][2];
ione[0][1] = inertiaall[m][3];
ione[1][2] = inertiaall[m][4];
ione[0][2] = inertiaall[m][5];
ione[1][0] = ione[0][1];
ione[2][1] = ione[1][2];
ione[2][0] = ione[0][2];
@ -221,15 +225,15 @@ void ComputeOmegaChunk::compute_array()
ione[2][0]*ione[1][1]*ione[0][2];
if (determinant > 0.0)
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
for (i = 0; i < 3; i++)
for (j = 0; j < 3; j++)
inverse[i][j] /= determinant;
omega[i][0] = inverse[0][0]*angmom[i][0] + inverse[0][1]*angmom[i][1] +
inverse[0][2]*angmom[i][2];
omega[i][1] = inverse[1][0]*angmom[i][0] + inverse[1][1]*angmom[i][1] +
inverse[1][2]*angmom[i][2];
omega[i][2] = inverse[2][0]*angmom[i][0] + inverse[2][1]*angmom[i][1] +
omega[m][0] = inverse[0][0]*angmom[m][0] + inverse[0][1]*angmom[m][1] +
inverse[0][2]*angmom[m][2];
omega[m][1] = inverse[1][0]*angmom[m][0] + inverse[1][1]*angmom[m][1] +
inverse[1][2]*angmom[m][2];
omega[m][2] = inverse[2][0]*angmom[m][0] + inverse[2][1]*angmom[m][1] +
inverse[2][2]*angmom[i][2];
}
}

View File

@ -37,7 +37,7 @@ enum{TYPE,RADIUS};
ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
pstyle(NULL), pindex(NULL), vector(NULL), array(NULL)
pstyle(NULL), pindex(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal compute pair/local command");

View File

@ -41,8 +41,6 @@ class ComputePairLocal : public Compute {
int singleflag;
int nmax;
double *vector;
double **array;
class NeighList *list;

View File

@ -33,7 +33,7 @@ using namespace LAMMPS_NS;
ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
index(NULL), vector(NULL), array(NULL), pack_choice(NULL)
index(NULL), pack_choice(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal compute property/atom command");

View File

@ -36,8 +36,6 @@ class ComputePropertyAtom : public Compute {
int nvalues;
int nmax;
int *index;
double *vector;
double **array;
double *buf;
class AtomVecEllipsoid *avec_ellipsoid;
class AtomVecLine *avec_line;

View File

@ -35,7 +35,7 @@ enum{TYPE,RADIUS};
ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
vector(NULL), array(NULL), indices(NULL), pack_choice(NULL)
indices(NULL), pack_choice(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal compute property/local command");

View File

@ -37,8 +37,6 @@ class ComputePropertyLocal : public Compute {
int nvalues,kindflag,cutstyle;
int nmax;
double *vector;
double **array;
double *buf;
class NeighList *list;

View File

@ -158,7 +158,7 @@ void CreateBox::command(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"extra/special/per/atom") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command");
atom->maxspecial = force->inumeric(FLERR,arg[iarg+1]);
force->special_extra = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2;
} else error->all(FLERR,"Illegal create_box command");
}

View File

@ -13,6 +13,7 @@
#include <mpi.h>
#include <stdlib.h>
#include <string.h>
#include "error.h"
#include "universe.h"
#include "output.h"
@ -21,7 +22,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
Error::Error(LAMMPS *lmp) : Pointers(lmp) {}
Error::Error(LAMMPS *lmp) : Pointers(lmp), last_error_message(NULL) {}
/* ----------------------------------------------------------------------
called by all procs in universe
@ -47,8 +48,14 @@ void Error::universe_all(const char *file, int line, const char *str)
}
if (universe->ulogfile) fclose(universe->ulogfile);
#ifdef LAMMPS_EXCEPTIONS
char msg[100];
sprintf(msg, "ERROR: %s (%s:%d)\n", str, file, line);
throw LAMMPSException(msg);
#else
MPI_Finalize();
exit(1);
#endif
}
/* ----------------------------------------------------------------------
@ -61,7 +68,14 @@ void Error::universe_one(const char *file, int line, const char *str)
if (universe->uscreen)
fprintf(universe->uscreen,"ERROR on proc %d: %s (%s:%d)\n",
universe->me,str,file,line);
#ifdef LAMMPS_EXCEPTIONS
char msg[100];
sprintf(msg, "ERROR: %s (%s:%d)\n", str, file, line);
throw LAMMPSAbortException(msg, universe->uworld);
#else
MPI_Abort(universe->uworld,1);
#endif
}
/* ----------------------------------------------------------------------
@ -95,6 +109,16 @@ void Error::all(const char *file, int line, const char *str)
if (logfile) fprintf(logfile,"ERROR: %s (%s:%d)\n",str,file,line);
}
#ifdef LAMMPS_EXCEPTIONS
char msg[100];
sprintf(msg, "ERROR: %s (%s:%d)\n", str, file, line);
if (universe->nworlds > 1) {
throw LAMMPSAbortException(msg, universe->uworld);
}
throw LAMMPSException(msg);
#else
if (output) delete output;
if (screen && screen != stdout) fclose(screen);
if (logfile) fclose(logfile);
@ -102,6 +126,7 @@ void Error::all(const char *file, int line, const char *str)
if (universe->nworlds > 1) MPI_Abort(universe->uworld,1);
MPI_Finalize();
exit(1);
#endif
}
/* ----------------------------------------------------------------------
@ -121,7 +146,14 @@ void Error::one(const char *file, int line, const char *str)
if (universe->uscreen)
fprintf(universe->uscreen,"ERROR on proc %d: %s (%s:%d)\n",
universe->me,str,file,line);
#ifdef LAMMPS_EXCEPTIONS
char msg[100];
sprintf(msg, "ERROR on proc %d: %s (%s:%d)\n", me, str, file, line);
throw LAMMPSAbortException(msg, world);
#else
MPI_Abort(world,1);
#endif
}
/* ----------------------------------------------------------------------
@ -165,3 +197,31 @@ void Error::done(int status)
MPI_Finalize();
exit(status);
}
/* ----------------------------------------------------------------------
return the last error message reported by LAMMPS (only used if
compiled with -DLAMMPS_EXCEPTIONS)
------------------------------------------------------------------------- */
char * Error::get_last_error() const
{
return last_error_message;
}
/* ----------------------------------------------------------------------
set the last error message (only used if compiled with
-DLAMMPS_EXCEPTIONS)
------------------------------------------------------------------------- */
void Error::set_last_error(const char * msg)
{
delete [] last_error_message;
if(msg) {
last_error_message = new char[strlen(msg)+1];
strcpy(last_error_message, msg);
} else {
last_error_message = NULL;
}
}

View File

@ -15,10 +15,41 @@
#define LMP_ERROR_H
#include "pointers.h"
#include <string>
#include <exception>
namespace LAMMPS_NS {
class LAMMPSException : public std::exception
{
public:
std::string message;
LAMMPSException(std::string msg) : message(msg) {
}
~LAMMPSException() throw() {
}
virtual const char * what() const throw() {
return message.c_str();
}
};
class LAMMPSAbortException : public LAMMPSException {
public:
MPI_Comm universe;
LAMMPSAbortException(std::string msg, MPI_Comm universe) :
LAMMPSException(msg),
universe(universe)
{
}
};
class Error : protected Pointers {
char * last_error_message;
public:
Error(class LAMMPS *);
@ -31,6 +62,9 @@ class Error : protected Pointers {
void warning(const char *, int, const char *, int = 1);
void message(const char *, int, const char *, int = 1);
void done(int = 0); // 1 would be fully backwards compatible
char * get_last_error() const;
void set_last_error(const char * msg);
};
}

View File

@ -31,7 +31,8 @@ int Fix::instance_total = 0;
/* ---------------------------------------------------------------------- */
Fix::Fix(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
Fix::Fix(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp),
id(NULL), style(NULL), eatom(NULL), vatom(NULL)
{
instance_me = instance_total++;
@ -92,8 +93,6 @@ Fix::Fix(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
// which may occur outside of timestepping
maxeatom = maxvatom = 0;
eatom = NULL;
vatom = NULL;
vflag_atom = 0;
// CUDA and KOKKOS per-fix data masks

View File

@ -40,7 +40,8 @@ enum{DIAMETER,CHARGE};
/* ---------------------------------------------------------------------- */
FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg),
nadapt(0), id_fix_diam(NULL), id_fix_chg(NULL), adapt(NULL)
{
if (narg < 5) error->all(FLERR,"Illegal fix adapt command");
nevery = force->inumeric(FLERR,arg[3]);
@ -159,8 +160,6 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
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;
}
/* ---------------------------------------------------------------------- */

View File

@ -36,7 +36,9 @@ enum{NONE,CONSTANT,EQUAL,ATOM};
/* ---------------------------------------------------------------------- */
FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
xstr(NULL), ystr(NULL), zstr(NULL), estr(NULL), idregion(NULL), sforce(NULL)
{
if (narg < 6) error->all(FLERR,"Illegal fix addforce command");
@ -81,8 +83,6 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
nevery = 1;
iregion = -1;
idregion = NULL;
estr = NULL;
int iarg = 6;
while (iarg < narg) {

View File

@ -35,7 +35,8 @@ enum{X,V,F,COMPUTE,FIX,VARIABLE};
/* ---------------------------------------------------------------------- */
FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), array(NULL)
{
if (narg < 7) error->all(FLERR,"Illegal fix ave/atom command");
@ -192,7 +193,6 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
// perform initial allocation of atom-based array
// register with Atom class
array = NULL;
grow_arrays(atom->nmax);
atom->add_callback(0);

View File

@ -40,7 +40,14 @@ enum{ONE,RUNNING,WINDOW};
/* ---------------------------------------------------------------------- */
FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
nvalues(0), nrepeat(0),
which(NULL), argindex(NULL), value2index(NULL), ids(NULL),
fp(NULL), idchunk(NULL), varatom(NULL),
count_one(NULL), count_many(NULL), count_sum(NULL),
values_one(NULL), values_many(NULL), values_sum(NULL),
count_total(NULL), count_list(NULL),
values_total(NULL), values_list(NULL)
{
if (narg < 7) error->all(FLERR,"Illegal fix ave/chunk command");
@ -72,7 +79,6 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
argindex = new int[nargnew];
ids = new char*[nargnew];
value2index = new int[nargnew];
nvalues = 0;
int iarg = 0;
while (iarg < nargnew) {
@ -149,7 +155,6 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
normflag = ALL;
scaleflag = ATOM;
ave = ONE;
fp = NULL;
nwindow = 0;
biasflag = 0;
id_bias = NULL;
@ -433,7 +438,6 @@ FixAveChunk::~FixAveChunk()
if (fp && me == 0) fclose(fp);
memory->destroy(varatom);
memory->destroy(count_one);
memory->destroy(count_many);
memory->destroy(count_sum);
@ -457,6 +461,24 @@ FixAveChunk::~FixAveChunk()
}
delete [] idchunk;
which = NULL;
argindex = NULL;
ids = NULL;
value2index = NULL;
fp = NULL;
varatom = NULL;
count_one = NULL;
count_many = NULL;
count_sum = NULL;
count_total = NULL;
count_list = NULL;
values_one = NULL;
values_many = NULL;
values_sum = NULL;
values_total = NULL;
values_list = NULL;
idchunk = NULL;
cchunk = NULL;
}
/* ---------------------------------------------------------------------- */

View File

@ -44,7 +44,9 @@ enum{AUTO,UPPER,LOWER,AUTOUPPER,AUTOLOWER,FULL};
/* ---------------------------------------------------------------------- */
FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
Fix (lmp, narg, arg)
Fix (lmp, narg, arg),
nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), fp(NULL),
count(NULL), values(NULL), corr(NULL), save_count(NULL), save_corr(NULL)
{
if (narg < 7) error->all(FLERR,"Illegal fix ave/correlate command");

View File

@ -45,7 +45,9 @@ enum{IGNORE,END,EXTRA};
/* ---------------------------------------------------------------------- */
FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), fp(NULL), stats_list(NULL),
bin(NULL), bin_total(NULL), bin_all(NULL), bin_list(NULL), coord(NULL), vector(NULL)
{
if (narg < 10) error->all(FLERR,"Illegal fix ave/histo command");

View File

@ -42,7 +42,10 @@ enum{SCALAR,VECTOR};
/* ---------------------------------------------------------------------- */
FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
nvalues(0), which(NULL), argindex(NULL), value2index(NULL), offcol(NULL), varlen(NULL), ids(NULL),
fp(NULL), offlist(NULL), format(NULL), format_user(NULL), vector(NULL), vector_total(NULL), vector_list(NULL),
column(NULL), array(NULL), array_total(NULL), array_list(NULL)
{
if (narg < 7) error->all(FLERR,"Illegal fix ave/time command");

View File

@ -34,7 +34,8 @@ enum{NONE,CONSTANT,EQUAL};
/* ---------------------------------------------------------------------- */
FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
xstr(NULL), ystr(NULL), zstr(NULL), idregion(NULL)
{
if (narg < 6) error->all(FLERR,"Illegal fix aveforce command");

View File

@ -35,7 +35,7 @@ enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files
/* ---------------------------------------------------------------------- */
FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg), fp(NULL)
{
if (narg < 6) error->all(FLERR,"Illegal fix balance command");

View File

@ -41,7 +41,8 @@ enum{ISO,ANISO,TRICLINIC};
/* ---------------------------------------------------------------------- */
FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
id_temp(NULL), id_press(NULL), tflag(0), pflag(0)
{
if (narg < 5) error->all(FLERR,"Illegal fix box/relax command");

View File

@ -33,7 +33,8 @@ enum{COMPUTE,FIX,VARIABLE};
/* ---------------------------------------------------------------------- */
FixController::FixController(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
pvID(NULL), cvID(NULL)
{
if (narg != 11) error->all(FLERR,"Illegal fix controller command");
@ -50,8 +51,6 @@ FixController::FixController(LAMMPS *lmp, int narg, char **arg) :
ki = force->numeric(FLERR,arg[6]);
kd = force->numeric(FLERR,arg[7]);
pvID = cvID = NULL;
// process variable arg
int iarg = 8;

View File

@ -46,7 +46,8 @@ enum{NO_REMAP,X_REMAP,V_REMAP};
/* ---------------------------------------------------------------------- */
FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg),
rfix(NULL), irregular(NULL), set(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal fix deform command");
@ -355,7 +356,6 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
next_reneighbor = -1;
nrigid = 0;
rfix = NULL;
flip = 0;
if (force_reneighbor) irregular = new Irregular(lmp);
@ -368,9 +368,11 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
FixDeform::~FixDeform()
{
for (int i = 0; i < 6; i++) {
delete [] set[i].hstr;
delete [] set[i].hratestr;
if(set) {
for (int i = 0; i < 6; i++) {
delete [] set[i].hstr;
delete [] set[i].hratestr;
}
}
delete [] set;
delete [] rfix;

View File

@ -26,12 +26,12 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixEnforce2D::FixEnforce2D(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
flist(NULL)
{
if (narg != 3) error->all(FLERR,"Illegal fix enforce2d command");
nfixlist = 0;
flist = NULL;
}
/* ---------------------------------------------------------------------- */

View File

@ -29,7 +29,8 @@ enum{PF_CALLBACK,PF_ARRAY};
/* ---------------------------------------------------------------------- */
FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
fexternal(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal fix external command");
@ -56,7 +57,6 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) :
// perform initial allocation of atom-based array
// register with Atom class
fexternal = NULL;
grow_arrays(atom->nmax);
atom->add_callback(0);

View File

@ -37,7 +37,8 @@ enum{CONSTANT,EQUAL};
/* ---------------------------------------------------------------------- */
FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
mstr(NULL), vstr(NULL), pstr(NULL), tstr(NULL), xstr(NULL), ystr(NULL), zstr(NULL)
{
if (narg < 5) error->all(FLERR,"Illegal fix gravity command");

View File

@ -31,7 +31,8 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixGroup::FixGroup(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
FixGroup::FixGroup(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg),
idregion(NULL), idvar(NULL)
{
// dgroupbit = bitmask of dynamic group
// group ID is last part of fix ID
@ -46,9 +47,7 @@ FixGroup::FixGroup(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
// process optional args
regionflag = 0;
idregion = NULL;
varflag = 0;
idvar = NULL;
nevery = 1;
int iarg = 3;

View File

@ -38,7 +38,8 @@ enum{CONSTANT,EQUAL,ATOM};
/* ---------------------------------------------------------------------- */
FixHeat::FixHeat(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
FixHeat::FixHeat(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg),
idregion(NULL), hstr(NULL), vheat(NULL), vscale(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal fix heat command");
@ -63,8 +64,7 @@ FixHeat::FixHeat(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
// optional args
iregion = -1;
idregion = NULL;
int iarg = 5;
while (iarg < narg) {
if (strcmp(arg[iarg],"region") == 0) {
@ -82,8 +82,6 @@ FixHeat::FixHeat(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
scale = 1.0;
maxatom = 0;
vheat = NULL;
vscale = NULL;
}
/* ---------------------------------------------------------------------- */

View File

@ -40,7 +40,8 @@ enum{INSIDE,OUTSIDE};
/* ---------------------------------------------------------------------- */
FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
xstr(NULL), ystr(NULL), zstr(NULL), rstr(NULL), pstr(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal fix indent command");

View File

@ -51,7 +51,9 @@ enum{CONSTANT,EQUAL,ATOM};
/* ---------------------------------------------------------------------- */
FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
gjfflag(0), gfactor1(NULL), gfactor2(NULL), ratio(NULL), tstr(NULL),
flangevin(NULL), tforce(NULL), franprev(NULL), id_temp(NULL), random(NULL)
{
if (narg < 7) error->all(FLERR,"Illegal fix langevin command");
@ -61,7 +63,6 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
extscalar = 1;
nevery = 1;
tstr = NULL;
if (strstr(arg[3],"v_") == arg[3]) {
int n = strlen(&arg[3][2]) + 1;
tstr = new char[n];

View File

@ -24,12 +24,9 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixMinimize::FixMinimize(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
nvector(0), peratom(NULL), vectors(NULL)
{
nvector = 0;
peratom = NULL;
vectors = NULL;
// register callback to this fix from Atom class
// don't perform initial allocation here, must wait until add_vector()

View File

@ -47,7 +47,9 @@ enum{EQUAL,ATOM};
/* ---------------------------------------------------------------------- */
FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
xvarstr(NULL), yvarstr(NULL), zvarstr(NULL), vxvarstr(NULL), vyvarstr(NULL), vzvarstr(NULL),
xoriginal(NULL), toriginal(NULL), qoriginal(NULL), displace(NULL), velocity(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal fix move command");
@ -65,9 +67,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
// 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;
@ -255,9 +255,6 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
// 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);

View File

@ -50,7 +50,11 @@ 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)
FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg),
tstat_flag(0), pstat_flag(0),
rfix(NULL), id_dilate(NULL), irregular(NULL), id_temp(NULL), id_press(NULL),
tcomputeflag(0), pcomputeflag(0), eta(NULL), eta_dot(NULL), eta_dotdot(NULL),
eta_mass(NULL), etap(NULL), etap_dot(NULL), etap_dotdot(NULL), etap_mass(NULL), mpchain(0)
{
if (narg < 4) error->all(FLERR,"Illegal fix nvt/npt/nph command");

View File

@ -37,7 +37,8 @@ enum{ISO,ANISO};
/* ---------------------------------------------------------------------- */
FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
id_temp(NULL), id_press(NULL), tflag(0), pflag(0)
{
if (narg < 5) error->all(FLERR,"Illegal fix press/berendsen command");

View File

@ -28,7 +28,8 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
fp(NULL), string(NULL), copy(NULL), work(NULL)
{
if (narg < 5) error->all(FLERR,"Illegal fix print command");
nevery = force->inumeric(FLERR,arg[3]);

View File

@ -29,7 +29,8 @@ enum{MOLECULE,CHARGE,RMASS,INTEGER,DOUBLE};
/* ---------------------------------------------------------------------- */
FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
nvalue(0), style(NULL), index(NULL), astyle(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal fix property/atom command");

View File

@ -23,7 +23,8 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
count(NULL), extra(NULL)
{
nextra = force->inumeric(FLERR,arg[3]);
int nfix = force->inumeric(FLERR,arg[4]);
@ -31,8 +32,6 @@ FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) :
// perform initial allocation of atom-based array
// register with Atom class
count = NULL;
extra = NULL;
grow_arrays(atom->nmax);
atom->add_callback(0);

View File

@ -24,7 +24,8 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
store_torque(0), f_level(NULL), t_level(NULL)
{
// nlevels = # of rRESPA levels

View File

@ -44,7 +44,8 @@ enum{BOND,ANGLE,DIHEDRAL};
/* ---------------------------------------------------------------------- */
FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
rstyle(NULL), ids(NULL), kstart(NULL), kstop(NULL), target(NULL), cos_target(NULL), sin_target(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal fix restrain command");
@ -57,11 +58,7 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) :
// parse args
nrestrain = maxrestrain = 0;
rstyle = NULL;
ids = NULL;
kstart = kstop = NULL;
target = cos_target = sin_target = NULL;
int iarg = 3;
while (iarg < narg) {
if (nrestrain == maxrestrain) {

View File

@ -34,7 +34,8 @@ enum{NONE,CONSTANT,EQUAL,ATOM};
/* ---------------------------------------------------------------------- */
FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
xstr(NULL), ystr(NULL), zstr(NULL), idregion(NULL), sforce(NULL)
{
if (narg < 6) error->all(FLERR,"Illegal fix setforce command");

View File

@ -34,7 +34,8 @@ enum{NPARTNER,PERPARTNER};
/* ---------------------------------------------------------------------- */
FixShearHistory::FixShearHistory(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
npartner(NULL), partner(NULL), shearpartner(NULL), ipage(NULL), dpage(NULL)
{
if (narg != 4) error->all(FLERR,"Illegal fix SHEAR_HISTORY commmand");
@ -57,15 +58,10 @@ FixShearHistory::FixShearHistory(LAMMPS *lmp, int narg, char **arg) :
// perform initial allocation of atom-based arrays
// register with atom class
npartner = NULL;
partner = NULL;
shearpartner = NULL;
grow_arrays(atom->nmax);
atom->add_callback(0);
atom->add_callback(1);
ipage = NULL;
dpage = NULL;
pgsize = oneatom = 0;
// initialize npartner to 0 so neighbor list creation is OK the 1st time

View File

@ -37,7 +37,8 @@ enum{TETHER,COUPLE};
/* ---------------------------------------------------------------------- */
FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
group2(NULL)
{
if (narg < 9) error->all(FLERR,"Illegal fix spring command");
@ -51,8 +52,6 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
respa_level_support = 1;
ilevel_respa = 0;
group2 = NULL;
if (strcmp(arg[3],"tether") == 0) {
if (narg != 9) error->all(FLERR,"Illegal fix spring command");
styleflag = TETHER;

Some files were not shown because too many files have changed in this diff Show More