Hi all,
I am trying to create my own fixes and am facing some issue.
My objective is to create and break bonds and while the bond is existing there should be a bond force between the 2 atoms.
Once the create bond criterion is satisfied it should enter a bondlist and then a calculated force should be applied on the particles and once the criterion for the bond breakage is satisfied the 2 particles should be deleted from the bondlist.
I have created 2 new fixes based on the template of the fix_bond_create.cpp and fix_bond_break.cpp to account for the formation and breakage of bonds based on a criterion.
In the fix_bond_break.cpp, I include a force on the 2 particles in the bondlist.
The issue I am facing is that there seems to be no effect of force even though the bonds are getting created and broken.
I have checked if the force arrays are in the same address location both in the dump and the fix_bond_break compute force sequence, and they seem to be.
The only conclusion is that the force is getting reset to zero after I assign a value to atom->f.
I am not sure where the force gets reset.
Has anyone faced a similar issue?
Thank you any help in advance.
You should post some of your
You should post some of your code so we can see exactly what you are doing. Adding forces to atom->f has worked for me in the past.
Fixed the problem
I was initially adding the force in fix->post_integrate() but realized that the force resets after. Now I have put the force calculation in fix->final_integrate()
It works as intended so far. I hope I am not over seeing anything.
Thanks.