Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itischler
lbmpy
Commits
0153b244
Commit
0153b244
authored
Aug 11, 2020
by
Jan Hönig
Browse files
Merge branch 'Update_pipeline' into 'master'
Update conftest and readme See merge request
pycodegen/lbmpy!38
parents
956c5c44
16250e9d
Changes
5
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
0153b244
...
...
@@ -21,7 +21,7 @@ tests-and-coverage:
-
py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun"
tags
:
-
docker
-
cuda
-
cuda
11
-
AVX
artifacts
:
when
:
always
...
...
@@ -43,7 +43,7 @@ test-longrun:
-
py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=.
tags
:
-
docker
-
cuda
-
cuda
11
-
AVX
artifacts
:
paths
:
...
...
@@ -79,7 +79,7 @@ ubuntu:
-
pytest-3 -v -m "not longrun"
tags
:
-
docker
-
cuda
-
cuda
11
minimal-conda
:
stage
:
test
...
...
@@ -124,7 +124,7 @@ pycodegen-integration:
-
make -j $NUM_CORES
tags
:
-
docker
-
cuda
-
cuda
11
-
AVX
# -------------------- Linter & Documentation --------------------------------------------------------------------------
...
...
@@ -140,7 +140,7 @@ flake8-lint:
-
flake8 lbmpy
tags
:
-
docker
-
cuda
-
cuda
11
build-documentation
:
...
...
@@ -153,7 +153,7 @@ build-documentation:
-
sphinx-build -W -b html doc html_doc
tags
:
-
docker
-
cuda
-
cuda
11
artifacts
:
paths
:
-
html_doc
...
...
README.md
View file @
0153b244
...
...
@@ -2,9 +2,9 @@ lbmpy
=====
[

](https://mybinder.org/v2/gh/mabau/lbmpy/master?filepath=doc%2Fnotebooks)
[

](http://pycodegen.pages.
walberla.net
/lbmpy)
[

](http://pycodegen.pages.
i10git.cs.fau.de
/lbmpy)
[

](https://i10git.cs.fau.de/pycodegen/lbmpy/commits/master)
[

](http://pycodegen.pages.
walberla.net
/lbmpy/coverage_report)
[

](http://pycodegen.pages.
i10git.cs.fau.de
/lbmpy/coverage_report)
Run fast fluid simulations based on the lattice Boltzmann method in Python on CPUs and GPUs.
...
...
@@ -39,7 +39,7 @@ pip install lbmpy[interactive]
Without
`[interactive]`
you get a minimal version with very little dependencies.
All options:
-
`gpu`
: use this if
nVidia
GPU is available and CUDA is installed
-
`gpu`
: use this if
a NVIDIA
GPU is available and CUDA is installed
-
`opencl`
: use this to enable the target
`opencl`
(execution using OpenCL)
-
`alltrafos`
: pulls in additional dependencies for loop simplification e.g. libisl
-
`interactive`
: installs dependencies to work in Jupyter including image I/O, plotting etc.
...
...
@@ -53,5 +53,5 @@ pip install lbmpy[interactive,gpu,doc]
Documentation
-------------
Read the docs
[
here
](
http://pycodegen.pages.
walberla.net
/lbmpy
)
and
Read the docs
[
here
](
http://pycodegen.pages.
i10git.cs.fau.de
/lbmpy
)
and
check out the Jupyter notebooks in
`doc/notebooks`
.
conftest.py
View file @
0153b244
...
...
@@ -21,6 +21,12 @@ from lbmpy.phasefield.simplex_projection import simplex_projection_2d # NOQA
SCRIPT_FOLDER
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
'lbmpy'
))
# the Ubuntu pipeline uses an older version of pytest which uses deprecated functionality.
# This leads to many warinings in the test and coverage pipeline.
pytest_numeric_version
=
[
int
(
x
,
10
)
for
x
in
pytest
.
__version__
.
split
(
'.'
)]
pytest_numeric_version
.
reverse
()
pytest_version
=
sum
(
x
*
(
100
**
i
)
for
i
,
x
in
enumerate
(
pytest_numeric_version
))
def
add_path_to_ignore
(
path
):
if
not
os
.
path
.
exists
(
path
):
...
...
@@ -121,7 +127,10 @@ class IPyNbFile(pytest.File):
warnings
.
filterwarnings
(
"ignore"
,
"IPython.core.inputsplitter is deprecated"
)
notebook
=
nbformat
.
read
(
notebook_contents
,
4
)
code
,
_
=
exporter
.
from_notebook_node
(
notebook
)
yield
IPyNbTest
(
self
.
name
,
self
,
code
)
if
pytest_version
>=
50403
:
yield
IPyNbTest
.
from_parent
(
name
=
self
.
name
,
parent
=
self
,
code
=
code
)
else
:
yield
IPyNbTest
(
self
.
name
,
self
,
code
)
def
teardown
(
self
):
pass
...
...
@@ -130,4 +139,7 @@ class IPyNbFile(pytest.File):
def
pytest_collect_file
(
path
,
parent
):
glob_exprs
=
[
"*demo*.ipynb"
,
"*tutorial*.ipynb"
,
"test_*.ipynb"
]
if
any
(
path
.
fnmatch
(
g
)
for
g
in
glob_exprs
):
return
IPyNbFile
(
path
,
parent
)
if
pytest_version
>=
50403
:
return
IPyNbFile
.
from_parent
(
fspath
=
path
,
parent
=
parent
)
else
:
return
IPyNbFile
(
path
,
parent
)
lbmpy/moments.py
View file @
0153b244
...
...
@@ -456,7 +456,7 @@ def extract_monomials(sequence_of_polynomials, dim=3):
>>> extract_monomials([x**2 + y**2 + y, y + y**2])
{(0, 2, 0), (0, 1, 0), (2, 0, 0)}
>>> extract_monomials([x**2 + y**2 + y, y + y**2], dim=2)
{(0, 1), (
2
,
0
), (
0
,
2
)}
{(0, 1), (
0
,
2
), (
2
,
0
)}
"""
monomials
=
set
()
for
polynomial
in
sequence_of_polynomials
:
...
...
@@ -479,8 +479,8 @@ def monomial_to_polynomial_transformation_matrix(monomials, polynomials):
>>> mons = list(extract_monomials(polys, dim=2))
>>> monomial_to_polynomial_transformation_matrix(mons, polys)
Matrix([
[
7,
3, 2],
[
9,
-5, 0]])
[ 3, 2
, 7
],
[-5, 0
, 9
]])
"""
dim
=
len
(
monomials
[
0
])
...
...
lbmpy_tests/test_srt_trt_simplifications.py
View file @
0153b244
...
...
@@ -38,7 +38,7 @@ def test_simplifications_srt_d2q9_incompressible():
def
test_simplifications_srt_d2q9_compressible
():
omega
=
sp
.
symbols
(
'omega'
)
method
=
create_srt
(
get_stencil
(
"D2Q9"
),
omega
,
compressible
=
True
,
equilibrium_order
=
2
)
check_method
(
method
,
[
53
,
5
7
,
1
],
[
53
,
4
1
,
1
])
check_method
(
method
,
[
53
,
5
8
,
1
],
[
53
,
4
2
,
1
])
def
test_simplifications_trt_d2q9_incompressible
():
...
...
@@ -50,7 +50,7 @@ def test_simplifications_trt_d2q9_incompressible():
def
test_simplifications_trt_d2q9_compressible
():
o1
,
o2
=
sp
.
symbols
(
"omega_1 omega_2"
)
method
=
create_trt
(
get_stencil
(
"D2Q9"
),
o1
,
o2
,
compressible
=
True
)
check_method
(
method
,
[
77
,
10
5
,
1
],
[
65
,
5
5
,
1
])
check_method
(
method
,
[
77
,
10
6
,
1
],
[
65
,
5
6
,
1
])
def
test_simplifications_trt_d3q19_force_incompressible
():
...
...
@@ -64,4 +64,4 @@ def test_simplifications_trt_d3q19_force_compressible():
o1
,
o2
=
sp
.
symbols
(
"omega_1 omega_2"
)
force_model
=
Guo
([
sp
.
Rational
(
1
,
3
),
sp
.
Rational
(
1
,
2
),
sp
.
Rational
(
1
,
5
)])
method
=
create_trt_with_magic_number
(
get_stencil
(
"D3Q19"
),
o1
,
compressible
=
False
,
force_model
=
force_model
)
check_method
(
method
,
[
270
,
28
3
,
1
],
[
243
,
17
7
,
1
])
check_method
(
method
,
[
270
,
28
4
,
1
],
[
243
,
17
8
,
1
])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment