{"id":13869714,"url":"https://github.com/lettucecfd/lettuce","last_synced_at":"2025-07-15T18:31:50.120Z","repository":{"id":41065275,"uuid":"185307088","full_name":"lettucecfd/lettuce","owner":"lettucecfd","description":"Computational Fluid Dynamics based on PyTorch and the Lattice Boltzmann Method","archived":false,"fork":false,"pushed_at":"2025-06-25T11:11:28.000Z","size":11536,"stargazers_count":244,"open_issues_count":35,"forks_count":46,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-25T12:24:48.514Z","etag":null,"topics":["cfd","lattice-boltzmann","machine-learning","physics-simulation","pytorch","torch"],"latest_commit_sha":null,"homepage":"","language":"Python","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/lettucecfd.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"docs/contributing.rst","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":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-05-07T02:37:05.000Z","updated_at":"2025-06-25T11:11:33.000Z","dependencies_parsed_at":"2024-01-16T07:22:42.719Z","dependency_job_id":"83c42ea5-37a8-4558-b5ec-5df4393971ec","html_url":"https://github.com/lettucecfd/lettuce","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/lettucecfd/lettuce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettucecfd%2Flettuce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettucecfd%2Flettuce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettucecfd%2Flettuce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettucecfd%2Flettuce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lettucecfd","download_url":"https://codeload.github.com/lettucecfd/lettuce/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettucecfd%2Flettuce/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265451443,"owners_count":23767768,"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":["cfd","lattice-boltzmann","machine-learning","physics-simulation","pytorch","torch"],"created_at":"2024-08-05T20:01:13.258Z","updated_at":"2025-07-15T18:31:49.566Z","avatar_url":"https://github.com/lettucecfd.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":".. image:: https://raw.githubusercontent.com/lettucecfd/lettuce/master/.source/img/logo_lettuce_typo.png\n\n.. image:: https://github.com/lettucecfd/lettuce/actions/workflows/CI.yml/badge.svg\n        :target: https://github.com/lettucecfd/lettuce/actions/workflows/CI.yml\n        :alt: CI Status\n\n.. image:: https://readthedocs.org/projects/lettucecfd/badge/?version=latest\n        :target: https://lettucecfd.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n        \n.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3757641.svg\n        :target: https://doi.org/10.5281/zenodo.3757641\n\n\n\nGPU-accelerated Lattice Boltzmann Simulations in Python\n-------------------------------------------------------\n\nLettuce is a Computational Fluid Dynamics framework based on the lattice Boltzmann method (LBM).\n\n- **GPU-Accelerated Computation**: Utilizes PyTorch for high performance and efficient GPU utilization.\n- **Rapid Prototyping**: Supports both 2D and 3D simulations for quick and reliable analysis.\n- **Advanced Techniques**: Integrates neural networks and automatic differentiation to enhance LBM.\n- **Optimized Performance**: Includes custom PyTorch extensions for native CUDA kernels.\n\nResources\n---------\n\n- `Documentation`_\n- Presentation at CFDML2021 - `Paper`_ | `Preprint`_ | `Slides`_ | `Video`_ | `Code`_\n\n.. _Paper: https://www.springerprofessional.de/en/lettuce-pytorch-based-lattice-boltzmann-framework/19862378\n.. _Documentation: https://lettuceboltzmann.readthedocs.io\n.. _Preprint: https://arxiv.org/pdf/2106.12929.pdf\n.. _Slides: https://drive.google.com/file/d/1jyJFKgmRBTXhPvTfrwFs292S4MC3Fqh8/view\n.. _Video: https://www.youtube.com/watch?v=7nVCuuZDCYA\n.. _Code: https://github.com/lettucecfd/lettuce-paper\n\nGetting Started\n---------------\n\nTo find some very simple examples of how to use lettuce, please have a look at the examples_. These will guide you through lettuce's main features. Please ensure you have Jupyter installed to run the Jupyter notebooks.\n\nThe simplest example is:\n\nhttps://github.com/lettucecfd/lettuce/blob/ef9830b59c6ad50e02fdf0ce24cc47ea520aa354/examples/00_simplest_TGV.py#L6-L21\n\n.. _examples: https://github.com/lettucecfd/lettuce/tree/master/examples\n\nInstallation\n------------\n\n* Install the anaconda or miniconda package manager from https://www.anaconda.org\n\n* Clone this repository from github and change to it::\n\n    git clone https://github.com/lettucecfd/lettuce\n    cd lettuce\n\n* Update conda, create a new conda environment and activate it::\n\n    conda update conda\n    conda create -n lettuce\n    conda activate lettuce\n\n* Follow the recommendations at https://pytorch.org/get-started/locally/ to install pytorch based on your GPU's CUDA version. You may need to install the nvidia toolkit. You may follow the instructions at https://developer.nvidia.com/cuda-downloads. You may need to check the compatibility of your NVIDIA driver with the desired CUDA version: https://docs.nvidia.com/deploy/cuda-compatibility/. To get your CUDA version, run::\n\n    nvcc --version\n\n* For CUDA 12.1 (if supported by your GPU) use::\n\n    conda install pytorch pytorch-cuda=12.1 -c pytorch -c nvidia\n\n* Install the remaining dependencies. _This will not include CUDA-support unless you installed `pytorch-cuda`!_::\n\n    conda activate lettuce\n    conda install --file requirements.txt -c pytorch -c nvidia -c conda-forge\n\n* **NOTE**: Sometimes, the installation does not properly set the `CUDA_HOME` variable. In this case, you may install `cudatoolkit` and set `CUDA_HOME` to the package directory (it should containa `/bin/nvcc/` subdirectory!).\n\n* If you want to only **use** lettuce, run the installation (from the lettuce base directory!). Ideally, use [PEP 517](https://peps.python.org/pep-0517/)::\n\n    pip install --use-pep517 .\n\n* If you are a **developer**, add the changeable-installation-flag (`-e`)::\n\n    pip install --use-pep517 -e .\n\n* Check out the convergence order, running on CPU::\n\n    lettuce --no-cuda convergence\n\n* Run the test cases::\n\n    pytest tests\n\n* For running a CUDA-driven LBM simulation on one GPU omit the `--no-cuda`. If CUDA is not found, make sure that cuda drivers are installed and compatible with the installed cudatoolkit (see conda install command above).\n\n* Check out the performance, running on GPU::\n\n    lettuce benchmark\n\nCitation\n--------\nIf you use Lettuce in your research, please cite the following paper::\n\n    @inproceedings{bedrunka2021lettuce,\n      title={Lettuce: PyTorch-Based Lattice Boltzmann Framework},\n      author={Bedrunka, Mario Christopher and Wilde, Dominik and Kliemank, Martin and Reith, Dirk and Foysi, Holger and Kr{\\\"a}mer, Andreas},\n      booktitle={High Performance Computing: ISC High Performance Digital 2021 International Workshops, Frankfurt am Main, Germany, June 24--July 2, 2021, Revised Selected Papers},\n      pages={40},\n      organization={Springer Nature}\n    }\n\nCredits\n-------\nWe use the following third-party packages:\n\n* pytorch_\n* numpy_\n* pytest_\n* click_\n* matplotlib_\n* versioneer_\n* pyevtk_\n* h5py_\n* mmh3_\n\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n.. _pytorch: https://github.com/pytorch/pytorch\n.. _numpy: https://github.com/numpy/numpy\n.. _pytest: https://github.com/pytest-dev/pytest\n.. _click: https://github.com/pallets/click\n.. _matplotlib: https://github.com/matplotlib/matplotlib\n.. _versioneer: https://github.com/python-versioneer/python-versioneer\n.. _pyevtk: https://github.com/pyscience-projects/pyevtk\n.. _h5py: https://github.com/h5py/h5py\n.. _mmh3: https://github.com/hajimes/mmh3\n\nLicense\n-----------\n* Free software: MIT license, as found in the LICENSE_ file.\n\n.. _LICENSE: https://github.com/lettucecfd/lettuce/blob/master/LICENSE\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flettucecfd%2Flettuce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flettucecfd%2Flettuce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flettucecfd%2Flettuce/lists"}