Right now I am working on programming a new angle style. I am stuck at how to find how many times a bond is shared among the angles.
I tried two approaches without MPI communication but could not get them to work:
I thought I could loop through neighbor->anglelist and count number of appearances for each bond, but found that the anglelist only has information about local angles, so it does not work for the bonds whose atoms do not belong to the same processor.
Then I thought the number of times a bond is shared equals the number of atoms bonded to each atom combined minus 2 (the atoms of the given bond itself). But It is still limited by the fact that variables atom->num_bond and atom->bond_atom are also local.
So I am wondering if there is some kind of global connectivity array that stores the global bonding information? Or I can somehow access the number of bonded atom of a ghost atom. Also, definitely let me know if you have better approaches.
Preferably I don’t want to MPI involved, because not only it affects the performance of the angle style, it also is difficult to code.
Let me know if I need to elaborate on my question more.