1 #ifndef OPENMM_CUSTOMEXTERNALFORCE_H_
2 #define OPENMM_CUSTOMEXTERNALFORCE_H_
38 #include "internal/windowsExport.h"
89 return particles.size();
95 return parameters.size();
101 return globalParameters.size();
106 const std::string& getEnergyFunction()
const;
110 void setEnergyFunction(
const std::string& energy);
117 int addPerParticleParameter(
const std::string& name);
124 const std::string& getPerParticleParameterName(
int index)
const;
131 void setPerParticleParameterName(
int index,
const std::string& name);
139 int addGlobalParameter(
const std::string& name,
double defaultValue);
146 const std::string& getGlobalParameterName(
int index)
const;
153 void setGlobalParameterName(
int index,
const std::string& name);
160 double getGlobalParameterDefaultValue(
int index)
const;
167 void setGlobalParameterDefaultValue(
int index,
double defaultValue);
175 int addParticle(
int particle,
const std::vector<double>& parameters);
183 void getParticleParameters(
int index,
int& particle, std::vector<double>& parameters)
const;
191 void setParticleParameters(
int index,
int particle,
const std::vector<double>& parameters);
202 void updateParametersInContext(
Context& context);
213 ForceImpl* createImpl()
const;
216 class ParticleParameterInfo;
217 class GlobalParameterInfo;
218 std::string energyExpression;
219 std::vector<ParticleParameterInfo> parameters;
220 std::vector<GlobalParameterInfo> globalParameters;
221 std::vector<ParticleInfo> particles;
228 class CustomExternalForce::ParticleInfo {
231 std::vector<double> parameters;
232 ParticleInfo() : particle(-1) {
234 ParticleInfo(
int particle,
const std::vector<double>& parameters) : particle(particle), parameters(parameters) {
242 class CustomExternalForce::ParticleParameterInfo {
245 ParticleParameterInfo() {
247 ParticleParameterInfo(
const std::string& name) : name(name) {
255 class CustomExternalForce::GlobalParameterInfo {
259 GlobalParameterInfo() {
261 GlobalParameterInfo(
const std::string& name,
double defaultValue) : name(name), defaultValue(defaultValue) {
bool usesPeriodicBoundaryConditions() const
Returns whether or not this force makes use of periodic boundary conditions.
Definition: CustomExternalForce.h:209
A Context stores the complete state of a simulation.
Definition: Context.h:67
This class implements an "external" force on particles.
Definition: CustomExternalForce.h:76
int getNumPerParticleParameters() const
Get the number of per-particle parameters that the force depends on.
Definition: CustomExternalForce.h:94
int getNumParticles() const
Get the number of particles for which force field parameters have been defined.
Definition: CustomExternalForce.h:88
Force objects apply forces to the particles in a System, or alter their behavior in other ways...
Definition: Force.h:65
int getNumGlobalParameters() const
Get the number of global parameters that the force depends on.
Definition: CustomExternalForce.h:100
Definition: AndersenThermostat.h:40