1 #ifndef OPENMM_CUSTOMNONBONDEDFORCE_H_
2 #define OPENMM_CUSTOMNONBONDEDFORCE_H_
35 #include "TabulatedFunction.h"
42 #include "internal/windowsExport.h"
147 CutoffNonPeriodic = 1,
167 return particles.size();
173 return exclusions.size();
179 return parameters.size();
185 return globalParameters.size();
191 return functions.size();
199 return functions.size();
205 return interactionGroups.size();
210 const std::string& getEnergyFunction()
const;
214 void setEnergyFunction(
const std::string& energy);
218 NonbondedMethod getNonbondedMethod()
const;
222 void setNonbondedMethod(NonbondedMethod method);
229 double getCutoffDistance()
const;
236 void setCutoffDistance(
double distance);
241 bool getUseSwitchingFunction()
const;
246 void setUseSwitchingFunction(
bool use);
251 double getSwitchingDistance()
const;
256 void setSwitchingDistance(
double distance);
261 bool getUseLongRangeCorrection()
const;
266 void setUseLongRangeCorrection(
bool use);
273 int addPerParticleParameter(
const std::string& name);
280 const std::string& getPerParticleParameterName(
int index)
const;
287 void setPerParticleParameterName(
int index,
const std::string& name);
295 int addGlobalParameter(
const std::string& name,
double defaultValue);
302 const std::string& getGlobalParameterName(
int index)
const;
309 void setGlobalParameterName(
int index,
const std::string& name);
316 double getGlobalParameterDefaultValue(
int index)
const;
323 void setGlobalParameterDefaultValue(
int index,
double defaultValue);
331 int addParticle(
const std::vector<double>& parameters);
338 void getParticleParameters(
int index, std::vector<double>& parameters)
const;
345 void setParticleParameters(
int index,
const std::vector<double>& parameters);
355 int addExclusion(
int particle1,
int particle2);
363 void getExclusionParticles(
int index,
int& particle1,
int& particle2)
const;
371 void setExclusionParticles(
int index,
int particle1,
int particle2);
380 void createExclusionsFromBonds(
const std::vector<std::pair<int, int> >& bonds,
int bondCutoff);
411 const std::string& getTabulatedFunctionName(
int index)
const;
417 int addFunction(
const std::string& name,
const std::vector<double>& values,
double min,
double max);
424 void getFunctionParameters(
int index, std::string& name, std::vector<double>& values,
double& min,
double& max)
const;
431 void setFunctionParameters(
int index,
const std::string& name,
const std::vector<double>& values,
double min,
double max);
439 int addInteractionGroup(
const std::set<int>& set1,
const std::set<int>& set2);
447 void getInteractionGroupParameters(
int index, std::set<int>& set1, std::set<int>& set2)
const;
455 void setInteractionGroupParameters(
int index,
const std::set<int>& set1,
const std::set<int>& set2);
467 void updateParametersInContext(
Context& context);
478 ForceImpl* createImpl()
const;
482 class PerParticleParameterInfo;
483 class GlobalParameterInfo;
486 class InteractionGroupInfo;
487 NonbondedMethod nonbondedMethod;
488 double cutoffDistance, switchingDistance;
489 bool useSwitchingFunction, useLongRangeCorrection;
490 std::string energyExpression;
491 std::vector<PerParticleParameterInfo> parameters;
492 std::vector<GlobalParameterInfo> globalParameters;
493 std::vector<ParticleInfo> particles;
494 std::vector<ExclusionInfo> exclusions;
495 std::vector<FunctionInfo> functions;
496 std::vector<InteractionGroupInfo> interactionGroups;
503 class CustomNonbondedForce::ParticleInfo {
505 std::vector<double> parameters;
508 ParticleInfo(
const std::vector<double>& parameters) : parameters(parameters) {
516 class CustomNonbondedForce::PerParticleParameterInfo {
519 PerParticleParameterInfo() {
521 PerParticleParameterInfo(
const std::string& name) : name(name) {
529 class CustomNonbondedForce::GlobalParameterInfo {
533 GlobalParameterInfo() {
535 GlobalParameterInfo(
const std::string& name,
double defaultValue) : name(name), defaultValue(defaultValue) {
543 class CustomNonbondedForce::ExclusionInfo {
545 int particle1, particle2;
547 particle1 = particle2 = -1;
549 ExclusionInfo(
int particle1,
int particle2) :
550 particle1(particle1), particle2(particle2) {
558 class CustomNonbondedForce::FunctionInfo {
561 TabulatedFunction*
function;
564 FunctionInfo(
const std::string& name, TabulatedFunction*
function) : name(name), function(function) {
572 class CustomNonbondedForce::InteractionGroupInfo {
574 std::set<int> set1, set2;
575 InteractionGroupInfo() {
577 InteractionGroupInfo(
const std::set<int>& set1,
const std::set<int>& set2) :
578 set1(set1), set2(set2) {
int getNumGlobalParameters() const
Get the number of global parameters that the interaction depends on.
Definition: CustomNonbondedForce.h:184
A TabulatedFunction uses a set of tabulated values to define a mathematical function.
Definition: TabulatedFunction.h:58
bool usesPeriodicBoundaryConditions() const
Returns whether or not this force makes use of periodic boundary conditions.
Definition: CustomNonbondedForce.h:474
int getNumFunctions() const
Get the number of tabulated functions that have been defined.
Definition: CustomNonbondedForce.h:198
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:172
int getNumPerParticleParameters() const
Get the number of per-particle parameters that the interaction depends on.
Definition: CustomNonbondedForce.h:178
Periodic boundary conditions are used, so that each particle interacts only with the nearest periodic...
Definition: CustomNonbondedForce.h:152
Force objects apply forces to the particles in a System, or alter their behavior in other ways...
Definition: Force.h:65
int getNumTabulatedFunctions() const
Get the number of tabulated functions that have been defined.
Definition: CustomNonbondedForce.h:190
int getNumInteractionGroups() const
Get the number of interaction groups that have been defined.
Definition: CustomNonbondedForce.h:204
int getNumParticles() const
Get the number of particles for which force field parameters have been defined.
Definition: CustomNonbondedForce.h:166
NonbondedMethod
This is an enumeration of the different methods that may be used for handling long range nonbonded fo...
Definition: CustomNonbondedForce.h:138
Definition: AndersenThermostat.h:40
This class implements nonbonded interactions between particles.
Definition: CustomNonbondedForce.h:133