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
61d5cc0f
Commit
61d5cc0f
authored
Apr 16, 2015
by
Peter
Browse files
Merge branch 'master' into applecl
parents
e2999354
afae4bc8
Changes
248
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
498 additions
and
26 deletions
+498
-26
openmmapi/include/openmm/GBSAOBCForce.h
openmmapi/include/openmm/GBSAOBCForce.h
+23
-2
openmmapi/include/openmm/GBVIForce.h
openmmapi/include/openmm/GBVIForce.h
+13
-4
openmmapi/include/openmm/HarmonicAngleForce.h
openmmapi/include/openmm/HarmonicAngleForce.h
+10
-1
openmmapi/include/openmm/HarmonicBondForce.h
openmmapi/include/openmm/HarmonicBondForce.h
+10
-1
openmmapi/include/openmm/LangevinIntegrator.h
openmmapi/include/openmm/LangevinIntegrator.h
+5
-1
openmmapi/include/openmm/MonteCarloAnisotropicBarostat.h
openmmapi/include/openmm/MonteCarloAnisotropicBarostat.h
+13
-0
openmmapi/include/openmm/MonteCarloBarostat.h
openmmapi/include/openmm/MonteCarloBarostat.h
+13
-0
openmmapi/include/openmm/MonteCarloMembraneBarostat.h
openmmapi/include/openmm/MonteCarloMembraneBarostat.h
+251
-0
openmmapi/include/openmm/NonbondedForce.h
openmmapi/include/openmm/NonbondedForce.h
+12
-1
openmmapi/include/openmm/PeriodicTorsionForce.h
openmmapi/include/openmm/PeriodicTorsionForce.h
+10
-1
openmmapi/include/openmm/RBTorsionForce.h
openmmapi/include/openmm/RBTorsionForce.h
+10
-1
openmmapi/include/openmm/State.h
openmmapi/include/openmm/State.h
+4
-0
openmmapi/include/openmm/System.h
openmmapi/include/openmm/System.h
+25
-5
openmmapi/include/openmm/VariableLangevinIntegrator.h
openmmapi/include/openmm/VariableLangevinIntegrator.h
+4
-0
openmmapi/include/openmm/VerletIntegrator.h
openmmapi/include/openmm/VerletIntegrator.h
+1
-1
openmmapi/include/openmm/internal/CMAPTorsionForceImpl.h
openmmapi/include/openmm/internal/CMAPTorsionForceImpl.h
+2
-1
openmmapi/include/openmm/internal/ContextImpl.h
openmmapi/include/openmm/internal/ContextImpl.h
+3
-5
openmmapi/include/openmm/internal/MonteCarloMembraneBarostatImpl.h
.../include/openmm/internal/MonteCarloMembraneBarostatImpl.h
+71
-0
openmmapi/include/openmm/internal/vectorize8.h
openmmapi/include/openmm/internal/vectorize8.h
+12
-0
openmmapi/include/openmm/internal/vectorize_neon.h
openmmapi/include/openmm/internal/vectorize_neon.h
+6
-2
No files found.
Too many changes to show.
To preserve performance only
248 of 248+
files are displayed.
Plain diff
Email patch
openmmapi/include/openmm/GBSAOBCForce.h
View file @
61d5cc0f
...
...
@@ -138,6 +138,18 @@ public:
void
setSoluteDielectric
(
double
dielectric
)
{
soluteDielectric
=
dielectric
;
}
/**
* Get the energy scale for the surface energy term, measured in kJ/mol/nm^2.
*/
double
getSurfaceAreaEnergy
()
const
{
return
surfaceAreaEnergy
;
}
/**
* Set the energy scale for the surface energy term, measured in kJ/mol/nm^2.
*/
void
setSurfaceAreaEnergy
(
double
energy
)
{
surfaceAreaEnergy
=
energy
;
}
/**
* Get the method used for handling long range nonbonded interactions.
*/
...
...
@@ -164,7 +176,7 @@ public:
* Update the particle parameters in a Context to match those stored in this Force object. This method
* provides an efficient method to update certain parameters in an existing Context without needing to
* reinitialize it. Simply call setParticleParameters() to modify this object's parameters, then call
* updateParametersIn
State
() to copy them over to the Context.
* updateParametersIn
Context
() to copy them over to the Context.
*
* The only information this method updates is the values of per-particle parameters. All other aspects
* of the Force (the nonbonded method, the cutoff distance, etc.) are unaffected and can only be changed
...
...
@@ -172,12 +184,21 @@ public:
* change the parameters of existing ones.
*/
void
updateParametersInContext
(
Context
&
context
);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
nonbondedMethod
==
GBSAOBCForce
::
CutoffPeriodic
;
}
protected:
ForceImpl
*
createImpl
()
const
;
private:
class
ParticleInfo
;
NonbondedMethod
nonbondedMethod
;
double
cutoffDistance
,
solventDielectric
,
soluteDielectric
;
double
cutoffDistance
,
solventDielectric
,
soluteDielectric
,
surfaceAreaEnergy
;
std
::
vector
<
ParticleInfo
>
particles
;
};
...
...
openmmapi/include/openmm/GBVIForce.h
View file @
61d5cc0f
...
...
@@ -157,7 +157,7 @@ public:
*
* @return number of bonds
*/
int
getNumBonds
(
void
)
const
;
int
getNumBonds
()
const
;
/**
* Get the dielectric constant for the solvent.
...
...
@@ -208,7 +208,7 @@ public:
/**
* Get Born radius scaling method
*/
BornRadiusScalingMethod
getBornRadiusScalingMethod
(
void
)
const
;
BornRadiusScalingMethod
getBornRadiusScalingMethod
()
const
;
/**
* Set Born radius scaling method
*/
...
...
@@ -216,7 +216,7 @@ public:
/**
* Get the lower limit factor used in the quintic spline scaling method (typically 0.5-0.8)
*/
double
getQuinticLowerLimitFactor
(
void
)
const
;
double
getQuinticLowerLimitFactor
()
const
;
/**
* Set the lower limit factor used in the quintic spline scaling method (typically 0.5-0.8)
*/
...
...
@@ -224,11 +224,20 @@ public:
/**
* Get the upper limit used in the quintic spline scaling method, measured in nm (~5.0)
*/
double
getQuinticUpperBornRadiusLimit
(
void
)
const
;
double
getQuinticUpperBornRadiusLimit
()
const
;
/**
* Set the upper limit used in the quintic spline scaling method, measured in nm (~5.0)
*/
void
setQuinticUpperBornRadiusLimit
(
double
quinticUpperBornRadiusLimit
);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
nonbondedMethod
==
GBVIForce
::
CutoffPeriodic
;
}
protected:
ForceImpl
*
createImpl
()
const
;
private:
...
...
openmmapi/include/openmm/HarmonicAngleForce.h
View file @
61d5cc0f
...
...
@@ -95,13 +95,22 @@ public:
/**
* Update the per-angle parameters in a Context to match those stored in this Force object. This method provides
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
* Simply call setAngleParameters() to modify this object's parameters, then call updateParametersIn
State
()
* Simply call setAngleParameters() to modify this object's parameters, then call updateParametersIn
Context
()
* to copy them over to the Context.
*
* The only information this method updates is the values of per-angle parameters. The set of particles involved
* in a angle cannot be changed, nor can new angles be added.
*/
void
updateParametersInContext
(
Context
&
context
);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
false
;
}
protected:
ForceImpl
*
createImpl
()
const
;
private:
...
...
openmmapi/include/openmm/HarmonicBondForce.h
View file @
61d5cc0f
...
...
@@ -92,13 +92,22 @@ public:
/**
* Update the per-bond parameters in a Context to match those stored in this Force object. This method provides
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
* Simply call setBondParameters() to modify this object's parameters, then call updateParametersIn
State
()
* Simply call setBondParameters() to modify this object's parameters, then call updateParametersIn
Context
()
* to copy them over to the Context.
*
* The only information this method updates is the values of per-bond parameters. The set of particles involved
* in a bond cannot be changed, nor can new bonds be added.
*/
void
updateParametersInContext
(
Context
&
context
);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
false
;
}
protected:
ForceImpl
*
createImpl
()
const
;
private:
...
...
openmmapi/include/openmm/LangevinIntegrator.h
View file @
61d5cc0f
...
...
@@ -49,7 +49,7 @@ public:
*
* @param temperature the temperature of the heat bath (in Kelvin)
* @param frictionCoeff the friction coefficient which couples the system to the heat bath (in inverse picoseconds)
* @param stepSize the step size with which to integrat
or
the system (in picoseconds)
* @param stepSize the step size with which to integrat
e
the system (in picoseconds)
*/
LangevinIntegrator
(
double
temperature
,
double
frictionCoeff
,
double
stepSize
);
/**
...
...
@@ -99,6 +99,10 @@ public:
* the other hand, no guarantees are made about the behavior of simulations that use the same seed.
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically.
*
* If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* is created from this Force. This is done to ensure that each Context receives unique random seeds
* without you needing to set them explicitly.
*/
void
setRandomNumberSeed
(
int
seed
)
{
randomNumberSeed
=
seed
;
...
...
openmmapi/include/openmm/MonteCarloAnisotropicBarostat.h
View file @
61d5cc0f
...
...
@@ -167,10 +167,23 @@ public:
* the other hand, no guarantees are made about the behavior of simulations that use the same seed.
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically.
*
* If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* is created from this Force. This is done to ensure that each Context receives unique random seeds
* without you needing to set them explicitly.
*/
void
setRandomNumberSeed
(
int
seed
)
{
randomNumberSeed
=
seed
;
}
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
true
;
}
protected:
ForceImpl
*
createImpl
()
const
;
private:
...
...
openmmapi/include/openmm/MonteCarloBarostat.h
View file @
61d5cc0f
...
...
@@ -123,10 +123,23 @@ public:
* the other hand, no guarantees are made about the behavior of simulations that use the same seed.
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically.
*
* If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* is created from this Force. This is done to ensure that each Context receives unique random seeds
* without you needing to set them explicitly.
*/
void
setRandomNumberSeed
(
int
seed
)
{
randomNumberSeed
=
seed
;
}
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
true
;
}
protected:
ForceImpl
*
createImpl
()
const
;
private:
...
...
openmmapi/include/openmm/MonteCarloMembraneBarostat.h
0 → 100644
View file @
61d5cc0f
#ifndef OPENMM_MONTECARLOMEMBRANEBAROSTAT_H_
#define OPENMM_MONTECARLOMEMBRANEBAROSTAT_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) 2010-2014 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 "Force.h"
#include <string>
#include "internal/windowsExport.h"
namespace
OpenMM
{
/**
* This is a Monte Carlo barostat designed specifically for membrane simulations. It assumes the
* membrane lies in the XY plane. The Monte Carlo acceptance criterion includes a term to model
* isotropic pressure, which depends on the volume of the periodic box, and a second term to model
* surface tension, which depends on the cross sectional area of the box in the XY plane. Note
* that pressure and surface tension are defined with opposite senses: a larger pressure tends to
* make the box smaller, but a larger surface tension tends to make the box larger.
*
* There are options for configuring exactly how the various box dimensions are allowed to change:
*
* <ul>
* <li>The X and Y axes may be treated isotropically, in which case they always scale by the same
* amount and remain in proportion to each other; or they may be treated anisotropically, in which
* case they can vary independently of each other.</li>
* <li>The Z axis can be allowed to vary independently of the other axes; or held fixed; or constrained
* to vary in inverse proportion to the other two axes, so that the total box volume remains fixed.</li>
* </ul>
*
* This class assumes the simulation is also being run at constant temperature, and requires you
* to specify the system temperature (since it affects the acceptance probability for Monte Carlo
* moves). It does not actually perform temperature regulation, however. You must use another
* mechanism along with it to maintain the temperature, such as LangevinIntegrator or AndersenThermostat.
*/
class
OPENMM_EXPORT
MonteCarloMembraneBarostat
:
public
Force
{
public:
/**
* This is an enumeration of the different behaviors for the X and Y axes.
*/
enum
XYMode
{
/**
* The X and Y axes are always scaled by the same amount, so the ratio of their lengths remains constant.
*/
XYIsotropic
=
0
,
/**
* The X and Y axes are allowed to vary independently of each other.
*/
XYAnisotropic
=
1
};
/**
* This is an enumeration of the different behaviors for Z axis.
*/
enum
ZMode
{
/**
* The Z axis is allowed to vary freely, independent of the other two axes.
*/
ZFree
=
0
,
/**
* The Z axis is held fixed and does not change.
*/
ZFixed
=
1
,
/**
* The Z axis is always scaled in inverse proportion to the other two axes so the box volume remains
* fixed. Note that in this mode pressure has no effect on the system, only surface tension.
*/
ConstantVolume
=
2
};
/**
* This is the name of the parameter which stores the current pressure acting on
* the system (in bar).
*/
static
const
std
::
string
&
Pressure
()
{
static
const
std
::
string
key
=
"MembraneMonteCarloPressure"
;
return
key
;
}
/**
* This is the name of the parameter which stores the current surface tension acting on
* the system (in bar*nm).
*/
static
const
std
::
string
&
SurfaceTension
()
{
static
const
std
::
string
key
=
"MembraneMonteCarloSurfaceTension"
;
return
key
;
}
/**
* Create a MonteCarloMembraneBarostat.
*
* @param defaultPressure the default pressure acting on the system (in bar)
* @param defaultSurfaceTension the default surface tension acting on the system (in bar*nm)
* @param temperature the temperature at which the system is being maintained (in Kelvin)
* @param xymode the mode specifying the behavior of the X and Y axes
* @param zmode the mode specifying the behavior of the Z axis
* @param frequency the frequency at which Monte Carlo volume changes should be attempted (in time steps)
*/
MonteCarloMembraneBarostat
(
double
defaultPressure
,
double
defaultSurfaceTension
,
double
temperature
,
XYMode
xymode
,
ZMode
zmode
,
int
frequency
=
25
);
/**
* Get the default pressure acting on the system (in bar).
*
* @return the default pressure acting on the system, measured in bar.
*/
double
getDefaultPressure
()
const
{
return
defaultPressure
;
}
/**
* Set the default pressure acting on the system. This will affect any new Contexts you create,
* but not ones that already exist.
*
* @param pressure the default pressure acting on the system, measured in bar.
*/
void
setDefaultPressure
(
double
pressure
)
{
defaultPressure
=
pressure
;
}
/**
* Get the default surface tension acting on the system (in bar*nm).
*
* @return the default surface tension acting on the system, measured in bar*nm.
*/
double
getDefaultSurfaceTension
()
const
{
return
defaultSurfaceTension
;
}
/**
* Set the default surface tension acting on the system. This will affect any new Contexts you create,
* but not ones that already exist.
*
* @param surfaceTension the default surface tension acting on the system, measured in bar.
*/
void
setDefaultSurfaceTension
(
double
surfaceTension
)
{
defaultSurfaceTension
=
surfaceTension
;
}
/**
* Get the frequency (in time steps) at which Monte Carlo volume changes should be attempted. If this is set to
* 0, the barostat is disabled.
*/
int
getFrequency
()
const
{
return
frequency
;
}
/**
* Set the frequency (in time steps) at which Monte Carlo volume changes should be attempted. If this is set to
* 0, the barostat is disabled.
*/
void
setFrequency
(
int
freq
)
{
frequency
=
freq
;
}
/**
* Get the temperature at which the system is being maintained, measured in Kelvin.
*/
double
getTemperature
()
const
{
return
temperature
;
}
/**
* Set the temperature at which the system is being maintained.
*
* @param temp the system temperature, measured in Kelvin.
*/
void
setTemperature
(
double
temp
)
{
temperature
=
temp
;
}
/**
* Get the mode specifying the behavior of the X and Y axes.
*/
XYMode
getXYMode
()
const
{
return
xymode
;
}
/**
* Set the mode specifying the behavior of the X and Y axes.
*/
void
setXYMode
(
XYMode
mode
)
{
xymode
=
mode
;
}
/**
* Get the mode specifying the behavior of the Z axis.
*/
ZMode
getZMode
()
const
{
return
zmode
;
}
/**
* Set the mode specifying the behavior of the Z axis.
*/
void
setZMode
(
ZMode
mode
)
{
zmode
=
mode
;
}
/**
* Get the random number seed. See setRandomNumberSeed() for details.
*/
int
getRandomNumberSeed
()
const
{
return
randomNumberSeed
;
}
/**
* Set the random number seed. It is guaranteed that if two simulations are run
* with different random number seeds, the sequence of Monte Carlo steps will be different. On
* the other hand, no guarantees are made about the behavior of simulations that use the same seed.
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically.
*
* If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* is created from this Force. This is done to ensure that each Context receives unique random seeds
* without you needing to set them explicitly.
*/
void
setRandomNumberSeed
(
int
seed
)
{
randomNumberSeed
=
seed
;
}
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
true
;
}
protected:
ForceImpl
*
createImpl
()
const
;
private:
double
defaultPressure
,
defaultSurfaceTension
,
temperature
;
XYMode
xymode
;
ZMode
zmode
;
int
frequency
,
randomNumberSeed
;
};
}
// namespace OpenMM
#endif
/*OPENMM_MONTECARLOMEMBRANEBAROSTAT_H_*/
openmmapi/include/openmm/NonbondedForce.h
View file @
61d5cc0f
...
...
@@ -343,7 +343,7 @@ public:
* Update the particle and exception parameters in a Context to match those stored in this Force object. This method
* provides an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
* Simply call setParticleParameters() and setExceptionParameters() to modify this object's parameters, then call
* updateParametersIn
State
() to copy them over to the Context.
* updateParametersIn
Context
() to copy them over to the Context.
*
* This method has several limitations. The only information it updates is the parameters of particles and exceptions.
* All other aspects of the Force (the nonbonded method, the cutoff distance, etc.) are unaffected and can only be
...
...
@@ -352,6 +352,17 @@ public:
* to add new particles or exceptions, only to change the parameters of existing ones.
*/
void
updateParametersInContext
(
Context
&
context
);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
nonbondedMethod
==
NonbondedForce
::
CutoffPeriodic
||
nonbondedMethod
==
NonbondedForce
::
Ewald
||
nonbondedMethod
==
NonbondedForce
::
PME
;
}
protected:
ForceImpl
*
createImpl
()
const
;
private:
...
...
openmmapi/include/openmm/PeriodicTorsionForce.h
View file @
61d5cc0f
...
...
@@ -101,13 +101,22 @@ public:
/**
* Update the per-torsion parameters in a Context to match those stored in this Force object. This method provides
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
* Simply call setTorsionParameters() to modify this object's parameters, then call updateParametersIn
State
()
* Simply call setTorsionParameters() to modify this object's parameters, then call updateParametersIn
Context
()
* to copy them over to the Context.
*
* The only information this method updates is the values of per-torsion parameters. The set of particles involved
* in a torsion cannot be changed, nor can new torsions be added.
*/
void
updateParametersInContext
(
Context
&
context
);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
false
;
}
protected:
ForceImpl
*
createImpl
()
const
;
private:
...
...
openmmapi/include/openmm/RBTorsionForce.h
View file @
61d5cc0f
...
...
@@ -110,13 +110,22 @@ public:
/**
* Update the per-torsion parameters in a Context to match those stored in this Force object. This method provides
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
* Simply call setTorsionParameters() to modify this object's parameters, then call updateParametersIn
State
()
* Simply call setTorsionParameters() to modify this object's parameters, then call updateParametersIn
Context
()
* to copy them over to the Context.
*
* The only information this method updates is the values of per-torsion parameters. The set of particles involved
* in a torsion cannot be changed, nor can new torsions be added.
*/
void
updateParametersInContext
(
Context
&
context
);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
false
;
}
protected:
ForceImpl
*
createImpl
()
const
;
private:
...
...
openmmapi/include/openmm/State.h
View file @
61d5cc0f
...
...
@@ -108,6 +108,10 @@ public:
* Get a map containing the values of all parameters. If this State does not contain parameters, this will throw an exception.
*/
const
std
::
map
<
std
::
string
,
double
>&
getParameters
()
const
;
/**
* Get which data types are stored in this State. The return value is a sum of DataType flags.
*/
int
getDataTypes
()
const
;
private:
State
(
double
time
);
void
setPositions
(
const
std
::
vector
<
Vec3
>&
pos
);
...
...
openmmapi/include/openmm/System.h
View file @
61d5cc0f
...
...
@@ -168,6 +168,12 @@ public:
* @param distance the required distance between the two particles, measured in nm
*/
void
setConstraintParameters
(
int
index
,
int
particle1
,
int
particle2
,
double
distance
);
/**
* Remove a constraint from the System.
*
* @param index the index of the constraint to remove
*/
void
removeConstraint
(
int
index
);
/**
* Add a Force to the System. The Force should have been created on the heap with the
* "new" operator. The System takes over ownership of it, and deletes the Force when the
...
...
@@ -198,14 +204,18 @@ public:
* @param index the index of the Force to get
*/
Force
&
getForce
(
int
index
);
/**
* Remove a Force from the System. The memory associated with the removed Force
* object is deleted.
*
* @param index the index of the Force to remove
*/
void
removeForce
(
int
index
);
/**
* Get the default values of the vectors defining the axes of the periodic box (measured in nm). Any newly
* created Context will have its box vectors set to these. They will affect
* any Force added to the System that uses periodic boundary conditions.
*
* Currently, only rectangular boxes are supported. This means that a, b, and c must be aligned with the
* x, y, and z axes respectively. Future releases may support arbitrary triclinic boxes.
*
* @param a on exit, this contains the vector defining the first edge of the periodic box
* @param b on exit, this contains the vector defining the second edge of the periodic box
* @param c on exit, this contains the vector defining the third edge of the periodic box
...
...
@@ -216,14 +226,24 @@ public:
* created Context will have its box vectors set to these. They will affect
* any Force added to the System that uses periodic boundary conditions.
*
* Currently, only rectangular boxes are supported. This means that a, b, and c must be aligned with the
* x, y, and z axes respectively. Future releases may support arbitrary triclinic boxes.
* Triclinic boxes are supported, but the vectors must satisfy certain requirements. In particular,
* a must point in the x direction, b must point "mostly" in the y direction, and c must point "mostly"
* in the z direction. See the documentation for details.
*
* @param a the vector defining the first edge of the periodic box
* @param b the vector defining the second edge of the periodic box
* @param c the vector defining the third edge of the periodic box
*/
void
setDefaultPeriodicBoxVectors
(
const
Vec3
&
a
,
const
Vec3
&
b
,
const
Vec3
&
c
);
/**
* Returns whether or not any forces in this System use periodic boundaries.
*
* If a force in this System does not implement usesPeriodicBoundaryConditions
* a OpenMM::OpenMMException is thrown
*
* @return true if at least one force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
();
private:
class
ConstraintInfo
;
Vec3
periodicBoxVectors
[
3
];
...
...
openmmapi/include/openmm/VariableLangevinIntegrator.h
View file @
61d5cc0f
...
...
@@ -121,6 +121,10 @@ public:
* the other hand, no guarantees are made about the behavior of simulations that use the same seed.
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically.
*
* If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* is created from this Force. This is done to ensure that each Context receives unique random seeds
* without you needing to set them explicitly.
*/
void
setRandomNumberSeed
(
int
seed
)
{
randomNumberSeed
=
seed
;
...
...
openmmapi/include/openmm/VerletIntegrator.h
View file @
61d5cc0f
...
...
@@ -47,7 +47,7 @@ public:
/**
* Create a VerletIntegrator.
*
* @param stepSize the step size with which to integrat
or
the system (in picoseconds)
* @param stepSize the step size with which to integrat
e
the system (in picoseconds)
*/
explicit
VerletIntegrator
(
double
stepSize
);
/**
...
...
openmmapi/include/openmm/internal/CMAPTorsionForceImpl.h
View file @
61d5cc0f
...
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-201
0
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
5
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -60,6 +60,7 @@ public:
return
std
::
map
<
std
::
string
,
double
>
();
// This force field doesn't define any parameters.
}
std
::
vector
<
std
::
string
>
getKernelNames
();
void
updateParametersInContext
(
ContextImpl
&
context
);
/**
* Given the energy values for a map, compute the spline coefficients at each point of the map.
*/
...
...
openmmapi/include/openmm/internal/ContextImpl.h
View file @
61d5cc0f
...
...
@@ -142,9 +142,6 @@ public:
* Get the vectors defining the axes of the periodic box (measured in nm). They will affect
* any Force that uses periodic boundary conditions.
*
* Currently, only rectangular boxes are supported. This means that a, b, and c must be aligned with the
* x, y, and z axes respectively. Future releases may support arbitrary triclinic boxes.
*
* @param a the vector defining the first edge of the periodic box
* @param b the vector defining the second edge of the periodic box
* @param c the vector defining the third edge of the periodic box
...
...
@@ -154,8 +151,9 @@ public:
* Set the vectors defining the axes of the periodic box (measured in nm). They will affect
* any Force that uses periodic boundary conditions.
*
* Currently, only rectangular boxes are supported. This means that a, b, and c must be aligned with the
* x, y, and z axes respectively. Future releases may support arbitrary triclinic boxes.
* Triclinic boxes are supported, but the vectors must satisfy certain requirements. In particular,
* a must point in the x direction, b must point "mostly" in the y direction, and c must point "mostly"
* in the z direction. See the documentation for details.
*
* @param a the vector defining the first edge of the periodic box
* @param b the vector defining the second edge of the periodic box
...
...
openmmapi/include/openmm/internal/MonteCarloMembraneBarostatImpl.h
0 → 100644
View file @
61d5cc0f
#ifndef OPENMM_MONTECARLOMEMBRANEBAROSTATIMPL_H_
#define OPENMM_MONTECARLOMEMBRANEBAROSTATIMPL_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) 2010-2014 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/MonteCarloMembraneBarostat.h"
#include "openmm/Kernel.h"
#include "sfmt/SFMT.h"
#include <string>
namespace
OpenMM
{
/**
* This is the internal implementation of MonteCarloMembraneBarostat.
*/
class
MonteCarloMembraneBarostatImpl
:
public
ForceImpl
{
public:
MonteCarloMembraneBarostatImpl
(
const
MonteCarloMembraneBarostat
&
owner
);
void
initialize
(
ContextImpl
&
context
);
const
MonteCarloMembraneBarostat
&
getOwner
()
const
{
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
);
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
// This force doesn't apply forces to particles.
return
0.0
;
}
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
();
std
::
vector
<
std
::
string
>
getKernelNames
();
private:
const
MonteCarloMembraneBarostat
&
owner
;
int
step
,
numAttempted
[
3
],
numAccepted
[
3
];
double
volumeScale
[
3
];
OpenMM_SFMT
::
SFMT
random
;
Kernel
kernel
;
};
}
// namespace OpenMM
#endif
/*OPENMM_MONTECARLOMEMBRANEBAROSTATIMPL_H_*/
openmmapi/include/openmm/internal/vectorize8.h
View file @
61d5cc0f
...
...
@@ -191,6 +191,18 @@ static inline fvec8 sqrt(const fvec8& v) {
return
fvec8
(
_mm256_sqrt_ps
(
v
.
val
));
}
static
inline
fvec8
rsqrt
(
const
fvec8
&
v
)
{
// Initial estimate of rsqrt().
fvec8
y
(
_mm256_rsqrt_ps
(
v
.
val
));
// Perform an iteration of Newton refinement.
fvec8
x2
=
v
*
0.5
f
;
y
*=
fvec8
(
1.5
f
)
-
x2
*
y
*
y
;
return
y
;
}
static
inline
float
dot8
(
const
fvec8
&
v1
,
const
fvec8
&
v2
)
{
fvec8
result
=
_mm256_dp_ps
(
v1
,
v2
,
0xF1
);
return
_mm_cvtss_f32
(
result
.
lowerVec
())
+
_mm_cvtss_f32
(
result
.
upperVec
());
...
...
openmmapi/include/openmm/internal/vectorize_neon.h
View file @
61d5cc0f
...
...
@@ -251,11 +251,15 @@ static inline fvec4 abs(const fvec4& v) {
return
vabsq_f32
(
v
);
}
static
inline
fvec4
sqrt
(
const
fvec4
&
v
)
{
static
inline
fvec4
r
sqrt
(
const
fvec4
&
v
)
{
float32x4_t
recipSqrt
=
vrsqrteq_f32
(
v
);
recipSqrt
=
vmulq_f32
(
recipSqrt
,
vrsqrtsq_f32
(
vmulq_f32
(
recipSqrt
,
v
),
recipSqrt
));
recipSqrt
=
vmulq_f32
(
recipSqrt
,
vrsqrtsq_f32
(
vmulq_f32
(
recipSqrt
,
v
),
recipSqrt
));
return
vmulq_f32
(
v
,
recipSqrt
);
return
recipSqrt
;
}
static
inline
fvec4
sqrt
(
const
fvec4
&
v
)
{
return
rsqrt
(
v
)
*
v
;
}
static
inline
float
dot3
(
const
fvec4
&
v1
,
const
fvec4
&
v2
)
{
...
...
Prev
1
…
4
5
6
7
8
9
10
11
12
13
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