1 #ifndef OPENMM_NONBONDEDFORCE_H_
2 #define OPENMM_NONBONDEDFORCE_H_
41 #include "internal/windowsExport.h"
96 CutoffNonPeriodic = 1,
122 return particles.size();
128 return exceptions.size();
133 NonbondedMethod getNonbondedMethod()
const;
137 void setNonbondedMethod(NonbondedMethod method);
144 double getCutoffDistance()
const;
151 void setCutoffDistance(
double distance);
156 bool getUseSwitchingFunction()
const;
161 void setUseSwitchingFunction(
bool use);
166 double getSwitchingDistance()
const;
171 void setSwitchingDistance(
double distance);
175 double getReactionFieldDielectric()
const;
179 void setReactionFieldDielectric(
double dielectric);
186 double getEwaldErrorTolerance()
const;
193 void setEwaldErrorTolerance(
double tol);
206 int addParticle(
double charge,
double sigma,
double epsilon);
215 void getParticleParameters(
int index,
double& charge,
double& sigma,
double& epsilon)
const;
226 void setParticleParameters(
int index,
double charge,
double sigma,
double epsilon);
243 int addException(
int particle1,
int particle2,
double chargeProd,
double sigma,
double epsilon,
bool replace =
false);
254 void getExceptionParameters(
int index,
int& particle1,
int& particle2,
double& chargeProd,
double& sigma,
double& epsilon)
const;
267 void setExceptionParameters(
int index,
int particle1,
int particle2,
double chargeProd,
double sigma,
double epsilon);
280 void createExceptionsFromBonds(
const std::vector<std::pair<int, int> >& bonds,
double coulomb14Scale,
double lj14Scale);
288 return useDispersionCorrection;
297 useDispersionCorrection = useCorrection;
305 int getReciprocalSpaceForceGroup()
const;
315 void setReciprocalSpaceForceGroup(
int group);
328 void updateParametersInContext(
Context& context);
334 NonbondedMethod nonbondedMethod;
335 double cutoffDistance, switchingDistance, rfDielectric, ewaldErrorTol;
336 bool useSwitchingFunction, useDispersionCorrection;
338 void addExclusionsToSet(
const std::vector<std::set<int> >& bonded12, std::set<int>& exclusions,
int baseParticle,
int fromParticle,
int currentLevel)
const;
339 std::vector<ParticleInfo> particles;
340 std::vector<ExceptionInfo> exceptions;
341 std::map<std::pair<int, int>,
int> exceptionMap;
348 class NonbondedForce::ParticleInfo {
350 double charge, sigma, epsilon;
352 charge = sigma = epsilon = 0.0;
354 ParticleInfo(
double charge,
double sigma,
double epsilon) :
355 charge(charge), sigma(sigma), epsilon(epsilon) {
363 class NonbondedForce::ExceptionInfo {
365 int particle1, particle2;
366 double chargeProd, sigma, epsilon;
368 particle1 = particle2 = -1;
369 chargeProd = sigma = epsilon = 0.0;
371 ExceptionInfo(
int particle1,
int particle2,
double chargeProd,
double sigma,
double epsilon) :
372 particle1(particle1), particle2(particle2), chargeProd(chargeProd), sigma(sigma), epsilon(epsilon) {