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
4068b915
Unverified
Commit
4068b915
authored
Dec 15, 2022
by
Peter Eastman
Committed by
GitHub
Dec 15, 2022
Browse files
Added checks for invalid sigma in AmoebaVdwForce (#3872)
parent
ccb7d3d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
plugins/amoeba/openmmapi/src/AmoebaVdwForceImpl.cpp
plugins/amoeba/openmmapi/src/AmoebaVdwForceImpl.cpp
+19
-1
No files found.
plugins/amoeba/openmmapi/src/AmoebaVdwForceImpl.cpp
View file @
4068b915
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-20
16
Stanford University and the Authors. *
* Portions copyright (c) 2008-20
22
Stanford University and the Authors. *
* Authors: *
* Authors: *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -53,6 +53,24 @@ void AmoebaVdwForceImpl::initialize(ContextImpl& context) {
...
@@ -53,6 +53,24 @@ void AmoebaVdwForceImpl::initialize(ContextImpl& context) {
if
(
owner
.
getNumParticles
()
!=
system
.
getNumParticles
())
if
(
owner
.
getNumParticles
()
!=
system
.
getNumParticles
())
throw
OpenMMException
(
"AmoebaVdwForce must have exactly as many particles as the System it belongs to."
);
throw
OpenMMException
(
"AmoebaVdwForce must have exactly as many particles as the System it belongs to."
);
for
(
int
i
=
0
;
i
<
owner
.
getNumParticles
();
i
++
)
{
int
parentIndex
,
typeIndex
;
double
sigma
,
epsilon
,
reductionFactor
;
bool
isAlchemical
;
owner
.
getParticleParameters
(
i
,
parentIndex
,
sigma
,
epsilon
,
reductionFactor
,
isAlchemical
,
typeIndex
);
if
(
sigma
<
0
)
throw
OpenMMException
(
"AmoebaVdwForce: sigma for a particle cannot be negative"
);
if
(
owner
.
getPotentialFunction
()
==
AmoebaVdwForce
::
Buffered147
&&
sigma
==
0
)
throw
OpenMMException
(
"AmoebaVdwForce: sigma for a particle cannot be zero"
);
}
for
(
int
i
=
0
;
i
<
owner
.
getNumParticleTypes
();
i
++
)
{
double
sigma
,
epsilon
;
owner
.
getParticleTypeParameters
(
i
,
sigma
,
epsilon
);
if
(
sigma
<
0
)
throw
OpenMMException
(
"AmoebaVdwForce: sigma for a particle type cannot be negative"
);
if
(
owner
.
getPotentialFunction
()
==
AmoebaVdwForce
::
Buffered147
&&
sigma
==
0
)
throw
OpenMMException
(
"AmoebaVdwForce: sigma for a particle type cannot be zero"
);
}
// check that cutoff < 0.5*boxSize
// check that cutoff < 0.5*boxSize
...
...
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