1 #ifndef OPENMM_CUSTOMEXTERNALFORCE_H_
2 #define OPENMM_CUSTOMEXTERNALFORCE_H_
38 #include "internal/windowsExport.h"
88 return particles.size();
94 return parameters.size();
100 return globalParameters.size();
105 const std::string& getEnergyFunction()
const;
109 void setEnergyFunction(
const std::string& energy);
116 int addPerParticleParameter(
const std::string& name);
123 const std::string& getPerParticleParameterName(
int index)
const;
130 void setPerParticleParameterName(
int index,
const std::string& name);
138 int addGlobalParameter(
const std::string& name,
double defaultValue);
145 const std::string& getGlobalParameterName(
int index)
const;
152 void setGlobalParameterName(
int index,
const std::string& name);
159 double getGlobalParameterDefaultValue(
int index)
const;
166 void setGlobalParameterDefaultValue(
int index,
double defaultValue);
174 int addParticle(
int particle,
const std::vector<double>& parameters);
182 void getParticleParameters(
int index,
int& particle, std::vector<double>& parameters)
const;
190 void setParticleParameters(
int index,
int particle,
const std::vector<double>& parameters);
201 void updateParametersInContext(
Context& context);
206 class ParticleParameterInfo;
207 class GlobalParameterInfo;
208 std::string energyExpression;
209 std::vector<ParticleParameterInfo> parameters;
210 std::vector<GlobalParameterInfo> globalParameters;
211 std::vector<ParticleInfo> particles;
218 class CustomExternalForce::ParticleInfo {
221 std::vector<double> parameters;
222 ParticleInfo() : particle(-1) {
224 ParticleInfo(
int particle,
const std::vector<double>& parameters) : particle(particle), parameters(parameters) {
232 class CustomExternalForce::ParticleParameterInfo {
235 ParticleParameterInfo() {
237 ParticleParameterInfo(
const std::string& name) : name(name) {
245 class CustomExternalForce::GlobalParameterInfo {
249 GlobalParameterInfo() {
251 GlobalParameterInfo(
const std::string& name,
double defaultValue) : name(name), defaultValue(defaultValue) {