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
"platforms/cuda/vscode:/vscode.git/clone" did not exist on "0b96aa2e53ac3949e6718be2d01d554f16a3e4b3"
Commit
a4020466
authored
Jul 14, 2009
by
Peter Eastman
Browse files
Renamed OpenMMContext to Context
parent
95b8dbd6
Changes
139
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
93 additions
and
93 deletions
+93
-93
examples/HelloArgon.cpp
examples/HelloArgon.cpp
+1
-1
examples/HelloEthane.cpp
examples/HelloEthane.cpp
+2
-2
examples/HelloSodiumChloride.cpp
examples/HelloSodiumChloride.cpp
+2
-2
examples/HelloWaterBox.cpp
examples/HelloWaterBox.cpp
+2
-2
examples/OpenMM_CWrapper.cpp
examples/OpenMM_CWrapper.cpp
+7
-7
olla/include/openmm/KernelFactory.h
olla/include/openmm/KernelFactory.h
+1
-1
olla/include/openmm/Platform.h
olla/include/openmm/Platform.h
+7
-7
olla/include/openmm/StreamFactory.h
olla/include/openmm/StreamFactory.h
+1
-1
olla/include/openmm/kernels.h
olla/include/openmm/kernels.h
+25
-25
olla/src/Platform.cpp
olla/src/Platform.cpp
+4
-4
openmmapi/include/OpenMM.h
openmmapi/include/OpenMM.h
+1
-1
openmmapi/include/openmm/BrownianIntegrator.h
openmmapi/include/openmm/BrownianIntegrator.h
+4
-4
openmmapi/include/openmm/Context.h
openmmapi/include/openmm/Context.h
+15
-15
openmmapi/include/openmm/Force.h
openmmapi/include/openmm/Force.h
+4
-4
openmmapi/include/openmm/GBSAOBCForce.h
openmmapi/include/openmm/GBSAOBCForce.h
+1
-1
openmmapi/include/openmm/GBVIForce.h
openmmapi/include/openmm/GBVIForce.h
+1
-1
openmmapi/include/openmm/Integrator.h
openmmapi/include/openmm/Integrator.h
+8
-8
openmmapi/include/openmm/LangevinIntegrator.h
openmmapi/include/openmm/LangevinIntegrator.h
+4
-4
openmmapi/include/openmm/NonbondedForce.h
openmmapi/include/openmm/NonbondedForce.h
+1
-1
openmmapi/include/openmm/State.h
openmmapi/include/openmm/State.h
+2
-2
No files found.
examples/HelloArgon.cpp
View file @
a4020466
...
...
@@ -49,7 +49,7 @@ void simulateArgon()
OpenMM
::
VerletIntegrator
integrator
(
0.004
);
// step size in ps
// Let OpenMM Context choose best platform.
OpenMM
::
OpenMM
Context
context
(
system
,
integrator
);
OpenMM
::
Context
context
(
system
,
integrator
);
printf
(
"REMARK Using OpenMM platform %s
\n
"
,
context
.
getPlatform
().
getName
().
c_str
()
);
...
...
examples/HelloEthane.cpp
View file @
a4020466
...
...
@@ -225,7 +225,7 @@ struct MyOpenMMData {
~
MyOpenMMData
()
{
delete
context
;
delete
integrator
;
delete
system
;}
OpenMM
::
System
*
system
;
OpenMM
::
Integrator
*
integrator
;
OpenMM
::
OpenMM
Context
*
context
;
OpenMM
::
Context
*
context
;
};
...
...
@@ -345,7 +345,7 @@ myInitializeOpenMM( const MyAtomInfo atoms[],
// best available Platform. Initialize the configuration from the default
// positions we collected above. Initial velocities will be zero.
omm
->
integrator
=
new
OpenMM
::
VerletIntegrator
(
StepSizeInFs
*
OpenMM
::
PsPerFs
);
omm
->
context
=
new
OpenMM
::
OpenMM
Context
(
*
omm
->
system
,
*
omm
->
integrator
);
omm
->
context
=
new
OpenMM
::
Context
(
*
omm
->
system
,
*
omm
->
integrator
);
omm
->
context
->
setPositions
(
initialPosInNm
);
platformName
=
omm
->
context
->
getPlatform
().
getName
();
...
...
examples/HelloSodiumChloride.cpp
View file @
a4020466
...
...
@@ -178,7 +178,7 @@ struct MyOpenMMData {
MyOpenMMData
()
:
system
(
0
),
context
(
0
),
integrator
(
0
)
{}
~
MyOpenMMData
()
{
delete
system
;
delete
context
;
delete
integrator
;}
OpenMM
::
System
*
system
;
OpenMM
::
OpenMM
Context
*
context
;
OpenMM
::
Context
*
context
;
OpenMM
::
Integrator
*
integrator
;
};
...
...
@@ -262,7 +262,7 @@ myInitializeOpenMM( const MyAtomInfo atoms[],
// have been set here.
omm
->
integrator
=
new
OpenMM
::
LangevinIntegrator
(
temperature
,
frictionInPs
,
stepSizeInFs
*
OpenMM
::
PsPerFs
);
omm
->
context
=
new
OpenMM
::
OpenMM
Context
(
*
omm
->
system
,
*
omm
->
integrator
);
omm
->
context
=
new
OpenMM
::
Context
(
*
omm
->
system
,
*
omm
->
integrator
);
omm
->
context
->
setPositions
(
initialPosInNm
);
platformName
=
omm
->
context
->
getPlatform
().
getName
();
...
...
examples/HelloWaterBox.cpp
View file @
a4020466
...
...
@@ -193,7 +193,7 @@ struct MyOpenMMData {
~
MyOpenMMData
()
{
delete
context
;
delete
integrator
;
delete
system
;}
OpenMM
::
System
*
system
;
OpenMM
::
Integrator
*
integrator
;
OpenMM
::
OpenMM
Context
*
context
;
OpenMM
::
Context
*
context
;
};
...
...
@@ -348,7 +348,7 @@ myInitializeOpenMM( int numWatersAlongEdge,
// best available Platform. Initialize the configuration from the default
// positions we collected above. Initial velocities will be zero.
omm
->
integrator
=
new
OpenMM
::
VerletIntegrator
(
StepSizeInFs
*
OpenMM
::
PsPerFs
);
omm
->
context
=
new
OpenMM
::
OpenMM
Context
(
*
omm
->
system
,
*
omm
->
integrator
);
omm
->
context
=
new
OpenMM
::
Context
(
*
omm
->
system
,
*
omm
->
integrator
);
omm
->
context
->
setPositions
(
initialPosInNm
);
platformName
=
omm
->
context
->
getPlatform
().
getName
();
...
...
examples/OpenMM_CWrapper.cpp
View file @
a4020466
...
...
@@ -1012,7 +1012,7 @@ void OPENMM_LANGEVININTEGRATOR_STEP(OpenMM_LangevinIntegrator* const& langevin,
// create
OpenMM_Context
*
OpenMM_Context_create
(
OpenMM_System
*
sys
,
OpenMM_Integrator
*
integ
)
{
return
(
OpenMM_Context
*
)
new
OpenMM
::
OpenMM
Context
(
*
(
System
*
)
sys
,
*
(
Integrator
*
)
integ
);
}
{
return
(
OpenMM_Context
*
)
new
OpenMM
::
Context
(
*
(
System
*
)
sys
,
*
(
Integrator
*
)
integ
);
}
void
openmm_context_create_
(
OpenMM_Context
*&
context
,
OpenMM_System
*&
sys
,
OpenMM_Integrator
*&
integ
)
{
context
=
OpenMM_Context_create
(
sys
,
integ
);
}
void
OPENMM_CONTEXT_CREATE
(
OpenMM_Context
*&
context
,
OpenMM_System
*&
sys
,
OpenMM_Integrator
*&
integ
)
...
...
@@ -1020,7 +1020,7 @@ void OPENMM_CONTEXT_CREATE(OpenMM_Context*& context, OpenMM_System*& sys, OpenMM
// destroy
void
OpenMM_Context_destroy
(
OpenMM_Context
*
doomed
)
{
delete
(
OpenMM
Context
*
)
doomed
;
}
{
delete
(
Context
*
)
doomed
;
}
void
openmm_context_destroy_
(
OpenMM_Context
*&
doomed
)
{
OpenMM_Context_destroy
(
doomed
);
}
void
OPENMM_CONTEXT_DESTROY
(
OpenMM_Context
*&
doomed
)
...
...
@@ -1028,7 +1028,7 @@ void OPENMM_CONTEXT_DESTROY(OpenMM_Context*& doomed)
// setPositions
void
OpenMM_Context_setPositions
(
OpenMM_Context
*
context
,
const
OpenMM_Vec3Array
*
positions
)
{
((
OpenMM
Context
*
)
context
)
->
setPositions
(
*
(
const
std
::
vector
<
Vec3
>*
)
positions
);
}
{
((
Context
*
)
context
)
->
setPositions
(
*
(
const
std
::
vector
<
Vec3
>*
)
positions
);
}
void
openmm_context_setpositions_
(
OpenMM_Context
*
const
&
context
,
const
OpenMM_Vec3Array
*
const
&
positions
)
{
OpenMM_Context_setPositions
(
context
,
positions
);
}
void
OPENMM_CONTEXT_SETPOSITIONS
(
OpenMM_Context
*
const
&
context
,
const
OpenMM_Vec3Array
*
const
&
positions
)
...
...
@@ -1036,7 +1036,7 @@ void OPENMM_CONTEXT_SETPOSITIONS(OpenMM_Context* const& context, const OpenMM_Ve
// setVelocities
void
OpenMM_Context_setVelocities
(
OpenMM_Context
*
context
,
const
OpenMM_Vec3Array
*
velocities
)
{
((
OpenMM
Context
*
)
context
)
->
setVelocities
(
*
(
const
std
::
vector
<
Vec3
>*
)
velocities
);
}
{
((
Context
*
)
context
)
->
setVelocities
(
*
(
const
std
::
vector
<
Vec3
>*
)
velocities
);
}
void
openmm_context_setvelocities_
(
OpenMM_Context
*
const
&
context
,
const
OpenMM_Vec3Array
*
const
&
velocities
)
{
OpenMM_Context_setVelocities
(
context
,
velocities
);
}
void
OPENMM_CONTEXT_SETVELOCITIES
(
OpenMM_Context
*
const
&
context
,
const
OpenMM_Vec3Array
*
const
&
velocities
)
...
...
@@ -1046,7 +1046,7 @@ void OPENMM_CONTEXT_SETVELOCITIES(OpenMM_Context* const& context, const OpenMM_V
// Note that a Context creates the OpenMM::State object, but you have to destroy
// it using OpenMM_State_destroy.
OpenMM_State
*
OpenMM_Context_createState
(
const
OpenMM_Context
*
context
,
int
types
)
{
return
(
OpenMM_State
*
)
new
State
(((
OpenMM
Context
*
)
context
)
->
getState
(
types
));
}
{
return
(
OpenMM_State
*
)
new
State
(((
Context
*
)
context
)
->
getState
(
types
));
}
void
openmm_context_createstate_
(
const
OpenMM_Context
*
const
&
context
,
const
int
&
types
,
OpenMM_State
*&
state
)
{
state
=
OpenMM_Context_createState
(
context
,
types
);
}
void
OPENMM_CONTEXT_CREATESTATE
(
const
OpenMM_Context
*
const
&
context
,
const
int
&
types
,
OpenMM_State
*&
state
)
...
...
@@ -1056,13 +1056,13 @@ void OPENMM_CONTEXT_CREATESTATE(const OpenMM_Context* const& context, const int&
// Platform name.
const
char
*
OpenMM_Context_getPlatformName
(
const
OpenMM_Context
*
context
)
{
static
std
::
string
platform
;
platform
=
((
const
OpenMM
Context
*
)
context
)
->
getPlatform
().
getName
();
platform
=
((
const
Context
*
)
context
)
->
getPlatform
().
getName
();
return
platform
.
c_str
();
}
// getPlatformName Fortran: Return a blank-padded Fortran string containing the Platform name. There
// is no terminating null.
void
openmm_context_getplatformname_
(
const
OpenMM_Context
*
const
&
context
,
char
*
buf
,
int
len
)
{
const
std
::
string
name
=
((
const
OpenMM
Context
*
)
context
)
->
getPlatform
().
getName
();
const
std
::
string
name
=
((
const
Context
*
)
context
)
->
getPlatform
().
getName
();
const
int
minLen
=
std
::
min
((
int
)
name
.
size
(),
len
);
for
(
int
i
=
0
;
i
<
minLen
;
++
i
)
buf
[
i
]
=
name
[
i
];
for
(
int
i
=
minLen
;
i
<
len
;
++
i
)
buf
[
i
]
=
' '
;
...
...
olla/include/openmm/KernelFactory.h
View file @
a4020466
...
...
@@ -50,7 +50,7 @@ public:
* @param name the name of the kernel to create
* @param context the context the kernel will belong to
*/
virtual
KernelImpl
*
createKernelImpl
(
std
::
string
name
,
const
Platform
&
platform
,
OpenMM
ContextImpl
&
context
)
const
=
0
;
virtual
KernelImpl
*
createKernelImpl
(
std
::
string
name
,
const
Platform
&
platform
,
ContextImpl
&
context
)
const
=
0
;
virtual
~
KernelFactory
()
{
}
};
...
...
olla/include/openmm/Platform.h
View file @
a4020466
...
...
@@ -41,7 +41,7 @@ namespace OpenMM {
class
Kernel
;
class
KernelFactory
;
class
OpenMM
ContextImpl
;
class
ContextImpl
;
class
StreamFactory
;
/**
...
...
@@ -86,15 +86,15 @@ public:
*/
virtual
const
StreamFactory
&
getDefaultStreamFactory
()
const
=
0
;
/**
* 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.
*/
virtual
void
contextCreated
(
OpenMM
ContextImpl
&
context
)
const
;
virtual
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.
*/
virtual
void
contextDestroyed
(
OpenMM
ContextImpl
&
context
)
const
;
virtual
void
contextDestroyed
(
ContextImpl
&
context
)
const
;
/**
* Register a KernelFactory which should be used to create Kernels with a particular name.
* The Platform takes over ownership of the factory, and will delete it when the Platform itself
...
...
@@ -133,7 +133,7 @@ public:
* @param context the context for which to create a Kernel
* @return a newly created Kernel object
*/
Kernel
createKernel
(
const
std
::
string
&
name
,
OpenMM
ContextImpl
&
context
)
const
;
Kernel
createKernel
(
const
std
::
string
&
name
,
ContextImpl
&
context
)
const
;
/**
* Create a Stream object. If you call this method multiple times for different contexts with the same name,
* the returned Streams are independent and do not interact with each other. This means
...
...
@@ -147,7 +147,7 @@ public:
* @param context the context for which to create a Stream
* @return a newly created Stream object
*/
Stream
createStream
(
const
std
::
string
&
name
,
int
size
,
Stream
::
DataType
type
,
OpenMM
ContextImpl
&
context
)
const
;
Stream
createStream
(
const
std
::
string
&
name
,
int
size
,
Stream
::
DataType
type
,
ContextImpl
&
context
)
const
;
/**
* Register a new Platform.
*/
...
...
olla/include/openmm/StreamFactory.h
View file @
a4020466
...
...
@@ -53,7 +53,7 @@ public:
* @param type the data type of each element in the stream
* @param context the context the kernel will belong to
*/
virtual
StreamImpl
*
createStreamImpl
(
std
::
string
name
,
int
size
,
Stream
::
DataType
type
,
const
Platform
&
platform
,
OpenMM
ContextImpl
&
context
)
const
=
0
;
virtual
StreamImpl
*
createStreamImpl
(
std
::
string
name
,
int
size
,
Stream
::
DataType
type
,
const
Platform
&
platform
,
ContextImpl
&
context
)
const
=
0
;
virtual
~
StreamFactory
()
{
}
};
...
...
olla/include/openmm/kernels.h
View file @
a4020466
...
...
@@ -76,7 +76,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual
void
execute
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
void
execute
(
ContextImpl
&
context
)
=
0
;
};
/**
...
...
@@ -100,14 +100,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual
double
getTime
(
const
OpenMM
ContextImpl
&
context
)
const
=
0
;
virtual
double
getTime
(
const
ContextImpl
&
context
)
const
=
0
;
/**
* Set the current time (in picoseconds).
*
* @param context the context in which to execute this kernel
* @param time the time
*/
virtual
void
setTime
(
OpenMM
ContextImpl
&
context
,
double
time
)
=
0
;
virtual
void
setTime
(
ContextImpl
&
context
,
double
time
)
=
0
;
};
/**
...
...
@@ -132,14 +132,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual
void
executeForces
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
void
executeForces
(
ContextImpl
&
context
)
=
0
;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the HarmonicBondForce
*/
virtual
double
executeEnergy
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
double
executeEnergy
(
ContextImpl
&
context
)
=
0
;
};
/**
...
...
@@ -164,14 +164,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual
void
executeForces
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
void
executeForces
(
ContextImpl
&
context
)
=
0
;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the HarmonicAngleForce
*/
virtual
double
executeEnergy
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
double
executeEnergy
(
ContextImpl
&
context
)
=
0
;
};
/**
...
...
@@ -196,14 +196,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual
void
executeForces
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
void
executeForces
(
ContextImpl
&
context
)
=
0
;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the PeriodicTorsionForce
*/
virtual
double
executeEnergy
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
double
executeEnergy
(
ContextImpl
&
context
)
=
0
;
};
/**
...
...
@@ -228,14 +228,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual
void
executeForces
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
void
executeForces
(
ContextImpl
&
context
)
=
0
;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the RBTorsionForce
*/
virtual
double
executeEnergy
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
double
executeEnergy
(
ContextImpl
&
context
)
=
0
;
};
/**
...
...
@@ -267,14 +267,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual
void
executeForces
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
void
executeForces
(
ContextImpl
&
context
)
=
0
;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the NonbondedForce
*/
virtual
double
executeEnergy
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
double
executeEnergy
(
ContextImpl
&
context
)
=
0
;
};
/**
...
...
@@ -299,14 +299,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual
void
executeForces
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
void
executeForces
(
ContextImpl
&
context
)
=
0
;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the GBSAOBCForce
*/
virtual
double
executeEnergy
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
double
executeEnergy
(
ContextImpl
&
context
)
=
0
;
};
/**
...
...
@@ -332,14 +332,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual
void
executeForces
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
void
executeForces
(
ContextImpl
&
context
)
=
0
;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the GBVIForce
*/
virtual
double
executeEnergy
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
double
executeEnergy
(
ContextImpl
&
context
)
=
0
;
};
/**
...
...
@@ -365,7 +365,7 @@ public:
* @param context the context in which to execute this kernel
* @param integrator the VerletIntegrator this kernel is being used for
*/
virtual
void
execute
(
OpenMM
ContextImpl
&
context
,
const
VerletIntegrator
&
integrator
)
=
0
;
virtual
void
execute
(
ContextImpl
&
context
,
const
VerletIntegrator
&
integrator
)
=
0
;
};
/**
...
...
@@ -391,7 +391,7 @@ public:
* @param context the context in which to execute this kernel
* @param integrator the LangevinIntegrator this kernel is being used for
*/
virtual
void
execute
(
OpenMM
ContextImpl
&
context
,
const
LangevinIntegrator
&
integrator
)
=
0
;
virtual
void
execute
(
ContextImpl
&
context
,
const
LangevinIntegrator
&
integrator
)
=
0
;
};
/**
...
...
@@ -417,7 +417,7 @@ public:
* @param context the context in which to execute this kernel
* @param integrator the BrownianIntegrator this kernel is being used for
*/
virtual
void
execute
(
OpenMM
ContextImpl
&
context
,
const
BrownianIntegrator
&
integrator
)
=
0
;
virtual
void
execute
(
ContextImpl
&
context
,
const
BrownianIntegrator
&
integrator
)
=
0
;
};
/**
...
...
@@ -444,7 +444,7 @@ public:
* @param integrator the LangevinIntegrator this kernel is being used for
* @param maxTime the maximum time beyond which the simulation should not be advanced
*/
virtual
void
execute
(
OpenMM
ContextImpl
&
context
,
const
VariableLangevinIntegrator
&
integrator
,
double
maxTime
)
=
0
;
virtual
void
execute
(
ContextImpl
&
context
,
const
VariableLangevinIntegrator
&
integrator
,
double
maxTime
)
=
0
;
};
/**
...
...
@@ -471,7 +471,7 @@ public:
* @param integrator the VerletIntegrator this kernel is being used for
* @param maxTime the maximum time beyond which the simulation should not be advanced
*/
virtual
void
execute
(
OpenMM
ContextImpl
&
context
,
const
VariableVerletIntegrator
&
integrator
,
double
maxTime
)
=
0
;
virtual
void
execute
(
ContextImpl
&
context
,
const
VariableVerletIntegrator
&
integrator
,
double
maxTime
)
=
0
;
};
/**
...
...
@@ -496,7 +496,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual
void
execute
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
void
execute
(
ContextImpl
&
context
)
=
0
;
};
/**
...
...
@@ -520,7 +520,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual
double
execute
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
double
execute
(
ContextImpl
&
context
)
=
0
;
};
/**
...
...
@@ -545,7 +545,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual
void
execute
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
void
execute
(
ContextImpl
&
context
)
=
0
;
};
}
// namespace OpenMM
...
...
olla/src/Platform.cpp
View file @
a4020466
...
...
@@ -74,10 +74,10 @@ Platform::~Platform() {
delete
*
iter
;
}
void
Platform
::
contextCreated
(
OpenMM
ContextImpl
&
context
)
const
{
void
Platform
::
contextCreated
(
ContextImpl
&
context
)
const
{
}
void
Platform
::
contextDestroyed
(
OpenMM
ContextImpl
&
context
)
const
{
void
Platform
::
contextDestroyed
(
ContextImpl
&
context
)
const
{
}
void
Platform
::
registerKernelFactory
(
const
string
&
name
,
KernelFactory
*
factory
)
{
...
...
@@ -95,13 +95,13 @@ bool Platform::supportsKernels(const vector<string>& kernelNames) const {
return
true
;
}
Kernel
Platform
::
createKernel
(
const
string
&
name
,
OpenMM
ContextImpl
&
context
)
const
{
Kernel
Platform
::
createKernel
(
const
string
&
name
,
ContextImpl
&
context
)
const
{
if
(
kernelFactories
.
find
(
name
)
==
kernelFactories
.
end
())
throw
OpenMMException
(
"Called createKernel() on a Platform which does not support the requested kernel"
);
return
Kernel
(
kernelFactories
.
find
(
name
)
->
second
->
createKernelImpl
(
name
,
*
this
,
context
));
}
Stream
Platform
::
createStream
(
const
string
&
name
,
int
size
,
Stream
::
DataType
type
,
OpenMM
ContextImpl
&
context
)
const
{
Stream
Platform
::
createStream
(
const
string
&
name
,
int
size
,
Stream
::
DataType
type
,
ContextImpl
&
context
)
const
{
if
(
streamFactories
.
find
(
name
)
==
streamFactories
.
end
())
return
Stream
(
getDefaultStreamFactory
().
createStreamImpl
(
name
,
size
,
type
,
*
this
,
context
));
return
Stream
(
streamFactories
.
find
(
name
)
->
second
->
createStreamImpl
(
name
,
size
,
type
,
*
this
,
context
));
...
...
openmmapi/include/OpenMM.h
View file @
a4020466
...
...
@@ -43,7 +43,7 @@
#include "openmm/Integrator.h"
#include "openmm/LangevinIntegrator.h"
#include "openmm/NonbondedForce.h"
#include "openmm/
OpenMM
Context.h"
#include "openmm/Context.h"
#include "openmm/OpenMMException.h"
#include "openmm/PeriodicTorsionForce.h"
#include "openmm/RBTorsionForce.h"
...
...
openmmapi/include/openmm/BrownianIntegrator.h
View file @
a4020466
...
...
@@ -103,11 +103,11 @@ public:
void
step
(
int
steps
);
protected:
/**
* This will be called by the
OpenMM
Context when it is created. It informs the Integrator
* This will be called by the Context when it is created. It informs the Integrator
* of what context it will be integrating, and gives it a chance to do any necessary initialization.
* It will also get called again if the application calls reinitialize() on the
OpenMM
Context.
* It will also get called again if the application calls reinitialize() on the Context.
*/
void
initialize
(
OpenMM
ContextImpl
&
context
);
void
initialize
(
ContextImpl
&
context
);
/**
* Get the names of all Kernels used by this Integrator.
*/
...
...
@@ -115,7 +115,7 @@ protected:
private:
double
temperature
,
friction
;
int
randomNumberSeed
;
OpenMM
ContextImpl
*
context
;
ContextImpl
*
context
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/
OpenMM
Context.h
→
openmmapi/include/openmm/Context.h
View file @
a4020466
#ifndef OPENMM_
OPENMM
CONTEXT_H_
#define OPENMM_
OPENMM
CONTEXT_H_
#ifndef OPENMM_CONTEXT_H_
#define OPENMM_CONTEXT_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
...
...
@@ -41,12 +41,12 @@
namespace
OpenMM
{
class
OpenMM
ContextImpl
;
class
ContextImpl
;
class
Vec3
;
class
Platform
;
/**
* A
n OpenMM
Context stores the complete state of a simulation. More specifically, it includes:
* A
Context stores the complete state of a simulation. More specifically, it includes:
*
* <ul>
* <li>The current time</li>
...
...
@@ -61,25 +61,25 @@ class Platform;
* particle and the current energy of the System.
*/
class
OPENMM_EXPORT
OpenMM
Context
{
class
OPENMM_EXPORT
Context
{
public:
/**
* Construct a new
OpenMM
Context in which to run a simulation.
* Construct a new Context in which to run a simulation.
*
* @param system the System which will be simulated
* @param integrator the Integrator which will be used to simulate the System
*/
OpenMM
Context
(
System
&
system
,
Integrator
&
integrator
);
Context
(
System
&
system
,
Integrator
&
integrator
);
/**
* Construct a new
OpenMM
Context in which to run a simulation, explicitly specifying what Platform should be used
* Construct a new Context in which to run a simulation, explicitly specifying what Platform should be used
* to perform calculations.
*
* @param system the System which will be simulated
* @param integrator the Integrator which will be used to simulate the System
* @param platform the Platform to use for calculations
*/
OpenMM
Context
(
System
&
system
,
Integrator
&
integrator
,
Platform
&
platform
);
~
OpenMM
Context
();
Context
(
System
&
system
,
Integrator
&
integrator
,
Platform
&
platform
);
~
Context
();
/**
* Get System being simulated in this context.
*/
...
...
@@ -143,19 +143,19 @@ public:
*/
void
setParameter
(
const
std
::
string
&
name
,
double
value
);
/**
* When a
n OpenMM
Context is created, it may cache information about the System being simulated
* When a
Context is created, it may cache information about the System being simulated
* and the Force objects contained in it. This means that, if the System or Forces are then
* modified, the
OpenMM
Context might not see all of the changes. Call reinitialize() to force
* the
OpenMM
Context to rebuild its internal representation of the System and pick up any changes
* modified, the Context might not see all of the changes. Call reinitialize() to force
* the Context to rebuild its internal representation of the System and pick up any changes
* that have been made.
*
* This is an expensive operation, so you should try to avoid calling it too frequently.
*/
void
reinitialize
();
private:
OpenMM
ContextImpl
*
impl
;
ContextImpl
*
impl
;
};
}
// namespace OpenMM
#endif
/*OPENMM_
OPENMM
CONTEXT_H_*/
#endif
/*OPENMM_CONTEXT_H_*/
openmmapi/include/openmm/Force.h
View file @
a4020466
...
...
@@ -48,7 +48,7 @@ class ForceImpl;
* <li>Add a contribution to the force on each particle</li>
* <li>Add a contribution to the potential energy of the System</li>
* <li>Modify the positions and velocities of particles at the start of each time step</li>
* <li>Define parameters which are stored in the
OpenMM
Context and can be modified by the user</li>
* <li>Define parameters which are stored in the Context and can be modified by the user</li>
* <li>Change the values of parameters defined by other Force objects at the start of each time step</li>
* </ul>
*/
...
...
@@ -59,11 +59,11 @@ public:
virtual
~
Force
()
{
}
protected:
friend
class
OpenMM
ContextImpl
;
friend
class
ContextImpl
;
/**
* When a
n OpenMM
Context is created, it invokes this method on each Force in the System.
* When a
Context is created, it invokes this method on each Force in the System.
* It should create a new ForceImpl object which can be used by the context for calculating forces.
* The ForceImpl will be deleted automatically when the
OpenMM
Context is deleted.
* The ForceImpl will be deleted automatically when the Context is deleted.
*/
virtual
ForceImpl
*
createImpl
()
=
0
;
...
...
openmmapi/include/openmm/GBSAOBCForce.h
View file @
a4020466
...
...
@@ -44,7 +44,7 @@ namespace OpenMM {
* To use this class, create a GBSAOBCForce object, then call addParticle() once for each particle in the
* System to define its parameters. The number of particles for which you define GBSA parameters must
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* try to create a
n OpenMM
Context. After a particle has been added, you can modify its force field parameters
* try to create a
Context. After a particle has been added, you can modify its force field parameters
* by calling setParticleParameters().
* <p>
* If the System also contains a NonbondedForce, this force will use the cutoffs
...
...
openmmapi/include/openmm/GBVIForce.h
View file @
a4020466
...
...
@@ -44,7 +44,7 @@ namespace OpenMM {
* To use this class, create a GBVIForce object, then call addParticle() once for each particle in the
* System to define its parameters. The number of particles for which you define GB/VI parameters must
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* try to create a
n OpenMM
Context. After a particle has been added, you can modify its force field parameters
* try to create a
Context. After a particle has been added, you can modify its force field parameters
* by calling setParticleParameters().
* <p>
* If the System also contains a NonbondedForce, this force will use the cutoffs
...
...
openmmapi/include/openmm/Integrator.h
View file @
a4020466
...
...
@@ -39,15 +39,15 @@
namespace
OpenMM
{
class
OpenMM
Context
;
class
OpenMM
ContextImpl
;
class
Context
;
class
ContextImpl
;
/**
* An Integrator defines a method for simulating a System by integrating the equations of motion.
* This is an abstract class. Subclasses define particular integration methods.
*
* Each Integrator object is bound to a particular
OpenMM
Context which it integrates. This connection
* is specified by passing the Integrator as an argument to the constructor of the
OpenMM
Context.
* Each Integrator object is bound to a particular Context which it integrates. This connection
* is specified by passing the Integrator as an argument to the constructor of the Context.
*/
class
OPENMM_EXPORT
Integrator
{
...
...
@@ -87,13 +87,13 @@ public:
*/
virtual
void
step
(
int
steps
)
=
0
;
protected:
friend
class
OpenMM
ContextImpl
;
friend
class
ContextImpl
;
/**
* This will be called by the
OpenMM
Context when it is created. It informs the Integrator
* This will be called by the Context when it is created. It informs the Integrator
* of what context it will be integrating, and gives it a chance to do any necessary initialization.
* It will also get called again if the application calls reinitialize() on the
OpenMM
Context.
* It will also get called again if the application calls reinitialize() on the Context.
*/
virtual
void
initialize
(
OpenMM
ContextImpl
&
context
)
=
0
;
virtual
void
initialize
(
ContextImpl
&
context
)
=
0
;
/**
* Get the names of all Kernels used by this Integrator.
*/
...
...
openmmapi/include/openmm/LangevinIntegrator.h
View file @
a4020466
...
...
@@ -103,11 +103,11 @@ public:
void
step
(
int
steps
);
protected:
/**
* This will be called by the
OpenMM
Context when it is created. It informs the Integrator
* This will be called by the Context when it is created. It informs the Integrator
* of what context it will be integrating, and gives it a chance to do any necessary initialization.
* It will also get called again if the application calls reinitialize() on the
OpenMM
Context.
* It will also get called again if the application calls reinitialize() on the Context.
*/
void
initialize
(
OpenMM
ContextImpl
&
context
);
void
initialize
(
ContextImpl
&
context
);
/**
* Get the names of all Kernels used by this Integrator.
*/
...
...
@@ -115,7 +115,7 @@ protected:
private:
double
temperature
,
friction
;
int
randomNumberSeed
;
OpenMM
ContextImpl
*
context
;
ContextImpl
*
context
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/NonbondedForce.h
View file @
a4020466
...
...
@@ -52,7 +52,7 @@ namespace OpenMM {
* To use this class, create a NonbondedForce object, then call addParticle() once for each particle in the
* System to define its parameters. The number of particles for which you define nonbonded parameters must
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* try to create a
n OpenMM
Context. After a particle has been added, you can modify its force field parameters
* try to create a
Context. After a particle has been added, you can modify its force field parameters
* by calling setParticleParameters().
*
* NonbondedForce also lets you specify "exceptions", particular pairs of particles whose interactions should be
...
...
openmmapi/include/openmm/State.h
View file @
a4020466
...
...
@@ -41,7 +41,7 @@ namespace OpenMM {
/**
* A State object records a snapshot of the current state of a simulation at a point in time.
* You create it by calling getState() on a
n OpenMM
Context.
* You create it by calling getState() on a
Context.
*
* When a State is created, you specify what information should be stored in it. This saves
* time and memory by only copying in the information that you actually want. This is especially
...
...
@@ -86,7 +86,7 @@ public:
*/
const
std
::
map
<
std
::
string
,
double
>&
getParameters
()
const
;
private:
friend
class
OpenMM
Context
;
friend
class
Context
;
State
(
double
time
,
int
numParticles
,
DataType
types
);
// Retarded visual studio compiler complains about being unable to
...
...
Prev
1
2
3
4
5
…
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