compute rigid/atom command
Syntax
compute ID group-ID rigid/atom rigidID input1 input2 ...
ID, group-ID are documented in compute command
rigid/atom = style name of this compute command
rigidID = ID of fix rigid/small command or one of its variants
input = one or more rigid body attributes
possible attributes = id, mol, mass, x, y, z, xu, yu, zu, ix, iy, iz, vx, vy, vz, omegax, omegay, omegaz, quatw, quati, quatj, quatk, inertiax, inertiay, inertiazid = atom ID of atom within body which owns body properties mol = molecule ID used to define body in fix rigid/small command mass = total mass of body x,y,z = center of mass coords of body xu,yu,zu = unwrapped center of mass coords of body ix,iy,iz = box image that the center of mass is in vx,vy,vz = center of mass velocities omegax,omegay,omegaz = angular velocity of body quatw,quati,quatj,quatk = quaternion components for body inertiax,inertiay,inertiaz = diagonalized moments of inertia of body
Examples
compute 1 all rigid/atom myRigid mol x y z
Description
Added in version TBD.
Define a calculation that stores one or more rigid-body values with each atom in rigid bodies defined by the fix rigid/small command or one of its NVE, NVT, NPT, NPH variants. Each atom in a particular body will store the same data. This can be useful when creating a dump file for post-analyses or visualizations, e.g. to color each atom based on a property of the rigid body it belongs to. See the compute rigid/local command for how to output only one copy of each rigid body’s information.
Note that this command only works with the fix rigid/small command or its variants, not the fix rigid command and its variants. The ID of the fix rigid/small command used to define rigid bodies must be specified as rigidID. The fix rigid command is typically used to define a handful of (potentially very large) rigid bodies. It outputs similar per-body information as this command directly from the fix as global data; see the fix rigid page for details.
The values generated by this compute will be 0.0 for atoms not in the specified compute group group-ID or not in a rigid body.
Here is an example of how to use this compute to dump rigid body info with each atom to a file:
compute 1 all rigid/atom myRigid mol x y z fx fy fz
dump 1 all custom 1000 tmp.dump id c_1[*]
This section explains the rigid body attributes that can be specified.
The id attribute is the atom-ID of the atom which owns the rigid body, which is assigned by the fix rigid/small command.
The mol attribute is the molecule ID of the rigid body. It should be the molecule ID which all of the atoms in the body belong to, since that is how the fix rigid/small command defines its rigid bodies.
The mass attribute is the total mass of the rigid body.
There are two options for outputting the coordinates of the center of mass (COM) of the body. The x, y, z attributes write the COM “unscaled”, in the appropriate distance units (\(\AA\), \(\sigma\), etc). Use xu, yu, zu if you want the COM “unwrapped” by the image flags for each body. Unwrapped means that if the body COM has passed through a periodic boundary one or more times, the value is generated what the COM coordinate would be if it had not been wrapped back into the periodic box.
The image flags for the body can be generated directly using the ix, iy, iz attributes. For periodic dimensions, they specify which image of the simulation box the COM is considered to be in. An image of 0 means it is inside the box as defined. A value of 2 means add 2 box lengths to get the true value. A value of \(-1\) means subtract 1 box length to get the true value. LAMMPS updates these flags as the rigid body COMs cross periodic boundaries during the simulation.
The vx, vy, vz attributes are components of the COM velocity of the body.
The omegax, omegay, and omegaz attributes are the angular velocity components of the body in the system frame around its COM.
The quatw, quati, quatj, and quatk attributes are the components of the 4-vector quaternion representing the orientation of the rigid body. See the set command for an explanation of the quaternion vector.
The inertiax, inertiay, inertiaz attributes are components of diagonalized inertia tensor for the body (i.e., the three moments of inertia for the body around its principal axes), as computed internally by LAMMPS.
Note
Unlike the compute rigid/local command, this command does not provide options for the total force, torque, and angular momentum vectors of the rigid bodies. This is because this information is not communicated by the fix rigid/small command so that each atom in a body has access to that information.
Output info
This compute calculates a per-atom vector or array depending on the number of keywords. If a single keyword is specified, a per-atom vector is produced. If two or more keywords are specified, a per-atom array is produced where the number of columns = the number of keywords. The vector or array can be accessed by any command that uses per-atom values from a compute as input. See the Howto output page for an overview of LAMMPS output options.
The vector or array values will be in whatever units the corresponding attribute is in:
id,mol = unitless
mass = mass units
x,y,z and xu,yu,zu = distance units
ix,iy,iz = unitless
vx,vy,vz = velocity units
omegax,omegay,omegaz = radians/time units
quatw,quati,quatj,quatk = unitless
inertiax,inertiay,inertiaz = mass*distance\(^2\) units
Restrictions
This compute is part of the RIGID package. It is only enabled if LAMMPS was built with that package. See the Build package page for more info.
Default
none