Commit c64a84ec authored by Robert T. McGibbon's avatar Robert T. McGibbon
Browse files

Move things onto one page

parent 293f76e5
...@@ -74,7 +74,7 @@ matrix: ...@@ -74,7 +74,7 @@ matrix:
CC=clang CC=clang
CXX=clang++ CXX=clang++
DOCS_DEPLOY=true DOCS_DEPLOY=true
CMAKE_FLAGS="" CMAKE_FLAGS="-DOPENMM_GENERATE_API_DOCS=ON"
- sudo: false - sudo: false
python: 3.4 python: 3.4
...@@ -142,7 +142,7 @@ script: ...@@ -142,7 +142,7 @@ script:
ctest -I FailedTests.log; ctest -I FailedTests.log;
fi fi
- if [[ ! -z "${DOCS_DEPLOY}" && "${DOCS_DEPLOY}" = "true" ]]; then - if [[ ! -z "${DOCS_DEPLOY}" && "${DOCS_DEPLOY}" = "true" ]]; then
pip install sphinx sphinxcontrib.lunrsearch sphinxcontrib.autodoc_doxygen; pip install sphinx sphinxcontrib-lunrsearch sphinxcontrib-autodoc_doxygen;
make C++ApiDocs PythonApiDocs; make C++ApiDocs PythonApiDocs;
mkdir -p api-docs; mkdir -p api-docs;
mv api-python api-docs; mv api-python api-docs;
......
...@@ -35,31 +35,23 @@ foreach(INIT_FILE ${STAGING_INPUT_FILES}) ...@@ -35,31 +35,23 @@ foreach(INIT_FILE ${STAGING_INPUT_FILES})
endforeach(INIT_FILE ${STAGING_INPUT_FILES}) endforeach(INIT_FILE ${STAGING_INPUT_FILES})
add_custom_command( add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/core.rst" OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/library.rst"
"${CMAKE_CURRENT_BINARY_DIR}/integrators.rst"
"${CMAKE_CURRENT_BINARY_DIR}/forces.rst"
"${CMAKE_CURRENT_BINARY_DIR}/extras.rst"
COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_BINARY_DIR}/render.py" COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_BINARY_DIR}/render.py"
"${WRAPPER_DOXYGEN_DIR}/xml/" "${WRAPPER_DOXYGEN_DIR}/xml/"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/render.py" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/render.py"
"${CMAKE_CURRENT_BINARY_DIR}/core.rst.jinja2" "${CMAKE_CURRENT_BINARY_DIR}/library.rst.jinja2"
"${CMAKE_CURRENT_BINARY_DIR}/integrators.rst.jinja2"
"${CMAKE_CURRENT_BINARY_DIR}/forces.rst.jinja2"
"${CMAKE_CURRENT_BINARY_DIR}/extras.rst.jinja2"
"${WRAPPER_DOXYGEN_DIR}/xml/index.xml" "${WRAPPER_DOXYGEN_DIR}/xml/index.xml"
) )
add_custom_command( add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/api-c++/index.html" OUTPUT "${CMAKE_BINARY_DIR}/api-c++/index.html"
COMMAND "${PYTHON_EXECUTABLE}" -m sphinx . "${CMAKE_BINARY_DIR}/api-c++" COMMAND "${PYTHON_EXECUTABLE}" -m sphinx . "${CMAKE_BINARY_DIR}/api-c++"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/conf.py" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/conf.py"
"${CMAKE_CURRENT_BINARY_DIR}/core.rst" "${CMAKE_CURRENT_BINARY_DIR}/library.rst"
"${CMAKE_CURRENT_BINARY_DIR}/forces.rst" "${CMAKE_CURRENT_BINARY_DIR}/index.rst"
"${CMAKE_CURRENT_BINARY_DIR}/extras.rst" "${CMAKE_CURRENT_BINARY_DIR}/_static/logo.png"
"${CMAKE_CURRENT_BINARY_DIR}/integrators.rst" "${WRAPPER_DOXYGEN_DIR}/xml/index.xml"
"${CMAKE_CURRENT_BINARY_DIR}/index.rst"
"${CMAKE_CURRENT_BINARY_DIR}/_static/logo.png"
) )
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/api-c++/) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/api-c++/)
......
Core Objects
~~~~~~~~~~~~
.. autodoxysummary::
:toctree: generated/
{% for obj in core %}
~{{obj}}
{% endfor %}
Extras
~~~~~~
.. autodoxysummary::
:toctree: generated/
{% for extra in extras %}
~{{extra}}
{% endfor %}
Forces
~~~~~~
The Force objects added to a :cpp:obj:`System` define the behavior of the
particles. Force is an abstract class; subclasses implement specific behaviors.
The Force class is actually slightly more general than its name suggests. A
Force can, indeed, apply forces to particles, but it can also directly modify
particle positions and velocities in arbitrary ways. Some thermostats and
barostats, for example, can be implemented as Force classes.
.. autodoxysummary::
:toctree: generated/
{% for force in forces %}
~{{force}}
{% endfor %}
OpenMM C++ API OpenMM C++ API
================= =================
The C++ API provides information about the classes and methods available in OpenMM for C++ developers. The C++ API provides information about the classes and methods available in OpenMM for C++ developers. The public API is based on a small number of classes.
:cpp:class:`System <OpenMM::System>`\ : A System specifies generic properties of the system to be
simulated: the number of particles it contains, the mass of each one, the size
of the periodic box, etc. The interactions between the particles are specified
through a set of Force objects (see below) that are added to the System. Force
field specific parameters, such as particle charges, are not direct properties
of the System. They are properties of the Force objects contained within the
System.
:cpp:class:`Force <OpenMM::Force>`\ : The Force objects added to a System define the behavior of the
particles. Force is an abstract class; subclasses implement specific behaviors.
The Force class is actually slightly more general than its name suggests. A
Force can, indeed, apply forces to particles, but it can also directly modify
particle positions and velocities in arbitrary ways. Some thermostats and
barostats, for example, can be implemented as Force classes. Examples of Force
subclasses include :cpp:class:`HarmonincBondForce <OpenMM::HarmonincBondForce>`, :cpp:class:`NonbondedForce <OpenMM::NonbondedForce>`, and :cpp:class:`MonteCarloBarostat <OpenMM::MonteCarloBarostat>`.
:cpp:class:`Context <OpenMM::Context>`\ : This stores all of the state information for a simulation:
particle positions and velocities, as well as arbitrary parameters defined by
the Forces in the System. It is possible to create multiple Contexts for a
single System, and thus have multiple simulations of that System in progress at
the same time.
:cpp:class:`Integrator <OpenMM::Integrator>`\ : This implements an algorithm for advancing the simulation
through time. It is an abstract class; subclasses implement specific
algorithms. Examples of Integrator subclasses include :cpp:class:`LangevinIntegrator <OpenMM::LangevinIntegrator>`,
:cpp:class:`VerletIntegrator <OpenMM::VerletIntegrator>`, and :cpp:class:`BrownianIntegrator <OpenMM::BrownianIntegrator>`.
:cpp:class:`State <OpenMM::State>`\ : A State stores a snapshot of the simulation at a particular point
in time. It is created by calling a method on a Context. As discussed earlier,
this is a potentially expensive operation. This is the only way to query the
values of state variables, such as particle positions and velocities; Context
does not provide methods for accessing them directly.
Here is an example of what the source code to create a System and run a
simulation might look like:
.. code-block:: c
System system;
for (int i = 0; i < numParticles; ++i)
system.addParticle(particle[i].mass);
HarmonicBondForce* bonds = new HarmonicBondForce();
system.addForce(bonds);
for (int i = 0; i < numBonds; ++i)
bonds->addBond(bond[i].particle1, bond[i].particle2,
bond[i].length, bond[i].k);
HarmonicAngleForce* angles = new HarmonicAngleForce();
system.addForce(angles);
for (int i = 0; i < numAngles; ++i)
angles->addAngle(angle[i].particle1, angle[i].particle2,
angle[i].particle3, angle[i].angle, angle[i].k);
// ...create and initialize other force field terms in the same way
LangevinIntegrator integrator(temperature, friction, stepSize);
Context context(system, integrator);
context.setPositions(initialPositions);
context.setVelocities(initialVelocities);
integrator.step(10000);
.. raw:: html
<div style="display:none">
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 2
library
.. raw:: html
core </div>
forces
integrators
extras
Integrators
~~~~~~~~~~~
.. autodoxysummary::
:toctree: generated/
{% for integrator in integrators %}
~{{integrator}}
{% endfor %}
.. _core-objects:
Core Objects
~~~~~~~~~~~~
.. autodoxysummary::
:toctree: generated/
{% for obj in core %}
~{{obj}}
{% endfor %}
.. _forces:
Forces
~~~~~~
.. autodoxysummary::
:toctree: generated/
{% for force in forces %}
~{{force}}
{% endfor %}
.. _integrators:
Integrators
~~~~~~~~~~~
These integrators implement an algorithm for advancing the simulation
through time.
.. autodoxysummary::
:toctree: generated/
{% for integrator in integrators %}
~{{integrator}}
{% endfor %}
.. _extras:
Extras
~~~~~~
.. autodoxysummary::
:toctree: generated/
{% for extra in extras %}
~{{extra}}
{% endfor %}
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