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
18295108
Commit
18295108
authored
Sep 05, 2017
by
peastman
Browse files
Merge changes from main branch
parents
e6101f68
8d7234e5
Changes
154
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
132 additions
and
23 deletions
+132
-23
openmmapi/include/openmm/internal/CMMotionRemoverImpl.h
openmmapi/include/openmm/internal/CMMotionRemoverImpl.h
+1
-1
openmmapi/include/openmm/internal/ContextImpl.h
openmmapi/include/openmm/internal/ContextImpl.h
+20
-3
openmmapi/include/openmm/internal/CustomAngleForceImpl.h
openmmapi/include/openmm/internal/CustomAngleForceImpl.h
+1
-1
openmmapi/include/openmm/internal/CustomBondForceImpl.h
openmmapi/include/openmm/internal/CustomBondForceImpl.h
+1
-1
openmmapi/include/openmm/internal/CustomCVForceImpl.h
openmmapi/include/openmm/internal/CustomCVForceImpl.h
+77
-0
openmmapi/include/openmm/internal/CustomCentroidBondForceImpl.h
...api/include/openmm/internal/CustomCentroidBondForceImpl.h
+1
-1
openmmapi/include/openmm/internal/CustomCompoundBondForceImpl.h
...api/include/openmm/internal/CustomCompoundBondForceImpl.h
+1
-1
openmmapi/include/openmm/internal/CustomExternalForceImpl.h
openmmapi/include/openmm/internal/CustomExternalForceImpl.h
+1
-1
openmmapi/include/openmm/internal/CustomGBForceImpl.h
openmmapi/include/openmm/internal/CustomGBForceImpl.h
+1
-1
openmmapi/include/openmm/internal/CustomHbondForceImpl.h
openmmapi/include/openmm/internal/CustomHbondForceImpl.h
+1
-1
openmmapi/include/openmm/internal/CustomIntegratorUtilities.h
...mmapi/include/openmm/internal/CustomIntegratorUtilities.h
+1
-1
openmmapi/include/openmm/internal/CustomManyParticleForceImpl.h
...api/include/openmm/internal/CustomManyParticleForceImpl.h
+1
-1
openmmapi/include/openmm/internal/CustomNonbondedForceImpl.h
openmmapi/include/openmm/internal/CustomNonbondedForceImpl.h
+2
-2
openmmapi/include/openmm/internal/CustomTorsionForceImpl.h
openmmapi/include/openmm/internal/CustomTorsionForceImpl.h
+1
-1
openmmapi/include/openmm/internal/ForceImpl.h
openmmapi/include/openmm/internal/ForceImpl.h
+17
-2
openmmapi/include/openmm/internal/GBSAOBCForceImpl.h
openmmapi/include/openmm/internal/GBSAOBCForceImpl.h
+1
-1
openmmapi/include/openmm/internal/HarmonicAngleForceImpl.h
openmmapi/include/openmm/internal/HarmonicAngleForceImpl.h
+1
-1
openmmapi/include/openmm/internal/HarmonicBondForceImpl.h
openmmapi/include/openmm/internal/HarmonicBondForceImpl.h
+1
-1
openmmapi/include/openmm/internal/MonteCarloBarostatImpl.h
openmmapi/include/openmm/internal/MonteCarloBarostatImpl.h
+1
-1
openmmapi/include/openmm/internal/NonbondedForceImpl.h
openmmapi/include/openmm/internal/NonbondedForceImpl.h
+1
-1
No files found.
openmmapi/include/openmm/internal/CMMotionRemoverImpl.h
View file @
18295108
...
...
@@ -49,7 +49,7 @@ public:
const
CMMotionRemover
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
);
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
);
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
// This force doesn't apply forces to particles.
return
0.0
;
...
...
openmmapi/include/openmm/internal/ContextImpl.h
View file @
18295108
...
...
@@ -55,7 +55,8 @@ public:
/**
* Create an ContextImpl for a Context;
*/
ContextImpl
(
Context
&
owner
,
const
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
*
originalContext
=
NULL
);
~
ContextImpl
();
/**
* Get the Context for which this is the implementation.
...
...
@@ -197,8 +198,11 @@ public:
double
calcForcesAndEnergy
(
bool
includeForces
,
bool
includeEnergy
,
int
groups
=
0xFFFFFFFF
);
/**
* Get the set of force group flags that were passed to the most recent call to calcForcesAndEnergy().
*
* Note that this returns a reference, so it's possible to modify it. Be very very cautious about
* doing that! Only do it if you're also modifying forces stored inside the context.
*/
int
getLastForceGroups
()
const
;
int
&
getLastForceGroups
();
/**
* Calculate the kinetic energy of the system (in kJ/mol).
*/
...
...
@@ -206,8 +210,11 @@ public:
/**
* This should be called at the start of each time step. It calls updateContextState() on each
* ForceImpl in the system, allowing them to modify the values of state variables.
*
* @return true if the state was modified in any way that would cause the forces on particles
* to change, false otherwise
*/
void
updateContextState
();
bool
updateContextState
();
/**
* Get the list of ForceImpls belonging to this ContextImpl.
*/
...
...
@@ -261,8 +268,18 @@ public:
* you should never call it. It is exposed here because the same logic is useful to other classes too.
*/
static
std
::
vector
<
std
::
vector
<
int
>
>
findMolecules
(
int
numParticles
,
std
::
vector
<
std
::
vector
<
int
>
>&
particleBonds
);
/**
* Create a new Context based on this one. The new context will use the same Platform, device, and property
* values as this one. With the CUDA and OpenCL platforms, it also shares the same GPU context, allowing data
* to be transferred between them without leaving the GPU.
*
* This method exists for very specialized purposes. If you aren't certain whether you should use it, that probably
* means you shouldn't.
*/
Context
*
createLinkedContext
(
const
System
&
system
,
Integrator
&
integrator
);
private:
friend
class
Context
;
void
initialize
();
Context
&
owner
;
const
System
&
system
;
Integrator
&
integrator
;
...
...
openmmapi/include/openmm/internal/CustomAngleForceImpl.h
View file @
18295108
...
...
@@ -53,7 +53,7 @@ public:
const
CustomAngleForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
openmmapi/include/openmm/internal/CustomBondForceImpl.h
View file @
18295108
...
...
@@ -53,7 +53,7 @@ public:
const
CustomBondForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
openmmapi/include/openmm/internal/CustomCVForceImpl.h
0 → 100644
View file @
18295108
#ifndef OPENMM_CUSTOMCVFORCEIMPL_H_
#define OPENMM_CUSTOMCVFORCEIMPL_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* This is part of the OpenMM molecular simulation toolkit originating from *
* Simbios, the NIH National Center for Physics-Based Simulation of *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-2017 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the "Software"), *
* to deal in the Software without restriction, including without limitation *
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
* and/or sell copies of the Software, and to permit persons to whom the *
* Software is furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
* THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "ForceImpl.h"
#include "openmm/Context.h"
#include "openmm/CustomCVForce.h"
#include "openmm/Kernel.h"
#include "openmm/System.h"
#include "openmm/VerletIntegrator.h"
#include <map>
#include <string>
#include <vector>
namespace
OpenMM
{
/**
* This is the internal implementation of CustomCVForce.
*/
class
OPENMM_EXPORT
CustomCVForceImpl
:
public
ForceImpl
{
public:
CustomCVForceImpl
(
const
CustomCVForce
&
owner
);
~
CustomCVForceImpl
();
void
initialize
(
ContextImpl
&
context
);
const
CustomCVForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
();
std
::
vector
<
std
::
string
>
getKernelNames
();
void
getCollectiveVariableValues
(
ContextImpl
&
context
,
std
::
vector
<
double
>&
values
);
Context
&
getInnerContext
();
private:
const
CustomCVForce
&
owner
;
Kernel
kernel
;
System
innerSystem
;
VerletIntegrator
innerIntegrator
;
Context
*
innerContext
;
};
}
// namespace OpenMM
#endif
/*OPENMM_CUSTOMCVFORCEIMPL_H_*/
openmmapi/include/openmm/internal/CustomCentroidBondForceImpl.h
View file @
18295108
...
...
@@ -58,7 +58,7 @@ public:
const
CustomCentroidBondForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
openmmapi/include/openmm/internal/CustomCompoundBondForceImpl.h
View file @
18295108
...
...
@@ -57,7 +57,7 @@ public:
const
CustomCompoundBondForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
openmmapi/include/openmm/internal/CustomExternalForceImpl.h
View file @
18295108
...
...
@@ -53,7 +53,7 @@ public:
const
CustomExternalForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
openmmapi/include/openmm/internal/CustomGBForceImpl.h
View file @
18295108
...
...
@@ -53,7 +53,7 @@ public:
const
CustomGBForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
openmmapi/include/openmm/internal/CustomHbondForceImpl.h
View file @
18295108
...
...
@@ -57,7 +57,7 @@ public:
const
CustomHbondForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
openmmapi/include/openmm/internal/CustomIntegratorUtilities.h
View file @
18295108
...
...
@@ -73,7 +73,7 @@ public:
*/
static
void
analyzeComputations
(
const
ContextImpl
&
context
,
const
CustomIntegrator
&
integrator
,
std
::
vector
<
std
::
vector
<
Lepton
::
ParsedExpression
>
>&
expressions
,
std
::
vector
<
Comparison
>&
comparisons
,
std
::
vector
<
int
>&
blockEnd
,
std
::
vector
<
bool
>&
invalidatesForces
,
std
::
vector
<
bool
>&
needsForces
,
std
::
vector
<
bool
>&
needsEnergy
,
std
::
vector
<
bool
>&
computeBoth
,
std
::
vector
<
int
>&
forceGroup
);
std
::
vector
<
bool
>&
needsEnergy
,
std
::
vector
<
bool
>&
computeBoth
,
std
::
vector
<
int
>&
forceGroup
,
const
std
::
map
<
std
::
string
,
Lepton
::
CustomFunction
*>&
functions
);
/**
* Determine whether an expression involves a particular variable.
*/
...
...
openmmapi/include/openmm/internal/CustomManyParticleForceImpl.h
View file @
18295108
...
...
@@ -57,7 +57,7 @@ public:
const
CustomManyParticleForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
openmmapi/include/openmm/internal/CustomNonbondedForceImpl.h
View file @
18295108
...
...
@@ -54,7 +54,7 @@ public:
const
CustomNonbondedForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
@@ -69,7 +69,7 @@ public:
static
void
calcLongRangeCorrection
(
const
CustomNonbondedForce
&
force
,
const
Context
&
context
,
double
&
coefficient
,
std
::
vector
<
double
>&
derivatives
);
private:
static
double
integrateInteraction
(
Lepton
::
CompiledExpression
&
expression
,
const
std
::
vector
<
double
>&
params1
,
const
std
::
vector
<
double
>&
params2
,
const
CustomNonbondedForce
&
force
,
const
Context
&
context
);
const
CustomNonbondedForce
&
force
,
const
Context
&
context
,
const
std
::
vector
<
std
::
string
>&
paramNames
);
const
CustomNonbondedForce
&
owner
;
Kernel
kernel
;
};
...
...
openmmapi/include/openmm/internal/CustomTorsionForceImpl.h
View file @
18295108
...
...
@@ -53,7 +53,7 @@ public:
const
CustomTorsionForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
openmmapi/include/openmm/internal/ForceImpl.h
View file @
18295108
...
...
@@ -32,6 +32,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/Context.h"
#include "openmm/internal/windowsExport.h"
#include <map>
#include <string>
...
...
@@ -73,8 +74,15 @@ public:
* Context in arbitrary ways before integration is performed.
*
* @param context the context in which the system is being simulated
* @param forcesInvalid if the state was modified in any way that might cause previously
* calculated forces to no longer be valid (such as modifying
* positions or parameters), the method should set this to true.
*/
virtual
void
updateContextState
(
ContextImpl
&
context
)
=
0
;
virtual
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
);
/**
* @deprecated This version exists for backward compatibility. Subclasses should implement the other version instead.
*/
virtual
void
updateContextState
(
ContextImpl
&
context
);
/**
* Calculate the force on each particle generated by this ForceImpl and/or this ForceImpl's
* contribution to the potential energy of the system.
...
...
@@ -104,6 +112,13 @@ public:
virtual
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
()
const
{
return
std
::
vector
<
std
::
pair
<
int
,
int
>
>
(
0
);
}
protected:
/**
* Get the ContextImpl corresponding to a Context.
*/
ContextImpl
&
getContextImpl
(
Context
&
context
)
{
return
context
.
getImpl
();
}
};
}
// namespace OpenMM
...
...
openmmapi/include/openmm/internal/GBSAOBCForceImpl.h
View file @
18295108
...
...
@@ -50,7 +50,7 @@ public:
const
GBSAOBCForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
openmmapi/include/openmm/internal/HarmonicAngleForceImpl.h
View file @
18295108
...
...
@@ -53,7 +53,7 @@ public:
const
HarmonicAngleForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
openmmapi/include/openmm/internal/HarmonicBondForceImpl.h
View file @
18295108
...
...
@@ -53,7 +53,7 @@ public:
const
HarmonicBondForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
openmmapi/include/openmm/internal/MonteCarloBarostatImpl.h
View file @
18295108
...
...
@@ -51,7 +51,7 @@ public:
const
MonteCarloBarostat
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
);
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
);
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
// This force doesn't apply forces to particles.
return
0.0
;
...
...
openmmapi/include/openmm/internal/NonbondedForceImpl.h
View file @
18295108
...
...
@@ -55,7 +55,7 @@ public:
const
NonbondedForce
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
)
{
void
updateContextState
(
ContextImpl
&
context
,
bool
&
forcesInvalid
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
...
...
Prev
1
2
3
4
5
6
…
8
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