bond/create specific number of bonds

Hello Users,

I have a polymer system with cross linkable end groups. I would like to cross link the system during a run but only allow a defined number of cross links to form. By that I mean, if there are 20 places that could be cross linked, I would like to only cross link 10.

Is this something that would likely be controllable using an “if-statement”?

Ideas are welcome.

Thanks for your help!

If you are using the fix bond/create command to do the
cross-linking, then you could put a series of short runs
in a loop (see the jump command doc page), and
use the if command to test on the # of bonds created
(an output from the fix bond/create command), and
exit the loop when your condition is met.

Steve

Hi Steve,

Thank you for your response. Soon after sending this email, this is what I figured out to do:

fix create_bond all bond/create 50000 7 7 5.0 12 iparam 1 7 jparam 1 7
variable Nbond equal f_create_bond[1]
label aloop
variable a loop 10
if “${Nbond} >= 95” then “jump SELF break”
run 50000
next a
jump SELF aloop

Again, thank you for your help