- Main Page
- Related Pages
- Classes
- Files

- File List

# AmoebaTorsionTorsionForce.h

    00001 #ifndef OPENMM_AMOEBA_TORSION_TORSION_FORCE_H_
    00002 #define OPENMM_AMOEBA_TORSION_TORSION_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
    00038 #include <vector>
    00039 #include <cmath>
    00040
    00041 namespace OpenMM {
    00042
    00043 typedef std::vector< std::vector< std::vector<double> > > TorsionTorsionGrid;
    00044 typedef std::vector< std::vector< std::vector<float> > > TorsionTorsionGridFloat;
    00045
    00053 class OPENMM_EXPORT_AMOEBA AmoebaTorsionTorsionForce : public Force {
    00054
    00055 public:
    00059     AmoebaTorsionTorsionForce(void);
    00060
    00064     int getNumTorsionTorsions(void) const {
    00065         return torsionTorsions.size();
    00066     }
    00067
    00071     int getNumTorsionTorsionGrids(void) const {
    00072         return torsionTorsionGrids.size();
    00073     }
    00074
    00087     int addTorsionTorsion(int particle1, int particle2, int particle3, int particle4, int particle5, int chiralCheckAtomIndex, int gridIndex);
    00088
    00101     void getTorsionTorsionParameters(int index, int& particle1, int& particle2, int& particle3, int& particle4, int& particle5, int& chiralCheckAtomIndex, int& gridIndex) const;
    00102
    00115     void setTorsionTorsionParameters(int index, int particle1, int particle2, int particle3, int particle4, int particle5, int chiralCheckAtomIndex, int gridIndex);
    00116
    00123     const std::vector<std::vector<std::vector<double> > >& getTorsionTorsionGrid(int index) const;
    00124
    00139     void setTorsionTorsionGrid(int index, const std::vector<std::vector<std::vector<double> > >& grid);
    00140
    00141 protected:
    00142     ForceImpl* createImpl() const;
    00143 private:
    00144     class TorsionTorsionInfo;
    00145     class TorsionTorsionGridInfo;
    00146     std::vector<TorsionTorsionInfo> torsionTorsions;
    00147     std::vector<TorsionTorsionGridInfo> torsionTorsionGrids;
    00148 };
    00149
    00154 class AmoebaTorsionTorsionForce::TorsionTorsionInfo {
    00155
    00156 public:
    00157
    00158     int particle1, particle2, particle3, particle4, particle5;
    00159     int chiralCheckAtomIndex;
    00160     int gridIndex;
    00161     TorsionTorsionInfo() {
    00162         particle1 = particle2  = particle3 = particle4 = particle5 = chiralCheckAtomIndex = -1;
    00163         gridIndex = 0;
    00164     }
    00165     TorsionTorsionInfo(int particle1, int particle2, int particle3, int particle4, int particle5, int chiralCheckAtomIndex, int gridIndex) :
    00166                        particle1(particle1), particle2(particle2), particle3(particle3),
    00167                        particle4(particle4), particle5(particle5), gridIndex(gridIndex), chiralCheckAtomIndex(chiralCheckAtomIndex) {
    00168
    00169     }
    00170 };
    00171
    00176 class AmoebaTorsionTorsionForce::TorsionTorsionGridInfo {
    00177
    00178 public:
    00179
    00180     TorsionTorsionGridInfo() {
    00181         _size[0]        = _size[1]        = 0;
    00182         _startValues[0] = _startValues[1] = 0.0;
    00183         _spacing[0]     = _spacing[1]     = 1.0;
    00184     }
    00185
    00186     TorsionTorsionGridInfo(const TorsionTorsionGrid& grid);
    00187
    00188     const TorsionTorsionGrid& getTorsionTorsionGrid(void) const {
    00189         return _grid;
    00190     }
    00191     int getDimensionSize(int index) const {
    00192         return _size[index];
    00193     }
    00194     double getStartValue(int index) const {
    00195         return _startValues[index];
    00196     }
    00197     double getSpacing(int index) const {
    00198         return _spacing[index];
    00199     }
    00200
    00201 private:
    00202
    00203     TorsionTorsionGrid _grid;
    00204     int _size[2];
    00205     double _startValues[2];
    00206     double _spacing[2];
    00207 };
    00208
    00209 } // namespace OpenMM
    00210
    00211 #endif /*OPENMM_AMOEBA_TORSION_TORSION_FORCE_H_*/