Commit dca54ec7 authored by Saurabh Belsare's avatar Saurabh Belsare
Browse files

Merged fork with latest original master

parents cace5edf 01f9e415
......@@ -2,6 +2,8 @@
// This file is part of the "Irrlicht Engine" and the "irrXML" project.
// For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h
// MODIFIED by Peter Eastman, Feb. 4, 2016, to support numeric escape sequences
#ifndef __ICXML_READER_IMPL_H_INCLUDED__
#define __ICXML_READER_IMPL_H_INCLUDED__
......@@ -530,8 +532,35 @@ private:
}
else
{
newstr.append(origstr.subString(oldPos, pos - oldPos + 1));
pos += 1;
int semicolonPos = origstr.findNext(L';', pos);
if (semicolonPos != -1 && origstr.c_str()[pos+1] == L'#')
{
// it is a numeric character reference
int number;
core::string<char> numberString;
if (origstr.c_str()[pos+2] == L'x')
{
// hex value
for (int i=pos+3; i<semicolonPos; ++i)
numberString.append((char) origstr[i]);
sscanf(numberString.c_str(), "%x", &number);
}
else
{
// decimal value
for (int i=pos+2; i<semicolonPos; ++i)
numberString.append((char) origstr[i]);
sscanf(numberString.c_str(), "%d", &number);
}
newstr.append(origstr.subString(oldPos, pos - oldPos));
newstr.append((char_type) number);
pos = semicolonPos+1;
}
else
{
newstr.append(origstr.subString(oldPos, pos - oldPos + 1));
pos += 1;
}
}
// find next &
......
......@@ -78,7 +78,8 @@ CompiledExpression& CompiledExpression::operator=(const CompiledExpression& expr
for (int i = 0; i < (int) operation.size(); i++)
operation[i] = expression.operation[i]->clone();
#ifdef LEPTON_USE_JIT
generateJitCode();
if (workspace.size() > 0)
generateJitCode();
#endif
return *this;
}
......
......@@ -124,14 +124,12 @@ public:
};
void SFMT::createCheckpoint(std::ostream& stream) {
stream.write((char*) &data->baseData, sizeof(data->baseData));
stream.write((char*) &data->sfmt, sizeof(data->sfmt));
stream.write((char*) data->sfmt, N*sizeof(w128_t));
stream.write((char*) &data->idx, sizeof(data->idx));
}
void SFMT::loadCheckpoint(std::istream& stream) {
stream.read((char*) &data->baseData, sizeof(data->baseData));
stream.read((char*) &data->sfmt, sizeof(data->sfmt));
stream.read((char*) data->sfmt, N*sizeof(w128_t));
stream.read((char*) &data->idx, sizeof(data->idx));
}
......
......@@ -40,16 +40,16 @@ namespace OpenMM {
/**
* A Kernel encapsulates a particular implementation of a calculation that can be performed on the data
* in a Context. Kernel objects are created by Platforms:
*
*
* <pre>
* Kernel kernel = platform.createKernel(kernelName);
* </pre>
*
*
* The Kernel class itself does not specify any details of what calculation is to be performed or the API
* for calling it. Instead, subclasses of KernelImpl will define APIs which are appropriate to particular
* calculations. To execute a Kernel, you therefore request its implementation object and cast it to the
* correct type:
*
*
* <pre>
* dynamic_cast<AddStreamsImpl&>(kernel.getImpl()).execute(stream1, stream2);
* </pre>
......@@ -61,8 +61,8 @@ public:
Kernel(const Kernel& copy);
/**
* Create a Kernel that wraps a KernelImpl.
*
* @param name the name of the kernel to create
*
* @param KernelImpl the KernelImpl to wrap
*/
Kernel(KernelImpl* impl);
~Kernel();
......
......@@ -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-2012 Stanford University and the Authors. *
* Portions copyright (c) 2008-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -53,7 +53,7 @@ class KernelFactory;
* To get a Platform object, call
*
* <pre>
* Platform& platform Platform::findPlatform(kernelNames);
* Platform& platform = Platform::findPlatform(kernelNames);
* </pre>
*
* passing in the names of all kernels that will be required for the calculation you plan to perform. It
......@@ -78,6 +78,9 @@ public:
/**
* Get whether this Platform supports double precision arithmetic. If this returns false, the platform
* is permitted to represent double precision values internally as single precision.
*
* @deprecated This method is not well defined, and is too simplistic to describe the actual behavior of
* some Platforms, such as ones that offer multiple precision modes. It will be removed in a future release.
*/
virtual bool supportsDoublePrecision() const = 0;
/**
......@@ -233,7 +236,9 @@ protected:
*/
const ContextImpl& getContextImpl(const Context& context) const;
std::vector<std::string> platformProperties;
std::map<std::string, std::string> deprecatedPropertyReplacements;
private:
friend class ContextImpl;
std::map<std::string, KernelFactory*> kernelFactories;
std::map<std::string, std::string> defaultProperties;
static std::vector<Platform*>& getPlatforms();
......
......@@ -187,7 +187,7 @@ public:
* @param b the vector defining the second edge of the periodic box
* @param c the vector defining the third edge of the periodic box
*/
virtual void setPeriodicBoxVectors(ContextImpl& context, const Vec3& a, const Vec3& b, const Vec3& c) const = 0;
virtual void setPeriodicBoxVectors(ContextImpl& context, const Vec3& a, const Vec3& b, const Vec3& c) = 0;
/**
* Create a checkpoint recording the current state of the Context.
*
......
......@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-2012 Stanford University and the Authors. *
* Portions copyright (c) 2008-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -89,15 +89,21 @@ void Platform::setPropertyValue(Context& context, const string& property, const
}
const string& Platform::getPropertyDefaultValue(const string& property) const {
map<string, string>::const_iterator value = defaultProperties.find(property);
string propertyName = property;
if (deprecatedPropertyReplacements.find(property) != deprecatedPropertyReplacements.end())
propertyName = deprecatedPropertyReplacements.find(property)->second;
map<string, string>::const_iterator value = defaultProperties.find(propertyName);
if (value == defaultProperties.end())
throw OpenMMException("getPropertyDefaultValue: Illegal property name");
return value->second;
}
void Platform::setPropertyDefaultValue(const string& property, const string& value) {
string propertyName = property;
if (deprecatedPropertyReplacements.find(property) != deprecatedPropertyReplacements.end())
propertyName = deprecatedPropertyReplacements.find(property)->second;
for (int i = 0; i < (int) platformProperties.size(); i++)
if (platformProperties[i] == property) {
if (platformProperties[i] == propertyName) {
defaultProperties[property] = value;
return;
}
......@@ -314,7 +320,11 @@ const string& Platform::getDefaultPluginsDirectory() {
#define STRING(x) STRING1(x)
const string& Platform::getOpenMMVersion() {
#if OPENMM_BUILD_VERSION == 0
static const string version = STRING(OPENMM_MAJOR_VERSION) "." STRING(OPENMM_MINOR_VERSION);
#else
static const string version = STRING(OPENMM_MAJOR_VERSION) "." STRING(OPENMM_MINOR_VERSION) "." STRING(OPENMM_BUILD_VERSION);
#endif
return version;
}
......
......@@ -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) 2010-2015 Stanford University and the Authors. *
* Portions copyright (c) 2010-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -159,15 +159,18 @@ public:
* new bonds and torsions cannot be added.
*/
void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns false
* @returns true if force uses PBC and false otherwise
*/
bool usesPeriodicBoundaryConditions() const {
return false;
}
bool usesPeriodicBoundaryConditions() const;
protected:
ForceImpl* createImpl() const;
private:
......@@ -175,6 +178,7 @@ private:
class CMAPTorsionInfo;
std::vector<MapInfo> maps;
std::vector<CMAPTorsionInfo> torsions;
bool usePeriodic;
};
/**
......
......@@ -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) 2010-2012 Stanford University and the Authors. *
* Portions copyright (c) 2010-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -203,15 +203,18 @@ public:
* the Context. The set of particles involved in a angle cannot be changed, nor can new angles be added.
*/
void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns false
* @returns true if force uses PBC and false otherwise
*/
bool usesPeriodicBoundaryConditions() const {
return false;
}
bool usesPeriodicBoundaryConditions() const;
protected:
ForceImpl* createImpl() const;
private:
......@@ -222,6 +225,7 @@ private:
std::vector<AngleParameterInfo> parameters;
std::vector<GlobalParameterInfo> globalParameters;
std::vector<AngleInfo> angles;
bool usePeriodic;
};
/**
......
......@@ -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-2012 Stanford University and the Authors. *
* Portions copyright (c) 2008-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -200,15 +200,18 @@ public:
* the Context. The set of particles involved in a bond cannot be changed, nor can new bonds be added.
*/
void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns false
* @returns true if force uses PBC and false otherwise
*/
bool usesPeriodicBoundaryConditions() const {
return false;
}
bool usesPeriodicBoundaryConditions() const;
protected:
ForceImpl* createImpl() const;
private:
......@@ -219,6 +222,7 @@ private:
std::vector<BondParameterInfo> parameters;
std::vector<GlobalParameterInfo> globalParameters;
std::vector<BondInfo> bonds;
bool usePeriodic;
};
/**
......
......@@ -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-2015 Stanford University and the Authors. *
* Portions copyright (c) 2008-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -324,15 +324,18 @@ public:
* bonds be added.
*/
void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns false
* @returns true if force uses PBC and false otherwise
*/
bool usesPeriodicBoundaryConditions() const {
return false;
}
bool usesPeriodicBoundaryConditions() const;
protected:
ForceImpl* createImpl() const;
private:
......@@ -348,6 +351,7 @@ private:
std::vector<GroupInfo> groups;
std::vector<BondInfo> bonds;
std::vector<FunctionInfo> functions;
bool usePeriodic;
};
/**
......
......@@ -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-2014 Stanford University and the Authors. *
* Portions copyright (c) 2008-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -298,15 +298,18 @@ public:
* the Context. The set of particles involved in a bond cannot be changed, nor can new bonds be added.
*/
void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns false
* @returns true if force uses PBC and false otherwise
*/
bool usesPeriodicBoundaryConditions() const {
return false;
}
bool usesPeriodicBoundaryConditions() const;
protected:
ForceImpl* createImpl() const;
private:
......@@ -320,6 +323,7 @@ private:
std::vector<GlobalParameterInfo> globalParameters;
std::vector<BondInfo> bonds;
std::vector<FunctionInfo> functions;
bool usePeriodic;
};
/**
......
......@@ -369,8 +369,8 @@ public:
* Get the donor and acceptor in a pair whose interaction should be excluded.
*
* @param index the index of the exclusion for which to get donor and acceptor indices
* @param[out] particle1 the index of the donor
* @param[out] particle2 the index of the acceptor
* @param[out] donor the index of the donor
* @param[out] acceptor the index of the acceptor
*/
void getExclusionParticles(int index, int& donor, int& acceptor) const;
/**
......
......@@ -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) 2011-2012 Stanford University and the Authors. *
* Portions copyright (c) 2011-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -266,15 +266,15 @@ public:
/**
* Begin an "if" block.
*/
BeginIfBlock = 6,
IfBlockStart = 6,
/**
* Begin a while" block.
*/
BeginWhileBlock = 7,
WhileBlockStart = 7,
/**
* End an "if" or "while" block.
*/
EndBlock = 8
BlockEnd = 8
};
/**
* Create a CustomIntegrator.
......
......@@ -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) 2010-2012 Stanford University and the Authors. *
* Portions copyright (c) 2010-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -206,15 +206,18 @@ public:
* the Context. The set of particles involved in a torsion cannot be changed, nor can new torsions be added.
*/
void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/**
* 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;
}
bool usesPeriodicBoundaryConditions() const;
protected:
ForceImpl* createImpl() const;
private:
......@@ -225,6 +228,7 @@ private:
std::vector<TorsionParameterInfo> parameters;
std::vector<GlobalParameterInfo> globalParameters;
std::vector<TorsionInfo> torsions;
bool usePeriodic;
};
/**
......
......@@ -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-2012 Stanford University and the Authors. *
* Portions copyright (c) 2008-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -102,20 +102,23 @@ public:
* in a angle cannot be changed, nor can new angles be added.
*/
void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/**
* 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:
bool usesPeriodicBoundaryConditions() const;protected:
ForceImpl* createImpl() const;
private:
class AngleInfo;
std::vector<AngleInfo> angles;
bool usePeriodic;
};
/**
......
......@@ -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-2012 Stanford University and the Authors. *
* Portions copyright (c) 2008-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -99,20 +99,24 @@ public:
* in a bond cannot be changed, nor can new bonds be added.
*/
void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/**
* 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;
}
bool usesPeriodicBoundaryConditions() const;
protected:
ForceImpl* createImpl() const;
private:
class BondInfo;
std::vector<BondInfo> bonds;
bool usePeriodic;
};
/**
......
......@@ -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) 2010-2013 Stanford University and the Authors. *
* Portions copyright (c) 2010-2016 Stanford University and the Authors. *
* Authors: Peter Eastman, Lee-Ping Wang *
* Contributors: *
* *
......@@ -81,17 +81,25 @@ public:
static const std::string key = "MonteCarloPressureZ";
return key;
}
/**
* This is the name of the parameter which stores the current temperature at which the
* system is being maintained (in Kelvin)
*/
static const std::string& Temperature() {
static const std::string key = "AnisotropicMonteCarloTemperature";
return key;
}
/**
* Create a MonteCarloAnisotropicBarostat.
*
* @param defaultPressure The default pressure acting on each axis (in bar)
* @param temperature the temperature at which the system is being maintained (in Kelvin)
* @param scaleX whether to allow the X dimension of the periodic box to change size
* @param scaleY whether to allow the Y dimension of the periodic box to change size
* @param scaleZ whether to allow the Z dimension of the periodic box to change size
* @param frequency the frequency at which Monte Carlo pressure changes should be attempted (in time steps)
* @param defaultPressure The default pressure acting on each axis (in bar)
* @param defaultTemperature the default temperature at which the system is being maintained (in Kelvin)
* @param scaleX whether to allow the X dimension of the periodic box to change size
* @param scaleY whether to allow the Y dimension of the periodic box to change size
* @param scaleZ whether to allow the Z dimension of the periodic box to change size
* @param frequency the frequency at which Monte Carlo pressure changes should be attempted (in time steps)
*/
MonteCarloAnisotropicBarostat(const Vec3& defaultPressure, double temperature, bool scaleX = true, bool scaleY = true, bool scaleZ = true, int frequency = 25);
MonteCarloAnisotropicBarostat(const Vec3& defaultPressure, double defaultTemperature, bool scaleX = true, bool scaleY = true, bool scaleZ = true, int frequency = 25);
/**
* Get the default pressure (in bar).
*
......@@ -142,18 +150,19 @@ public:
frequency = freq;
}
/**
* Get the temperature at which the system is being maintained, measured in Kelvin.
* Get the default temperature at which the system is being maintained, measured in Kelvin.
*/
double getTemperature() const {
return temperature;
double getDefaultTemperature() const {
return defaultTemperature;
}
/**
* Set the temperature at which the system is being maintained.
* Set the default temperature at which the system is being maintained. This will affect any new Contexts you create,
* but not ones that already exist.
*
* @param temp the system temperature, measured in Kelvin.
*/
void setTemperature(double temp) {
temperature = temp;
void setDefaultTemperature(double temp) {
defaultTemperature = temp;
}
/**
* Get the random number seed. See setRandomNumberSeed() for details.
......@@ -188,7 +197,7 @@ protected:
ForceImpl* createImpl() const;
private:
Vec3 defaultPressure;
double temperature;
double defaultTemperature;
bool scaleX, scaleY, scaleZ;
int frequency, randomNumberSeed;
};
......
......@@ -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) 2010 Stanford University and the Authors. *
* Portions copyright (c) 2010-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -58,14 +58,22 @@ public:
static const std::string key = "MonteCarloPressure";
return key;
}
/**
* This is the name of the parameter which stores the current temperature at which the
* system is being maintained (in Kelvin)
*/
static const std::string& Temperature() {
static const std::string key = "MonteCarloTemperature";
return key;
}
/**
* Create a MonteCarloBarostat.
*
* @param defaultPressure the default pressure acting on the system (in bar)
* @param temperature the temperature at which the system is being maintained (in Kelvin)
* @param frequency the frequency at which Monte Carlo pressure changes should be attempted (in time steps)
* @param defaultPressure the default pressure acting on the system (in bar)
* @param defaultTemperature the default temperature at which the system is being maintained (in Kelvin)
* @param frequency the frequency at which Monte Carlo pressure changes should be attempted (in time steps)
*/
MonteCarloBarostat(double defaultPressure, double temperature, int frequency = 25);
MonteCarloBarostat(double defaultPressure, double defaultTemperature, int frequency = 25);
/**
* Get the default pressure acting on the system (in bar).
*
......@@ -98,18 +106,19 @@ public:
frequency = freq;
}
/**
* Get the temperature at which the system is being maintained, measured in Kelvin.
* Get the default temperature at which the system is being maintained, measured in Kelvin.
*/
double getTemperature() const {
return temperature;
double getDefaultTemperature() const {
return defaultTemperature;
}
/**
* Set the temperature at which the system is being maintained.
* Set the default temperature at which the system is being maintained. This will affect any new Contexts you create,
* but not ones that already exist.
*
* @param temp the system temperature, measured in Kelvin.
*/
void setTemperature(double temp) {
temperature = temp;
void setDefaultTemperature(double temp) {
defaultTemperature = temp;
}
/**
* Get the random number seed. See setRandomNumberSeed() for details.
......@@ -143,7 +152,7 @@ public:
protected:
ForceImpl* createImpl() const;
private:
double defaultPressure, temperature;
double defaultPressure, defaultTemperature;
int frequency, randomNumberSeed;
};
......
......@@ -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) 2010-2014 Stanford University and the Authors. *
* Portions copyright (c) 2010-2016 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -111,17 +111,25 @@ public:
static const std::string key = "MembraneMonteCarloSurfaceTension";
return key;
}
/**
* This is the name of the parameter which stores the current temperature at which the
* system is being maintained (in Kelvin)
*/
static const std::string& Temperature() {
static const std::string key = "MembraneMonteCarloTemperature";
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 defaultTemperature the default 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);
MonteCarloMembraneBarostat(double defaultPressure, double defaultSurfaceTension, double defaultTemperature, XYMode xymode, ZMode zmode, int frequency = 25);
/**
* Get the default pressure acting on the system (in bar).
*
......@@ -171,18 +179,19 @@ public:
frequency = freq;
}
/**
* Get the temperature at which the system is being maintained, measured in Kelvin.
* Get the default temperature at which the system is being maintained, measured in Kelvin.
*/
double getTemperature() const {
return temperature;
double getDefaultTemperature() const {
return defaultTemperature;
}
/**
* Set the temperature at which the system is being maintained.
* Set the default temperature at which the system is being maintained. This will affect any new Contexts you create,
* but not ones that already exist.
*
* @param temp the system temperature, measured in Kelvin.
*/
void setTemperature(double temp) {
temperature = temp;
void setDefaultTemperature(double temp) {
defaultTemperature = temp;
}
/**
* Get the mode specifying the behavior of the X and Y axes.
......@@ -240,7 +249,7 @@ public:
protected:
ForceImpl* createImpl() const;
private:
double defaultPressure, defaultSurfaceTension, temperature;
double defaultPressure, defaultSurfaceTension, defaultTemperature;
XYMode xymode;
ZMode zmode;
int frequency, randomNumberSeed;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment