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
4a26bca4
Unverified
Commit
4a26bca4
authored
Apr 12, 2023
by
Peter Eastman
Committed by
GitHub
Apr 12, 2023
Browse files
Ignore changes to force group after context creation (#4029)
parent
c7efe3d4
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
44 additions
and
22 deletions
+44
-22
openmmapi/include/openmm/internal/ForceImpl.h
openmmapi/include/openmm/internal/ForceImpl.h
+1
-0
openmmapi/include/openmm/internal/NonbondedForceImpl.h
openmmapi/include/openmm/internal/NonbondedForceImpl.h
+2
-0
openmmapi/src/CMAPTorsionForceImpl.cpp
openmmapi/src/CMAPTorsionForceImpl.cpp
+2
-1
openmmapi/src/CustomAngleForceImpl.cpp
openmmapi/src/CustomAngleForceImpl.cpp
+2
-1
openmmapi/src/CustomBondForceImpl.cpp
openmmapi/src/CustomBondForceImpl.cpp
+2
-1
openmmapi/src/CustomCVForceImpl.cpp
openmmapi/src/CustomCVForceImpl.cpp
+2
-1
openmmapi/src/CustomCentroidBondForceImpl.cpp
openmmapi/src/CustomCentroidBondForceImpl.cpp
+2
-1
openmmapi/src/CustomCompoundBondForceImpl.cpp
openmmapi/src/CustomCompoundBondForceImpl.cpp
+2
-1
openmmapi/src/CustomExternalForceImpl.cpp
openmmapi/src/CustomExternalForceImpl.cpp
+2
-1
openmmapi/src/CustomGBForceImpl.cpp
openmmapi/src/CustomGBForceImpl.cpp
+2
-1
openmmapi/src/CustomHbondForceImpl.cpp
openmmapi/src/CustomHbondForceImpl.cpp
+2
-1
openmmapi/src/CustomManyParticleForceImpl.cpp
openmmapi/src/CustomManyParticleForceImpl.cpp
+2
-1
openmmapi/src/CustomNonbondedForceImpl.cpp
openmmapi/src/CustomNonbondedForceImpl.cpp
+2
-1
openmmapi/src/CustomTorsionForceImpl.cpp
openmmapi/src/CustomTorsionForceImpl.cpp
+2
-1
openmmapi/src/GBSAOBCForceImpl.cpp
openmmapi/src/GBSAOBCForceImpl.cpp
+2
-1
openmmapi/src/GayBerneForceImpl.cpp
openmmapi/src/GayBerneForceImpl.cpp
+2
-1
openmmapi/src/HarmonicAngleForceImpl.cpp
openmmapi/src/HarmonicAngleForceImpl.cpp
+2
-1
openmmapi/src/HarmonicBondForceImpl.cpp
openmmapi/src/HarmonicBondForceImpl.cpp
+2
-1
openmmapi/src/NonbondedForceImpl.cpp
openmmapi/src/NonbondedForceImpl.cpp
+7
-5
openmmapi/src/PeriodicTorsionForceImpl.cpp
openmmapi/src/PeriodicTorsionForceImpl.cpp
+2
-1
No files found.
openmmapi/include/openmm/internal/ForceImpl.h
View file @
4a26bca4
...
@@ -119,6 +119,7 @@ protected:
...
@@ -119,6 +119,7 @@ protected:
ContextImpl
&
getContextImpl
(
Context
&
context
)
const
{
ContextImpl
&
getContextImpl
(
Context
&
context
)
const
{
return
context
.
getImpl
();
return
context
.
getImpl
();
}
}
int
forceGroup
;
};
};
}
// namespace OpenMM
}
// namespace OpenMM
...
...
openmmapi/include/openmm/internal/NonbondedForceImpl.h
View file @
4a26bca4
...
@@ -86,6 +86,8 @@ private:
...
@@ -86,6 +86,8 @@ private:
static
double
evalIntegral
(
double
r
,
double
rs
,
double
rc
,
double
sigma
);
static
double
evalIntegral
(
double
r
,
double
rs
,
double
rc
,
double
sigma
);
const
NonbondedForce
&
owner
;
const
NonbondedForce
&
owner
;
Kernel
kernel
;
Kernel
kernel
;
int
recipForceGroup
;
bool
includeDirectSpace
;
};
};
}
// namespace OpenMM
}
// namespace OpenMM
...
...
openmmapi/src/CMAPTorsionForceImpl.cpp
View file @
4a26bca4
...
@@ -43,6 +43,7 @@ using namespace OpenMM;
...
@@ -43,6 +43,7 @@ using namespace OpenMM;
using
namespace
std
;
using
namespace
std
;
CMAPTorsionForceImpl
::
CMAPTorsionForceImpl
(
const
CMAPTorsionForce
&
owner
)
:
owner
(
owner
)
{
CMAPTorsionForceImpl
::
CMAPTorsionForceImpl
(
const
CMAPTorsionForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
CMAPTorsionForceImpl
::~
CMAPTorsionForceImpl
()
{
CMAPTorsionForceImpl
::~
CMAPTorsionForceImpl
()
{
...
@@ -73,7 +74,7 @@ void CMAPTorsionForceImpl::initialize(ContextImpl& context) {
...
@@ -73,7 +74,7 @@ void CMAPTorsionForceImpl::initialize(ContextImpl& context) {
}
}
double
CMAPTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
CMAPTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcCMAPTorsionForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcCMAPTorsionForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/CustomAngleForceImpl.cpp
View file @
4a26bca4
...
@@ -44,6 +44,7 @@ using std::string;
...
@@ -44,6 +44,7 @@ using std::string;
using
std
::
stringstream
;
using
std
::
stringstream
;
CustomAngleForceImpl
::
CustomAngleForceImpl
(
const
CustomAngleForce
&
owner
)
:
owner
(
owner
)
{
CustomAngleForceImpl
::
CustomAngleForceImpl
(
const
CustomAngleForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
CustomAngleForceImpl
::~
CustomAngleForceImpl
()
{
CustomAngleForceImpl
::~
CustomAngleForceImpl
()
{
...
@@ -78,7 +79,7 @@ void CustomAngleForceImpl::initialize(ContextImpl& context) {
...
@@ -78,7 +79,7 @@ void CustomAngleForceImpl::initialize(ContextImpl& context) {
}
}
double
CustomAngleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
CustomAngleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcCustomAngleForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcCustomAngleForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/CustomBondForceImpl.cpp
View file @
4a26bca4
...
@@ -44,6 +44,7 @@ using std::string;
...
@@ -44,6 +44,7 @@ using std::string;
using
std
::
stringstream
;
using
std
::
stringstream
;
CustomBondForceImpl
::
CustomBondForceImpl
(
const
CustomBondForce
&
owner
)
:
owner
(
owner
)
{
CustomBondForceImpl
::
CustomBondForceImpl
(
const
CustomBondForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
CustomBondForceImpl
::~
CustomBondForceImpl
()
{
CustomBondForceImpl
::~
CustomBondForceImpl
()
{
...
@@ -79,7 +80,7 @@ void CustomBondForceImpl::initialize(ContextImpl& context) {
...
@@ -79,7 +80,7 @@ void CustomBondForceImpl::initialize(ContextImpl& context) {
}
}
double
CustomBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
CustomBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcCustomBondForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcCustomBondForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/CustomCVForceImpl.cpp
View file @
4a26bca4
...
@@ -42,6 +42,7 @@ using namespace std;
...
@@ -42,6 +42,7 @@ using namespace std;
CustomCVForceImpl
::
CustomCVForceImpl
(
const
CustomCVForce
&
owner
)
:
owner
(
owner
),
innerIntegrator
(
1.0
),
CustomCVForceImpl
::
CustomCVForceImpl
(
const
CustomCVForce
&
owner
)
:
owner
(
owner
),
innerIntegrator
(
1.0
),
innerContext
(
NULL
)
{
innerContext
(
NULL
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
CustomCVForceImpl
::~
CustomCVForceImpl
()
{
CustomCVForceImpl
::~
CustomCVForceImpl
()
{
...
@@ -80,7 +81,7 @@ void CustomCVForceImpl::initialize(ContextImpl& context) {
...
@@ -80,7 +81,7 @@ void CustomCVForceImpl::initialize(ContextImpl& context) {
}
}
double
CustomCVForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
CustomCVForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcCustomCVForceKernel
>
().
execute
(
context
,
getContextImpl
(
*
innerContext
),
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcCustomCVForceKernel
>
().
execute
(
context
,
getContextImpl
(
*
innerContext
),
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/CustomCentroidBondForceImpl.cpp
View file @
4a26bca4
...
@@ -68,6 +68,7 @@ public:
...
@@ -68,6 +68,7 @@ public:
};
};
CustomCentroidBondForceImpl
::
CustomCentroidBondForceImpl
(
const
CustomCentroidBondForce
&
owner
)
:
owner
(
owner
)
{
CustomCentroidBondForceImpl
::
CustomCentroidBondForceImpl
(
const
CustomCentroidBondForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
CustomCentroidBondForceImpl
::~
CustomCentroidBondForceImpl
()
{
CustomCentroidBondForceImpl
::~
CustomCentroidBondForceImpl
()
{
...
@@ -120,7 +121,7 @@ void CustomCentroidBondForceImpl::initialize(ContextImpl& context) {
...
@@ -120,7 +121,7 @@ void CustomCentroidBondForceImpl::initialize(ContextImpl& context) {
}
}
double
CustomCentroidBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
CustomCentroidBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcCustomCentroidBondForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcCustomCentroidBondForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/CustomCompoundBondForceImpl.cpp
View file @
4a26bca4
...
@@ -72,6 +72,7 @@ public:
...
@@ -72,6 +72,7 @@ public:
};
};
CustomCompoundBondForceImpl
::
CustomCompoundBondForceImpl
(
const
CustomCompoundBondForce
&
owner
)
:
owner
(
owner
)
{
CustomCompoundBondForceImpl
::
CustomCompoundBondForceImpl
(
const
CustomCompoundBondForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
CustomCompoundBondForceImpl
::~
CustomCompoundBondForceImpl
()
{
CustomCompoundBondForceImpl
::~
CustomCompoundBondForceImpl
()
{
...
@@ -106,7 +107,7 @@ void CustomCompoundBondForceImpl::initialize(ContextImpl& context) {
...
@@ -106,7 +107,7 @@ void CustomCompoundBondForceImpl::initialize(ContextImpl& context) {
}
}
double
CustomCompoundBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
CustomCompoundBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcCustomCompoundBondForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcCustomCompoundBondForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/CustomExternalForceImpl.cpp
View file @
4a26bca4
...
@@ -44,6 +44,7 @@ using std::string;
...
@@ -44,6 +44,7 @@ using std::string;
using
std
::
stringstream
;
using
std
::
stringstream
;
CustomExternalForceImpl
::
CustomExternalForceImpl
(
const
CustomExternalForce
&
owner
)
:
owner
(
owner
)
{
CustomExternalForceImpl
::
CustomExternalForceImpl
(
const
CustomExternalForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
CustomExternalForceImpl
::~
CustomExternalForceImpl
()
{
CustomExternalForceImpl
::~
CustomExternalForceImpl
()
{
...
@@ -77,7 +78,7 @@ void CustomExternalForceImpl::initialize(ContextImpl& context) {
...
@@ -77,7 +78,7 @@ void CustomExternalForceImpl::initialize(ContextImpl& context) {
}
}
double
CustomExternalForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
CustomExternalForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcCustomExternalForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcCustomExternalForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/CustomGBForceImpl.cpp
View file @
4a26bca4
...
@@ -45,6 +45,7 @@ using std::string;
...
@@ -45,6 +45,7 @@ using std::string;
using
std
::
stringstream
;
using
std
::
stringstream
;
CustomGBForceImpl
::
CustomGBForceImpl
(
const
CustomGBForce
&
owner
)
:
owner
(
owner
)
{
CustomGBForceImpl
::
CustomGBForceImpl
(
const
CustomGBForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
CustomGBForceImpl
::~
CustomGBForceImpl
()
{
CustomGBForceImpl
::~
CustomGBForceImpl
()
{
...
@@ -107,7 +108,7 @@ void CustomGBForceImpl::initialize(ContextImpl& context) {
...
@@ -107,7 +108,7 @@ void CustomGBForceImpl::initialize(ContextImpl& context) {
}
}
double
CustomGBForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
CustomGBForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcCustomGBForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcCustomGBForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/CustomHbondForceImpl.cpp
View file @
4a26bca4
...
@@ -73,6 +73,7 @@ public:
...
@@ -73,6 +73,7 @@ public:
};
};
CustomHbondForceImpl
::
CustomHbondForceImpl
(
const
CustomHbondForce
&
owner
)
:
owner
(
owner
)
{
CustomHbondForceImpl
::
CustomHbondForceImpl
(
const
CustomHbondForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
CustomHbondForceImpl
::~
CustomHbondForceImpl
()
{
CustomHbondForceImpl
::~
CustomHbondForceImpl
()
{
...
@@ -180,7 +181,7 @@ void CustomHbondForceImpl::initialize(ContextImpl& context) {
...
@@ -180,7 +181,7 @@ void CustomHbondForceImpl::initialize(ContextImpl& context) {
}
}
double
CustomHbondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
CustomHbondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcCustomHbondForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcCustomHbondForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/CustomManyParticleForceImpl.cpp
View file @
4a26bca4
...
@@ -73,6 +73,7 @@ public:
...
@@ -73,6 +73,7 @@ public:
};
};
CustomManyParticleForceImpl
::
CustomManyParticleForceImpl
(
const
CustomManyParticleForce
&
owner
)
:
owner
(
owner
)
{
CustomManyParticleForceImpl
::
CustomManyParticleForceImpl
(
const
CustomManyParticleForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
CustomManyParticleForceImpl
::~
CustomManyParticleForceImpl
()
{
CustomManyParticleForceImpl
::~
CustomManyParticleForceImpl
()
{
...
@@ -136,7 +137,7 @@ void CustomManyParticleForceImpl::initialize(ContextImpl& context) {
...
@@ -136,7 +137,7 @@ void CustomManyParticleForceImpl::initialize(ContextImpl& context) {
}
}
double
CustomManyParticleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
CustomManyParticleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcCustomManyParticleForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcCustomManyParticleForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/CustomNonbondedForceImpl.cpp
View file @
4a26bca4
...
@@ -51,6 +51,7 @@ using namespace OpenMM;
...
@@ -51,6 +51,7 @@ using namespace OpenMM;
using
namespace
std
;
using
namespace
std
;
CustomNonbondedForceImpl
::
CustomNonbondedForceImpl
(
const
CustomNonbondedForce
&
owner
)
:
owner
(
owner
)
{
CustomNonbondedForceImpl
::
CustomNonbondedForceImpl
(
const
CustomNonbondedForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
CustomNonbondedForceImpl
::~
CustomNonbondedForceImpl
()
{
CustomNonbondedForceImpl
::~
CustomNonbondedForceImpl
()
{
...
@@ -139,7 +140,7 @@ void CustomNonbondedForceImpl::initialize(ContextImpl& context) {
...
@@ -139,7 +140,7 @@ void CustomNonbondedForceImpl::initialize(ContextImpl& context) {
}
}
double
CustomNonbondedForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
CustomNonbondedForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcCustomNonbondedForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcCustomNonbondedForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/CustomTorsionForceImpl.cpp
View file @
4a26bca4
...
@@ -44,6 +44,7 @@ using std::string;
...
@@ -44,6 +44,7 @@ using std::string;
using
std
::
stringstream
;
using
std
::
stringstream
;
CustomTorsionForceImpl
::
CustomTorsionForceImpl
(
const
CustomTorsionForce
&
owner
)
:
owner
(
owner
)
{
CustomTorsionForceImpl
::
CustomTorsionForceImpl
(
const
CustomTorsionForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
CustomTorsionForceImpl
::~
CustomTorsionForceImpl
()
{
CustomTorsionForceImpl
::~
CustomTorsionForceImpl
()
{
...
@@ -79,7 +80,7 @@ void CustomTorsionForceImpl::initialize(ContextImpl& context) {
...
@@ -79,7 +80,7 @@ void CustomTorsionForceImpl::initialize(ContextImpl& context) {
}
}
double
CustomTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
CustomTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcCustomTorsionForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcCustomTorsionForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/GBSAOBCForceImpl.cpp
View file @
4a26bca4
...
@@ -40,6 +40,7 @@ using namespace OpenMM;
...
@@ -40,6 +40,7 @@ using namespace OpenMM;
using
std
::
vector
;
using
std
::
vector
;
GBSAOBCForceImpl
::
GBSAOBCForceImpl
(
const
GBSAOBCForce
&
owner
)
:
owner
(
owner
)
{
GBSAOBCForceImpl
::
GBSAOBCForceImpl
(
const
GBSAOBCForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
void
GBSAOBCForceImpl
::
initialize
(
ContextImpl
&
context
)
{
void
GBSAOBCForceImpl
::
initialize
(
ContextImpl
&
context
)
{
...
@@ -65,7 +66,7 @@ void GBSAOBCForceImpl::initialize(ContextImpl& context) {
...
@@ -65,7 +66,7 @@ void GBSAOBCForceImpl::initialize(ContextImpl& context) {
}
}
double
GBSAOBCForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
GBSAOBCForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcGBSAOBCForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcGBSAOBCForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/GayBerneForceImpl.cpp
View file @
4a26bca4
...
@@ -41,6 +41,7 @@ using namespace OpenMM;
...
@@ -41,6 +41,7 @@ using namespace OpenMM;
using
namespace
std
;
using
namespace
std
;
GayBerneForceImpl
::
GayBerneForceImpl
(
const
GayBerneForce
&
owner
)
:
owner
(
owner
)
{
GayBerneForceImpl
::
GayBerneForceImpl
(
const
GayBerneForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
GayBerneForceImpl
::~
GayBerneForceImpl
()
{
GayBerneForceImpl
::~
GayBerneForceImpl
()
{
...
@@ -122,7 +123,7 @@ void GayBerneForceImpl::initialize(ContextImpl& context) {
...
@@ -122,7 +123,7 @@ void GayBerneForceImpl::initialize(ContextImpl& context) {
}
}
double
GayBerneForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
GayBerneForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcGayBerneForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcGayBerneForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/HarmonicAngleForceImpl.cpp
View file @
4a26bca4
...
@@ -43,6 +43,7 @@ using namespace OpenMM;
...
@@ -43,6 +43,7 @@ using namespace OpenMM;
using
namespace
std
;
using
namespace
std
;
HarmonicAngleForceImpl
::
HarmonicAngleForceImpl
(
const
HarmonicAngleForce
&
owner
)
:
owner
(
owner
)
{
HarmonicAngleForceImpl
::
HarmonicAngleForceImpl
(
const
HarmonicAngleForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
HarmonicAngleForceImpl
::~
HarmonicAngleForceImpl
()
{
HarmonicAngleForceImpl
::~
HarmonicAngleForceImpl
()
{
...
@@ -70,7 +71,7 @@ void HarmonicAngleForceImpl::initialize(ContextImpl& context) {
...
@@ -70,7 +71,7 @@ void HarmonicAngleForceImpl::initialize(ContextImpl& context) {
}
}
double
HarmonicAngleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
HarmonicAngleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcHarmonicAngleForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcHarmonicAngleForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/HarmonicBondForceImpl.cpp
View file @
4a26bca4
...
@@ -39,6 +39,7 @@ using namespace OpenMM;
...
@@ -39,6 +39,7 @@ using namespace OpenMM;
using
namespace
std
;
using
namespace
std
;
HarmonicBondForceImpl
::
HarmonicBondForceImpl
(
const
HarmonicBondForce
&
owner
)
:
owner
(
owner
)
{
HarmonicBondForceImpl
::
HarmonicBondForceImpl
(
const
HarmonicBondForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
HarmonicBondForceImpl
::~
HarmonicBondForceImpl
()
{
HarmonicBondForceImpl
::~
HarmonicBondForceImpl
()
{
...
@@ -66,7 +67,7 @@ void HarmonicBondForceImpl::initialize(ContextImpl& context) {
...
@@ -66,7 +67,7 @@ void HarmonicBondForceImpl::initialize(ContextImpl& context) {
}
}
double
HarmonicBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
HarmonicBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcHarmonicBondForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcHarmonicBondForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/NonbondedForceImpl.cpp
View file @
4a26bca4
...
@@ -46,6 +46,11 @@ using namespace OpenMM;
...
@@ -46,6 +46,11 @@ using namespace OpenMM;
using
namespace
std
;
using
namespace
std
;
NonbondedForceImpl
::
NonbondedForceImpl
(
const
NonbondedForce
&
owner
)
:
owner
(
owner
)
{
NonbondedForceImpl
::
NonbondedForceImpl
(
const
NonbondedForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
recipForceGroup
=
owner
.
getReciprocalSpaceForceGroup
();
if
(
recipForceGroup
<
0
)
recipForceGroup
=
owner
.
getForceGroup
();
includeDirectSpace
=
owner
.
getIncludeDirectSpace
();
}
}
NonbondedForceImpl
::~
NonbondedForceImpl
()
{
NonbondedForceImpl
::~
NonbondedForceImpl
()
{
...
@@ -136,11 +141,8 @@ void NonbondedForceImpl::initialize(ContextImpl& context) {
...
@@ -136,11 +141,8 @@ void NonbondedForceImpl::initialize(ContextImpl& context) {
}
}
double
NonbondedForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
NonbondedForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
bool
includeDirect
=
(
owner
.
getIncludeDirectSpace
()
&&
(
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
);
bool
includeDirect
=
(
includeDirectSpace
&&
(
groups
&
(
1
<<
forceGroup
))
!=
0
);
int
reciprocalGroup
=
owner
.
getReciprocalSpaceForceGroup
();
bool
includeReciprocal
=
((
groups
&
(
1
<<
recipForceGroup
))
!=
0
);
if
(
reciprocalGroup
<
0
)
reciprocalGroup
=
owner
.
getForceGroup
();
bool
includeReciprocal
=
((
groups
&
(
1
<<
reciprocalGroup
))
!=
0
);
return
kernel
.
getAs
<
CalcNonbondedForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
,
includeDirect
,
includeReciprocal
);
return
kernel
.
getAs
<
CalcNonbondedForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
,
includeDirect
,
includeReciprocal
);
}
}
...
...
openmmapi/src/PeriodicTorsionForceImpl.cpp
View file @
4a26bca4
...
@@ -39,6 +39,7 @@ using namespace OpenMM;
...
@@ -39,6 +39,7 @@ using namespace OpenMM;
using
namespace
std
;
using
namespace
std
;
PeriodicTorsionForceImpl
::
PeriodicTorsionForceImpl
(
const
PeriodicTorsionForce
&
owner
)
:
owner
(
owner
)
{
PeriodicTorsionForceImpl
::
PeriodicTorsionForceImpl
(
const
PeriodicTorsionForce
&
owner
)
:
owner
(
owner
)
{
forceGroup
=
owner
.
getForceGroup
();
}
}
PeriodicTorsionForceImpl
::~
PeriodicTorsionForceImpl
()
{
PeriodicTorsionForceImpl
::~
PeriodicTorsionForceImpl
()
{
...
@@ -66,7 +67,7 @@ void PeriodicTorsionForceImpl::initialize(ContextImpl& context) {
...
@@ -66,7 +67,7 @@ void PeriodicTorsionForceImpl::initialize(ContextImpl& context) {
}
}
double
PeriodicTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
PeriodicTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getF
orceGroup
()
))
!=
0
)
if
((
groups
&
(
1
<<
f
orceGroup
))
!=
0
)
return
kernel
.
getAs
<
CalcPeriodicTorsionForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcPeriodicTorsionForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
Prev
1
2
Next
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