fix gcmc and fix rigid, can or cannot be used simultaneously?

Dear LAMMPS developers,

I have a question about using fix gcmc with a system containing a large number of rigid aromatic rings, which I did not find the specific answer from the lammps mailing list.

In the LAMMPS manual of fix gcmc, there is a statement “Because molecule insertion does not work in combination with fix rigid, simultaneous use of fix rigid or fix rigid/small with this fix is not allowed.” My question is, if my simulation does not contain molecule insertion (I only have atom insertion/deletion), can I run the simulation with fix rigid or fix rogid/small with fix gcmc?

I tested the simulation that uses fix rigid and fix gcmc simultaneously. The simulation run without giving any error, though I expected there would be according to the LAMMPS manual. I then checked fix_gcmc.cpp, and did not find any error check related to fix rigid. Could anyone please help me figure out the reason?

Thanks,
Jibao

Dear LAMMPS developers,

I have a question about using fix gcmc with a system containing a large
number of rigid aromatic rings, which I did not find the specific answer
from the lammps mailing list.

In the LAMMPS manual of fix gcmc, there is a statement "Because molecule
insertion does not work in combination with fix rigid, simultaneous use of
fix rigid or fix rigid/small with this fix is not allowed." My question is,
if my simulation does not contain molecule insertion (I only have atom
insertion/deletion), can I run the simulation with fix rigid or fix
rogid/small with fix gcmc?

aidan will have to comment on that.

I tested the simulation that uses fix rigid and fix gcmc simultaneously. The
simulation run without giving any error, though I expected there would be
according to the LAMMPS manual. I then checked fix_gcmc.cpp, and did not
find any error check related to fix rigid. Could anyone please help me
figure out the reason?

that means that your LAMMPS version is older than 2016-05-25 when this
check was added.
please note that the online manual always reflects the very latest
patch level of LAMMPS.
a summary of the most important changes between patches can be found
here: http://lammps.sandia.gov/bug.html

axel.

Dear Axel,

Thank you for your answer! On the download page of lammps http://lammps.sandia.gov/download.html, the latest version I can find is 14 May 2016. Could you please tell me where I can find the URL for downloading the real latest version?

Thanks,
Jibao

Dear Axel,

Thank you for your answer! On the download page of lammps
http://lammps.sandia.gov/download.html, the latest version I can find is 14
May 2016. Could you please tell me where I can find the URL for downloading
the real latest version?

the very latest version is called "Development Version",
or you can download/update the source via git or svn

axel.

http://lammps.sandia.gov/tars/lammps.tar.gz

Joshua, thank you!

Aidan, could you please comment on my first question?

if my simulation does not contain molecule insertion (I only have atom
insertion/deletion), can I run the simulation with fix rigid or fix
rogid/small with fix gcmc?

Thanks,
Jibao

The underlying issue is that atom or molecule insertions and deletions executed by fix gcmc do not take in to account the existence of rigid constraints, except those implemented using fix shake. In principle, it would be fine to run fix gcmc with fix rigid, as long as the two fixes are applied to groups that have no atoms in common. In practice, there is no easy way to check that, so we have imposed a blanket ban on the use of any variant of fix rigid in any simulation with fix gcmc. If you know what you are doing, you can go in to fix_gcmc.cpp and comment out this block of code:

for (int irigid = 0; irigid < modify->nfix; irigid++) {
if (strncmp(modify->fix[irigid]->style,“rigid”,5) == 0)
error->all(FLERR,“Fix gcmc can not currently be used with any rigid fix”);
}

Aidan

Dear Aidan,

Thank you for your answer!
As I know, I cannot use fix shake for the rigid aromatic rings. So I have to use the fix rigid in my simulation.

The following are the three lines in my previous input script for the fix gcmc used with fix nvt, which perform simulations in the grand canonical ensemble:
fix 1 all gcmc 1 20 0 1 973145 298 {Pin} 0.0 pressure {Pin}

fix 2 notring nve temp $T T {Tdamp}
fix 3 ring rigid/nvt/small single

As you said, “In principle, it would be fine to run fix gcmc with fix rigid, as long as the two fixes are applied to groups that have no atoms in common”. So, instead of applying fix gcmc to the group all, can I just apply fix gcmc to the group that does not contain any rigid bodies to insure that the two fixes are applied to groups that have no atoms in common? (I’m not sure whether it makes sense for a grand canonical ensemble simulation in which fix gcmc is applied to part of the atoms in the system, while fix nvt is applied to the whole system.)

Thanks,
Jibao

I think I got it. Thanks

Well, there will always be issues when you combine MC and MD. But there is no point trying to do MC on the molecules that are handled by fix rigid/nvt/small. So, you should be fine doing MC only on type 1 atoms. It is good practice to make this atom type a separate group and use that group in the fix gcmc command.

Aidan

Dear Aidan,
Thank you!
Jibao