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
feb79f77
Commit
feb79f77
authored
Jun 28, 2017
by
peastman
Committed by
GitHub
Jun 28, 2017
Browse files
Merge pull request #1850 from peastman/customgb
Fixed bug in CustomGBForce
parents
7cdd6d16
b2e9b5ac
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
platforms/cpu/include/CpuKernels.h
platforms/cpu/include/CpuKernels.h
+2
-1
platforms/cpu/src/CpuKernels.cpp
platforms/cpu/src/CpuKernels.cpp
+5
-2
platforms/reference/src/ReferenceKernels.cpp
platforms/reference/src/ReferenceKernels.cpp
+2
-1
tests/TestCustomGBForce.h
tests/TestCustomGBForce.h
+1
-0
No files found.
platforms/cpu/include/CpuKernels.h
View file @
feb79f77
...
...
@@ -373,7 +373,7 @@ private:
class
CpuCalcCustomGBForceKernel
:
public
CalcCustomGBForceKernel
{
public:
CpuCalcCustomGBForceKernel
(
std
::
string
name
,
const
Platform
&
platform
,
CpuPlatform
::
PlatformData
&
data
)
:
CalcCustomGBForceKernel
(
name
,
platform
),
data
(
data
)
{
CalcCustomGBForceKernel
(
name
,
platform
),
data
(
data
)
,
ixn
(
NULL
),
neighborList
(
NULL
)
{
}
~
CpuCalcCustomGBForceKernel
();
/**
...
...
@@ -406,6 +406,7 @@ private:
double
**
particleParamArray
;
double
nonbondedCutoff
;
CpuCustomGBForce
*
ixn
;
CpuNeighborList
*
neighborList
;
std
::
vector
<
std
::
set
<
int
>
>
exclusions
;
std
::
vector
<
std
::
string
>
particleParameterNames
,
globalParameterNames
,
energyParamDerivNames
,
valueNames
;
std
::
vector
<
OpenMM
::
CustomGBForce
::
ComputationType
>
valueTypes
;
...
...
platforms/cpu/src/CpuKernels.cpp
View file @
feb79f77
...
...
@@ -1018,6 +1018,8 @@ CpuCalcCustomGBForceKernel::~CpuCalcCustomGBForceKernel() {
}
if
(
ixn
!=
NULL
)
delete
ixn
;
if
(
neighborList
!=
NULL
)
delete
neighborList
;
}
void
CpuCalcCustomGBForceKernel
::
initialize
(
const
System
&
system
,
const
CustomGBForce
&
force
)
{
...
...
@@ -1064,7 +1066,7 @@ void CpuCalcCustomGBForceKernel::initialize(const System& system, const CustomGB
nonbondedMethod
=
CalcCustomGBForceKernel
::
NonbondedMethod
(
force
.
getNonbondedMethod
());
nonbondedCutoff
=
force
.
getCutoffDistance
();
if
(
nonbondedMethod
!=
NoCutoff
)
data
.
requestNeighborList
(
nonbondedCutoff
,
0.25
*
nonbondedCutoff
,
force
.
getNumExclusions
()
>
0
,
exclusions
);
neighborList
=
new
CpuNeighborList
(
4
);
// Create custom functions for the tabulated functions.
...
...
@@ -1171,7 +1173,8 @@ double CpuCalcCustomGBForceKernel::execute(ContextImpl& context, bool includeFor
ixn
->
setPeriodic
(
extractBoxSize
(
context
));
if
(
nonbondedMethod
!=
NoCutoff
)
{
vector
<
set
<
int
>
>
noExclusions
(
numParticles
);
ixn
->
setUseCutoff
(
nonbondedCutoff
,
*
data
.
neighborList
);
neighborList
->
computeNeighborList
(
numParticles
,
data
.
posq
,
noExclusions
,
boxVectors
,
data
.
isPeriodic
,
nonbondedCutoff
,
data
.
threads
);
ixn
->
setUseCutoff
(
nonbondedCutoff
,
*
neighborList
);
}
map
<
string
,
double
>
globalParameters
;
for
(
auto
&
name
:
globalParameterNames
)
...
...
platforms/reference/src/ReferenceKernels.cpp
View file @
feb79f77
...
...
@@ -1474,7 +1474,8 @@ double ReferenceCalcCustomGBForceKernel::execute(ContextImpl& context, bool incl
if
(
periodic
)
ixn
.
setPeriodic
(
extractBoxVectors
(
context
));
if
(
nonbondedMethod
!=
NoCutoff
)
{
computeNeighborListVoxelHash
(
*
neighborList
,
numParticles
,
posData
,
exclusions
,
extractBoxVectors
(
context
),
periodic
,
nonbondedCutoff
,
0.0
);
vector
<
set
<
int
>
>
empty
(
context
.
getSystem
().
getNumParticles
());
// Don't omit exclusions from the neighbor list
computeNeighborListVoxelHash
(
*
neighborList
,
numParticles
,
posData
,
empty
,
extractBoxVectors
(
context
),
periodic
,
nonbondedCutoff
,
0.0
);
ixn
.
setUseCutoff
(
nonbondedCutoff
,
*
neighborList
);
}
map
<
string
,
double
>
globalParameters
;
...
...
tests/TestCustomGBForce.h
View file @
feb79f77
...
...
@@ -118,6 +118,7 @@ void testOBC(GBSAOBCForce::NonbondedMethod obcMethod, CustomGBForce::NonbondedMe
params
[
1
]
=
0.1
;
custom
->
addParticle
(
params
);
}
custom
->
addExclusion
(
2
*
i
,
2
*
i
+
1
);
positions
[
2
*
i
]
=
Vec3
(
boxSize
*
genrand_real2
(
sfmt
),
boxSize
*
genrand_real2
(
sfmt
),
boxSize
*
genrand_real2
(
sfmt
));
positions
[
2
*
i
+
1
]
=
Vec3
(
positions
[
2
*
i
][
0
]
+
1.0
,
positions
[
2
*
i
][
1
],
positions
[
2
*
i
][
2
]);
velocities
[
2
*
i
]
=
Vec3
(
genrand_real2
(
sfmt
),
genrand_real2
(
sfmt
),
genrand_real2
(
sfmt
));
...
...
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