Skip to content

Commit

Permalink
Minor changes to vibanalysis
Browse files Browse the repository at this point in the history
-removed all calles to checkADM as this does nothing
- Simplified some code in the read pdielec routine
  • Loading branch information
JohnKendrick committed Nov 13, 2024
1 parent 5c9612a commit 269b064
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions PDielec/vibanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ def makeADM(self):
for i in range(len(self.vibrations)):
self.ADM[:,i]=self.vibrations[i].displacements
def checkADM(self):
"""Check orthogonalyty of the ADM"""
self.makeADM()
"""Check orthogonality of the ADM"""
for n in range(self.ADM.shape[1]):
norm=np.linalg.norm(self.ADM[:,n])
#print("Norm of Vibrational Mode %d is %8.6f"%(n+1,norm))
Expand Down Expand Up @@ -471,13 +470,9 @@ def readPDielec(ifn):
for imode,mode in enumerate(mass_weighted_normal_modes):
for index,old_index in enumerate(original_atomic_order):
i = index*3
new_mass_weighted_normal_modes[imode,i+0] = mode[old_index][0]
new_mass_weighted_normal_modes[imode,i+1] = mode[old_index][1]
new_mass_weighted_normal_modes[imode,i+2] = mode[old_index][2]
new_normal_modes[imode,i+0] = new_mass_weighted_normal_modes[imode,i+0] / math.sqrt(masses[index])
new_normal_modes[imode,i+1] = new_mass_weighted_normal_modes[imode,i+1] / math.sqrt(masses[index])
new_normal_modes[imode,i+2] = new_mass_weighted_normal_modes[imode,i+2] / math.sqrt(masses[index])

new_normal_modes[imode,i+0] = mode[old_index][0] / math.sqrt(masses[index])
new_normal_modes[imode,i+1] = mode[old_index][1] / math.sqrt(masses[index])
new_normal_modes[imode,i+2] = mode[old_index][2] / math.sqrt(masses[index])
#
# OK - now we can start the interface to VibAnalysis
#
Expand Down Expand Up @@ -1449,7 +1444,7 @@ def main():
system.normalizeVibrations()
#jk system.sortVibrations()
system.makeADM()
system.checkADM()
#jk system.checkADM()
# Generate quasi-redundant internal coordinated
of.write("\nGenerating Internal Coordinates...\n")
makeIC(system,useric)
Expand Down

0 comments on commit 269b064

Please sign in to comment.