Dynamic Groups and logical operators

Hej LAMMPS users,

I'm trying to add atoms dynamically to a group in a way that the fix remembers which atoms already are in it and stores them. For this I'm using three variables and a dynamic group:

variable random_id equal round(random(1,count(all),923438))
variable random_atom atom "id == v_random_id"
variable active_atoms atom "gmask(active_atoms) || v_random_atom"

group active_atoms dynamic all var active_atoms every 1000

However, in step 0 already 2 atoms are in the fix and my box explodes. This is somehow weird since a explicitly pick with "random_atom" only a single atom. Is it in general possible to use such a combination?

Regards
Robert

Hej LAMMPS users,

I’m trying to add atoms dynamically to a group in a way that the fix remembers which atoms already are in it and stores them. For this I’m using three variables and a dynamic group:

Please note that multiple group commands are Incremental, so it is not clear to me why you need such a complex construct for this.

Axel

And what fix are you using the group with? Does it support dynamic groups?

Steve

It does, I use the tfmc fix (with dynamic_groups_allow = 1)

Regards

Robert

2015-06-10 17:12 GMT+02:00 Meißner, Robert <
[email protected]...>:

It does, I use the tfmc fix (with dynamic_groups_allow = 1)

You mean this one? http://lammps.sandia.gov/doc/fix_tfmc.html

If so, did you just use it as implemented in LAMMPS, or did you modify the
code yourself? Anyways, could you provide a (simple) sample input that
generates the same error, so I can have a look. I have an optmization for
fix tfmc in mind, b/c I just realized it might cause problems in some cases
I hadn't considered yet. Dynamic groups may be one of them.

Kristof

Dear Kristof,

Yes, I’ve been using your code, but finding a simple example would be difficult at the moment with my funny construct for a dynamic assignment of random atoms. I tried tfmc within a loop and what tfmc gives me was nearly the same as when I use all atoms in tfmc in the beginning. However, with a dynamic group it (often) gave me a “out of range atoms”. I could solve the problem by defining first a static group and making this group later dynamic. I’ll try to put this into a simple example.

Regards

Robert

2015-06-11 9:15 GMT+02:00 Meißner, Robert <
[email protected]...>:

Dear Kristof,

Yes, I’ve been using your code, but finding a simple example would be
difficult at the moment with my funny construct for a dynamic assignment of
random atoms. I tried tfmc within a loop and what tfmc gives me was nearly
the same as when I use all atoms in tfmc in the beginning. However, with a
dynamic group it (often) gave me a “out of range atoms”. I could solve the
problem by defining first a static group and making this group later
dynamic. I’ll try to put this into a simple example.

Hi Robert,

Thanks for the clarification. I think I know the problem with dynamic
groups: tfMC needs to know the smallest particle mass in the system in
order to calculate mass-dependent maximal displacement lengths for every
particle in the system. In the current implementation, this is done in the
init() stage of every run. I think that in the case of dynamic groups, the
fix group can still be empty at that point, and I'm pretty sure funny
things can happen then. This problem will not occur with a static
(non-empty) group.

I'll provide a solution asap, as soon as I figure out an elegant way to do
it.

Kristof