1 #ifndef OPENMM_CUSTOMNONBONDEDFORCE_H_
2 #define OPENMM_CUSTOMNONBONDEDFORCE_H_
41 #include "internal/windowsExport.h"
107 CutoffNonPeriodic = 1,
125 return particles.size();
131 return exclusions.size();
137 return parameters.size();
143 return globalParameters.size();
149 return functions.size();
154 const std::string& getEnergyFunction()
const;
158 void setEnergyFunction(
const std::string& energy);
162 NonbondedMethod getNonbondedMethod()
const;
166 void setNonbondedMethod(NonbondedMethod method);
173 double getCutoffDistance()
const;
180 void setCutoffDistance(
double distance);
187 int addPerParticleParameter(
const std::string& name);
194 const std::string& getPerParticleParameterName(
int index)
const;
201 void setPerParticleParameterName(
int index,
const std::string& name);
209 int addGlobalParameter(
const std::string& name,
double defaultValue);
216 const std::string& getGlobalParameterName(
int index)
const;
223 void setGlobalParameterName(
int index,
const std::string& name);
230 double getGlobalParameterDefaultValue(
int index)
const;
237 void setGlobalParameterDefaultValue(
int index,
double defaultValue);
245 int addParticle(
const std::vector<double>& parameters);
252 void getParticleParameters(
int index, std::vector<double>& parameters)
const;
259 void setParticleParameters(
int index,
const std::vector<double>& parameters);
267 int addExclusion(
int particle1,
int particle2);
275 void getExclusionParticles(
int index,
int& particle1,
int& particle2)
const;
283 void setExclusionParticles(
int index,
int particle1,
int particle2);
294 int addFunction(
const std::string& name,
const std::vector<double>& values,
double min,
double max);
305 void getFunctionParameters(
int index, std::string& name, std::vector<double>& values,
double& min,
double& max)
const;
316 void setFunctionParameters(
int index,
const std::string& name,
const std::vector<double>& values,
double min,
double max);
328 void updateParametersInContext(
Context& context);
333 class PerParticleParameterInfo;
334 class GlobalParameterInfo;
337 NonbondedMethod nonbondedMethod;
338 double cutoffDistance;
339 std::string energyExpression;
340 std::vector<PerParticleParameterInfo> parameters;
341 std::vector<GlobalParameterInfo> globalParameters;
342 std::vector<ParticleInfo> particles;
343 std::vector<ExclusionInfo> exclusions;
344 std::vector<FunctionInfo> functions;
351 class CustomNonbondedForce::ParticleInfo {
353 std::vector<double> parameters;
356 ParticleInfo(
const std::vector<double>& parameters) : parameters(parameters) {
364 class CustomNonbondedForce::PerParticleParameterInfo {
367 PerParticleParameterInfo() {
369 PerParticleParameterInfo(
const std::string& name) : name(name) {
377 class CustomNonbondedForce::GlobalParameterInfo {
381 GlobalParameterInfo() {
383 GlobalParameterInfo(
const std::string& name,
double defaultValue) : name(name), defaultValue(defaultValue) {
391 class CustomNonbondedForce::ExclusionInfo {
393 int particle1, particle2;
395 particle1 = particle2 = -1;
397 ExclusionInfo(
int particle1,
int particle2) :
398 particle1(particle1), particle2(particle2) {
406 class CustomNonbondedForce::FunctionInfo {
409 std::vector<double> values;
413 FunctionInfo(
const std::string& name,
const std::vector<double>& values,
double min,
double max) :
414 name(name), values(values), min(min), max(max) {