Commit 31ad4832 authored by Helen Schottenhamml's avatar Helen Schottenhamml
Browse files

Merge branch 'AdaptionToPystencils' into 'master'

Adaption for CodeGen pipeline

Closes #166, #165, and #167

See merge request !547
parents 086dcd27 2f7b33ed
......@@ -72,6 +72,4 @@ cmake_install.cmake
CMakeDefs.h
/moduleStatistics.json
/walberla-config.cmake
/cmake-build-debug/
/cmake-build-release/
/cmake-build-debug-remote/
cmake-build-*
......@@ -503,7 +503,7 @@ gcc_9_serial:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -526,7 +526,7 @@ gcc_9_mpionly:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -547,7 +547,7 @@ gcc_9_hybrid:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -567,7 +567,7 @@ gcc_9_serial_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -591,7 +591,7 @@ gcc_9_mpionly_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -613,7 +613,7 @@ gcc_9_hybrid_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -633,12 +633,20 @@ gcc_9_hybrid_dbg:
gcc_9_hybrid_dbg_sp:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
before_script:
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
- CC=gcc CXX=g++ pip3 install pycuda
variables:
WALBERLA_BUILD_WITH_CUDA: "ON"
CMAKE_BUILD_TYPE: "DebugOptimized"
WALBERLA_DOUBLE_ACCURACY: "OFF"
WALBERLA_BUILD_WITH_PARMETIS: "OFF"
WALBERLA_BUILD_WITH_METIS: "OFF"
WALBERLA_BUILD_WITH_CODEGEN: "ON"
WALBERLA_BUILD_WITH_PYTHON: "ON"
only:
variables:
- $ENABLE_NIGHTLY_BUILDS
......@@ -650,7 +658,7 @@ gcc_10_serial:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:10
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -673,7 +681,7 @@ gcc_10_mpionly:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:10
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -694,7 +702,7 @@ gcc_10_hybrid:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:10
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -714,7 +722,7 @@ gcc_10_serial_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:10
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -738,7 +746,7 @@ gcc_10_mpionly_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:10
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -760,7 +768,7 @@ gcc_10_hybrid_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:10
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -780,12 +788,20 @@ gcc_10_hybrid_dbg:
gcc_10_hybrid_dbg_sp:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:10
before_script:
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
- CC=gcc CXX=g++ pip3 install pycuda
variables:
WALBERLA_BUILD_WITH_CUDA: "ON"
CMAKE_BUILD_TYPE: "DebugOptimized"
WALBERLA_DOUBLE_ACCURACY: "OFF"
WALBERLA_BUILD_WITH_PARMETIS: "OFF"
WALBERLA_BUILD_WITH_METIS: "OFF"
WALBERLA_BUILD_WITH_CODEGEN: "ON"
WALBERLA_BUILD_WITH_PYTHON: "ON"
only:
variables:
- $ENABLE_NIGHTLY_BUILDS
......@@ -797,7 +813,7 @@ gcc_11_serial:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:11
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -820,7 +836,7 @@ gcc_11_mpionly:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:11
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -842,11 +858,12 @@ gcc_11_hybrid:
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:11
stage: pretest
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
- CC=gcc CXX=g++ pip3 install pycuda
- pip3 list
variables:
WALBERLA_BUILD_WITH_CUDA: "ON"
WALBERLA_BUILD_WITH_CODEGEN: "ON"
......@@ -859,7 +876,7 @@ gcc_11_serial_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:11
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -880,7 +897,7 @@ gcc_11_mpionly_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:11
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -899,7 +916,7 @@ gcc_11_hybrid_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:11
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -916,12 +933,20 @@ gcc_11_hybrid_dbg:
gcc_11_hybrid_dbg_sp:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:11
before_script:
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
- CC=gcc CXX=g++ pip3 install pycuda
variables:
WALBERLA_BUILD_WITH_CUDA: "ON"
CMAKE_BUILD_TYPE: "DebugOptimized"
WALBERLA_DOUBLE_ACCURACY: "OFF"
WALBERLA_BUILD_WITH_PARMETIS: "OFF"
WALBERLA_BUILD_WITH_METIS: "OFF"
WALBERLA_BUILD_WITH_CODEGEN: "ON"
WALBERLA_BUILD_WITH_PYTHON: "ON"
tags:
- cuda11
- docker
......@@ -1422,7 +1447,7 @@ clang_11.0_serial:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:11.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1445,7 +1470,7 @@ clang_11.0_mpionly:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:11.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1466,7 +1491,7 @@ clang_11.0_hybrid:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:11.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1486,7 +1511,7 @@ clang_11.0_serial_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:11.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1510,7 +1535,7 @@ clang_11.0_mpionly_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:11.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1532,7 +1557,7 @@ clang_11.0_hybrid_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:11.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1552,12 +1577,20 @@ clang_11.0_hybrid_dbg:
clang_11.0_hybrid_dbg_sp:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:11.0
before_script:
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
- CC=gcc CXX=g++ pip3 install pycuda
variables:
WALBERLA_BUILD_WITH_CUDA: "ON"
CMAKE_BUILD_TYPE: "DebugOptimized"
WALBERLA_DOUBLE_ACCURACY: "OFF"
WALBERLA_BUILD_WITH_PARMETIS: "OFF"
WALBERLA_BUILD_WITH_METIS: "OFF"
WALBERLA_BUILD_WITH_CODEGEN: "ON"
WALBERLA_BUILD_WITH_PYTHON: "ON"
only:
variables:
- $ENABLE_NIGHTLY_BUILDS
......@@ -1569,7 +1602,7 @@ clang_12.0_serial:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:12.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1592,7 +1625,7 @@ clang_12.0_mpionly:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:12.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1613,7 +1646,7 @@ clang_12.0_hybrid:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:12.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1633,7 +1666,7 @@ clang_12.0_serial_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:12.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1657,7 +1690,7 @@ clang_12.0_mpionly_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:12.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1679,7 +1712,7 @@ clang_12.0_hybrid_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:12.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1699,12 +1732,20 @@ clang_12.0_hybrid_dbg:
clang_12.0_hybrid_dbg_sp:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:12.0
before_script:
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
- CC=gcc CXX=g++ pip3 install pycuda
variables:
WALBERLA_BUILD_WITH_CUDA: "ON"
CMAKE_BUILD_TYPE: "DebugOptimized"
WALBERLA_DOUBLE_ACCURACY: "OFF"
WALBERLA_BUILD_WITH_PARMETIS: "OFF"
WALBERLA_BUILD_WITH_METIS: "OFF"
WALBERLA_BUILD_WITH_CODEGEN: "ON"
WALBERLA_BUILD_WITH_PYTHON: "ON"
only:
variables:
- $ENABLE_NIGHTLY_BUILDS
......@@ -1716,7 +1757,7 @@ clang_13.0_serial:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:13.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1739,7 +1780,7 @@ clang_13.0_mpionly:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:13.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1760,7 +1801,7 @@ clang_13.0_hybrid:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:13.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1777,7 +1818,7 @@ clang_13.0_serial_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:13.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1798,7 +1839,7 @@ clang_13.0_mpionly_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:13.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1817,7 +1858,7 @@ clang_13.0_hybrid_dbg:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:13.0
before_script:
- pip3 install lbmpy==0.4.1 jinja2 pytest
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
......@@ -1835,12 +1876,20 @@ clang_13.0_hybrid_dbg_sp:
extends: .build_template
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:13.0
stage: pretest
before_script:
- pip3 install lbmpy==1.0 jinja2 pytest
- cd python
- python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla
- cd ..
- CC=gcc CXX=g++ pip3 install pycuda
variables:
WALBERLA_BUILD_WITH_CUDA: "ON"
CMAKE_BUILD_TYPE: "DebugOptimized"
WALBERLA_DOUBLE_ACCURACY: "OFF"
WALBERLA_BUILD_WITH_PARMETIS: "OFF"
WALBERLA_BUILD_WITH_METIS: "OFF"
WALBERLA_BUILD_WITH_CODEGEN: "ON"
WALBERLA_BUILD_WITH_PYTHON: "ON"
tags:
- cuda11
- docker
......
......@@ -73,21 +73,21 @@ auto VelocityCallback = [](const Cell& pos, const shared_ptr< StructuredBlockFor
real_t inflow_velocity, const bool constant_inflow = true) {
if (constant_inflow)
{
Vector3< real_t > result(inflow_velocity, 0.0, 0.0);
Vector3< real_t > result(inflow_velocity, real_c(0.0), real_c(0.0));
return result;
}
else
{
Cell globalCell;
CellInterval domain = SbF->getDomainCellBB();
real_t h_y = real_c(domain.ySize());
real_t h_z = real_c(domain.zSize());
auto h_y = real_c(domain.ySize());
auto h_z = real_c(domain.zSize());
SbF->transformBlockLocalToGlobalCell(globalCell, block, pos);
real_t y1 = real_c(globalCell[1] - (h_y / 2.0 - 0.5));
real_t z1 = real_c(globalCell[2] - (h_z / 2.0 - 0.5));
auto y1 = real_c(globalCell[1] - (h_y / 2.0 - 0.5));
auto z1 = real_c(globalCell[2] - (h_z / 2.0 - 0.5));
real_t u = (inflow_velocity * real_c(16)) / (h_y * h_y * h_z * h_z) * (h_y / real_c(2.0) - y1) *
real_t u = (inflow_velocity * real_c(16.0)) / (h_y * h_y * h_z * h_z) * (h_y / real_c(2.0) - y1) *
(h_y / real_c(2.0) + y1) * (h_z / real_c(2.0) - z1) * (h_z / real_c(2.0) + z1);
Vector3< real_t > result(u, 0.0, 0.0);
......@@ -151,9 +151,9 @@ int main(int argc, char** argv)
auto parameters = config->getOneBlock("Parameters");
const uint_t timesteps = parameters.getParameter< uint_t >("timesteps", uint_c(10));
const real_t omega = parameters.getParameter< real_t >("omega", real_t(1.9));
const real_t u_max = parameters.getParameter< real_t >("u_max", real_t(0.05));
const real_t reynolds_number = parameters.getParameter< real_t >("reynolds_number", real_t(1000));
const real_t omega = parameters.getParameter< real_t >("omega", real_c(1.9));
const real_t u_max = parameters.getParameter< real_t >("u_max", real_c(0.05));
const real_t reynolds_number = parameters.getParameter< real_t >("reynolds_number", real_c(1000.0));
const uint_t diameter_sphere = parameters.getParameter< uint_t >("diameter_sphere", uint_t(5));
const bool constant_inflow = parameters.getParameter< bool >("constant_inflow", true);
......@@ -162,8 +162,8 @@ int main(int argc, char** argv)
// create fields
BlockDataID pdfFieldID = blocks->addStructuredBlockData< PdfField_T >(pdfFieldAdder, "PDFs");
BlockDataID velFieldID = field::addToStorage< VelocityField_T >(blocks, "velocity", real_t(0), field::fzyx);
BlockDataID densityFieldID = field::addToStorage< ScalarField_T >(blocks, "density", real_t(0), field::fzyx);
BlockDataID velFieldID = field::addToStorage< VelocityField_T >(blocks, "velocity", real_c(0.0), field::fzyx);
BlockDataID densityFieldID = field::addToStorage< ScalarField_T >(blocks, "density", real_c(0.0), field::fzyx);
#if defined(WALBERLA_BUILD_WITH_CUDA)
BlockDataID pdfFieldIDGPU = cuda::addGPUFieldToStorage< PdfField_T >(blocks, pdfFieldID, "PDFs on GPU", true);
......@@ -300,7 +300,7 @@ int main(int argc, char** argv)
timeloop.run();
simTimer.end();
WALBERLA_LOG_INFO_ON_ROOT("Simulation finished")
auto time = simTimer.last();
auto time = real_c(simTimer.last());
auto nrOfCells = real_c(cellsPerBlock[0] * cellsPerBlock[1] * cellsPerBlock[2]);
auto mlupsPerProcess = nrOfCells * real_c(timesteps) / time * 1e-6;
WALBERLA_LOG_RESULT_ON_ROOT("MLUPS per process " << mlupsPerProcess)
......
......@@ -33,7 +33,8 @@ with CodeGeneration() as ctx:
'velocity': velocity_field
}
lbm_config = LBMConfig(stencil=stencil, method=Method.CUMULANT, relaxation_rate=omega, galilean_correction=True,
lbm_config = LBMConfig(stencil=stencil, method=Method.CUMULANT, compressible=True,
relaxation_rate=omega, galilean_correction=True,
field_name='pdfs', streaming_pattern=streaming_pattern, output=output)
lbm_optimisation = LBMOptimisation(symbolic_field=pdfs, cse_global=False, cse_pdfs=False)
......@@ -66,9 +67,9 @@ with CodeGeneration() as ctx:
generate_sweep(ctx, 'FlowAroundSphereCodeGen_MacroSetter', setter_assignments, target=target)
# boundaries
ubb = UBB(lambda *args: None, dim=dim)
ubb = UBB(lambda *args: None, dim=dim, data_type=data_type)
ubb_data_handler = UBBAdditionalDataHandler(stencil, ubb)
outflow = ExtrapolationOutflow(stencil[4], lb_method, streaming_pattern=streaming_pattern)
outflow = ExtrapolationOutflow(stencil[4], lb_method, streaming_pattern=streaming_pattern, data_type=data_type)
outflow_data_handler = OutflowAdditionalDataHandler(stencil, outflow, target=target)
generate_alternating_lbm_boundary(ctx, 'FlowAroundSphereCodeGen_UBB', ubb, lb_method,
......
import sympy as sp
from sympy.core.cache import clear_cache
import pystencils as ps
from lbmpy.creationfunctions import create_lb_method_from_existing, create_lb_method
from lbmpy.creationfunctions import LBMConfig, LBMOptimisation, Method, Stencil, create_lb_method
from lbmpy_walberla import generate_lattice_model
from pystencils_walberla import CodeGeneration
from pystencils_walberla import get_vectorize_instruction_set
from lbmpy.creationfunctions import create_lb_collision_rule
from lbmpy.moments import is_even, get_order, MOMENT_SYMBOLS
from lbmpy.stencils import get_stencil
from lbmpy.stencils import LBStencil
from collections import OrderedDict
with CodeGeneration() as ctx:
generatedMethod = 'TRTlike'
#generatedMethod = 'D3Q27TRTlike'
#generatedMethod = 'cumulant'
# generatedMethod = 'D3Q27TRTlike'
# generatedMethod = 'cumulant'
clear_cache()
......@@ -28,7 +28,7 @@ with CodeGeneration() as ctx:
omegaVisc = sp.Symbol('omega_visc')
omegaBulk = ps.fields(f'omega_bulk: {dtype_string}[3D]', layout='fzyx')
omegaMagic = sp.Symbol('omega_magic')
stencil = get_stencil('D3Q19', 'walberla')
stencil = LBStencil(Stencil.D3Q19)
x, y, z = MOMENT_SYMBOLS
one = sp.Rational(1, 1)
......@@ -44,33 +44,43 @@ with CodeGeneration() as ctx:
]
# relaxation rate for first group of moments (1,x,y,z) is set to zero internally
relaxation_rates=[omegaBulk.center_vector, omegaBulk.center_vector, omegaMagic, omegaVisc, omegaVisc, omegaMagic]
relaxation_rates = [omegaBulk.center_vector, omegaBulk.center_vector,
omegaMagic, omegaVisc, omegaVisc, omegaMagic]
methodWithForce = create_lb_method(stencil=stencil, method='mrt', maxwellian_moments=False,
nested_moments=moments, relaxation_rates=relaxation_rates)
lbm_config = LBMConfig(stencil=stencil, method=Method.MRT, continuous_equilibrium=False,
zero_centered=False, delta_equilibrium=False,
nested_moments=moments, relaxation_rates=relaxation_rates)
#print(methodWithForce.relaxation_rates)
#print(methodWithForce.moment_matrix)
collision_rule = create_lb_collision_rule(lb_method=methodWithForce, optimization={'cse_global': True})
lbm_opt = LBMOptimisation(cse_global=True)
methodWithForce = create_lb_method(lbm_config=lbm_config)
# print(methodWithForce.relaxation_rates)
# print(methodWithForce.moment_matrix)
collision_rule = create_lb_collision_rule(lbm_config=lbm_config, lbm_optimisation=lbm_opt)
generate_lattice_model(ctx, 'GeneratedLBM', collision_rule, field_layout='fzyx', cpu_vectorize_info=cpu_vectorize_info)
if generatedMethod == 'D3Q27TRTlike':
omegaVisc = sp.Symbol('omega_visc')
omegaBulk = ps.fields(f'omega_bulk: {dtype_string}[3D]', layout='fzyx')
omegaMagic = sp.Symbol('omega_magic')
stencil = get_stencil('D3Q27', 'walberla')
stencil = LBStencil(Stencil.D3Q27)
relaxation_rates = [omegaVisc, omegaBulk.center_vector, omegaMagic, omegaVisc, omegaMagic, omegaVisc]
methodWithForce = create_lb_method(stencil=stencil, method='mrt', maxwellian_moments=False, weighted=True,
compressible=False, relaxation_rates=relaxation_rates)
lbm_config = LBMConfig(stencil=stencil, method=Method.MRT, maxwellian_moments=False, weighted=True,
compressible=False, relaxation_rates=relaxation_rates)
lbm_opt = LBMOptimisation(cse_global=True)
methodWithForce = create_lb_method(lbm_config=lbm_config)
collision_rule = create_lb_collision_rule(lb_method=methodWithForce, optimization={'cse_global': True})
collision_rule = create_lb_collision_rule(lbm_config=lbm_config, lbm_optimisation=lbm_opt)
generate_lattice_model(ctx, 'GeneratedLBM', collision_rule, field_layout='fzyx',
cpu_vectorize_info=cpu_vectorize_info)
# using create_with_continuous_maxwellian_eq_moments won't work probably
if generatedMethod == 'cumulant':
x, y, z = MOMENT_SYMBOLS
......@@ -122,7 +132,7 @@ with CodeGeneration() as ctx:
else:
return 1
stencil = get_stencil('D3Q27', 'walberla')