Files
lammps/doc/html/Howto_body.html
2025-01-13 14:55:48 +00:00

626 lines
34 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>8.5.3. Body particles &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinx-design.min.css" type="text/css" />
<link rel="stylesheet" href="_static/css/lammps.css" type="text/css" />
<link rel="shortcut icon" href="_static/lammps.ico"/>
<link rel="canonical" href="https://docs.lammps.org/Howto_body.html" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=5929fcd5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/design-tabs.js?v=f930bc37"></script>
<script async="async" src="_static/mathjax/es5/tex-mml-chtml.js?v=cadf963e"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="8.5.4. Bonded particle models" href="Howto_bpm.html" />
<link rel="prev" title="8.5.2. Granular models" href="Howto_granular.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="Manual.html">
<img src="_static/lammps-logo.png" class="logo" alt="Logo"/>
</a>
<div class="lammps_version">Version: <b>19 Nov 2024</b></div>
<div class="lammps_release">git info: </div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">User Guide</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="Intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Install.html">2. Install LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Build.html">3. Build LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Run_head.html">4. Run LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Commands.html">5. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Packages.html">6. Optional packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Speed.html">7. Accelerate performance</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="Howto.html">8. Howto discussions</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="Howto.html#general-howto">8.1. General howto</a></li>
<li class="toctree-l2"><a class="reference internal" href="Howto.html#settings-howto">8.2. Settings howto</a></li>
<li class="toctree-l2"><a class="reference internal" href="Howto.html#analysis-howto">8.3. Analysis howto</a></li>
<li class="toctree-l2"><a class="reference internal" href="Howto.html#force-fields-howto">8.4. Force fields howto</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="Howto.html#packages-howto">8.5. Packages howto</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="Howto_spherical.html">8.5.1. Finite-size spherical and aspherical particles</a></li>
<li class="toctree-l3"><a class="reference internal" href="Howto_granular.html">8.5.2. Granular models</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">8.5.3. Body particles</a></li>
<li class="toctree-l3"><a class="reference internal" href="Howto_bpm.html">8.5.4. Bonded particle models</a></li>
<li class="toctree-l3"><a class="reference internal" href="Howto_polarizable.html">8.5.5. Polarizable models</a></li>
<li class="toctree-l3"><a class="reference internal" href="Howto_coreshell.html">8.5.6. Adiabatic core/shell model</a></li>
<li class="toctree-l3"><a class="reference internal" href="Howto_drude.html">8.5.7. Drude induced dipoles</a></li>
<li class="toctree-l3"><a class="reference internal" href="Howto_drude2.html">8.5.8. Tutorial for Thermalized Drude oscillators in LAMMPS</a></li>
<li class="toctree-l3"><a class="reference internal" href="Howto_peri.html">8.5.9. Peridynamics with LAMMPS</a></li>
<li class="toctree-l3"><a class="reference internal" href="Howto_manifold.html">8.5.10. Manifolds (surfaces)</a></li>
<li class="toctree-l3"><a class="reference internal" href="Howto_rheo.html">8.5.11. Reproducing hydrodynamics and elastic objects (RHEO)</a></li>
<li class="toctree-l3"><a class="reference internal" href="Howto_spins.html">8.5.12. Magnetic spins</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="Howto.html#tutorials-howto">8.6. Tutorials howto</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Examples.html">9. Example scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="Tools.html">10. Auxiliary tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Errors.html">11. Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Programmer Guide</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="Library.html">1. LAMMPS Library Interfaces</a></li>
<li class="toctree-l1"><a class="reference internal" href="Python_head.html">2. Use Python with LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Modify.html">3. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Developer.html">4. Information for Developers</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Command Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="commands_list.html">Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="fixes.html">Fix Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="computes.html">Compute Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="pairs.html">Pair Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="bonds.html">Bond Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="angles.html">Angle Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="dihedrals.html">Dihedral Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="impropers.html">Improper Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="dumps.html">Dump Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="fix_modify_atc_commands.html">fix_modify AtC commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Bibliography.html">Bibliography</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="Manual.html">LAMMPS</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content style-external-links">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="Howto.html"><span class="section-number">8. </span>Howto discussions</a></li>
<li class="breadcrumb-item active"><span class="section-number">8.5.3. </span>Body particles</li>
<li class="wy-breadcrumbs-aside">
<a href="https://www.lammps.org"><img src="_static/lammps-logo.png" width="64" height="16" alt="LAMMPS Homepage"></a> | <a href="Commands_all.html">Commands</a>
</li>
</ul><div class="rst-breadcrumbs-buttons" role="navigation" aria-label="Sequential page navigation">
<a href="Howto_granular.html" class="btn btn-neutral float-left" title="8.5.2. Granular models" accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="Howto_bpm.html" class="btn btn-neutral float-right" title="8.5.4. Bonded particle models" accesskey="n">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<p><span class="math notranslate nohighlight">\(\renewcommand{\AA}{\text{Å}}\)</span></p>
<section id="body-particles">
<h1><span class="section-number">8.5.3. </span>Body particles<a class="headerlink" href="#body-particles" title="Link to this heading"></a></h1>
<p><strong>Overview:</strong></p>
<p>In LAMMPS, body particles are generalized finite-size particles.
Individual body particles can represent complex entities, such as
surface meshes of discrete points, collections of sub-particles,
deformable objects, etc. Note that other kinds of finite-size
spherical and aspherical particles are also supported by LAMMPS, such
as spheres, ellipsoids, line segments, and triangles, but they are
simpler entities than body particles. See the <a class="reference internal" href="Howto_spherical.html"><span class="doc">Howto spherical</span></a> page for a general overview of all these
particle types.</p>
<p>Body particles are used via the <a class="reference internal" href="atom_style.html"><span class="doc">atom_style body</span></a>
command. It takes a body style as an argument. The current body
styles supported by LAMMPS are as follows. The name in the first
column is used as the <em>bstyle</em> argument for the <a class="reference internal" href="atom_style.html"><span class="doc">atom_style body</span></a> command.</p>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><em>nparticle</em></p></td>
<td><p>rigid body with N sub-particles</p></td>
</tr>
<tr class="row-even"><td><p><em>rounded/polygon</em></p></td>
<td><p>2d polygons with N vertices</p></td>
</tr>
<tr class="row-odd"><td><p><em>rounded/polyhedron</em></p></td>
<td><p>3d polyhedra with N vertices, E edges and F faces</p></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>
<p>More styles may be added in the future. See the
<a class="reference internal" href="Modify_body.html"><span class="doc">page on creating new body styles</span></a> for details on
how to add a new body style to the code.</p>
<hr class="docutils" />
<p><strong>When to use body particles:</strong></p>
<p>You should not use body particles to model a rigid body made of
simpler particles (e.g. point, sphere, ellipsoid, line segment,
triangular particles), if the interaction between pairs of rigid
bodies is just the summation of pairwise interactions between the
simpler particles. LAMMPS already supports this kind of model via the
<a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid</span></a> command. Any of the numerous pair styles
that compute interactions between simpler particles can be used. The
<a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid</span></a> command time integrates the motion of the
rigid bodies. All of the standard LAMMPS commands for thermostatting,
adding constraints, performing output, etc will operate as expected on
the simple particles.</p>
<p>By contrast, when body particles are used, LAMMPS treats an entire
body as a single particle for purposes of computing pairwise
interactions, building neighbor lists, migrating particles between
processors, output of particles to a dump file, etc. This means that
interactions between pairs of bodies or between a body and non-body
(point) particle need to be encoded in an appropriate pair style. If
such a pair style were to mimic the <a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid</span></a>
model, it would need to loop over the entire collection of
interactions between pairs of simple particles within the two bodies,
each time a single body/body interaction was computed.</p>
<p>Thus it only makes sense to use body particles and develop such a pair
style, when particle/particle interactions are more complex than what
the <a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid</span></a> command can already calculate. For
example, consider particles with one or more of the following
attributes:</p>
<ul class="simple">
<li><p>represented by a surface mesh</p></li>
<li><p>represented by a collection of geometric entities (e.g. planes + spheres)</p></li>
<li><p>deformable</p></li>
<li><p>internal stress that induces fragmentation</p></li>
</ul>
<p>For these models, the interaction between pairs of particles is likely
to be more complex than the summation of simple pairwise interactions.
An example is contact or frictional forces between particles with
planar surfaces that inter-penetrate. Likewise, the body particle may
store internal state, such as a stress tensor used to compute a
fracture criterion.</p>
<p>These are additional LAMMPS commands that can be used with body
particles of different styles</p>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="fix_nve_body.html"><span class="doc">fix nve/body</span></a></p></td>
<td><p>integrate motion of a body particle in NVE ensemble</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="fix_nvt_body.html"><span class="doc">fix nvt/body</span></a></p></td>
<td><p>ditto for NVT ensemble</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="fix_npt_body.html"><span class="doc">fix npt/body</span></a></p></td>
<td><p>ditto for NPT ensemble</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="fix_nph_body.html"><span class="doc">fix nph/body</span></a></p></td>
<td><p>ditto for NPH ensemble</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="compute_body_local.html"><span class="doc">compute body/local</span></a></p></td>
<td><p>store sub-particle attributes of a body particle</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="compute_temp_body.html"><span class="doc">compute temp/body</span></a></p></td>
<td><p>compute temperature of body particles</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="dump.html"><span class="doc">dump local</span></a></p></td>
<td><p>output sub-particle attributes of a body particle</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="dump_image.html"><span class="doc">dump image</span></a></p></td>
<td><p>output body particle attributes as an image</p></td>
</tr>
</tbody>
</table>
<p>The pair styles currently defined for use with specific body styles
are listed in the sections below.</p>
<p>Note that for all the body styles, if the data file defines a general
triclinic box, then the orientation of the body particle and its
corresponding 6 moments of inertia and other orientation-dependent
values should reflect the fact the body is defined withing a general
triclinic box with edge vectors <strong>A</strong>,**B**,**C**. LAMMPS will rotate
the box to convert it to a restricted triclinic box. This operation
will also rotate the orientation of the body particles. See the
<a class="reference internal" href="Howto_triclinic.html"><span class="doc">Howto triclinic</span></a> doc page for more details.
The sections below highlight the orientation-dependent values specific
to each body style.</p>
<hr class="docutils" />
<p><strong>Specifics of body style nparticle:</strong></p>
<p>The <em>nparticle</em> body style represents body particles as a rigid body
with a variable number N of sub-particles. It is provided as a
vanilla, prototypical example of a body particle, although as
mentioned above, the <a class="reference internal" href="fix_rigid.html"><span class="doc">fix rigid</span></a> command already
duplicates its functionality.</p>
<p>The atom_style body command for this body style takes two additional
arguments:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>atom_style body nparticle Nmin Nmax
Nmin = minimum # of sub-particles in any body in the system
Nmax = maximum # of sub-particles in any body in the system
</pre></div>
</div>
<p>The Nmin and Nmax arguments are used to bound the size of data
structures used internally by each particle.</p>
<p>When the <a class="reference internal" href="read_data.html"><span class="doc">read_data</span></a> command reads a data file for this
body style, the following information must be provided for each entry
in the <em>Bodies</em> section of the data file:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>atom-ID 1 M
N
ixx iyy izz ixy ixz iyz
x1 y1 z1
...
xN yN zN
</pre></div>
</div>
<p>where M = 6 + 3*N, and N is the number of sub-particles in the body
particle.</p>
<p>The integer line has a single value N. The floating point line(s)
list 6 moments of inertia followed by the coordinates of the N
sub-particles (x1 to zN) as 3N values. These values can be listed on
as many lines as you wish; see the <a class="reference internal" href="read_data.html"><span class="doc">read_data</span></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 principal axes of the
rigid body itself. LAMMPS performs the latter calculation internally.</p>
<p>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>Note that if the data file defines a general triclinic simulation box,
these sub-particle displacements are orientation-dependent and, as
mentioned above, should reflect the body particles orientation within
the general triclinic box.</p>
<p>The <a class="reference internal" href="pair_body_nparticle.html"><span class="doc">pair_style body/nparticle</span></a> command can be used
with this body style to compute body/body and body/non-body interactions.</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 2d
polygon with a variable number of N vertices. This style can only be
used for 2d models; see the <a class="reference internal" href="boundary.html"><span class="doc">boundary</span></a> command. See the
<a class="reference internal" href="pair_body_rounded_polygon.html"><span class="doc">pair_style body/rounded/polygon</span></a> page for
a diagram of two squares with rounded circles at the vertices. Special cases
for N = 1 (circle) and N = 2 (rod with rounded ends) can also be specified.</p>
<p>One use of this body style is for 2d discrete element models, as
described in <a class="reference internal" href="#body-fraige"><span class="std std-ref">Fraige</span></a>.</p>
<p>Similar to body style <em>nparticle</em>, the atom_style body command for
this body style takes two additional arguments:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>atom_style body rounded/polygon Nmin Nmax
Nmin = minimum # of vertices in any body in the system
Nmax = maximum # of vertices in any body in the system
</pre></div>
</div>
<p>The Nmin and Nmax arguments are used to bound the size of data
structures used internally by each particle.</p>
<p>When the <a class="reference internal" href="read_data.html"><span class="doc">read_data</span></a> command reads a data file for this
body style, the following information must be provided for each body
in the <em>Bodies</em> section of the data file:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>atom-ID 1 M
N
ixx iyy izz ixy ixz iyz
x1 y1 z1
...
xN yN zN
diameter
</pre></div>
</div>
<p>where M = 6 + 3*N + 1, and N is the number of vertices in the body
particle.</p>
<p>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 (with z = 0.0 for each), followed by
a diameter value = the rounded diameter of the circle that surrounds
each vertex. The diameter value can be different for each body
particle. These floating-point values can be listed on as many lines
as you wish; see the <a class="reference internal" href="read_data.html"><span class="doc">read_data</span></a> command for more
details.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>It is important that the vertices for each polygonal body particle be
listed in order around its perimeter, so that edges can be inferred.
LAMMPS does not check that this is the case.</p>
</div>
<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 principal axes of the
rigid body itself. LAMMPS performs the latter calculation internally.</p>
<p>The coordinates of each vertex are specified as its x,y,z displacement
from the center-of-mass of the body particle. The center-of-mass
position of the particle is specified by the x,y,z values in the
<em>Atoms</em> section of the data file.</p>
<p>For example, the following information would specify a square particle
whose edge length is sqrt(2) and rounded diameter is 1.0. The
orientation of the square is aligned with the xy coordinate axes which
is consistent with the 6 moments of inertia: ixx iyy izz ixy ixz iyz =
1 1 4 0 0 0. Note that only Izz matters in 2D simulations.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>3 1 19
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
1.0
</pre></div>
</div>
<p>A rod in 2D, whose length is 4.0, mass 1.0, rounded at two ends
by circles of diameter 0.5, is specified as follows:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>1 1 13
2
1 1 1.33333 0 0 0
-2 0 0
2 0 0
0.5
</pre></div>
</div>
<p>A disk, whose diameter is 3.0, mass 1.0, is specified as follows:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>1 1 10
1
1 1 4.5 0 0 0
0 0 0
3.0
</pre></div>
</div>
<p>Note that if the data file defines a general triclinic simulation box,
these polygon vertex displacements are orientation-dependent and, as
mentioned above, should reflect the body particles orientation within
the general triclinic box.</p>
<p>The <a class="reference internal" href="pair_body_rounded_polygon.html"><span class="doc">pair_style body/rounded/polygon</span></a>
command can be used with this body style to compute body/body
interactions. The <a class="reference internal" href="fix_wall_body_polygon.html"><span class="doc">fix wall/body/polygon</span></a>
command can be used with this body style to compute the interaction of
body particles with a wall.</p>
<hr class="docutils" />
<p><strong>Specifics of body style rounded/polyhedron:</strong></p>
<p>The <em>rounded/polyhedron</em> body style represents body particles as a 3d
polyhedron with a variable number of N vertices, E edges and F faces.
This style can only be used for 3d models; see the
<a class="reference internal" href="boundary.html"><span class="doc">boundary</span></a> command. See the “pair_style
body/rounded/polygon” page for a diagram of a two 2d squares with
rounded circles at the vertices. A 3d cube with rounded spheres at
the 8 vertices and 12 rounded edges would be similar. Special cases
for N = 1 (sphere) and N = 2 (rod with rounded ends) can also be
specified.</p>
<p>This body style is for 3d discrete element models, as described in
<a class="reference internal" href="#body-wang"><span class="std std-ref">Wang</span></a>.</p>
<p>Similar to body style <em>rounded/polygon</em>, the atom_style body command
for this body style takes two additional arguments:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>atom_style body rounded/polyhedron Nmin Nmax
Nmin = minimum # of vertices in any body in the system
Nmax = maximum # of vertices in any body in the system
</pre></div>
</div>
<p>The Nmin and Nmax arguments are used to bound the size of data
structures used internally by each particle.</p>
<p>When the <a class="reference internal" href="read_data.html"><span class="doc">read_data</span></a> command reads a data file for this
body style, the following information must be provided for each entry
in the <em>Bodies</em> section of the data file:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>atom-ID 3 M
N E F
ixx iyy izz ixy ixz iyz
x1 y1 z1
...
xN yN zN
0 1
1 2
2 3
...
0 1 2 -1
0 2 3 -1
...
1 2 3 4
diameter
</pre></div>
</div>
<p>where M = 6 + 3*N + 2*E + 4*F + 1, and N is the number of vertices
in the body particle, E = number of edges, F = number of faces. For N
= 1 or 2, the format is simpler. E and F are ignored and no edges or
faces are listed, so that M = 6 + 3*N + 1.</p>
<p>The integer line has three values: number of vertices (N), number of
edges (E) and number of faces (F). The floating point line(s) list 6
moments of inertia followed by the coordinates of the N vertices (x1
to zN) as 3N values, followed by 2E vertex indices corresponding to
the end points of the E edges, then 4*F vertex indices defining F
faces. The last value is the diameter value = the rounded diameter of
the sphere that surrounds each vertex. The diameter value can be
different for each body particle. These floating-point values can be
listed on as many lines as you wish; see the <a class="reference internal" href="read_data.html"><span class="doc">read_data</span></a> command for more details.</p>
<p>Note that vertices are numbered from 0 to N-1 inclusive. The order of
the 2 vertices in each edge does not matter. Faces can be triangles
or quadrilaterals. In both cases 4 vertices must be specified. For a
triangle the 4th vertex is -1. The 4 vertices within each triangle or
quadrilateral face should be ordered by the right-hand rule so that
the normal vector of the face points outwards from the center of mass.
For polyhedron with faces with more than 4 vertices, you should split
the complex face into multiple simple faces, each of which is a
triangle or quadrilateral.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If a face is a quadrilateral then its 4 vertices must be co-planar.
LAMMPS does not check that this is the case. If you have a quad-face
of a polyhedron that is not planar (e.g. a cube whose vertices have
been randomly displaced), then you should represent the single quad
face as two triangle faces instead.</p>
</div>
<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 principal axes of the
rigid body itself. LAMMPS performs the latter calculation internally.</p>
<p>The coordinates of each vertex are specified as its x,y,z displacement
from the center-of-mass of the body particle. The center-of-mass
position of the particle is specified by the x,y,z values in the
<em>Atoms</em> section of the data file.</p>
<p>For example, the following information would specify a cubic particle
whose edge length is 2.0 and rounded diameter is 0.5.
The orientation of the cube is aligned with the xyz coordinate axes
which is consistent with the 6 moments of inertia: ixx iyy izz ixy ixz
iyz = 0.667 0.667 0.667 0 0 0.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>1 3 79
8 12 6
0.667 0.667 0.667 0 0 0
1 1 1
1 -1 1
-1 -1 1
-1 1 1
1 1 -1
1 -1 -1
-1 -1 -1
-1 1 -1
0 1
1 2
2 3
3 0
4 5
5 6
6 7
7 4
0 4
1 5
2 6
3 7
0 1 2 3
4 5 6 7
0 1 5 4
1 2 6 5
2 3 7 6
3 0 4 7
0.5
</pre></div>
</div>
<p>A rod in 3D, whose length is 4.0, mass 1.0 and rounded at two ends
by circles of diameter 0.5, is specified as follows:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>1 3 13
2 1 1
0 1.33333 1.33333 0 0 0
-2 0 0
2 0 0
0.5
</pre></div>
</div>
<p>A sphere whose diameter is 3.0 and mass 1.0, is specified as follows:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>1 3 10
1 1 1
0.9 0.9 0.9 0 0 0
0 0 0
3.0
</pre></div>
</div>
<p>The number of edges and faces for a rod or sphere must be listed,
but is ignored.</p>
<p>Note that if the data file defines a general triclinic simulation box,
these polyhedron vertex displacements are orientation-dependent and,
as mentioned above, should reflect the body particles orientation
within the general triclinic box.</p>
<p>The <a class="reference internal" href="pair_body_rounded_polyhedron.html"><span class="doc">pair_style body/rounded/polhedron</span></a> command can be used with this body
style to compute body/body interactions. The <a class="reference internal" href="fix_wall_body_polygon.html"><span class="doc">fix
wall/body/polyhedron</span></a> command can be used with
this body style to compute the interaction of body particles with a
wall.</p>
<hr class="docutils" />
<p><strong>Output specifics for all body styles:</strong></p>
<p>For the <a class="reference internal" href="compute_body_local.html"><span class="doc">compute body/local</span></a> and <a class="reference internal" href="dump.html"><span class="doc">dump
local</span></a> commands, all 3 of the body styles described on his page
produces one datum for each of the N vertices (of sub-particles) in a
body particle. The datum has 3 values:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>1 = x position of vertex (or sub-particle)
2 = y position of vertex
3 = z position of vertex
</pre></div>
</div>
<p>These values are the current position of the vertex within the
simulation domain, not a displacement from the center-of-mass (COM) of
the body particle itself. These values are calculated using the
current COM and orientation of the body particle.</p>
<p>The <a class="reference internal" href="dump_image.html"><span class="doc">dump image</span></a> command and its <em>body</em> keyword can
be used to render body particles.</p>
<p>For the <em>nparticle</em> body style, each body 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>
<p>For the <em>rounded/polygon</em> body style, each body is drawn as a polygon
with N line segments. For the <em>rounded/polyhedron</em> body style, each
face of each body is drawn as a polygon with N line segments. 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>
<p>Note that for both the <em>rounded/polygon</em> and <em>rounded/polyhedron</em>
styles, line segments are drawn between the pairs of vertices.
Depending on the diameters of the line segments this may be slightly
different than the physical extent of the body as calculated by the
<a class="reference internal" href="pair_body_rounded_polygon.html"><span class="doc">pair_style rounded/polygon</span></a> or
<a class="reference internal" href="pair_body_rounded_polyhedron.html"><span class="doc">pair_style rounded/polyhedron</span></a>
commands. Conceptually, the pair styles define the surface of a 2d or
3d body by lines or planes that are tangent to the finite-size spheres
of specified diameter which are placed on each vertex position.</p>
<hr class="docutils" />
<p id="body-fraige"><strong>(Fraige)</strong> F. Y. Fraige, P. A. Langston, A. J. Matchett, J. Dodds,
Particuology, 6, 455 (2008).</p>
<p id="body-wang"><strong>(Wang)</strong> J. Wang, H. S. Yu, P. A. Langston, F. Y. Fraige, Granular
Matter, 13, 1 (2011).</p>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="Howto_granular.html" class="btn btn-neutral float-left" title="8.5.2. Granular models" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="Howto_bpm.html" class="btn btn-neutral float-right" title="8.5.4. Bonded particle models" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2003-2025 Sandia Corporation.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(false);
});
</script>
</body>
</html>