fix rigid/nve with fix nve

Thanks Axel! You were exactly correct. I did not realize that the order of fixes was important. I put my shake fix last, and it indeed solved the problem. Not only is the energy much better conserved, but the SHAKE stats show that the residuals are several orders of magnitude better.

My original question (hence the incorrect subject) was how well does fix rigid/nve play with fix nve? It is a moot point for me now, since I will continue to use fix shake instead of fix rigid, but I am still curious. I have added ions to my water box, and had to use two time integrators in parallel (one for each group of atoms/molecules). I equilibrated for a very long time with fix rigid/nvt and fix nvt, and subsequently observed constant energy with fix rigid/nve and fix nve. However, the KE, PE, E-field energy, and wall energy each change significantly over time. Might this be due to the two time integrators or is this some other issue?

Jonathan

Thanks Axel! You were exactly correct. I did not realize that the order of fixes was important. I put my shake fix last, and it indeed solved the problem. Not only is the energy much better conserved, but the SHAKE stats show that the residuals are several orders of magnitude better.

My original question (hence the incorrect subject) was how well does fix rigid/nve play with fix nve? It is a moot point for me now, since I will continue to use fix shake instead of fix rigid, but I am still curious.

the two nve integrators play along very well. since there is no
thermostatting involved,
there should be no side effects from using two integrators on separate
groups of atoms.
iff you would include thermostatting, you have - of course - to live
with coupling of the
two groups of atoms to individual heat baths instead of one common
thermostat. but
even the latter can be achieved by using the nve integrators in
combination with fix
langevin or fix berendsen on all atoms.

I have added ions to my water box, and had to use two time integrators in parallel (one for each group of atoms/molecules). I equilibrated for a very long time with fix rigid/nvt and fix nvt, and subsequently observed constant energy with fix rigid/nve and fix nve. However, the KE, PE, E-field energy, and wall energy each change significantly over time. Might this be due to the two time integrators or is this some other issue?

this is more likely due to the (slow) relaxation and reorientation of
the system due to
the external field, don't you think?

cheers,
    axel.

I want to emphasize that fix nve and fix nve/rigid have
no connection to each other. However it is critical
that you don't use them together on the same atoms.
This is different than using fix nve and fix shake, since
SHAKE is not an integrator but a constaint. So in
the latter case you would use fix nve on all your atoms.
In the former you would only use fix nve on atoms
not covered by fix rigid/nve.

It is also conceptually easy to see why fix shake needs
to come after fix efield to do what you want. Both are
adjusting forces. In the case of fix shake it is taking
the current forces and adjusting them by adding new
forces so that when the integration occurs the SHAKE
contstraints will be satisfied (e.g. bond lengths). If your
script then adds additional forces (via fix efield), fix
shake knows nothing about them, and the SHAKE constraints
will not be conserved. So fix shake needs to be invoked
after all other forces are added if you want it to work
as you expect. I will add a note to the fix shake doc
page to this effect.

Steve