delete_bonds and special_bond related issue

Dear Steve, Users,

I am trying to run a simulation where I plan to break bonds (permanently; like in ablation). After looking at the manual, it seems like delete_bond would do most of the work. But, my impression is that although, it deletes the bond, the angle, dihedral and improper information would remain in the system. Please correct me if I am wrong.

Basically, I would like to remove the angle, dihedral and improper information associated with that bond for good and update the special_bond list before I run the simulation further. So, I am running the lammps as a library with a C++ code around it. Based on the simple.cpp and lammps_sparkks.cpp example, I have been able to run it successfully and extract the bond information (through property/local and bond/local commands) which I need to break. In order to proceed further, I have following questions/queries

  1. I know the bond which need to be deleted and the processor it recides on. Should I execute the lmp->input->one (delete_bonds) command on that processor or do I need to execute on proc 0 or broadcast it to each processor and then run.

  2. In order to remove the associated angles, dihedrals, and impropers, I would have to execute the delete_bonds command again with angle/dihedrals/impropers settings. For that, I need to have access to nspecial[i][]; onetwo[i][]; onethree[i][] arrays (where i is the local index of two atoms which are involved in bond breaking). I am wondering how I can retrieve these arrays in my code.

  3. My plan is that once I have these array, I can access the index of atoms, thus creating new temporary groups, delete angles, dihedrals, then delete groups. For the last delete_bond command, I will use “remove special” setting, so that new special_bonds are build.

  4. Update neighbour list.

  5. Run lammps again.

Any help (especially with point two) or any other route to accomplish above will be highly appreciated.

Best Regards,
Vikas

The "remove" option on delete bonds will remove them permanently,
from all data structures.

Steve

Dear Steve,
Thanks for your email. I am bit confused when you say that “delete bond will remove them permanently from all data structures”. Does it include data structures associated with angle, dihedral and impropers?

I tried running a test simulation in which I have following before the bond is deleted.
22 atoms
23 bonds
36 angles
52 dihedrals
12 impropers

After, I delete the bond (permanently) and save restart file, I have following information.
22 atoms
22 bonds
36 angles
52 dihedrals
12 impropers

To me it appears that while the bond information is gone for good, the angle, dihedral and improper associated with the broken bond still exist in the data. This is my concern.

Please look below for the lammps output. The bone energy and van der Waals energy is changed (which is should as we have deleting the bond and update the special_bonds list). But the angle energy, dihedral energy and improper energy remains same. I think once I delete the bond, the associated angle, dihedrals and impropers should be deleted, which in turn should change the angles, dihedrals and improper energy. This is the reason, I want to extract the special_bond info from lammps to the C++ code and use delete_bond command with angle/dihedral/improper keywords few times to remove them.

Before bond breaking
---------------- Step 10 ----- CPU = 0.0010 (sec) ----------------
TotEng = 87.2377 KinEng = 35.6978 Temp = 570.2792
PotEng = 51.5399 E_bond = 22.4370 E_angle = 27.4529
E_dihed = 5.2473 E_impro = 0.2165 E_vdwl = -2.5181
E_coul = -1.2958 E_long = 0.0000 Press = -324.8025

After bond breaking
---------------- Step 10 ----- CPU = 0.0000 (sec) ----------------
TotEng = 32369.8113 KinEng = 35.6978 Temp = 570.2792
PotEng = 32334.1136 E_bond = 21.4042 E_angle = 27.4529
E_dihed = 5.2473 E_impro = 0.2165 E_vdwl = 32286.4657
E_coul = -6.6730 E_long = 0.0000 Press = 328234.7272

Please guide.

Best regards,
Vikas

I misunderstood your Q. There is no logic in the delete bonds command
to search for angles to delete that had a bond that was deleted. Or dihedrals,
etc. My previous answer was wtr full removal of bonds only. Unless
your system is setup such that angles with deleted bonds have a unique
angle type
(so that you can use delete bonds on the angles as well), then I think
you will have to post-process the extra deletions yourself.

Steve

Dear Steve,
Thank you for your answer. I have following question for you then.

Lets say, I define a group of two atoms (I know the bond type between them). Then I use delete_bond command to delete bond between them permanently. Then I find out (somehow) the third atom try delete_bond with angle settings as follows

group 2bond id 1 2
delete_bond 2bond bond 1 remove //Bond Type is one
group 3angle id 1 2 3 // 3 is the third atom
delete_bond 3angle angle 1 remove special // Angle Type is one.

Would it delete the angle information for good.

If it is possible, I have a final question to you. It seems like all this information is stored in a efficient manner in special.cpp in nspecial, onetwo, onethree and onefour arrays. Is it possible to import these array values to a .cpp program (like simple.cpp of COUPLE/simple example folder) which uses lammps as library

Please let me know.

Best regards,
Vikas

Delete_bond angle will remove angles, as the doc page says.
If you add a function to library.cpp, or add a recognized field
to library.cpp::lammps_extract_atom, you can get a pointer
to the special and nspecial data structs, just as you can any
per-atom pointer. Arrays onetwo, etc are not permanent
data structs. The int **special is.

Steve