All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CustomAngleForce.h
#ifndef OPENMM_CUSTOMANGLEFORCE_H_
#define OPENMM_CUSTOMANGLEFORCE_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-2012 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 "Vec3.h"
#include <vector>
#include "internal/windowsExport.h"
namespace OpenMM {
class OPENMM_EXPORT CustomAngleForce : public Force {
public:
explicit CustomAngleForce(const std::string& energy);
int getNumAngles() const {
return angles.size();
}
int getNumPerAngleParameters() const {
return parameters.size();
}
int getNumGlobalParameters() const {
return globalParameters.size();
}
const std::string& getEnergyFunction() const;
void setEnergyFunction(const std::string& energy);
int addPerAngleParameter(const std::string& name);
const std::string& getPerAngleParameterName(int index) const;
void setPerAngleParameterName(int index, const std::string& name);
int addGlobalParameter(const std::string& name, double defaultValue);
const std::string& getGlobalParameterName(int index) const;
void setGlobalParameterName(int index, const std::string& name);
double getGlobalParameterDefaultValue(int index) const;
void setGlobalParameterDefaultValue(int index, double defaultValue);
int addAngle(int particle1, int particle2, int particle3, const std::vector<double>& parameters);
void getAngleParameters(int index, int& particle1, int& particle2, int& particle3, std::vector<double>& parameters) const;
void setAngleParameters(int index, int particle1, int particle2, int particle3, const std::vector<double>& parameters);
void updateParametersInContext(Context& context);
bool usesPeriodicBoundaryConditions() const {
return false;
}
protected:
ForceImpl* createImpl() const;
private:
class AngleInfo;
class AngleParameterInfo;
class GlobalParameterInfo;
std::string energyExpression;
std::vector<AngleParameterInfo> parameters;
std::vector<GlobalParameterInfo> globalParameters;
std::vector<AngleInfo> angles;
};
class CustomAngleForce::AngleInfo {
public:
int particle1, particle2, particle3;
std::vector<double> parameters;
AngleInfo() : particle1(-1), particle2(-1), particle3(-1) {
}
AngleInfo(int particle1, int particle2, int particle3, const std::vector<double>& parameters) :
particle1(particle1), particle2(particle2), particle3(particle3), parameters(parameters) {
}
};
class CustomAngleForce::AngleParameterInfo {
public:
std::string name;
AngleParameterInfo() {
}
AngleParameterInfo(const std::string& name) : name(name) {
}
};
class CustomAngleForce::GlobalParameterInfo {
public:
std::string name;
double defaultValue;
GlobalParameterInfo() {
}
GlobalParameterInfo(const std::string& name, double defaultValue) : name(name), defaultValue(defaultValue) {
}
};
} // namespace OpenMM
#endif /*OPENMM_CUSTOMANGLEFORCE_H_*/
OpenMM::CustomAngleForce::getNumPerAngleParameters
int getNumPerAngleParameters() const
Get the number of per-angle parameters that the interaction depends on.
Definition: CustomAngleForce.h:91
OpenMM::Context
A Context stores the complete state of a simulation.
Definition: Context.h:67
OpenMM::CustomAngleForce::getNumGlobalParameters
int getNumGlobalParameters() const
Get the number of global parameters that the interaction depends on.
Definition: CustomAngleForce.h:97
OpenMM::Force
Force objects apply forces to the particles in a System, or alter their behavior in other ways...
Definition: Force.h:65
OpenMM::CustomAngleForce::getNumAngles
int getNumAngles() const
Get the number of angles for which force field parameters have been defined.
Definition: CustomAngleForce.h:85
OpenMM::CustomAngleForce::usesPeriodicBoundaryConditions
bool usesPeriodicBoundaryConditions() const
Returns whether or not this force makes use of periodic boundary conditions.
Definition: CustomAngleForce.h:212
OpenMM::CustomAngleForce
This class implements interactions between sets of three particles that depend on the angle between t...
Definition: CustomAngleForce.h:73
OpenMM
Definition: AndersenThermostat.h:40