Permalink
Browse files

Merge branch 'python' into widom_insertion

  • Loading branch information...
fweik committed Jan 11, 2018
2 parents 61a5b1f + e5f091f commit 334bab9f1327210cdfe8a821bd9d0906be447a0a
Showing with 1,596 additions and 745 deletions.
  1. +35 −4 .gitlab-ci.yml
  2. +0 −8 .travis.yml
  3. +0 −4 doc/sphinx/README.rst
  4. +1 −2 doc/sphinx/conf.py.in
  5. +1 −1 doc/sphinx/dg.rst
  6. +35 −0 doc/sphinx/installation.rst
  7. +25 −15 doc/sphinx/part.rst
  8. +0 −18 doc/sphinx/zrefs.bib
  9. +8 −2 doc/tutorials/python/05-raspberry_electrophoresis/scripts/simulate_raspberry_electrophoresis.py
  10. +1 −0 maintainer/configs/maxset.hpp
  11. +0 −15 maintainer/configs/rest1.hpp
  12. +0 −5 maintainer/configs/rest2.hpp
  13. +1 −1 maintainer/travis/build_cmake.sh
  14. +0 −1 requirements.txt
  15. +2 −2 src/core/CMakeLists.txt
  16. +1 −1 src/core/collision.cpp
  17. +0 −1 src/core/collision.hpp
  18. +1 −1 src/core/communication.cpp
  19. +1 −1 src/core/energy_inline.hpp
  20. +11 −15 src/core/forces.cpp
  21. +3 −3 src/core/ghmc.cpp
  22. +7 −7 src/core/ghosts.cpp
  23. +4 −6 src/core/initialize.cpp
  24. +9 −7 src/core/integrate.cpp
  25. +2 −2 src/core/lb.cpp
  26. +1 −1 src/core/minimize_energy.cpp
  27. +104 −0 src/core/observables/CylindricalLBVelocityProfileAtParticlePositions.cpp
  28. +39 −0 src/core/observables/CylindricalLBVelocityProfileAtParticlePositions.hpp
  29. +73 −0 src/core/observables/CylindricalVelocityProfile.hpp
  30. +13 −15 src/core/pressure.cpp
  31. +1 −1 src/core/rotation.cpp
  32. +4 −4 src/core/statistics.cpp
  33. +3 −3 src/core/statistics.hpp
  34. +2 −2 src/core/thermostat.hpp
  35. +7 −7 src/core/utils/Histogram.hpp
  36. +120 −24 src/core/virtual_sites.cpp
  37. +9 −77 src/core/virtual_sites.hpp
  38. +70 −0 src/core/virtual_sites/VirtualSites.hpp
  39. +30 −0 src/core/virtual_sites/VirtualSitesOff.hpp
  40. +221 −0 src/core/virtual_sites/VirtualSitesRelative.cpp
  41. +58 −0 src/core/virtual_sites/VirtualSitesRelative.hpp
  42. +8 −8 src/core/{ → virtual_sites}/virtual_sites_com.cpp
  43. 0 src/core/{ → virtual_sites}/virtual_sites_com.hpp
  44. +0 −333 src/core/virtual_sites_relative.cpp
  45. +0 −49 src/core/virtual_sites_relative.hpp
  46. +2 −6 src/features.def
  47. +4 −4 src/python/CMakeLists.txt
  48. +17 −12 src/python/espressomd/analyze.pyx
  49. +2 −1 src/python/espressomd/c_analyze.pxd
  50. +6 −1 src/python/espressomd/constraints.py
  51. +70 −0 src/python/espressomd/observables.py
  52. +1 −1 src/python/espressomd/particle_data.pxd
  53. +1 −1 src/python/espressomd/particle_data.pyx
  54. +17 −0 src/python/espressomd/system.pyx
  55. +40 −0 src/python/espressomd/virtual_sites.py
  56. +50 −13 src/python/pypresso.cmakein
  57. +1 −0 src/script_interface/CMakeLists.txt
  58. +37 −26 src/script_interface/ParallelScriptInterface.cpp
  59. +3 −5 src/script_interface/ParallelScriptInterface.hpp
  60. +2 −0 src/script_interface/initialize.cpp
  61. +5 −0 src/script_interface/observables/CylindricalProfileObservable.hpp
  62. +2 −0 src/script_interface/observables/initialize.cpp
  63. +56 −0 src/script_interface/virtual_sites/ActiveVirtualSitesHandle.hpp
  64. +55 −0 src/script_interface/virtual_sites/VirtualSites.hpp
  65. +47 −0 src/script_interface/virtual_sites/VirtualSitesOff.hpp
  66. +46 −0 src/script_interface/virtual_sites/VirtualSitesRelative.hpp
  67. +47 −0 src/script_interface/virtual_sites/initialize.cpp
  68. +31 −0 src/script_interface/virtual_sites/initialize.hpp
  69. +4 −4 testsuite/CMakeLists.txt
  70. +6 −0 testsuite/constraint_shape_based.py
  71. +46 −4 testsuite/observable_cylindrical.py
  72. +87 −21 testsuite/virtual_sites_relative.py
View
@@ -1,12 +1,27 @@
image: espressomd/espresso-ubuntu-cuda:latest
stages:
- clone
- prepare
- build
- doc_check
- additional_checks
- deploy
- result
variables:
GIT_STRATEGY: none
git_clone:
stage: clone
variables:
GIT_STRATEGY: clone
script:
- cd ${CI_PROJECT_DIR}; git submodule update --init --recursive
artifacts:
paths:
- ${CI_PROJECT_DIR}
expire_in: 4 weeks
status_pending:
stage: prepare
script: bash maintainer/gh_post_status.sh pending
@@ -32,6 +47,7 @@ maxset:
artifacts:
paths:
- build/
expire_in: 4 weeks
clang-static-analysis:
stage: build
@@ -48,11 +64,24 @@ clang:
- bash maintainer/cuda_build.sh
check_sphinx:
stage: doc_check
stage: additional_checks
dependencies:
- git_clone
- maxset
when: on_success
script:
- cd ${CI_PROJECT_DIR}; cd build && find ./ -exec touch -c -t 203901010000 {} \; && make sphinx
check_with_odd_no_of_processors:
stage: additional_checks
when: on_success
dependencies:
- git_clone
- maxset
script:
- export build_procs=3 check_procs=3
- bash maintainer/cuda_build.sh
deploy_documentation:
stage: deploy
only:
@@ -75,10 +104,12 @@ status_success:
stage: result
script: bash maintainer/gh_post_status.sh success
when: on_success
dependencies: []
dependencies:
- git_clone
status_failure:
stage: result
script: bash maintainer/gh_post_status.sh failure
when: on_failure
dependencies: []
dependencies:
- git_clone
View
@@ -36,14 +36,6 @@ matrix:
- os: osx
osx_image: xcode8
env: myconfig=maxset image=python3
- os: linux
sudo: required
services: docker
env: myconfig=rest1 with_coverage=true
- os: linux
sudo: required
services: docker
env: myconfig=rest2 with_coverage=true
- os: linux
sudo: required
services: docker
View
@@ -9,10 +9,6 @@ How to get started with SPHINX
pip2 install sphinxcontrib-bibtex --user --upgrade
#. Install the numpydoc extension to Sphinx::
pip2 install numpydoc --user --upgrade
#. Compile the ``sphinx`` target in your build directory (that can take some time
since we depend on finishing the build of the interface)::
View
@@ -38,7 +38,7 @@ extensions = [
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinxcontrib.bibtex',
'numpydoc'
'sphinx.ext.napoleon'
]
# Add any paths that contain templates here, relative to this directory.
@@ -298,7 +298,6 @@ texinfo_documents = [
# Supress warning if html is build
# http://stackoverflow.com/questions/12206334/sphinx-autosummary-toctree-contains-reference-to-nonexisting-document-warnings
numpydoc_show_class_members = False
autodoc_mock_imports = ['featuredefs', 'mayavi', 'pyface.api', 'tvtk.tools', 'vtk', 'MDAnalysis']
autodoc_default_flags = ['members',
'show-inheritance', 'undoc-members']
View
@@ -136,7 +136,7 @@ Documentation
The documentation of |es| consists of four parts:
- The users' guide and developers' guide are located in ``doc/sphinx``, and make use of the Sphinx Python package
- In-code documentation for the Python interface is located in the various files in src/python/espressomd and also makes use of the Sphinx Python package. We also make use of the extensions in the numpydoc package and use the NumPy documentation style.
- In-code documentation for the Python interface is located in the various files in src/python/espressomd and also makes use of the Sphinx Python package. We make use of the napolean extension and use the NumPy documentation style.
- In-code documentation of the C++ core is located in the .cpp and .hpp files in ``/src/core`` and its sub-directories and makes use of Doxygen.
@@ -569,6 +569,41 @@ created by the system class. To perform an integration step, execute
system.integrator.run(steps=100)
.. _Debugging es:
Debugging |es|
--------------
Exceptional situations occur in every program. If |es| crashes with a
segmentation fault that means that there was a memory fault in the
simulation core which requires running the program in a debugger. The
`pypresso` executable file is acutally not a program but a script
which sets the Python path appropriately and starts the Python
interpreter with your arguments. Thus it is not possible to directly
run `pypresso` in a debugger. However, we provide some useful
commandline options for the most common tools.
.. code-block:: bash
./pypresso --tool <args>
where ``--tool`` can be any from the following table. You can only
use one tool at a time.
+---------------------+----------------------------------------------+
| Tool | Effect |
+=====================+==============================================+
| ``--gdb`` | ``gdb --args python <args>`` |
+---------------------+----------------------------------------------+
| ``--lldb`` | ``lldb -- python <args>`` |
+---------------------+----------------------------------------------+
| ``--valgrind`` | ``valgrind --leak-check=full python <args>`` |
+---------------------+----------------------------------------------+
| ``--cuda-gdb`` | ``cuda-gdb --args python <args>`` |
+---------------------+----------------------------------------------+
| ``--cuda-memcheck`` | ``cuda-memcheck python <args>`` |
+---------------------+----------------------------------------------+
.. [1]
http://espressomd.org
View
@@ -315,14 +315,31 @@ according to their respective particle type. Before the next integration
step, the forces accumulated on a virtual site are distributed back to
those particles, from which the virtual site was derived.
There are two distinct types of virtual sites, described in the
following.
There are different schemes for virtual sites, described in the
following sections.
To switch the active scheme, the attribute :attr:`espressomd.system.System.virtual_sites` of the system class can be used::
import espressomd
from espressomd.virtual_sites import VirtualSitesOff, VirtualSitesRelative
s=espressomd.System()
s.virtual_sites=VirtualSitesRelative(have_velocity=True)
# or
s.virtual_sites=VirtualSitesOff()
By default, :class:`espressomd.virtual_sites.VirtualSitesOff` is selected. This means that virtual particles are not touched during integration.
the `have_velocity` attribute determines, whether or not the velocity of virtual sites is calcualted, which carries a performance cost.
.. _Rigid arrangements of particles:
Rigid arrangements of particles
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The relative implementation of virtual sites allows for the simulation
of rigid arrangements of particles. It can be used, , for extended
of rigid arrangements of particles. It can be used, for extended
dipoles and raspberry-particles, but also for more complex
configurations. Position and velocity of a virtual site are obtained
from the position and orientation of exactly one non-virtual particle,
@@ -341,7 +358,7 @@ site is placed at a fixed distance from the non-virtual particle. When
the non-virtual particle rotates, the virtual sites rotates on an orbit
around the non-virtual particles center.
To use this implementation of virtual sites, activate the feature VIRTUAL_SITES_RELATIVE.
To use this implementation of virtual sites, activate the feature VIRTUAL_SITES_RELATIVE. Furthermore, an instance of :class:`espressomd.virtual_sites.VirtualSitesRelative` has to be set as the active virtual sites scheme (see above).
To set up a virtual site,
#. Place the particle to which the virtual site should be related. It
@@ -392,11 +409,6 @@ Please note:
- The presence of rigid bodies constructed by means of virtual sites
adds a contribution to the pressure and stress tensor.
- The use of virtual sites requires that the particles are numbered
consecutively, , the particle ids should go from zero to :math:`N-1`,
where :math:`N` is the number of particles.
Virtual sites in the center of mass of a molecule
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:todo: `This is not implemented in Python, yet`
@@ -451,10 +463,6 @@ that order
integrate 0
Please note that the use of virtual sites requires that the particles
are numbered consecutively. I.e., the particle ids should go from zero
to :math:`N-1`, where :math:`N` is the number of particles.
The type of the molecule you can choose freely, it is only used in
certain analysis functions, namely ``energy_kinetic_mol``,
``pressure_mol`` and ``dipmom_mol``, which compute kinetic energy,
@@ -473,8 +481,10 @@ switches in ``myconfig.hpp``.
- THERMOSTAT_IGNORE_NON_VIRTUAL specifies that the thermostat does not act on non-virtual particles
Particle counting feature
-------------------------
Grand canonical feature
-----------------------
:mod:`espressomd.grand_canonical`
For using conveniently in simulations in the grand canonical ensemble,
or other purposes, when particles of certain types are created and
View
@@ -438,24 +438,6 @@ @BOOK{hockney88
timestamp = {2007.08.29}
}
@ARTICLE{hofling11a,
author = {F. H\"{o}fling and Karl-Ulrich Bamberg and Thomas Franosch},
title = {Anomalous transport resolved in space and time by fluorescence correlation
spectroscopy},
journal = {Soft Matter},
year = {2011},
volume = {7},
pages = {1358},
number = { },
month = { },
note = { },
abstract = { },
file = {hofling2011.pdf:hofling2011.pdf:PDF},
keywords = { },
owner = {kosovan},
timestamp = {2012.02.17}
}
@ARTICLE{horowitz91,
author = {Alan M. Horowitz},
title = {A generalized guided Monte Carlo algorithm},
@@ -89,13 +89,19 @@
system.bonded_inter[0] = interactions.HarmonicBond(k=0, r_0=0)
print("\n# min dist to the center pre moving of surface beads = {}".format(analyze.Analysis(system).mindist([0],[1])))
print("\n# min dist to the center pre moving of surface beads = {}".format(analyze.Analysis(system).min_dist([0],[1])))
#this loop moves the surface beads such that they are once again exactly radius_col away from the center
for i in range(1,n_col_part):
pos = system.part[i].pos
system.part[i].pos=(pos-colPos)/np.linalg.norm(pos-colPos)*radius_col+colPos
print("# min dist to the center past moving of surface beads = {}".format(analyze.Analysis(system).mindist([0],[1])))
print("# min dist to the center past moving of surface beads = {}".format(analyze.Analysis(system).min_dist([0],[1])))
# Select the virtual sites scheme to VirtualSitesRelative
from espressomd.virtual_sites import VirtualSitesRelative
system.virtual_sites= VirtualSitesRelative(have_velocity=True)
#setting min_global_cut is necessary when there is no interaction defined with a range larger than the colloid
#such that the virtual particles are able to communicate their forces to the real particle at the center of the colloid
@@ -25,6 +25,7 @@
#define NPT
#define GHMC
#define DPD
#define METADYNAMICS
#define LB
#define LB_BOUNDARIES

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -151,7 +151,7 @@ end "CONFIGURE"
# BUILD
start "BUILD"
cmd "make -k -j${build_procs}" || exit $?
cmd "make -k -j${build_procs}" || cmd "make -k -j1" || exit $?
end "BUILD"
View
@@ -1,4 +1,3 @@
sphinx>=1.5.2
sphinxcontrib-bibtex>=0.3.5
numpydoc>=0.4
MDAnalysis>=0.16
View
@@ -1,6 +1,6 @@
file(GLOB EspressoCore_SRC
"*.cpp"
)
"*.cpp" "virtual_sites/VirtualSitesRelative.cpp")
if( WITH_COVERAGE )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Og --coverage -fprofile-arcs -ftest-coverage")
View
@@ -26,7 +26,7 @@
#include "grid.hpp"
#include "domain_decomposition.hpp"
#include "rotation.hpp"
#include "virtual_sites/VirtualSitesRelative.hpp"
using namespace std;
View
@@ -21,7 +21,6 @@
#include "particle_data.hpp"
#include "interaction_data.hpp"
#include "virtual_sites_relative.hpp"
#include "virtual_sites.hpp"
#include "integrate.hpp"
@@ -954,7 +954,7 @@ void mpi_send_virtual_slave(int pnode, int part) {
#ifdef VIRTUAL_SITES
if (pnode == this_node) {
Particle *p = local_particles[part];
MPI_Recv(&p->p.isVirtual, 1, MPI_INT, 0, SOME_TAG, comm_cart,
MPI_Recv(&(p->p.isVirtual), 1, MPI_INT, 0, SOME_TAG, comm_cart,
MPI_STATUS_IGNORE);
}
@@ -496,7 +496,7 @@ inline void add_bonded_energy(Particle *p1) {
*/
inline void add_kinetic_energy(Particle *p1) {
#ifdef VIRTUAL_SITES
if (ifParticleIsVirtual(p1))
if (p1->p.isVirtual)
return;
#endif
Oops, something went wrong.

0 comments on commit 334bab9

Please sign in to comment.