From beec6d3e4fe078fea83b55815445de73ad1c6f5e Mon Sep 17 00:00:00 2001 From: Martin Bauer <martin.bauer@fau.de> Date: Sat, 27 Apr 2019 18:09:14 +0200 Subject: [PATCH] Adapted README --- README.md | 38 +++++++++++++++++++++++++++++++++++--- doc/img/logo_no_text.png | Bin 0 -> 5554 bytes 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 doc/img/logo_no_text.png diff --git a/README.md b/README.md index bd3680317..e864251cd 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 GIT binary patch literal 5554 zcmV;j6;0}iP)<h;3K|Lk000e1NJLTq003tI003$T1^@s6q2Es@00004b3#c}2nYxW zd<bNS00009a7bBm000Wa000Wa0cLH2)Bpeg8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H16)#CdK~#90?Vag!9A}-!KmGL6=bX~$uq@kgoW#xru^o#eRn%^P zCBP<e$g(U@yyM^C@8IRWplXj|7jl>^fvsJNBb$&zR!rf<365`B);ag|`SiZ%>5=R> z@sZf>5&BkjX=XGt{Y-!Q_Z+{YTT7B8VN1D`yweT%#8L`G_D}&JgxK%~@!`)5iG~=C z>TeM$ia<pJPznJEgpeR4^q(V!3)B$8Q79FG3LxsDq7K9zRL}txqLf0{B|>+I%>s!i zAdCV+*eFs^Vn`qj861^D3ECv#Dsgv#xP5`dUqS_IBvFq9g{GTmvV>;Ukj@mEyPe1y zLzoqW>81uZ1b~JHj#3ds9>fje&N;&R`$Vnx_~6|)dH=n4SzcNui~>}wkW%6nirlqx z7oXXG2zUGeWO*;Lv<H|#$Ra42dqCPS%+{2O5Go+@mPpzk5U$N}>d(L7_rLock>8+J zf|3oU0U8h~==#v;K%=K~-+g=e(&K-RIerkM`VgY9BLzgh0p%Z#Qb2(6SBM+$5iY&X z8^8Y<N9W#Rx~dqjK*<5i04YGzKqU}FDWJ7BTwH@#RC(%|Z&SVNZ!kvouLBbK?L6|^ zvcA&ptWDHDPp~q_>>qy4v7>Kr-xN$%pyYzpHvmoB_&F%pQ0#B#mh1fNr~k%xzi(2| zT`Z#j!t7g4KCLI8t=cFRkoc>_t@k<i-tU-w>rM7d!SpDM6v4H?kg3(^+WKbbU>i_& zVWI+eO+eY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