Fix langevin

First setting:
fix 1 top langevin 300 300 0.1 456789
fix 2 top nve

Second setting:
fix 1 top nve
fix 2 top langevin 300 300 0.1 456789

Is there any difference?

Do you see a different result when running a test simulation ?

Fortunately, tests show that there is no difference.
But the following settings will be slightly different.

First:
fix 1 top rigid/nve single force 1 on on on torque 1 off off off
fix 2 top aveforce 0 0 10.0

Second:
fix 1 top aveforce 0 0 10.0
fix 2 top rigid/nve single force 1 on on on torque 1 off off off

I don’t know why.

Hi @hgc, the answer is likely in the manual page of the fix command.

As stated:

Fixes perform their operations at different stages of the timestep. If two or more fixes operate at the same stage of the timestep, they are invoked in the order they were specified in the input script.

So depending on which stage of the timestep the fixes apply, especially if you modify forces, the order of the fix commands can be important. For example, fix recenter operates at the same point as integrators and should come last if you want the groups to be re-centered correctly. There is a dedicated warning in the manual and a dedicated warning message if the commands order does not follow this rule.

But there is no warning information, and there is no relevant warning in the manual.

I mentioned the warning from fix recenter because that is a place in the manual where the fix order effect is emphasised.

My point is mainly that fix command order matters and can have (some) effect on the dynamics.

Now you proposed two cases which are very different to system that are not provided and in input file we have nearly no information about. The only difference is the order of some fix commands at a point in your file. Fine. You don’t know why? Me neither. But getting a better understanding of how the commands operate might be a good way to start understanding how the code works and what is troubling you.

Also, a good way of addressing such a question would be to make a simple case and make a test with a single step with the same seed for the random commands, changing the order and printing the forces. You can only end up with two options:

  1. You see a difference? The order matters.
  2. You see no difference? The order doesn’t matter.