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
a4020466
Commit
a4020466
authored
Jul 14, 2009
by
Peter Eastman
Browse files
Renamed OpenMMContext to Context
parent
95b8dbd6
Changes
139
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
90 additions
and
90 deletions
+90
-90
openmmapi/src/HarmonicBondForceImpl.cpp
openmmapi/src/HarmonicBondForceImpl.cpp
+4
-4
openmmapi/src/LangevinIntegrator.cpp
openmmapi/src/LangevinIntegrator.cpp
+3
-3
openmmapi/src/NonbondedForceImpl.cpp
openmmapi/src/NonbondedForceImpl.cpp
+4
-4
openmmapi/src/OpenMMContext.cpp
openmmapi/src/OpenMMContext.cpp
+23
-23
openmmapi/src/OpenMMContextImpl.cpp
openmmapi/src/OpenMMContextImpl.cpp
+14
-14
openmmapi/src/PeriodicTorsionForceImpl.cpp
openmmapi/src/PeriodicTorsionForceImpl.cpp
+4
-4
openmmapi/src/RBTorsionForceImpl.cpp
openmmapi/src/RBTorsionForceImpl.cpp
+4
-4
openmmapi/src/VariableLangevinIntegrator.cpp
openmmapi/src/VariableLangevinIntegrator.cpp
+3
-3
openmmapi/src/VariableVerletIntegrator.cpp
openmmapi/src/VariableVerletIntegrator.cpp
+3
-3
openmmapi/src/VerletIntegrator.cpp
openmmapi/src/VerletIntegrator.cpp
+3
-3
platforms/brook/include/BrookKernelFactory.h
platforms/brook/include/BrookKernelFactory.h
+1
-1
platforms/brook/include/BrookPlatform.h
platforms/brook/include/BrookPlatform.h
+4
-4
platforms/brook/include/BrookStreamFactory.h
platforms/brook/include/BrookStreamFactory.h
+1
-1
platforms/brook/src/BrookBonded.h
platforms/brook/src/BrookBonded.h
+1
-1
platforms/brook/src/BrookCalcGBSAOBCForceKernel.cpp
platforms/brook/src/BrookCalcGBSAOBCForceKernel.cpp
+4
-4
platforms/brook/src/BrookCalcGBSAOBCForceKernel.h
platforms/brook/src/BrookCalcGBSAOBCForceKernel.h
+2
-2
platforms/brook/src/BrookCalcHarmonicAngleForceKernel.cpp
platforms/brook/src/BrookCalcHarmonicAngleForceKernel.cpp
+4
-4
platforms/brook/src/BrookCalcHarmonicAngleForceKernel.h
platforms/brook/src/BrookCalcHarmonicAngleForceKernel.h
+2
-2
platforms/brook/src/BrookCalcHarmonicBondForceKernel.cpp
platforms/brook/src/BrookCalcHarmonicBondForceKernel.cpp
+4
-4
platforms/brook/src/BrookCalcHarmonicBondForceKernel.h
platforms/brook/src/BrookCalcHarmonicBondForceKernel.h
+2
-2
No files found.
openmmapi/src/HarmonicBondForceImpl.cpp
View file @
a4020466
...
...
@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/internal/
OpenMM
ContextImpl.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/internal/HarmonicBondForceImpl.h"
#include "openmm/kernels.h"
...
...
@@ -44,16 +44,16 @@ HarmonicBondForceImpl::HarmonicBondForceImpl(HarmonicBondForce& owner) : owner(o
HarmonicBondForceImpl
::~
HarmonicBondForceImpl
()
{
}
void
HarmonicBondForceImpl
::
initialize
(
OpenMM
ContextImpl
&
context
)
{
void
HarmonicBondForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcHarmonicBondForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcHarmonicBondForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
void
HarmonicBondForceImpl
::
calcForces
(
OpenMM
ContextImpl
&
context
,
Stream
&
forces
)
{
void
HarmonicBondForceImpl
::
calcForces
(
ContextImpl
&
context
,
Stream
&
forces
)
{
dynamic_cast
<
CalcHarmonicBondForceKernel
&>
(
kernel
.
getImpl
()).
executeForces
(
context
);
}
double
HarmonicBondForceImpl
::
calcEnergy
(
OpenMM
ContextImpl
&
context
)
{
double
HarmonicBondForceImpl
::
calcEnergy
(
ContextImpl
&
context
)
{
return
dynamic_cast
<
CalcHarmonicBondForceKernel
&>
(
kernel
.
getImpl
()).
executeEnergy
(
context
);
}
...
...
openmmapi/src/LangevinIntegrator.cpp
View file @
a4020466
...
...
@@ -30,8 +30,8 @@
* -------------------------------------------------------------------------- */
#include "openmm/LangevinIntegrator.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/internal/
OpenMM
ContextImpl.h"
#include "openmm/Context.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/kernels.h"
#include <ctime>
#include <string>
...
...
@@ -48,7 +48,7 @@ LangevinIntegrator::LangevinIntegrator(double temperature, double frictionCoeff,
setRandomNumberSeed
((
int
)
time
(
NULL
));
}
void
LangevinIntegrator
::
initialize
(
OpenMM
ContextImpl
&
contextRef
)
{
void
LangevinIntegrator
::
initialize
(
ContextImpl
&
contextRef
)
{
context
=
&
contextRef
;
kernel
=
context
->
getPlatform
().
createKernel
(
IntegrateLangevinStepKernel
::
Name
(),
contextRef
);
dynamic_cast
<
IntegrateLangevinStepKernel
&>
(
kernel
.
getImpl
()).
initialize
(
contextRef
.
getSystem
(),
*
this
);
...
...
openmmapi/src/NonbondedForceImpl.cpp
View file @
a4020466
...
...
@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/OpenMMException.h"
#include "openmm/internal/
OpenMM
ContextImpl.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/internal/NonbondedForceImpl.h"
#include "openmm/kernels.h"
#include <sstream>
...
...
@@ -47,7 +47,7 @@ NonbondedForceImpl::NonbondedForceImpl(NonbondedForce& owner) : owner(owner) {
NonbondedForceImpl
::~
NonbondedForceImpl
()
{
}
void
NonbondedForceImpl
::
initialize
(
OpenMM
ContextImpl
&
context
)
{
void
NonbondedForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcNonbondedForceKernel
::
Name
(),
context
);
// Check for errors in the specification of exceptions.
...
...
@@ -86,11 +86,11 @@ void NonbondedForceImpl::initialize(OpenMMContextImpl& context) {
dynamic_cast
<
CalcNonbondedForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
void
NonbondedForceImpl
::
calcForces
(
OpenMM
ContextImpl
&
context
,
Stream
&
forces
)
{
void
NonbondedForceImpl
::
calcForces
(
ContextImpl
&
context
,
Stream
&
forces
)
{
dynamic_cast
<
CalcNonbondedForceKernel
&>
(
kernel
.
getImpl
()).
executeForces
(
context
);
}
double
NonbondedForceImpl
::
calcEnergy
(
OpenMM
ContextImpl
&
context
)
{
double
NonbondedForceImpl
::
calcEnergy
(
ContextImpl
&
context
)
{
return
dynamic_cast
<
CalcNonbondedForceKernel
&>
(
kernel
.
getImpl
()).
executeEnergy
(
context
);
}
...
...
openmmapi/src/OpenMMContext.cpp
View file @
a4020466
...
...
@@ -29,51 +29,51 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/
OpenMM
Context.h"
#include "openmm/internal/
OpenMM
ContextImpl.h"
#include "openmm/Context.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/OpenMMException.h"
using
namespace
OpenMM
;
using
namespace
std
;
OpenMM
Context
::
OpenMM
Context
(
System
&
system
,
Integrator
&
integrator
)
{
impl
=
new
OpenMM
ContextImpl
(
*
this
,
system
,
integrator
,
0
);
Context
::
Context
(
System
&
system
,
Integrator
&
integrator
)
{
impl
=
new
ContextImpl
(
*
this
,
system
,
integrator
,
0
);
}
OpenMM
Context
::
OpenMM
Context
(
System
&
system
,
Integrator
&
integrator
,
Platform
&
platform
)
{
impl
=
new
OpenMM
ContextImpl
(
*
this
,
system
,
integrator
,
&
platform
);
Context
::
Context
(
System
&
system
,
Integrator
&
integrator
,
Platform
&
platform
)
{
impl
=
new
ContextImpl
(
*
this
,
system
,
integrator
,
&
platform
);
}
OpenMM
Context
::~
OpenMM
Context
()
{
Context
::~
Context
()
{
delete
impl
;
}
const
System
&
OpenMM
Context
::
getSystem
()
const
{
const
System
&
Context
::
getSystem
()
const
{
return
impl
->
getSystem
();
}
System
&
OpenMM
Context
::
getSystem
()
{
System
&
Context
::
getSystem
()
{
return
impl
->
getSystem
();
}
const
Integrator
&
OpenMM
Context
::
getIntegrator
()
const
{
const
Integrator
&
Context
::
getIntegrator
()
const
{
return
impl
->
getIntegrator
();
}
Integrator
&
OpenMM
Context
::
getIntegrator
()
{
Integrator
&
Context
::
getIntegrator
()
{
return
impl
->
getIntegrator
();
}
const
Platform
&
OpenMM
Context
::
getPlatform
()
const
{
const
Platform
&
Context
::
getPlatform
()
const
{
return
impl
->
getPlatform
();
}
Platform
&
OpenMM
Context
::
getPlatform
()
{
Platform
&
Context
::
getPlatform
()
{
return
impl
->
getPlatform
();
}
State
OpenMM
Context
::
getState
(
int
types
)
const
{
State
Context
::
getState
(
int
types
)
const
{
State
state
(
impl
->
getTime
(),
impl
->
getSystem
().
getNumParticles
(),
State
::
DataType
(
types
));
if
(
types
&
State
::
Energy
)
state
.
setEnergy
(
impl
->
calcKineticEnergy
(),
impl
->
calcPotentialEnergy
());
...
...
@@ -92,34 +92,34 @@ State OpenMMContext::getState(int types) const {
return
state
;
}
void
OpenMM
Context
::
setTime
(
double
time
)
{
void
Context
::
setTime
(
double
time
)
{
impl
->
setTime
(
time
);
}
void
OpenMM
Context
::
setPositions
(
const
vector
<
Vec3
>&
positions
)
{
void
Context
::
setPositions
(
const
vector
<
Vec3
>&
positions
)
{
if
((
int
)
positions
.
size
()
!=
impl
->
getSystem
().
getNumParticles
())
throw
OpenMMException
(
"Called setPositions() on a
n OpenMM
Context with the wrong number of positions"
);
throw
OpenMMException
(
"Called setPositions() on a
Context with the wrong number of positions"
);
impl
->
getPositions
().
loadFromArray
(
&
positions
[
0
]);
}
void
OpenMM
Context
::
setVelocities
(
const
vector
<
Vec3
>&
velocities
)
{
void
Context
::
setVelocities
(
const
vector
<
Vec3
>&
velocities
)
{
if
((
int
)
velocities
.
size
()
!=
impl
->
getSystem
().
getNumParticles
())
throw
OpenMMException
(
"Called setVelocities() on a
n OpenMM
Context with the wrong number of velocities"
);
throw
OpenMMException
(
"Called setVelocities() on a
Context with the wrong number of velocities"
);
impl
->
getVelocities
().
loadFromArray
(
&
velocities
[
0
]);
}
double
OpenMM
Context
::
getParameter
(
const
string
&
name
)
{
double
Context
::
getParameter
(
const
string
&
name
)
{
return
impl
->
getParameter
(
name
);
}
void
OpenMM
Context
::
setParameter
(
const
string
&
name
,
double
value
)
{
void
Context
::
setParameter
(
const
string
&
name
,
double
value
)
{
impl
->
setParameter
(
name
,
value
);
}
void
OpenMM
Context
::
reinitialize
()
{
void
Context
::
reinitialize
()
{
System
&
system
=
impl
->
getSystem
();
Integrator
&
integrator
=
impl
->
getIntegrator
();
Platform
&
platform
=
impl
->
getPlatform
();
delete
impl
;
impl
=
new
OpenMM
ContextImpl
(
*
this
,
system
,
integrator
,
&
platform
);
impl
=
new
ContextImpl
(
*
this
,
system
,
integrator
,
&
platform
);
}
openmmapi/src/OpenMMContextImpl.cpp
View file @
a4020466
...
...
@@ -35,7 +35,7 @@
#include "openmm/System.h"
#include "openmm/kernels.h"
#include "openmm/internal/ForceImpl.h"
#include "openmm/internal/
OpenMM
ContextImpl.h"
#include "openmm/internal/ContextImpl.h"
#include <map>
#include <vector>
...
...
@@ -44,7 +44,7 @@ using std::map;
using
std
::
vector
;
using
std
::
string
;
OpenMM
ContextImpl
::
OpenMM
ContextImpl
(
OpenMM
Context
&
owner
,
System
&
system
,
Integrator
&
integrator
,
Platform
*
platform
)
:
ContextImpl
::
ContextImpl
(
Context
&
owner
,
System
&
system
,
Integrator
&
integrator
,
Platform
*
platform
)
:
owner
(
owner
),
system
(
system
),
integrator
(
integrator
),
platform
(
platform
),
platformData
(
NULL
)
...
...
@@ -65,7 +65,7 @@ OpenMMContextImpl::OpenMMContextImpl(OpenMMContext& owner, System& system, Integ
if
(
platform
==
0
)
this
->
platform
=
platform
=
&
Platform
::
findPlatform
(
kernelNames
);
else
if
(
!
platform
->
supportsKernels
(
kernelNames
))
throw
OpenMMException
(
"Specified a Platform for a
n OpenMM
Context which does not support all required kernels"
);
throw
OpenMMException
(
"Specified a Platform for a
Context which does not support all required kernels"
);
platform
->
contextCreated
(
*
this
);
initializeForcesKernel
=
platform
->
createKernel
(
InitializeForcesKernel
::
Name
(),
*
this
);
dynamic_cast
<
InitializeForcesKernel
&>
(
initializeForcesKernel
.
getImpl
()).
initialize
(
system
);
...
...
@@ -83,58 +83,58 @@ OpenMMContextImpl::OpenMMContextImpl(OpenMMContext& owner, System& system, Integ
velocities
.
fillWithValue
(
&
zero
);
}
OpenMM
ContextImpl
::~
OpenMM
ContextImpl
()
{
ContextImpl
::~
ContextImpl
()
{
for
(
int
i
=
0
;
i
<
(
int
)
forceImpls
.
size
();
++
i
)
delete
forceImpls
[
i
];
platform
->
contextDestroyed
(
*
this
);
}
double
OpenMM
ContextImpl
::
getTime
()
const
{
double
ContextImpl
::
getTime
()
const
{
return
dynamic_cast
<
const
UpdateTimeKernel
&>
(
updateTimeKernel
.
getImpl
()).
getTime
(
*
this
);
}
void
OpenMM
ContextImpl
::
setTime
(
double
t
)
{
void
ContextImpl
::
setTime
(
double
t
)
{
dynamic_cast
<
UpdateTimeKernel
&>
(
updateTimeKernel
.
getImpl
()).
setTime
(
*
this
,
t
);
}
double
OpenMM
ContextImpl
::
getParameter
(
std
::
string
name
)
{
double
ContextImpl
::
getParameter
(
std
::
string
name
)
{
if
(
parameters
.
find
(
name
)
==
parameters
.
end
())
throw
OpenMMException
(
"Called getParameter() with invalid parameter name"
);
return
parameters
[
name
];
}
void
OpenMM
ContextImpl
::
setParameter
(
std
::
string
name
,
double
value
)
{
void
ContextImpl
::
setParameter
(
std
::
string
name
,
double
value
)
{
if
(
parameters
.
find
(
name
)
==
parameters
.
end
())
throw
OpenMMException
(
"Called setParameter() with invalid parameter name"
);
parameters
[
name
]
=
value
;
}
void
OpenMM
ContextImpl
::
calcForces
()
{
void
ContextImpl
::
calcForces
()
{
dynamic_cast
<
InitializeForcesKernel
&>
(
initializeForcesKernel
.
getImpl
()).
execute
(
*
this
);
for
(
int
i
=
0
;
i
<
(
int
)
forceImpls
.
size
();
++
i
)
forceImpls
[
i
]
->
calcForces
(
*
this
,
forces
);
}
double
OpenMM
ContextImpl
::
calcKineticEnergy
()
{
double
ContextImpl
::
calcKineticEnergy
()
{
return
dynamic_cast
<
CalcKineticEnergyKernel
&>
(
kineticEnergyKernel
.
getImpl
()).
execute
(
*
this
);
}
double
OpenMM
ContextImpl
::
calcPotentialEnergy
()
{
double
ContextImpl
::
calcPotentialEnergy
()
{
double
energy
=
0.0
;
for
(
int
i
=
0
;
i
<
(
int
)
forceImpls
.
size
();
++
i
)
energy
+=
forceImpls
[
i
]
->
calcEnergy
(
*
this
);
return
energy
;
}
void
OpenMM
ContextImpl
::
updateContextState
()
{
void
ContextImpl
::
updateContextState
()
{
for
(
int
i
=
0
;
i
<
(
int
)
forceImpls
.
size
();
++
i
)
forceImpls
[
i
]
->
updateContextState
(
*
this
);
}
void
*
OpenMM
ContextImpl
::
getPlatformData
()
{
void
*
ContextImpl
::
getPlatformData
()
{
return
platformData
;
}
void
OpenMM
ContextImpl
::
setPlatformData
(
void
*
data
)
{
void
ContextImpl
::
setPlatformData
(
void
*
data
)
{
platformData
=
data
;
}
openmmapi/src/PeriodicTorsionForceImpl.cpp
View file @
a4020466
...
...
@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/internal/
OpenMM
ContextImpl.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/internal/PeriodicTorsionForceImpl.h"
#include "openmm/kernels.h"
...
...
@@ -44,16 +44,16 @@ PeriodicTorsionForceImpl::PeriodicTorsionForceImpl(PeriodicTorsionForce& owner)
PeriodicTorsionForceImpl
::~
PeriodicTorsionForceImpl
()
{
}
void
PeriodicTorsionForceImpl
::
initialize
(
OpenMM
ContextImpl
&
context
)
{
void
PeriodicTorsionForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcPeriodicTorsionForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcPeriodicTorsionForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
void
PeriodicTorsionForceImpl
::
calcForces
(
OpenMM
ContextImpl
&
context
,
Stream
&
forces
)
{
void
PeriodicTorsionForceImpl
::
calcForces
(
ContextImpl
&
context
,
Stream
&
forces
)
{
dynamic_cast
<
CalcPeriodicTorsionForceKernel
&>
(
kernel
.
getImpl
()).
executeForces
(
context
);
}
double
PeriodicTorsionForceImpl
::
calcEnergy
(
OpenMM
ContextImpl
&
context
)
{
double
PeriodicTorsionForceImpl
::
calcEnergy
(
ContextImpl
&
context
)
{
return
dynamic_cast
<
CalcPeriodicTorsionForceKernel
&>
(
kernel
.
getImpl
()).
executeEnergy
(
context
);
}
...
...
openmmapi/src/RBTorsionForceImpl.cpp
View file @
a4020466
...
...
@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/internal/
OpenMM
ContextImpl.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/internal/RBTorsionForceImpl.h"
#include "openmm/kernels.h"
...
...
@@ -44,16 +44,16 @@ RBTorsionForceImpl::RBTorsionForceImpl(RBTorsionForce& owner) : owner(owner) {
RBTorsionForceImpl
::~
RBTorsionForceImpl
()
{
}
void
RBTorsionForceImpl
::
initialize
(
OpenMM
ContextImpl
&
context
)
{
void
RBTorsionForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcRBTorsionForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcRBTorsionForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
void
RBTorsionForceImpl
::
calcForces
(
OpenMM
ContextImpl
&
context
,
Stream
&
forces
)
{
void
RBTorsionForceImpl
::
calcForces
(
ContextImpl
&
context
,
Stream
&
forces
)
{
dynamic_cast
<
CalcRBTorsionForceKernel
&>
(
kernel
.
getImpl
()).
executeForces
(
context
);
}
double
RBTorsionForceImpl
::
calcEnergy
(
OpenMM
ContextImpl
&
context
)
{
double
RBTorsionForceImpl
::
calcEnergy
(
ContextImpl
&
context
)
{
return
dynamic_cast
<
CalcRBTorsionForceKernel
&>
(
kernel
.
getImpl
()).
executeEnergy
(
context
);
}
...
...
openmmapi/src/VariableLangevinIntegrator.cpp
View file @
a4020466
...
...
@@ -30,8 +30,8 @@
* -------------------------------------------------------------------------- */
#include "openmm/VariableLangevinIntegrator.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/internal/
OpenMM
ContextImpl.h"
#include "openmm/Context.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/kernels.h"
#include <limits>
#include <string>
...
...
@@ -48,7 +48,7 @@ VariableLangevinIntegrator::VariableLangevinIntegrator(double temperature, doubl
setRandomNumberSeed
((
int
)
time
(
NULL
));
}
void
VariableLangevinIntegrator
::
initialize
(
OpenMM
ContextImpl
&
contextRef
)
{
void
VariableLangevinIntegrator
::
initialize
(
ContextImpl
&
contextRef
)
{
context
=
&
contextRef
;
kernel
=
context
->
getPlatform
().
createKernel
(
IntegrateVariableLangevinStepKernel
::
Name
(),
contextRef
);
dynamic_cast
<
IntegrateVariableLangevinStepKernel
&>
(
kernel
.
getImpl
()).
initialize
(
contextRef
.
getSystem
(),
*
this
);
...
...
openmmapi/src/VariableVerletIntegrator.cpp
View file @
a4020466
...
...
@@ -30,8 +30,8 @@
* -------------------------------------------------------------------------- */
#include "openmm/VariableVerletIntegrator.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/internal/
OpenMM
ContextImpl.h"
#include "openmm/Context.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/kernels.h"
#include <limits>
#include <string>
...
...
@@ -44,7 +44,7 @@ VariableVerletIntegrator::VariableVerletIntegrator(double errorTol) : errorTol(e
setConstraintTolerance
(
1e-4
);
}
void
VariableVerletIntegrator
::
initialize
(
OpenMM
ContextImpl
&
contextRef
)
{
void
VariableVerletIntegrator
::
initialize
(
ContextImpl
&
contextRef
)
{
context
=
&
contextRef
;
kernel
=
context
->
getPlatform
().
createKernel
(
IntegrateVariableVerletStepKernel
::
Name
(),
contextRef
);
dynamic_cast
<
IntegrateVariableVerletStepKernel
&>
(
kernel
.
getImpl
()).
initialize
(
contextRef
.
getSystem
(),
*
this
);
...
...
openmmapi/src/VerletIntegrator.cpp
View file @
a4020466
...
...
@@ -30,8 +30,8 @@
* -------------------------------------------------------------------------- */
#include "openmm/VerletIntegrator.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/internal/
OpenMM
ContextImpl.h"
#include "openmm/Context.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/kernels.h"
#include <string>
...
...
@@ -44,7 +44,7 @@ VerletIntegrator::VerletIntegrator(double stepSize) {
setConstraintTolerance
(
1e-4
);
}
void
VerletIntegrator
::
initialize
(
OpenMM
ContextImpl
&
contextRef
)
{
void
VerletIntegrator
::
initialize
(
ContextImpl
&
contextRef
)
{
context
=
&
contextRef
;
kernel
=
context
->
getPlatform
().
createKernel
(
IntegrateVerletStepKernel
::
Name
(),
contextRef
);
dynamic_cast
<
IntegrateVerletStepKernel
&>
(
kernel
.
getImpl
()).
initialize
(
contextRef
.
getSystem
(),
*
this
);
...
...
platforms/brook/include/BrookKernelFactory.h
View file @
a4020466
...
...
@@ -44,7 +44,7 @@ class BrookKernelFactory : public KernelFactory {
public:
KernelImpl
*
createKernelImpl
(
std
::
string
name
,
const
Platform
&
platform
,
OpenMM
ContextImpl
&
context
)
const
;
KernelImpl
*
createKernelImpl
(
std
::
string
name
,
const
Platform
&
platform
,
ContextImpl
&
context
)
const
;
};
}
// namespace OpenMM
...
...
platforms/brook/include/BrookPlatform.h
View file @
a4020466
...
...
@@ -278,17 +278,17 @@ class OPENMM_EXPORT BrookPlatform : public Platform {
FILE
*
getLog
(
void
)
const
;
/**
* This is called whenever a new
OpenMM
Context is created. It gives the Platform a chance to initialize
* This is called whenever a new Context is created. It gives the Platform a chance to initialize
* the context and store platform-specific data in it.
*/
void
contextCreated
(
OpenMM
ContextImpl
&
context
)
const
;
void
contextCreated
(
ContextImpl
&
context
)
const
;
/**
* This is called whenever a
n OpenMM
Context is deleted. It gives the Platform a chance to clean up
* This is called whenever a
Context is deleted. It gives the Platform a chance to clean up
* any platform-specific data that was stored in it.
*/
void
contextDestroyed
(
OpenMM
ContextImpl
&
context
)
const
;
void
contextDestroyed
(
ContextImpl
&
context
)
const
;
/**
* Get minSuggestedThreads
...
...
platforms/brook/include/BrookStreamFactory.h
View file @
a4020466
...
...
@@ -77,7 +77,7 @@ class OPENMM_EXPORT BrookStreamFactory : public StreamFactory {
* @return StreamImpl
*/
StreamImpl
*
createStreamImpl
(
std
::
string
name
,
int
size
,
Stream
::
DataType
type
,
const
Platform
&
platform
,
OpenMM
ContextImpl
&
context
)
const
;
StreamImpl
*
createStreamImpl
(
std
::
string
name
,
int
size
,
Stream
::
DataType
type
,
const
Platform
&
platform
,
ContextImpl
&
context
)
const
;
/**
* Create StreamImpl
...
...
platforms/brook/src/BrookBonded.h
View file @
a4020466
...
...
@@ -31,7 +31,7 @@
#include "BrookStreamImpl.h"
#include "BrookCommon.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "BrookBondParameters.h"
namespace
OpenMM
{
...
...
platforms/brook/src/BrookCalcGBSAOBCForceKernel.cpp
View file @
a4020466
...
...
@@ -172,11 +172,11 @@ void BrookCalcGBSAOBCForceKernel::initialize( const System& system, const GBSAOB
/**
* Compute forces given particle coordinates
*
* @param context
OpenMM
ContextImpl context
* @param context ContextImpl context
*
*/
void
BrookCalcGBSAOBCForceKernel
::
executeForces
(
OpenMM
ContextImpl
&
context
){
void
BrookCalcGBSAOBCForceKernel
::
executeForces
(
ContextImpl
&
context
){
// ---------------------------------------------------------------------------------------
...
...
@@ -193,13 +193,13 @@ void BrookCalcGBSAOBCForceKernel::executeForces( OpenMMContextImpl& context ){
/**
* Execute the kernel to calculate the OBC energy
*
* @param context
OpenMM
ContextImpl context
* @param context ContextImpl context
*
* @return energy
*
*/
double
BrookCalcGBSAOBCForceKernel
::
executeEnergy
(
OpenMM
ContextImpl
&
context
){
double
BrookCalcGBSAOBCForceKernel
::
executeEnergy
(
ContextImpl
&
context
){
// ---------------------------------------------------------------------------------------
...
...
platforms/brook/src/BrookCalcGBSAOBCForceKernel.h
View file @
a4020466
...
...
@@ -72,7 +72,7 @@ class BrookCalcGBSAOBCForceKernel : public CalcGBSAOBCForceKernel {
*
*/
void
executeForces
(
OpenMM
ContextImpl
&
context
);
void
executeForces
(
ContextImpl
&
context
);
/**
* Execute the kernel to calculate the energy.
...
...
@@ -84,7 +84,7 @@ class BrookCalcGBSAOBCForceKernel : public CalcGBSAOBCForceKernel {
*
*/
double
executeEnergy
(
OpenMM
ContextImpl
&
context
);
double
executeEnergy
(
ContextImpl
&
context
);
/**
* Set log file reference
...
...
platforms/brook/src/BrookCalcHarmonicAngleForceKernel.cpp
View file @
a4020466
...
...
@@ -171,11 +171,11 @@ void BrookCalcHarmonicAngleForceKernel::initialize( const System& system, const
/**
* Compute forces given particle coordinates
*
* @param context
OpenMM
ContextImpl context
* @param context ContextImpl context
*
*/
void
BrookCalcHarmonicAngleForceKernel
::
executeForces
(
OpenMM
ContextImpl
&
context
){
void
BrookCalcHarmonicAngleForceKernel
::
executeForces
(
ContextImpl
&
context
){
// ---------------------------------------------------------------------------------------
...
...
@@ -195,13 +195,13 @@ void BrookCalcHarmonicAngleForceKernel::executeForces( OpenMMContextImpl& contex
/**
* Execute the kernel to calculate the energy
*
* @param context
OpenMM
ContextImpl context
* @param context ContextImpl context
*
* @return potential energy
*
*/
double
BrookCalcHarmonicAngleForceKernel
::
executeEnergy
(
OpenMM
ContextImpl
&
context
){
double
BrookCalcHarmonicAngleForceKernel
::
executeEnergy
(
ContextImpl
&
context
){
// ---------------------------------------------------------------------------------------
...
...
platforms/brook/src/BrookCalcHarmonicAngleForceKernel.h
View file @
a4020466
...
...
@@ -72,7 +72,7 @@ class BrookCalcHarmonicAngleForceKernel : public CalcHarmonicAngleForceKernel {
*
*/
void
executeForces
(
OpenMM
ContextImpl
&
context
);
void
executeForces
(
ContextImpl
&
context
);
/**
* Execute the kernel to calculate the energy.
...
...
@@ -83,7 +83,7 @@ class BrookCalcHarmonicAngleForceKernel : public CalcHarmonicAngleForceKernel {
*
*/
double
executeEnergy
(
OpenMM
ContextImpl
&
context
);
double
executeEnergy
(
ContextImpl
&
context
);
/**
* Set log file reference
...
...
platforms/brook/src/BrookCalcHarmonicBondForceKernel.cpp
View file @
a4020466
...
...
@@ -177,11 +177,11 @@ void BrookCalcHarmonicBondForceKernel::initialize( const System& system, const H
/**
* Compute forces given particle coordinates
*
* @param context
OpenMM
ContextImpl context
* @param context ContextImpl context
*
*/
void
BrookCalcHarmonicBondForceKernel
::
executeForces
(
OpenMM
ContextImpl
&
context
){
void
BrookCalcHarmonicBondForceKernel
::
executeForces
(
ContextImpl
&
context
){
// ---------------------------------------------------------------------------------------
...
...
@@ -201,13 +201,13 @@ void BrookCalcHarmonicBondForceKernel::executeForces( OpenMMContextImpl& context
/**
* Execute the kernel to calculate the energy
*
* @param context
OpenMM
ContextImpl context
* @param context ContextImpl context
*
* @return potential energy
*
*/
double
BrookCalcHarmonicBondForceKernel
::
executeEnergy
(
OpenMM
ContextImpl
&
context
){
double
BrookCalcHarmonicBondForceKernel
::
executeEnergy
(
ContextImpl
&
context
){
// ---------------------------------------------------------------------------------------
...
...
platforms/brook/src/BrookCalcHarmonicBondForceKernel.h
View file @
a4020466
...
...
@@ -72,7 +72,7 @@ class BrookCalcHarmonicBondForceKernel : public CalcHarmonicBondForceKernel {
*
*/
void
executeForces
(
OpenMM
ContextImpl
&
context
);
void
executeForces
(
ContextImpl
&
context
);
/**
* Execute the kernel to calculate the energy.
...
...
@@ -83,7 +83,7 @@ class BrookCalcHarmonicBondForceKernel : public CalcHarmonicBondForceKernel {
*
*/
double
executeEnergy
(
OpenMM
ContextImpl
&
context
);
double
executeEnergy
(
ContextImpl
&
context
);
/**
* Set log file reference
...
...
Prev
1
2
3
4
5
6
7
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