Center of mass correction
Added in version 3.17.0.
This modifier removes the center-of-mass drift from a particle trajectory. At each frame of the trajectory, it translates the particles – and any other spatial data objects, such as surface meshes, voxel grids, or dislocation lines – such that the current center of mass of the particles coincides with the center of mass computed at a fixed reference frame of the trajectory (typically the first frame). The simulation cell is left in place, so that the particles’ center of mass is corrected relative to the cell.
Removing the drift is useful, for example, when the simulated system as a whole slowly migrates through space during a molecular dynamics simulation. Such a drift would otherwise obscure the local motion of the particles or interfere with time-averaged analyses. It can also be a necessary correction step when computing diffusion coefficients.
Caution
Make sure the particle trajectories are unwrapped before applying this modifier.
The modifier computes the center of mass from the particle coordinates as they are, without unwrapping them. For a trajectory with wrapped particle coordinates, i.e., where particles are folded back into the simulation cell at periodic boundaries, this yields incorrect results. In that case, first insert the Unwrap trajectories modifier into the pipeline to make the particle trajectories continuous.
Mass weighting
The modifier computes the center of mass from the particle coordinates, weighting them with the following mass information, in order of precedence:
The per-particle
Massproperty, if present.The masses of the particle types, if at least one particle type has a positive mass.
Otherwise, all particles are weighted equally, and the modifier computes the geometric center instead.
Parameters
- Reference frame number
The trajectory frame at which the reference center of mass is computed. At this frame, the modifier leaves the system unchanged; at all other frames, the system is translated such that its center of mass matches the one computed at the reference frame.
- Use only selected particles
Restricts the center-of-mass calculation to the currently selected particles. Note that the resulting translation is still applied to the entire dataset, including unselected particles. This option is useful, for example, to keep a substrate or a molecule of interest fixed in space.
Output attributes
The modifier outputs both centers of mass as global attributes:
CenterOfMassCorrection.referenceThe center of mass of the particles at the reference frame (xyz coordinates).
CenterOfMassCorrection.currentThe center of mass of the particles at the current frame, before the correction is applied. The translation applied by the modifier is the difference between the two positions, i.e.,
CenterOfMassCorrection.referenceminusCenterOfMassCorrection.current.
See also
ovito.modifiers.CenterOfMassCorrectionModifier(Python API)Align Molecule extension for OVITO Pro
Affine transformation modifier
Unwrap trajectories modifier