Fix Gle dynamic groups

Dear Lammps-Users,

Is there anyway to implement fix gle on a dynamic group? I setup two dynamic groups based on regions and as molecules move into one region I want to implement a fix gle on them while the other region has a separate thermostat.

Currently if I try to run with it as is I get the simple error:
ERROR: Fix 2 does not allow use of dynamic group (…/modify.cpp:246)

Is there any way to get around this limitation as I need to run the thermostat on a dynamic group. For example could I manually rename the group as a new static group every x amount of timesteps and loop it? How would I go about doing this if I could?

Any help would be appreciated

Thank you,
Jonathan

Dear Lammps-Users,

Is there anyway to implement fix gle on a dynamic group? I setup two dynamic groups based on regions and as molecules move into one region I want to implement a fix gle on them while the other region has a separate thermostat.

Currently if I try to run with it as is I get the simple error:
ERROR: Fix 2 does not allow use of dynamic group (…/modify.cpp:246)

Is there any way to get around this limitation as I need to run the thermostat on a dynamic group. For example could I manually rename the group as a new static group every x amount of timesteps and loop it? How would I go about doing this if I could?

the technical step to circumventing the limitation is much simpler (you just need to set the variable dynamic_group_allow in the fix gle constructor to 1.

however, the question is: does the algorithm in fix gle support dynamical groups intrinsically?
that is not quite as easy to answer. as that usually means that it must not need any access to data from the previous time step or maintain per-atom data that is carried along during the simulation or have any other properties that are pre-computed during the Fix::init() phase and would need to be updated/recomputed when the number of particles changes. for thermostats that usually requires triggering an update to the temperature compute, since that needs to change the number of degrees of freedom with particles added or removed to a group.

this is not an automatic step and thus all fixes that have not been reviewed accordingly (and this usually requires contacting the authors and asking them to submit a suitable pull request on github. or at least an e-mail to one of the core LAMMPS developers) are disallowed for dynamic groups.

axel.

Dear Jonathan,
Indeed I expect this to break GLE badly, not only code-wise but also conceptually. Each degree of freedom has a bunch of fictitious momenta attached to it: what happens when a new atom gets into the GLE region? This is particularly true for non-canonical GLEs such as the quantum thermostat (http://dx.doi.org/10.1103/PhysRevLett.103.030603).
To me the most reasonable (and conceptually consistent) way to implement a dynamic group mode for GLE would involve keeping to compute the propagator for all the atoms (or a static group of atoms) and then multiply the change in momentum by a 0/1 (ideally smoothed) multiplier.
IDK enough about internal implementation of dynamic groups in LAMMPS to know how well this fits into the scheme, and I don’t have in the foreseeable future time to look into this myself.
If you are interested in coding something along those lines I’d be glad to discuss with you in more detail, and to review code changes.
Best
Michele

Thank you both for your responses. As for now I’ll look into other ways to implement what I’m trying to do.

In response to Michele, if its alright with you I will reach out to you shortly in regards to the fix GLE as I’ve gotten some unexpected results that I wanted to verify first. In regards to implementing dynamic groups for the fix, I would love to work on something like that, but as a relatively new user to LAMMPS and new grad student it may be beyond my ability currently. I look forward to talking with you soon about this and other things about your work.

Best,
Jonathan

Sure, let me know if anything unexpected you may have encountered.
Best
M