All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
RPMDIntegrator.h
#ifndef OPENMM_RPMDINTEGRATOR_H_
#define OPENMM_RPMDINTEGRATOR_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-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 "openmm/Integrator.h"
#include "openmm/Kernel.h"
#include "openmm/State.h"
#include "openmm/Vec3.h"
#include "openmm/internal/windowsExportRpmd.h"
#include <map>
namespace OpenMM {
class OPENMM_EXPORT_RPMD RPMDIntegrator : public Integrator {
public:
RPMDIntegrator(int numCopies, double temperature, double frictionCoeff, double stepSize);
RPMDIntegrator(int numCopies, double temperature, double frictionCoeff, double stepSize, const std::map<int, int>& contractions);
int getNumCopies() const {
return numCopies;
}
double getTemperature() const {
return temperature;
}
void setTemperature(double temp) {
temperature = temp;
}
double getFriction() const {
return friction;
}
void setFriction(double coeff) {
friction = coeff;
}
bool getApplyThermostat() const {
return applyThermostat;
}
void setApplyThermostat(bool apply) {
applyThermostat = apply;
}
int getRandomNumberSeed() const {
return randomNumberSeed;
}
void setRandomNumberSeed(int seed) {
randomNumberSeed = seed;
}
const std::map<int, int>& getContractions() const {
return contractions;
}
void setPositions(int copy, const std::vector<Vec3>& positions);
void setVelocities(int copy, const std::vector<Vec3>& velocities);
State getState(int copy, int types, bool enforcePeriodicBox=false, int groups=0xFFFFFFFF);
double getTotalEnergy();
void step(int steps);
protected:
void initialize(ContextImpl& context);
void cleanup();
void stateChanged(State::DataType changed);
std::vector<std::string> getKernelNames();
double computeKineticEnergy();
private:
double temperature, friction;
int numCopies, randomNumberSeed;
bool applyThermostat;
std::map<int, int> contractions;
bool forcesAreValid, hasSetPosition, hasSetVelocity, isFirstStep;
Kernel kernel;
};
} // namespace OpenMM
#endif /*OPENMM_RPMDINTEGRATOR_H_*/
OpenMM::RPMDIntegrator::getContractions
const std::map< int, int > & getContractions() const
Get the ring polymer contractions to use for evaluating different force groups.
Definition: RPMDIntegrator.h:172
OpenMM::RPMDIntegrator::setFriction
void setFriction(double coeff)
Set the friction coefficient which determines how strongly the system is coupled to the heat bath (in...
Definition: RPMDIntegrator.h:130
OpenMM::RPMDIntegrator::setTemperature
void setTemperature(double temp)
Set the temperature of the heat bath (in Kelvin).
Definition: RPMDIntegrator.h:112
OpenMM::RPMDIntegrator::getApplyThermostat
bool getApplyThermostat() const
Get whether a thermostat is applied to the system.
Definition: RPMDIntegrator.h:136
OpenMM::State
A State object records a snapshot of the current state of a simulation at a point in time...
Definition: State.h:54
OpenMM::RPMDIntegrator::getRandomNumberSeed
int getRandomNumberSeed() const
Get the random number seed.
Definition: RPMDIntegrator.h:148
OpenMM::RPMDIntegrator::getTemperature
double getTemperature() const
Get the temperature of the heat bath (in Kelvin).
Definition: RPMDIntegrator.h:104
OpenMM::RPMDIntegrator::getNumCopies
int getNumCopies() const
Get the number of copies of the system being simulated.
Definition: RPMDIntegrator.h:96
OpenMM::Integrator
An Integrator defines a method for simulating a System by integrating the equations of motion...
Definition: Integrator.h:54
OpenMM::RPMDIntegrator
This is an Integrator which simulates a System using ring polymer molecular dynamics (RPMD)...
Definition: RPMDIntegrator.h:69
OpenMM::State::DataType
DataType
This is an enumeration of the types of data which may be stored in a State.
Definition: State.h:61
OpenMM::Kernel
A Kernel encapsulates a particular implementation of a calculation that can be performed on the data ...
Definition: Kernel.h:58
OpenMM::RPMDIntegrator::getFriction
double getFriction() const
Get the friction coefficient which determines how strongly the system is coupled to the heat bath (in...
Definition: RPMDIntegrator.h:121
OpenMM
Definition: AndersenThermostat.h:40
OpenMM::RPMDIntegrator::setRandomNumberSeed
void setRandomNumberSeed(int seed)
Set the random number seed.
Definition: RPMDIntegrator.h:163
OpenMM::RPMDIntegrator::setApplyThermostat
void setApplyThermostat(bool apply)
Set whether a thermostat is applied to the system.
Definition: RPMDIntegrator.h:142