proposal: automatic molecule renumbering after fix bond/break bond/create?

I'd like to propose adding (optional) on-the-fly molecule-ID
renumbering to fix bond/create and fix bond/break. When enabled by
the user, this would insure that two atoms connected together by bonds
will share the same molecule-ID. (Why bother? In my case I have some
pair styles which compare the molecule-ID of each atom before looking
up the pair coeffs. I'm happy to post these, by the way. I'm sure
some people will think of use for this. {We use it to speed up
nucleation.})

I think I could add this code to FixBondBreak::post_integrate() and
FixBondCreate::post_integrate(). (I would have them both invoke the
same function to renumber atoms->molecule[] after every bond formation
or breakage event.)

Alternately I could create a new fix (something like "fix mol/auto")?

Does anyone have an opinion on this?

Andrew

Hi Andrew,

It sounds expensive, because you will have to do a global cluster
analysis a la ComputeClusterAtom every time a bond is added or
removed. For that reason, it should probably be added as a separate
fix.

Aidan

Dear Aidan

Thank you for your reply, and thanks for the heads up regarding
ComputeClusterAtom. (I think my code was even more expensive. It
calculated everything on the root-CPU.)

Hi Andrew,

It sounds expensive, because you will have to do a global cluster
analysis a la ComputeClusterAtom every time a bond is added or
removed. For that reason, it should probably be added as a separate
fix.

If it was added as a separate fix, wouldn't that mean that the
molecule-IDs would be recalculated after every time step (not just
after a bond is broken or formed)?

Thank you greatly for your reply. If I have any questions, I'll try
to make them concise.
Cheers!

Andrew