Using both fix shake and fix rigid simultaneously

Hi,

I want to simulate the diffusion of rigid CO2 and H2O molecules in MOF. As far as I know, fix shake is the best choice for H2O, but it cannot be applied to linear molecules like CO2. Therefore, I need to use fix rigid to control the geometry of CO2. My question is, can these two constraint methods be used at the same time? Or should I better use only fix rigid for both types of molecules?

Thank you very much.

Yifei

Yes, they are compatible. Please note that fix rigid/small includes time integration while fix shake does not.

Thank you very much.

Hope it’s okay, I wanted to ask a follow up question.

If I wanted to run a simulation at constant NPT simulation with both rigid CO2 and shake H2O how do I set the fix commands for both molecule types? As far as I can tell it’s only allowed to have one fix command that can change the volume of the system.

This is discussed near the bottom of the fix rigid documentation: fix rigid command — LAMMPS documentation

1 Like

That is exactly what I needed! Thank you for the very helpful and speedy reply!