Commit e04a268e authored by Remi Perenon's avatar Remi Perenon
Browse files

Handling old numpy versions

parent ed54d086
......@@ -321,7 +321,7 @@ class GroupOfAtoms(object):
:rtype: Scientific.Geometry.Transformation.RigidBodyTransformation
"""
cm, inertia = self.centerAndMomentOfInertia()
ev, diag = numpy.linalg.eig(inertia)
ev, diag = numpy.linalg.eig(inertia.array)
diag = numpy.transpose(diag)
if numpy.linalg.det(diag) < 0:
diag[0] = -diag[0]
......
......@@ -203,11 +203,11 @@ class BondAngle(InternalCoordinate):
cm1, th1 = self.fragment1.centerAndMomentOfInertia()
r1 = self.universe.distanceVector(self.atoms[1], cm1)
th1 -= self.fragment1.mass()*((r1*r1)*delta-r1.dyadicProduct(r1))
i1 = numpy.dot(axis, numpy.dot(th1, axis))
i1 = numpy.dot(axis.array, numpy.dot(th1.array, axis.array))
cm2, th2 = self.fragment2.centerAndMomentOfInertia()
r2 = self.universe.distanceVector(self.atoms[1], cm2)
th2 -= self.fragment2.mass()*((r2*r2)*delta-r2.dyadicProduct(r2))
i2 = numpy.dot(axis, numpy.dot(th2, axis))
i2 = numpy.dot(axis.array, numpy.dot(th2.array, axis.array))
d1 = i2*d/(i1+i2)
d2 = d1-d
self.fragment1.rotateAroundAxis(self.atoms[1].position(),
......@@ -284,11 +284,11 @@ class DihedralAngle(InternalCoordinate):
cm1, th1 = self.fragment1.centerAndMomentOfInertia()
r1 = self.universe.distanceVector(self.atoms[1], cm1)
th1 -= self.fragment1.mass()*((r1*r1)*delta-r1.dyadicProduct(r1))
i1 = numpy.dot(axis, numpy.dot(th1, axis))
i1 = numpy.dot(axis.array, numpy.dot(th1.array, axis.array))
cm2, th2 = self.fragment2.centerAndMomentOfInertia()
r2 = self.universe.distanceVector(self.atoms[2], cm2)
th2 -= self.fragment2.mass()*((r2*r2)*delta-r2.dyadicProduct(r2))
i2 = numpy.dot(axis, numpy.dot(th2, axis))
i2 = numpy.dot(axis.array, numpy.dot(th2.array, axis.array))
d1 = i2*d/(i1+i2)
d2 = d1-d
self.fragment1.rotateAroundAxis(self.atoms[1].position(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment