Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
09d17766
Commit
09d17766
authored
Apr 14, 2020
by
peastman
Browse files
Fixed an edge condition that could cause errors in CMAPTorsionForce
parent
e703f76f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
platforms/common/src/kernels/cmapTorsionForce.cc
platforms/common/src/kernels/cmapTorsionForce.cc
+2
-2
platforms/reference/src/SimTKReference/ReferenceCMAPTorsionIxn.cpp
.../reference/src/SimTKReference/ReferenceCMAPTorsionIxn.cpp
+3
-3
No files found.
platforms/common/src/kernels/cmapTorsionForce.cc
View file @
09d17766
...
...
@@ -61,8 +61,8 @@ angleB = fmod(angleB+2.0f*PI, 2.0f*PI);
int2
pos
=
MAP_POS
[
MAPS
[
index
]];
int
size
=
pos
.
y
;
real
delta
=
2
*
PI
/
size
;
int
s
=
(
int
)
(
angleA
/
delta
);
int
t
=
(
int
)
(
angleB
/
delta
);
int
s
=
(
int
)
fmin
(
angleA
/
delta
,
size
-
1
);
int
t
=
(
int
)
fmin
(
angleB
/
delta
,
size
-
1
);
float4
c
[
4
];
int
coeffIndex
=
pos
.
x
+
4
*
(
s
+
size
*
t
);
c
[
0
]
=
COEFF
[
coeffIndex
];
...
...
platforms/reference/src/SimTKReference/ReferenceCMAPTorsionIxn.cpp
View file @
09d17766
/* Portions copyright (c) 2010-20
16
Stanford University and Simbios.
/* Portions copyright (c) 2010-20
20
Stanford University and Simbios.
* Contributors: Peter Eastman
*
* Permission is hereby granted, free of charge, to any person obtaining
...
...
@@ -133,8 +133,8 @@ void ReferenceCMAPTorsionIxn::calculateOneIxn(int index, vector<Vec3>& atomCoord
int
size
=
(
int
)
sqrt
(
coeff
[
map
].
size
());
double
delta
=
2
*
M_PI
/
size
;
int
s
=
(
int
)
(
angleA
/
delta
);
int
t
=
(
int
)
(
angleB
/
delta
);
int
s
=
(
int
)
fmin
(
angleA
/
delta
,
size
-
1
);
int
t
=
(
int
)
fmin
(
angleB
/
delta
,
size
-
1
);
const
vector
<
double
>&
c
=
coeff
[
map
][
s
+
size
*
t
];
double
da
=
angleA
/
delta
-
s
;
double
db
=
angleB
/
delta
-
t
;
...
...
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