- Main Page
- Related Pages
- Classes
- Files

- File List

# AmoebaVdwForce.h

    00001 #ifndef OPENMM_AMOEBA_VDW_FORCE_H_
    00002 #define OPENMM_AMOEBA_VDW_FORCE_H_
    00003
    00004 /* -------------------------------------------------------------------------- *
    00005  *                              OpenMMAmoeba                                  *
    00006  * -------------------------------------------------------------------------- *
    00007  * This is part of the OpenMM molecular simulation toolkit originating from   *
    00008  * Simbios, the NIH National Center for Physics-Based Simulation of           *
    00009  * Biological Structures at Stanford, funded under the NIH Roadmap for        *
    00010  * Medical Research, grant U54 GM072970. See https://simtk.org.               *
    00011  *                                                                            *
    00012  * Portions copyright (c) 2008-2012 Stanford University and the Authors.      *
    00013  * Authors: Mark Friedrichs, Peter Eastman                                    *
    00014  * Contributors:                                                              *
    00015  *                                                                            *
    00016  * Permission is hereby granted, free of charge, to any person obtaining a    *
    00017  * copy of this software and associated documentation files (the "Software"), *
    00018  * to deal in the Software without restriction, including without limitation  *
    00019  * the rights to use, copy, modify, merge, publish, distribute, sublicense,   *
    00020  * and/or sell copies of the Software, and to permit persons to whom the      *
    00021  * Software is furnished to do so, subject to the following conditions:       *
    00022  *                                                                            *
    00023  * The above copyright notice and this permission notice shall be included in *
    00024  * all copies or substantial portions of the Software.                        *
    00025  *                                                                            *
    00026  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
    00027  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   *
    00028  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    *
    00029  * THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,    *
    00030  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR      *
    00031  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE  *
    00032  * USE OR OTHER DEALINGS IN THE SOFTWARE.                                     *
    00033  * -------------------------------------------------------------------------- */
    00034
    00035 #include "openmm/Force.h"
    00036 #include "internal/windowsExportAmoeba.h"
    00037 #include <vector>
    00038
    00039 namespace OpenMM {
    00040
    00055 class OPENMM_EXPORT_AMOEBA AmoebaVdwForce : public Force {
    00056 public:
    00060     enum NonbondedMethod {
    00065         NoCutoff = 0,
    00070         CutoffPeriodic = 1,
    00071     };
    00072
    00076     AmoebaVdwForce();
    00077
    00081     int getNumParticles() const {
    00082         return parameters.size();
    00083     }
    00084
    00095     void setParticleParameters(int particleIndex, int parentIndex, double sigma, double epsilon, double reductionFactor);
    00096
    00107     void getParticleParameters(int particleIndex, int& parentIndex, double& sigma, double& epsilon, double& reductionFactor) const;
    00108
    00109
    00120     int addParticle(int parentIndex, double sigma, double epsilon, double reductionFactor);
    00121
    00127     void setSigmaCombiningRule(const std::string& sigmaCombiningRule);
    00128
    00134     const std::string& getSigmaCombiningRule(void) const;
    00135
    00141     void setEpsilonCombiningRule(const std::string& epsilonCombiningRule);
    00142
    00148     const std::string& getEpsilonCombiningRule(void) const;
    00149
    00156     bool getUseDispersionCorrection() const {
    00157         return useDispersionCorrection;
    00158     }
    00159
    00166     void setUseDispersionCorrection(bool useCorrection) {
    00167         useDispersionCorrection = useCorrection;
    00168     }
    00169
    00176     void setParticleExclusions(int particleIndex, const std::vector<int>& exclusions);
    00177
    00184     void getParticleExclusions(int particleIndex, std::vector<int>& exclusions) const;
    00185
    00189     void setCutoff(double cutoff);
    00190
    00194     double getCutoff() const;
    00195
    00199     NonbondedMethod getNonbondedMethod() const;
    00200
    00204     void setNonbondedMethod(NonbondedMethod method);
    00214     void updateParametersInContext(Context& context);
    00215
    00216 protected:
    00217     ForceImpl* createImpl() const;
    00218 private:
    00219
    00220     class VdwInfo;
    00221     NonbondedMethod nonbondedMethod;
    00222     double cutoff;
    00223     bool useDispersionCorrection;
    00224
    00225     std::string sigmaCombiningRule;
    00226     std::string epsilonCombiningRule;
    00227
    00228     std::vector< std::vector<int> > exclusions;
    00229     std::vector<VdwInfo> parameters;
    00230     std::vector< std::vector< std::vector<double> > > sigEpsTable;
    00231 };
    00232
    00237 class AmoebaVdwForce::VdwInfo {
    00238 public:
    00239     int parentIndex;
    00240     double reductionFactor, sigma, epsilon, cutoff;
    00241     VdwInfo() {
    00242         parentIndex = -1;
    00243         reductionFactor      = 0.0;
    00244         sigma                = 1.0;
    00245         epsilon              = 0.0;
    00246     }
    00247     VdwInfo(int parentIndex, double sigma, double epsilon, double reductionFactor) :
    00248         parentIndex(parentIndex), sigma(sigma), epsilon(epsilon), reductionFactor(reductionFactor)  {
    00249     }
    00250 };
    00251
    00252 } // namespace OpenMM
    00253
    00254 #endif /*OPENMM_AMOEBA_VDW_FORCE_H_*/
    00255