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
a7c50469
"examples/python-examples/simulateGromacs.py" did not exist on "27047bc39f45a9716ac4336314b46fa207b37a86"
Commit
a7c50469
authored
Jun 01, 2020
by
peastman
Browse files
Fixed check for changed exceptions
parent
b37e55be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
platforms/cpu/src/CpuKernels.cpp
platforms/cpu/src/CpuKernels.cpp
+12
-1
platforms/reference/src/ReferenceKernels.cpp
platforms/reference/src/ReferenceKernels.cpp
+12
-1
No files found.
platforms/cpu/src/CpuKernels.cpp
View file @
a7c50469
...
...
@@ -712,12 +712,23 @@ double CpuCalcNonbondedForceKernel::execute(ContextImpl& context, bool includeFo
void
CpuCalcNonbondedForceKernel
::
copyParametersToContext
(
ContextImpl
&
context
,
const
NonbondedForce
&
force
)
{
if
(
force
.
getNumParticles
()
!=
numParticles
)
throw
OpenMMException
(
"updateParametersInContext: The number of particles has changed"
);
// Identify which exceptions are 1-4 interactions.
set
<
int
>
exceptionsWithOffsets
;
for
(
int
i
=
0
;
i
<
force
.
getNumExceptionParameterOffsets
();
i
++
)
{
string
param
;
int
exception
;
double
charge
,
sigma
,
epsilon
;
force
.
getExceptionParameterOffset
(
i
,
param
,
exception
,
charge
,
sigma
,
epsilon
);
exceptionsWithOffsets
.
insert
(
exception
);
}
vector
<
int
>
nb14s
;
for
(
int
i
=
0
;
i
<
force
.
getNumExceptions
();
i
++
)
{
int
particle1
,
particle2
;
double
chargeProd
,
sigma
,
epsilon
;
force
.
getExceptionParameters
(
i
,
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
);
if
(
chargeProd
!=
0.0
||
epsilon
!=
0.0
)
if
(
chargeProd
!=
0.0
||
epsilon
!=
0.0
||
exceptionsWithOffsets
.
find
(
i
)
!=
exceptionsWithOffsets
.
end
()
)
nb14s
.
push_back
(
i
);
}
if
(
nb14s
.
size
()
!=
num14
)
...
...
platforms/reference/src/ReferenceKernels.cpp
View file @
a7c50469
...
...
@@ -1015,12 +1015,23 @@ double ReferenceCalcNonbondedForceKernel::execute(ContextImpl& context, bool inc
void
ReferenceCalcNonbondedForceKernel
::
copyParametersToContext
(
ContextImpl
&
context
,
const
NonbondedForce
&
force
)
{
if
(
force
.
getNumParticles
()
!=
numParticles
)
throw
OpenMMException
(
"updateParametersInContext: The number of particles has changed"
);
// Identify which exceptions are 1-4 interactions.
set
<
int
>
exceptionsWithOffsets
;
for
(
int
i
=
0
;
i
<
force
.
getNumExceptionParameterOffsets
();
i
++
)
{
string
param
;
int
exception
;
double
charge
,
sigma
,
epsilon
;
force
.
getExceptionParameterOffset
(
i
,
param
,
exception
,
charge
,
sigma
,
epsilon
);
exceptionsWithOffsets
.
insert
(
exception
);
}
vector
<
int
>
nb14s
;
for
(
int
i
=
0
;
i
<
force
.
getNumExceptions
();
i
++
)
{
int
particle1
,
particle2
;
double
chargeProd
,
sigma
,
epsilon
;
force
.
getExceptionParameters
(
i
,
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
);
if
(
chargeProd
!=
0.0
||
epsilon
!=
0.0
)
if
(
chargeProd
!=
0.0
||
epsilon
!=
0.0
||
exceptionsWithOffsets
.
find
(
i
)
!=
exceptionsWithOffsets
.
end
()
)
nb14s
.
push_back
(
i
);
}
if
(
nb14s
.
size
()
!=
num14
)
...
...
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