Fix rigid command

Hi,

I am simulating a system that needs to be partially rigid. The rigid part is connected to the non-rigid part. When I use “fix rigid/npt” command for rigid part and then “fix npt” command for the non-rigid part, it gives an error (nan values). But when I use “fix rigid” for rigid part and “fix npt” for both rigid and non-rigid parts, it runs; however, I am not sure it is correct or not because it gives warning.

Also, I have a similar question about NVE ensemble.

I would be thankful if you make your comments about this issue?

Best

Hi,

I am simulating a system that needs to be partially rigid. The rigid part is

rigid or immobile? from your description it almost sounds as if you
want the second, not the first.

connected to the non-rigid part. When I use "fix rigid/npt" command for
rigid part and then "fix npt" command for the non-rigid part, it gives an
error (nan values). But when I use "fix rigid" for rigid part and "fix npt"

yes. you cannot have two fixes at the same time change your simulation
cell. that will create a mess. it is well documented, too.

for both rigid and non-rigid parts, it runs; however, I am not sure it is
correct or not because it gives warning.

what *is* the warning?

Also, I have a similar question about NVE ensemble.

what *is* the similar question?

I would be thankful if you make your comments about this issue?

first you have to provide us with sufficient information. then we can
see. please also check the mailing list archives. what you have asked
so far is something that is rather frequently asked (and answered).

axel.

This was discussed on this list a few months ago, and the documentation explains it clearer than I could:

"

If you with to perform NPT or NPH dynamics (barostatting), you cannot use both fix npt and fix rigid/npt (or the nph variants). This is because there can only be one fix which monitors the global pressure and changes the simulation box dimensions. So you have 3 choices:

  • Use fix rigid/npt for the rigid bodies. Use the dilate all option so that it will dilate the positions of the non-rigid particles as well. Use fix nvt (or any other thermostat) for the non-rigid particles.
  • Use fix npt for the group of non-rigid particles. Use the dilate all option so that it will dilate the center-of-mass positions of the rigid bodies as well. Use fix rigid/nvt for the rigid bodies.
  • Use fix press/berendsen to compute the pressure and change the box dimensions. Use fix rigid/nvt for the rigid bodies. Use fix nvt (or any other thermostat) for the non-rigid particles.

In all case, the rigid bodies and non-rigid particles both contribute to the global pressure and the box is scaled the same by any of the barostatting fixes.

You could even use the 2nd and 3rd options for a non-hybrid simulation consisting of only rigid bodies, assuming you give fix npt an empty group, though it’s an odd thing to do. The barostatting fixes (fix npt and fix press/berensen) will monitor the pressure and change the box dimensions, but not time integrate any particles. The integration of the rigid bodies will be performed by fix rigid/nvt.

"

Dear Stefan,

Thank you very much for your clear explanations. They are very helpful. But I was doing the same thing (choice 1) as you mentioned except I did not use the “dilate” option; however, I set the pressure to zero. With this option, it still does not work (gives NAN).

Here is the command I am using:

fix g1 rigidPart rigid/npt single temp 300 300 0.1 iso 0.0 0.0 0.1 dilate all
fix g2 nonRigidPart npt temp 300 300 0.1 iso 0.0 0.0 0.1

Please let me know about your comments.
Best

Dear Stefan,

Thank you very much for your clear explanations. They are very helpful. But
I was doing the same thing (choice 1) as you mentioned except I did not use
the "dilate" option; however, I set the pressure to zero. With this option,
it still does not work (gives NAN).

Here is the command I am using:

fix g1 rigidPart rigid/npt single temp 300 300 0.1 iso 0.0 0.0 0.1 dilate
all
fix g2 nonRigidPart npt temp 300 300 0.1 iso 0.0 0.0 0.1

Please let me know about your comments.

you are *not* using option 1. you *still* have two fixes (rigid/npt
and npt) that want to dynamically change the cell dimensions. setting
the target pressure to 0.0 doesn't turn it off. option 1 uses fix
_nvt_ instead of _npt_. please study the documentation more carefully.

axel.

Dear Axel,

Thanks for your response. Even with NVT, it does not work ? I am using the following command:

fix g1 rigidPart rigid/npt single temp 300 300 0.1 iso 0.0 0.0 0.1 dilate all
fix g2 nonRigidPart nvt temp 300 300 0.1

Thanks

Dear Axel,

Thanks for your response. Even with NVT, it does not work ? I am using the following command:

fix g1 rigidPart rigid/npt single temp 300 300 0.1 iso 0.0 0.0 0.1 dilate all
fix g2 nonRigidPart nvt temp 300 300 0.1

Thanks

This will work, but how can we know that you don’t have similar blunders elsewhere? As I already mentioned in a previous response, you don’t provide enough information.

Dear Axel,

I am attaching my input file. Hopefully, this information is enough. Please let me know what you think?

Best

Dear Axel,

I am attaching my input file. Hopefully, this information is enough. Please
let me know what you think?

i don't see any glaring mistakes. some of your settings are fairly
aggressive, and it would be easier to debug, if it wasn't so
convoluted and had only the absolute required parts in it. but whether
the settings are a problem depends very much on the specific system.
more likely your problem is due to a bad initial configuration in the data file.

you also mentioned that you get warnings, yet you failed to tell us
what they are?

axel.

That warning was for doing the integration two times for a specific group and now is removed. I attached my output. I am also suspicious about the configuration. I am attaching a figure showing my configuration ?

Best

LAMMPS (1 Feb 2014)
Reading data file …
orthogonal box = (0 0 0) to (32.586 32.586 65.172)
3 by 2 by 2 MPI processor grid
reading atoms …
1984 atoms
reading velocities …
1984 velocities
1728 atoms in group slab
256 atoms in group pillar
1 rigid bodies with 256 atoms
Setting up run …
Memory usage per processor = 3.54322 Mbytes
Step Temp Press Volume PotEng KinEng TotEng
0 299.48236 28763.191 69202.718 -8174.491 66.93155 -8107.5594
10 -nan -nan -nan -nan -nan -nan
20 -nan -nan -nan -nan -nan -nan
30 -nan -nan -nan -nan -nan -nan
40 -nan -nan -nan -nan -nan -nan

Config.PNG

Hi Hossein,

because there’s only one rigid body in your particular system, the fluctuations in the “energy” of the barostat and its associated thermostat chains can be large, causing big variations in the box dimensions. The fix rigid variants (rigid nvt/npt/nph) should behave well when there are a sufficiently large number of rigid bodies in the group.

For your system, I would suggest you use fix rigid for the rigid body and fix npt for the rest of the system. You can use the langevin option in fix rigid to turn on the Langevin thermostat coupled with the body, but I suppose that it doesn’t matter to the system temperature once the whole system is well equilibrated.

Cheers,
-Trung