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
d82bfb62
Unverified
Commit
d82bfb62
authored
Oct 12, 2021
by
Peter Eastman
Committed by
GitHub
Oct 12, 2021
Browse files
Wait a little longer before deciding long range correction won't converge (#3280)
parent
833817ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
openmmapi/src/CustomNonbondedForceImpl.cpp
openmmapi/src/CustomNonbondedForceImpl.cpp
+6
-4
No files found.
openmmapi/src/CustomNonbondedForceImpl.cpp
View file @
d82bfb62
...
...
@@ -338,9 +338,10 @@ double CustomNonbondedForceImpl::integrateInteraction(Lepton::CompiledExpression
newSum
+=
expression
.
evaluate
()
*
r2
*
r2
;
}
sum
=
newSum
/
numPoints
+
oldSum
/
3
;
if
(
iteration
>
2
&&
(
fabs
((
sum
-
oldSum
)
/
sum
)
<
1e-5
||
sum
==
0
))
double
relativeChange
=
fabs
((
sum
-
oldSum
)
/
sum
);
if
(
iteration
>
2
&&
(
relativeChange
<
1e-5
||
sum
==
0
))
break
;
if
(
iteration
==
8
)
if
(
iteration
==
10
||
(
iteration
>
7
&&
relativeChange
>
1e-3
)
)
throw
OpenMMException
(
"CustomNonbondedForce: Long range correction did not converge. Does the energy go to 0 faster than 1/r^2?"
);
numPoints
*=
3
;
}
...
...
@@ -365,9 +366,10 @@ double CustomNonbondedForceImpl::integrateInteraction(Lepton::CompiledExpression
newSum
+=
switchValue
*
expression
.
evaluate
()
*
r
*
r
;
}
sum2
=
newSum
/
numPoints
+
oldSum
/
3
;
if
(
iteration
>
2
&&
(
fabs
((
sum2
-
oldSum
)
/
sum2
)
<
1e-5
||
sum2
==
0
))
double
relativeChange
=
fabs
((
sum2
-
oldSum
)
/
sum2
);
if
(
iteration
>
2
&&
(
relativeChange
<
1e-5
||
sum2
==
0
))
break
;
if
(
iteration
==
8
)
if
(
iteration
==
10
||
(
iteration
>
7
&&
relativeChange
>
1e-3
)
)
throw
OpenMMException
(
"CustomNonbondedForce: Long range correction did not converge. Is the energy finite everywhere in the switching interval?"
);
numPoints
*=
3
;
}
...
...
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