Commit b04caa75 authored by Markus Holzer's avatar Markus Holzer Committed by Jan Hönig
Browse files

Dataclasses for method creation

parent 4e47c1eb
......@@ -143,7 +143,7 @@ ubuntu:
before_script:
- apt-get -y remove python3-sympy
- ln -s /usr/include/locale.h /usr/include/xlocale.h
- pip3 install `grep -Eo 'sympy[>=]+[0-9\.]+' setup.py | sed 's/>/=/g'`
# - pip3 install `grep -Eo 'sympy[>=]+[0-9\.]+' setup.py | sed 's/>/=/g'`
- pip3 install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
script:
- export NUM_CORES=$(nproc --all)
......
......@@ -16,11 +16,12 @@ It even comes with an integrated Chapman Enskog analysis based on sympy!
Common test scenarios can be set up quickly:
```python
from lbmpy.scenarios import create_channel
from pystencils import Target
from lbmpy.session import *
ch = create_channel(domain_size=(300,100, 100), force=1e-7, method="trt",
ch = create_channel(domain_size=(300, 100, 100), force=1e-7, method=Method.TRT,
equilibrium_order=2, compressible=True,
relaxation_rates=[1.97, 1.6], optimization={'target': 'gpu'})
relaxation_rates=[1.97, 1.6], optimization={'target': Target.GPU})
```
To find out more, check out the interactive [tutorial notebooks online with binder](https://mybinder.org/v2/gh/mabau/lbmpy/master?filepath=doc%2Fnotebooks).
......
......@@ -29,8 +29,8 @@ templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
copyright = f'{datetime.datetime.now().year}, Martin Bauer'
author = 'Martin Bauer'
copyright = f'{datetime.datetime.now().year}, Martin Bauer, Markus Holzer'
author = 'Martin Bauer, Markus Holzer'
# The short X.Y version (including .devXXXX, rcX, b1 suffixes if present)
version = re.sub(r'(\d+\.\d+)\.\d+(.*)', r'\1\2', lbmpy.__version__)
version = re.sub(r'(\.dev\d+).*?$', r'\1', version)
......
This diff is collapsed.
......@@ -26,11 +26,11 @@
N = 64
omega_a = 1.
g_aa = -4.7
rho0 = 1.
stencil = get_stencil("D2Q9")
stencil = LBStencil(Stencil.D2Q9)
weights = get_weights(stencil, c_s_sq=sp.Rational(1,3))
```
%% Cell type:markdown id: tags:
......@@ -81,16 +81,14 @@
## Kernels
%% Cell type:code id: tags:
``` python
collision = create_lb_update_rule(stencil=stencil,
relaxation_rate=omega_a,
compressible=True,
force_model='guo',
force=force,
kernel_type='collide_only',
lbm_config = LBMConfig(stencil=stencil, relaxation_rate=omega_a, compressible=True,
force_model=ForceModel.GUO, force=force, kernel_type='collide_only')
collision = create_lb_update_rule(lbm_config=lbm_config,
optimization={'symbolic_field': src})
stream = create_stream_pull_with_output_kernel(collision.method, src, dst, {'density': ρ})
......@@ -106,11 +104,11 @@
## Initialization
%% Cell type:code id: tags:
``` python
method_without_force = create_lb_method(stencil=stencil, relaxation_rate=omega_a, compressible=True)
method_without_force = create_lb_method(LBMConfig(stencil=stencil, relaxation_rate=omega_a, compressible=True))
init_assignments = macroscopic_values_setter(method_without_force, velocity=(0, 0),
pdfs=src.center_vector, density=ρ.center)
init_kernel = ps.create_kernel(init_assignments, ghost_layers=0).compile()
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,6 +5,7 @@ API Reference
:maxdepth: 1
scenarios.rst
enums.rst
kernelcreation.rst
methodcreation.rst
stencils.rst
......
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