Commit 458f19f3 authored by Michael Schnieders's avatar Michael Schnieders
Browse files

Proof of concept API changes to support softcore AMOEBA vdW interactions

parent a34bb184
...@@ -70,6 +70,21 @@ public: ...@@ -70,6 +70,21 @@ public:
CutoffPeriodic = 1, CutoffPeriodic = 1,
}; };
/**
* This is an enumeration of the different alchemical methods used when applying softcore interactions.
*/
enum AlchemicalMethod {
/**
* Maintain full strength vdW interactions between two alchemical particles. This is the default.
*/
Decouple = 0,
/**
* Interactions between two alchemical particles are turned off at lambda=0.
*/
Annihilate = 1,
};
/** /**
* Create an Amoeba VdwForce. * Create an Amoeba VdwForce.
*/ */
...@@ -91,8 +106,9 @@ public: ...@@ -91,8 +106,9 @@ public:
* @param epsilon vdw epsilon * @param epsilon vdw epsilon
* @param reductionFactor the fraction of the distance along the line from the parent particle to this particle * @param reductionFactor the fraction of the distance along the line from the parent particle to this particle
* at which the interaction site should be placed * at which the interaction site should be placed
* @param isAlchemical if true, this vdW particle is undergoing an alchemical change.
*/ */
void setParticleParameters(int particleIndex, int parentIndex, double sigma, double epsilon, double reductionFactor); void setParticleParameters(int particleIndex, int parentIndex, double sigma, double epsilon, double reductionFactor, bool isAlchemical);
/** /**
* Get the force field parameters for a vdw particle. * Get the force field parameters for a vdw particle.
...@@ -103,8 +119,11 @@ public: ...@@ -103,8 +119,11 @@ public:
* @param[out] epsilon vdw epsilon * @param[out] epsilon vdw epsilon
* @param[out] reductionFactor the fraction of the distance along the line from the parent particle to this particle * @param[out] reductionFactor the fraction of the distance along the line from the parent particle to this particle
* at which the interaction site should be placed * at which the interaction site should be placed
* @param[out] isAlchemical if true, this vdW particle is undergoing an alchemical change.
*/ */
void getParticleParameters(int particleIndex, int& parentIndex, double& sigma, double& epsilon, double& reductionFactor) const; */
void getParticleParameters(int particleIndex, int& parentIndex, double& sigma, double& epsilon,
double& reductionFactor, bool& isAlchemical) const;
/** /**
...@@ -115,9 +134,10 @@ public: ...@@ -115,9 +134,10 @@ public:
* @param epsilon vdw epsilon * @param epsilon vdw epsilon
* @param reductionFactor the fraction of the distance along the line from the parent particle to this particle * @param reductionFactor the fraction of the distance along the line from the parent particle to this particle
* at which the interaction site should be placed * at which the interaction site should be placed
* @param isAlchemical if true, this vdW particle is undergoing an alchemical change.
* @return index of added particle * @return index of added particle
*/ */
int addParticle(int parentIndex, double sigma, double epsilon, double reductionFactor); int addParticle(int parentIndex, double sigma, double epsilon, double reductionFactor, bool isAlchemical);
/** /**
* Set sigma combining rule * Set sigma combining rule
...@@ -223,6 +243,47 @@ public: ...@@ -223,6 +243,47 @@ public:
* Set the method used for handling long range nonbonded interactions. * Set the method used for handling long range nonbonded interactions.
*/ */
void setNonbondedMethod(NonbondedMethod method); void setNonbondedMethod(NonbondedMethod method);
/**
* Set the vdw Lambda value.
*/
void setLambda(double lambda);
/**
* Get the vdw Lambda value.
*/
double getLambda() const;
/**
* Set the softcore power on lambda.
*/
void setN(double n);
/**
* Get the softcore power on lambda.
*/
double getN() const;
/**
* Set the softcore alpha value.
*/
void setAlpha(double alpha);
/**
* Get the softcore alpha value.
*/
double getAlpha() const;
/**
* Get the method used for alchemical interactions.
*/
AlchemicalMethod getAlchemicalMethod() const;
/**
* Set the method used for handling long range nonbonded interactions.
*/
void setAlchemicalMethod(AlchemicalMethod method);
/** /**
* Update the per-particle parameters in a Context to match those stored in this Force object. This method provides * Update the per-particle parameters in a Context to match those stored in this Force object. This method provides
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it. * an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
...@@ -250,6 +311,9 @@ private: ...@@ -250,6 +311,9 @@ private:
NonbondedMethod nonbondedMethod; NonbondedMethod nonbondedMethod;
double cutoff; double cutoff;
bool useDispersionCorrection; bool useDispersionCorrection;
double amoebaVdwLambda;
int n;
double alpha;
std::string sigmaCombiningRule; std::string sigmaCombiningRule;
std::string epsilonCombiningRule; std::string epsilonCombiningRule;
...@@ -267,14 +331,16 @@ class AmoebaVdwForce::VdwInfo { ...@@ -267,14 +331,16 @@ class AmoebaVdwForce::VdwInfo {
public: public:
int parentIndex; int parentIndex;
double reductionFactor, sigma, epsilon, cutoff; double reductionFactor, sigma, epsilon, cutoff;
bool isAlchemical;
VdwInfo() { VdwInfo() {
parentIndex = -1; parentIndex = -1;
reductionFactor = 0.0; reductionFactor = 0.0;
sigma = 1.0; sigma = 1.0;
epsilon = 0.0; epsilon = 0.0;
isAlchemical = false;
} }
VdwInfo(int parentIndex, double sigma, double epsilon, double reductionFactor) : VdwInfo(int parentIndex, double sigma, double epsilon, double reductionFactor, bool isAlchemical) :
parentIndex(parentIndex), reductionFactor(reductionFactor), sigma(sigma), epsilon(epsilon) { parentIndex(parentIndex), reductionFactor(reductionFactor), sigma(sigma), epsilon(epsilon), isAlchemical(isAlchemical) {
} }
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment