"wrappers/python/vscode:/vscode.git/clone" did not exist on "fd44d285348a7a5a161582e46b2f21c2dbcb6770"
Commit f7f79b04 authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Initial Amoeba

parent 5003591d
#---------------------------------------------------
# OpenMM Amoeba Plugin
#
# Creates OpenMM Amoeba plugin library, base name=OpenMMAmoeba.
# Default libraries are shared & optimized. Variants
# are created for static (_static) and debug (_d).
#
# Windows:
# OpenMMAmoeba[_d].dll
# OpenMMAmoeba[_d].lib
# OpenMMAmoeba_static[_d].lib
# Unix:
# libOpenMMAmoeba[_d].so
# libOpenMMAmoeba_static[_d].a
#----------------------------------------------------
#INCLUDE(Dart)
SET(LOG FALSE)
# ----------------------------------------------------------------------------
IF(LOG)
SET(LOG_FILE "CMakeLog.txt" )
FILE( WRITE ${LOG_FILE} "In OpenMM Cmake\n")
ENDIF(LOG)
IF(LOG)
MACRO(LOG_DIR LOG_FILE DIR_LIST )
FILE( APPEND ${LOG_FILE} "\n${DIR_LIST}\n")
FOREACH(currentFile ${ARGN})
FILE( APPEND ${LOG_FILE} " ${currentFile}\n" )
ENDFOREACH(currentFile)
ENDMACRO(LOG_DIR)
ENDIF(LOG)
# ----------------------------------------------------------------------------
# The source is organized into subdirectories, but we handle them all from
# this CMakeLists file rather than letting CMake visit them as SUBDIRS.
#SET(OPENMM_AMOEBA_PLUGIN_SOURCE_SUBDIRS . openmmapi platforms/reference)
SET(OPENMM_AMOEBA_PLUGIN_SOURCE_SUBDIRS . openmmapi )
# Collect up information about the version of the OpenMM library we're building
# and make it available to the code so it can be built into the binaries.
SET(OPENMM_AMOEBA_LIBRARY_NAME OpenMMAmoeba)
SET(OPENMM_AMOEBA_MAJOR_VERSION 1)
SET(OPENMM_AMOEBA_MINOR_VERSION 0)
SET(OPENMM_AMOEBA_BUILD_VERSION 0)
ADD_DEFINITIONS(-DOPENMM_AMOEBA_LIBRARY_NAME=${OPENMM_AMOEBA_LIBRARY_NAME}
-DOPENMM_AMOEBA_MAJOR_VERSION=${OPENMM_AMOEBA_MAJOR_VERSION}
-DOPENMM_AMOEBA_MINOR_VERSION=${OPENMM_AMOEBA_MINOR_VERSION}
-DOPENMM_AMOEBA_BUILD_VERSION=${OPENMM_AMOEBA_BUILD_VERSION})
SET(SHARED_AMOEBA_TARGET ${OPENMM_AMOEBA_LIBRARY_NAME})
SET(STATIC_AMOEBA_TARGET ${OPENMM_AMOEBA_LIBRARY_NAME}_static)
# But on Unix or Cygwin we have to add the suffix manually
IF (UNIX AND CMAKE_BUILD_TYPE MATCHES Debug)
SET(SHARED_AMOEBA_TARGET ${SHARED_AMOEBA_TARGET}_d)
SET(STATIC_AMOEBA_TARGET ${STATIC_AMOEBA_TARGET}_d)
ENDIF (UNIX AND CMAKE_BUILD_TYPE MATCHES Debug)
# These are all the places to search for header files which are
# to be part of the API.
SET(API_AMOEBA_INCLUDE_DIRS) # start empty
FOREACH(subdir ${OPENMM_AMOEBA_PLUGIN_SOURCE_SUBDIRS})
# append
SET(API_AMOEBA_INCLUDE_DIRS ${API_AMOEBA_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/include
${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/include/internal)
ENDFOREACH(subdir)
# We'll need both *relative* path names, starting with their API_INCLUDE_DIRS,
# and absolute pathnames.
SET(API_AMOEBA_REL_INCLUDE_FILES) # start these out empty
SET(API_AMOEBA_ABS_INCLUDE_FILES)
FOREACH(dir ${API_AMOEBA_INCLUDE_DIRS})
FILE(GLOB fullpaths ${dir}/*.h) # returns full pathnames
SET(API_AMOEBA_ABS_INCLUDE_FILES ${API_AMOEBA_ABS_INCLUDE_FILES} ${fullpaths})
FOREACH(pathname ${fullpaths})
GET_FILENAME_COMPONENT(filename ${pathname} NAME)
SET(API_AMOEBA_REL_INCLUDE_FILES ${API_AMOEBA_REL_INCLUDE_FILES} ${dir}/${filename})
ENDFOREACH(pathname)
ENDFOREACH(dir)
# collect up source files
SET(SOURCE_AMOEBA_FILES) # empty
SET(SOURCE_AMOEBA_INCLUDE_FILES)
FOREACH(subdir ${OPENMM_AMOEBA_PLUGIN_SOURCE_SUBDIRS})
FILE(GLOB src_files ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/src/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/src/*/*.cpp)
FILE(GLOB incl_files ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/src/*.h)
SET(SOURCE_AMOEBA_FILES ${SOURCE_AMOEBA_FILES} ${src_files}) #append
SET(SOURCE_AMOEBA_INCLUDE_FILES ${SOURCE_AMOEBA_INCLUDE_FILES} ${incl_files})
## Make sure we find these locally before looking in OpenMM/include if
## OpenMM was previously installed there.
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/include)
ENDFOREACH(subdir)
#INCLUDE_DIRECTORIES(BEFORE ${OPENMM_DIR}/platforms/reference/src)
#INCLUDE_DIRECTORIES(BEFORE ${OPENMM_DIR}/platforms/reference/src/SimTKReference)
# ----------------------------------------------------------------------------
IF(LOG)
FILE( APPEND ${LOG_FILE} "SOURCE_AMOEBA_FILES=" ${SOURCE_AMOEBA_FILES} "\n" )
FILE( APPEND ${LOG_FILE} "SOURCE_AMOEBA_INCLUDE_FILES=" ${SOURCE_AMOEBA_INCLUDE_FILES} "\n" )
FILE( APPEND ${LOG_FILE} "OPENMM_PATH=" ${OPENMM_PATH} "\n" )
FILE( APPEND ${LOG_FILE} "CUDA_PATH=" ${CUDA_PATH} "\n" )
ENDIF(LOG)
# ----------------------------------------------------------------------------
# If API_AMOEBA wrappers are being generated, and add them to the build.
#SET(OPENMM_BUILD_API_AMOEBA_WRAPPERS OFF CACHE BOOL "Build wrappers for C and Fortran")
#IF(OPENMM_BUILD_API_AMOEBA_WRAPPERS)
# ADD_SUBDIRECTORY(wrappers)
# SET(SOURCE_AMOEBA_FILES ${SOURCE_AMOEBA_FILES} wrappers/OpenMMCWrapper.cpp wrappers/OpenMMFortranWrapper.cpp)
# SET_SOURCE_AMOEBA_FILES_PROPERTIES(wrappers/OpenMMCWrapper.cpp wrappers/OpenMMFortranWrapper.cpp PROPERTIES GENERATED TRUE)
#ENDIF(OPENMM_BUILD_API_AMOEBA_WRAPPERS)
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/src)
ADD_LIBRARY(${SHARED_AMOEBA_TARGET} SHARED ${SOURCE_AMOEBA_FILES} ${SOURCE_AMOEBA_INCLUDE_FILES} ${API_AMOEBA_ABS_INCLUDE_FILES})
SET_TARGET_PROPERTIES(${SHARED_AMOEBA_TARGET} PROPERTIES COMPILE_FLAGS "-DOPENMM_BUILDING_SHARED_LIBRARY -DLEPTON_BUILDING_SHARED_LIBRARY")
IF(OPENMM_BUILD_STATIC_LIB)
ADD_LIBRARY(${STATIC_AMOEBA_TARGET} STATIC ${SOURCE_AMOEBA_FILES} ${SOURCE_AMOEBA_INCLUDE_FILES} ${API_AMOEBA_ABS_INCLUDE_FILES})
SET_TARGET_PROPERTIES(${STATIC_AMOEBA_TARGET} PROPERTIES COMPILE_FLAGS "-DOPENMM_USE_STATIC_LIBRARIES -DOPENMM_BUILDING_STATIC_LIBRARY -DLEPTON_USE_STATIC_LIBRARIES -DLEPTON_BUILDING_STATIC_LIBRARY")
ENDIF(OPENMM_BUILD_STATIC_LIB)
#IF(OPENMM_BUILD_API_AMOEBA_WRAPPERS)
# ADD_DEPENDENCIES(${SHARED_AMOEBA_TARGET} ApiWrappers)
# ADD_DEPENDENCIES(${STATIC_AMOEBA_TARGET} ApiWrappers)
#ENDIF(OPENMM_BUILD_API_AMOEBA_WRAPPERS)
# On Linux need to link to libdl
FIND_LIBRARY(DL_LIBRARY dl)
IF(DL_LIBRARY)
TARGET_LINK_LIBRARIES(${SHARED_AMOEBA_TARGET} ${DL_LIBRARY})
IF(OPENMM_BUILD_STATIC_LIB)
TARGET_LINK_LIBRARIES(${STATIC_AMOEBA_TARGET} ${DL_LIBRARY})
ENDIF(OPENMM_BUILD_STATIC_LIB)
ENDIF(DL_LIBRARY)
SET( OpenMMLib OpenMM )
# But on Unix or Cygwin we have to add the suffix manually
IF (UNIX AND CMAKE_BUILD_TYPE MATCHES Debug)
SET(OpenMMLib ${OpenMMLib}_d)
ENDIF (UNIX AND CMAKE_BUILD_TYPE MATCHES Debug)
TARGET_LINK_LIBRARIES( ${SHARED_AMOEBA_TARGET} ${SHARED_TARGET} )
IF(OPENMM_BUILD_STATIC_LIB)
TARGET_LINK_LIBRARIES( ${STATIC_AMOEBA_TARGET} ${STATIC_TARGET} )
ENDIF(OPENMM_BUILD_STATIC_LIB)
#ADD_SUBDIRECTORY(platforms/reference/tests)
# Which hardware platforms to build
IF(CUDA_FOUND)
SET(OPENMM_BUILD_AMOEBA_CUDA_LIB ON CACHE BOOL "Build OpenMMAmoebaCuda library for Nvidia GPUs")
ELSE(CUDA_FOUND)
SET(OPENMM_BUILD_AMOEBA_CUDA_LIB OFF CACHE BOOL "Build OpenMMAmoebaCuda library for Nvidia GPUs")
ENDIF(CUDA_FOUND)
SET(OPENMM_BUILD_AMOEBA_PATH)
SET(OPENMM_BUILD_AMOEBA_CUDA_PATH)
IF(OPENMM_BUILD_AMOEBA_CUDA_LIB)
ADD_SUBDIRECTORY(platforms/cuda)
SET(OPENMM_BUILD_AMOEBA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/platforms/cuda)
SET(OPENMM_BUILD_AMOEBA_CUDA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/platforms/cuda)
SET(OPENMM_AMOEBA_CUDA_SOURCE_SUBDIRS . openmmapi olla platforms/cuda)
ENDIF(OPENMM_BUILD_AMOEBA_CUDA_LIB)
#SET(OPENMM_BUILD_BROOK_LIB OFF CACHE BOOL "Build OpenMMBrook library for ATI GPUs")
#IF(OPENMM_BUILD_BROOK_LIB)
# ADD_SUBDIRECTORY(platforms/brook)
#ENDIF(OPENMM_BUILD_BROOK_LIB)
#
#SET(OPENMM_BUILD_OPENCL_LIB OFF CACHE BOOL "Build OpenMMOpenCL library for Nvidia GPUs")
#IF(OPENMM_BUILD_OPENCL_LIB)
# ADD_SUBDIRECTORY(platforms/opencl)
#ENDIF(OPENMM_BUILD_OPENCL_LIB)
INSTALL_TARGETS(/lib RUNTIME_DIRECTORY /lib/plugins ${SHARED_AMOEBA_TARGET})
IF(OPENMM_BUILD_STATIC_LIB)
INSTALL_TARGETS(/lib RUNTIME_DIRECTORY /lib/plugins ${STATIC_AMOEBA_TARGET})
ENDIF(OPENMM_BUILD_STATIC_LIB)
FILE(GLOB CORE_HEADERS include/*.h */include/*.h)
FILE(GLOB TOP_HEADERS include/openmm/*.h */include/openmm/*.h)
FILE(GLOB INTERNAL_HEADERS include/openmm/internal/*.h */include/openmm/internal/*.h )
INSTALL_FILES(/include FILES ${CORE_HEADERS})
INSTALL_FILES(/include/openmm FILES ${TOP_HEADERS})
INSTALL_FILES(/include/openmm/internal FILES ${INTERNAL_HEADERS})
#
# Allow automated build and dashboard.
#
#INCLUDE (Dart)
#IF (UNIX AND NOT CYGWIN AND NOT APPLE)
# IF (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES Debug)
# ADD_DEFINITIONS(-fprofile-arcs -ftest-coverage)
# LINK_LIBRARIES(gcov)
# ENDIF (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES Debug)
#ENDIF (UNIX AND NOT CYGWIN AND NOT APPLE)
#
# Testing
#
ENABLE_TESTING()
IF (EXECUTABLE_OUTPUT_PATH)
SET (TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
ELSE (EXECUTABLE_OUTPUT_PATH)
SET (TEST_PATH .)
ENDIF (EXECUTABLE_OUTPUT_PATH)
#INCLUDE(ApiDoxygen.cmake)
#ADD_SUBDIRECTORY(tests)
#ADD_SUBDIRECTORY(examples)
#ifndef AMOEBA_OPENMM_GBSA_OBC_FORCE_FIELD_H_
#define AMOEBA_OPENMM_GBSA_OBC_FORCE_FIELD_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: 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 <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements an implicit solvation force using the GBSA-OBC model.
* <p>
* To use this class, create a AmoebaGBSAOBCForce object, then call addParticle() once for each particle in the
* System to define its parameters. The number of particles for which you define GBSA parameters must
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* try to create a Context. After a particle has been added, you can modify its force field parameters
* by calling setParticleParameters().
*/
class OPENMM_EXPORT AmoebaGBSAOBCForce : public Force {
public:
/**
* This is an enumeration of the different methods that may be used for handling long range nonbonded forces.
*/
enum NonbondedMethod {
/**
* No cutoff is applied to nonbonded interactions. The full set of N^2 interactions is computed exactly.
* This necessarily means that periodic boundary conditions cannot be used. This is the default.
*/
NoCutoff = 0,
/**
* Interactions beyond the cutoff distance are ignored.
*/
CutoffNonPeriodic = 1,
/**
* Periodic boundary conditions are used, so that each particle interacts only with the nearest periodic copy of
* each other particle. Interactions beyond the cutoff distance are ignored.
*/
CutoffPeriodic = 2,
};
/*
* Create a AmoebaGBSAOBCForce.
*/
AmoebaGBSAOBCForce();
/**
* Get the number of particles in the system.
*/
int getNumParticles() const {
return particles.size();
}
/**
* Add the GBSA parameters for a particle. This should be called once for each particle
* in the System. When it is called for the i'th time, it specifies the parameters for the i'th particle.
*
* @param charge the charge of the particle, measured in units of the proton charge
* @param radius the GBSA radius of the particle, measured in nm
* @param scalingFactor the OBC scaling factor for the particle
* @return the index of the particle that was added
*/
int addParticle(double charge, double radius, double scalingFactor);
/**
* Get the force field parameters for a particle.
*
* @param index the index of the particle for which to get parameters
* @param charge the charge of the particle, measured in units of the proton charge
* @param radius the GBSA radius of the particle, measured in nm
* @param scalingFactor the OBC scaling factor for the particle
*/
void getParticleParameters(int index, double& charge, double& radius, double& scalingFactor) const;
/**
* Set the force field parameters for a particle.
*
* @param index the index of the particle for which to set parameters
* @param charge the charge of the particle, measured in units of the proton charge
* @param radius the GBSA radius of the particle, measured in nm
* @param scalingFactor the OBC scaling factor for the particle
*/
void setParticleParameters(int index, double charge, double radius, double scalingFactor);
/**
* Get the dielectric constant for the solvent.
*/
double getSolventDielectric() const {
return solventDielectric;
}
/**
* Set the dielectric constant for the solvent.
*/
void setSolventDielectric(double dielectric) {
solventDielectric = dielectric;
}
/**
* Get the dielectric constant for the solute.
*/
double getSoluteDielectric() const {
return soluteDielectric;
}
/**
* Set the dielectric constant for the solute.
*/
void setSoluteDielectric(double dielectric) {
soluteDielectric = dielectric;
}
/**
* Get the method used for handling long range nonbonded interactions.
*/
NonbondedMethod getNonbondedMethod() const;
/**
* Set the method used for handling long range nonbonded interactions.
*/
void setNonbondedMethod(NonbondedMethod method);
/**
* Get the cutoff distance (in nm) being used for nonbonded interactions. If the NonbondedMethod in use
* is NoCutoff, this value will have no effect.
*/
double getCutoffDistance() const;
/**
* Set the cutoff distance (in nm) being used for nonbonded interactions. If the NonbondedMethod in use
* is NoCutoff, this value will have no effect.
*/
void setCutoffDistance(double distance);
protected:
ForceImpl* createImpl();
private:
class ParticleInfo;
NonbondedMethod nonbondedMethod;
double cutoffDistance, solventDielectric, soluteDielectric;
std::vector<ParticleInfo> particles;
};
class AmoebaGBSAOBCForce::ParticleInfo {
public:
double charge, radius, scalingFactor;
ParticleInfo() {
charge = radius = scalingFactor = 0.0;
}
ParticleInfo(double charge, double radius, double scalingFactor) :
charge(charge), radius(radius), scalingFactor(scalingFactor) {
}
};
} // namespace OpenMM
#endif /*AMOEBA_OPENMM_GBSA_OBC_FORCE_FIELD_H_*/
#ifndef AMOEBA_OPENMM_GK_FORCE_FIELD_H_
#define AMOEBA_OPENMM_GK_FORCE_FIELD_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: 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 <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements an implicit solvation force using the GBSA-OBC model.
* <p>
* To use this class, create a AmoebaGeneralizedKirkwoodForce object, then call addParticle() once for each particle in the
* System to define its parameters. The number of particles for which you define GBSA parameters must
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* try to create a Context. After a particle has been added, you can modify its force field parameters
* by calling setParticleParameters().
*/
class OPENMM_EXPORT AmoebaGeneralizedKirkwoodForce : public Force {
public:
/**
* This is an enumeration of the different methods that may be used for handling long range nonbonded forces.
*/
enum NonbondedMethod {
/**
* No cutoff is applied to nonbonded interactions. The full set of N^2 interactions is computed exactly.
* This necessarily means that periodic boundary conditions cannot be used. This is the default.
*/
NoCutoff = 0,
/**
* Interactions beyond the cutoff distance are ignored.
*/
CutoffNonPeriodic = 1,
/**
* Periodic boundary conditions are used, so that each particle interacts only with the nearest periodic copy of
* each other particle. Interactions beyond the cutoff distance are ignored.
*/
CutoffPeriodic = 2,
};
/*
* Create a AmoebaGeneralizedKirkwoodForce.
*/
AmoebaGeneralizedKirkwoodForce();
/**
* Get the number of particles in the system.
*/
int getNumParticles() const {
return particles.size();
}
/**
* Add the GBSA parameters for a particle. This should be called once for each particle
* in the System. When it is called for the i'th time, it specifies the parameters for the i'th particle.
*
* @param charge the charge of the particle, measured in units of the proton charge
* @param radius the GBSA radius of the particle, measured in nm
* @param scalingFactor the OBC scaling factor for the particle
* @return the index of the particle that was added
*/
int addParticle(double charge, double radius, double scalingFactor);
/**
* Get the force field parameters for a particle.
*
* @param index the index of the particle for which to get parameters
* @param charge the charge of the particle, measured in units of the proton charge
* @param radius the GBSA radius of the particle, measured in nm
* @param scalingFactor the OBC scaling factor for the particle
*/
void getParticleParameters(int index, double& charge, double& radius, double& scalingFactor) const;
/**
* Set the force field parameters for a particle.
*
* @param index the index of the particle for which to set parameters
* @param charge the charge of the particle, measured in units of the proton charge
* @param radius the GBSA radius of the particle, measured in nm
* @param scalingFactor the OBC scaling factor for the particle
*/
void setParticleParameters(int index, double charge, double radius, double scalingFactor);
/**
* Get the dielectric constant for the solvent.
*/
double getSolventDielectric() const {
return solventDielectric;
}
/**
* Set the dielectric constant for the solvent.
*/
void setSolventDielectric(double dielectric) {
solventDielectric = dielectric;
}
/**
* Get the dielectric constant for the solute.
*/
double getSoluteDielectric() const {
return soluteDielectric;
}
/**
* Set the dielectric constant for the solute.
*/
void setSoluteDielectric(double dielectric) {
soluteDielectric = dielectric;
}
/**
* Get the method used for handling long range nonbonded interactions.
*/
NonbondedMethod getNonbondedMethod() const;
/**
* Set the method used for handling long range nonbonded interactions.
*/
void setNonbondedMethod(NonbondedMethod method);
/**
* Get the cutoff distance (in nm) being used for nonbonded interactions. If the NonbondedMethod in use
* is NoCutoff, this value will have no effect.
*/
double getCutoffDistance() const;
/**
* Set the cutoff distance (in nm) being used for nonbonded interactions. If the NonbondedMethod in use
* is NoCutoff, this value will have no effect.
*/
void setCutoffDistance(double distance);
/**
* Get the dielectric offset (nm) used in OBC
*/
double getDielectricOffset() const;
/**
* Set the dielectric offset (nm) used in OBC
*/
void setDielectricOffset(double dielectricOffset);
/**
* Get the flag signalling whether the cavity term should be included
*/
int getIncludeCavityTerm( ) const;
/**
* Set the flag signalling whether the cavity term should be included
*/
void setIncludeCavityTerm(int includeCavityTerm);
/**
* Get the probe radius (nm) used in SASA contribution
*/
double getProbeRadius() const;
/**
* Set the probe radius (nm) used in SASA contribution
*/
void setProbeRadius(double probeRadius);
/**
* Get the surface area factor kJ/(nm*nm) used in SASA contribution
*/
double getSurfaceAreaFactor() const;
/**
* Set the surface area factor kJ/(nm*nm) used in SASA contribution
*/
void setSurfaceAreaFactor( double surfaceAreaFactor );
protected:
ForceImpl* createImpl();
private:
class ParticleInfo;
NonbondedMethod nonbondedMethod;
int includeCavityTerm;
double cutoffDistance, solventDielectric, soluteDielectric, dielectricOffset,
probeRadius, surfaceAreaFactor;
std::vector<ParticleInfo> particles;
};
class AmoebaGeneralizedKirkwoodForce::ParticleInfo {
public:
double charge, radius, scalingFactor;
ParticleInfo() {
charge = radius = scalingFactor = 0.0;
}
ParticleInfo(double charge, double radius, double scalingFactor) :
charge(charge), radius(radius), scalingFactor(scalingFactor) {
}
};
} // namespace OpenMM
#endif /*AMOEBA_OPENMM_GBSA_OBC_FORCE_FIELD_H_*/
#ifndef OPENMM_AMOEBA_HARMONIC_ANGLE_FORCE_H_
#define OPENMM_AMOEBA_HARMONIC_ANGLE_FORCE_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: *
* 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 <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements an interaction between pairs of particles that varies harmonically with the distance
* between them. To use it, create a HarmonicAngleForce object then call addAngle() once for each angle. After
* a angle has been added, you can modify its force field parameters by calling setAngleParameters().
*/
class OPENMM_EXPORT AmoebaHarmonicAngleForce : public Force {
public:
/**
* Create a Amoeba HarmonicAngleForce.
*/
AmoebaHarmonicAngleForce();
/**
* Get the number of harmonic angle stretch terms in the potential function
*/
int getNumAngles() const {
return angles.size();
}
/**
* Set the global cubic term
*
* @param cubicK the cubic harmonic force constant for the angle
*/
void setAmoebaGlobalHarmonicAngleCubic( double cubicK );
/**
* Get the global cubic term
*
* @return global cubicK term
*/
double getAmoebaGlobalHarmonicAngleCubic( void ) const;
/**
* Set the global cubic term
*
* @param quarticK the quartic harmonic force constant for the angle
*/
void setAmoebaGlobalHarmonicAngleQuartic( double quarticK );
/**
* Get the global quartic term
*
* @return global quartic term
*/
double getAmoebaGlobalHarmonicAngleQuartic( void ) const;
/**
* Set the global pentic term
*
* @param penticK the pentic harmonic force constant for the angle
*/
void setAmoebaGlobalHarmonicAnglePentic( double penticK );
/**
* Get the global pentic term
*
* @return global penticK term
*/
double getAmoebaGlobalHarmonicAnglePentic( void ) const;
/**
* Set the global sextic term
*
* @param sexticK the sextic harmonic force constant for the angle
*/
void setAmoebaGlobalHarmonicAngleSextic( double sexticK );
/**
* Get the global sextic term
*
* @return global sextic term
*/
double getAmoebaGlobalHarmonicAngleSextic( void ) const;
/**
* Add a angle term to the force field.
*
* @param particle1 the index of the first particle connected by the angle
* @param particle2 the index of the second particle connected by the angle
* @param particle3 the index of the third particle connected by the angle
* @param length the equilibrium length of the angle, measured in nm
* @param quadratic k the quadratic harmonic force constant for the angle
* @return the index of the angle that was added
*/
int addAngle(int particle1, int particle2, int particle3, double length,
double quadraticK );
/**
* Get the force field parameters for a angle term.
*
* @param index the index of the angle for which to get parameters
* @param particle1 the index of the first particle connected by the angle
* @param particle2 the index of the second particle connected by the angle
* @param particle3 the index of the third particle connected by the angle
* @param length the equilibrium length of the angle, measured in nm
* @param quadratic k the quadratic harmonic force constant for the angle
*/
void getAngleParameters(int index, int& particle1, int& particle2, int& particle3, double& length,
double& quadraticK ) const;
/**
* Set the force field parameters for a angle term.
*
* @param index the index of the angle for which to set parameters
* @param particle1 the index of the first particle connected by the angle
* @param particle2 the index of the second particle connected by the angle
* @param particle3 the index of the third particle connected by the angle
* @param length the equilibrium length of the angle, measured in nm
* @param quadratic k the quadratic harmonic force constant for the angle
*/
void setAngleParameters(int index, int particle1, int particle2, int particle3, double length, double quadraticK );
protected:
ForceImpl* createImpl();
double _globalCubicK, _globalQuarticK, _globalPenticK, _globalSexticK;
private:
class AngleInfo;
// Retarded visual studio compiler complains about being unable to
// export private stl class members.
// This stanza explains that it should temporarily shut up.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4251)
#endif
std::vector<AngleInfo> angles;
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
};
class AmoebaHarmonicAngleForce::AngleInfo {
public:
int particle1, particle2, particle3;
double length, quadraticK;
AngleInfo() {
particle1 = particle2 = particle3 = -1;
length = quadraticK = 0.0;
}
AngleInfo(int particle1, int particle2, int particle3, double length, double quadraticK ) :
particle1(particle1), particle2(particle2), particle3(particle3), length(length), quadraticK(quadraticK) {
}
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_HARMONIC_ANGLE_FORCE_H_*/
#ifndef OPENMM_AMOEBA_HARMONIC_BOND_FORCE_H_
#define OPENMM_AMOEBA_HARMONIC_BOND_FORCE_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: *
* 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 "openmm/Vec3.h"
#include <map>
#include <vector>
#include "openmm/internal/windowsExport.h"
//namespace AmoebaOpenMM {
namespace OpenMM {
/**
* This class implements an interaction between pairs of particles that varies harmonically with the distance
* between them. To use it, create a HarmonicBondForce object then call addBond() once for each bond. After
* a bond has been added, you can modify its force field parameters by calling setBondParameters().
*/
class OPENMM_EXPORT AmoebaHarmonicBondForce : public Force {
public:
/**
* Create a Amoeba HarmonicBondForce.
*/
AmoebaHarmonicBondForce();
/**
* Get the number of harmonic bond stretch terms in the potential function
*/
int getNumBonds() const {
return bonds.size();
}
/**
* Set the global cubic term
*
* @param cubicK the cubic harmonic force constant for the bond
*/
void setAmoebaGlobalHarmonicBondCubic( double cubicK );
/**
* Get the global cubic term
*
* @return global cubicK term
*/
double getAmoebaGlobalHarmonicBondCubic( void ) const;
/**
* Set the global cubic term
*
* @param quarticK the quartic harmonic force constant for the bond
*/
void setAmoebaGlobalHarmonicBondQuartic( double quarticK );
/**
* Get the global quartic term
*
* @return global quartic term
*/
double getAmoebaGlobalHarmonicBondQuartic( void ) const;
/**
* Add a bond term to the force field.
*
* @param particle1 the index of the first particle connected by the bond
* @param particle2 the index of the second particle connected by the bond
* @param length the equilibrium length of the bond, measured in nm
* @param cubic k the cubic harmonic force constant for the bond
* @param quartic k the quartic harmonic force constant for the bond
* @param quadratic k the quadratic harmonic force constant for the bond
* @return the index of the bond that was added
*/
int addBond(int particle1, int particle2, double length, double quadraticK, double cubicK = DEFAULT_GLOBAL_K, double quarticK = DEFAULT_GLOBAL_K );
/**
* Get the force field parameters for a bond term.
*
* @param index the index of the bond for which to get parameters
* @param particle1 the index of the first particle connected by the bond
* @param particle2 the index of the second particle connected by the bond
* @param length the equilibrium length of the bond, measured in nm
* @param quadratic k the quadratic harmonic force constant for the bond
* @param cubic k the cubic harmonic force constant for the bond
* @param quartic k the quartic harmonic force constant for the bond
*/
void getBondParameters(int index, int& particle1, int& particle2, double& length, double& quadraticK, double& cubicK, double& quarticK ) const;
/**
* Set the force field parameters for a bond term.
*
* @param index the index of the bond for which to set parameters
* @param particle1 the index of the first particle connected by the bond
* @param particle2 the index of the second particle connected by the bond
* @param length the equilibrium length of the bond, measured in nm
* @param cubic k the cubic harmonic force constant for the bond
* @param quartic k the quartic harmonic force constant for the bond
* @param quadratic k the quadratic harmonic force constant for the bond
*/
void setBondParameters(int index, int particle1, int particle2, double length, double quadraticK, double cubicK = DEFAULT_GLOBAL_K, double quarticK = DEFAULT_GLOBAL_K);
protected:
double _globalQuarticK, _globalCubicK;
ForceImpl* createImpl();
private:
static const double DEFAULT_GLOBAL_K;
class BondInfo;
// Retarded visual studio compiler complains about being unable to
// export private stl class members.
// This stanza explains that it should temporarily shut up.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4251)
#endif
std::vector<BondInfo> bonds;
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
};
class AmoebaHarmonicBondForce::BondInfo {
public:
int particle1, particle2;
double length, quadraticK, cubicK, quarticK;
BondInfo() {
particle1 = particle2 = -1;
length = quadraticK = 0.0;
cubicK = quarticK = DEFAULT_GLOBAL_K;
}
BondInfo(int particle1, int particle2, double length, double quadraticK, double cubicK, double quarticK) :
particle1(particle1), particle2(particle2), length(length), quadraticK(quadraticK), cubicK(cubicK), quarticK(quarticK) {
}
};
} // namespace AmoebaOpenMM
#endif /*OPENMM_AMOEBA_HARMONIC_BOND_FORCE_H_*/
#ifndef OPENMM_AMOEBA_HARMONIC_IN_PLANE_ANGLE_FORCE_H_
#define OPENMM_AMOEBA_HARMONIC_IN_PLANE_ANGLE_FORCE_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: *
* 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 <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements an interaction between pairs of particles that varies harmonically with the distance
* between them. To use it, create a AmoebaHarmonicInPlaneAngle object then call addAngle() once for each angle. After
* a angle has been added, you can modify its force field parameters by calling setAngleParameters().
*/
class OPENMM_EXPORT AmoebaHarmonicInPlaneAngleForce : public Force {
public:
/**
* Create a Amoeba HarmonicAngleForce.
*/
AmoebaHarmonicInPlaneAngleForce();
/**
* Get the number of harmonic angle stretch terms in the potential function
*/
int getNumAngles() const {
return angles.size();
}
/**
* Set the global cubic term
*
* @param cubicK the cubic harmonic force constant for the angle
*/
void setAmoebaGlobalHarmonicInPlaneAngleCubic( double cubicK );
/**
* Get the global cubic term
*
* @return global cubicK term
*/
double getAmoebaGlobalHarmonicInPlaneAngleCubic( void ) const;
/**
* Set the global cubic term
*
* @param quarticK the quartic harmonic force constant for the angle
*/
void setAmoebaGlobalHarmonicInPlaneAngleQuartic( double quarticK );
/**
* Get the global quartic term
*
* @return global quartic term
*/
double getAmoebaGlobalHarmonicInPlaneAngleQuartic( void ) const;
/**
* Set the global pentic term
*
* @param penticK the pentic harmonic force constant for the angle
*/
void setAmoebaGlobalHarmonicInPlaneAnglePentic( double penticK );
/**
* Get the global pentic term
*
* @return global penticK term
*/
double getAmoebaGlobalHarmonicInPlaneAnglePentic( void ) const;
/**
* Set the global sextic term
*
* @param sexticK the sextic harmonic force constant for the angle
*/
void setAmoebaGlobalHarmonicInPlaneAngleSextic( double sexticK );
/**
* Get the global sextic term
*
* @return global sextic term
*/
double getAmoebaGlobalHarmonicInPlaneAngleSextic( void ) const;
/**
* Add a angle term to the force field.
*
* @param particle1 the index of the first particle connected by the angle
* @param particle2 the index of the second particle connected by the angle
* @param particle3 the index of the third particle connected by the angle
* @param particle4 the index of the fourth particle connected by the angle
* @param length the equilibrium length of the angle, measured in nm
* @param quadratic k the quadratic harmonic force constant for the angle
* @return the index of the angle that was added
*/
int addAngle(int particle1, int particle2, int particle3, int particle4, double length,
double quadraticK );
/**
* Get the force field parameters for a angle term.
*
* @param index the index of the angle for which to get parameters
* @param particle1 the index of the first particle connected by the angle
* @param particle2 the index of the second particle connected by the angle
* @param particle3 the index of the third particle connected by the angle
* @param particle4 the index of the fourth particle connected by the angle
* @param length the equilibrium length of the angle, measured in nm
* @param quadratic k the quadratic harmonic force constant for the angle
*/
void getAngleParameters(int index, int& particle1, int& particle2, int& particle3, int& particle4, double& length,
double& quadraticK ) const;
/**
* Set the force field parameters for a angle term.
*
* @param index the index of the angle for which to set parameters
* @param particle1 the index of the first particle connected by the angle
* @param particle2 the index of the second particle connected by the angle
* @param particle3 the index of the third particle connected by the angle
* @param particle4 the index of the fourth particle connected by the angle
* @param length the equilibrium length of the angle, measured in nm
* @param quadratic k the quadratic harmonic force constant for the angle
*/
void setAngleParameters(int index, int particle1, int particle2, int particle3, int particle4, double length, double quadraticK );
protected:
ForceImpl* createImpl();
double _globalCubicK, _globalQuarticK, _globalPenticK, _globalSexticK;
private:
class AngleInfo;
// Retarded visual studio compiler complains about being unable to
// export private stl class members.
// This stanza explains that it should temporarily shut up.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4251)
#endif
std::vector<AngleInfo> angles;
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
};
class AmoebaHarmonicInPlaneAngleForce::AngleInfo {
public:
int particle1, particle2, particle3, particle4;
double length, quadraticK;
AngleInfo() {
particle1 = particle2 = particle3 = particle4 = -1;
length = quadraticK = 0.0;
}
AngleInfo(int particle1, int particle2, int particle3, int particle4, double length, double quadraticK ) :
particle1(particle1), particle2(particle2), particle3(particle3), particle4(particle4),
length(length), quadraticK(quadraticK) {
}
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_HARMONIC_IN_PLANE_ANGLE_FORCE_H_*/
#ifndef OPENMM_AMOEBA_MULTIPOLE_FORCE_H_
#define OPENMM_AMOEBA_MULTIPOLE_FORCE_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: *
* 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 <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements the Amoeba pi-torsion interaction
* To use it, create a MultipoleForce object then call addMultipole() once for each torsion. After
* a torsion has been added, you can modify its force field parameters by calling setMultipoleParameters().
*/
class OPENMM_EXPORT AmoebaMultipoleForce : public Force {
public:
enum MultipoleAxisTypes { ZThenX, Bisector };
enum MutualInducedIterationMethod { SOR, ConjugateGradient };
enum CovalentType {
Covalent12, Covalent13, Covalent14, Covalent15,
PolarizationCovalent11, PolarizationCovalent12, PolarizationCovalent13, PolarizationCovalent14, CovalentEnd };
static const int CovalentDegrees[8];
/**
* Create a Amoeba MultipoleForce.
*/
AmoebaMultipoleForce();
/**
* Get the number of pi torsion terms in the potential function
*/
int getNumMultipoles() const {
return multipoles.size();
}
/**
* Add multipole-related info for a particle
*
* @param charge the particle's charge
* @param molecularDipole the particle's molecular dipole (vector of size 3)
* @param molecularQuadrupole the particle's molecular quadrupole (vector of size 9)
* @param axisType the particle's axis type ( ZThenX, Bisector )
* @param multipoleAtomId1 index of first atom used in constructing lab<->molecular frames
* @param multipoleAtomId2 index of second atom used in constructing lab<->molecular frames
* @param thole Thole parameter
* @param dampingFactor dampingFactor parameter
* @param polarity polarity parameter
*
* @return the index of the particle that was added
*/
int addParticle( double charge, std::vector<double>& molecularDipole, std::vector<double>& molecularQuadrupole, int axisType,
int multipoleAtomId1, int multipoleAtomId2, double thole, double dampingFactor, double polarity );
/**
* Get the multipole parameters for a particle.
*
* @param index the index of the atom for which to get parameters
* @param charge the particle's charge
* @param molecularDipole the particle's molecular dipole (vector of size 3)
* @param molecularQuadrupole the particle's molecular quadrupole (vector of size 9)
* @param axisType the particle's axis type ( ZThenX, Bisector )
* @param multipoleAtomId1 index of first atom used in constructing lab<->molecular frames
* @param multipoleAtomId2 index of second atom used in constructing lab<->molecular frames
* @param thole Thole parameter
* @param dampingFactor dampingFactor parameter
* @param polarity polarity parameter
*/
void getMultipoleParameters(int index, double& charge, std::vector<double>& molecularDipole, std::vector<double>& molecularQuadrupole,
int& axisType, int& multipoleAtomId1, int& multipoleAtomId2, double& thole, double& dampingFactor, double& polarity ) const;
/**
* Set the multipole parameters for a particle.
*
* @param index the index of the atom for which to set parameters
* @param charge the particle's charge
* @param molecularDipole the particle's molecular dipole (vector of size 3)
* @param molecularQuadrupole the particle's molecular quadrupole (vector of size 9)
* @param axisType the particle's axis type ( ZThenX, Bisector )
* @param multipoleAtomId1 index of first atom used in constructing lab<->molecular frames
* @param multipoleAtomId2 index of second atom used in constructing lab<->molecular frames
* @param polarity polarity parameter
*/
void setMultipoleParameters(int index, double charge, std::vector<double>& molecularDipole, std::vector<double>& molecularQuadrupole,
int axisType, int multipoleAtomId1, int multipoleAtomId2, double thole, double dampingFactor, double polarity);
/**
* Set the CovalentMap for an atom
*
* @param index the index of the atom for which to set parameters
* @param typeId CovalentTypes type
* @param covalentAtoms vector of covalent atoms associated w/ the specfied CovalentType
*/
void setCovalentMap(int index, CovalentType typeId, const std::vector<int>& covalentAtoms );
/**
* Get the CovalentMap for an atom
*
* @param index the index of the atom for which to set parameters
* @param typeId CovalentTypes type
* @param covalentAtoms output vector of covalent atoms associated w/ the specfied CovalentType
*/
void getCovalentMap(int index, CovalentType typeId, std::vector<int>& covalentAtoms ) const;
/**
* Get the CovalentMap for an atom
*
* @param index the index of the atom for which to set parameters
* @param covalentLists output vector of covalent lists of atoms
*/
void getCovalentMaps(int index, std::vector < std::vector<int> >& covalentLists ) const;
/**
* Get the CovalentMap for an atom
*
* @param index the index of the atom for which to set parameters
* @param minCovalentIndex minimum covalent index
* @param maxCovalentIndex maximum covalent index
*/
void getCovalentRange(int index, const std::vector<CovalentType>& lists, int* minCovalentIndex, int* maxCovalentIndex ) const;
/**
* Get the covalent degree for the CovalentEnd lists
*
* @param covalentDegree covalent degrees for the CovalentEnd lists
*/
void getCovalentDegree( std::vector<int>& covalentDegree ) const;
/**
* Get the iteration method to be used for calculating the mutual induced dipoles
*
* @return iteration method to be used for calculating the mutual induced dipole
*/
MutualInducedIterationMethod getMutualInducedIterationMethod( void ) const;
/**
* Set the iteration method to be used for calculating the mutual induced dipoles
*
* @param iteration method to be used for calculating the mutual induced dipole
*/
void setMutualInducedIterationMethod( MutualInducedIterationMethod inputMutualInducedIterationMethod );
/**
* Get the max number of iterations to be used in calculating the mutual induced dipoles
*
* @return max number of iterations
*/
int getMutualInducedMaxIterations( void ) const;
/**
* Set the max number of iterations to be used in calculating the mutual induced dipoles
*
* @param max number of iterations
*/
void setMutualInducedMaxIterations( int inputMutualInducedMaxIterations );
/**
* Get the target epsilon to be used to test for convergence of iterative method used in calculating the mutual induced dipoles
*
* @return target epsilon
*/
double getMutualInducedTargetEpsilon( void ) const;
/**
* Set the target epsilon to be used to test for convergence of iterative method used in calculating the mutual induced dipoles
*
* @param target epsilon
*/
void setMutualInducedTargetEpsilon( double inputMutualInducedTargetEpsilon );
/**
* Get the scaling distance cutoff (nm)
*
* @return scaling distance cutoff
*/
double getScalingDistanceCutoff( void ) const;
/**
* Set the scaling distance cutoff
*
* @param scaling distance cutoff
*/
void setScalingDistanceCutoff( double inputScalingDistanceCutoff );
/**
* Get the electric constant
*
* @return the electric constant
*/
double getElectricConstant( void ) const;
/**
* Set the electric constant
*
* @param the electric constant
*/
void setElectricConstant( double inputElectricConstant );
protected:
ForceImpl* createImpl();
private:
MutualInducedIterationMethod mutualInducedIterationMethod;
int mutualInducedMaxIterations;
double mutualInducedTargetEpsilon;
double scalingDistanceCutoff;
double electricConstant;
class MultipoleInfo;
// Retarded visual studio compiler complains about being unable to
// export private stl class members.
// This stanza explains that it should temporarily shut up.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4251)
#endif
std::vector<MultipoleInfo> multipoles;
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
};
class AmoebaMultipoleForce::MultipoleInfo {
public:
int axisType, multipoleAtomId1, multipoleAtomId2;
double charge, thole, dampingFactor, polarity;
std::vector<double> molecularDipole;
std::vector<double> molecularQuadrupole;
std::vector< std::vector<int> > covalentInfo;
MultipoleInfo() {
axisType = multipoleAtomId1 = multipoleAtomId2 = -1;
charge = thole = dampingFactor = 0.0;
molecularDipole.resize( 3 );
molecularQuadrupole.resize( 9 );
}
MultipoleInfo( double charge, std::vector<double>& inputMolecularDipole, std::vector<double>& inputMolecularQuadrupole,
int axisType, int multipoleAtomId1, int multipoleAtomId2, double thole, double dampingFactor, double polarity) :
charge(charge), axisType(axisType), multipoleAtomId1(multipoleAtomId1), multipoleAtomId2(multipoleAtomId2),
thole(thole), dampingFactor(dampingFactor), polarity(polarity) {
covalentInfo.resize( CovalentEnd );
molecularDipole.resize( 3 );
molecularDipole[0] = inputMolecularDipole[0];
molecularDipole[1] = inputMolecularDipole[1];
molecularDipole[2] = inputMolecularDipole[2];
molecularQuadrupole.resize( 9 );
molecularQuadrupole[0] = inputMolecularQuadrupole[0];
molecularQuadrupole[1] = inputMolecularQuadrupole[1];
molecularQuadrupole[2] = inputMolecularQuadrupole[2];
molecularQuadrupole[3] = inputMolecularQuadrupole[3];
molecularQuadrupole[4] = inputMolecularQuadrupole[4];
molecularQuadrupole[5] = inputMolecularQuadrupole[5];
molecularQuadrupole[6] = inputMolecularQuadrupole[6];
molecularQuadrupole[7] = inputMolecularQuadrupole[7];
molecularQuadrupole[8] = inputMolecularQuadrupole[8];
}
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_MULTIPOLE_FORCE_H_*/
#ifndef AMOEBA_OPENMM_H_
#define AMOEBA_OPENMM_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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) 2009 Stanford University and the Authors. *
* Authors: *
* 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 "AmoebaHarmonicBondForce.h"
#include "AmoebaHarmonicAngleForce.h"
#include "AmoebaHarmonicInPlaneAngleForce.h"
#include "AmoebaTorsionForce.h"
#include "AmoebaPiTorsionForce.h"
#include "AmoebaStretchBendForce.h"
#include "AmoebaOutOfPlaneBendForce.h"
#include "AmoebaTorsionTorsionForce.h"
#include "AmoebaMultipoleForce.h"
#include "AmoebaGeneralizedKirkwoodForce.h"
#include "AmoebaSASAForce.h"
#include "AmoebaVdwForce.h"
#include "AmoebaWcaDispersionForce.h"
#endif /*AMOEBA_OPENMM_H_*/
#ifndef OPENMM_AMOEBA_OUT_OF_PLANE_BEND_FORCE_H_
#define OPENMM_AMOEBA_OUT_OF_PLANE_BEND_FORCE_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: *
* 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 <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements the Amoeba Out-of-plane bend interaction
* To use it, create a OutOfPlaneBendForce object then call addOutOfPlaneBend() once for each outOfPlaneBend. After
* a outOfPlaneBend has been added, you can modify its force field parameters by calling setOutOfPlaneBendParameters().
*/
class OPENMM_EXPORT AmoebaOutOfPlaneBendForce : public Force {
public:
/**
* Create a Amoeba OutOfPlaneBendForce.
*/
AmoebaOutOfPlaneBendForce();
/**
* Get the number of outOfPlaneBend terms in the potential function
*/
int getNumOutOfPlaneBends() const {
return outOfPlaneBends.size();
}
/**
* Set the global cubic term
*
* @param cubicK the cubic harmonic force constant for the angle
*/
void setAmoebaGlobalOutOfPlaneBendCubic( double cubicK );
/**
* Get the global cubic term
*
* @return global cubicK term
*/
double getAmoebaGlobalOutOfPlaneBendCubic( void ) const;
/**
* Set the global cubic term
*
* @param quarticK the quartic harmonic force constant for the angle
*/
void setAmoebaGlobalOutOfPlaneBendQuartic( double quarticK );
/**
* Get the global quartic term
*
* @return global quartic term
*/
double getAmoebaGlobalOutOfPlaneBendQuartic( void ) const;
/**
* Set the global pentic term
*
* @param penticK the pentic harmonic force constant for the angle
*/
void setAmoebaGlobalOutOfPlaneBendPentic( double penticK );
/**
* Get the global pentic term
*
* @return global penticK term
*/
double getAmoebaGlobalOutOfPlaneBendPentic( void ) const;
/**
* Set the global sextic term
*
* @param sexticK the sextic harmonic force constant for the angle
*/
void setAmoebaGlobalOutOfPlaneBendSextic( double sexticK );
/**
* Get the global sextic term
*
* @return global sexticK term
*/
double getAmoebaGlobalOutOfPlaneBendSextic( void ) const;
/**
* Add a outOfPlaneBend term to the force field.
*
* @param particle1 the index of the first particle connected by the outOfPlaneBend
* @param particle2 the index of the second particle connected by the outOfPlaneBend
* @param particle3 the index of the third particle connected by the outOfPlaneBend
* @param particle4 the index of the fourth particle connected by the outOfPlaneBend
* @param k the force constant for the outOfPlaneBend
* @return the index of the outOfPlaneBend that was added
*/
int addOutOfPlaneBend(int particle1, int particle2, int particle3, int particle4, double k );
/**
* Get the force field parameters for a outOfPlaneBend term.
*
* @param index the index of the outOfPlaneBend for which to get parameters
* @param particle1 the index of the first particle connected by the outOfPlaneBend
* @param particle2 the index of the second particle connected by the outOfPlaneBend
* @param particle3 the index of the third particle connected by the outOfPlaneBend
* @param particle4 the index of the fourth particle connected by the outOfPlaneBend
* @param k the force constant for the outOfPlaneBend
*/
void getOutOfPlaneBendParameters(int index, int& particle1, int& particle2, int& particle3, int& particle4, double& k ) const;
/**
* Set the force field parameters for a outOfPlaneBend term.
*
* @param index the index of the outOfPlaneBend for which to set parameters
* @param particle1 the index of the first particle connected by the outOfPlaneBend
* @param particle2 the index of the second particle connected by the outOfPlaneBend
* @param particle3 the index of the third particle connected by the outOfPlaneBend
* @param particle4 the index of the fourth particle connected by the outOfPlaneBend
* @param k the force constant for the outOfPlaneBend
*/
void setOutOfPlaneBendParameters(int index, int particle1, int particle2, int particle3, int particle4, double k );
protected:
ForceImpl* createImpl();
double _globalCubicK, _globalQuarticK, _globalPenticK, _globalSexticK;
private:
class OutOfPlaneBendInfo;
// Retarded visual studio compiler complains about being unable to
// export private stl class members.
// This stanza explains that it should temporarily shut up.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4251)
#endif
std::vector<OutOfPlaneBendInfo> outOfPlaneBends;
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
};
class AmoebaOutOfPlaneBendForce::OutOfPlaneBendInfo {
public:
int particle1, particle2, particle3, particle4;
double k;
OutOfPlaneBendInfo() {
particle1 = particle2 = particle3 = particle4 = -1;
k = 0.0;
}
OutOfPlaneBendInfo(int particle1, int particle2, int particle3, int particle4,
double k ) :
particle1(particle1), particle2(particle2), particle3(particle3), particle4(particle4), k(k) {
}
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_OUT_OF_PLANE_BEND_FORCE_H_*/
#ifndef OPENMM_AMOEBA_PI_TORSION_FORCE_H_
#define OPENMM_AMOEBA_PI_TORSION_FORCE_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: *
* 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 "openmm/Vec3.h"
#include <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements the Amoeba pi-torsion interaction
* To use it, create a PiTorsionForce object then call addPiTorsion() once for each torsion. After
* a torsion has been added, you can modify its force field parameters by calling setPiTorsionParameters().
*/
class OPENMM_EXPORT AmoebaPiTorsionForce : public Force {
public:
/**
* Create a Amoeba PiTorsionForce.
*/
AmoebaPiTorsionForce();
/**
* Get the number of pi torsion terms in the potential function
*/
int getNumPiTorsions() const {
return piTorsions.size();
}
/**
* Add a torsion term to the force field.
*
* @param particle1 the index of the first particle connected by the torsion
* @param particle2 the index of the second particle connected by the torsion
* @param particle3 the index of the third particle connected by the torsion
* @param particle4 the index of the fourth particle connected by the torsion
* @param particle5 the index of the fifth particle connected by the torsion
* @param particle6 the index of the sixth particle connected by the torsion
* @param k the force constant for the torsion
* @return the index of the torsion that was added
*/
int addPiTorsion(int particle1, int particle2, int particle3, int particle4, int particle5, int particle6, double k );
/**
* Get the force field parameters for a torsion term.
*
* @param index the index of the torsion for which to get parameters
* @param particle1 the index of the first particle connected by the torsion
* @param particle2 the index of the second particle connected by the torsion
* @param particle3 the index of the third particle connected by the torsion
* @param particle4 the index of the fourth particle connected by the torsion
* @param particle5 the index of the fifth particle connected by the torsion
* @param particle6 the index of the sixth particle connected by the torsion
* @param k the force constant for the torsion
*/
void getPiTorsionParameters(int index, int& particle1, int& particle2, int& particle3, int& particle4, int& particle5, int& particle6, double& k ) const;
/**
* Set the force field parameters for a pi torsion term.
*
* @param index the index of the torsion for which to set parameters
* @param particle1 the index of the first particle connected by the torsion
* @param particle2 the index of the second particle connected by the torsion
* @param particle3 the index of the third particle connected by the torsion
* @param particle4 the index of the fourth particle connected by the torsion
* @param particle5 the index of the fifth particle connected by the torsion
* @param particle6 the index of the sixth particle connected by the torsion
* @param k the force constant for the torsion
*/
void setPiTorsionParameters(int index, int particle1, int particle2, int particle3, int particle4, int particle5, int particle6, double k );
protected:
ForceImpl* createImpl();
private:
class PiTorsionInfo;
// Retarded visual studio compiler complains about being unable to
// export private stl class members.
// This stanza explains that it should temporarily shut up.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4251)
#endif
std::vector<PiTorsionInfo> piTorsions;
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
};
class AmoebaPiTorsionForce::PiTorsionInfo {
public:
int particle1, particle2, particle3, particle4, particle5, particle6;
double k;
PiTorsionInfo() {
particle1 = particle2 = particle3 = particle4 = particle5 = particle6 = -1;
k = 0.0;
}
PiTorsionInfo(int particle1, int particle2, int particle3, int particle4, int particle5, int particle6, double k ) :
particle1(particle1), particle2(particle2), particle3(particle3), particle4(particle4), particle5(particle5), particle6(particle6), k(k) {
}
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_PI_TORSION_FORCE_H_*/
#ifndef AMOEBA_OPENMM_SASA_FORCE_FIELD_H_
#define AMOEBA_OPENMM_SASA_FORCE_FIELD_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: 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 <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements an SASA force
* by performing an analytical computation of the weighted
* solvent accessible surface area of each atom and the first
* derivatives of the area with respect to Cartesian coordinates
*
* Literature references:
*
* T. J. Richmond, "Solvent Accessible Surface Area and
* Excluded Volume in Proteins", Journal of Molecular Biology,
* 178, 63-89 (1984)
*
* L. Wesson and D. Eisenberg, "Atomic Solvation Parameters
* Applied to Molecular Dynamics of Proteins in Solution",
* Protein Science, 1, 227-235 (1992)
*
* <p>
* To use this class, create a AmoebaSASAForce object, then call addParticle() once for each particle in the
* System to define its parameters. The number of particles for which you define SASA parameters must
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* try to create a Context. After a particle has been added, you can modify its force field parameters
* by calling setParticleParameters().
*/
class OPENMM_EXPORT AmoebaSASAForce : public Force {
public:
/*
* Create a AmoebaSASAForce.
*/
AmoebaSASAForce();
/**
* Get the number of particles in the system.
*/
int getNumParticles() const {
return particles.size();
}
/**
* Add the SASA parameters for a particle. This should be called once for each particle
* in the System. When it is called for the i'th time, it specifies the parameters for the i'th particle.
*
* @param radius the radius of the particle, measured in nm
* @param weight the sasa weight (Tinker asolv())
* @return the index of the particle that was added
*/
int addParticle(double radius, double weight);
/**
* Get the force field parameters for a particle.
*
* @param index the index of the particle for which to get parameters
* @param radius the radius of the particle, measured in nm
* @param weight the sasa weight(Tinker asolv())
*/
void getParticleParameters(int index, double& radius, double& weight) const;
/**
* Set the force field parameters for a particle.
*
* @param index the index of the particle for which to set parameters
* @param radius the radius of the particle, measured in nm
* @param weight the sasa weight(Tinker asolv())
*/
void setParticleParameters(int index, double radius, double weight);
/**
* Get the probe radius
*/
double getProbeRadius() const;
/**
* Set the probe radius
*/
void setProbeRadius(double distance);
protected:
ForceImpl* createImpl();
private:
class ParticleInfo;
double probeRadius;
std::vector<ParticleInfo> particles;
};
class AmoebaSASAForce::ParticleInfo {
public:
double radius, weight;
ParticleInfo() {
radius = weight = 0.0;
}
ParticleInfo(double radius, double weight) :
radius(radius), weight(weight) {
}
};
} // namespace OpenMM
#endif /*AMOEBA_OPENMM_GBSA_OBC_FORCE_FIELD_H_*/
#ifndef OPENMM_AMOEBA_STRETCH_BEND_FORCE_H_
#define OPENMM_AMOEBA_STRETCH_BEND_FORCE_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: *
* 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 <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements the Amoeba stretch bend interaction
* To use it, create a StretchBendForce object then call addStretchBend() once for each stretchBend. After
* a stretchBend has been added, you can modify its force field parameters by calling setStretchBendParameters().
*/
class OPENMM_EXPORT AmoebaStretchBendForce : public Force {
public:
/**
* Create a Amoeba StretchBendForce.
*/
AmoebaStretchBendForce();
/**
* Get the number of stretchBend terms in the potential function
*/
int getNumStretchBends() const {
return stretchBends.size();
}
/**
* Add a stretchBend term to the force field.
*
* @param particle1 the index of the first particle connected by the stretchBend
* @param particle2 the index of the second particle connected by the stretchBend
* @param particle3 the index of the third particle connected by the stretchBend
* @param lengthAB the equilibrium length of the stretchBend in bond ab [particle1, particle2], measured in nm
* @param lengthCB the equilibrium length of the stretchBend in bond cb [particle3, particle2], measured in nm
* @param angle the equilibrium angle in radians
* @param k the force constant for the stretchBend
* @return the index of the stretchBend that was added
*/
int addStretchBend(int particle1, int particle2, int particle3, double lengthAB, double lengthCB, double angle,
double k );
/**
* Get the force field parameters for a stretchBend term.
*
* @param index the index of the stretchBend for which to get parameters
* @param particle1 the index of the first particle connected by the stretchBend
* @param particle2 the index of the second particle connected by the stretchBend
* @param particle3 the index of the third particle connected by the stretchBend
* @param lengthAB the equilibrium length of the stretchBend in bond ab [particle1, particle2], measured in nm
* @param lengthCB the equilibrium length of the stretchBend in bond cb [particle3, particle2], measured in nm
* @param angle the equilibrium angle in radians
* @param k the force constant for the stretchBend
*/
void getStretchBendParameters(int index, int& particle1, int& particle2, int& particle3,
double& lengthAB, double& lengthCB, double& angle, double& k ) const;
/**
* Set the force field parameters for a stretchBend term.
*
* @param index the index of the stretchBend for which to set parameters
* @param particle1 the index of the first particle connected by the stretchBend
* @param particle2 the index of the second particle connected by the stretchBend
* @param particle3 the index of the third particle connected by the stretchBend
* @param lengthAB the equilibrium length of the stretchBend in bond ab [particle1, particle2], measured in nm
* @param lengthCB the equilibrium length of the stretchBend in bond cb [particle3, particle2], measured in nm
* @param angle the equilibrium angle in radians
* @param k the force constant for the stretchBend
*/
void setStretchBendParameters(int index, int particle1, int particle2, int particle3,
double lengthAB, double lengthCB, double angle, double k );
protected:
ForceImpl* createImpl();
private:
class StretchBendInfo;
// Retarded visual studio compiler complains about being unable to
// export private stl class members.
// This stanza explains that it should temporarily shut up.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4251)
#endif
std::vector<StretchBendInfo> stretchBends;
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
};
class AmoebaStretchBendForce::StretchBendInfo {
public:
int particle1, particle2, particle3;
double lengthAB, lengthCB, angle, k;
StretchBendInfo() {
particle1 = particle2 = particle3 = -1;
lengthAB = lengthCB = angle = k = 0.0;
}
StretchBendInfo(int particle1, int particle2, int particle3,
double lengthAB, double lengthCB, double angle, double k ) :
particle1(particle1), particle2(particle2), particle3(particle3),
lengthAB(lengthAB), lengthCB(lengthCB), angle(angle), k(k) {
}
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_STRETCH_BEND_FORCE_H_*/
#ifndef OPENMM_AMOEBA_TORSION_FORCE_H_
#define OPENMM_AMOEBA_TORSION_FORCE_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: *
* 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 "openmm/OpenMMException.h"
#include <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements an torsion interaction among four particles.
* To use it, create a TorsionForce object then call addTorsion() once for each angle. After
* a angle has been added, you can modify its force field parameters by calling setTorsionParameters().
*/
class OPENMM_EXPORT AmoebaTorsionForce : public Force {
public:
static const unsigned int ParametersPerTorsion = 2;
/**
* Create a Amoeba TorsionForce.
*/
AmoebaTorsionForce();
/**
* Get the number of torsion terms in the potential function
*/
int getNumTorsions() const {
return torsions.size();
}
/**
* Add a torsion term to the force field.
*
* @param particle1 the index of the first particle connected by the torsion
* @param particle2 the index of the second particle connected by the torsion
* @param particle3 the index of the third particle connected by the torsion
* @param particle4 the index of the fourth particle connected by the torsion
* @param torsion1 the vector of torsion params for first index (amplitude, phase, fold)
* @param torsion2 the vector of torsion params for second index (amplitude, phase, fold)
* @param torsion3 the vector of torsion params for third index (amplitude, phase, fold)
* @return the index of the torsion that was added
*/
int addTorsion(int particle1, int particle2, int particle3, int particle4,
std::vector<double> torsion1, std::vector<double> torsion2, std::vector<double> torsion3 );
/**
* Get the force field parameters for a torsion term.
*
* @param index the index of the torsion for which to get parameters
* @param particle1 the index of the first particle connected by the torsion
* @param particle2 the index of the second particle connected by the torsion
* @param particle3 the index of the third particle connected by the torsion
* @param particle4 the index of the fourth particle connected by the torsion
* @param torsion1 the vector of torsion params for first index (amplitude, phase, fold)
* @param torsion2 the vector of torsion params for second index (amplitude, phase, fold)
* @param torsion3 the vector of torsion params for third index (amplitude, phase, fold)
*/
void getTorsionParameters(int index, int& particle1, int& particle2, int& particle3, int& particle4,
std::vector<double>& torsion1, std::vector<double>& torsion2, std::vector<double>& torsion3 ) const;
/**
* Set the force field parameters for a torsion term.
*
* @param index the index of the torsion for which to set parameters
* @param particle1 the index of the first particle connected by the torsion
* @param particle2 the index of the second particle connected by the torsion
* @param particle3 the index of the third particle connected by the torsion
* @param particle4 the index of the fourth particle connected by the torsion
* @param torsion1 the vector of torsion params for first index (amplitude, phase, fold)
* @param torsion2 the vector of torsion params for second index (amplitude, phase, fold)
* @param torsion3 the vector of torsion params for third index (amplitude, phase, fold)
*/
void setTorsionParameters(int index, int particle1, int particle2, int particle3, int particle4,
std::vector<double> torsion1, std::vector<double> torsion2, std::vector<double> torsion3 );
protected:
ForceImpl* createImpl();
private:
class TorsionInfo;
// Retarded visual studio compiler complains about being unable to
// export private stl class members.
// This stanza explains that it should temporarily shut up.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4251)
#endif
std::vector<TorsionInfo> torsions;
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
};
class AmoebaTorsionForce::TorsionInfo {
private:
// max number of torsion sets of parameters; in current amoebapro.prm max is 3
// but code goes up to 6
static const unsigned int maxTorsions = 3;
void _initialize() {
torsionParameters.resize( maxTorsions );
for( unsigned int ii = 0; ii < torsionParameters.size(); ii++ ){
torsionParameters[ii].resize( AmoebaTorsionForce::ParametersPerTorsion );
for( unsigned int jj = 0; jj < AmoebaTorsionForce::ParametersPerTorsion; jj++ ){
torsionParameters[ii][jj] = 0.0;
}
}
}
public:
int particle1, particle2, particle3, particle4;
std::vector< std::vector<double> > torsionParameters;
TorsionInfo() {
particle1 = particle2 = particle3 = particle4 = -1;
_initialize();
}
TorsionInfo(int particle1, int particle2, int particle3, int particle4, std::vector<double>& torsion1, std::vector<double>& torsion2, std::vector<double>& torsion3 ) :
particle1(particle1), particle2(particle2), particle3(particle3), particle4(particle4) {
if( torsion1.size() != AmoebaTorsionForce::ParametersPerTorsion ){
char buffer[1024];
(void) sprintf( buffer, "TorsionInfo::TorsionInfo: torsion1 size(=%u) is not %d!", torsion1.size(), AmoebaTorsionForce::ParametersPerTorsion);
throw OpenMMException( buffer );
}
if( torsion2.size() != AmoebaTorsionForce::ParametersPerTorsion ){
char buffer[1024];
(void) sprintf( buffer, "TorsionInfo::TorsionInfo: torsion2 size(=%u) is not %d!", torsion2.size(), AmoebaTorsionForce::ParametersPerTorsion);
throw OpenMMException( buffer );
}
if( torsion3.size() != AmoebaTorsionForce::ParametersPerTorsion ){
char buffer[1024];
(void) sprintf( buffer, "TorsionInfo::TorsionInfo: torsion3 size(=%u) is not %d!", torsion3.size(), AmoebaTorsionForce::ParametersPerTorsion);
throw OpenMMException( buffer );
}
_initialize();
for( unsigned int ii = 0; ii < AmoebaTorsionForce::ParametersPerTorsion; ii++ ){
torsionParameters[0][ii] = torsion1[ii];
torsionParameters[1][ii] = torsion2[ii];
torsionParameters[2][ii] = torsion3[ii];
}
}
int copyTorsionParameter(int index, std::vector<double>& torsionParameter ) {
if( torsionParameter.size() != AmoebaTorsionForce::ParametersPerTorsion ){
char buffer[1024];
(void) sprintf( buffer, "TorsionInfo::copyTorsionParameter: input torsionParameter size(=%u) is not %d!", torsionParameter.size(), AmoebaTorsionForce::ParametersPerTorsion);
throw OpenMMException( buffer );
}
if( index >= 0 && index < maxTorsions ){
for( unsigned int ii = 0; ii < AmoebaTorsionForce::ParametersPerTorsion; ii++ ){
torsionParameters[index][ii] = torsionParameter[ii];
}
} else {
char buffer[1024];
(void) sprintf( buffer, "TorsionInfo::copyTorsionParameter: input torsionParameter index(=%u) is not in range [0,%u)!", index, maxTorsions );
throw OpenMMException( buffer );
}
}
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_TORSION_FORCE_H_*/
#ifndef OPENMM_AMOEBA_TORSION_TORSION_FORCE_H_
#define OPENMM_AMOEBA_TORSION_TORSION_FORCE_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: *
* 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 <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
typedef std::vector< std::vector< std::vector<double> > > TorsionTorsionGrid;
/**
* This class implements the Amoeba Out-of-plane bend interaction
* To use it, create a TorsionTorsionForce object then call addTorsionTorsion() once for each torsionTorsion. After
* a torsionTorsion has been added, you can modify its force field parameters by calling setTorsionTorsionParameters().
*/
class OPENMM_EXPORT AmoebaTorsionTorsionForce : public Force {
public:
/**
* Create a Amoeba TorsionTorsionForce.
*/
AmoebaTorsionTorsionForce();
/**
* Get the number of torsionTorsion terms in the potential function
*/
int getNumTorsionTorsions() const {
return torsionTorsions.size();
}
/**
* Get the number of torsionTorsion grids
*/
int getNumTorsionTorsionGrids() const {
return torsionTorsionGrids.size();
}
/**
* Add a torsionTorsion term to the force field.
*
* @param particle1 the index of the first particle connected by the torsionTorsion
* @param particle2 the index of the second particle connected by the torsionTorsion
* @param particle3 the index of the third particle connected by the torsionTorsion
* @param particle4 the index of the fourth particle connected by the torsionTorsion
* @param particle5 the index of the fifth particle connected by the torsionTorsion
* @param chiralCheckAtomIndex the index of the particle connected to particle3, but not particle2 or particle4 to be used in chirality check
* @param gridIndex the grid index
* @return the index of the torsionTorsion that was added
*/
int addTorsionTorsion(int particle1, int particle2, int particle3, int particle4, int particle5, int chiralCheckAtomIndex, int gridIndex );
/**
* Get the force field parameters for a torsionTorsion term.
*
* @param index the index of the torsionTorsion for which to get parameters
* @param particle1 the index of the first particle connected by the torsionTorsion
* @param particle2 the index of the second particle connected by the torsionTorsion
* @param particle3 the index of the third particle connected by the torsionTorsion
* @param particle4 the index of the fourth particle connected by the torsionTorsion
* @param particle5 the index of the fifth particle connected by the torsionTorsion
* @param chiralCheckAtomIndex the index of the particle connected to particle3, but not particle2 or particle4 to be used in chirality check
* @param gridIndex the grid index
*/
void getTorsionTorsionParameters(int index, int& particle1, int& particle2, int& particle3, int& particle4, int& particle5, int& chiralCheckAtomIndex, int& gridIndex ) const;
/**
* Set the force field parameters for a torsionTorsion term.
*
* @param index the index of the torsionTorsion for which to set parameters
* @param particle1 the index of the first particle connected by the torsionTorsion
* @param particle2 the index of the second particle connected by the torsionTorsion
* @param particle3 the index of the third particle connected by the torsionTorsion
* @param particle4 the index of the fourth particle connected by the torsionTorsion
* @param particle5 the index of the fifth particle connected by the torsionTorsion
* @param chiralCheckAtomIndex the index of the particle connected to particle3, but not particle2 or particle4 to be used in chirality check
* @param gridIndex the grid index
*/
void setTorsionTorsionParameters(int index, int particle1, int particle2, int particle3, int particle4, int particle5, int chiralCheckAtomIndex, int gridIndex );
/**
* Get the torsion-torsion grid at the specified index
*
* @param gridIndex the grid index
* @param grid the grid
*/
void getTorsionTorsionGrid(int index, TorsionTorsionGrid& grid ) const;
/**
* Set the torsion-torsion grid at the specified index
*
* @param index the index of the torsionTorsion for which to get parameters
* @param grid grid
* grid[x][y][0] = x value
* grid[x][y][1] = y value
* grid[x][y][2] = function value
* grid[x][y][3] = dfdx value
* grid[x][y][4] = dfdy value
* grid[x][y][5] = dfd(xy) value
*/
void setTorsionTorsionGrid(int index, TorsionTorsionGrid& grid );
protected:
ForceImpl* createImpl();
private:
class TorsionTorsionInfo;
// Retarded visual studio compiler complains about being unable to
// export private stl class members.
// This stanza explains that it should temporarily shut up.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4251)
#endif
std::vector<TorsionTorsionInfo> torsionTorsions;
std::vector<TorsionTorsionGrid> torsionTorsionGrids;
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
};
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) {
}
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_TORSION_TORSION_FORCE_H_*/
#ifndef OPENMM_AMOEBA_VDW_FORCE_H_
#define OPENMM_AMOEBA_VDW_FORCE_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: *
* 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 <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements an interaction between pairs of particles that varies harmonically with the distance
* between them. To use it, create a VdwForce object then call addAngle() once for each angle. After
* a angle has been added, you can modify its force field parameters by calling setAngleParameters().
*/
class OPENMM_EXPORT AmoebaVdwForce : public Force {
public:
/**
* Create a Amoeba VdwForce.
*/
AmoebaVdwForce();
/**
* Get the number of particles
*/
int getNumParticles() const {
return parameters.size();
}
/**
* Set table size
*
* @param tableSize table size
*/
void setSigEpsTableSize( int tableSize );
/**
* Get the SigEps table size
*
* @return the table size
*/
int getSigEpsTableSize( void ) const;
/**
* Set a entry to sigma/epsilon table.
*
* @param indexI row index of table
* @param indexJ column index of table
* @param sigma sigma entry
* @param epsilon epsilon entry
* @param sigma4 sigma4 entry
* @param epsilon4 epsilon4 entry
*/
void setSigEpsTableEntry(int indexI, int indexJ, double sigma, double epsilon,
double sigma4, double epsilon4 );
/**
* Get a entry to sigma/epsilon table.
*
* @param indexI row index of table
* @param indexJ column index of table
* @param sigma sigma entry
* @param epsilon epsilon entry
* @param sigma4 sigma4 entry
* @param epsilon4 epsilon4 entry
*/
void getSigEpsTableEntry(int indexI, int indexJ, double& sigma, double& epsilon,
double& sigma4, double& epsilon4 ) const;
/**
* Set the force field parameters for a vdw particle.
*
* @param particleIndex the particle index
* @param ivIndex the iv index
* @param classIndex the class index into the sig-eps table
* @param sigma vdw sigma
* @param sigma4 1-4 vdw sigma
* @param epsilon vdw epsilon
* @param epsilon4 1-4 vdw epsilon
* @param reductionFactor the reduction factor for 1-4 ixns
*/
void setParticleParameters(int particleIndex, int ivIndex, int classIndex,
double sigma, double sigma4, double epsilon, double epsilon4, double reductionFactor );
/**
* Get the force field parameters for a vdw particle.
*
* @param particleIndex the particle index
* @param ivIndex the iv index
* @param classIndex the class index into the sig-eps table
* @param sigma vdw sigma
* @param sigma4 1-4 vdw sigma
* @param epsilon vdw epsilon
* @param epsilon4 1-4 vdw epsilon
* @param reductionFactor the reduction factor for 1-4 ixns
*/
void getParticleParameters(int particleIndex, int& ivIndex, int& classIndex,
double& sigma, double& sigma4, double& epsilon, double& epsilon4, double& reductionFactor ) const;
/**
* Set the force field parameters for a vdw particle.
*
* @param particleIndex the particle index
* @param ivIndex the iv index
* @param classIndex the class index into the sig-eps table
* @param sigma vdw sigma
* @param sigma4 1-4 vdw sigma
* @param epsilon vdw epsilon
* @param epsilon4 1-4 vdw epsilon
* @param reductionFactor the reduction factor for 1-4 ixns
* @return index of added particle
*/
int addParticle(int ivIndex, int classIndex,
double sigma, double sigma4, double epsilon, double epsilon4, double reductionFactor );
/**
* Set sigma combining rule
*
* @param sigmaCombiningRule sigma combining rule: 'ARITHMETIC', 'GEOMETRIC'. 'CUBIC-MEAN'
*/
void setSigmaCombiningRule( std::string& sigmaCombiningRule );
/**
* Get sigma combining rule
*
* @return sigmaCombiningRule sigma combining rule: 'ARITHMETIC', 'GEOMETRIC'. 'CUBIC-MEAN'
*/
std::string getSigmaCombiningRule( void ) const;
/**
* Set epsilon combining rule
*
* @param epsilonCombiningRule epsilon combining rule: 'ARITHMETIC', 'GEOMETRIC'. 'CUBIC-MEAN'
*/
void setEpsilonCombiningRule( std::string& epsilonCombiningRule );
/**
* Get epsilon combining rule
*
* @return epsilonCombiningRule epsilon combining rule: 'ARITHMETIC', 'GEOMETRIC'. 'HARMONIC', 'HHG'
*/
std::string getEpsilonCombiningRule( void ) const;
/**
* Set exclusions for specified particle
*
* @param particleIndex particle index
* @param exclusions output vector of exclusions
*/
void setParticleExclusions( int particleIndex, std::vector< int >& exclusions );
/**
* Get exclusions for specified particle
*
* @param particleIndex particle index
* @param exclusions output vector of exclusions
*/
void getParticleExclusions( int particleIndex, std::vector< int >& exclusions ) const;
protected:
ForceImpl* createImpl();
private:
class VdwInfo;
std::string sigmaCombiningRule;
std::string epsilonCombiningRule;
std::vector< std::vector<int> > exclusions;
// Retarded visual studio compiler complains about being unable to
// export private stl class members.
// This stanza explains that it should temporarily shut up.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4251)
#endif
std::vector<VdwInfo> parameters;
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
std::vector< std::vector< std::vector<double> > > sigEpsTable;
};
class AmoebaVdwForce::VdwInfo {
public:
int ivIndex, classIndex;
double reductionFactor, sigma, sigma4, epsilon, epsilon4;
VdwInfo() {
ivIndex = classIndex = -1;
reductionFactor = 0.0;
sigma = 1.0;
sigma4 = 1.0;
epsilon = 0.0;
epsilon4 = 0.0;
}
VdwInfo(int ivIndex, int classIndex, double sigma, double sigma4, double epsilon, double epsilon4, double reductionFactor ) :
ivIndex(ivIndex), classIndex(classIndex), sigma(sigma), sigma4(sigma4), epsilon(epsilon), epsilon4(epsilon4), reductionFactor(reductionFactor) {
}
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_VDW_FORCE_H_*/
#ifndef OPENMM_AMOEBA_WCA_DISPERSION_FORCE_H_
#define OPENMM_AMOEBA_WCA_DISPERSION_FORCE_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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-2009 Stanford University and the Authors. *
* Authors: *
* 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 <vector>
#include "openmm/internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements an interaction between pairs of particles that varies harmonically with the distance
* between them. To use it, create a WcaDispersionForce object then call addAngle() once for each angle. After
* a angle has been added, you can modify its force field parameters by calling setAngleParameters().
*/
class OPENMM_EXPORT AmoebaWcaDispersionForce : public Force {
public:
/**
* Create a Amoeba WcaDispersionForce.
*/
AmoebaWcaDispersionForce();
/**
* Get the number of particles
*/
int getNumParticles() const {
return parameters.size();
}
/**
* Set the force field parameters for a wca dispersion particle.
*
* @param particleIndex the particle index
* @param radius radius
* @param epsilon epsilon
*/
void setParticleParameters(int particleIndex, double radius, double epsilon );
/**
* Get the force field parameters for a wca dispersion particle.
*
* @param particleIndex the particle index
* @param radius radius
* @param epsilon epsilon
*/
void getParticleParameters(int particleIndex, double& radius, double& epsilon) const;
/**
* Set the force field parameters for a wca dispersion particle.
*
* @param radius radius
* @param epsilon epsilon
* @return index of added particle
*/
int addParticle( double radius, double epsilon );
/**
* Get the maximum dispersion energy for a particle
*
* @param particleIndex the particle index
* @param maxDispersionEnergy maximum dispersion energy
*/
void getMaximumDispersionEnergy(int particleIndex, double& maxDispersionEnergy ) const;
/**
* Get the total maximum dispersion energy
*
* @return total maximum dispersion energy for the system
*/
double getTotalMaximumDispersionEnergy( void ) const;
/*
* Constants
*/
double getEpso( void ) const;
double getEpsh( void ) const;
double getRmino( void ) const;
double getRminh( void ) const;
double getAwater( void ) const;
double getShctd( void ) const;
double getDispoff( void ) const;
double getSlevy( void ) const;
void setEpso( double inputValue );
void setEpsh( double inputValue );
void setRmino( double inputValue );
void setRminh( double inputValue );
void setAwater( double inputValue );
void setShctd( double inputValue );
void setDispoff( double inputValue );
void setSlevy( double inputValue );
protected:
ForceImpl* createImpl();
private:
class WcaDispersionInfo;
double epso;
double epsh;
double rmino;
double rminh;
double awater;
double slevy;
double shctd;
double dispoff;
// Retarded visual studio compiler complains about being unable to
// export private stl class members.
// This stanza explains that it should temporarily shut up.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4251)
#endif
std::vector<WcaDispersionInfo> parameters;
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
};
class AmoebaWcaDispersionForce::WcaDispersionInfo {
public:
double radius, epsilon;
WcaDispersionInfo() {
radius = 1.0;
epsilon = 0.0;
}
WcaDispersionInfo( double radius, double epsilon ) : radius(radius), epsilon(epsilon) {
}
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_WCA_DISPERSION_FORCE_H_*/
#ifndef AMOEBA_OPENMM_KERNELS_H_
#define AMOEBA_OPENMM_KERNELS_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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 Stanford University and the Authors. *
* Authors: *
* 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 "AmoebaOpenMM.h"
#include "openmm/KernelImpl.h"
#include "openmm/System.h"
#include "openmm/Platform.h"
#include <set>
#include <string>
#include <vector>
namespace OpenMM {
/**
* This kernel is invoked by AmoebaHarmonicBondForce to calculate the forces acting on the system and the energy of the system.
*/
class CalcAmoebaHarmonicBondForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaHarmonicBondForce";
}
CalcAmoebaHarmonicBondForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the AmoebaHarmonicBondForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaHarmonicBondForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the HarmonicBondForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
* This kernel is invoked by AmoebaHarmonicAngleForce to calculate the forces acting on the system and the energy of the system.
*/
class CalcAmoebaHarmonicAngleForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaHarmonicAngleForce";
}
CalcAmoebaHarmonicAngleForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the HarmonicAngleForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaHarmonicAngleForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the HarmonicAngleForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
* This kernel is invoked by AmoebaHarmonicInPlaneAngleForce to calculate the forces acting on the system and the energy of the system.
*/
class CalcAmoebaHarmonicInPlaneAngleForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaHarmonicInPlaneAngleForce";
}
CalcAmoebaHarmonicInPlaneAngleForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the HarmonicInPlaneAngleForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaHarmonicInPlaneAngleForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the HarmonicInPlaneAngleForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
* This kernel is invoked by AmoebaTorsionForce to calculate the forces acting on the system and the energy of the system.
*/
class CalcAmoebaTorsionForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaTorsionForce";
}
CalcAmoebaTorsionForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the TorsionForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaTorsionForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the TorsionForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
* This kernel is invoked by AmoebaTorsionForce to calculate the forces acting on the system and the energy of the system.
*/
class CalcAmoebaPiTorsionForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaPiTorsionForce";
}
CalcAmoebaPiTorsionForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the PiTorsionForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaPiTorsionForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the PiTorsionForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
* This kernel is invoked by AmoebaTorsionForce to calculate the forces acting on the system and the energy of the system.
*/
class CalcAmoebaStretchBendForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaStretchBendForce";
}
CalcAmoebaStretchBendForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the StretchBendForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaStretchBendForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the StretchBendForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
* This kernel is invoked by AmoebaTorsionForce to calculate the forces acting on the system and the energy of the system.
*/
class CalcAmoebaOutOfPlaneBendForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaOutOfPlaneBendForce";
}
CalcAmoebaOutOfPlaneBendForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the OutOfPlaneBendForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaOutOfPlaneBendForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the OutOfPlaneBendForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
* This kernel is invoked by AmoebaTorsionTorsionForce to calculate the forces acting on the system and the energy of the system.
*/
class CalcAmoebaTorsionTorsionForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaTorsionTorsionForce";
}
CalcAmoebaTorsionTorsionForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the TorsionTorsionForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaTorsionTorsionForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the TorsionTorsionForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
* This kernel is invoked by AmoebaMultipoleForce to calculate the forces acting on the system and the energy of the system.
*/
class CalcAmoebaMultipoleForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaMultipoleForce";
}
CalcAmoebaMultipoleForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the MultipoleForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaMultipoleForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the MultipoleForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
* This kernel is invoked by AmoebaGeneralizedKirkwoodForce to calculate the forces acting on the system and the energy of the system.
*/
class CalcAmoebaGeneralizedKirkwoodForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaGeneralizedKirkwoodForce";
}
CalcAmoebaGeneralizedKirkwoodForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the GBSAOBCForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaGeneralizedKirkwoodForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the GBSAOBCForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
* This kernel is invoked by AmoebaSASAForce to calculate the solvent-accessible surface area forces acting on the system and the energy of the system.
*/
class CalcAmoebaSASAForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaSASAForce";
}
CalcAmoebaSASAForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the GBSAOBCForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaSASAForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the GBSAOBCForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
* This kernel is invoked by AmoebaVdwForce to calculate the vdw forces acting on the system and the vdw energy of the system.
*/
class CalcAmoebaVdwForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaVdwForce";
}
CalcAmoebaVdwForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the GBSAOBCForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaVdwForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the GBSAOBCForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
* This kernel is invoked by AmoebaWcaDispersionForce to calculate the WCA dispersion forces acting on the system and the WCA dispersion energy of the system.
*/
class CalcAmoebaWcaDispersionForceKernel : public KernelImpl {
public:
static std::string Name() {
return "CalcAmoebaWcaDispersionForce";
}
CalcAmoebaWcaDispersionForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
}
/**
* Initialize the kernel.
*
* @param system the System this kernel will be applied to
* @param force the GBSAOBCForce this kernel will be used for
*/
virtual void initialize(const System& system, const AmoebaWcaDispersionForce& force) = 0;
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the GBSAOBCForce
*/
virtual double executeEnergy(ContextImpl& context) = 0;
};
} // namespace OpenMM
#endif /*AMOEBA_OPENMM_KERNELS_H*/
#ifndef OPENMM_AMOEBA_GBSA_OBC_FORCE_FIELD_IMPL_H_
#define OPENMM_AMOEBA_GBSA_OBC_FORCE_FIELD_IMPL_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* 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 Stanford University and the Authors. *
* Authors: 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/internal/ForceImpl.h"
#include "AmoebaGBSAOBCForce.h"
#include "openmm/Kernel.h"
#include <string>
namespace OpenMM {
/**
* This is the internal implementation of AmoebaGBSAOBCForce.
*/
class AmoebaGBSAOBCForceImpl : public ForceImpl {
public:
AmoebaGBSAOBCForceImpl(AmoebaGBSAOBCForce& owner);
void initialize(ContextImpl& context);
AmoebaGBSAOBCForce& getOwner() {
return owner;
}
void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly.
}
void calcForces(ContextImpl& context);
double calcEnergy(ContextImpl& context);
std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters.
}
std::vector<std::string> getKernelNames();
private:
AmoebaGBSAOBCForce& owner;
Kernel kernel;
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_GBSA_OBC_FORCE_FIELD_IMPL_H_*/
#ifndef OPENMM_AMOEBA_GK_FORCE_FIELD_IMPL_H_
#define OPENMM_AMOEBA_GK_FORCE_FIELD_IMPL_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* 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 Stanford University and the Authors. *
* Authors: 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/internal/ForceImpl.h"
#include "AmoebaGeneralizedKirkwoodForce.h"
#include "openmm/Kernel.h"
#include <string>
namespace OpenMM {
/**
* This is the internal implementation of AmoebaGeneralizedKirkwoodForce.
*/
class AmoebaGeneralizedKirkwoodForceImpl : public ForceImpl {
public:
AmoebaGeneralizedKirkwoodForceImpl(AmoebaGeneralizedKirkwoodForce& owner);
void initialize(ContextImpl& context);
AmoebaGeneralizedKirkwoodForce& getOwner() {
return owner;
}
void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly.
}
void calcForces(ContextImpl& context);
double calcEnergy(ContextImpl& context);
std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters.
}
std::vector<std::string> getKernelNames();
private:
AmoebaGeneralizedKirkwoodForce& owner;
Kernel kernel;
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_GBSA_OBC_FORCE_FIELD_IMPL_H_*/
#ifndef OPENMM_AMOEBA_HARMONIC_ANGLE_FORCE_IMPL_H_
#define OPENMM_AMOEBA_HARMONIC_ANGLE_FORCE_IMPL_H_
/* -------------------------------------------------------------------------- *
* AmoebaOpenMM *
* -------------------------------------------------------------------------- *
* 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 Stanford University and the Authors. *
* Authors: *
* 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/internal/ForceImpl.h"
#include "AmoebaHarmonicAngleForce.h"
#include "openmm/Kernel.h"
#include <utility>
#include <set>
#include <string>
namespace OpenMM {
/**
* This is the internal implementation of AmoebaHarmonicAngleForce.
*/
class AmoebaHarmonicAngleForceImpl : public ForceImpl {
public:
AmoebaHarmonicAngleForceImpl(AmoebaHarmonicAngleForce& owner);
~AmoebaHarmonicAngleForceImpl();
void initialize(ContextImpl& context);
AmoebaHarmonicAngleForce& getOwner() {
return owner;
}
void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly.
}
void calcForces(ContextImpl& context );
double calcEnergy(ContextImpl& context);
std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters.
}
std::vector<std::string> getKernelNames();
private:
AmoebaHarmonicAngleForce& owner;
Kernel kernel;
};
} // namespace OpenMM
#endif /*OPENMM_AMOEBA_HARMONIC_ANGLE_FORCE_IMPL_H_*/
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