Define molecule ID

Hello there,

I am working on ‘fix shake’ on molecules.

in.square (1.5 KB) (149.4 KB)

I think the molecules were created in my file through file but the ‘fix shake’ is not working. In addition, I also fixed them with ‘rigid/small’ which is supposed to allow shake according to the description, however it is still show the same error message below.

Cannot use fix shake with non-molecular system (…/fix_shake.cpp:74)

I assume the molecule should be defined through ‘molecule’ again.
Could you please give an advice on

  1. how to define the molecule ID?
  2. how to correct the line for ‘fix shake’ in the attached?

Thank you!

The “sphere” atom style cannot define bonds, and therefore cannot define molecules. You’ll want to use the “bpm/sphere” atom style, and for that you’ll need to rewrite/edit the data file with a molecule ID column added after the atom ID column. See the atom_style documentation.

How did you initially create the data file?

Granted, this advice will work for the technical issues you’re facing, but I can’t say much on whether this is scientifically sound.

Thank you for your prompt reply!

I would change the input file as you recommend.

For the input file, I create the data file with my own codes.

The SHAKE algorithm works on explicit bonds (and angles) to maintain them at a predefined length, so molecule IDs are irrelevant in this regard. They are just some kind of label that can be used to group atoms. Fix rigid treats groups of atoms as rigid bodies by storing the relative geometry, derive center of mass force and torque from the atomic forces and then does time integration of the bodies’ center of mass translation and rotation around the center of mass (and then generate atom positions and velocities from that information).

Adding molecule IDs with fix property/atom does not make your system a “molecular system”. For that you need a “real” bond topology.