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
0307a0db
Commit
0307a0db
authored
Apr 15, 2013
by
Yutong Zhao
Browse files
Context constructor now uses const System&, guaranteeing that System won't be modified.
parent
19757775
Changes
138
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
56 additions
and
56 deletions
+56
-56
openmmapi/include/openmm/RBTorsionForce.h
openmmapi/include/openmm/RBTorsionForce.h
+1
-1
openmmapi/include/openmm/internal/AndersenThermostatImpl.h
openmmapi/include/openmm/internal/AndersenThermostatImpl.h
+3
-3
openmmapi/include/openmm/internal/CMAPTorsionForceImpl.h
openmmapi/include/openmm/internal/CMAPTorsionForceImpl.h
+3
-3
openmmapi/include/openmm/internal/CMMotionRemoverImpl.h
openmmapi/include/openmm/internal/CMMotionRemoverImpl.h
+3
-3
openmmapi/include/openmm/internal/ContextImpl.h
openmmapi/include/openmm/internal/ContextImpl.h
+3
-3
openmmapi/include/openmm/internal/CustomAngleForceImpl.h
openmmapi/include/openmm/internal/CustomAngleForceImpl.h
+3
-3
openmmapi/include/openmm/internal/CustomBondForceImpl.h
openmmapi/include/openmm/internal/CustomBondForceImpl.h
+3
-3
openmmapi/include/openmm/internal/CustomCompoundBondForceImpl.h
...api/include/openmm/internal/CustomCompoundBondForceImpl.h
+3
-3
openmmapi/include/openmm/internal/CustomExternalForceImpl.h
openmmapi/include/openmm/internal/CustomExternalForceImpl.h
+3
-3
openmmapi/include/openmm/internal/CustomGBForceImpl.h
openmmapi/include/openmm/internal/CustomGBForceImpl.h
+3
-3
openmmapi/include/openmm/internal/CustomHbondForceImpl.h
openmmapi/include/openmm/internal/CustomHbondForceImpl.h
+3
-3
openmmapi/include/openmm/internal/CustomNonbondedForceImpl.h
openmmapi/include/openmm/internal/CustomNonbondedForceImpl.h
+3
-3
openmmapi/include/openmm/internal/CustomTorsionForceImpl.h
openmmapi/include/openmm/internal/CustomTorsionForceImpl.h
+3
-3
openmmapi/include/openmm/internal/ForceImpl.h
openmmapi/include/openmm/internal/ForceImpl.h
+1
-1
openmmapi/include/openmm/internal/GBSAOBCForceImpl.h
openmmapi/include/openmm/internal/GBSAOBCForceImpl.h
+3
-3
openmmapi/include/openmm/internal/GBVIForceImpl.h
openmmapi/include/openmm/internal/GBVIForceImpl.h
+3
-3
openmmapi/include/openmm/internal/HarmonicAngleForceImpl.h
openmmapi/include/openmm/internal/HarmonicAngleForceImpl.h
+3
-3
openmmapi/include/openmm/internal/HarmonicBondForceImpl.h
openmmapi/include/openmm/internal/HarmonicBondForceImpl.h
+3
-3
openmmapi/include/openmm/internal/MonteCarloBarostatImpl.h
openmmapi/include/openmm/internal/MonteCarloBarostatImpl.h
+3
-3
openmmapi/include/openmm/internal/NonbondedForceImpl.h
openmmapi/include/openmm/internal/NonbondedForceImpl.h
+3
-3
No files found.
openmmapi/include/openmm/RBTorsionForce.h
View file @
0307a0db
...
...
@@ -118,7 +118,7 @@ public:
*/
void
updateParametersInContext
(
Context
&
context
);
protected:
ForceImpl
*
createImpl
();
ForceImpl
*
createImpl
()
const
;
private:
class
RBTorsionInfo
;
std
::
vector
<
RBTorsionInfo
>
rbTorsions
;
...
...
openmmapi/include/openmm/internal/AndersenThermostatImpl.h
View file @
0307a0db
...
...
@@ -47,9 +47,9 @@ class System;
class
OPENMM_EXPORT
AndersenThermostatImpl
:
public
ForceImpl
{
public:
AndersenThermostatImpl
(
AndersenThermostat
&
owner
);
AndersenThermostatImpl
(
const
AndersenThermostat
&
owner
);
void
initialize
(
ContextImpl
&
context
);
AndersenThermostat
&
getOwner
()
{
const
AndersenThermostat
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
);
...
...
@@ -66,7 +66,7 @@ public:
static
std
::
vector
<
std
::
vector
<
int
>
>
calcParticleGroups
(
const
System
&
system
);
private:
static
void
tagParticlesInGroup
(
int
particle
,
int
group
,
std
::
vector
<
int
>&
particleGroup
,
std
::
vector
<
std
::
vector
<
int
>
>&
particleConstraints
);
AndersenThermostat
&
owner
;
const
AndersenThermostat
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/CMAPTorsionForceImpl.h
View file @
0307a0db
...
...
@@ -46,10 +46,10 @@ namespace OpenMM {
class
OPENMM_EXPORT
CMAPTorsionForceImpl
:
public
ForceImpl
{
public:
CMAPTorsionForceImpl
(
CMAPTorsionForce
&
owner
);
CMAPTorsionForceImpl
(
const
CMAPTorsionForce
&
owner
);
~
CMAPTorsionForceImpl
();
void
initialize
(
ContextImpl
&
context
);
CMAPTorsionForce
&
getOwner
()
{
const
CMAPTorsionForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -65,7 +65,7 @@ public:
*/
static
void
calcMapDerivatives
(
int
size
,
const
std
::
vector
<
double
>&
energy
,
std
::
vector
<
std
::
vector
<
double
>
>&
c
);
private:
CMAPTorsionForce
&
owner
;
const
CMAPTorsionForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/CMMotionRemoverImpl.h
View file @
0307a0db
...
...
@@ -44,9 +44,9 @@ namespace OpenMM {
class
CMMotionRemoverImpl
:
public
ForceImpl
{
public:
CMMotionRemoverImpl
(
CMMotionRemover
&
owner
);
CMMotionRemoverImpl
(
const
CMMotionRemover
&
owner
);
void
initialize
(
ContextImpl
&
context
);
CMMotionRemover
&
getOwner
()
{
const
CMMotionRemover
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
);
...
...
@@ -59,7 +59,7 @@ public:
}
std
::
vector
<
std
::
string
>
getKernelNames
();
private:
CMMotionRemover
&
owner
;
const
CMMotionRemover
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/ContextImpl.h
View file @
0307a0db
...
...
@@ -55,7 +55,7 @@ public:
/**
* Create an ContextImpl for a Context;
*/
ContextImpl
(
Context
&
owner
,
System
&
system
,
Integrator
&
integrator
,
Platform
*
platform
,
const
std
::
map
<
std
::
string
,
std
::
string
>&
properties
);
ContextImpl
(
Context
&
owner
,
const
System
&
system
,
Integrator
&
integrator
,
Platform
*
platform
,
const
std
::
map
<
std
::
string
,
std
::
string
>&
properties
);
~
ContextImpl
();
/**
* Get the Context for which this is the implementation.
...
...
@@ -66,7 +66,7 @@ public:
/**
* Get System being simulated in this context.
*/
System
&
getSystem
()
{
const
System
&
getSystem
()
const
{
return
system
;
}
/**
...
...
@@ -254,7 +254,7 @@ private:
friend
class
Context
;
static
void
tagParticlesInMolecule
(
int
particle
,
int
molecule
,
std
::
vector
<
int
>&
particleMolecule
,
std
::
vector
<
std
::
vector
<
int
>
>&
particleBonds
);
Context
&
owner
;
System
&
system
;
const
System
&
system
;
Integrator
&
integrator
;
std
::
vector
<
ForceImpl
*>
forceImpls
;
std
::
map
<
std
::
string
,
double
>
parameters
;
...
...
openmmapi/include/openmm/internal/CustomAngleForceImpl.h
View file @
0307a0db
...
...
@@ -47,10 +47,10 @@ namespace OpenMM {
class
CustomAngleForceImpl
:
public
ForceImpl
{
public:
CustomAngleForceImpl
(
CustomAngleForce
&
owner
);
CustomAngleForceImpl
(
const
CustomAngleForce
&
owner
);
~
CustomAngleForceImpl
();
void
initialize
(
ContextImpl
&
context
);
CustomAngleForce
&
getOwner
()
{
const
CustomAngleForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -61,7 +61,7 @@ public:
std
::
vector
<
std
::
string
>
getKernelNames
();
void
updateParametersInContext
(
ContextImpl
&
context
);
private:
CustomAngleForce
&
owner
;
const
CustomAngleForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/CustomBondForceImpl.h
View file @
0307a0db
...
...
@@ -47,10 +47,10 @@ namespace OpenMM {
class
CustomBondForceImpl
:
public
ForceImpl
{
public:
CustomBondForceImpl
(
CustomBondForce
&
owner
);
CustomBondForceImpl
(
const
CustomBondForce
&
owner
);
~
CustomBondForceImpl
();
void
initialize
(
ContextImpl
&
context
);
CustomBondForce
&
getOwner
()
{
const
CustomBondForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -62,7 +62,7 @@ public:
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
()
const
;
void
updateParametersInContext
(
ContextImpl
&
context
);
private:
CustomBondForce
&
owner
;
const
CustomBondForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/CustomCompoundBondForceImpl.h
View file @
0307a0db
...
...
@@ -50,10 +50,10 @@ namespace OpenMM {
class
OPENMM_EXPORT
CustomCompoundBondForceImpl
:
public
ForceImpl
{
public:
CustomCompoundBondForceImpl
(
CustomCompoundBondForce
&
owner
);
CustomCompoundBondForceImpl
(
const
CustomCompoundBondForce
&
owner
);
~
CustomCompoundBondForceImpl
();
void
initialize
(
ContextImpl
&
context
);
CustomCompoundBondForce
&
getOwner
()
{
const
CustomCompoundBondForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -84,7 +84,7 @@ private:
static
Lepton
::
ExpressionTreeNode
replaceFunctions
(
const
Lepton
::
ExpressionTreeNode
&
node
,
std
::
map
<
std
::
string
,
int
>
atoms
,
std
::
map
<
std
::
string
,
std
::
vector
<
int
>
>&
distances
,
std
::
map
<
std
::
string
,
std
::
vector
<
int
>
>&
angles
,
std
::
map
<
std
::
string
,
std
::
vector
<
int
>
>&
dihedrals
);
CustomCompoundBondForce
&
owner
;
const
CustomCompoundBondForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/CustomExternalForceImpl.h
View file @
0307a0db
...
...
@@ -47,10 +47,10 @@ namespace OpenMM {
class
CustomExternalForceImpl
:
public
ForceImpl
{
public:
CustomExternalForceImpl
(
CustomExternalForce
&
owner
);
CustomExternalForceImpl
(
const
CustomExternalForce
&
owner
);
~
CustomExternalForceImpl
();
void
initialize
(
ContextImpl
&
context
);
CustomExternalForce
&
getOwner
()
{
const
CustomExternalForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -61,7 +61,7 @@ public:
std
::
vector
<
std
::
string
>
getKernelNames
();
void
updateParametersInContext
(
ContextImpl
&
context
);
private:
CustomExternalForce
&
owner
;
const
CustomExternalForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/CustomGBForceImpl.h
View file @
0307a0db
...
...
@@ -47,10 +47,10 @@ namespace OpenMM {
class
CustomGBForceImpl
:
public
ForceImpl
{
public:
CustomGBForceImpl
(
CustomGBForce
&
owner
);
CustomGBForceImpl
(
const
CustomGBForce
&
owner
);
~
CustomGBForceImpl
();
void
initialize
(
ContextImpl
&
context
);
CustomGBForce
&
getOwner
()
{
const
CustomGBForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -61,7 +61,7 @@ public:
std
::
vector
<
std
::
string
>
getKernelNames
();
void
updateParametersInContext
(
ContextImpl
&
context
);
private:
CustomGBForce
&
owner
;
const
CustomGBForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/CustomHbondForceImpl.h
View file @
0307a0db
...
...
@@ -50,10 +50,10 @@ namespace OpenMM {
class
OPENMM_EXPORT
CustomHbondForceImpl
:
public
ForceImpl
{
public:
CustomHbondForceImpl
(
CustomHbondForce
&
owner
);
CustomHbondForceImpl
(
const
CustomHbondForce
&
owner
);
~
CustomHbondForceImpl
();
void
initialize
(
ContextImpl
&
context
);
CustomHbondForce
&
getOwner
()
{
const
CustomHbondForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -85,7 +85,7 @@ private:
static
Lepton
::
ExpressionTreeNode
replaceFunctions
(
const
Lepton
::
ExpressionTreeNode
&
node
,
std
::
map
<
std
::
string
,
int
>
atoms
,
std
::
map
<
std
::
string
,
std
::
vector
<
int
>
>&
distances
,
std
::
map
<
std
::
string
,
std
::
vector
<
int
>
>&
angles
,
std
::
map
<
std
::
string
,
std
::
vector
<
int
>
>&
dihedrals
);
CustomHbondForce
&
owner
;
const
CustomHbondForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/CustomNonbondedForceImpl.h
View file @
0307a0db
...
...
@@ -47,10 +47,10 @@ namespace OpenMM {
class
CustomNonbondedForceImpl
:
public
ForceImpl
{
public:
CustomNonbondedForceImpl
(
CustomNonbondedForce
&
owner
);
CustomNonbondedForceImpl
(
const
CustomNonbondedForce
&
owner
);
~
CustomNonbondedForceImpl
();
void
initialize
(
ContextImpl
&
context
);
CustomNonbondedForce
&
getOwner
()
{
const
CustomNonbondedForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -61,7 +61,7 @@ public:
std
::
vector
<
std
::
string
>
getKernelNames
();
void
updateParametersInContext
(
ContextImpl
&
context
);
private:
CustomNonbondedForce
&
owner
;
const
CustomNonbondedForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/CustomTorsionForceImpl.h
View file @
0307a0db
...
...
@@ -47,10 +47,10 @@ namespace OpenMM {
class
CustomTorsionForceImpl
:
public
ForceImpl
{
public:
CustomTorsionForceImpl
(
CustomTorsionForce
&
owner
);
CustomTorsionForceImpl
(
const
CustomTorsionForce
&
owner
);
~
CustomTorsionForceImpl
();
void
initialize
(
ContextImpl
&
context
);
CustomTorsionForce
&
getOwner
()
{
const
CustomTorsionForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -61,7 +61,7 @@ public:
std
::
vector
<
std
::
string
>
getKernelNames
();
void
updateParametersInContext
(
ContextImpl
&
context
);
private:
CustomTorsionForce
&
owner
;
const
CustomTorsionForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/ForceImpl.h
View file @
0307a0db
...
...
@@ -66,7 +66,7 @@ public:
/**
* Get the Force object from which this ForceImpl was created.
*/
virtual
Force
&
getOwner
()
=
0
;
virtual
const
Force
&
getOwner
()
const
=
0
;
/**
* This method is called at the beginning of each time step. It give the ForceImpl a chance
* to modify the state variables (positions, velocities, and parameters) stored in the
...
...
openmmapi/include/openmm/internal/GBSAOBCForceImpl.h
View file @
0307a0db
...
...
@@ -45,9 +45,9 @@ namespace OpenMM {
class
GBSAOBCForceImpl
:
public
ForceImpl
{
public:
GBSAOBCForceImpl
(
GBSAOBCForce
&
owner
);
GBSAOBCForceImpl
(
const
GBSAOBCForce
&
owner
);
void
initialize
(
ContextImpl
&
context
);
GBSAOBCForce
&
getOwner
()
{
const
GBSAOBCForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -60,7 +60,7 @@ public:
std
::
vector
<
std
::
string
>
getKernelNames
();
void
updateParametersInContext
(
ContextImpl
&
context
);
private:
GBSAOBCForce
&
owner
;
const
GBSAOBCForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/GBVIForceImpl.h
View file @
0307a0db
...
...
@@ -45,9 +45,9 @@ namespace OpenMM {
class
GBVIForceImpl
:
public
ForceImpl
{
public:
GBVIForceImpl
(
GBVIForce
&
owner
);
GBVIForceImpl
(
const
GBVIForce
&
owner
);
void
initialize
(
ContextImpl
&
context
);
GBVIForce
&
getOwner
()
{
const
GBVIForce
&
getOwner
()
const
{
return
owner
;
}
...
...
@@ -68,7 +68,7 @@ public:
}
std
::
vector
<
std
::
string
>
getKernelNames
();
private:
GBVIForce
&
owner
;
const
GBVIForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/HarmonicAngleForceImpl.h
View file @
0307a0db
...
...
@@ -47,10 +47,10 @@ namespace OpenMM {
class
HarmonicAngleForceImpl
:
public
ForceImpl
{
public:
HarmonicAngleForceImpl
(
HarmonicAngleForce
&
owner
);
HarmonicAngleForceImpl
(
const
HarmonicAngleForce
&
owner
);
~
HarmonicAngleForceImpl
();
void
initialize
(
ContextImpl
&
context
);
HarmonicAngleForce
&
getOwner
()
{
const
HarmonicAngleForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -63,7 +63,7 @@ public:
std
::
vector
<
std
::
string
>
getKernelNames
();
void
updateParametersInContext
(
ContextImpl
&
context
);
private:
HarmonicAngleForce
&
owner
;
const
HarmonicAngleForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/HarmonicBondForceImpl.h
View file @
0307a0db
...
...
@@ -47,10 +47,10 @@ namespace OpenMM {
class
HarmonicBondForceImpl
:
public
ForceImpl
{
public:
HarmonicBondForceImpl
(
HarmonicBondForce
&
owner
);
HarmonicBondForceImpl
(
const
HarmonicBondForce
&
owner
);
~
HarmonicBondForceImpl
();
void
initialize
(
ContextImpl
&
context
);
HarmonicBondForce
&
getOwner
()
{
const
HarmonicBondForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -64,7 +64,7 @@ public:
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
()
const
;
void
updateParametersInContext
(
ContextImpl
&
context
);
private:
HarmonicBondForce
&
owner
;
const
HarmonicBondForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/MonteCarloBarostatImpl.h
View file @
0307a0db
...
...
@@ -46,9 +46,9 @@ namespace OpenMM {
class
MonteCarloBarostatImpl
:
public
ForceImpl
{
public:
MonteCarloBarostatImpl
(
MonteCarloBarostat
&
owner
);
MonteCarloBarostatImpl
(
const
MonteCarloBarostat
&
owner
);
void
initialize
(
ContextImpl
&
context
);
MonteCarloBarostat
&
getOwner
()
{
const
MonteCarloBarostat
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
);
...
...
@@ -59,7 +59,7 @@ public:
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
();
std
::
vector
<
std
::
string
>
getKernelNames
();
private:
MonteCarloBarostat
&
owner
;
const
MonteCarloBarostat
&
owner
;
int
step
,
numAttempted
,
numAccepted
;
double
volumeScale
;
OpenMM_SFMT
::
SFMT
random
;
...
...
openmmapi/include/openmm/internal/NonbondedForceImpl.h
View file @
0307a0db
...
...
@@ -49,10 +49,10 @@ class System;
class
OPENMM_EXPORT
NonbondedForceImpl
:
public
ForceImpl
{
public:
NonbondedForceImpl
(
NonbondedForce
&
owner
);
NonbondedForceImpl
(
const
NonbondedForce
&
owner
);
~
NonbondedForceImpl
();
void
initialize
(
ContextImpl
&
context
);
NonbondedForce
&
getOwner
()
{
const
NonbondedForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
...
...
@@ -83,7 +83,7 @@ private:
class
ErrorFunction
;
class
EwaldErrorFunction
;
static
int
findZero
(
const
ErrorFunction
&
f
,
int
initialGuess
);
NonbondedForce
&
owner
;
const
NonbondedForce
&
owner
;
Kernel
kernel
;
};
...
...
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