All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Context.h
#ifndef OPENMM_CONTEXT_H_
#define OPENMM_CONTEXT_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-2013 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 "Integrator.h"
#include "State.h"
#include "System.h"
#include <iosfwd>
#include <map>
#include <string>
#include <vector>
#include "internal/windowsExport.h"
#include "internal/OSRngSeed.h"
namespace OpenMM {
class ContextImpl;
class Vec3;
class Platform;
class OPENMM_EXPORT Context {
public:
Context(const System& system, Integrator& integrator);
Context(const System& system, Integrator& integrator, Platform& platform);
Context(const System& system, Integrator& integrator, Platform& platform, const std::map<std::string, std::string>& properties);
~Context();
const System& getSystem() const;
const Integrator& getIntegrator() const;
Integrator& getIntegrator();
const Platform& getPlatform() const;
Platform& getPlatform();
State getState(int types, bool enforcePeriodicBox=false, int groups=0xFFFFFFFF) const;
void setState(const State& state);
void setTime(double time);
void setPositions(const std::vector<Vec3>& positions);
void setVelocities(const std::vector<Vec3>& velocities);
void setVelocitiesToTemperature(double temperature, int randomSeed=osrngseed());
double getParameter(const std::string& name) const;
void setParameter(const std::string& name, double value);
void setPeriodicBoxVectors(const Vec3& a, const Vec3& b, const Vec3& c);
void applyConstraints(double tol);
void applyVelocityConstraints(double tol);
void computeVirtualSites();
void reinitialize();
void createCheckpoint(std::ostream& stream);
void loadCheckpoint(std::istream& stream);
const std::vector<std::vector<int> >& getMolecules() const;
private:
friend class Force;
friend class Platform;
ContextImpl& getImpl();
ContextImpl* impl;
std::map<std::string, std::string> properties;
};
} // namespace OpenMM
#endif /*OPENMM_CONTEXT_H_*/
OpenMM::Context
A Context stores the complete state of a simulation.
Definition: Context.h:67
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::Force
Force objects apply forces to the particles in a System, or alter their behavior in other ways...
Definition: Force.h:65
OpenMM::Integrator
An Integrator defines a method for simulating a System by integrating the equations of motion...
Definition: Integrator.h:54
OpenMM::System
This class represents a molecular system.
Definition: System.h:66
OpenMM::Vec3
This class represents a three component vector.
Definition: Vec3.h:45
OpenMM
Definition: AndersenThermostat.h:40
OpenMM::Platform
A Platform defines an implementation of all the kernels needed to perform some calculation.
Definition: Platform.h:64