diff --git a/README.md b/README.md index bd3680317ccc7c923d11873b88baffe0bdb1029b..e864251cdcaff71cddfcc38e88c4adbe56ff8ffb 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,47 @@ pystencils ========== +[](https://i10git.cs.fau.de/pycodegen/pystencils/commits/master) +[](https://i10git.cs.fau.de/pycodegen/pystencils/commits/master) +[coverage report](http://pycodegen.pages.walberla.net/pystencils/coverage_report) + Run blazingly fast stencil codes on numpy arrays. - +*pystencils* uses sympy to define stencil operations, that can be executed on numpy array. +It runs faster than normal numpy code and even as Cython and numba. + +Here is a code snippet that computes the average of neighboring cells: +```python +import pystencils as ps +import numpy as np + +f, g = ps.fields("f, g : [2D]") +stencil = ps.Assignment(g[0, 0], + (f[1, 0] + f[-1, 0] + f[0, 1] + f[0, -1]) / 4) +kernel = ps.create_kernel(stencil).compile() + +f_arr = np.random.rand(1000, 1000) +g_arr = np.empty_like(f_arr) +kernel(f=f_arr, g=g_arr) +``` + +*pystencils* is mostly used for numerical simulations using finite difference or finite volume methods. +It comes with automatic finite difference discretization for PDEs: + +```python +c, v = ps.fields("c, v(2): [2D]") +adv_diff_pde = ps.fd.transient(c) - ps.fd.diffusion(c, sp.symbols("D")) + ps.fd.advection(c, v) +discretize = ps.fd.Discretization2ndOrder(dx=1, dt=0.01) +discretization = discretize(adv_diff_pde) +``` + +Look at the [documentation](http://pycodegen.pages.walberla.net/pystencils) to learn more. Installation ------------ ```bash -export PIP_EXTRA_INDEX_URL=https://www.walberla.net/pip pip install pystencils[interactive] ``` @@ -32,4 +63,5 @@ pip install pystencils[interactive,gpu,doc] Documentation ------------- -Read the docs [here](http://software.pages.walberla.net/pystencils/pystencils) \ No newline at end of file +Read the docs [here](http://pycodegen.pages.walberla.net/pystencils) and +check out the Jupyter notebooks in `doc/notebooks`. diff --git a/doc/img/logo_no_text.png b/doc/img/logo_no_text.png new file mode 100644 index 0000000000000000000000000000000000000000..a214a13cbe271cca7c890430a1cb0da44ccadf71 Binary files /dev/null and b/doc/img/logo_no_text.png differ