1 "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
3 :link(lws,http://lammps.sandia.gov)
5 :link(lc,Section_commands.html#comm)
10 fix rigid/nve command :h3
11 fix rigid/nvt command :h3
12 fix rigid/npt command :h3
13 fix rigid/nph command :h3
14 fix rigid/small command :h3
15 fix rigid/nve/small command :h3
16 fix rigid/nvt/small command :h3
17 fix rigid/npt/small command :h3
18 fix rigid/nph/small command :h3
22 fix ID group-ID style bodystyle args keyword values ... :pre
24 ID, group-ID are documented in "fix"_fix.html command :ulb,l
25 style = {rigid} or {rigid/nve} or {rigid/nvt} or {rigid/npt} or {rigid/nph} or {rigid/small} or {rigid/nve/small} or {rigid/nvt/small} or {rigid/npt/small} or {rigid/nph/small} :l
26 bodystyle = {single} or {molecule} or {group} :l
28 {molecule} args = none
29 {group} args = N groupID1 groupID2 ...
31 groupID1, groupID2, ... = list of N group IDs :pre
33 zero or more keyword/value pairs may be appended :l
34 keyword = {langevin} or {temp} or {iso} or {aniso} or {x} or {y} or {z} or {couple} or {tparam} or {pchain} or {dilate} or {force} or {torque} or {infile} :l
35 {langevin} values = Tstart Tstop Tperiod seed
36 Tstart,Tstop = desired temperature at start/stop of run (temperature units)
37 Tdamp = temperature damping parameter (time units)
38 seed = random number seed to use for white noise (positive integer)
39 {temp} values = Tstart Tstop Tdamp
40 Tstart,Tstop = desired temperature at start/stop of run (temperature units)
41 Tdamp = temperature damping parameter (time units)
42 {iso} or {aniso} values = Pstart Pstop Pdamp
43 Pstart,Pstop = scalar external pressure at start/end of run (pressure units)
44 Pdamp = pressure damping parameter (time units)
45 {x} or {y} or {z} values = Pstart Pstop Pdamp
46 Pstart,Pstop = external stress tensor component at start/end of run (pressure units)
47 Pdamp = stress damping parameter (time units)
48 {couple} = {none} or {xyz} or {xy} or {yz} or {xz}
49 {tparam} values = Tchain Titer Torder
50 Tchain = length of Nose/Hoover thermostat chain
51 Titer = number of thermostat iterations performed
52 Torder = 3 or 5 = Yoshida-Suzuki integration parameters
53 {pchain} values = Pchain
54 Pchain = length of the Nose/Hoover thermostat chain coupled with the barostat
55 {dilate} value = dilate-group-ID
56 dilate-group-ID = only dilate atoms in this group due to barostat volume changes
57 {force} values = M xflag yflag zflag
58 M = which rigid body from 1-Nbody (see asterisk form below)
59 xflag,yflag,zflag = off/on if component of center-of-mass force is active
60 {torque} values = M xflag yflag zflag
61 M = which rigid body from 1-Nbody (see asterisk form below)
62 xflag,yflag,zflag = off/on if component of center-of-mass torque is active
64 filename = file with per-body values of mass, center-of-mass, moments of inertia
65 {mol} value = template-ID
66 template-ID = ID of molecule template specified in a separate "molecule"_molecule.html command :pre
71 fix 1 clump rigid single
72 fix 1 clump rigid/small molecule
73 fix 1 clump rigid single force 1 off off on langevin 1.0 1.0 1.0 428984
74 fix 1 polychains rigid/nvt molecule temp 1.0 1.0 5.0
75 fix 1 polychains rigid molecule force 1*5 off off off force 6*10 off off on
76 fix 1 polychains rigid/small molecule langevin 1.0 1.0 1.0 428984
77 fix 2 fluid rigid group 3 clump1 clump2 clump3 torque * off off off
78 fix 1 rods rigid/npt molecule temp 300.0 300.0 100.0 iso 0.5 0.5 10.0
79 fix 1 particles rigid/npt molecule temp 1.0 1.0 5.0 x 0.5 0.5 1.0 z 0.5 0.5 1.0 couple xz
80 fix 1 water rigid/nph molecule iso 0.5 0.5 1.0
81 fix 1 particles rigid/npt/small molecule temp 1.0 1.0 1.0 iso 0.5 0.5 1.0 :pre
85 Treat one or more sets of atoms as independent rigid bodies. This
86 means that each timestep the total force and torque on each rigid body
87 is computed as the sum of the forces and torques on its constituent
88 particles. The coordinates, velocities, and orientations of the atoms
89 in each body are then updated so that the body moves and rotates as a
92 Examples of large rigid bodies are a colloidal particle, or portions
93 of a biomolecule such as a protein.
95 Example of small rigid bodies are patchy nanoparticles, such as those
96 modeled in "this paper"_#Zhang by Sharon Glotzer's group, clumps of
97 granular particles, lipid molecules consiting of one or more point
98 dipoles connected to other spheroids or ellipsoids, irregular
99 particles built from line segments (2d) or triangles (3d), and
100 coarse-grain models of nano or colloidal particles consisting of a
101 small number of constituent particles. Note that the "fix
102 shake"_fix_shake.html command can also be used to rigidify small
103 molecules of 2, 3, or 4 atoms, e.g. water molecules. That fix treats
104 the constituent atoms as point masses.
106 These fixes also update the positions and velocities of the atoms in
107 each rigid body via time integration, in the NVE, NVT, NPT, or NPH
108 ensemble, as described below.
110 There are two main variants of this fix, fix rigid and fix
111 rigid/small. The NVE/NVT/NPT/NHT versions belong to one of the two
112 variants, as their style names indicate.
114 NOTE: Not all of the {bodystyle} options and keyword/value options are
115 available for both the {rigid} and {rigid/small} variants. See
118 The {rigid} styles are typically the best choice for a system with a
119 small number of large rigid bodies, each of which can extend across
120 the domain of many processors. It operates by creating a single
121 global list of rigid bodies, which all processors contribute to.
122 MPI_Allreduce operations are performed each timestep to sum the
123 contributions from each processor to the force and torque on all the
124 bodies. This operation will not scale well in parallel if large
125 numbers of rigid bodies are simulated.
127 The {rigid/small} styles are typically best for a system with a large
128 number of small rigid bodies. Each body is assigned to the atom
129 closest to the geometrical center of the body. The fix operates using
130 local lists of rigid bodies owned by each processor and information is
131 exchanged and summed via local communication between neighboring
132 processors when ghost atom info is accumlated.
134 NOTE: To use the {rigid/small} styles the ghost atom cutoff must be
135 large enough to span the distance between the atom that owns the body
136 and every other atom in the body. This distance value is printed out
137 when the rigid bodies are defined. If the
138 "pair_style"_pair_style.html cutoff plus neighbor skin does not span
139 this distance, then you should use the "comm_modify
140 cutoff"_comm_modify.html command with a setting epsilon larger than
143 Which of the two variants is faster for a particular problem is hard
144 to predict. The best way to decide is to perform a short test run.
145 Both variants should give identical numerical answers for short runs.
146 Long runs should give statistically similar results, but round-off
147 differences may accumulate to produce divergent trajectories.
149 NOTE: You should not update the atoms in rigid bodies via other
150 time-integration fixes (e.g. "fix nve"_fix_nve.html, "fix
151 nvt"_fix_nh.html, "fix npt"_fix_nh.html), or you will be integrating
152 their motion more than once each timestep. When performing a hybrid
153 simulation with some atoms in rigid bodies, and some not, a separate
154 time integration fix like "fix nve"_fix_nve.html or "fix
155 nvt"_fix_nh.html should be used for the non-rigid particles.
157 NOTE: These fixes are overkill if you simply want to hold a collection
158 of atoms stationary or have them move with a constant velocity. A
159 simpler way to hold atoms stationary is to not include those atoms in
160 your time integration fix. E.g. use "fix 1 mobile nve" instead of
161 "fix 1 all nve", where "mobile" is the group of atoms that you want to
162 move. You can move atoms with a constant velocity by assigning them
163 an initial velocity (via the "velocity"_velocity.html command),
164 setting the force on them to 0.0 (via the "fix
165 setforce"_fix_setforce.html command), and integrating them as usual
166 (e.g. via the "fix nve"_fix_nve.html command).
168 NOTE: The aggregate properties of each rigid body are calculated one
169 time at the start of the first simulation run after these fixes are
170 specified. The properties include the position and velocity of the
171 center-of-mass of the body, its moments of inertia, and its angular
172 momentum. This is done using the properties of the constituent atoms
173 of the body at that point in time (or see the {infile} keyword
174 option). Thereafter, changing properties of individual atoms in the
175 body will have no effect on a rigid body's dynamics, unless they
176 affect the "pair_style"_pair_style.html interactions that individual
177 particles are part of. For example, you might think you could
178 displace the atoms in a body or add a large velocity to each atom in a
179 body to make it move in a desired direction before a 2nd run is
180 performed, using the "set"_set.html or
181 "displace_atoms"_displace_atoms.html or "velocity"_velocity.html
182 command. But these commands will not affect the internal attributes
183 of the body, and the position and velocity of individual atoms in the
184 body will be reset when time integration starts.
188 Each rigid body must have two or more atoms. An atom can belong to at
189 most one rigid body. Which atoms are in which bodies can be defined
192 NOTE: With the {rigid/small} styles, which require that {bodystyle} be
193 specified as {molecule}, you can define a system that has no rigid
194 bodies initially. This is useful when you are using the {mol} keyword
195 in conjunction with another fix that is adding rigid bodies on-the-fly
196 as molecules, such as "fix deposit"_fix_deposit.html or "fix
199 For bodystyle {single} the entire fix group of atoms is treated as one
200 rigid body. This option is only allowed for the {rigid} styles.
202 For bodystyle {molecule}, each set of atoms in the fix group with a
203 different molecule ID is treated as a rigid body. This option is
204 allowed for both the {rigid} and {rigid/small} styles. Note that
205 atoms with a molecule ID = 0 will be treated as a single rigid body.
206 For a system with atomic solvent (typically this is atoms with
207 molecule ID = 0) surrounding rigid bodies, this may not be what you
208 want. Thus you should be careful to use a fix group that only
209 includes atoms you want to be part of rigid bodies.
211 For bodystyle {group}, each of the listed groups is treated as a
212 separate rigid body. Only atoms that are also in the fix group are
213 included in each rigid body. This option is only allowed for the
216 NOTE: To compute the initial center-of-mass position and other
217 properties of each rigid body, the image flags for each atom in the
218 body are used to "unwrap" the atom coordinates. Thus you must insure
219 that these image flags are consistent so that the unwrapping creates a
220 valid rigid body (one where the atoms are close together),
221 particularly if the atoms in a single rigid body straddle a periodic
222 boundary. This means the input data file or restart file must define
223 the image flags for each atom consistently or that you have used the
224 "set"_set.html command to specify them correctly. If a dimension is
225 non-periodic then the image flag of each atom must be 0 in that
226 dimension, else an error is generated.
228 The {force} and {torque} keywords discussed next are only allowed for
231 By default, each rigid body is acted on by other atoms which induce an
232 external force and torque on its center of mass, causing it to
233 translate and rotate. Components of the external center-of-mass force
234 and torque can be turned off by the {force} and {torque} keywords.
235 This may be useful if you wish a body to rotate but not translate, or
236 vice versa, or if you wish it to rotate or translate continuously
237 unaffected by interactions with other particles. Note that if you
238 expect a rigid body not to move or rotate by using these keywords, you
239 must insure its initial center-of-mass translational or angular
240 velocity is 0.0. Otherwise the initial translational or angular
241 momentum the body has will persist.
243 An xflag, yflag, or zflag set to {off} means turn off the component of
244 force of torque in that dimension. A setting of {on} means turn on
245 the component, which is the default. Which rigid body(s) the settings
246 apply to is determined by the first argument of the {force} and
247 {torque} keywords. It can be an integer M from 1 to Nbody, where
248 Nbody is the number of rigid bodies defined. A wild-card asterisk can
249 be used in place of, or in conjunction with, the M argument to set the
250 flags for multiple rigid bodies. This takes the form "*" or "*n" or
251 "n*" or "m*n". If N = the number of rigid bodies, then an asterisk
252 with no numeric values means all bodies from 1 to N. A leading
253 asterisk means all bodies from 1 to n (inclusive). A trailing
254 asterisk means all bodies from n to N (inclusive). A middle asterisk
255 means all types from m to n (inclusive). Note that you can use the
256 {force} or {torque} keywords as many times as you like. If a
257 particular rigid body has its component flags set multiple times, the
258 settings from the final keyword are used.
260 NOTE: For computational efficiency, you may wish to turn off pairwise
261 and bond interactions within each rigid body, as they no longer
262 contribute to the motion. The "neigh_modify
263 exclude"_neigh_modify.html and "delete_bonds"_delete_bonds.html
264 commands are used to do this. If the rigid bodies have strongly
265 overalapping atoms, you may need to turn off these interactions to
266 avoid numerical problems due to large equal/opposite intra-body forces
267 swamping the contribution of small inter-body forces.
269 For computational efficiency, you should typically define one fix
270 rigid or fix rigid/small command which includes all the desired rigid
271 bodies. LAMMPS will allow multiple rigid fixes to be defined, but it
276 The constituent particles within a rigid body can be point particles
277 (the default in LAMMPS) or finite-size particles, such as spheres or
278 ellipsoids or line segments or triangles. See the "atom_style sphere
279 and ellipsoid and line and tri"_atom_style.html commands for more
280 details on these kinds of particles. Finite-size particles contribute
281 differently to the moment of inertia of a rigid body than do point
282 particles. Finite-size particles can also experience torque (e.g. due
283 to "frictional granular interactions"_pair_gran.html) and have an
284 orientation. These contributions are accounted for by these fixes.
286 Forces between particles within a body do not contribute to the
287 external force or torque on the body. Thus for computational
288 efficiency, you may wish to turn off pairwise and bond interactions
289 between particles within each rigid body. The "neigh_modify
290 exclude"_neigh_modify.html and "delete_bonds"_delete_bonds.html
291 commands are used to do this. For finite-size particles this also
292 means the particles can be highly overlapped when creating the rigid
297 The {rigid}, {rigid/nve}, {rigid/small}, and {rigid/small/nve} styles
298 perform constant NVE time integration. They are referred to below as
299 the 4 NVE rigid styles. The only difference is that the {rigid} and
300 {rigid/small} styles use an integration technique based on Richardson
301 iterations. The {rigid/nve} and {rigid/small/nve} styles uses the
302 methods described in the paper by "Miller"_#Miller, which are thought
303 to provide better energy conservation than an iterative approach.
305 The {rigid/nvt} and {rigid/nvt/small} styles performs constant NVT
306 integration using a Nose/Hoover thermostat with chains as described
307 originally in "(Hoover)"_#Hoover and "(Martyna)"_#Martyna, which
308 thermostats both the translational and rotational degrees of freedom
309 of the rigid bodies. They are referred to below as the 2 NVT rigid
310 styles. The rigid-body algorithm used by {rigid/nvt} is described in
311 the paper by "Kamberaj"_#Kamberaj.
313 The {rigid/npt}, {rigid/nph}, {rigid/npt/small}, and {rigid/nph/small}
314 styles perform constant NPT or NPH integration using a Nose/Hoover
315 barostat with chains. They are referred to below as the 4 NPT and NPH
316 rigid styles. For the NPT case, the same Nose/Hoover thermostat is
317 also used as with {rigid/nvt} and {rigid/nvt/small}.
319 The barostat parameters are specified using one or more of the {iso},
320 {aniso}, {x}, {y}, {z} and {couple} keywords. These keywords give you
321 the ability to specify 3 diagonal components of the external stress
322 tensor, and to couple these components together so that the dimensions
323 they represent are varied together during a constant-pressure
324 simulation. The effects of these keywords are similar to those
325 defined in "fix npt/nph"_fix_nh.html
327 NOTE: Currently the {rigid/npt}, {rigid/nph}, {rigid/npt/small}, and
328 {rigid/nph/small} styles do not support triclinic (non-orthongonal)
331 The target pressures for each of the 6 components of the stress tensor
332 can be specified independently via the {x}, {y}, {z} keywords, which
333 correspond to the 3 simulation box dimensions. For each component,
334 the external pressure or tensor component at each timestep is a ramped
335 value during the run from {Pstart} to {Pstop}. If a target pressure is
336 specified for a component, then the corresponding box dimension will
337 change during a simulation. For example, if the {y} keyword is used,
338 the y-box length will change. A box dimension will not change if that
339 component is not specified, although you have the option to change
340 that dimension via the "fix deform"_fix_deform.html command.
342 For all barostat keywords, the {Pdamp} parameter operates like the
343 {Tdamp} parameter, determining the time scale on which pressure is
344 relaxed. For example, a value of 10.0 means to relax the pressure in
345 a timespan of (roughly) 10 time units (e.g. tau or fmsec or psec - see
346 the "units"_units.html command).
348 Regardless of what atoms are in the fix group (the only atoms which
349 are time integrated), a global pressure or stress tensor is computed
350 for all atoms. Similarly, when the size of the simulation box is
351 changed, all atoms are re-scaled to new positions, unless the keyword
352 {dilate} is specified with a {dilate-group-ID} for a group that
353 represents a subset of the atoms. This can be useful, for example, to
354 leave the coordinates of atoms in a solid substrate unchanged and
355 controlling the pressure of a surrounding fluid. Another example is a
356 system consisting of rigid bodies and point particles where the
357 barostat is only coupled with the rigid bodies. This option should be
358 used with care, since it can be unphysical to dilate some atoms and
359 not others, because it can introduce large, instantaneous
360 displacements between a pair of atoms (one dilated, one not) that are
361 far from the dilation origin.
363 The {couple} keyword allows two or three of the diagonal components of
364 the pressure tensor to be "coupled" together. The value specified
365 with the keyword determines which are coupled. For example, {xz}
366 means the {Pxx} and {Pzz} components of the stress tensor are coupled.
367 {Xyz} means all 3 diagonal components are coupled. Coupling means two
368 things: the instantaneous stress will be computed as an average of the
369 corresponding diagonal components, and the coupled box dimensions will
370 be changed together in lockstep, meaning coupled dimensions will be
371 dilated or contracted by the same percentage every timestep. The
372 {Pstart}, {Pstop}, {Pdamp} parameters for any coupled dimensions must
373 be identical. {Couple xyz} can be used for a 2d simulation; the {z}
374 dimension is simply ignored.
376 The {iso} and {aniso} keywords are simply shortcuts that are
377 equivalent to specifying several other keywords together.
379 The keyword {iso} means couple all 3 diagonal components together when
380 pressure is computed (hydrostatic pressure), and dilate/contract the
381 dimensions together. Using "iso Pstart Pstop Pdamp" is the same as
382 specifying these 4 keywords:
389 The keyword {aniso} means {x}, {y}, and {z} dimensions are controlled
390 independently using the {Pxx}, {Pyy}, and {Pzz} components of the
391 stress tensor as the driving forces, and the specified scalar external
392 pressure. Using "aniso Pstart Pstop Pdamp" is the same as specifying
402 The keyword/value option pairs are used in the following ways.
404 The {langevin} and {temp} and {tparam} keywords perform thermostatting
405 of the rigid bodies, altering both their translational and rotational
406 degrees of freedom. What is meant by "temperature" of a collection of
407 rigid bodies and how it can be monitored via the fix output is
410 The {langevin} keyword applies a Langevin thermostat to the constant
411 NVE time integration performed by any of the 4 NVE rigid styles:
412 {rigid}, {rigid/nve}, {rigid/small}, {rigid/small/nve}. It cannot be
413 used with the 2 NVT rigid styles: {rigid/nvt}, {rigid/small/nvt}. The
414 desired temperature at each timestep is a ramped value during the run
415 from {Tstart} to {Tstop}. The {Tdamp} parameter is specified in time
416 units and determines how rapidly the temperature is relaxed. For
417 example, a value of 100.0 means to relax the temperature in a timespan
418 of (roughly) 100 time units (tau or fmsec or psec - see the
419 "units"_units.html command). The random # {seed} must be a positive
422 The way that Langevin thermostatting operates is explained on the "fix
423 langevin"_fix_langevin.html doc page. If you wish to simply viscously
424 damp the rotational motion without thermostatting, you can set
425 {Tstart} and {Tstop} to 0.0, which means only the viscous drag term in
426 the Langevin thermostat will be applied. See the discussion on the
427 "fix viscous"_fix_viscous.html doc page for details.
429 NOTE: When the {langevin} keyword is used with fix rigid versus fix
430 rigid/small, different dynamics will result for parallel runs. This
431 is because of the way random numbers are used in the two cases. The
432 dynamics for the two cases should be statistically similar, but will
433 not be identical, even for a single timestep.
435 The {temp} and {tparam} keywords apply a Nose/Hoover thermostat to the
436 NVT time integration performed by the 2 NVT rigid styles. They cannot
437 be used with the 4 NVE rigid styles. The desired temperature at each
438 timestep is a ramped value during the run from {Tstart} to {Tstop}.
439 The {Tdamp} parameter is specified in time units and determines how
440 rapidly the temperature is relaxed. For example, a value of 100.0
441 means to relax the temperature in a timespan of (roughly) 100 time
442 units (tau or fmsec or psec - see the "units"_units.html command).
444 Nose/Hoover chains are used in conjunction with this thermostat. The
445 {tparam} keyword can optionally be used to change the chain settings
446 used. {Tchain} is the number of thermostats in the Nose Hoover chain.
447 This value, along with {Tdamp} can be varied to dampen undesirable
448 oscillations in temperature that can occur in a simulation. As a rule
449 of thumb, increasing the chain length should lead to smaller
450 oscillations. The keyword {pchain} specifies the number of
451 thermostats in the chain thermostatting the barostat degrees of
454 NOTE: There are alternate ways to thermostat a system of rigid bodies.
455 You can use "fix langevin"_fix_langevin.html to treat the individual
456 particles in the rigid bodies as effectively immersed in an implicit
457 solvent, e.g. a Brownian dynamics model. For hybrid systems with both
458 rigid bodies and solvent particles, you can thermostat only the
459 solvent particles that surround one or more rigid bodies by
460 appropriate choice of groups in the compute and fix commands for
461 temperature and thermostatting. The solvent interactions with the
462 rigid bodies should then effectively thermostat the rigid body
463 temperature as well without use of the Langevin or Nose/Hoover options
464 associated with the fix rigid commands.
468 The {mol} keyword can only be used with the {rigid/small} styles. It
469 must be used when other commands, such as "fix
470 deposit"_fix_deposit.html or "fix pour"_fix_pour.html, add rigid
471 bodies on-the-fly during a simulation. You specify a {template-ID}
472 previously defined using the "molecule"_molecule.html command, which
473 reads a file that defines the molecule. You must use the same
474 {template-ID} that the other fix which is adding rigid bodies uses.
475 The coordinates, atom types, atom diameters, center-of-mass, and
476 moments of inertia can be specified in the molecule file. See the
477 "molecule"_molecule.html command for details. The only settings
478 required to be in this file are the coordinates and types of atoms in
479 the molecule, in which case the molecule command calculates the other
482 Note that these other fixes create new rigid bodies, in addition to
483 those defined initially by this fix via the {bodystyle} setting.
485 Also note that when using the {mol} keyword, extra restart information
486 about all rigid bodies is written out whenever a restart file is
487 written out. See the NOTE in the next section for details.
491 The {infile} keyword allows a file of rigid body attributes to be read
492 in from a file, rather then having LAMMPS compute them. There are 5
493 such attributes: the total mass of the rigid body, its center-of-mass
494 position, its 6 moments of inertia, its center-of-mass velocity, and
495 the 3 image flags of the center-of-mass position. For rigid bodies
496 consisting of point particles or non-overlapping finite-size
497 particles, LAMMPS can compute these values accurately. However, for
498 rigid bodies consisting of finite-size particles which overlap each
499 other, LAMMPS will ignore the overlaps when computing these 4
500 attributes. The amount of error this induces depends on the amount of
501 overlap. To avoid this issue, the values can be pre-computed
502 (e.g. using Monte Carlo integration).
504 The format of the file is as follows. Note that the file does not
505 have to list attributes for every rigid body integrated by fix rigid.
506 Only bodies which the file specifies will have their computed
507 attributes overridden. The file can contain initial blank lines or
508 comment lines starting with "#" which are ignored. The first
509 non-blank, non-comment line should list N = the number of lines to
510 follow. The N successive lines contain the following information:
512 ID1 masstotal xcm ycm zcm ixx iyy izz ixy ixz iyz vxcm vycm vzcm lx ly lz ixcm iycm izcm
513 ID2 masstotal xcm ycm zcm ixx iyy izz ixy ixz iyz vxcm vycm vzcm lx ly lz ixcm iycm izcm
515 IDN masstotal xcm ycm zcm ixx iyy izz ixy ixz iyz vxcm vycm vzcm lx ly lz ixcm iycm izcm :pre
517 The rigid body IDs are all positive integers. For the {single}
518 bodystyle, only an ID of 1 can be used. For the {group} bodystyle,
519 IDs from 1 to Ng can be used where Ng is the number of specified
520 groups. For the {molecule} bodystyle, use the molecule ID for the
521 atoms in a specific rigid body as the rigid body ID.
523 The masstotal and center-of-mass coordinates (xcm,ycm,zcm) are
524 self-explanatory. The center-of-mass should be consistent with what
525 is calculated for the position of the rigid body with all its atoms
526 unwrapped by their respective image flags. If this produces a
527 center-of-mass that is outside the simulation box, LAMMPS wraps it
530 The 6 moments of inertia (ixx,iyy,izz,ixy,ixz,iyz) should be the
531 values consistent with the current orientation of the rigid body
532 around its center of mass. The values are with respect to the
533 simulation box XYZ axes, not with respect to the prinicpal axes of the
534 rigid body itself. LAMMPS performs the latter calculation internally.
536 The (vxcm,vycm,vzcm) values are the velocity of the center of mass.
537 The (lx,ly,lz) values are the angular momentum of the body. The
538 (vxcm,vycm,vzcm) and (lx,ly,lz) values can simply be set to 0 if you
539 wish the body to have no initial motion.
541 The (ixcm,iycm,izcm) values are the image flags of the center of mass
542 of the body. For periodic dimensions, they specify which image of the
543 simulation box the body is considered to be in. An image of 0 means
544 it is inside the box as defined. A value of 2 means add 2 box lengths
545 to get the true value. A value of -1 means subtract 1 box length to
546 get the true value. LAMMPS updates these flags as the rigid bodies
547 cross periodic boundaries during the simulation.
549 NOTE: If you use the {infile} or {mol} keywords and write restart
550 files during a simulation, then each time a restart file is written,
551 the fix also write an auxiliary restart file with the name
552 rfile.rigid, where "rfile" is the name of the restart file,
553 e.g. tmp.restart.10000 and tmp.restart.10000.rigid. This auxiliary
554 file is in the same format described above. Thus it can be used in a
555 new input script that restarts the run and re-specifies a rigid fix
556 using an {infile} keyword and the appropriate filename. Note that the
557 auxiliary file will contain one line for every rigid body, even if the
558 original file only listed a subset of the rigid bodies.
562 If you use a "temperature compute"_compute.html with a group that
563 includes particles in rigid bodies, the degrees-of-freedom removed by
564 each rigid body are accounted for in the temperature (and pressure)
565 computation, but only if the temperature group includes all the
566 particles in a particular rigid body.
568 A 3d rigid body has 6 degrees of freedom (3 translational, 3
569 rotational), except for a collection of point particles lying on a
570 straight line, which has only 5, e.g a dimer. A 2d rigid body has 3
571 degrees of freedom (2 translational, 1 rotational).
573 NOTE: You may wish to explicitly subtract additional
574 degrees-of-freedom if you use the {force} and {torque} keywords to
575 eliminate certain motions of one or more rigid bodies. LAMMPS does
576 not do this automatically.
578 The rigid body contribution to the pressure of the system (virial) is
579 also accounted for by this fix.
583 If your simlulation is a hybrid model with a mixture of rigid bodies
584 and non-rigid particles (e.g. solvent) there are several ways these
585 rigid fixes can be used in tandem with "fix nve"_fix_nve.html, "fix
586 nvt"_fix_nh.html, "fix npt"_fix_nh.html, and "fix nph"_fix_nh.html.
588 If you wish to perform NVE dynamics (no thermostatting or
589 barostatting), use one of 4 NVE rigid styles to integrate the rigid
590 bodies, and "fix nve"_fix_nve.html to integrate the non-rigid
593 If you wish to perform NVT dynamics (thermostatting, but no
594 barostatting), you can use one of the 2 NVT rigid styles for the rigid
595 bodies, and any thermostatting fix for the non-rigid particles ("fix
596 nvt"_fix_nh.html, "fix langevin"_fix_langevin.html, "fix
597 temp/berendsen"_fix_temp_berendsen.html). You can also use one of the
598 4 NVE rigid styles for the rigid bodies and thermostat them using "fix
599 langevin"_fix_langevin.html on the group that contains all the
600 particles in the rigid bodies. The net force added by "fix
601 langevin"_fix_langevin.html to each rigid body effectively thermostats
602 its translational center-of-mass motion. Not sure how well it does at
603 thermostatting its rotational motion.
605 If you with to perform NPT or NPH dynamics (barostatting), you cannot
606 use both "fix npt"_fix_nh.html and the NPT or NPH rigid styles. This
607 is because there can only be one fix which monitors the global
608 pressure and changes the simulation box dimensions. So you have 3
611 Use one of the 4 NPT or NPH styles for the rigid bodies. Use the
612 {dilate} all option so that it will dilate the positions of the
613 non-rigid particles as well. Use "fix nvt"_fix_nh.html (or any other
614 thermostat) for the non-rigid particles. :ulb,l
616 Use "fix npt"_fix_nh.html for the group of non-rigid particles. Use
617 the {dilate} all option so that it will dilate the center-of-mass
618 positions of the rigid bodies as well. Use one of the 4 NVE or 2 NVT
619 rigid styles for the rigid bodies. :l
621 Use "fix press/berendsen"_fix_press_berendsen.html to compute the
622 pressure and change the box dimensions. Use one of the 4 NVE or 2 NVT
623 rigid styles for the rigid bodies. Use "fix nvt"_fix_nh.html (or any
624 other thermostat) for the non-rigid particles. :l
627 In all case, the rigid bodies and non-rigid particles both contribute
628 to the global pressure and the box is scaled the same by any of the
631 You could even use the 2nd and 3rd options for a non-hybrid simulation
632 consisting of only rigid bodies, assuming you give "fix
633 npt"_fix_nh.html an empty group, though it's an odd thing to do. The
634 barostatting fixes ("fix npt"_fix_nh.html and "fix
635 press/berensen"_fix_press_berendsen.html) will monitor the pressure
636 and change the box dimensions, but not time integrate any particles.
637 The integration of the rigid bodies will be performed by fix
642 Styles with a {gpu}, {intel}, {kk}, {omp}, or {opt} suffix are
643 functionally the same as the corresponding style without the suffix.
644 They have been optimized to run faster, depending on your available
645 hardware, as discussed in "Section 5"_Section_accelerate.html
646 of the manual. The accelerated styles take the same arguments and
647 should produce the same results, except for round-off and precision
650 These accelerated styles are part of the GPU, USER-INTEL, KOKKOS,
651 USER-OMP and OPT packages, respectively. They are only enabled if
652 LAMMPS was built with those packages. See the "Making
653 LAMMPS"_Section_start.html#start_3 section for more info.
655 You can specify the accelerated styles explicitly in your input script
656 by including their suffix, or you can use the "-suffix command-line
657 switch"_Section_start.html#start_7 when you invoke LAMMPS, or you can
658 use the "suffix"_suffix.html command in your input script.
660 See "Section 5"_Section_accelerate.html of the manual for
661 more instructions on how to use the accelerated styles effectively.
665 [Restart, fix_modify, output, run start/stop, minimize info:]
667 No information about the 4 NVE rigid styles is written to "binary
668 restart files"_restart.html. The exception is if the {infile} or
669 {mol} keyword is used, in which case an auxiliary file is written out
670 with rigid body information each time a restart file is written, as
671 explained above for the {infile} keyword. For the 2 NVT rigid styles,
672 the state of the Nose/Hoover thermostat is written to "binary restart
673 files"_restart.html. Ditto for the 4 NPT and NPH rigid styles, and
674 the state of the Nose/Hoover barostat. See the
675 "read_restart"_read_restart.html command for info on how to re-specify
676 a fix in an input script that reads a restart file, so that the
677 operation of the fix continues in an uninterrupted fashion.
679 The "fix_modify"_fix_modify.html {energy} option is supported by the 6
680 NVT, NPT, NPH rigid styles to add the energy change induced by the
681 thermostatting to the system's potential energy as part of
682 "thermodynamic output"_thermo_style.html.
684 The "fix_modify"_fix_modify.html {temp} and {press} options are
685 supported by the 4 NPT and NPH rigid styles to change the computes
686 used to calculate the instantaneous pressure tensor. Note that the 2
687 NVT rigid fixes do not use any external compute to compute
688 instantaneous temperature.
690 The 2 NVE rigid fixes compute a global scalar which can be accessed by
691 various "output commands"_Section_howto.html#howto_15. The scalar
692 value calculated by these fixes is "intensive". The scalar is the
693 current temperature of the collection of rigid bodies. This is
694 averaged over all rigid bodies and their translational and rotational
695 degrees of freedom. The translational energy of a rigid body is 1/2 m
696 v^2, where m = total mass of the body and v = the velocity of its
697 center of mass. The rotational energy of a rigid body is 1/2 I w^2,
698 where I = the moment of inertia tensor of the body and w = its angular
699 velocity. Degrees of freedom constrained by the {force} and {torque}
700 keywords are removed from this calculation, but only for the {rigid}
701 and {rigid/nve} fixes.
703 The 6 NVT, NPT, NPH rigid fixes compute a global scalar which can be
704 accessed by various "output commands"_Section_howto.html#howto_15.
705 The scalar value calculated by these fixes is "extensive". The scalar
706 is the cumulative energy change due to the thermostatting and
707 barostatting the fix performs.
709 All of the {rigid} styles (not the {rigid/small} styles) compute a
710 global array of values which can be accessed by various "output
711 commands"_Section_howto.html#howto_15. Similar information about the
712 bodies defined by the {rigid/small} styles can be accessed via the
713 "compute rigid/local"_compute_rigid_local.html command.
715 The number of rows in the array is equal to the number of rigid
716 bodies. The number of columns is 15. Thus for each rigid body, 15
717 values are stored: the xyz coords of the center of mass (COM), the xyz
718 components of the COM velocity, the xyz components of the force acting
719 on the COM, the xyz components of the torque acting on the COM, and
720 the xyz image flags of the COM.
722 The center of mass (COM) for each body is similar to unwrapped
723 coordinates written to a dump file. It will always be inside (or
724 slightly outside) the simulation box. The image flags have the same
725 meaning as image flags for atom positions (see the "dump" command).
726 This means you can calculate the unwrapped COM by applying the image
727 flags to the COM, the same as when unwrapped coordinates are written
730 The force and torque values in the array are not affected by the
731 {force} and {torque} keywords in the fix rigid command; they reflect
732 values before any changes are made by those keywords.
734 The ordering of the rigid bodies (by row in the array) is as follows.
735 For the {single} keyword there is just one rigid body. For the
736 {molecule} keyword, the bodies are ordered by ascending molecule ID.
737 For the {group} keyword, the list of group IDs determines the ordering
740 The array values calculated by these fixes are "intensive", meaning
741 they are independent of the number of atoms in the simulation.
743 No parameter of these fixes can be used with the {start/stop} keywords
744 of the "run"_run.html command. These fixes are not invoked during
745 "energy minimization"_minimize.html.
751 These fixes are all part of the RIGID package. It is only enabled if
752 LAMMPS was built with that package. See the "Making
753 LAMMPS"_Section_start.html#start_3 section for more info.
755 Assigning a temperature via the "velocity create"_velocity.html
756 command to a system with "rigid bodies"_fix_rigid.html may not have
757 the desired outcome for two reasons. First, the velocity command can
758 be invoked before the rigid-body fix is invoked or initialized and the
759 number of adjusted degrees of freedom (DOFs) is known. Thus it is not
760 possible to compute the target temperature correctly. Second, the
761 assigned velocities may be partially canceled when constraints are
762 first enforced, leading to a different temperature than desired. A
763 workaround for this is to perform a "run 0"_run.html command, which
764 insures all DOFs are accounted for properly, and then rescale the
765 temperature to the desired value before performing a simulation. For
768 velocity all create 300.0 12345
769 run 0 # temperature may not be 300K
770 velocity all scale 300.0 # now it should be :pre
774 "delete_bonds"_delete_bonds.html, "neigh_modify"_neigh_modify.html
775 exclude, "fix shake"_fix_shake.html
779 The option defaults are force * on on on and torque * on on on,
780 meaning all rigid bodies are acted on by center-of-mass force and
781 torque. Also Tchain = Pchain = 10, Titer = 1, Torder = 3.
786 [(Hoover)] Hoover, Phys Rev A, 31, 1695 (1985).
789 [(Kamberaj)] Kamberaj, Low, Neal, J Chem Phys, 122, 224114 (2005).
792 [(Martyna)] Martyna, Klein, Tuckerman, J Chem Phys, 97, 2635 (1992);
793 Martyna, Tuckerman, Tobias, Klein, Mol Phys, 87, 1117.
796 [(Miller)] Miller, Eleftheriou, Pattnaik, Ndirango, and Newns,
797 J Chem Phys, 116, 8649 (2002).
800 [(Zhang)] Zhang, Glotzer, Nanoletters, 4, 1407-1413 (2004).