pair vashishta/table

This commit is contained in:
Steve Plimpton 2016-09-13 14:54:12 -06:00
commit ed52f9ea5e
22 changed files with 22677 additions and 161 deletions

View File

@ -129,30 +129,49 @@
</div>
<div class="section" id="pair-style-vashishta-omp-command">
<h1>pair_style vashishta/omp command</h1>
</div>
<div class="section" id="pair-style-vashishta-table-command">
<h1>pair_style vashishta/table command</h1>
</div>
<div class="section" id="pair-style-vashishta-table-omp-command">
<h1>pair_style vashishta/table/omp command</h1>
<div class="section" id="syntax">
<h2>Syntax</h2>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pair_style</span> <span class="n">vashishta</span>
</pre></div>
</div>
<pre class="literal-block">
pair_style style args
</pre>
<ul class="simple">
<li>style = <em>vashishta</em> or <em>vashishta/table</em> or <em>vashishta/omp</em> or <em>vashishta/table/omp</em></li>
<li>args = list of arguments for a particular style</li>
</ul>
<pre class="literal-block">
<em>vashishta</em> or <em>vashishta/omp</em> args = none
<em>vashishta/table</em> or <em>vashishta/table/omp</em> args = Ntable cutinner
Ntable = # of tabulation points
cutinner = tablulate from cutinner to cutoff
</pre>
</div>
<div class="section" id="examples">
<h2>Examples</h2>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pair_style</span> <span class="n">vashishta</span>
<span class="n">pair_coeff</span> <span class="o">*</span> <span class="o">*</span> <span class="n">SiC</span><span class="o">.</span><span class="n">vashishta</span> <span class="n">Si</span> <span class="n">C</span>
</pre></div>
</div>
<pre class="literal-block">
pair_style vashishta
pair_coeff * * SiC.vashishta Si C
</pre>
<pre class="literal-block">
pair_style vashishta/table 100000 0.2
pair_coeff * * SiC.vashishta Si C
</pre>
</div>
<div class="section" id="description">
<h2>Description</h2>
<p>The <em>vashishta</em> style computes the combined 2-body and 3-body
family of potentials developed in the group of Vashishta and
co-workers. By combining repulsive, screened Coulombic,
screened charge-dipole, and dispersion interactions with a
bond-angle energy based on the Stillinger-Weber potential,
this potential has been used to describe a variety of inorganic
compounds, including SiO2 <a class="reference internal" href="#vashishta1990"><span class="std std-ref">Vashishta1990</span></a>,
SiC <a class="reference internal" href="#vashishta2007"><span class="std std-ref">Vashishta2007</span></a>,
and InP <a class="reference internal" href="#branicio2009"><span class="std std-ref">Branicio2009</span></a>.</p>
<p>The <em>vashishta</em> and <em>vashishta/table</em> styles compute the combined
2-body and 3-body family of potentials developed in the group of Priya
Vashishta and collaborators. By combining repulsive, screened
Coulombic, screened charge-dipole, and dispersion interactions with a
bond-angle energy based on the Stillinger-Weber potential, this
potential has been used to describe a variety of inorganic compounds,
including SiO2 <a class="reference internal" href="#vashishta1990"><span class="std std-ref">Vashishta1990</span></a>, SiC
<a class="reference internal" href="#vashishta2007"><span class="std std-ref">Vashishta2007</span></a>, and InP <a class="reference internal" href="#branicio2009"><span class="std std-ref">Branicio2009</span></a>.</p>
<p>The potential for the energy U of a system of atoms is</p>
<img alt="_images/pair_vashishta.jpg" class="align-center" src="_images/pair_vashishta.jpg" />
<p>where we follow the notation used in <a class="reference internal" href="#branicio2009"><span class="std std-ref">Branicio2009</span></a>.
@ -163,10 +182,20 @@ tilted by a linear function so that the energy and force are
both zero at <em>rc</em>. The summation over three-body terms
is over all neighbors J and K within a cut-off distance = <em>r0</em>,
where the exponential screening function becomes zero.</p>
<p>Only a single pair_coeff command is used with the <em>vashishta</em> style which
specifies a Vashishta potential file with parameters for all
needed elements. These are mapped to LAMMPS atom types by specifying
N additional arguments after the filename in the pair_coeff command,
<p>The <em>vashishta</em> style computes these formulas analytically. The
<em>vashishta/table</em> style tabulates the analytic values for <em>Ntable</em>
points from cutinner to the cutoff of the potential. The points are
equally spaced in R^2 space from cutinner^2 to cutoff^2. For the
two-body term in the above equation, a linear interpolation for each
pairwise distance between adjacent points in the table. In practice
the tabulated version can run 3-5x faster than the analytic version
with with moderate to little loss of accuracy for Ntable values
between 10000 and 1000000. It is not recommended to use less than
5000 tabulation points.</p>
<p>Only a single pair_coeff command is used with either style which
specifies a Vashishta potential file with parameters for all needed
elements. These are mapped to LAMMPS atom types by specifying N
additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:</p>
<ul class="simple">
<li>filename</li>
@ -178,9 +207,9 @@ to specify the path for the potential file.</p>
Si and C. If your LAMMPS simulation has 4 atoms types and you want
the 1st 3 to be Si, and the 4th to be C, you would use the following
pair_coeff command:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pair_coeff</span> <span class="o">*</span> <span class="o">*</span> <span class="n">SiC</span><span class="o">.</span><span class="n">vashishta</span> <span class="n">Si</span> <span class="n">Si</span> <span class="n">Si</span> <span class="n">C</span>
</pre></div>
</div>
<pre class="literal-block">
pair_coeff * * SiC.vashishta Si Si Si C
</pre>
<p>The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three Si arguments map LAMMPS atom types 1,2,3 to the Si
element in the file. The final C argument maps LAMMPS atom type 4
@ -213,56 +242,49 @@ and three-body coefficients in the formulae above:</p>
<li>C</li>
<li>costheta0</li>
</ul>
<p>The non-annotated parameters are unitless.
The Vashishta potential file must contain entries for all the
elements listed in the pair_coeff command. It can also contain
entries for additional elements not being used in a particular
simulation; LAMMPS ignores those entries.
For a single-element simulation, only a single entry is required
(e.g. SiSiSi). For a two-element simulation, the file must contain 8
entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that
specify parameters for all permutations of the two elements
interacting in three-body configurations. Thus for 3 elements, 27
entries would be required, etc.</p>
<p>Depending on the particular version of the Vashishta potential,
the values of these parameters may be keyed to the identities of
zero, one, two, or three elements.
In order to make the input file format unambiguous, general,
and simple to code,
LAMMPS uses a slightly confusing method for specifying parameters.
All parameters are divided into two classes: two-body and three-body.
Two-body and three-body parameters are handled differently,
as described below.
The two-body parameters are H, eta, lambda1, D, lambda4, W, rc, gamma, and r0.
They appear in the above formulae with two subscripts.
The parameters Zi and Zj are also classified as two-body parameters,
even though they only have 1 subscript.
The three-body parameters are B, C, costheta0.
They appear in the above formulae with three subscripts.
Two-body and three-body parameters are handled differently,
as described below.</p>
<p>The first element in each entry is the center atom
in a three-body interaction, while the second and third elements
are two neighbor atoms. Three-body parameters for a central atom I
and two neighbors J and K are taken from the IJK entry.
Note that even though three-body parameters do not depend on the order of
J and K, LAMMPS stores three-body parameters for both IJK and IKJ.
The user must ensure that these values are equal.
Two-body parameters for an atom I interacting with atom J are taken from
the IJJ entry, where the 2nd and 3rd
elements are the same. Thus the two-body parameters
for Si interacting with C come from the SiCC entry. Note that even
though two-body parameters (except possibly gamma and r0 in U3)
do not depend on the order of the two elements,
LAMMPS will get the Si-C value from the SiCC entry
and the C-Si value from the CSiSi entry. The user must ensure
that these values are equal. Two-body parameters appearing
in entries where the 2nd and 3rd elements are different are
stored but never used. It is good practice to enter zero for
these values. Note that the three-body function U3 above
contains the two-body parameters gamma and r0. So U3 for a
central C atom bonded to an Si atom and a second C atom
will take three-body parameters from the CSiC entry, but
<p>The non-annotated parameters are unitless. The Vashishta potential
file must contain entries for all the elements listed in the
pair_coeff command. It can also contain entries for additional
elements not being used in a particular simulation; LAMMPS ignores
those entries. For a single-element simulation, only a single entry
is required (e.g. SiSiSi). For a two-element simulation, the file
must contain 8 entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC,
CCSi, CCC), that specify parameters for all permutations of the two
elements interacting in three-body configurations. Thus for 3
elements, 27 entries would be required, etc.</p>
<p>Depending on the particular version of the Vashishta potential, the
values of these parameters may be keyed to the identities of zero,
one, two, or three elements. In order to make the input file format
unambiguous, general, and simple to code, LAMMPS uses a slightly
confusing method for specifying parameters. All parameters are
divided into two classes: two-body and three-body. Two-body and
three-body parameters are handled differently, as described below.
The two-body parameters are H, eta, lambda1, D, lambda4, W, rc, gamma,
and r0. They appear in the above formulae with two subscripts. The
parameters Zi and Zj are also classified as two-body parameters, even
though they only have 1 subscript. The three-body parameters are B,
C, costheta0. They appear in the above formulae with three
subscripts. Two-body and three-body parameters are handled
differently, as described below.</p>
<p>The first element in each entry is the center atom in a three-body
interaction, while the second and third elements are two neighbor
atoms. Three-body parameters for a central atom I and two neighbors J
and K are taken from the IJK entry. Note that even though three-body
parameters do not depend on the order of J and K, LAMMPS stores
three-body parameters for both IJK and IKJ. The user must ensure that
these values are equal. Two-body parameters for an atom I interacting
with atom J are taken from the IJJ entry, where the 2nd and 3rd
elements are the same. Thus the two-body parameters for Si interacting
with C come from the SiCC entry. Note that even though two-body
parameters (except possibly gamma and r0 in U3) do not depend on the
order of the two elements, LAMMPS will get the Si-C value from the
SiCC entry and the C-Si value from the CSiSi entry. The user must
ensure that these values are equal. Two-body parameters appearing in
entries where the 2nd and 3rd elements are different are stored but
never used. It is good practice to enter zero for these values. Note
that the three-body function U3 above contains the two-body parameters
gamma and r0. So U3 for a central C atom bonded to an Si atom and a
second C atom will take three-body parameters from the CSiC entry, but
two-body parameters from the CCC and CSiSi entries.</p>
<hr class="docutils" />
<p>Styles with a <em>gpu</em>, <em>intel</em>, <em>kk</em>, <em>omp</em>, or <em>opt</em> suffix are
@ -297,15 +319,16 @@ script that reads a restart file.</p>
<hr class="docutils" />
<div class="section" id="restrictions">
<h2>Restrictions</h2>
<p>This pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package (which it is by default). 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>This pair style requires the <a class="reference internal" href="newton.html"><span class="doc">newton</span></a> setting to be &#8220;on&#8221;
<p>These pair style are part of the MANYBODY package. They is only
enabled if LAMMPS was built with that package (which it is by
default). 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>These pair styles requires the <a class="reference internal" href="newton.html"><span class="doc">newton</span></a> setting to be &#8220;on&#8221;
for pair interactions.</p>
<p>The Vashishta potential files provided with LAMMPS (see the
potentials directory) are parameterized for metal <a class="reference internal" href="units.html"><span class="doc">units</span></a>.
You can use the Vashishta potential with any LAMMPS units, but you would need
to create your own Vashishta potential file with coefficients listed in the
<p>The Vashishta potential files provided with LAMMPS (see the potentials
directory) are parameterized for metal <a class="reference internal" href="units.html"><span class="doc">units</span></a>. You can
use the Vashishta potential with any LAMMPS units, but you would need
to create your own potential file with coefficients listed in the
appropriate units if your simulation doesn&#8217;t use &#8220;metal&#8221; units.</p>
</div>
<div class="section" id="related-commands">
@ -313,9 +336,12 @@ appropriate units if your simulation doesn&#8217;t use &#8220;metal&#8221; units
<p><a class="reference internal" href="pair_coeff.html"><span class="doc">pair_coeff</span></a></p>
<p><strong>Default:</strong> none</p>
<hr class="docutils" />
<p id="vashishta1990"><strong>(Vashishta1990)</strong> P. Vashishta, R. K. Kalia, J. P. Rino, Phys. Rev. B 41, 12197 (1990).</p>
<p id="vashishta2007"><strong>(Vashishta2007)</strong> P. Vashishta, R. K. Kalia, A. Nakano, J. P. Rino. J. Appl. Phys. 101, 103515 (2007).</p>
<p id="branicio2009"><strong>(Branicio2009)</strong> Branicio, Rino, Gan and Tsuzuki, J. Phys Condensed Matter 21 (2009) 095002</p>
<p id="vashishta1990"><strong>(Vashishta1990)</strong> P. Vashishta, R. K. Kalia, J. P. Rino, Phys. Rev. B
41, 12197 (1990).</p>
<p id="vashishta2007"><strong>(Vashishta2007)</strong> P. Vashishta, R. K. Kalia, A. Nakano,
J. P. Rino. J. Appl. Phys. 101, 103515 (2007).</p>
<p id="branicio2009"><strong>(Branicio2009)</strong> Branicio, Rino, Gan and Tsuzuki, J. Phys Condensed
Matter 21 (2009) 095002</p>
</div>
</div>

View File

@ -8,27 +8,38 @@
pair_style vashishta command :h3
pair_style vashishta/omp command :h3
pair_style vashishta/table command :h3
pair_style vashishta/table/omp command :h3
[Syntax:]
pair_style vashishta :pre
pair_style style args :pre
style = {vashishta} or {vashishta/table} or {vashishta/omp} or {vashishta/table/omp}
args = list of arguments for a particular style :ul
{vashishta} or {vashishta/omp} args = none
{vashishta/table} or {vashishta/table/omp} args = Ntable cutinner
Ntable = # of tabulation points
cutinner = tablulate from cutinner to cutoff :pre
[Examples:]
pair_style vashishta
pair_coeff * * SiC.vashishta Si C :pre
pair_style vashishta/table 100000 0.2
pair_coeff * * SiC.vashishta Si C :pre
[Description:]
The {vashishta} style computes the combined 2-body and 3-body
family of potentials developed in the group of Vashishta and
co-workers. By combining repulsive, screened Coulombic,
screened charge-dipole, and dispersion interactions with a
bond-angle energy based on the Stillinger-Weber potential,
this potential has been used to describe a variety of inorganic
compounds, including SiO2 "Vashishta1990"_#Vashishta1990,
SiC "Vashishta2007"_#Vashishta2007,
and InP "Branicio2009"_#Branicio2009.
The {vashishta} and {vashishta/table} styles compute the combined
2-body and 3-body family of potentials developed in the group of Priya
Vashishta and collaborators. By combining repulsive, screened
Coulombic, screened charge-dipole, and dispersion interactions with a
bond-angle energy based on the Stillinger-Weber potential, this
potential has been used to describe a variety of inorganic compounds,
including SiO2 "Vashishta1990"_#Vashishta1990, SiC
"Vashishta2007"_#Vashishta2007, and InP "Branicio2009"_#Branicio2009.
The potential for the energy U of a system of atoms is
@ -43,10 +54,21 @@ both zero at {rc}. The summation over three-body terms
is over all neighbors J and K within a cut-off distance = {r0},
where the exponential screening function becomes zero.
Only a single pair_coeff command is used with the {vashishta} style which
specifies a Vashishta potential file with parameters for all
needed elements. These are mapped to LAMMPS atom types by specifying
N additional arguments after the filename in the pair_coeff command,
The {vashishta} style computes these formulas analytically. The
{vashishta/table} style tabulates the analytic values for {Ntable}
points from cutinner to the cutoff of the potential. The points are
equally spaced in R^2 space from cutinner^2 to cutoff^2. For the
two-body term in the above equation, a linear interpolation for each
pairwise distance between adjacent points in the table. In practice
the tabulated version can run 3-5x faster than the analytic version
with with moderate to little loss of accuracy for Ntable values
between 10000 and 1000000. It is not recommended to use less than
5000 tabulation points.
Only a single pair_coeff command is used with either style which
specifies a Vashishta potential file with parameters for all needed
elements. These are mapped to LAMMPS atom types by specifying N
additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
filename
@ -95,59 +117,52 @@ r0 (distance units)
C
costheta0 :ul
The non-annotated parameters are unitless.
The Vashishta potential file must contain entries for all the
elements listed in the pair_coeff command. It can also contain
entries for additional elements not being used in a particular
simulation; LAMMPS ignores those entries.
For a single-element simulation, only a single entry is required
(e.g. SiSiSi). For a two-element simulation, the file must contain 8
entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that
specify parameters for all permutations of the two elements
interacting in three-body configurations. Thus for 3 elements, 27
entries would be required, etc.
The non-annotated parameters are unitless. The Vashishta potential
file must contain entries for all the elements listed in the
pair_coeff command. It can also contain entries for additional
elements not being used in a particular simulation; LAMMPS ignores
those entries. For a single-element simulation, only a single entry
is required (e.g. SiSiSi). For a two-element simulation, the file
must contain 8 entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC,
CCSi, CCC), that specify parameters for all permutations of the two
elements interacting in three-body configurations. Thus for 3
elements, 27 entries would be required, etc.
Depending on the particular version of the Vashishta potential,
the values of these parameters may be keyed to the identities of
zero, one, two, or three elements.
In order to make the input file format unambiguous, general,
and simple to code,
LAMMPS uses a slightly confusing method for specifying parameters.
All parameters are divided into two classes: two-body and three-body.
Two-body and three-body parameters are handled differently,
as described below.
The two-body parameters are H, eta, lambda1, D, lambda4, W, rc, gamma, and r0.
They appear in the above formulae with two subscripts.
The parameters Zi and Zj are also classified as two-body parameters,
even though they only have 1 subscript.
The three-body parameters are B, C, costheta0.
They appear in the above formulae with three subscripts.
Two-body and three-body parameters are handled differently,
as described below.
Depending on the particular version of the Vashishta potential, the
values of these parameters may be keyed to the identities of zero,
one, two, or three elements. In order to make the input file format
unambiguous, general, and simple to code, LAMMPS uses a slightly
confusing method for specifying parameters. All parameters are
divided into two classes: two-body and three-body. Two-body and
three-body parameters are handled differently, as described below.
The two-body parameters are H, eta, lambda1, D, lambda4, W, rc, gamma,
and r0. They appear in the above formulae with two subscripts. The
parameters Zi and Zj are also classified as two-body parameters, even
though they only have 1 subscript. The three-body parameters are B,
C, costheta0. They appear in the above formulae with three
subscripts. Two-body and three-body parameters are handled
differently, as described below.
The first element in each entry is the center atom
in a three-body interaction, while the second and third elements
are two neighbor atoms. Three-body parameters for a central atom I
and two neighbors J and K are taken from the IJK entry.
Note that even though three-body parameters do not depend on the order of
J and K, LAMMPS stores three-body parameters for both IJK and IKJ.
The user must ensure that these values are equal.
Two-body parameters for an atom I interacting with atom J are taken from
the IJJ entry, where the 2nd and 3rd
elements are the same. Thus the two-body parameters
for Si interacting with C come from the SiCC entry. Note that even
though two-body parameters (except possibly gamma and r0 in U3)
do not depend on the order of the two elements,
LAMMPS will get the Si-C value from the SiCC entry
and the C-Si value from the CSiSi entry. The user must ensure
that these values are equal. Two-body parameters appearing
in entries where the 2nd and 3rd elements are different are
stored but never used. It is good practice to enter zero for
these values. Note that the three-body function U3 above
contains the two-body parameters gamma and r0. So U3 for a
central C atom bonded to an Si atom and a second C atom
will take three-body parameters from the CSiC entry, but
two-body parameters from the CCC and CSiSi entries.
The first element in each entry is the center atom in a three-body
interaction, while the second and third elements are two neighbor
atoms. Three-body parameters for a central atom I and two neighbors J
and K are taken from the IJK entry. Note that even though three-body
parameters do not depend on the order of J and K, LAMMPS stores
three-body parameters for both IJK and IKJ. The user must ensure that
these values are equal. Two-body parameters for an atom I interacting
with atom J are taken from the IJJ entry, where the 2nd and 3rd
elements are the same. Thus the two-body parameters for Si interacting
with C come from the SiCC entry. Note that even though two-body
parameters (except possibly gamma and r0 in U3) do not depend on the
order of the two elements, LAMMPS will get the Si-C value from the
SiCC entry and the C-Si value from the CSiSi entry. The user must
ensure that these values are equal. Two-body parameters appearing in
entries where the 2nd and 3rd elements are different are stored but
never used. It is good practice to enter zero for these values. Note
that the three-body function U3 above contains the two-body parameters
gamma and r0. So U3 for a central C atom bonded to an Si atom and a
second C atom will take three-body parameters from the CSiC entry, but
two-body parameters from the CCC and CSiSi entries.
:line
@ -196,17 +211,18 @@ This pair style can only be used via the {pair} keyword of the
[Restrictions:]
This pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package (which it is by default). See
the "Making LAMMPS"_Section_start.html#start_3 section for more info.
These pair style are part of the MANYBODY package. They is only
enabled if LAMMPS was built with that package (which it is by
default). See the "Making LAMMPS"_Section_start.html#start_3 section
for more info.
This pair style requires the "newton"_newton.html setting to be "on"
These pair styles requires the "newton"_newton.html setting to be "on"
for pair interactions.
The Vashishta potential files provided with LAMMPS (see the
potentials directory) are parameterized for metal "units"_units.html.
You can use the Vashishta potential with any LAMMPS units, but you would need
to create your own Vashishta potential file with coefficients listed in the
The Vashishta potential files provided with LAMMPS (see the potentials
directory) are parameterized for metal "units"_units.html. You can
use the Vashishta potential with any LAMMPS units, but you would need
to create your own potential file with coefficients listed in the
appropriate units if your simulation doesn't use "metal" units.
[Related commands:]
@ -218,11 +234,13 @@ appropriate units if your simulation doesn't use "metal" units.
:line
:link(Vashishta1990)
[(Vashishta1990)] P. Vashishta, R. K. Kalia, J. P. Rino, Phys. Rev. B 41, 12197 (1990).
[(Vashishta1990)] P. Vashishta, R. K. Kalia, J. P. Rino, Phys. Rev. B
41, 12197 (1990).
:link(Vashishta2007)
[(Vashishta2007)] P. Vashishta, R. K. Kalia, A. Nakano, J. P. Rino. J. Appl. Phys. 101, 103515 (2007).
[(Vashishta2007)] P. Vashishta, R. K. Kalia, A. Nakano,
J. P. Rino. J. Appl. Phys. 101, 103515 (2007).
:link(Branicio2009)
[(Branicio2009)] Branicio, Rino, Gan and Tsuzuki, J. Phys Condensed Matter 21 (2009) 095002
[(Branicio2009)] Branicio, Rino, Gan and Tsuzuki, J. Phys Condensed
Matter 21 (2009) 095002

0
examples/vashishta/InP.vashishta Executable file → Normal file
View File

0
examples/vashishta/SiO.1990.vashishta Executable file → Normal file
View File

View File

@ -0,0 +1,75 @@
# calculate the energy volume curve for InP zincblende
# define volume range and filename
variable ndelta equal 100
variable volatom_min equal 20.0
variable volatom_max equal 29.0
variable evsvolfile string evsvol.dat
# set up cell
units metal
boundary p p p
# setup loop variables for box volume
variable amin equal ${volatom_min}^(1/3)*2
variable delta equal (${volatom_max}-${volatom_min})/${ndelta}
variable scale equal (${delta}/v_volatom+1)^(1/3)
# set up 8 atom InP zincblende unit cell
lattice diamond ${amin}
region box prism &
0 1 &
0 1 &
0 1 &
0 0 0
create_box 2 box
create_atoms 1 box &
basis 5 2 &
basis 6 2 &
basis 7 2 &
basis 8 2
mass 1 114.76
mass 2 30.98
# choose potential
pair_style vashishta/table 100000 0.2
pair_coeff * * InP.vashishta In P
# setup neighbor style
neighbor 1.0 nsq
neigh_modify once no every 1 delay 0 check yes
# setup output
thermo_style custom step temp pe press vol
thermo_modify norm no
variable volatom equal vol/atoms
variable eatom equal pe/atoms
print "# Volume [A^3/atom] Energy [eV/atom]" file ${evsvolfile}
# loop over range of volumes
label loop
variable i loop ${ndelta}
change_box all x scale ${scale} y scale ${scale} z scale ${scale} remap
# calculate energy
# no energy minimization needed for zincblende
run 0
print "${volatom} ${eatom}" append ${evsvolfile}
next i
jump SELF loop

View File

@ -0,0 +1,30 @@
# test Vashishta potential for quartz
units metal
boundary p p p
variable ntable index 100000
atom_style atomic
read_data data.quartz
replicate 4 4 4
velocity all create 2000.0 277387 mom yes
displace_atoms all move 0.05 0.9 0.4 units box
pair_style vashishta/table ${ntable} 0.2
pair_coeff * * SiO.1990.vashishta Si O
neighbor 0.3 bin
neigh_modify delay 10
fix 1 all nve
thermo 10
timestep 0.001
#dump 1 all cfg 10 *.cfg mass type xs ys zs vx vy vz fx fy fz
#dump_modify 1 element Si O
run 100

View File

@ -0,0 +1,75 @@
# calculate the energy volume curve for InP zincblende
# define volume range and filename
variable ndelta equal 100
variable volatom_min equal 20.0
variable volatom_max equal 29.0
variable evsvolfile string evsvol.dat
# set up cell
units metal
boundary p p p
# setup loop variables for box volume
variable amin equal ${volatom_min}^(1/3)*2
variable delta equal (${volatom_max}-${volatom_min})/${ndelta}
variable scale equal (${delta}/v_volatom+1)^(1/3)
# set up 8 atom InP zincblende unit cell
lattice diamond ${amin}
region box prism &
0 1 &
0 1 &
0 1 &
0 0 0
create_box 2 box
create_atoms 1 box &
basis 5 2 &
basis 6 2 &
basis 7 2 &
basis 8 2
mass 1 114.76
mass 2 30.98
# choose potential
pair_style vashishta
pair_coeff * * InP.vashishta In P
# setup neighbor style
neighbor 1.0 nsq
neigh_modify once no every 1 delay 0 check yes
# setup output
thermo_style custom step temp pe press vol
thermo_modify norm no
variable volatom equal vol/atoms
variable eatom equal pe/atoms
print "# Volume [A^3/atom] Energy [eV/atom]" file ${evsvolfile}
# loop over range of volumes
label loop
variable i loop ${ndelta}
change_box all x scale ${scale} y scale ${scale} z scale ${scale} remap
# calculate energy
# no energy minimization needed for zincblende
run 0
print "${volatom} ${eatom}" append ${evsvolfile}
next i
jump SELF loop

View File

@ -0,0 +1,28 @@
# test Vashishta potential for quartz
units metal
boundary p p p
atom_style atomic
read_data data.quartz
replicate 4 4 4
velocity all create 2000.0 277387 mom yes
displace_atoms all move 0.05 0.9 0.4 units box
pair_style vashishta
pair_coeff * * SiO.1990.vashishta Si O
neighbor 0.3 bin
neigh_modify delay 10
fix 1 all nve
thermo 10
timestep 0.001
#dump 1 all cfg 10 *.cfg mass type xs ys zs vx vy vz fx fy fz
#dump_modify 1 element Si O
run 100

View File

@ -0,0 +1,75 @@
# calculate the energy volume curve for InP zincblende
# define volume range and filename
variable ndelta equal 100
variable volatom_min equal 20.0
variable volatom_max equal 29.0
variable evsvolfile string evsvol.dat
# set up cell
units metal
boundary p p p
# setup loop variables for box volume
variable amin equal ${volatom_min}^(1/3)*2
variable delta equal (${volatom_max}-${volatom_min})/${ndelta}
variable scale equal (${delta}/v_volatom+1)^(1/3)
# set up 8 atom InP zincblende unit cell
lattice diamond ${amin}
region box prism &
0 1 &
0 1 &
0 1 &
0 0 0
create_box 2 box
create_atoms 1 box &
basis 5 2 &
basis 6 2 &
basis 7 2 &
basis 8 2
mass 1 114.76
mass 2 30.98
# choose potential
pair_style vashishta/table 100000 0.2
pair_coeff * * InP.vashishta In P
# setup neighbor style
neighbor 1.0 nsq
neigh_modify once no every 1 delay 0 check yes
# setup output
thermo_style custom step temp pe press vol
thermo_modify norm no
variable volatom equal vol/atoms
variable eatom equal pe/atoms
print "# Volume [A^3/atom] Energy [eV/atom]" file ${evsvolfile}
# loop over range of volumes
label loop
variable i loop ${ndelta}
change_box all x scale ${scale} y scale ${scale} z scale ${scale} remap
# calculate energy
# no energy minimization needed for zincblende
run 0
print "${volatom} ${eatom}" append ${evsvolfile}
next i
jump SELF loop

View File

@ -0,0 +1,30 @@
# test Vashishta potential for quartz
units metal
boundary p p p
variable ntable index 100000
atom_style atomic
read_data data.quartz
replicate 4 4 4
velocity all create 2000.0 277387 mom yes
displace_atoms all move 0.05 0.9 0.4 units box
pair_style vashishta/table ${ntable} 0.2
pair_coeff * * SiO.1990.vashishta Si O
neighbor 0.3 bin
neigh_modify delay 10
fix 1 all nve
thermo 10
timestep 0.001
#dump 1 all cfg 10 *.cfg mass type xs ys zs vx vy vz fx fy fz
#dump_modify 1 element Si O
run 100

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,86 @@
LAMMPS (7 Sep 2016)
# test Vashishta potential for quartz
units metal
boundary p p p
atom_style atomic
read_data data.quartz
triclinic box = (0 0 0) to (4.9134 4.25513 5.4052) with tilt (-2.4567 0 0)
1 by 1 by 1 MPI processor grid
reading atoms ...
9 atoms
replicate 4 4 4
triclinic box = (0 0 0) to (19.6536 17.0205 21.6208) with tilt (-9.8268 0 0)
1 by 1 by 1 MPI processor grid
576 atoms
velocity all create 2000.0 277387 mom yes
displace_atoms all move 0.05 0.9 0.4 units box
pair_style vashishta
pair_coeff * * SiO.1990.vashishta Si O
Reading potential file SiO.1990.vashishta with DATE: 2015-10-14
neighbor 0.3 bin
neigh_modify delay 10
fix 1 all nve
thermo 10
timestep 0.001
#dump 1 all cfg 10 *.cfg mass type xs ys zs vx vy vz fx fy fz
#dump_modify 1 element Si O
run 100
Neighbor list info ...
1 neighbor list requests
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10.3
ghost atom cutoff = 10.3
binsize = 5.15 -> bins = 6 4 5
Memory usage per processor = 2.54081 Mbytes
Step Temp E_pair E_mol TotEng Press
0 2000 -5280.875 0 -5132.2259 -20502.321
10 895.65237 -5198.402 0 -5131.833 419.34676
20 932.93463 -5201.1569 0 -5131.8169 -21407.961
30 936.09591 -5201.3998 0 -5131.8248 -32531.168
40 930.05159 -5201.0073 0 -5131.8816 -46445.212
50 904.64676 -5199.062 0 -5131.8245 -31402.385
60 1005.5353 -5206.5725 0 -5131.8365 -29790.442
70 941.02343 -5201.7644 0 -5131.8232 -23046.796
80 1020.1044 -5207.6763 0 -5131.8574 -13488.675
90 912.75535 -5199.651 0 -5131.8108 2715.5897
100 998.97588 -5206.1008 0 -5131.8523 6024.3651
Loop time of 2.14363 on 1 procs for 100 steps with 576 atoms
Performance: 4.031 ns/day, 5.955 hours/ns, 46.650 timesteps/s
99.9% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 2.0632 | 2.0632 | 2.0632 | 0.0 | 96.25
Neigh | 0.074735 | 0.074735 | 0.074735 | 0.0 | 3.49
Comm | 0.0039496 | 0.0039496 | 0.0039496 | 0.0 | 0.18
Output | 0.00013208 | 0.00013208 | 0.00013208 | 0.0 | 0.01
Modify | 0.00093484 | 0.00093484 | 0.00093484 | 0.0 | 0.04
Other | | 0.0006742 | | | 0.03
Nlocal: 576 ave 576 max 576 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 4926 ave 4926 max 4926 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 210470 ave 210470 max 210470 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 210470
Ave neighs/atom = 365.399
Neighbor list builds = 10
Dangerous builds = 10
Total wall time: 0:00:02

View File

@ -0,0 +1,86 @@
LAMMPS (7 Sep 2016)
# test Vashishta potential for quartz
units metal
boundary p p p
atom_style atomic
read_data data.quartz
triclinic box = (0 0 0) to (4.9134 4.25513 5.4052) with tilt (-2.4567 0 0)
2 by 1 by 2 MPI processor grid
reading atoms ...
9 atoms
replicate 4 4 4
triclinic box = (0 0 0) to (19.6536 17.0205 21.6208) with tilt (-9.8268 0 0)
2 by 1 by 2 MPI processor grid
576 atoms
velocity all create 2000.0 277387 mom yes
displace_atoms all move 0.05 0.9 0.4 units box
pair_style vashishta
pair_coeff * * SiO.1990.vashishta Si O
Reading potential file SiO.1990.vashishta with DATE: 2015-10-14
neighbor 0.3 bin
neigh_modify delay 10
fix 1 all nve
thermo 10
timestep 0.001
#dump 1 all cfg 10 *.cfg mass type xs ys zs vx vy vz fx fy fz
#dump_modify 1 element Si O
run 100
Neighbor list info ...
1 neighbor list requests
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10.3
ghost atom cutoff = 10.3
binsize = 5.15 -> bins = 6 4 5
Memory usage per processor = 2.50221 Mbytes
Step Temp E_pair E_mol TotEng Press
0 2000 -5280.875 0 -5132.2259 -20502.321
10 895.65237 -5198.402 0 -5131.833 419.34676
20 932.93463 -5201.1569 0 -5131.8169 -21407.961
30 936.09591 -5201.3998 0 -5131.8248 -32531.168
40 930.05159 -5201.0073 0 -5131.8816 -46445.212
50 904.64676 -5199.062 0 -5131.8245 -31402.385
60 1005.5353 -5206.5725 0 -5131.8365 -29790.442
70 941.02343 -5201.7644 0 -5131.8232 -23046.796
80 1020.1044 -5207.6763 0 -5131.8574 -13488.675
90 912.75535 -5199.651 0 -5131.8108 2715.5897
100 998.97588 -5206.1008 0 -5131.8523 6024.3651
Loop time of 0.595482 on 4 procs for 100 steps with 576 atoms
Performance: 14.509 ns/day, 1.654 hours/ns, 167.931 timesteps/s
99.7% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.5197 | 0.52697 | 0.53712 | 0.9 | 88.49
Neigh | 0.017602 | 0.017907 | 0.018271 | 0.2 | 3.01
Comm | 0.039021 | 0.049564 | 0.057245 | 3.0 | 8.32
Output | 0.00021839 | 0.00024223 | 0.00028372 | 0.2 | 0.04
Modify | 0.00027037 | 0.00027883 | 0.00028706 | 0.0 | 0.05
Other | | 0.0005233 | | | 0.09
Nlocal: 144 ave 146 max 143 min
Histogram: 2 0 0 1 0 0 0 0 0 1
Nghost: 3031 ave 3032 max 3030 min
Histogram: 1 0 0 0 0 2 0 0 0 1
Neighs: 0 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 52617.5 ave 53258 max 52208 min
Histogram: 2 0 0 0 1 0 0 0 0 1
Total # of neighbors = 210470
Ave neighs/atom = 365.399
Neighbor list builds = 10
Dangerous builds = 10
Total wall time: 0:00:00

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,89 @@
LAMMPS (7 Sep 2016)
# test Vashishta potential for quartz
units metal
boundary p p p
variable ntable index 100000
atom_style atomic
read_data data.quartz
triclinic box = (0 0 0) to (4.9134 4.25513 5.4052) with tilt (-2.4567 0 0)
1 by 1 by 1 MPI processor grid
reading atoms ...
9 atoms
replicate 4 4 4
triclinic box = (0 0 0) to (19.6536 17.0205 21.6208) with tilt (-9.8268 0 0)
1 by 1 by 1 MPI processor grid
576 atoms
velocity all create 2000.0 277387 mom yes
displace_atoms all move 0.05 0.9 0.4 units box
pair_style vashishta/table ${ntable} 0.2
pair_style vashishta/table 100000 0.2
pair_coeff * * SiO.1990.vashishta Si O
Reading potential file SiO.1990.vashishta with DATE: 2015-10-14
neighbor 0.3 bin
neigh_modify delay 10
fix 1 all nve
thermo 10
timestep 0.001
#dump 1 all cfg 10 *.cfg mass type xs ys zs vx vy vz fx fy fz
#dump_modify 1 element Si O
run 100
Neighbor list info ...
1 neighbor list requests
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10.3
ghost atom cutoff = 10.3
binsize = 5.15 -> bins = 6 4 5
Memory usage per processor = 8.64433 Mbytes
Step Temp E_pair E_mol TotEng Press
0 2000 -5280.8748 0 -5132.2257 -20501.94
10 895.65274 -5198.4018 0 -5131.8328 419.5556
20 932.93469 -5201.1567 0 -5131.8167 -21407.92
30 936.0957 -5201.3996 0 -5131.8246 -32531.15
40 930.05185 -5201.0072 0 -5131.8815 -46445.195
50 904.6467 -5199.0618 0 -5131.8243 -31402.296
60 1005.5353 -5206.5723 0 -5131.8363 -29790.426
70 941.02343 -5201.7642 0 -5131.8231 -23046.844
80 1020.1046 -5207.6761 0 -5131.8572 -13488.691
90 912.75537 -5199.6508 0 -5131.8106 2715.7189
100 998.97595 -5206.1006 0 -5131.8521 6024.5628
Loop time of 0.558684 on 1 procs for 100 steps with 576 atoms
Performance: 15.465 ns/day, 1.552 hours/ns, 178.992 timesteps/s
99.9% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.47882 | 0.47882 | 0.47882 | 0.0 | 85.71
Neigh | 0.07425 | 0.07425 | 0.07425 | 0.0 | 13.29
Comm | 0.0038991 | 0.0038991 | 0.0038991 | 0.0 | 0.70
Output | 0.00013018 | 0.00013018 | 0.00013018 | 0.0 | 0.02
Modify | 0.00092959 | 0.00092959 | 0.00092959 | 0.0 | 0.17
Other | | 0.0006537 | | | 0.12
Nlocal: 576 ave 576 max 576 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 4926 ave 4926 max 4926 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 210470 ave 210470 max 210470 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 210470
Ave neighs/atom = 365.399
Neighbor list builds = 10
Dangerous builds = 10
Total wall time: 0:00:00

View File

@ -0,0 +1,89 @@
LAMMPS (7 Sep 2016)
# test Vashishta potential for quartz
units metal
boundary p p p
variable ntable index 100000
atom_style atomic
read_data data.quartz
triclinic box = (0 0 0) to (4.9134 4.25513 5.4052) with tilt (-2.4567 0 0)
2 by 1 by 2 MPI processor grid
reading atoms ...
9 atoms
replicate 4 4 4
triclinic box = (0 0 0) to (19.6536 17.0205 21.6208) with tilt (-9.8268 0 0)
2 by 1 by 2 MPI processor grid
576 atoms
velocity all create 2000.0 277387 mom yes
displace_atoms all move 0.05 0.9 0.4 units box
pair_style vashishta/table ${ntable} 0.2
pair_style vashishta/table 100000 0.2
pair_coeff * * SiO.1990.vashishta Si O
Reading potential file SiO.1990.vashishta with DATE: 2015-10-14
neighbor 0.3 bin
neigh_modify delay 10
fix 1 all nve
thermo 10
timestep 0.001
#dump 1 all cfg 10 *.cfg mass type xs ys zs vx vy vz fx fy fz
#dump_modify 1 element Si O
run 100
Neighbor list info ...
1 neighbor list requests
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10.3
ghost atom cutoff = 10.3
binsize = 5.15 -> bins = 6 4 5
Memory usage per processor = 8.60573 Mbytes
Step Temp E_pair E_mol TotEng Press
0 2000 -5280.8748 0 -5132.2257 -20501.94
10 895.65274 -5198.4018 0 -5131.8328 419.5556
20 932.93469 -5201.1567 0 -5131.8167 -21407.92
30 936.0957 -5201.3996 0 -5131.8246 -32531.15
40 930.05185 -5201.0072 0 -5131.8815 -46445.195
50 904.6467 -5199.0618 0 -5131.8243 -31402.296
60 1005.5353 -5206.5723 0 -5131.8363 -29790.426
70 941.02343 -5201.7642 0 -5131.8231 -23046.844
80 1020.1046 -5207.6761 0 -5131.8572 -13488.691
90 912.75537 -5199.6508 0 -5131.8106 2715.7189
100 998.97595 -5206.1006 0 -5131.8521 6024.5628
Loop time of 0.168748 on 4 procs for 100 steps with 576 atoms
Performance: 51.201 ns/day, 0.469 hours/ns, 592.599 timesteps/s
99.7% CPU use with 4 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.12804 | 0.13513 | 0.1384 | 1.1 | 80.08
Neigh | 0.01754 | 0.017732 | 0.017853 | 0.1 | 10.51
Comm | 0.011786 | 0.014872 | 0.021839 | 3.3 | 8.81
Output | 0.00026298 | 0.00027776 | 0.00031996 | 0.1 | 0.16
Modify | 0.00025988 | 0.00027919 | 0.00029302 | 0.1 | 0.17
Other | | 0.0004623 | | | 0.27
Nlocal: 144 ave 146 max 143 min
Histogram: 2 0 0 1 0 0 0 0 0 1
Nghost: 3031 ave 3032 max 3030 min
Histogram: 1 0 0 0 0 2 0 0 0 1
Neighs: 0 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 52617.5 ave 53258 max 52208 min
Histogram: 2 0 0 0 1 0 0 0 0 1
Total # of neighbors = 210470
Ave neighs/atom = 365.399
Neighbor list builds = 10
Dangerous builds = 10
Total wall time: 0:00:00

View File

@ -0,0 +1,313 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Anders Hafreager (UiO), andershaf@gmail.com
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_vashishta_table.h"
#include "atom.h"
#include "neighbor.h"
#include "neigh_request.h"
#include "force.h"
#include "comm.h"
#include "memory.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PairVashishtaTable::PairVashishtaTable(LAMMPS *lmp) : PairVashishta(lmp)
{
neigh3BodyMax = 0;
neigh3BodyCount = NULL;
neigh3Body = NULL;
forceTable = NULL;
potentialTable = NULL;
}
/* ----------------------------------------------------------------------
check if allocated, since class can be destructed when incomplete
------------------------------------------------------------------------- */
PairVashishtaTable::~PairVashishtaTable()
{
memory->destroy(forceTable);
memory->destroy(potentialTable);
memory->destroy(neigh3BodyCount);
memory->destroy(neigh3Body);
}
/* ---------------------------------------------------------------------- */
void PairVashishtaTable::compute(int eflag, int vflag)
{
int i,j,k,ii,jj,kk,inum,jnum,jnumm1;
int itype,jtype,ktype,ijparam,ikparam,ijkparam;
tagint itag,jtag;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,rsq1,rsq2;
double delr1[3],delr2[3],fj[3],fk[3];
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0;
double **x = atom->x;
double **f = atom->f;
tagint *tag = atom->tag;
int *type = atom->type;
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
inum = list->inum;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
// reallocate 3-body neighbor list if necessary
// NOTE: using 1000 is inefficient
// could make this a LAMMPS paged neighbor list
if (nlocal > neigh3BodyMax) {
neigh3BodyMax = atom->nmax;
memory->destroy(neigh3BodyCount);
memory->destroy(neigh3Body);
memory->create(neigh3BodyCount,neigh3BodyMax,
"pair:vashishta:neigh3BodyCount");
memory->create(neigh3Body,neigh3BodyMax,1000,
"pair:vashishta:neigh3Body");
}
// loop over full neighbor list of my atoms
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
itag = tag[i];
itype = map[type[i]];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
// reset the 3-body neighbor list
neigh3BodyCount[i] = 0;
// two-body interactions, skip half of them
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
jtag = tag[j];
jtype = map[type[j]];
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
ijparam = elem2param[itype][jtype][jtype];
if (rsq <= params[ijparam].cutsq2) {
neigh3Body[i][neigh3BodyCount[i]] = j;
neigh3BodyCount[i]++;
}
if (rsq > params[ijparam].cutsq) continue;
if (itag > jtag) {
if ((itag+jtag) % 2 == 0) continue;
} else if (itag < jtag) {
if ((itag+jtag) % 2 == 1) continue;
} else {
if (x[j][2] < ztmp) continue;
if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
}
twobody_table(params[ijparam],rsq,fpair,eflag,evdwl);
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
}
jlist = neigh3Body[i];
jnum = neigh3BodyCount[i];
jnumm1 = jnum - 1;
for (jj = 0; jj < jnumm1; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
jtype = map[type[j]];
ijparam = elem2param[itype][jtype][jtype];
delr1[0] = x[j][0] - xtmp;
delr1[1] = x[j][1] - ytmp;
delr1[2] = x[j][2] - ztmp;
rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
if (rsq1 >= params[ijparam].cutsq2) continue;
for (kk = jj+1; kk < jnum; kk++) {
k = jlist[kk];
k &= NEIGHMASK;
ktype = map[type[k]];
ikparam = elem2param[itype][ktype][ktype];
ijkparam = elem2param[itype][jtype][ktype];
delr2[0] = x[k][0] - xtmp;
delr2[1] = x[k][1] - ytmp;
delr2[2] = x[k][2] - ztmp;
rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
if (rsq2 >= params[ikparam].cutsq2) continue;
threebody(&params[ijparam],&params[ikparam],&params[ijkparam],
rsq1,rsq2,delr1,delr2,fj,fk,eflag,evdwl);
f[i][0] -= fj[0] + fk[0];
f[i][1] -= fj[1] + fk[1];
f[i][2] -= fj[2] + fk[2];
f[j][0] += fj[0];
f[j][1] += fj[1];
f[j][2] += fj[2];
f[k][0] += fk[0];
f[k][1] += fk[1];
f[k][2] += fk[2];
if (evflag) ev_tally3(i,j,k,evdwl,0.0,fj,fk,delr1,delr2);
}
}
}
if (vflag_fdotr) virial_fdotr_compute();
}
/* ---------------------------------------------------------------------- */
void PairVashishtaTable::twobody_table(const Param &param, double rsq,
double &fforce, int eflag, double &eng)
{
// use analytic form if rsq is inside inner cutoff
if (rsq < tabinnersq) {
Param *pparam = const_cast<Param *> (&param);
PairVashishta::twobody(pparam,rsq,fforce,eflag,eng);
return;
}
// double -> int will only keep the 0.xxxx part
const int tableIndex = (rsq - tabinnersq)*oneOverDeltaR2;
const double fraction = (rsq - tabinnersq)*oneOverDeltaR2 - tableIndex;
// force/energy are linearly interpolated between two adjacent values
double force0 = forceTable[param.ielement][param.jelement][tableIndex];
double force1 = forceTable[param.ielement][param.jelement][tableIndex+1];
fforce = (1.0 - fraction)*force0 + fraction*force1;
if (evflag) {
double energy0 = potentialTable[param.ielement][param.jelement][tableIndex];
double energy1 = potentialTable[param.ielement][param.jelement]
[tableIndex+1];
eng = (1.0 - fraction)*energy0 + fraction*energy1;
}
}
/* ----------------------------------------------------------------------
global settings
------------------------------------------------------------------------- */
void PairVashishtaTable::settings(int narg, char **arg)
{
if (narg != 2) error->all(FLERR,"Illegal pair_style command");
ntable = force->inumeric(FLERR,arg[0]);
tabinner = force->numeric(FLERR,arg[1]);
if (tabinner <= 0.0)
error->all(FLERR,"Illegal inner cutoff for tabulation");
}
/* ---------------------------------------------------------------------- */
void PairVashishtaTable::setup_params()
{
PairVashishta::setup_params();
create_tables();
}
/* ---------------------------------------------------------------------- */
void PairVashishtaTable::create_tables()
{
memory->destroy(forceTable);
memory->destroy(potentialTable);
forceTable = NULL;
potentialTable = NULL;
tabinnersq = tabinner*tabinner;
deltaR2 = (cutmax*cutmax - tabinnersq) / (ntable-1);
oneOverDeltaR2 = 1.0/deltaR2;
memory->create(forceTable,nelements,nelements,ntable+1,
"pair:vashishta:forceTable");
memory->create(potentialTable,nelements,nelements,ntable+1,
"pair:vashishta:potentialTable");
// tabulalate energy/force via analytic twobody() in parent
int i,j,idx;
double rsq,fpair,eng;
for (i = 0; i < nelements; i++) {
for (j = 0; j < nelements; j++) {
int ijparam = elem2param[i][j][j];
for (idx = 0; idx <= ntable; idx++) {
rsq = tabinnersq + idx*deltaR2;
PairVashishta::twobody(&params[ijparam],rsq,fpair,1,eng);
forceTable[i][j][idx] = fpair;
potentialTable[i][j][idx] = eng;
}
}
}
}
/* ----------------------------------------------------------------------
memory usage of tabulation arrays
------------------------------------------------------------------------- */
double PairVashishtaTable::memory_usage()
{
double bytes = 2*nelements*nelements*sizeof(double)*ntable;
return bytes;
}

View File

@ -0,0 +1,105 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(vashishta/table,PairVashishtaTable)
#else
#ifndef LMP_PAIR_VASHISHITA_TABLE_H
#define LMP_PAIR_VASHISHITA_TABLE_H
#include "pair_vashishta.h"
namespace LAMMPS_NS {
class PairVashishtaTable : public PairVashishta {
public:
PairVashishtaTable(class LAMMPS *);
~PairVashishtaTable();
void compute(int, int);
void settings(int, char **);
double memory_usage();
protected:
int ntable;
double deltaR2;
double oneOverDeltaR2;
double ***forceTable; // table of forces per element pair
double ***potentialTable; // table of potential energies
int neigh3BodyMax; // max size of short neighborlist
int *neigh3BodyCount; // # of neighbors in short range
// 3 particle forces neighbor list
int **neigh3Body; // neighlist for short range 3 particle forces
void twobody_table(const Param &, double, double &, int, double &);
void setup_params();
void create_tables();
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Incorrect args for pair coefficients
Self-explanatory. Check the input script or data file.
E: Pair style Vashishta requires atom IDs
This is a requirement to use the Vashishta potential.
E: Pair style Vashishta requires newton pair on
See the newton command. This is a restriction to use the Vashishta
potential.
E: All pair coeffs are not set
All pair coefficients must be set in the data file or by the
pair_coeff command before running a simulation.
E: Cannot open Vashishta potential file %s
The specified Vashishta potential file cannot be opened. Check that the path
and name are correct.
E: Incorrect format in Vashishta potential file
Incorrect number of words per line in the potential file.
E: Illegal Vashishta parameter
One or more of the coefficients defined in the potential file is
invalid.
E: Potential file has duplicate entry
The potential file has more than one entry for the same element.
E: Potential file is missing an entry
The potential file does not have a needed entry.
*/

View File

@ -0,0 +1,239 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
This software is distributed under the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include <math.h>
#include "pair_vashishta_table_omp.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "memory.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
PairVashishtaTableOMP::PairVashishtaTableOMP(LAMMPS *lmp) :
PairVashishtaTable(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}
/* ---------------------------------------------------------------------- */
void PairVashishtaTableOMP::compute(int eflag, int vflag)
{
if (eflag || vflag) {
ev_setup(eflag,vflag);
} else evflag = vflag_fdotr = 0;
// reallocate 3-body neighbor list if necessary
// NOTE: using 1000 is inefficient
// could make this a LAMMPS paged neighbor list
if (atom->nlocal > neigh3BodyMax) {
neigh3BodyMax = atom->nmax;
memory->destroy(neigh3BodyCount);
memory->destroy(neigh3Body);
memory->create(neigh3BodyCount,neigh3BodyMax,
"pair:vashishta:neigh3BodyCount");
memory->create(neigh3Body,neigh3BodyMax,1000,
"pair:vashishta:neigh3Body");
}
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = list->inum;
#if defined(_OPENMP)
#pragma omp parallel default(none) shared(eflag,vflag)
#endif
{
int ifrom, ito, tid;
loop_setup_thr(ifrom, ito, tid, inum, nthreads);
ThrData *thr = fix->get_thr(tid);
thr->timer(Timer::START);
ev_setup_thr(eflag, vflag, nall, eatom, vatom, thr);
if (evflag) {
if (eflag) {
eval<1,1>(ifrom, ito, thr);
} else {
eval<1,0>(ifrom, ito, thr);
}
} else eval<0,0>(ifrom, ito, thr);
thr->timer(Timer::PAIR);
reduce_thr(this, eflag, vflag, thr);
} // end of omp parallel region
}
template <int EVFLAG, int EFLAG>
void PairVashishtaTableOMP::eval(int iifrom, int iito, ThrData * const thr)
{
int i,j,k,ii,jj,kk,jnum,jnumm1;
tagint itag,jtag;
int itype,jtype,ktype,ijparam,ikparam,ijkparam;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,rsq1,rsq2;
double delr1[3],delr2[3],fj[3],fk[3];
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = 0.0;
const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const tagint * _noalias const tag = atom->tag;
const int * _noalias const type = atom->type;
const int nlocal = atom->nlocal;
ilist = list->ilist;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
double fxtmp,fytmp,fztmp;
// loop over full neighbor list of my atoms
for (ii = iifrom; ii < iito; ++ii) {
i = ilist[ii];
itag = tag[i];
itype = map[type[i]];
xtmp = x[i].x;
ytmp = x[i].y;
ztmp = x[i].z;
fxtmp = fytmp = fztmp = 0.0;
// reset the 3-body neighbor list
neigh3BodyCount[i] = 0;
// two-body interactions, skip half of them
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
jtag = tag[j];
jtype = map[type[j]];
delx = xtmp - x[j].x;
dely = ytmp - x[j].y;
delz = ztmp - x[j].z;
rsq = delx*delx + dely*dely + delz*delz;
ijparam = elem2param[itype][jtype][jtype];
if (rsq <= params[ijparam].cutsq2) {
neigh3Body[i][neigh3BodyCount[i]] = j;
neigh3BodyCount[i]++;
}
if (rsq >= params[ijparam].cutsq) continue;
if (itag > jtag) {
if ((itag+jtag) % 2 == 0) continue;
} else if (itag < jtag) {
if ((itag+jtag) % 2 == 1) continue;
} else {
if (x[j].z < ztmp) continue;
if (x[j].z == ztmp && x[j].y < ytmp) continue;
if (x[j].z == ztmp && x[j].y == ytmp && x[j].x < xtmp) continue;
}
twobody_table(params[ijparam],rsq,fpair,EFLAG,evdwl);
fxtmp += delx*fpair;
fytmp += dely*fpair;
fztmp += delz*fpair;
f[j].x -= delx*fpair;
f[j].y -= dely*fpair;
f[j].z -= delz*fpair;
if (EVFLAG) ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,
evdwl,0.0,fpair,delx,dely,delz,thr);
}
jlist = neigh3Body[i];
jnum = neigh3BodyCount[i];
jnumm1 = jnum - 1;
for (jj = 0; jj < jnumm1; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
jtype = map[type[j]];
ijparam = elem2param[itype][jtype][jtype];
delr1[0] = x[j].x - xtmp;
delr1[1] = x[j].y - ytmp;
delr1[2] = x[j].z - ztmp;
rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
if (rsq1 >= params[ijparam].cutsq2) continue;
double fjxtmp,fjytmp,fjztmp;
fjxtmp = fjytmp = fjztmp = 0.0;
for (kk = jj+1; kk < jnum; kk++) {
k = jlist[kk];
k &= NEIGHMASK;
ktype = map[type[k]];
ikparam = elem2param[itype][ktype][ktype];
ijkparam = elem2param[itype][jtype][ktype];
delr2[0] = x[k].x - xtmp;
delr2[1] = x[k].y - ytmp;
delr2[2] = x[k].z - ztmp;
rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
if (rsq2 >= params[ikparam].cutsq2) continue;
threebody(&params[ijparam],&params[ikparam],&params[ijkparam],
rsq1,rsq2,delr1,delr2,fj,fk,EFLAG,evdwl);
fxtmp -= fj[0] + fk[0];
fytmp -= fj[1] + fk[1];
fztmp -= fj[2] + fk[2];
fjxtmp += fj[0];
fjytmp += fj[1];
fjztmp += fj[2];
f[k].x += fk[0];
f[k].y += fk[1];
f[k].z += fk[2];
if (EVFLAG) ev_tally3_thr(this,i,j,k,evdwl,0.0,fj,fk,delr1,delr2,thr);
}
f[j].x += fjxtmp;
f[j].y += fjytmp;
f[j].z += fjztmp;
}
f[i].x += fxtmp;
f[i].y += fytmp;
f[i].z += fztmp;
}
}
/* ---------------------------------------------------------------------- */
double PairVashishtaTableOMP::memory_usage()
{
double bytes = memory_usage_thr();
bytes += PairVashishtaTable::memory_usage();
return bytes;
}

View File

@ -0,0 +1,48 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(vashishta/table/omp,PairVashishtaTableOMP)
#else
#ifndef LMP_PAIR_VASHISHTA_TABLE_OMP_H
#define LMP_PAIR_VASHISHTA_TABLE_OMP_H
#include "pair_vashishta_table.h"
#include "thr_omp.h"
namespace LAMMPS_NS {
class PairVashishtaTableOMP : public PairVashishtaTable, public ThrOMP {
public:
PairVashishtaTableOMP(class LAMMPS *);
virtual void compute(int, int);
virtual double memory_usage();
private:
template <int EVFLAG, int EFLAG>
void eval(int ifrom, int ito, ThrData * const thr);
};
}
#endif
#endif