Bug fixed when using dynamic group with fix bond/create

Dear All,

I am using lammps to generate a crosslinked polymer system. When I define a group with dynamic property, lammps gives me an error which means fix bond/create are not allowed to use dynamic group.

Actually it is a bug.

When I check the code in MC/fix_bond_create.cpp, the variable “dynamic_group_allow” does not appear in anywhere.

So at the constructor function
“FixBondCreate::FixBondCreate”
I added this line
“dynamic_group_allow = 1;”
and this bug is fixed, fix bond/create now can combined with dynamic group.

I am not sure how many similar bug exist in lammps. But I hope this could be helpful for other people who has similar problem like me.

Thanks.

Zilu Wang

Postdoc in department of polymer science.
University of Akron.

Dear All,

I am using lammps to generate a crosslinked polymer system. When I define a
group with dynamic property, lammps gives me an error which means fix
bond/create are not allowed to use dynamic group.

Actually it is a bug.

no, it is not.

When I check the code in MC/fix_bond_create.cpp, the variable
"dynamic_group_allow" does not appear in anywhere.

that is correct. it is set to its default value (0) in the constructor
of the base class Fix.

So at the constructor function
"FixBondCreate::FixBondCreate"
I added this line
"dynamic_group_allow = 1;"
and this bug is fixed, fix bond/create now can combined with dynamic group.

it is not as simple as that. dynamic groups are a tricky thing and
that is why it is disabled by default for fixes. after you change, you
can use the fix, but it is not clear at all, whether the fix will
behave correctly. this requires careful and thorough auditing of the
code.

I am not sure how many similar bug exist in lammps. But I hope this could be
helpful for other people who has similar problem like me.

these are no bugs and changing the code without really understanding
why certain choices are made can lead to a lot of grief and problems.

axel.