SPHARCLE
Slender Particle Hydrodynamics And Reacting Cytoskeletal Linking Elements.
See the documentation on readthedocs for installation instructions, as well as how to run and modify the examples.
This repository contains the Python/C++ and Matlab codes for the publications:
- "An integral-based spectral method for inextensible slender fibers in
Stokes flow," by O. Maxian, A. Mogilner, and A. Donev, Jan. 2021.
See arxiv for text and
Phys. Rev. Fluids for published
version.
- "Simulations of dynamically cross-linked actin networks: morphology, rheology, and hydrodynamic interactions,"
by O. Maxian, R. P. Peláez, A. Mogilner, and A. Donev, Dec. 2021.
See biorxiv for text and
PLoS Comp. Bio
for published version.
- "Interplay between Brownian motion and cross-linking kinetics controls bundling dynamics in actin networks,"
by O. Maxian, A. Donev, and A. Mogilner, April 2022.
See biorxiv for text and Biophys. J. for
published version.
- "The hydrodynamics of a twisting, bending, inextensible fiber in Stokes flow,"
by O. Maxian, B. Sprinkle, C.S. Peskin, and A. Donev, July 2022.
See arxiv for text and Phys. Rev. Fluids for published
version.
- "Slender body theories for rotating filaments," by O. Maxian and A. Donev, Nov. 2022. See J. Fluid Mech. for published version, which is open access. This is primarily a theoretical study which has some numerical calculations. The relevant files are here, but we recommend using the more accurate quadrature scheme by Malhotra and Barnett for slender body boundary integral calculations.
- "Bending fluctuations in semiflexible, inextensible, slender filaments in Stokes flow: towards a spectral discretization," by O. Maxian, B. Sprinkle, and A. Donev, Jan. 2023. See arxiv for text and J. Chem. Phys for published version.
- "Helical motors and formins synergize to compact chiral filopodial bundles: a theoretical perspective," by O. Maxian and A. Mogilner, Nov. 2023. See biorxiv for text. The codes for this publication are here.
Organization is as follows:
- Python: directory with python codes
- Python/cppmodules: directory with C++ modules linked to python using pybind11 (compile with included makefile)
- Python/Examples: python scripts to reproduce the tests and examples [1-3] and [6]. See the README there for more information.
- Python/Dependencies: contains all dependencies for the python codes. Some are submodules, while some are modified copies of the libraries.
- Matlab: directory with matlab codes. These are the only codes used in [4], [5], and [7].
External dependencies:
- krypy. I have modified some of this and included the raw code in Python/Dependencies.
- scipy
- LaPack (for C++ functions)
- PyBind11 (to link python and C++)
- UAMMD (for Ewald splitting on the GPU). This is used as a submodule in Python/Dependencies.
- FINUFFT. I have modified some of the v 1.0 code and included the raw code in Python/Dependencies. Note that this dependency is not strictly necessary; it is only needed if you wish to run nonlocal hydrodynamics and do not have a GPU.
Instructions for running code
1) Clone this repo using
git clone --recursive https://github.com/stochasticHydroTools/SlenderBody
This will also clone the submodules in the dependency folder. Then run
cd SlenderBody
bash install.sh
in the main directory. This will compile all of the dependencies and C++ modulues. It will also
add the appropriate directories (where the python modulues are compiled) to your PYTHONPATH.
If the compilation process fails this script will show an error. In that case fix the compilation issue and run bash install.sh
again.
3) Common mistakes:
- When compiling UAMMD in the dependencies, the compiler may complain depending on what version of nvcc you use.
If it complains that there is no file called cub, cd into SlenderBody/Python/Dependencies/UAMMD_PSE_Python/uammd/src/third_party
and change the folder called "cub_bak" to "cub." This should fix that issue. See also the UAMMD webpage
for more compilation instructions.
4) Run the python scripts in Python/Examples. For example,
python3 ThreeShearedFibs.py
will run the example in Section 5.1.2 of [1]
Parallelization
The number of OpenMP threads (environment variable) MUST be set to one to obtain good performance.
In particular, you must use
export OMP_NUM_THREADS=1
in linux prior to running our code.
The parallelization is then implemented in the C++ class FiberCollectionC.cpp which takes as an inpute the number of threads. The number of threads in these calculations can be set by passing an integer to the constructor of fiberCollection.py. An example of this is on line 49 of Python/Examples/CheckStability.py. We also have a GPU version.
Uninstalling
1) Run make clean
inside the Python folder.
2) The install.sh script modifies the .bashrc file (which are marked as written by the script). Simply remove these lines.