Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
bcbc4eec
Commit
bcbc4eec
authored
Aug 19, 2009
by
Michael Sherman
Browse files
Fixed wrapper generation to work on Windows (mostly inolved dllexport issues).
Deleted all the old hand-generated wrappers.
parent
9438fa83
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
487 additions
and
7033 deletions
+487
-7033
CMakeLists.txt
CMakeLists.txt
+320
-321
examples/CMakeLists.txt
examples/CMakeLists.txt
+2
-34
examples/Makefile
examples/Makefile
+15
-29
examples/OpenMMCWrapper.cpp
examples/OpenMMCWrapper.cpp
+0
-964
examples/OpenMMCWrapper.h
examples/OpenMMCWrapper.h
+0
-326
examples/OpenMMFortranModule.f90
examples/OpenMMFortranModule.f90
+0
-1364
examples/OpenMMFortranWrapper.cpp
examples/OpenMMFortranWrapper.cpp
+0
-1381
examples/OpenMM_CWrapper.cpp
examples/OpenMM_CWrapper.cpp
+0
-1215
examples/OpenMM_CWrapper.h
examples/OpenMM_CWrapper.h
+0
-322
examples/OpenMM_Module.f90
examples/OpenMM_Module.f90
+0
-925
wrappers/CMakeLists.txt
wrappers/CMakeLists.txt
+0
-2
wrappers/CWrapper_Header.xslt
wrappers/CWrapper_Header.xslt
+41
-37
wrappers/CWrapper_Source.xslt
wrappers/CWrapper_Source.xslt
+38
-42
wrappers/FortranWrapper_Source.xslt
wrappers/FortranWrapper_Source.xslt
+71
-71
No files found.
CMakeLists.txt
View file @
bcbc4eec
#---------------------------------------------------
# OpenMM
#
# Creates OpenMM library, base name=OpenMM.
# Default libraries are shared & optimized. Variants
# are created for static (_static) and debug (_d).
#
# Windows:
# OpenMM[_d].dll
# OpenMM[_d].lib
# OpenMM_static[_d].lib
# Unix:
# libOpenMM[_d].so
# libOpenMM_static[_d].a
#----------------------------------------------------
# On Linux it appears that cmake 2.4 does not work with Cuda cmake rules
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.6
)
if
(
COMMAND cmake_policy
)
cmake_policy
(
SET CMP0003 NEW
)
cmake_policy
(
SET CMP0005 NEW
)
cmake_policy
(
SET CMP0011 NEW
)
endif
(
COMMAND cmake_policy
)
# Don't create a new project name if this is part of a mega-build from the
# parent directory
IF
(
NOT PROJECT_NAME
)
PROJECT
(
OpenMM
)
ENDIF
(
NOT PROJECT_NAME
)
# Where to install
IF
(
${
CMAKE_C_COMPILER
}
MATCHES
"gcc"
)
IF
(
NOT OPENMM_INSTALL_PREFIX
)
SET
(
OPENMM_INSTALL_PREFIX
"/usr/local/openmm"
CACHE PATH
"Where to install OpenMM"
)
ENDIF
(
NOT OPENMM_INSTALL_PREFIX
)
ELSE
(
${
CMAKE_C_COMPILER
}
MATCHES
"gcc"
)
IF
(
NOT OPENMM_INSTALL_PREFIX
)
SET
(
OPENMM_INSTALL_PREFIX
"$ENV{ProgramFiles}/OpenMM"
CACHE PATH
"Where to install OpenMM"
)
ENDIF
(
NOT OPENMM_INSTALL_PREFIX
)
ENDIF
(
${
CMAKE_C_COMPILER
}
MATCHES
"gcc"
)
MARK_AS_ADVANCED
(
OPENMM_INSTALL_PREFIX
)
# It seems that on linux and mac, everything is trying to be installed in /usr/local/openmm
# But if every install target is prefixed with /openmm/, on Windows the install files
# end up in C:/Program Files/OpenMM/openmm/ which is ugly.
# Better to set CMAKE_INSTALL_PREFIX to /usr/local/openmm and leave /openmm/ off the
# install target names. Plus, the user now has the opportunity to install into /usr/local/
# if she so chooses. --cmb
IF
(
${
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
}
)
SET
(
CMAKE_INSTALL_PREFIX
${
OPENMM_INSTALL_PREFIX
}
CACHE PATH
"Where to install OpenMM"
FORCE
)
ENDIF
(
${
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
}
)
INCLUDE
(
Dart
)
SUBDIRS
(
tests examples
)
# 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_SOURCE_SUBDIRS . openmmapi olla libraries/jama libraries/quern libraries/lepton platforms/reference
)
# The build system will set ARCH64 for 64 bit builds, which require
# use of the lib64/ library directories rather than lib/.
#SET( ARCH64 OFF CACHE BOOL "ON for 64bit builds, OFF for 32bit builds")
#MARK_AS_ADVANCED( ARCH64 )
#IF (ARCH64)
# SET(LIB64 64)
#ELSE (ARCH64)
# SET(LIB64) # nothing
#ENDIF (ARCH64)
IF
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
SET
(
LIB64 64
)
ELSE
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
SET
(
LIB64
)
ENDIF
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
IF
(
UNIX AND NOT CMAKE_BUILD_TYPE
)
SET
(
CMAKE_BUILD_TYPE Debug CACHE STRING
"Debug or Release build"
FORCE
)
ENDIF
(
UNIX AND NOT CMAKE_BUILD_TYPE
)
IF
(
NOT CMAKE_CXX_FLAGS_DEBUG
)
SET
(
CMAKE_CXX_FLAGS_DEBUG
"-g"
CACHE STRING
"To use when CMAKE_BUILD_TYPE=Debug"
FORCE
)
ENDIF
(
NOT CMAKE_CXX_FLAGS_DEBUG
)
IF
(
NOT CMAKE_CXX_FLAGS_RELEASE
)
SET
(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -DNDEBUG"
CACHE STRING
"To use when CMAKE_BUILD_TYPE=Release"
FORCE
)
ENDIF
(
NOT CMAKE_CXX_FLAGS_RELEASE
)
# 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_LIBRARY_NAME OpenMM
)
SET
(
OPENMM_MAJOR_VERSION 1
)
SET
(
OPENMM_MINOR_VERSION 0
)
SET
(
OPENMM_BUILD_VERSION 0
)
SET
(
OPENMM_COPYRIGHT_YEARS
"2008"
)
# underbar separated list of dotted authors, no spaces or commas
SET
(
OPENMM_AUTHORS
"Peter.Eastman"
)
# Get the subversion revision number if we can
# It's possible that WIN32 installs use svnversion through cygwin
# so we'll try for both svnversion.exe and svnversion. Note that
# this will result in warnings if all you have is Tortoise without
# Cygwin, and your "about" string will say "unknown" rather than
# providing the SVN version of the source.
FIND_PROGRAM
(
SVNVERSION_EXE svnversion.exe
)
IF
(
SVNVERSION_EXE
)
EXEC_PROGRAM
(
${
SVNVERSION_EXE
}
ARGS \"
${
CMAKE_CURRENT_SOURCE_DIR
}
\"
OUTPUT_VARIABLE OPENMM_SVN_REVISION
)
ELSE
(
SVNVERSION_EXE
)
FIND_PROGRAM
(
SVNVERSION svnversion
)
IF
(
SVNVERSION
)
EXEC_PROGRAM
(
${
SVNVERSION
}
ARGS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
OUTPUT_VARIABLE OPENMM_SVN_REVISION
)
ELSE
(
SVNVERSION
)
MESSAGE
(
STATUS
"Could not find 'svnversion' executable; 'about' will be wrong. (Cygwin provides one on Windows.)"
)
SET
(
OPENMM_SVN_REVISION unknown
)
ENDIF
(
SVNVERSION
)
ENDIF
(
SVNVERSION_EXE
)
# Remove colon from build version, for easier placement in directory names
STRING
(
REPLACE
":"
"_"
OPENMM_SVN_REVISION
${
OPENMM_SVN_REVISION
}
)
ADD_DEFINITIONS
(
-DOPENMM_LIBRARY_NAME=
${
OPENMM_LIBRARY_NAME
}
-DOPENMM_MAJOR_VERSION=
${
OPENMM_MAJOR_VERSION
}
-DOPENMM_MINOR_VERSION=
${
OPENMM_MINOR_VERSION
}
-DOPENMM_BUILD_VERSION=
${
OPENMM_BUILD_VERSION
}
)
# CMake quotes automatically when building Visual Studio projects but we need
# to add them ourselves for Linux or Cygwin. Two cases to avoid duplicate quotes
# in Visual Studio which end up in the binary.
IF
(
${
CMAKE_GENERATOR
}
MATCHES
"Visual Studio"
)
SET
(
NEED_QUOTES FALSE
)
ELSE
(
${
CMAKE_GENERATOR
}
MATCHES
"Visual Studio"
)
SET
(
NEED_QUOTES TRUE
)
ENDIF
(
${
CMAKE_GENERATOR
}
MATCHES
"Visual Studio"
)
##TODO: doesn't work without quotes in nightly build
SET
(
NEED_QUOTES TRUE
)
IF
(
NEED_QUOTES
)
ADD_DEFINITIONS
(
-DOPENMM_SVN_REVISION=
"
${
OPENMM_SVN_REVISION
}
"
-DOPENMM_COPYRIGHT_YEARS=
"
${
OPENMM_COPYRIGHT_YEARS
}
"
-DOPENMM_AUTHORS=
"
${
OPENMM_AUTHORS
}
"
)
ELSE
(
NEED_QUOTES
)
ADD_DEFINITIONS
(
-DOPENMM_SVN_REVISION=
${
OPENMM_SVN_REVISION
}
-DOPENMM_COPYRIGHT_YEARS=
${
OPENMM_COPYRIGHT_YEARS
}
-DOPENMM_AUTHORS=
${
OPENMM_AUTHORS
}
)
ENDIF
(
NEED_QUOTES
)
# -DOPENMM_TYPE has to be defined in the target subdirectories.
# -Dsimbody_EXPORTS defined automatically when Windows DLL build is being done.
# Report the version number to the CMake UI
SET
(
OPENMM_VERSION
"
${
OPENMM_MAJOR_VERSION
}
.
${
OPENMM_MINOR_VERSION
}
.
${
OPENMM_BUILD_VERSION
}
"
CACHE STRING
"This is the version of OpenMM which will be built."
FORCE
)
SET
(
SHARED_TARGET
${
OPENMM_LIBRARY_NAME
}
)
SET
(
STATIC_TARGET
${
OPENMM_LIBRARY_NAME
}
_static
)
## If no one says otherwise, change the executable path to drop into the same binary
## location as the DLLs so that the test cases will use the just-build DLLs.
IF
(
NOT EXECUTABLE_OUTPUT_PATH
)
SET
(
EXECUTABLE_OUTPUT_PATH
${
PROJECT_BINARY_DIR
}
CACHE INTERNAL
"Single output directory for building all executables."
)
ENDIF
(
NOT EXECUTABLE_OUTPUT_PATH
)
IF
(
NOT LIBRARY_OUTPUT_PATH
)
SET
(
LIBRARY_OUTPUT_PATH
${
PROJECT_BINARY_DIR
}
CACHE INTERNAL
"Single output directory for building all libraries."
)
ENDIF
(
NOT LIBRARY_OUTPUT_PATH
)
SET
(
${
PROJECT_NAME
}
_EXECUTABLE_DIR
${
EXECUTABLE_OUTPUT_PATH
}
/
${
CMAKE_CFG_INTDIR
}
)
SET
(
${
PROJECT_NAME
}
_LIBRARY_DIR
${
LIBRARY_OUTPUT_PATH
}
/
${
CMAKE_CFG_INTDIR
}
)
# Ensure that debug libraries have "_d" appended to their names.
# CMake gets this right on Windows automatically with this definition.
IF
(
${
CMAKE_GENERATOR
}
MATCHES
"Visual Studio"
)
SET
(
CMAKE_DEBUG_POSTFIX
"_d"
CACHE INTERNAL
""
FORCE
)
ENDIF
(
${
CMAKE_GENERATOR
}
MATCHES
"Visual Studio"
)
# But on Unix or Cygwin we have to add the suffix manually
IF
(
UNIX AND CMAKE_BUILD_TYPE MATCHES Debug
)
SET
(
SHARED_TARGET
${
SHARED_TARGET
}
_d
)
SET
(
STATIC_TARGET
${
STATIC_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_INCLUDE_DIRS
)
# start empty
FOREACH
(
subdir
${
OPENMM_SOURCE_SUBDIRS
}
)
# append
SET
(
API_INCLUDE_DIRS
${
API_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_REL_INCLUDE_FILES
)
# start these out empty
SET
(
API_ABS_INCLUDE_FILES
)
FOREACH
(
dir
${
API_INCLUDE_DIRS
}
)
FILE
(
GLOB fullpaths
${
dir
}
/*.h
)
# returns full pathnames
SET
(
API_ABS_INCLUDE_FILES
${
API_ABS_INCLUDE_FILES
}
${
fullpaths
}
)
FOREACH
(
pathname
${
fullpaths
}
)
GET_FILENAME_COMPONENT
(
filename
${
pathname
}
NAME
)
SET
(
API_REL_INCLUDE_FILES
${
API_REL_INCLUDE_FILES
}
${
dir
}
/
${
filename
}
)
ENDFOREACH
(
pathname
)
ENDFOREACH
(
dir
)
# collect up source files
SET
(
SOURCE_FILES
)
# empty
SET
(
SOURCE_INCLUDE_FILES
)
FOREACH
(
subdir
${
OPENMM_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_FILES
${
SOURCE_FILES
}
${
src_files
}
)
#append
SET
(
SOURCE_INCLUDE_FILES
${
SOURCE_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
)
# If API wrappers are being generated, and add them to the build.
SET
(
OPENMM_BUILD_API_WRAPPERS OFF CACHE BOOL
"Build wrappers for C and Fortran"
)
IF
(
OPENMM_BUILD_API_WRAPPERS
)
SET
(
SOURCE_FILES
${
SOURCE_FILES
}
wrappers/OpenMMCWrapper.cpp wrappers/OpenMMFortranWrapper.cpp
)
ENDIF
(
OPENMM_BUILD_API_WRAPPERS
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
ADD_LIBRARY
(
${
SHARED_TARGET
}
SHARED
${
SOURCE_FILES
}
${
SOURCE_INCLUDE_FILES
}
${
API_ABS_INCLUDE_FILES
}
)
SET_TARGET_PROPERTIES
(
${
SHARED_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMM_BUILDING_SHARED_LIBRARY -DLEPTON_BUILDING_SHARED_LIBRARY"
)
ADD_LIBRARY
(
${
STATIC_TARGET
}
STATIC
${
SOURCE_FILES
}
${
SOURCE_INCLUDE_FILES
}
${
API_ABS_INCLUDE_FILES
}
)
SET_TARGET_PROPERTIES
(
${
STATIC_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMM_USE_STATIC_LIBRARIES -DOPENMM_BUILDING_STATIC_LIBRARY -DLEPTON_USE_STATIC_LIBRARIES -DLEPTON_BUILDING_STATIC_LIBRARY"
)
# On Linux need to link to libdl
FIND_LIBRARY
(
DL_LIBRARY dl
)
IF
(
DL_LIBRARY
)
TARGET_LINK_LIBRARIES
(
${
SHARED_TARGET
}
${
DL_LIBRARY
}
)
TARGET_LINK_LIBRARIES
(
${
STATIC_TARGET
}
${
DL_LIBRARY
}
)
ENDIF
(
DL_LIBRARY
)
ADD_SUBDIRECTORY
(
platforms/reference/tests
)
# Which hardware platforms to build
SET
(
OPENMM_BUILD_CUDA_LIB OFF CACHE BOOL
"Build OpenMMCuda library for Nvidia GPUs"
)
IF
(
OPENMM_BUILD_CUDA_LIB
)
ADD_SUBDIRECTORY
(
platforms/cuda
)
ENDIF
(
OPENMM_BUILD_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
)
INSTALL_TARGETS
(
/lib RUNTIME_DIRECTORY /lib
${
SHARED_TARGET
}
)
INSTALL_TARGETS
(
/lib RUNTIME_DIRECTORY /lib
${
STATIC_TARGET
}
)
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
)
#
# Generate API wrappers if requested.
#
IF
(
OPENMM_BUILD_API_WRAPPERS
)
ADD_SUBDIRECTORY
(
wrappers
)
ENDIF
(
OPENMM_BUILD_API_WRAPPERS
)
#---------------------------------------------------
# OpenMM
#
# Creates OpenMM library, base name=OpenMM.
# Default libraries are shared & optimized. Variants
# are created for static (_static) and debug (_d).
#
# Windows:
# OpenMM[_d].dll
# OpenMM[_d].lib
# OpenMM_static[_d].lib
# Unix:
# libOpenMM[_d].so
# libOpenMM_static[_d].a
#----------------------------------------------------
# On Linux it appears that cmake 2.4 does not work with Cuda cmake rules
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.6
)
if
(
COMMAND cmake_policy
)
cmake_policy
(
SET CMP0003 NEW
)
cmake_policy
(
SET CMP0005 NEW
)
cmake_policy
(
SET CMP0011 NEW
)
endif
(
COMMAND cmake_policy
)
# Don't create a new project name if this is part of a mega-build from the
# parent directory
IF
(
NOT PROJECT_NAME
)
PROJECT
(
OpenMM
)
ENDIF
(
NOT PROJECT_NAME
)
# Where to install
IF
(
${
CMAKE_C_COMPILER
}
MATCHES
"gcc"
)
IF
(
NOT OPENMM_INSTALL_PREFIX
)
SET
(
OPENMM_INSTALL_PREFIX
"/usr/local/openmm"
CACHE PATH
"Where to install OpenMM"
)
ENDIF
(
NOT OPENMM_INSTALL_PREFIX
)
ELSE
(
${
CMAKE_C_COMPILER
}
MATCHES
"gcc"
)
IF
(
NOT OPENMM_INSTALL_PREFIX
)
SET
(
OPENMM_INSTALL_PREFIX
"$ENV{ProgramFiles}/OpenMM"
CACHE PATH
"Where to install OpenMM"
)
ENDIF
(
NOT OPENMM_INSTALL_PREFIX
)
ENDIF
(
${
CMAKE_C_COMPILER
}
MATCHES
"gcc"
)
MARK_AS_ADVANCED
(
OPENMM_INSTALL_PREFIX
)
# It seems that on linux and mac, everything is trying to be installed in /usr/local/openmm
# But if every install target is prefixed with /openmm/, on Windows the install files
# end up in C:/Program Files/OpenMM/openmm/ which is ugly.
# Better to set CMAKE_INSTALL_PREFIX to /usr/local/openmm and leave /openmm/ off the
# install target names. Plus, the user now has the opportunity to install into /usr/local/
# if she so chooses. --cmb
IF
(
${
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
}
)
SET
(
CMAKE_INSTALL_PREFIX
${
OPENMM_INSTALL_PREFIX
}
CACHE PATH
"Where to install OpenMM"
FORCE
)
ENDIF
(
${
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
}
)
INCLUDE
(
Dart
)
SUBDIRS
(
tests examples
)
# 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_SOURCE_SUBDIRS . openmmapi olla libraries/jama libraries/quern libraries/lepton platforms/reference
)
# The build system will set ARCH64 for 64 bit builds, which require
# use of the lib64/ library directories rather than lib/.
#SET( ARCH64 OFF CACHE BOOL "ON for 64bit builds, OFF for 32bit builds")
#MARK_AS_ADVANCED( ARCH64 )
#IF (ARCH64)
# SET(LIB64 64)
#ELSE (ARCH64)
# SET(LIB64) # nothing
#ENDIF (ARCH64)
IF
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
SET
(
LIB64 64
)
ELSE
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
SET
(
LIB64
)
ENDIF
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
IF
(
UNIX AND NOT CMAKE_BUILD_TYPE
)
SET
(
CMAKE_BUILD_TYPE Debug CACHE STRING
"Debug or Release build"
FORCE
)
ENDIF
(
UNIX AND NOT CMAKE_BUILD_TYPE
)
IF
(
NOT CMAKE_CXX_FLAGS_DEBUG
)
SET
(
CMAKE_CXX_FLAGS_DEBUG
"-g"
CACHE STRING
"To use when CMAKE_BUILD_TYPE=Debug"
FORCE
)
ENDIF
(
NOT CMAKE_CXX_FLAGS_DEBUG
)
IF
(
NOT CMAKE_CXX_FLAGS_RELEASE
)
SET
(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -DNDEBUG"
CACHE STRING
"To use when CMAKE_BUILD_TYPE=Release"
FORCE
)
ENDIF
(
NOT CMAKE_CXX_FLAGS_RELEASE
)
# 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_LIBRARY_NAME OpenMM
)
SET
(
OPENMM_MAJOR_VERSION 1
)
SET
(
OPENMM_MINOR_VERSION 0
)
SET
(
OPENMM_BUILD_VERSION 0
)
SET
(
OPENMM_COPYRIGHT_YEARS
"2008"
)
# underbar separated list of dotted authors, no spaces or commas
SET
(
OPENMM_AUTHORS
"Peter.Eastman"
)
# Get the subversion revision number if we can
# It's possible that WIN32 installs use svnversion through cygwin
# so we'll try for both svnversion.exe and svnversion. Note that
# this will result in warnings if all you have is Tortoise without
# Cygwin, and your "about" string will say "unknown" rather than
# providing the SVN version of the source.
FIND_PROGRAM
(
SVNVERSION_EXE svnversion.exe
)
IF
(
SVNVERSION_EXE
)
EXEC_PROGRAM
(
${
SVNVERSION_EXE
}
ARGS \"
${
CMAKE_CURRENT_SOURCE_DIR
}
\"
OUTPUT_VARIABLE OPENMM_SVN_REVISION
)
ELSE
(
SVNVERSION_EXE
)
FIND_PROGRAM
(
SVNVERSION svnversion
)
IF
(
SVNVERSION
)
EXEC_PROGRAM
(
${
SVNVERSION
}
ARGS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
OUTPUT_VARIABLE OPENMM_SVN_REVISION
)
ELSE
(
SVNVERSION
)
MESSAGE
(
STATUS
"Could not find 'svnversion' executable; 'about' will be wrong. (Cygwin provides one on Windows.)"
)
SET
(
OPENMM_SVN_REVISION unknown
)
ENDIF
(
SVNVERSION
)
ENDIF
(
SVNVERSION_EXE
)
# Remove colon from build version, for easier placement in directory names
STRING
(
REPLACE
":"
"_"
OPENMM_SVN_REVISION
${
OPENMM_SVN_REVISION
}
)
ADD_DEFINITIONS
(
-DOPENMM_LIBRARY_NAME=
${
OPENMM_LIBRARY_NAME
}
-DOPENMM_MAJOR_VERSION=
${
OPENMM_MAJOR_VERSION
}
-DOPENMM_MINOR_VERSION=
${
OPENMM_MINOR_VERSION
}
-DOPENMM_BUILD_VERSION=
${
OPENMM_BUILD_VERSION
}
)
# CMake quotes automatically when building Visual Studio projects but we need
# to add them ourselves for Linux or Cygwin. Two cases to avoid duplicate quotes
# in Visual Studio which end up in the binary.
IF
(
${
CMAKE_GENERATOR
}
MATCHES
"Visual Studio"
)
SET
(
NEED_QUOTES FALSE
)
ELSE
(
${
CMAKE_GENERATOR
}
MATCHES
"Visual Studio"
)
SET
(
NEED_QUOTES TRUE
)
ENDIF
(
${
CMAKE_GENERATOR
}
MATCHES
"Visual Studio"
)
##TODO: doesn't work without quotes in nightly build
SET
(
NEED_QUOTES TRUE
)
IF
(
NEED_QUOTES
)
ADD_DEFINITIONS
(
-DOPENMM_SVN_REVISION=
"
${
OPENMM_SVN_REVISION
}
"
-DOPENMM_COPYRIGHT_YEARS=
"
${
OPENMM_COPYRIGHT_YEARS
}
"
-DOPENMM_AUTHORS=
"
${
OPENMM_AUTHORS
}
"
)
ELSE
(
NEED_QUOTES
)
ADD_DEFINITIONS
(
-DOPENMM_SVN_REVISION=
${
OPENMM_SVN_REVISION
}
-DOPENMM_COPYRIGHT_YEARS=
${
OPENMM_COPYRIGHT_YEARS
}
-DOPENMM_AUTHORS=
${
OPENMM_AUTHORS
}
)
ENDIF
(
NEED_QUOTES
)
# -DOPENMM_TYPE has to be defined in the target subdirectories.
# -Dsimbody_EXPORTS defined automatically when Windows DLL build is being done.
# Report the version number to the CMake UI
SET
(
OPENMM_VERSION
"
${
OPENMM_MAJOR_VERSION
}
.
${
OPENMM_MINOR_VERSION
}
.
${
OPENMM_BUILD_VERSION
}
"
CACHE STRING
"This is the version of OpenMM which will be built."
FORCE
)
SET
(
SHARED_TARGET
${
OPENMM_LIBRARY_NAME
}
)
SET
(
STATIC_TARGET
${
OPENMM_LIBRARY_NAME
}
_static
)
## If no one says otherwise, change the executable path to drop into the same binary
## location as the DLLs so that the test cases will use the just-build DLLs.
IF
(
NOT EXECUTABLE_OUTPUT_PATH
)
SET
(
EXECUTABLE_OUTPUT_PATH
${
PROJECT_BINARY_DIR
}
CACHE INTERNAL
"Single output directory for building all executables."
)
ENDIF
(
NOT EXECUTABLE_OUTPUT_PATH
)
IF
(
NOT LIBRARY_OUTPUT_PATH
)
SET
(
LIBRARY_OUTPUT_PATH
${
PROJECT_BINARY_DIR
}
CACHE INTERNAL
"Single output directory for building all libraries."
)
ENDIF
(
NOT LIBRARY_OUTPUT_PATH
)
SET
(
${
PROJECT_NAME
}
_EXECUTABLE_DIR
${
EXECUTABLE_OUTPUT_PATH
}
/
${
CMAKE_CFG_INTDIR
}
)
SET
(
${
PROJECT_NAME
}
_LIBRARY_DIR
${
LIBRARY_OUTPUT_PATH
}
/
${
CMAKE_CFG_INTDIR
}
)
# Ensure that debug libraries have "_d" appended to their names.
# CMake gets this right on Windows automatically with this definition.
IF
(
${
CMAKE_GENERATOR
}
MATCHES
"Visual Studio"
)
SET
(
CMAKE_DEBUG_POSTFIX
"_d"
CACHE INTERNAL
""
FORCE
)
ENDIF
(
${
CMAKE_GENERATOR
}
MATCHES
"Visual Studio"
)
# But on Unix or Cygwin we have to add the suffix manually
IF
(
UNIX AND CMAKE_BUILD_TYPE MATCHES Debug
)
SET
(
SHARED_TARGET
${
SHARED_TARGET
}
_d
)
SET
(
STATIC_TARGET
${
STATIC_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_INCLUDE_DIRS
)
# start empty
FOREACH
(
subdir
${
OPENMM_SOURCE_SUBDIRS
}
)
# append
SET
(
API_INCLUDE_DIRS
${
API_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_REL_INCLUDE_FILES
)
# start these out empty
SET
(
API_ABS_INCLUDE_FILES
)
FOREACH
(
dir
${
API_INCLUDE_DIRS
}
)
FILE
(
GLOB fullpaths
${
dir
}
/*.h
)
# returns full pathnames
SET
(
API_ABS_INCLUDE_FILES
${
API_ABS_INCLUDE_FILES
}
${
fullpaths
}
)
FOREACH
(
pathname
${
fullpaths
}
)
GET_FILENAME_COMPONENT
(
filename
${
pathname
}
NAME
)
SET
(
API_REL_INCLUDE_FILES
${
API_REL_INCLUDE_FILES
}
${
dir
}
/
${
filename
}
)
ENDFOREACH
(
pathname
)
ENDFOREACH
(
dir
)
# collect up source files
SET
(
SOURCE_FILES
)
# empty
SET
(
SOURCE_INCLUDE_FILES
)
FOREACH
(
subdir
${
OPENMM_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_FILES
${
SOURCE_FILES
}
${
src_files
}
)
#append
SET
(
SOURCE_INCLUDE_FILES
${
SOURCE_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
)
# If API wrappers are being generated, and add them to the build.
SET
(
OPENMM_BUILD_API_WRAPPERS OFF CACHE BOOL
"Build wrappers for C and Fortran"
)
IF
(
OPENMM_BUILD_API_WRAPPERS
)
ADD_SUBDIRECTORY
(
wrappers
)
SET
(
SOURCE_FILES
${
SOURCE_FILES
}
wrappers/OpenMMCWrapper.cpp wrappers/OpenMMFortranWrapper.cpp
)
ENDIF
(
OPENMM_BUILD_API_WRAPPERS
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
ADD_LIBRARY
(
${
SHARED_TARGET
}
SHARED
${
SOURCE_FILES
}
${
SOURCE_INCLUDE_FILES
}
${
API_ABS_INCLUDE_FILES
}
)
SET_TARGET_PROPERTIES
(
${
SHARED_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMM_BUILDING_SHARED_LIBRARY -DLEPTON_BUILDING_SHARED_LIBRARY"
)
ADD_LIBRARY
(
${
STATIC_TARGET
}
STATIC
${
SOURCE_FILES
}
${
SOURCE_INCLUDE_FILES
}
${
API_ABS_INCLUDE_FILES
}
)
SET_TARGET_PROPERTIES
(
${
STATIC_TARGET
}
PROPERTIES COMPILE_FLAGS
"-DOPENMM_USE_STATIC_LIBRARIES -DOPENMM_BUILDING_STATIC_LIBRARY -DLEPTON_USE_STATIC_LIBRARIES -DLEPTON_BUILDING_STATIC_LIBRARY"
)
IF
(
OPENMM_BUILD_API_WRAPPERS
)
ADD_DEPENDENCIES
(
${
SHARED_TARGET
}
ApiWrappers
)
ADD_DEPENDENCIES
(
${
STATIC_TARGET
}
ApiWrappers
)
ENDIF
(
OPENMM_BUILD_API_WRAPPERS
)
# On Linux need to link to libdl
FIND_LIBRARY
(
DL_LIBRARY dl
)
IF
(
DL_LIBRARY
)
TARGET_LINK_LIBRARIES
(
${
SHARED_TARGET
}
${
DL_LIBRARY
}
)
TARGET_LINK_LIBRARIES
(
${
STATIC_TARGET
}
${
DL_LIBRARY
}
)
ENDIF
(
DL_LIBRARY
)
ADD_SUBDIRECTORY
(
platforms/reference/tests
)
# Which hardware platforms to build
SET
(
OPENMM_BUILD_CUDA_LIB OFF CACHE BOOL
"Build OpenMMCuda library for Nvidia GPUs"
)
IF
(
OPENMM_BUILD_CUDA_LIB
)
ADD_SUBDIRECTORY
(
platforms/cuda
)
ENDIF
(
OPENMM_BUILD_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
)
INSTALL_TARGETS
(
/lib RUNTIME_DIRECTORY /lib
${
SHARED_TARGET
}
)
INSTALL_TARGETS
(
/lib RUNTIME_DIRECTORY /lib
${
STATIC_TARGET
}
)
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
)
examples/CMakeLists.txt
View file @
bcbc4eec
...
...
@@ -17,18 +17,6 @@ SET(OpenMM_CWRAPPER "OpenMMCWrapper")
SET
(
OpenMM_FWRAPPER
"OpenMMFortranWrapper"
)
SET
(
OpenMM_FMODULE
"OpenMMFortranModule"
)
# CWrapper is always a static library but you need a different
# one if you want to link with the OpenMM static library.
SET
(
CWRAPPER_FOR_SHARED
${
OpenMM_CWRAPPER
}
)
SET
(
CWRAPPER_FOR_STATIC
${
OpenMM_CWRAPPER
}
_static
)
# Visual Studio will add "_d" to target names automatically
# but on Unix or Cygwin we have to add the suffix manually
IF
(
UNIX AND CMAKE_BUILD_TYPE MATCHES Debug
)
SET
(
CWRAPPER_FOR_SHARED
${
CWRAPPER_FOR_SHARED
}
_d
)
SET
(
CWRAPPER_FOR_STATIC
${
CWRAPPER_FOR_STATIC
}
_d
)
ENDIF
(
UNIX AND CMAKE_BUILD_TYPE MATCHES Debug
)
SET
(
CPP_EXAMPLES HelloArgon HelloSodiumChloride HelloEthane HelloWaterBox
)
SET
(
C_EXAMPLES HelloArgonInC HelloSodiumChlorideInC
)
SET
(
F_EXAMPLES HelloArgonInFortran HelloSodiumChlorideInFortran
)
...
...
@@ -36,24 +24,7 @@ SET(F_EXAMPLES HelloArgonInFortran HelloSodiumChlorideInFortran)
SET
(
BUILD_TESTING_SHARED 1
)
SET
(
BUILD_TESTING_STATIC 1
)
ADD_LIBRARY
(
${
CWRAPPER_FOR_SHARED
}
${
OpenMM_CWRAPPER
}
.cpp
${
OpenMM_FWRAPPER
}
.cpp
${
OpenMM_CWRAPPER
}
.h
)
SET_TARGET_PROPERTIES
(
${
CWRAPPER_FOR_SHARED
}
PROPERTIES
PROJECT_LABEL
"C Bindings"
)
TARGET_LINK_LIBRARIES
(
${
CWRAPPER_FOR_SHARED
}
${
SHARED_TARGET
}
)
ADD_LIBRARY
(
${
CWRAPPER_FOR_STATIC
}
${
OpenMM_CWRAPPER
}
.cpp
${
OpenMM_FWRAPPER
}
.cpp
${
OpenMM_CWRAPPER
}
.h
)
SET_TARGET_PROPERTIES
(
${
CWRAPPER_FOR_STATIC
}
PROPERTIES
COMPILE_FLAGS
"-DOPENMM_USE_STATIC_LIBRARIES"
PROJECT_LABEL
"C Bindings for static OpenMM"
)
INSTALL_TARGETS
(
/lib RUNTIME_DIRECTORY /lib
${
CWRAPPER_FOR_SHARED
}
)
INSTALL_TARGETS
(
/lib RUNTIME_DIRECTORY /lib
${
CWRAPPER_FOR_STATIC
}
)
FOREACH
(
EX_ROOT
${
CPP_EXAMPLES
}
)
IF
(
BUILD_TESTING_SHARED
)
# Link with shared library
...
...
@@ -88,7 +59,7 @@ FOREACH(EX_ROOT ${C_EXAMPLES})
SET_TARGET_PROPERTIES
(
${
EX_ROOT
}
PROPERTIES
PROJECT_LABEL
"Example C -
${
EX_ROOT
}
"
)
TARGET_LINK_LIBRARIES
(
${
EX_ROOT
}
${
CWRAPPER_FOR_SHARED
}
${
SHARED_TARGET
}
)
TARGET_LINK_LIBRARIES
(
${
EX_ROOT
}
${
SHARED_TARGET
}
)
ENDIF
(
BUILD_TESTING_SHARED
)
IF
(
BUILD_TESTING_STATIC
)
...
...
@@ -101,7 +72,7 @@ FOREACH(EX_ROOT ${C_EXAMPLES})
PROPERTIES
COMPILE_FLAGS
"-DOPENMM_USE_STATIC_LIBRARIES"
PROJECT_LABEL
"Example C -
${
EX_STATIC
}
"
)
TARGET_LINK_LIBRARIES
(
${
EX_STATIC
}
${
CWRAPPER_FOR_STATIC
}
${
STATIC_TARGET
}
)
TARGET_LINK_LIBRARIES
(
${
EX_STATIC
}
${
STATIC_TARGET
}
)
ENDIF
(
BUILD_TESTING_STATIC
)
INSTALL
(
FILES
${
EX_ROOT
}
.c DESTINATION examples
)
...
...
@@ -112,9 +83,6 @@ FOREACH(EX_ROOT ${F_EXAMPLES})
INSTALL
(
FILES
${
EX_ROOT
}
.f90 DESTINATION examples
)
ENDFOREACH
(
EX_ROOT
${
F_EXAMPLES
}
)
INSTALL
(
FILES
${
OpenMM_CWRAPPER
}
.h
${
OpenMM_CWRAPPER
}
.cpp
${
OpenMM_FWRAPPER
}
.cpp
DESTINATION examples
)
INSTALL
(
FILES
${
OpenMM_FMODULE
}
.f90 DESTINATION examples
)
INSTALL
(
FILES README.txt DESTINATION examples
)
INSTALL
(
FILES Makefile NMakefile DESTINATION examples
)
...
...
examples/Makefile
View file @
bcbc4eec
# ----------------------------------------------------------------------
# Makefile for OpenMM Preview Release
3
workshop "hello world" examples.
#
June 24
, 2009
.
# Makefile for OpenMM Preview Release
4
workshop "hello world" examples.
#
August 18
, 2009
# See https://simtk.org/home/openmm.
# ----------------------------------------------------------------------
# This assumes you have gcc compilers for whatever language you are
# using: g++ for C++ and C, gfortran for Fortran 95.
#
# Note: the C Wrappers and Fortran Module are just prototypes. They are
# incomplete but have enough functionality to get through these examples.
# We would like more complete and better-thought-out interfaces; if you
# have code or ideas please post to the OpenMM forum at the above URL
# (select "Advanced/Public Forums").
# For the C and Fortran examples, we're depending on your version of
# OpenMM to have been built with the automatically-generated API
# wrappers.
#
# This has had only minimal testing, although it has been known to
# work. It is likely to work fine for C and C++. For Fortran, you
...
...
@@ -32,8 +30,6 @@ FCPPLIBS = -lstdc++
LIB_DIR
=
$(OpenMM_INSTALL_DIR)
/lib
INCLUDE_DIR
=
$(OpenMM_INSTALL_DIR)
/include
# assume local directory for C and Fortran wrappers
WRAPPER_DIR
=
.
LIBS
=
-lOpenMM
ALL_CPP_EXAMPLES
=
HelloArgon HelloSodiumChloride HelloEthane HelloWaterBox
...
...
@@ -46,40 +42,30 @@ default: HelloArgon
all
:
$(ALL_PROGS)
# Treat all .cpp source files the same way (except the one that
# implements the C Wrappers).
# Treat all .cpp source files the same way.
.cpp
:
g++
$(CFLAGS)
-I
$(INCLUDE_DIR)
$<
-L
$(LIB_DIR)
$(LIBS)
-o
$*
HelloArgonInC
:
HelloArgonInC.c
OpenMMCWrapper.o
g++
$(CFLAGS)
-I
$(WRAPPER_DIR)
HelloArgonInC.c OpenMMCWrapper.o
\
HelloArgonInC
:
HelloArgonInC.c
g++
$(CFLAGS)
HelloArgonInC.c
\
-L
$(LIB_DIR)
$(LIBS)
-o
HelloArgonInC
HelloSodiumChlorideInC
:
HelloSodiumChlorideInC.c
OpenMMCWrapper.o
g++
$(CFLAGS)
-I
$(WRAPPER_DIR)
HelloSodiumChlorideInC.c
OpenMMCWrapper.o
\
HelloSodiumChlorideInC
:
HelloSodiumChlorideInC.c
g++
$(CFLAGS)
HelloSodiumChlorideInC.c
\
-L
$(LIB_DIR)
$(LIBS)
-o
HelloSodiumChlorideInC
HelloArgonInFortran
:
HelloArgonInFortran.f90 openmm.mod
OpenMMFortranWrapper.o OpenMMCWrapper.o
gfortran
$(FFLAGS)
HelloArgonInFortran.f90
OpenMMFortranWrapper.o OpenMMCWrapper.o
\
HelloArgonInFortran
:
HelloArgonInFortran.f90 openmm.mod
gfortran
$(FFLAGS)
HelloArgonInFortran.f90
\
-L
$(LIB_DIR)
$(LIBS)
$(FCPPLIBS)
-o
HelloArgonInFortran
HelloSodiumChlorideInFortran
:
HelloSodiumChlorideInFortran.f90 openmm.mod
OpenMMFortranWrapper.o OpenMMCWrapper.o
gfortran
$(FFLAGS)
HelloSodiumChlorideInFortran.f90
OpenMMFortranWrapper.o OpenMMCWrapper.o
\
HelloSodiumChlorideInFortran
:
HelloSodiumChlorideInFortran.f90 openmm.mod
gfortran
$(FFLAGS)
HelloSodiumChlorideInFortran.f90
\
-L
$(LIB_DIR)
$(LIBS)
$(FCPPLIBS)
-o
HelloSodiumChlorideInFortran
# Build C Wrappers (Fortran depends on this too)
OpenMMCWrapper.o
:
g++
-c
$(CFLAGS)
-I
$(WRAPPER_DIR)
-I
$(INCLUDE_DIR)
\
$(WRAPPER_DIR)
/OpenMMCWrapper.cpp
-o
OpenMMCWrapper.o
# Build Fortran Wrappers
OpenMMFortranWrapper.o
:
g++
-c
$(CFLAGS)
-I
$(WRAPPER_DIR)
-I
$(INCLUDE_DIR)
\
$(WRAPPER_DIR)
/OpenMMFortranWrapper.cpp
-o
OpenMMFortranWrapper.o
# Build Fortran 95 Module file
openmm.mod
:
gfortran
-c
$(FFLAGS)
$(
WRAPPER
_DIR)
/OpenMMFortranModule.f90
gfortran
-c
$(FFLAGS)
$(
INCLUDE
_DIR)
/OpenMMFortranModule.f90
clean
:
rm
$(ALL_PROGS)
*
.o
*
.mod
*
.obj
*
.exe
...
...
examples/OpenMMCWrapper.cpp
deleted
100644 → 0
View file @
9438fa83
#include "OpenMMCWrapper.h"
#include "OpenMM.h"
#include <cstring>
#include <vector>
using
namespace
OpenMM
;
using
namespace
std
;
#if defined(__cplusplus)
extern
"C"
{
#endif
/* OpenMM_Vec3 */
OpenMM_Vec3
OpenMM_Vec3_scale
(
const
OpenMM_Vec3
vec
,
double
scale
)
{
OpenMM_Vec3
result
=
{
vec
.
x
*
scale
,
vec
.
y
*
scale
,
vec
.
z
*
scale
};
return
result
;
}
/* OpenMM_Vec3Array */
OpenMM_Vec3Array
*
OpenMM_Vec3Array_create
(
int
size
)
{
return
reinterpret_cast
<
OpenMM_Vec3Array
*>
(
new
vector
<
Vec3
>
(
size
));
}
void
OpenMM_Vec3Array_destroy
(
OpenMM_Vec3Array
*
array
)
{
delete
reinterpret_cast
<
vector
<
Vec3
>*>
(
array
);
}
int
OpenMM_Vec3Array_getSize
(
const
OpenMM_Vec3Array
*
array
)
{
return
reinterpret_cast
<
const
vector
<
Vec3
>*>
(
array
)
->
size
();
}
void
OpenMM_Vec3Array_resize
(
OpenMM_Vec3Array
*
array
,
int
size
)
{
reinterpret_cast
<
vector
<
Vec3
>*>
(
array
)
->
resize
(
size
);
}
void
OpenMM_Vec3Array_append
(
OpenMM_Vec3Array
*
array
,
const
OpenMM_Vec3
vec
)
{
reinterpret_cast
<
vector
<
Vec3
>*>
(
array
)
->
push_back
(
Vec3
(
vec
.
x
,
vec
.
y
,
vec
.
z
));
}
void
OpenMM_Vec3Array_set
(
OpenMM_Vec3Array
*
array
,
int
index
,
const
OpenMM_Vec3
vec
)
{
(
*
reinterpret_cast
<
vector
<
Vec3
>*>
(
array
))[
index
]
=
Vec3
(
vec
.
x
,
vec
.
y
,
vec
.
z
);
}
const
OpenMM_Vec3
*
OpenMM_Vec3Array_get
(
const
OpenMM_Vec3Array
*
array
,
int
index
)
{
return
reinterpret_cast
<
const
OpenMM_Vec3
*>
((
&
(
*
reinterpret_cast
<
const
vector
<
Vec3
>*>
(
array
))[
index
]));
}
/* OpenMM_StringArray */
OpenMM_StringArray
*
OpenMM_StringArray_create
(
int
size
)
{
return
reinterpret_cast
<
OpenMM_StringArray
*>
(
new
vector
<
string
>
(
size
));
}
void
OpenMM_StringArray_destroy
(
OpenMM_StringArray
*
array
)
{
delete
reinterpret_cast
<
vector
<
string
>*>
(
array
);
}
int
OpenMM_StringArray_getSize
(
const
OpenMM_StringArray
*
array
)
{
return
reinterpret_cast
<
const
vector
<
string
>*>
(
array
)
->
size
();
}
void
OpenMM_StringArray_resize
(
OpenMM_StringArray
*
array
,
int
size
)
{
reinterpret_cast
<
vector
<
string
>*>
(
array
)
->
resize
(
size
);
}
void
OpenMM_StringArray_append
(
OpenMM_StringArray
*
array
,
const
char
*
str
)
{
reinterpret_cast
<
vector
<
string
>*>
(
array
)
->
push_back
(
string
(
str
));
}
void
OpenMM_StringArray_set
(
OpenMM_StringArray
*
array
,
int
index
,
const
char
*
str
)
{
(
*
reinterpret_cast
<
vector
<
string
>*>
(
array
))[
index
]
=
string
(
str
);
}
const
char
*
OpenMM_StringArray_get
(
const
OpenMM_StringArray
*
array
,
int
index
)
{
return
(
*
reinterpret_cast
<
const
vector
<
string
>*>
(
array
))[
index
].
c_str
();
}
/* OpenMM_BondArray */
OpenMM_BondArray
*
OpenMM_BondArray_create
(
int
size
)
{
return
reinterpret_cast
<
OpenMM_BondArray
*>
(
new
vector
<
pair
<
int
,
int
>
>
(
size
));
}
void
OpenMM_BondArray_destroy
(
OpenMM_BondArray
*
array
)
{
delete
reinterpret_cast
<
vector
<
pair
<
int
,
int
>
>*>
(
array
);
}
int
OpenMM_BondArray_getSize
(
const
OpenMM_BondArray
*
array
)
{
return
reinterpret_cast
<
const
vector
<
pair
<
int
,
int
>
>*>
(
array
)
->
size
();
}
void
OpenMM_BondArray_resize
(
OpenMM_BondArray
*
array
,
int
size
)
{
reinterpret_cast
<
vector
<
pair
<
int
,
int
>
>*>
(
array
)
->
resize
(
size
);
}
void
OpenMM_BondArray_append
(
OpenMM_BondArray
*
array
,
int
particle1
,
int
particle2
)
{
reinterpret_cast
<
vector
<
pair
<
int
,
int
>
>*>
(
array
)
->
push_back
(
pair
<
int
,
int
>
(
particle1
,
particle2
));
}
void
OpenMM_BondArray_set
(
OpenMM_BondArray
*
array
,
int
index
,
int
particle1
,
int
particle2
)
{
(
*
reinterpret_cast
<
vector
<
pair
<
int
,
int
>
>*>
(
array
))[
index
]
=
pair
<
int
,
int
>
(
particle1
,
particle2
);
}
void
OpenMM_BondArray_get
(
const
OpenMM_BondArray
*
array
,
int
index
,
int
*
particle1
,
int
*
particle2
)
{
pair
<
int
,
int
>
particles
=
(
*
reinterpret_cast
<
const
vector
<
pair
<
int
,
int
>
>*>
(
array
))[
index
];
*
particle1
=
particles
.
first
;
*
particle2
=
particles
.
second
;
}
/* OpenMM_ParameterArray */
int
OpenMM_ParameterArray_getSize
(
const
OpenMM_ParameterArray
*
array
)
{
return
reinterpret_cast
<
const
map
<
string
,
double
>*>
(
array
)
->
size
();
}
double
OpenMM_ParameterArray_get
(
const
OpenMM_ParameterArray
*
array
,
const
char
*
name
)
{
const
map
<
string
,
double
>*
params
=
reinterpret_cast
<
const
map
<
string
,
double
>*>
(
array
);
const
map
<
string
,
double
>::
const_iterator
iter
=
params
->
find
(
string
(
name
));
if
(
iter
==
params
->
end
())
throw
OpenMMException
(
"OpenMM_ParameterArray_get: No such parameter"
);
return
iter
->
second
;
}
/* These methods need to be handled specially, since their C++ APIs cannot be directly translated to C.
Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself. */
OpenMM_State
*
OpenMM_Context_getState
(
const
OpenMM_Context
*
target
,
int
types
)
{
State
result
=
reinterpret_cast
<
const
Context
*>
(
target
)
->
getState
(
types
);
return
reinterpret_cast
<
OpenMM_State
*>
(
new
State
(
result
));
};
OpenMM_StringArray
*
OpenMM_Platform_loadPluginsFromDirectory
(
const
char
*
directory
)
{
vector
<
string
>
result
=
Platform
::
loadPluginsFromDirectory
(
string
(
directory
));
return
reinterpret_cast
<
OpenMM_StringArray
*>
(
new
vector
<
string
>
(
result
));
};
/* OpenMM::HarmonicBondForce*/
OpenMM_HarmonicBondForce
*
OpenMM_HarmonicBondForce_create
()
{
return
reinterpret_cast
<
OpenMM_HarmonicBondForce
*>
(
new
HarmonicBondForce
());
}
void
OpenMM_HarmonicBondForce_destroy
(
OpenMM_HarmonicBondForce
*
target
)
{
delete
reinterpret_cast
<
HarmonicBondForce
*>
(
target
);
}
int
OpenMM_HarmonicBondForce_getNumBonds
(
const
OpenMM_HarmonicBondForce
*
target
)
{
int
result
=
reinterpret_cast
<
const
HarmonicBondForce
*>
(
target
)
->
getNumBonds
();
return
result
;
};
int
OpenMM_HarmonicBondForce_addBond
(
OpenMM_HarmonicBondForce
*
target
,
int
particle1
,
int
particle2
,
double
length
,
double
k
)
{
int
result
=
reinterpret_cast
<
HarmonicBondForce
*>
(
target
)
->
addBond
(
particle1
,
particle2
,
length
,
k
);
return
result
;
};
void
OpenMM_HarmonicBondForce_getBondParameters
(
const
OpenMM_HarmonicBondForce
*
target
,
int
index
,
int
*
particle1
,
int
*
particle2
,
double
*
length
,
double
*
k
)
{
reinterpret_cast
<
const
HarmonicBondForce
*>
(
target
)
->
getBondParameters
(
index
,
*
reinterpret_cast
<
int
*
>
(
particle1
),
*
reinterpret_cast
<
int
*
>
(
particle2
),
*
reinterpret_cast
<
double
*
>
(
length
),
*
reinterpret_cast
<
double
*
>
(
k
));
};
void
OpenMM_HarmonicBondForce_setBondParameters
(
OpenMM_HarmonicBondForce
*
target
,
int
index
,
int
particle1
,
int
particle2
,
double
length
,
double
k
)
{
reinterpret_cast
<
HarmonicBondForce
*>
(
target
)
->
setBondParameters
(
index
,
particle1
,
particle2
,
length
,
k
);
};
/* OpenMM::BrownianIntegrator*/
OpenMM_BrownianIntegrator
*
OpenMM_BrownianIntegrator_create
(
double
temperature
,
double
frictionCoeff
,
double
stepSize
)
{
return
reinterpret_cast
<
OpenMM_BrownianIntegrator
*>
(
new
BrownianIntegrator
(
temperature
,
frictionCoeff
,
stepSize
));
}
void
OpenMM_BrownianIntegrator_destroy
(
OpenMM_BrownianIntegrator
*
target
)
{
delete
reinterpret_cast
<
BrownianIntegrator
*>
(
target
);
}
double
OpenMM_BrownianIntegrator_getTemperature
(
const
OpenMM_BrownianIntegrator
*
target
)
{
double
result
=
reinterpret_cast
<
const
BrownianIntegrator
*>
(
target
)
->
getTemperature
();
return
result
;
};
void
OpenMM_BrownianIntegrator_setTemperature
(
OpenMM_BrownianIntegrator
*
target
,
double
temp
)
{
reinterpret_cast
<
BrownianIntegrator
*>
(
target
)
->
setTemperature
(
temp
);
};
double
OpenMM_BrownianIntegrator_getFriction
(
const
OpenMM_BrownianIntegrator
*
target
)
{
double
result
=
reinterpret_cast
<
const
BrownianIntegrator
*>
(
target
)
->
getFriction
();
return
result
;
};
void
OpenMM_BrownianIntegrator_setFriction
(
OpenMM_BrownianIntegrator
*
target
,
double
coeff
)
{
reinterpret_cast
<
BrownianIntegrator
*>
(
target
)
->
setFriction
(
coeff
);
};
int
OpenMM_BrownianIntegrator_getRandomNumberSeed
(
const
OpenMM_BrownianIntegrator
*
target
)
{
int
result
=
reinterpret_cast
<
const
BrownianIntegrator
*>
(
target
)
->
getRandomNumberSeed
();
return
result
;
};
void
OpenMM_BrownianIntegrator_setRandomNumberSeed
(
OpenMM_BrownianIntegrator
*
target
,
int
seed
)
{
reinterpret_cast
<
BrownianIntegrator
*>
(
target
)
->
setRandomNumberSeed
(
seed
);
};
void
OpenMM_BrownianIntegrator_step
(
OpenMM_BrownianIntegrator
*
target
,
int
steps
)
{
reinterpret_cast
<
BrownianIntegrator
*>
(
target
)
->
step
(
steps
);
};
/* OpenMM::OpenMMException*/
OpenMM_OpenMMException
*
OpenMM_OpenMMException_create
(
const
char
*
message
)
{
return
reinterpret_cast
<
OpenMM_OpenMMException
*>
(
new
OpenMMException
(
string
(
message
)));
}
void
OpenMM_OpenMMException_destroy
(
OpenMM_OpenMMException
*
target
)
{
delete
reinterpret_cast
<
OpenMMException
*>
(
target
);
}
const
char
*
OpenMM_OpenMMException_what
(
const
OpenMM_OpenMMException
*
target
)
{
const
char
*
result
=
reinterpret_cast
<
const
OpenMMException
*>
(
target
)
->
what
();
return
reinterpret_cast
<
const
char
*>
(
result
);
};
/* OpenMM::NonbondedForce*/
OpenMM_NonbondedForce
*
OpenMM_NonbondedForce_create
()
{
return
reinterpret_cast
<
OpenMM_NonbondedForce
*>
(
new
NonbondedForce
());
}
void
OpenMM_NonbondedForce_destroy
(
OpenMM_NonbondedForce
*
target
)
{
delete
reinterpret_cast
<
NonbondedForce
*>
(
target
);
}
int
OpenMM_NonbondedForce_getNumParticles
(
const
OpenMM_NonbondedForce
*
target
)
{
int
result
=
reinterpret_cast
<
const
NonbondedForce
*>
(
target
)
->
getNumParticles
();
return
result
;
};
int
OpenMM_NonbondedForce_getNumExceptions
(
const
OpenMM_NonbondedForce
*
target
)
{
int
result
=
reinterpret_cast
<
const
NonbondedForce
*>
(
target
)
->
getNumExceptions
();
return
result
;
};
OpenMM_NonbondedForce_NonbondedMethod
OpenMM_NonbondedForce_getNonbondedMethod
(
const
OpenMM_NonbondedForce
*
target
)
{
NonbondedForce
::
NonbondedMethod
result
=
reinterpret_cast
<
const
NonbondedForce
*>
(
target
)
->
getNonbondedMethod
();
return
static_cast
<
OpenMM_NonbondedForce_NonbondedMethod
>
(
result
);
};
void
OpenMM_NonbondedForce_setNonbondedMethod
(
OpenMM_NonbondedForce
*
target
,
OpenMM_NonbondedForce_NonbondedMethod
method
)
{
reinterpret_cast
<
NonbondedForce
*>
(
target
)
->
setNonbondedMethod
(
static_cast
<
NonbondedForce
::
NonbondedMethod
>
(
method
));
};
double
OpenMM_NonbondedForce_getCutoffDistance
(
const
OpenMM_NonbondedForce
*
target
)
{
double
result
=
reinterpret_cast
<
const
NonbondedForce
*>
(
target
)
->
getCutoffDistance
();
return
result
;
};
void
OpenMM_NonbondedForce_setCutoffDistance
(
OpenMM_NonbondedForce
*
target
,
double
distance
)
{
reinterpret_cast
<
NonbondedForce
*>
(
target
)
->
setCutoffDistance
(
distance
);
};
double
OpenMM_NonbondedForce_getReactionFieldDielectric
(
const
OpenMM_NonbondedForce
*
target
)
{
double
result
=
reinterpret_cast
<
const
NonbondedForce
*>
(
target
)
->
getReactionFieldDielectric
();
return
result
;
};
void
OpenMM_NonbondedForce_setReactionFieldDielectric
(
OpenMM_NonbondedForce
*
target
,
double
dielectric
)
{
reinterpret_cast
<
NonbondedForce
*>
(
target
)
->
setReactionFieldDielectric
(
dielectric
);
};
double
OpenMM_NonbondedForce_getEwaldErrorTolerance
(
const
OpenMM_NonbondedForce
*
target
)
{
double
result
=
reinterpret_cast
<
const
NonbondedForce
*>
(
target
)
->
getEwaldErrorTolerance
();
return
result
;
};
void
OpenMM_NonbondedForce_setEwaldErrorTolerance
(
OpenMM_NonbondedForce
*
target
,
double
tol
)
{
reinterpret_cast
<
NonbondedForce
*>
(
target
)
->
setEwaldErrorTolerance
(
tol
);
};
void
OpenMM_NonbondedForce_getPeriodicBoxVectors
(
const
OpenMM_NonbondedForce
*
target
,
OpenMM_Vec3
*
a
,
OpenMM_Vec3
*
b
,
OpenMM_Vec3
*
c
)
{
reinterpret_cast
<
const
NonbondedForce
*>
(
target
)
->
getPeriodicBoxVectors
(
*
reinterpret_cast
<
Vec3
*
>
(
a
),
*
reinterpret_cast
<
Vec3
*
>
(
b
),
*
reinterpret_cast
<
Vec3
*
>
(
c
));
};
void
OpenMM_NonbondedForce_setPeriodicBoxVectors
(
OpenMM_NonbondedForce
*
target
,
OpenMM_Vec3
a
,
OpenMM_Vec3
b
,
OpenMM_Vec3
c
)
{
reinterpret_cast
<
NonbondedForce
*>
(
target
)
->
setPeriodicBoxVectors
(
Vec3
(
a
.
x
,
a
.
y
,
a
.
z
),
Vec3
(
b
.
x
,
b
.
y
,
b
.
z
),
Vec3
(
c
.
x
,
c
.
y
,
c
.
z
));
};
int
OpenMM_NonbondedForce_addParticle
(
OpenMM_NonbondedForce
*
target
,
double
charge
,
double
sigma
,
double
epsilon
)
{
int
result
=
reinterpret_cast
<
NonbondedForce
*>
(
target
)
->
addParticle
(
charge
,
sigma
,
epsilon
);
return
result
;
};
void
OpenMM_NonbondedForce_getParticleParameters
(
const
OpenMM_NonbondedForce
*
target
,
int
index
,
double
*
charge
,
double
*
sigma
,
double
*
epsilon
)
{
reinterpret_cast
<
const
NonbondedForce
*>
(
target
)
->
getParticleParameters
(
index
,
*
reinterpret_cast
<
double
*
>
(
charge
),
*
reinterpret_cast
<
double
*
>
(
sigma
),
*
reinterpret_cast
<
double
*
>
(
epsilon
));
};
void
OpenMM_NonbondedForce_setParticleParameters
(
OpenMM_NonbondedForce
*
target
,
int
index
,
double
charge
,
double
sigma
,
double
epsilon
)
{
reinterpret_cast
<
NonbondedForce
*>
(
target
)
->
setParticleParameters
(
index
,
charge
,
sigma
,
epsilon
);
};
int
OpenMM_NonbondedForce_addException
(
OpenMM_NonbondedForce
*
target
,
int
particle1
,
int
particle2
,
double
chargeProd
,
double
sigma
,
double
epsilon
,
OpenMM_Boolean
replace
)
{
int
result
=
reinterpret_cast
<
NonbondedForce
*>
(
target
)
->
addException
(
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
,
(
replace
!=
OpenMM_False
));
return
result
;
};
void
OpenMM_NonbondedForce_getExceptionParameters
(
const
OpenMM_NonbondedForce
*
target
,
int
index
,
int
*
particle1
,
int
*
particle2
,
double
*
chargeProd
,
double
*
sigma
,
double
*
epsilon
)
{
reinterpret_cast
<
const
NonbondedForce
*>
(
target
)
->
getExceptionParameters
(
index
,
*
reinterpret_cast
<
int
*
>
(
particle1
),
*
reinterpret_cast
<
int
*
>
(
particle2
),
*
reinterpret_cast
<
double
*
>
(
chargeProd
),
*
reinterpret_cast
<
double
*
>
(
sigma
),
*
reinterpret_cast
<
double
*
>
(
epsilon
));
};
void
OpenMM_NonbondedForce_setExceptionParameters
(
OpenMM_NonbondedForce
*
target
,
int
index
,
int
particle1
,
int
particle2
,
double
chargeProd
,
double
sigma
,
double
epsilon
)
{
reinterpret_cast
<
NonbondedForce
*>
(
target
)
->
setExceptionParameters
(
index
,
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
);
};
void
OpenMM_NonbondedForce_createExceptionsFromBonds
(
OpenMM_NonbondedForce
*
target
,
const
OpenMM_BondArray
*
bonds
,
double
coulomb14Scale
,
double
lj14Scale
)
{
reinterpret_cast
<
NonbondedForce
*>
(
target
)
->
createExceptionsFromBonds
(
*
reinterpret_cast
<
const
vector
<
pair
<
int
,
int
>
>*
>
(
bonds
),
coulomb14Scale
,
lj14Scale
);
};
/* OpenMM::VariableLangevinIntegrator*/
OpenMM_VariableLangevinIntegrator
*
OpenMM_VariableLangevinIntegrator_create
(
double
temperature
,
double
frictionCoeff
,
double
errorTol
)
{
return
reinterpret_cast
<
OpenMM_VariableLangevinIntegrator
*>
(
new
VariableLangevinIntegrator
(
temperature
,
frictionCoeff
,
errorTol
));
}
void
OpenMM_VariableLangevinIntegrator_destroy
(
OpenMM_VariableLangevinIntegrator
*
target
)
{
delete
reinterpret_cast
<
VariableLangevinIntegrator
*>
(
target
);
}
double
OpenMM_VariableLangevinIntegrator_getTemperature
(
const
OpenMM_VariableLangevinIntegrator
*
target
)
{
double
result
=
reinterpret_cast
<
const
VariableLangevinIntegrator
*>
(
target
)
->
getTemperature
();
return
result
;
};
void
OpenMM_VariableLangevinIntegrator_setTemperature
(
OpenMM_VariableLangevinIntegrator
*
target
,
double
temp
)
{
reinterpret_cast
<
VariableLangevinIntegrator
*>
(
target
)
->
setTemperature
(
temp
);
};
double
OpenMM_VariableLangevinIntegrator_getFriction
(
const
OpenMM_VariableLangevinIntegrator
*
target
)
{
double
result
=
reinterpret_cast
<
const
VariableLangevinIntegrator
*>
(
target
)
->
getFriction
();
return
result
;
};
void
OpenMM_VariableLangevinIntegrator_setFriction
(
OpenMM_VariableLangevinIntegrator
*
target
,
double
coeff
)
{
reinterpret_cast
<
VariableLangevinIntegrator
*>
(
target
)
->
setFriction
(
coeff
);
};
double
OpenMM_VariableLangevinIntegrator_getErrorTolerance
(
const
OpenMM_VariableLangevinIntegrator
*
target
)
{
double
result
=
reinterpret_cast
<
const
VariableLangevinIntegrator
*>
(
target
)
->
getErrorTolerance
();
return
result
;
};
void
OpenMM_VariableLangevinIntegrator_setErrorTolerance
(
OpenMM_VariableLangevinIntegrator
*
target
,
double
tol
)
{
reinterpret_cast
<
VariableLangevinIntegrator
*>
(
target
)
->
setErrorTolerance
(
tol
);
};
int
OpenMM_VariableLangevinIntegrator_getRandomNumberSeed
(
const
OpenMM_VariableLangevinIntegrator
*
target
)
{
int
result
=
reinterpret_cast
<
const
VariableLangevinIntegrator
*>
(
target
)
->
getRandomNumberSeed
();
return
result
;
};
void
OpenMM_VariableLangevinIntegrator_setRandomNumberSeed
(
OpenMM_VariableLangevinIntegrator
*
target
,
int
seed
)
{
reinterpret_cast
<
VariableLangevinIntegrator
*>
(
target
)
->
setRandomNumberSeed
(
seed
);
};
void
OpenMM_VariableLangevinIntegrator_step
(
OpenMM_VariableLangevinIntegrator
*
target
,
int
steps
)
{
reinterpret_cast
<
VariableLangevinIntegrator
*>
(
target
)
->
step
(
steps
);
};
void
OpenMM_VariableLangevinIntegrator_stepTo
(
OpenMM_VariableLangevinIntegrator
*
target
,
double
time
)
{
reinterpret_cast
<
VariableLangevinIntegrator
*>
(
target
)
->
stepTo
(
time
);
};
/* OpenMM::GBVIForce*/
OpenMM_GBVIForce
*
OpenMM_GBVIForce_create
()
{
return
reinterpret_cast
<
OpenMM_GBVIForce
*>
(
new
GBVIForce
());
}
void
OpenMM_GBVIForce_destroy
(
OpenMM_GBVIForce
*
target
)
{
delete
reinterpret_cast
<
GBVIForce
*>
(
target
);
}
int
OpenMM_GBVIForce_getNumParticles
(
const
OpenMM_GBVIForce
*
target
)
{
int
result
=
reinterpret_cast
<
const
GBVIForce
*>
(
target
)
->
getNumParticles
();
return
result
;
};
int
OpenMM_GBVIForce_addParticle
(
OpenMM_GBVIForce
*
target
,
double
charge
,
double
radius
,
double
gamma
)
{
int
result
=
reinterpret_cast
<
GBVIForce
*>
(
target
)
->
addParticle
(
charge
,
radius
,
gamma
);
return
result
;
};
void
OpenMM_GBVIForce_getParticleParameters
(
const
OpenMM_GBVIForce
*
target
,
int
index
,
double
*
charge
,
double
*
radius
,
double
*
gamma
)
{
reinterpret_cast
<
const
GBVIForce
*>
(
target
)
->
getParticleParameters
(
index
,
*
reinterpret_cast
<
double
*
>
(
charge
),
*
reinterpret_cast
<
double
*
>
(
radius
),
*
reinterpret_cast
<
double
*
>
(
gamma
));
};
void
OpenMM_GBVIForce_setParticleParameters
(
OpenMM_GBVIForce
*
target
,
int
index
,
double
charge
,
double
radius
,
double
gamma
)
{
reinterpret_cast
<
GBVIForce
*>
(
target
)
->
setParticleParameters
(
index
,
charge
,
radius
,
gamma
);
};
double
OpenMM_GBVIForce_getSolventDielectric
(
const
OpenMM_GBVIForce
*
target
)
{
double
result
=
reinterpret_cast
<
const
GBVIForce
*>
(
target
)
->
getSolventDielectric
();
return
result
;
};
void
OpenMM_GBVIForce_setSolventDielectric
(
OpenMM_GBVIForce
*
target
,
double
dielectric
)
{
reinterpret_cast
<
GBVIForce
*>
(
target
)
->
setSolventDielectric
(
dielectric
);
};
double
OpenMM_GBVIForce_getSoluteDielectric
(
const
OpenMM_GBVIForce
*
target
)
{
double
result
=
reinterpret_cast
<
const
GBVIForce
*>
(
target
)
->
getSoluteDielectric
();
return
result
;
};
void
OpenMM_GBVIForce_setSoluteDielectric
(
OpenMM_GBVIForce
*
target
,
double
dielectric
)
{
reinterpret_cast
<
GBVIForce
*>
(
target
)
->
setSoluteDielectric
(
dielectric
);
};
/* OpenMM::Context*/
OpenMM_Context
*
OpenMM_Context_create
(
OpenMM_System
*
system
,
OpenMM_Integrator
*
integrator
)
{
return
reinterpret_cast
<
OpenMM_Context
*>
(
new
Context
(
*
reinterpret_cast
<
System
*
>
(
system
),
*
reinterpret_cast
<
Integrator
*
>
(
integrator
)));
}
OpenMM_Context
*
OpenMM_Context_create_2
(
OpenMM_System
*
system
,
OpenMM_Integrator
*
integrator
,
OpenMM_Platform
*
platform
)
{
return
reinterpret_cast
<
OpenMM_Context
*>
(
new
Context
(
*
reinterpret_cast
<
System
*
>
(
system
),
*
reinterpret_cast
<
Integrator
*
>
(
integrator
),
*
reinterpret_cast
<
Platform
*
>
(
platform
)));
}
void
OpenMM_Context_destroy
(
OpenMM_Context
*
target
)
{
delete
reinterpret_cast
<
Context
*>
(
target
);
}
OpenMM_System
*
OpenMM_Context_getSystem
(
OpenMM_Context
*
target
)
{
System
*
result
=
&
reinterpret_cast
<
Context
*>
(
target
)
->
getSystem
();
return
reinterpret_cast
<
OpenMM_System
*>
(
result
);
};
OpenMM_Integrator
*
OpenMM_Context_getIntegrator
(
OpenMM_Context
*
target
)
{
Integrator
*
result
=
&
reinterpret_cast
<
Context
*>
(
target
)
->
getIntegrator
();
return
reinterpret_cast
<
OpenMM_Integrator
*>
(
result
);
};
OpenMM_Platform
*
OpenMM_Context_getPlatform
(
OpenMM_Context
*
target
)
{
Platform
*
result
=
&
reinterpret_cast
<
Context
*>
(
target
)
->
getPlatform
();
return
reinterpret_cast
<
OpenMM_Platform
*>
(
result
);
};
void
OpenMM_Context_setTime
(
OpenMM_Context
*
target
,
double
time
)
{
reinterpret_cast
<
Context
*>
(
target
)
->
setTime
(
time
);
};
void
OpenMM_Context_setPositions
(
OpenMM_Context
*
target
,
const
OpenMM_Vec3Array
*
positions
)
{
reinterpret_cast
<
Context
*>
(
target
)
->
setPositions
(
*
reinterpret_cast
<
const
vector
<
Vec3
>*
>
(
positions
));
};
void
OpenMM_Context_setVelocities
(
OpenMM_Context
*
target
,
const
OpenMM_Vec3Array
*
velocities
)
{
reinterpret_cast
<
Context
*>
(
target
)
->
setVelocities
(
*
reinterpret_cast
<
const
vector
<
Vec3
>*
>
(
velocities
));
};
double
OpenMM_Context_getParameter
(
OpenMM_Context
*
target
,
const
char
*
name
)
{
double
result
=
reinterpret_cast
<
Context
*>
(
target
)
->
getParameter
(
string
(
name
));
return
result
;
};
void
OpenMM_Context_setParameter
(
OpenMM_Context
*
target
,
const
char
*
name
,
double
value
)
{
reinterpret_cast
<
Context
*>
(
target
)
->
setParameter
(
string
(
name
),
value
);
};
void
OpenMM_Context_reinitialize
(
OpenMM_Context
*
target
)
{
reinterpret_cast
<
Context
*>
(
target
)
->
reinitialize
();
};
/* OpenMM::GBSAOBCForce*/
OpenMM_GBSAOBCForce
*
OpenMM_GBSAOBCForce_create
()
{
return
reinterpret_cast
<
OpenMM_GBSAOBCForce
*>
(
new
GBSAOBCForce
());
}
void
OpenMM_GBSAOBCForce_destroy
(
OpenMM_GBSAOBCForce
*
target
)
{
delete
reinterpret_cast
<
GBSAOBCForce
*>
(
target
);
}
int
OpenMM_GBSAOBCForce_getNumParticles
(
const
OpenMM_GBSAOBCForce
*
target
)
{
int
result
=
reinterpret_cast
<
const
GBSAOBCForce
*>
(
target
)
->
getNumParticles
();
return
result
;
};
int
OpenMM_GBSAOBCForce_addParticle
(
OpenMM_GBSAOBCForce
*
target
,
double
charge
,
double
radius
,
double
scalingFactor
)
{
int
result
=
reinterpret_cast
<
GBSAOBCForce
*>
(
target
)
->
addParticle
(
charge
,
radius
,
scalingFactor
);
return
result
;
};
void
OpenMM_GBSAOBCForce_getParticleParameters
(
const
OpenMM_GBSAOBCForce
*
target
,
int
index
,
double
*
charge
,
double
*
radius
,
double
*
scalingFactor
)
{
reinterpret_cast
<
const
GBSAOBCForce
*>
(
target
)
->
getParticleParameters
(
index
,
*
reinterpret_cast
<
double
*
>
(
charge
),
*
reinterpret_cast
<
double
*
>
(
radius
),
*
reinterpret_cast
<
double
*
>
(
scalingFactor
));
};
void
OpenMM_GBSAOBCForce_setParticleParameters
(
OpenMM_GBSAOBCForce
*
target
,
int
index
,
double
charge
,
double
radius
,
double
scalingFactor
)
{
reinterpret_cast
<
GBSAOBCForce
*>
(
target
)
->
setParticleParameters
(
index
,
charge
,
radius
,
scalingFactor
);
};
double
OpenMM_GBSAOBCForce_getSolventDielectric
(
const
OpenMM_GBSAOBCForce
*
target
)
{
double
result
=
reinterpret_cast
<
const
GBSAOBCForce
*>
(
target
)
->
getSolventDielectric
();
return
result
;
};
void
OpenMM_GBSAOBCForce_setSolventDielectric
(
OpenMM_GBSAOBCForce
*
target
,
double
dielectric
)
{
reinterpret_cast
<
GBSAOBCForce
*>
(
target
)
->
setSolventDielectric
(
dielectric
);
};
double
OpenMM_GBSAOBCForce_getSoluteDielectric
(
const
OpenMM_GBSAOBCForce
*
target
)
{
double
result
=
reinterpret_cast
<
const
GBSAOBCForce
*>
(
target
)
->
getSoluteDielectric
();
return
result
;
};
void
OpenMM_GBSAOBCForce_setSoluteDielectric
(
OpenMM_GBSAOBCForce
*
target
,
double
dielectric
)
{
reinterpret_cast
<
GBSAOBCForce
*>
(
target
)
->
setSoluteDielectric
(
dielectric
);
};
/* OpenMM::VariableVerletIntegrator*/
OpenMM_VariableVerletIntegrator
*
OpenMM_VariableVerletIntegrator_create
(
double
errorTol
)
{
return
reinterpret_cast
<
OpenMM_VariableVerletIntegrator
*>
(
new
VariableVerletIntegrator
(
errorTol
));
}
void
OpenMM_VariableVerletIntegrator_destroy
(
OpenMM_VariableVerletIntegrator
*
target
)
{
delete
reinterpret_cast
<
VariableVerletIntegrator
*>
(
target
);
}
double
OpenMM_VariableVerletIntegrator_getErrorTolerance
(
const
OpenMM_VariableVerletIntegrator
*
target
)
{
double
result
=
reinterpret_cast
<
const
VariableVerletIntegrator
*>
(
target
)
->
getErrorTolerance
();
return
result
;
};
void
OpenMM_VariableVerletIntegrator_setErrorTolerance
(
OpenMM_VariableVerletIntegrator
*
target
,
double
tol
)
{
reinterpret_cast
<
VariableVerletIntegrator
*>
(
target
)
->
setErrorTolerance
(
tol
);
};
void
OpenMM_VariableVerletIntegrator_step
(
OpenMM_VariableVerletIntegrator
*
target
,
int
steps
)
{
reinterpret_cast
<
VariableVerletIntegrator
*>
(
target
)
->
step
(
steps
);
};
void
OpenMM_VariableVerletIntegrator_stepTo
(
OpenMM_VariableVerletIntegrator
*
target
,
double
time
)
{
reinterpret_cast
<
VariableVerletIntegrator
*>
(
target
)
->
stepTo
(
time
);
};
/* OpenMM::CMMotionRemover*/
OpenMM_CMMotionRemover
*
OpenMM_CMMotionRemover_create
(
int
frequency
)
{
return
reinterpret_cast
<
OpenMM_CMMotionRemover
*>
(
new
CMMotionRemover
(
frequency
));
}
void
OpenMM_CMMotionRemover_destroy
(
OpenMM_CMMotionRemover
*
target
)
{
delete
reinterpret_cast
<
CMMotionRemover
*>
(
target
);
}
int
OpenMM_CMMotionRemover_getFrequency
(
const
OpenMM_CMMotionRemover
*
target
)
{
int
result
=
reinterpret_cast
<
const
CMMotionRemover
*>
(
target
)
->
getFrequency
();
return
result
;
};
void
OpenMM_CMMotionRemover_setFrequency
(
OpenMM_CMMotionRemover
*
target
,
int
freq
)
{
reinterpret_cast
<
CMMotionRemover
*>
(
target
)
->
setFrequency
(
freq
);
};
/* OpenMM::VerletIntegrator*/
OpenMM_VerletIntegrator
*
OpenMM_VerletIntegrator_create
(
double
stepSize
)
{
return
reinterpret_cast
<
OpenMM_VerletIntegrator
*>
(
new
VerletIntegrator
(
stepSize
));
}
void
OpenMM_VerletIntegrator_destroy
(
OpenMM_VerletIntegrator
*
target
)
{
delete
reinterpret_cast
<
VerletIntegrator
*>
(
target
);
}
void
OpenMM_VerletIntegrator_step
(
OpenMM_VerletIntegrator
*
target
,
int
steps
)
{
reinterpret_cast
<
VerletIntegrator
*>
(
target
)
->
step
(
steps
);
};
/* OpenMM::RBTorsionForce*/
OpenMM_RBTorsionForce
*
OpenMM_RBTorsionForce_create
()
{
return
reinterpret_cast
<
OpenMM_RBTorsionForce
*>
(
new
RBTorsionForce
());
}
void
OpenMM_RBTorsionForce_destroy
(
OpenMM_RBTorsionForce
*
target
)
{
delete
reinterpret_cast
<
RBTorsionForce
*>
(
target
);
}
int
OpenMM_RBTorsionForce_getNumTorsions
(
const
OpenMM_RBTorsionForce
*
target
)
{
int
result
=
reinterpret_cast
<
const
RBTorsionForce
*>
(
target
)
->
getNumTorsions
();
return
result
;
};
int
OpenMM_RBTorsionForce_addTorsion
(
OpenMM_RBTorsionForce
*
target
,
int
particle1
,
int
particle2
,
int
particle3
,
int
particle4
,
double
c0
,
double
c1
,
double
c2
,
double
c3
,
double
c4
,
double
c5
)
{
int
result
=
reinterpret_cast
<
RBTorsionForce
*>
(
target
)
->
addTorsion
(
particle1
,
particle2
,
particle3
,
particle4
,
c0
,
c1
,
c2
,
c3
,
c4
,
c5
);
return
result
;
};
void
OpenMM_RBTorsionForce_getTorsionParameters
(
const
OpenMM_RBTorsionForce
*
target
,
int
index
,
int
*
particle1
,
int
*
particle2
,
int
*
particle3
,
int
*
particle4
,
double
*
c0
,
double
*
c1
,
double
*
c2
,
double
*
c3
,
double
*
c4
,
double
*
c5
)
{
reinterpret_cast
<
const
RBTorsionForce
*>
(
target
)
->
getTorsionParameters
(
index
,
*
reinterpret_cast
<
int
*
>
(
particle1
),
*
reinterpret_cast
<
int
*
>
(
particle2
),
*
reinterpret_cast
<
int
*
>
(
particle3
),
*
reinterpret_cast
<
int
*
>
(
particle4
),
*
reinterpret_cast
<
double
*
>
(
c0
),
*
reinterpret_cast
<
double
*
>
(
c1
),
*
reinterpret_cast
<
double
*
>
(
c2
),
*
reinterpret_cast
<
double
*
>
(
c3
),
*
reinterpret_cast
<
double
*
>
(
c4
),
*
reinterpret_cast
<
double
*
>
(
c5
));
};
void
OpenMM_RBTorsionForce_setTorsionParameters
(
OpenMM_RBTorsionForce
*
target
,
int
index
,
int
particle1
,
int
particle2
,
int
particle3
,
int
particle4
,
double
c0
,
double
c1
,
double
c2
,
double
c3
,
double
c4
,
double
c5
)
{
reinterpret_cast
<
RBTorsionForce
*>
(
target
)
->
setTorsionParameters
(
index
,
particle1
,
particle2
,
particle3
,
particle4
,
c0
,
c1
,
c2
,
c3
,
c4
,
c5
);
};
/* OpenMM::LangevinIntegrator*/
OpenMM_LangevinIntegrator
*
OpenMM_LangevinIntegrator_create
(
double
temperature
,
double
frictionCoeff
,
double
stepSize
)
{
return
reinterpret_cast
<
OpenMM_LangevinIntegrator
*>
(
new
LangevinIntegrator
(
temperature
,
frictionCoeff
,
stepSize
));
}
void
OpenMM_LangevinIntegrator_destroy
(
OpenMM_LangevinIntegrator
*
target
)
{
delete
reinterpret_cast
<
LangevinIntegrator
*>
(
target
);
}
double
OpenMM_LangevinIntegrator_getTemperature
(
const
OpenMM_LangevinIntegrator
*
target
)
{
double
result
=
reinterpret_cast
<
const
LangevinIntegrator
*>
(
target
)
->
getTemperature
();
return
result
;
};
void
OpenMM_LangevinIntegrator_setTemperature
(
OpenMM_LangevinIntegrator
*
target
,
double
temp
)
{
reinterpret_cast
<
LangevinIntegrator
*>
(
target
)
->
setTemperature
(
temp
);
};
double
OpenMM_LangevinIntegrator_getFriction
(
const
OpenMM_LangevinIntegrator
*
target
)
{
double
result
=
reinterpret_cast
<
const
LangevinIntegrator
*>
(
target
)
->
getFriction
();
return
result
;
};
void
OpenMM_LangevinIntegrator_setFriction
(
OpenMM_LangevinIntegrator
*
target
,
double
coeff
)
{
reinterpret_cast
<
LangevinIntegrator
*>
(
target
)
->
setFriction
(
coeff
);
};
int
OpenMM_LangevinIntegrator_getRandomNumberSeed
(
const
OpenMM_LangevinIntegrator
*
target
)
{
int
result
=
reinterpret_cast
<
const
LangevinIntegrator
*>
(
target
)
->
getRandomNumberSeed
();
return
result
;
};
void
OpenMM_LangevinIntegrator_setRandomNumberSeed
(
OpenMM_LangevinIntegrator
*
target
,
int
seed
)
{
reinterpret_cast
<
LangevinIntegrator
*>
(
target
)
->
setRandomNumberSeed
(
seed
);
};
void
OpenMM_LangevinIntegrator_step
(
OpenMM_LangevinIntegrator
*
target
,
int
steps
)
{
reinterpret_cast
<
LangevinIntegrator
*>
(
target
)
->
step
(
steps
);
};
/* OpenMM::Force*/
void
OpenMM_Force_destroy
(
OpenMM_Force
*
target
)
{
delete
reinterpret_cast
<
Force
*>
(
target
);
}
/* OpenMM::HarmonicAngleForce*/
OpenMM_HarmonicAngleForce
*
OpenMM_HarmonicAngleForce_create
()
{
return
reinterpret_cast
<
OpenMM_HarmonicAngleForce
*>
(
new
HarmonicAngleForce
());
}
void
OpenMM_HarmonicAngleForce_destroy
(
OpenMM_HarmonicAngleForce
*
target
)
{
delete
reinterpret_cast
<
HarmonicAngleForce
*>
(
target
);
}
int
OpenMM_HarmonicAngleForce_getNumAngles
(
const
OpenMM_HarmonicAngleForce
*
target
)
{
int
result
=
reinterpret_cast
<
const
HarmonicAngleForce
*>
(
target
)
->
getNumAngles
();
return
result
;
};
int
OpenMM_HarmonicAngleForce_addAngle
(
OpenMM_HarmonicAngleForce
*
target
,
int
particle1
,
int
particle2
,
int
particle3
,
double
angle
,
double
k
)
{
int
result
=
reinterpret_cast
<
HarmonicAngleForce
*>
(
target
)
->
addAngle
(
particle1
,
particle2
,
particle3
,
angle
,
k
);
return
result
;
};
void
OpenMM_HarmonicAngleForce_getAngleParameters
(
const
OpenMM_HarmonicAngleForce
*
target
,
int
index
,
int
*
particle1
,
int
*
particle2
,
int
*
particle3
,
double
*
angle
,
double
*
k
)
{
reinterpret_cast
<
const
HarmonicAngleForce
*>
(
target
)
->
getAngleParameters
(
index
,
*
reinterpret_cast
<
int
*
>
(
particle1
),
*
reinterpret_cast
<
int
*
>
(
particle2
),
*
reinterpret_cast
<
int
*
>
(
particle3
),
*
reinterpret_cast
<
double
*
>
(
angle
),
*
reinterpret_cast
<
double
*
>
(
k
));
};
void
OpenMM_HarmonicAngleForce_setAngleParameters
(
OpenMM_HarmonicAngleForce
*
target
,
int
index
,
int
particle1
,
int
particle2
,
int
particle3
,
double
angle
,
double
k
)
{
reinterpret_cast
<
HarmonicAngleForce
*>
(
target
)
->
setAngleParameters
(
index
,
particle1
,
particle2
,
particle3
,
angle
,
k
);
};
/* OpenMM::AndersenThermostat*/
OpenMM_AndersenThermostat
*
OpenMM_AndersenThermostat_create
(
double
defaultTemperature
,
double
defaultCollisionFrequency
)
{
return
reinterpret_cast
<
OpenMM_AndersenThermostat
*>
(
new
AndersenThermostat
(
defaultTemperature
,
defaultCollisionFrequency
));
}
void
OpenMM_AndersenThermostat_destroy
(
OpenMM_AndersenThermostat
*
target
)
{
delete
reinterpret_cast
<
AndersenThermostat
*>
(
target
);
}
const
char
*
OpenMM_AndersenThermostat_Temperature
()
{
const
string
*
result
=
&
AndersenThermostat
::
Temperature
();
return
result
->
c_str
();
};
const
char
*
OpenMM_AndersenThermostat_CollisionFrequency
()
{
const
string
*
result
=
&
AndersenThermostat
::
CollisionFrequency
();
return
result
->
c_str
();
};
double
OpenMM_AndersenThermostat_getDefaultTemperature
(
const
OpenMM_AndersenThermostat
*
target
)
{
double
result
=
reinterpret_cast
<
const
AndersenThermostat
*>
(
target
)
->
getDefaultTemperature
();
return
result
;
};
double
OpenMM_AndersenThermostat_getDefaultCollisionFrequency
(
const
OpenMM_AndersenThermostat
*
target
)
{
double
result
=
reinterpret_cast
<
const
AndersenThermostat
*>
(
target
)
->
getDefaultCollisionFrequency
();
return
result
;
};
int
OpenMM_AndersenThermostat_getRandomNumberSeed
(
const
OpenMM_AndersenThermostat
*
target
)
{
int
result
=
reinterpret_cast
<
const
AndersenThermostat
*>
(
target
)
->
getRandomNumberSeed
();
return
result
;
};
void
OpenMM_AndersenThermostat_setRandomNumberSeed
(
OpenMM_AndersenThermostat
*
target
,
int
seed
)
{
reinterpret_cast
<
AndersenThermostat
*>
(
target
)
->
setRandomNumberSeed
(
seed
);
};
/* OpenMM::Platform*/
void
OpenMM_Platform_destroy
(
OpenMM_Platform
*
target
)
{
delete
reinterpret_cast
<
Platform
*>
(
target
);
}
const
char
*
OpenMM_Platform_getName
(
const
OpenMM_Platform
*
target
)
{
const
string
*
result
=
&
reinterpret_cast
<
const
Platform
*>
(
target
)
->
getName
();
return
result
->
c_str
();
};
double
OpenMM_Platform_getSpeed
(
const
OpenMM_Platform
*
target
)
{
double
result
=
reinterpret_cast
<
const
Platform
*>
(
target
)
->
getSpeed
();
return
result
;
};
OpenMM_Boolean
OpenMM_Platform_supportsDoublePrecision
(
const
OpenMM_Platform
*
target
)
{
bool
result
=
reinterpret_cast
<
const
Platform
*>
(
target
)
->
supportsDoublePrecision
();
return
(
result
?
OpenMM_True
:
OpenMM_False
);
};
const
OpenMM_StringArray
*
OpenMM_Platform_getPropertyNames
(
OpenMM_Platform
*
target
)
{
const
vector
<
string
>*
result
=
&
reinterpret_cast
<
Platform
*>
(
target
)
->
getPropertyNames
();
return
reinterpret_cast
<
const
OpenMM_StringArray
*>
(
result
);
};
const
char
*
OpenMM_Platform_getPropertyValue
(
const
OpenMM_Platform
*
target
,
const
OpenMM_Context
*
context
,
const
char
*
property
)
{
const
string
*
result
=
&
reinterpret_cast
<
const
Platform
*>
(
target
)
->
getPropertyValue
(
*
reinterpret_cast
<
const
Context
*
>
(
context
),
string
(
property
));
return
result
->
c_str
();
};
void
OpenMM_Platform_setPropertyValue
(
const
OpenMM_Platform
*
target
,
OpenMM_Context
*
context
,
const
char
*
property
,
const
char
*
value
)
{
reinterpret_cast
<
const
Platform
*>
(
target
)
->
setPropertyValue
(
*
reinterpret_cast
<
Context
*
>
(
context
),
string
(
property
),
string
(
value
));
};
const
char
*
OpenMM_Platform_getPropertyDefaultValue
(
const
OpenMM_Platform
*
target
,
const
char
*
property
)
{
const
string
*
result
=
&
reinterpret_cast
<
const
Platform
*>
(
target
)
->
getPropertyDefaultValue
(
string
(
property
));
return
result
->
c_str
();
};
void
OpenMM_Platform_setPropertyDefaultValue
(
OpenMM_Platform
*
target
,
const
char
*
property
,
const
char
*
value
)
{
reinterpret_cast
<
Platform
*>
(
target
)
->
setPropertyDefaultValue
(
string
(
property
),
string
(
value
));
};
void
OpenMM_Platform_contextCreated
(
const
OpenMM_Platform
*
target
,
OpenMM_ContextImpl
*
context
)
{
reinterpret_cast
<
const
Platform
*>
(
target
)
->
contextCreated
(
*
reinterpret_cast
<
ContextImpl
*
>
(
context
));
};
void
OpenMM_Platform_contextDestroyed
(
const
OpenMM_Platform
*
target
,
OpenMM_ContextImpl
*
context
)
{
reinterpret_cast
<
const
Platform
*>
(
target
)
->
contextDestroyed
(
*
reinterpret_cast
<
ContextImpl
*
>
(
context
));
};
OpenMM_Boolean
OpenMM_Platform_supportsKernels
(
const
OpenMM_Platform
*
target
,
const
OpenMM_StringArray
*
kernelNames
)
{
bool
result
=
reinterpret_cast
<
const
Platform
*>
(
target
)
->
supportsKernels
(
*
reinterpret_cast
<
const
vector
<
string
>*
>
(
kernelNames
));
return
(
result
?
OpenMM_True
:
OpenMM_False
);
};
void
OpenMM_Platform_registerPlatform
(
OpenMM_Platform
*
platform
)
{
Platform
::
registerPlatform
(
reinterpret_cast
<
Platform
*
>
(
platform
));
};
int
OpenMM_Platform_getNumPlatforms
()
{
int
result
=
Platform
::
getNumPlatforms
();
return
result
;
};
OpenMM_Platform
*
OpenMM_Platform_getPlatform
(
int
index
)
{
Platform
*
result
=
&
Platform
::
getPlatform
(
index
);
return
reinterpret_cast
<
OpenMM_Platform
*>
(
result
);
};
OpenMM_Platform
*
OpenMM_Platform_findPlatform
(
const
OpenMM_StringArray
*
kernelNames
)
{
Platform
*
result
=
&
Platform
::
findPlatform
(
*
reinterpret_cast
<
const
vector
<
string
>*
>
(
kernelNames
));
return
reinterpret_cast
<
OpenMM_Platform
*>
(
result
);
};
void
OpenMM_Platform_loadPluginLibrary
(
const
char
*
file
)
{
Platform
::
loadPluginLibrary
(
string
(
file
));
};
const
char
*
OpenMM_Platform_getDefaultPluginsDirectory
()
{
const
string
*
result
=
&
Platform
::
getDefaultPluginsDirectory
();
return
result
->
c_str
();
};
/* OpenMM::State*/
void
OpenMM_State_destroy
(
OpenMM_State
*
target
)
{
delete
reinterpret_cast
<
State
*>
(
target
);
}
double
OpenMM_State_getTime
(
const
OpenMM_State
*
target
)
{
double
result
=
reinterpret_cast
<
const
State
*>
(
target
)
->
getTime
();
return
result
;
};
const
OpenMM_Vec3Array
*
OpenMM_State_getPositions
(
const
OpenMM_State
*
target
)
{
const
vector
<
Vec3
>*
result
=
&
reinterpret_cast
<
const
State
*>
(
target
)
->
getPositions
();
return
reinterpret_cast
<
const
OpenMM_Vec3Array
*>
(
result
);
};
const
OpenMM_Vec3Array
*
OpenMM_State_getVelocities
(
const
OpenMM_State
*
target
)
{
const
vector
<
Vec3
>*
result
=
&
reinterpret_cast
<
const
State
*>
(
target
)
->
getVelocities
();
return
reinterpret_cast
<
const
OpenMM_Vec3Array
*>
(
result
);
};
const
OpenMM_Vec3Array
*
OpenMM_State_getForces
(
const
OpenMM_State
*
target
)
{
const
vector
<
Vec3
>*
result
=
&
reinterpret_cast
<
const
State
*>
(
target
)
->
getForces
();
return
reinterpret_cast
<
const
OpenMM_Vec3Array
*>
(
result
);
};
double
OpenMM_State_getKineticEnergy
(
const
OpenMM_State
*
target
)
{
double
result
=
reinterpret_cast
<
const
State
*>
(
target
)
->
getKineticEnergy
();
return
result
;
};
double
OpenMM_State_getPotentialEnergy
(
const
OpenMM_State
*
target
)
{
double
result
=
reinterpret_cast
<
const
State
*>
(
target
)
->
getPotentialEnergy
();
return
result
;
};
const
OpenMM_ParameterArray
*
OpenMM_State_getParameters
(
const
OpenMM_State
*
target
)
{
const
map
<
string
,
double
>*
result
=
&
reinterpret_cast
<
const
State
*>
(
target
)
->
getParameters
();
return
reinterpret_cast
<
const
OpenMM_ParameterArray
*>
(
result
);
};
/* OpenMM::PeriodicTorsionForce*/
OpenMM_PeriodicTorsionForce
*
OpenMM_PeriodicTorsionForce_create
()
{
return
reinterpret_cast
<
OpenMM_PeriodicTorsionForce
*>
(
new
PeriodicTorsionForce
());
}
void
OpenMM_PeriodicTorsionForce_destroy
(
OpenMM_PeriodicTorsionForce
*
target
)
{
delete
reinterpret_cast
<
PeriodicTorsionForce
*>
(
target
);
}
int
OpenMM_PeriodicTorsionForce_getNumTorsions
(
const
OpenMM_PeriodicTorsionForce
*
target
)
{
int
result
=
reinterpret_cast
<
const
PeriodicTorsionForce
*>
(
target
)
->
getNumTorsions
();
return
result
;
};
int
OpenMM_PeriodicTorsionForce_addTorsion
(
OpenMM_PeriodicTorsionForce
*
target
,
int
particle1
,
int
particle2
,
int
particle3
,
int
particle4
,
int
periodicity
,
double
phase
,
double
k
)
{
int
result
=
reinterpret_cast
<
PeriodicTorsionForce
*>
(
target
)
->
addTorsion
(
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
,
phase
,
k
);
return
result
;
};
void
OpenMM_PeriodicTorsionForce_getTorsionParameters
(
const
OpenMM_PeriodicTorsionForce
*
target
,
int
index
,
int
*
particle1
,
int
*
particle2
,
int
*
particle3
,
int
*
particle4
,
int
*
periodicity
,
double
*
phase
,
double
*
k
)
{
reinterpret_cast
<
const
PeriodicTorsionForce
*>
(
target
)
->
getTorsionParameters
(
index
,
*
reinterpret_cast
<
int
*
>
(
particle1
),
*
reinterpret_cast
<
int
*
>
(
particle2
),
*
reinterpret_cast
<
int
*
>
(
particle3
),
*
reinterpret_cast
<
int
*
>
(
particle4
),
*
reinterpret_cast
<
int
*
>
(
periodicity
),
*
reinterpret_cast
<
double
*
>
(
phase
),
*
reinterpret_cast
<
double
*
>
(
k
));
};
void
OpenMM_PeriodicTorsionForce_setTorsionParameters
(
OpenMM_PeriodicTorsionForce
*
target
,
int
index
,
int
particle1
,
int
particle2
,
int
particle3
,
int
particle4
,
int
periodicity
,
double
phase
,
double
k
)
{
reinterpret_cast
<
PeriodicTorsionForce
*>
(
target
)
->
setTorsionParameters
(
index
,
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
,
phase
,
k
);
};
/* OpenMM::Integrator*/
void
OpenMM_Integrator_destroy
(
OpenMM_Integrator
*
target
)
{
delete
reinterpret_cast
<
Integrator
*>
(
target
);
}
double
OpenMM_Integrator_getStepSize
(
const
OpenMM_Integrator
*
target
)
{
double
result
=
reinterpret_cast
<
const
Integrator
*>
(
target
)
->
getStepSize
();
return
result
;
};
void
OpenMM_Integrator_setStepSize
(
OpenMM_Integrator
*
target
,
double
size
)
{
reinterpret_cast
<
Integrator
*>
(
target
)
->
setStepSize
(
size
);
};
double
OpenMM_Integrator_getConstraintTolerance
(
const
OpenMM_Integrator
*
target
)
{
double
result
=
reinterpret_cast
<
const
Integrator
*>
(
target
)
->
getConstraintTolerance
();
return
result
;
};
void
OpenMM_Integrator_setConstraintTolerance
(
OpenMM_Integrator
*
target
,
double
tol
)
{
reinterpret_cast
<
Integrator
*>
(
target
)
->
setConstraintTolerance
(
tol
);
};
void
OpenMM_Integrator_step
(
OpenMM_Integrator
*
target
,
int
steps
)
{
reinterpret_cast
<
Integrator
*>
(
target
)
->
step
(
steps
);
};
/* OpenMM::System*/
OpenMM_System
*
OpenMM_System_create
()
{
return
reinterpret_cast
<
OpenMM_System
*>
(
new
System
());
}
void
OpenMM_System_destroy
(
OpenMM_System
*
target
)
{
delete
reinterpret_cast
<
System
*>
(
target
);
}
int
OpenMM_System_getNumParticles
(
const
OpenMM_System
*
target
)
{
int
result
=
reinterpret_cast
<
const
System
*>
(
target
)
->
getNumParticles
();
return
result
;
};
int
OpenMM_System_addParticle
(
OpenMM_System
*
target
,
double
mass
)
{
int
result
=
reinterpret_cast
<
System
*>
(
target
)
->
addParticle
(
mass
);
return
result
;
};
double
OpenMM_System_getParticleMass
(
const
OpenMM_System
*
target
,
int
index
)
{
double
result
=
reinterpret_cast
<
const
System
*>
(
target
)
->
getParticleMass
(
index
);
return
result
;
};
void
OpenMM_System_setParticleMass
(
OpenMM_System
*
target
,
int
index
,
double
mass
)
{
reinterpret_cast
<
System
*>
(
target
)
->
setParticleMass
(
index
,
mass
);
};
int
OpenMM_System_getNumConstraints
(
const
OpenMM_System
*
target
)
{
int
result
=
reinterpret_cast
<
const
System
*>
(
target
)
->
getNumConstraints
();
return
result
;
};
int
OpenMM_System_addConstraint
(
OpenMM_System
*
target
,
int
particle1
,
int
particle2
,
double
distance
)
{
int
result
=
reinterpret_cast
<
System
*>
(
target
)
->
addConstraint
(
particle1
,
particle2
,
distance
);
return
result
;
};
void
OpenMM_System_getConstraintParameters
(
const
OpenMM_System
*
target
,
int
index
,
int
*
particle1
,
int
*
particle2
,
double
*
distance
)
{
reinterpret_cast
<
const
System
*>
(
target
)
->
getConstraintParameters
(
index
,
*
reinterpret_cast
<
int
*
>
(
particle1
),
*
reinterpret_cast
<
int
*
>
(
particle2
),
*
reinterpret_cast
<
double
*
>
(
distance
));
};
void
OpenMM_System_setConstraintParameters
(
OpenMM_System
*
target
,
int
index
,
int
particle1
,
int
particle2
,
double
distance
)
{
reinterpret_cast
<
System
*>
(
target
)
->
setConstraintParameters
(
index
,
particle1
,
particle2
,
distance
);
};
int
OpenMM_System_addForce
(
OpenMM_System
*
target
,
OpenMM_Force
*
force
)
{
int
result
=
reinterpret_cast
<
System
*>
(
target
)
->
addForce
(
reinterpret_cast
<
Force
*
>
(
force
));
return
result
;
};
int
OpenMM_System_getNumForces
(
const
OpenMM_System
*
target
)
{
int
result
=
reinterpret_cast
<
const
System
*>
(
target
)
->
getNumForces
();
return
result
;
};
OpenMM_Force
*
OpenMM_System_getForce
(
OpenMM_System
*
target
,
int
index
)
{
Force
*
result
=
&
reinterpret_cast
<
System
*>
(
target
)
->
getForce
(
index
);
return
reinterpret_cast
<
OpenMM_Force
*>
(
result
);
};
#if defined(__cplusplus)
}
#endif
examples/OpenMMCWrapper.h
deleted
100644 → 0
View file @
9438fa83
#ifndef OPENMM_CWRAPPER_H_
#define OPENMM_CWRAPPER_H_
/* Global Constants */
static
const
double
OpenMM_KJPerKcal
=
4
.
184
;
static
const
double
OpenMM_KcalPerKJ
=
0
.
2390057361376673
;
static
const
double
OpenMM_PsPerFs
=
0
.
001
;
static
const
double
OpenMM_AngstromsPerNm
=
10
;
static
const
double
OpenMM_FsPerPs
=
1000
;
static
const
double
OpenMM_RadiansPerDegree
=
0
.
0174532
92519943295
;
static
const
double
OpenMM_NmPerAngstrom
=
0
.
1
;
static
const
double
OpenMM_SigmaPerVdwRadius
=
1
.
7817974362806785
;
static
const
double
OpenMM_VdwRadiusPerSigma
=
0
.
5612310241546865
;
static
const
double
OpenMM_DegreesPerRadian
=
57
.
29577951308232
;
/* Type Declarations */
typedef
struct
OpenMM_HarmonicBondForce_struct
OpenMM_HarmonicBondForce
;
typedef
struct
OpenMM_BrownianIntegrator_struct
OpenMM_BrownianIntegrator
;
typedef
struct
OpenMM_OpenMMException_struct
OpenMM_OpenMMException
;
typedef
struct
OpenMM_NonbondedForce_struct
OpenMM_NonbondedForce
;
typedef
struct
OpenMM_VariableLangevinIntegrator_struct
OpenMM_VariableLangevinIntegrator
;
typedef
struct
OpenMM_GBVIForce_struct
OpenMM_GBVIForce
;
typedef
struct
OpenMM_Context_struct
OpenMM_Context
;
typedef
struct
OpenMM_GBSAOBCForce_struct
OpenMM_GBSAOBCForce
;
typedef
struct
OpenMM_VariableVerletIntegrator_struct
OpenMM_VariableVerletIntegrator
;
typedef
struct
OpenMM_CMMotionRemover_struct
OpenMM_CMMotionRemover
;
typedef
struct
OpenMM_VerletIntegrator_struct
OpenMM_VerletIntegrator
;
typedef
struct
OpenMM_ContextImpl_struct
OpenMM_ContextImpl
;
typedef
struct
OpenMM_RBTorsionForce_struct
OpenMM_RBTorsionForce
;
typedef
struct
OpenMM_LangevinIntegrator_struct
OpenMM_LangevinIntegrator
;
typedef
struct
OpenMM_Force_struct
OpenMM_Force
;
typedef
struct
OpenMM_HarmonicAngleForce_struct
OpenMM_HarmonicAngleForce
;
typedef
struct
OpenMM_AndersenThermostat_struct
OpenMM_AndersenThermostat
;
typedef
struct
OpenMM_ForceImpl_struct
OpenMM_ForceImpl
;
typedef
struct
OpenMM_Platform_struct
OpenMM_Platform
;
typedef
struct
OpenMM_State_struct
OpenMM_State
;
typedef
struct
OpenMM_PeriodicTorsionForce_struct
OpenMM_PeriodicTorsionForce
;
typedef
struct
OpenMM_Integrator_struct
OpenMM_Integrator
;
typedef
struct
OpenMM_System_struct
OpenMM_System
;
typedef
struct
OpenMM_Vec3Array_struct
OpenMM_Vec3Array
;
typedef
struct
OpenMM_StringArray_struct
OpenMM_StringArray
;
typedef
struct
OpenMM_BondArray_struct
OpenMM_BondArray
;
typedef
struct
OpenMM_ParameterArray_struct
OpenMM_ParameterArray
;
typedef
struct
{
double
x
,
y
,
z
;}
OpenMM_Vec3
;
typedef
enum
{
OpenMM_False
=
0
,
OpenMM_True
=
1
}
OpenMM_Boolean
;
#if defined(__cplusplus)
extern
"C"
{
#endif
/* OpenMM_Vec3 */
extern
OpenMM_Vec3
OpenMM_Vec3_scale
(
const
OpenMM_Vec3
vec
,
double
scale
);
/* OpenMM_Vec3Array */
extern
OpenMM_Vec3Array
*
OpenMM_Vec3Array_create
(
int
size
);
extern
void
OpenMM_Vec3Array_destroy
(
OpenMM_Vec3Array
*
array
);
extern
int
OpenMM_Vec3Array_getSize
(
const
OpenMM_Vec3Array
*
array
);
extern
void
OpenMM_Vec3Array_resize
(
OpenMM_Vec3Array
*
array
,
int
size
);
extern
void
OpenMM_Vec3Array_append
(
OpenMM_Vec3Array
*
array
,
const
OpenMM_Vec3
vec
);
extern
void
OpenMM_Vec3Array_set
(
OpenMM_Vec3Array
*
array
,
int
index
,
const
OpenMM_Vec3
vec
);
extern
const
OpenMM_Vec3
*
OpenMM_Vec3Array_get
(
const
OpenMM_Vec3Array
*
array
,
int
index
);
/* OpenMM_StringArray */
extern
OpenMM_StringArray
*
OpenMM_StringArray_create
(
int
size
);
extern
void
OpenMM_StringArray_destroy
(
OpenMM_StringArray
*
array
);
extern
int
OpenMM_StringArray_getSize
(
const
OpenMM_StringArray
*
array
);
extern
void
OpenMM_StringArray_resize
(
OpenMM_StringArray
*
array
,
int
size
);
extern
void
OpenMM_StringArray_append
(
OpenMM_StringArray
*
array
,
const
char
*
string
);
extern
void
OpenMM_StringArray_set
(
OpenMM_StringArray
*
array
,
int
index
,
const
char
*
string
);
extern
const
char
*
OpenMM_StringArray_get
(
const
OpenMM_StringArray
*
array
,
int
index
);
/* OpenMM_BondArray */
extern
OpenMM_BondArray
*
OpenMM_BondArray_create
(
int
size
);
extern
void
OpenMM_BondArray_destroy
(
OpenMM_BondArray
*
array
);
extern
int
OpenMM_BondArray_getSize
(
const
OpenMM_BondArray
*
array
);
extern
void
OpenMM_BondArray_resize
(
OpenMM_BondArray
*
array
,
int
size
);
extern
void
OpenMM_BondArray_append
(
OpenMM_BondArray
*
array
,
int
particle1
,
int
particle2
);
extern
void
OpenMM_BondArray_set
(
OpenMM_BondArray
*
array
,
int
index
,
int
particle1
,
int
particle2
);
extern
void
OpenMM_BondArray_get
(
const
OpenMM_BondArray
*
array
,
int
index
,
int
*
particle1
,
int
*
particle2
);
/* OpenMM_ParameterArray */
extern
int
OpenMM_ParameterArray_getSize
(
const
OpenMM_ParameterArray
*
array
);
extern
double
OpenMM_ParameterArray_get
(
const
OpenMM_ParameterArray
*
array
,
const
char
*
name
);
/* These methods need to be handled specially, since their C++ APIs cannot be directly translated to C.
Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself. */
extern
OpenMM_State
*
OpenMM_Context_getState
(
const
OpenMM_Context
*
target
,
int
types
);
extern
OpenMM_StringArray
*
OpenMM_Platform_loadPluginsFromDirectory
(
const
char
*
directory
);
/* OpenMM::HarmonicBondForce*/
extern
OpenMM_HarmonicBondForce
*
OpenMM_HarmonicBondForce_create
();
extern
void
OpenMM_HarmonicBondForce_destroy
(
OpenMM_HarmonicBondForce
*
target
);
extern
int
OpenMM_HarmonicBondForce_getNumBonds
(
const
OpenMM_HarmonicBondForce
*
target
);
extern
int
OpenMM_HarmonicBondForce_addBond
(
OpenMM_HarmonicBondForce
*
target
,
int
particle1
,
int
particle2
,
double
length
,
double
k
);
extern
void
OpenMM_HarmonicBondForce_getBondParameters
(
const
OpenMM_HarmonicBondForce
*
target
,
int
index
,
int
*
particle1
,
int
*
particle2
,
double
*
length
,
double
*
k
);
extern
void
OpenMM_HarmonicBondForce_setBondParameters
(
OpenMM_HarmonicBondForce
*
target
,
int
index
,
int
particle1
,
int
particle2
,
double
length
,
double
k
);
/* OpenMM::BrownianIntegrator*/
extern
OpenMM_BrownianIntegrator
*
OpenMM_BrownianIntegrator_create
(
double
temperature
,
double
frictionCoeff
,
double
stepSize
);
extern
void
OpenMM_BrownianIntegrator_destroy
(
OpenMM_BrownianIntegrator
*
target
);
extern
double
OpenMM_BrownianIntegrator_getTemperature
(
const
OpenMM_BrownianIntegrator
*
target
);
extern
void
OpenMM_BrownianIntegrator_setTemperature
(
OpenMM_BrownianIntegrator
*
target
,
double
temp
);
extern
double
OpenMM_BrownianIntegrator_getFriction
(
const
OpenMM_BrownianIntegrator
*
target
);
extern
void
OpenMM_BrownianIntegrator_setFriction
(
OpenMM_BrownianIntegrator
*
target
,
double
coeff
);
extern
int
OpenMM_BrownianIntegrator_getRandomNumberSeed
(
const
OpenMM_BrownianIntegrator
*
target
);
extern
void
OpenMM_BrownianIntegrator_setRandomNumberSeed
(
OpenMM_BrownianIntegrator
*
target
,
int
seed
);
extern
void
OpenMM_BrownianIntegrator_step
(
OpenMM_BrownianIntegrator
*
target
,
int
steps
);
/* OpenMM::OpenMMException*/
extern
OpenMM_OpenMMException
*
OpenMM_OpenMMException_create
(
const
char
*
message
);
extern
void
OpenMM_OpenMMException_destroy
(
OpenMM_OpenMMException
*
target
);
extern
const
char
*
OpenMM_OpenMMException_what
(
const
OpenMM_OpenMMException
*
target
);
/* OpenMM::NonbondedForce*/
typedef
enum
{
OpenMM_NonbondedForce_NoCutoff
=
0
,
OpenMM_NonbondedForce_CutoffNonPeriodic
=
1
,
OpenMM_NonbondedForce_CutoffPeriodic
=
2
,
OpenMM_NonbondedForce_Ewald
=
3
,
OpenMM_NonbondedForce_PME
=
4
}
OpenMM_NonbondedForce_NonbondedMethod
;
extern
OpenMM_NonbondedForce
*
OpenMM_NonbondedForce_create
();
extern
void
OpenMM_NonbondedForce_destroy
(
OpenMM_NonbondedForce
*
target
);
extern
int
OpenMM_NonbondedForce_getNumParticles
(
const
OpenMM_NonbondedForce
*
target
);
extern
int
OpenMM_NonbondedForce_getNumExceptions
(
const
OpenMM_NonbondedForce
*
target
);
extern
OpenMM_NonbondedForce_NonbondedMethod
OpenMM_NonbondedForce_getNonbondedMethod
(
const
OpenMM_NonbondedForce
*
target
);
extern
void
OpenMM_NonbondedForce_setNonbondedMethod
(
OpenMM_NonbondedForce
*
target
,
OpenMM_NonbondedForce_NonbondedMethod
method
);
extern
double
OpenMM_NonbondedForce_getCutoffDistance
(
const
OpenMM_NonbondedForce
*
target
);
extern
void
OpenMM_NonbondedForce_setCutoffDistance
(
OpenMM_NonbondedForce
*
target
,
double
distance
);
extern
double
OpenMM_NonbondedForce_getReactionFieldDielectric
(
const
OpenMM_NonbondedForce
*
target
);
extern
void
OpenMM_NonbondedForce_setReactionFieldDielectric
(
OpenMM_NonbondedForce
*
target
,
double
dielectric
);
extern
double
OpenMM_NonbondedForce_getEwaldErrorTolerance
(
const
OpenMM_NonbondedForce
*
target
);
extern
void
OpenMM_NonbondedForce_setEwaldErrorTolerance
(
OpenMM_NonbondedForce
*
target
,
double
tol
);
extern
void
OpenMM_NonbondedForce_getPeriodicBoxVectors
(
const
OpenMM_NonbondedForce
*
target
,
OpenMM_Vec3
*
a
,
OpenMM_Vec3
*
b
,
OpenMM_Vec3
*
c
);
extern
void
OpenMM_NonbondedForce_setPeriodicBoxVectors
(
OpenMM_NonbondedForce
*
target
,
OpenMM_Vec3
a
,
OpenMM_Vec3
b
,
OpenMM_Vec3
c
);
extern
int
OpenMM_NonbondedForce_addParticle
(
OpenMM_NonbondedForce
*
target
,
double
charge
,
double
sigma
,
double
epsilon
);
extern
void
OpenMM_NonbondedForce_getParticleParameters
(
const
OpenMM_NonbondedForce
*
target
,
int
index
,
double
*
charge
,
double
*
sigma
,
double
*
epsilon
);
extern
void
OpenMM_NonbondedForce_setParticleParameters
(
OpenMM_NonbondedForce
*
target
,
int
index
,
double
charge
,
double
sigma
,
double
epsilon
);
extern
int
OpenMM_NonbondedForce_addException
(
OpenMM_NonbondedForce
*
target
,
int
particle1
,
int
particle2
,
double
chargeProd
,
double
sigma
,
double
epsilon
,
OpenMM_Boolean
replace
);
extern
void
OpenMM_NonbondedForce_getExceptionParameters
(
const
OpenMM_NonbondedForce
*
target
,
int
index
,
int
*
particle1
,
int
*
particle2
,
double
*
chargeProd
,
double
*
sigma
,
double
*
epsilon
);
extern
void
OpenMM_NonbondedForce_setExceptionParameters
(
OpenMM_NonbondedForce
*
target
,
int
index
,
int
particle1
,
int
particle2
,
double
chargeProd
,
double
sigma
,
double
epsilon
);
extern
void
OpenMM_NonbondedForce_createExceptionsFromBonds
(
OpenMM_NonbondedForce
*
target
,
const
OpenMM_BondArray
*
bonds
,
double
coulomb14Scale
,
double
lj14Scale
);
/* OpenMM::VariableLangevinIntegrator*/
extern
OpenMM_VariableLangevinIntegrator
*
OpenMM_VariableLangevinIntegrator_create
(
double
temperature
,
double
frictionCoeff
,
double
errorTol
);
extern
void
OpenMM_VariableLangevinIntegrator_destroy
(
OpenMM_VariableLangevinIntegrator
*
target
);
extern
double
OpenMM_VariableLangevinIntegrator_getTemperature
(
const
OpenMM_VariableLangevinIntegrator
*
target
);
extern
void
OpenMM_VariableLangevinIntegrator_setTemperature
(
OpenMM_VariableLangevinIntegrator
*
target
,
double
temp
);
extern
double
OpenMM_VariableLangevinIntegrator_getFriction
(
const
OpenMM_VariableLangevinIntegrator
*
target
);
extern
void
OpenMM_VariableLangevinIntegrator_setFriction
(
OpenMM_VariableLangevinIntegrator
*
target
,
double
coeff
);
extern
double
OpenMM_VariableLangevinIntegrator_getErrorTolerance
(
const
OpenMM_VariableLangevinIntegrator
*
target
);
extern
void
OpenMM_VariableLangevinIntegrator_setErrorTolerance
(
OpenMM_VariableLangevinIntegrator
*
target
,
double
tol
);
extern
int
OpenMM_VariableLangevinIntegrator_getRandomNumberSeed
(
const
OpenMM_VariableLangevinIntegrator
*
target
);
extern
void
OpenMM_VariableLangevinIntegrator_setRandomNumberSeed
(
OpenMM_VariableLangevinIntegrator
*
target
,
int
seed
);
extern
void
OpenMM_VariableLangevinIntegrator_step
(
OpenMM_VariableLangevinIntegrator
*
target
,
int
steps
);
extern
void
OpenMM_VariableLangevinIntegrator_stepTo
(
OpenMM_VariableLangevinIntegrator
*
target
,
double
time
);
/* OpenMM::GBVIForce*/
extern
OpenMM_GBVIForce
*
OpenMM_GBVIForce_create
();
extern
void
OpenMM_GBVIForce_destroy
(
OpenMM_GBVIForce
*
target
);
extern
int
OpenMM_GBVIForce_getNumParticles
(
const
OpenMM_GBVIForce
*
target
);
extern
int
OpenMM_GBVIForce_addParticle
(
OpenMM_GBVIForce
*
target
,
double
charge
,
double
radius
,
double
gamma
);
extern
void
OpenMM_GBVIForce_getParticleParameters
(
const
OpenMM_GBVIForce
*
target
,
int
index
,
double
*
charge
,
double
*
radius
,
double
*
gamma
);
extern
void
OpenMM_GBVIForce_setParticleParameters
(
OpenMM_GBVIForce
*
target
,
int
index
,
double
charge
,
double
radius
,
double
gamma
);
extern
double
OpenMM_GBVIForce_getSolventDielectric
(
const
OpenMM_GBVIForce
*
target
);
extern
void
OpenMM_GBVIForce_setSolventDielectric
(
OpenMM_GBVIForce
*
target
,
double
dielectric
);
extern
double
OpenMM_GBVIForce_getSoluteDielectric
(
const
OpenMM_GBVIForce
*
target
);
extern
void
OpenMM_GBVIForce_setSoluteDielectric
(
OpenMM_GBVIForce
*
target
,
double
dielectric
);
/* OpenMM::Context*/
extern
OpenMM_Context
*
OpenMM_Context_create
(
OpenMM_System
*
system
,
OpenMM_Integrator
*
integrator
);
extern
OpenMM_Context
*
OpenMM_Context_create_2
(
OpenMM_System
*
system
,
OpenMM_Integrator
*
integrator
,
OpenMM_Platform
*
platform
);
extern
void
OpenMM_Context_destroy
(
OpenMM_Context
*
target
);
extern
OpenMM_System
*
OpenMM_Context_getSystem
(
OpenMM_Context
*
target
);
extern
OpenMM_Integrator
*
OpenMM_Context_getIntegrator
(
OpenMM_Context
*
target
);
extern
OpenMM_Platform
*
OpenMM_Context_getPlatform
(
OpenMM_Context
*
target
);
extern
void
OpenMM_Context_setTime
(
OpenMM_Context
*
target
,
double
time
);
extern
void
OpenMM_Context_setPositions
(
OpenMM_Context
*
target
,
const
OpenMM_Vec3Array
*
positions
);
extern
void
OpenMM_Context_setVelocities
(
OpenMM_Context
*
target
,
const
OpenMM_Vec3Array
*
velocities
);
extern
double
OpenMM_Context_getParameter
(
OpenMM_Context
*
target
,
const
char
*
name
);
extern
void
OpenMM_Context_setParameter
(
OpenMM_Context
*
target
,
const
char
*
name
,
double
value
);
extern
void
OpenMM_Context_reinitialize
(
OpenMM_Context
*
target
);
/* OpenMM::GBSAOBCForce*/
extern
OpenMM_GBSAOBCForce
*
OpenMM_GBSAOBCForce_create
();
extern
void
OpenMM_GBSAOBCForce_destroy
(
OpenMM_GBSAOBCForce
*
target
);
extern
int
OpenMM_GBSAOBCForce_getNumParticles
(
const
OpenMM_GBSAOBCForce
*
target
);
extern
int
OpenMM_GBSAOBCForce_addParticle
(
OpenMM_GBSAOBCForce
*
target
,
double
charge
,
double
radius
,
double
scalingFactor
);
extern
void
OpenMM_GBSAOBCForce_getParticleParameters
(
const
OpenMM_GBSAOBCForce
*
target
,
int
index
,
double
*
charge
,
double
*
radius
,
double
*
scalingFactor
);
extern
void
OpenMM_GBSAOBCForce_setParticleParameters
(
OpenMM_GBSAOBCForce
*
target
,
int
index
,
double
charge
,
double
radius
,
double
scalingFactor
);
extern
double
OpenMM_GBSAOBCForce_getSolventDielectric
(
const
OpenMM_GBSAOBCForce
*
target
);
extern
void
OpenMM_GBSAOBCForce_setSolventDielectric
(
OpenMM_GBSAOBCForce
*
target
,
double
dielectric
);
extern
double
OpenMM_GBSAOBCForce_getSoluteDielectric
(
const
OpenMM_GBSAOBCForce
*
target
);
extern
void
OpenMM_GBSAOBCForce_setSoluteDielectric
(
OpenMM_GBSAOBCForce
*
target
,
double
dielectric
);
/* OpenMM::VariableVerletIntegrator*/
extern
OpenMM_VariableVerletIntegrator
*
OpenMM_VariableVerletIntegrator_create
(
double
errorTol
);
extern
void
OpenMM_VariableVerletIntegrator_destroy
(
OpenMM_VariableVerletIntegrator
*
target
);
extern
double
OpenMM_VariableVerletIntegrator_getErrorTolerance
(
const
OpenMM_VariableVerletIntegrator
*
target
);
extern
void
OpenMM_VariableVerletIntegrator_setErrorTolerance
(
OpenMM_VariableVerletIntegrator
*
target
,
double
tol
);
extern
void
OpenMM_VariableVerletIntegrator_step
(
OpenMM_VariableVerletIntegrator
*
target
,
int
steps
);
extern
void
OpenMM_VariableVerletIntegrator_stepTo
(
OpenMM_VariableVerletIntegrator
*
target
,
double
time
);
/* OpenMM::CMMotionRemover*/
extern
OpenMM_CMMotionRemover
*
OpenMM_CMMotionRemover_create
(
int
frequency
);
extern
void
OpenMM_CMMotionRemover_destroy
(
OpenMM_CMMotionRemover
*
target
);
extern
int
OpenMM_CMMotionRemover_getFrequency
(
const
OpenMM_CMMotionRemover
*
target
);
extern
void
OpenMM_CMMotionRemover_setFrequency
(
OpenMM_CMMotionRemover
*
target
,
int
freq
);
/* OpenMM::VerletIntegrator*/
extern
OpenMM_VerletIntegrator
*
OpenMM_VerletIntegrator_create
(
double
stepSize
);
extern
void
OpenMM_VerletIntegrator_destroy
(
OpenMM_VerletIntegrator
*
target
);
extern
void
OpenMM_VerletIntegrator_step
(
OpenMM_VerletIntegrator
*
target
,
int
steps
);
/* OpenMM::RBTorsionForce*/
extern
OpenMM_RBTorsionForce
*
OpenMM_RBTorsionForce_create
();
extern
void
OpenMM_RBTorsionForce_destroy
(
OpenMM_RBTorsionForce
*
target
);
extern
int
OpenMM_RBTorsionForce_getNumTorsions
(
const
OpenMM_RBTorsionForce
*
target
);
extern
int
OpenMM_RBTorsionForce_addTorsion
(
OpenMM_RBTorsionForce
*
target
,
int
particle1
,
int
particle2
,
int
particle3
,
int
particle4
,
double
c0
,
double
c1
,
double
c2
,
double
c3
,
double
c4
,
double
c5
);
extern
void
OpenMM_RBTorsionForce_getTorsionParameters
(
const
OpenMM_RBTorsionForce
*
target
,
int
index
,
int
*
particle1
,
int
*
particle2
,
int
*
particle3
,
int
*
particle4
,
double
*
c0
,
double
*
c1
,
double
*
c2
,
double
*
c3
,
double
*
c4
,
double
*
c5
);
extern
void
OpenMM_RBTorsionForce_setTorsionParameters
(
OpenMM_RBTorsionForce
*
target
,
int
index
,
int
particle1
,
int
particle2
,
int
particle3
,
int
particle4
,
double
c0
,
double
c1
,
double
c2
,
double
c3
,
double
c4
,
double
c5
);
/* OpenMM::LangevinIntegrator*/
extern
OpenMM_LangevinIntegrator
*
OpenMM_LangevinIntegrator_create
(
double
temperature
,
double
frictionCoeff
,
double
stepSize
);
extern
void
OpenMM_LangevinIntegrator_destroy
(
OpenMM_LangevinIntegrator
*
target
);
extern
double
OpenMM_LangevinIntegrator_getTemperature
(
const
OpenMM_LangevinIntegrator
*
target
);
extern
void
OpenMM_LangevinIntegrator_setTemperature
(
OpenMM_LangevinIntegrator
*
target
,
double
temp
);
extern
double
OpenMM_LangevinIntegrator_getFriction
(
const
OpenMM_LangevinIntegrator
*
target
);
extern
void
OpenMM_LangevinIntegrator_setFriction
(
OpenMM_LangevinIntegrator
*
target
,
double
coeff
);
extern
int
OpenMM_LangevinIntegrator_getRandomNumberSeed
(
const
OpenMM_LangevinIntegrator
*
target
);
extern
void
OpenMM_LangevinIntegrator_setRandomNumberSeed
(
OpenMM_LangevinIntegrator
*
target
,
int
seed
);
extern
void
OpenMM_LangevinIntegrator_step
(
OpenMM_LangevinIntegrator
*
target
,
int
steps
);
/* OpenMM::Force*/
extern
void
OpenMM_Force_destroy
(
OpenMM_Force
*
target
);
/* OpenMM::HarmonicAngleForce*/
extern
OpenMM_HarmonicAngleForce
*
OpenMM_HarmonicAngleForce_create
();
extern
void
OpenMM_HarmonicAngleForce_destroy
(
OpenMM_HarmonicAngleForce
*
target
);
extern
int
OpenMM_HarmonicAngleForce_getNumAngles
(
const
OpenMM_HarmonicAngleForce
*
target
);
extern
int
OpenMM_HarmonicAngleForce_addAngle
(
OpenMM_HarmonicAngleForce
*
target
,
int
particle1
,
int
particle2
,
int
particle3
,
double
angle
,
double
k
);
extern
void
OpenMM_HarmonicAngleForce_getAngleParameters
(
const
OpenMM_HarmonicAngleForce
*
target
,
int
index
,
int
*
particle1
,
int
*
particle2
,
int
*
particle3
,
double
*
angle
,
double
*
k
);
extern
void
OpenMM_HarmonicAngleForce_setAngleParameters
(
OpenMM_HarmonicAngleForce
*
target
,
int
index
,
int
particle1
,
int
particle2
,
int
particle3
,
double
angle
,
double
k
);
/* OpenMM::AndersenThermostat*/
extern
OpenMM_AndersenThermostat
*
OpenMM_AndersenThermostat_create
(
double
defaultTemperature
,
double
defaultCollisionFrequency
);
extern
void
OpenMM_AndersenThermostat_destroy
(
OpenMM_AndersenThermostat
*
target
);
extern
const
char
*
OpenMM_AndersenThermostat_Temperature
();
extern
const
char
*
OpenMM_AndersenThermostat_CollisionFrequency
();
extern
double
OpenMM_AndersenThermostat_getDefaultTemperature
(
const
OpenMM_AndersenThermostat
*
target
);
extern
double
OpenMM_AndersenThermostat_getDefaultCollisionFrequency
(
const
OpenMM_AndersenThermostat
*
target
);
extern
int
OpenMM_AndersenThermostat_getRandomNumberSeed
(
const
OpenMM_AndersenThermostat
*
target
);
extern
void
OpenMM_AndersenThermostat_setRandomNumberSeed
(
OpenMM_AndersenThermostat
*
target
,
int
seed
);
/* OpenMM::Platform*/
extern
void
OpenMM_Platform_destroy
(
OpenMM_Platform
*
target
);
extern
const
char
*
OpenMM_Platform_getName
(
const
OpenMM_Platform
*
target
);
extern
double
OpenMM_Platform_getSpeed
(
const
OpenMM_Platform
*
target
);
extern
OpenMM_Boolean
OpenMM_Platform_supportsDoublePrecision
(
const
OpenMM_Platform
*
target
);
extern
const
OpenMM_StringArray
*
OpenMM_Platform_getPropertyNames
(
OpenMM_Platform
*
target
);
extern
const
char
*
OpenMM_Platform_getPropertyValue
(
const
OpenMM_Platform
*
target
,
const
OpenMM_Context
*
context
,
const
char
*
property
);
extern
void
OpenMM_Platform_setPropertyValue
(
const
OpenMM_Platform
*
target
,
OpenMM_Context
*
context
,
const
char
*
property
,
const
char
*
value
);
extern
const
char
*
OpenMM_Platform_getPropertyDefaultValue
(
const
OpenMM_Platform
*
target
,
const
char
*
property
);
extern
void
OpenMM_Platform_setPropertyDefaultValue
(
OpenMM_Platform
*
target
,
const
char
*
property
,
const
char
*
value
);
extern
void
OpenMM_Platform_contextCreated
(
const
OpenMM_Platform
*
target
,
OpenMM_ContextImpl
*
context
);
extern
void
OpenMM_Platform_contextDestroyed
(
const
OpenMM_Platform
*
target
,
OpenMM_ContextImpl
*
context
);
extern
OpenMM_Boolean
OpenMM_Platform_supportsKernels
(
const
OpenMM_Platform
*
target
,
const
OpenMM_StringArray
*
kernelNames
);
extern
void
OpenMM_Platform_registerPlatform
(
OpenMM_Platform
*
platform
);
extern
int
OpenMM_Platform_getNumPlatforms
();
extern
OpenMM_Platform
*
OpenMM_Platform_getPlatform
(
int
index
);
extern
OpenMM_Platform
*
OpenMM_Platform_findPlatform
(
const
OpenMM_StringArray
*
kernelNames
);
extern
void
OpenMM_Platform_loadPluginLibrary
(
const
char
*
file
);
extern
const
char
*
OpenMM_Platform_getDefaultPluginsDirectory
();
/* OpenMM::State*/
typedef
enum
{
OpenMM_State_Positions
=
1
,
OpenMM_State_Velocities
=
2
,
OpenMM_State_Forces
=
4
,
OpenMM_State_Energy
=
8
,
OpenMM_State_Parameters
=
16
}
OpenMM_State_DataType
;
extern
void
OpenMM_State_destroy
(
OpenMM_State
*
target
);
extern
double
OpenMM_State_getTime
(
const
OpenMM_State
*
target
);
extern
const
OpenMM_Vec3Array
*
OpenMM_State_getPositions
(
const
OpenMM_State
*
target
);
extern
const
OpenMM_Vec3Array
*
OpenMM_State_getVelocities
(
const
OpenMM_State
*
target
);
extern
const
OpenMM_Vec3Array
*
OpenMM_State_getForces
(
const
OpenMM_State
*
target
);
extern
double
OpenMM_State_getKineticEnergy
(
const
OpenMM_State
*
target
);
extern
double
OpenMM_State_getPotentialEnergy
(
const
OpenMM_State
*
target
);
extern
const
OpenMM_ParameterArray
*
OpenMM_State_getParameters
(
const
OpenMM_State
*
target
);
/* OpenMM::PeriodicTorsionForce*/
extern
OpenMM_PeriodicTorsionForce
*
OpenMM_PeriodicTorsionForce_create
();
extern
void
OpenMM_PeriodicTorsionForce_destroy
(
OpenMM_PeriodicTorsionForce
*
target
);
extern
int
OpenMM_PeriodicTorsionForce_getNumTorsions
(
const
OpenMM_PeriodicTorsionForce
*
target
);
extern
int
OpenMM_PeriodicTorsionForce_addTorsion
(
OpenMM_PeriodicTorsionForce
*
target
,
int
particle1
,
int
particle2
,
int
particle3
,
int
particle4
,
int
periodicity
,
double
phase
,
double
k
);
extern
void
OpenMM_PeriodicTorsionForce_getTorsionParameters
(
const
OpenMM_PeriodicTorsionForce
*
target
,
int
index
,
int
*
particle1
,
int
*
particle2
,
int
*
particle3
,
int
*
particle4
,
int
*
periodicity
,
double
*
phase
,
double
*
k
);
extern
void
OpenMM_PeriodicTorsionForce_setTorsionParameters
(
OpenMM_PeriodicTorsionForce
*
target
,
int
index
,
int
particle1
,
int
particle2
,
int
particle3
,
int
particle4
,
int
periodicity
,
double
phase
,
double
k
);
/* OpenMM::Integrator*/
extern
void
OpenMM_Integrator_destroy
(
OpenMM_Integrator
*
target
);
extern
double
OpenMM_Integrator_getStepSize
(
const
OpenMM_Integrator
*
target
);
extern
void
OpenMM_Integrator_setStepSize
(
OpenMM_Integrator
*
target
,
double
size
);
extern
double
OpenMM_Integrator_getConstraintTolerance
(
const
OpenMM_Integrator
*
target
);
extern
void
OpenMM_Integrator_setConstraintTolerance
(
OpenMM_Integrator
*
target
,
double
tol
);
extern
void
OpenMM_Integrator_step
(
OpenMM_Integrator
*
target
,
int
steps
);
/* OpenMM::System*/
extern
OpenMM_System
*
OpenMM_System_create
();
extern
void
OpenMM_System_destroy
(
OpenMM_System
*
target
);
extern
int
OpenMM_System_getNumParticles
(
const
OpenMM_System
*
target
);
extern
int
OpenMM_System_addParticle
(
OpenMM_System
*
target
,
double
mass
);
extern
double
OpenMM_System_getParticleMass
(
const
OpenMM_System
*
target
,
int
index
);
extern
void
OpenMM_System_setParticleMass
(
OpenMM_System
*
target
,
int
index
,
double
mass
);
extern
int
OpenMM_System_getNumConstraints
(
const
OpenMM_System
*
target
);
extern
int
OpenMM_System_addConstraint
(
OpenMM_System
*
target
,
int
particle1
,
int
particle2
,
double
distance
);
extern
void
OpenMM_System_getConstraintParameters
(
const
OpenMM_System
*
target
,
int
index
,
int
*
particle1
,
int
*
particle2
,
double
*
distance
);
extern
void
OpenMM_System_setConstraintParameters
(
OpenMM_System
*
target
,
int
index
,
int
particle1
,
int
particle2
,
double
distance
);
extern
int
OpenMM_System_addForce
(
OpenMM_System
*
target
,
OpenMM_Force
*
force
);
extern
int
OpenMM_System_getNumForces
(
const
OpenMM_System
*
target
);
extern
OpenMM_Force
*
OpenMM_System_getForce
(
OpenMM_System
*
target
,
int
index
);
#if defined(__cplusplus)
}
#endif
#endif
/*OPENMM_CWRAPPER_H_*/
examples/OpenMMFortranModule.f90
deleted
100644 → 0
View file @
9438fa83
MODULE
OpenMM_Types
implicit
none
! Global Constants
real
*
8
OpenMM_KJPerKcal
real
*
8
OpenMM_KcalPerKJ
real
*
8
OpenMM_PsPerFs
real
*
8
OpenMM_AngstromsPerNm
real
*
8
OpenMM_FsPerPs
real
*
8
OpenMM_RadiansPerDegree
real
*
8
OpenMM_NmPerAngstrom
real
*
8
OpenMM_SigmaPerVdwRadius
real
*
8
OpenMM_VdwRadiusPerSigma
real
*
8
OpenMM_DegreesPerRadian
parameter
(
OpenMM_KJPerKcal
=
4.184
)
parameter
(
OpenMM_KcalPerKJ
=
0.2390057361376673
)
parameter
(
OpenMM_PsPerFs
=
0.001
)
parameter
(
OpenMM_AngstromsPerNm
=
10
)
parameter
(
OpenMM_FsPerPs
=
1000
)
parameter
(
OpenMM_RadiansPerDegree
=
0.017453292519943295
)
parameter
(
OpenMM_NmPerAngstrom
=
0.1
)
parameter
(
OpenMM_SigmaPerVdwRadius
=
1.7817974362806785
)
parameter
(
OpenMM_VdwRadiusPerSigma
=
0.5612310241546865
)
parameter
(
OpenMM_DegreesPerRadian
=
57.29577951308232
)
! Type Declarations
type
OpenMM_HarmonicBondForce
integer
*
8
::
handle
=
0
end
type
type
OpenMM_BrownianIntegrator
integer
*
8
::
handle
=
0
end
type
type
OpenMM_OpenMMException
integer
*
8
::
handle
=
0
end
type
type
OpenMM_NonbondedForce
integer
*
8
::
handle
=
0
end
type
type
OpenMM_VariableLangevinIntegrator
integer
*
8
::
handle
=
0
end
type
type
OpenMM_GBVIForce
integer
*
8
::
handle
=
0
end
type
type
OpenMM_Context
integer
*
8
::
handle
=
0
end
type
type
OpenMM_GBSAOBCForce
integer
*
8
::
handle
=
0
end
type
type
OpenMM_VariableVerletIntegrator
integer
*
8
::
handle
=
0
end
type
type
OpenMM_CMMotionRemover
integer
*
8
::
handle
=
0
end
type
type
OpenMM_VerletIntegrator
integer
*
8
::
handle
=
0
end
type
type
OpenMM_ContextImpl
integer
*
8
::
handle
=
0
end
type
type
OpenMM_RBTorsionForce
integer
*
8
::
handle
=
0
end
type
type
OpenMM_LangevinIntegrator
integer
*
8
::
handle
=
0
end
type
type
OpenMM_Force
integer
*
8
::
handle
=
0
end
type
type
OpenMM_HarmonicAngleForce
integer
*
8
::
handle
=
0
end
type
type
OpenMM_AndersenThermostat
integer
*
8
::
handle
=
0
end
type
type
OpenMM_ForceImpl
integer
*
8
::
handle
=
0
end
type
type
OpenMM_Platform
integer
*
8
::
handle
=
0
end
type
type
OpenMM_State
integer
*
8
::
handle
=
0
end
type
type
OpenMM_PeriodicTorsionForce
integer
*
8
::
handle
=
0
end
type
type
OpenMM_Integrator
integer
*
8
::
handle
=
0
end
type
type
OpenMM_System
integer
*
8
::
handle
=
0
end
type
type
OpenMM_Vec3Array
integer
*
8
::
handle
=
0
end
type
type
OpenMM_StringArray
integer
*
8
::
handle
=
0
end
type
type
OpenMM_BondArray
integer
*
8
::
handle
=
0
end
type
type
OpenMM_ParameterArray
integer
*
8
::
handle
=
0
end
type
! Enumerations
integer
*
4
OpenMM_False
integer
*
4
OpenMM_True
parameter
(
OpenMM_False
=
0
)
parameter
(
OpenMM_True
=
1
)
integer
*
4
OpenMM_NonbondedForce_NoCutoff
integer
*
4
OpenMM_NonbondedForce_CutoffNonPeriodic
integer
*
4
OpenMM_NonbondedForce_CutoffPeriodic
integer
*
4
OpenMM_NonbondedForce_Ewald
integer
*
4
OpenMM_NonbondedForce_PME
parameter
(
OpenMM_NonbondedForce_NoCutoff
=
0
)
parameter
(
OpenMM_NonbondedForce_CutoffNonPeriodic
=
1
)
parameter
(
OpenMM_NonbondedForce_CutoffPeriodic
=
2
)
parameter
(
OpenMM_NonbondedForce_Ewald
=
3
)
parameter
(
OpenMM_NonbondedForce_PME
=
4
)
integer
*
4
OpenMM_State_Positions
integer
*
4
OpenMM_State_Velocities
integer
*
4
OpenMM_State_Forces
integer
*
4
OpenMM_State_Energy
integer
*
4
OpenMM_State_Parameters
parameter
(
OpenMM_State_Positions
=
1
)
parameter
(
OpenMM_State_Velocities
=
2
)
parameter
(
OpenMM_State_Forces
=
4
)
parameter
(
OpenMM_State_Energy
=
8
)
parameter
(
OpenMM_State_Parameters
=
16
)
END
MODULE
OpenMM_Types
MODULE
OpenMM
use
OpenMM_Types
;
implicit
none
interface
! OpenMM_Vec3
subroutine
OpenMM_Vec3_scale
(
vec
,
scale
,
result
)
use
OpenMM_Types
;
implicit
none
real
*
8
vec
(
3
)
real
*
8
scale
real
*
8
result
(
3
)
end
! OpenMM_Vec3Array
subroutine
OpenMM_Vec3Array_create
(
result
,
size
)
use
OpenMM_Types
;
implicit
none
integer
*
4
size
type
(
OpenMM_Vec3Array
)
result
end
subroutine
OpenMM_Vec3Array_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
destroy
end
function
OpenMM_Vec3Array_getSize
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
target
integer
*
4
OpenMM_Vec3Array_getSize
end
subroutine
OpenMM_Vec3Array_resize
(
target
,
size
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
target
integer
*
4
size
end
subroutine
OpenMM_Vec3Array_append
(
target
,
vec
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
target
real
*
8
vec
(
3
)
end
subroutine
OpenMM_Vec3Array_set
(
target
,
index
,
vec
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
target
integer
*
4
index
real
*
8
vec
(
3
)
end
subroutine
OpenMM_Vec3Array_get
(
target
,
index
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
target
integer
*
4
index
real
*
8
result
(
3
)
end
! OpenMM_StringArray
subroutine
OpenMM_StringArray_create
(
result
,
size
)
use
OpenMM_Types
;
implicit
none
integer
*
4
size
type
(
OpenMM_StringArray
)
result
end
subroutine
OpenMM_StringArray_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_StringArray
)
destroy
end
function
OpenMM_StringArray_getSize
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_StringArray
)
target
integer
*
4
OpenMM_StringArray_getSize
end
subroutine
OpenMM_StringArray_resize
(
target
,
size
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_StringArray
)
target
integer
*
4
size
end
subroutine
OpenMM_StringArray_append
(
target
,
str
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_StringArray
)
target
character
(
*
)
str
end
subroutine
OpenMM_StringArray_set
(
target
,
index
,
str
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_StringArray
)
target
integer
*
4
index
character
(
*
)
str
end
subroutine
OpenMM_StringArray_get
(
target
,
index
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_StringArray
)
target
integer
*
4
index
character
(
*
)
result
end
! OpenMM_BondArray
subroutine
OpenMM_BondArray_create
(
result
,
size
)
use
OpenMM_Types
;
implicit
none
integer
*
4
size
type
(
OpenMM_BondArray
)
result
end
subroutine
OpenMM_BondArray_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BondArray
)
destroy
end
function
OpenMM_BondArray_getSize
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BondArray
)
target
integer
*
4
OpenMM_BondArray_getSize
end
subroutine
OpenMM_BondArray_resize
(
target
,
size
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BondArray
)
target
integer
*
4
size
end
subroutine
OpenMM_BondArray_append
(
target
,
particle1
,
particle2
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BondArray
)
target
integer
*
4
particle1
integer
*
4
particle2
end
subroutine
OpenMM_BondArray_set
(
target
,
index
,
particle1
,
particle2
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BondArray
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
end
subroutine
OpenMM_BondArray_get
(
target
,
index
,
particle1
,
particle2
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BondArray
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
end
! OpenMM_ParameterArray
function
OpenMM_ParameterArray_getSize
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_ParameterArray
)
target
integer
*
4
OpenMM_ParameterArray_getSize
end
subroutine
OpenMM_ParameterArray_get
(
target
,
name
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_ParameterArray
)
target
character
(
*
)
name
character
(
*
)
result
end
! OpenMM::HarmonicBondForce
subroutine
OpenMM_HarmonicBondForce_create
(
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
result
end
subroutine
OpenMM_HarmonicBondForce_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
destroy
end
function
OpenMM_HarmonicBondForce_getNumBonds
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
target
integer
*
4
OpenMM_HarmonicBondForce_getNumBonds
end
function
OpenMM_HarmonicBondForce_addBond
(
target
,
particle1
,
particle2
,
length
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
target
integer
*
4
particle1
integer
*
4
particle2
real
*
8
length
real
*
8
k
integer
*
4
OpenMM_HarmonicBondForce_addBond
end
subroutine
OpenMM_HarmonicBondForce_getBondParameters
(
target
,
index
,
particle1
,
particle2
,
length
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
real
*
8
length
real
*
8
k
end
subroutine
OpenMM_HarmonicBondForce_setBondParameters
(
target
,
index
,
particle1
,
particle2
,
length
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
real
*
8
length
real
*
8
k
end
! OpenMM::BrownianIntegrator
subroutine
OpenMM_BrownianIntegrator_create
(
result
,
temperature
,
frictionCoeff
,
stepSize
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BrownianIntegrator
)
result
real
*
8
temperature
real
*
8
frictionCoeff
real
*
8
stepSize
end
subroutine
OpenMM_BrownianIntegrator_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BrownianIntegrator
)
destroy
end
function
OpenMM_BrownianIntegrator_getTemperature
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BrownianIntegrator
)
target
real
*
8
OpenMM_BrownianIntegrator_getTemperature
end
subroutine
OpenMM_BrownianIntegrator_setTemperature
(
target
,
temp
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BrownianIntegrator
)
target
real
*
8
temp
end
function
OpenMM_BrownianIntegrator_getFriction
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BrownianIntegrator
)
target
real
*
8
OpenMM_BrownianIntegrator_getFriction
end
subroutine
OpenMM_BrownianIntegrator_setFriction
(
target
,
coeff
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BrownianIntegrator
)
target
real
*
8
coeff
end
function
OpenMM_BrownianIntegrator_getRandomNumberSeed
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BrownianIntegrator
)
target
integer
*
4
OpenMM_BrownianIntegrator_getRandomNumberSeed
end
subroutine
OpenMM_BrownianIntegrator_setRandomNumberSeed
(
target
,
seed
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BrownianIntegrator
)
target
integer
*
4
seed
end
subroutine
OpenMM_BrownianIntegrator_step
(
target
,
steps
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BrownianIntegrator
)
target
integer
*
4
steps
end
! OpenMM::OpenMMException
subroutine
OpenMM_OpenMMException_create
(
result
,
message
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_OpenMMException
)
result
character
(
*
)
message
end
subroutine
OpenMM_OpenMMException_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_OpenMMException
)
destroy
end
subroutine
OpenMM_OpenMMException_what
(
target
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_OpenMMException
)
target
character
(
*
)
result
end
! OpenMM::NonbondedForce
subroutine
OpenMM_NonbondedForce_create
(
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
result
end
subroutine
OpenMM_NonbondedForce_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
destroy
end
function
OpenMM_NonbondedForce_getNumParticles
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
integer
*
4
OpenMM_NonbondedForce_getNumParticles
end
function
OpenMM_NonbondedForce_getNumExceptions
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
integer
*
4
OpenMM_NonbondedForce_getNumExceptions
end
subroutine
OpenMM_NonbondedForce_getNonbondedMethod
(
target
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
integer
*
4
result
end
subroutine
OpenMM_NonbondedForce_setNonbondedMethod
(
target
,
method
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
integer
*
4
method
end
function
OpenMM_NonbondedForce_getCutoffDistance
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
real
*
8
OpenMM_NonbondedForce_getCutoffDistance
end
subroutine
OpenMM_NonbondedForce_setCutoffDistance
(
target
,
distance
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
real
*
8
distance
end
function
OpenMM_NonbondedForce_getReactionFieldDielectric
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
real
*
8
OpenMM_NonbondedForce_getReactionFieldDielectric
end
subroutine
OpenMM_NonbondedForce_setReactionFieldDielectric
(
target
,
dielectric
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
real
*
8
dielectric
end
function
OpenMM_NonbondedForce_getEwaldErrorTolerance
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
real
*
8
OpenMM_NonbondedForce_getEwaldErrorTolerance
end
subroutine
OpenMM_NonbondedForce_setEwaldErrorTolerance
(
target
,
tol
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
real
*
8
tol
end
subroutine
OpenMM_NonbondedForce_getPeriodicBoxVectors
(
target
,
a
,
b
,
c
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
real
*
8
a
(
3
)
real
*
8
b
(
3
)
real
*
8
c
(
3
)
end
subroutine
OpenMM_NonbondedForce_setPeriodicBoxVectors
(
target
,
a
,
b
,
c
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
real
*
8
a
(
3
)
real
*
8
b
(
3
)
real
*
8
c
(
3
)
end
function
OpenMM_NonbondedForce_addParticle
(
target
,
charge
,
sigma
,
epsilon
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
real
*
8
charge
real
*
8
sigma
real
*
8
epsilon
integer
*
4
OpenMM_NonbondedForce_addParticle
end
subroutine
OpenMM_NonbondedForce_getParticleParameters
(
target
,
index
,
charge
,
sigma
,
epsilon
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
integer
*
4
index
real
*
8
charge
real
*
8
sigma
real
*
8
epsilon
end
subroutine
OpenMM_NonbondedForce_setParticleParameters
(
target
,
index
,
charge
,
sigma
,
epsilon
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
integer
*
4
index
real
*
8
charge
real
*
8
sigma
real
*
8
epsilon
end
function
OpenMM_NonbondedForce_addException
(
target
,
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
,
replace
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
integer
*
4
particle1
integer
*
4
particle2
real
*
8
chargeProd
real
*
8
sigma
real
*
8
epsilon
integer
*
4
replace
integer
*
4
OpenMM_NonbondedForce_addException
end
subroutine
OpenMM_NonbondedForce_getExceptionParameters
(
target
,
index
,
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
real
*
8
chargeProd
real
*
8
sigma
real
*
8
epsilon
end
subroutine
OpenMM_NonbondedForce_setExceptionParameters
(
target
,
index
,
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
real
*
8
chargeProd
real
*
8
sigma
real
*
8
epsilon
end
subroutine
OpenMM_NonbondedForce_createExceptionsFromBonds
(
target
,
bonds
,
coulomb14Scale
,
lj14Scale
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
target
type
(
OpenMM_BondArray
)
bonds
real
*
8
coulomb14Scale
real
*
8
lj14Scale
end
! OpenMM::VariableLangevinIntegrator
subroutine
OpenMM_VariableLangevinIntegrator_create
(
result
,
temperature
,
frictionCoeff
,
errorTol
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableLangevinIntegrator
)
result
real
*
8
temperature
real
*
8
frictionCoeff
real
*
8
errorTol
end
subroutine
OpenMM_VariableLangevinIntegrator_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableLangevinIntegrator
)
destroy
end
function
OpenMM_VariableLangevinIntegrator_getTemperature
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableLangevinIntegrator
)
target
real
*
8
OpenMM_VariableLangevinIntegrator_getTemperature
end
subroutine
OpenMM_VariableLangevinIntegrator_setTemperature
(
target
,
temp
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableLangevinIntegrator
)
target
real
*
8
temp
end
function
OpenMM_VariableLangevinIntegrator_getFriction
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableLangevinIntegrator
)
target
real
*
8
OpenMM_VariableLangevinIntegrator_getFriction
end
subroutine
OpenMM_VariableLangevinIntegrator_setFriction
(
target
,
coeff
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableLangevinIntegrator
)
target
real
*
8
coeff
end
function
OpenMM_VariableLangevinIntegrator_getErrorTolerance
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableLangevinIntegrator
)
target
real
*
8
OpenMM_VariableLangevinIntegrator_getErrorTolerance
end
subroutine
OpenMM_VariableLangevinIntegrator_setErrorTolerance
(
target
,
tol
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableLangevinIntegrator
)
target
real
*
8
tol
end
function
OpenMM_VariableLangevinIntegrator_getRandomNumberSeed
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableLangevinIntegrator
)
target
integer
*
4
OpenMM_VariableLangevinIntegrator_getRandomNumberSeed
end
subroutine
OpenMM_VariableLangevinIntegrator_setRandomNumberSeed
(
target
,
seed
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableLangevinIntegrator
)
target
integer
*
4
seed
end
subroutine
OpenMM_VariableLangevinIntegrator_step
(
target
,
steps
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableLangevinIntegrator
)
target
integer
*
4
steps
end
subroutine
OpenMM_VariableLangevinIntegrator_stepTo
(
target
,
time
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableLangevinIntegrator
)
target
real
*
8
time
end
! OpenMM::GBVIForce
subroutine
OpenMM_GBVIForce_create
(
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBVIForce
)
result
end
subroutine
OpenMM_GBVIForce_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBVIForce
)
destroy
end
function
OpenMM_GBVIForce_getNumParticles
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBVIForce
)
target
integer
*
4
OpenMM_GBVIForce_getNumParticles
end
function
OpenMM_GBVIForce_addParticle
(
target
,
charge
,
radius
,
gamma
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBVIForce
)
target
real
*
8
charge
real
*
8
radius
real
*
8
gamma
integer
*
4
OpenMM_GBVIForce_addParticle
end
subroutine
OpenMM_GBVIForce_getParticleParameters
(
target
,
index
,
charge
,
radius
,
gamma
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBVIForce
)
target
integer
*
4
index
real
*
8
charge
real
*
8
radius
real
*
8
gamma
end
subroutine
OpenMM_GBVIForce_setParticleParameters
(
target
,
index
,
charge
,
radius
,
gamma
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBVIForce
)
target
integer
*
4
index
real
*
8
charge
real
*
8
radius
real
*
8
gamma
end
function
OpenMM_GBVIForce_getSolventDielectric
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBVIForce
)
target
real
*
8
OpenMM_GBVIForce_getSolventDielectric
end
subroutine
OpenMM_GBVIForce_setSolventDielectric
(
target
,
dielectric
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBVIForce
)
target
real
*
8
dielectric
end
function
OpenMM_GBVIForce_getSoluteDielectric
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBVIForce
)
target
real
*
8
OpenMM_GBVIForce_getSoluteDielectric
end
subroutine
OpenMM_GBVIForce_setSoluteDielectric
(
target
,
dielectric
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBVIForce
)
target
real
*
8
dielectric
end
! OpenMM::Context
subroutine
OpenMM_Context_create
(
result
,
system
,
integrator
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
result
type
(
OpenMM_System
)
system
type
(
OpenMM_Integrator
)
integrator
end
subroutine
OpenMM_Context_create_2
(
result
,
system
,
integrator
,
platform
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
result
type
(
OpenMM_System
)
system
type
(
OpenMM_Integrator
)
integrator
type
(
OpenMM_Platform
)
platform
end
subroutine
OpenMM_Context_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
destroy
end
subroutine
OpenMM_Context_getSystem
(
target
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
target
type
(
OpenMM_System
)
result
end
subroutine
OpenMM_Context_getIntegrator
(
target
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
target
type
(
OpenMM_Integrator
)
result
end
subroutine
OpenMM_Context_getPlatform
(
target
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
target
type
(
OpenMM_Platform
)
result
end
subroutine
OpenMM_Context_getState
(
target
,
types
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
target
integer
*
4
types
type
(
OpenMM_State
)
result
end
subroutine
OpenMM_Context_setTime
(
target
,
time
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
target
real
*
8
time
end
subroutine
OpenMM_Context_setPositions
(
target
,
positions
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
target
type
(
OpenMM_Vec3Array
)
positions
end
subroutine
OpenMM_Context_setVelocities
(
target
,
velocities
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
target
type
(
OpenMM_Vec3Array
)
velocities
end
function
OpenMM_Context_getParameter
(
target
,
name
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
target
character
(
*
)
name
real
*
8
OpenMM_Context_getParameter
end
subroutine
OpenMM_Context_setParameter
(
target
,
name
,
value
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
target
character
(
*
)
name
real
*
8
value
end
subroutine
OpenMM_Context_reinitialize
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
target
end
! OpenMM::GBSAOBCForce
subroutine
OpenMM_GBSAOBCForce_create
(
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
result
end
subroutine
OpenMM_GBSAOBCForce_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
destroy
end
function
OpenMM_GBSAOBCForce_getNumParticles
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
target
integer
*
4
OpenMM_GBSAOBCForce_getNumParticles
end
function
OpenMM_GBSAOBCForce_addParticle
(
target
,
charge
,
radius
,
scalingFactor
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
target
real
*
8
charge
real
*
8
radius
real
*
8
scalingFactor
integer
*
4
OpenMM_GBSAOBCForce_addParticle
end
subroutine
OpenMM_GBSAOBCForce_getParticleParameters
(
target
,
index
,
charge
,
radius
,
scalingFactor
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
target
integer
*
4
index
real
*
8
charge
real
*
8
radius
real
*
8
scalingFactor
end
subroutine
OpenMM_GBSAOBCForce_setParticleParameters
(
target
,
index
,
charge
,
radius
,
scalingFactor
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
target
integer
*
4
index
real
*
8
charge
real
*
8
radius
real
*
8
scalingFactor
end
function
OpenMM_GBSAOBCForce_getSolventDielectric
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
target
real
*
8
OpenMM_GBSAOBCForce_getSolventDielectric
end
subroutine
OpenMM_GBSAOBCForce_setSolventDielectric
(
target
,
dielectric
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
target
real
*
8
dielectric
end
function
OpenMM_GBSAOBCForce_getSoluteDielectric
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
target
real
*
8
OpenMM_GBSAOBCForce_getSoluteDielectric
end
subroutine
OpenMM_GBSAOBCForce_setSoluteDielectric
(
target
,
dielectric
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
target
real
*
8
dielectric
end
! OpenMM::VariableVerletIntegrator
subroutine
OpenMM_VariableVerletIntegrator_create
(
result
,
errorTol
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableVerletIntegrator
)
result
real
*
8
errorTol
end
subroutine
OpenMM_VariableVerletIntegrator_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableVerletIntegrator
)
destroy
end
function
OpenMM_VariableVerletIntegrator_getErrorTolerance
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableVerletIntegrator
)
target
real
*
8
OpenMM_VariableVerletIntegrator_getErrorTolerance
end
subroutine
OpenMM_VariableVerletIntegrator_setErrorTolerance
(
target
,
tol
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableVerletIntegrator
)
target
real
*
8
tol
end
subroutine
OpenMM_VariableVerletIntegrator_step
(
target
,
steps
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableVerletIntegrator
)
target
integer
*
4
steps
end
subroutine
OpenMM_VariableVerletIntegrator_stepTo
(
target
,
time
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VariableVerletIntegrator
)
target
real
*
8
time
end
! OpenMM::CMMotionRemover
subroutine
OpenMM_CMMotionRemover_create
(
result
,
frequency
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_CMMotionRemover
)
result
integer
*
4
frequency
end
subroutine
OpenMM_CMMotionRemover_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_CMMotionRemover
)
destroy
end
function
OpenMM_CMMotionRemover_getFrequency
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_CMMotionRemover
)
target
integer
*
4
OpenMM_CMMotionRemover_getFrequency
end
subroutine
OpenMM_CMMotionRemover_setFrequency
(
target
,
freq
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_CMMotionRemover
)
target
integer
*
4
freq
end
! OpenMM::VerletIntegrator
subroutine
OpenMM_VerletIntegrator_create
(
result
,
stepSize
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VerletIntegrator
)
result
real
*
8
stepSize
end
subroutine
OpenMM_VerletIntegrator_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VerletIntegrator
)
destroy
end
subroutine
OpenMM_VerletIntegrator_step
(
target
,
steps
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VerletIntegrator
)
target
integer
*
4
steps
end
! OpenMM::RBTorsionForce
subroutine
OpenMM_RBTorsionForce_create
(
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RBTorsionForce
)
result
end
subroutine
OpenMM_RBTorsionForce_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RBTorsionForce
)
destroy
end
function
OpenMM_RBTorsionForce_getNumTorsions
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RBTorsionForce
)
target
integer
*
4
OpenMM_RBTorsionForce_getNumTorsions
end
function
OpenMM_RBTorsionForce_addTorsion
(
target
,
particle1
,
particle2
,
particle3
,
particle4
,
c0
,
c1
,
c2
,
c3
,
c4
,
c5
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RBTorsionForce
)
target
integer
*
4
particle1
integer
*
4
particle2
integer
*
4
particle3
integer
*
4
particle4
real
*
8
c0
real
*
8
c1
real
*
8
c2
real
*
8
c3
real
*
8
c4
real
*
8
c5
integer
*
4
OpenMM_RBTorsionForce_addTorsion
end
subroutine
OpenMM_RBTorsionForce_getTorsionParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
particle4
,
c0
,
c1
,
c2
,
c3
,
c4
,
c5
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RBTorsionForce
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
integer
*
4
particle3
integer
*
4
particle4
real
*
8
c0
real
*
8
c1
real
*
8
c2
real
*
8
c3
real
*
8
c4
real
*
8
c5
end
subroutine
OpenMM_RBTorsionForce_setTorsionParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
particle4
,
c0
,
c1
,
c2
,
c3
,
c4
,
c5
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RBTorsionForce
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
integer
*
4
particle3
integer
*
4
particle4
real
*
8
c0
real
*
8
c1
real
*
8
c2
real
*
8
c3
real
*
8
c4
real
*
8
c5
end
! OpenMM::LangevinIntegrator
subroutine
OpenMM_LangevinIntegrator_create
(
result
,
temperature
,
frictionCoeff
,
stepSize
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
result
real
*
8
temperature
real
*
8
frictionCoeff
real
*
8
stepSize
end
subroutine
OpenMM_LangevinIntegrator_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
destroy
end
function
OpenMM_LangevinIntegrator_getTemperature
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
target
real
*
8
OpenMM_LangevinIntegrator_getTemperature
end
subroutine
OpenMM_LangevinIntegrator_setTemperature
(
target
,
temp
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
target
real
*
8
temp
end
function
OpenMM_LangevinIntegrator_getFriction
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
target
real
*
8
OpenMM_LangevinIntegrator_getFriction
end
subroutine
OpenMM_LangevinIntegrator_setFriction
(
target
,
coeff
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
target
real
*
8
coeff
end
function
OpenMM_LangevinIntegrator_getRandomNumberSeed
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
target
integer
*
4
OpenMM_LangevinIntegrator_getRandomNumberSeed
end
subroutine
OpenMM_LangevinIntegrator_setRandomNumberSeed
(
target
,
seed
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
target
integer
*
4
seed
end
subroutine
OpenMM_LangevinIntegrator_step
(
target
,
steps
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
target
integer
*
4
steps
end
! OpenMM::Force
! OpenMM::HarmonicAngleForce
subroutine
OpenMM_HarmonicAngleForce_create
(
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
result
end
subroutine
OpenMM_HarmonicAngleForce_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
destroy
end
function
OpenMM_HarmonicAngleForce_getNumAngles
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
target
integer
*
4
OpenMM_HarmonicAngleForce_getNumAngles
end
function
OpenMM_HarmonicAngleForce_addAngle
(
target
,
particle1
,
particle2
,
particle3
,
angle
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
target
integer
*
4
particle1
integer
*
4
particle2
integer
*
4
particle3
real
*
8
angle
real
*
8
k
integer
*
4
OpenMM_HarmonicAngleForce_addAngle
end
subroutine
OpenMM_HarmonicAngleForce_getAngleParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
angle
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
integer
*
4
particle3
real
*
8
angle
real
*
8
k
end
subroutine
OpenMM_HarmonicAngleForce_setAngleParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
angle
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
integer
*
4
particle3
real
*
8
angle
real
*
8
k
end
! OpenMM::AndersenThermostat
subroutine
OpenMM_AndersenThermostat_create
(
result
,
defaultTemperature
,
defaultCollisionFrequency
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
result
real
*
8
defaultTemperature
real
*
8
defaultCollisionFrequency
end
subroutine
OpenMM_AndersenThermostat_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
destroy
end
subroutine
OpenMM_AndersenThermostat_Temperature
(
result
)
use
OpenMM_Types
;
implicit
none
character
(
*
)
result
end
subroutine
OpenMM_AndersenThermostat_CollisionFrequency
(
result
)
use
OpenMM_Types
;
implicit
none
character
(
*
)
result
end
function
OpenMM_AndersenThermostat_getDefaultTemperature
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
target
real
*
8
OpenMM_AndersenThermostat_getDefaultTemperature
end
function
OpenMM_AndersenThermostat_getDefaultCollisionFrequency
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
target
real
*
8
OpenMM_AndersenThermostat_getDefaultCollisionFrequency
end
function
OpenMM_AndersenThermostat_getRandomNumberSeed
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
target
integer
*
4
OpenMM_AndersenThermostat_getRandomNumberSeed
end
subroutine
OpenMM_AndersenThermostat_setRandomNumberSeed
(
target
,
seed
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
target
integer
*
4
seed
end
! OpenMM::Platform
subroutine
OpenMM_Platform_getName
(
target
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Platform
)
target
character
(
*
)
result
end
function
OpenMM_Platform_getSpeed
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Platform
)
target
real
*
8
OpenMM_Platform_getSpeed
end
subroutine
OpenMM_Platform_supportsDoublePrecision
(
target
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Platform
)
target
integer
*
4
result
end
subroutine
OpenMM_Platform_getPropertyNames
(
target
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Platform
)
target
type
(
OpenMM_StringArray
)
result
end
subroutine
OpenMM_Platform_getPropertyValue
(
target
,
context
,
property
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Platform
)
target
type
(
OpenMM_Context
)
context
character
(
*
)
property
character
(
*
)
result
end
subroutine
OpenMM_Platform_setPropertyValue
(
target
,
context
,
property
,
value
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Platform
)
target
type
(
OpenMM_Context
)
context
character
(
*
)
property
character
(
*
)
value
end
subroutine
OpenMM_Platform_getPropertyDefaultValue
(
target
,
property
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Platform
)
target
character
(
*
)
property
character
(
*
)
result
end
subroutine
OpenMM_Platform_setPropertyDefaultValue
(
target
,
property
,
value
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Platform
)
target
character
(
*
)
property
character
(
*
)
value
end
subroutine
OpenMM_Platform_contextCreated
(
target
,
context
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Platform
)
target
type
(
OpenMM_ContextImpl
)
context
end
subroutine
OpenMM_Platform_contextDestroyed
(
target
,
context
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Platform
)
target
type
(
OpenMM_ContextImpl
)
context
end
subroutine
OpenMM_Platform_supportsKernels
(
target
,
kernelNames
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Platform
)
target
type
(
OpenMM_StringArray
)
kernelNames
integer
*
4
result
end
subroutine
OpenMM_Platform_registerPlatform
(
platform
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Platform
)
platform
end
function
OpenMM_Platform_getNumPlatforms
()
use
OpenMM_Types
;
implicit
none
integer
*
4
OpenMM_Platform_getNumPlatforms
end
subroutine
OpenMM_Platform_getPlatform
(
index
,
result
)
use
OpenMM_Types
;
implicit
none
integer
*
4
index
type
(
OpenMM_Platform
)
result
end
subroutine
OpenMM_Platform_findPlatform
(
kernelNames
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_StringArray
)
kernelNames
type
(
OpenMM_Platform
)
result
end
subroutine
OpenMM_Platform_loadPluginLibrary
(
file
)
use
OpenMM_Types
;
implicit
none
character
(
*
)
file
end
subroutine
OpenMM_Platform_loadPluginsFromDirectory
(
directory
,
result
)
use
OpenMM_Types
;
implicit
none
character
(
*
)
directory
type
(
OpenMM_StringArray
)
result
end
subroutine
OpenMM_Platform_getDefaultPluginsDirectory
(
result
)
use
OpenMM_Types
;
implicit
none
character
(
*
)
result
end
! OpenMM::State
subroutine
OpenMM_State_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
destroy
end
function
OpenMM_State_getTime
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
target
real
*
8
OpenMM_State_getTime
end
subroutine
OpenMM_State_getPositions
(
target
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
target
type
(
OpenMM_Vec3Array
)
result
end
subroutine
OpenMM_State_getVelocities
(
target
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
target
type
(
OpenMM_Vec3Array
)
result
end
subroutine
OpenMM_State_getForces
(
target
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
target
type
(
OpenMM_Vec3Array
)
result
end
function
OpenMM_State_getKineticEnergy
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
target
real
*
8
OpenMM_State_getKineticEnergy
end
function
OpenMM_State_getPotentialEnergy
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
target
real
*
8
OpenMM_State_getPotentialEnergy
end
subroutine
OpenMM_State_getParameters
(
target
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
target
type
(
OpenMM_ParameterArray
)
result
end
! OpenMM::PeriodicTorsionForce
subroutine
OpenMM_PeriodicTorsionForce_create
(
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
result
end
subroutine
OpenMM_PeriodicTorsionForce_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
destroy
end
function
OpenMM_PeriodicTorsionForce_getNumTorsions
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
target
integer
*
4
OpenMM_PeriodicTorsionForce_getNumTorsions
end
function
OpenMM_PeriodicTorsionForce_addTorsion
(
target
,
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
,
phase
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
target
integer
*
4
particle1
integer
*
4
particle2
integer
*
4
particle3
integer
*
4
particle4
integer
*
4
periodicity
real
*
8
phase
real
*
8
k
integer
*
4
OpenMM_PeriodicTorsionForce_addTorsion
end
subroutine
OpenMM_PeriodicTorsionForce_getTorsionParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
,
phase
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
integer
*
4
particle3
integer
*
4
particle4
integer
*
4
periodicity
real
*
8
phase
real
*
8
k
end
subroutine
OpenMM_PeriodicTorsionForce_setTorsionParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
,
phase
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
integer
*
4
particle3
integer
*
4
particle4
integer
*
4
periodicity
real
*
8
phase
real
*
8
k
end
! OpenMM::Integrator
function
OpenMM_Integrator_getStepSize
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Integrator
)
target
real
*
8
OpenMM_Integrator_getStepSize
end
subroutine
OpenMM_Integrator_setStepSize
(
target
,
size
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Integrator
)
target
real
*
8
size
end
function
OpenMM_Integrator_getConstraintTolerance
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Integrator
)
target
real
*
8
OpenMM_Integrator_getConstraintTolerance
end
subroutine
OpenMM_Integrator_setConstraintTolerance
(
target
,
tol
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Integrator
)
target
real
*
8
tol
end
subroutine
OpenMM_Integrator_step
(
target
,
steps
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Integrator
)
target
integer
*
4
steps
end
! OpenMM::System
subroutine
OpenMM_System_create
(
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
result
end
subroutine
OpenMM_System_destroy
(
destroy
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
destroy
end
function
OpenMM_System_getNumParticles
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
target
integer
*
4
OpenMM_System_getNumParticles
end
function
OpenMM_System_addParticle
(
target
,
mass
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
target
real
*
8
mass
integer
*
4
OpenMM_System_addParticle
end
function
OpenMM_System_getParticleMass
(
target
,
index
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
target
integer
*
4
index
real
*
8
OpenMM_System_getParticleMass
end
subroutine
OpenMM_System_setParticleMass
(
target
,
index
,
mass
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
target
integer
*
4
index
real
*
8
mass
end
function
OpenMM_System_getNumConstraints
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
target
integer
*
4
OpenMM_System_getNumConstraints
end
function
OpenMM_System_addConstraint
(
target
,
particle1
,
particle2
,
distance
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
target
integer
*
4
particle1
integer
*
4
particle2
real
*
8
distance
integer
*
4
OpenMM_System_addConstraint
end
subroutine
OpenMM_System_getConstraintParameters
(
target
,
index
,
particle1
,
particle2
,
distance
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
real
*
8
distance
end
subroutine
OpenMM_System_setConstraintParameters
(
target
,
index
,
particle1
,
particle2
,
distance
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
target
integer
*
4
index
integer
*
4
particle1
integer
*
4
particle2
real
*
8
distance
end
function
OpenMM_System_addForce
(
target
,
force
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
target
type
(
OpenMM_Force
)
force
integer
*
4
OpenMM_System_addForce
end
function
OpenMM_System_getNumForces
(
target
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
target
integer
*
4
OpenMM_System_getNumForces
end
subroutine
OpenMM_System_getForce
(
target
,
index
,
result
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
target
integer
*
4
index
type
(
OpenMM_Force
)
result
end
end
interface
END
MODULE
OpenMM
examples/OpenMMFortranWrapper.cpp
deleted
100644 → 0
View file @
9438fa83
#include "OpenMMCWrapper.h"
#include "OpenMM.h"
#include <cstring>
#include <vector>
using
namespace
OpenMM
;
using
namespace
std
;
extern
"C"
{
/* OpenMM_Vec3 */
void
openmm_vec3_scale_
(
const
OpenMM_Vec3
&
vec
,
double
const
&
scale
,
OpenMM_Vec3
&
result
)
{
result
=
OpenMM_Vec3_scale
(
vec
,
scale
);
}
void
OPENMM_VEC3_SCALE
(
const
OpenMM_Vec3
&
vec
,
double
const
&
scale
,
OpenMM_Vec3
&
result
)
{
result
=
OpenMM_Vec3_scale
(
vec
,
scale
);
}
/* OpenMM_Vec3Array */
void
openmm_vec3array_create_
(
OpenMM_Vec3Array
*&
result
,
const
int
&
size
)
{
result
=
OpenMM_Vec3Array_create
(
size
);
}
void
OPENMM_VEC3ARRAY_CREATE
(
OpenMM_Vec3Array
*&
result
,
const
int
&
size
)
{
result
=
OpenMM_Vec3Array_create
(
size
);
}
void
openmm_vec3array_destroy_
(
OpenMM_Vec3Array
*&
array
)
{
OpenMM_Vec3Array_destroy
(
array
);
array
=
0
;
}
void
OPENMM_VEC3ARRAY_DESTROY
(
OpenMM_Vec3Array
*&
array
)
{
OpenMM_Vec3Array_destroy
(
array
);
array
=
0
;
}
int
openmm_vec3array_getsize_
(
const
OpenMM_Vec3Array
*
const
&
array
)
{
return
OpenMM_Vec3Array_getSize
(
array
);
}
int
OPENMM_VEC3ARRAY_GETSIZE
(
const
OpenMM_Vec3Array
*
const
&
array
)
{
return
OpenMM_Vec3Array_getSize
(
array
);
}
void
openmm_vec3array_resize_
(
OpenMM_Vec3Array
*
const
&
array
,
const
int
&
size
)
{
OpenMM_Vec3Array_resize
(
array
,
size
);
}
void
OPENMM_VEC3ARRAY_RESIZE
(
OpenMM_Vec3Array
*
const
&
array
,
const
int
&
size
)
{
OpenMM_Vec3Array_resize
(
array
,
size
);
}
void
openmm_vec3array_append_
(
OpenMM_Vec3Array
*
const
&
array
,
const
OpenMM_Vec3
&
vec
)
{
OpenMM_Vec3Array_append
(
array
,
vec
);
}
void
OPENMM_VEC3ARRAY_APPEND
(
OpenMM_Vec3Array
*
const
&
array
,
const
OpenMM_Vec3
&
vec
)
{
OpenMM_Vec3Array_append
(
array
,
vec
);
}
void
openmm_vec3array_set_
(
OpenMM_Vec3Array
*
const
&
array
,
const
int
&
index
,
const
OpenMM_Vec3
&
vec
)
{
OpenMM_Vec3Array_set
(
array
,
index
-
1
,
vec
);
}
void
OPENMM_VEC3ARRAY_SET
(
OpenMM_Vec3Array
*
const
&
array
,
const
int
&
index
,
const
OpenMM_Vec3
&
vec
)
{
OpenMM_Vec3Array_set
(
array
,
index
-
1
,
vec
);
}
void
openmm_vec3array_get_
(
const
OpenMM_Vec3Array
*
const
&
array
,
const
int
&
index
,
OpenMM_Vec3
&
result
)
{
result
=
*
OpenMM_Vec3Array_get
(
array
,
index
-
1
);
}
void
OPENMM_VEC3ARRAY_GET
(
const
OpenMM_Vec3Array
*
const
&
array
,
const
int
&
index
,
OpenMM_Vec3
&
result
)
{
result
=
*
OpenMM_Vec3Array_get
(
array
,
index
-
1
);
}
/* OpenMM_StringArray */
void
copyAndPadString
(
char
*
dest
,
const
char
*
source
,
int
length
)
{
bool
reachedEnd
=
false
;
for
(
int
i
=
0
;
i
<
length
;
i
++
)
{
if
(
source
[
i
]
==
0
)
reachedEnd
=
true
;
dest
[
i
]
=
(
reachedEnd
?
' '
:
source
[
i
]);
}
}
void
openmm_stringarray_create_
(
OpenMM_StringArray
*&
result
,
const
int
&
size
)
{
result
=
OpenMM_StringArray_create
(
size
);
}
void
OPENMM_STRINGARRAY_CREATE
(
OpenMM_StringArray
*&
result
,
const
int
&
size
)
{
result
=
OpenMM_StringArray_create
(
size
);
}
void
openmm_stringarray_destroy_
(
OpenMM_StringArray
*&
array
)
{
OpenMM_StringArray_destroy
(
array
);
array
=
0
;
}
void
OPENMM_STRINGARRAY_DESTROY
(
OpenMM_StringArray
*&
array
)
{
OpenMM_StringArray_destroy
(
array
);
array
=
0
;
}
int
openmm_stringarray_getsize_
(
const
OpenMM_StringArray
*
const
&
array
)
{
return
OpenMM_StringArray_getSize
(
array
);
}
int
OPENMM_STRINGARRAY_GETSIZE
(
const
OpenMM_StringArray
*
const
&
array
)
{
return
OpenMM_StringArray_getSize
(
array
);
}
void
openmm_stringarray_resize_
(
OpenMM_StringArray
*
const
&
array
,
const
int
&
size
)
{
OpenMM_StringArray_resize
(
array
,
size
);
}
void
OPENMM_STRINGARRAY_RESIZE
(
OpenMM_StringArray
*
const
&
array
,
const
int
&
size
)
{
OpenMM_StringArray_resize
(
array
,
size
);
}
void
openmm_stringarray_append_
(
OpenMM_StringArray
*
const
&
array
,
const
char
*
str
,
int
length
)
{
OpenMM_StringArray_append
(
array
,
string
(
str
,
length
).
c_str
());
}
void
OPENMM_STRINGARRAY_APPEND
(
OpenMM_StringArray
*
const
&
array
,
const
char
*
str
,
int
length
)
{
OpenMM_StringArray_append
(
array
,
string
(
str
,
length
).
c_str
());
}
void
openmm_stringarray_set_
(
OpenMM_StringArray
*
const
&
array
,
const
int
&
index
,
const
char
*
str
,
int
length
)
{
OpenMM_StringArray_set
(
array
,
index
-
1
,
string
(
str
,
length
).
c_str
());
}
void
OPENMM_STRINGARRAY_SET
(
OpenMM_StringArray
*
const
&
array
,
const
int
&
index
,
const
char
*
str
,
int
length
)
{
OpenMM_StringArray_set
(
array
,
index
-
1
,
string
(
str
,
length
).
c_str
());
}
void
openmm_stringarray_get_
(
const
OpenMM_StringArray
*
const
&
array
,
const
int
&
index
,
char
*
result
,
int
length
)
{
const
char
*
str
=
OpenMM_StringArray_get
(
array
,
index
-
1
);
copyAndPadString
(
result
,
str
,
length
);
}
void
OPENMM_STRINGARRAY_GET
(
const
OpenMM_StringArray
*
const
&
array
,
const
int
&
index
,
char
*
result
,
int
length
)
{
const
char
*
str
=
OpenMM_StringArray_get
(
array
,
index
-
1
);
copyAndPadString
(
result
,
str
,
length
);
}
/* OpenMM_BondArray */
void
openmm_bondarray_create_
(
OpenMM_BondArray
*&
result
,
const
int
&
size
)
{
result
=
OpenMM_BondArray_create
(
size
);
}
void
OPENMM_BONDARRAY_CREATE
(
OpenMM_BondArray
*&
result
,
const
int
&
size
)
{
result
=
OpenMM_BondArray_create
(
size
);
}
void
openmm_bondarray_destroy_
(
OpenMM_BondArray
*&
array
)
{
OpenMM_BondArray_destroy
(
array
);
array
=
0
;
}
void
OPENMM_BONDARRAY_DESTROY
(
OpenMM_BondArray
*&
array
)
{
OpenMM_BondArray_destroy
(
array
);
array
=
0
;
}
int
openmm_bondarray_getsize_
(
const
OpenMM_BondArray
*
const
&
array
)
{
return
OpenMM_BondArray_getSize
(
array
);
}
int
OPENMM_BONDARRAY_GETSIZE
(
const
OpenMM_BondArray
*
const
&
array
)
{
return
OpenMM_BondArray_getSize
(
array
);
}
void
openmm_bondarray_resize_
(
OpenMM_BondArray
*
const
&
array
,
const
int
&
size
)
{
OpenMM_BondArray_resize
(
array
,
size
);
}
void
OPENMM_BONDARRAY_RESIZE
(
OpenMM_BondArray
*
const
&
array
,
const
int
&
size
)
{
OpenMM_BondArray_resize
(
array
,
size
);
}
void
openmm_bondarray_append_
(
OpenMM_BondArray
*
const
&
array
,
const
int
&
particle1
,
const
int
&
particle2
)
{
OpenMM_BondArray_append
(
array
,
particle1
,
particle2
);
}
void
OPENMM_BONDARRAY_APPEND
(
OpenMM_BondArray
*
const
&
array
,
const
int
&
particle1
,
const
int
&
particle2
)
{
OpenMM_BondArray_append
(
array
,
particle1
,
particle2
);
}
void
openmm_bondarray_set_
(
OpenMM_BondArray
*
const
&
array
,
const
int
&
index
,
const
int
&
particle1
,
const
int
&
particle2
)
{
OpenMM_BondArray_set
(
array
,
index
-
1
,
particle1
,
particle2
);
}
void
OPENMM_BONDARRAY_SET
(
OpenMM_BondArray
*
const
&
array
,
const
int
&
index
,
const
int
&
particle1
,
const
int
&
particle2
)
{
OpenMM_BondArray_set
(
array
,
index
-
1
,
particle1
,
particle2
);
}
void
openmm_bondarray_get_
(
const
OpenMM_BondArray
*
const
&
array
,
const
int
&
index
,
int
*
particle1
,
int
*
particle2
)
{
OpenMM_BondArray_get
(
array
,
index
-
1
,
particle1
,
particle2
);
}
void
OPENMM_BONDARRAY_GET
(
const
OpenMM_BondArray
*
const
&
array
,
const
int
&
index
,
int
*
particle1
,
int
*
particle2
)
{
OpenMM_BondArray_get
(
array
,
index
-
1
,
particle1
,
particle2
);
}
/* OpenMM_ParameterArray */
int
openmm_parameterarray_getsize_
(
const
OpenMM_ParameterArray
*
const
&
array
)
{
return
OpenMM_ParameterArray_getSize
(
array
);
}
int
OPENMM_PARAMETERARRAY_GETSIZE
(
const
OpenMM_ParameterArray
*
const
&
array
)
{
return
OpenMM_ParameterArray_getSize
(
array
);
}
double
openmm_parameterarray_get_
(
const
OpenMM_ParameterArray
*
const
&
array
,
const
char
*
name
,
int
length
)
{
return
OpenMM_ParameterArray_get
(
array
,
string
(
name
,
length
).
c_str
());
}
double
OPENMM_PARAMETERARRAY_GET
(
const
OpenMM_ParameterArray
*
const
&
array
,
const
char
*
name
,
int
length
)
{
return
OpenMM_ParameterArray_get
(
array
,
string
(
name
,
length
).
c_str
());
}
/* These methods need to be handled specially, since their C++ APIs cannot be directly translated to C.
Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself. */
void
openmm_context_getstate_
(
const
OpenMM_Context
*&
target
,
int
const
&
types
,
OpenMM_State
*&
result
)
{
result
=
OpenMM_Context_getState
(
target
,
types
);
};
void
OPENMM_CONTEXT_GETSTATE
(
const
OpenMM_Context
*&
target
,
int
const
&
types
,
OpenMM_State
*&
result
)
{
result
=
OpenMM_Context_getState
(
target
,
types
);
};
void
openmm_platform_loadpluginsfromdirectory_
(
const
char
*
directory
,
OpenMM_StringArray
*&
result
,
int
length
)
{
result
=
OpenMM_Platform_loadPluginsFromDirectory
(
string
(
directory
,
length
).
c_str
());
};
void
OPENMM_PLATFORM_LOADPLUGINSFROMDIRECTORY
(
const
char
*
directory
,
OpenMM_StringArray
*&
result
,
int
length
)
{
result
=
OpenMM_Platform_loadPluginsFromDirectory
(
string
(
directory
,
length
).
c_str
());
};
/* OpenMM::HarmonicBondForce*/
void
openmm_harmonicbondforce_create_
(
OpenMM_HarmonicBondForce
*&
result
)
{
result
=
OpenMM_HarmonicBondForce_create
();
}
void
OPENMM_HARMONICBONDFORCE_CREATE
(
OpenMM_HarmonicBondForce
*&
result
)
{
result
=
OpenMM_HarmonicBondForce_create
();
}
void
openmm_harmonicbondforce_destroy_
(
OpenMM_HarmonicBondForce
*&
destroy
)
{
OpenMM_HarmonicBondForce_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_HARMONICBONDFORCE_DESTROY
(
OpenMM_HarmonicBondForce
*&
destroy
)
{
OpenMM_HarmonicBondForce_destroy
(
destroy
);
destroy
=
0
;
}
int
openmm_harmonicbondforce_getnumbonds_
(
const
OpenMM_HarmonicBondForce
*&
target
)
{
return
OpenMM_HarmonicBondForce_getNumBonds
(
target
);
};
int
OPENMM_HARMONICBONDFORCE_GETNUMBONDS
(
const
OpenMM_HarmonicBondForce
*&
target
)
{
return
OpenMM_HarmonicBondForce_getNumBonds
(
target
);
};
int
openmm_harmonicbondforce_addbond_
(
OpenMM_HarmonicBondForce
*&
target
,
int
const
&
particle1
,
int
const
&
particle2
,
double
const
&
length
,
double
const
&
k
)
{
return
OpenMM_HarmonicBondForce_addBond
(
target
,
particle1
,
particle2
,
length
,
k
);
};
int
OPENMM_HARMONICBONDFORCE_ADDBOND
(
OpenMM_HarmonicBondForce
*&
target
,
int
const
&
particle1
,
int
const
&
particle2
,
double
const
&
length
,
double
const
&
k
)
{
return
OpenMM_HarmonicBondForce_addBond
(
target
,
particle1
,
particle2
,
length
,
k
);
};
void
openmm_harmonicbondforce_getbondparameters_
(
const
OpenMM_HarmonicBondForce
*&
target
,
int
const
&
index
,
int
*
particle1
,
int
*
particle2
,
double
*
length
,
double
*
k
)
{
OpenMM_HarmonicBondForce_getBondParameters
(
target
,
index
,
particle1
,
particle2
,
length
,
k
);
};
void
OPENMM_HARMONICBONDFORCE_GETBONDPARAMETERS
(
const
OpenMM_HarmonicBondForce
*&
target
,
int
const
&
index
,
int
*
particle1
,
int
*
particle2
,
double
*
length
,
double
*
k
)
{
OpenMM_HarmonicBondForce_getBondParameters
(
target
,
index
,
particle1
,
particle2
,
length
,
k
);
};
void
openmm_harmonicbondforce_setbondparameters_
(
OpenMM_HarmonicBondForce
*&
target
,
int
const
&
index
,
int
const
&
particle1
,
int
const
&
particle2
,
double
const
&
length
,
double
const
&
k
)
{
OpenMM_HarmonicBondForce_setBondParameters
(
target
,
index
,
particle1
,
particle2
,
length
,
k
);
};
void
OPENMM_HARMONICBONDFORCE_SETBONDPARAMETERS
(
OpenMM_HarmonicBondForce
*&
target
,
int
const
&
index
,
int
const
&
particle1
,
int
const
&
particle2
,
double
const
&
length
,
double
const
&
k
)
{
OpenMM_HarmonicBondForce_setBondParameters
(
target
,
index
,
particle1
,
particle2
,
length
,
k
);
};
/* OpenMM::BrownianIntegrator*/
void
openmm_brownianintegrator_create_
(
OpenMM_BrownianIntegrator
*&
result
,
double
const
&
temperature
,
double
const
&
frictionCoeff
,
double
const
&
stepSize
)
{
result
=
OpenMM_BrownianIntegrator_create
(
temperature
,
frictionCoeff
,
stepSize
);
}
void
OPENMM_BROWNIANINTEGRATOR_CREATE
(
OpenMM_BrownianIntegrator
*&
result
,
double
const
&
temperature
,
double
const
&
frictionCoeff
,
double
const
&
stepSize
)
{
result
=
OpenMM_BrownianIntegrator_create
(
temperature
,
frictionCoeff
,
stepSize
);
}
void
openmm_brownianintegrator_destroy_
(
OpenMM_BrownianIntegrator
*&
destroy
)
{
OpenMM_BrownianIntegrator_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_BROWNIANINTEGRATOR_DESTROY
(
OpenMM_BrownianIntegrator
*&
destroy
)
{
OpenMM_BrownianIntegrator_destroy
(
destroy
);
destroy
=
0
;
}
double
openmm_brownianintegrator_gettemperature_
(
const
OpenMM_BrownianIntegrator
*&
target
)
{
return
OpenMM_BrownianIntegrator_getTemperature
(
target
);
};
double
OPENMM_BROWNIANINTEGRATOR_GETTEMPERATURE
(
const
OpenMM_BrownianIntegrator
*&
target
)
{
return
OpenMM_BrownianIntegrator_getTemperature
(
target
);
};
void
openmm_brownianintegrator_settemperature_
(
OpenMM_BrownianIntegrator
*&
target
,
double
const
&
temp
)
{
OpenMM_BrownianIntegrator_setTemperature
(
target
,
temp
);
};
void
OPENMM_BROWNIANINTEGRATOR_SETTEMPERATURE
(
OpenMM_BrownianIntegrator
*&
target
,
double
const
&
temp
)
{
OpenMM_BrownianIntegrator_setTemperature
(
target
,
temp
);
};
double
openmm_brownianintegrator_getfriction_
(
const
OpenMM_BrownianIntegrator
*&
target
)
{
return
OpenMM_BrownianIntegrator_getFriction
(
target
);
};
double
OPENMM_BROWNIANINTEGRATOR_GETFRICTION
(
const
OpenMM_BrownianIntegrator
*&
target
)
{
return
OpenMM_BrownianIntegrator_getFriction
(
target
);
};
void
openmm_brownianintegrator_setfriction_
(
OpenMM_BrownianIntegrator
*&
target
,
double
const
&
coeff
)
{
OpenMM_BrownianIntegrator_setFriction
(
target
,
coeff
);
};
void
OPENMM_BROWNIANINTEGRATOR_SETFRICTION
(
OpenMM_BrownianIntegrator
*&
target
,
double
const
&
coeff
)
{
OpenMM_BrownianIntegrator_setFriction
(
target
,
coeff
);
};
int
openmm_brownianintegrator_getrandomnumberseed_
(
const
OpenMM_BrownianIntegrator
*&
target
)
{
return
OpenMM_BrownianIntegrator_getRandomNumberSeed
(
target
);
};
int
OPENMM_BROWNIANINTEGRATOR_GETRANDOMNUMBERSEED
(
const
OpenMM_BrownianIntegrator
*&
target
)
{
return
OpenMM_BrownianIntegrator_getRandomNumberSeed
(
target
);
};
void
openmm_brownianintegrator_setrandomnumberseed_
(
OpenMM_BrownianIntegrator
*&
target
,
int
const
&
seed
)
{
OpenMM_BrownianIntegrator_setRandomNumberSeed
(
target
,
seed
);
};
void
OPENMM_BROWNIANINTEGRATOR_SETRANDOMNUMBERSEED
(
OpenMM_BrownianIntegrator
*&
target
,
int
const
&
seed
)
{
OpenMM_BrownianIntegrator_setRandomNumberSeed
(
target
,
seed
);
};
void
openmm_brownianintegrator_step_
(
OpenMM_BrownianIntegrator
*&
target
,
int
const
&
steps
)
{
OpenMM_BrownianIntegrator_step
(
target
,
steps
);
};
void
OPENMM_BROWNIANINTEGRATOR_STEP
(
OpenMM_BrownianIntegrator
*&
target
,
int
const
&
steps
)
{
OpenMM_BrownianIntegrator_step
(
target
,
steps
);
};
/* OpenMM::OpenMMException*/
void
openmm_openmmexception_create_
(
OpenMM_OpenMMException
*&
result
,
const
char
*
message
,
int
message_length
)
{
result
=
OpenMM_OpenMMException_create
(
string
(
message
,
message_length
).
c_str
());
}
void
OPENMM_OPENMMEXCEPTION_CREATE
(
OpenMM_OpenMMException
*&
result
,
const
char
*
message
,
int
message_length
)
{
result
=
OpenMM_OpenMMException_create
(
string
(
message
,
message_length
).
c_str
());
}
void
openmm_openmmexception_destroy_
(
OpenMM_OpenMMException
*&
destroy
)
{
OpenMM_OpenMMException_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_OPENMMEXCEPTION_DESTROY
(
OpenMM_OpenMMException
*&
destroy
)
{
OpenMM_OpenMMException_destroy
(
destroy
);
destroy
=
0
;
}
void
openmm_openmmexception_what_
(
const
OpenMM_OpenMMException
*&
target
,
char
*
result
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_OpenMMException_what
(
target
);
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
void
OPENMM_OPENMMEXCEPTION_WHAT
(
const
OpenMM_OpenMMException
*&
target
,
char
*
result
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_OpenMMException_what
(
target
);
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
/* OpenMM::NonbondedForce*/
void
openmm_nonbondedforce_create_
(
OpenMM_NonbondedForce
*&
result
)
{
result
=
OpenMM_NonbondedForce_create
();
}
void
OPENMM_NONBONDEDFORCE_CREATE
(
OpenMM_NonbondedForce
*&
result
)
{
result
=
OpenMM_NonbondedForce_create
();
}
void
openmm_nonbondedforce_destroy_
(
OpenMM_NonbondedForce
*&
destroy
)
{
OpenMM_NonbondedForce_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_NONBONDEDFORCE_DESTROY
(
OpenMM_NonbondedForce
*&
destroy
)
{
OpenMM_NonbondedForce_destroy
(
destroy
);
destroy
=
0
;
}
int
openmm_nonbondedforce_getnumparticles_
(
const
OpenMM_NonbondedForce
*&
target
)
{
return
OpenMM_NonbondedForce_getNumParticles
(
target
);
};
int
OPENMM_NONBONDEDFORCE_GETNUMPARTICLES
(
const
OpenMM_NonbondedForce
*&
target
)
{
return
OpenMM_NonbondedForce_getNumParticles
(
target
);
};
int
openmm_nonbondedforce_getnumexceptions_
(
const
OpenMM_NonbondedForce
*&
target
)
{
return
OpenMM_NonbondedForce_getNumExceptions
(
target
);
};
int
OPENMM_NONBONDEDFORCE_GETNUMEXCEPTIONS
(
const
OpenMM_NonbondedForce
*&
target
)
{
return
OpenMM_NonbondedForce_getNumExceptions
(
target
);
};
void
openmm_nonbondedforce_getnonbondedmethod_
(
const
OpenMM_NonbondedForce
*&
target
,
int
&
result
)
{
result
=
OpenMM_NonbondedForce_getNonbondedMethod
(
target
);
};
void
OPENMM_NONBONDEDFORCE_GETNONBONDEDMETHOD
(
const
OpenMM_NonbondedForce
*&
target
,
int
&
result
)
{
result
=
OpenMM_NonbondedForce_getNonbondedMethod
(
target
);
};
void
openmm_nonbondedforce_setnonbondedmethod_
(
OpenMM_NonbondedForce
*&
target
,
int
const
&
method
)
{
OpenMM_NonbondedForce_setNonbondedMethod
(
target
,
(
OpenMM_NonbondedForce_NonbondedMethod
)
method
);
};
void
OPENMM_NONBONDEDFORCE_SETNONBONDEDMETHOD
(
OpenMM_NonbondedForce
*&
target
,
int
const
&
method
)
{
OpenMM_NonbondedForce_setNonbondedMethod
(
target
,
(
OpenMM_NonbondedForce_NonbondedMethod
)
method
);
};
double
openmm_nonbondedforce_getcutoffdistance_
(
const
OpenMM_NonbondedForce
*&
target
)
{
return
OpenMM_NonbondedForce_getCutoffDistance
(
target
);
};
double
OPENMM_NONBONDEDFORCE_GETCUTOFFDISTANCE
(
const
OpenMM_NonbondedForce
*&
target
)
{
return
OpenMM_NonbondedForce_getCutoffDistance
(
target
);
};
void
openmm_nonbondedforce_setcutoffdistance_
(
OpenMM_NonbondedForce
*&
target
,
double
const
&
distance
)
{
OpenMM_NonbondedForce_setCutoffDistance
(
target
,
distance
);
};
void
OPENMM_NONBONDEDFORCE_SETCUTOFFDISTANCE
(
OpenMM_NonbondedForce
*&
target
,
double
const
&
distance
)
{
OpenMM_NonbondedForce_setCutoffDistance
(
target
,
distance
);
};
double
openmm_nonbondedforce_getreactionfielddielectric_
(
const
OpenMM_NonbondedForce
*&
target
)
{
return
OpenMM_NonbondedForce_getReactionFieldDielectric
(
target
);
};
double
OPENMM_NONBONDEDFORCE_GETREACTIONFIELDDIELECTRIC
(
const
OpenMM_NonbondedForce
*&
target
)
{
return
OpenMM_NonbondedForce_getReactionFieldDielectric
(
target
);
};
void
openmm_nonbondedforce_setreactionfielddielectric_
(
OpenMM_NonbondedForce
*&
target
,
double
const
&
dielectric
)
{
OpenMM_NonbondedForce_setReactionFieldDielectric
(
target
,
dielectric
);
};
void
OPENMM_NONBONDEDFORCE_SETREACTIONFIELDDIELECTRIC
(
OpenMM_NonbondedForce
*&
target
,
double
const
&
dielectric
)
{
OpenMM_NonbondedForce_setReactionFieldDielectric
(
target
,
dielectric
);
};
double
openmm_nonbondedforce_getewalderrortolerance_
(
const
OpenMM_NonbondedForce
*&
target
)
{
return
OpenMM_NonbondedForce_getEwaldErrorTolerance
(
target
);
};
double
OPENMM_NONBONDEDFORCE_GETEWALDERRORTOLERANCE
(
const
OpenMM_NonbondedForce
*&
target
)
{
return
OpenMM_NonbondedForce_getEwaldErrorTolerance
(
target
);
};
void
openmm_nonbondedforce_setewalderrortolerance_
(
OpenMM_NonbondedForce
*&
target
,
double
const
&
tol
)
{
OpenMM_NonbondedForce_setEwaldErrorTolerance
(
target
,
tol
);
};
void
OPENMM_NONBONDEDFORCE_SETEWALDERRORTOLERANCE
(
OpenMM_NonbondedForce
*&
target
,
double
const
&
tol
)
{
OpenMM_NonbondedForce_setEwaldErrorTolerance
(
target
,
tol
);
};
void
openmm_nonbondedforce_getperiodicboxvectors_
(
const
OpenMM_NonbondedForce
*&
target
,
OpenMM_Vec3
*
a
,
OpenMM_Vec3
*
b
,
OpenMM_Vec3
*
c
)
{
OpenMM_NonbondedForce_getPeriodicBoxVectors
(
target
,
a
,
b
,
c
);
};
void
OPENMM_NONBONDEDFORCE_GETPERIODICBOXVECTORS
(
const
OpenMM_NonbondedForce
*&
target
,
OpenMM_Vec3
*
a
,
OpenMM_Vec3
*
b
,
OpenMM_Vec3
*
c
)
{
OpenMM_NonbondedForce_getPeriodicBoxVectors
(
target
,
a
,
b
,
c
);
};
void
openmm_nonbondedforce_setperiodicboxvectors_
(
OpenMM_NonbondedForce
*&
target
,
OpenMM_Vec3
const
&
a
,
OpenMM_Vec3
const
&
b
,
OpenMM_Vec3
const
&
c
)
{
OpenMM_NonbondedForce_setPeriodicBoxVectors
(
target
,
a
,
b
,
c
);
};
void
OPENMM_NONBONDEDFORCE_SETPERIODICBOXVECTORS
(
OpenMM_NonbondedForce
*&
target
,
OpenMM_Vec3
const
&
a
,
OpenMM_Vec3
const
&
b
,
OpenMM_Vec3
const
&
c
)
{
OpenMM_NonbondedForce_setPeriodicBoxVectors
(
target
,
a
,
b
,
c
);
};
int
openmm_nonbondedforce_addparticle_
(
OpenMM_NonbondedForce
*&
target
,
double
const
&
charge
,
double
const
&
sigma
,
double
const
&
epsilon
)
{
return
OpenMM_NonbondedForce_addParticle
(
target
,
charge
,
sigma
,
epsilon
);
};
int
OPENMM_NONBONDEDFORCE_ADDPARTICLE
(
OpenMM_NonbondedForce
*&
target
,
double
const
&
charge
,
double
const
&
sigma
,
double
const
&
epsilon
)
{
return
OpenMM_NonbondedForce_addParticle
(
target
,
charge
,
sigma
,
epsilon
);
};
void
openmm_nonbondedforce_getparticleparameters_
(
const
OpenMM_NonbondedForce
*&
target
,
int
const
&
index
,
double
*
charge
,
double
*
sigma
,
double
*
epsilon
)
{
OpenMM_NonbondedForce_getParticleParameters
(
target
,
index
,
charge
,
sigma
,
epsilon
);
};
void
OPENMM_NONBONDEDFORCE_GETPARTICLEPARAMETERS
(
const
OpenMM_NonbondedForce
*&
target
,
int
const
&
index
,
double
*
charge
,
double
*
sigma
,
double
*
epsilon
)
{
OpenMM_NonbondedForce_getParticleParameters
(
target
,
index
,
charge
,
sigma
,
epsilon
);
};
void
openmm_nonbondedforce_setparticleparameters_
(
OpenMM_NonbondedForce
*&
target
,
int
const
&
index
,
double
const
&
charge
,
double
const
&
sigma
,
double
const
&
epsilon
)
{
OpenMM_NonbondedForce_setParticleParameters
(
target
,
index
,
charge
,
sigma
,
epsilon
);
};
void
OPENMM_NONBONDEDFORCE_SETPARTICLEPARAMETERS
(
OpenMM_NonbondedForce
*&
target
,
int
const
&
index
,
double
const
&
charge
,
double
const
&
sigma
,
double
const
&
epsilon
)
{
OpenMM_NonbondedForce_setParticleParameters
(
target
,
index
,
charge
,
sigma
,
epsilon
);
};
int
openmm_nonbondedforce_addexception_
(
OpenMM_NonbondedForce
*&
target
,
int
const
&
particle1
,
int
const
&
particle2
,
double
const
&
chargeProd
,
double
const
&
sigma
,
double
const
&
epsilon
,
OpenMM_Boolean
const
&
replace
)
{
return
OpenMM_NonbondedForce_addException
(
target
,
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
,
replace
);
};
int
OPENMM_NONBONDEDFORCE_ADDEXCEPTION
(
OpenMM_NonbondedForce
*&
target
,
int
const
&
particle1
,
int
const
&
particle2
,
double
const
&
chargeProd
,
double
const
&
sigma
,
double
const
&
epsilon
,
OpenMM_Boolean
const
&
replace
)
{
return
OpenMM_NonbondedForce_addException
(
target
,
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
,
replace
);
};
void
openmm_nonbondedforce_getexceptionparameters_
(
const
OpenMM_NonbondedForce
*&
target
,
int
const
&
index
,
int
*
particle1
,
int
*
particle2
,
double
*
chargeProd
,
double
*
sigma
,
double
*
epsilon
)
{
OpenMM_NonbondedForce_getExceptionParameters
(
target
,
index
,
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
);
};
void
OPENMM_NONBONDEDFORCE_GETEXCEPTIONPARAMETERS
(
const
OpenMM_NonbondedForce
*&
target
,
int
const
&
index
,
int
*
particle1
,
int
*
particle2
,
double
*
chargeProd
,
double
*
sigma
,
double
*
epsilon
)
{
OpenMM_NonbondedForce_getExceptionParameters
(
target
,
index
,
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
);
};
void
openmm_nonbondedforce_setexceptionparameters_
(
OpenMM_NonbondedForce
*&
target
,
int
const
&
index
,
int
const
&
particle1
,
int
const
&
particle2
,
double
const
&
chargeProd
,
double
const
&
sigma
,
double
const
&
epsilon
)
{
OpenMM_NonbondedForce_setExceptionParameters
(
target
,
index
,
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
);
};
void
OPENMM_NONBONDEDFORCE_SETEXCEPTIONPARAMETERS
(
OpenMM_NonbondedForce
*&
target
,
int
const
&
index
,
int
const
&
particle1
,
int
const
&
particle2
,
double
const
&
chargeProd
,
double
const
&
sigma
,
double
const
&
epsilon
)
{
OpenMM_NonbondedForce_setExceptionParameters
(
target
,
index
,
particle1
,
particle2
,
chargeProd
,
sigma
,
epsilon
);
};
void
openmm_nonbondedforce_createexceptionsfrombonds_
(
OpenMM_NonbondedForce
*&
target
,
const
OpenMM_BondArray
*&
bonds
,
double
const
&
coulomb14Scale
,
double
const
&
lj14Scale
)
{
OpenMM_NonbondedForce_createExceptionsFromBonds
(
target
,
bonds
,
coulomb14Scale
,
lj14Scale
);
};
void
OPENMM_NONBONDEDFORCE_CREATEEXCEPTIONSFROMBONDS
(
OpenMM_NonbondedForce
*&
target
,
const
OpenMM_BondArray
*&
bonds
,
double
const
&
coulomb14Scale
,
double
const
&
lj14Scale
)
{
OpenMM_NonbondedForce_createExceptionsFromBonds
(
target
,
bonds
,
coulomb14Scale
,
lj14Scale
);
};
/* OpenMM::VariableLangevinIntegrator*/
void
openmm_variablelangevinintegrator_create_
(
OpenMM_VariableLangevinIntegrator
*&
result
,
double
const
&
temperature
,
double
const
&
frictionCoeff
,
double
const
&
errorTol
)
{
result
=
OpenMM_VariableLangevinIntegrator_create
(
temperature
,
frictionCoeff
,
errorTol
);
}
void
OPENMM_VARIABLELANGEVININTEGRATOR_CREATE
(
OpenMM_VariableLangevinIntegrator
*&
result
,
double
const
&
temperature
,
double
const
&
frictionCoeff
,
double
const
&
errorTol
)
{
result
=
OpenMM_VariableLangevinIntegrator_create
(
temperature
,
frictionCoeff
,
errorTol
);
}
void
openmm_variablelangevinintegrator_destroy_
(
OpenMM_VariableLangevinIntegrator
*&
destroy
)
{
OpenMM_VariableLangevinIntegrator_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_VARIABLELANGEVININTEGRATOR_DESTROY
(
OpenMM_VariableLangevinIntegrator
*&
destroy
)
{
OpenMM_VariableLangevinIntegrator_destroy
(
destroy
);
destroy
=
0
;
}
double
openmm_variablelangevinintegrator_gettemperature_
(
const
OpenMM_VariableLangevinIntegrator
*&
target
)
{
return
OpenMM_VariableLangevinIntegrator_getTemperature
(
target
);
};
double
OPENMM_VARIABLELANGEVININTEGRATOR_GETTEMPERATURE
(
const
OpenMM_VariableLangevinIntegrator
*&
target
)
{
return
OpenMM_VariableLangevinIntegrator_getTemperature
(
target
);
};
void
openmm_variablelangevinintegrator_settemperature_
(
OpenMM_VariableLangevinIntegrator
*&
target
,
double
const
&
temp
)
{
OpenMM_VariableLangevinIntegrator_setTemperature
(
target
,
temp
);
};
void
OPENMM_VARIABLELANGEVININTEGRATOR_SETTEMPERATURE
(
OpenMM_VariableLangevinIntegrator
*&
target
,
double
const
&
temp
)
{
OpenMM_VariableLangevinIntegrator_setTemperature
(
target
,
temp
);
};
double
openmm_variablelangevinintegrator_getfriction_
(
const
OpenMM_VariableLangevinIntegrator
*&
target
)
{
return
OpenMM_VariableLangevinIntegrator_getFriction
(
target
);
};
double
OPENMM_VARIABLELANGEVININTEGRATOR_GETFRICTION
(
const
OpenMM_VariableLangevinIntegrator
*&
target
)
{
return
OpenMM_VariableLangevinIntegrator_getFriction
(
target
);
};
void
openmm_variablelangevinintegrator_setfriction_
(
OpenMM_VariableLangevinIntegrator
*&
target
,
double
const
&
coeff
)
{
OpenMM_VariableLangevinIntegrator_setFriction
(
target
,
coeff
);
};
void
OPENMM_VARIABLELANGEVININTEGRATOR_SETFRICTION
(
OpenMM_VariableLangevinIntegrator
*&
target
,
double
const
&
coeff
)
{
OpenMM_VariableLangevinIntegrator_setFriction
(
target
,
coeff
);
};
double
openmm_variablelangevinintegrator_geterrortolerance_
(
const
OpenMM_VariableLangevinIntegrator
*&
target
)
{
return
OpenMM_VariableLangevinIntegrator_getErrorTolerance
(
target
);
};
double
OPENMM_VARIABLELANGEVININTEGRATOR_GETERRORTOLERANCE
(
const
OpenMM_VariableLangevinIntegrator
*&
target
)
{
return
OpenMM_VariableLangevinIntegrator_getErrorTolerance
(
target
);
};
void
openmm_variablelangevinintegrator_seterrortolerance_
(
OpenMM_VariableLangevinIntegrator
*&
target
,
double
const
&
tol
)
{
OpenMM_VariableLangevinIntegrator_setErrorTolerance
(
target
,
tol
);
};
void
OPENMM_VARIABLELANGEVININTEGRATOR_SETERRORTOLERANCE
(
OpenMM_VariableLangevinIntegrator
*&
target
,
double
const
&
tol
)
{
OpenMM_VariableLangevinIntegrator_setErrorTolerance
(
target
,
tol
);
};
int
openmm_variablelangevinintegrator_getrandomnumberseed_
(
const
OpenMM_VariableLangevinIntegrator
*&
target
)
{
return
OpenMM_VariableLangevinIntegrator_getRandomNumberSeed
(
target
);
};
int
OPENMM_VARIABLELANGEVININTEGRATOR_GETRANDOMNUMBERSEED
(
const
OpenMM_VariableLangevinIntegrator
*&
target
)
{
return
OpenMM_VariableLangevinIntegrator_getRandomNumberSeed
(
target
);
};
void
openmm_variablelangevinintegrator_setrandomnumberseed_
(
OpenMM_VariableLangevinIntegrator
*&
target
,
int
const
&
seed
)
{
OpenMM_VariableLangevinIntegrator_setRandomNumberSeed
(
target
,
seed
);
};
void
OPENMM_VARIABLELANGEVININTEGRATOR_SETRANDOMNUMBERSEED
(
OpenMM_VariableLangevinIntegrator
*&
target
,
int
const
&
seed
)
{
OpenMM_VariableLangevinIntegrator_setRandomNumberSeed
(
target
,
seed
);
};
void
openmm_variablelangevinintegrator_step_
(
OpenMM_VariableLangevinIntegrator
*&
target
,
int
const
&
steps
)
{
OpenMM_VariableLangevinIntegrator_step
(
target
,
steps
);
};
void
OPENMM_VARIABLELANGEVININTEGRATOR_STEP
(
OpenMM_VariableLangevinIntegrator
*&
target
,
int
const
&
steps
)
{
OpenMM_VariableLangevinIntegrator_step
(
target
,
steps
);
};
void
openmm_variablelangevinintegrator_stepto_
(
OpenMM_VariableLangevinIntegrator
*&
target
,
double
const
&
time
)
{
OpenMM_VariableLangevinIntegrator_stepTo
(
target
,
time
);
};
void
OPENMM_VARIABLELANGEVININTEGRATOR_STEPTO
(
OpenMM_VariableLangevinIntegrator
*&
target
,
double
const
&
time
)
{
OpenMM_VariableLangevinIntegrator_stepTo
(
target
,
time
);
};
/* OpenMM::GBVIForce*/
void
openmm_gbviforce_create_
(
OpenMM_GBVIForce
*&
result
)
{
result
=
OpenMM_GBVIForce_create
();
}
void
OPENMM_GBVIFORCE_CREATE
(
OpenMM_GBVIForce
*&
result
)
{
result
=
OpenMM_GBVIForce_create
();
}
void
openmm_gbviforce_destroy_
(
OpenMM_GBVIForce
*&
destroy
)
{
OpenMM_GBVIForce_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_GBVIFORCE_DESTROY
(
OpenMM_GBVIForce
*&
destroy
)
{
OpenMM_GBVIForce_destroy
(
destroy
);
destroy
=
0
;
}
int
openmm_gbviforce_getnumparticles_
(
const
OpenMM_GBVIForce
*&
target
)
{
return
OpenMM_GBVIForce_getNumParticles
(
target
);
};
int
OPENMM_GBVIFORCE_GETNUMPARTICLES
(
const
OpenMM_GBVIForce
*&
target
)
{
return
OpenMM_GBVIForce_getNumParticles
(
target
);
};
int
openmm_gbviforce_addparticle_
(
OpenMM_GBVIForce
*&
target
,
double
const
&
charge
,
double
const
&
radius
,
double
const
&
gamma
)
{
return
OpenMM_GBVIForce_addParticle
(
target
,
charge
,
radius
,
gamma
);
};
int
OPENMM_GBVIFORCE_ADDPARTICLE
(
OpenMM_GBVIForce
*&
target
,
double
const
&
charge
,
double
const
&
radius
,
double
const
&
gamma
)
{
return
OpenMM_GBVIForce_addParticle
(
target
,
charge
,
radius
,
gamma
);
};
void
openmm_gbviforce_getparticleparameters_
(
const
OpenMM_GBVIForce
*&
target
,
int
const
&
index
,
double
*
charge
,
double
*
radius
,
double
*
gamma
)
{
OpenMM_GBVIForce_getParticleParameters
(
target
,
index
,
charge
,
radius
,
gamma
);
};
void
OPENMM_GBVIFORCE_GETPARTICLEPARAMETERS
(
const
OpenMM_GBVIForce
*&
target
,
int
const
&
index
,
double
*
charge
,
double
*
radius
,
double
*
gamma
)
{
OpenMM_GBVIForce_getParticleParameters
(
target
,
index
,
charge
,
radius
,
gamma
);
};
void
openmm_gbviforce_setparticleparameters_
(
OpenMM_GBVIForce
*&
target
,
int
const
&
index
,
double
const
&
charge
,
double
const
&
radius
,
double
const
&
gamma
)
{
OpenMM_GBVIForce_setParticleParameters
(
target
,
index
,
charge
,
radius
,
gamma
);
};
void
OPENMM_GBVIFORCE_SETPARTICLEPARAMETERS
(
OpenMM_GBVIForce
*&
target
,
int
const
&
index
,
double
const
&
charge
,
double
const
&
radius
,
double
const
&
gamma
)
{
OpenMM_GBVIForce_setParticleParameters
(
target
,
index
,
charge
,
radius
,
gamma
);
};
double
openmm_gbviforce_getsolventdielectric_
(
const
OpenMM_GBVIForce
*&
target
)
{
return
OpenMM_GBVIForce_getSolventDielectric
(
target
);
};
double
OPENMM_GBVIFORCE_GETSOLVENTDIELECTRIC
(
const
OpenMM_GBVIForce
*&
target
)
{
return
OpenMM_GBVIForce_getSolventDielectric
(
target
);
};
void
openmm_gbviforce_setsolventdielectric_
(
OpenMM_GBVIForce
*&
target
,
double
const
&
dielectric
)
{
OpenMM_GBVIForce_setSolventDielectric
(
target
,
dielectric
);
};
void
OPENMM_GBVIFORCE_SETSOLVENTDIELECTRIC
(
OpenMM_GBVIForce
*&
target
,
double
const
&
dielectric
)
{
OpenMM_GBVIForce_setSolventDielectric
(
target
,
dielectric
);
};
double
openmm_gbviforce_getsolutedielectric_
(
const
OpenMM_GBVIForce
*&
target
)
{
return
OpenMM_GBVIForce_getSoluteDielectric
(
target
);
};
double
OPENMM_GBVIFORCE_GETSOLUTEDIELECTRIC
(
const
OpenMM_GBVIForce
*&
target
)
{
return
OpenMM_GBVIForce_getSoluteDielectric
(
target
);
};
void
openmm_gbviforce_setsolutedielectric_
(
OpenMM_GBVIForce
*&
target
,
double
const
&
dielectric
)
{
OpenMM_GBVIForce_setSoluteDielectric
(
target
,
dielectric
);
};
void
OPENMM_GBVIFORCE_SETSOLUTEDIELECTRIC
(
OpenMM_GBVIForce
*&
target
,
double
const
&
dielectric
)
{
OpenMM_GBVIForce_setSoluteDielectric
(
target
,
dielectric
);
};
/* OpenMM::Context*/
void
openmm_context_create_
(
OpenMM_Context
*&
result
,
OpenMM_System
*&
system
,
OpenMM_Integrator
*&
integrator
)
{
result
=
OpenMM_Context_create
(
system
,
integrator
);
}
void
OPENMM_CONTEXT_CREATE
(
OpenMM_Context
*&
result
,
OpenMM_System
*&
system
,
OpenMM_Integrator
*&
integrator
)
{
result
=
OpenMM_Context_create
(
system
,
integrator
);
}
void
openmm_context_create_2_
(
OpenMM_Context
*&
result
,
OpenMM_System
*&
system
,
OpenMM_Integrator
*&
integrator
,
OpenMM_Platform
*&
platform
)
{
result
=
OpenMM_Context_create_2
(
system
,
integrator
,
platform
);
}
void
OPENMM_CONTEXT_CREATE_2
(
OpenMM_Context
*&
result
,
OpenMM_System
*&
system
,
OpenMM_Integrator
*&
integrator
,
OpenMM_Platform
*&
platform
)
{
result
=
OpenMM_Context_create_2
(
system
,
integrator
,
platform
);
}
void
openmm_context_destroy_
(
OpenMM_Context
*&
destroy
)
{
OpenMM_Context_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_CONTEXT_DESTROY
(
OpenMM_Context
*&
destroy
)
{
OpenMM_Context_destroy
(
destroy
);
destroy
=
0
;
}
void
openmm_context_getsystem_
(
OpenMM_Context
*&
target
,
OpenMM_System
*&
result
)
{
result
=
OpenMM_Context_getSystem
(
target
);
};
void
OPENMM_CONTEXT_GETSYSTEM
(
OpenMM_Context
*&
target
,
OpenMM_System
*&
result
)
{
result
=
OpenMM_Context_getSystem
(
target
);
};
void
openmm_context_getintegrator_
(
OpenMM_Context
*&
target
,
OpenMM_Integrator
*&
result
)
{
result
=
OpenMM_Context_getIntegrator
(
target
);
};
void
OPENMM_CONTEXT_GETINTEGRATOR
(
OpenMM_Context
*&
target
,
OpenMM_Integrator
*&
result
)
{
result
=
OpenMM_Context_getIntegrator
(
target
);
};
void
openmm_context_getplatform_
(
OpenMM_Context
*&
target
,
OpenMM_Platform
*&
result
)
{
result
=
OpenMM_Context_getPlatform
(
target
);
};
void
OPENMM_CONTEXT_GETPLATFORM
(
OpenMM_Context
*&
target
,
OpenMM_Platform
*&
result
)
{
result
=
OpenMM_Context_getPlatform
(
target
);
};
void
openmm_context_settime_
(
OpenMM_Context
*&
target
,
double
const
&
time
)
{
OpenMM_Context_setTime
(
target
,
time
);
};
void
OPENMM_CONTEXT_SETTIME
(
OpenMM_Context
*&
target
,
double
const
&
time
)
{
OpenMM_Context_setTime
(
target
,
time
);
};
void
openmm_context_setpositions_
(
OpenMM_Context
*&
target
,
const
OpenMM_Vec3Array
*&
positions
)
{
OpenMM_Context_setPositions
(
target
,
positions
);
};
void
OPENMM_CONTEXT_SETPOSITIONS
(
OpenMM_Context
*&
target
,
const
OpenMM_Vec3Array
*&
positions
)
{
OpenMM_Context_setPositions
(
target
,
positions
);
};
void
openmm_context_setvelocities_
(
OpenMM_Context
*&
target
,
const
OpenMM_Vec3Array
*&
velocities
)
{
OpenMM_Context_setVelocities
(
target
,
velocities
);
};
void
OPENMM_CONTEXT_SETVELOCITIES
(
OpenMM_Context
*&
target
,
const
OpenMM_Vec3Array
*&
velocities
)
{
OpenMM_Context_setVelocities
(
target
,
velocities
);
};
double
openmm_context_getparameter_
(
OpenMM_Context
*&
target
,
const
char
*
name
,
int
name_length
)
{
return
OpenMM_Context_getParameter
(
target
,
string
(
name
,
name_length
).
c_str
());
};
double
OPENMM_CONTEXT_GETPARAMETER
(
OpenMM_Context
*&
target
,
const
char
*
name
,
int
name_length
)
{
return
OpenMM_Context_getParameter
(
target
,
string
(
name
,
name_length
).
c_str
());
};
void
openmm_context_setparameter_
(
OpenMM_Context
*&
target
,
const
char
*
name
,
double
const
&
value
,
int
name_length
)
{
OpenMM_Context_setParameter
(
target
,
string
(
name
,
name_length
).
c_str
(),
value
);
};
void
OPENMM_CONTEXT_SETPARAMETER
(
OpenMM_Context
*&
target
,
const
char
*
name
,
double
const
&
value
,
int
name_length
)
{
OpenMM_Context_setParameter
(
target
,
string
(
name
,
name_length
).
c_str
(),
value
);
};
void
openmm_context_reinitialize_
(
OpenMM_Context
*&
target
)
{
OpenMM_Context_reinitialize
(
target
);
};
void
OPENMM_CONTEXT_REINITIALIZE
(
OpenMM_Context
*&
target
)
{
OpenMM_Context_reinitialize
(
target
);
};
/* OpenMM::GBSAOBCForce*/
void
openmm_gbsaobcforce_create_
(
OpenMM_GBSAOBCForce
*&
result
)
{
result
=
OpenMM_GBSAOBCForce_create
();
}
void
OPENMM_GBSAOBCFORCE_CREATE
(
OpenMM_GBSAOBCForce
*&
result
)
{
result
=
OpenMM_GBSAOBCForce_create
();
}
void
openmm_gbsaobcforce_destroy_
(
OpenMM_GBSAOBCForce
*&
destroy
)
{
OpenMM_GBSAOBCForce_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_GBSAOBCFORCE_DESTROY
(
OpenMM_GBSAOBCForce
*&
destroy
)
{
OpenMM_GBSAOBCForce_destroy
(
destroy
);
destroy
=
0
;
}
int
openmm_gbsaobcforce_getnumparticles_
(
const
OpenMM_GBSAOBCForce
*&
target
)
{
return
OpenMM_GBSAOBCForce_getNumParticles
(
target
);
};
int
OPENMM_GBSAOBCFORCE_GETNUMPARTICLES
(
const
OpenMM_GBSAOBCForce
*&
target
)
{
return
OpenMM_GBSAOBCForce_getNumParticles
(
target
);
};
int
openmm_gbsaobcforce_addparticle_
(
OpenMM_GBSAOBCForce
*&
target
,
double
const
&
charge
,
double
const
&
radius
,
double
const
&
scalingFactor
)
{
return
OpenMM_GBSAOBCForce_addParticle
(
target
,
charge
,
radius
,
scalingFactor
);
};
int
OPENMM_GBSAOBCFORCE_ADDPARTICLE
(
OpenMM_GBSAOBCForce
*&
target
,
double
const
&
charge
,
double
const
&
radius
,
double
const
&
scalingFactor
)
{
return
OpenMM_GBSAOBCForce_addParticle
(
target
,
charge
,
radius
,
scalingFactor
);
};
void
openmm_gbsaobcforce_getparticleparameters_
(
const
OpenMM_GBSAOBCForce
*&
target
,
int
const
&
index
,
double
*
charge
,
double
*
radius
,
double
*
scalingFactor
)
{
OpenMM_GBSAOBCForce_getParticleParameters
(
target
,
index
,
charge
,
radius
,
scalingFactor
);
};
void
OPENMM_GBSAOBCFORCE_GETPARTICLEPARAMETERS
(
const
OpenMM_GBSAOBCForce
*&
target
,
int
const
&
index
,
double
*
charge
,
double
*
radius
,
double
*
scalingFactor
)
{
OpenMM_GBSAOBCForce_getParticleParameters
(
target
,
index
,
charge
,
radius
,
scalingFactor
);
};
void
openmm_gbsaobcforce_setparticleparameters_
(
OpenMM_GBSAOBCForce
*&
target
,
int
const
&
index
,
double
const
&
charge
,
double
const
&
radius
,
double
const
&
scalingFactor
)
{
OpenMM_GBSAOBCForce_setParticleParameters
(
target
,
index
,
charge
,
radius
,
scalingFactor
);
};
void
OPENMM_GBSAOBCFORCE_SETPARTICLEPARAMETERS
(
OpenMM_GBSAOBCForce
*&
target
,
int
const
&
index
,
double
const
&
charge
,
double
const
&
radius
,
double
const
&
scalingFactor
)
{
OpenMM_GBSAOBCForce_setParticleParameters
(
target
,
index
,
charge
,
radius
,
scalingFactor
);
};
double
openmm_gbsaobcforce_getsolventdielectric_
(
const
OpenMM_GBSAOBCForce
*&
target
)
{
return
OpenMM_GBSAOBCForce_getSolventDielectric
(
target
);
};
double
OPENMM_GBSAOBCFORCE_GETSOLVENTDIELECTRIC
(
const
OpenMM_GBSAOBCForce
*&
target
)
{
return
OpenMM_GBSAOBCForce_getSolventDielectric
(
target
);
};
void
openmm_gbsaobcforce_setsolventdielectric_
(
OpenMM_GBSAOBCForce
*&
target
,
double
const
&
dielectric
)
{
OpenMM_GBSAOBCForce_setSolventDielectric
(
target
,
dielectric
);
};
void
OPENMM_GBSAOBCFORCE_SETSOLVENTDIELECTRIC
(
OpenMM_GBSAOBCForce
*&
target
,
double
const
&
dielectric
)
{
OpenMM_GBSAOBCForce_setSolventDielectric
(
target
,
dielectric
);
};
double
openmm_gbsaobcforce_getsolutedielectric_
(
const
OpenMM_GBSAOBCForce
*&
target
)
{
return
OpenMM_GBSAOBCForce_getSoluteDielectric
(
target
);
};
double
OPENMM_GBSAOBCFORCE_GETSOLUTEDIELECTRIC
(
const
OpenMM_GBSAOBCForce
*&
target
)
{
return
OpenMM_GBSAOBCForce_getSoluteDielectric
(
target
);
};
void
openmm_gbsaobcforce_setsolutedielectric_
(
OpenMM_GBSAOBCForce
*&
target
,
double
const
&
dielectric
)
{
OpenMM_GBSAOBCForce_setSoluteDielectric
(
target
,
dielectric
);
};
void
OPENMM_GBSAOBCFORCE_SETSOLUTEDIELECTRIC
(
OpenMM_GBSAOBCForce
*&
target
,
double
const
&
dielectric
)
{
OpenMM_GBSAOBCForce_setSoluteDielectric
(
target
,
dielectric
);
};
/* OpenMM::VariableVerletIntegrator*/
void
openmm_variableverletintegrator_create_
(
OpenMM_VariableVerletIntegrator
*&
result
,
double
const
&
errorTol
)
{
result
=
OpenMM_VariableVerletIntegrator_create
(
errorTol
);
}
void
OPENMM_VARIABLEVERLETINTEGRATOR_CREATE
(
OpenMM_VariableVerletIntegrator
*&
result
,
double
const
&
errorTol
)
{
result
=
OpenMM_VariableVerletIntegrator_create
(
errorTol
);
}
void
openmm_variableverletintegrator_destroy_
(
OpenMM_VariableVerletIntegrator
*&
destroy
)
{
OpenMM_VariableVerletIntegrator_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_VARIABLEVERLETINTEGRATOR_DESTROY
(
OpenMM_VariableVerletIntegrator
*&
destroy
)
{
OpenMM_VariableVerletIntegrator_destroy
(
destroy
);
destroy
=
0
;
}
double
openmm_variableverletintegrator_geterrortolerance_
(
const
OpenMM_VariableVerletIntegrator
*&
target
)
{
return
OpenMM_VariableVerletIntegrator_getErrorTolerance
(
target
);
};
double
OPENMM_VARIABLEVERLETINTEGRATOR_GETERRORTOLERANCE
(
const
OpenMM_VariableVerletIntegrator
*&
target
)
{
return
OpenMM_VariableVerletIntegrator_getErrorTolerance
(
target
);
};
void
openmm_variableverletintegrator_seterrortolerance_
(
OpenMM_VariableVerletIntegrator
*&
target
,
double
const
&
tol
)
{
OpenMM_VariableVerletIntegrator_setErrorTolerance
(
target
,
tol
);
};
void
OPENMM_VARIABLEVERLETINTEGRATOR_SETERRORTOLERANCE
(
OpenMM_VariableVerletIntegrator
*&
target
,
double
const
&
tol
)
{
OpenMM_VariableVerletIntegrator_setErrorTolerance
(
target
,
tol
);
};
void
openmm_variableverletintegrator_step_
(
OpenMM_VariableVerletIntegrator
*&
target
,
int
const
&
steps
)
{
OpenMM_VariableVerletIntegrator_step
(
target
,
steps
);
};
void
OPENMM_VARIABLEVERLETINTEGRATOR_STEP
(
OpenMM_VariableVerletIntegrator
*&
target
,
int
const
&
steps
)
{
OpenMM_VariableVerletIntegrator_step
(
target
,
steps
);
};
void
openmm_variableverletintegrator_stepto_
(
OpenMM_VariableVerletIntegrator
*&
target
,
double
const
&
time
)
{
OpenMM_VariableVerletIntegrator_stepTo
(
target
,
time
);
};
void
OPENMM_VARIABLEVERLETINTEGRATOR_STEPTO
(
OpenMM_VariableVerletIntegrator
*&
target
,
double
const
&
time
)
{
OpenMM_VariableVerletIntegrator_stepTo
(
target
,
time
);
};
/* OpenMM::CMMotionRemover*/
void
openmm_cmmotionremover_create_
(
OpenMM_CMMotionRemover
*&
result
,
int
const
&
frequency
)
{
result
=
OpenMM_CMMotionRemover_create
(
frequency
);
}
void
OPENMM_CMMOTIONREMOVER_CREATE
(
OpenMM_CMMotionRemover
*&
result
,
int
const
&
frequency
)
{
result
=
OpenMM_CMMotionRemover_create
(
frequency
);
}
void
openmm_cmmotionremover_destroy_
(
OpenMM_CMMotionRemover
*&
destroy
)
{
OpenMM_CMMotionRemover_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_CMMOTIONREMOVER_DESTROY
(
OpenMM_CMMotionRemover
*&
destroy
)
{
OpenMM_CMMotionRemover_destroy
(
destroy
);
destroy
=
0
;
}
int
openmm_cmmotionremover_getfrequency_
(
const
OpenMM_CMMotionRemover
*&
target
)
{
return
OpenMM_CMMotionRemover_getFrequency
(
target
);
};
int
OPENMM_CMMOTIONREMOVER_GETFREQUENCY
(
const
OpenMM_CMMotionRemover
*&
target
)
{
return
OpenMM_CMMotionRemover_getFrequency
(
target
);
};
void
openmm_cmmotionremover_setfrequency_
(
OpenMM_CMMotionRemover
*&
target
,
int
const
&
freq
)
{
OpenMM_CMMotionRemover_setFrequency
(
target
,
freq
);
};
void
OPENMM_CMMOTIONREMOVER_SETFREQUENCY
(
OpenMM_CMMotionRemover
*&
target
,
int
const
&
freq
)
{
OpenMM_CMMotionRemover_setFrequency
(
target
,
freq
);
};
/* OpenMM::VerletIntegrator*/
void
openmm_verletintegrator_create_
(
OpenMM_VerletIntegrator
*&
result
,
double
const
&
stepSize
)
{
result
=
OpenMM_VerletIntegrator_create
(
stepSize
);
}
void
OPENMM_VERLETINTEGRATOR_CREATE
(
OpenMM_VerletIntegrator
*&
result
,
double
const
&
stepSize
)
{
result
=
OpenMM_VerletIntegrator_create
(
stepSize
);
}
void
openmm_verletintegrator_destroy_
(
OpenMM_VerletIntegrator
*&
destroy
)
{
OpenMM_VerletIntegrator_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_VERLETINTEGRATOR_DESTROY
(
OpenMM_VerletIntegrator
*&
destroy
)
{
OpenMM_VerletIntegrator_destroy
(
destroy
);
destroy
=
0
;
}
void
openmm_verletintegrator_step_
(
OpenMM_VerletIntegrator
*&
target
,
int
const
&
steps
)
{
OpenMM_VerletIntegrator_step
(
target
,
steps
);
};
void
OPENMM_VERLETINTEGRATOR_STEP
(
OpenMM_VerletIntegrator
*&
target
,
int
const
&
steps
)
{
OpenMM_VerletIntegrator_step
(
target
,
steps
);
};
/* OpenMM::RBTorsionForce*/
void
openmm_rbtorsionforce_create_
(
OpenMM_RBTorsionForce
*&
result
)
{
result
=
OpenMM_RBTorsionForce_create
();
}
void
OPENMM_RBTORSIONFORCE_CREATE
(
OpenMM_RBTorsionForce
*&
result
)
{
result
=
OpenMM_RBTorsionForce_create
();
}
void
openmm_rbtorsionforce_destroy_
(
OpenMM_RBTorsionForce
*&
destroy
)
{
OpenMM_RBTorsionForce_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_RBTORSIONFORCE_DESTROY
(
OpenMM_RBTorsionForce
*&
destroy
)
{
OpenMM_RBTorsionForce_destroy
(
destroy
);
destroy
=
0
;
}
int
openmm_rbtorsionforce_getnumtorsions_
(
const
OpenMM_RBTorsionForce
*&
target
)
{
return
OpenMM_RBTorsionForce_getNumTorsions
(
target
);
};
int
OPENMM_RBTORSIONFORCE_GETNUMTORSIONS
(
const
OpenMM_RBTorsionForce
*&
target
)
{
return
OpenMM_RBTorsionForce_getNumTorsions
(
target
);
};
int
openmm_rbtorsionforce_addtorsion_
(
OpenMM_RBTorsionForce
*&
target
,
int
const
&
particle1
,
int
const
&
particle2
,
int
const
&
particle3
,
int
const
&
particle4
,
double
const
&
c0
,
double
const
&
c1
,
double
const
&
c2
,
double
const
&
c3
,
double
const
&
c4
,
double
const
&
c5
)
{
return
OpenMM_RBTorsionForce_addTorsion
(
target
,
particle1
,
particle2
,
particle3
,
particle4
,
c0
,
c1
,
c2
,
c3
,
c4
,
c5
);
};
int
OPENMM_RBTORSIONFORCE_ADDTORSION
(
OpenMM_RBTorsionForce
*&
target
,
int
const
&
particle1
,
int
const
&
particle2
,
int
const
&
particle3
,
int
const
&
particle4
,
double
const
&
c0
,
double
const
&
c1
,
double
const
&
c2
,
double
const
&
c3
,
double
const
&
c4
,
double
const
&
c5
)
{
return
OpenMM_RBTorsionForce_addTorsion
(
target
,
particle1
,
particle2
,
particle3
,
particle4
,
c0
,
c1
,
c2
,
c3
,
c4
,
c5
);
};
void
openmm_rbtorsionforce_gettorsionparameters_
(
const
OpenMM_RBTorsionForce
*&
target
,
int
const
&
index
,
int
*
particle1
,
int
*
particle2
,
int
*
particle3
,
int
*
particle4
,
double
*
c0
,
double
*
c1
,
double
*
c2
,
double
*
c3
,
double
*
c4
,
double
*
c5
)
{
OpenMM_RBTorsionForce_getTorsionParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
particle4
,
c0
,
c1
,
c2
,
c3
,
c4
,
c5
);
};
void
OPENMM_RBTORSIONFORCE_GETTORSIONPARAMETERS
(
const
OpenMM_RBTorsionForce
*&
target
,
int
const
&
index
,
int
*
particle1
,
int
*
particle2
,
int
*
particle3
,
int
*
particle4
,
double
*
c0
,
double
*
c1
,
double
*
c2
,
double
*
c3
,
double
*
c4
,
double
*
c5
)
{
OpenMM_RBTorsionForce_getTorsionParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
particle4
,
c0
,
c1
,
c2
,
c3
,
c4
,
c5
);
};
void
openmm_rbtorsionforce_settorsionparameters_
(
OpenMM_RBTorsionForce
*&
target
,
int
const
&
index
,
int
const
&
particle1
,
int
const
&
particle2
,
int
const
&
particle3
,
int
const
&
particle4
,
double
const
&
c0
,
double
const
&
c1
,
double
const
&
c2
,
double
const
&
c3
,
double
const
&
c4
,
double
const
&
c5
)
{
OpenMM_RBTorsionForce_setTorsionParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
particle4
,
c0
,
c1
,
c2
,
c3
,
c4
,
c5
);
};
void
OPENMM_RBTORSIONFORCE_SETTORSIONPARAMETERS
(
OpenMM_RBTorsionForce
*&
target
,
int
const
&
index
,
int
const
&
particle1
,
int
const
&
particle2
,
int
const
&
particle3
,
int
const
&
particle4
,
double
const
&
c0
,
double
const
&
c1
,
double
const
&
c2
,
double
const
&
c3
,
double
const
&
c4
,
double
const
&
c5
)
{
OpenMM_RBTorsionForce_setTorsionParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
particle4
,
c0
,
c1
,
c2
,
c3
,
c4
,
c5
);
};
/* OpenMM::LangevinIntegrator*/
void
openmm_langevinintegrator_create_
(
OpenMM_LangevinIntegrator
*&
result
,
double
const
&
temperature
,
double
const
&
frictionCoeff
,
double
const
&
stepSize
)
{
result
=
OpenMM_LangevinIntegrator_create
(
temperature
,
frictionCoeff
,
stepSize
);
}
void
OPENMM_LANGEVININTEGRATOR_CREATE
(
OpenMM_LangevinIntegrator
*&
result
,
double
const
&
temperature
,
double
const
&
frictionCoeff
,
double
const
&
stepSize
)
{
result
=
OpenMM_LangevinIntegrator_create
(
temperature
,
frictionCoeff
,
stepSize
);
}
void
openmm_langevinintegrator_destroy_
(
OpenMM_LangevinIntegrator
*&
destroy
)
{
OpenMM_LangevinIntegrator_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_LANGEVININTEGRATOR_DESTROY
(
OpenMM_LangevinIntegrator
*&
destroy
)
{
OpenMM_LangevinIntegrator_destroy
(
destroy
);
destroy
=
0
;
}
double
openmm_langevinintegrator_gettemperature_
(
const
OpenMM_LangevinIntegrator
*&
target
)
{
return
OpenMM_LangevinIntegrator_getTemperature
(
target
);
};
double
OPENMM_LANGEVININTEGRATOR_GETTEMPERATURE
(
const
OpenMM_LangevinIntegrator
*&
target
)
{
return
OpenMM_LangevinIntegrator_getTemperature
(
target
);
};
void
openmm_langevinintegrator_settemperature_
(
OpenMM_LangevinIntegrator
*&
target
,
double
const
&
temp
)
{
OpenMM_LangevinIntegrator_setTemperature
(
target
,
temp
);
};
void
OPENMM_LANGEVININTEGRATOR_SETTEMPERATURE
(
OpenMM_LangevinIntegrator
*&
target
,
double
const
&
temp
)
{
OpenMM_LangevinIntegrator_setTemperature
(
target
,
temp
);
};
double
openmm_langevinintegrator_getfriction_
(
const
OpenMM_LangevinIntegrator
*&
target
)
{
return
OpenMM_LangevinIntegrator_getFriction
(
target
);
};
double
OPENMM_LANGEVININTEGRATOR_GETFRICTION
(
const
OpenMM_LangevinIntegrator
*&
target
)
{
return
OpenMM_LangevinIntegrator_getFriction
(
target
);
};
void
openmm_langevinintegrator_setfriction_
(
OpenMM_LangevinIntegrator
*&
target
,
double
const
&
coeff
)
{
OpenMM_LangevinIntegrator_setFriction
(
target
,
coeff
);
};
void
OPENMM_LANGEVININTEGRATOR_SETFRICTION
(
OpenMM_LangevinIntegrator
*&
target
,
double
const
&
coeff
)
{
OpenMM_LangevinIntegrator_setFriction
(
target
,
coeff
);
};
int
openmm_langevinintegrator_getrandomnumberseed_
(
const
OpenMM_LangevinIntegrator
*&
target
)
{
return
OpenMM_LangevinIntegrator_getRandomNumberSeed
(
target
);
};
int
OPENMM_LANGEVININTEGRATOR_GETRANDOMNUMBERSEED
(
const
OpenMM_LangevinIntegrator
*&
target
)
{
return
OpenMM_LangevinIntegrator_getRandomNumberSeed
(
target
);
};
void
openmm_langevinintegrator_setrandomnumberseed_
(
OpenMM_LangevinIntegrator
*&
target
,
int
const
&
seed
)
{
OpenMM_LangevinIntegrator_setRandomNumberSeed
(
target
,
seed
);
};
void
OPENMM_LANGEVININTEGRATOR_SETRANDOMNUMBERSEED
(
OpenMM_LangevinIntegrator
*&
target
,
int
const
&
seed
)
{
OpenMM_LangevinIntegrator_setRandomNumberSeed
(
target
,
seed
);
};
void
openmm_langevinintegrator_step_
(
OpenMM_LangevinIntegrator
*&
target
,
int
const
&
steps
)
{
OpenMM_LangevinIntegrator_step
(
target
,
steps
);
};
void
OPENMM_LANGEVININTEGRATOR_STEP
(
OpenMM_LangevinIntegrator
*&
target
,
int
const
&
steps
)
{
OpenMM_LangevinIntegrator_step
(
target
,
steps
);
};
/* OpenMM::Force*/
void
openmm_force_destroy_
(
OpenMM_Force
*&
destroy
)
{
OpenMM_Force_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_FORCE_DESTROY
(
OpenMM_Force
*&
destroy
)
{
OpenMM_Force_destroy
(
destroy
);
destroy
=
0
;
}
/* OpenMM::HarmonicAngleForce*/
void
openmm_harmonicangleforce_create_
(
OpenMM_HarmonicAngleForce
*&
result
)
{
result
=
OpenMM_HarmonicAngleForce_create
();
}
void
OPENMM_HARMONICANGLEFORCE_CREATE
(
OpenMM_HarmonicAngleForce
*&
result
)
{
result
=
OpenMM_HarmonicAngleForce_create
();
}
void
openmm_harmonicangleforce_destroy_
(
OpenMM_HarmonicAngleForce
*&
destroy
)
{
OpenMM_HarmonicAngleForce_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_HARMONICANGLEFORCE_DESTROY
(
OpenMM_HarmonicAngleForce
*&
destroy
)
{
OpenMM_HarmonicAngleForce_destroy
(
destroy
);
destroy
=
0
;
}
int
openmm_harmonicangleforce_getnumangles_
(
const
OpenMM_HarmonicAngleForce
*&
target
)
{
return
OpenMM_HarmonicAngleForce_getNumAngles
(
target
);
};
int
OPENMM_HARMONICANGLEFORCE_GETNUMANGLES
(
const
OpenMM_HarmonicAngleForce
*&
target
)
{
return
OpenMM_HarmonicAngleForce_getNumAngles
(
target
);
};
int
openmm_harmonicangleforce_addangle_
(
OpenMM_HarmonicAngleForce
*&
target
,
int
const
&
particle1
,
int
const
&
particle2
,
int
const
&
particle3
,
double
const
&
angle
,
double
const
&
k
)
{
return
OpenMM_HarmonicAngleForce_addAngle
(
target
,
particle1
,
particle2
,
particle3
,
angle
,
k
);
};
int
OPENMM_HARMONICANGLEFORCE_ADDANGLE
(
OpenMM_HarmonicAngleForce
*&
target
,
int
const
&
particle1
,
int
const
&
particle2
,
int
const
&
particle3
,
double
const
&
angle
,
double
const
&
k
)
{
return
OpenMM_HarmonicAngleForce_addAngle
(
target
,
particle1
,
particle2
,
particle3
,
angle
,
k
);
};
void
openmm_harmonicangleforce_getangleparameters_
(
const
OpenMM_HarmonicAngleForce
*&
target
,
int
const
&
index
,
int
*
particle1
,
int
*
particle2
,
int
*
particle3
,
double
*
angle
,
double
*
k
)
{
OpenMM_HarmonicAngleForce_getAngleParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
angle
,
k
);
};
void
OPENMM_HARMONICANGLEFORCE_GETANGLEPARAMETERS
(
const
OpenMM_HarmonicAngleForce
*&
target
,
int
const
&
index
,
int
*
particle1
,
int
*
particle2
,
int
*
particle3
,
double
*
angle
,
double
*
k
)
{
OpenMM_HarmonicAngleForce_getAngleParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
angle
,
k
);
};
void
openmm_harmonicangleforce_setangleparameters_
(
OpenMM_HarmonicAngleForce
*&
target
,
int
const
&
index
,
int
const
&
particle1
,
int
const
&
particle2
,
int
const
&
particle3
,
double
const
&
angle
,
double
const
&
k
)
{
OpenMM_HarmonicAngleForce_setAngleParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
angle
,
k
);
};
void
OPENMM_HARMONICANGLEFORCE_SETANGLEPARAMETERS
(
OpenMM_HarmonicAngleForce
*&
target
,
int
const
&
index
,
int
const
&
particle1
,
int
const
&
particle2
,
int
const
&
particle3
,
double
const
&
angle
,
double
const
&
k
)
{
OpenMM_HarmonicAngleForce_setAngleParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
angle
,
k
);
};
/* OpenMM::AndersenThermostat*/
void
openmm_andersenthermostat_create_
(
OpenMM_AndersenThermostat
*&
result
,
double
const
&
defaultTemperature
,
double
const
&
defaultCollisionFrequency
)
{
result
=
OpenMM_AndersenThermostat_create
(
defaultTemperature
,
defaultCollisionFrequency
);
}
void
OPENMM_ANDERSENTHERMOSTAT_CREATE
(
OpenMM_AndersenThermostat
*&
result
,
double
const
&
defaultTemperature
,
double
const
&
defaultCollisionFrequency
)
{
result
=
OpenMM_AndersenThermostat_create
(
defaultTemperature
,
defaultCollisionFrequency
);
}
void
openmm_andersenthermostat_destroy_
(
OpenMM_AndersenThermostat
*&
destroy
)
{
OpenMM_AndersenThermostat_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_ANDERSENTHERMOSTAT_DESTROY
(
OpenMM_AndersenThermostat
*&
destroy
)
{
OpenMM_AndersenThermostat_destroy
(
destroy
);
destroy
=
0
;
}
void
openmm_andersenthermostat_temperature_
(
char
*
result
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_AndersenThermostat_Temperature
();
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
void
OPENMM_ANDERSENTHERMOSTAT_TEMPERATURE
(
char
*
result
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_AndersenThermostat_Temperature
();
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
void
openmm_andersenthermostat_collisionfrequency_
(
char
*
result
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_AndersenThermostat_CollisionFrequency
();
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
void
OPENMM_ANDERSENTHERMOSTAT_COLLISIONFREQUENCY
(
char
*
result
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_AndersenThermostat_CollisionFrequency
();
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
double
openmm_andersenthermostat_getdefaulttemperature_
(
const
OpenMM_AndersenThermostat
*&
target
)
{
return
OpenMM_AndersenThermostat_getDefaultTemperature
(
target
);
};
double
OPENMM_ANDERSENTHERMOSTAT_GETDEFAULTTEMPERATURE
(
const
OpenMM_AndersenThermostat
*&
target
)
{
return
OpenMM_AndersenThermostat_getDefaultTemperature
(
target
);
};
double
openmm_andersenthermostat_getdefaultcollisionfrequency_
(
const
OpenMM_AndersenThermostat
*&
target
)
{
return
OpenMM_AndersenThermostat_getDefaultCollisionFrequency
(
target
);
};
double
OPENMM_ANDERSENTHERMOSTAT_GETDEFAULTCOLLISIONFREQUENCY
(
const
OpenMM_AndersenThermostat
*&
target
)
{
return
OpenMM_AndersenThermostat_getDefaultCollisionFrequency
(
target
);
};
int
openmm_andersenthermostat_getrandomnumberseed_
(
const
OpenMM_AndersenThermostat
*&
target
)
{
return
OpenMM_AndersenThermostat_getRandomNumberSeed
(
target
);
};
int
OPENMM_ANDERSENTHERMOSTAT_GETRANDOMNUMBERSEED
(
const
OpenMM_AndersenThermostat
*&
target
)
{
return
OpenMM_AndersenThermostat_getRandomNumberSeed
(
target
);
};
void
openmm_andersenthermostat_setrandomnumberseed_
(
OpenMM_AndersenThermostat
*&
target
,
int
const
&
seed
)
{
OpenMM_AndersenThermostat_setRandomNumberSeed
(
target
,
seed
);
};
void
OPENMM_ANDERSENTHERMOSTAT_SETRANDOMNUMBERSEED
(
OpenMM_AndersenThermostat
*&
target
,
int
const
&
seed
)
{
OpenMM_AndersenThermostat_setRandomNumberSeed
(
target
,
seed
);
};
/* OpenMM::Platform*/
void
openmm_platform_destroy_
(
OpenMM_Platform
*&
destroy
)
{
OpenMM_Platform_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_PLATFORM_DESTROY
(
OpenMM_Platform
*&
destroy
)
{
OpenMM_Platform_destroy
(
destroy
);
destroy
=
0
;
}
void
openmm_platform_getname_
(
const
OpenMM_Platform
*&
target
,
char
*
result
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_Platform_getName
(
target
);
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
void
OPENMM_PLATFORM_GETNAME
(
const
OpenMM_Platform
*&
target
,
char
*
result
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_Platform_getName
(
target
);
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
double
openmm_platform_getspeed_
(
const
OpenMM_Platform
*&
target
)
{
return
OpenMM_Platform_getSpeed
(
target
);
};
double
OPENMM_PLATFORM_GETSPEED
(
const
OpenMM_Platform
*&
target
)
{
return
OpenMM_Platform_getSpeed
(
target
);
};
void
openmm_platform_supportsdoubleprecision_
(
const
OpenMM_Platform
*&
target
,
OpenMM_Boolean
&
result
)
{
result
=
OpenMM_Platform_supportsDoublePrecision
(
target
);
};
void
OPENMM_PLATFORM_SUPPORTSDOUBLEPRECISION
(
const
OpenMM_Platform
*&
target
,
OpenMM_Boolean
&
result
)
{
result
=
OpenMM_Platform_supportsDoublePrecision
(
target
);
};
void
openmm_platform_getpropertynames_
(
OpenMM_Platform
*&
target
,
const
OpenMM_StringArray
*&
result
)
{
result
=
OpenMM_Platform_getPropertyNames
(
target
);
};
void
OPENMM_PLATFORM_GETPROPERTYNAMES
(
OpenMM_Platform
*&
target
,
const
OpenMM_StringArray
*&
result
)
{
result
=
OpenMM_Platform_getPropertyNames
(
target
);
};
void
openmm_platform_getpropertyvalue_
(
const
OpenMM_Platform
*&
target
,
const
OpenMM_Context
*&
context
,
const
char
*
property
,
char
*
result
,
int
property_length
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_Platform_getPropertyValue
(
target
,
context
,
string
(
property
,
property_length
).
c_str
());
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
void
OPENMM_PLATFORM_GETPROPERTYVALUE
(
const
OpenMM_Platform
*&
target
,
const
OpenMM_Context
*&
context
,
const
char
*
property
,
char
*
result
,
int
property_length
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_Platform_getPropertyValue
(
target
,
context
,
string
(
property
,
property_length
).
c_str
());
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
void
openmm_platform_setpropertyvalue_
(
const
OpenMM_Platform
*&
target
,
OpenMM_Context
*&
context
,
const
char
*
property
,
const
char
*
value
,
int
property_length
,
int
value_length
)
{
OpenMM_Platform_setPropertyValue
(
target
,
context
,
string
(
property
,
property_length
).
c_str
(),
string
(
value
,
value_length
).
c_str
());
};
void
OPENMM_PLATFORM_SETPROPERTYVALUE
(
const
OpenMM_Platform
*&
target
,
OpenMM_Context
*&
context
,
const
char
*
property
,
const
char
*
value
,
int
property_length
,
int
value_length
)
{
OpenMM_Platform_setPropertyValue
(
target
,
context
,
string
(
property
,
property_length
).
c_str
(),
string
(
value
,
value_length
).
c_str
());
};
void
openmm_platform_getpropertydefaultvalue_
(
const
OpenMM_Platform
*&
target
,
const
char
*
property
,
char
*
result
,
int
property_length
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_Platform_getPropertyDefaultValue
(
target
,
string
(
property
,
property_length
).
c_str
());
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
void
OPENMM_PLATFORM_GETPROPERTYDEFAULTVALUE
(
const
OpenMM_Platform
*&
target
,
const
char
*
property
,
char
*
result
,
int
property_length
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_Platform_getPropertyDefaultValue
(
target
,
string
(
property
,
property_length
).
c_str
());
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
void
openmm_platform_setpropertydefaultvalue_
(
OpenMM_Platform
*&
target
,
const
char
*
property
,
const
char
*
value
,
int
property_length
,
int
value_length
)
{
OpenMM_Platform_setPropertyDefaultValue
(
target
,
string
(
property
,
property_length
).
c_str
(),
string
(
value
,
value_length
).
c_str
());
};
void
OPENMM_PLATFORM_SETPROPERTYDEFAULTVALUE
(
OpenMM_Platform
*&
target
,
const
char
*
property
,
const
char
*
value
,
int
property_length
,
int
value_length
)
{
OpenMM_Platform_setPropertyDefaultValue
(
target
,
string
(
property
,
property_length
).
c_str
(),
string
(
value
,
value_length
).
c_str
());
};
void
openmm_platform_contextcreated_
(
const
OpenMM_Platform
*&
target
,
OpenMM_ContextImpl
*
context
)
{
OpenMM_Platform_contextCreated
(
target
,
context
);
};
void
OPENMM_PLATFORM_CONTEXTCREATED
(
const
OpenMM_Platform
*&
target
,
OpenMM_ContextImpl
*
context
)
{
OpenMM_Platform_contextCreated
(
target
,
context
);
};
void
openmm_platform_contextdestroyed_
(
const
OpenMM_Platform
*&
target
,
OpenMM_ContextImpl
*
context
)
{
OpenMM_Platform_contextDestroyed
(
target
,
context
);
};
void
OPENMM_PLATFORM_CONTEXTDESTROYED
(
const
OpenMM_Platform
*&
target
,
OpenMM_ContextImpl
*
context
)
{
OpenMM_Platform_contextDestroyed
(
target
,
context
);
};
void
openmm_platform_supportskernels_
(
const
OpenMM_Platform
*&
target
,
const
OpenMM_StringArray
*&
kernelNames
,
OpenMM_Boolean
&
result
)
{
result
=
OpenMM_Platform_supportsKernels
(
target
,
kernelNames
);
};
void
OPENMM_PLATFORM_SUPPORTSKERNELS
(
const
OpenMM_Platform
*&
target
,
const
OpenMM_StringArray
*&
kernelNames
,
OpenMM_Boolean
&
result
)
{
result
=
OpenMM_Platform_supportsKernels
(
target
,
kernelNames
);
};
void
openmm_platform_registerplatform_
(
OpenMM_Platform
*&
platform
)
{
OpenMM_Platform_registerPlatform
(
platform
);
};
void
OPENMM_PLATFORM_REGISTERPLATFORM
(
OpenMM_Platform
*&
platform
)
{
OpenMM_Platform_registerPlatform
(
platform
);
};
int
openmm_platform_getnumplatforms_
()
{
return
OpenMM_Platform_getNumPlatforms
();
};
int
OPENMM_PLATFORM_GETNUMPLATFORMS
()
{
return
OpenMM_Platform_getNumPlatforms
();
};
void
openmm_platform_getplatform_
(
int
const
&
index
,
OpenMM_Platform
*&
result
)
{
result
=
OpenMM_Platform_getPlatform
(
index
);
};
void
OPENMM_PLATFORM_GETPLATFORM
(
int
const
&
index
,
OpenMM_Platform
*&
result
)
{
result
=
OpenMM_Platform_getPlatform
(
index
);
};
void
openmm_platform_findplatform_
(
const
OpenMM_StringArray
*&
kernelNames
,
OpenMM_Platform
*&
result
)
{
result
=
OpenMM_Platform_findPlatform
(
kernelNames
);
};
void
OPENMM_PLATFORM_FINDPLATFORM
(
const
OpenMM_StringArray
*&
kernelNames
,
OpenMM_Platform
*&
result
)
{
result
=
OpenMM_Platform_findPlatform
(
kernelNames
);
};
void
openmm_platform_loadpluginlibrary_
(
const
char
*
file
,
int
file_length
)
{
OpenMM_Platform_loadPluginLibrary
(
string
(
file
,
file_length
).
c_str
());
};
void
OPENMM_PLATFORM_LOADPLUGINLIBRARY
(
const
char
*
file
,
int
file_length
)
{
OpenMM_Platform_loadPluginLibrary
(
string
(
file
,
file_length
).
c_str
());
};
void
openmm_platform_getdefaultpluginsdirectory_
(
char
*
result
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_Platform_getDefaultPluginsDirectory
();
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
void
OPENMM_PLATFORM_GETDEFAULTPLUGINSDIRECTORY
(
char
*
result
,
int
result_length
)
{
const
char
*
result_chars
=
OpenMM_Platform_getDefaultPluginsDirectory
();
copyAndPadString
(
result
,
result_chars
,
result_length
);
};
/* OpenMM::State*/
void
openmm_state_destroy_
(
OpenMM_State
*&
destroy
)
{
OpenMM_State_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_STATE_DESTROY
(
OpenMM_State
*&
destroy
)
{
OpenMM_State_destroy
(
destroy
);
destroy
=
0
;
}
double
openmm_state_gettime_
(
const
OpenMM_State
*&
target
)
{
return
OpenMM_State_getTime
(
target
);
};
double
OPENMM_STATE_GETTIME
(
const
OpenMM_State
*&
target
)
{
return
OpenMM_State_getTime
(
target
);
};
void
openmm_state_getpositions_
(
const
OpenMM_State
*&
target
,
const
OpenMM_Vec3Array
*&
result
)
{
result
=
OpenMM_State_getPositions
(
target
);
};
void
OPENMM_STATE_GETPOSITIONS
(
const
OpenMM_State
*&
target
,
const
OpenMM_Vec3Array
*&
result
)
{
result
=
OpenMM_State_getPositions
(
target
);
};
void
openmm_state_getvelocities_
(
const
OpenMM_State
*&
target
,
const
OpenMM_Vec3Array
*&
result
)
{
result
=
OpenMM_State_getVelocities
(
target
);
};
void
OPENMM_STATE_GETVELOCITIES
(
const
OpenMM_State
*&
target
,
const
OpenMM_Vec3Array
*&
result
)
{
result
=
OpenMM_State_getVelocities
(
target
);
};
void
openmm_state_getforces_
(
const
OpenMM_State
*&
target
,
const
OpenMM_Vec3Array
*&
result
)
{
result
=
OpenMM_State_getForces
(
target
);
};
void
OPENMM_STATE_GETFORCES
(
const
OpenMM_State
*&
target
,
const
OpenMM_Vec3Array
*&
result
)
{
result
=
OpenMM_State_getForces
(
target
);
};
double
openmm_state_getkineticenergy_
(
const
OpenMM_State
*&
target
)
{
return
OpenMM_State_getKineticEnergy
(
target
);
};
double
OPENMM_STATE_GETKINETICENERGY
(
const
OpenMM_State
*&
target
)
{
return
OpenMM_State_getKineticEnergy
(
target
);
};
double
openmm_state_getpotentialenergy_
(
const
OpenMM_State
*&
target
)
{
return
OpenMM_State_getPotentialEnergy
(
target
);
};
double
OPENMM_STATE_GETPOTENTIALENERGY
(
const
OpenMM_State
*&
target
)
{
return
OpenMM_State_getPotentialEnergy
(
target
);
};
void
openmm_state_getparameters_
(
const
OpenMM_State
*&
target
,
const
OpenMM_ParameterArray
*&
result
)
{
result
=
OpenMM_State_getParameters
(
target
);
};
void
OPENMM_STATE_GETPARAMETERS
(
const
OpenMM_State
*&
target
,
const
OpenMM_ParameterArray
*&
result
)
{
result
=
OpenMM_State_getParameters
(
target
);
};
/* OpenMM::PeriodicTorsionForce*/
void
openmm_periodictorsionforce_create_
(
OpenMM_PeriodicTorsionForce
*&
result
)
{
result
=
OpenMM_PeriodicTorsionForce_create
();
}
void
OPENMM_PERIODICTORSIONFORCE_CREATE
(
OpenMM_PeriodicTorsionForce
*&
result
)
{
result
=
OpenMM_PeriodicTorsionForce_create
();
}
void
openmm_periodictorsionforce_destroy_
(
OpenMM_PeriodicTorsionForce
*&
destroy
)
{
OpenMM_PeriodicTorsionForce_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_PERIODICTORSIONFORCE_DESTROY
(
OpenMM_PeriodicTorsionForce
*&
destroy
)
{
OpenMM_PeriodicTorsionForce_destroy
(
destroy
);
destroy
=
0
;
}
int
openmm_periodictorsionforce_getnumtorsions_
(
const
OpenMM_PeriodicTorsionForce
*&
target
)
{
return
OpenMM_PeriodicTorsionForce_getNumTorsions
(
target
);
};
int
OPENMM_PERIODICTORSIONFORCE_GETNUMTORSIONS
(
const
OpenMM_PeriodicTorsionForce
*&
target
)
{
return
OpenMM_PeriodicTorsionForce_getNumTorsions
(
target
);
};
int
openmm_periodictorsionforce_addtorsion_
(
OpenMM_PeriodicTorsionForce
*&
target
,
int
const
&
particle1
,
int
const
&
particle2
,
int
const
&
particle3
,
int
const
&
particle4
,
int
const
&
periodicity
,
double
const
&
phase
,
double
const
&
k
)
{
return
OpenMM_PeriodicTorsionForce_addTorsion
(
target
,
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
,
phase
,
k
);
};
int
OPENMM_PERIODICTORSIONFORCE_ADDTORSION
(
OpenMM_PeriodicTorsionForce
*&
target
,
int
const
&
particle1
,
int
const
&
particle2
,
int
const
&
particle3
,
int
const
&
particle4
,
int
const
&
periodicity
,
double
const
&
phase
,
double
const
&
k
)
{
return
OpenMM_PeriodicTorsionForce_addTorsion
(
target
,
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
,
phase
,
k
);
};
void
openmm_periodictorsionforce_gettorsionparameters_
(
const
OpenMM_PeriodicTorsionForce
*&
target
,
int
const
&
index
,
int
*
particle1
,
int
*
particle2
,
int
*
particle3
,
int
*
particle4
,
int
*
periodicity
,
double
*
phase
,
double
*
k
)
{
OpenMM_PeriodicTorsionForce_getTorsionParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
,
phase
,
k
);
};
void
OPENMM_PERIODICTORSIONFORCE_GETTORSIONPARAMETERS
(
const
OpenMM_PeriodicTorsionForce
*&
target
,
int
const
&
index
,
int
*
particle1
,
int
*
particle2
,
int
*
particle3
,
int
*
particle4
,
int
*
periodicity
,
double
*
phase
,
double
*
k
)
{
OpenMM_PeriodicTorsionForce_getTorsionParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
,
phase
,
k
);
};
void
openmm_periodictorsionforce_settorsionparameters_
(
OpenMM_PeriodicTorsionForce
*&
target
,
int
const
&
index
,
int
const
&
particle1
,
int
const
&
particle2
,
int
const
&
particle3
,
int
const
&
particle4
,
int
const
&
periodicity
,
double
const
&
phase
,
double
const
&
k
)
{
OpenMM_PeriodicTorsionForce_setTorsionParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
,
phase
,
k
);
};
void
OPENMM_PERIODICTORSIONFORCE_SETTORSIONPARAMETERS
(
OpenMM_PeriodicTorsionForce
*&
target
,
int
const
&
index
,
int
const
&
particle1
,
int
const
&
particle2
,
int
const
&
particle3
,
int
const
&
particle4
,
int
const
&
periodicity
,
double
const
&
phase
,
double
const
&
k
)
{
OpenMM_PeriodicTorsionForce_setTorsionParameters
(
target
,
index
,
particle1
,
particle2
,
particle3
,
particle4
,
periodicity
,
phase
,
k
);
};
/* OpenMM::Integrator*/
void
openmm_integrator_destroy_
(
OpenMM_Integrator
*&
destroy
)
{
OpenMM_Integrator_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_INTEGRATOR_DESTROY
(
OpenMM_Integrator
*&
destroy
)
{
OpenMM_Integrator_destroy
(
destroy
);
destroy
=
0
;
}
double
openmm_integrator_getstepsize_
(
const
OpenMM_Integrator
*&
target
)
{
return
OpenMM_Integrator_getStepSize
(
target
);
};
double
OPENMM_INTEGRATOR_GETSTEPSIZE
(
const
OpenMM_Integrator
*&
target
)
{
return
OpenMM_Integrator_getStepSize
(
target
);
};
void
openmm_integrator_setstepsize_
(
OpenMM_Integrator
*&
target
,
double
const
&
size
)
{
OpenMM_Integrator_setStepSize
(
target
,
size
);
};
void
OPENMM_INTEGRATOR_SETSTEPSIZE
(
OpenMM_Integrator
*&
target
,
double
const
&
size
)
{
OpenMM_Integrator_setStepSize
(
target
,
size
);
};
double
openmm_integrator_getconstrainttolerance_
(
const
OpenMM_Integrator
*&
target
)
{
return
OpenMM_Integrator_getConstraintTolerance
(
target
);
};
double
OPENMM_INTEGRATOR_GETCONSTRAINTTOLERANCE
(
const
OpenMM_Integrator
*&
target
)
{
return
OpenMM_Integrator_getConstraintTolerance
(
target
);
};
void
openmm_integrator_setconstrainttolerance_
(
OpenMM_Integrator
*&
target
,
double
const
&
tol
)
{
OpenMM_Integrator_setConstraintTolerance
(
target
,
tol
);
};
void
OPENMM_INTEGRATOR_SETCONSTRAINTTOLERANCE
(
OpenMM_Integrator
*&
target
,
double
const
&
tol
)
{
OpenMM_Integrator_setConstraintTolerance
(
target
,
tol
);
};
void
openmm_integrator_step_
(
OpenMM_Integrator
*&
target
,
int
const
&
steps
)
{
OpenMM_Integrator_step
(
target
,
steps
);
};
void
OPENMM_INTEGRATOR_STEP
(
OpenMM_Integrator
*&
target
,
int
const
&
steps
)
{
OpenMM_Integrator_step
(
target
,
steps
);
};
/* OpenMM::System*/
void
openmm_system_create_
(
OpenMM_System
*&
result
)
{
result
=
OpenMM_System_create
();
}
void
OPENMM_SYSTEM_CREATE
(
OpenMM_System
*&
result
)
{
result
=
OpenMM_System_create
();
}
void
openmm_system_destroy_
(
OpenMM_System
*&
destroy
)
{
OpenMM_System_destroy
(
destroy
);
destroy
=
0
;
}
void
OPENMM_SYSTEM_DESTROY
(
OpenMM_System
*&
destroy
)
{
OpenMM_System_destroy
(
destroy
);
destroy
=
0
;
}
int
openmm_system_getnumparticles_
(
const
OpenMM_System
*&
target
)
{
return
OpenMM_System_getNumParticles
(
target
);
};
int
OPENMM_SYSTEM_GETNUMPARTICLES
(
const
OpenMM_System
*&
target
)
{
return
OpenMM_System_getNumParticles
(
target
);
};
int
openmm_system_addparticle_
(
OpenMM_System
*&
target
,
double
const
&
mass
)
{
return
OpenMM_System_addParticle
(
target
,
mass
);
};
int
OPENMM_SYSTEM_ADDPARTICLE
(
OpenMM_System
*&
target
,
double
const
&
mass
)
{
return
OpenMM_System_addParticle
(
target
,
mass
);
};
double
openmm_system_getparticlemass_
(
const
OpenMM_System
*&
target
,
int
const
&
index
)
{
return
OpenMM_System_getParticleMass
(
target
,
index
);
};
double
OPENMM_SYSTEM_GETPARTICLEMASS
(
const
OpenMM_System
*&
target
,
int
const
&
index
)
{
return
OpenMM_System_getParticleMass
(
target
,
index
);
};
void
openmm_system_setparticlemass_
(
OpenMM_System
*&
target
,
int
const
&
index
,
double
const
&
mass
)
{
OpenMM_System_setParticleMass
(
target
,
index
,
mass
);
};
void
OPENMM_SYSTEM_SETPARTICLEMASS
(
OpenMM_System
*&
target
,
int
const
&
index
,
double
const
&
mass
)
{
OpenMM_System_setParticleMass
(
target
,
index
,
mass
);
};
int
openmm_system_getnumconstraints_
(
const
OpenMM_System
*&
target
)
{
return
OpenMM_System_getNumConstraints
(
target
);
};
int
OPENMM_SYSTEM_GETNUMCONSTRAINTS
(
const
OpenMM_System
*&
target
)
{
return
OpenMM_System_getNumConstraints
(
target
);
};
int
openmm_system_addconstraint_
(
OpenMM_System
*&
target
,
int
const
&
particle1
,
int
const
&
particle2
,
double
const
&
distance
)
{
return
OpenMM_System_addConstraint
(
target
,
particle1
,
particle2
,
distance
);
};
int
OPENMM_SYSTEM_ADDCONSTRAINT
(
OpenMM_System
*&
target
,
int
const
&
particle1
,
int
const
&
particle2
,
double
const
&
distance
)
{
return
OpenMM_System_addConstraint
(
target
,
particle1
,
particle2
,
distance
);
};
void
openmm_system_getconstraintparameters_
(
const
OpenMM_System
*&
target
,
int
const
&
index
,
int
*
particle1
,
int
*
particle2
,
double
*
distance
)
{
OpenMM_System_getConstraintParameters
(
target
,
index
,
particle1
,
particle2
,
distance
);
};
void
OPENMM_SYSTEM_GETCONSTRAINTPARAMETERS
(
const
OpenMM_System
*&
target
,
int
const
&
index
,
int
*
particle1
,
int
*
particle2
,
double
*
distance
)
{
OpenMM_System_getConstraintParameters
(
target
,
index
,
particle1
,
particle2
,
distance
);
};
void
openmm_system_setconstraintparameters_
(
OpenMM_System
*&
target
,
int
const
&
index
,
int
const
&
particle1
,
int
const
&
particle2
,
double
const
&
distance
)
{
OpenMM_System_setConstraintParameters
(
target
,
index
,
particle1
,
particle2
,
distance
);
};
void
OPENMM_SYSTEM_SETCONSTRAINTPARAMETERS
(
OpenMM_System
*&
target
,
int
const
&
index
,
int
const
&
particle1
,
int
const
&
particle2
,
double
const
&
distance
)
{
OpenMM_System_setConstraintParameters
(
target
,
index
,
particle1
,
particle2
,
distance
);
};
int
openmm_system_addforce_
(
OpenMM_System
*&
target
,
OpenMM_Force
*&
force
)
{
return
OpenMM_System_addForce
(
target
,
force
);
};
int
OPENMM_SYSTEM_ADDFORCE
(
OpenMM_System
*&
target
,
OpenMM_Force
*&
force
)
{
return
OpenMM_System_addForce
(
target
,
force
);
};
int
openmm_system_getnumforces_
(
const
OpenMM_System
*&
target
)
{
return
OpenMM_System_getNumForces
(
target
);
};
int
OPENMM_SYSTEM_GETNUMFORCES
(
const
OpenMM_System
*&
target
)
{
return
OpenMM_System_getNumForces
(
target
);
};
void
openmm_system_getforce_
(
OpenMM_System
*&
target
,
int
const
&
index
,
OpenMM_Force
*&
result
)
{
result
=
OpenMM_System_getForce
(
target
,
index
);
};
void
OPENMM_SYSTEM_GETFORCE
(
OpenMM_System
*&
target
,
int
const
&
index
,
OpenMM_Force
*&
result
)
{
result
=
OpenMM_System_getForce
(
target
,
index
);
};
}
examples/OpenMM_CWrapper.cpp
deleted
100644 → 0
View file @
9438fa83
// -----------------------------------------------------------------------------
// OpenMM(tm) PROTOTPYE C and Fortran wrapper functions (June 2009)
// -----------------------------------------------------------------------------
// This is the C++ implementation of the C wrappers for the OpenMM workshop.
// The functions here convert between C types and OpenMM's C++ objects
// and then call the appropriate OpenMM methods.
//
// Each C function comes in several forms -- one is intended to be called from C
// main programs, and the others from Fortran main programs. The Fortran ones
// typically just translates Fortran naming and argument conventions into C
// and then calls the C function. In particular, gcc's gfortran compiler
// translates names into all-lowercase and appends an underscore, while
// Intel's ifort compiler tranlates names into all-uppercase and does not
// append an underscore.
//
// A C main program can use this just by including the OpenMM_CWrapper.h
// header file that is included here as well. A Fortran 95 program can use
// the "use OpenMM" module which defines an interface to the Fortran-callable
// functions defined here. Fortran 77 programs have to call these directly;
// you can use an integer*8 to hold the pointers on any platform.
// -----------------------------------------------------------------------------
#include "OpenMM_CWrapper.h"
#include <cstring>
// Suppress irrelevant warnings from Microsoft's compiler.
#ifdef _MSC_VER
#pragma warning(disable:4996) // sprintf is unsafe
#pragma warning(disable:4251) // no dll interface for some classes
#endif
#include "OpenMM.h"
using
namespace
OpenMM
;
static
inline
Vec3
toVec3
(
const
OpenMM_Vec3
src
)
{
return
Vec3
(
src
[
0
],
src
[
1
],
src
[
2
]);
}
static
inline
Vec3
scaleToVec3
(
const
OpenMM_Vec3
src
,
double
s
)
{
return
Vec3
(
s
*
src
[
0
],
s
*
src
[
1
],
s
*
src
[
2
]);
}
static
inline
void
fromVec3
(
const
Vec3
&
src
,
OpenMM_Vec3
dest
)
{
dest
[
0
]
=
src
[
0
];
dest
[
1
]
=
src
[
1
];
dest
[
2
]
=
src
[
2
];
}
static
inline
void
scaleFromVec3
(
const
Vec3
&
src
,
double
s
,
OpenMM_Vec3
dest
)
{
dest
[
0
]
=
s
*
src
[
0
];
dest
[
1
]
=
s
*
src
[
1
];
dest
[
2
]
=
s
*
src
[
2
];
}
extern
"C"
{
///////////////////////////////
// std::vector<OpenMM::Vec3> //
///////////////////////////////
// This provides std::vector<Vec3> functionality to the
// C program. It isn't as elegant as in C++ but is still better
// than doing it in C. Also, this allows the C program to
// communicate with OpenMM without having to copy arrays of
// Vec3s to and from std::vectors.
OpenMM_Vec3Array
*
OpenMM_Vec3Array_create
(
int
n
)
{
return
(
OpenMM_Vec3Array
*
)
new
std
::
vector
<
Vec3
>
(
n
);
}
void
openmm_vec3array_create_
(
OpenMM_Vec3Array
*&
a
,
const
int
&
n
)
{
a
=
OpenMM_Vec3Array_create
(
n
);
}
void
OPENMM_VEC3ARRAY_CREATE
(
OpenMM_Vec3Array
*&
a
,
const
int
&
n
)
{
a
=
OpenMM_Vec3Array_create
(
n
);
}
int
OpenMM_Vec3Array_size
(
const
OpenMM_Vec3Array
*
a
)
{
return
(
int
)((
const
std
::
vector
<
Vec3
>*
)
a
)
->
size
();
}
int
openmm_vec3array_size_
(
const
OpenMM_Vec3Array
*&
a
)
{
return
OpenMM_Vec3Array_size
(
a
);
}
int
OPENMM_VEC3ARRAY_SIZE
(
const
OpenMM_Vec3Array
*&
a
)
{
return
OpenMM_Vec3Array_size
(
a
);
}
void
OpenMM_Vec3Array_resize
(
OpenMM_Vec3Array
*
a
,
int
n
)
{
((
std
::
vector
<
Vec3
>*
)
a
)
->
resize
(
n
);
}
void
openmm_vec3array_resize_
(
OpenMM_Vec3Array
*
const
&
a
,
const
int
&
n
)
{
OpenMM_Vec3Array_resize
(
a
,
n
);
}
void
OPENMM_VEC3ARRAY_RESIZE
(
OpenMM_Vec3Array
*
const
&
a
,
const
int
&
n
)
{
OpenMM_Vec3Array_resize
(
a
,
n
);
}
void
OpenMM_Vec3Array_destroy
(
OpenMM_Vec3Array
*
doomed
)
{
delete
((
std
::
vector
<
Vec3
>*
)
doomed
);
}
void
openmm_vec3array_destroy_
(
OpenMM_Vec3Array
*&
doomed
)
{
OpenMM_Vec3Array_destroy
(
doomed
);
doomed
=
0
;
}
void
OPENMM_VEC3ARRAY_DESTROY
(
OpenMM_Vec3Array
*&
doomed
)
{
OpenMM_Vec3Array_destroy
(
doomed
);
doomed
=
0
;
}
void
OpenMM_Vec3Array_append
(
OpenMM_Vec3Array
*
a
,
const
OpenMM_Vec3
v
)
{
((
std
::
vector
<
Vec3
>*
)
a
)
->
push_back
(
*
(
const
Vec3
*
)
v
);
}
void
openmm_vec3array_append_
(
OpenMM_Vec3Array
*
const
&
a
,
const
OpenMM_Vec3
v
)
{
OpenMM_Vec3Array_append
(
a
,
v
);
}
void
OPENMM_VEC3ARRAY_APPEND
(
OpenMM_Vec3Array
*
const
&
a
,
const
OpenMM_Vec3
v
)
{
OpenMM_Vec3Array_append
(
a
,
v
);
}
// Get a single Vec3 element from the array. Index is 0-relative in C, 1-relative in Fortran.
void
OpenMM_Vec3Array_get
(
const
OpenMM_Vec3Array
*
a
,
int
i0
,
OpenMM_Vec3
ov3
)
{
fromVec3
((
*
(
const
std
::
vector
<
Vec3
>*
)
a
)[
i0
],
ov3
);
}
void
openmm_vec3array_get_
(
const
OpenMM_Vec3Array
*
const
&
a
,
const
int
&
i1
,
OpenMM_Vec3
ov3
)
{
OpenMM_Vec3Array_get
(
a
,
i1
-
1
,
ov3
);
}
void
OPENMM_VEC3ARRAY_GET
(
const
OpenMM_Vec3Array
*
const
&
a
,
const
int
&
i1
,
OpenMM_Vec3
ov3
)
{
OpenMM_Vec3Array_get
(
a
,
i1
-
1
,
ov3
);
}
// Get a single Vec3 element from the array and scale it. Index is 0-relative in C,
// 1-relative in Fortran.
void
OpenMM_Vec3Array_getScaled
(
const
OpenMM_Vec3Array
*
a
,
int
i0
,
double
s
,
OpenMM_Vec3
ov3
)
{
scaleFromVec3
((
*
(
const
std
::
vector
<
Vec3
>*
)
a
)[
i0
],
s
,
ov3
);
}
void
openmm_vec3array_getscaled_
(
const
OpenMM_Vec3Array
*
const
&
a
,
const
int
&
i1
,
const
double
&
s
,
OpenMM_Vec3
ov3
)
{
OpenMM_Vec3Array_getScaled
(
a
,
i1
-
1
,
s
,
ov3
);
}
void
OPENMM_VEC3ARRAY_GETSCALED
(
const
OpenMM_Vec3Array
*
const
&
a
,
const
int
&
i1
,
const
double
&
s
,
OpenMM_Vec3
ov3
)
{
OpenMM_Vec3Array_getScaled
(
a
,
i1
-
1
,
s
,
ov3
);
}
// Set a single Vec3 element in the array. Index is 0-relative in C, 1-relative in Fortran.
void
OpenMM_Vec3Array_set
(
OpenMM_Vec3Array
*
a
,
int
i0
,
const
OpenMM_Vec3
v3
)
{
(
*
(
std
::
vector
<
Vec3
>*
)
a
)[
i0
]
=
toVec3
(
v3
);
}
void
openmm_vec3array_set_
(
OpenMM_Vec3Array
*
const
&
a
,
const
int
&
i1
,
const
OpenMM_Vec3
v3
)
{
OpenMM_Vec3Array_set
(
a
,
i1
-
1
,
v3
);
}
void
OPENMM_VEC3ARRAY_SET
(
OpenMM_Vec3Array
*
const
&
a
,
const
int
&
i1
,
const
OpenMM_Vec3
v3
)
{
OpenMM_Vec3Array_set
(
a
,
i1
-
1
,
v3
);
}
// Set a single Vec3 element in the array to a scaling of the input vector.
// Index is 0-relative in C, 1-relative in Fortran.
void
OpenMM_Vec3Array_setScaled
(
OpenMM_Vec3Array
*
a
,
int
i0
,
const
OpenMM_Vec3
v3
,
double
s
)
{
(
*
(
std
::
vector
<
Vec3
>*
)
a
)[
i0
]
=
scaleToVec3
(
v3
,
s
);
}
void
openmm_vec3array_setscaled_
(
OpenMM_Vec3Array
*
const
&
a
,
const
int
&
i1
,
const
OpenMM_Vec3
v3
,
const
double
&
s
)
{
OpenMM_Vec3Array_setScaled
(
a
,
i1
-
1
,
v3
,
s
);
}
void
OPENMM_VEC3ARRAY_SETSCALED
(
OpenMM_Vec3Array
*
const
&
a
,
const
int
&
i1
,
const
OpenMM_Vec3
v3
,
const
double
&
s
)
{
OpenMM_Vec3Array_setScaled
(
a
,
i1
-
1
,
v3
,
s
);
}
void
OpenMM_Vec3_scale
(
const
double
in
[
3
],
double
s
,
double
out
[
3
])
{
out
[
0
]
=
s
*
in
[
0
];
out
[
1
]
=
s
*
in
[
1
];
out
[
2
]
=
s
*
in
[
2
];
}
void
openmm_vec3_scale_
(
const
double
in
[
3
],
const
double
&
s
,
double
out
[
3
])
{
out
[
0
]
=
s
*
in
[
0
];
out
[
1
]
=
s
*
in
[
1
];
out
[
2
]
=
s
*
in
[
2
];
}
void
OPENMM_VEC3_SCALE
(
const
double
in
[
3
],
const
double
&
s
,
double
out
[
3
])
{
out
[
0
]
=
s
*
in
[
0
];
out
[
1
]
=
s
*
in
[
1
];
out
[
2
]
=
s
*
in
[
2
];
}
///////////////////////////////////////
// std::vector< std::pair<int,int> > //
///////////////////////////////////////
// This provides std::vector< std::pair<int,int> > functionality to the
// C program, for use as a list of bond pairs.
typedef
std
::
vector
<
std
::
pair
<
int
,
int
>
>
IntPairs
;
OpenMM_BondArray
*
OpenMM_BondArray_create
(
int
n
)
{
return
(
OpenMM_BondArray
*
)
new
IntPairs
(
n
);
}
void
openmm_bondarray_create_
(
OpenMM_BondArray
*&
a
,
const
int
&
n
)
{
a
=
OpenMM_BondArray_create
(
n
);
}
void
OPENMM_BONDARRAY_CREATE
(
OpenMM_BondArray
*&
a
,
const
int
&
n
)
{
a
=
OpenMM_BondArray_create
(
n
);
}
int
OpenMM_BondArray_size
(
const
OpenMM_BondArray
*
a
)
{
return
(
int
)((
const
IntPairs
*
)
a
)
->
size
();
}
int
openmm_bondarray_size_
(
const
OpenMM_BondArray
*&
a
)
{
return
OpenMM_BondArray_size
(
a
);
}
int
OPENMM_BONDARRAY_SIZE
(
const
OpenMM_BondArray
*&
a
)
{
return
OpenMM_BondArray_size
(
a
);
}
void
OpenMM_BondArray_resize
(
OpenMM_BondArray
*
a
,
int
n
)
{
((
IntPairs
*
)
a
)
->
resize
(
n
);
}
void
openmm_bondarray_resize_
(
OpenMM_BondArray
*
const
&
a
,
const
int
&
n
)
{
OpenMM_BondArray_resize
(
a
,
n
);
}
void
OPENMM_BONDARRAY_RESIZE
(
OpenMM_BondArray
*
const
&
a
,
const
int
&
n
)
{
OpenMM_BondArray_resize
(
a
,
n
);
}
void
OpenMM_BondArray_destroy
(
OpenMM_BondArray
*
doomed
)
{
delete
((
IntPairs
*
)
doomed
);
}
void
openmm_bondarray_destroy_
(
OpenMM_BondArray
*&
doomed
)
{
OpenMM_BondArray_destroy
(
doomed
);
doomed
=
0
;
}
void
OPENMM_BONDARRAY_DESTROY
(
OpenMM_BondArray
*&
doomed
)
{
OpenMM_BondArray_destroy
(
doomed
);
doomed
=
0
;
}
void
OpenMM_BondArray_append
(
OpenMM_BondArray
*
a
,
int
p1
,
int
p2
)
{
((
IntPairs
*
)
a
)
->
push_back
(
std
::
make_pair
(
p1
,
p2
));
}
void
openmm_bondarray_append_
(
OpenMM_BondArray
*
const
&
a
,
int
const
&
p1
,
int
const
&
p2
)
{
OpenMM_BondArray_append
(
a
,
p1
,
p2
);
}
void
OPENMM_BONDARRAY_APPEND
(
OpenMM_BondArray
*
const
&
a
,
int
const
&
p1
,
int
const
&
p2
)
{
OpenMM_BondArray_append
(
a
,
p1
,
p2
);
}
// Get a single int pair from the array. Index is 0-relative in C, 1-relative in Fortran.
void
OpenMM_BondArray_get
(
const
OpenMM_BondArray
*
a
,
int
i0
,
int
*
p1
,
int
*
p2
)
{
*
p1
=
(
*
(
const
IntPairs
*
)
a
)[
i0
].
first
;
*
p2
=
(
*
(
const
IntPairs
*
)
a
)[
i0
].
second
;
}
void
openmm_bondarray_get_
(
const
OpenMM_BondArray
*
const
&
a
,
const
int
&
i1
,
int
&
p1
,
int
&
p2
)
{
OpenMM_BondArray_get
(
a
,
i1
-
1
,
&
p1
,
&
p2
);
}
void
OPENMM_BONDARRAY_GET
(
const
OpenMM_BondArray
*
const
&
a
,
const
int
&
i1
,
int
&
p1
,
int
&
p2
)
{
OpenMM_BondArray_get
(
a
,
i1
-
1
,
&
p1
,
&
p2
);
}
// Set a single Vec3 element in the array. Index is 0-relative in C, 1-relative in Fortran.
void
OpenMM_BondArray_set
(
OpenMM_BondArray
*
a
,
int
i0
,
int
p1
,
int
p2
)
{
(
*
(
IntPairs
*
)
a
)[
i0
]
=
std
::
make_pair
(
p1
,
p2
);
}
void
openmm_bondarray_set_
(
OpenMM_BondArray
*
const
&
a
,
const
int
&
i1
,
int
const
&
p1
,
int
const
&
p2
)
{
OpenMM_BondArray_set
(
a
,
i1
-
1
,
p1
,
p2
);
}
void
OPENMM_BONDARRAY_SET
(
OpenMM_BondArray
*
const
&
a
,
const
int
&
i1
,
int
const
&
p1
,
int
const
&
p2
)
{
OpenMM_BondArray_set
(
a
,
i1
-
1
,
p1
,
p2
);
}
/////////////////
// std::string //
/////////////////
// This is an interface to std::string primarily for Fortran. You
// can use null-terminated char arrays directly in C.
// create
OpenMM_String
*
OpenMM_String_create
(
const
char
*
nullTerminatedInitVal
)
{
OpenMM_String
*
os
=
(
OpenMM_String
*
)
new
std
::
string
(
nullTerminatedInitVal
);
return
os
;
}
void
openmm_string_create_
(
OpenMM_String
*&
os
,
const
char
*
init
,
int
len
)
{
std
::
string
*
s
=
new
std
::
string
();
os
=
(
OpenMM_String
*
)
s
;
if
(
len
>
0
)
{
s
->
resize
(
len
);
std
::
strncpy
(
&
(
*
s
)[
0
],
init
,
len
);
}
}
void
OPENMM_STRING_CREATE
(
OpenMM_String
*&
os
,
const
char
*
init
,
int
len
)
{
openmm_string_create_
(
os
,
init
,
len
);
}
// destroy
void
OpenMM_String_destroy
(
OpenMM_String
*
os
)
{
delete
((
std
::
string
*
)
os
);
}
void
openmm_string_destroy_
(
OpenMM_String
*&
os
)
{
OpenMM_String_destroy
(
os
);}
void
OPENMM_STRING_DESTROY
(
OpenMM_String
*&
os
)
{
OpenMM_String_destroy
(
os
);}
// C only : getAsC
const
char
*
OpenMM_String_getAsC
(
const
OpenMM_String
*
os
)
{
return
((
const
std
::
string
*
)
os
)
->
c_str
();
}
// length
int
OpenMM_String_length
(
const
OpenMM_String
*
os
)
{
return
(
int
)((
const
std
::
string
*
)
os
)
->
size
();
}
int
openmm_string_length_
(
const
OpenMM_String
*
const
&
os
)
{
return
OpenMM_String_length
(
os
);
}
int
OPENMM_STRING_LENGTH
(
const
OpenMM_String
*
const
&
os
)
{
return
OpenMM_String_length
(
os
);
}
// get C: Copy out as a null-terminated C string.
void
OpenMM_String_get
(
const
OpenMM_String
*
os
,
char
*
buf
,
int
buflen
)
{
if
(
buflen
<=
0
)
return
;
const
std
::
string
&
s
=
*
(
const
std
::
string
*
)
os
;
const
int
minlen
=
std
::
min
((
int
)
s
.
size
(),
buflen
);
for
(
int
i
=
0
;
i
<
minlen
;
++
i
)
buf
[
i
]
=
s
[
i
];
const
int
nullpos
=
std
::
min
(
minlen
,
buflen
-
1
);
buf
[
nullpos
]
=
'\0'
;
}
// get Fortran: Copy out as a blank-padded Fortran string.
void
openmm_string_get_
(
const
OpenMM_String
*
const
&
os
,
char
*
buf
,
int
buflen
)
{
if
(
buflen
<=
0
)
return
;
const
std
::
string
&
s
=
*
(
const
std
::
string
*
)
os
;
const
int
minlen
=
std
::
min
((
int
)
s
.
size
(),
buflen
);
for
(
int
i
=
0
;
i
<
minlen
;
++
i
)
buf
[
i
]
=
s
[
i
];
for
(
int
i
=
minlen
;
i
<
buflen
;
++
i
)
buf
[
i
]
=
' '
;
}
void
OPENMM_STRING_GET
(
const
OpenMM_String
*
const
&
os
,
char
*
buf
,
int
buflen
)
{
openmm_string_get_
(
os
,
buf
,
buflen
);
}
// set C: Set string from a null-terminated C string, stripping trailing blanks.
void
OpenMM_String_set
(
OpenMM_String
*
os
,
const
char
*
in
)
{
std
::
string
&
s
=
*
(
std
::
string
*
)
os
;
int
len
=
std
::
strlen
(
in
);
s
=
std
::
string
(
in
,
in
+
len
);
while
(
len
>
0
&&
s
[
len
-
1
]
==
' '
)
--
len
;
s
.
erase
(
len
);
}
// set Fotran: Set string from a fix-sized Fortran character array,
// stripping trailing blanks.
void
openmm_string_set_
(
OpenMM_String
*&
os
,
const
char
*
in
,
int
len
)
{
std
::
string
&
s
=
*
(
std
::
string
*
)
os
;
s
=
std
::
string
(
in
,
in
+
len
);
while
(
len
>
0
&&
s
[
len
-
1
]
==
' '
)
--
len
;
s
.
erase
(
len
);
}
void
OPENMM_STRING_SET
(
OpenMM_String
*&
os
,
const
char
*
in
,
int
len
)
{
openmm_string_set_
(
os
,
in
,
len
);
}
//////////////////////
// OpenMM::Platform //
//////////////////////
void
OpenMM_Platform_loadPluginsFromDirectory
(
const
char
*
dir
)
{
OpenMM
::
Platform
::
loadPluginsFromDirectory
(
std
::
string
(
dir
));
}
const
char
*
OpenMM_Platform_getDefaultPluginsDirectory
()
{
static
std
::
string
dir
;
dir
=
OpenMM
::
Platform
::
getDefaultPluginsDirectory
();
const
char
*
out
=
dir
.
c_str
();
return
dir
.
c_str
();
}
void
openmm_platform_loadpluginsfromdirectory_
(
const
OpenMM_String
*
const
&
dir
)
{
OpenMM_Platform_loadPluginsFromDirectory
(
OpenMM_String_getAsC
(
dir
));
}
void
OPENMM_PLATFORM_LOADPLUGINSFROMDIRECTORY
(
const
OpenMM_String
*
const
&
dir
)
{
OpenMM_Platform_loadPluginsFromDirectory
(
OpenMM_String_getAsC
(
dir
));
}
void
openmm_platform_getdefaultpluginsdirectory_
(
OpenMM_String
*
const
&
dir
)
{
OpenMM_String_set
(
dir
,
OpenMM_Platform_getDefaultPluginsDirectory
());
}
void
OPENMM_PLATFORM_GETDEFAULTPLUGINSDIRECTORY
(
OpenMM_String
*
const
&
dir
)
{
OpenMM_String_set
(
dir
,
OpenMM_Platform_getDefaultPluginsDirectory
());
}
////////////////////
// OpenMM::System //
////////////////////
// create
OpenMM_System
*
OpenMM_System_create
()
{
return
(
OpenMM_System
*
)
new
System
();
}
void
openmm_system_create_
(
OpenMM_System
*&
sys
)
{
sys
=
OpenMM_System_create
();}
void
OPENMM_SYSTEM_CREATE
(
OpenMM_System
*&
sys
)
{
sys
=
OpenMM_System_create
();}
// destroy
void
OpenMM_System_destroy
(
OpenMM_System
*
doomed
)
{
delete
(
System
*
)
doomed
;
}
void
openmm_system_destroy_
(
OpenMM_System
*&
doomed
)
{
OpenMM_System_destroy
(
doomed
);
doomed
=
0
;
}
void
OPENMM_SYSTEM_DESTROY
(
OpenMM_System
*&
doomed
)
{
OpenMM_System_destroy
(
doomed
);
doomed
=
0
;
}
// addParticle
int
OpenMM_System_addParticle
(
OpenMM_System
*
sys
,
double
mass
)
{
return
((
System
*
)
sys
)
->
addParticle
(
mass
);
}
int
openmm_system_addparticle_
(
OpenMM_System
*
const
&
sys
,
double
const
&
mass
)
{
return
OpenMM_System_addParticle
(
sys
,
mass
);
}
int
OPENMM_SYSTEM_ADDPARTICLE
(
OpenMM_System
*
const
&
sys
,
double
const
&
mass
)
{
return
OpenMM_System_addParticle
(
sys
,
mass
);
}
// setParticleMass
void
OpenMM_System_setParticleMass
(
OpenMM_System
*
sys
,
int
ix
,
double
mass
)
{
((
System
*
)
sys
)
->
setParticleMass
(
ix
,
mass
);
}
void
openmm_system_setparticlemass_
(
OpenMM_System
*
const
&
sys
,
int
const
&
ix
,
double
const
&
mass
)
{
OpenMM_System_setParticleMass
(
sys
,
ix
,
mass
);
}
void
OPENMM_SYSTEM_SETPARTICLEMASS
(
OpenMM_System
*
const
&
sys
,
int
const
&
ix
,
double
const
&
mass
)
{
OpenMM_System_setParticleMass
(
sys
,
ix
,
mass
);
}
// getParticleMass
double
OpenMM_System_getParticleMass
(
const
OpenMM_System
*
sys
,
int
ix
)
{
return
((
const
System
*
)
sys
)
->
getParticleMass
(
ix
);
}
double
openmm_system_getparticlemass_
(
const
OpenMM_System
*
const
&
sys
,
int
const
&
ix
)
{
return
OpenMM_System_getParticleMass
(
sys
,
ix
);
}
double
OPENMM_SYSTEM_GETPARTICLEMASS
(
const
OpenMM_System
*
const
&
sys
,
int
const
&
ix
)
{
return
OpenMM_System_getParticleMass
(
sys
,
ix
);
}
// addConstraint
int
OpenMM_System_addConstraint
(
OpenMM_System
*
sys
,
int
p1
,
int
p2
,
double
distance
)
{
return
((
System
*
)
sys
)
->
addConstraint
(
p1
,
p2
,
distance
);
}
int
openmm_system_addconstraint_
(
OpenMM_System
*
const
&
sys
,
int
const
&
p1
,
int
const
&
p2
,
double
const
&
distance
)
{
return
OpenMM_System_addConstraint
(
sys
,
p1
,
p2
,
distance
);
}
int
OPENMM_SYSTEM_ADDCONSTRAINT
(
OpenMM_System
*
const
&
sys
,
int
const
&
p1
,
int
const
&
p2
,
double
const
&
distance
)
{
return
OpenMM_System_addConstraint
(
sys
,
p1
,
p2
,
distance
);
}
// setConstraintParameters
void
OpenMM_System_setConstraintParameters
(
OpenMM_System
*
sys
,
int
ix
,
int
p1
,
int
p2
,
double
distance
)
{
((
System
*
)
sys
)
->
setConstraintParameters
(
ix
,
p1
,
p2
,
distance
);
}
void
openmm_system_setConstraintParameters_
(
OpenMM_System
*
const
&
sys
,
int
const
&
ix
,
int
const
&
p1
,
int
const
&
p2
,
double
const
&
distance
)
{
OpenMM_System_setConstraintParameters
(
sys
,
ix
,
p1
,
p2
,
distance
);
}
void
OPENMM_SYSTEM_SETCONSTRAINTPARAMETERS
(
OpenMM_System
*
const
&
sys
,
int
const
&
ix
,
int
const
&
p1
,
int
const
&
p2
,
double
const
&
distance
)
{
OpenMM_System_setConstraintParameters
(
sys
,
ix
,
p1
,
p2
,
distance
);
}
// getConstraintParameters
void
OpenMM_System_getConstraintParameters
(
const
OpenMM_System
*
sys
,
int
ix
,
int
*
p1
,
int
*
p2
,
double
*
distance
)
{
((
const
System
*
)
sys
)
->
getConstraintParameters
(
ix
,
*
p1
,
*
p2
,
*
distance
);
}
void
openmm_system_getConstraintParameters_
(
const
OpenMM_System
*
const
&
sys
,
int
const
&
ix
,
int
&
p1
,
int
&
p2
,
double
&
distance
)
{
OpenMM_System_getConstraintParameters
(
sys
,
ix
,
&
p1
,
&
p2
,
&
distance
);
}
void
OPENMM_SYSTEM_GETCONSTRAINTPARAMETERS
(
const
OpenMM_System
*
const
&
sys
,
int
const
&
ix
,
int
&
p1
,
int
&
p2
,
double
&
distance
)
{
OpenMM_System_getConstraintParameters
(
sys
,
ix
,
&
p1
,
&
p2
,
&
distance
);
}
// addForce
// TODO: PREVIEW RELEASE 3 doesn't return a value
//int OpenMM_System_addForce(OpenMM_System* sys, OpenMM_Force* frc)
//{ return ((System*)sys)->addForce((NonbondedForce*)frc); }
int
OpenMM_System_addForce
(
OpenMM_System
*
sys
,
OpenMM_Force
*
frc
)
{
((
System
*
)
sys
)
->
addForce
((
NonbondedForce
*
)
frc
);
return
-
1
;
}
int
openmm_system_addforce_
(
OpenMM_System
*
const
&
sys
,
OpenMM_Force
*&
frc
)
{
return
OpenMM_System_addForce
(
sys
,
frc
);
}
int
OPENMM_SYSTEM_ADDFORCE
(
OpenMM_System
*
const
&
sys
,
OpenMM_Force
*&
frc
)
{
return
OpenMM_System_addForce
(
sys
,
frc
);
}
// getForce, updForce
OpenMM_Force
*
OpenMM_System_updForce
(
OpenMM_System
*
sys
,
int
ix
)
{
return
(
OpenMM_Force
*
)
&
((
System
*
)
sys
)
->
getForce
(
ix
);
}
void
openmm_system_updforce_
(
OpenMM_System
*
const
&
sys
,
int
const
&
ix
,
OpenMM_Force
*&
frc
)
{
frc
=
OpenMM_System_updForce
(
sys
,
ix
);
}
void
OPENMM_SYSTEM_UPDFORCE
(
OpenMM_System
*
sys
,
int
ix
,
OpenMM_Force
*&
frc
)
{
frc
=
OpenMM_System_updForce
(
sys
,
ix
);
}
const
OpenMM_Force
*
OpenMM_System_getForce
(
const
OpenMM_System
*
sys
,
int
ix
)
{
return
(
const
OpenMM_Force
*
)
&
((
const
System
*
)
sys
)
->
getForce
(
ix
);
}
void
openmm_system_getforce_
(
const
OpenMM_System
*
const
&
sys
,
int
const
&
ix
,
const
OpenMM_Force
*&
frc
)
{
frc
=
OpenMM_System_getForce
(
sys
,
ix
);
}
void
OPENMM_SYSTEM_GETFORCE
(
const
OpenMM_System
*
const
&
sys
,
int
const
&
ix
,
const
OpenMM_Force
*&
frc
)
{
frc
=
OpenMM_System_getForce
(
sys
,
ix
);
}
// getNumParticles
int
OpenMM_System_getNumParticles
(
const
OpenMM_System
*
sys
)
{
return
((
const
System
*
)
sys
)
->
getNumParticles
();
}
int
openmm_system_getnumparticles_
(
const
OpenMM_System
*
const
&
sys
)
{
return
OpenMM_System_getNumParticles
(
sys
);
}
int
OPENMM_SYSTEM_GETNUMPARTICLES
(
const
OpenMM_System
*
const
&
sys
)
{
return
OpenMM_System_getNumParticles
(
sys
);
}
// getNumConstraints
int
OpenMM_System_getNumConstraints
(
const
OpenMM_System
*
sys
)
{
return
((
const
System
*
)
sys
)
->
getNumConstraints
();
}
int
openmm_system_getnumconstraints_
(
const
OpenMM_System
*
const
&
sys
)
{
return
OpenMM_System_getNumConstraints
(
sys
);
}
int
OPENMM_SYSTEM_GETNUMCONSTRAINTS
(
const
OpenMM_System
*
const
&
sys
)
{
return
OpenMM_System_getNumConstraints
(
sys
);
}
// getNumForces
int
OpenMM_System_getNumForces
(
const
OpenMM_System
*
sys
)
{
return
((
const
System
*
)
sys
)
->
getNumForces
();
}
int
openmm_system_getnumforces_
(
const
OpenMM_System
*
const
&
sys
)
{
return
OpenMM_System_getNumForces
(
sys
);
}
int
OPENMM_SYSTEM_GETNUMFORCES
(
const
OpenMM_System
*
const
&
sys
)
{
return
OpenMM_System_getNumForces
(
sys
);
}
////////////////////////////
// OpenMM::NonbondedForce //
////////////////////////////
// create
OpenMM_NonbondedForce
*
OpenMM_NonbondedForce_create
()
{
return
(
OpenMM_NonbondedForce
*
)
new
NonbondedForce
();
}
void
openmm_nonbondedforce_create_
(
OpenMM_NonbondedForce
*&
frc
)
{
frc
=
OpenMM_NonbondedForce_create
();}
void
OPENMM_NONBONDEDFORCE_CREATE
(
OpenMM_NonbondedForce
*&
frc
)
{
frc
=
OpenMM_NonbondedForce_create
();}
// destroy
void
OpenMM_NonbondedForce_destroy
(
OpenMM_NonbondedForce
*
doomed
)
{
delete
(
NonbondedForce
*
)
doomed
;
}
void
openmm_nonbondedforce_destroy_
(
OpenMM_NonbondedForce
*&
doomed
)
{
OpenMM_NonbondedForce_destroy
(
doomed
);
doomed
=
0
;}
void
OPENMM_NONBONDEDFORCE_DESTROY
(
OpenMM_NonbondedForce
*&
doomed
)
{
OpenMM_NonbondedForce_destroy
(
doomed
);
doomed
=
0
;}
// Fortran only: recast NonbondedForce as a Force.
void
openmm_nonbondedforce_asforce_
(
OpenMM_NonbondedForce
*
const
&
nonbond
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
nonbond
;
}
void
OPENMM_NONBONDEDFORCE_ASFORCE
(
OpenMM_NonbondedForce
*
const
&
nonbond
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
nonbond
;
}
// setNonbondedMethod
void
OpenMM_NonbondedForce_setNonbondedMethod
(
OpenMM_NonbondedForce
*
nbf
,
OpenMM_NonbondedForce_NonbondedMethod
method
)
{
((
NonbondedForce
*
)
nbf
)
->
setNonbondedMethod
(
NonbondedForce
::
NonbondedMethod
(
method
));
}
void
openmm_nonbondedforce_setnonbondedmethod_
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
int
&
method
)
{
OpenMM_NonbondedForce_setNonbondedMethod
(
nbf
,
OpenMM_NonbondedForce_NonbondedMethod
(
method
));
}
void
OPENMM_NONBONDEDFORCE_SETNONBONDEDMETHOD
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
int
&
method
)
{
OpenMM_NonbondedForce_setNonbondedMethod
(
nbf
,
OpenMM_NonbondedForce_NonbondedMethod
(
method
));
}
// getNonbondedMethod
OpenMM_NonbondedForce_NonbondedMethod
OpenMM_NonbondedForce_getNonbondedMethod
(
const
OpenMM_NonbondedForce
*
nbf
)
{
return
OpenMM_NonbondedForce_NonbondedMethod
(((
const
NonbondedForce
*
)
nbf
)
->
getNonbondedMethod
());
}
int
openmm_nonbondedforce_getnonbondedmethod_
(
const
OpenMM_NonbondedForce
*
const
&
nbf
)
{
return
(
int
)
OpenMM_NonbondedForce_getNonbondedMethod
(
nbf
);
}
int
OPENMM_NONBONDEDFORCE_GETNONBONDEDMETHOD
(
const
OpenMM_NonbondedForce
*
const
&
nbf
)
{
return
(
int
)
OpenMM_NonbondedForce_getNonbondedMethod
(
nbf
);
}
// setCutoffDistance
void
OpenMM_NonbondedForce_setCutoffDistance
(
OpenMM_NonbondedForce
*
nbf
,
double
d
)
{
((
NonbondedForce
*
)
nbf
)
->
setCutoffDistance
(
d
);
}
void
openmm_nonbondedforce_setcutoffdistance_
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
double
&
d
)
{
OpenMM_NonbondedForce_setCutoffDistance
(
nbf
,
d
);}
void
OPENMM_NONBONDEDFORCE_SETCUTOFFDISTANCE
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
double
&
d
)
{
OpenMM_NonbondedForce_setCutoffDistance
(
nbf
,
d
);}
// getCutoffDistance
double
OpenMM_NonbondedForce_getCutoffDistance
(
const
OpenMM_NonbondedForce
*
nbf
)
{
return
((
NonbondedForce
*
)
nbf
)
->
getCutoffDistance
();
}
double
openmm_nonbondedforce_getcutoffdistance_
(
const
OpenMM_NonbondedForce
*
const
&
nbf
)
{
return
OpenMM_NonbondedForce_getCutoffDistance
(
nbf
);}
double
OPENMM_NONBONDEDFORCE_GETCUTOFFDISTANCE
(
const
OpenMM_NonbondedForce
*
const
&
nbf
)
{
return
OpenMM_NonbondedForce_getCutoffDistance
(
nbf
);}
// setPeriodicBoxVectors
void
OpenMM_NonbondedForce_setPeriodicBoxVectors
(
OpenMM_NonbondedForce
*
nbf
,
const
OpenMM_Vec3
a
,
const
OpenMM_Vec3
b
,
const
OpenMM_Vec3
c
)
{
((
NonbondedForce
*
)
nbf
)
->
setPeriodicBoxVectors
(
*
(
const
Vec3
*
)
a
,
*
(
const
Vec3
*
)
b
,
*
(
const
Vec3
*
)
c
);
}
void
openmm_nonbondedforce_setperiodicboxvectors_
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
OpenMM_Vec3
a
,
const
OpenMM_Vec3
b
,
const
OpenMM_Vec3
c
)
{
OpenMM_NonbondedForce_setPeriodicBoxVectors
(
nbf
,
a
,
b
,
c
);}
void
OPENMM_NONBONDEDFORCE_SETPERIODICBOXVECTORS
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
OpenMM_Vec3
a
,
const
OpenMM_Vec3
b
,
const
OpenMM_Vec3
c
)
{
OpenMM_NonbondedForce_setPeriodicBoxVectors
(
nbf
,
a
,
b
,
c
);}
// getPeriodicBoxVectors
void
OpenMM_NonbondedForce_getPeriodicBoxVectors
(
const
OpenMM_NonbondedForce
*
nbf
,
OpenMM_Vec3
a
,
OpenMM_Vec3
b
,
OpenMM_Vec3
c
)
{
((
const
NonbondedForce
*
)
nbf
)
->
getPeriodicBoxVectors
(
*
(
Vec3
*
)
a
,
*
(
Vec3
*
)
b
,
*
(
Vec3
*
)
c
);
}
void
openmm_nonbondedforce_getperiodicboxvectors_
(
const
OpenMM_NonbondedForce
*
const
&
nbf
,
OpenMM_Vec3
a
,
OpenMM_Vec3
b
,
OpenMM_Vec3
c
)
{
OpenMM_NonbondedForce_getPeriodicBoxVectors
(
nbf
,
a
,
b
,
c
);}
void
OPENMM_NONBONDEDFORCE_GETPERIODICBOXVECTORS
(
const
OpenMM_NonbondedForce
*
const
&
nbf
,
OpenMM_Vec3
a
,
OpenMM_Vec3
b
,
OpenMM_Vec3
c
)
{
OpenMM_NonbondedForce_getPeriodicBoxVectors
(
nbf
,
a
,
b
,
c
);}
// addParticle
int
OpenMM_NonbondedForce_addParticle
(
OpenMM_NonbondedForce
*
nbf
,
double
charge
,
double
sigmaInNm
,
double
vdwEnergyInKJ
)
{
return
((
NonbondedForce
*
)
nbf
)
->
addParticle
(
charge
,
sigmaInNm
,
vdwEnergyInKJ
);
}
void
openmm_nonbondedforce_addparticle_
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
double
&
charge
,
const
double
&
sigmaInNm
,
const
double
&
vdwEnergyInKJ
)
{
OpenMM_NonbondedForce_addParticle
(
nbf
,
charge
,
sigmaInNm
,
vdwEnergyInKJ
);}
void
OPENMM_NONBONDEDFORCE_ADDPARTICLE
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
double
&
charge
,
const
double
&
sigmaInNm
,
const
double
&
vdwEnergyInKJ
)
{
OpenMM_NonbondedForce_addParticle
(
nbf
,
charge
,
sigmaInNm
,
vdwEnergyInKJ
);}
// setParticleParameters
void
OpenMM_NonbondedForce_setParticleParameters
(
OpenMM_NonbondedForce
*
nbf
,
int
index
,
double
charge
,
double
sigmaInNm
,
double
vdwEnergyInKJ
)
{
((
NonbondedForce
*
)
nbf
)
->
setParticleParameters
(
index
,
charge
,
sigmaInNm
,
vdwEnergyInKJ
);
}
void
openmm_nonbondedforce_setparticleparameters_
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
int
&
index
,
const
double
&
charge
,
const
double
&
sigmaInNm
,
const
double
&
vdwEnergyInKJ
)
{
OpenMM_NonbondedForce_setParticleParameters
(
nbf
,
index
,
charge
,
sigmaInNm
,
vdwEnergyInKJ
);}
void
OPENMM_NONBONDEDFORCE_SETPARTICLEPARAMETERS
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
int
&
index
,
const
double
&
charge
,
const
double
&
sigmaInNm
,
const
double
&
vdwEnergyInKJ
)
{
OpenMM_NonbondedForce_setParticleParameters
(
nbf
,
index
,
charge
,
sigmaInNm
,
vdwEnergyInKJ
);}
// getParticleParameters
void
OpenMM_NonbondedForce_getParticleParameters
(
const
OpenMM_NonbondedForce
*
nbf
,
int
index
,
double
*
charge
,
double
*
sigmaInNm
,
double
*
vdwEnergyInKJ
)
{
((
const
NonbondedForce
*
)
nbf
)
->
getParticleParameters
(
index
,
*
charge
,
*
sigmaInNm
,
*
vdwEnergyInKJ
);
}
void
openmm_nonbondedforce_getparticleparameters_
(
const
OpenMM_NonbondedForce
*
const
&
nbf
,
const
int
&
index
,
double
&
charge
,
double
&
sigmaInNm
,
double
&
vdwEnergyInKJ
)
{
OpenMM_NonbondedForce_getParticleParameters
(
nbf
,
index
,
&
charge
,
&
sigmaInNm
,
&
vdwEnergyInKJ
);}
void
OPENMM_NONBONDEDFORCE_GETPARTICLEPARAMETERS
(
const
OpenMM_NonbondedForce
*
const
&
nbf
,
const
int
&
index
,
double
&
charge
,
double
&
sigmaInNm
,
double
&
vdwEnergyInKJ
)
{
OpenMM_NonbondedForce_getParticleParameters
(
nbf
,
index
,
&
charge
,
&
sigmaInNm
,
&
vdwEnergyInKJ
);}
// getNumParticles
int
OpenMM_NonbondedForce_getNumParticles
(
const
OpenMM_NonbondedForce
*
nbf
)
{
return
((
const
NonbondedForce
*
)
nbf
)
->
getNumParticles
();
}
int
openmm_nonbondedforce_getnumparticles_
(
const
OpenMM_NonbondedForce
*
const
&
nbf
)
{
return
OpenMM_NonbondedForce_getNumParticles
(
nbf
);
}
int
OPENMM_NONBONDEDFORCE_GETNUMPARTICLES
(
const
OpenMM_NonbondedForce
*
const
&
nbf
)
{
return
OpenMM_NonbondedForce_getNumParticles
(
nbf
);
}
// getNumExceptions
int
OpenMM_NonbondedForce_getNumExceptions
(
const
OpenMM_NonbondedForce
*
nbf
)
{
return
((
const
NonbondedForce
*
)
nbf
)
->
getNumExceptions
();
}
int
openmm_nonbondedforce_getnumexceptions_
(
const
OpenMM_NonbondedForce
*
const
&
nbf
)
{
return
OpenMM_NonbondedForce_getNumExceptions
(
nbf
);
}
int
OPENMM_NONBONDEDFORCE_GETNUMEXCEPTIONS
(
const
OpenMM_NonbondedForce
*
const
&
nbf
)
{
return
OpenMM_NonbondedForce_getNumExceptions
(
nbf
);
}
// addException
int
OpenMM_NonbondedForce_addException
(
OpenMM_NonbondedForce
*
nbf
,
int
p1
,
int
p2
,
double
chargeProd
,
double
sigmaInNm
,
double
vdwEnergyInKJ
)
{
return
((
NonbondedForce
*
)
nbf
)
->
addException
(
p1
,
p2
,
chargeProd
,
sigmaInNm
,
vdwEnergyInKJ
);
}
void
openmm_nonbondedforce_addexception_
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
int
&
p1
,
const
int
&
p2
,
const
double
&
chargeProd
,
const
double
&
sigmaInNm
,
const
double
&
vdwEnergyInKJ
)
{
OpenMM_NonbondedForce_addException
(
nbf
,
p1
,
p2
,
chargeProd
,
sigmaInNm
,
vdwEnergyInKJ
);}
void
OPENMM_NONBONDEDFORCE_ADDEXCEPTION
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
int
&
p1
,
const
int
&
p2
,
const
double
&
chargeProd
,
const
double
&
sigmaInNm
,
const
double
&
vdwEnergyInKJ
)
{
OpenMM_NonbondedForce_addException
(
nbf
,
p1
,
p2
,
chargeProd
,
sigmaInNm
,
vdwEnergyInKJ
);}
// setExceptionParameters
void
OpenMM_NonbondedForce_setExceptionParameters
(
OpenMM_NonbondedForce
*
nbf
,
int
index
,
int
p1
,
int
p2
,
double
chargeProd
,
double
sigmaInNm
,
double
vdwEnergyInKJ
)
{
return
((
NonbondedForce
*
)
nbf
)
->
setExceptionParameters
(
index
,
p1
,
p2
,
chargeProd
,
sigmaInNm
,
vdwEnergyInKJ
);
}
void
openmm_nonbondedforce_setexceptionparameters_
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
int
&
index
,
const
int
&
p1
,
const
int
&
p2
,
const
double
&
chargeProd
,
const
double
&
sigmaInNm
,
const
double
&
vdwEnergyInKJ
)
{
OpenMM_NonbondedForce_setExceptionParameters
(
nbf
,
index
,
p1
,
p2
,
chargeProd
,
sigmaInNm
,
vdwEnergyInKJ
);}
void
OPENMM_NONBONDEDFORCE_SETEXCEPTIONPARAMETERS
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
int
&
index
,
const
int
&
p1
,
const
int
&
p2
,
const
double
&
chargeProd
,
const
double
&
sigmaInNm
,
const
double
&
vdwEnergyInKJ
)
{
OpenMM_NonbondedForce_setExceptionParameters
(
nbf
,
index
,
p1
,
p2
,
chargeProd
,
sigmaInNm
,
vdwEnergyInKJ
);}
// getExceptionParameters
void
OpenMM_NonbondedForce_getExceptionParameters
(
const
OpenMM_NonbondedForce
*
nbf
,
int
index
,
int
*
p1
,
int
*
p2
,
double
*
chargeProd
,
double
*
sigmaInNm
,
double
*
vdwEnergyInKJ
)
{
return
((
const
NonbondedForce
*
)
nbf
)
->
getExceptionParameters
(
index
,
*
p1
,
*
p2
,
*
chargeProd
,
*
sigmaInNm
,
*
vdwEnergyInKJ
);
}
void
openmm_nonbondedforce_getexceptionparameters_
(
const
OpenMM_NonbondedForce
*
const
&
nbf
,
const
int
&
index
,
int
&
p1
,
int
&
p2
,
double
&
chargeProd
,
double
&
sigmaInNm
,
double
&
vdwEnergyInKJ
)
{
OpenMM_NonbondedForce_getExceptionParameters
(
nbf
,
index
,
&
p1
,
&
p2
,
&
chargeProd
,
&
sigmaInNm
,
&
vdwEnergyInKJ
);}
void
OPENMM_NONBONDEDFORCE_GETEXCEPTIONPARAMETERS
(
const
OpenMM_NonbondedForce
*
const
&
nbf
,
const
int
&
index
,
int
&
p1
,
int
&
p2
,
double
&
chargeProd
,
double
&
sigmaInNm
,
double
&
vdwEnergyInKJ
)
{
OpenMM_NonbondedForce_getExceptionParameters
(
nbf
,
index
,
&
p1
,
&
p2
,
&
chargeProd
,
&
sigmaInNm
,
&
vdwEnergyInKJ
);}
// createExceptionsFromBonds
void
OpenMM_NonbondedForces_createExceptionsFromBonds
(
OpenMM_NonbondedForce
*
nbf
,
const
OpenMM_BondArray
*
ba
,
double
coulomb14Scale
,
double
lj14Scale
)
{
typedef
std
::
vector
<
std
::
pair
<
int
,
int
>
>
IntPairs
;
const
IntPairs
&
bonds
=
*
(
const
IntPairs
*
)
ba
;
((
NonbondedForce
*
)
nbf
)
->
createExceptionsFromBonds
(
bonds
,
coulomb14Scale
,
lj14Scale
);
}
void
openmm_nonbondedforces_createexceptionsfrombonds_
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
OpenMM_BondArray
*
const
&
ba
,
double
const
&
coulomb14Scale
,
double
const
&
lj14Scale
)
{
OpenMM_NonbondedForces_createExceptionsFromBonds
(
nbf
,
ba
,
coulomb14Scale
,
lj14Scale
);
}
void
OPENMM_NONBONDEDFORCES_CREATEEXCEPTIONSFROMBONDS
(
OpenMM_NonbondedForce
*
const
&
nbf
,
const
OpenMM_BondArray
*
const
&
ba
,
double
const
&
coulomb14Scale
,
double
const
&
lj14Scale
)
{
OpenMM_NonbondedForces_createExceptionsFromBonds
(
nbf
,
ba
,
coulomb14Scale
,
lj14Scale
);
}
//////////////////////////
// OpenMM::GBSAOBCForce //
//////////////////////////
// create
OpenMM_GBSAOBCForce
*
OpenMM_GBSAOBCForce_create
()
{
return
(
OpenMM_GBSAOBCForce
*
)
new
GBSAOBCForce
();
}
void
openmm_gbsaobcforce_create_
(
OpenMM_GBSAOBCForce
*&
frc
)
{
frc
=
OpenMM_GBSAOBCForce_create
();
}
void
OPENMM_GBSAOBCFORCE_CREATE
(
OpenMM_GBSAOBCForce
*&
frc
)
{
frc
=
OpenMM_GBSAOBCForce_create
();
}
// destroy
void
OpenMM_GBSAOBCForce_destroy
(
OpenMM_GBSAOBCForce
*
doomed
)
{
delete
(
GBSAOBCForce
*
)
doomed
;
}
void
openmm_gbsaobcforce_destroy_
(
OpenMM_GBSAOBCForce
*&
doomed
)
{
OpenMM_GBSAOBCForce_destroy
(
doomed
);
doomed
=
0
;
}
void
OPENMM_GBSAOBCFORCE_DESTROY
(
OpenMM_GBSAOBCForce
*&
doomed
)
{
OpenMM_GBSAOBCForce_destroy
(
doomed
);
doomed
=
0
;
}
// Fortran only: recast GBSAOBCForce as a Force.
void
openmm_gbsaobcforce_asforce_
(
OpenMM_GBSAOBCForce
*
const
&
gbsa
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
gbsa
;
}
void
OPENMM_GBSAOBCFORCE_ASFORCE
(
OpenMM_GBSAOBCForce
*
const
&
gbsa
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
gbsa
;
}
// setSolventDielectric
void
OpenMM_GBSAOBCForce_setSolventDielectric
(
OpenMM_GBSAOBCForce
*
gbsa
,
double
d
)
{
((
GBSAOBCForce
*
)
gbsa
)
->
setSolventDielectric
(
d
);
}
void
openmm_gbsaobcforce_setsolventdielectric_
(
OpenMM_GBSAOBCForce
*&
gbsa
,
const
double
&
d
)
{
OpenMM_GBSAOBCForce_setSolventDielectric
(
gbsa
,
d
);
}
void
OPENMM_GBSAOBCFORCE_SETSOLVENTDIELECTRIC
(
OpenMM_GBSAOBCForce
*&
gbsa
,
const
double
&
d
)
{
OpenMM_GBSAOBCForce_setSolventDielectric
(
gbsa
,
d
);
}
// setSoluteDielectric
void
OpenMM_GBSAOBCForce_setSoluteDielectric
(
OpenMM_GBSAOBCForce
*
gbsa
,
double
d
)
{
((
GBSAOBCForce
*
)
gbsa
)
->
setSoluteDielectric
(
d
);
}
void
openmm_gbsaobcforce_setsolutedielectric_
(
OpenMM_GBSAOBCForce
*&
gbsa
,
const
double
&
d
)
{
OpenMM_GBSAOBCForce_setSoluteDielectric
(
gbsa
,
d
);
}
void
OPENMM_GBSAOBCFORCE_SETSOLUTEDIELECTRIC
(
OpenMM_GBSAOBCForce
*&
gbsa
,
const
double
&
d
)
{
OpenMM_GBSAOBCForce_setSoluteDielectric
(
gbsa
,
d
);
}
// addParticle
int
OpenMM_GBSAOBCForce_addParticle
(
OpenMM_GBSAOBCForce
*
gbsa
,
double
charge
,
double
radiusInNm
,
double
scalingFactor
)
{
return
((
GBSAOBCForce
*
)
gbsa
)
->
addParticle
(
charge
,
radiusInNm
,
scalingFactor
);
}
int
openmm_gbsaobcforce_addparticle_
(
OpenMM_GBSAOBCForce
*&
gbsa
,
const
double
&
charge
,
const
double
&
radiusInNm
,
const
double
&
scalingFactor
)
{
return
OpenMM_GBSAOBCForce_addParticle
(
gbsa
,
charge
,
radiusInNm
,
scalingFactor
);
}
int
OPENMM_GBSAOBCFORCE_ADDPARTICLE
(
OpenMM_GBSAOBCForce
*&
gbsa
,
const
double
&
charge
,
const
double
&
radiusInNm
,
const
double
&
scalingFactor
)
{
return
OpenMM_GBSAOBCForce_addParticle
(
gbsa
,
charge
,
radiusInNm
,
scalingFactor
);
}
///////////////////////////////
// OpenMM::HarmonicBondForce //
///////////////////////////////
// create
OpenMM_HarmonicBondForce
*
OpenMM_HarmonicBondForce_create
()
{
return
(
OpenMM_HarmonicBondForce
*
)
new
HarmonicBondForce
();
}
void
openmm_harmonicbondforce_create_
(
OpenMM_HarmonicBondForce
*&
frc
)
{
frc
=
OpenMM_HarmonicBondForce_create
();}
void
OPENMM_HARMONICBONDFORCE_CREATE
(
OpenMM_HarmonicBondForce
*&
frc
)
{
frc
=
OpenMM_HarmonicBondForce_create
();}
// destroy
void
OpenMM_HarmonicBondForce_destroy
(
OpenMM_HarmonicBondForce
*
doomed
)
{
delete
(
HarmonicBondForce
*
)
doomed
;
}
void
openmm_harmonicbondforce_destroy_
(
OpenMM_HarmonicBondForce
*&
doomed
)
{
OpenMM_HarmonicBondForce_destroy
(
doomed
);
doomed
=
0
;}
void
OPENMM_HARMONICBONDFORCE_DESTROY
(
OpenMM_HarmonicBondForce
*&
doomed
)
{
OpenMM_HarmonicBondForce_destroy
(
doomed
);
doomed
=
0
;}
// Fortran only: recast HarmonicBondForce as a Force.
void
openmm_harmonicbondforce_asforce_
(
OpenMM_HarmonicBondForce
*
const
&
hbf
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
hbf
;
}
void
OPENMM_HARMONICBONDFORCE_ASFORCE
(
OpenMM_HarmonicBondForce
*
const
&
hbf
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
hbf
;
}
// getNumBonds
int
OpenMM_HarmonicBondForce_getNumBonds
(
const
OpenMM_HarmonicBondForce
*
hbf
)
{
return
((
const
HarmonicBondForce
*
)
hbf
)
->
getNumBonds
();
}
int
openmm_harmonicbondforce_getnumbonds_
(
const
OpenMM_HarmonicBondForce
*
const
&
hbf
)
{
return
OpenMM_HarmonicBondForce_getNumBonds
(
hbf
);
}
int
OPENMM_HARMONICBONDFORCE_GETNUMBONDS
(
const
OpenMM_HarmonicBondForce
*
const
&
hbf
)
{
return
OpenMM_HarmonicBondForce_getNumBonds
(
hbf
);
}
// addBond
int
OpenMM_HarmonicBondForce_addBond
(
OpenMM_HarmonicBondForce
*
hbf
,
int
p1
,
int
p2
,
double
len
,
double
k
)
{
return
((
HarmonicBondForce
*
)
hbf
)
->
addBond
(
p1
,
p2
,
len
,
k
);
}
int
openmm_harmonicbondforce_addbond_
(
OpenMM_HarmonicBondForce
*
const
&
hbf
,
int
const
&
p1
,
int
const
&
p2
,
double
const
&
len
,
double
const
&
k
)
{
return
OpenMM_HarmonicBondForce_addBond
(
hbf
,
p1
,
p2
,
len
,
k
);
}
int
OPENMM_HARMONICBONDFORCE_ADDBOND
(
OpenMM_HarmonicBondForce
*
const
&
hbf
,
int
const
&
p1
,
int
const
&
p2
,
double
const
&
len
,
double
const
&
k
)
{
return
OpenMM_HarmonicBondForce_addBond
(
hbf
,
p1
,
p2
,
len
,
k
);
}
// setBondParameters
void
OpenMM_HarmonicBondForce_setBondParameters
(
OpenMM_HarmonicBondForce
*
hbf
,
int
ix
,
int
p1
,
int
p2
,
double
len
,
double
k
)
{
((
HarmonicBondForce
*
)
hbf
)
->
setBondParameters
(
ix
,
p1
,
p2
,
len
,
k
);
}
void
openmm_harmonicbondforce_setbondparameters_
(
OpenMM_HarmonicBondForce
*
const
&
hbf
,
int
const
&
ix
,
int
const
&
p1
,
int
const
&
p2
,
double
const
&
len
,
double
const
&
k
)
{
OpenMM_HarmonicBondForce_setBondParameters
(
hbf
,
ix
,
p1
,
p2
,
len
,
k
);
}
void
OPENMM_HARMONICBONDFORCE_SETBONDPARAMETERS
(
OpenMM_HarmonicBondForce
*
const
&
hbf
,
int
const
&
ix
,
int
const
&
p1
,
int
const
&
p2
,
double
const
&
len
,
double
const
&
k
)
{
OpenMM_HarmonicBondForce_setBondParameters
(
hbf
,
ix
,
p1
,
p2
,
len
,
k
);
}
// getBondParameters
void
OpenMM_HarmonicBondForce_getBondParameters
(
const
OpenMM_HarmonicBondForce
*
hbf
,
int
ix
,
int
*
p1
,
int
*
p2
,
double
*
len
,
double
*
k
)
{
((
const
HarmonicBondForce
*
)
hbf
)
->
getBondParameters
(
ix
,
*
p1
,
*
p2
,
*
len
,
*
k
);
}
void
openmm_harmonicbondforce_getbondparameters_
(
const
OpenMM_HarmonicBondForce
*
const
&
hbf
,
int
const
&
ix
,
int
&
p1
,
int
&
p2
,
double
&
len
,
double
&
k
)
{
OpenMM_HarmonicBondForce_getBondParameters
(
hbf
,
ix
,
&
p1
,
&
p2
,
&
len
,
&
k
);
}
void
OPENMM_HARMONICBONDFORCE_GETBONDPARAMETERS
(
const
OpenMM_HarmonicBondForce
*
const
&
hbf
,
int
const
&
ix
,
int
&
p1
,
int
&
p2
,
double
&
len
,
double
&
k
)
{
OpenMM_HarmonicBondForce_getBondParameters
(
hbf
,
ix
,
&
p1
,
&
p2
,
&
len
,
&
k
);
}
////////////////////////////////
// OpenMM::HarmonicAngleForce //
////////////////////////////////
// create
OpenMM_HarmonicAngleForce
*
OpenMM_HarmonicAngleForce_create
()
{
return
(
OpenMM_HarmonicAngleForce
*
)
new
HarmonicAngleForce
();
}
void
openmm_harmonicangleforce_create_
(
OpenMM_HarmonicAngleForce
*&
frc
)
{
frc
=
OpenMM_HarmonicAngleForce_create
();}
void
OPENMM_HARMONICANGLEFORCE_CREATE
(
OpenMM_HarmonicAngleForce
*&
frc
)
{
frc
=
OpenMM_HarmonicAngleForce_create
();}
// destroy
void
OpenMM_HarmonicAngleForce_destroy
(
OpenMM_HarmonicAngleForce
*
doomed
)
{
delete
(
HarmonicAngleForce
*
)
doomed
;
}
void
openmm_harmonicangleforce_destroy_
(
OpenMM_HarmonicAngleForce
*&
doomed
)
{
OpenMM_HarmonicAngleForce_destroy
(
doomed
);
doomed
=
0
;}
void
OPENMM_HARMONICANGLEFORCE_DESTROY
(
OpenMM_HarmonicAngleForce
*&
doomed
)
{
OpenMM_HarmonicAngleForce_destroy
(
doomed
);
doomed
=
0
;}
// Fortran only: recast HarmonicAngleForce as a Force.
void
openmm_harmonicangleforce_asforce_
(
OpenMM_HarmonicAngleForce
*
const
&
haf
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
haf
;
}
void
OPENMM_HARMONICANGLEFORCE_ASFORCE
(
OpenMM_HarmonicAngleForce
*
const
&
haf
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
haf
;
}
// getNumAngles
int
OpenMM_HarmonicAngleForce_getNumAngles
(
const
OpenMM_HarmonicAngleForce
*
haf
)
{
return
((
const
HarmonicAngleForce
*
)
haf
)
->
getNumAngles
();
}
int
openmm_harmonicangleforce_getnumangles_
(
const
OpenMM_HarmonicAngleForce
*
const
&
haf
)
{
return
OpenMM_HarmonicAngleForce_getNumAngles
(
haf
);
}
int
OPENMM_HARMONICANGLEFORCE_GETNUMANGLES
(
const
OpenMM_HarmonicAngleForce
*
const
&
haf
)
{
return
OpenMM_HarmonicAngleForce_getNumAngles
(
haf
);
}
// addAngle
int
OpenMM_HarmonicAngleForce_addAngle
(
OpenMM_HarmonicAngleForce
*
haf
,
int
p1
,
int
p2
,
int
p3
,
double
angle
,
double
k
)
{
return
((
HarmonicAngleForce
*
)
haf
)
->
addAngle
(
p1
,
p2
,
p3
,
angle
,
k
);
}
int
openmm_harmonicangleforce_addangle_
(
OpenMM_HarmonicAngleForce
*
const
&
haf
,
int
const
&
p1
,
int
const
&
p2
,
int
const
&
p3
,
double
const
&
angle
,
double
const
&
k
)
{
return
OpenMM_HarmonicAngleForce_addAngle
(
haf
,
p1
,
p2
,
p3
,
angle
,
k
);
}
int
OPENMM_HARMONICANGLEFORCE_ADDANGLE
(
OpenMM_HarmonicAngleForce
*
const
&
haf
,
int
const
&
p1
,
int
const
&
p2
,
int
const
&
p3
,
double
const
&
angle
,
double
const
&
k
)
{
return
OpenMM_HarmonicAngleForce_addAngle
(
haf
,
p1
,
p2
,
p3
,
angle
,
k
);
}
// setAngleParameters
void
OpenMM_HarmonicAngleForce_setAngleParameters
(
OpenMM_HarmonicAngleForce
*
haf
,
int
ix
,
int
p1
,
int
p2
,
int
p3
,
double
angle
,
double
k
)
{
((
HarmonicAngleForce
*
)
haf
)
->
setAngleParameters
(
ix
,
p1
,
p2
,
p3
,
angle
,
k
);
}
void
openmm_harmonicangleforce_setangleparameters_
(
OpenMM_HarmonicAngleForce
*
const
&
haf
,
int
const
&
ix
,
int
const
&
p1
,
int
const
&
p2
,
int
const
&
p3
,
double
const
&
angle
,
double
const
&
k
)
{
OpenMM_HarmonicAngleForce_setAngleParameters
(
haf
,
ix
,
p1
,
p2
,
p3
,
angle
,
k
);
}
void
OPENMM_HARMONICANGLEFORCE_SETANGLEPARAMETERS
(
OpenMM_HarmonicAngleForce
*
const
&
haf
,
int
const
&
ix
,
int
const
&
p1
,
int
const
&
p2
,
int
const
&
p3
,
double
const
&
angle
,
double
const
&
k
)
{
OpenMM_HarmonicAngleForce_setAngleParameters
(
haf
,
ix
,
p1
,
p2
,
p3
,
angle
,
k
);
}
// getAngleParameters
void
OpenMM_HarmonicAngleForce_getAngleParameters
(
const
OpenMM_HarmonicAngleForce
*
haf
,
int
ix
,
int
*
p1
,
int
*
p2
,
int
*
p3
,
double
*
angle
,
double
*
k
)
{
((
const
HarmonicAngleForce
*
)
haf
)
->
getAngleParameters
(
ix
,
*
p1
,
*
p2
,
*
p3
,
*
angle
,
*
k
);
}
void
openmm_harmonicangleforce_getangleparameters_
(
const
OpenMM_HarmonicAngleForce
*
const
&
haf
,
int
const
&
ix
,
int
&
p1
,
int
&
p2
,
int
&
p3
,
double
&
angle
,
double
&
k
)
{
OpenMM_HarmonicAngleForce_getAngleParameters
(
haf
,
ix
,
&
p1
,
&
p2
,
&
p3
,
&
angle
,
&
k
);
}
void
OPENMM_HARMONICANGLEFORCE_GETANGLEPARAMETERS
(
const
OpenMM_HarmonicAngleForce
*
const
&
haf
,
int
const
&
ix
,
int
&
p1
,
int
&
p2
,
int
&
p3
,
double
&
angle
,
double
&
k
)
{
OpenMM_HarmonicAngleForce_getAngleParameters
(
haf
,
ix
,
&
p1
,
&
p2
,
&
p3
,
&
angle
,
&
k
);
}
//////////////////////////////////
// OpenMM::PeriodicTorsionForce //
//////////////////////////////////
// create
OpenMM_PeriodicTorsionForce
*
OpenMM_PeriodicTorsionForce_create
()
{
return
(
OpenMM_PeriodicTorsionForce
*
)
new
PeriodicTorsionForce
();
}
void
openmm_periodictorsionforce_create_
(
OpenMM_PeriodicTorsionForce
*&
frc
)
{
frc
=
OpenMM_PeriodicTorsionForce_create
();}
void
OPENMM_PERIODICTORSIONFORCE_CREATE
(
OpenMM_PeriodicTorsionForce
*&
frc
)
{
frc
=
OpenMM_PeriodicTorsionForce_create
();}
// destroy
void
OpenMM_PeriodicTorsionForce_destroy
(
OpenMM_PeriodicTorsionForce
*
doomed
)
{
delete
(
PeriodicTorsionForce
*
)
doomed
;
}
void
openmm_periodictorsionforce_destroy_
(
OpenMM_PeriodicTorsionForce
*&
doomed
)
{
OpenMM_PeriodicTorsionForce_destroy
(
doomed
);
doomed
=
0
;}
void
OPENMM_PERIODICTORSIONFORCE_DESTROY
(
OpenMM_PeriodicTorsionForce
*&
doomed
)
{
OpenMM_PeriodicTorsionForce_destroy
(
doomed
);
doomed
=
0
;}
// Fortran only: recast PeriodicTorsionForce as a Force.
void
openmm_periodictorsionforce_asforce_
(
OpenMM_PeriodicTorsionForce
*
const
&
ptf
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
ptf
;
}
void
OPENMM_PERIODICTORSIONFORCE_ASFORCE
(
OpenMM_PeriodicTorsionForce
*
const
&
ptf
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
ptf
;
}
// getNumTorsions
int
OpenMM_PeriodicTorsionForce_getNumTorsions
(
const
OpenMM_PeriodicTorsionForce
*
ptf
)
{
return
((
const
PeriodicTorsionForce
*
)
ptf
)
->
getNumTorsions
();
}
int
openmm_periodictorsionforce_getnumangles_
(
const
OpenMM_PeriodicTorsionForce
*
const
&
ptf
)
{
return
OpenMM_PeriodicTorsionForce_getNumTorsions
(
ptf
);
}
int
OPENMM_PERIODICTORSIONFORCE_GETNUMANGLES
(
const
OpenMM_PeriodicTorsionForce
*
const
&
ptf
)
{
return
OpenMM_PeriodicTorsionForce_getNumTorsions
(
ptf
);
}
// addTorsion
int
OpenMM_PeriodicTorsionForce_addTorsion
(
OpenMM_PeriodicTorsionForce
*
ptf
,
int
p1
,
int
p2
,
int
p3
,
int
p4
,
int
periodicity
,
double
phase
,
double
k
)
{
return
((
PeriodicTorsionForce
*
)
ptf
)
->
addTorsion
(
p1
,
p2
,
p3
,
p4
,
periodicity
,
phase
,
k
);
}
int
openmm_periodictorsionforce_addtorsion_
(
OpenMM_PeriodicTorsionForce
*
const
&
ptf
,
int
const
&
p1
,
int
const
&
p2
,
int
const
&
p3
,
int
const
&
p4
,
int
const
&
periodicity
,
double
const
&
phase
,
double
const
&
k
)
{
return
OpenMM_PeriodicTorsionForce_addTorsion
(
ptf
,
p1
,
p2
,
p3
,
p4
,
periodicity
,
phase
,
k
);
}
int
OPENMM_PERIODICTORSIONFORCE_ADDTORSION
(
OpenMM_PeriodicTorsionForce
*
const
&
ptf
,
int
const
&
p1
,
int
const
&
p2
,
int
const
&
p3
,
int
const
&
p4
,
int
const
&
periodicity
,
double
const
&
phase
,
double
const
&
k
)
{
return
OpenMM_PeriodicTorsionForce_addTorsion
(
ptf
,
p1
,
p2
,
p3
,
p4
,
periodicity
,
phase
,
k
);
}
// setTorsionParameters
void
OpenMM_PeriodicTorsionForce_setTorsionParameters
(
OpenMM_PeriodicTorsionForce
*
ptf
,
int
ix
,
int
p1
,
int
p2
,
int
p3
,
int
p4
,
int
periodicity
,
double
phase
,
double
k
)
{
((
PeriodicTorsionForce
*
)
ptf
)
->
setTorsionParameters
(
ix
,
p1
,
p2
,
p3
,
p4
,
periodicity
,
phase
,
k
);
}
void
openmm_periodictorsionforce_settorsionparameters_
(
OpenMM_PeriodicTorsionForce
*
const
&
ptf
,
int
const
&
ix
,
int
const
&
p1
,
int
const
&
p2
,
int
const
&
p3
,
int
const
&
p4
,
int
const
&
periodicity
,
double
const
&
phase
,
double
const
&
k
)
{
OpenMM_PeriodicTorsionForce_setTorsionParameters
(
ptf
,
ix
,
p1
,
p2
,
p3
,
p4
,
periodicity
,
phase
,
k
);
}
void
OPENMM_PERIODICTORSIONFORCE_SETTORSIONPARAMETERS
(
OpenMM_PeriodicTorsionForce
*
const
&
ptf
,
int
const
&
ix
,
int
const
&
p1
,
int
const
&
p2
,
int
const
&
p3
,
int
const
&
p4
,
int
const
&
periodicity
,
double
const
&
phase
,
double
const
&
k
)
{
OpenMM_PeriodicTorsionForce_setTorsionParameters
(
ptf
,
ix
,
p1
,
p2
,
p3
,
p4
,
periodicity
,
phase
,
k
);
}
// getTorsionParameters
void
OpenMM_PeriodicTorsionForce_getTorsionParameters
(
const
OpenMM_PeriodicTorsionForce
*
ptf
,
int
ix
,
int
*
p1
,
int
*
p2
,
int
*
p3
,
int
*
p4
,
int
*
periodicity
,
double
*
phase
,
double
*
k
)
{
((
const
PeriodicTorsionForce
*
)
ptf
)
->
getTorsionParameters
(
ix
,
*
p1
,
*
p2
,
*
p3
,
*
p4
,
*
periodicity
,
*
phase
,
*
k
);
}
void
openmm_periodictorsionforce_gettorsionparameters_
(
const
OpenMM_PeriodicTorsionForce
*
const
&
ptf
,
int
const
&
ix
,
int
&
p1
,
int
&
p2
,
int
&
p3
,
int
&
p4
,
int
&
periodicity
,
double
&
phase
,
double
&
k
)
{
OpenMM_PeriodicTorsionForce_getTorsionParameters
(
ptf
,
ix
,
&
p1
,
&
p2
,
&
p3
,
&
p4
,
&
periodicity
,
&
phase
,
&
k
);
}
void
OPENMM_PERIODICTORSIONFORCE_GETTORSIONPARAMETERS
(
const
OpenMM_PeriodicTorsionForce
*
const
&
ptf
,
int
const
&
ix
,
int
&
p1
,
int
&
p2
,
int
&
p3
,
int
&
p4
,
int
&
periodicity
,
double
&
phase
,
double
&
k
)
{
OpenMM_PeriodicTorsionForce_getTorsionParameters
(
ptf
,
ix
,
&
p1
,
&
p2
,
&
p3
,
&
p4
,
&
periodicity
,
&
phase
,
&
k
);
}
////////////////////////////////
// OpenMM::AndersenThermostat //
////////////////////////////////
// create
OpenMM_AndersenThermostat
*
OpenMM_AndersenThermostat_create
(
double
temp
,
double
collisionFreqInPerPs
)
{
return
(
OpenMM_AndersenThermostat
*
)
new
AndersenThermostat
(
temp
,
collisionFreqInPerPs
);
}
void
openmm_andersenthermostat_create_
(
OpenMM_AndersenThermostat
*&
frc
,
double
const
&
temp
,
double
const
&
freq
)
{
frc
=
OpenMM_AndersenThermostat_create
(
temp
,
freq
);}
void
OPENMM_ANDERSENTHERMOSTAT_CREATE
(
OpenMM_AndersenThermostat
*&
frc
,
double
const
&
temp
,
double
const
&
freq
)
{
frc
=
OpenMM_AndersenThermostat_create
(
temp
,
freq
);}
// destroy
void
OpenMM_AndersenThermostat_destroy
(
OpenMM_AndersenThermostat
*
doomed
)
{
delete
(
AndersenThermostat
*
)
doomed
;
}
void
openmm_andersenthermostat_destroy_
(
OpenMM_AndersenThermostat
*&
doomed
)
{
OpenMM_AndersenThermostat_destroy
(
doomed
);
doomed
=
0
;}
void
OPENMM_ANDERSENTHERMOSTAT_DESTROY
(
OpenMM_AndersenThermostat
*&
doomed
)
{
OpenMM_AndersenThermostat_destroy
(
doomed
);
doomed
=
0
;}
// Fortran only: recast AndersenThermostat as a Force.
void
openmm_andersenthermostat_asforce_
(
OpenMM_AndersenThermostat
*
const
&
at
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
at
;
}
void
OPENMM_ANDERSENTHERMOSTAT_ASFORCE
(
OpenMM_AndersenThermostat
*
const
&
at
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
at
;
}
// For compatibility with preview release 3 where getDefaultTemperature() and
// getDefaultCollisionFrequency() were accidentally declared nonconst, we're
// using const_cast<> here; that will be unnecessary (but harmless) later.
// getDefaultTemperature
double
OpenMM_AndersenThermostat_getDefaultTemperature
(
const
OpenMM_AndersenThermostat
*
at
)
{
return
const_cast
<
AndersenThermostat
*>
((
const
AndersenThermostat
*
)
at
)
->
getDefaultTemperature
();
}
double
openmm_andersenthermostat_getdefaulttemperature_
(
const
OpenMM_AndersenThermostat
*
const
&
at
)
{
return
OpenMM_AndersenThermostat_getDefaultTemperature
(
at
);
}
double
OPENMM_ANDERSENTHERMOSTAT_GETDEFAULTTEMPERATURE
(
const
OpenMM_AndersenThermostat
*
const
&
at
)
{
return
OpenMM_AndersenThermostat_getDefaultTemperature
(
at
);
}
// getDefaultCollisionFrequency
double
OpenMM_AndersenThermostat_getDefaultCollisionFrequency
(
const
OpenMM_AndersenThermostat
*
at
)
{
return
const_cast
<
AndersenThermostat
*>
((
const
AndersenThermostat
*
)
at
)
->
getDefaultCollisionFrequency
();
}
double
openmm_andersenthermostat_getdefaultcollisionfrequency_
(
const
OpenMM_AndersenThermostat
*
const
&
at
)
{
return
OpenMM_AndersenThermostat_getDefaultCollisionFrequency
(
at
);
}
double
OPENMM_ANDERSENTHERMOSTAT_GETDEFAULTCOLLISIONFREQUENCY
(
const
OpenMM_AndersenThermostat
*
const
&
at
)
{
return
OpenMM_AndersenThermostat_getDefaultCollisionFrequency
(
at
);
}
// getRandomNumberSeed
int
OpenMM_AndersenThermostat_getRandomNumberSeed
(
const
OpenMM_AndersenThermostat
*
at
)
{
return
((
const
AndersenThermostat
*
)
at
)
->
getRandomNumberSeed
();
}
int
openmm_andersenthermostat_getrandomnumberseed_
(
const
OpenMM_AndersenThermostat
*
const
&
at
)
{
return
OpenMM_AndersenThermostat_getRandomNumberSeed
(
at
);
}
int
OPENMM_ANDERSENTHERMOSTAT_GETRANDOMNUMBERSEED
(
const
OpenMM_AndersenThermostat
*
const
&
at
)
{
return
OpenMM_AndersenThermostat_getRandomNumberSeed
(
at
);
}
// setRandomNumberSeed
void
OpenMM_AndersenThermostat_setRandomNumberSeed
(
OpenMM_AndersenThermostat
*
at
,
int
seed
)
{
((
AndersenThermostat
*
)
at
)
->
setRandomNumberSeed
(
seed
);
}
void
openmm_andersenthermostat_setrandomnumberseed_
(
OpenMM_AndersenThermostat
*
const
&
at
,
int
const
&
seed
)
{
OpenMM_AndersenThermostat_setRandomNumberSeed
(
at
,
seed
);
}
void
OPENMM_ANDERSENTHERMOSTAT_SETRANDOMNUMBERSEED
(
OpenMM_AndersenThermostat
*
const
&
at
,
int
const
&
seed
)
{
OpenMM_AndersenThermostat_setRandomNumberSeed
(
at
,
seed
);
}
////////////////////////
// OpenMM::Integrator //
////////////////////////
// This is the generic Integrator class so there is no "create" method. Instead,
// you always create an object of a concrete class like VerletIntegrator and
// then cast it to the generic Integrator.
// step
void
OpenMM_Integrator_step
(
OpenMM_Integrator
*
integ
,
int
numSteps
)
{
((
Integrator
*
)
integ
)
->
step
(
numSteps
);
}
void
openmm_integrator_step_
(
OpenMM_Integrator
*
const
&
integ
,
int
&
numSteps
)
{
OpenMM_Integrator_step
(
integ
,
numSteps
);
}
void
OPENMM_INTEGRATOR_STEP
(
OpenMM_Integrator
*
const
&
integ
,
int
&
numSteps
)
{
OpenMM_Integrator_step
(
integ
,
numSteps
);
}
// destroy
void
OpenMM_Integrator_destroy
(
OpenMM_Integrator
*
doomed
)
{
delete
((
Integrator
*
)
doomed
);
}
void
openmm_integrator_destroy_
(
OpenMM_Integrator
*&
doomed
)
{
OpenMM_Integrator_destroy
(
doomed
);
doomed
=
0
;
}
void
OPENMM_INTEGRATOR_DESTROY
(
OpenMM_Integrator
*&
doomed
)
{
OpenMM_Integrator_destroy
(
doomed
);
doomed
=
0
;
}
// OpenMM::VerletIntegrator
// create
OpenMM_VerletIntegrator
*
OpenMM_VerletIntegrator_create
(
double
stepSzInPs
)
{
return
(
OpenMM_VerletIntegrator
*
)
new
VerletIntegrator
(
stepSzInPs
);
}
void
openmm_verletintegrator_create_
(
OpenMM_VerletIntegrator
*&
verlet
,
double
&
stepSzInPs
)
{
verlet
=
OpenMM_VerletIntegrator_create
(
stepSzInPs
);
}
void
OPENMM_VERLETINTEGRATOR_CREATE
(
OpenMM_VerletIntegrator
*&
verlet
,
double
&
stepSzInPs
)
{
verlet
=
OpenMM_VerletIntegrator_create
(
stepSzInPs
);
}
// destroy
void
OpenMM_VerletIntegrator_destroy
(
OpenMM_VerletIntegrator
*
doomed
)
{
delete
(
VerletIntegrator
*
)
doomed
;
}
void
openmm_verletintegrator_destroy_
(
OpenMM_VerletIntegrator
*&
doomed
)
{
OpenMM_VerletIntegrator_destroy
(
doomed
);
doomed
=
0
;
}
void
OPENMM_VERLETINTEGRATOR_DESTROY
(
OpenMM_VerletIntegrator
*&
doomed
)
{
OpenMM_VerletIntegrator_destroy
(
doomed
);
doomed
=
0
;
}
// Fortran only: recast VerletIntegrator as an Integrator.
void
openmm_verletintegrator_asintegrator_
(
OpenMM_VerletIntegrator
*
const
&
verlet
,
OpenMM_Integrator
*&
integ
)
{
integ
=
(
OpenMM_Integrator
*
)
verlet
;
}
void
OPENMM_VERLETINTEGRATOR_ASINTEGRATOR
(
OpenMM_VerletIntegrator
*
const
&
verlet
,
OpenMM_Integrator
*&
integ
)
{
integ
=
(
OpenMM_Integrator
*
)
verlet
;
}
// step
void
OpenMM_VerletIntegrator_step
(
OpenMM_VerletIntegrator
*
verlet
,
int
numSteps
)
{
((
VerletIntegrator
*
)
verlet
)
->
step
(
numSteps
);
}
void
openmm_verletintegrator_step_
(
OpenMM_VerletIntegrator
*
const
&
verlet
,
int
&
numSteps
)
{
OpenMM_VerletIntegrator_step
(
verlet
,
numSteps
);
}
void
OPENMM_VERLETINTEGRATOR_STEP
(
OpenMM_VerletIntegrator
*
const
&
verlet
,
int
&
numSteps
)
{
OpenMM_VerletIntegrator_step
(
verlet
,
numSteps
);
}
// OpenMM::LangevinIntegrator
// create
OpenMM_LangevinIntegrator
*
OpenMM_LangevinIntegrator_create
(
double
temperature
,
double
frictionInPerPs
,
double
stepSzInPs
)
{
return
(
OpenMM_LangevinIntegrator
*
)
new
LangevinIntegrator
(
temperature
,
frictionInPerPs
,
stepSzInPs
);
}
void
openmm_langevinintegrator_create_
(
OpenMM_LangevinIntegrator
*&
langevin
,
double
&
temperature
,
double
&
frictionInPerPs
,
double
&
stepSzInPs
)
{
langevin
=
OpenMM_LangevinIntegrator_create
(
temperature
,
frictionInPerPs
,
stepSzInPs
);
}
void
OPENMM_LANGEVININTEGRATOR_CREATE
(
OpenMM_LangevinIntegrator
*&
langevin
,
double
&
temperature
,
double
&
frictionInPerPs
,
double
&
stepSzInPs
)
{
langevin
=
OpenMM_LangevinIntegrator_create
(
temperature
,
frictionInPerPs
,
stepSzInPs
);
}
// destroy
void
OpenMM_LangevinIntegrator_destroy
(
OpenMM_LangevinIntegrator
*
doomed
)
{
delete
(
LangevinIntegrator
*
)
doomed
;
}
void
openmm_langevinintegrator_destroy_
(
OpenMM_LangevinIntegrator
*&
doomed
)
{
OpenMM_LangevinIntegrator_destroy
(
doomed
);
doomed
=
0
;
}
void
OPENMM_LANGEVININTEGRATOR_DESTROY
(
OpenMM_LangevinIntegrator
*&
doomed
)
{
OpenMM_LangevinIntegrator_destroy
(
doomed
);
doomed
=
0
;
}
// asIntegrator Fortran only: recast LangevinIntegrator as an Integrator.
void
openmm_langevinintegrator_asintegrator_
(
OpenMM_LangevinIntegrator
*
const
&
langevin
,
OpenMM_Integrator
*&
integ
)
{
integ
=
(
OpenMM_Integrator
*
)
langevin
;
}
void
OPENMM_LANGEVININTEGRATOR_ASINTEGRATOR
(
OpenMM_LangevinIntegrator
*
const
&
langevin
,
OpenMM_Integrator
*&
integ
)
{
integ
=
(
OpenMM_Integrator
*
)
langevin
;
}
// step
void
OpenMM_LangevinIntegrator_step
(
OpenMM_LangevinIntegrator
*
langevin
,
int
numSteps
)
{
((
LangevinIntegrator
*
)
langevin
)
->
step
(
numSteps
);
}
void
openmm_langevinintegrator_step_
(
OpenMM_LangevinIntegrator
*
const
&
langevin
,
int
&
numSteps
)
{
OpenMM_LangevinIntegrator_step
(
langevin
,
numSteps
);
}
void
OPENMM_LANGEVININTEGRATOR_STEP
(
OpenMM_LangevinIntegrator
*
const
&
langevin
,
int
&
numSteps
)
{
OpenMM_LangevinIntegrator_step
(
langevin
,
numSteps
);
}
/////////////////////
// OpenMM::Context //
/////////////////////
// create
OpenMM_Context
*
OpenMM_Context_create
(
OpenMM_System
*
sys
,
OpenMM_Integrator
*
integ
)
{
return
(
OpenMM_Context
*
)
new
OpenMM
::
Context
(
*
(
System
*
)
sys
,
*
(
Integrator
*
)
integ
);
}
void
openmm_context_create_
(
OpenMM_Context
*&
context
,
OpenMM_System
*&
sys
,
OpenMM_Integrator
*&
integ
)
{
context
=
OpenMM_Context_create
(
sys
,
integ
);
}
void
OPENMM_CONTEXT_CREATE
(
OpenMM_Context
*&
context
,
OpenMM_System
*&
sys
,
OpenMM_Integrator
*&
integ
)
{
context
=
OpenMM_Context_create
(
sys
,
integ
);
}
// destroy
void
OpenMM_Context_destroy
(
OpenMM_Context
*
doomed
)
{
delete
(
Context
*
)
doomed
;
}
void
openmm_context_destroy_
(
OpenMM_Context
*&
doomed
)
{
OpenMM_Context_destroy
(
doomed
);
}
void
OPENMM_CONTEXT_DESTROY
(
OpenMM_Context
*&
doomed
)
{
OpenMM_Context_destroy
(
doomed
);
}
// setPositions
void
OpenMM_Context_setPositions
(
OpenMM_Context
*
context
,
const
OpenMM_Vec3Array
*
positions
)
{
((
Context
*
)
context
)
->
setPositions
(
*
(
const
std
::
vector
<
Vec3
>*
)
positions
);
}
void
openmm_context_setpositions_
(
OpenMM_Context
*
const
&
context
,
const
OpenMM_Vec3Array
*
const
&
positions
)
{
OpenMM_Context_setPositions
(
context
,
positions
);
}
void
OPENMM_CONTEXT_SETPOSITIONS
(
OpenMM_Context
*
const
&
context
,
const
OpenMM_Vec3Array
*
const
&
positions
)
{
OpenMM_Context_setPositions
(
context
,
positions
);
}
// setVelocities
void
OpenMM_Context_setVelocities
(
OpenMM_Context
*
context
,
const
OpenMM_Vec3Array
*
velocities
)
{
((
Context
*
)
context
)
->
setVelocities
(
*
(
const
std
::
vector
<
Vec3
>*
)
velocities
);
}
void
openmm_context_setvelocities_
(
OpenMM_Context
*
const
&
context
,
const
OpenMM_Vec3Array
*
const
&
velocities
)
{
OpenMM_Context_setVelocities
(
context
,
velocities
);
}
void
OPENMM_CONTEXT_SETVELOCITIES
(
OpenMM_Context
*
const
&
context
,
const
OpenMM_Vec3Array
*
const
&
velocities
)
{
OpenMM_Context_setVelocities
(
context
,
velocities
);
}
// createState
// Note that a Context creates the OpenMM::State object, but you have to destroy
// it using OpenMM_State_destroy.
OpenMM_State
*
OpenMM_Context_createState
(
const
OpenMM_Context
*
context
,
int
types
)
{
return
(
OpenMM_State
*
)
new
State
(((
Context
*
)
context
)
->
getState
(
types
));
}
void
openmm_context_createstate_
(
const
OpenMM_Context
*
const
&
context
,
const
int
&
types
,
OpenMM_State
*&
state
)
{
state
=
OpenMM_Context_createState
(
context
,
types
);
}
void
OPENMM_CONTEXT_CREATESTATE
(
const
OpenMM_Context
*
const
&
context
,
const
int
&
types
,
OpenMM_State
*&
state
)
{
state
=
OpenMM_Context_createState
(
context
,
types
);
}
// getPlatformName C: Return a reference to a static null terminated C string containing the
// Platform name.
const
char
*
OpenMM_Context_getPlatformName
(
const
OpenMM_Context
*
context
)
{
static
std
::
string
platform
;
platform
=
((
const
Context
*
)
context
)
->
getPlatform
().
getName
();
return
platform
.
c_str
();
}
// getPlatformName Fortran: Return a blank-padded Fortran string containing the Platform name. There
// is no terminating null.
void
openmm_context_getplatformname_
(
const
OpenMM_Context
*
const
&
context
,
char
*
buf
,
int
len
)
{
const
std
::
string
name
=
((
const
Context
*
)
context
)
->
getPlatform
().
getName
();
const
int
minLen
=
std
::
min
((
int
)
name
.
size
(),
len
);
for
(
int
i
=
0
;
i
<
minLen
;
++
i
)
buf
[
i
]
=
name
[
i
];
for
(
int
i
=
minLen
;
i
<
len
;
++
i
)
buf
[
i
]
=
' '
;
}
void
OPENMM_CONTEXT_GETPLATFORMNAME
(
const
OpenMM_Context
*
const
&
context
,
char
*
buf
,
int
len
)
{
openmm_context_getplatformname_
(
context
,
buf
,
len
);
}
///////////////////
// OpenMM::State //
///////////////////
// States are created by Context, see above.
// destroy
void
OpenMM_State_destroy
(
OpenMM_State
*
doomed
)
{
delete
(
State
*
)
doomed
;
}
void
openmm_state_destroy_
(
OpenMM_State
*&
doomed
)
{
OpenMM_State_destroy
(
doomed
);
doomed
=
0
;
}
void
OPENMM_STATE_DESTROY
(
OpenMM_State
*&
doomed
)
{
OpenMM_State_destroy
(
doomed
);
doomed
=
0
;
}
// getTime
double
OpenMM_State_getTime
(
const
OpenMM_State
*
state
)
{
return
((
const
State
*
)
state
)
->
getTime
();
}
double
openmm_state_gettime_
(
const
OpenMM_State
*
const
&
state
)
{
return
OpenMM_State_getTime
(
state
);
}
double
OPENMM_STATE_GETTIME
(
const
OpenMM_State
*
const
&
state
)
{
return
OpenMM_State_getTime
(
state
);
}
// getPotentialEnergy
double
OpenMM_State_getPotentialEnergy
(
const
OpenMM_State
*
state
)
{
return
((
const
State
*
)
state
)
->
getPotentialEnergy
();
}
double
openmm_state_getpotentialenergy_
(
const
OpenMM_State
*
const
&
state
)
{
return
OpenMM_State_getPotentialEnergy
(
state
);
}
double
OPENMM_STATE_GETPOTENTIALENERGY
(
const
OpenMM_State
*
const
&
state
)
{
return
OpenMM_State_getPotentialEnergy
(
state
);
}
// getKineticEnergy
double
OpenMM_State_getKineticEnergy
(
const
OpenMM_State
*
state
)
{
return
((
const
State
*
)
state
)
->
getKineticEnergy
();
}
double
openmm_state_getkineticenergy_
(
const
OpenMM_State
*
const
&
state
)
{
return
OpenMM_State_getKineticEnergy
(
state
);
}
double
OPENMM_STATE_GETKINETICENERGY
(
const
OpenMM_State
*
const
&
state
)
{
return
OpenMM_State_getKineticEnergy
(
state
);
}
// getPositions
const
OpenMM_Vec3Array
*
OpenMM_State_getPositions
(
const
OpenMM_State
*
state
)
{
return
(
const
OpenMM_Vec3Array
*
)
&
((
const
State
*
)
state
)
->
getPositions
();
}
void
openmm_state_getpositions_
(
const
OpenMM_State
*
const
&
state
,
const
OpenMM_Vec3Array
*&
positions
)
{
positions
=
OpenMM_State_getPositions
(
state
);
}
void
OPENMM_STATE_GETPOSITIONS
(
const
OpenMM_State
*
const
&
state
,
const
OpenMM_Vec3Array
*&
positions
)
{
positions
=
OpenMM_State_getPositions
(
state
);
}
// getVelocities
const
OpenMM_Vec3Array
*
OpenMM_State_getVelocities
(
const
OpenMM_State
*
state
)
{
return
(
const
OpenMM_Vec3Array
*
)
&
((
const
State
*
)
state
)
->
getVelocities
();
}
void
openmm_state_getvelocities_
(
const
OpenMM_State
*
const
&
state
,
const
OpenMM_Vec3Array
*&
velocities
)
{
velocities
=
OpenMM_State_getVelocities
(
state
);
}
void
OPENMM_STATE_GETVELOCITIES
(
const
OpenMM_State
*
const
&
state
,
const
OpenMM_Vec3Array
*&
velocities
)
{
velocities
=
OpenMM_State_getVelocities
(
state
);
}
///////////////////////////
// OpenMM_RuntimeObjects //
///////////////////////////
// create
OpenMM_RuntimeObjects
*
OpenMM_RuntimeObjects_create
()
{
OpenMM_RuntimeObjects
*
ommrt
=
new
OpenMM_RuntimeObjects
();
ommrt
->
system
=
0
;
ommrt
->
integrator
=
0
;
ommrt
->
context
=
0
;
return
ommrt
;
}
void
openmm_runtimeobjects_create_
(
OpenMM_RuntimeObjects
*&
ommrt
)
{
ommrt
=
OpenMM_RuntimeObjects_create
();
}
void
OPENMM_RUNTIMEOBJECTS_CREATE
(
OpenMM_RuntimeObjects
*&
ommrt
)
{
ommrt
=
OpenMM_RuntimeObjects_create
();
}
// clear
void
OpenMM_RuntimeObjects_clear
(
OpenMM_RuntimeObjects
*
ommrt
)
{
if
(
!
ommrt
)
return
;
OpenMM_Context_destroy
(
ommrt
->
context
);
ommrt
->
context
=
0
;
OpenMM_Integrator_destroy
(
ommrt
->
integrator
);
ommrt
->
integrator
=
0
;
OpenMM_System_destroy
(
ommrt
->
system
);
ommrt
->
system
=
0
;
}
void
openmm_runtimeobjects_clear_
(
OpenMM_RuntimeObjects
*
const
&
ommrt
)
{
OpenMM_RuntimeObjects_clear
(
ommrt
);
}
void
OPENMM_RUNTIMEOBJECTS_CLEAR
(
OpenMM_RuntimeObjects
*
const
&
ommrt
)
{
OpenMM_RuntimeObjects_clear
(
ommrt
);
}
// destroy
void
OpenMM_RuntimeObjects_destroy
(
OpenMM_RuntimeObjects
*
ommrt
)
{
OpenMM_RuntimeObjects_clear
(
ommrt
);
delete
ommrt
;
}
void
openmm_runtimeobjects_destroy_
(
OpenMM_RuntimeObjects
*&
ommrt
)
{
OpenMM_RuntimeObjects_destroy
(
ommrt
);
ommrt
=
0
;
}
void
OPENMM_RUNTIMEOBJECTS_DESTROY
(
OpenMM_RuntimeObjects
*&
ommrt
)
{
OpenMM_RuntimeObjects_destroy
(
ommrt
);
ommrt
=
0
;
}
// setSystem
void
OpenMM_RuntimeObjects_setSystem
(
OpenMM_RuntimeObjects
*
ommrt
,
OpenMM_System
*
sys
)
{
OpenMM_System_destroy
(
ommrt
->
system
);
ommrt
->
system
=
sys
;
}
void
openmm_runtimeobjects_setsystem_
(
OpenMM_RuntimeObjects
*
const
&
ommrt
,
OpenMM_System
*
const
&
sys
)
{
OpenMM_RuntimeObjects_setSystem
(
ommrt
,
sys
);
}
void
OPENMM_RUNTIMEOBJECTS_SETSYSTEM
(
OpenMM_RuntimeObjects
*
const
&
ommrt
,
OpenMM_System
*
const
&
sys
)
{
OpenMM_RuntimeObjects_setSystem
(
ommrt
,
sys
);
}
// getSystem
OpenMM_System
*
OpenMM_RuntimeObjects_getSystem
(
OpenMM_RuntimeObjects
*
ommrt
)
{
return
ommrt
->
system
;
}
void
openmm_runtimeobjects_getsystem_
(
OpenMM_RuntimeObjects
*
const
&
ommrt
,
OpenMM_System
*&
sys
)
{
sys
=
OpenMM_RuntimeObjects_getSystem
(
ommrt
);
}
void
OPENMM_RUNTIMEOBJECTS_GETSYSTEM
(
OpenMM_RuntimeObjects
*
const
&
ommrt
,
OpenMM_System
*&
sys
)
{
sys
=
OpenMM_RuntimeObjects_getSystem
(
ommrt
);
}
// setIntegrator
void
OpenMM_RuntimeObjects_setIntegrator
(
OpenMM_RuntimeObjects
*
ommrt
,
OpenMM_Integrator
*
integ
)
{
OpenMM_Integrator_destroy
(
ommrt
->
integrator
);
ommrt
->
integrator
=
integ
;
}
void
openmm_runtimeobjects_setintegrator_
(
OpenMM_RuntimeObjects
*
const
&
ommrt
,
OpenMM_Integrator
*
const
&
integ
)
{
OpenMM_RuntimeObjects_setIntegrator
(
ommrt
,
integ
);
}
void
OPENMM_RUNTIMEOBJECTS_SETINTEGRATOR
(
OpenMM_RuntimeObjects
*
const
&
ommrt
,
OpenMM_Integrator
*
const
&
integ
)
{
OpenMM_RuntimeObjects_setIntegrator
(
ommrt
,
integ
);
}
// getIntegrator
OpenMM_Integrator
*
OpenMM_RuntimeObjects_getIntegrator
(
OpenMM_RuntimeObjects
*
ommrt
)
{
return
ommrt
->
integrator
;
}
void
openmm_runtimeobjects_getintegrator_
(
OpenMM_RuntimeObjects
*
const
&
ommrt
,
OpenMM_Integrator
*&
integ
)
{
integ
=
OpenMM_RuntimeObjects_getIntegrator
(
ommrt
);
}
void
OPENMM_RUNTIMEOBJECTS_GETINTEGRATOR
(
OpenMM_RuntimeObjects
*
const
&
ommrt
,
OpenMM_Integrator
*&
integ
)
{
integ
=
OpenMM_RuntimeObjects_getIntegrator
(
ommrt
);
}
// setContext
void
OpenMM_RuntimeObjects_setContext
(
OpenMM_RuntimeObjects
*
ommrt
,
OpenMM_Context
*
context
)
{
OpenMM_Context_destroy
(
ommrt
->
context
);
ommrt
->
context
=
context
;
}
void
openmm_runtimeobjects_setcontext_
(
OpenMM_RuntimeObjects
*
const
&
ommrt
,
OpenMM_Context
*&
context
)
{
OpenMM_RuntimeObjects_setContext
(
ommrt
,
context
);
}
void
OPENMM_RUNTIMEOBJECTS_SETCONTEXT
(
OpenMM_RuntimeObjects
*
const
&
ommrt
,
OpenMM_Context
*&
context
)
{
OpenMM_RuntimeObjects_setContext
(
ommrt
,
context
);
}
// getContext
OpenMM_Context
*
OpenMM_RuntimeObjects_getContext
(
OpenMM_RuntimeObjects
*
ommrt
)
{
return
ommrt
->
context
;
}
void
openmm_runtimeobjects_getcontext_
(
OpenMM_RuntimeObjects
*
const
&
ommrt
,
OpenMM_Context
*&
context
)
{
context
=
OpenMM_RuntimeObjects_getContext
(
ommrt
);
}
void
OPENMM_RUNTIMEOBJECTS_GETCONTEXT
(
OpenMM_RuntimeObjects
*
const
&
ommrt
,
OpenMM_Context
*&
context
)
{
context
=
OpenMM_RuntimeObjects_getContext
(
ommrt
);
}
}
// extern "C"
examples/OpenMM_CWrapper.h
deleted
100644 → 0
View file @
9438fa83
/* --------------------------------------------------------------------------
* OpenMM(tm) PROTOTYPE C wrapper function declarations (June 2009)
* --------------------------------------------------------------------------
* This header should be included by a C main program that would like to
* access the OpenMM API through the C wrappers. Please note that this is an
* experimental prototype, not an official part of OpenMM; it is just an
* example of how the C++ API can be wrapped for access from C.
*
* This set of wrappers is incomplete. If you add more, please send them
* to us. Improvements in substance and style would also be greatly
* appreciated. If you have ideas (or better code) please post to the OpenMM
* forum on simtk.org/home/openmm or if you're shy you can email Michael
* Sherman at msherman@stanford.edu.
*
* Note: this header must be includable in both ANSI C and C++ code, because
* the function declarations must be common to both the users and the
* implementing code, which is in C++.
* -------------------------------------------------------------------------- */
#ifndef OPENMM_CWRAPPER_H_
#define OPENMM_CWRAPPER_H_
/* Declare incomplete types corresponding to each of the OpenMM objects that
* we want to make available. This allows us to have unique pointer types
* for each object to maintain some semblance of type safety.
*/
/* These first three types represent the three OpenMM runtime objects that
* must persist from call to call during an OpenMM-powered simulation.
* OpenMM_Integrator is the generic type of all Integrator objects. */
typedef
struct
OpenMM_System_s
OpenMM_System
;
typedef
struct
OpenMM_Integrator_s
OpenMM_Integrator
;
typedef
struct
OpenMM_Context_s
OpenMM_Context
;
/* This is the generic type of all Force objects. */
typedef
struct
OpenMM_Force_s
OpenMM_Force
;
/* This struct collects all the runtime object pointers together to
* facilitate use of an opaque handle in high-level C or Fortran code
* that doesn't have (or want) access to OpenMM declarations. This
* does not have an equivalent in the OpenMM C++ API. */
typedef
struct
OpenMM_RuntimeObjects_s
{
OpenMM_System
*
system
;
OpenMM_Integrator
*
integrator
;
OpenMM_Context
*
context
;
}
OpenMM_RuntimeObjects
;
typedef
double
OpenMM_Vec3
[
3
];
typedef
struct
OpenMM_Vec3Array_s
OpenMM_Vec3Array
;
typedef
struct
OpenMM_BondArray_s
OpenMM_BondArray
;
typedef
struct
OpenMM_String_s
OpenMM_String
;
/*
* OpenMM_Integrator is the generic type for all integrators. Cast your
* specific pointer type to the generic one for communication with functions
* that take type OpenMM_Integrator.
*/
typedef
struct
OpenMM_VerletIntegrator_s
OpenMM_VerletIntegrator
;
typedef
struct
OpenMM_LangevinIntegrator_s
OpenMM_LangevinIntegrator
;
/*
* OpenMM_Force is the generic type for all Force objects. Create the
* concrete Force object and then cast it to the generic type.
*/
typedef
struct
OpenMM_NonbondedForce_s
OpenMM_NonbondedForce
;
typedef
struct
OpenMM_GBSAOBCForce_s
OpenMM_GBSAOBCForce
;
typedef
struct
OpenMM_HarmonicBondForce_s
OpenMM_HarmonicBondForce
;
typedef
struct
OpenMM_HarmonicAngleForce_s
OpenMM_HarmonicAngleForce
;
typedef
struct
OpenMM_PeriodicTorsionForce_s
OpenMM_PeriodicTorsionForce
;
typedef
struct
OpenMM_AndersenThermostat_s
OpenMM_AndersenThermostat
;
typedef
enum
{
OpenMM_NonbondedForce_NoCutoff
=
0
,
OpenMM_NonbondedForce_CutoffNonPeriodic
=
1
,
OpenMM_NonbondedForce_CutoffPeriodic
=
2
,
OpenMM_NonbondedForce_Ewald
=
3
}
OpenMM_NonbondedForce_NonbondedMethod
;
typedef
struct
OpenMM_State_s
OpenMM_State
;
typedef
enum
{
OpenMM_State_Positions
=
1
,
OpenMM_State_Velocities
=
2
,
OpenMM_State_Forces
=
4
,
OpenMM_State_Energy
=
8
,
OpenMM_State_Parameters
=
16
}
OpenMM_State_DataType
;
/* Conversion constants from openmm/Units.h */
/*
* The number of nanometers in an Angstrom.
*/
static
const
double
OpenMM_NmPerAngstrom
=
0
.
1
;
/*
* The number of Angstroms in a nanometer.
*/
static
const
double
OpenMM_AngstromsPerNm
=
10
.
0
;
/*
* The number of picoseconds in a femtosecond.
*/
static
const
double
OpenMM_PsPerFs
=
0
.
001
;
/*
* The number of femtoseconds in a picosecond.
*/
static
const
double
OpenMM_FsPerPs
=
1000
.
0
;
/*
* The number of kJ in a kcal.
*/
static
const
double
OpenMM_KJPerKcal
=
4
.
184
;
/*
* The number of kcal in a kJ.
*/
static
const
double
OpenMM_KcalPerKJ
=
1
.
0
/
4
.
184
;
/*
* The number of radians in a degree.
*/
static
const
double
OpenMM_RadiansPerDegree
=
3
.
1415926535897932385
/
180
.
0
;
/*
* The number of degrees in a radian.
*/
static
const
double
OpenMM_DegreesPerRadian
=
180
.
0
/
3
.
1415926535897932385
;
/*
* This is the conversion factor that takes you from a van der Waals radius
* (defined as 1/2 the minimum energy separation) to the related Lennard Jones
* "sigma" parameter (defined as the zero crossing separation). The value
* is 2*pow(2, -1/6).
*/
static
const
double
OpenMM_SigmaPerVdwRadius
=
1
.
7817974362806786095
;
#if defined(__cplusplus)
extern
"C"
{
#endif
/* OpenMM_Vec3Array */
extern
OpenMM_Vec3Array
*
OpenMM_Vec3Array_create
(
int
n
);
extern
int
OpenMM_Vec3Array_size
(
const
OpenMM_Vec3Array
*
);
extern
void
OpenMM_Vec3Array_resize
(
OpenMM_Vec3Array
*
,
int
n
);
extern
void
OpenMM_Vec3Array_destroy
(
OpenMM_Vec3Array
*
);
extern
void
OpenMM_Vec3Array_append
(
OpenMM_Vec3Array
*
,
const
double
[
3
]);
extern
void
OpenMM_Vec3Array_get
(
const
OpenMM_Vec3Array
*
,
int
i
,
double
[
3
]);
extern
void
OpenMM_Vec3Array_getScaled
(
const
OpenMM_Vec3Array
*
,
int
i
,
double
s
,
double
[
3
]);
extern
void
OpenMM_Vec3Array_set
(
OpenMM_Vec3Array
*
,
int
i
,
const
double
[
3
]);
extern
void
OpenMM_Vec3Array_setScaled
(
OpenMM_Vec3Array
*
,
int
i
,
const
double
[
3
],
double
s
);
extern
void
OpenMM_Vec3_scale
(
const
double
in
[
3
],
double
s
,
double
out
[
3
]);
/* OpenMM_BondArray */
extern
OpenMM_BondArray
*
OpenMM_BondArray_create
(
int
n
);
extern
int
OpenMM_BondArray_size
(
const
OpenMM_BondArray
*
);
extern
void
OpenMM_BondArray_resize
(
OpenMM_BondArray
*
,
int
n
);
extern
void
OpenMM_BondArray_destroy
(
OpenMM_BondArray
*
);
extern
void
OpenMM_BondArray_append
(
OpenMM_BondArray
*
,
int
p1
,
int
p2
);
extern
void
OpenMM_BondArray_get
(
const
OpenMM_BondArray
*
,
int
i
,
int
*
p1
,
int
*
p2
);
extern
void
OpenMM_BondArray_set
(
OpenMM_BondArray
*
,
int
i
,
int
p1
,
int
p2
);
/* OpenMM_String */
extern
OpenMM_String
*
OpenMM_String_create
(
const
char
*
init
);
extern
void
OpenMM_String_destroy
(
OpenMM_String
*
);
extern
int
OpenMM_String_length
(
const
OpenMM_String
*
);
extern
const
char
*
OpenMM_String_getAsC
(
const
OpenMM_String
*
);
extern
void
OpenMM_String_get
(
const
OpenMM_String
*
,
char
*
buf
,
int
buflen
);
extern
void
OpenMM_String_set
(
OpenMM_String
*
,
const
char
*
buf
);
/* OpenMM::Platform */
extern
void
OpenMM_Platform_loadPluginsFromDirectory
(
const
char
*
);
extern
const
char
*
OpenMM_Platform_getDefaultPluginsDirectory
();
/* OpenMM::System */
extern
OpenMM_System
*
OpenMM_System_create
();
extern
void
OpenMM_System_destroy
(
OpenMM_System
*
);
extern
int
OpenMM_System_addParticle
(
OpenMM_System
*
,
double
mass
);
extern
void
OpenMM_System_setParticleMass
(
OpenMM_System
*
,
int
ix
,
double
mass
);
extern
double
OpenMM_System_getParticleMass
(
const
OpenMM_System
*
,
int
ix
);
extern
int
OpenMM_System_addConstraint
(
OpenMM_System
*
,
int
p1
,
int
p2
,
double
distance
);
extern
void
OpenMM_System_setConstraintParameters
(
OpenMM_System
*
,
int
ix
,
int
p1
,
int
p2
,
double
distance
);
extern
void
OpenMM_System_getConstraintParameters
(
const
OpenMM_System
*
,
int
ix
,
int
*
p1
,
int
*
p2
,
double
*
distance
);
extern
int
OpenMM_System_addForce
(
OpenMM_System
*
,
OpenMM_Force
*
);
extern
OpenMM_Force
*
OpenMM_System_updForce
(
OpenMM_System
*
,
int
ix
);
extern
const
OpenMM_Force
*
OpenMM_System_getForce
(
const
OpenMM_System
*
,
int
ix
);
extern
int
OpenMM_System_getNumParticles
(
const
OpenMM_System
*
);
extern
int
OpenMM_System_getNumConstraints
(
const
OpenMM_System
*
);
extern
int
OpenMM_System_getNumForces
(
const
OpenMM_System
*
);
/* OpenMM::NonbondedForce */
extern
OpenMM_NonbondedForce
*
OpenMM_NonbondedForce_create
();
extern
void
OpenMM_NonbondedForce_destroy
(
OpenMM_NonbondedForce
*
);
extern
void
OpenMM_NonbondedForce_setNonbondedMethod
(
OpenMM_NonbondedForce
*
,
OpenMM_NonbondedForce_NonbondedMethod
);
extern
OpenMM_NonbondedForce_NonbondedMethod
OpenMM_NonbondedForce_getNonbondedMethod
(
const
OpenMM_NonbondedForce
*
);
extern
void
OpenMM_NonbondedForce_setCutoffDistance
(
OpenMM_NonbondedForce
*
,
double
);
extern
double
OpenMM_NonbondedForce_getCutoffDistance
(
const
OpenMM_NonbondedForce
*
);
extern
void
OpenMM_NonbondedForce_setPeriodicBoxVectors
(
OpenMM_NonbondedForce
*
,
const
OpenMM_Vec3
,
const
OpenMM_Vec3
,
const
OpenMM_Vec3
);
extern
void
OpenMM_NonbondedForce_getPeriodicBoxVectors
(
const
OpenMM_NonbondedForce
*
,
OpenMM_Vec3
,
OpenMM_Vec3
,
OpenMM_Vec3
);
extern
int
OpenMM_NonbondedForce_addParticle
(
OpenMM_NonbondedForce
*
,
double
charge
,
double
sigmaInNm
,
double
vdwEnergyInKJ
);
extern
void
OpenMM_NonbondedForce_setParticleParameters
(
OpenMM_NonbondedForce
*
,
int
index
,
double
charge
,
double
sigmaInNm
,
double
vdwEnergyInKJ
);
extern
void
OpenMM_NonbondedForce_getParticleParameters
(
const
OpenMM_NonbondedForce
*
,
int
index
,
double
*
charge
,
double
*
sigmaInNm
,
double
*
vdwEnergyInKJ
);
extern
int
OpenMM_NonbondedForce_getNumParticles
(
const
OpenMM_NonbondedForce
*
);
extern
int
OpenMM_NonbondedForce_getNumExceptions
(
const
OpenMM_NonbondedForce
*
);
extern
int
OpenMM_NonbondedForce_addException
(
OpenMM_NonbondedForce
*
,
int
p1
,
int
p2
,
double
chargeProd
,
double
sigma
,
double
epsilon
);
extern
void
OpenMM_NonbondedForce_getExceptionParameters
(
const
OpenMM_NonbondedForce
*
,
int
index
,
int
*
p1
,
int
*
p2
,
double
*
chargeProd
,
double
*
sigma
,
double
*
epsilon
);
extern
void
OpenMM_NonbondedForce_setExceptionParameters
(
OpenMM_NonbondedForce
*
,
int
index
,
int
p1
,
int
p2
,
double
chargeProd
,
double
sigma
,
double
epsilon
);
extern
void
OpenMM_NonbondedForces_createExceptionsFromBonds
(
OpenMM_NonbondedForce
*
,
const
OpenMM_BondArray
*
,
double
coulomb14Scale
,
double
lj14Scale
);
/* OpenMM::GBSAOBCForce */
extern
OpenMM_GBSAOBCForce
*
OpenMM_GBSAOBCForce_create
();
extern
void
OpenMM_GBSAOBCForce_destroy
(
OpenMM_GBSAOBCForce
*
);
extern
void
OpenMM_GBSAOBCForce_setSolventDielectric
(
OpenMM_GBSAOBCForce
*
,
double
);
extern
void
OpenMM_GBSAOBCForce_setSoluteDielectric
(
OpenMM_GBSAOBCForce
*
,
double
);
extern
int
OpenMM_GBSAOBCForce_addParticle
(
OpenMM_GBSAOBCForce
*
,
double
charge
,
double
radiusInNm
,
double
scalingFactor
);
/* OpenMM::HarmonicBondForce */
extern
OpenMM_HarmonicBondForce
*
OpenMM_HarmonicBondForce_create
();
extern
void
OpenMM_HarmonicBondForce_destroy
(
OpenMM_HarmonicBondForce
*
);
extern
int
OpenMM_HarmonicBondForce_getNumBonds
(
const
OpenMM_HarmonicBondForce
*
);
extern
int
OpenMM_HarmonicBondForce_addBond
(
OpenMM_HarmonicBondForce
*
,
int
p1
,
int
p2
,
double
len
,
double
k
);
extern
void
OpenMM_HarmonicBondForce_getBondParameters
(
const
OpenMM_HarmonicBondForce
*
,
int
ix
,
int
*
p1
,
int
*
p2
,
double
*
len
,
double
*
k
);
extern
void
OpenMM_HarmonicBondForce_setBondParameters
(
OpenMM_HarmonicBondForce
*
,
int
ix
,
int
p1
,
int
p2
,
double
len
,
double
k
);
/* OpenMM::HarmonicAngleForce */
extern
OpenMM_HarmonicAngleForce
*
OpenMM_HarmonicAngleForce_create
();
extern
void
OpenMM_HarmonicAngleForce_destroy
(
OpenMM_HarmonicAngleForce
*
);
extern
int
OpenMM_HarmonicAngleForce_getNumAngles
(
const
OpenMM_HarmonicAngleForce
*
);
extern
int
OpenMM_HarmonicAngleForce_addAngle
(
OpenMM_HarmonicAngleForce
*
,
int
p1
,
int
p2
,
int
p3
,
double
angle
,
double
k
);
extern
void
OpenMM_HarmonicAngleForce_getAngleParameters
(
const
OpenMM_HarmonicAngleForce
*
,
int
ix
,
int
*
p1
,
int
*
p2
,
int
*
p3
,
double
*
angle
,
double
*
k
);
extern
void
OpenMM_HarmonicAngleForce_setAngleParameters
(
OpenMM_HarmonicAngleForce
*
,
int
ix
,
int
p1
,
int
p2
,
int
p3
,
double
angle
,
double
k
);
/* OpenMM::PeriodicTorsionForce */
extern
OpenMM_PeriodicTorsionForce
*
OpenMM_PeriodicTorsionForce_create
();
extern
void
OpenMM_PeriodicTorsionForce_destroy
(
OpenMM_PeriodicTorsionForce
*
);
extern
int
OpenMM_PeriodicTorsionForce_getNumTorsions
(
const
OpenMM_PeriodicTorsionForce
*
);
extern
int
OpenMM_PeriodicTorsionForce_addTorsion
(
OpenMM_PeriodicTorsionForce
*
,
int
p1
,
int
p2
,
int
p3
,
int
p4
,
int
periodicity
,
double
phase
,
double
k
);
extern
void
OpenMM_PeriodicTorsionForce_getTorsionParameters
(
const
OpenMM_PeriodicTorsionForce
*
,
int
ix
,
int
*
p1
,
int
*
p2
,
int
*
p3
,
int
*
p4
,
int
*
periodicity
,
double
*
phase
,
double
*
k
);
extern
void
OpenMM_PeriodicTorsionForce_setTorsionParameters
(
OpenMM_PeriodicTorsionForce
*
,
int
ix
,
int
p1
,
int
p2
,
int
p3
,
int
p4
,
int
periodicity
,
double
phase
,
double
k
);
/* OpenMM::AndersenThermostat */
extern
OpenMM_AndersenThermostat
*
OpenMM_AndersenThermostat_create
(
double
temp
,
double
collisionFreqInPerPs
);
extern
void
OpenMM_AndersenThermostat_destroy
(
OpenMM_AndersenThermostat
*
);
extern
double
OpenMM_AndersenThermostat_getDefaultTemperature
(
const
OpenMM_AndersenThermostat
*
);
extern
double
OpenMM_AndersenThermostat_getDefaultCollisionFrequency
(
const
OpenMM_AndersenThermostat
*
);
extern
int
OpenMM_AndersenThermostat_getRandomNumberSeed
(
const
OpenMM_AndersenThermostat
*
);
extern
void
OpenMM_AndersenThermostat_setRandomNumberSeed
(
OpenMM_AndersenThermostat
*
,
int
seed
);
/* OpenMM::Integrator */
extern
void
OpenMM_Integrator_step
(
OpenMM_Integrator
*
,
int
numSteps
);
extern
void
OpenMM_Integrator_destroy
(
OpenMM_Integrator
*
);
/* OpenMM::VerletIntegrator */
extern
OpenMM_VerletIntegrator
*
OpenMM_VerletIntegrator_create
(
double
stepSzInPs
);
extern
void
OpenMM_VerletIntegrator_destroy
(
OpenMM_VerletIntegrator
*
);
extern
void
OpenMM_VerletIntegrator_step
(
OpenMM_VerletIntegrator
*
,
int
numSteps
);
/* OpenMM::LangevinIntegrator */
extern
OpenMM_LangevinIntegrator
*
OpenMM_LangevinIntegrator_create
(
double
temperature
,
double
frictionInPerPs
,
double
stepSzInPs
);
extern
void
OpenMM_LangevinIntegrator_destroy
(
OpenMM_LangevinIntegrator
*
);
extern
void
OpenMM_LangevinIntegrator_step
(
OpenMM_LangevinIntegrator
*
,
int
numSteps
);
/* OpenMM::Context */
extern
OpenMM_Context
*
OpenMM_Context_create
(
OpenMM_System
*
,
OpenMM_Integrator
*
);
extern
void
OpenMM_Context_destroy
(
OpenMM_Context
*
);
extern
void
OpenMM_Context_setPositions
(
OpenMM_Context
*
,
const
OpenMM_Vec3Array
*
);
extern
void
OpenMM_Context_setVelocities
(
OpenMM_Context
*
,
const
OpenMM_Vec3Array
*
);
extern
OpenMM_State
*
OpenMM_Context_createState
(
const
OpenMM_Context
*
,
int
types
);
extern
const
char
*
OpenMM_Context_getPlatformName
(
const
OpenMM_Context
*
);
/* OpenMM::State */
extern
void
OpenMM_State_destroy
(
OpenMM_State
*
);
extern
double
OpenMM_State_getTime
(
const
OpenMM_State
*
);
extern
double
OpenMM_State_getPotentialEnergy
(
const
OpenMM_State
*
);
extern
double
OpenMM_State_getKineticEnergy
(
const
OpenMM_State
*
);
extern
const
OpenMM_Vec3Array
*
OpenMM_State_getPositions
(
const
OpenMM_State
*
);
extern
const
OpenMM_Vec3Array
*
OpenMM_State_getVelocities
(
const
OpenMM_State
*
);
/* OpenMM_Runtime_Objects */
extern
OpenMM_RuntimeObjects
*
OpenMM_RuntimeObjects_create
();
extern
void
OpenMM_RuntimeObjects_clear
(
OpenMM_RuntimeObjects
*
);
extern
void
OpenMM_RuntimeObjects_destroy
(
OpenMM_RuntimeObjects
*
);
extern
void
OpenMM_RuntimeObjects_setSystem
(
OpenMM_RuntimeObjects
*
,
OpenMM_System
*
);
extern
void
OpenMM_RuntimeObjects_setIntegrator
(
OpenMM_RuntimeObjects
*
,
OpenMM_Integrator
*
);
extern
void
OpenMM_RuntimeObjects_setContext
(
OpenMM_RuntimeObjects
*
,
OpenMM_Context
*
);
extern
OpenMM_System
*
OpenMM_RuntimeObjects_getSystem
(
OpenMM_RuntimeObjects
*
);
extern
OpenMM_Integrator
*
OpenMM_RuntimeObjects_getIntegrator
(
OpenMM_RuntimeObjects
*
);
extern
OpenMM_Context
*
OpenMM_RuntimeObjects_getContext
(
OpenMM_RuntimeObjects
*
);
#if defined(__cplusplus)
}
#endif
#endif
/*OPENMM_CWRAPPER_H_*/
examples/OpenMM_Module.f90
deleted
100644 → 0
View file @
9438fa83
! -----------------------------------------------------------------------------
! OpenMM(tm) PROTOTYPE Fortran 95 Interface (June 2009)
! -----------------------------------------------------------------------------
! This is a Fortran 95 interface module providing access to the OpenMM API
! which is written in C++. At link time this module requires that the OpenMM
! C wrapper library (or object file) is available since that provides a
! simplified Fortran-style set of access methods that can be described
! adequately here without using any Fortran 2003 features.
!
! This is experimental and is not part of the OpenMM release. Improvements in
! substance and style would be greatly appreciated. If you have ideas (or
! better code) please post to the OpenMM forum on simtk.org/home/openmm or
! if you're shy you can email Michael Sherman at msherman@stanford.edu.
!
! Below we define two modules
! OpenMM_Types
! OpenMM
! Only "use OpenMM" need be included in Fortran program units since
! that modules includes the other one.
! -----------------------------------------------------------------------------
! We use defined types containing opaque pointers as a way of getting
! a modicum of type safety without having to expose any of the OpenMM
! data structures here. You never have to do anything with those
! pointers to deal with these objects; they get created by the API
! for you and you just pass them back to the API when you want to
! do something with them. We use integer*8 to hold the pointers
! since that is big enough to work on any machine; we don't
! necessarily use the whole thing. If you are working in Fortran 77
! (which doesn't have "type" declarations) you can simply use
! an integer*8 instead; you won't get the type checking provided
! here but it will still work.
!
! We are also making the assumption here that a C "int" is seen from
! Fortran as an integer*4 (32 bit integer) and that a C double is
! a real*8 (64 bit real). That is correct for all the systems we've
! tried; if it isn't on yours you'll need to make some changes.
MODULE
OpenMM_Types
implicit
none
! The System, Integrator, and Context must persist between calls.
! They can be conveniently grouped in a RuntimeObjects structure.
type
OpenMM_System
integer
*
8
::
handle
=
0
end
type
! This is the generic Integrator type; it represents one of
! the concrete integrators like Verlet or Langevin.
type
OpenMM_Integrator
integer
*
8
::
handle
=
0
end
type
! A Context connects a System and an Integrator and manages
! the run-time State.
type
OpenMM_Context
integer
*
8
::
handle
=
0
end
type
! This data structure can be used to hold the set of OpenMM objects
! that must persist from call to call while running a simulation.
! It contains an OpenMM_System, _Integrator, and _Context.
type
OpenMM_RuntimeObjects
integer
*
8
::
handle
=
0
end
type
type
OpenMM_State
integer
*
8
::
handle
=
0
end
type
type
OpenMM_Vec3Array
integer
*
8
::
handle
=
0
end
type
type
OpenMM_BondArray
integer
*
8
::
handle
=
0
end
type
type
OpenMM_String
integer
*
8
::
handle
=
0
end
type
! This is the generic Force type.
type
OpenMM_Force
integer
*
8
::
handle
=
0
end
type
type
OpenMM_NonbondedForce
integer
*
8
::
handle
=
0
end
type
type
OpenMM_GBSAOBCForce
integer
*
8
::
handle
=
0
end
type
type
OpenMM_HarmonicBondForce
integer
*
8
::
handle
=
0
end
type
type
OpenMM_HarmonicAngleForce
integer
*
8
::
handle
=
0
end
type
type
OpenMM_PeriodicTorsionForce
integer
*
8
::
handle
=
0
end
type
type
OpenMM_AndersenThermostat
integer
*
8
::
handle
=
0
end
type
type
OpenMM_VerletIntegrator
integer
*
8
::
handle
=
0
end
type
type
OpenMM_LangevinIntegrator
integer
*
8
::
handle
=
0
end
type
! OpenMM::State enumerations
integer
*
4
OpenMM_State_Positions
,
OpenMM_State_Velocities
integer
*
4
OpenMM_State_Forces
,
OpenMM_State_Energy
integer
*
4
OpenMM_State_Parameters
parameter
(
OpenMM_State_Positions
=
1
,
OpenMM_State_Velocities
=
2
)
parameter
(
OpenMM_State_Forces
=
4
,
OpenMM_State_Energy
=
8
)
parameter
(
OpenMM_State_Parameters
=
16
)
!OpenMM::NonbondedForce enumerations
integer
*
4
OpenMM_NonbondedForce_NoCutoff
,
OpenMM_NonbondedForce_CutoffNonPeriodic
integer
*
4
OpenMM_NonbondedForce_CutoffPeriodic
,
OpenMM_NonbondedForce_Ewald
parameter
(
OpenMM_NonbondedForce_NoCutoff
=
0
,
OpenMM_NonbondedForce_CutoffNonPeriodic
=
1
)
parameter
(
OpenMM_NonbondedForce_CutoffPeriodic
=
2
,
OpenMM_NonbondedForce_Ewald
=
3
)
!OpenMM units conversion constants
real
*
8
OpenMM_NmPerAngstrom
,
OpenMM_AngstromsPerNm
,
OpenMM_PsPerFs
,
OpenMM_FsPerPs
real
*
8
OpenMM_KJPerKcal
,
OpenMM_KcalPerKJ
,
OpenMM_RadiansPerDegree
,
OpenMM_DegreesPerRadian
real
*
8
OpenMM_SigmaPerVdwRadius
parameter
(
OpenMM_NmPerAngstrom
=
0.1d0
,
OpenMM_AngstromsPerNm
=
10d0
)
parameter
(
OpenMM_PsPerFs
=
0.001d0
,
OpenMM_FsPerPs
=
1000d0
)
parameter
(
OpenMM_KJPerKcal
=
4.184d0
,
OpenMM_KcalPerKJ
=
1d0
/
4.184d0
)
parameter
(
OpenMM_RadiansPerDegree
=
3.1415926535897932385d0
/
180d0
)
parameter
(
OpenMM_DegreesPerRadian
=
180d0
/
3.1415926535897932385d0
)
parameter
(
OpenMM_SigmaPerVdwRadius
=
1.78179743628068d0
)
END
MODULE
OpenMM_Types
MODULE
OpenMM
use
OpenMM_Types
;
implicit
none
interface
! -------------------------
! OpenMM::Vec3Array
! -------------------------
! OpenMM_Vec3Array is an interface to the std::vector<Vec3>
! arrays used in various contexts by OpenMM. It is not the
! same as a Fortran array of Vec3s would be.
! You can create this with zero elements and then
! append to it and it will grow as needed.
subroutine
OpenMM_Vec3Array_create
(
array
,
n
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
array
integer
*
4
n
end
function
OpenMM_Vec3Array_size
(
array
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
array
integer
*
4
OpenMM_Vec3Array_size
end
subroutine
OpenMM_Vec3Array_resize
(
array
,
n
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
array
integer
*
4
n
end
subroutine
OpenMM_Vec3Array_destroy
(
array
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
array
end
subroutine
OpenMM_Vec3Array_append
(
array
,
v3
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
array
real
*
8
v3
(
3
)
end
subroutine
OpenMM_Vec3Array_get
(
array
,
i
,
v3
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
array
integer
*
4
i
real
*
8
,
intent
(
out
)
::
v3
(
3
)
end
subroutine
OpenMM_Vec3Array_getScaled
(
array
,
i
,
s
,
v3
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
array
integer
*
4
i
real
*
8
s
real
*
8
,
intent
(
out
)
::
v3
(
3
)
end
subroutine
OpenMM_Vec3Array_set
(
array
,
i
,
v3
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
array
integer
*
4
i
real
*
8
,
intent
(
in
)
::
v3
(
3
)
end
subroutine
OpenMM_Vec3Array_setScaled
(
array
,
i
,
v3
,
s
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Vec3Array
)
array
integer
*
4
i
real
*
8
,
intent
(
in
)
::
v3
(
3
)
real
*
8
s
end
subroutine
OpenMM_Vec3_scale
(
v3in
,
s
,
v3out
)
real
*
8
,
intent
(
in
)
::
v3in
(
3
)
real
*
8
s
real
*
8
,
intent
(
out
)
::
v3out
(
3
)
end
! -------------------------
! OpenMM::BondArray
! -------------------------
! OpenMM_BondArray is an interface to the
! std::vector<std::pair<int,int>> arrays used for
! bond lists by OpenMM. It is not the
! same as a Fortran array of integer(2)'s would be.
! You can create this with zero elements and then
! append to it and it will grow as needed.
subroutine
OpenMM_BondArray_create
(
array
,
n
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BondArray
)
array
integer
*
4
n
end
function
OpenMM_BondArray_size
(
array
)
use
OpenMM_Types
;
implicit
none
integer
*
4
OpenMM_BondArray_size
type
(
OpenMM_BondArray
)
array
end
subroutine
OpenMM_BondArray_resize
(
array
,
n
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BondArray
)
array
integer
*
4
n
end
subroutine
OpenMM_BondArray_destroy
(
array
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BondArray
)
array
end
subroutine
OpenMM_BondArray_append
(
array
,
p1
,
p2
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BondArray
)
array
integer
*
4
p1
,
p2
end
subroutine
OpenMM_BondArray_get
(
array
,
i
,
p1
,
p2
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BondArray
)
array
integer
*
4
i
,
p1
,
p2
end
subroutine
OpenMM_BondArray_set
(
array
,
i
,
p1
,
p2
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_BondArray
)
array
integer
*
4
i
,
p1
,
p2
end
! -------------------------
! OpenMM::String
! -------------------------
! OpenMM_String is an interface to std::string, with some
! crude ability to copy from and out to fixed-size Fortran
! character arrays (with blank padding).
subroutine
OpenMM_String_create
(
string
,
initVal
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_String
)
string
character
(
*
)
initVal
end
subroutine
OpenMM_String_destroy
(
string
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_String
)
string
end
function
OpenMM_String_length
(
string
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_String
)
string
integer
*
4
OpenMM_String_length
end
subroutine
OpenMM_String_get
(
string
,
fstring
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_String
)
string
character
(
*
)
fstring
end
subroutine
OpenMM_String_set
(
string
,
fstring
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_String
)
string
character
(
*
)
fstring
end
! -------------------------
! OpenMM::Platform
! -------------------------
subroutine
OpenMM_Platform_loadPluginsFromDirectory
(
dirName
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_String
)
dirName
end
subroutine
OpenMM_Platform_getDefaultPluginsDirectory
(
dirName
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_String
)
dirName
end
! -------------------------
! OpenMM::System
! -------------------------
subroutine
OpenMM_System_create
(
system
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
end
subroutine
OpenMM_System_destroy
(
system
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
end
! Returns the particle index in case you want it.
function
OpenMM_System_addParticle
(
system
,
mass
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
real
*
8
mass
integer
*
4
OpenMM_System_addParticle
end
subroutine
OpenMM_System_setParticleMass
(
system
,
ix
,
mass
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
integer
*
4
ix
! particle index
real
*
8
mass
end
function
OpenMM_System_getParticleMass
(
system
,
ix
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
integer
*
4
ix
! particle index
real
*
8
OpenMM_System_getParticleMass
end
! Returns the constraint index in case you want it.
function
OpenMM_System_addConstraint
(
system
,
p1
,
p2
,
distance
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
integer
*
4
p1
,
p2
real
*
8
distance
integer
*
4
OpenMM_System_addConstraint
end
subroutine
OpenMM_System_setConstraintParameters
(
system
,
ix
,
p1
,
p2
,
distance
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
integer
*
4
ix
,
p1
,
p2
real
*
8
distance
end
subroutine
OpenMM_System_getConstraintParameters
(
system
,
ix
,
p1
,
p2
,
distance
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
integer
*
4
ix
,
p1
,
p2
real
*
8
distance
end
! Returns the force index in case you want it.
function
OpenMM_System_addForce
(
system
,
force
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
type
(
OpenMM_Force
)
force
integer
*
4
OpenMM_System_addForce
end
! Fortran doesn't distinguish between writable and const objects but
! we'll support both the "get" and "update" calls so it is clear what
! is intended.
subroutine
OpenMM_System_updForce
(
system
,
ix
,
force
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
integer
*
4
ix
! force index
type
(
OpenMM_Force
)
force
end
subroutine
OpenMM_System_getForce
(
system
,
ix
,
force
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
integer
*
4
ix
! force index
type
(
OpenMM_Force
)
force
end
function
OpenMM_System_getNumParticles
(
system
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
integer
*
4
OpenMM_System_getNumParticles
end
function
OpenMM_System_getNumConstraints
(
system
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
integer
*
4
OpenMM_System_getNumConstraints
end
function
OpenMM_System_getNumForces
(
system
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_System
)
system
integer
*
4
OpenMM_System_getNumForces
end
! -------------------------
! OpenMM::NonbondedForce
! -------------------------
subroutine
OpenMM_NonbondedForce_create
(
nonbond
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
end
subroutine
OpenMM_NonbondedForce_destroy
(
nonbond
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
end
! This takes a NonbondedForce handle and recasts it to a generic
! Force handle. This is only a type change; the returned Force
! handle refers to the same NonbondedForce object as the input.
! You can accomplish the same thing with Fortran 95's "transfer"
! intrinsic function.
subroutine
OpenMM_NonbondedForce_asForce
(
nonbond
,
force
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
type
(
OpenMM_Force
)
force
end
subroutine
OpenMM_NonbondedForce_setNonbondedMethod
(
nonbond
,
method
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
integer
*
4
method
end
function
OpenMM_NonbondedForce_getNonbondedMethod
(
nonbond
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
integer
*
4
OpenMM_NonbondedForce_getNonbondedMethod
end
subroutine
OpenMM_NonbondedForce_setCutoffDistance
(
nonbond
,
distanceInNm
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
real
*
8
,
intent
(
in
)
::
distanceInNm
end
function
OpenMM_NonbondedForce_getCutoffDistance
(
nonbond
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
real
*
8
OpenMM_NonbondedForce_getCutoffDistance
end
subroutine
OpenMM_NonbondedForce_setPeriodicBoxVectors
(
nonbond
,
a
,
b
,
c
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
real
*
8
a
(
3
),
b
(
3
),
c
(
3
)
end
subroutine
OpenMM_NonbondedForce_getPeriodicBoxVectors
(
nonbond
,
a
,
b
,
c
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
real
*
8
a
(
3
),
b
(
3
),
c
(
3
)
end
! Returns the assigned particle index.
function
OpenMM_NonbondedForce_addParticle
&
(
nonbond
,
charge
,
sigmaInNm
,
vdwEnergyInKJ
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
real
*
8
charge
,
sigmaInNm
,
vdwEnergyInKJ
integer
*
4
OpenMM_NonbondedForce_addParticle
end
subroutine
OpenMM_NonbondedForce_setParticleParameters
&
(
nonbond
,
ix
,
charge
,
sigmaInNm
,
vdwEnergyInKJ
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
integer
*
4
ix
real
*
8
charge
,
sigmaInNm
,
vdwEnergyInKJ
end
subroutine
OpenMM_NonbondedForce_getParticleParameters
&
(
nonbond
,
ix
,
charge
,
sigmaInNm
,
vdwEnergyInKJ
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
integer
*
4
ix
real
*
8
charge
,
sigmaInNm
,
vdwEnergyInKJ
end
function
OpenMM_NonbondedForce_getNumParticles
(
nonbond
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
integer
*
4
OpenMM_NonbondedForce_getNumParticles
end
function
OpenMM_NonbondedForce_getNumExceptions
(
nonbond
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
integer
*
4
OpenMM_NonbondedForce_getNumExceptions
end
! Returns the assigned exception index.
function
OpenMM_NonbondedForce_addException
&
(
nonbond
,
p1
,
p2
,
chargeProd
,
sigmaInNm
,
vdwEnergyInKJ
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
integer
*
4
p1
,
p2
real
*
8
chargeProd
,
sigmaInNm
,
vdwEnergyInKJ
integer
*
4
OpenMM_NonbondedForce_addException
end
subroutine
OpenMM_NonbondedForce_setExceptionParameters
&
(
nonbond
,
ix
,
p1
,
p2
,
chargeProd
,
sigmaInNm
,
vdwEnergyInKJ
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
integer
*
4
ix
,
p1
,
p2
real
*
8
chargeProd
,
sigmaInNm
,
vdwEnergyInKJ
end
subroutine
OpenMM_NonbondedForce_getExceptionParameters
&
(
nonbond
,
ix
,
p1
,
p2
,
chargeProd
,
sigmaInNm
,
vdwEnergyInKJ
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
integer
*
4
ix
,
p1
,
p2
real
*
8
chargeProd
,
sigmaInNm
,
vdwEnergyInKJ
end
subroutine
OpenMM_NonbondedForce_createExceptionsFromBonds
&
(
nonbond
,
bonds
,
coulomb14Scale
,
lj14Scale
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_NonbondedForce
)
nonbond
type
(
OpenMM_BondArray
)
bonds
real
*
8
coulomb14Scale
,
lj14Scale
end
! -------------------------
! OpenMM::GBSAOBCForce
! -------------------------
subroutine
OpenMM_GBSAOBCForce_create
(
gbsa
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
gbsa
end
subroutine
OpenMM_GBSAOBCForce_destroy
(
gbsa
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
gbsa
end
! This takes a GBSAOBCForce handle and recasts it to a generic
! Force handle. This is only a type change; the returned Force
! handle refers to the same GBSAOBCForce object as the input.
! You can accomplish the same thing with Fortran 95's "transfer"
! intrinsic function.
subroutine
OpenMM_GBSAOBCForce_asForce
(
gbsa
,
force
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
gbsa
type
(
OpenMM_Force
)
force
end
subroutine
OpenMM_GBSAOBCForce_setSolventDielectric
(
gbsa
,
d
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
gbsa
real
*
8
d
end
subroutine
OpenMM_GBSAOBCForce_setSoluteDielectric
(
gbsa
,
d
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
gbsa
real
*
8
d
end
! Returns the assigned particle index in case you want it.
function
OpenMM_GBSAOBCForce_addParticle
&
(
gbsa
,
charge
,
radiusInNm
,
scalingFactor
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_GBSAOBCForce
)
gbsa
real
*
8
charge
,
radiusInNm
,
scalingFactor
integer
*
4
OpenMM_GBSAOBCForce_addParticle
end
! -------------------------
! OpenMM::HarmonicBondForce
! -------------------------
subroutine
OpenMM_HarmonicBondForce_create
(
hbf
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
hbf
end
subroutine
OpenMM_HarmonicBondForce_destroy
(
hbf
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
hbf
end
! This takes a HarmonicBondForce handle and recasts it to a generic
! Force handle. This is only a type change; the returned Force
! handle refers to the same HarmonicBondForce object as the input.
! You can accomplish the same thing with Fortran 95's "transfer"
! intrinsic function.
subroutine
OpenMM_HarmonicBondForce_asForce
(
hbf
,
force
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
hbf
type
(
OpenMM_Force
)
force
end
function
OpenMM_HarmonicBondForce_getNumBonds
(
hbf
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
hbf
integer
*
4
OpenMM_HarmonicBondForce_getNumBonds
end
! Returns bond index in case you want it.
function
OpenMM_HarmonicBondForce_addBond
(
hbf
,
p1
,
p2
,
length
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
hbf
integer
*
4
p1
,
p2
real
*
8
length
,
k
integer
*
4
OpenMM_HarmonicBondForce_addBond
end
subroutine
OpenMM_HarmonicBondForce_setBondParameters
(
hbf
,
ix
,
p1
,
p2
,
length
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
hbf
integer
*
4
ix
,
p1
,
p2
real
*
8
length
,
k
end
subroutine
OpenMM_HarmonicBondForce_getBondParameters
(
hbf
,
ix
,
p1
,
p2
,
length
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicBondForce
)
hbf
integer
*
4
ix
,
p1
,
p2
real
*
8
length
,
k
end
! --------------------------
! OpenMM::HarmonicAngleForce
! --------------------------
subroutine
OpenMM_HarmonicAngleForce_create
(
hbf
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
hbf
end
subroutine
OpenMM_HarmonicAngleForce_destroy
(
hbf
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
hbf
end
! This takes a HarmonicAngleForce handle and recasts it to a generic
! Force handle. This is only a type change; the returned Force
! handle refers to the same HarmonicAngleForce object as the input.
! You can accomplish the same thing with Fortran 95's "transfer"
! intrinsic function.
subroutine
OpenMM_HarmonicAngleForce_asForce
(
hbf
,
force
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
hbf
type
(
OpenMM_Force
)
force
end
function
OpenMM_HarmonicAngleForce_getNumAngles
(
hbf
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
hbf
integer
*
4
OpenMM_HarmonicAngleForce_getNumAngles
end
! Returns angle index in case you want it.
function
OpenMM_HarmonicAngleForce_addAngle
(
hbf
,
p1
,
p2
,
p3
,
angle
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
hbf
integer
*
4
OpenMM_HarmonicAngleForce_addAngle
integer
*
4
p1
,
p2
,
p3
real
*
8
angle
,
k
end
subroutine
OpenMM_HarmonicAngleForce_setAngleParameters
&
(
hbf
,
ix
,
p1
,
p2
,
p3
,
angle
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
hbf
integer
*
4
ix
,
p1
,
p2
,
p3
real
*
8
angle
,
k
end
subroutine
OpenMM_HarmonicAngleForce_getAngleParameters
&
(
hbf
,
ix
,
p1
,
p2
,
p3
,
angle
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_HarmonicAngleForce
)
hbf
integer
*
4
ix
,
p1
,
p2
,
p3
real
*
8
angle
,
k
end
! ----------------------------
! OpenMM::PeriodicTorsionForce
! ----------------------------
subroutine
OpenMM_PeriodicTorsionForce_create
(
hbf
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
hbf
end
subroutine
OpenMM_PeriodicTorsionForce_destroy
(
hbf
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
hbf
end
! This takes a PeriodicTorsionForce handle and recasts it to a generic
! Force handle. This is only a type change; the returned Force
! handle refers to the same PeriodicTorsionForce object as the input.
! You can accomplish the same thing with Fortran 95's "transfer"
! intrinsic function.
subroutine
OpenMM_PeriodicTorsionForce_asForce
(
hbf
,
force
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
hbf
type
(
OpenMM_Force
)
force
end
function
OpenMM_PeriodicTorsionForce_getNumTorsions
(
hbf
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
hbf
integer
*
4
OpenMM_PeriodicTorsionForce_getNumTorsions
end
! Returns torsion index in case you want it.
function
OpenMM_PeriodicTorsionForce_addTorsion
&
(
hbf
,
p1
,
p2
,
p3
,
p4
,
periodicity
,
phase
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
hbf
integer
*
4
OpenMM_PeriodicTorsionForce_addTorsion
integer
*
4
p1
,
p2
,
p3
,
p4
,
periodicity
real
*
8
phase
,
k
end
subroutine
OpenMM_PeriodicTorsionForce_setTorsionParameters
&
(
hbf
,
ix
,
p1
,
p2
,
p3
,
p4
,
periodicity
,
phase
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
hbf
integer
*
4
ix
,
p1
,
p2
,
p3
,
p4
,
periodicity
real
*
8
phase
,
k
end
subroutine
OpenMM_PeriodicTorsionForce_getTorsionParameters
&
(
hbf
,
ix
,
p1
,
p2
,
p3
,
p4
,
periodicity
,
phase
,
k
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_PeriodicTorsionForce
)
hbf
integer
*
4
ix
,
p1
,
p2
,
p3
,
p4
,
periodicity
real
*
8
phase
,
k
end
! --------------------------
! OpenMM::AndersenThermostat
! --------------------------
subroutine
OpenMM_AndersenThermostat_create
(
at
,
temp
,
freqInPerPs
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
at
real
*
8
temp
,
freqInPerPs
end
subroutine
OpenMM_AndersenThermostat_destroy
(
at
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
at
end
! This takes an AndersenThermostat handle and recasts it to a generic
! Force handle. This is only a type change; the returned Force
! handle refers to the same AndersenThermostat object as the input.
! You can accomplish the same thing with Fortran 95's "transfer"
! intrinsic function.
subroutine
OpenMM_AndersenThermostat_asForce
(
at
,
force
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
at
type
(
OpenMM_Force
)
force
end
function
OpenMM_AndersenThermostat_getDefaultTemperature
(
at
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
at
real
*
8
OpenMM_AndersenThermostat_getDefaultTemperature
end
function
OpenMM_AndersenThermostat_getDefaultCollisionFrequency
(
at
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
at
real
*
8
OpenMM_AndersenThermostat_getDefaultCollisionFrequency
end
function
OpenMM_AndersenThermostat_getRandomNumberSeed
(
at
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
at
integer
*
4
OpenMM_AndersenThermostat_getRandomNumberSeed
end
subroutine
OpenMM_AndersenThermostat_setRandomNumberSeed
(
at
,
seed
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_AndersenThermostat
)
at
integer
*
4
seed
end
! -------------------------
! OpenMM::Integrator
! -------------------------
subroutine
OpenMM_Integrator_step
(
integrator
,
numSteps
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Integrator
)
integrator
integer
*
4
numSteps
end
subroutine
OpenMM_Integrator_destroy
(
integrator
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Integrator
)
integrator
end
! -------------------------
! OpenMM::VerletIntegrator
! -------------------------
subroutine
OpenMM_VerletIntegrator_create
(
verlet
,
stepSzInPs
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VerletIntegrator
)
verlet
real
*
8
stepSzInPs
end
subroutine
OpenMM_VerletIntegrator_destroy
(
verlet
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VerletIntegrator
)
verlet
end
! This takes a VerletIntegrator handle and recasts it to a generic
! Integrator handle. This is only a type change; the returned Integrator
! handle refers to the same VerletIntegrator object as the input.
! You can accomplish the same thing with Fortran 95's "transfer"
! intrinsic function.
subroutine
OpenMM_VerletIntegrator_asIntegrator
(
verlet
,
integ
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VerletIntegrator
)
verlet
type
(
OpenMM_Integrator
)
integ
end
subroutine
OpenMM_VerletIntegrator_step
(
verlet
,
numSteps
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_VerletIntegrator
)
verlet
integer
*
4
numSteps
end
! -------------------------
! OpenMM::LangevinIntegrator
! -------------------------
subroutine
OpenMM_LangevinIntegrator_create
&
(
langevin
,
temperature
,
frictionInPerPs
,
stepSzInPs
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
langevin
real
*
8
temperature
,
frictionInPerPs
,
stepSzInPs
end
subroutine
OpenMM_LangevinIntegrator_destroy
(
langevin
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
langevin
end
! This takes a LangevinIntegrator handle and recasts it to a generic
! Integrator handle. This is only a type change; the returned Integrator
! handle refers to the same LangevinIntegrator object as the input.
! You can accomplish the same thing with Fortran 95's "transfer"
! intrinsic function.
subroutine
OpenMM_LangevinIntegrator_asIntegrator
(
langevin
,
integ
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
langevin
type
(
OpenMM_Integrator
)
integ
end
subroutine
OpenMM_LangevinIntegrator_step
(
langevin
,
numSteps
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_LangevinIntegrator
)
langevin
integer
*
4
numSteps
end
! -------------------------
! OpenMM::Context
! -------------------------
subroutine
OpenMM_Context_create
(
context
,
system
,
integrator
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
context
type
(
OpenMM_System
)
system
type
(
OpenMM_Integrator
)
integrator
end
subroutine
OpenMM_Context_destroy
(
context
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
context
end
subroutine
OpenMM_Context_setPositions
(
context
,
positions
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
context
type
(
OpenMM_Vec3Array
)
positions
end
subroutine
OpenMM_Context_setVelocities
(
context
,
velocities
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
context
type
(
OpenMM_Vec3Array
)
velocities
end
subroutine
OpenMM_Context_createState
(
context
,
types
,
state
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
context
integer
*
4
types
type
(
OpenMM_State
)
state
end
subroutine
OpenMM_Context_getPlatformName
(
context
,
platformName
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_Context
)
context
character
(
*
)
platformName
end
! -------------------------
! OpenMM::State
! -------------------------
subroutine
OpenMM_State_destroy
(
state
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
state
end
function
OpenMM_State_getTime
(
state
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
state
real
*
8
OpenMM_State_getTime
end
function
OpenMM_State_getPotentialEnergy
(
state
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
state
real
*
8
OpenMM_State_getPotentialEnergy
end
function
OpenMM_State_getKineticEnergy
(
state
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
state
real
*
8
OpenMM_State_getKineticEnergy
end
subroutine
OpenMM_State_getPositions
(
state
,
positions
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
state
type
(
OpenMM_Vec3Array
)
positions
end
subroutine
OpenMM_State_getVelocities
(
state
,
velocities
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_State
)
state
type
(
OpenMM_Vec3Array
)
velocities
end
! -------------------------
! OpenMM::RuntimeObjects
! -------------------------
subroutine
OpenMM_RuntimeObjects_create
(
omm
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RuntimeObjects
)
omm
end
subroutine
OpenMM_RuntimeObjects_clear
(
omm
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RuntimeObjects
)
omm
end
subroutine
OpenMM_RuntimeObjects_destroy
(
omm
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RuntimeObjects
)
omm
end
subroutine
OpenMM_RuntimeObjects_setSystem
(
omm
,
sys
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RuntimeObjects
)
omm
type
(
OpenMM_System
)
sys
end
subroutine
OpenMM_RuntimeObjects_setIntegrator
(
omm
,
integ
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RuntimeObjects
)
omm
type
(
OpenMM_Integrator
)
integ
end
subroutine
OpenMM_RuntimeObjects_setContext
(
omm
,
context
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RuntimeObjects
)
omm
type
(
OpenMM_Context
)
context
end
subroutine
OpenMM_RuntimeObjects_getSystem
(
omm
,
sys
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RuntimeObjects
)
omm
type
(
OpenMM_System
)
sys
end
subroutine
OpenMM_RuntimeObjects_getIntegrator
(
omm
,
integ
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RuntimeObjects
)
omm
type
(
OpenMM_Integrator
)
integ
end
subroutine
OpenMM_RuntimeObjects_getContext
(
omm
,
context
)
use
OpenMM_Types
;
implicit
none
type
(
OpenMM_RuntimeObjects
)
omm
type
(
OpenMM_Context
)
context
end
end
interface
END
MODULE
OpenMM
wrappers/CMakeLists.txt
View file @
bcbc4eec
...
...
@@ -19,7 +19,5 @@ ADD_CUSTOM_COMMAND(OUTPUT OpenMMFortranWrapper.cpp COMMAND ${JAVA_RUNTIME} -jar
ADD_CUSTOM_TARGET
(
ApiWrappers DEPENDS OpenMMCWrapper.h OpenMMCWrapper.cpp OpenMMFortranModule.f90 OpenMMFortranWrapper.cpp
)
ADD_DEPENDENCIES
(
${
SHARED_TARGET
}
ApiWrappers
)
ADD_DEPENDENCIES
(
${
STATIC_TARGET
}
ApiWrappers
)
INSTALL_FILES
(
/include FILES OpenMMCWrapper.h OpenMMFortranModule.f90
)
wrappers/CWrapper_Header.xslt
View file @
bcbc4eec
...
...
@@ -28,6 +28,10 @@
#ifndef OPENMM_CWRAPPER_H_
#define OPENMM_CWRAPPER_H_
#ifndef OPENMM_EXPORT
#define OPENMM_EXPORT
#endif
/* Global Constants */
<xsl:for-each
select=
"Variable[@context=$openmm_namespace_id]"
>
static
<xsl:call-template
name=
"wrap_type"
><xsl:with-param
name=
"type_id"
select=
"@type"
/></xsl:call-template><xsl:value-of
select=
"concat(' OpenMM_', @name, ' = ', number(@init), ';')"
/>
...
...
@@ -51,38 +55,38 @@ extern "C" {
#endif
/* OpenMM_Vec3 */
extern OpenMM_Vec3 OpenMM_Vec3_scale(const OpenMM_Vec3 vec, double scale);
extern
OPENMM_EXPORT
OpenMM_Vec3 OpenMM_Vec3_scale(const OpenMM_Vec3 vec, double scale);
/* OpenMM_Vec3Array */
extern OpenMM_Vec3Array* OpenMM_Vec3Array_create(int size);
extern void OpenMM_Vec3Array_destroy(OpenMM_Vec3Array* array);
extern int OpenMM_Vec3Array_getSize(const OpenMM_Vec3Array* array);
extern void OpenMM_Vec3Array_resize(OpenMM_Vec3Array* array, int size);
extern void OpenMM_Vec3Array_append(OpenMM_Vec3Array* array, const OpenMM_Vec3 vec);
extern void OpenMM_Vec3Array_set(OpenMM_Vec3Array* array, int index, const OpenMM_Vec3 vec);
extern const OpenMM_Vec3* OpenMM_Vec3Array_get(const OpenMM_Vec3Array* array, int index);
extern
OPENMM_EXPORT
OpenMM_Vec3Array* OpenMM_Vec3Array_create(int size);
extern
OPENMM_EXPORT
void OpenMM_Vec3Array_destroy(OpenMM_Vec3Array* array);
extern
OPENMM_EXPORT
int OpenMM_Vec3Array_getSize(const OpenMM_Vec3Array* array);
extern
OPENMM_EXPORT
void OpenMM_Vec3Array_resize(OpenMM_Vec3Array* array, int size);
extern
OPENMM_EXPORT
void OpenMM_Vec3Array_append(OpenMM_Vec3Array* array, const OpenMM_Vec3 vec);
extern
OPENMM_EXPORT
void OpenMM_Vec3Array_set(OpenMM_Vec3Array* array, int index, const OpenMM_Vec3 vec);
extern
OPENMM_EXPORT
const OpenMM_Vec3* OpenMM_Vec3Array_get(const OpenMM_Vec3Array* array, int index);
/* OpenMM_StringArray */
extern OpenMM_StringArray* OpenMM_StringArray_create(int size);
extern void OpenMM_StringArray_destroy(OpenMM_StringArray* array);
extern int OpenMM_StringArray_getSize(const OpenMM_StringArray* array);
extern void OpenMM_StringArray_resize(OpenMM_StringArray* array, int size);
extern void OpenMM_StringArray_append(OpenMM_StringArray* array, const char* string);
extern void OpenMM_StringArray_set(OpenMM_StringArray* array, int index, const char* string);
extern const char* OpenMM_StringArray_get(const OpenMM_StringArray* array, int index);
extern
OPENMM_EXPORT
OpenMM_StringArray* OpenMM_StringArray_create(int size);
extern
OPENMM_EXPORT
void OpenMM_StringArray_destroy(OpenMM_StringArray* array);
extern
OPENMM_EXPORT
int OpenMM_StringArray_getSize(const OpenMM_StringArray* array);
extern
OPENMM_EXPORT
void OpenMM_StringArray_resize(OpenMM_StringArray* array, int size);
extern
OPENMM_EXPORT
void OpenMM_StringArray_append(OpenMM_StringArray* array, const char* string);
extern
OPENMM_EXPORT
void OpenMM_StringArray_set(OpenMM_StringArray* array, int index, const char* string);
extern
OPENMM_EXPORT
const char* OpenMM_StringArray_get(const OpenMM_StringArray* array, int index);
/* OpenMM_BondArray */
extern OpenMM_BondArray* OpenMM_BondArray_create(int size);
extern void OpenMM_BondArray_destroy(OpenMM_BondArray* array);
extern int OpenMM_BondArray_getSize(const OpenMM_BondArray* array);
extern void OpenMM_BondArray_resize(OpenMM_BondArray* array, int size);
extern void OpenMM_BondArray_append(OpenMM_BondArray* array, int particle1, int particle2);
extern void OpenMM_BondArray_set(OpenMM_BondArray* array, int index, int particle1, int particle2);
extern void OpenMM_BondArray_get(const OpenMM_BondArray* array, int index, int* particle1, int* particle2);
extern
OPENMM_EXPORT
OpenMM_BondArray* OpenMM_BondArray_create(int size);
extern
OPENMM_EXPORT
void OpenMM_BondArray_destroy(OpenMM_BondArray* array);
extern
OPENMM_EXPORT
int OpenMM_BondArray_getSize(const OpenMM_BondArray* array);
extern
OPENMM_EXPORT
void OpenMM_BondArray_resize(OpenMM_BondArray* array, int size);
extern
OPENMM_EXPORT
void OpenMM_BondArray_append(OpenMM_BondArray* array, int particle1, int particle2);
extern
OPENMM_EXPORT
void OpenMM_BondArray_set(OpenMM_BondArray* array, int index, int particle1, int particle2);
extern
OPENMM_EXPORT
void OpenMM_BondArray_get(const OpenMM_BondArray* array, int index, int* particle1, int* particle2);
/* OpenMM_ParameterArray */
extern int OpenMM_ParameterArray_getSize(const OpenMM_ParameterArray* array);
extern double OpenMM_ParameterArray_get(const OpenMM_ParameterArray* array, const char* name);
extern
OPENMM_EXPORT
int OpenMM_ParameterArray_getSize(const OpenMM_ParameterArray* array);
extern
OPENMM_EXPORT
double OpenMM_ParameterArray_get(const OpenMM_ParameterArray* array, const char* name);
<xsl:call-template
name=
"primitive_array"
>
<xsl:with-param
name=
"element_type"
select=
"'double'"
/>
<xsl:with-param
name=
"name"
select=
"'OpenMM_DoubleArray'"
/>
...
...
@@ -90,8 +94,8 @@ extern double OpenMM_ParameterArray_get(const OpenMM_ParameterArray* array, cons
/* These methods need to be handled specially, since their C++ APIs cannot be directly translated to C.
Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself. */
extern OpenMM_State* OpenMM_Context_getState(const OpenMM_Context* target, int types);
extern OpenMM_StringArray* OpenMM_Platform_loadPluginsFromDirectory(const char* directory);
extern
OPENMM_EXPORT
OpenMM_State* OpenMM_Context_getState(const OpenMM_Context* target, int types);
extern
OPENMM_EXPORT
OpenMM_StringArray* OpenMM_Platform_loadPluginsFromDirectory(const char* directory);
<!-- Class members -->
<xsl:for-each
select=
"Class[@context=$openmm_namespace_id and empty(index-of($skip_classes, @name))]"
>
...
...
@@ -110,13 +114,13 @@ extern OpenMM_StringArray* OpenMM_Platform_loadPluginsFromDirectory(const char*
<xsl:param
name=
"element_type"
/>
<xsl:param
name=
"name"
/>
/*
<xsl:value-of
select=
"$name"
/>
*/
extern
<xsl:value-of
select=
"$name"
/>
*
<xsl:value-of
select=
"$name"
/>
_create(int size);
extern void
<xsl:value-of
select=
"$name"
/>
_destroy(
<xsl:value-of
select=
"$name"
/>
* array);
extern int
<xsl:value-of
select=
"$name"
/>
_getSize(const
<xsl:value-of
select=
"$name"
/>
* array);
extern void
<xsl:value-of
select=
"$name"
/>
_resize(
<xsl:value-of
select=
"$name"
/>
* array, int size);
extern void
<xsl:value-of
select=
"$name"
/>
_append(
<xsl:value-of
select=
"$name"
/>
* array,
<xsl:value-of
select=
"$element_type"
/>
value);
extern void
<xsl:value-of
select=
"$name"
/>
_set(
<xsl:value-of
select=
"$name"
/>
* array, int index,
<xsl:value-of
select=
"$element_type"
/>
value);
extern
<xsl:value-of
select=
"concat($element_type, ' ', $name)"
/>
_get(const
<xsl:value-of
select=
"$name"
/>
* array, int index);
extern
OPENMM_EXPORT
<xsl:value-of
select=
"$name"
/>
*
<xsl:value-of
select=
"$name"
/>
_create(int size);
extern
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name"
/>
_destroy(
<xsl:value-of
select=
"$name"
/>
* array);
extern
OPENMM_EXPORT
int
<xsl:value-of
select=
"$name"
/>
_getSize(const
<xsl:value-of
select=
"$name"
/>
* array);
extern
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name"
/>
_resize(
<xsl:value-of
select=
"$name"
/>
* array, int size);
extern
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name"
/>
_append(
<xsl:value-of
select=
"$name"
/>
* array,
<xsl:value-of
select=
"$element_type"
/>
value);
extern
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name"
/>
_set(
<xsl:value-of
select=
"$name"
/>
* array, int index,
<xsl:value-of
select=
"$element_type"
/>
value);
extern
OPENMM_EXPORT
<xsl:value-of
select=
"concat($element_type, ' ', $name)"
/>
_get(const
<xsl:value-of
select=
"$name"
/>
* array, int index);
</xsl:template>
<!-- Print out information for a class -->
...
...
@@ -140,7 +144,7 @@ extern <xsl:value-of select="concat($element_type, ' ', $name)"/>_get(const <xsl
</xsl:call-template>
</xsl:for-each>
</xsl:if>
extern void OpenMM_
<xsl:value-of
select=
"concat(@name, '_destroy(OpenMM_', @name, '* target);')"
/>
extern
OPENMM_EXPORT
void OpenMM_
<xsl:value-of
select=
"concat(@name, '_destroy(OpenMM_', @name, '* target);')"
/>
<!-- Methods -->
<xsl:variable
name=
"methods"
select=
"/GCC_XML/Method[@context=$class_id and @access='public']"
/>
<xsl:for-each
select=
"$methods"
>
...
...
@@ -173,7 +177,7 @@ typedef enum {
<!-- Print out the declaration for a constructor -->
<xsl:template
name=
"constructor"
>
<xsl:param
name=
"suffix"
/>
extern OpenMM_
<xsl:value-of
select=
"concat(@name, '* OpenMM_', @name, '_create', $suffix, '(')"
/>
extern
OPENMM_EXPORT
OpenMM_
<xsl:value-of
select=
"concat(@name, '* OpenMM_', @name, '_create', $suffix, '(')"
/>
<xsl:for-each
select=
"Argument"
>
<xsl:if
test=
"position() > 1"
>
,
</xsl:if>
<xsl:call-template
name=
"wrap_type"
><xsl:with-param
name=
"type_id"
select=
"@type"
/></xsl:call-template>
...
...
@@ -185,7 +189,7 @@ extern OpenMM_<xsl:value-of select="concat(@name, '* OpenMM_', @name, '_create',
<!-- Print out the declaration for a method -->
<xsl:template
name=
"method"
>
<xsl:param
name=
"class_name"
/>
extern
<xsl:call-template
name=
"wrap_type"
><xsl:with-param
name=
"type_id"
select=
"@returns"
/></xsl:call-template><xsl:value-of
select=
"concat(' OpenMM_', $class_name, '_', @name, '(')"
/>
extern
OPENMM_EXPORT
<xsl:call-template
name=
"wrap_type"
><xsl:with-param
name=
"type_id"
select=
"@returns"
/></xsl:call-template><xsl:value-of
select=
"concat(' OpenMM_', $class_name, '_', @name, '(')"
/>
<xsl:if
test=
"not(@static='1')"
>
<xsl:if
test=
"@const='1'"
>
<xsl:value-of
select=
"'const '"
/>
...
...
@@ -293,4 +297,4 @@ extern <xsl:call-template name="wrap_type"><xsl:with-param name="type_id" select
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
</xsl:stylesheet>
wrappers/CWrapper_Source.xslt
View file @
bcbc4eec
...
...
@@ -32,100 +32,98 @@
<!-- Main loop over all classes in the OpenMM namespace -->
<xsl:template
match=
"/GCC_XML"
>
#include "OpenMMCWrapper.h"
#include "OpenMM.h"
#include "OpenMMCWrapper.h"
#include
<
cstring
>
#include
<
vector
>
using namespace OpenMM;
using namespace std;
#if defined(__cplusplus)
extern "C" {
#endif
/* OpenMM_Vec3 */
OpenMM_Vec3 OpenMM_Vec3_scale(const OpenMM_Vec3 vec, double scale) {
OPENMM_EXPORT
OpenMM_Vec3 OpenMM_Vec3_scale(const OpenMM_Vec3 vec, double scale) {
OpenMM_Vec3 result = {vec.x*scale, vec.y*scale, vec.z*scale};
return result;
}
/* OpenMM_Vec3Array */
OpenMM_Vec3Array* OpenMM_Vec3Array_create(int size) {
OPENMM_EXPORT
OpenMM_Vec3Array* OpenMM_Vec3Array_create(int size) {
return reinterpret_cast
<
OpenMM_Vec3Array*
>
(new vector
<
Vec3
>
(size));
}
void OpenMM_Vec3Array_destroy(OpenMM_Vec3Array* array) {
OPENMM_EXPORT
void OpenMM_Vec3Array_destroy(OpenMM_Vec3Array* array) {
delete reinterpret_cast
<
vector
<
Vec3
>
*
>
(array);
}
int OpenMM_Vec3Array_getSize(const OpenMM_Vec3Array* array) {
OPENMM_EXPORT
int OpenMM_Vec3Array_getSize(const OpenMM_Vec3Array* array) {
return reinterpret_cast
<
const vector
<
Vec3
>
*
>
(array)->size();
}
void OpenMM_Vec3Array_resize(OpenMM_Vec3Array* array, int size) {
OPENMM_EXPORT
void OpenMM_Vec3Array_resize(OpenMM_Vec3Array* array, int size) {
reinterpret_cast
<
vector
<
Vec3
>
*
>
(array)->resize(size);
}
void OpenMM_Vec3Array_append(OpenMM_Vec3Array* array, const OpenMM_Vec3 vec) {
OPENMM_EXPORT
void OpenMM_Vec3Array_append(OpenMM_Vec3Array* array, const OpenMM_Vec3 vec) {
reinterpret_cast
<
vector
<
Vec3
>
*
>
(array)->push_back(Vec3(vec.x, vec.y, vec.z));
}
void OpenMM_Vec3Array_set(OpenMM_Vec3Array* array, int index, const OpenMM_Vec3 vec) {
OPENMM_EXPORT
void OpenMM_Vec3Array_set(OpenMM_Vec3Array* array, int index, const OpenMM_Vec3 vec) {
(*reinterpret_cast
<
vector
<
Vec3
>
*
>
(array))[index] = Vec3(vec.x, vec.y, vec.z);
}
const OpenMM_Vec3* OpenMM_Vec3Array_get(const OpenMM_Vec3Array* array, int index) {
OPENMM_EXPORT
const OpenMM_Vec3* OpenMM_Vec3Array_get(const OpenMM_Vec3Array* array, int index) {
return reinterpret_cast
<
const OpenMM_Vec3*
>
((
&
(*reinterpret_cast
<
const vector
<
Vec3
>
*
>
(array))[index]));
}
/* OpenMM_StringArray */
OpenMM_StringArray* OpenMM_StringArray_create(int size) {
OPENMM_EXPORT
OpenMM_StringArray* OpenMM_StringArray_create(int size) {
return reinterpret_cast
<
OpenMM_StringArray*
>
(new vector
<
string
>
(size));
}
void OpenMM_StringArray_destroy(OpenMM_StringArray* array) {
OPENMM_EXPORT
void OpenMM_StringArray_destroy(OpenMM_StringArray* array) {
delete reinterpret_cast
<
vector
<
string
>
*
>
(array);
}
int OpenMM_StringArray_getSize(const OpenMM_StringArray* array) {
OPENMM_EXPORT
int OpenMM_StringArray_getSize(const OpenMM_StringArray* array) {
return reinterpret_cast
<
const vector
<
string
>
*
>
(array)->size();
}
void OpenMM_StringArray_resize(OpenMM_StringArray* array, int size) {
OPENMM_EXPORT
void OpenMM_StringArray_resize(OpenMM_StringArray* array, int size) {
reinterpret_cast
<
vector
<
string
>
*
>
(array)->resize(size);
}
void OpenMM_StringArray_append(OpenMM_StringArray* array, const char* str) {
OPENMM_EXPORT
void OpenMM_StringArray_append(OpenMM_StringArray* array, const char* str) {
reinterpret_cast
<
vector
<
string
>
*
>
(array)->push_back(string(str));
}
void OpenMM_StringArray_set(OpenMM_StringArray* array, int index, const char* str) {
OPENMM_EXPORT
void OpenMM_StringArray_set(OpenMM_StringArray* array, int index, const char* str) {
(*reinterpret_cast
<
vector
<
string
>
*
>
(array))[index] = string(str);
}
const char* OpenMM_StringArray_get(const OpenMM_StringArray* array, int index) {
OPENMM_EXPORT
const char* OpenMM_StringArray_get(const OpenMM_StringArray* array, int index) {
return (*reinterpret_cast
<
const vector
<
string
>
*
>
(array))[index].c_str();
}
/* OpenMM_BondArray */
OpenMM_BondArray* OpenMM_BondArray_create(int size) {
OPENMM_EXPORT
OpenMM_BondArray* OpenMM_BondArray_create(int size) {
return reinterpret_cast
<
OpenMM_BondArray*
>
(new vector
<
pair
<
int, int
>
>
(size));
}
void OpenMM_BondArray_destroy(OpenMM_BondArray* array) {
OPENMM_EXPORT
void OpenMM_BondArray_destroy(OpenMM_BondArray* array) {
delete reinterpret_cast
<
vector
<
pair
<
int, int
>
>
*
>
(array);
}
int OpenMM_BondArray_getSize(const OpenMM_BondArray* array) {
OPENMM_EXPORT
int OpenMM_BondArray_getSize(const OpenMM_BondArray* array) {
return reinterpret_cast
<
const vector
<
pair
<
int, int
>
>
*
>
(array)->size();
}
void OpenMM_BondArray_resize(OpenMM_BondArray* array, int size) {
OPENMM_EXPORT
void OpenMM_BondArray_resize(OpenMM_BondArray* array, int size) {
reinterpret_cast
<
vector
<
pair
<
int, int
>
>
*
>
(array)->resize(size);
}
void OpenMM_BondArray_append(OpenMM_BondArray* array, int particle1, int particle2) {
OPENMM_EXPORT
void OpenMM_BondArray_append(OpenMM_BondArray* array, int particle1, int particle2) {
reinterpret_cast
<
vector
<
pair
<
int, int
>
>
*
>
(array)->push_back(pair
<
int, int
>
(particle1, particle2));
}
void OpenMM_BondArray_set(OpenMM_BondArray* array, int index, int particle1, int particle2) {
OPENMM_EXPORT
void OpenMM_BondArray_set(OpenMM_BondArray* array, int index, int particle1, int particle2) {
(*reinterpret_cast
<
vector
<
pair
<
int, int
>
>
*
>
(array))[index] = pair
<
int, int
>
(particle1, particle2);
}
void OpenMM_BondArray_get(const OpenMM_BondArray* array, int index, int* particle1, int* particle2) {
OPENMM_EXPORT
void OpenMM_BondArray_get(const OpenMM_BondArray* array, int index, int* particle1, int* particle2) {
pair
<
int, int
>
particles = (*reinterpret_cast
<
const vector
<
pair
<
int, int
>
>
*
>
(array))[index];
*particle1 = particles.first;
*particle2 = particles.second;
}
/* OpenMM_ParameterArray */
int OpenMM_ParameterArray_getSize(const OpenMM_ParameterArray* array) {
OPENMM_EXPORT
int OpenMM_ParameterArray_getSize(const OpenMM_ParameterArray* array) {
return reinterpret_cast
<
const map
<
string, double
>
*
>
(array)->size();
}
double OpenMM_ParameterArray_get(const OpenMM_ParameterArray* array, const char* name) {
OPENMM_EXPORT
double OpenMM_ParameterArray_get(const OpenMM_ParameterArray* array, const char* name) {
const map
<
string, double
>
* params = reinterpret_cast
<
const map
<
string, double
>
*
>
(array);
const map
<
string, double
>
::const_iterator iter = params->find(string(name));
if (iter == params->end())
...
...
@@ -139,11 +137,11 @@ double OpenMM_ParameterArray_get(const OpenMM_ParameterArray* array, const char*
/* These methods need to be handled specially, since their C++ APIs cannot be directly translated to C.
Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself. */
OpenMM_State* OpenMM_Context_getState(const OpenMM_Context* target, int types) {
OPENMM_EXPORT
OpenMM_State* OpenMM_Context_getState(const OpenMM_Context* target, int types) {
State result = reinterpret_cast
<
const Context*
>
(target)->getState(types);
return reinterpret_cast
<
OpenMM_State*
>
(new State(result));
};
OpenMM_StringArray* OpenMM_Platform_loadPluginsFromDirectory(const char* directory) {
OPENMM_EXPORT
OpenMM_StringArray* OpenMM_Platform_loadPluginsFromDirectory(const char* directory) {
vector
<
string
>
result = Platform::loadPluginsFromDirectory(string(directory));
return reinterpret_cast
<
OpenMM_StringArray*
>
(new vector
<
string
>
(result));
};
...
...
@@ -153,9 +151,7 @@ OpenMM_StringArray* OpenMM_Platform_loadPluginsFromDirectory(const char* directo
<xsl:call-template
name=
"class"
/>
</xsl:for-each>
#if defined(__cplusplus)
}
#endif
</xsl:template>
<!-- Print out the definitions for a (Primitive)Array type -->
...
...
@@ -163,25 +159,25 @@ OpenMM_StringArray* OpenMM_Platform_loadPluginsFromDirectory(const char* directo
<xsl:param
name=
"element_type"
/>
<xsl:param
name=
"name"
/>
/*
<xsl:value-of
select=
"$name"
/>
*/
<xsl:value-of
select=
"$name"
/>
*
<xsl:value-of
select=
"$name"
/>
_create(int size) {
OPENMM_EXPORT
<xsl:value-of
select=
"$name"
/>
*
<xsl:value-of
select=
"$name"
/>
_create(int size) {
return reinterpret_cast
<
<xsl:value-of
select=
"$name"
/>
*
>
(new vector
<
<xsl:value-of
select=
"$element_type"
/>
>
(size));
}
void
<xsl:value-of
select=
"$name"
/>
_destroy(
<xsl:value-of
select=
"$name"
/>
* array) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name"
/>
_destroy(
<xsl:value-of
select=
"$name"
/>
* array) {
delete reinterpret_cast
<
vector
<
<xsl:value-of
select=
"$element_type"
/>
>
*
>
(array);
}
int
<xsl:value-of
select=
"$name"
/>
_getSize(const
<xsl:value-of
select=
"$name"
/>
* array) {
OPENMM_EXPORT
int
<xsl:value-of
select=
"$name"
/>
_getSize(const
<xsl:value-of
select=
"$name"
/>
* array) {
return reinterpret_cast
<
const vector
<
<xsl:value-of
select=
"$element_type"
/>
>
*
>
(array)->size();
}
void
<xsl:value-of
select=
"$name"
/>
_resize(
<xsl:value-of
select=
"$name"
/>
* array, int size) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name"
/>
_resize(
<xsl:value-of
select=
"$name"
/>
* array, int size) {
reinterpret_cast
<
vector
<
<xsl:value-of
select=
"$element_type"
/>
>
*
>
(array)->resize(size);
}
void
<xsl:value-of
select=
"$name"
/>
_append(
<xsl:value-of
select=
"$name"
/>
* array,
<xsl:value-of
select=
"$element_type"
/>
value) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name"
/>
_append(
<xsl:value-of
select=
"$name"
/>
* array,
<xsl:value-of
select=
"$element_type"
/>
value) {
reinterpret_cast
<
vector
<
<xsl:value-of
select=
"$element_type"
/>
>
*
>
(array)->push_back(value);
}
void
<xsl:value-of
select=
"$name"
/>
_set(
<xsl:value-of
select=
"$name"
/>
* array, int index,
<xsl:value-of
select=
"$element_type"
/>
value) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name"
/>
_set(
<xsl:value-of
select=
"$name"
/>
* array, int index,
<xsl:value-of
select=
"$element_type"
/>
value) {
(*reinterpret_cast
<
vector
<
<xsl:value-of
select=
"$element_type"
/>
>
*
>
(array))[index] = value;
}
double
<xsl:value-of
select=
"$name"
/>
_get(const
<xsl:value-of
select=
"$name"
/>
* array, int index) {
OPENMM_EXPORT
double
<xsl:value-of
select=
"$name"
/>
_get(const
<xsl:value-of
select=
"$name"
/>
* array, int index) {
return (*reinterpret_cast
<
const vector
<
<xsl:value-of
select=
"$element_type"
/>
>
*
>
(array))[index];
}
</xsl:template>
...
...
@@ -201,7 +197,7 @@ double <xsl:value-of select="$name"/>_get(const <xsl:value-of select="$name"/>*
</xsl:call-template>
</xsl:for-each>
</xsl:if>
void OpenMM_
<xsl:value-of
select=
"concat(@name, '_destroy(OpenMM_', @name, '* target) {')"
/>
OPENMM_EXPORT
void OpenMM_
<xsl:value-of
select=
"concat(@name, '_destroy(OpenMM_', @name, '* target) {')"
/>
delete reinterpret_cast
<
<xsl:value-of
select=
"@name"
/>
*
>
(target);
}
<!-- Methods -->
...
...
@@ -226,7 +222,7 @@ void OpenMM_<xsl:value-of select="concat(@name, '_destroy(OpenMM_', @name, '* ta
<!-- Print out the definition of a constructor -->
<xsl:template
name=
"constructor"
>
<xsl:param
name=
"suffix"
/>
OpenMM_
<xsl:value-of
select=
"concat(@name, '* OpenMM_', @name, '_create', $suffix, '(')"
/>
OPENMM_EXPORT
OpenMM_
<xsl:value-of
select=
"concat(@name, '* OpenMM_', @name, '_create', $suffix, '(')"
/>
<xsl:for-each
select=
"Argument"
>
<xsl:if
test=
"position() > 1"
>
,
</xsl:if>
<xsl:call-template
name=
"wrap_type"
><xsl:with-param
name=
"type_id"
select=
"@type"
/></xsl:call-template>
...
...
@@ -251,7 +247,7 @@ OpenMM_<xsl:value-of select="concat(@name, '* OpenMM_', @name, '_create', $suffi
<xsl:param
name=
"class_id"
/>
<!-- First the method signature -->
<xsl:value-of
select=
"$newline"
/>
<xsl:call-template
name=
"wrap_type"
><xsl:with-param
name=
"type_id"
select=
"@returns"
/></xsl:call-template><xsl:value-of
select=
"concat(' OpenMM_', $class_name, '_', @name, '(')"
/>
OPENMM_EXPORT
<xsl:call-template
name=
"wrap_type"
><xsl:with-param
name=
"type_id"
select=
"@returns"
/></xsl:call-template><xsl:value-of
select=
"concat(' OpenMM_', $class_name, '_', @name, '(')"
/>
<xsl:if
test=
"not(@static='1')"
>
<xsl:if
test=
"@const='1'"
>
<xsl:value-of
select=
"'const '"
/>
...
...
@@ -516,4 +512,4 @@ OpenMM_<xsl:value-of select="concat(@name, '* OpenMM_', @name, '_create', $suffi
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
</xsl:stylesheet>
wrappers/FortranWrapper_Source.xslt
View file @
bcbc4eec
...
...
@@ -36,8 +36,8 @@
<!-- Main loop over all classes in the OpenMM namespace -->
<xsl:template
match=
"/GCC_XML"
>
#include "OpenMMCWrapper.h"
#include "OpenMM.h"
#include "OpenMMCWrapper.h"
#include
<
cstring
>
#include
<
vector
>
...
...
@@ -47,56 +47,56 @@ using namespace std;
extern "C" {
/* OpenMM_Vec3 */
void openmm_vec3_scale_(const OpenMM_Vec3
&
vec, double const
&
scale, OpenMM_Vec3
&
result) {
OPENMM_EXPORT
void openmm_vec3_scale_(const OpenMM_Vec3
&
vec, double const
&
scale, OpenMM_Vec3
&
result) {
result = OpenMM_Vec3_scale(vec, scale);
}
void OPENMM_VEC3_SCALE(const OpenMM_Vec3
&
vec, double const
&
scale, OpenMM_Vec3
&
result) {
OPENMM_EXPORT
void OPENMM_VEC3_SCALE(const OpenMM_Vec3
&
vec, double const
&
scale, OpenMM_Vec3
&
result) {
result = OpenMM_Vec3_scale(vec, scale);
}
/* OpenMM_Vec3Array */
void openmm_vec3array_create_(OpenMM_Vec3Array*
&
result, const int
&
size) {
OPENMM_EXPORT
void openmm_vec3array_create_(OpenMM_Vec3Array*
&
result, const int
&
size) {
result = OpenMM_Vec3Array_create(size);
}
void OPENMM_VEC3ARRAY_CREATE(OpenMM_Vec3Array*
&
result, const int
&
size) {
OPENMM_EXPORT
void OPENMM_VEC3ARRAY_CREATE(OpenMM_Vec3Array*
&
result, const int
&
size) {
result = OpenMM_Vec3Array_create(size);
}
void openmm_vec3array_destroy_(OpenMM_Vec3Array*
&
array) {
OPENMM_EXPORT
void openmm_vec3array_destroy_(OpenMM_Vec3Array*
&
array) {
OpenMM_Vec3Array_destroy(array);
array = 0;
}
void OPENMM_VEC3ARRAY_DESTROY(OpenMM_Vec3Array*
&
array) {
OPENMM_EXPORT
void OPENMM_VEC3ARRAY_DESTROY(OpenMM_Vec3Array*
&
array) {
OpenMM_Vec3Array_destroy(array);
array = 0;
}
int openmm_vec3array_getsize_(const OpenMM_Vec3Array* const
&
array) {
OPENMM_EXPORT
int openmm_vec3array_getsize_(const OpenMM_Vec3Array* const
&
array) {
return OpenMM_Vec3Array_getSize(array);
}
int OPENMM_VEC3ARRAY_GETSIZE(const OpenMM_Vec3Array* const
&
array) {
OPENMM_EXPORT
int OPENMM_VEC3ARRAY_GETSIZE(const OpenMM_Vec3Array* const
&
array) {
return OpenMM_Vec3Array_getSize(array);
}
void openmm_vec3array_resize_(OpenMM_Vec3Array* const
&
array, const int
&
size) {
OPENMM_EXPORT
void openmm_vec3array_resize_(OpenMM_Vec3Array* const
&
array, const int
&
size) {
OpenMM_Vec3Array_resize(array, size);
}
void OPENMM_VEC3ARRAY_RESIZE(OpenMM_Vec3Array* const
&
array, const int
&
size) {
OPENMM_EXPORT
void OPENMM_VEC3ARRAY_RESIZE(OpenMM_Vec3Array* const
&
array, const int
&
size) {
OpenMM_Vec3Array_resize(array, size);
}
void openmm_vec3array_append_(OpenMM_Vec3Array* const
&
array, const OpenMM_Vec3
&
vec) {
OPENMM_EXPORT
void openmm_vec3array_append_(OpenMM_Vec3Array* const
&
array, const OpenMM_Vec3
&
vec) {
OpenMM_Vec3Array_append(array, vec);
}
void OPENMM_VEC3ARRAY_APPEND(OpenMM_Vec3Array* const
&
array, const OpenMM_Vec3
&
vec) {
OPENMM_EXPORT
void OPENMM_VEC3ARRAY_APPEND(OpenMM_Vec3Array* const
&
array, const OpenMM_Vec3
&
vec) {
OpenMM_Vec3Array_append(array, vec);
}
void openmm_vec3array_set_(OpenMM_Vec3Array* const
&
array, const int
&
index, const OpenMM_Vec3
&
vec) {
OPENMM_EXPORT
void openmm_vec3array_set_(OpenMM_Vec3Array* const
&
array, const int
&
index, const OpenMM_Vec3
&
vec) {
OpenMM_Vec3Array_set(array, index-1, vec);
}
void OPENMM_VEC3ARRAY_SET(OpenMM_Vec3Array* const
&
array, const int
&
index, const OpenMM_Vec3
&
vec) {
OPENMM_EXPORT
void OPENMM_VEC3ARRAY_SET(OpenMM_Vec3Array* const
&
array, const int
&
index, const OpenMM_Vec3
&
vec) {
OpenMM_Vec3Array_set(array, index-1, vec);
}
void openmm_vec3array_get_(const OpenMM_Vec3Array* const
&
array, const int
&
index, OpenMM_Vec3
&
result) {
OPENMM_EXPORT
void openmm_vec3array_get_(const OpenMM_Vec3Array* const
&
array, const int
&
index, OpenMM_Vec3
&
result) {
result = *OpenMM_Vec3Array_get(array, index-1);
}
void OPENMM_VEC3ARRAY_GET(const OpenMM_Vec3Array* const
&
array, const int
&
index, OpenMM_Vec3
&
result) {
OPENMM_EXPORT
void OPENMM_VEC3ARRAY_GET(const OpenMM_Vec3Array* const
&
array, const int
&
index, OpenMM_Vec3
&
result) {
result = *OpenMM_Vec3Array_get(array, index-1);
}
...
...
@@ -109,110 +109,110 @@ static void copyAndPadString(char* dest, const char* source, int length) {
dest[i] = (reachedEnd ? ' ' : source[i]);
}
}
void openmm_stringarray_create_(OpenMM_StringArray*
&
result, const int
&
size) {
OPENMM_EXPORT
void openmm_stringarray_create_(OpenMM_StringArray*
&
result, const int
&
size) {
result = OpenMM_StringArray_create(size);
}
void OPENMM_STRINGARRAY_CREATE(OpenMM_StringArray*
&
result, const int
&
size) {
OPENMM_EXPORT
void OPENMM_STRINGARRAY_CREATE(OpenMM_StringArray*
&
result, const int
&
size) {
result = OpenMM_StringArray_create(size);
}
void openmm_stringarray_destroy_(OpenMM_StringArray*
&
array) {
OPENMM_EXPORT
void openmm_stringarray_destroy_(OpenMM_StringArray*
&
array) {
OpenMM_StringArray_destroy(array);
array = 0;
}
void OPENMM_STRINGARRAY_DESTROY(OpenMM_StringArray*
&
array) {
OPENMM_EXPORT
void OPENMM_STRINGARRAY_DESTROY(OpenMM_StringArray*
&
array) {
OpenMM_StringArray_destroy(array);
array = 0;
}
int openmm_stringarray_getsize_(const OpenMM_StringArray* const
&
array) {
OPENMM_EXPORT
int openmm_stringarray_getsize_(const OpenMM_StringArray* const
&
array) {
return OpenMM_StringArray_getSize(array);
}
int OPENMM_STRINGARRAY_GETSIZE(const OpenMM_StringArray* const
&
array) {
OPENMM_EXPORT
int OPENMM_STRINGARRAY_GETSIZE(const OpenMM_StringArray* const
&
array) {
return OpenMM_StringArray_getSize(array);
}
void openmm_stringarray_resize_(OpenMM_StringArray* const
&
array, const int
&
size) {
OPENMM_EXPORT
void openmm_stringarray_resize_(OpenMM_StringArray* const
&
array, const int
&
size) {
OpenMM_StringArray_resize(array, size);
}
void OPENMM_STRINGARRAY_RESIZE(OpenMM_StringArray* const
&
array, const int
&
size) {
OPENMM_EXPORT
void OPENMM_STRINGARRAY_RESIZE(OpenMM_StringArray* const
&
array, const int
&
size) {
OpenMM_StringArray_resize(array, size);
}
void openmm_stringarray_append_(OpenMM_StringArray* const
&
array, const char* str, int length) {
OPENMM_EXPORT
void openmm_stringarray_append_(OpenMM_StringArray* const
&
array, const char* str, int length) {
OpenMM_StringArray_append(array, string(str, length).c_str());
}
void OPENMM_STRINGARRAY_APPEND(OpenMM_StringArray* const
&
array, const char* str, int length) {
OPENMM_EXPORT
void OPENMM_STRINGARRAY_APPEND(OpenMM_StringArray* const
&
array, const char* str, int length) {
OpenMM_StringArray_append(array, string(str, length).c_str());
}
void openmm_stringarray_set_(OpenMM_StringArray* const
&
array, const int
&
index, const char* str, int length) {
OPENMM_EXPORT
void openmm_stringarray_set_(OpenMM_StringArray* const
&
array, const int
&
index, const char* str, int length) {
OpenMM_StringArray_set(array, index-1, string(str, length).c_str());
}
void OPENMM_STRINGARRAY_SET(OpenMM_StringArray* const
&
array, const int
&
index, const char* str, int length) {
OPENMM_EXPORT
void OPENMM_STRINGARRAY_SET(OpenMM_StringArray* const
&
array, const int
&
index, const char* str, int length) {
OpenMM_StringArray_set(array, index-1, string(str, length).c_str());
}
void openmm_stringarray_get_(const OpenMM_StringArray* const
&
array, const int
&
index, char* result, int length) {
OPENMM_EXPORT
void openmm_stringarray_get_(const OpenMM_StringArray* const
&
array, const int
&
index, char* result, int length) {
const char* str = OpenMM_StringArray_get(array, index-1);
copyAndPadString(result, str, length);
}
void OPENMM_STRINGARRAY_GET(const OpenMM_StringArray* const
&
array, const int
&
index, char* result, int length) {
OPENMM_EXPORT
void OPENMM_STRINGARRAY_GET(const OpenMM_StringArray* const
&
array, const int
&
index, char* result, int length) {
const char* str = OpenMM_StringArray_get(array, index-1);
copyAndPadString(result, str, length);
}
/* OpenMM_BondArray */
void openmm_bondarray_create_(OpenMM_BondArray*
&
result, const int
&
size) {
OPENMM_EXPORT
void openmm_bondarray_create_(OpenMM_BondArray*
&
result, const int
&
size) {
result = OpenMM_BondArray_create(size);
}
void OPENMM_BONDARRAY_CREATE(OpenMM_BondArray*
&
result, const int
&
size) {
OPENMM_EXPORT
void OPENMM_BONDARRAY_CREATE(OpenMM_BondArray*
&
result, const int
&
size) {
result = OpenMM_BondArray_create(size);
}
void openmm_bondarray_destroy_(OpenMM_BondArray*
&
array) {
OPENMM_EXPORT
void openmm_bondarray_destroy_(OpenMM_BondArray*
&
array) {
OpenMM_BondArray_destroy(array);
array = 0;
}
void OPENMM_BONDARRAY_DESTROY(OpenMM_BondArray*
&
array) {
OPENMM_EXPORT
void OPENMM_BONDARRAY_DESTROY(OpenMM_BondArray*
&
array) {
OpenMM_BondArray_destroy(array);
array = 0;
}
int openmm_bondarray_getsize_(const OpenMM_BondArray* const
&
array) {
OPENMM_EXPORT
int openmm_bondarray_getsize_(const OpenMM_BondArray* const
&
array) {
return OpenMM_BondArray_getSize(array);
}
int OPENMM_BONDARRAY_GETSIZE(const OpenMM_BondArray* const
&
array) {
OPENMM_EXPORT
int OPENMM_BONDARRAY_GETSIZE(const OpenMM_BondArray* const
&
array) {
return OpenMM_BondArray_getSize(array);
}
void openmm_bondarray_resize_(OpenMM_BondArray* const
&
array, const int
&
size) {
OPENMM_EXPORT
void openmm_bondarray_resize_(OpenMM_BondArray* const
&
array, const int
&
size) {
OpenMM_BondArray_resize(array, size);
}
void OPENMM_BONDARRAY_RESIZE(OpenMM_BondArray* const
&
array, const int
&
size) {
OPENMM_EXPORT
void OPENMM_BONDARRAY_RESIZE(OpenMM_BondArray* const
&
array, const int
&
size) {
OpenMM_BondArray_resize(array, size);
}
void openmm_bondarray_append_(OpenMM_BondArray* const
&
array, const int
&
particle1, const int
&
particle2) {
OPENMM_EXPORT
void openmm_bondarray_append_(OpenMM_BondArray* const
&
array, const int
&
particle1, const int
&
particle2) {
OpenMM_BondArray_append(array, particle1, particle2);
}
void OPENMM_BONDARRAY_APPEND(OpenMM_BondArray* const
&
array, const int
&
particle1, const int
&
particle2) {
OPENMM_EXPORT
void OPENMM_BONDARRAY_APPEND(OpenMM_BondArray* const
&
array, const int
&
particle1, const int
&
particle2) {
OpenMM_BondArray_append(array, particle1, particle2);
}
void openmm_bondarray_set_(OpenMM_BondArray* const
&
array, const int
&
index, const int
&
particle1, const int
&
particle2) {
OPENMM_EXPORT
void openmm_bondarray_set_(OpenMM_BondArray* const
&
array, const int
&
index, const int
&
particle1, const int
&
particle2) {
OpenMM_BondArray_set(array, index-1, particle1, particle2);
}
void OPENMM_BONDARRAY_SET(OpenMM_BondArray* const
&
array, const int
&
index, const int
&
particle1, const int
&
particle2) {
OPENMM_EXPORT
void OPENMM_BONDARRAY_SET(OpenMM_BondArray* const
&
array, const int
&
index, const int
&
particle1, const int
&
particle2) {
OpenMM_BondArray_set(array, index-1, particle1, particle2);
}
void openmm_bondarray_get_(const OpenMM_BondArray* const
&
array, const int
&
index, int* particle1, int* particle2) {
OPENMM_EXPORT
void openmm_bondarray_get_(const OpenMM_BondArray* const
&
array, const int
&
index, int* particle1, int* particle2) {
OpenMM_BondArray_get(array, index-1, particle1, particle2);
}
void OPENMM_BONDARRAY_GET(const OpenMM_BondArray* const
&
array, const int
&
index, int* particle1, int* particle2) {
OPENMM_EXPORT
void OPENMM_BONDARRAY_GET(const OpenMM_BondArray* const
&
array, const int
&
index, int* particle1, int* particle2) {
OpenMM_BondArray_get(array, index-1, particle1, particle2);
}
/* OpenMM_ParameterArray */
int openmm_parameterarray_getsize_(const OpenMM_ParameterArray* const
&
array) {
OPENMM_EXPORT
int openmm_parameterarray_getsize_(const OpenMM_ParameterArray* const
&
array) {
return OpenMM_ParameterArray_getSize(array);
}
int OPENMM_PARAMETERARRAY_GETSIZE(const OpenMM_ParameterArray* const
&
array) {
OPENMM_EXPORT
int OPENMM_PARAMETERARRAY_GETSIZE(const OpenMM_ParameterArray* const
&
array) {
return OpenMM_ParameterArray_getSize(array);
}
double openmm_parameterarray_get_(const OpenMM_ParameterArray* const
&
array, const char* name, int length) {
OPENMM_EXPORT
double openmm_parameterarray_get_(const OpenMM_ParameterArray* const
&
array, const char* name, int length) {
return OpenMM_ParameterArray_get(array, string(name, length).c_str());
}
double OPENMM_PARAMETERARRAY_GET(const OpenMM_ParameterArray* const
&
array, const char* name, int length) {
OPENMM_EXPORT
double OPENMM_PARAMETERARRAY_GET(const OpenMM_ParameterArray* const
&
array, const char* name, int length) {
return OpenMM_ParameterArray_get(array, string(name, length).c_str());
}
<xsl:call-template
name=
"primitive_array"
>
...
...
@@ -222,16 +222,16 @@ double OPENMM_PARAMETERARRAY_GET(const OpenMM_ParameterArray* const& array,
/* These methods need to be handled specially, since their C++ APIs cannot be directly translated to C.
Unlike the C++ versions, the return value is allocated on the heap, and you must delete it yourself. */
void openmm_context_getstate_(const OpenMM_Context*
&
target, int const
&
types, OpenMM_State*
&
result) {
OPENMM_EXPORT
void openmm_context_getstate_(const OpenMM_Context*
&
target, int const
&
types, OpenMM_State*
&
result) {
result = OpenMM_Context_getState(target, types);
};
void OPENMM_CONTEXT_GETSTATE(const OpenMM_Context*
&
target, int const
&
types, OpenMM_State*
&
result) {
OPENMM_EXPORT
void OPENMM_CONTEXT_GETSTATE(const OpenMM_Context*
&
target, int const
&
types, OpenMM_State*
&
result) {
result = OpenMM_Context_getState(target, types);
};
void openmm_platform_loadpluginsfromdirectory_(const char* directory, OpenMM_StringArray*
&
result, int length) {
OPENMM_EXPORT
void openmm_platform_loadpluginsfromdirectory_(const char* directory, OpenMM_StringArray*
&
result, int length) {
result = OpenMM_Platform_loadPluginsFromDirectory(string(directory, length).c_str());
};
void OPENMM_PLATFORM_LOADPLUGINSFROMDIRECTORY(const char* directory, OpenMM_StringArray*
&
result, int length) {
OPENMM_EXPORT
void OPENMM_PLATFORM_LOADPLUGINSFROMDIRECTORY(const char* directory, OpenMM_StringArray*
&
result, int length) {
result = OpenMM_Platform_loadPluginsFromDirectory(string(directory, length).c_str());
};
...
...
@@ -250,48 +250,48 @@ void OPENMM_PLATFORM_LOADPLUGINSFROMDIRECTORY(const char* directory, OpenMM_Stri
<xsl:variable
name=
"name_lower"
select=
"lower-case($name)"
/>
<xsl:variable
name=
"name_upper"
select=
"upper-case($name)"
/>
/*
<xsl:value-of
select=
"$name"
/>
*/
void
<xsl:value-of
select=
"$name_lower"
/>
_create_(
<xsl:value-of
select=
"$name"
/>
*
&
result, const int
&
size) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name_lower"
/>
_create_(
<xsl:value-of
select=
"$name"
/>
*
&
result, const int
&
size) {
result =
<xsl:value-of
select=
"$name"
/>
_create(size);
}
void
<xsl:value-of
select=
"$name_upper"
/>
_CREATE(
<xsl:value-of
select=
"$name"
/>
*
&
result, const int
&
size) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name_upper"
/>
_CREATE(
<xsl:value-of
select=
"$name"
/>
*
&
result, const int
&
size) {
result =
<xsl:value-of
select=
"$name"
/>
_create(size);
}
void
<xsl:value-of
select=
"$name_lower"
/>
_destroy_(
<xsl:value-of
select=
"$name"
/>
*
&
array) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name_lower"
/>
_destroy_(
<xsl:value-of
select=
"$name"
/>
*
&
array) {
<xsl:value-of
select=
"$name"
/>
_destroy(array);
array = 0;
}
void
<xsl:value-of
select=
"$name_upper"
/>
_DESTROY(
<xsl:value-of
select=
"$name"
/>
*
&
array) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name_upper"
/>
_DESTROY(
<xsl:value-of
select=
"$name"
/>
*
&
array) {
<xsl:value-of
select=
"$name"
/>
_destroy(array);
array = 0;
}
int
<xsl:value-of
select=
"$name_lower"
/>
_getsize_(const
<xsl:value-of
select=
"$name"
/>
* const
&
array) {
OPENMM_EXPORT
int
<xsl:value-of
select=
"$name_lower"
/>
_getsize_(const
<xsl:value-of
select=
"$name"
/>
* const
&
array) {
return
<xsl:value-of
select=
"$name"
/>
_getSize(array);
}
int
<xsl:value-of
select=
"$name_upper"
/>
_GETSIZE(const
<xsl:value-of
select=
"$name"
/>
* const
&
array) {
OPENMM_EXPORT
int
<xsl:value-of
select=
"$name_upper"
/>
_GETSIZE(const
<xsl:value-of
select=
"$name"
/>
* const
&
array) {
return
<xsl:value-of
select=
"$name"
/>
_getSize(array);
}
void
<xsl:value-of
select=
"$name_lower"
/>
_resize_(
<xsl:value-of
select=
"$name"
/>
* const
&
array, const int
&
size) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name_lower"
/>
_resize_(
<xsl:value-of
select=
"$name"
/>
* const
&
array, const int
&
size) {
<xsl:value-of
select=
"$name"
/>
_resize(array, size);
}
void
<xsl:value-of
select=
"$name_upper"
/>
_RESIZE(
<xsl:value-of
select=
"$name"
/>
* const
&
array, const int
&
size) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name_upper"
/>
_RESIZE(
<xsl:value-of
select=
"$name"
/>
* const
&
array, const int
&
size) {
<xsl:value-of
select=
"$name"
/>
_resize(array, size);
}
void
<xsl:value-of
select=
"$name_lower"
/>
_append_(
<xsl:value-of
select=
"$name"
/>
* const
&
array,
<xsl:value-of
select=
"$element_type"
/>
value) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name_lower"
/>
_append_(
<xsl:value-of
select=
"$name"
/>
* const
&
array,
<xsl:value-of
select=
"$element_type"
/>
value) {
<xsl:value-of
select=
"$name"
/>
_append(array, value);
}
void
<xsl:value-of
select=
"$name_upper"
/>
_APPEND(
<xsl:value-of
select=
"$name"
/>
* const
&
array,
<xsl:value-of
select=
"$element_type"
/>
value) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name_upper"
/>
_APPEND(
<xsl:value-of
select=
"$name"
/>
* const
&
array,
<xsl:value-of
select=
"$element_type"
/>
value) {
<xsl:value-of
select=
"$name"
/>
_append(array, value);
}
void
<xsl:value-of
select=
"$name_lower"
/>
_set_(
<xsl:value-of
select=
"$name"
/>
* const
&
array, const int
&
index,
<xsl:value-of
select=
"$element_type"
/>
value) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name_lower"
/>
_set_(
<xsl:value-of
select=
"$name"
/>
* const
&
array, const int
&
index,
<xsl:value-of
select=
"$element_type"
/>
value) {
<xsl:value-of
select=
"$name"
/>
_set(array, index-1, value);
}
void
<xsl:value-of
select=
"$name_upper"
/>
_SET(
<xsl:value-of
select=
"$name"
/>
* const
&
array, const int
&
index,
<xsl:value-of
select=
"$element_type"
/>
value) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name_upper"
/>
_SET(
<xsl:value-of
select=
"$name"
/>
* const
&
array, const int
&
index,
<xsl:value-of
select=
"$element_type"
/>
value) {
<xsl:value-of
select=
"$name"
/>
_set(array, index-1, value);
}
void
<xsl:value-of
select=
"$name_lower"
/>
_get_(const
<xsl:value-of
select=
"$name"
/>
* const
&
array, const int
&
index,
<xsl:value-of
select=
"$element_type"
/>
&
result) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name_lower"
/>
_get_(const
<xsl:value-of
select=
"$name"
/>
* const
&
array, const int
&
index,
<xsl:value-of
select=
"$element_type"
/>
&
result) {
result =
<xsl:value-of
select=
"$name"
/>
_get(array, index-1);
}
void
<xsl:value-of
select=
"$name_upper"
/>
_GET(const
<xsl:value-of
select=
"$name"
/>
* const
&
array, const int
&
index,
<xsl:value-of
select=
"$element_type"
/>
&
result) {
OPENMM_EXPORT
void
<xsl:value-of
select=
"$name_upper"
/>
_GET(const
<xsl:value-of
select=
"$name"
/>
* const
&
array, const int
&
index,
<xsl:value-of
select=
"$element_type"
/>
&
result) {
result =
<xsl:value-of
select=
"$name"
/>
_get(array, index-1);
}
</xsl:template>
...
...
@@ -355,7 +355,7 @@ void <xsl:value-of select="$name_upper"/>_GET(const <xsl:value-of select="$name"
<xsl:template
name=
"constructor"
>
<xsl:param
name=
"function_name"
/>
<xsl:param
name=
"suffix"
/>
<xsl:value-of
select=
"concat('void ', $function_name, '(OpenMM_', @name, '*& result')"
/>
OPENMM_EXPORT
<xsl:value-of
select=
"concat('void ', $function_name, '(OpenMM_', @name, '*& result')"
/>
<!-- Generate the list of arguments -->
<xsl:for-each
select=
"Argument"
>
<xsl:value-of
select=
"', '"
/>
...
...
@@ -398,7 +398,7 @@ void <xsl:value-of select="$name_upper"/>_GET(const <xsl:value-of select="$name"
<!-- Print out the definition of a destructor -->
<xsl:template
name=
"destructor"
>
<xsl:param
name=
"function_name"
/>
<xsl:value-of
select=
"concat('void ', $function_name, '(OpenMM_', @name, '*& destroy) {')"
/>
OPENMM_EXPORT
<xsl:value-of
select=
"concat('void ', $function_name, '(OpenMM_', @name, '*& destroy) {')"
/>
OpenMM_
<xsl:value-of
select=
"concat(@name, '_destroy(destroy);')"
/>
destroy = 0;
}
...
...
@@ -412,7 +412,7 @@ void <xsl:value-of select="$name_upper"/>_GET(const <xsl:value-of select="$name"
<!-- First the method signature -->
<xsl:variable
name=
"has_return"
select=
"@returns=$int_type_id or @returns=$double_type_id"
/>
<xsl:variable
name=
"has_return_arg"
select=
"not($has_return or @returns=$void_type_id)"
/>
<xsl:if
test=
"$has_return"
>
OPENMM_EXPORT
<xsl:if
test=
"$has_return"
>
<xsl:call-template
name=
"wrap_type"
><xsl:with-param
name=
"type_id"
select=
"@returns"
/></xsl:call-template>
</xsl:if>
<xsl:if
test=
"not($has_return)"
>
...
...
@@ -618,4 +618,4 @@ void <xsl:value-of select="$name_upper"/>_GET(const <xsl:value-of select="$name"
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
</xsl:stylesheet>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment