Skip to content

Commit

Permalink
Merge branch 'python' into 2680_vv_docu
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad authored Jul 25, 2019
2 parents 47494fe + 958747c commit e64e5f7
Show file tree
Hide file tree
Showing 314 changed files with 5,055 additions and 11,184 deletions.
52 changes: 26 additions & 26 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ default:
<<: *global_job_definition
stage: build
script:
- export with_cuda=false myconfig=default with_coverage=true python_version=3
- export with_cuda=false myconfig=default with_coverage=true
- bash maintainer/CI/build_cmake.sh
tags:
- docker
Expand All @@ -97,7 +97,7 @@ min_boost:
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:min_boost
script:
- export with_cuda=false myconfig=maxset python_version=3
- export with_cuda=false myconfig=maxset
- bash maintainer/CI/build_cmake.sh
tags:
- docker
Expand All @@ -107,7 +107,7 @@ maxset:
<<: *global_job_definition
stage: build
script:
- export myconfig=maxset with_coverage=true python_version=3
- export myconfig=maxset with_coverage=true
- bash maintainer/CI/build_cmake.sh
tags:
- docker
Expand All @@ -117,7 +117,7 @@ no_rotation:
<<: *global_job_definition
stage: build
script:
- export myconfig=no_rotation with_coverage=true python_version=3
- export myconfig=no_rotation with_coverage=true
- bash maintainer/CI/build_cmake.sh
tags:
- docker
Expand All @@ -127,7 +127,7 @@ nocheckmaxset:
<<: *global_job_definition
stage: build
script:
- export with_cuda=false myconfig=nocheck-maxset python_version=3 make_check=false
- export with_cuda=false myconfig=nocheck-maxset make_check=false
- bash maintainer/CI/build_cmake.sh
tags:
- docker
Expand All @@ -140,7 +140,7 @@ nocheckmaxset:
debian:9:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/debian-python3:9
script:
- export with_cuda=false
- export myconfig=maxset make_check=false
Expand All @@ -154,7 +154,7 @@ opensuse:15.1:
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
script:
- export with_cuda=false myconfig=maxset make_check=false python_version=3
- export with_cuda=false myconfig=maxset make_check=false
- bash maintainer/CI/build_cmake.sh
tags:
- docker
Expand All @@ -165,7 +165,7 @@ centos:7:
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/centos-python3:7
script:
- export with_cuda=false myconfig=maxset make_check=true python_version=3
- export with_cuda=false myconfig=maxset make_check=true
- bash maintainer/CI/build_cmake.sh
tags:
- docker
Expand All @@ -176,7 +176,7 @@ fedora:
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/centos-python3:next
script:
- export with_cuda=false myconfig=maxset make_check=false python_version=3
- export with_cuda=false myconfig=maxset make_check=false
- bash maintainer/CI/build_cmake.sh
tags:
- docker
Expand All @@ -193,7 +193,7 @@ cuda-maxset:
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:9.0
script:
- export myconfig=maxset with_coverage=true python_version=3 test_timeout=900 srcdir=${CI_PROJECT_DIR}
- export myconfig=maxset with_coverage=true test_timeout=900 srcdir=${CI_PROJECT_DIR}
- bash maintainer/CI/build_cmake.sh
artifacts:
paths:
Expand All @@ -209,7 +209,7 @@ tutorials-samples-maxset:
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:tutorials
script:
- export myconfig=maxset with_coverage=false python_version=3 make_check=false
- export myconfig=maxset with_coverage=false make_check=false
- export make_check_tutorials=true make_check_samples=true make_check_benchmarks=true test_timeout=1200
- bash maintainer/CI/build_cmake.sh
tags:
Expand All @@ -222,7 +222,7 @@ tutorials-samples-default:
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:tutorials
script:
- export myconfig=default with_coverage=false python_version=3 make_check=false
- export myconfig=default with_coverage=false make_check=false
- export make_check_tutorials=true make_check_samples=true make_check_benchmarks=true test_timeout=1200
- bash maintainer/CI/build_cmake.sh
tags:
Expand All @@ -237,7 +237,7 @@ tutorials-samples-empty:
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:tutorials
script:
- export myconfig=empty with_coverage=false python_version=3 make_check=false
- export myconfig=empty with_coverage=false make_check=false
- export make_check_tutorials=true make_check_samples=true make_check_benchmarks=true test_timeout=1200
- bash maintainer/CI/build_cmake.sh
tags:
Expand All @@ -252,7 +252,7 @@ tutorials-samples-no-gpu:
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:tutorials
script:
- export myconfig=maxset with_coverage=false python_version=3 make_check=false
- export myconfig=maxset with_coverage=false make_check=false
- export make_check_tutorials=true make_check_samples=true make_check_benchmarks=true test_timeout=1200 hide_gpu=true
- bash maintainer/CI/build_cmake.sh
tags:
Expand All @@ -269,7 +269,7 @@ cuda-no-gpu:
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:9.0
script:
- export myconfig=maxset hide_gpu=true python_version=3 test_timeout=900
- export myconfig=maxset hide_gpu=true test_timeout=900
- bash maintainer/CI/build_cmake.sh
tags:
- docker
Expand All @@ -280,7 +280,7 @@ empty:
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:9.0
script:
- export myconfig=empty python_version=3
- export myconfig=empty
- bash maintainer/CI/build_cmake.sh
tags:
- docker
Expand All @@ -290,7 +290,7 @@ empty:
ubuntu:wo-dependencies:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:wo-dependencies
script:
- export myconfig=maxset make_check=false
- bash maintainer/CI/build_cmake.sh
Expand All @@ -303,7 +303,7 @@ ubuntu:wo-dependencies:
rocm-maxset:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/rocm:latest
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/rocm-python3:latest
script:
- export myconfig=maxset
- bash maintainer/CI/build_cmake.sh
Expand All @@ -319,13 +319,12 @@ rocm-maxset:
script:
- export with_cuda=false test_timeout=900 check_skip_long=true
- export OMPI_MCA_btl_vader_single_copy_mechanism=none
- export myconfig=maxset python_version=3
- export myconfig=maxset
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
only:
- schedules
when: manual

ubuntu:arm64:
<<: *arch_definition
Expand Down Expand Up @@ -353,7 +352,7 @@ osx:
<<: *global_job_definition
stage: build
script:
- export with_ccache=false myconfig=maxset with_cuda=false python_version=3
- export with_ccache=false myconfig=maxset with_cuda=false
- bash maintainer/CI/build_cmake.sh
tags:
- mac
Expand All @@ -362,7 +361,7 @@ osx-cuda:
<<: *global_job_definition
stage: build
script:
- export with_ccache=false myconfig=maxset with_cuda=true python_version=3 make_check=false
- export with_ccache=false myconfig=maxset with_cuda=true make_check=false
- bash maintainer/CI/build_cmake.sh
tags:
- mac
Expand All @@ -372,7 +371,7 @@ osx-cuda:
clang:6.0:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/clang-python3:6.0
script:
- export myconfig=maxset with_coverage=false with_static_analysis=true with_asan=true with_ubsan=true test_timeout=900
- bash maintainer/CI/build_cmake.sh
Expand All @@ -385,7 +384,7 @@ clang:6.0:
intel:18:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/intel-python3:18
script:
- export myconfig=maxset with_coverage=false I_MPI_SHM_LMT=shm
- export cxx_flags=-O2
Expand All @@ -395,6 +394,7 @@ intel:18:
- linux
- cuda
- icp
when: manual

check_sphinx:
<<: *global_job_definition
Expand Down Expand Up @@ -441,7 +441,7 @@ check_with_odd_no_of_processors:
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:9.0
when: on_success
script:
- export myconfig=maxset with_coverage=true python_version=3 build_procs=3 check_procs=3 check_odd_only=true
- export myconfig=maxset with_coverage=true build_procs=3 check_procs=3 check_odd_only=true
- bash maintainer/CI/build_cmake.sh
tags:
- docker
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ matrix:
- os: linux
sudo: required
services: docker
env: myconfig=maxset image=ubuntu-python3 python_version=3
env: myconfig=maxset image=ubuntu-python3

script:
- maintainer/CI/build_docker.sh
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ cmake_minimum_required(VERSION 3.4)
include(FeatureSummary)
project(ESPResSo)
include(cmake/FindPythonModule.cmake)
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.12")
cmake_policy(SET CMP0074 NEW)
endif()

enable_language(CXX)

Expand Down Expand Up @@ -232,7 +235,7 @@ if(WITH_CUDA)
endif()
endif(WITH_CUDA)

find_package(PythonInterp REQUIRED)
find_package(PythonInterp 3 REQUIRED)

if(WITH_PYTHON)
find_package(Cython 0.23 REQUIRED)
Expand Down
3 changes: 2 additions & 1 deletion bors.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
status = [
"ICP GitLab CI"
]
timeout-sec = 14400
timeout_sec = 14400
required_approvals = 1
106 changes: 1 addition & 105 deletions doc/sphinx/advanced_methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,109 +119,6 @@ The following limitations currently apply for the collision detection:
* The ``"bind at point of collision"`` approach cannot handle collisions
between virtual sites

.. _Swimmer Reactions:

Swimmer Reactions
-----------------


With the help of the feature ``SWIMMER_REACTIONS``, one can define three particle types to act as reactant (e.g. :math:`\mathrm{H_2 O_2}`), catalyzer (e.g. platinum), and product (e.g. :math:`\mathrm{O_2}` and :math:`\mathrm{H_2 O}`). The current setup allows one to simulate active swimmers and their chemical propulsion.

For a Janus swimmer consisting of platinum on one hemisphere and gold on the other hemisphere, both surfaces catalytically induce a reaction. We assume an initial abundance of hydrogen peroxide and absence of products, so that back (recombination) reactions seldom occur at the surface. A typical model for the propulsion of such a particle assumes

.. math::
\begin{aligned}
\mathrm{H_2 O_2} &\xrightarrow{\text{Pt}} \mathrm{2 H^{+} + 2 e^{-} + O_2} \\
\mathrm{2 H^{+} + 2 e^{-} + H_2 O_2} &\xrightarrow{\text{Au}} \mathrm{2 H_2 O}
\end{aligned}
That is, catalytic surfaces induce a reactions that produce charged species by consuming hydrogen peroxide. It is the change in distribution of charged species that leads to motion of the swimmer, a process referred to as self-electrophoresis. A minimal model for this would be

.. math::
\begin{aligned}
A &\xrightarrow{C^{+}} B \\
B &\xrightarrow{C^{-}} A
\end{aligned}
where on the upper half of the catalyst :math:`C^{+}` a species :math:`A` is converted into :math:`B`, and on the lower half :math:`C^{-}` the opposite reaction takes place. Note that when :math:`A` and :math:`B` are charged, this reaction conserves charge, provided the rates are equal. Note that this feature uses the word catalyst in a meaning which cannot be brought into agreement with the definition of a catalyst. If the catalyst :math:`C^{+}` catalyzes (on average) the reaction, where :math:`A` is converted to :math:`B`, then it is impossible that a catalyst :math:`C^{-}` performs (on average) the reverse reaction. For the example with hydrogen peroxide this would mean that hydrogen peroxide is created spontaneously using a catalyst (under the same environment where another catalyst wants to split hydrogen peroxide). This is chemically impossible. What is meant to be modeled is that hydrogen peroxide is constantly flowing into the system from the bulk and therefore it is not depleted. This behaviour cannot be modeled using a catalyst (in the defined meaning of the word catalyst).
In |es| the orientation of a catalyzer particle is used to define hemispheres; half spaces going through the particle's center. The reaction region is bounded by the *reaction range*: :math:`r`. Inside the reaction range, we react only reactant-product pairs. The particles in a pair are swapped from hemisphere to another with a rate prescribed by

.. math::
P_{\text{move}} = 1 - \mathrm{e}^{-k_{\mathrm{ct}}\,\Delta t} ,
with the reaction rate :math:`k_{\mathrm{ct}}` and the simulation time step :math:`\Delta t`. A pair may be swapped only once per MD time step, to avoid a no-net-effect situation. That is, we allow an exchange move only when the following conditions are met:

1. Both partners of the reactant-product pair have to reside within the reaction range.
2. The product has to reside in the upper half-space of the reaction range.
3. The reactant has to reside in the lower half-space of the reaction range.

Self-propulsion is achieved by imposing an interaction asymmetry between the partners of a swapped pair. That is, the heterogeneous distribution of chemical species induced by the swapping leads to a net force on the particle, counter balanced by friction.

To set up the system for catalytic reactions the class :class:`espressomd.swimmer_reaction.Reaction`
can be used. ::

from espressomd.swimmer_reaction import Reaction

system = espressomd.System()

# setting up particles etc

r = Reaction(product_type=1, reactant_type=2, catalyzer_type=0,
ct_range=2, ct_rate=0.2, eq_rate=0)
r.start()
r.stop()

print r

* the first invocation of ``Reaction``, in the above example, defines a
reaction with particles of type number 2 as reactant, type 0 as catalyzer and
type 1 as product [#1]_. The catalytic reaction rate constant is given by :math:`\mathrm{ct\_rate}`
[#2]_ and to override the default rate constant for the equilibrium reaction
( = 0), one can specify it by as ``eq_rata``. By default each reactant particle is checked
against each catalyst particle (``react_once=False``). However, when creating
smooth surfaces using many catalyst particles, it can be desirable to let the
reaction rate be independent of the surface density of these particles. That
is, each particle has a likelihood of reacting in the vicinity of the surface
(distance is less than :math:`r`) as specified by the rate constant, i.e.,
*not* according to :math:`P_{\text{cvt}} = 1 - \exp \left( - n k\Delta t
\right)`, with :math:`n` the number of local catalysts. To accomplish this,
each reactant is considered only once each time step by using the option
``react_once=True`` . The reaction command is set up such that the different
properties may be influenced individually.

* ``r.stop()`` disables the reaction. Note that at the moment, there can
only be one reaction in the simulation.

* ``print r`` returns the current reaction parameters.

In future versions of |es| the capabilities of the ``SWIMMER_REACTIONS`` feature may be generalized
to handle multiple reactant, catalyzer, and product types, as well as
more general reaction schemes. Other changes may involve merging the
current implementation with the ``COLLISION_DETECTION`` feature.

.. rubric:: Footnotes

.. [#1]
Only one type of particle can be assigned to each of these three
reaction species and no particle type may be assigned to multiple
species. That is, currently does not support particles of type 1 and
2 both to be reactants, nor can particles of type 1 be a reactant as
well as a catalyst. Moreover, only one of these reactions can be
implemented in a single Tcl script. If, for instance, there is a
reaction involving particle types 1, 2, and 4, there cannot be a
second reaction involving particles of type 5, 6, and 8. It is
however possible to modify the reaction properties for a given set of
types during the simulation.
.. [#2]
Currently only strictly positive values of the catalytic conversion
rate constant are allowed. Setting the value to zero is equivalent to
``r.stop()``.
..
.. _Lees-Edwards boundary conditions:

Expand Down Expand Up @@ -253,8 +150,7 @@ friction coefficient (this is different from the Object-in-Fluid method
below). We implement these marker points as virtual tracer
particles which are not integrated using the usual velocity-Verlet
scheme, but instead are propagated using a simple Euler algorithm with
the local fluid velocity (if the ``IMMERSED_BOUNDARY`` feature is turned
on).
the local fluid velocity.

The immersed boundary method consists of two components, which can be used independently:

Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ For example, ::

Momentum of the System
~~~~~~~~~~~~~~~~~~~~~~
:meth:`espressomd.analyze.Analysis.analyze_linear_momentum`
:meth:`espressomd.analyze.Analysis.linear_momentum`

This command returns the total linear momentum of the particles and the
lattice Boltzmann (LB) fluid, if one exists. Giving the optional
Expand Down
Loading

0 comments on commit e64e5f7

Please sign in to comment.