1 #ifndef OPENMM_AMOEBA_MULTIPOLE_FORCE_H_
2 #define OPENMM_AMOEBA_MULTIPOLE_FORCE_H_
35 #include "openmm/Force.h"
36 #include "openmm/OpenMMException.h"
37 #include "internal/windowsExportAmoeba.h"
38 #include "openmm/Vec3.h"
85 enum MultipoleAxisTypes { ZThenX = 0, Bisector = 1, ZBisect = 2, ThreeFold = 3, ZOnly = 4, NoAxisType = 5, LastAxisTypeIndex = 6 };
88 Covalent12 = 0, Covalent13 = 1, Covalent14 = 2, Covalent15 = 3,
89 PolarizationCovalent11 = 4, PolarizationCovalent12 = 5, PolarizationCovalent13 = 6, PolarizationCovalent14 = 7, CovalentEnd = 8 };
100 return multipoles.size();
106 NonbondedMethod getNonbondedMethod()
const;
111 void setNonbondedMethod(NonbondedMethod method);
116 PolarizationType getPolarizationType()
const;
121 void setPolarizationType(PolarizationType type);
129 double getCutoffDistance()
const;
137 void setCutoffDistance(
double distance);
145 double getAEwald()
const;
153 void setAEwald(
double aewald);
160 int getPmeBSplineOrder()
const;
168 void getPmeGridDimensions(std::vector<int>& gridDimension)
const;
176 void setPmeGridDimensions(
const std::vector<int>& gridDimension);
194 int addMultipole(
double charge,
const std::vector<double>& molecularDipole,
const std::vector<double>& molecularQuadrupole,
int axisType,
195 int multipoleAtomZ,
int multipoleAtomX,
int multipoleAtomY,
double thole,
double dampingFactor,
double polarity);
212 void getMultipoleParameters(
int index,
double& charge, std::vector<double>& molecularDipole, std::vector<double>& molecularQuadrupole,
213 int& axisType,
int& multipoleAtomZ,
int& multipoleAtomX,
int& multipoleAtomY,
double& thole,
double& dampingFactor,
double& polarity)
const;
228 void setMultipoleParameters(
int index,
double charge,
const std::vector<double>& molecularDipole,
const std::vector<double>& molecularQuadrupole,
229 int axisType,
int multipoleAtomZ,
int multipoleAtomX,
int multipoleAtomY,
double thole,
double dampingFactor,
double polarity);
238 void setCovalentMap(
int index, CovalentType typeId,
const std::vector<int>& covalentAtoms);
247 void getCovalentMap(
int index, CovalentType typeId, std::vector<int>& covalentAtoms)
const;
255 void getCovalentMaps(
int index, std::vector < std::vector<int> >& covalentLists)
const;
262 int getMutualInducedMaxIterations(
void)
const;
269 void setMutualInducedMaxIterations(
int inputMutualInducedMaxIterations);
276 double getMutualInducedTargetEpsilon(
void)
const;
283 void setMutualInducedTargetEpsilon(
double inputMutualInducedTargetEpsilon);
293 double getEwaldErrorTolerance()
const;
302 void setEwaldErrorTolerance(
double tol);
310 void getInducedDipoles(
Context& context, std::vector<Vec3>& dipoles);
320 void getElectrostaticPotential(
const std::vector< Vec3 >& inputGrid,
321 Context& context, std::vector< double >& outputElectrostaticPotential);
339 void getSystemMultipoleMoments(
Context& context, std::vector< double >& outputMultipoleMoments);
351 void updateParametersInContext(
Context& context);
362 ForceImpl* createImpl()
const;
364 NonbondedMethod nonbondedMethod;
365 PolarizationType polarizationType;
366 double cutoffDistance;
369 std::vector<int> pmeGridDimension;
370 int mutualInducedMaxIterations;
371 double mutualInducedTargetEpsilon;
372 double scalingDistanceCutoff;
373 double electricConstant;
374 double ewaldErrorTol;
376 std::vector<MultipoleInfo> multipoles;
383 class AmoebaMultipoleForce::MultipoleInfo {
386 int axisType, multipoleAtomZ, multipoleAtomX, multipoleAtomY;
387 double charge, thole, dampingFactor, polarity;
389 std::vector<double> molecularDipole;
390 std::vector<double> molecularQuadrupole;
391 std::vector< std::vector<int> > covalentInfo;
394 axisType = multipoleAtomZ = multipoleAtomX = multipoleAtomY = -1;
395 charge = thole = dampingFactor = 0.0;
397 molecularDipole.resize(3);
398 molecularQuadrupole.resize(9);
402 MultipoleInfo(
double charge,
const std::vector<double>& inputMolecularDipole,
const std::vector<double>& inputMolecularQuadrupole,
403 int axisType,
int multipoleAtomZ,
int multipoleAtomX,
int multipoleAtomY,
double thole,
double dampingFactor,
double polarity) :
404 charge(charge), axisType(axisType), multipoleAtomZ(multipoleAtomZ), multipoleAtomX(multipoleAtomX), multipoleAtomY(multipoleAtomY),
405 thole(thole), dampingFactor(dampingFactor), polarity(polarity) {
409 molecularDipole.resize(3);
410 molecularDipole[0] = inputMolecularDipole[0];
411 molecularDipole[1] = inputMolecularDipole[1];
412 molecularDipole[2] = inputMolecularDipole[2];
414 molecularQuadrupole.resize(9);
415 molecularQuadrupole[0] = inputMolecularQuadrupole[0];
416 molecularQuadrupole[1] = inputMolecularQuadrupole[1];
417 molecularQuadrupole[2] = inputMolecularQuadrupole[2];
418 molecularQuadrupole[3] = inputMolecularQuadrupole[3];
419 molecularQuadrupole[4] = inputMolecularQuadrupole[4];
420 molecularQuadrupole[5] = inputMolecularQuadrupole[5];
421 molecularQuadrupole[6] = inputMolecularQuadrupole[6];
422 molecularQuadrupole[7] = inputMolecularQuadrupole[7];
423 molecularQuadrupole[8] = inputMolecularQuadrupole[8];
int getNumMultipoles() const
Get the number of particles in the potential function.
Definition: AmoebaMultipoleForce.h:99
A Context stores the complete state of a simulation.
Definition: Context.h:67
Force objects apply forces to the particles in a System, or alter their behavior in other ways...
Definition: Force.h:65
NonbondedMethod
Definition: AmoebaMultipoleForce.h:57
CovalentType
Definition: AmoebaMultipoleForce.h:87
PolarizationType
Definition: AmoebaMultipoleForce.h:72
This class implements the Amoeba multipole interaction.
Definition: AmoebaMultipoleForce.h:53
bool usesPeriodicBoundaryConditions() const
Returns whether or not this force makes use of periodic boundary conditions.
Definition: AmoebaMultipoleForce.h:358
Definition: AndersenThermostat.h:40
MultipoleAxisTypes
Definition: AmoebaMultipoleForce.h:85
Definition: AmoebaMultipoleForce.h:89
Periodic boundary conditions are used, and Particle-Mesh Ewald (PME) summation is used to compute the...
Definition: AmoebaMultipoleForce.h:69