Commit 73183c61 authored by ChayaSt's avatar ChayaSt
Browse files

resolved conflict

parents 0e218233 32e08b87
...@@ -18,7 +18,7 @@ Need Help? Check out the [documentation](http://docs.openmm.org/) and [discussio ...@@ -18,7 +18,7 @@ Need Help? Check out the [documentation](http://docs.openmm.org/) and [discussio
Badges Badges
------ ------
* Travis CI `linux` and `osx` integration tests: * Travis CI `linux` and `osx` integration tests:
* GitHub master [![Build Status](https://travis-ci.org/pandegroup/openmm.png?branch=master)](https://travis-ci.org/pandegroup/openmm) * GitHub master [![Build Status](https://travis-ci.org/pandegroup/openmm.svg?branch=master)](https://travis-ci.org/pandegroup/openmm)
* `openmm-dev` recipe [![Build Status](https://travis-ci.org/omnia-md/conda-dev-recipes.svg?branch=master)](https://travis-ci.org/omnia-md/conda-dev-recipes) * `openmm-dev` recipe [![Build Status](https://travis-ci.org/omnia-md/conda-dev-recipes.svg?branch=master)](https://travis-ci.org/omnia-md/conda-dev-recipes)
* Anaconda Cloud `openmm` conda release: [![Binstar `openmm` conda release](https://anaconda.org/omnia/openmm/badges/version.svg)](https://anaconda.org/omnia/openmm) * Anaconda Cloud `openmm` conda release: [![Binstar `openmm` conda release](https://anaconda.org/omnia/openmm/badges/version.svg)](https://anaconda.org/omnia/openmm)
* Anaconda Cloud `openmm-dev` conda package: [![Binstar `openmm-dev` conda package](https://anaconda.org/omnia/openmm-dev/badges/version.svg)](https://anaconda.org/omnia/openmm-dev) * Anaconda Cloud `openmm-dev` conda package: [![Binstar `openmm-dev` conda package](https://anaconda.org/omnia/openmm-dev/badges/version.svg)](https://anaconda.org/omnia/openmm-dev)
...@@ -27,16 +27,23 @@ FILE(MAKE_DIRECTORY "${SPHINX_BUILD_DIR}") ...@@ -27,16 +27,23 @@ FILE(MAKE_DIRECTORY "${SPHINX_BUILD_DIR}")
FILE(GLOB_RECURSE USER_GUIDE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/usersguide/*) FILE(GLOB_RECURSE USER_GUIDE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/usersguide/*)
FILE(GLOB_RECURSE DEVELOPER_GUIDE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/developerguide/*) FILE(GLOB_RECURSE DEVELOPER_GUIDE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/developerguide/*)
IF(WIN32)
SET(SPHINX_MAKE_USERGUIDE_COMMAND "${CMAKE_COMMAND}" -E env "OPENMM_VERSION=${OPENMM_MAJOR_VERSION}.${OPENMM_MINOR_VERSION}" "BUILDDIR=${SPHINX_BUILD_DIR}/userguide" make.bat)
SET(SPHINX_MAKE_DEVELOPERGUIDE_COMMAND "${CMAKE_COMMAND}" -E env "OPENMM_VERSION=${OPENMM_MAJOR_VERSION}.${OPENMM_MINOR_VERSION}" "BUILDDIR=${SPHINX_BUILD_DIR}/developerguide" make.bat)
ELSE(WIN32)
SET(SPHINX_MAKE_USERGUIDE_COMMAND "${CMAKE_MAKE_PROGRAM}" OPENMM_VERSION="${OPENMM_MAJOR_VERSION}.${OPENMM_MINOR_VERSION}" BUILDDIR="${SPHINX_BUILD_DIR}/userguide")
SET(SPHINX_MAKE_DEVELOPERGUIDE_COMMAND "${CMAKE_MAKE_PROGRAM}" OPENMM_VERSION="${OPENMM_MAJOR_VERSION}.${OPENMM_MINOR_VERSION}" BUILDDIR="${SPHINX_BUILD_DIR}/developerguide")
ENDIF(WIN32)
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT "${SPHINX_BUILD_DIR}/userguide/latex/OpenMMUsersGuide.pdf" OUTPUT "${SPHINX_BUILD_DIR}/userguide/latex/OpenMMUsersGuide.pdf"
COMMAND "${CMAKE_MAKE_PROGRAM}" BUILDDIR="${SPHINX_BUILD_DIR}/userguide" OPENMM_VERSION="${OPENMM_MAJOR_VERSION}.${OPENMM_MINOR_VERSION}" latexpdf COMMAND ${SPHINX_MAKE_USERGUIDE_COMMAND} latexpdf
DEPENDS ${USER_GUIDE_FILES} DEPENDS ${USER_GUIDE_FILES}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/usersguide" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/usersguide"
COMMENT "Generating PDF user guide" COMMENT "Generating PDF user guide"
) )
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT "${SPHINX_BUILD_DIR}/developerguide/latex/OpenMMDeveloperGuide.pdf" OUTPUT "${SPHINX_BUILD_DIR}/developerguide/latex/OpenMMDeveloperGuide.pdf"
COMMAND "${CMAKE_MAKE_PROGRAM}" BUILDDIR="${SPHINX_BUILD_DIR}/developerguide" OPENMM_VERSION="${OPENMM_MAJOR_VERSION}.${OPENMM_MINOR_VERSION}" latexpdf COMMAND ${SPHINX_MAKE_DEVELOPERGUIDE_COMMAND} latexpdf
DEPENDS ${DEVELOPER_GUIDE_FILES} DEPENDS ${DEVELOPER_GUIDE_FILES}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/developerguide" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/developerguide"
COMMENT "Generating PDF developer guide" COMMENT "Generating PDF developer guide"
...@@ -47,14 +54,14 @@ ADD_CUSTOM_TARGET(sphinxpdf ...@@ -47,14 +54,14 @@ ADD_CUSTOM_TARGET(sphinxpdf
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT "${SPHINX_BUILD_DIR}/userguide/html/index.html" OUTPUT "${SPHINX_BUILD_DIR}/userguide/html/index.html"
COMMAND "${CMAKE_MAKE_PROGRAM}" BUILDDIR="${SPHINX_BUILD_DIR}/userguide" OPENMM_VERSION="${OPENMM_MAJOR_VERSION}.${OPENMM_MINOR_VERSION}" html COMMAND ${SPHINX_MAKE_USERGUIDE_COMMAND} html
DEPENDS ${USER_GUIDE_FILES} DEPENDS ${USER_GUIDE_FILES}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/usersguide" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/usersguide"
COMMENT "Generating HTML user guide" COMMENT "Generating HTML user guide"
) )
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT "${SPHINX_BUILD_DIR}/developerguide/html/index.html" OUTPUT "${SPHINX_BUILD_DIR}/developerguide/html/index.html"
COMMAND "${CMAKE_MAKE_PROGRAM}" BUILDDIR="${SPHINX_BUILD_DIR}/developerguide" OPENMM_VERSION="${OPENMM_MAJOR_VERSION}.${OPENMM_MINOR_VERSION}" html COMMAND ${SPHINX_MAKE_DEVELOPERGUIDE_COMMAND} html
DEPENDS ${DEVELOPER_GUIDE_FILES} DEPENDS ${DEVELOPER_GUIDE_FILES}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/developerguide" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/developerguide"
COMMENT "Generating HTML developer guide" COMMENT "Generating HTML developer guide"
......
Portions copyright (c) 2011-2015 Stanford University and the Authors Portions copyright (c) 2011-2016 Stanford University and the Authors
Contributors: Peter Eastman Contributors: Peter Eastman
......
@ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
REM set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. texinfo to make Texinfo files
echo. gettext to make PO message catalogs
echo. changes to make an overview over all changed/added/deprecated items
echo. xml to make Docutils-native XML files
echo. pseudoxml to make pseudoxml-XML files for display purposes
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
echo. coverage to run coverage check of the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 2> nul
if errorlevel 9009 goto sphinx_python
goto sphinx_ok
:sphinx_python
set SPHINXBUILD=python -m sphinx.__init__
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
:sphinx_ok
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\OpenMM.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\OpenMM.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdf" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdfja" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf-ja
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "texinfo" (
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
goto end
)
if "%1" == "gettext" (
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
if "%1" == "coverage" (
%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
if errorlevel 1 exit /b 1
echo.
echo.Testing of coverage in the sources finished, look at the ^
results in %BUILDDIR%/coverage/python.txt.
goto end
)
if "%1" == "xml" (
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The XML files are in %BUILDDIR%/xml.
goto end
)
if "%1" == "pseudoxml" (
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
goto end
)
:end
...@@ -395,7 +395,7 @@ files in the newer PDBx/mmCIF format: just change :class:`PDBFile` to :class:`PD ...@@ -395,7 +395,7 @@ files in the newer PDBx/mmCIF format: just change :class:`PDBFile` to :class:`PD
This line specifies the force field to use for the simulation. Force fields are This line specifies the force field to use for the simulation. Force fields are
defined by XML files. OpenMM includes XML files defining lots of standard force fields (see Section :ref:`force-fields`). defined by XML files. OpenMM includes XML files defining lots of standard force fields (see Section :ref:`force-fields`).
If you find you need to extend the repertoire of force fields available, If you find you need to extend the repertoire of force fields available,
you can find more information on how to create these XML files in Section :ref:`creating-force-fields`. you can find more information on how to create these XML files in Chapter :ref:`creating-force-fields`.
In this case we load two of those files: :file:`amber99sb.xml`, which contains the In this case we load two of those files: :file:`amber99sb.xml`, which contains the
Amber99SB force field, and :file:`tip3p.xml`, which contains the TIP3P water model. The Amber99SB force field, and :file:`tip3p.xml`, which contains the TIP3P water model. The
:class:`ForceField` object is assigned to a variable called :code:`forcefield`\ . :class:`ForceField` object is assigned to a variable called :code:`forcefield`\ .
...@@ -417,10 +417,8 @@ Note the way we specified the cutoff distance 1 nm using :code:`1*nanometer`: ...@@ -417,10 +417,8 @@ Note the way we specified the cutoff distance 1 nm using :code:`1*nanometer`:
This is an example of the powerful units tracking and automatic conversion facility This is an example of the powerful units tracking and automatic conversion facility
built into the OpenMM Python API that makes specifying unit-bearing quantities built into the OpenMM Python API that makes specifying unit-bearing quantities
convenient and less error-prone. We could have equivalently specified convenient and less error-prone. We could have equivalently specified
:code:`10*angstrom` instead of :code:`1*nanometer` and achieved the same result, :code:`10*angstrom` instead of :code:`1*nanometer` and achieved the same result.
but had we specified the wrong dimensions, such as :code:`1*(nanometer**2)` or The units system will be described in more detail later, in Section :ref:`units-and-dimensional-analysis`.
:code:`1*picoseconds`, OpenMM would have thrown an exception. The units system
will be described in more detail later, in Section :ref:`units-and-dimensional-analysis`.
:: ::
integrator = LangevinIntegrator(300*kelvin, 1/picosecond, 0.002*picoseconds) integrator = LangevinIntegrator(300*kelvin, 1/picosecond, 0.002*picoseconds)
...@@ -748,7 +746,7 @@ double precision: ...@@ -748,7 +746,7 @@ double precision:
:: ::
platform = Platform.getPlatformByName('CUDA') platform = Platform.getPlatformByName('CUDA')
properties = {'CudaDeviceIndex': '0,1', 'CudaPrecision': 'double'} properties = {'DeviceIndex': '0,1', 'Precision': 'double'}
simulation = Simulation(prmtop.topology, system, integrator, platform, properties) simulation = Simulation(prmtop.topology, system, integrator, platform, properties)
.. _force-fields: .. _force-fields:
...@@ -1322,11 +1320,12 @@ Writing Trajectories ...@@ -1322,11 +1320,12 @@ Writing Trajectories
==================== ====================
OpenMM can save simulation trajectories to disk in two formats: PDB_ and DCD_. OpenMM can save simulation trajectories to disk in three formats: PDB_,
Both of these are widely supported formats, so you should be able to read them `PDBx/mmCIF`_, and DCD_. All of these are widely supported formats, so you
into most analysis and visualization programs. should be able to read them into most analysis and visualization programs.
.. _PDB: http://www.wwpdb.org/documentation/format33/v3.3.html .. _PDB: http://www.wwpdb.org/documentation/format33/v3.3.html
.. _PDBx/mmCIF: http://mmcif.wwpdb.org
.. _DCD: http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/dcdplugin.html .. _DCD: http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/dcdplugin.html
To save a trajectory, just add a reporter to the simulation, as shown in the To save a trajectory, just add a reporter to the simulation, as shown in the
...@@ -1336,9 +1335,9 @@ example scripts above: ...@@ -1336,9 +1335,9 @@ example scripts above:
simulation.reporters.append(PDBReporter('output.pdb', 1000)) simulation.reporters.append(PDBReporter('output.pdb', 1000))
The two parameters of the :class:`PDBReporter` are the output filename and how often (in The two parameters of the :class:`PDBReporter` are the output filename and how often (in
number of time steps) output structures should be written. To use DCD format, number of time steps) output structures should be written. To use PDBx/mmCIF or
just replace :class:`PDBReporter` with :class:`DCDReporter`. The parameters represent the DCD format, just replace :class:`PDBReporter` with :class:`PDBxReporter` or
same values: :class:`DCDReporter`. The parameters represent the same values:
:: ::
simulation.reporters.append(DCDReporter('output.dcd', 1000)) simulation.reporters.append(DCDReporter('output.dcd', 1000))
...@@ -1771,8 +1770,8 @@ not an arbitrary choice. ...@@ -1771,8 +1770,8 @@ not an arbitrary choice.
Extracting and Reporting Forces (and other data) Extracting and Reporting Forces (and other data)
************************************************ ************************************************
OpenMM provides reporters for two output formats: PDB_ and DCD_. Both of those OpenMM provides reporters for three output formats: PDB_, `PDBx/mmCIF`_ and DCD_.
formats store only positions, not velocities, forces, or other data. In this All of those formats store only positions, not velocities, forces, or other data. In this
section, we create a new reporter that outputs forces. This illustrates two section, we create a new reporter that outputs forces. This illustrates two
important things: how to write a reporter, and how to query the simulation for important things: how to write a reporter, and how to query the simulation for
forces or other data. forces or other data.
...@@ -1862,7 +1861,7 @@ the potential energy of each one. Assume we have already created our :class:`Sy ...@@ -1862,7 +1861,7 @@ the potential energy of each one. Assume we have already created our :class:`Sy
pdb = PDBFile(os.path.join('structures', file)) pdb = PDBFile(os.path.join('structures', file))
simulation.context.setPositions(pdb.positions) simulation.context.setPositions(pdb.positions)
state = simulation.context.getState(getEnergy=True) state = simulation.context.getState(getEnergy=True)
print file, state.getPotentialEnergy() print(file, state.getPotentialEnergy())
.. caption:: .. caption::
...@@ -2068,7 +2067,7 @@ Missing residue templates ...@@ -2068,7 +2067,7 @@ Missing residue templates
========================= =========================
.. CAUTION:: .. CAUTION::
These features are experimental, and its API is subject to change. These features are experimental, and their API is subject to change.
You can use the :meth:`getUnmatchedResidues()` method to get a list of residues You can use the :meth:`getUnmatchedResidues()` method to get a list of residues
in the provided :code:`topology` object that do not currently have a matching in the provided :code:`topology` object that do not currently have a matching
...@@ -2106,7 +2105,7 @@ are being matched: ...@@ -2106,7 +2105,7 @@ are being matched:
forcefield = ForceField('amber99sb.xml', 'tip3p.xml') forcefield = ForceField('amber99sb.xml', 'tip3p.xml')
templates = forcefield.getMatchingTemplates(topology) templates = forcefield.getMatchingTemplates(topology)
for (residue, template) in zip(pdb.topology.residues(), templates): for (residue, template) in zip(pdb.topology.residues(), templates):
print "Residue %d %s matched template %s" % (residue.id, residue.name, template.name) print("Residue %d %s matched template %s" % (residue.id, residue.name, template.name))
<HarmonicBondForce> <HarmonicBondForce>
=================== ===================
...@@ -2916,17 +2915,19 @@ This :code:`generator` function must conform to the following API: ...@@ -2916,17 +2915,19 @@ This :code:`generator` function must conform to the following API:
------- -------
success : bool success : bool
If the generator is able to successfully parameterize the residue, `True` is returned. If the generator is able to successfully parameterize the residue, `True` is returned.
If the generator cannot parameterize the residue, it should return `False` and not modify `forcefield`. If the generator cannot parameterize the residue, it should return `False` and not
modify `forcefield`.
The generator should either register a residue template directly with `forcefield.registerResidueTemplate(template)` The generator should either register a residue template directly with
or it should call `forcefield.loadFile(file)` to load residue definitions from an ffxml file. `forcefield.registerResidueTemplate(template)` or it should call `forcefield.loadFile(file)`
to load residue definitions from an ffxml file.
It can also use the `ForceField` programmatic API to add additional atom types (via `forcefield.registerAtomType(parameters)`) It can also use the `ForceField` programmatic API to add additional atom types (via
or additional parameters. `forcefield.registerAtomType(parameters)`) or additional parameters.
""" """
The :code:`ForceField` object will be modified by the residue template generator as residues without previously The :class:`ForceField` object will be modified by the residue template generator as residues without previously
defined templates are encountered. Because these templates are added to `ForceField` as new residue defined templates are encountered. Because these templates are added to the :class:`ForceField` as new residue
types are encountered, subsequent residues will be parameterized using the same residue templates without types are encountered, subsequent residues will be parameterized using the same residue templates without
calling the :code:`generator` again. calling the :code:`generator` again.
...@@ -347,11 +347,6 @@ The choice of which platform to use for a simulation depends on various factors: ...@@ -347,11 +347,6 @@ The choice of which platform to use for a simulation depends on various factors:
OpenCL platform running on the CPU. OpenCL platform running on the CPU.
#. The CUDA platform can only be used with NVIDIA GPUs. For using an AMD or #. The CUDA platform can only be used with NVIDIA GPUs. For using an AMD or
Intel GPU, use the OpenCL platform. Intel GPU, use the OpenCL platform.
#. When running on recent NVIDIA GPUs (Fermi and Kepler generations), the CUDA
platform is usually faster and should be used. On older GPUs, the OpenCL
platform is likely to be faster. Also, some very old GPUs (GeForce 8000 and
9000 series) are only supported by the OpenCL platform, not by the CUDA
platform.
#. The AMOEBA force field only works with the CUDA platform, not with the OpenCL #. The AMOEBA force field only works with the CUDA platform, not with the OpenCL
platform. It also works with the Reference and CPU platforms, but the performance platform. It also works with the Reference and CPU platforms, but the performance
is usually too slow to be useful on those platforms. is usually too slow to be useful on those platforms.
...@@ -393,14 +388,9 @@ Mac and Linux: clang or gcc ...@@ -393,14 +388,9 @@ Mac and Linux: clang or gcc
Use clang or gcc on Mac/Linux. OpenMM should compile correctly with all recent Use clang or gcc on Mac/Linux. OpenMM should compile correctly with all recent
versions of these compilers. We recommend clang since it produces faster code, versions of these compilers. We recommend clang since it produces faster code,
especially when using the CPU platform. especially when using the CPU platform. If you do not already have a compiler
installed, you will need to download and install it. On Mac OS X, this means
If you do not already have a compiler installed, you will need to download and downloading the Xcode Tools from the App Store.
install it. On Mac OS X, this means downloading the Xcode Tools from the App
Store. (With Xcode 4.3, you must then launch Xcode, open the Preferences window,
go to the Downloads tab, and tell it to install the command line tools. With
Xcode 4.2 and earlier, the command line tools are automatically installed when
you install Xcode.)
Windows: Visual Studio Windows: Visual Studio
---------------------- ----------------------
...@@ -545,6 +535,8 @@ There are several variables that can be adjusted in the CMake interface: ...@@ -545,6 +535,8 @@ There are several variables that can be adjusted in the CMake interface:
and documentation. and documentation.
* Set the variable CMAKE_INSTALL_PREFIX to the location where you want to * Set the variable CMAKE_INSTALL_PREFIX to the location where you want to
install OpenMM. install OpenMM.
* Set the variable PYTHON_EXECUTABLE to the Python interpreter you plan to use
OpenMM with.
Configure (press c) again. Adjust any variables that cause an Configure (press c) again. Adjust any variables that cause an
...@@ -1844,7 +1836,7 @@ Context constructor: ...@@ -1844,7 +1836,7 @@ Context constructor:
Platform& platform = Platform::getPlatformByName("OpenCL"); Platform& platform = Platform::getPlatformByName("OpenCL");
map<string, string> properties; map<string, string> properties;
properties["OpenCLDeviceIndex"] = "1"; properties["DeviceIndex"] = "1";
Context context(system, integrator, platform, properties); Context context(system, integrator, platform, properties);
After a Context is created, you can use the Platform’s \ After a Context is created, you can use the Platform’s \
...@@ -1855,7 +1847,7 @@ OpenCL Platform ...@@ -1855,7 +1847,7 @@ OpenCL Platform
The OpenCL Platform recognizes the following Platform-specific properties: The OpenCL Platform recognizes the following Platform-specific properties:
* OpenCLPrecision: This selects what numeric precision to use for calculations. * Precision: This selects what numeric precision to use for calculations.
The allowed values are “single”, “mixed”, and “double”. If it is set to The allowed values are “single”, “mixed”, and “double”. If it is set to
“single”, nearly all calculations are done in single precision. This is the “single”, nearly all calculations are done in single precision. This is the
fastest option but also the least accurate. If it is set to “mixed”, forces are fastest option but also the least accurate. If it is set to “mixed”, forces are
...@@ -1863,7 +1855,7 @@ The OpenCL Platform recognizes the following Platform-specific properties: ...@@ -1863,7 +1855,7 @@ The OpenCL Platform recognizes the following Platform-specific properties:
gives much better energy conservation with only a slight decrease in speed. gives much better energy conservation with only a slight decrease in speed.
If it is set to “double”, all calculations are done in double precision. This If it is set to “double”, all calculations are done in double precision. This
is the most accurate option, but is usually much slower than the others. is the most accurate option, but is usually much slower than the others.
* OpenCLUseCpuPme: This selects whether to use the CPU-based PME * UseCpuPme: This selects whether to use the CPU-based PME
implementation. The allowed values are “true” or “false”. Depending on your implementation. The allowed values are “true” or “false”. Depending on your
hardware, this might (or might not) improve performance. To use this option, hardware, this might (or might not) improve performance. To use this option,
you must have FFTW (single precision, multithreaded) installed, and your CPU you must have FFTW (single precision, multithreaded) installed, and your CPU
...@@ -1873,19 +1865,19 @@ The OpenCL Platform recognizes the following Platform-specific properties: ...@@ -1873,19 +1865,19 @@ The OpenCL Platform recognizes the following Platform-specific properties:
zero-based index of the platform (in the OpenCL sense, not the OpenMM sense) to use, zero-based index of the platform (in the OpenCL sense, not the OpenMM sense) to use,
in the order they are returned by the OpenCL platform API. This is useful, for in the order they are returned by the OpenCL platform API. This is useful, for
example, in selecting whether to use a GPU or CPU based OpenCL implementation. example, in selecting whether to use a GPU or CPU based OpenCL implementation.
* OpenCLDeviceIndex: When multiple OpenCL devices are available on your * DeviceIndex: When multiple OpenCL devices are available on your
computer, this is used to select which one to use. The value is the zero-based computer, this is used to select which one to use. The value is the zero-based
index of the device to use, in the order they are returned by the OpenCL device index of the device to use, in the order they are returned by the OpenCL device
API. API.
The OpenCL Platform also supports parallelizing a simulation across multiple The OpenCL Platform also supports parallelizing a simulation across multiple
GPUs. To do that, set the OpenCLDeviceIndex property to a comma separated list GPUs. To do that, set the DeviceIndex property to a comma separated list
of values. For example, of values. For example,
.. code-block:: c .. code-block:: c
properties["OpenCLDeviceIndex"] = "0,1"; properties["DeviceIndex"] = "0,1";
This tells it to use both devices 0 and 1, splitting the work between them. This tells it to use both devices 0 and 1, splitting the work between them.
...@@ -1894,7 +1886,7 @@ CUDA Platform ...@@ -1894,7 +1886,7 @@ CUDA Platform
The CUDA Platform recognizes the following Platform-specific properties: The CUDA Platform recognizes the following Platform-specific properties:
* CudaPrecision: This selects what numeric precision to use for calculations. * Precision: This selects what numeric precision to use for calculations.
The allowed values are “single”, “mixed”, and “double”. If it is set to The allowed values are “single”, “mixed”, and “double”. If it is set to
“single”, nearly all calculations are done in single precision. This is the “single”, nearly all calculations are done in single precision. This is the
fastest option but also the least accurate. If it is set to “mixed”, forces are fastest option but also the least accurate. If it is set to “mixed”, forces are
...@@ -1902,7 +1894,7 @@ The CUDA Platform recognizes the following Platform-specific properties: ...@@ -1902,7 +1894,7 @@ The CUDA Platform recognizes the following Platform-specific properties:
gives much better energy conservation with only a slight decrease in speed. gives much better energy conservation with only a slight decrease in speed.
If it is set to “double”, all calculations are done in double precision. This If it is set to “double”, all calculations are done in double precision. This
is the most accurate option, but is usually much slower than the others. is the most accurate option, but is usually much slower than the others.
* CudaUseCpuPme: This selects whether to use the CPU-based PME implementation. * UseCpuPme: This selects whether to use the CPU-based PME implementation.
The allowed values are “true” or “false”. Depending on your hardware, this The allowed values are “true” or “false”. Depending on your hardware, this
might (or might not) improve performance. To use this option, you must have might (or might not) improve performance. To use this option, you must have
FFTW (single precision, multithreaded) installed, and your CPU must support SSE FFTW (single precision, multithreaded) installed, and your CPU must support SSE
...@@ -1920,28 +1912,36 @@ The CUDA Platform recognizes the following Platform-specific properties: ...@@ -1920,28 +1912,36 @@ The CUDA Platform recognizes the following Platform-specific properties:
appends \nvcc.exe to it. That environment variable is set by the CUDA appends \nvcc.exe to it. That environment variable is set by the CUDA
installer, so it usually is present. installer, so it usually is present.
* CudaTempDirectory: This specifies a directory where temporary files can be * TempDirectory: This specifies a directory where temporary files can be
written while compiling kernels. OpenMM usually can locate your operating written while compiling kernels. OpenMM usually can locate your operating
system’s temp directory automatically (for example, by looking for the TEMP system’s temp directory automatically (for example, by looking for the TEMP
environment variable), so you rarely need to specify this. environment variable), so you rarely need to specify this.
* CudaDeviceIndex: When multiple CUDA devices are available on your computer, * DeviceIndex: When multiple CUDA devices are available on your computer,
this is used to select which one to use. The value is the zero-based index of this is used to select which one to use. The value is the zero-based index of
the device to use, in the order they are returned by the CUDA API. the device to use, in the order they are returned by the CUDA API.
* CudaUseBlockingSync: This is used to control how the CUDA runtime * UseBlockingSync: This is used to control how the CUDA runtime
synchronizes between the CPU and GPU. If this is set to “true” (the default), synchronizes between the CPU and GPU. If this is set to “true” (the default),
CUDA will allow the calling thread to sleep while the GPU is performing a CUDA will allow the calling thread to sleep while the GPU is performing a
computation, allowing the CPU to do other work. If it is set to “false”, CUDA computation, allowing the CPU to do other work. If it is set to “false”, CUDA
will spin-lock while the GPU is working. Setting it to "false" can improve performance slightly, will spin-lock while the GPU is working. Setting it to "false" can improve performance slightly,
but also prevents the CPU from doing anything else while the GPU is working. but also prevents the CPU from doing anything else while the GPU is working.
* DeterministicForces: In some cases, the CUDA platform may compute forces
in ways that are not fully deterministic (typically differing in what order a
set of numbers get added together). This means that if you compute the forces
twice for the same particle positions, there may be tiny differences in the
results. In most cases this is not a problem, but certain algorithms depend
on forces being exactly reproducible to the last bit. If you set this
property to "true", it will instead do these calculations in a way that
produces fully deterministic results, at the cost of a small decrease in
performance.
The CUDA Platform also supports parallelizing a simulation across multiple GPUs. The CUDA Platform also supports parallelizing a simulation across multiple GPUs.
To do that, set the CudaDeviceIndex property to a comma separated list of To do that, set the DeviceIndex property to a comma separated list of
values. For example, values. For example,
.. code-block:: c .. code-block:: c
properties["CudaDeviceIndex"] = "0,1"; properties["DeviceIndex"] = "0,1";
This tells it to use both devices 0 and 1, splitting the work between them. This tells it to use both devices 0 and 1, splitting the work between them.
...@@ -1950,7 +1950,7 @@ CPU Platform ...@@ -1950,7 +1950,7 @@ CPU Platform
The CPU Platform recognizes the following Platform-specific properties: The CPU Platform recognizes the following Platform-specific properties:
* CpuThreads: This specifies the number of CPU threads to use. If you do not * Threads: This specifies the number of CPU threads to use. If you do not
specify this, OpenMM will select a default number of threads as follows: specify this, OpenMM will select a default number of threads as follows:
* If an environment variable called OPENMM_CPU_THREADS is set, its value is * If an environment variable called OPENMM_CPU_THREADS is set, its value is
......
Portions copyright (c) 2008-2015 Stanford University and the Authors Portions copyright (c) 2008-2016 Stanford University and the Authors
Contributors: Kyle Beauchamp, Christopher Bruns, John Chodera, Peter Eastman, Mark Contributors: Kyle Beauchamp, Christopher Bruns, John Chodera, Peter Eastman, Mark
Friedrichs, Joy P. Ku, Tom Markland, Vijay Pande, Randy Radmer, Michael Sherman, Friedrichs, Joy P. Ku, Tom Markland, Vijay Pande, Randy Radmer, Michael Sherman,
......
@ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
REM set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. texinfo to make Texinfo files
echo. gettext to make PO message catalogs
echo. changes to make an overview over all changed/added/deprecated items
echo. xml to make Docutils-native XML files
echo. pseudoxml to make pseudoxml-XML files for display purposes
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
echo. coverage to run coverage check of the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 2> nul
if errorlevel 9009 goto sphinx_python
goto sphinx_ok
:sphinx_python
set SPHINXBUILD=python -m sphinx.__init__
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
:sphinx_ok
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\OpenMM.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\OpenMM.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdf" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdfja" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf-ja
cd %~dp0
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "texinfo" (
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
goto end
)
if "%1" == "gettext" (
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
if "%1" == "coverage" (
%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
if errorlevel 1 exit /b 1
echo.
echo.Testing of coverage in the sources finished, look at the ^
results in %BUILDDIR%/coverage/python.txt.
goto end
)
if "%1" == "xml" (
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The XML files are in %BUILDDIR%/xml.
goto end
)
if "%1" == "pseudoxml" (
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
goto end
)
:end
...@@ -81,18 +81,12 @@ def runOneTest(testName, options): ...@@ -81,18 +81,12 @@ def runOneTest(testName, options):
print('Step Size: %g fs' % dt.value_in_unit(unit.femtoseconds)) print('Step Size: %g fs' % dt.value_in_unit(unit.femtoseconds))
properties = {} properties = {}
initialSteps = 5 initialSteps = 5
if options.device is not None: if options.device is not None and platform.getName() in ('CUDA', 'OpenCL'):
if platform.getName() == 'CUDA': properties['DeviceIndex'] = options.device
properties['CudaDeviceIndex'] = options.device
elif platform.getName() == 'OpenCL':
properties['OpenCLDeviceIndex'] = options.device
if ',' in options.device or ' ' in options.device: if ',' in options.device or ' ' in options.device:
initialSteps = 250 initialSteps = 250
if options.precision is not None: if options.precision is not None and platform.getName() in ('CUDA', 'OpenCL'):
if platform.getName() == 'CUDA': properties['Precision'] = options.precision
properties['CudaPrecision'] = options.precision
elif platform.getName() == 'OpenCL':
properties['OpenCLPrecision'] = options.precision
# Run the simulation. # Run the simulation.
......
...@@ -78,6 +78,7 @@ CompiledExpression& CompiledExpression::operator=(const CompiledExpression& expr ...@@ -78,6 +78,7 @@ CompiledExpression& CompiledExpression::operator=(const CompiledExpression& expr
for (int i = 0; i < (int) operation.size(); i++) for (int i = 0; i < (int) operation.size(); i++)
operation[i] = expression.operation[i]->clone(); operation[i] = expression.operation[i]->clone();
#ifdef LEPTON_USE_JIT #ifdef LEPTON_USE_JIT
if (workspace.size() > 0)
generateJitCode(); generateJitCode();
#endif #endif
return *this; return *this;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for * * Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. * * Medical Research, grant U54 GM072970. See https://simtk.org. *
* * * *
* Portions copyright (c) 2008-2012 Stanford University and the Authors. * * Portions copyright (c) 2008-2016 Stanford University and the Authors. *
* Authors: Peter Eastman * * Authors: Peter Eastman *
* Contributors: * * Contributors: *
* * * *
...@@ -236,7 +236,9 @@ protected: ...@@ -236,7 +236,9 @@ protected:
*/ */
const ContextImpl& getContextImpl(const Context& context) const; const ContextImpl& getContextImpl(const Context& context) const;
std::vector<std::string> platformProperties; std::vector<std::string> platformProperties;
std::map<std::string, std::string> deprecatedPropertyReplacements;
private: private:
friend class ContextImpl;
std::map<std::string, KernelFactory*> kernelFactories; std::map<std::string, KernelFactory*> kernelFactories;
std::map<std::string, std::string> defaultProperties; std::map<std::string, std::string> defaultProperties;
static std::vector<Platform*>& getPlatforms(); static std::vector<Platform*>& getPlatforms();
......
...@@ -187,7 +187,7 @@ public: ...@@ -187,7 +187,7 @@ public:
* @param b the vector defining the second edge of the periodic box * @param b the vector defining the second edge of the periodic box
* @param c the vector defining the third edge of the periodic box * @param c the vector defining the third edge of the periodic box
*/ */
virtual void setPeriodicBoxVectors(ContextImpl& context, const Vec3& a, const Vec3& b, const Vec3& c) const = 0; virtual void setPeriodicBoxVectors(ContextImpl& context, const Vec3& a, const Vec3& b, const Vec3& c) = 0;
/** /**
* Create a checkpoint recording the current state of the Context. * Create a checkpoint recording the current state of the Context.
* *
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for * * Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. * * Medical Research, grant U54 GM072970. See https://simtk.org. *
* * * *
* Portions copyright (c) 2008-2012 Stanford University and the Authors. * * Portions copyright (c) 2008-2016 Stanford University and the Authors. *
* Authors: Peter Eastman * * Authors: Peter Eastman *
* Contributors: * * Contributors: *
* * * *
...@@ -89,15 +89,21 @@ void Platform::setPropertyValue(Context& context, const string& property, const ...@@ -89,15 +89,21 @@ void Platform::setPropertyValue(Context& context, const string& property, const
} }
const string& Platform::getPropertyDefaultValue(const string& property) const { const string& Platform::getPropertyDefaultValue(const string& property) const {
map<string, string>::const_iterator value = defaultProperties.find(property); string propertyName = property;
if (deprecatedPropertyReplacements.find(property) != deprecatedPropertyReplacements.end())
propertyName = deprecatedPropertyReplacements.find(property)->second;
map<string, string>::const_iterator value = defaultProperties.find(propertyName);
if (value == defaultProperties.end()) if (value == defaultProperties.end())
throw OpenMMException("getPropertyDefaultValue: Illegal property name"); throw OpenMMException("getPropertyDefaultValue: Illegal property name");
return value->second; return value->second;
} }
void Platform::setPropertyDefaultValue(const string& property, const string& value) { void Platform::setPropertyDefaultValue(const string& property, const string& value) {
string propertyName = property;
if (deprecatedPropertyReplacements.find(property) != deprecatedPropertyReplacements.end())
propertyName = deprecatedPropertyReplacements.find(property)->second;
for (int i = 0; i < (int) platformProperties.size(); i++) for (int i = 0; i < (int) platformProperties.size(); i++)
if (platformProperties[i] == property) { if (platformProperties[i] == propertyName) {
defaultProperties[property] = value; defaultProperties[property] = value;
return; return;
} }
...@@ -314,7 +320,11 @@ const string& Platform::getDefaultPluginsDirectory() { ...@@ -314,7 +320,11 @@ const string& Platform::getDefaultPluginsDirectory() {
#define STRING(x) STRING1(x) #define STRING(x) STRING1(x)
const string& Platform::getOpenMMVersion() { const string& Platform::getOpenMMVersion() {
#if OPENMM_BUILD_VERSION == 0
static const string version = STRING(OPENMM_MAJOR_VERSION) "." STRING(OPENMM_MINOR_VERSION); static const string version = STRING(OPENMM_MAJOR_VERSION) "." STRING(OPENMM_MINOR_VERSION);
#else
static const string version = STRING(OPENMM_MAJOR_VERSION) "." STRING(OPENMM_MINOR_VERSION) "." STRING(OPENMM_BUILD_VERSION);
#endif
return version; return version;
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for * * Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. * * Medical Research, grant U54 GM072970. See https://simtk.org. *
* * * *
* Portions copyright (c) 2010-2015 Stanford University and the Authors. * * Portions copyright (c) 2010-2016 Stanford University and the Authors. *
* Authors: Peter Eastman * * Authors: Peter Eastman *
* Contributors: * * Contributors: *
* * * *
...@@ -159,15 +159,18 @@ public: ...@@ -159,15 +159,18 @@ public:
* new bonds and torsions cannot be added. * new bonds and torsions cannot be added.
*/ */
void updateParametersInContext(Context& context); void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/** /**
* Returns whether or not this force makes use of periodic boundary * Returns whether or not this force makes use of periodic boundary
* conditions. * conditions.
* *
* @returns false * @returns true if force uses PBC and false otherwise
*/ */
bool usesPeriodicBoundaryConditions() const { bool usesPeriodicBoundaryConditions() const;
return false;
}
protected: protected:
ForceImpl* createImpl() const; ForceImpl* createImpl() const;
private: private:
...@@ -175,6 +178,7 @@ private: ...@@ -175,6 +178,7 @@ private:
class CMAPTorsionInfo; class CMAPTorsionInfo;
std::vector<MapInfo> maps; std::vector<MapInfo> maps;
std::vector<CMAPTorsionInfo> torsions; std::vector<CMAPTorsionInfo> torsions;
bool usePeriodic;
}; };
/** /**
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for * * Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. * * Medical Research, grant U54 GM072970. See https://simtk.org. *
* * * *
* Portions copyright (c) 2010-2012 Stanford University and the Authors. * * Portions copyright (c) 2010-2016 Stanford University and the Authors. *
* Authors: Peter Eastman * * Authors: Peter Eastman *
* Contributors: * * Contributors: *
* * * *
...@@ -203,15 +203,18 @@ public: ...@@ -203,15 +203,18 @@ public:
* the Context. The set of particles involved in a angle cannot be changed, nor can new angles be added. * the Context. The set of particles involved in a angle cannot be changed, nor can new angles be added.
*/ */
void updateParametersInContext(Context& context); void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/** /**
* Returns whether or not this force makes use of periodic boundary * Returns whether or not this force makes use of periodic boundary
* conditions. * conditions.
* *
* @returns false * @returns true if force uses PBC and false otherwise
*/ */
bool usesPeriodicBoundaryConditions() const { bool usesPeriodicBoundaryConditions() const;
return false;
}
protected: protected:
ForceImpl* createImpl() const; ForceImpl* createImpl() const;
private: private:
...@@ -222,6 +225,7 @@ private: ...@@ -222,6 +225,7 @@ private:
std::vector<AngleParameterInfo> parameters; std::vector<AngleParameterInfo> parameters;
std::vector<GlobalParameterInfo> globalParameters; std::vector<GlobalParameterInfo> globalParameters;
std::vector<AngleInfo> angles; std::vector<AngleInfo> angles;
bool usePeriodic;
}; };
/** /**
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for * * Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. * * Medical Research, grant U54 GM072970. See https://simtk.org. *
* * * *
* Portions copyright (c) 2008-2012 Stanford University and the Authors. * * Portions copyright (c) 2008-2016 Stanford University and the Authors. *
* Authors: Peter Eastman * * Authors: Peter Eastman *
* Contributors: * * Contributors: *
* * * *
...@@ -200,15 +200,18 @@ public: ...@@ -200,15 +200,18 @@ public:
* the Context. The set of particles involved in a bond cannot be changed, nor can new bonds be added. * the Context. The set of particles involved in a bond cannot be changed, nor can new bonds be added.
*/ */
void updateParametersInContext(Context& context); void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/** /**
* Returns whether or not this force makes use of periodic boundary * Returns whether or not this force makes use of periodic boundary
* conditions. * conditions.
* *
* @returns false * @returns true if force uses PBC and false otherwise
*/ */
bool usesPeriodicBoundaryConditions() const { bool usesPeriodicBoundaryConditions() const;
return false;
}
protected: protected:
ForceImpl* createImpl() const; ForceImpl* createImpl() const;
private: private:
...@@ -219,6 +222,7 @@ private: ...@@ -219,6 +222,7 @@ private:
std::vector<BondParameterInfo> parameters; std::vector<BondParameterInfo> parameters;
std::vector<GlobalParameterInfo> globalParameters; std::vector<GlobalParameterInfo> globalParameters;
std::vector<BondInfo> bonds; std::vector<BondInfo> bonds;
bool usePeriodic;
}; };
/** /**
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for * * Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. * * Medical Research, grant U54 GM072970. See https://simtk.org. *
* * * *
* Portions copyright (c) 2008-2015 Stanford University and the Authors. * * Portions copyright (c) 2008-2016 Stanford University and the Authors. *
* Authors: Peter Eastman * * Authors: Peter Eastman *
* Contributors: * * Contributors: *
* * * *
...@@ -324,15 +324,18 @@ public: ...@@ -324,15 +324,18 @@ public:
* bonds be added. * bonds be added.
*/ */
void updateParametersInContext(Context& context); void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/** /**
* Returns whether or not this force makes use of periodic boundary * Returns whether or not this force makes use of periodic boundary
* conditions. * conditions.
* *
* @returns false * @returns true if force uses PBC and false otherwise
*/ */
bool usesPeriodicBoundaryConditions() const { bool usesPeriodicBoundaryConditions() const;
return false;
}
protected: protected:
ForceImpl* createImpl() const; ForceImpl* createImpl() const;
private: private:
...@@ -348,6 +351,7 @@ private: ...@@ -348,6 +351,7 @@ private:
std::vector<GroupInfo> groups; std::vector<GroupInfo> groups;
std::vector<BondInfo> bonds; std::vector<BondInfo> bonds;
std::vector<FunctionInfo> functions; std::vector<FunctionInfo> functions;
bool usePeriodic;
}; };
/** /**
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for * * Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. * * Medical Research, grant U54 GM072970. See https://simtk.org. *
* * * *
* Portions copyright (c) 2008-2014 Stanford University and the Authors. * * Portions copyright (c) 2008-2016 Stanford University and the Authors. *
* Authors: Peter Eastman * * Authors: Peter Eastman *
* Contributors: * * Contributors: *
* * * *
...@@ -298,15 +298,18 @@ public: ...@@ -298,15 +298,18 @@ public:
* the Context. The set of particles involved in a bond cannot be changed, nor can new bonds be added. * the Context. The set of particles involved in a bond cannot be changed, nor can new bonds be added.
*/ */
void updateParametersInContext(Context& context); void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/** /**
* Returns whether or not this force makes use of periodic boundary * Returns whether or not this force makes use of periodic boundary
* conditions. * conditions.
* *
* @returns false * @returns true if force uses PBC and false otherwise
*/ */
bool usesPeriodicBoundaryConditions() const { bool usesPeriodicBoundaryConditions() const;
return false;
}
protected: protected:
ForceImpl* createImpl() const; ForceImpl* createImpl() const;
private: private:
...@@ -320,6 +323,7 @@ private: ...@@ -320,6 +323,7 @@ private:
std::vector<GlobalParameterInfo> globalParameters; std::vector<GlobalParameterInfo> globalParameters;
std::vector<BondInfo> bonds; std::vector<BondInfo> bonds;
std::vector<FunctionInfo> functions; std::vector<FunctionInfo> functions;
bool usePeriodic;
}; };
/** /**
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for * * Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. * * Medical Research, grant U54 GM072970. See https://simtk.org. *
* * * *
* Portions copyright (c) 2011-2012 Stanford University and the Authors. * * Portions copyright (c) 2011-2016 Stanford University and the Authors. *
* Authors: Peter Eastman * * Authors: Peter Eastman *
* Contributors: * * Contributors: *
* * * *
...@@ -266,15 +266,15 @@ public: ...@@ -266,15 +266,15 @@ public:
/** /**
* Begin an "if" block. * Begin an "if" block.
*/ */
BeginIfBlock = 6, IfBlockStart = 6,
/** /**
* Begin a while" block. * Begin a while" block.
*/ */
BeginWhileBlock = 7, WhileBlockStart = 7,
/** /**
* End an "if" or "while" block. * End an "if" or "while" block.
*/ */
EndBlock = 8 BlockEnd = 8
}; };
/** /**
* Create a CustomIntegrator. * Create a CustomIntegrator.
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for * * Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. * * Medical Research, grant U54 GM072970. See https://simtk.org. *
* * * *
* Portions copyright (c) 2010-2012 Stanford University and the Authors. * * Portions copyright (c) 2010-2016 Stanford University and the Authors. *
* Authors: Peter Eastman * * Authors: Peter Eastman *
* Contributors: * * Contributors: *
* * * *
...@@ -206,15 +206,18 @@ public: ...@@ -206,15 +206,18 @@ public:
* the Context. The set of particles involved in a torsion cannot be changed, nor can new torsions be added. * the Context. The set of particles involved in a torsion cannot be changed, nor can new torsions be added.
*/ */
void updateParametersInContext(Context& context); void updateParametersInContext(Context& context);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void setUsesPeriodicBoundaryConditions(bool periodic);
/** /**
* Returns whether or not this force makes use of periodic boundary * Returns whether or not this force makes use of periodic boundary
* conditions. * conditions.
* *
* @returns true if force uses PBC and false otherwise * @returns true if force uses PBC and false otherwise
*/ */
bool usesPeriodicBoundaryConditions() const { bool usesPeriodicBoundaryConditions() const;
return false;
}
protected: protected:
ForceImpl* createImpl() const; ForceImpl* createImpl() const;
private: private:
...@@ -225,6 +228,7 @@ private: ...@@ -225,6 +228,7 @@ private:
std::vector<TorsionParameterInfo> parameters; std::vector<TorsionParameterInfo> parameters;
std::vector<GlobalParameterInfo> globalParameters; std::vector<GlobalParameterInfo> globalParameters;
std::vector<TorsionInfo> torsions; std::vector<TorsionInfo> torsions;
bool usePeriodic;
}; };
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment