85
85
Treat one or more sets of atoms as independent rigid bodies. This
86
86
means that each timestep the total force and torque on each rigid body
87
87
is computed as the sum of the forces and torques on its constituent
88
particles and the coordinates, velocities, and orientations of the
89
atoms in each body are updated so that the body moves and rotates as a
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 large colloidal particle, or
93
portions of a large biomolecule such as a protein.
92
Examples of large rigid bodies are a colloidal particle, or portions
93
of a biomolecule such as a protein.
95
95
Example of small rigid bodies are patchy nanoparticles, such as those
96
96
modeled in "this paper"_#Zhang by Sharon Glotzer's group, clumps of
165
165
setforce"_fix_setforce.html command), and integrating them as usual
166
166
(e.g. via the "fix nve"_fix_nve.html command).
168
IMPORTANT NOTE: The aggregate properties of each rigid body are
169
calculated at the start of each simulation run. These include its
170
center of mass, moments of inertia, and net velocity and angular
171
momentum. This means that before or between runs, per-atom properties
172
can be changed, e.g. via the "set"_set.html or
173
"velocity"_velocity.html command, which will affect the bodies. An
174
exception is if the {infile} keyword is used, then all the body
175
properties (except net velocity and angular momentum) are only
176
calculated once so that values from the file are valid.
170
180
Each rigid body must have two or more atoms. An atom can belong to at
542
552
The rigid body contribution to the pressure of the system (virial) is
543
553
also accounted for by this fix.
545
IMPORTANT NOTE: The periodic image flags of atoms in rigid bodies are
546
altered so that the rigid body can be reconstructed correctly when it
547
straddles periodic boundaries. The atom image flags are not
548
incremented/decremented as they would be for non-rigid atoms as the
549
rigid body crosses periodic boundaries. Specifically, they are set so
550
that the center-of-mass (COM) of the rigid body always remains inside
553
This means that if you output per-atom image flags you cannot
554
interpret them as you normally would. I.e. the image flag values
555
written to a "dump file"_dump.html will be different than they would
556
be if the atoms were not in a rigid body. Likewise the "compute
557
msd"_compute_msd.html will not compute the expected mean-squared
558
displacement for such atoms if the body moves across periodic
559
boundaries. It also means that if you have bonds between a pair of
560
rigid bodies and the bond straddles a periodic boundary, you cannot
561
use the "replicate"_replicate.html command to increase the system
564
Here are details on how, you can post-process a dump file to calculate
565
a diffusion coefficient for rigid bodies, using the altered per-atom
566
image flags written to a dump file. The image flags for atoms in the
567
same rigid body can be used to unwrap the body and calculate its
568
center-of-mass (COM). As mentioned above, this COM will always be
569
inside the simulation box. Thus it will "jump" from one side of the
570
box to the other when the COM crosses a periodic boundary. If you
571
keep track of the jumps, you can effectively "unwrap" the COM and use
572
that value to track the displacement of each rigid body, and thus the
573
mean-squared displacement (MSD) of an ensemble of bodies, and thus a
574
diffusion coefficient.
576
Note that fix rigid does define image flags for each rigid body, which
577
are incremented when the center-of-mass of the rigid body crosses a
578
periodic boundary in the usual way. These image flags have the same
579
meaning as atom images (see the "dump" command) and can be accessed
580
and output as described below.
584
557
If your simlulation is a hybrid model with a mixture of rigid bodies
642
Styles with a {cuda}, {gpu}, {omp}, or {opt} suffix are functionally
643
the same as the corresponding style without the suffix. They have
644
been optimized to run faster, depending on your available hardware, as
645
discussed in "Section_accelerate"_Section_accelerate.html of the
646
manual. The accelerated styles take the same arguments and should
647
produce the same results, except for round-off and precision issues.
615
Styles with a {cuda}, {gpu}, {intel}, {kk}, {omp}, or {opt} suffix are
616
functionally the same as the corresponding style without the suffix.
617
They have been optimized to run faster, depending on your available
618
hardware, as discussed in "Section_accelerate"_Section_accelerate.html
619
of the manual. The accelerated styles take the same arguments and
620
should produce the same results, except for round-off and precision
649
These accelerated styles are part of the USER-CUDA, GPU, USER-OMP and OPT
650
packages, respectively. They are only enabled if LAMMPS was built with
651
those packages. See the "Making LAMMPS"_Section_start.html#start_3
652
section for more info.
623
These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL,
624
KOKKOS, USER-OMP and OPT packages, respectively. They are only
625
enabled if LAMMPS was built with those packages. See the "Making
626
LAMMPS"_Section_start.html#start_3 section for more info.
654
628
You can specify the accelerated styles explicitly in your input script
655
629
by including their suffix, or you can use the "-suffix command-line
708
682
is 15. Thus for each rigid body, 15 values are stored: the xyz coords
709
683
of the center of mass (COM), the xyz components of the COM velocity,
710
684
the xyz components of the force acting on the COM, the xyz components
711
of the torque acting on the COM, and the xyz image flags of the COM,
712
which have the same meaning as image flags for atom positions (see the
713
"dump" command). The force and torque values in the array are not
714
affected by the {force} and {torque} keywords in the fix rigid
715
command; they reflect values before any changes are made by those
685
of the torque acting on the COM, and the xyz image flags of the COM.
687
The center of mass (COM) for each body is similar to unwrapped
688
coordinates written to a dump file. It will always be inside (or
689
slightly outside) the simulation box. The image flags have the same
690
meaning as image flags for atom positions (see the "dump" command).
691
This means you can calculate the unwrapped COM by applying the image
692
flags to the COM, the same as when unwrapped coordinates are written
695
The force and torque values in the array are not affected by the
696
{force} and {torque} keywords in the fix rigid command; they reflect
697
values before any changes are made by those keywords.
718
699
The ordering of the rigid bodies (by row in the array) is as follows.
719
700
For the {single} keyword there is just one rigid body. For the
736
717
LAMMPS was built with that package. See the "Making
737
718
LAMMPS"_Section_start.html#start_3 section for more info.
720
Assigning a temperature via the "velocity create"_velocity.html
721
command to a system with "rigid bodies"_fix_rigid.html may not have
722
the desired outcome for two reasons. First, the velocity command can
723
be invoked before the rigid-body fix is invoked or initialized and the
724
number of adjusted degrees of freedom (DOFs) is known. Thus it is not
725
possible to compute the target temperature correctly. Second, the
726
assigned velocities may be partially canceled when constraints are
727
first enforced, leading to a different temperature than desired. A
728
workaround for this is to perform a "run 0"_run.html command, which
729
insures all DOFs are accounted for properly, and then rescale the
730
temperature to the desired value before performing a simulation. For
733
velocity all create 300.0 12345
734
run 0 # temperature may not be 300K
735
velocity all scale 300.0 # now it should be :pre
739
737
[Related commands:]
741
739
"delete_bonds"_delete_bonds.html, "neigh_modify"_neigh_modify.html
740
exclude, "fix shake"_fix_shake.html