Skip to content

Commit 0983874

Browse files
committed
Merge remote-tracking branch 'refs/remotes/lettucecfd/update-readme' into 226-feature-add-simple-first_examplypy
2 parents 62d9304 + 628b856 commit 0983874

File tree

2 files changed

+34
-44
lines changed

2 files changed

+34
-44
lines changed

README.rst

+33-43
Original file line numberDiff line numberDiff line change
@@ -40,65 +40,57 @@ Resources
4040
.. _Video: https://www.youtube.com/watch?v=7nVCuuZDCYA
4141
.. _Code: https://github.com/lettucecfd/lettuce-paper
4242

43-
44-
Resources
45-
---------
46-
47-
- `Documentation`_
48-
- Presentation at CFDML2021 - `Preprint`_ | `Slides`_ | `Video`_ | `Code`_
49-
50-
.. _Documentation: https://lettuceboltzmann.readthedocs.io
51-
.. _Preprint: https://arxiv.org/pdf/2106.12929.pdf
52-
.. _Slides: https://drive.google.com/file/d/1jyJFKgmRBTXhPvTfrwFs292S4MC3Fqh8/view
53-
.. _Video: https://www.youtube.com/watch?v=7nVCuuZDCYA
54-
.. _Code: https://github.com/lettucecfd/lettuce-paper
55-
5643
Getting Started
5744
---------------
5845

59-
The following Python code will run a two-dimensional Taylor-Green vortex on a GPU:
46+
To find some very simple examples of how to use lettuce, please have a look
47+
at the examples_. These will guide you through lettuce's main features.
6048

61-
.. code:: python
49+
Please ensure you have Jupyter installed to run the Jupyter notebooks.
6250

63-
import torch
64-
import lettuce as lt
51+
.. _examples: https://github.com/lettucecfd/lettuce/tree/master/examples
6552

66-
lattice = lt.Lattice(lt.D2Q9, device='cuda', dtype=torch.float64, use_native=False) # for running on cpu: device='cpu'
67-
flow = lt.TaylorGreenVortex2D(resolution=128, reynolds_number=100, mach_number=0.05, lattice=lattice)
68-
collision = lt.BGKCollision(lattice, tau=flow.units.relaxation_parameter_lu)
69-
streaming = lt.StandardStreaming(lattice)
70-
simulation = lt.Simulation(flow=flow, lattice=lattice, collision=collision, streaming=streaming)
71-
mlups = simulation.step(num_steps=1000)
72-
print("Performance in MLUPS:", mlups)
53+
Installation
54+
------------
7355

74-
More advanced examples_ are available as jupyter notebooks.
56+
* Install the anaconda or miniconda package manager from www.anaconda.org
57+
* Create a new conda environment and activate it::
7558

76-
Please ensure you have Jupyter installed to run these notebooks.
59+
conda create -n lettuce
60+
conda activate lettuce
7761

78-
.. _examples: https://github.com/lettucecfd/lettuce/tree/master/examples
62+
* Follow the recommendations at https://pytorch.org/get-started/locally/ to
63+
install pytorch based on your GPU's CUDA version. You may need to install
64+
the nvidia toolkit. You may follow the instructions at https://developer
65+
.nvidia.com/cuda-downloads. You may need to check the compatibility of your
66+
NVIDIA driver with the desired CUDA version:
67+
https://docs.nvidia.com/deploy/cuda-compatibility/. To get your CUDA version,
68+
run::
7969

80-
Installation
81-
------------
70+
nvcc --version
8271

83-
* Install the anaconda package manager from www.anaconda.org
84-
* Create a new conda environment and install PyTorch::
72+
* For CUDA 12.1 (if supported by your GPU) use::
8573

86-
conda create -n lettuce -c pytorch -c nvidia pytorch pytorch-cuda=12.1
74+
conda install pytorch pytorch-cuda=12.1 -c pytorch -c nvidia
8775

88-
* Activate the conda environment::
76+
* Install the remaining dependencies::
8977

9078
conda activate lettuce
79+
conda install -c pytorch -c conda-forge matplotlib pytest click pyevtk mmh3 h5py scipy pandas numpy
9180

92-
* Install all requirements::
81+
* Clone this repository from github and change to it::
9382

94-
conda install -c conda-forge -c anaconda matplotlib pytest click pyevtk h5py mmh3
83+
git clone https://github.com/lettucecfd/lettuce
84+
cd lettuce
9585

96-
* Clone this repository from github
97-
* Change into the cloned directory
98-
* Run the install script::
86+
* If you want to only **USE** lettuce, run the install script::
9987

10088
python setup.py install
10189

90+
* If you are a **developer**, do this to update the lettuce package when running a script::
91+
92+
python setup.py develop
93+
10294
* Run the test cases::
10395

10496
python setup.py test
@@ -107,15 +99,14 @@ Installation
10799

108100
lettuce --no-cuda convergence
109101

110-
* For running a CUDA-driven LBM simulation on one GPU omit the `--no-cuda`. If CUDA is not found,
111-
make sure that cuda drivers are installed and compatible with the installed cudatoolkit
112-
(see conda install command above).
102+
* For running a CUDA-driven LBM simulation on one GPU omit the `--no-cuda`.
103+
If CUDA is not found, make sure that cuda drivers are installed and
104+
compatible with the installed cudatoolkit (see conda install command above).
113105

114106
* Check out the performance, running on GPU::
115107

116108
lettuce benchmark
117109

118-
119110
Citation
120111
--------
121112
If you use Lettuce in your research, please cite the following paper::
@@ -128,7 +119,6 @@ If you use Lettuce in your research, please cite the following paper::
128119
organization={Springer Nature}
129120
}
130121

131-
132122
Credits
133123
-------
134124
We use the following third-party packages:

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
with open('HISTORY.rst') as history_file:
1313
history = history_file.read()
1414

15-
requirements = ['Click>=6.0', "torch>=2.1", "numpy==1.26.4", "matplotlib==3.9.0", "pyevtk", "h5py>=3.2.1", "mmh3"]
15+
requirements = ['Click>=6.0', "torch>=2.1", "numpy==1.26.4", "matplotlib", "pyevtk", "h5py>=3.2.1", "mmh3"]
1616

1717
setup_requirements = ['pytest-runner', 'pytest']
1818

0 commit comments

Comments
 (0)