Fix bond/break breaks bonds and reports breakage incorrectly?

Hello, LAMMPS community!

I have a reason to think that LAMMPS fix bond/break either does not break bonds correctly or does not report the breakage correctly.

I perform 1D stretching of a simulation box filled with a Kremer-Grest polymer network with breakable bonds. The bonds are of two types : 1 and 2 - mimicing polymer backbone bonds and sulfur cross-link bonds.

LAMMPS command in the terminal is [ do not ask, please, why I do not use the LAMMPS job submission script with srun routine and #SBATCH directives ] :

mpirun -np 112 <LAMMPS executable> -in kg_1D_str_X-lnk_BB_brk.lam -var input <LAMMPS input file> -var base <base name> -var tRlx 500 -log <log file>

LAMMPS configuration script kg_1D_str_X-lnk_BB_brk.lam looks like as follows :

# Uniaxial stretching a KG model network from ElF 1 to 20 along X axis
# X-links & backbone bonds are breakable with the distance criteria

# #################
# ### VARIABLES ###
# #################

variable mass     equal 1.0                                # m_b -- mass of KG bead
variable tDamp    equal 2.0                                # tau -- relaxation time of temperature for Langevin dynamics
variable T        equal 1.0                                # final temperature for Langevin dynamics
variable tStep    equal 0.01                               # time step

variable finElF      equal 20                              # target elongation factor (ElF)
variable tElF        equal ${tRlx}                         # time per strain increment
variable strRate     equal 1/${tElF}                       # strain rate (engineering)
variable nRun        equal &
         (${finElF}-1)*${tElF}/${tStep}                    # steps to make ElF equal to finElF
                                                           # print deformation mode info
print "   Final elongation factor   = ${finElF}"
print "   Time per strain increment = ${tElF} tau"
print "   Strain rate               = ${strRate} tau^-1 (engineering)"
print "   Number of time steps      = ${nRun}"

# ######################
# ### INITIALISATION ###
# ######################

units  lj                                                  # LJ units
dimension  3                                               # 3D problem dimension
boundary  p p p                                            # periodic BCs
atom_style  molecular                                      # molecular atom style

# ######################################
# ### NEIGHBOUR LIST & COMMUNICATION ###
# ######################################

neighbor  2.0 bin                                          # neighbour skin thickness & type
neigh_modify  every 1 delay 0 check yes                    # neighbour list modification settings
comm_modify  mode single cutoff 4.0                        # inter-process commmunication

# ##################
# ### READ INPUT ###
# ##################

read_data ${input}
mass * ${mass}                                             # KG bead mass

# ####################
# ### INTERACTIONS ###
# ####################

variable  cutoff  equal  1.12246204830937

pair_style    lj/cut ${cutoff}
pair_coeff    * * 1.0 1.0 ${cutoff}
pair_modify   shift yes
bond_style    fene
bond_coeff    * 30.0 1.5 0.0 1.0
special_bonds lj 1 1 1
angle_style   cosine
angle_coeff   * 0.2060

# ################
# ### DYNAMICS ###
# ################

fix  dynamics    all  langevin ${T} ${T} ${tDamp} 432985345 gjf vfull tally yes
fix  integrator  all  nve

# ##############################
# ### STRETCH BOX UNIAXIALLY ###
# ### PRESERVING VOLUME      ###
# ##############################

fix 1DStretching all deform 10 &
    x erate ${strRate}         &
    y volume                   &
    z volume                   &
    units box                  &
    remap x
                                                           # rebalance grid of nodes when box is strained
fix rebal all balance 10000 0.95 shift xyz 10 1.05

# ######################################
# ### BREAK BACKBONE BONDS & X-LINKS ###
# ######################################

fix brkBB all bond/break 10 1 1.3
fix brkX  all bond/break 10 1 1.275

# #############
# ### FIXES ###
# #############

variable lambda equal lx/vol^(1.0/3.0)                     # x-ElF
                                                           # number of broken bonds
fix brkAvg all ave/time &
    1000   1   1000  v_lambda f_brkBB[1] f_brkX[1] f_brkBB[2] f_brkX[2] &
    file brkNum.t

# ######################
# ### TIMESTEP & RUN ###
# ######################

timestep ${tStep}
run ${nRun} upto start 0 stop ${nRun} every 50000 NULL

As you can see, there is an accidentally made typo, namely :

fix brkBB all bond/break 10 1 1.3
fix brkX  all bond/break 10 1 1.275

i.e. breakage is defined only for the bonds of type 1, not for the type 2. My bad, I will fix it for a new MD run. Nonetheless, I have noticed that brkNum.t outpuf file has the following interesting data :

# Time-averaged data for fix brkAvg
# TimeStep v_lambda f_brkBB[1] f_brkX[1] f_brkBB[2] f_brkX[2]
0 1 0 0 0 0
1000 1.02 0 0 0 1
2000 1.04 0 0 0 1
3000 1.06 0 0 0 1
...
243000 5.86 0 1 660 7294
244000 5.88 0 0 670 7400
245000 5.9 0 0 679 7497
...

i.e. the type 2 bonds are also broken even though for them breakage is not specified. Thus, there are two questions I would like to address :

  1. how come LAMMPS fix bond/break actually breaks type 2 bonds?

  2. how come the cumulative number of broken bonds got increased, i.e. 1000 1.02 0 0 0 1 , whereas there was not a single bond broken on any breakage time step?

P.S. Does any body know how to output info about broken bonds, e.g. their coordinates or the coordinates of beads that a broken bond connect? Thank you!

@wswgG You are making it very difficult to help you.

Please start by reviewing the posted guidelines and suggestions, which provide explanations.

As noted in those guidelines, you should always report which LAMMPS version you are using and how you configured/compiled it and what platform you are running on.

Also, if you notice a possible problem, you should construct a minimal(!!) input deck that has only a very small number of atoms/molecules and only the minimum number of commands (there seems to be a lot of unrelated commands in your quoted input and your command line suggests that you are working with a very large system). Once you can quickly and easily reproduce the perceived issue, you can post your complete(!) test system input deck and people can have a look and try to reproduce what you are seeing and understand what is going on.

How do you determine that? It is not clear to me from your description and I don’t see it from your input (which is hard to read because of its complexity and so I may be overlooking something).

I don’t think such a feature exists at the moment. What is available is a feature that you can highlight the atoms involved in broken bonds with dump image for a given number of steps. See the documentation for details.

The bond styles in the BPM package have the ability to track and output a list of broken bonds with associated data when they stretch past a critical strain (for example). The bpm/spring style is closest to Kremer Grest. I couldn’t comment of the top of my head how well this would work with fix bond/break though. See the bottom of the howto page 10.5.4. Bonded particle models — LAMMPS documentation

If you are having trouble with fix bond/break whitch as fas as my concern has also stability issues (if your bonds are harmonic for example) you can also try to break bonds using the very usefull fix bond/react. This is mostly made to create bonds but you can also break bonds if you like based on a variety of crirteria (including energy, distance etc.) I think for a coarse grain system the creation of the nesessary files should be quite straighforward. You can also see this publication https://pubs.acs.org/doi/full/10.1021/acs.jpcb.4c02350 on bond breaking in polymers.

Fix bond react can also track the number of bonds that have been break and also hiligh the reaction sites in the dump file.

I hope this helps!

Dear @akohlmey , thanks for your reply!

Thanks for the pointing this out. I hope I’ve fixed my original post in such a way that it meets the guidelines and suggestions.

LAMMPS Stable release 29 August 2024, OS x86_64 GNU/Linux. LAMMPS executable was generated as :

cmake ../cmake -DLAMMPS_MACHINE=<machine_name> -DBUILD_MPI=yes -DBUILD_OMP=yes - DWITH_GZIP=yes -DWITH_PNG=yes -DWITH_JPEG=yes -DLAMMPS_MEMALIGN=16 -
DLAMMPS_EXCEPTIONS=yes -DPKG_MOLECULE=YES -DPKG_MISC=yes -DPKG_COMPRESS=yes -DPKG_MC=yes -DPKG_EXTRA-FIX=yes - DPKG_EXTRA-COMPUTE=yes -DPKG_EXTRA-FIX=yes -DPKG_EXTRA-MOLECULE=yes - DPKG_GRANULAR=yes -DPKG_EXTRA-PAIR=yes -DPKG_DPD-BASIC=yes - DPKG_BROWNIAN=yes -DPKG_FEP=yes -DCMAKE_INSTALL_PREFIX=~/arch/ - DBUILD_SHARED_LIBS=no -DPKG_PYTHON=on -DCMAKE_CXX_FLAGS="-g -O3"

LAMMPS input script has been reduced, only the necessary commands are left. The input configuration file is included

polymer.input (2.8 MB)

. The output is updated correspondingly :

# Time-averaged data for fix brkAvg
# TimeStep v_lambda f_brkBB[1] f_brkX[1] f_brkBB[2] f_brkX[2]
0 1 0 0 0 0
1000 1.02 0 0 0 0
2000 1.04 0 0 0 0
...
438000 9.76 0 0 7 147
439000 9.78 0 0 7 147
440000 9.8 0 0 7 147

I made this conclusion based on the input in LAMMPS configuration script :

fix brkBB all bond/break 10 1 1.3
fix brkX  all bond/break 10 1 1.275
...
variable lambda equal lx/vol^(1.0/3.0)
fix brkAvg all ave/time &
    1000   1   1000  v_lambda f_brkBB[1] f_brkX[1] f_brkBB[2] f_brkX[2] &
    file brkNum.t

and the output :

# Time-averaged data for fix brkAvg
# TimeStep v_lambda f_brkBB[1] f_brkX[1] f_brkBB[2] f_brkX[2]
0 1 0 0 0 0
1000 1.02 0 0 0 0
2000 1.04 0 0 0 0
...
438000 9.76 0 0 7 147
439000 9.78 0 0 7 147
440000 9.8 0 0 7 147

AFAIU fix bond/break, bonds type 2 should not be breaking, but only bonds type 1.

Yet another question is how to catch the values f_brkBB[1] and f_brkX[1] being not equal to 0. Do I need to align the frequencies of fix ave/time and of fix bond/break ?

I don’t understand your logic here. Neither of the two fix bond/break commands monitors and attempts to break any type 2 bonds. How can they indicate that type 2 bonds are broken?
Your output only shows how many type 1 bonds are broken by each fix instance.

How else? Just re-read the section of fix bond/break explaining what the two values are representing that the fix make available for output.

Jeeeez, now I understood the failure of my logic :man_facepalming: I’m sorry for making such a silly mistake. Thanks for questioning, this helped to find the truth as always.

Thanks for the hint. However, we have to stick to the WCA potential, i.e. FENE bonded interactions in particular.

If you’re willing to do some development, you could always copy and paste the force calculation from FENE into a BPM bond style to inherit its output capabilities. If breakage is stochastic, this might be tricky. But a deterministic stretch-based failure would be easy and a BPM/FENE bond style would probably be a good bit faster (far fewer communication calls and no extra topology updates when bonds break).

Alternatively, one could copy the fix_store_local code from bond_bpm.cpp into fix_fix_bond_break.cpp.

This looks like an interesting approach! Thanks for pointing out!