Merge remote-tracking branch 'lammps-ro/master' into lammps-icms
This commit is contained in:
103
doc/body.html
103
doc/body.html
@ -140,14 +140,29 @@ particle types.</p>
|
||||
command. It takes a body style as an argument. The current body
|
||||
styles supported by LAMMPS are as follows. The name in the first
|
||||
column is used as the <em>bstyle</em> argument for the <a class="reference internal" href="atom_style.html"><em>atom_style body</em></a> command.</p>
|
||||
<p><em>rounded/polygon</em> |
|
||||
+———————————–+—————————————————+
|
||||
| 2d convex polygon with N vertices | |
|
||||
+———————————–+—————————————————+</p>
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="35%" />
|
||||
<col width="65%" />
|
||||
</colgroup>
|
||||
<tbody valign="top">
|
||||
<tr class="row-odd"><td><em>nparticle</em></td>
|
||||
<td>rigid body with N sub-particles</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><em>rounded/polygon</em></td>
|
||||
<td>2d convex polygon with N vertices</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The body style determines what attributes are stored for each body and
|
||||
thus how they can be used to compute pairwise body/body or
|
||||
bond/non-body (point particle) interactions. More details of each
|
||||
style are described below.</p>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">The rounded/polygon style listed in the table above and
|
||||
described below has not yet been relesed in LAMMPS. It will be soon.</p>
|
||||
</div>
|
||||
<p>We hope to add more styles in the future. See <a class="reference internal" href="Section_modify.html#mod-12"><span>Section_modify 12</span></a> for details on how to add a new body
|
||||
style to the code.</p>
|
||||
<hr class="docutils" />
|
||||
@ -216,6 +231,9 @@ particles of different styles</p>
|
||||
<tr class="row-odd"><td><a class="reference internal" href="dump.html"><em>dump local</em></a></td>
|
||||
<td>output sub-particle attributes of a body particle</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><a class="reference internal" href="dump_image.html"><em>dump image</em></a></td>
|
||||
<td>output body particle attributes as an image</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The pair styles defined for use with specific body styles are listed
|
||||
@ -241,26 +259,28 @@ body style, the following information must be provided for each entry
|
||||
in the <em>Bodies</em> section of the data file:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>atom-ID 1 M
|
||||
N
|
||||
ixx iyy izz ixy ixz iyz x1 y1 z1 ...
|
||||
ixx iyy izz ixy ixz iyz
|
||||
x1 y1 z1
|
||||
...
|
||||
... xN yN zN
|
||||
xN yN zN
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>N is the number of sub-particles in the body particle. M = 6 + 3*N.
|
||||
The integer line has a single value N. The floating point line(s)
|
||||
list 6 moments of inertia followed by the coordinates of the N
|
||||
sub-particles (x1 to zN) as 3N values on as many lines as required.
|
||||
Note that this in not N lines, but 10 values per line; see the
|
||||
<a class="reference internal" href="read_data.html"><em>read_data</em></a> command for details. The 6 moments of
|
||||
inertia (ixx,iyy,izz,ixy,ixz,iyz) should be the values consistent with
|
||||
the current orientation of the rigid body around its center of mass.
|
||||
The values are with respect to the simulation box XYZ axes, not with
|
||||
respect to the prinicpal axes of the rigid body itself. LAMMPS
|
||||
performs the latter calculation internally. The coordinates of each
|
||||
sub-particle are specified as its x,y,z displacement from the
|
||||
center-of-mass of the body particle. The center-of-mass position of
|
||||
the particle is specified by the x,y,z values in the <em>Atoms</em> section
|
||||
of the data file.</p>
|
||||
sub-particles (x1 to zN) as 3N values. These values can be listed on
|
||||
as many lines as you wish; see the <a class="reference internal" href="read_data.html"><em>read_data</em></a> command
|
||||
for more details.</p>
|
||||
<p>The 6 moments of inertia (ixx,iyy,izz,ixy,ixz,iyz) should be the
|
||||
values consistent with the current orientation of the rigid body
|
||||
around its center of mass. The values are with respect to the
|
||||
simulation box XYZ axes, not with respect to the prinicpal axes of the
|
||||
rigid body itself. LAMMPS performs the latter calculation internally.
|
||||
The coordinates of each sub-particle are specified as its x,y,z
|
||||
displacement from the center-of-mass of the body particle. The
|
||||
center-of-mass position of the particle is specified by the x,y,z
|
||||
values in the <em>Atoms</em> section of the data file, as is the total mass
|
||||
of the body particle.</p>
|
||||
<p>The <a class="reference internal" href="pair_body.html"><em>pair_style body</em></a> command can be used with this
|
||||
body style to compute body/body and body/non-body interactions.</p>
|
||||
<p>For output purposes via the <a class="reference internal" href="compute_body_local.html"><em>compute body/local</em></a> and <a class="reference internal" href="dump.html"><em>dump local</em></a>
|
||||
@ -275,12 +295,17 @@ sub-particles in a body particle. The datum has 3 values:</p>
|
||||
simulation domain, not a displacement from the center-of-mass (COM) of
|
||||
the body particle itself. These values are calculated using the
|
||||
current COM and orientation of the body particle.</p>
|
||||
<p>For images created by the <a class="reference internal" href="dump_image.html"><em>dump image</em></a> command, if the
|
||||
<em>body</em> keyword is set to <em>yes</em>, then each body particle is drawn as a
|
||||
collection of spheres, one for each sub-particle. The size of each
|
||||
sphere is determined by the <em>bflag1</em> parameter for the <em>body</em> keyword.
|
||||
The <em>bflag2</em> argument is ignored.</p>
|
||||
<hr class="docutils" />
|
||||
<p><strong>Specifics of body style rounded/polygon:</strong></p>
|
||||
<p>The <em>rounded/polygon</em> body style represents body particles as a convex
|
||||
polygon with a variable number N > 2 of vertices, which can only be
|
||||
used for 2d models. One example use of this body style is for 2d
|
||||
discrete element models, as described in <a class="reference internal" href="pair_body_rounded_polygon.html#fraige"><span>Fraige</span></a>. Similar to
|
||||
discrete element models, as described in <a class="reference internal" href="#fraige"><span>Fraige</span></a>. Similar to
|
||||
body style <em>nparticle</em>, the atom_style body command for this body
|
||||
style takes two additional arguments:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>atom_style body rounded/polygon Nmin Nmax
|
||||
@ -295,22 +320,23 @@ body style, the following information must be provided for each entry
|
||||
in the <em>Bodies</em> section of the data file:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>atom-ID 1 M
|
||||
N
|
||||
ixx iyy izz ixy ixz iyz x1 y1 z1 ...
|
||||
ixx iyy izz ixy ixz iyz
|
||||
x1 y1 z1
|
||||
...
|
||||
... xN yN zN i j j k ...
|
||||
xN yN zN
|
||||
i j j k k ...
|
||||
radius
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>N is the number of vertices in the body particle. M = 6 + 3*N + 2*N +
|
||||
1. The integer line has a single value N. The floating point line(s)
|
||||
list 6 moments of inertia followed by the coordinates of the N
|
||||
vertices (x1 to zN) as 3N values on as many lines as required. Note
|
||||
that this in not N lines, but 10 values per line; see the
|
||||
<a class="reference internal" href="read_data.html"><em>read_data</em></a> command for details. The next 2N elements
|
||||
are the vertex indices corresponding to the ends of the N edges. The
|
||||
vertex indices (i, j, k, ...) range from 0 to (N-1), consistent with
|
||||
the order of the vertices listed. The last element is the radius of
|
||||
the smallest circle encompassing the polygon, which is used to
|
||||
facilitate the body/body contact detection.</p>
|
||||
vertices (x1 to zN) as 3N values, followed by 2N vertex indices
|
||||
corresponding to the end points of the N edges, followed by a single
|
||||
radius value = the smallest circle encompassing the polygon. That
|
||||
last value is used to facilitate the body/body contact detection.
|
||||
These floating-point values can be listed on as many lines as you
|
||||
wish; see the <a class="reference internal" href="read_data.html"><em>read_data</em></a> command for more details.</p>
|
||||
<p>The 6 moments of inertia (ixx,iyy,izz,ixy,ixz,iyz) should be the
|
||||
values consistent with the current orientation of the rigid body
|
||||
around its center of mass. The values are with respect to the
|
||||
@ -324,9 +350,13 @@ position of the particle is specified by the x,y,z values in the
|
||||
particles whose edge length is sqrt(2):</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>3 1 27
|
||||
4
|
||||
1 1 4 0 0 0 -0.7071 -0.7071 0 -0.7071
|
||||
0.7071 0 0.7071 0.7071 0 0.7071 -0.7071 0 0 1
|
||||
1 2 2 3 3 0 1.0
|
||||
1 1 4 0 0 0
|
||||
-0.7071 -0.7071 0
|
||||
-0.7071 0.7071 0
|
||||
0.7071 0.7071 0
|
||||
0.7071 -0.7071 0
|
||||
0 1 1 2 2 3 3 0
|
||||
1.0
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The <a class="reference internal" href="pair_body_rounded_polygon.html"><em>pair_style body/rounded/polygon</em></a> command
|
||||
@ -343,6 +373,15 @@ sub-particles in a body particle. The datum has 3 values:</p>
|
||||
simulation domain, not a displacement from the center-of-mass (COM) of
|
||||
the body particle itself. These values are calculated using the
|
||||
current COM and orientation of the body particle.</p>
|
||||
<p>For images created by the <a class="reference internal" href="dump_image.html"><em>dump image</em></a> command, if the
|
||||
<em>body</em> keyword is set to <em>yes</em>, then each body particle is drawn as a
|
||||
convex polygon consisting of N line segments. Note that the line
|
||||
segments are drawn between the N vertices, which does not correspond
|
||||
exactly to the physical extent of the body (because the <a class="reference external" href="pair_body_rounded_polygon.cpp">pair_style rounded/polygon</a> defines finite-size
|
||||
spheres at those point and the line segments between the spheres are
|
||||
tangent to the spheres). The drawn diameter of each line segment is
|
||||
determined by the <em>bflag1</em> parameter for the <em>body</em> keyword. The
|
||||
<em>bflag2</em> argument is ignored.</p>
|
||||
<hr class="docutils" />
|
||||
<p id="fraige"><strong>(Fraige)</strong> F. Y. Fraige, P. A. Langston, A. J. Matchett, J. Dodds,
|
||||
Particuology, 6, 455 (2008).</p>
|
||||
|
||||
87
doc/body.txt
87
doc/body.txt
@ -27,7 +27,7 @@ styles supported by LAMMPS are as follows. The name in the first
|
||||
column is used as the {bstyle} argument for the "atom_style
|
||||
body"_atom_style.html command.
|
||||
|
||||
{nparticle} | rigid body with N sub-particles
|
||||
{nparticle} | rigid body with N sub-particles |
|
||||
{rounded/polygon} | 2d convex polygon with N vertices :tb(c=2,s=|)
|
||||
|
||||
The body style determines what attributes are stored for each body and
|
||||
@ -35,6 +35,9 @@ thus how they can be used to compute pairwise body/body or
|
||||
bond/non-body (point particle) interactions. More details of each
|
||||
style are described below.
|
||||
|
||||
NOTE: The rounded/polygon style listed in the table above and
|
||||
described below has not yet been relesed in LAMMPS. It will be soon.
|
||||
|
||||
We hope to add more styles in the future. See "Section_modify
|
||||
12"_Section_modify.html#mod_12 for details on how to add a new body
|
||||
style to the code.
|
||||
@ -90,7 +93,8 @@ particles of different styles
|
||||
"fix nph/body"_fix_nph_body.html : ditto for NPH ensemble
|
||||
"compute body/local"_compute_body_local.html : store sub-particle attributes of a body particle
|
||||
"compute temp/body"_compute_temp_body.html : compute temperature of body particles
|
||||
"dump local"_dump.html : output sub-particle attributes of a body particle :tb(s=:)
|
||||
"dump local"_dump.html : output sub-particle attributes of a body particle
|
||||
"dump image"_dump_image.html : output body particle attributes as an image :tb(s=:)
|
||||
|
||||
The pair styles defined for use with specific body styles are listed
|
||||
in the sections below.
|
||||
@ -121,25 +125,28 @@ in the {Bodies} section of the data file:
|
||||
|
||||
atom-ID 1 M
|
||||
N
|
||||
ixx iyy izz ixy ixz iyz x1 y1 z1 ...
|
||||
ixx iyy izz ixy ixz iyz
|
||||
x1 y1 z1
|
||||
...
|
||||
... xN yN zN :pre
|
||||
xN yN zN :pre
|
||||
|
||||
N is the number of sub-particles in the body particle. M = 6 + 3*N.
|
||||
The integer line has a single value N. The floating point line(s)
|
||||
list 6 moments of inertia followed by the coordinates of the N
|
||||
sub-particles (x1 to zN) as 3N values on as many lines as required.
|
||||
Note that this in not N lines, but 10 values per line; see the
|
||||
"read_data"_read_data.html command for details. The 6 moments of
|
||||
inertia (ixx,iyy,izz,ixy,ixz,iyz) should be the values consistent with
|
||||
the current orientation of the rigid body around its center of mass.
|
||||
The values are with respect to the simulation box XYZ axes, not with
|
||||
respect to the prinicpal axes of the rigid body itself. LAMMPS
|
||||
performs the latter calculation internally. The coordinates of each
|
||||
sub-particle are specified as its x,y,z displacement from the
|
||||
center-of-mass of the body particle. The center-of-mass position of
|
||||
the particle is specified by the x,y,z values in the {Atoms} section
|
||||
of the data file.
|
||||
sub-particles (x1 to zN) as 3N values. These values can be listed on
|
||||
as many lines as you wish; see the "read_data"_read_data.html command
|
||||
for more details.
|
||||
|
||||
The 6 moments of inertia (ixx,iyy,izz,ixy,ixz,iyz) should be the
|
||||
values consistent with the current orientation of the rigid body
|
||||
around its center of mass. The values are with respect to the
|
||||
simulation box XYZ axes, not with respect to the prinicpal axes of the
|
||||
rigid body itself. LAMMPS performs the latter calculation internally.
|
||||
The coordinates of each sub-particle are specified as its x,y,z
|
||||
displacement from the center-of-mass of the body particle. The
|
||||
center-of-mass position of the particle is specified by the x,y,z
|
||||
values in the {Atoms} section of the data file, as is the total mass
|
||||
of the body particle.
|
||||
|
||||
The "pair_style body"_pair_body.html command can be used with this
|
||||
body style to compute body/body and body/non-body interactions.
|
||||
@ -158,6 +165,12 @@ simulation domain, not a displacement from the center-of-mass (COM) of
|
||||
the body particle itself. These values are calculated using the
|
||||
current COM and orientation of the body particle.
|
||||
|
||||
For images created by the "dump image"_dump_image.html command, if the
|
||||
{body} keyword is set to {yes}, then each body particle is drawn as a
|
||||
collection of spheres, one for each sub-particle. The size of each
|
||||
sphere is determined by the {bflag1} parameter for the {body} keyword.
|
||||
The {bflag2} argument is ignored.
|
||||
|
||||
:line
|
||||
|
||||
[Specifics of body style rounded/polygon:]
|
||||
@ -182,21 +195,22 @@ in the {Bodies} section of the data file:
|
||||
|
||||
atom-ID 1 M
|
||||
N
|
||||
ixx iyy izz ixy ixz iyz x1 y1 z1 ...
|
||||
ixx iyy izz ixy ixz iyz
|
||||
x1 y1 z1
|
||||
...
|
||||
... xN yN zN i j j k ... :pre
|
||||
xN yN zN
|
||||
i j j k k ...
|
||||
radius :pre
|
||||
|
||||
N is the number of vertices in the body particle. M = 6 + 3*N + 2*N +
|
||||
1. The integer line has a single value N. The floating point line(s)
|
||||
list 6 moments of inertia followed by the coordinates of the N
|
||||
vertices (x1 to zN) as 3N values on as many lines as required. Note
|
||||
that this in not N lines, but 10 values per line; see the
|
||||
"read_data"_read_data.html command for details. The next 2N elements
|
||||
are the vertex indices corresponding to the ends of the N edges. The
|
||||
vertex indices (i, j, k, ...) range from 0 to (N-1), consistent with
|
||||
the order of the vertices listed. The last element is the radius of
|
||||
the smallest circle encompassing the polygon, which is used to
|
||||
facilitate the body/body contact detection.
|
||||
vertices (x1 to zN) as 3N values, followed by 2N vertex indices
|
||||
corresponding to the end points of the N edges, followed by a single
|
||||
radius value = the smallest circle encompassing the polygon. That
|
||||
last value is used to facilitate the body/body contact detection.
|
||||
These floating-point values can be listed on as many lines as you
|
||||
wish; see the "read_data"_read_data.html command for more details.
|
||||
|
||||
The 6 moments of inertia (ixx,iyy,izz,ixy,ixz,iyz) should be the
|
||||
values consistent with the current orientation of the rigid body
|
||||
@ -213,9 +227,13 @@ particles whose edge length is sqrt(2):
|
||||
|
||||
3 1 27
|
||||
4
|
||||
1 1 4 0 0 0 -0.7071 -0.7071 0 -0.7071
|
||||
0.7071 0 0.7071 0.7071 0 0.7071 -0.7071 0 0 1
|
||||
1 2 2 3 3 0 1.0 :pre
|
||||
1 1 4 0 0 0
|
||||
-0.7071 -0.7071 0
|
||||
-0.7071 0.7071 0
|
||||
0.7071 0.7071 0
|
||||
0.7071 -0.7071 0
|
||||
0 1 1 2 2 3 3 0
|
||||
1.0 :pre
|
||||
|
||||
The "pair_style body/rounded/polygon"_pair_body_rounded_polygon.html command
|
||||
can be used with this body style to compute body/body interactions.
|
||||
@ -234,6 +252,17 @@ simulation domain, not a displacement from the center-of-mass (COM) of
|
||||
the body particle itself. These values are calculated using the
|
||||
current COM and orientation of the body particle.
|
||||
|
||||
For images created by the "dump image"_dump_image.html command, if the
|
||||
{body} keyword is set to {yes}, then each body particle is drawn as a
|
||||
convex polygon consisting of N line segments. Note that the line
|
||||
segments are drawn between the N vertices, which does not correspond
|
||||
exactly to the physical extent of the body (because the "pair_style
|
||||
rounded/polygon"_pair_body_rounded_polygon.cpp defines finite-size
|
||||
spheres at those point and the line segments between the spheres are
|
||||
tangent to the spheres). The drawn diameter of each line segment is
|
||||
determined by the {bflag1} parameter for the {body} keyword. The
|
||||
{bflag2} argument is ignored.
|
||||
|
||||
:line
|
||||
|
||||
:link(Fraige)
|
||||
|
||||
@ -135,9 +135,10 @@
|
||||
<li>ID, group-ID are documented in <a class="reference internal" href="compute.html"><em>compute</em></a> command</li>
|
||||
<li>body/local = style name of this compute command</li>
|
||||
<li>one or more keywords may be appended</li>
|
||||
<li>keyword = <em>type</em> or <em>integer</em></li>
|
||||
<li>keyword = <em>id</em> or <em>type</em> or <em>integer</em></li>
|
||||
</ul>
|
||||
<pre class="literal-block">
|
||||
<em>id</em> = atom ID of the body particle
|
||||
<em>type</em> = atom type of the body particle
|
||||
<em>integer</em> = 1,2,3,etc = index of fields defined by body style
|
||||
</pre>
|
||||
@ -163,8 +164,10 @@ the atoms. An atom will only be included if it is in the group. If
|
||||
the atom is a body particle, then its N sub-particles will be looped
|
||||
over, and it will contribute N datums to the count of datums. If it
|
||||
is not a body particle, it will contribute 1 datum.</p>
|
||||
<p>For both body particles and non-body particles, the <em>id</em> keyword
|
||||
will store the ID of the particle.</p>
|
||||
<p>For both body particles and non-body particles, the <em>type</em> keyword
|
||||
will store the type of the atom.</p>
|
||||
will store the type of the particle.</p>
|
||||
<p>The <em>integer</em> keywords mean different things for body and non-body
|
||||
particles. If the atom is not a body particle, only its <em>x</em>, <em>y</em>, <em>z</em>
|
||||
coordinates can be referenced, using the <em>integer</em> keywords 1,2,3.
|
||||
|
||||
@ -15,7 +15,8 @@ compute ID group-ID body/local input1 input2 ... :pre
|
||||
ID, group-ID are documented in "compute"_compute.html command :ulb,l
|
||||
body/local = style name of this compute command :l
|
||||
one or more keywords may be appended :l
|
||||
keyword = {type} or {integer} :l
|
||||
keyword = {id} or {type} or {integer} :l
|
||||
{id} = atom ID of the body particle
|
||||
{type} = atom type of the body particle
|
||||
{integer} = 1,2,3,etc = index of fields defined by body style :pre
|
||||
:ule
|
||||
@ -41,8 +42,11 @@ the atom is a body particle, then its N sub-particles will be looped
|
||||
over, and it will contribute N datums to the count of datums. If it
|
||||
is not a body particle, it will contribute 1 datum.
|
||||
|
||||
For both body particles and non-body particles, the {id} keyword
|
||||
will store the ID of the particle.
|
||||
|
||||
For both body particles and non-body particles, the {type} keyword
|
||||
will store the type of the atom.
|
||||
will store the type of the particle.
|
||||
|
||||
The {integer} keywords mean different things for body and non-body
|
||||
particles. If the atom is not a body particle, only its {x}, {y}, {z}
|
||||
|
||||
@ -143,11 +143,14 @@
|
||||
<li>color = atom attribute that determines color of each atom</li>
|
||||
<li>diameter = atom attribute that determines size of each atom</li>
|
||||
<li>zero or more keyword/value pairs may be appended</li>
|
||||
<li>keyword = <em>adiam</em> or <em>atom</em> or <em>bond</em> or <em>size</em> or <em>view</em> or <em>center</em> or <em>up</em> or <em>zoom</em> or <em>persp</em> or <em>box</em> or <em>axes</em> or <em>subbox</em> or <em>shiny</em> or <em>ssao</em></li>
|
||||
<li>keyword = <em>adiam</em> or <em>atom</em> or <em>body</em> or <em>bond</em> or <em>size</em> or <em>view</em> or <em>center</em> or <em>up</em> or <em>zoom</em> or <em>persp</em> or <em>box</em> or <em>axes</em> or <em>subbox</em> or <em>shiny</em> or <em>ssao</em></li>
|
||||
</ul>
|
||||
<pre class="literal-block">
|
||||
<em>adiam</em> value = number = numeric value for atom diameter (distance units)
|
||||
<em>atom</em> = yes/no = do or do not draw atoms
|
||||
<em>body</em> = yes/no bflag1 bflag2
|
||||
yes/no = do or do not draw atoms as bodies
|
||||
bflag1,bflag2 = 2 numeric flags to affect how bodies are drawn
|
||||
<em>bond</em> values = color width = color and width of bonds
|
||||
color = <em>atom</em> or <em>type</em> or <em>none</em>
|
||||
width = number or <em>atom</em> or <em>type</em> or <em>none</em>
|
||||
@ -297,9 +300,8 @@ for the <a class="reference internal" href="dump.html"><em>dump custom</em></a>
|
||||
<em>element</em>. This includes per-atom quantities calculated by a
|
||||
<a class="reference internal" href="compute.html"><em>compute</em></a>, <a class="reference internal" href="fix.html"><em>fix</em></a>, or <a class="reference internal" href="variable.html"><em>variable</em></a>,
|
||||
which are prefixed by “<a href="#id9"><span class="problematic" id="id10">c_</span></a>”, “<a href="#id11"><span class="problematic" id="id12">f_</span></a>”, or “<a href="#id13"><span class="problematic" id="id14">v_</span></a>” respectively. Note that the
|
||||
<em>diameter</em> setting can be overridden with a numeric value by the
|
||||
optional <em>adiam</em> keyword, in which case you can specify the <em>diameter</em>
|
||||
setting with any valid atom attribute.</p>
|
||||
<em>diameter</em> setting can be overridden with a numeric value applied to
|
||||
all atoms by the optional <em>adiam</em> keyword.</p>
|
||||
<p>If <em>type</em> is specified for the <em>color</em> setting, then the color of each
|
||||
atom is determined by its atom type. By default the mapping of types
|
||||
to colors is as follows:</p>
|
||||
@ -354,6 +356,20 @@ drawn with that diameter, e.g. 1.5, which is in whatever distance
|
||||
<a class="reference internal" href="units.html"><em>units</em></a> the input script defines, e.g. Angstroms.</p>
|
||||
<p>The <em>atom</em> keyword allow you to turn off the drawing of all atoms,
|
||||
if the specified value is <em>no</em>.</p>
|
||||
<p>The <em>body</em> keyword can be used when <a class="reference internal" href="atom_style.html"><em>atom_style body</em></a>
|
||||
is used to define body particles with internal state
|
||||
(e.g. sub-particles). The <a class="reference internal" href="body.html"><em>body</em></a> doc page descibes the body
|
||||
styles LAMMPS currently supports, and provides more details as to the
|
||||
kind of body particles they represent and how they are drawn by this
|
||||
dump image command. For all the body styles, individual atoms can be
|
||||
either a body particle or a usual point (non-body) particle. If the
|
||||
<em>body</em> keyword is set to <em>yes</em>, then atoms which are body particles
|
||||
are drawn by the method defined by the body style. Non-body particles
|
||||
the same way they would be if the <em>body</em> keyword is <em>no</em>, i.e. as
|
||||
spheres. The <em>bflag1</em> and <em>bflag2</em> settings are numerical values
|
||||
which are passed to the body style to affect how the drawing of a body
|
||||
particle is done. See the <a class="reference internal" href="body.html"><em>body</em></a> doc page for a description
|
||||
of what these parameters mean for each body style.</p>
|
||||
<p>The <em>bond</em> keyword allows to you to alter how bonds are drawn. A bond
|
||||
is only drawn if both atoms in the bond are being drawn due to being
|
||||
in the specified group and due to other selection criteria
|
||||
|
||||
@ -21,9 +21,12 @@ file = name of file to write image to :l
|
||||
color = atom attribute that determines color of each atom :l
|
||||
diameter = atom attribute that determines size of each atom :l
|
||||
zero or more keyword/value pairs may be appended :l
|
||||
keyword = {adiam} or {atom} or {bond} or {size} or {view} or {center} or {up} or {zoom} or {persp} or {box} or {axes} or {subbox} or {shiny} or {ssao} :l
|
||||
keyword = {adiam} or {atom} or {body} or {bond} or {size} or {view} or {center} or {up} or {zoom} or {persp} or {box} or {axes} or {subbox} or {shiny} or {ssao} :l
|
||||
{adiam} value = number = numeric value for atom diameter (distance units)
|
||||
{atom} = yes/no = do or do not draw atoms
|
||||
{body} = yes/no bflag1 bflag2
|
||||
yes/no = do or do not draw atoms as bodies
|
||||
bflag1,bflag2 = 2 numeric flags to affect how bodies are drawn
|
||||
{bond} values = color width = color and width of bonds
|
||||
color = {atom} or {type} or {none}
|
||||
width = number or {atom} or {type} or {none}
|
||||
@ -168,9 +171,8 @@ for the "dump custom"_dump.html command, including {type} and
|
||||
{element}. This includes per-atom quantities calculated by a
|
||||
"compute"_compute.html, "fix"_fix.html, or "variable"_variable.html,
|
||||
which are prefixed by "c_", "f_", or "v_" respectively. Note that the
|
||||
{diameter} setting can be overridden with a numeric value by the
|
||||
optional {adiam} keyword, in which case you can specify the {diameter}
|
||||
setting with any valid atom attribute.
|
||||
{diameter} setting can be overridden with a numeric value applied to
|
||||
all atoms by the optional {adiam} keyword.
|
||||
|
||||
If {type} is specified for the {color} setting, then the color of each
|
||||
atom is determined by its atom type. By default the mapping of types
|
||||
@ -240,6 +242,21 @@ drawn with that diameter, e.g. 1.5, which is in whatever distance
|
||||
The {atom} keyword allow you to turn off the drawing of all atoms,
|
||||
if the specified value is {no}.
|
||||
|
||||
The {body} keyword can be used when "atom_style body"_atom_style.html
|
||||
is used to define body particles with internal state
|
||||
(e.g. sub-particles). The "body"_body.html doc page descibes the body
|
||||
styles LAMMPS currently supports, and provides more details as to the
|
||||
kind of body particles they represent and how they are drawn by this
|
||||
dump image command. For all the body styles, individual atoms can be
|
||||
either a body particle or a usual point (non-body) particle. If the
|
||||
{body} keyword is set to {yes}, then atoms which are body particles
|
||||
are drawn by the method defined by the body style. Non-body particles
|
||||
the same way they would be if the {body} keyword is {no}, i.e. as
|
||||
spheres. The {bflag1} and {bflag2} settings are numerical values
|
||||
which are passed to the body style to affect how the drawing of a body
|
||||
particle is done. See the "body"_body.html doc page for a description
|
||||
of what these parameters mean for each body style.
|
||||
|
||||
The {bond} keyword allows to you to alter how bonds are drawn. A bond
|
||||
is only drawn if both atoms in the bond are being drawn due to being
|
||||
in the specified group and due to other selection criteria
|
||||
|
||||
@ -816,15 +816,15 @@ script.</p>
|
||||
<p><em>Bodies</em> section:</p>
|
||||
<ul class="simple">
|
||||
<li>one or more lines per body</li>
|
||||
<li>first line syntax: atom-ID ninteger ndouble</li>
|
||||
<li>first line syntax: atom-ID Ninteger Ndouble</li>
|
||||
</ul>
|
||||
<div class="highlight-python"><div class="highlight"><pre>ninteger = # of integer quantities for this particle
|
||||
ndouble = # of floating-point quantities for this particle
|
||||
<div class="highlight-python"><div class="highlight"><pre>Ninteger = # of integer quantities for this particle
|
||||
Ndouble = # of floating-point quantities for this particle
|
||||
</pre></div>
|
||||
</div>
|
||||
<ul class="simple">
|
||||
<li>0 or more integer lines: one line for every 10 integer quantities</li>
|
||||
<li>0 or more double lines: one line for every 10 double quantities</li>
|
||||
<li>0 or more integer lines with total of Ninteger values</li>
|
||||
<li>0 or more double lines with total of Ndouble values</li>
|
||||
<li>example:</li>
|
||||
</ul>
|
||||
<div class="highlight-python"><div class="highlight"><pre>12 3 6
|
||||
@ -836,8 +836,8 @@ ndouble = # of floating-point quantities for this particle
|
||||
<li>example:</li>
|
||||
</ul>
|
||||
<div class="highlight-python"><div class="highlight"><pre>12 0 14
|
||||
1.0 2.0 3.0 1.0 2.0 4.0 1.0 2.0 3.0 1.0
|
||||
2.0 4.0 4.0 2.0
|
||||
1.0 2.0 3.0 1.0 2.0 4.0 1.0
|
||||
2.0 3.0 1.0 2.0 4.0 4.0 2.0
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The <em>Bodies</em> section must appear if <a class="reference internal" href="atom_style.html"><em>atom_style body</em></a>
|
||||
@ -849,16 +849,14 @@ values. The number and meaning of the values is defined by the body
|
||||
style, as described in the <a class="reference internal" href="body.html"><em>body</em></a> doc page. The body style
|
||||
is given as an argument to the <a class="reference internal" href="atom_style.html"><em>atom_style body</em></a>
|
||||
command.</p>
|
||||
<p>The ninteger and ndouble values determine how many integer and
|
||||
<p>The Ninteger and Ndouble values determine how many integer and
|
||||
floating-point values are specified for this particle. Ninteger and
|
||||
ndouble can be as large as needed and can be different for every body.
|
||||
Integer values are then listed on subsequent lines, 10 values per
|
||||
line. Floating-point values follow on subsequent lines, again 10 per
|
||||
line. If the number of lines is not evenly divisible by 10, the last
|
||||
line in that group contains the remaining values, e.g. 4 values out of
|
||||
14 in the last example above, for floating-point values. If there are
|
||||
no values of a particular type, no lines appear for that type,
|
||||
e.g. there are no integer lines in the last example above.</p>
|
||||
Ndouble can be as large as needed and can be different for every body.
|
||||
Integer values are then listed next on subsequent lines. Lines are
|
||||
read one at a time until Ninteger values are read. Floating-point
|
||||
values follow on subsequent lines, Again lines are read one at a time
|
||||
until Ndouble values are read. Note that if there are no values of a
|
||||
particular type, no lines appear for that type.</p>
|
||||
<p>The <em>Bodies</em> section must appear after the <em>Atoms</em> section.</p>
|
||||
<hr class="docutils" />
|
||||
<p><em>Bond Coeffs</em> section:</p>
|
||||
|
||||
@ -702,19 +702,19 @@ script.
|
||||
{Bodies} section:
|
||||
|
||||
one or more lines per body :ulb,l
|
||||
first line syntax: atom-ID ninteger ndouble :l
|
||||
ninteger = # of integer quantities for this particle
|
||||
ndouble = # of floating-point quantities for this particle :pre
|
||||
0 or more integer lines: one line for every 10 integer quantities :l
|
||||
0 or more double lines: one line for every 10 double quantities :l
|
||||
first line syntax: atom-ID Ninteger Ndouble :l
|
||||
Ninteger = # of integer quantities for this particle
|
||||
Ndouble = # of floating-point quantities for this particle :pre
|
||||
0 or more integer lines with total of Ninteger values :l
|
||||
0 or more double lines with total of Ndouble values :l
|
||||
example: :l
|
||||
12 3 6
|
||||
2 3 2
|
||||
1.0 2.0 3.0 1.0 2.0 4.0 :pre
|
||||
example: :l
|
||||
12 0 14
|
||||
1.0 2.0 3.0 1.0 2.0 4.0 1.0 2.0 3.0 1.0
|
||||
2.0 4.0 4.0 2.0 :pre
|
||||
1.0 2.0 3.0 1.0 2.0 4.0 1.0
|
||||
2.0 3.0 1.0 2.0 4.0 4.0 2.0 :pre
|
||||
:ule
|
||||
|
||||
The {Bodies} section must appear if "atom_style body"_atom_style.html
|
||||
@ -728,16 +728,14 @@ style, as described in the "body"_body.html doc page. The body style
|
||||
is given as an argument to the "atom_style body"_atom_style.html
|
||||
command.
|
||||
|
||||
The ninteger and ndouble values determine how many integer and
|
||||
The Ninteger and Ndouble values determine how many integer and
|
||||
floating-point values are specified for this particle. Ninteger and
|
||||
ndouble can be as large as needed and can be different for every body.
|
||||
Integer values are then listed on subsequent lines, 10 values per
|
||||
line. Floating-point values follow on subsequent lines, again 10 per
|
||||
line. If the number of lines is not evenly divisible by 10, the last
|
||||
line in that group contains the remaining values, e.g. 4 values out of
|
||||
14 in the last example above, for floating-point values. If there are
|
||||
no values of a particular type, no lines appear for that type,
|
||||
e.g. there are no integer lines in the last example above.
|
||||
Ndouble can be as large as needed and can be different for every body.
|
||||
Integer values are then listed next on subsequent lines. Lines are
|
||||
read one at a time until Ninteger values are read. Floating-point
|
||||
values follow on subsequent lines, Again lines are read one at a time
|
||||
until Ndouble values are read. Note that if there are no values of a
|
||||
particular type, no lines appear for that type.
|
||||
|
||||
The {Bodies} section must appear after the {Atoms} section.
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -16,12 +16,14 @@
|
||||
#include "math_extra.h"
|
||||
#include "atom_vec_body.h"
|
||||
#include "atom.h"
|
||||
#include "error.h"
|
||||
#include "force.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define EPSILON 1.0e-7
|
||||
enum{SPHERE,LINE}; // also in DumpImage
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -42,6 +44,9 @@ BodyNparticle::BodyNparticle(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
icp = new MyPoolChunk<int>(1,1);
|
||||
dcp = new MyPoolChunk<double>(3*nmin,3*nmax);
|
||||
|
||||
memory->create(imflag,nmax,"body/nparticle:imflag");
|
||||
memory->create(imdata,nmax,4,"body/nparticle:imdata");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -50,6 +55,8 @@ BodyNparticle::~BodyNparticle()
|
||||
{
|
||||
delete icp;
|
||||
delete dcp;
|
||||
memory->destroy(imflag);
|
||||
memory->destroy(imdata);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -220,3 +227,31 @@ void BodyNparticle::output(int ibonus, int m, double *values)
|
||||
values[1] += x[1];
|
||||
values[2] += x[2];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int BodyNparticle::image(int ibonus, double flag1, double flag2,
|
||||
int *&ivec, double **&darray)
|
||||
{
|
||||
double p[3][3];
|
||||
double *x;
|
||||
|
||||
AtomVecBody::Bonus *bonus = &avec->bonus[ibonus];
|
||||
int n = bonus->ivalue[0];
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
imflag[i] = SPHERE;
|
||||
MathExtra::quat_to_mat(bonus->quat,p);
|
||||
MathExtra::matvec(p,&bonus->dvalue[3*i],imdata[i]);
|
||||
|
||||
x = atom->x[bonus->ilocal];
|
||||
imdata[i][0] += x[0];
|
||||
imdata[i][1] += x[1];
|
||||
imdata[i][2] += x[2];
|
||||
imdata[i][3] = flag1;
|
||||
}
|
||||
|
||||
ivec = imflag;
|
||||
darray = imdata;
|
||||
return n;
|
||||
}
|
||||
|
||||
@ -39,6 +39,12 @@ class BodyNparticle : public Body {
|
||||
int noutrow(int);
|
||||
int noutcol();
|
||||
void output(int, int, double *);
|
||||
int image(int, double, double, int *&, double **&);
|
||||
|
||||
private:
|
||||
int *imflag;
|
||||
double **imdata;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
51
src/atom.cpp
51
src/atom.cpp
@ -45,7 +45,6 @@ using namespace MathConst;
|
||||
#define DELTA_MEMSTR 1024
|
||||
#define EPSILON 1.0e-6
|
||||
#define CUDA_CHUNK 3000
|
||||
#define MAXBODY 20 // max # of lines in one body, also in ReadData class
|
||||
|
||||
enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files
|
||||
|
||||
@ -713,6 +712,29 @@ int Atom::count_words(const char *line)
|
||||
return n;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
count and return words in a single line using provided copy buf
|
||||
make copy of line before using strtok so as not to change line
|
||||
trim anything from '#' onward
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int Atom::count_words(const char *line, char *copy)
|
||||
{
|
||||
strcpy(copy,line);
|
||||
|
||||
char *ptr;
|
||||
if ((ptr = strchr(copy,'#'))) *ptr = '\0';
|
||||
|
||||
if (strtok(copy," \t\n\r\f") == NULL) {
|
||||
memory->destroy(copy);
|
||||
return 0;
|
||||
}
|
||||
int n = 1;
|
||||
while (strtok(NULL," \t\n\r\f")) n++;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
deallocate molecular topology arrays
|
||||
done before realloc with (possibly) new 2nd dimension set to
|
||||
@ -756,7 +778,7 @@ void Atom::deallocate_topology()
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unpack n lines from Atom section of data file
|
||||
unpack N lines from Atom section of data file
|
||||
call style-specific routine to parse line
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -900,7 +922,7 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, int type_offset,
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unpack n lines from Velocity section of data file
|
||||
unpack N lines from Velocity section of data file
|
||||
check that atom IDs are > 0 and <= map_tag_max
|
||||
call style-specific routine to parse line
|
||||
------------------------------------------------------------------------- */
|
||||
@ -1240,7 +1262,7 @@ void Atom::data_impropers(int n, char *buf, int *count, tagint id_offset,
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unpack n lines from atom-style specific section of data file
|
||||
unpack N lines from atom-style specific bonus section of data file
|
||||
check that atom IDs are > 0 and <= map_tag_max
|
||||
call style-specific routine to parse line
|
||||
------------------------------------------------------------------------- */
|
||||
@ -1287,7 +1309,8 @@ void Atom::data_bonus(int n, char *buf, AtomVec *avec_bonus, tagint id_offset)
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unpack n lines from atom-style specific section of data file
|
||||
unpack N bodies from Bodies section of data file
|
||||
each body spans multiple lines
|
||||
check that atom IDs are > 0 and <= map_tag_max
|
||||
call style-specific routine to parse line
|
||||
------------------------------------------------------------------------- */
|
||||
@ -1297,8 +1320,10 @@ void Atom::data_bodies(int n, char *buf, AtomVecBody *avec_body,
|
||||
{
|
||||
int j,m,tagdata,ninteger,ndouble;
|
||||
|
||||
char **ivalues = new char*[10*MAXBODY];
|
||||
char **dvalues = new char*[10*MAXBODY];
|
||||
int maxint = 0;
|
||||
int maxdouble = 0;
|
||||
char **ivalues = NULL;
|
||||
char **dvalues = NULL;
|
||||
|
||||
// loop over lines of body data
|
||||
// tokenize the lines into ivalues and dvalues
|
||||
@ -1307,9 +1332,21 @@ void Atom::data_bodies(int n, char *buf, AtomVecBody *avec_body,
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (i == 0) tagdata = ATOTAGINT(strtok(buf," \t\n\r\f")) + id_offset;
|
||||
else tagdata = ATOTAGINT(strtok(NULL," \t\n\r\f")) + id_offset;
|
||||
|
||||
ninteger = atoi(strtok(NULL," \t\n\r\f"));
|
||||
ndouble = atoi(strtok(NULL," \t\n\r\f"));
|
||||
|
||||
if (ninteger > maxint) {
|
||||
delete [] ivalues;
|
||||
maxint = ninteger;
|
||||
ivalues = new char*[maxint];
|
||||
}
|
||||
if (ndouble > maxdouble) {
|
||||
delete [] dvalues;
|
||||
maxdouble = ndouble;
|
||||
dvalues = new char*[maxdouble];
|
||||
}
|
||||
|
||||
for (j = 0; j < ninteger; j++)
|
||||
ivalues[j] = strtok(NULL," \t\n\r\f");
|
||||
for (j = 0; j < ndouble; j++)
|
||||
|
||||
@ -207,6 +207,7 @@ class Atom : protected Pointers {
|
||||
|
||||
int parse_data(const char *);
|
||||
int count_words(const char *);
|
||||
int count_words(const char *, char *);
|
||||
|
||||
void deallocate_topology();
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ class Body : protected Pointers {
|
||||
virtual int noutrow(int) = 0;
|
||||
virtual int noutcol() = 0;
|
||||
virtual void output(int, int, double *) = 0;
|
||||
virtual int image(int, double, double, int *&, double **&) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
#include "image.h"
|
||||
#include "atom.h"
|
||||
#include "atom_vec.h"
|
||||
#include "atom_vec_body.h"
|
||||
#include "body.h"
|
||||
#include "molecule.h"
|
||||
#include "domain.h"
|
||||
#include "group.h"
|
||||
@ -36,6 +38,7 @@ using namespace MathConst;
|
||||
#define BIG 1.0e20
|
||||
|
||||
enum{NUMERIC,ATOM,TYPE,ELEMENT,ATTRIBUTE};
|
||||
enum{SPHERE,LINE}; // also in Body child classes
|
||||
enum{STATIC,DYNAMIC};
|
||||
enum{NO,YES};
|
||||
|
||||
@ -103,6 +106,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
|
||||
// set defaults for optional args
|
||||
|
||||
atomflag = YES;
|
||||
bodyflag = NO;
|
||||
if (atom->nbondtypes == 0) bondflag = NO;
|
||||
else {
|
||||
bondflag = YES;
|
||||
@ -142,6 +146,15 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
|
||||
else error->all(FLERR,"Illegal dump image command");
|
||||
iarg += 2;
|
||||
|
||||
} else if (strcmp(arg[iarg],"body") == 0) {
|
||||
if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
|
||||
if (strcmp(arg[iarg+1],"yes") == 0) bodyflag = YES;
|
||||
else if (strcmp(arg[iarg+1],"no") == 0) bodyflag = NO;
|
||||
else error->all(FLERR,"Illegal dump image command");
|
||||
bodyflag1 = force->numeric(FLERR,arg[iarg+2]);
|
||||
bodyflag2 = force->numeric(FLERR,arg[iarg+3]);
|
||||
iarg += 4;
|
||||
|
||||
} else if (strcmp(arg[iarg],"bond") == 0) {
|
||||
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
|
||||
if (atom->nbondtypes == 0)
|
||||
@ -320,6 +333,14 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
|
||||
} else error->all(FLERR,"Illegal dump image command");
|
||||
}
|
||||
|
||||
// error check for bodyflag
|
||||
|
||||
if (bodyflag) {
|
||||
AtomVecBody *avec = (AtomVecBody *) atom->style_match("body");
|
||||
if (!avec) error->all(FLERR,"Dump image body yes requires atom style body");
|
||||
bptr = avec->bptr;
|
||||
}
|
||||
|
||||
// allocate image buffer now that image size is known
|
||||
|
||||
image->buffers();
|
||||
@ -658,9 +679,11 @@ void DumpImage::view_params()
|
||||
|
||||
void DumpImage::create_image()
|
||||
{
|
||||
int i,j,m,n,itype,atom1,atom2,imol,iatom,btype;
|
||||
int i,j,k,m,n,itype,atom1,atom2,imol,iatom,btype,ibonus;
|
||||
tagint tagprev;
|
||||
double diameter,delx,dely,delz;
|
||||
int *bodyvec;
|
||||
double **bodyarray;
|
||||
double *color,*color1,*color2;
|
||||
double xmid[3];
|
||||
|
||||
@ -668,6 +691,7 @@ void DumpImage::create_image()
|
||||
|
||||
if (atomflag) {
|
||||
double **x = atom->x;
|
||||
int *body = atom->body;
|
||||
|
||||
m = 0;
|
||||
for (i = 0; i < nchoose; i++) {
|
||||
@ -695,7 +719,20 @@ void DumpImage::create_image()
|
||||
diameter = buf[m+1];
|
||||
}
|
||||
|
||||
image->draw_sphere(x[j],color,diameter);
|
||||
if (!body || !bodyflag || body[j] < 0)
|
||||
image->draw_sphere(x[j],color,diameter);
|
||||
else {
|
||||
ibonus = body[i];
|
||||
n = bptr->image(ibonus,bodyflag1,bodyflag2,bodyvec,bodyarray);
|
||||
for (k = 0; k < n; k++) {
|
||||
if (bodyvec[k] == SPHERE)
|
||||
image->draw_sphere(bodyarray[k],color,bodyarray[k][3]);
|
||||
else if (bodyvec[k] == LINE)
|
||||
image->draw_cylinder(&bodyarray[k][0],&bodyarray[k][3],
|
||||
color,bodyarray[k][6],3);
|
||||
}
|
||||
}
|
||||
|
||||
m += size_one;
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,6 +40,8 @@ class DumpImage : public DumpCustom {
|
||||
int acolor,adiam; // what determines color/diam of atoms
|
||||
double adiamvalue; // atom diameter value
|
||||
int atomflag,bondflag; // 0/1 for draw atoms,bonds
|
||||
int bodyflag; // 0/1 for draw atoms as bodies
|
||||
double bodyflag1,bodyflag2; // user params for drawing bodies
|
||||
int bcolor,bdiam; // what determines color/diam of bonds
|
||||
double bdiamvalue; // bond diameter value
|
||||
char *thetastr,*phistr; // variables for view theta,phi
|
||||
@ -63,6 +65,7 @@ class DumpImage : public DumpCustom {
|
||||
double **colortype,**colorelement,**bcolortype; // per-type colors
|
||||
|
||||
class Image *image; // class that renders each image
|
||||
class Body *bptr; // class for Body particles
|
||||
|
||||
int *chooseghost; // extended choose array for comm
|
||||
double **bufcopy; // buffer for communicating bond/atom info
|
||||
|
||||
@ -52,7 +52,7 @@ using namespace LAMMPS_NS;
|
||||
#define LB_FACTOR 1.1
|
||||
#define CHUNK 1024
|
||||
#define DELTA 4 // must be 2 or larger
|
||||
#define MAXBODY 20 // max # of lines in one body, also in Atom class
|
||||
#define MAXBODY 32 // max # of lines in one body
|
||||
|
||||
// customize for new sections
|
||||
#define NSECTIONS 25 // change when add to header::section_keywords
|
||||
@ -73,6 +73,7 @@ ReadData::ReadData(LAMMPS *lmp) : Pointers(lmp)
|
||||
{
|
||||
MPI_Comm_rank(world,&me);
|
||||
line = new char[MAXLINE];
|
||||
copy = new char[MAXLINE];
|
||||
keyword = new char[MAXLINE];
|
||||
style = new char[MAXLINE];
|
||||
buffer = new char[CHUNK*MAXLINE];
|
||||
@ -98,6 +99,7 @@ ReadData::ReadData(LAMMPS *lmp) : Pointers(lmp)
|
||||
ReadData::~ReadData()
|
||||
{
|
||||
delete [] line;
|
||||
delete [] copy;
|
||||
delete [] keyword;
|
||||
delete [] style;
|
||||
delete [] buffer;
|
||||
@ -1462,12 +1464,12 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type)
|
||||
read all body data
|
||||
variable amount of info per body, described by ninteger and ndouble
|
||||
to find atoms, must build atom map if not a molecular system
|
||||
if not firstpass, just read but no processing of data
|
||||
if not firstpass, just read past data, but no processing of data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ReadData::bodies(int firstpass)
|
||||
{
|
||||
int i,m,nchunk,nline,nmax,ninteger,ndouble,tmp,onebody;
|
||||
int i,m,nchunk,nline,nmax,ninteger,ndouble,nword,onebody,tmp;
|
||||
char *eof;
|
||||
|
||||
int mapflag = 0;
|
||||
@ -1498,19 +1500,38 @@ void ReadData::bodies(int firstpass)
|
||||
sscanf(&buffer[m],"%d %d %d",&tmp,&ninteger,&ndouble);
|
||||
m += strlen(&buffer[m]);
|
||||
|
||||
// read lines one at a time into buffer
|
||||
// make copy of line and count words
|
||||
// count to ninteger and ndouble until have enough lines
|
||||
|
||||
onebody = 0;
|
||||
if (ninteger) onebody += (ninteger-1)/10 + 1;
|
||||
if (ndouble) onebody += (ndouble-1)/10 + 1;
|
||||
|
||||
nword = 0;
|
||||
while (nword < ninteger) {
|
||||
eof = fgets(&buffer[m],MAXLINE,fp);
|
||||
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
|
||||
nword += atom->count_words(&buffer[m],copy);
|
||||
m += strlen(&buffer[m]);
|
||||
onebody++;
|
||||
}
|
||||
if (nword > ninteger)
|
||||
error->one(FLERR,"Too many value in body lines in data file");
|
||||
|
||||
nword = 0;
|
||||
while (nword < ndouble) {
|
||||
eof = fgets(&buffer[m],MAXLINE,fp);
|
||||
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
|
||||
nword += atom->count_words(&buffer[m],copy);
|
||||
m += strlen(&buffer[m]);
|
||||
onebody++;
|
||||
}
|
||||
if (nword > ndouble)
|
||||
error->one(FLERR,"Too many value in body lines in data file");
|
||||
|
||||
if (onebody+1 > MAXBODY)
|
||||
error->one(FLERR,
|
||||
"Too many lines in one body in data file - boost MAXBODY");
|
||||
|
||||
for (i = 0; i < onebody; i++) {
|
||||
eof = fgets(&buffer[m],MAXLINE,fp);
|
||||
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
|
||||
m += strlen(&buffer[m]);
|
||||
}
|
||||
|
||||
nchunk++;
|
||||
nline += onebody+1;
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ class ReadData : protected Pointers {
|
||||
|
||||
private:
|
||||
int me,compressed;
|
||||
char *line,*keyword,*buffer,*style;
|
||||
char *line,*copy,*keyword,*buffer,*style;
|
||||
FILE *fp;
|
||||
char **arg;
|
||||
int narg,maxarg;
|
||||
|
||||
@ -1 +1 @@
|
||||
#define LAMMPS_VERSION "15 Dec 2015"
|
||||
#define LAMMPS_VERSION "17 Dec 2015"
|
||||
|
||||
Reference in New Issue
Block a user