1 #ifndef OPENMM_CUSTOMHBONDFORCE_H_
2 #define OPENMM_CUSTOMHBONDFORCE_H_
41 #include "internal/windowsExport.h"
112 CutoffNonPeriodic = 1,
131 return donors.size();
137 return acceptors.size();
143 return exclusions.size();
149 return donorParameters.size();
155 return acceptorParameters.size();
161 return globalParameters.size();
167 return functions.size();
172 const std::string& getEnergyFunction()
const;
176 void setEnergyFunction(
const std::string& energy);
180 NonbondedMethod getNonbondedMethod()
const;
184 void setNonbondedMethod(NonbondedMethod method);
191 double getCutoffDistance()
const;
198 void setCutoffDistance(
double distance);
205 int addPerDonorParameter(
const std::string& name);
212 const std::string& getPerDonorParameterName(
int index)
const;
219 void setPerDonorParameterName(
int index,
const std::string& name);
226 int addPerAcceptorParameter(
const std::string& name);
233 const std::string& getPerAcceptorParameterName(
int index)
const;
240 void setPerAcceptorParameterName(
int index,
const std::string& name);
248 int addGlobalParameter(
const std::string& name,
double defaultValue);
255 const std::string& getGlobalParameterName(
int index)
const;
262 void setGlobalParameterName(
int index,
const std::string& name);
269 double getGlobalParameterDefaultValue(
int index)
const;
276 void setGlobalParameterDefaultValue(
int index,
double defaultValue);
288 int addDonor(
int d1,
int d2,
int d3,
const std::vector<double>& parameters);
300 void getDonorParameters(
int index,
int& d1,
int& d2,
int& d3, std::vector<double>& parameters)
const;
312 void setDonorParameters(
int index,
int d1,
int d2,
int d3,
const std::vector<double>& parameters);
324 int addAcceptor(
int a1,
int a2,
int a3,
const std::vector<double>& parameters);
336 void getAcceptorParameters(
int index,
int& a1,
int& a2,
int& a3, std::vector<double>& parameters)
const;
348 void setAcceptorParameters(
int index,
int a1,
int a2,
int a3,
const std::vector<double>& parameters);
356 int addExclusion(
int donor,
int acceptor);
364 void getExclusionParticles(
int index,
int& donor,
int& acceptor)
const;
372 void setExclusionParticles(
int index,
int donor,
int acceptor);
383 int addFunction(
const std::string& name,
const std::vector<double>& values,
double min,
double max);
394 void getFunctionParameters(
int index, std::string& name, std::vector<double>& values,
double& min,
double& max)
const;
405 void setFunctionParameters(
int index,
const std::string& name,
const std::vector<double>& values,
double min,
double max);
417 void updateParametersInContext(
Context& context);
422 class PerPairParameterInfo;
423 class GlobalParameterInfo;
426 NonbondedMethod nonbondedMethod;
427 double cutoffDistance;
428 std::string energyExpression;
429 std::vector<PerPairParameterInfo> donorParameters;
430 std::vector<PerPairParameterInfo> acceptorParameters;
431 std::vector<GlobalParameterInfo> globalParameters;
432 std::vector<GroupInfo> donors;
433 std::vector<GroupInfo> acceptors;
434 std::vector<ExclusionInfo> exclusions;
435 std::vector<FunctionInfo> functions;
442 class CustomHbondForce::GroupInfo {
444 std::vector<double> parameters;
446 GroupInfo() : p1(-1), p2(-1), p3(-1) {
448 GroupInfo(
int p1,
int p2,
int p3,
const std::vector<double>& parameters) :
449 p1(p1), p2(p2), p3(p3), parameters(parameters) {
457 class CustomHbondForce::PerPairParameterInfo {
460 PerPairParameterInfo() {
462 PerPairParameterInfo(
const std::string& name) : name(name) {
470 class CustomHbondForce::GlobalParameterInfo {
474 GlobalParameterInfo() {
476 GlobalParameterInfo(
const std::string& name,
double defaultValue) : name(name), defaultValue(defaultValue) {
484 class CustomHbondForce::ExclusionInfo {
488 donor = acceptor = -1;
490 ExclusionInfo(
int donor,
int acceptor) :
491 donor(donor), acceptor(acceptor) {
499 class CustomHbondForce::FunctionInfo {
502 std::vector<double> values;
506 FunctionInfo(
const std::string& name,
const std::vector<double>& values,
double min,
double max) :
507 name(name), values(values), min(min), max(max) {