PyFilaments is a Python library to simulate the dynamics of active filaments inspired by our work to understand the remarkable behaviour of the ciliate Lacrymaria olor. The filaments are built out of spherical particles/colloids which can be either active, i.e. capable of applying stresses on the surrounding fluid, or passive. The library uses the PyStokes library for calculating rigid body motions of the colloids and their flows due to many-body hydrodynamic interactions. The colloids are connected into filaments using connection forces due to non-linear springs and bending potentials, as well as near-field repulsive potentials. The library allows the active stresses to be varied dynamically to simulate ciliary reversals which are a hallmark of ciliate behaviour.
Using the PyFilaments library we have discovered a rich space of filament behaviors under time-varying forcing, including periodic and aperiodic dynamics. We further find that aperiodic behaviors are due to a transition to chaos.
Follow instruction at https://docs.conda.io/projects/conda/en/latest/user-guide/install/ based on your operating system
>> git clone https://github.com/deepakkrishnamurthy/PyFilaments.git
>> cd PyFilaments
>> conda create -n pyfilaments python=3.6
>> conda activate pyfilaments
>> pip install -r requirements.txt
- Download odespy repo from https://github.com/rajeshrinet/odespy and follow install instructions.
Navigate to the pystokes folder within the pyfilaments repo and then run.
>> cd pystokes
>> python setup.py install
Navigate to the pyforces folder within the pyfilaments repo and then run.
>> cd pyforces
>> python setup.py install
Navigate to filament folder: /PyFilament/pyfilament/filament. Run the installation for Cythonized filament subroutines
>> cd pyfilament/filament
>> python setup.py install
Since the code base is under active development. Add the root folder of the repo to your PYTHONPATH by following the instructions here
For eg. on MacOS, this would mean
- Open terminal app
- Open the file ~/.bash_profile in your text editor – e.g. atom ~/.bash_profile;
- Add the following line to the end:
export PYTHONPATH="/Users/my_user/PyFilaments"
- Save the file
- Close the terminal app
If openMP is not detected while installing pystokes and pyforces. Then follow the next steps
We need to reinstall gcc with openMP for which we first need to set permissions
sudo chown -R $(whoami) $(brew --prefix)/*
Now install gcc
brew reinstall gcc --without-multilib
-
Krishnamurthy, Deepak, and Manu Prakash. "Emergent Programmable Behavior and Chaos in Dynamically Driven Active Filaments." bioRxiv (2022): 2022-06.
-
Singh, Rajesh, and Ronojoy Adhikari. "Pystokes: Phoresis and Stokesian hydrodynamics in python." arXiv preprint arXiv:1910.00909 (2019).