modifying forces post end_of_step how to correct with Rattle

Hello all,

I am implementing a new command and, for the sake of argument, lets assume I have good a reason for wanting to modify the forces (let’s say placing a call to fix_langevin’s post force) post end_of_step. This command needs to play nice with Rattle but obviously this will cause a problem. I have tried various modifications to the order (as well as trying to call rattle’s coordinate_const_end_of_step()) in which the thermostat and Rattle function are called in, what I hope is a logical way, to attempt to correct for the modifications I have made to the forces via the thermostat. Some modifications have come close but all have led to a poorer convergence of the constraint than the unadulterated code.

I have read the exchange with Peter Wirnsberger from last year but in this case I have good reason to not want any degradation of the quality of the constraint convergence. Any thoughts would be greatly appreciated.



I suggest you contact Peter directly. In general, SHAKE and RATTLE

are attempting to make a correction at time A so that when integration

happens later at time C, the constraints will be satisfied. If you insert

arbitrary changes to forces at time B between A and C, then you can

clearly mess up what SHAKE/RATTLE are attempting to do, b/c the

integration at time C will use the altered forces.