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
7bf58d51
Unverified
Commit
7bf58d51
authored
Apr 14, 2020
by
peastman
Committed by
GitHub
Apr 14, 2020
Browse files
Merge pull request #2644 from peastman/cmap
Fixed an edge condition that could cause errors in CMAPTorsionForce
parents
e703f76f
09d17766
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 @
7bf58d51
...
@@ -61,8 +61,8 @@ angleB = fmod(angleB+2.0f*PI, 2.0f*PI);
...
@@ -61,8 +61,8 @@ angleB = fmod(angleB+2.0f*PI, 2.0f*PI);
int2
pos
=
MAP_POS
[
MAPS
[
index
]];
int2
pos
=
MAP_POS
[
MAPS
[
index
]];
int
size
=
pos
.
y
;
int
size
=
pos
.
y
;
real
delta
=
2
*
PI
/
size
;
real
delta
=
2
*
PI
/
size
;
int
s
=
(
int
)
(
angleA
/
delta
);
int
s
=
(
int
)
fmin
(
angleA
/
delta
,
size
-
1
);
int
t
=
(
int
)
(
angleB
/
delta
);
int
t
=
(
int
)
fmin
(
angleB
/
delta
,
size
-
1
);
float4
c
[
4
];
float4
c
[
4
];
int
coeffIndex
=
pos
.
x
+
4
*
(
s
+
size
*
t
);
int
coeffIndex
=
pos
.
x
+
4
*
(
s
+
size
*
t
);
c
[
0
]
=
COEFF
[
coeffIndex
];
c
[
0
]
=
COEFF
[
coeffIndex
];
...
...
platforms/reference/src/SimTKReference/ReferenceCMAPTorsionIxn.cpp
View file @
7bf58d51
/* Portions copyright (c) 2010-20
16
Stanford University and Simbios.
/* Portions copyright (c) 2010-20
20
Stanford University and Simbios.
* Contributors: Peter Eastman
* Contributors: Peter Eastman
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* Permission is hereby granted, free of charge, to any person obtaining
...
@@ -133,8 +133,8 @@ void ReferenceCMAPTorsionIxn::calculateOneIxn(int index, vector<Vec3>& atomCoord
...
@@ -133,8 +133,8 @@ void ReferenceCMAPTorsionIxn::calculateOneIxn(int index, vector<Vec3>& atomCoord
int
size
=
(
int
)
sqrt
(
coeff
[
map
].
size
());
int
size
=
(
int
)
sqrt
(
coeff
[
map
].
size
());
double
delta
=
2
*
M_PI
/
size
;
double
delta
=
2
*
M_PI
/
size
;
int
s
=
(
int
)
(
angleA
/
delta
);
int
s
=
(
int
)
fmin
(
angleA
/
delta
,
size
-
1
);
int
t
=
(
int
)
(
angleB
/
delta
);
int
t
=
(
int
)
fmin
(
angleB
/
delta
,
size
-
1
);
const
vector
<
double
>&
c
=
coeff
[
map
][
s
+
size
*
t
];
const
vector
<
double
>&
c
=
coeff
[
map
][
s
+
size
*
t
];
double
da
=
angleA
/
delta
-
s
;
double
da
=
angleA
/
delta
-
s
;
double
db
=
angleB
/
delta
-
t
;
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