Giter VIP home page Giter VIP logo

pyfilaments's Introduction

PyFilaments: Simulate Active Filament Dynamics with Many-body Hydrodynamics in Python

About

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.

Rich behavioral space of active filaments under time-varying forcing

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.

Periodic dynamics

Periodic dynamics

Aperiodic dynamics

Aperiodic dynamics

Installation

From a checkout of this repo

Install a package manager (conda)

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

Create a python virtual environment.

>> conda create -n pyfilaments python=3.6
>> conda activate pyfilaments
>> pip install -r requirements.txt

Install odespy for numerical integration

Install pystokes

Navigate to the pystokes folder within the pyfilaments repo and then run.

>> cd pystokes
>> python setup.py install

Install pyforces

Navigate to the pyforces folder within the pyfilaments repo and then run.

>> cd pyforces
>> python setup.py install

Install fast filamnent subroutines

Navigate to filament folder: /PyFilament/pyfilament/filament. Run the installation for Cythonized filament subroutines

>> cd pyfilament/filament
>> python setup.py install

Create PYTHONPATH variables

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

OSX only:

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

References

  • 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).

pyfilaments's People

Contributors

deepakkrishnamurthy avatar rajeshrinet avatar ronojoy avatar

Stargazers

 avatar  avatar

pyfilaments's Issues

installation error

openmp and gcc reinstall suggestions are outdated - need to be updated to allow for proper gcc reinstall

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.