[lammps-users] fix recenter and respa

Hi,

I was trying to use fix recenter in combination with the respa multiple
timestep integrator and found that the centre-of-mass position of the fix group
would move, whereas using the verlet integrator it would remain fixed.

Looking in the code I noticed that fix_recenter.cpp (and .h) were missing the
intial_intergrate_respa function that is present in other fixes (such as
fix_move). After modifing fix_recenter to include the initial_integrate_respa
function (following fix_move) the centre of mass of the group does seem
(almost) fixed, but as I'm not overly experienced in c++ programming I don;t
think this should be inflicted on others. I also don't know whether there is
any physical reason why fix_recenter shouldn't be compatible with respa.

regards,
David Cheung

david,

Hi,

I was trying to use fix recenter in combination with the respa multiple
timestep integrator and found that the centre-of-mass position of the fix group
would move, whereas using the verlet integrator it would remain fixed.

Looking in the code I noticed that fix_recenter.cpp (and .h) were missing the
intial_intergrate_respa function that is present in other fixes (such as
fix_move). After modifing fix_recenter to include the initial_integrate_respa
function (following fix_move) the centre of mass of the group does seem
(almost) fixed, but as I'm not overly experienced in c++ programming I don;t
think this should be inflicted on others. I also don't know whether there is
any physical reason why fix_recenter shouldn't be compatible with respa.

rather than guessing what to do, you should have a look at
http://lammps.sandia.gov/doc/Section_modify.html#fix
to understand the when in the process each method of a
fix class is being invoked.

as for using respa, quite a chunk of the respa related code in lammps
has not been thoroughly tested and in some cases even reading
it indicates that it was copied and modified by somebody that
didn't understand how respa operates. since those are all optional
methods, it is difficult for any maintainer to tell whether they work
or not. if you have questions, check out who the contributor of a
specific piece of code is/was and try to contact that person first.

cheers,
    axel.

Looking in the code I noticed that fix_recenter.cpp (and .h) were missing the
intial_intergrate_respa function that is present in other fixes (such as
fix_move).

No fix in LAMMPS that does pre/post force operations or time integration
will work with rRESPA unless the fix has methods that rRESPA can
explicitly call to do this. This should be better documented.

The good news is that in many cases, these additional methods are easy
to add - you just have to decide at what level of rRESPA it makes sense
to invoke the fix. For recenter it probably only makes sense at the outermost
level.

as for using respa, quite a chunk of the respa related code in lammps
has not been thoroughly tested and in some cases even reading
it indicates that it was copied and modified by somebody that
didn't understand how respa operates

Examples? While it's true that the respa methods in fixes are less well
tested due to less use, I don't know of any bugs/issues with them in fixes
in main LAMMPS (user packages excluded).

Steve