1 #ifndef OPENMM_NONBONDEDFORCE_H_
2 #define OPENMM_NONBONDEDFORCE_H_
41 #include "internal/windowsExport.h"
85 CutoffNonPeriodic = 1,
111 return particles.size();
117 return exceptions.size();
122 NonbondedMethod getNonbondedMethod()
const;
126 void setNonbondedMethod(NonbondedMethod method);
133 double getCutoffDistance()
const;
140 void setCutoffDistance(
double distance);
144 double getReactionFieldDielectric()
const;
148 void setReactionFieldDielectric(
double dielectric);
155 double getEwaldErrorTolerance()
const;
162 void setEwaldErrorTolerance(
double tol);
175 int addParticle(
double charge,
double sigma,
double epsilon);
184 void getParticleParameters(
int index,
double& charge,
double& sigma,
double& epsilon)
const;
195 void setParticleParameters(
int index,
double charge,
double sigma,
double epsilon);
212 int addException(
int particle1,
int particle2,
double chargeProd,
double sigma,
double epsilon,
bool replace =
false);
223 void getExceptionParameters(
int index,
int& particle1,
int& particle2,
double& chargeProd,
double& sigma,
double& epsilon)
const;
236 void setExceptionParameters(
int index,
int particle1,
int particle2,
double chargeProd,
double sigma,
double epsilon);
249 void createExceptionsFromBonds(
const std::vector<std::pair<int, int> >& bonds,
double coulomb14Scale,
double lj14Scale);
257 return useDispersionCorrection;
266 useDispersionCorrection = useCorrection;
274 int getReciprocalSpaceForceGroup()
const;
284 void setReciprocalSpaceForceGroup(
int group);
297 void updateParametersInContext(
Context& context);
303 NonbondedMethod nonbondedMethod;
304 double cutoffDistance, rfDielectric, ewaldErrorTol;
305 bool useDispersionCorrection;
307 void addExclusionsToSet(
const std::vector<std::set<int> >& bonded12, std::set<int>& exclusions,
int baseParticle,
int fromParticle,
int currentLevel)
const;
308 std::vector<ParticleInfo> particles;
309 std::vector<ExceptionInfo> exceptions;
310 std::map<std::pair<int, int>,
int> exceptionMap;
317 class NonbondedForce::ParticleInfo {
319 double charge, sigma, epsilon;
321 charge = sigma = epsilon = 0.0;
323 ParticleInfo(
double charge,
double sigma,
double epsilon) :
324 charge(charge), sigma(sigma), epsilon(epsilon) {
332 class NonbondedForce::ExceptionInfo {
334 int particle1, particle2;
335 double chargeProd, sigma, epsilon;
337 particle1 = particle2 = -1;
338 chargeProd = sigma = epsilon = 0.0;
340 ExceptionInfo(
int particle1,
int particle2,
double chargeProd,
double sigma,
double epsilon) :
341 particle1(particle1), particle2(particle2), chargeProd(chargeProd), sigma(sigma), epsilon(epsilon) {