[lammps-users] question about fix shake command

Dear all,

We now have a question about “fix shake”. We want to fix the shape of H3O molecule. It has three O-H bonds and three H-O-H angles. We use
fix 5 water_h3o shake 0.0001 20 0 b 26 a 71

26 is the O-H bond and 71 is the H-O-H angle.

We found it seemed that only the bond length is fixed, while the angles deformed.

In LAMMPS manual, it says

“A cluster is defined as a central atom connected to others in the cluster by constrained bonds. LAMMPS allows for the following kinds of clusters to be constrained: one central atom bonded to 1 or 2 or 3 atoms, or one central atom bonded to 2 others and the angle between the 3 atoms also constrained.”

Does this mean only three variables can be constrained at the same time? So in our case, the constraint to the angles does not work at all.

Or if we want to constrain this molecule purely by bonds(three O-H bonds and three H-H bonds), would this command work?

Most appreciated for your help.

Best

LAMMPS allows for the following kinds of clusters to
be constrained: one central atom bonded to 1 or 2 or 3 atoms, or one central
atom bonded to 2 others and the angle between the 3 atoms also constrained."

For H30 you could constrain the 3 OH bonds, since that meets the above
criteria, but nothing else. If you want a fully rigid H3O molecule, then
you can use fix rigid.

Steve

As my understanding, the fix rigid can fix the defined groups as one rigid body individually. If I want fix every H3O molecule as one rigid body and there are many H3O molecules in the system, can the “fix rigid” work? I don’t think I can define so many groups in LAMMPS. Thanks for your reply.

Yajie

You can define molecules as rigid bodies with fix rigid.

Steve

You can define molecules as rigid bodies with fix rigid.

it may still be more efficient to implement 3x3 (3 atom triangle shaped)
and 4x6 (4 atom pyriamid shaped) analytical constraints for water molecules
and methyl groups, respectively. the latter might also work for the hydronium
case of the original poster.

i don't have time to look into this personally, but if somebody on this list
is looking for a way to make a lot of people happy, this would be one option.
i know a fortran 95 code that has both implemented and can probably also
dig out some references.

cheers,
    axel.

Thanks for your reply, Steve and Axel.

Axel, can you please tell me where I can find the fortran 95 code you mentioned?

Most appreciate.

Best
Yajie

Thanks for your reply, Steve and Axel.

Axel, can you please tell me where I can find the fortran 95 code you
mentioned?

http://cvs.berlios.de/cgi-bin/viewvc.cgi/cp2k/cp2k/src/constraint_3x3.F?view=markup

and

http://cvs.berlios.de/cgi-bin/viewvc.cgi/cp2k/cp2k/src/constraint_4x6.F?view=markup

enjoy,
   axel.

If you want to implement more many-body SHAKE constraints,
then more power to you, but you'll need to do quite a bit more
than just add a routine to calculate the constraint. Most of the
logic in fix shake is to find and identify and store the clusters
and insure they have a valid topology. All of that is somewhat
tricky in parallel.

Steve