Commit 41f3e83a authored by Martin Bauer's avatar Martin Bauer
Browse files

Separated modules into subfolders with own setup.py

This restructuring allows for easier separation of modules into
separate repositories later. Also, now pip install with repo url can be
used.

The setup.py files have also been updated to correctly reference each
other. Module versions are not extracted from git state
parent b789f010
This diff is collapsed.
include README.md
include COPYING.txt
pystencils
==========
![alt text](doc/img/logo.png)
\ No newline at end of file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../../pystencils'))
sys.path.insert(0, os.path.abspath('../..'))
from sphinx_doc_conf import *
project = 'lbmpy'
html_logo = "img/logo.png"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="118.61397mm"
height="113.13387mm"
viewBox="0 0 420.28571 400.86803"
id="svg6176"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="arch_lbmpy.svg">
<defs
id="defs6178">
<marker
inkscape:isstock="true"
style="overflow:visible"
id="marker4549-8-4"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Lend">
<path
transform="matrix(-0.8,0,0,-0.8,-10,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
id="path4551-4-9"
inkscape:connector-curvature="0" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="-254.85714"
inkscape:cy="-168.13741"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1043"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata6181">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-167,36.643246)">
<rect
y="-36.143246"
x="167.5"
height="301.42856"
width="419.28571"
id="rect3338-3-1"
style="opacity:0.17300002;fill:#bcc1c4;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<text
sodipodi:linespacing="125%"
id="text4140-7-5"
y="8.1217699"
x="322.69202"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:27.5px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold'"
y="8.1217699"
x="322.69202"
id="tspan4142-0-5"
sodipodi:role="line">lbmpy</tspan></text>
<text
inkscape:transform-center-y="22.223356"
inkscape:transform-center-x="-30.809653"
sodipodi:linespacing="125%"
id="text5052-7-6"
y="48.293827"
x="189.64954"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-size:17.49999809px"
y="48.293827"
x="189.64954"
id="tspan5054-5-5"
sodipodi:role="line">Collision</tspan><tspan
style="font-size:9.99999905px"
id="tspan4798"
y="70.168823"
x="189.64954"
sodipodi:role="line" /><tspan
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.49999809px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Italic'"
id="tspan4800"
y="87.060074"
x="189.64954"
sodipodi:role="line">- moments (SRT,TRT,MRT)</tspan><tspan
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.49999809px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Italic'"
id="tspan4802"
y="102.68507"
x="189.64954"
sodipodi:role="line">- cumulant</tspan><tspan
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.49999809px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Italic'"
id="tspan4804"
y="118.31007"
x="189.64954"
sodipodi:role="line">- (entropic)</tspan></text>
<text
inkscape:transform-center-y="22.223356"
inkscape:transform-center-x="-30.809653"
sodipodi:linespacing="125%"
id="text5052-7-6-8"
y="47.016239"
x="413.58612"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-size:17.49999809px"
y="47.016239"
x="413.58612"
id="tspan5054-5-5-8"
sodipodi:role="line">Propagation</tspan><tspan
style="font-size:9.99999905px"
id="tspan4798-4"
y="68.891235"
x="413.58612"
sodipodi:role="line" /><tspan
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.49999809px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Italic'"
id="tspan4800-3"
y="85.782486"
x="413.58612"
sodipodi:role="line">- source/destination</tspan><tspan
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.49999809px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Italic'"
id="tspan4802-1"
y="101.40749"
x="413.58612"
sodipodi:role="line">- EsoTwist</tspan><tspan
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.49999809px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Italic'"
id="tspan4804-4"
y="117.03249"
x="413.58612"
sodipodi:role="line">- AABB</tspan></text>
<text
inkscape:transform-center-y="22.223356"
inkscape:transform-center-x="-30.809653"
sodipodi:linespacing="125%"
id="text5052-7-6-9"
y="174.15912"
x="236.01477"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-size:17.49999809px"
y="174.15912"
x="236.01477"
id="tspan5054-5-5-2"
sodipodi:role="line">Specific Transformations</tspan><tspan
style="font-size:9.99999905px"
id="tspan4798-0"
y="196.03412"
x="236.01477"
sodipodi:role="line" /><tspan
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.49999809px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Italic'"
id="tspan4800-6"
y="212.92537"
x="236.01477"
sodipodi:role="line">- specific common subexpression elimination</tspan><tspan
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.49999809px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Italic'"
id="tspan4802-8"
y="228.55037"
x="236.01477"
sodipodi:role="line">- loop splitting</tspan><tspan
style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.49999809px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Italic'"
id="tspan4804-9"
y="244.17537"
x="236.01477"
sodipodi:role="line">- input/output of macroscopic values</tspan></text>
<text
sodipodi:linespacing="125%"
id="text4542-2"
y="338.70966"
x="372.24048"
style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-size:17.5px;text-align:center;text-anchor:middle"
y="338.70966"
x="375.02612"
id="tspan4544-6"
sodipodi:role="line">Equations with fields </tspan><tspan
id="tspan4564-6"
style="font-size:17.5px;text-align:center;text-anchor:middle"
y="360.58466"
x="372.24048"
sodipodi:role="line">and neighbor accesses</tspan></text>
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path4175-5-5"
d="m 373.76305,263.98075 10e-6,53.57142"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</svg>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="215.91653mm"
height="136.50279mm"
viewBox="0 0 765.05858 483.67131"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="containerScenario.svg">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="356.63429"
inkscape:cy="453.36919"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="20"
fit-margin-left="20"
fit-margin-right="20"
fit-margin-bottom="20"
inkscape:window-width="2560"
inkscape:window-height="1371"
inkscape:window-x="4480"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-5.3692855,-59.353126)">
<g
id="g4213"
transform="translate(0,-7.7074907e-5)"
inkscape:export-xdpi="92.410004"
inkscape:export-ydpi="92.410004">
<rect
ry="0"
y="130.21935"
x="80"
height="45.714287"
width="101.42857"
id="rect4136"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="0"
y="130.21935"
x="252.61903"
height="45.714287"
width="101.42857"
id="rect4136-3"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="0"
y="130.21935"
x="425.23807"
height="45.714287"
width="101.42857"
id="rect4136-6"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="0"
y="130.21935"
x="597.85712"
height="45.714287"
width="101.42857"
id="rect4136-93"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
<g
transform="translate(0.2760347,98.7415)"
id="g4213-6"
inkscape:export-xdpi="92.410004"
inkscape:export-ydpi="92.410004">
<rect
ry="0"
y="130.21935"
x="80"
height="45.714287"
width="101.42857"
id="rect4136-0"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="0"
y="130.21935"
x="252.61903"
height="45.714287"
width="101.42857"
id="rect4136-3-6"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="0"
y="130.21935"
x="425.23807"
height="45.714287"
width="101.42857"
id="rect4136-6-2"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="0"
y="130.21935"
x="597.85712"
height="45.714287"
width="101.42857"
id="rect4136-93-6"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
<g
transform="translate(-1.7442682,197.48308)"
id="g4213-1"
inkscape:export-xdpi="92.410004"
inkscape:export-ydpi="92.410004">
<rect
ry="0"
y="130.21935"
x="80"
height="45.714287"
width="101.42857"
id="rect4136-8"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="0"
y="130.21935"
x="252.61903"
height="45.714287"
width="101.42857"
id="rect4136-3-7"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="0"
y="130.21935"
x="425.23807"
height="45.714287"
width="101.42857"
id="rect4136-6-9"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="0"
y="130.21935"
x="597.85712"
height="45.714287"
width="101.42857"
id="rect4136-93-2"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
<g
transform="translate(-3.7645728,296.22465)"
id="g4213-0"
inkscape:export-xdpi="92.410004"
inkscape:export-ydpi="92.410004">
<rect
ry="0"
y="130.21935"
x="80"
height="45.714287"
width="101.42857"
id="rect4136-2"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="0"
y="130.21935"
x="252.61903"
height="45.714287"
width="101.42857"
id="rect4136-3-3"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="0"
y="130.21935"
x="425.23807"
height="45.714287"
width="101.42857"
id="rect4136-6-7"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
ry="0"
y="130.21935"
x="597.85712"
height="45.714287"
width="101.42857"
id="rect4136-93-5"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
</svg>
This diff is collapsed.
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from lbmpy.stencils import get_stencil
import numpy as np
import math
from matplotlib import cm
from matplotlib.patches import FancyArrowPatch
from mpl_toolkits.mplot3d import proj3d
class Arrow3D(FancyArrowPatch):
def __init__(self, xs, ys, zs, *args, **kwargs):
FancyArrowPatch.__init__(self, (0, 0), (0, 0), *args, **kwargs)
self._verts3d = xs, ys, zs
def draw(self, renderer):
xs3d, ys3d, zs3d = self._verts3d
xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
FancyArrowPatch.draw(self, renderer)
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.set_aspect("equal")
maxValue = 2
X = np.arange(-maxValue, maxValue, 0.1)
Y = np.arange(-maxValue, maxValue, 0.1)
X, Y = np.meshgrid(X, Y)
def maxwell_boltzmann(x, y):
rho = 1
m = 1
k_B = 0.5
pi = math.pi
T = 1.2
return rho * (m / (2 * k_B * T * pi)) ** (3 / 2) * np.exp(- m / (k_B * T) * (x ** 2 + y ** 2) / 2)
if __name__ == "__main__":
from mpl_toolkits.mplot3d import Axes3D
MB = maxwell_boltzmann(X, Y)
surf = ax.plot_surface(X, Y, MB, rstride=1, cstride=1, cmap=cm.coolwarm,
linewidth=0, antialiased=False)
for dir in get_stencil("D2Q9"):
a = Arrow3D([0, dir[0]], [0, dir[1]], [0, 0], mutation_scale=20, lw=1, arrowstyle="-|>", color="b")
ax.add_artist(a)
h = maxwell_boltzmann(dir[0], dir[1])
a = Arrow3D([dir[0], dir[0]], [dir[1], dir[1]], [0, h], mutation_scale=20, lw=2, arrowstyle="wedge", color="k")
ax.add_artist(a)
plt.show()
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment