Hello,
I am trying to calculate the average bond angle in a metal-organic framework. I tried setting up a group (with atom types 3,5,7), hoping to calculate all of the bonds formed by atoms 5-3-7. However, atoms of type 5 are bonded to two atoms of type 3 (so I have a chain of atom types 3-5-3-7). Because I had specified the angle based on the group, LAMMPS was actually calculating all of the 3-5-3 angles and all of the 5-3-7 angles and averaging both sets together.
Here is the code I have been using for this:
group C1NZn type 3 5 7
…
compute C1NZnAngle C1NZn angle/local theta
fix C1NZnAnglePrint C1NZn ave/histo 1 100 100 100.0 140.0 20 c_C1NZnAngle mode vector file C1NZnAngles.txt ave running
compute C1NZnAngleAvg all reduce ave c_C1NZnAngle
fix 14 C1NZn ave/time {Nevery} {Nrepeat} ${Nfreq} c_C1NZnAngleAvg file C1NZnAngleAvg.txt
From the “fix C1NZnAnglePrint … “ command I was able to see that the bond distribution is bimodal, with peaks at the expected values of the 3-5-3 angles and the 5-3-7 angles.
Is there a way to calculate an average bond angle based only on the angle number? I do have the angles defined, so the 3-5-7 angles are angle type 6 (and the 3-5-3 angles are angle type 8).
Any insights into this problem would be greatly appreciated!
Marie