1 #ifndef OPENMM_CUSTOMNONBONDEDFORCE_H_
2 #define OPENMM_CUSTOMNONBONDEDFORCE_H_
41 #include "internal/windowsExport.h"
145 CutoffNonPeriodic = 1,
163 return particles.size();
169 return exclusions.size();
175 return parameters.size();
181 return globalParameters.size();
187 return functions.size();
193 return interactionGroups.size();
198 const std::string& getEnergyFunction()
const;
202 void setEnergyFunction(
const std::string& energy);
206 NonbondedMethod getNonbondedMethod()
const;
210 void setNonbondedMethod(NonbondedMethod method);
217 double getCutoffDistance()
const;
224 void setCutoffDistance(
double distance);
229 bool getUseSwitchingFunction()
const;
234 void setUseSwitchingFunction(
bool use);
239 double getSwitchingDistance()
const;
244 void setSwitchingDistance(
double distance);
249 bool getUseLongRangeCorrection()
const;
254 void setUseLongRangeCorrection(
bool use);
261 int addPerParticleParameter(
const std::string& name);
268 const std::string& getPerParticleParameterName(
int index)
const;
275 void setPerParticleParameterName(
int index,
const std::string& name);
283 int addGlobalParameter(
const std::string& name,
double defaultValue);
290 const std::string& getGlobalParameterName(
int index)
const;
297 void setGlobalParameterName(
int index,
const std::string& name);
304 double getGlobalParameterDefaultValue(
int index)
const;
311 void setGlobalParameterDefaultValue(
int index,
double defaultValue);
319 int addParticle(
const std::vector<double>& parameters);
326 void getParticleParameters(
int index, std::vector<double>& parameters)
const;
333 void setParticleParameters(
int index,
const std::vector<double>& parameters);
341 int addExclusion(
int particle1,
int particle2);
349 void getExclusionParticles(
int index,
int& particle1,
int& particle2)
const;
357 void setExclusionParticles(
int index,
int particle1,
int particle2);
368 int addFunction(
const std::string& name,
const std::vector<double>& values,
double min,
double max);
379 void getFunctionParameters(
int index, std::string& name, std::vector<double>& values,
double& min,
double& max)
const;
390 void setFunctionParameters(
int index,
const std::string& name,
const std::vector<double>& values,
double min,
double max);
398 int addInteractionGroup(
const std::set<int>& set1,
const std::set<int>& set2);
406 void getInteractionGroupParameters(
int index, std::set<int>& set1, std::set<int>& set2)
const;
414 void setInteractionGroupParameters(
int index,
const std::set<int>& set1,
const std::set<int>& set2);
426 void updateParametersInContext(
Context& context);
431 class PerParticleParameterInfo;
432 class GlobalParameterInfo;
435 class InteractionGroupInfo;
436 NonbondedMethod nonbondedMethod;
437 double cutoffDistance, switchingDistance;
438 bool useSwitchingFunction, useLongRangeCorrection;
439 std::string energyExpression;
440 std::vector<PerParticleParameterInfo> parameters;
441 std::vector<GlobalParameterInfo> globalParameters;
442 std::vector<ParticleInfo> particles;
443 std::vector<ExclusionInfo> exclusions;
444 std::vector<FunctionInfo> functions;
445 std::vector<InteractionGroupInfo> interactionGroups;
452 class CustomNonbondedForce::ParticleInfo {
454 std::vector<double> parameters;
457 ParticleInfo(
const std::vector<double>& parameters) : parameters(parameters) {
465 class CustomNonbondedForce::PerParticleParameterInfo {
468 PerParticleParameterInfo() {
470 PerParticleParameterInfo(
const std::string& name) : name(name) {
478 class CustomNonbondedForce::GlobalParameterInfo {
482 GlobalParameterInfo() {
484 GlobalParameterInfo(
const std::string& name,
double defaultValue) : name(name), defaultValue(defaultValue) {
492 class CustomNonbondedForce::ExclusionInfo {
494 int particle1, particle2;
496 particle1 = particle2 = -1;
498 ExclusionInfo(
int particle1,
int particle2) :
499 particle1(particle1), particle2(particle2) {
507 class CustomNonbondedForce::FunctionInfo {
510 std::vector<double> values;
514 FunctionInfo(
const std::string& name,
const std::vector<double>& values,
double min,
double max) :
515 name(name), values(values), min(min), max(max) {
523 class CustomNonbondedForce::InteractionGroupInfo {
525 std::set<int> set1, set2;
526 InteractionGroupInfo() {
528 InteractionGroupInfo(
const std::set<int>& set1,
const std::set<int>& set2) :
529 set1(set1), set2(set2) {
int getNumGlobalParameters() const
Get the number of global parameters that the interaction depends on.
Definition: CustomNonbondedForce.h:180
int getNumFunctions() const
Get the number of tabulated functions that have been defined.
Definition: CustomNonbondedForce.h:186
A Context stores the complete state of a simulation.
Definition: Context.h:67
int getNumExclusions() const
Get the number of particle pairs whose interactions should be excluded.
Definition: CustomNonbondedForce.h:168
int getNumPerParticleParameters() const
Get the number of per-particle parameters that the interaction depends on.
Definition: CustomNonbondedForce.h:174
Force objects apply forces to the particles in a System, or alter their behavior in other ways...
Definition: Force.h:65
int getNumInteractionGroups() const
Get the number of interaction groups that have been defined.
Definition: CustomNonbondedForce.h:192
int getNumParticles() const
Get the number of particles for which force field parameters have been defined.
Definition: CustomNonbondedForce.h:162
NonbondedMethod
This is an enumeration of the different methods that may be used for handling long range nonbonded fo...
Definition: CustomNonbondedForce.h:136
A ForceImpl provides the internal implementation of a Force.
Definition: ForceImpl.h:57
This class implements nonbonded interactions between particles.
Definition: CustomNonbondedForce.h:131