Displacement with setforce zero in gcmc

I am running grand canonical monte carlo for water adsorption in zeolite with gcmc fix and I am freezing zeolite with setforce command.

Looking at the trajectory with ASE and VMD I see change in zeolite. The change seem to be shifts of coordinate system. When I run nvt instead of gcmc zeolite is frozen as it should be.

Is there an additional command required to avoid motion in gcmc ?

Does origin of reference frame change during gcmc ?

Input

timestep 1.0
group si type 3 4 5 6 7 8 9
group water type 1 2
fix freezeSi si setforce 0.0 0.0 0.0

molecule watmol watmol.txt

– energy minimization –

minimize 1e-30 1e-35 20000 2000000

– nvt / frozen coordinates don’t move –

velocity si set 0.0 0.0 0.0
velocity water create 300 5463576
fix fxnvt water nvt temp 300.0 300.0 10.0
run 1000

– gcmc / frozen coordinates move –

velocity si set 0.0 0.0 0.0
velocity water create 300 5463576
compute mdtemp water temp
compute_modify mdtemp dynamic/dof yes
fix fxnvt water nvt temp 300.0 300.0 10.0
fix_modify fxnvt temp mdtemp
fix fxmuvt water gcmc 10 100 100 0 29494 300.0 0.0 0.01 pressure 0.01 mol watmol
run 1000

watmol.txt (317 Bytes)

system.in.settings (1022 Bytes)

system.in.init (196 Bytes)

system.data (3.8 KB)

run.in (943 Bytes)

This is a confusing statement. Your input example does use nvt. So what are you switching from?
Please explain more cleanly (e.g. by showing “before” and “after” inputs). what gives the expected and what produces the unexpected result.

When I don’t use gcmc the frozen coordinates don’t move as expected.

We need something more tangible to actually reproduce this.
Unless the documentation explicitly says something else, a fix is only supposed to act on the atoms in the fix group.

This is not sufficient proof. It could just be a visualization artefact.

Looking at lammpstrj with dumped x y z ix iy iz coordinates I see clear changes showing that frozen atoms cross boundaries. Visualizing this it seems as if the structure is the same but randomly shifting a bit as a whole.

That can only be caused by commands other than fix gcmc.

Again, without the means to reproduce this cleanly and easily and only based on anecdotal evidence, it is not possible to properly diagnose this and suggest a remedy.

Thanks for the hints.

I uploaded a minimal reproducible example.

Thank you. That allowed me to identify the cause of the issue: you don’t assign a non-zero molecule ID to the water molecule in your data file. That messes up the logic for applying the same translations to all atoms with the same molecule ID. For any additional inserted water molecules, there is a new molecule ID, so the issue persists due to the one water in the original data file.

If I change the first three lines of your atoms section to:

     1   1   1  -0.8      3.6472690865540596      4.5124925530679434     0.53473326866687365
     2   1   2   0.4      3.6515681787056646       5.275719445235775   -0.061575731332712019
     3   1   2   0.4      3.6429699944013221      3.7492656609007655   -0.061575731333540579

the molecule translations and rotations are only applied to the water molecules.

Before:

After:

2 Likes

This is really helpful.

Many thanks.