All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
AmoebaTorsionTorsionForce.h
#ifndef OPENMM_AMOEBA_TORSION_TORSION_FORCE_H_
#define OPENMM_AMOEBA_TORSION_TORSION_FORCE_H_
/* -------------------------------------------------------------------------- *
* OpenMMAmoeba *
* -------------------------------------------------------------------------- *
* This is part of the OpenMM molecular simulation toolkit originating from *
* Simbios, the NIH National Center for Physics-Based Simulation of *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-2012 Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the "Software"), *
* to deal in the Software without restriction, including without limitation *
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
* and/or sell copies of the Software, and to permit persons to whom the *
* Software is furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
* THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/Force.h"
#include "internal/windowsExportAmoeba.h"
#include <vector>
#include <cmath>
namespace OpenMM {
typedef std::vector< std::vector< std::vector<double> > > TorsionTorsionGrid;
typedef std::vector< std::vector< std::vector<float> > > TorsionTorsionGridFloat;
class OPENMM_EXPORT_AMOEBA AmoebaTorsionTorsionForce : public Force {
public:
AmoebaTorsionTorsionForce(void);
int getNumTorsionTorsions(void) const {
return torsionTorsions.size();
}
int getNumTorsionTorsionGrids(void) const {
return torsionTorsionGrids.size();
}
int addTorsionTorsion(int particle1, int particle2, int particle3, int particle4, int particle5, int chiralCheckAtomIndex, int gridIndex);
void getTorsionTorsionParameters(int index, int& particle1, int& particle2, int& particle3, int& particle4, int& particle5, int& chiralCheckAtomIndex, int& gridIndex) const;
void setTorsionTorsionParameters(int index, int particle1, int particle2, int particle3, int particle4, int particle5, int chiralCheckAtomIndex, int gridIndex);
const std::vector<std::vector<std::vector<double> > >& getTorsionTorsionGrid(int index) const;
void setTorsionTorsionGrid(int index, const std::vector<std::vector<std::vector<double> > >& grid);
bool usesPeriodicBoundaryConditions() const {
return false;
}
protected:
ForceImpl* createImpl() const;
private:
class TorsionTorsionInfo;
class TorsionTorsionGridInfo;
std::vector<TorsionTorsionInfo> torsionTorsions;
std::vector<TorsionTorsionGridInfo> torsionTorsionGrids;
};
class AmoebaTorsionTorsionForce::TorsionTorsionInfo {
public:
int particle1, particle2, particle3, particle4, particle5;
int chiralCheckAtomIndex;
int gridIndex;
TorsionTorsionInfo() {
particle1 = particle2 = particle3 = particle4 = particle5 = chiralCheckAtomIndex = -1;
gridIndex = 0;
}
TorsionTorsionInfo(int particle1, int particle2, int particle3, int particle4, int particle5, int chiralCheckAtomIndex, int gridIndex) :
particle1(particle1), particle2(particle2), particle3(particle3),
particle4(particle4), particle5(particle5), gridIndex(gridIndex), chiralCheckAtomIndex(chiralCheckAtomIndex) {
}
};
class AmoebaTorsionTorsionForce::TorsionTorsionGridInfo {
public:
TorsionTorsionGridInfo() {
_size[0] = _size[1] = 0;
_startValues[0] = _startValues[1] = 0.0;
_spacing[0] = _spacing[1] = 1.0;
}
TorsionTorsionGridInfo(const TorsionTorsionGrid& grid);
const TorsionTorsionGrid& getTorsionTorsionGrid(void) const {
return _grid;
}
int getDimensionSize(int index) const {
return _size[index];
}
double getStartValue(int index) const {
return _startValues[index];
}
double getSpacing(int index) const {
return _spacing[index];
}
private:
TorsionTorsionGrid _grid;
int _size[2];
double _startValues[2];
double _spacing[2];
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_TORSION_TORSION_FORCE_H_*/
OpenMM::TorsionTorsionGrid
std::vector< std::vector< std::vector< double > > > TorsionTorsionGrid
Definition: AmoebaTorsionTorsionForce.h:43
OpenMM::TorsionTorsionGridFloat
std::vector< std::vector< std::vector< float > > > TorsionTorsionGridFloat
Definition: AmoebaTorsionTorsionForce.h:44
OpenMM::AmoebaTorsionTorsionForce::getTorsionTorsionGrid
const std::vector< std::vector< std::vector< double > > > & getTorsionTorsionGrid(int index) const
Get the torsion-torsion grid at the specified index.
OpenMM::AmoebaTorsionTorsionForce
This class implements the Amoeba torsion-torsion interaction.
Definition: AmoebaTorsionTorsionForce.h:53
OpenMM::AmoebaTorsionTorsionForce::usesPeriodicBoundaryConditions
bool usesPeriodicBoundaryConditions() const
Returns whether or not this force makes use of periodic boundary conditions.
Definition: AmoebaTorsionTorsionForce.h:146
OpenMM::Force
Force objects apply forces to the particles in a System, or alter their behavior in other ways...
Definition: Force.h:65
OpenMM
Definition: AndersenThermostat.h:40
OpenMM::AmoebaTorsionTorsionForce::getNumTorsionTorsions
int getNumTorsionTorsions(void) const
Get the number of torsion-torsion terms in the potential function.
Definition: AmoebaTorsionTorsionForce.h:64
OpenMM::AmoebaTorsionTorsionForce::getNumTorsionTorsionGrids
int getNumTorsionTorsionGrids(void) const
Get the number of torsion-torsion grids.
Definition: AmoebaTorsionTorsionForce.h:71