{"id":18948657,"url":"https://github.com/rajeshrinet/pystokes","last_synced_at":"2025-04-05T18:10:10.405Z","repository":{"id":22966066,"uuid":"26315951","full_name":"rajeshrinet/pystokes","owner":"rajeshrinet","description":"PyStokes: phoresis and Stokesian hydrodynamics in Python. github.com/rajeshrinet/pystokes","archived":false,"fork":false,"pushed_at":"2025-03-13T06:06:44.000Z","size":56870,"stargazers_count":47,"open_issues_count":0,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T17:11:29.443Z","etag":null,"topics":["active-colloids","active-particles","autophoretic-suspensions","colloids","crystallization","cython","force-fields","hydrodynamic-interactions","phase-separation","phoretic-interactions","pystokes","python","stokes-flow","stokesian-hydrodynamics","traction"],"latest_commit_sha":null,"homepage":"https://pystokes.readthedocs.io","language":"Cython","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rajeshrinet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-07T10:57:30.000Z","updated_at":"2025-03-13T06:06:47.000Z","dependencies_parsed_at":"2023-01-14T01:00:16.876Z","dependency_job_id":"9d20aa70-323d-4b09-a865-b31aac5c382d","html_url":"https://github.com/rajeshrinet/pystokes","commit_stats":{"total_commits":341,"total_committers":7,"mean_commits":"48.714285714285715","dds":0.0703812316715543,"last_synced_commit":"402254fdbcb1d06d69d74b6f65d7db82632644cc"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajeshrinet%2Fpystokes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajeshrinet%2Fpystokes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajeshrinet%2Fpystokes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajeshrinet%2Fpystokes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rajeshrinet","download_url":"https://codeload.github.com/rajeshrinet/pystokes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378149,"owners_count":20929297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["active-colloids","active-particles","autophoretic-suspensions","colloids","crystallization","cython","force-fields","hydrodynamic-interactions","phase-separation","phoretic-interactions","pystokes","python","stokes-flow","stokesian-hydrodynamics","traction"],"created_at":"2024-11-08T13:14:14.570Z","updated_at":"2025-04-05T18:10:10.356Z","avatar_url":"https://github.com/rajeshrinet.png","language":"Cython","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Imagel](https://raw.githubusercontent.com/rajeshrinet/pystokes/master/examples/banner.png)\n\n\n## PyStokes: phoresis and Stokesian hydrodynamics in Python \n![Installation](https://github.com/rajeshrinet/pystokes/workflows/CI/badge.svg) \n![Notebooks](https://github.com/rajeshrinet/pystokes/workflows/notebooks/badge.svg) \n[![Documentation Status](https://readthedocs.org/projects/pystokes/badge/?version=latest)](https://pystokes.readthedocs.io/en/latest/?badge=latest) \n[![DOI](https://joss.theoj.org/papers/10.21105/joss.02318/status.svg)](https://doi.org/10.21105/joss.02318) \n[![PyPI](https://img.shields.io/pypi/v/pystokes.svg)](https://pypi.python.org/pypi/pystokes)\n![PyPI Downloads](https://static.pepy.tech/badge/pystokes)\n![Stars](https://img.shields.io/github/stars/rajeshrinet/compPhy) \n![Forks](https://img.shields.io/github/forks/rajeshrinet/compPhy) \n\n[About](#about) \n| [Installation](#installation) \n| [Documentation](https://pystokes.readthedocs.io/en/latest/) \n| [Examples](#examples) \n| [Publications](#publications)\n| [Gallery](https://github.com/rajeshrinet/pystokes/wiki/Gallery)\n| [Support](#support) \n| [License](#license)\n\n\n## About\n\n[PyStokes](https://github.com/rajeshrinet/pystokes) is a numerical library for phoresis and Stokesian hydrodynamics in Python. It uses a grid-free method, combining the integral representation of Laplace and Stokes equations, spectral expansion, and Galerkin discretization, to compute phoretic and hydrodynamic interactions between spheres with slip boundary conditions on their surfaces. The library also computes suspension scale quantities, such as rheological response, energy dissipation and fluid flow. The computational cost is quadratic in the number of particles and upto 1e5 particles have been accommodated on multicore computers. The library has been used to model suspensions of **microorganisms**,  **synthetic autophoretic particles** and **self-propelling droplets**. \n\nYou can take PyStokes for a spin online using Google Colab: \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/rajeshrinet/pystokes/blob/master/examples/ex01a-colab.ipynb\"\u003e\n  \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\n\u003c/a\u003e\n\n\u003cbr\u003e\n\nPlease read the PyStokes [paper](https://doi.org/10.21105/joss.02318) and [Wiki](https://github.com/rajeshrinet/pystokes/wiki) before you use PyStokes for your research. Included below are some examples from [PyStokes Gallery](https://github.com/rajeshrinet/pystokes/wiki/Gallery): \n\n### Periodic orbits of active particles\n\n![Image](https://raw.githubusercontent.com/rajeshrinet/pystokes-misc/master/gallery/2_volvox.gif)\n\nOur [work](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.124.088003) shows that the oscillatory dynamics of a pair of active particles near\na boundary, best exemplified by the fascinating dance of the green algae\n*Volvox*, can be understood in terms of Hamiltonian mechanics, even though the\nsystem does not conserve energy. Read more in the [PyStokes Gallery](https://github.com/rajeshrinet/pystokes/wiki/Gallery).\n\u003cbr\u003e\n\n### Crystallization at a plane no-slip surface\nIt is well-known that crystallization of colloids approximating hard spheres\nis due, paradoxically, to the higher entropy of the ordered crystalline state\ncompared to that of  the disordered liquid state. Out of equilibrium, no such general\nprinciple is available to rationalize crystallization. In this [work](https://doi.org/10.1103/PhysRevLett.117.228002), we identify a new non-equilibrium mechanism, associated with entropy production rather than entropy gain, which drives crystallization of active colloids near plane walls. Read more in the [PyStokes Gallery](https://github.com/rajeshrinet/pystokes/wiki/Gallery).\n\n\n![Crystallization of active colloids](https://raw.githubusercontent.com/rajeshrinet/pystokes/master/examples/crystallite.gif) \n\n\n## News\n**26th July 2019** -- PyStokes can compute hydrodynamic *and* phoretic interactions in autophoretic suspensions.  \n\n\n## Installation\n\n### From a checkout of this repo\n\n#### Install PyStokes and an extended list of dependencies using \n \n```bash\n\u003e\u003e git clone https://github.com/rajeshrinet/pystokes.git\n\u003e\u003e cd pystokes\n\u003e\u003e pip install -r requirements.txt\n\u003e\u003e python setup.py install\n```\n\n\n### Via pip\n\nInstall the latest [PyPI](https://pypi.org/project/pystokes) version\n\n```bash\n\u003e\u003e pip install pystokes\n```\n\n\n### Testing\nTest installation and running\n\n```bash\n\u003e\u003e cd tests\n\u003e\u003e python test_short.py\n```\n\nLong test of example notebooks \n\n```bash\n\u003e\u003e cd tests\n\u003e\u003e python test_notebooks.py\n```\n\n\n## Examples\n\n\n```Python\n# Example 1: Flow field due to $2s$ mode of active slip\nimport pystokes, numpy as np, matplotlib.pyplot as plt\n\n# particle radius, self-propulsion speed, number and fluid viscosity\nb, eta, N = 1.0, 1.0/6.0, 1\n\n# initialize\nr, p = np.array([0.0, 0.0, 3.4]), np.array([0.0, 1.0, 0])\nV2s  = pystokes.utils.irreducibleTensors(2, p)\n\n# space dimension , extent , discretization\ndim, L, Ng = 3, 10, 64;\n\n# instantiate the Flow class\nflow = pystokes.wallBounded.Flow(radius=b, particles=N, viscosity=eta, gridpoints=Ng*Ng)\n\n# create grid, evaluate flow and plot\nrr, vv = pystokes.utils.gridYZ(dim, L, Ng)\nflow.flowField2s(vv, rr, r, V2s)  \npystokes.utils.plotStreamlinesYZsurf(vv, rr, r, offset=6-1, density=1.4, title='2s')\n```\n\n```Python\n#Example 2: Phoretic field due to active surface flux of l=0 mode\nimport pystokes, numpy as np, matplotlib.pyplot as plt\n# particle radius, fluid viscosity, and number of particles\nb, eta, N = 1.0, 1.0/6.0, 1\n\n#initialise\nr, p = np.array([0.0, 0.0, 5]), np.array([0.0, 0.0, 1])\nJ0 = np.ones(N)  # strength of chemical monopolar flux\n\n# space dimension , extent , discretization\ndim, L, Ng = 3, 10, 64;\n\n# instantiate the Flow class\nphoreticField = pystokes.phoretic.unbounded.Field(radius=b, particles=N, phoreticConstant=eta, gridpoints=Ng*Ng)\n\n# create grid, evaluate phoretic field and plot\nrr, vv = pystokes.utils.gridYZ(dim, L, Ng)\nphoreticField.phoreticField0(vv, rr, r, J0)  \npystokes.utils.plotContoursYZ(vv, rr, r, density=.8, offset=1e-16,  title='l=0') \n```\n\nOther examples include\n* [Irreducible Active flows](https://github.com/rajeshrinet/pystokes/blob/master/examples/ex01-unboundedFlow.ipynb)\n* [Effect of plane boundaries on active flows](https://github.com/rajeshrinet/pystokes/blob/master/examples/ex02-flowPlaneSurface.ipynb)\n* [Active Brownian Hydrodynamics near a plane wall](https://github.com/rajeshrinet/pystokes/blob/master/examples/ex03-crystalNucleation.ipynb)\n* [Flow-induced phase separation at a plane surface](https://github.com/rajeshrinet/pystokes/blob/master/examples/ex04-crystallization.ipynb)\n* [Irreducible autophoretic fields](https://github.com/rajeshrinet/pystokes/blob/master/examples/ex05-phoreticField.ipynb)\n* [Autophoretic arrest of flow-induced phase separation](https://github.com/rajeshrinet/pystokes/blob/master/examples/ex06-arrestedCluster.ipynb)\n\n\n## Publications\n\nA selected list of publications is given below. See full publication list [here](https://github.com/rajeshrinet/pystokes/wiki/Publications).\n\n* [PyStokes: phoresis and Stokesian hydrodynamics in Python](https://doi.org/10.21105/joss.02318), R Singh and R Adhikari, **Journal of Open Source Software**, 5(50), 2318, (2020). *(Please cite this paper if you use PyStokes in your research)*.\n\n* [Controlled optofluidic crystallization of colloids tethered at interfaces](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.125.068001), A Caciagli, R Singh, D Joshi, R Adhikari, and E Eiser, **Physical Review Letters** 125 (6), 068001 (2020)\n\n* [Periodic Orbits of Active Particles Induced by Hydrodynamic Monopoles](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.124.088003), A Bolitho, R Singh, R Adhikari, **Physical Review Letters** 124 (8), 088003 (2020)\n\n* [Competing phoretic and hydrodynamic interactions in autophoretic colloidal suspensions](https://aip.scitation.org/doi/full/10.1063/1.5090179), R Singh, R Adhikari, and ME Cates, **The Journal of Chemical Physics** 151, 044901 (2019)\n\n* [Generalized Stokes laws for active colloids and their applications](https://iopscience.iop.org/article/10.1088/2399-6528/aaab0d), R Singh and R Adhikari, **Journal of Physics Communications**, 2, 025025 (2018)\n\n\n* [Flow-induced phase separation of active particles is controlled by boundary conditions](https://www.pnas.org/content/115/21/5403), S Thutupalli, D Geyer, R Singh, R Adhikari, and HA Stone, **Proceedings of the National Academy of Sciences**, 115, 5403 (2018)  \n\n* [Universal hydrodynamic mechanisms for crystallization in active colloidal suspensions](https://doi.org/10.1103/PhysRevLett.117.228002), R Singh and R Adhikari,  **Physical Review Letters**, 117, 228002 (2016)\n\n\n## Support\n\n* For help with and questions about PyStokes, please post to the [pystokes-users](https://groups.google.com/forum/#!forum/pystokes) group.\n* For bug reports and feature requests, please use the [issue tracker](https://github.com/rajeshrinet/pystokes/issues) on GitHub.\n\n## License\nWe believe that openness and sharing improves the practice of science and increases the reach of its benefits. This code is released under the [MIT license](http://opensource.org/licenses/MIT). Our choice is guided by the excellent article on [Licensing for the scientist-programmer](http://www.ploscompbiol.org/article/info%3Adoi%2F10.1371%2Fjournal.pcbi.1002598). \n\t\t\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajeshrinet%2Fpystokes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajeshrinet%2Fpystokes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajeshrinet%2Fpystokes/lists"}