Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Stokesian Dynamics #3445

Closed
wants to merge 179 commits into from
Closed
Show file tree
Hide file tree
Changes from 128 commits
Commits
Show all changes
179 commits
Select commit Hold shift + click to select a range
4b40b4f
[SD] Starting with the new implementation
hmenke Dec 16, 2018
650e940
[SD] Stokesian dynamics in the integration loop
hmenke Dec 22, 2018
1a50e1c
[SD] Unequal radius, variable viscosity
hmenke Jan 1, 2019
d365bce
[SD] Communicate new positions and velocities
hmenke Jan 12, 2019
773042d
[SD] Interface
hmenke Feb 2, 2019
134b83f
[SD] Sample for dancing spheres
hmenke Feb 2, 2019
87d061b
[SD] Adapt to the new MPI communication scheme
hmenke Apr 14, 2019
6bbb4e8
[SD] Rebase onto latest origin/python
hmenke Jun 30, 2019
4e706ab
[SD] Lubrication corrections and feature bitflags
hmenke Jun 30, 2019
1efccea
Merge remote-tracking branch 'origin/python' into sd
hmenke Oct 8, 2019
95aa778
[SD] Adapt to new integrators
hmenke Oct 8, 2019
a7682ba
[SD] Associate radius with particle type
hmenke Oct 8, 2019
d06b989
[SD] Expose bit flags for feature selection
hmenke Oct 8, 2019
1e4c236
[SD] Move implementation to libs/stokesian_dynamics
hmenke Oct 8, 2019
f036395
[SD] Test against reference data from Brady's paper
hmenke Oct 8, 2019
75f147f
Formatting suggested by fix_style
hmenke Oct 9, 2019
1a77c33
[SD] Add reference, check Euclidean distance
hmenke Oct 9, 2019
ef0612c
[SD] Communicate rotations to core
hmenke Oct 9, 2019
2c6b583
[SD] First take on thermalization
hmenke Oct 11, 2019
6af4fcc
[SD] make kT optional
mkuron Oct 11, 2019
d7c8bc7
[SD] thermalization test
mkuron Oct 14, 2019
3440ff0
Merge remote-tracking branch 'origin/python' into sd
Dec 16, 2019
874f974
A few changes regarding PBC check in SD MPI particle transfer
Jan 14, 2020
12e2ed7
trying parallelization
Jan 23, 2020
0ea3e8d
implemented multithread support for the SD integrator
Jan 29, 2020
89ba6ed
fixed rotation
Feb 4, 2020
a7cc9db
some changes
Feb 11, 2020
4aa7bb6
Fixed SD thermalisation, now dependency on temperature and particle
Feb 20, 2020
b49f6ea
Added SD setup test
Feb 20, 2020
58d1d8b
Formatting with fix_style
Feb 20, 2020
475bd9d
More style corrections
Feb 20, 2020
f9644d2
fixed rescaling bug, added thrust wrapper
Mar 23, 2020
2947295
style corrections
Mar 23, 2020
3b439e0
removed unused stuff from SD test
Mar 23, 2020
081d670
temporarily removed style_doxygen from gitlab
Mar 23, 2020
6792295
minor change
Mar 23, 2020
cd6430f
Make STOKESIAN_DYNAMICS an external feature
jngrad Mar 23, 2020
53a7414
Merge branch 'python' into sd
jngrad Mar 23, 2020
d2c0b2e
Revert "temporarily removed style_doxygen from gitlab"
jngrad Mar 23, 2020
67ce845
fixed merge with recent python branch + introduced non-cuda rng
Mar 30, 2020
b88c138
Fix regression with feature STOKESIAN_DYNAMICS
jngrad Mar 25, 2020
633e923
fixed crash when running SD integrator
Mar 31, 2020
a7982e9
refactored SD cmake logic and compiler option logic, SD is internal
Apr 1, 2020
ac62a52
style
Apr 1, 2020
965e509
temporarily removed CMake section to add SD GPU code, so that we can
Apr 1, 2020
149aa2d
temporarily removed CMake section to add SD GPU code, so that we can …
Apr 1, 2020
c25d58f
suppress compiler warnings in Random123
Apr 2, 2020
122807b
addition to commits 965e509 and 149aa2d
Apr 2, 2020
966105d
get rid of various compiler warnings
Apr 2, 2020
a8dc4f9
correct dumb mistake
Apr 6, 2020
f9228e8
adding install commands for SD libraries
Apr 6, 2020
b933427
fixed a_host array legth
Apr 8, 2020
a0e5bc7
fixed compiler warnings
Apr 8, 2020
5274b38
added boost to libs SD dependencies
Apr 8, 2020
a8b5aa2
trying to fix OSX linker issue
Apr 9, 2020
89982db
Revert "trying to fix OSX linker issue"
Apr 9, 2020
155c6b1
CMake: use python -m sphinx instead of sphinx-build et al.
mkuron Apr 9, 2020
256a812
blacklist Sphinx 3.0.0
mkuron Apr 9, 2020
02ae476
removed EspressoCore dependency from sd_interface
Apr 9, 2020
97f26ed
Fix sphinx version regex
mkuron Apr 9, 2020
852b39b
fix sphinx apidoc detection above version 1.7
mkuron Apr 9, 2020
fa8fe76
sd_interface.cpp is now part of EspressoCore library
Apr 9, 2020
99c2ee2
Merge commit 'refs/pull/3648/head' of https://github.com/espressomd/e…
Apr 9, 2020
7c4360e
fix RNG issue
Apr 14, 2020
77cf43a
fix_style: try python3 -m pre_commit if pre-commit not found
mkuron Apr 14, 2020
28a9178
Merge commit 'refs/pull/3661/head' of https://github.com/espressomd/e…
Apr 14, 2020
9156fec
style
Apr 14, 2020
547d258
fix cmake_format or pylint not found
Apr 14, 2020
49b5483
SD: fix issue with rotation on Clang
Apr 15, 2020
d912cbd
SD: started SPHINX documentation
Apr 15, 2020
2362aec
added sd.rst to CMakeLists.txt
Apr 16, 2020
8282934
Merge commit 'refs/pull/3666/head' of https://github.com/espressomd/e…
Apr 16, 2020
45d9f13
fix add_css_file incompatible with Sphinx below 1.8
Apr 16, 2020
6ca35d2
added MWE to documentation
Apr 20, 2020
d042f7b
SD: refactor python interface
Apr 21, 2020
6933ab0
remove old code from fix_style.sh
Apr 22, 2020
af6ef9a
style
Apr 22, 2020
90244f9
SD: refactor SD test and update to new interface
Apr 22, 2020
b8fd28e
SD: fix undefined rotation when omega=0
Apr 28, 2020
a47e7aa
SD: adding/correcting code documentation
Apr 28, 2020
4b858be
SD: revert unwanted changes
Apr 29, 2020
578bbd3
revert more unwanted change
Apr 29, 2020
43554df
SD: add copyright headers, change code documentation
Apr 29, 2020
954bce2
SD: removed a debug log
Apr 29, 2020
599be3e
SD: added doxygen to device_matrix
Apr 29, 2020
c9290b6
SD: updated documentation
May 8, 2020
a24e320
SD: add to documentation
May 8, 2020
52e3136
SD: documentation
May 8, 2020
19b3371
SD: remove lubrication from (documented) ESPResSo
May 8, 2020
7f4b920
SD: citations
May 8, 2020
dc61284
SD: cleanup of CMake
May 13, 2020
9b05ceb
SD: remove commented out code
May 13, 2020
2fdfac3
Update doxygen in libs/stokesian_dynamics/device_matrix.hpp
biermanncarl May 13, 2020
38cb791
Update documentation of libs/stokesian_dynamics/sd.hpp
biermanncarl May 13, 2020
80cf889
Update documentation of libs/stokesian_dynamics/sd.hpp
biermanncarl May 13, 2020
3d7831f
SD: minor cleanups
May 13, 2020
3287ace
Revert "SD: cleanup of CMake"
May 13, 2020
468b303
SD: STOKESIAN_DYNAMICS_GPU won't be set
May 13, 2020
9890d0e
SD: removed debugging code
May 13, 2020
cd1b907
SD: removed #ifdef ROTATION
May 13, 2020
1b64796
SD: changes in serialization
May 13, 2020
60e2942
SD: remove #ifdef ROTATION once more
May 13, 2020
7e41fc0
SD: add header protectors
May 13, 2020
39875c9
SD: removed CXX_14_CONSTEXPR from multi_array.hpp
May 13, 2020
f560cc9
SD: update sample dancing.py
May 13, 2020
6c2ec98
SD: mainly in-code documentation
May 14, 2020
8858c61
SD: in-code documentation
May 18, 2020
7d06c52
SD: in-code documentation
May 19, 2020
fffa578
SD: restructured SD solver for clarity
May 19, 2020
9585342
SD: fix in-code documentation formulas
May 19, 2020
2e48351
SD: raise error upon Lubrication usage
May 20, 2020
69248bd
SD: renamed lubrication_method to approximation_method (now matches the
May 22, 2020
ac76828
SD: reactivate (and fix) GPU version
May 22, 2020
29005d8
SD: deactivate STOKESIAN_DYNAMICS_GPU again
May 22, 2020
616c1d8
SD: deactivate overlap check
May 22, 2020
889c32e
SD: add header protectors
May 22, 2020
23f7236
Merge branch 'python' into sd
jngrad May 22, 2020
55b8417
Remove overload optional argument
jngrad May 22, 2020
4d2572f
Revert "SD: deactivate STOKESIAN_DYNAMICS_GPU again"
May 22, 2020
fc06126
SD: get rid of Clang-sanitizer warnings
May 22, 2020
cb7b22e
Update src/core/stokesian_dynamics/sd_interface.cpp
biermanncarl May 22, 2020
78b8157
SD: replace cuda_add_library() with custom add_gpu_library()
May 22, 2020
f873487
SD: fix possible repeated branch in conditional chain error
May 22, 2020
c9e460f
Silence Clang-Tidy warnings from thrust
jngrad May 22, 2020
b2c203e
Merge branch 'python' into sd
jngrad May 28, 2020
1c47af8
SD: Add missing dependency
jngrad May 28, 2020
0c2ab57
SD: Add CUDA libraries for the Clang compiler
jngrad May 28, 2020
72e35ed
SD: add ROCm support
Jun 3, 2020
f184b19
ROCm 3.5 CMake fixes
mkuron Jun 3, 2020
1fb473e
ROCm 3.5 compiler flags need a different variable
mkuron Jun 3, 2020
86a2c7f
cmake: Make Stokesian Dynamics optional
jngrad May 28, 2020
8352bfa
cmake: Make Stokesian Dynamics external
jngrad Jun 4, 2020
54b14ec
cmake: Decouple CMake logic from myconfig.hpp
jngrad Jun 4, 2020
cd48cf2
sd: Add support for ROCm 3.3
jngrad Jun 4, 2020
236b50f
Revert "cmake: Decouple CMake logic from myconfig.hpp"
jngrad Jun 8, 2020
1905e81
Add missing externals
jngrad Jun 8, 2020
23074c9
Merge branch 'python' into sd
jngrad Jun 8, 2020
d9b9a6f
docs: Document SD dependencies and CMake flag
jngrad Jun 8, 2020
dba9534
cmake: convert SD to FetchContent project
jngrad Jun 12, 2020
16f51f4
cmake: Use SD with add_subdirectory
jngrad Jun 12, 2020
f135fcb
docs: Fix links and bash variables
jngrad Jun 12, 2020
7b350c1
docs: Explain how to install without network
jngrad Jun 12, 2020
ac85282
sd: Fix compiler guards
jngrad Jun 12, 2020
cbe0c1b
CI: Use latest ROCm image with all dependencies
jngrad Jun 12, 2020
6ca638f
sd: Fix compiler issue with CUDA 10.1 + thrust 1.9.5
jngrad Jun 15, 2020
145c2d3
sd: Remove license headers
jngrad Jun 15, 2020
23f762f
sd: Move header files to /src
jngrad Jun 15, 2020
fd6f090
sd: Simplify GPU guards
jngrad Jun 15, 2020
d107761
docs: Fix Sphinx issues in SD
jngrad Jun 15, 2020
6846c0c
cmake: Correctly locate CUDA libraries
jngrad Jun 15, 2020
b092645
cmake: Remove misplaced flag
jngrad Jun 15, 2020
c7258d0
core: Fix compiler error in NO_ROTATION builds
jngrad Jun 15, 2020
cd3232d
Merge remote-tracking branch 'origin/cmake-deps-inversion' into sd
jngrad Jun 15, 2020
3726d54
cmake: Dependency inversion
jngrad Jun 15, 2020
27333d4
Merge branch 'python' into sd
jngrad Jun 15, 2020
d5e0413
Formatting
jngrad Jun 15, 2020
b5cb4fd
cmake: Fix operator precedence
jngrad Jun 15, 2020
9be4433
SD: Update documentation
jngrad Jun 16, 2020
8b54548
SD: Add missing license headers
jngrad Jun 16, 2020
fc496f9
SD: Simplify interface code
jngrad Jun 16, 2020
cad813a
SD: Add CMake version guard for CUDA 10
jngrad Jun 16, 2020
3092aae
Formatting
jngrad Jun 16, 2020
b47d368
Merge branch 'python' into sd
jngrad Jun 16, 2020
8c42877
SD: Test checkpointing mechanism
jngrad Jun 16, 2020
5422567
testsuite: Fix MAX_NUM_PROC
jngrad Jun 16, 2020
e0a4a4e
SD: Split GPU and CPU test
jngrad Jun 16, 2020
811f3de
SD: Disable GPU test
jngrad Jun 16, 2020
e768253
SD: Commit missing files...
jngrad Jun 16, 2020
23ff1cf
Merge branch 'python' into sd
jngrad Jul 1, 2020
7054743
SD: Test CPU version on multiple OSse
jngrad Jul 1, 2020
ccbaa82
SD: Integrate SD docs into the integrator and thermostat pages
jngrad Jul 2, 2020
ae909ca
SD: Improve sample
jngrad Jul 2, 2020
f5bc594
SD: Test sample
jngrad Jul 2, 2020
efb34cf
SD: Accelerate tests
jngrad Jul 2, 2020
721c145
SD: Style fix
jngrad Jul 2, 2020
7ef68a8
Formatting
jngrad Jul 2, 2020
543245a
SD: Mark GPU implementation as experimental
jngrad Jul 2, 2020
53b31bf
Fix build system
jngrad Jul 2, 2020
4a352a9
SD: Rename integrator and thermostat
jngrad Jul 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,23 @@ if(WITH_GSL)
endif(GSL_FOUND)
endif(WITH_GSL)

find_package(BLAS)
if(BLAS_FOUND)
set(BLAS 1)
endif()
find_package(LAPACK)
if(LAPACK_FOUND)
set(LAPACK 1)
endif()

if(BLAS AND LAPACK)
set(STOKESIAN_DYNAMICS 1)
endif()
biermanncarl marked this conversation as resolved.
Show resolved Hide resolved

if(WITH_CUDA)
biermanncarl marked this conversation as resolved.
Show resolved Hide resolved
set(STOKESIAN_DYNAMICS_GPU 1)
endif()

if(WITH_VALGRIND_INSTRUMENTATION)
find_package(PkgConfig)
pkg_check_modules(VALGRIND valgrind)
Expand Down
8 changes: 8 additions & 0 deletions cmake/FindCUDACompilerClang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ find_library(
CUFFT_LIBRARY NAMES cufft PATHS ${CUDA_DIR}/lib64 ${CUDA_DIR}/lib
/usr/local/nvidia/lib
/usr/lib/x86_64-linux-gnu NO_DEFAULT_PATH)
find_library(
CUDA_CUBLAS_LIBRARIES NAMES cublas PATHS ${CUDA_DIR}/lib64 ${CUDA_DIR}/lib
/usr/local/nvidia/lib
/usr/lib/x86_64-linux-gnu NO_DEFAULT_PATH)
find_library(
CUDA_cusolver_LIBRARY NAMES cusolver PATHS ${CUDA_DIR}/lib64 ${CUDA_DIR}/lib
/usr/local/nvidia/lib
/usr/lib/x86_64-linux-gnu NO_DEFAULT_PATH)

function(add_gpu_library)
set(options STATIC SHARED MODULE EXCLUDE_FROM_ALL)
Expand Down
6 changes: 6 additions & 0 deletions cmake/FindCUDACompilerHIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ list(APPEND HIP_HIPCC_FLAGS_RELWITHASSERT -O3 -g)

find_library(ROCFFT_LIB name "rocfft" PATHS ${ROCM_HOME}/lib)

find_library(ROCBLAS_LIB name "rocblas" PATHS ${ROCM_HOME}/lib)
set(CUDA_CUBLAS_LIBRARIES ${ROCBLAS_LIB})

find_library(ROCSOLVER_LIB name "rocsolver" PATHS ${ROCM_HOME}/lib)
set(CUDA_cusolver_LIBRARY ${ROCSOLVER_LIB})

function(add_gpu_library)
hip_add_library(${ARGV})
set(GPU_TARGET_NAME ${ARGV0})
Expand Down
4 changes: 4 additions & 0 deletions cmake/cmake_config.cmakein
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

#cmakedefine GSL

#cmakedefine BLAS

#cmakedefine LAPACK

#cmakedefine VALGRIND_INSTRUMENTATION

#define PACKAGE_NAME "${PROJECT_NAME}"
Expand Down
1 change: 1 addition & 0 deletions doc/doxygen/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ WARN_LOGFILE =
# Note: If this tag is empty the current directory is searched.

INPUT = "@CMAKE_SOURCE_DIR@/src" \
"@CMAKE_SOURCE_DIR@/libs/stokesian_dynamics" \
"@CMAKE_SOURCE_DIR@/doc/doxygen/main.dox"

# This tag can be used to specify the character encoding of the source files
Expand Down
98 changes: 76 additions & 22 deletions doc/doxygen/bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ @Article{ahlrichs99a
doi = {10.1063/1.480156},
}

@book{allen2017,
title={Computer simulation of liquids},
author={Allen, Michael P and Tildesley, Dominic J},
year={2017},
publisher={Oxford University Press},
url={https://global.oup.com/academic/product/computer-simulation-of-liquids-9780198803201},
doi={10.1093/oso/9780198803195.001.0001},
isbn={9780198803195},
edition={2nd},
}

@Article{andersen83a,
title = {{Rattle: A "velocity" version of the shake algorithm for molecular dynamics calculations}},
author = {Andersen, Hans C.},
Expand Down Expand Up @@ -55,6 +66,27 @@ @Article{arnold13c
issn = {1099-4300},
}

@Article{banchio03a,
author = {Adolfo J. Banchio and John F. Brady},
title = {Accelerated Stokesian dynamics: Brownian motion},
journal = {Journal of Chemical Physics},
year = {2003},
volume = {118},
number = {22},
pages = {10323},
doi = {10.1063/1.1571819},
}

@Article{brady88a,
author = {J. F. Brady and G. Bossis},
title = {Stokesian Dynamics},
journal = {Annual Review of Fluid Mechanics},
year = {1988},
volume = {20},
pages = {111-157},
doi = {10.1146/annurev.fl.20.010188.000551},
}

@Article{brodka04a,
author = {Br\'{o}dka, A.},
title = {{Ewald summation method with electrostatic layer correction for interactions of point dipoles in slab geometry}},
Expand Down Expand Up @@ -91,6 +123,17 @@ @Article{cerda08d
doi = {10.1063/1.3000389},
}

@Article{cortez15a,
author = {Ricardo Cortez and DouglasVarela},
title = {A general system of images for regularized Stokeslets and other elements near a plane wall},
journal = {Journal of Computational Physics},
year = {2015},
volume = {285},
pages = {41-54},
doi = {10.1016/j.jcp.2015.01.019},
url = {https://www.sciencedirect.com/science/article/pii/S0021999115000236?via%3Dihub},
}

@PhdThesis{deserno00b,
author = {Deserno, Markus},
title = {Counterion condensation for rigid linear polyelectrolytes},
Expand Down Expand Up @@ -192,6 +235,17 @@ @Article{dupin08a
doi = {10.1080/10618560802238242},
}

@Article{durlofsky87a,
author = {L. Durlofsky and J. F. Brady and G. Bossis},
title = {Dynamic simulation of hydrodynamically interacting particles},
journal = {Journal of Fluid Mechanics},
year = {1987},
volume = {180},
pages = {21-49},
doi = {10.1017/S002211208700171X},
url = {https://www.cambridge.org/core/journals/journal-of-fluid-mechanics/article/dynamic-simulation-of-hydrodynamically-interacting-particles/7B6A8C5A04E3D16591FEABE9A8D2778F},
}

@Article{essmann95a,
title = {{A smooth Particle Mesh Ewald method}},
author = {Essmann, U. and Perera, L. and Berkowitz, M. L. and Darden, T. and Lee, H. and Pedersen, L.},
Expand Down Expand Up @@ -265,6 +319,28 @@ @Book{hockney88a
url = {https://www.crcpress.com/Computer-Simulation-Using-Particles/Hockney-Eastwood/p/book/9780852743928},
}

@Article{jancigova16a,
author = {Jan\v{c}igov\'{a}, Iveta and Cimr\'{a}k, Ivan},
title = {{Non-uniform force allocation for area preservation in spring network models}},
journal = {International Journal for Numerical Methods in Biomedical Engineering},
volume = {32},
number = {10},
pages = {e02757},
year = {2016},
doi = {10.1002/cnm.2757},
}

@Article{jeffrey84a,
author = {D. J. Jeffrey and Y. Onishi},
title = {Calculation of the resistance and mobility functions for two unequal rigid spheres in low-Reynolds-number flow},
journal = {Journal of Fluid Mechanics},
year = {1984},
volume = {139},
pages = {261-290},
doi = {10.1017/S0022112084000355},
url = {https://www.cambridge.org/core/journals/journal-of-fluid-mechanics/article/calculation-of-the-resistance-and-mobility-functions-for-two-unequal-rigid-spheres-in-lowreynoldsnumber-flow/BDF070924932AD9ABFCDAEC573D1B51A},
}

@Article{kolafa92a,
title = {{Cutoff errors in the Ewald summation formulae for point charge systems}},
author = {Kolafa, Jiri and Perram, John W.},
Expand All @@ -286,17 +362,6 @@ @Book{kruger12a
doi={10.1007/978-3-8348-2376-2},
}

@Article{jancigova16a,
author = {Jan\v{c}igov\'{a}, Iveta and Cimr\'{a}k, Ivan},
title = {{Non-uniform force allocation for area preservation in spring network models}},
journal = {International Journal for Numerical Methods in Biomedical Engineering},
volume = {32},
number = {10},
pages = {e02757},
year = {2016},
doi = {10.1002/cnm.2757},
}

@Article{ladd01a,
title = {{Lattice-Boltzmann simulations of particle-fluid suspensions}},
author = {Ladd, A. J. C. and Verberg, R.},
Expand Down Expand Up @@ -442,17 +507,6 @@ @Article{sonnenschein85a
doi = {10.1016/0021-9991(85)90151-2},
}

@book{allen2017,
title={Computer simulation of liquids},
author={Allen, Michael P and Tildesley, Dominic J},
year={2017},
publisher={Oxford University Press},
url={https://global.oup.com/academic/product/computer-simulation-of-liquids-9780198803201},
doi={10.1093/oso/9780198803195.001.0001},
isbn={9780198803195},
edition={2nd},
}

@Article{swope92a,
author = {Swope, William C. and Ferguson, David M.},
title = {{Alternative expressions for energies and forces due to angle bending and torsional energy}},
Expand Down
1 change: 1 addition & 0 deletions doc/sphinx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ if(SPHINX_FOUND)
"${CMAKE_CURRENT_SOURCE_DIR}/magnetostatics.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/particles.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/running.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/sd.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/system_manipulation.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/system_setup.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/ug.rst"
Expand Down
7 changes: 6 additions & 1 deletion doc/sphinx/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,12 @@ if sphinx.version_info[:3] < (2, 0, 1):
autodoc_mock_imports.append('MDAnalysis')

def setup(app):
app.add_css_file('bibtex.css')

# Function name was changed from before version 1.8
try:
app.add_css_file('bibtex.css')
except AttributeError:
app.add_stylesheet('bibtex.css')


# -- Options for Cython ---------------------------------------------------
Expand Down
69 changes: 69 additions & 0 deletions doc/sphinx/sd.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
.. _Stokesian_Dynamics:

Stokesian Dynamics
==================

The Stokesian Dynamics method allows to study the behaviour of spherical
particles in a viscous fluid. It is targeted at systems with very low Reynolds
numbers. In such systems, particles stop moving immediately as soon as any
force on them is removed. In other words, motion has no memory of the past.

The integration scheme is relatively simple. Only the particle's positions,
radii and forces (including torques) are needed to compute the momentary
velocities (including angular velocities). The particle positions are
integrated by simple Euler scheme.
biermanncarl marked this conversation as resolved.
Show resolved Hide resolved

The Stokesian Dynamics method is outlined in :cite:`durlofsky87a`

..note:: The computation of the velocities is an approximation with good results in the far field.

..note:: The Stokesian Dynamics method is only available for open systems, i.e. no periodic boundary conditions are supported. The box size has no effect either.

.. _Setting up an SD system:

Setting up an SD system:
------------------------

The following minimal example illustrates how to use the SDM in |es|::

import espressomd
system = espressomd.System(box_l=[1.0, 1.0, 1.0])
system.time_step = 0.01
system.cell_system.skin = 0.4
system.part.add(pos=[0, 0, 0], rotation=[1, 0, 0])
system.integrator.set_sd(viscosity=1.0, radii={0: 1.0})

system.integrator.run(100)

Because there is no force on the particle yet, nothing will move. You will need
biermanncarl marked this conversation as resolved.
Show resolved Hide resolved
to add your own actors to the system. The parameter ``radii`` is a dictionary
that maps particle types to different radii. ``viscosity`` is the dynamic
viscosity of the ambient infinite fluid. There are additional optional
parameters for ``set_sd()``. For more information, see
:py:meth:`espressomd.integrate.IntegratorHandle.set_sd()`.

Note that this setup represents a system at zero temperature. In order to
thermalize the system, the SD thermostat can be activated via an additional
command::

system.thermostat.set_sd(kT=1.0, seed=43)

``kT`` denotes the desired temperature of the system, and ``seed`` the seed for
the random number generator of the Stokesian Dynamics thermostat. It is
independent from other random number generators inside |es|.

.. _Important_SD:

Important:
----------

The particles must be prevented from overlapping. It is mathematically allowed for the particles to overlap to a certain degree. However, once the distance of the sphere centers is less than 2/3 of the sphere diameter, the mobility matrix is no longer positive definite and the Stokesian Dynamics integrator will fail. Therefore, the particle centers must be kept apart from each other by a strongly repulsive potential, for example the WCA potential that is set to the appropriate particle radius (for more information about the available interaction types see :ref:`Non-bonded interactions`).

The current implementation of SD only includes the far field approximation.
The near field (so-called lubrication) correction is planned. For now,
Stokesian Dynamics provides a good approximation of the hydrodynamics
in dilute systems where the average distance between particles is several
sphere diameters.


.. check math claims
1 change: 1 addition & 0 deletions doc/sphinx/ug.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
system_manipulation.rst
constraints.rst
lb.rst
sd.rst
analysis.rst
io.rst
visualization.rst
Expand Down
16 changes: 14 additions & 2 deletions doc/sphinx/zrefs.bib
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
% This file was created with JabRef 2.9.
% Encoding: US-ASCII
@article{ahlrichs99,
author = {Ahlrichs,Patrick and Dünweg,Burkhard },
author = {Ahlrichs,Patrick and D\"{u}nweg,Burkhard },
title = {Simulation of a single polymer chain in solution by combining lattice Boltzmann and molecular dynamics},
journal = {The Journal of Chemical Physics},
volume = {111},
Expand Down Expand Up @@ -1075,3 +1074,16 @@ @article{yaghoubi2015a
year={2015},
publisher={IOP Publishing}
}

@Article{durlofsky87a,
author = {L. Durlofsky and J. F. Brady and G. Bossis},
title = {Dynamic simulation of hydrodynamically interacting particles},
journal = {Journal of Fluid Mechanics},
year = {1987},
volume = {180},
pages = {21-49},
doi = {10.1017/S002211208700171X},
url = {https://www.cambridge.org/core/journals/journal-of-fluid-mechanics/article/dynamic-simulation-of-hydrodynamically-interacting-particles/7B6A8C5A04E3D16591FEABE9A8D2778F},
}

@Comment{jabref-meta: databaseType:bibtex;}
4 changes: 4 additions & 0 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ target_compile_definitions(Random123 INTERFACE R123_USE_MULHILO64_C99)

add_library(h5xx INTERFACE)
target_include_directories(h5xx SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/h5xx)

if(STOKESIAN_DYNAMICS OR STOKESIAN_DYNAMICS_GPU)
biermanncarl marked this conversation as resolved.
Show resolved Hide resolved
add_subdirectory(stokesian_dynamics)
endif()
36 changes: 36 additions & 0 deletions libs/stokesian_dynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
if(STOKESIAN_DYNAMICS_GPU)
add_gpu_library(sd_gpu SHARED sd_gpu.cu)
target_link_libraries(sd_gpu PRIVATE
${CUDA_CUBLAS_LIBRARIES}
${CUDA_cusolver_LIBRARY})
target_compile_definitions(sd_gpu PRIVATE SD_USE_THRUST SD_USE_GPU)
if(HIP)
jngrad marked this conversation as resolved.
Show resolved Hide resolved
target_compile_definitions(sd_gpu PRIVATE SD_USE_ROCM)
else()
target_compile_definitions(sd_gpu PRIVATE SD_USE_CUDA)
endif()
install(TARGETS sd_gpu LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd)
endif()

if(STOKESIAN_DYNAMICS)
add_library(sd_cpu SHARED sd_cpu.cpp)
target_link_libraries(sd_cpu
PRIVATE
${BLAS_LIBRARIES}
${LAPACK_LIBRARIES}
Boost::boost
Random123)
jngrad marked this conversation as resolved.
Show resolved Hide resolved

# In case the GPU is used, Thrust is present and can be used to parallelize
# the CPU code, too. The standard compiler needs to be told the location of
# Thrust
if(STOKESIAN_DYNAMICS_GPU)
target_compile_definitions(sd_cpu PUBLIC SD_USE_THRUST PRIVATE THRUST_DEVICE_SYSTEM=4)
#target_compile_definitions(sd_cpu PUBLIC USE_THRUST)
target_include_directories(sd_cpu PRIVATE
${CUDA_INCLUDE_DIRS}
${HIP_ROOT_DIR}/include
${ROCM_HOME}/include)
endif()
install(TARGETS sd_cpu LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd)
endif()
Loading