Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
mmtk
Commits
e04a268e
Commit
e04a268e
authored
Jun 01, 2018
by
Remi Perenon
Browse files
Handling old numpy versions
parent
ed54d086
Changes
2
Hide whitespace changes
Inline
Side-by-side
MMTK/Collections.py
View file @
e04a268e
...
...
@@ -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
]
...
...
MMTK/InternalCoordinates.py
View file @
e04a268e
...
...
@@ -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
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment