[lammps-users] fix bond/create: how to output the final topology


I am trying to run some polymerization simulations with the bond/create fix. The simulation appears to run fine for the simple cases I have tested so far. 
I am having a problem in finally dumping out the new topology - i.e., which beads are now bonded to which other beads. 

The Lammps manual states that information about the new bonds created are not written to the restart files. Nevertheless, when I write out a restart file 
and then use restart2data to convert that to a readable data file, there is a section on Bonds in the file. The problem is that this list appears 

to include spurious bonds - i.e., it contains bead pairs that are clearly not bonded (by observing in VMD, or in many cases, the beads are involved in 
more bonds than the maxbonds parameter of the fix bond/create). 

The manual also states that "dump bond" can be used to output the current bond topology - however, 'bond' does not appear to be a valid style for the dump command. 
Should there be a custom fix for this? Can somebody provide a simple example showing how to do this?

Any help would be great! 

The manual also states that "dump bond" can be used to output the current
bond topology - however, 'bond' does not appear to be a valid style for the
dump command.

This should say bond local can be used to output bonds, which I believe
will do what you want. See the dump doc page for details on "local".


Hi, all. I see the manual pages - but it’s not obvious how to get the results output by the old “dump_bond” command with the current version. Does someone have a current example script for dumping bonds in conjunction with fix bond/swap? I looked in the examples dir but didn’t see an appropriate script.


The idea is to use compute property/local and/or compute bond/local
to generate info for each bond. Then use dump local to output it.
It should just work with whatever current bonds that fix bond/swap
has created.


Hi, guys. Yes, I understand the idea in principle, but implementing it in a LAMMPS input script is proving difficult even though I’m a long-time user. My efforts to generate computes (so far) have all produced “ERROR: Illegal dump command” or at best “ERROR: Invalid attribute in dump local command”.

I tried the below and several variations thereof, to no avail:

fix 3 all bond/swap 0.5 1.4 598298 variable 1 equal f_1 variable accept equal f_1[1] variable attempt equal f_1[2] dump 1 all custom 500 configs.kfene30 id mol type x y z ix iy iz # deprecated old form of command #dump 2 all bond 500 bonds.kfene30 compute 1 all property/local btype batom1 batom2 variable 2 equal c_2 variable btype equal c_2[1] variable batom1 equal c_2[2] variable batom2 equal c_2[3] dump 2 all local 500 bonds.kfene30 btype batom1 batom2 thermo_style custom step temp epair ebond etotal press v_accept v_attempt

This produces “ERROR: Invalid attribute in dump local command” - perhaps I’m defining the variables incorrectly?

An example would be greatly appreciated :slight_smile:


Try one of these instead:

dump 2 all local 500 bonds.kfene30 v_btype v_batom1 v_batom2 #
variables are always pre-fixed by v_
dump 2 all local 500 filename c_1[1] c_1[2] c_1[3] # note you are
using c_2, but you don't have a compute 2