- Main Page
- Related Pages
- Classes
- Files

- File List

# GBVIForce.h

    00001 #ifndef OPENMM_GBVIFORCEFIELD_H_
    00002 #define OPENMM_GBVIFORCEFIELD_H_
    00003
    00004 /* -------------------------------------------------------------------------- *
    00005  *                                   OpenMM                                   *
    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-2009 Stanford University and the Authors.      *
    00013  * Authors: 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 "Force.h"
    00036 #include <vector>
    00037 #include "internal/windowsExport.h"
    00038
    00039 namespace OpenMM {
    00040
    00053 class OPENMM_EXPORT GBVIForce : public Force {
    00054 public:
    00058     enum NonbondedMethod {
    00063         NoCutoff = 0,
    00067         CutoffNonPeriodic = 1,
    00072         CutoffPeriodic = 2,
    00073     };
    00074
    00078     enum BornRadiusScalingMethod {
    00082         NoScaling          = 0,
    00086         QuinticSpline       = 1
    00087     };
    00088
    00089     /*
    00090      * Create a GBVIForce.
    00091      */
    00092     GBVIForce();
    00096     int getNumParticles() const {
    00097         return particles.size();
    00098     }
    00108     int addParticle(double charge, double radius, double gamma);
    00117     void getParticleParameters(int index, double& charge, double& radius, double& gamma) const;
    00126     void setParticleParameters(int index, double charge, double radius, double gamma);
    00135     int addBond(int particle1, int particle2, double distance);
    00136
    00145     void getBondParameters(int index, int& particle1, int& particle2, double& distance) const;
    00154     void setBondParameters( int index, int particle1, int particle2, double bondLength);
    00160     int getNumBonds( void ) const;
    00161
    00165     double getSolventDielectric() const {
    00166         return solventDielectric;
    00167     }
    00171     void setSolventDielectric(double dielectric) {
    00172         solventDielectric = dielectric;
    00173     }
    00177     double getSoluteDielectric() const {
    00178         return soluteDielectric;
    00179     }
    00183     void setSoluteDielectric(double dielectric) {
    00184         soluteDielectric = dielectric;
    00185     }
    00189     NonbondedMethod getNonbondedMethod() const;
    00193     void setNonbondedMethod(NonbondedMethod method);
    00200     double getCutoffDistance() const;
    00207     void setCutoffDistance(double distance);
    00211     BornRadiusScalingMethod getBornRadiusScalingMethod( void ) const;
    00215     void setBornRadiusScalingMethod( BornRadiusScalingMethod method);
    00219     double getQuinticLowerLimitFactor( void ) const;
    00223     void setQuinticLowerLimitFactor(double quinticLowerLimitFactor );
    00227     double getQuinticUpperBornRadiusLimit( void ) const;
    00231     void setQuinticUpperBornRadiusLimit(double quinticUpperBornRadiusLimit);
    00232 protected:
    00233     ForceImpl* createImpl() const;
    00234 private:
    00235     class ParticleInfo;
    00236     NonbondedMethod nonbondedMethod;
    00237     double cutoffDistance, solventDielectric, soluteDielectric;
    00238
    00239     BornRadiusScalingMethod scalingMethod;
    00240     double quinticLowerLimitFactor, quinticUpperBornRadiusLimit;
    00241
    00242     class BondInfo;
    00243     std::vector<ParticleInfo> particles;
    00244     std::vector<BondInfo> bonds;
    00245 };
    00246
    00251 class GBVIForce::ParticleInfo {
    00252 public:
    00253     double charge, radius, gamma;
    00254     ParticleInfo() {
    00255         charge = radius = gamma = 0.0;
    00256     }
    00257     ParticleInfo(double charge, double radius, double gamma) :
    00258         charge(charge), radius(radius), gamma(gamma) {
    00259     }
    00260 };
    00261
    00266 class GBVIForce::BondInfo {
    00267 public:
    00268     int particle1, particle2;
    00269     double bondLength;
    00270     BondInfo() {
    00271         bondLength     = 0.0;
    00272         particle1      = -1;
    00273         particle2      = -1;
    00274     }
    00275     BondInfo(int atomIndex1, int atomIndex2, double bondLength) :
    00276              particle1(atomIndex1), particle2(atomIndex2), bondLength(bondLength) {
    00277     }
    00278 };
    00279
    00280 } // namespace OpenMM
    00281
    00282 #endif /*OPENMM_GBVIFORCEFIELD_H_*/