Widom insertion of molecules with full_energy option

Hi folks-

I will preface this post by saying that I am running the 15 Jun 2023 version of LAMMPS.

I’m currently trying to calculate the Henry’s Law constant for insertion of a small molecule into a polymer system using the fix widom command. I’m using a force field with long-range electrostatics, PCFF, which means that the full_energy option is needed by the fix.

When I’ve tried to run the fix using this option with my molecule template set up correctly, I get the following error:
Fix widom does currently not support full_energy option with molecules on more than 1 MPI process.
Reading the fix_widom.cpp file in the source code, it says shortly before the error check in a comment that the full_energy implementation is broken on more than one MPI process. Looking further at the attempt_molecule_insertion_full() function, I see that there are several lines of code which seem to reference the MPI implementation.

My question is, what is the current issue with the parallel implementation of the full energy calculation is and is there a way that it could be corrected? Based on the LAMMPS documentation it seems that the fact that we have to do a kspace calculation is what is problematic, but we can do this in parallel normally during regular MD.

I have read some of the other posts on this site about the MPI for fix_gcmc not working well for molecules on translation/rotation moves but being okay for insertion moves, so I’m curious if there is a fix that could be applied in this situation with purely insertion MC moves.

Thank you so much!

The problem is that reverting insertions is not reliable when molecules are inserted in such a way that they cross sub-domain boundaries. The way to resolve this would be a complete redesign of the fix (which is a modification of fix gcmc, so it is really fix gcmc that should be redesigned). This goes back to the original implementation that only supported atoms (for diffusion of noble gases in zeolites) that was later gradually expanded and modified to also support charged particles and then molecules via molecule files. For a simple non-charged LJ particles, the MC step is simple since the energy difference can be computed for a single particle and its neighbors. That got more complicated when using long-range electrostatics, where the whole force calculation including kspace needed to be repeated for the before and after state.

1 Like

Hi Axel-

This got lost in the fray for me - but I just wanted to thank you for getting back to me on this with such a detailed response. Perhaps in the future making these changes is something I might try to work on myself.