diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3e9a1865382956bfaaa8bd8a1da80eadf05d38f1..187dd2c3185c625c066c0bf283e4875893547246 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -97,7 +97,7 @@ stages: icc_2022_serial: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -113,7 +113,7 @@ icc_2022_serial: icc_2022_mpionly: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" @@ -127,7 +127,7 @@ icc_2022_mpionly: icc_2022_hybrid: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" WARNING_ERROR: "OFF" @@ -137,7 +137,7 @@ icc_2022_hybrid: icc_2022_serial_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -151,7 +151,7 @@ icc_2022_serial_dbg: icc_2022_mpionly_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -163,7 +163,7 @@ icc_2022_mpionly_dbg: icc_2022_hybrid_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -174,7 +174,7 @@ icc_2022_hybrid_dbg: icc_2022_hybrid_dbg_sp: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icc-2022:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -188,7 +188,7 @@ icc_2022_hybrid_dbg_sp: icx_2023_serial: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -203,7 +203,7 @@ icx_2023_serial: icx_2023_mpionly: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" @@ -216,7 +216,7 @@ icx_2023_mpionly: icx_2023_hybrid: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" tags: @@ -225,7 +225,7 @@ icx_2023_hybrid: icx_2023_serial_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -238,7 +238,7 @@ icx_2023_serial_dbg: icx_2023_mpionly_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -249,7 +249,7 @@ icx_2023_mpionly_dbg: icx_2023_hybrid_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -259,7 +259,7 @@ icx_2023_hybrid_dbg: icx_2023_hybrid_dbg_sp: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/icx-2023:22 variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -272,14 +272,18 @@ icx_2023_hybrid_dbg_sp: gcc_10_serial: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -287,6 +291,7 @@ gcc_10_serial: WALBERLA_BUILD_WITH_PARMETIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -296,19 +301,24 @@ gcc_10_serial: gcc_10_mpionly: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -318,18 +328,23 @@ gcc_10_mpionly: gcc_10_hybrid: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -339,14 +354,18 @@ gcc_10_hybrid: gcc_10_serial_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -355,6 +374,7 @@ gcc_10_serial_dbg: CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -364,20 +384,25 @@ gcc_10_serial_dbg: gcc_10_mpionly_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -387,33 +412,42 @@ gcc_10_mpionly_dbg: gcc_10_hybrid_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" tags: - cuda11 - docker gcc_10_hybrid_dbg_sp: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-10:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -422,6 +456,7 @@ gcc_10_hybrid_dbg_sp: WALBERLA_BUILD_WITH_METIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -431,14 +466,18 @@ gcc_10_hybrid_dbg_sp: gcc_11_serial: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -446,6 +485,7 @@ gcc_11_serial: WALBERLA_BUILD_WITH_PARMETIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -455,19 +495,24 @@ gcc_11_serial: gcc_11_mpionly: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -477,18 +522,23 @@ gcc_11_mpionly: gcc_11_hybrid: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -498,14 +548,18 @@ gcc_11_hybrid: gcc_11_serial_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -514,6 +568,7 @@ gcc_11_serial_dbg: CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -523,20 +578,25 @@ gcc_11_serial_dbg: gcc_11_mpionly_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -546,19 +606,24 @@ gcc_11_mpionly_dbg: gcc_11_hybrid_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -568,14 +633,18 @@ gcc_11_hybrid_dbg: gcc_11_hybrid_dbg_sp: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-11:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -584,6 +653,7 @@ gcc_11_hybrid_dbg_sp: WALBERLA_BUILD_WITH_METIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -593,14 +663,18 @@ gcc_11_hybrid_dbg_sp: gcc_12_serial: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -608,6 +682,7 @@ gcc_12_serial: WALBERLA_BUILD_WITH_PARMETIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -617,19 +692,24 @@ gcc_12_serial: gcc_12_mpionly: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -639,18 +719,23 @@ gcc_12_mpionly: gcc_12_hybrid: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -660,14 +745,18 @@ gcc_12_hybrid: gcc_12_serial_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -676,6 +765,7 @@ gcc_12_serial_dbg: CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -685,20 +775,25 @@ gcc_12_serial_dbg: gcc_12_mpionly_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -708,19 +803,24 @@ gcc_12_mpionly_dbg: gcc_12_hybrid_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -730,14 +830,18 @@ gcc_12_hybrid_dbg: gcc_12_hybrid_dbg_sp: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-12:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -746,6 +850,7 @@ gcc_12_hybrid_dbg_sp: WALBERLA_BUILD_WITH_METIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -755,14 +860,18 @@ gcc_12_hybrid_dbg_sp: gcc_13_serial: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -770,6 +879,7 @@ gcc_13_serial: WALBERLA_BUILD_WITH_PARMETIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" WALBERLA_BUILD_WITH_HALF_PRECISION_SUPPORT: "ON" only: variables: @@ -780,19 +890,24 @@ gcc_13_serial: gcc_13_mpionly: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" WALBERLA_BUILD_WITH_HALF_PRECISION_SUPPORT: "ON" only: variables: @@ -803,19 +918,24 @@ gcc_13_mpionly: gcc_13_hybrid: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:22 stage: pretest before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" WALBERLA_BUILD_WITH_HALF_PRECISION_SUPPORT: "ON" tags: - cuda11 @@ -823,14 +943,18 @@ gcc_13_hybrid: gcc_13_serial_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -839,6 +963,7 @@ gcc_13_serial_dbg: CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" WALBERLA_BUILD_WITH_HALF_PRECISION_SUPPORT: "ON" tags: - cuda11 @@ -846,20 +971,25 @@ gcc_13_serial_dbg: gcc_13_mpionly_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" WALBERLA_BUILD_WITH_HALF_PRECISION_SUPPORT: "ON" tags: - cuda11 @@ -867,19 +997,24 @@ gcc_13_mpionly_dbg: gcc_13_hybrid_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" WALBERLA_BUILD_WITH_HALF_PRECISION_SUPPORT: "ON" tags: - cuda11 @@ -887,14 +1022,18 @@ gcc_13_hybrid_dbg: gcc_13_hybrid_dbg_sp: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc-13:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=gcc CXX=g++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -903,6 +1042,7 @@ gcc_13_hybrid_dbg_sp: WALBERLA_BUILD_WITH_METIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" WALBERLA_BUILD_WITH_HALF_PRECISION_SUPPORT: "ON" tags: - cuda11 @@ -910,14 +1050,18 @@ gcc_13_hybrid_dbg_sp: clang_14_serial: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -925,6 +1069,7 @@ clang_14_serial: WALBERLA_BUILD_WITH_PARMETIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -934,19 +1079,24 @@ clang_14_serial: clang_14_mpionly: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -956,18 +1106,23 @@ clang_14_mpionly: clang_14_hybrid: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -977,14 +1132,18 @@ clang_14_hybrid: clang_14_serial_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -993,6 +1152,7 @@ clang_14_serial_dbg: CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1002,20 +1162,25 @@ clang_14_serial_dbg: clang_14_mpionly_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1025,33 +1190,42 @@ clang_14_mpionly_dbg: clang_14_hybrid_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" tags: - cuda11 - docker clang_14_hybrid_dbg_sp: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-14:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -1060,6 +1234,7 @@ clang_14_hybrid_dbg_sp: WALBERLA_BUILD_WITH_METIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1069,14 +1244,18 @@ clang_14_hybrid_dbg_sp: clang_15_serial: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -1084,6 +1263,7 @@ clang_15_serial: WALBERLA_BUILD_WITH_PARMETIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1093,19 +1273,24 @@ clang_15_serial: clang_15_mpionly: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1115,18 +1300,23 @@ clang_15_mpionly: clang_15_hybrid: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1136,14 +1326,18 @@ clang_15_hybrid: clang_15_serial_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -1152,6 +1346,7 @@ clang_15_serial_dbg: CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1161,20 +1356,25 @@ clang_15_serial_dbg: clang_15_mpionly_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1184,19 +1384,24 @@ clang_15_mpionly_dbg: clang_15_hybrid_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1206,14 +1411,18 @@ clang_15_hybrid_dbg: clang_15_hybrid_dbg_sp: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-15:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -1222,6 +1431,7 @@ clang_15_hybrid_dbg_sp: WALBERLA_BUILD_WITH_METIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1231,14 +1441,18 @@ clang_15_hybrid_dbg_sp: clang_16_serial: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -1246,6 +1460,7 @@ clang_16_serial: WALBERLA_BUILD_WITH_PARMETIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1255,19 +1470,24 @@ clang_16_serial: clang_16_mpionly: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1277,18 +1497,23 @@ clang_16_mpionly: clang_16_hybrid: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1298,14 +1523,18 @@ clang_16_hybrid: clang_16_serial_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -1314,6 +1543,7 @@ clang_16_serial_dbg: CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1323,20 +1553,25 @@ clang_16_serial_dbg: clang_16_mpionly_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1346,19 +1581,24 @@ clang_16_mpionly_dbg: clang_16_hybrid_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1368,14 +1608,18 @@ clang_16_hybrid_dbg: clang_16_hybrid_dbg_sp: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-16:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -1384,6 +1628,7 @@ clang_16_hybrid_dbg_sp: WALBERLA_BUILD_WITH_METIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1393,14 +1638,18 @@ clang_16_hybrid_dbg_sp: clang_17_serial: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -1408,6 +1657,7 @@ clang_17_serial: WALBERLA_BUILD_WITH_PARMETIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1417,19 +1667,24 @@ clang_17_serial: clang_17_mpionly: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1439,32 +1694,41 @@ clang_17_mpionly: clang_17_hybrid: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" tags: - cuda11 - docker clang_17_serial_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -1473,60 +1737,75 @@ clang_17_serial_dbg: CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" tags: - cuda11 - docker clang_17_mpionly_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" tags: - cuda11 - docker clang_17_hybrid_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" tags: - cuda11 - docker clang_17_hybrid_dbg_sp: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/clang-17:22 stage: pretest before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -1535,20 +1814,25 @@ clang_17_hybrid_dbg_sp: WALBERLA_BUILD_WITH_METIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" tags: - cuda11 - docker aocc_4_serial: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -1556,6 +1840,7 @@ aocc_4_serial: WALBERLA_BUILD_WITH_PARMETIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1565,19 +1850,24 @@ aocc_4_serial: aocc_4_mpionly: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" only: variables: - $ENABLE_NIGHTLY_BUILDS @@ -1587,32 +1877,41 @@ aocc_4_mpionly: aocc_4_hybrid: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" tags: - cuda11 - docker aocc_4_serial_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" WALBERLA_BUILD_WITH_MPI: "OFF" @@ -1621,59 +1920,74 @@ aocc_4_serial_dbg: CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" tags: - cuda11 - docker aocc_4_mpionly_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" tags: - cuda11 - docker aocc_4_hybrid_dbg: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" tags: - cuda11 - docker aocc_4_hybrid_dbg_sp: extends: .build_template - image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:21 + image: i10git.cs.fau.de:5005/walberla/buildenvs/aocc-4:22 before_script: - - pip3 install lbmpy==1.3.3 jinja2 pytest + - python3 -m venv ci-venv + - source ci-venv/bin/activate + - python3 -m pip install lbmpy==1.3.4 jinja2 pytest - cd python - python3 -m pytest --junitxml=report.xml pystencils_walberla lbmpy_walberla - - pip3 list + - python3 -m pip list + - deactivate + - python3 -m pip install numpy - cd .. - - CC=gcc CXX=g++ pip3 install cupy-cuda11x + - CC=clang CXX=clang++ ci-venv/bin/python -m pip install cupy-cuda11x variables: WALBERLA_BUILD_WITH_CUDA: "ON" CMAKE_BUILD_TYPE: "DebugOptimized" @@ -1682,6 +1996,7 @@ aocc_4_hybrid_dbg_sp: WALBERLA_BUILD_WITH_METIS: "OFF" WALBERLA_BUILD_WITH_CODEGEN: "ON" WALBERLA_BUILD_WITH_PYTHON: "ON" + Python_ROOT_DIR: "./ci-venv" tags: - cuda11 - docker @@ -1826,8 +2141,8 @@ coverage: mac_Serial_Dbg: extends: .mac_build_template before_script: - - pip3 install pystencils==1.3.3 - - pip3 install lbmpy==1.3.3 + - pip3 install pystencils==1.3.4 + - pip3 install lbmpy==1.3.4 variables: CMAKE_BUILD_TYPE: "DebugOptimized" CTEST_EXCLUDE_LABELS: "longrun" @@ -1839,8 +2154,8 @@ mac_Serial_Dbg: mac_Serial: extends: .mac_build_template before_script: - - pip3 install pystencils==1.3.3 - - pip3 install lbmpy==1.3.3 + - pip3 install pystencils==1.3.4 + - pip3 install lbmpy==1.3.4 variables: CMAKE_BUILD_TYPE: "Release" CTEST_EXCLUDE_LABELS: "longrun" @@ -1852,8 +2167,8 @@ mac_Serial: mac_MpiOnly_Dbg: extends: .mac_build_template before_script: - - pip3 install pystencils==1.3.3 - - pip3 install lbmpy==1.3.3 + - pip3 install pystencils==1.3.4 + - pip3 install lbmpy==1.3.4 variables: CMAKE_BUILD_TYPE: "DebugOptimized" CTEST_EXCLUDE_LABELS: "longrun" @@ -1866,8 +2181,8 @@ mac_MpiOnly_Dbg: mac_MpiOnly: extends: .mac_build_template before_script: - - pip3 install pystencils==1.3.3 - - pip3 install lbmpy==1.3.3 + - pip3 install pystencils==1.3.4 + - pip3 install lbmpy==1.3.4 variables: CMAKE_BUILD_TYPE: "Release" CTEST_EXCLUDE_LABELS: "longrun" @@ -1992,11 +2307,6 @@ benchmark_clang8: benchmark_ClangBuildAnalyzer: script: - - apt-get update --fix-missing - - apt-get -y install apt-transport-https ca-certificates gnupg software-properties-common wget - - wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - - - apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' - - apt-get -y install cmake ninja-build - cmake --version - ccache --version - mpirun --version diff --git a/apps/benchmarks/CMakeLists.txt b/apps/benchmarks/CMakeLists.txt index f37d24767eb383e55b1ff2764770ee525bb54c68..3f6b8a92eb7650d9d885e92ad1162cd6dbda5757 100644 --- a/apps/benchmarks/CMakeLists.txt +++ b/apps/benchmarks/CMakeLists.txt @@ -26,6 +26,7 @@ if ( WALBERLA_BUILD_WITH_PYTHON ) add_subdirectory( UniformGridCPU ) add_subdirectory( PhaseFieldAllenCahn ) add_subdirectory( NonUniformGridCPU ) + add_subdirectory( TurbulentChannel ) endif() if ( WALBERLA_BUILD_WITH_CODEGEN AND WALBERLA_BUILD_WITH_GPU_SUPPORT ) diff --git a/apps/benchmarks/NonUniformGridCPU/NonUniformGridCPU.cpp b/apps/benchmarks/NonUniformGridCPU/NonUniformGridCPU.cpp index 6f6e0378176c28468f09b359932ea9d78152ec24..34fde13e360e3190c3ec811b0f810432f47adf00 100644 --- a/apps/benchmarks/NonUniformGridCPU/NonUniformGridCPU.cpp +++ b/apps/benchmarks/NonUniformGridCPU/NonUniformGridCPU.cpp @@ -132,7 +132,7 @@ int main(int argc, char** argv) SweepCollection_T sweepCollection(blocks, pdfFieldID, densityFieldID, velFieldID, omega, innerOuterSplit); for (auto& block : *blocks) { - sweepCollection.initialise(&block, 2); + sweepCollection.initialise(&block, cell_idx_c(1)); } WALBERLA_MPI_BARRIER() WALBERLA_LOG_INFO_ON_ROOT("Initialisation done") diff --git a/apps/benchmarks/NonUniformGridGPU/NonUniformGridGPU.cpp b/apps/benchmarks/NonUniformGridGPU/NonUniformGridGPU.cpp index e76c0b51184e8486d9d688a498c9ac4f65dd86b6..233103342cdde4e21ab443cd3aadbece48b42c85 100644 --- a/apps/benchmarks/NonUniformGridGPU/NonUniformGridGPU.cpp +++ b/apps/benchmarks/NonUniformGridGPU/NonUniformGridGPU.cpp @@ -190,7 +190,7 @@ int main(int argc, char** argv) SweepCollection_T sweepCollection(blocks, pdfFieldGpuID, densityFieldGpuID, velFieldGpuID, gpuBlockSize[0], gpuBlockSize[1], gpuBlockSize[2], omega, innerOuterSplit); for (auto& iBlock : *blocks) { - sweepCollection.initialise(&iBlock, 2, nullptr); + sweepCollection.initialise(&iBlock, cell_idx_c(1), nullptr); } WALBERLA_GPU_CHECK(gpuDeviceSynchronize()) WALBERLA_GPU_CHECK(gpuPeekAtLastError()) diff --git a/apps/benchmarks/TurbulentChannel/CMakeLists.txt b/apps/benchmarks/TurbulentChannel/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..73aa9ef56addc086f49cb4b533923a00ebce1018 --- /dev/null +++ b/apps/benchmarks/TurbulentChannel/CMakeLists.txt @@ -0,0 +1,26 @@ +waLBerla_link_files_to_builddir( *.prm ) + +if( WALBERLA_BUILD_WITH_CODEGEN ) + + # Turbulent Channel generation + walberla_generate_target_from_python( NAME TurbulentChannel_CodeGeneration + FILE TurbulentChannel.py + OUT_FILES CodegenIncludes.h + TurbulentChannel_Sweep.cpp TurbulentChannel_Sweep.h + TurbulentChannel_PackInfo.cpp TurbulentChannel_PackInfo.h + TurbulentChannel_Setter.cpp TurbulentChannel_Setter.h + TurbulentChannel_NoSlip.cpp TurbulentChannel_NoSlip.h + TurbulentChannel_FreeSlip_top.cpp TurbulentChannel_FreeSlip_top.h + TurbulentChannel_WFB_bottom.cpp TurbulentChannel_WFB_bottom.h + TurbulentChannel_WFB_top.cpp TurbulentChannel_WFB_top.h + TurbulentChannel_Welford.cpp TurbulentChannel_Welford.h + TurbulentChannel_Welford_TKE_SGS.cpp TurbulentChannel_Welford_TKE_SGS.h + TurbulentChannel_TKE_SGS_Writer.cpp TurbulentChannel_TKE_SGS_Writer.h + ) + + walberla_add_executable ( NAME TurbulentChannel_Application + FILES TurbulentChannel.cpp + DEPENDS blockforest core domain_decomposition field geometry timeloop lbm stencil vtk + TurbulentChannel_CodeGeneration ) + +endif() \ No newline at end of file diff --git a/apps/benchmarks/TurbulentChannel/TurbulentChannel.cpp b/apps/benchmarks/TurbulentChannel/TurbulentChannel.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bd31d1263bc735ccdbd8d096c22057491f4d545b --- /dev/null +++ b/apps/benchmarks/TurbulentChannel/TurbulentChannel.cpp @@ -0,0 +1,931 @@ +//====================================================================================================================== +// +// This file is part of waLBerla. waLBerla is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// waLBerla is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file TurbulentChannel.cpp +//! \author Helen Schottenhamml <helen.schottenhamml@fau.de> +// +//====================================================================================================================== + +#include <memory> +#include <cmath> +#include <string> +#include <iostream> + +#include <blockforest/all.h> +#include <core/all.h> +#include <domain_decomposition/all.h> +#include <field/all.h> +#include <field/vtk/VTKWriter.h> +#include <geometry/all.h> +#include <timeloop/all.h> +#include <lbm/all.h> + +// Codegen Includes +#include "CodegenIncludes.h" + +namespace walberla { + /////////////////////// + /// Typedef Aliases /// + /////////////////////// + + using Stencil_T = codegen::Stencil_T; + + // Communication Pack Info + using PackInfo_T = pystencils::TurbulentChannel_PackInfo; + + // PDF field type + using PdfField_T = field::GhostLayerField< real_t, Stencil_T::Size >; + + // Field Types + using ScalarField_T = field::GhostLayerField< real_t, 1 >; + using VectorField_T = field::GhostLayerField< real_t, Stencil_T::D >; + using TensorField_T = field::GhostLayerField< real_t, Stencil_T::D*Stencil_T::D >; + + using Setter_T = pystencils::TurbulentChannel_Setter; + + using StreamCollideSweep_T = pystencils::TurbulentChannel_Sweep; + using WelfordSweep_T = pystencils::TurbulentChannel_Welford; + using TKEWelfordSweep_T = pystencils::TurbulentChannel_Welford_TKE_SGS; + + using TkeSgsWriter_T = pystencils::TurbulentChannel_TKE_SGS_Writer; + + // Boundary Handling + using flag_t = uint8_t; + using FlagField_T = FlagField< flag_t >; + using NoSlip_T = lbm::TurbulentChannel_NoSlip; + using FreeSlip_top_T = lbm::TurbulentChannel_FreeSlip_top; + using WFB_bottom_T = lbm::TurbulentChannel_WFB_bottom; + using WFB_top_T = lbm::TurbulentChannel_WFB_top; + + /// DEAN CORRELATIONS + + namespace dean_correlation { + + real_t calculateFrictionReynoldsNumber(const real_t reynoldsBulk) { + return std::pow(0.073_r / 8_r, 1_r / 2_r) * std::pow(reynoldsBulk, 7_r / 8_r); + } + + real_t calculateBulkReynoldsNumber(const real_t reynoldsFriction) { + return std::pow(8_r / 0.073_r, 4_r / 7_r) * std::pow(reynoldsFriction, 8_r / 7_r); + } + } // namespace dean_correlation + + + /// VELOCITY FIELD INITIALISATION + + /* + * Initialises the velocity field with a logarithmic profile and sinusoidal perturbations to trigger turbulence. + * This initialisation is provided by Henrik Asmuth. + */ + template<typename VelocityField_T> + void setVelocityFieldsAsmuth( const std::weak_ptr<StructuredBlockStorage>& forest, + const BlockDataID & velocityFieldId, const BlockDataID & meanVelocityFieldId, + const real_t frictionVelocity, const uint_t channel_half_width, + const real_t B, const real_t kappa, const real_t viscosity, + const uint_t wallAxis, const uint_t flowAxis ) { + + auto blocks = forest.lock(); + WALBERLA_CHECK_NOT_NULLPTR(blocks) + + const auto domainSize = blocks->getDomain().max(); + const auto delta = real_c(channel_half_width); + const auto remAxis = 3 - wallAxis - flowAxis; + + for( auto block = blocks->begin(); block != blocks->end(); ++block ) { + + auto * velocityField = block->template getData<VelocityField_T>(velocityFieldId); + WALBERLA_CHECK_NOT_NULLPTR(velocityField) + + auto * meanVelocityField = block->template getData<VelocityField_T>(meanVelocityFieldId); + WALBERLA_CHECK_NOT_NULLPTR(meanVelocityField) + + const auto ci = velocityField->xyzSizeWithGhostLayer(); + for(auto cellIt = ci.begin(); cellIt != ci.end(); ++cellIt) { + + Cell globalCell(*cellIt); + blocks->transformBlockLocalToGlobalCell(globalCell, *block); + Vector3<real_t> cellCenter; + blocks->getCellCenter(cellCenter, globalCell); + + const auto y = cellCenter[wallAxis]; + const auto rel_x = cellCenter[flowAxis] / domainSize[flowAxis]; + const auto rel_z = cellCenter[remAxis] / domainSize[remAxis]; + + const real_t pos = std::max(delta - std::abs(y - delta - 1_r), 0.05_r); + const auto rel_y = pos / delta; + + auto initialVel = frictionVelocity * (std::log(frictionVelocity * pos / viscosity) / kappa + B); + + Vector3<real_t> vel; + vel[flowAxis] = initialVel; + + vel[remAxis] = 2_r * frictionVelocity / kappa * std::sin(math::pi * 16_r * rel_x) * + std::sin(math::pi * 8_r * rel_y) / (std::pow(rel_y, 2_r) + 1_r); + + vel[wallAxis] = 8_r * frictionVelocity / kappa * + (std::sin(math::pi * 8_r * rel_z) * std::sin(math::pi * 8_r * rel_y) + + std::sin(math::pi * 8_r * rel_x)) / (std::pow(0.5_r * delta - pos, 2_r) + 1_r); + + for(uint_t d = 0; d < 3; ++d) { + velocityField->get(*cellIt, d) = vel[d]; + meanVelocityField->get(*cellIt, d) = vel[d]; + } + + } + } + + } // function setVelocityFieldsHenrik + + /// SIMULATION PARAMETERS + + struct SimulationParameters { + + SimulationParameters(const Config::BlockHandle & config) + { + channelHalfWidth = config.getParameter<uint_t>("channel_half_width"); + fullChannel = config.getParameter<bool>("full_channel", false); + + /// TARGET QUANTITIES + + targetFrictionReynolds = config.getParameter<real_t>("target_friction_reynolds"); + targetBulkVelocity = config.getParameter<real_t>("target_bulk_velocity", 0.05_r); + + targetBulkReynolds = dean_correlation::calculateBulkReynoldsNumber(targetFrictionReynolds); + viscosity = 2_r * real_c(channelHalfWidth) * targetBulkVelocity / targetBulkReynolds; + targetFrictionVelocity = targetFrictionReynolds * viscosity / real_c(channelHalfWidth); + + /// TIMESTEPS + + timesteps = config.getParameter<uint_t>("timesteps", 0); + const uint_t turnoverPeriods = config.getParameter<uint_t>("turnover_periods", 0); + + WALBERLA_ASSERT((timesteps != 0) != (turnoverPeriods != 0), + "Either timesteps OR turnover periods must be given.") + + if(turnoverPeriods != 0) { + // turnover period defined by T = delta / u_tau + timesteps = turnoverPeriods * uint_c((real_c(channelHalfWidth) / targetFrictionVelocity)); + } + + /// DOMAIN DEFINITIONS + + // obtained from codegen script -> adapt there + wallAxis = codegen::wallAxis; + flowAxis = codegen::flowAxis; + + uint_t sizeFlowAxis = config.getParameter<uint_t>("size_flow_axis", 0); + uint_t sizeRemainingAxis = config.getParameter<uint_t>("size_remaining_axis", 0); + + WALBERLA_ASSERT_NOT_IDENTICAL(wallAxis, flowAxis, "Wall and flow axis must be different.") + + const auto sizeFactor = channelHalfWidth / uint_t(10); + if( !sizeFlowAxis) sizeFlowAxis = sizeFactor * 64; + if( !sizeRemainingAxis) sizeRemainingAxis = sizeFactor * 32; + + domainSize[wallAxis] = fullChannel ? 2 * channelHalfWidth : channelHalfWidth; + domainSize[flowAxis] = sizeFlowAxis; + domainSize[3- wallAxis - flowAxis] = sizeRemainingAxis; + + periodicity[wallAxis] = false; + + boundaryCondition = config.getParameter<std::string>("wall_boundary_condition", "WFB"); + + /// OUTPUT + + auto tsPerPeriod = uint_c((real_c(channelHalfWidth) / targetFrictionVelocity)); + + vtkFrequency = config.getParameter<uint_t>("vtk_frequency", 0); + vtkStart = config.getParameter<uint_t>("vtk_start", 0); + plotFrequency = config.getParameter<uint_t>("plot_frequency", 0); + plotStart = config.getParameter<uint_t>("plot_start", 0); + + // vtk start + vtkStart = config.getParameter<uint_t>("vtk_start_timesteps", 0); + const uint_t vtkStartPeriods = config.getParameter<uint_t>("vtk_start_periods", 0); + + if(vtkStart || vtkStartPeriods) { + WALBERLA_ASSERT((vtkStart != 0) != (vtkStartPeriods != 0), + "VTK start must be given in timesteps OR periods, not both.") + } + + if(vtkStartPeriods != 0) { + // turnover period defined by T = delta / u_tau + vtkStart = vtkStartPeriods * tsPerPeriod; + } + + // plot start + plotStart = config.getParameter<uint_t>("plot_start_timesteps", 0); + const uint_t plotStartPeriods = config.getParameter<uint_t>("plot_start_periods", 0); + + if(plotStart || plotStartPeriods) { + WALBERLA_ASSERT((plotStart != 0) != (plotStartPeriods != 0), + "Plotting start must be given in timesteps OR periods, not both.") + } + + if(plotStartPeriods != 0) { + // turnover period defined by T = delta / u_tau + plotStart = plotStartPeriods * tsPerPeriod; + } + + // frequencies + if(plotFrequency) { + timesteps = uint_c(std::ceil(real_c(timesteps) / real_c(plotFrequency))) * plotFrequency; + } + + // sampling start & interval + samplingStart = config.getParameter<uint_t>("sampling_start_timesteps", 0); + const uint_t samplingStartPeriods = config.getParameter<uint_t>("sampling_start_periods", 0); + + if(samplingStart || samplingStartPeriods) { + WALBERLA_ASSERT((samplingStart != 0) != (samplingStartPeriods != 0), + "Sampling start must be given in timesteps OR periods, not both.") + } + + if(samplingStartPeriods != 0) { + // turnover period defined by T = delta / u_tau + samplingStart = samplingStartPeriods * tsPerPeriod; + } + + samplingInterval = config.getParameter<uint_t>("sampling_interval_timesteps", 0); + const uint_t samplingIntervalPeriods = config.getParameter<uint_t>("sampling_interval_periods", 0); + + if(samplingInterval || samplingIntervalPeriods) { + WALBERLA_ASSERT((samplingInterval != 0) != (samplingIntervalPeriods != 0), + "Sampling start must be given in timesteps OR periods, not both.") + } + + if(samplingStartPeriods != 0) { + // turnover period defined by T = delta / u_tau + samplingInterval = samplingIntervalPeriods * tsPerPeriod; + } + + timesteps += 1; + + } + + uint_t channelHalfWidth{}; + bool fullChannel{}; + Vector3<uint_t> domainSize{}; + Vector3<uint_t> periodicity{true}; + + real_t targetFrictionReynolds{}; + real_t targetBulkReynolds{}; + real_t targetFrictionVelocity{}; + real_t targetBulkVelocity{}; + + real_t viscosity{}; + const real_t density{1.0}; + + uint_t timesteps{}; + + std::string boundaryCondition{}; + + uint_t wallAxis{}; + uint_t flowAxis{}; + + /// output + uint_t vtkFrequency{}; + uint_t vtkStart{}; + uint_t plotFrequency{}; + uint_t plotStart{}; + uint_t samplingStart{}; + uint_t samplingInterval{}; + + }; + + + namespace boundaries { + void createBoundaryConfig(const SimulationParameters & parameters, Config::Block & boundaryBlock) { + + auto & bottomWall = boundaryBlock.createBlock("Border"); + bottomWall.addParameter("direction", stencil::dirToString[stencil::directionFromAxis(parameters.wallAxis, true)]); + bottomWall.addParameter("walldistance", "-1"); + if(parameters.boundaryCondition == "NoSlip") { + bottomWall.addParameter("flag", "NoSlip"); + } else if(parameters.boundaryCondition == "WFB") { + bottomWall.addParameter("flag", "WFB_bottom"); + } + + auto & topWall = boundaryBlock.createBlock("Border"); + topWall.addParameter("direction", stencil::dirToString[stencil::directionFromAxis(parameters.wallAxis, false)]); + topWall.addParameter("walldistance", "-1"); + if(parameters.fullChannel) { + if (parameters.boundaryCondition == "NoSlip") { + topWall.addParameter("flag", "NoSlip"); + } else if (parameters.boundaryCondition == "WFB") { + topWall.addParameter("flag", "WFB_top"); + } + } else { + topWall.addParameter("flag", "FreeSlip"); + } + + } + } + + /// BULK VELOCITY CALCULATION + template< typename VelocityField_T > + class ForceCalculator { + + public: + ForceCalculator(const std::weak_ptr<StructuredBlockStorage> & blocks, const BlockDataID meanVelocityId, + const SimulationParameters & parameter) + : blocks_(blocks), meanVelocityId_(meanVelocityId), channelHalfWidth_(real_c(parameter.channelHalfWidth)), + targetBulkVelocity_(parameter.targetBulkVelocity), targetFrictionVelocity_(parameter.targetFrictionVelocity) + { + const auto & domainSize = parameter.domainSize; + + Cell maxCell; + maxCell[parameter.wallAxis] = int_c(parameter.channelHalfWidth) - 1; + maxCell[flowDirection_] = int_c(domainSize[flowDirection_]) - 1; + const auto remainingIdx = 3 - parameter.wallAxis - flowDirection_; + maxCell[remainingIdx] = int_c(domainSize[remainingIdx]) - 1; + ci_ = CellInterval(Cell{}, maxCell); + + numCells_ = real_c(parameter.channelHalfWidth * domainSize[flowDirection_] * domainSize[remainingIdx]); + } + + real_t bulkVelocity() const { return bulkVelocity_; } + void setBulkVelocity(const real_t bulkVelocity) { bulkVelocity_ = bulkVelocity; } + + void calculateBulkVelocity() { + + // reset bulk velocity + bulkVelocity_ = 0_r; + + auto blocks = blocks_.lock(); + WALBERLA_CHECK_NOT_NULLPTR(blocks) + + for( auto block = blocks->begin(); block != blocks->end(); ++block) { + + auto * meanVelocityField = block->template getData<VelocityField_T>(meanVelocityId_); + WALBERLA_CHECK_NOT_NULLPTR(meanVelocityField) + + auto fieldSize = meanVelocityField->xyzSize(); + CellInterval localCi; + blocks->transformGlobalToBlockLocalCellInterval(localCi, *block, ci_); + fieldSize.intersect(localCi); + + auto * slicedField = meanVelocityField->getSlicedField(fieldSize); + WALBERLA_CHECK_NOT_NULLPTR(meanVelocityField) + + for(auto fieldIt = slicedField->beginXYZ(); fieldIt != slicedField->end(); ++fieldIt) { + const auto localMean = fieldIt[flowDirection_]; + bulkVelocity_ += localMean; + } + + } + + mpi::allReduceInplace< real_t >(bulkVelocity_, mpi::SUM); + bulkVelocity_ /= numCells_; + + } + + real_t calculateDrivingForce() const { + + // forcing term as in Malaspinas (2014) "Wall model for large-eddy simulation based on the lattice Boltzmann method" + const auto force = targetFrictionVelocity_ * targetFrictionVelocity_ / channelHalfWidth_ + + (targetBulkVelocity_ - bulkVelocity_) * targetBulkVelocity_ / channelHalfWidth_; + + return force; + } + + private: + const std::weak_ptr<StructuredBlockStorage> blocks_{}; + const BlockDataID meanVelocityId_{}; + + const uint_t flowDirection_{}; + const real_t channelHalfWidth_{}; + const real_t targetBulkVelocity_{}; + const real_t targetFrictionVelocity_{}; + + CellInterval ci_{}; + + real_t numCells_{}; + real_t bulkVelocity_{}; + }; + + template< typename Welford_T > + class TurbulentChannelPlotter { + + public: + TurbulentChannelPlotter(SimulationParameters const * const parameters, Timeloop * const timeloop, + ForceCalculator<VectorField_T> const * const forceCalculator, + const std::weak_ptr<StructuredBlockStorage> & blocks, + const BlockDataID velocityFieldId, const BlockDataID meanVelocityFieldId, + const BlockDataID meanTkeSGSFieldId, Welford_T * velocityWelford, + const bool separateFile = false) + : parameters_(parameters), forceCalculator_(forceCalculator), timeloop_(timeloop), blocks_(blocks), + velocityWelford_(velocityWelford), velocityFieldId_(velocityFieldId), meanVelocityFieldId_(meanVelocityFieldId), + meanTkeSGSFieldId_(meanTkeSGSFieldId), plotFrequency_(parameters->plotFrequency), plotStart_(parameters->plotStart), + separateFiles_(separateFile) + { + if(!plotFrequency_) + return; + + // prepare output folder + const filesystem::path path(baseFolder_); + std::string fileSuffix = parameters->boundaryCondition + "_"; + + if(parameters->fullChannel) + fileSuffix += "full_D"; + else + fileSuffix += "half_D"; + + fileSuffix += std::to_string(parameters->channelHalfWidth) + "_Re" + + std::to_string(int(parameters->targetFrictionReynolds)) ; + + velocityProfilesFilePath_ = path / ("velocity_profiles_" + fileSuffix); + forcingDataFilePath_ = path / ("forcing_data_" + fileSuffix + "_t" + + std::to_string(parameters->timesteps-1) + ".txt"); + + WALBERLA_ROOT_SECTION() { + // create directory if not existent; empty if existent + if( !filesystem::exists(path) ) { + filesystem::create_directories(path); + } else { + for (const auto& entry : filesystem::directory_iterator(path)) + std::filesystem::remove_all(entry.path()); + } + } + + // write force header + std::ofstream os (forcingDataFilePath_, std::ios::out | std::ios::trunc); + if(os.is_open()) { + os << "# timestep\t bulk_velocity\t driving_force\n"; + os.close(); + } else { + WALBERLA_ABORT("Could not open forcing data file.") + } + + } + + void operator()() { + + const auto ts = timeloop_->getCurrentTimeStep(); + if(ts < plotStart_) + return; + + if(!plotFrequency_ || (ts % plotFrequency_)) + return; + + const auto channelHalfWidth = real_c(parameters_->channelHalfWidth); + const auto bulkVelocity = forceCalculator_->bulkVelocity(); + + /// write force data + + WALBERLA_ROOT_SECTION() { + std::ofstream forceOS(forcingDataFilePath_, std::ios::out | std::ios::app); + if (forceOS.is_open()) + { + forceOS << ts << "\t" << bulkVelocity << "\t" << forceCalculator_->calculateDrivingForce() << "\n"; + forceOS.close(); + } + } + + /// write velocity data + + // gather velocity data + std::vector<real_t> instantaneousVelocityVector(parameters_->channelHalfWidth, 0_r); + std::vector<real_t> meanVelocityVector(parameters_->channelHalfWidth, 0_r); + std::vector<real_t> tkeSGSVector(parameters_->channelHalfWidth, 0_r); + std::vector<real_t> tkeResolvedVector(parameters_->channelHalfWidth, 0_r); + std::vector<real_t> reynoldsStressVector(parameters_->channelHalfWidth * TensorField_T::F_SIZE, 0_r); + + const auto idxFlow = int_c(parameters_->domainSize[parameters_->flowAxis] / uint_t(2)); + const auto idxRem = int_c(parameters_->domainSize[3 - parameters_->flowAxis - parameters_->wallAxis] / uint_t(2)); + + Cell point; + point[parameters_->flowAxis] = idxFlow; + point[3 - parameters_->flowAxis - parameters_->wallAxis] = idxRem; + + const auto flowAxis = int_c(parameters_->flowAxis); + + auto blocks = blocks_.lock(); + WALBERLA_CHECK_NOT_NULLPTR(blocks) + + for(auto block = blocks->begin(); block != blocks->end(); ++block) { + + const auto * const velocity = block->template getData<VectorField_T>(velocityFieldId_); + WALBERLA_CHECK_NOT_NULLPTR(velocity) + + const auto * const meanVelocity = block->template getData<VectorField_T>(meanVelocityFieldId_); + WALBERLA_CHECK_NOT_NULLPTR(meanVelocity) + + const auto * const tkeSGS = block->template getData<ScalarField_T>(meanTkeSGSFieldId_); + WALBERLA_CHECK_NOT_NULLPTR(tkeSGS) + + const auto * const sop = block->template getData<TensorField_T>(velocityWelford_->sum_of_productsID); + WALBERLA_CHECK_NOT_NULLPTR(sop) + + for(uint_t idx = 0; idx < parameters_->channelHalfWidth; ++idx) { + + point[parameters_->wallAxis] = int_c(idx); + + Cell localCell; + blocks->transformGlobalToBlockLocalCell(localCell, *block, point); + + if(velocity->xyzSize().contains(localCell)){ + instantaneousVelocityVector[idx] = velocity->get(localCell, flowAxis); + meanVelocityVector[idx] = meanVelocity->get(localCell, flowAxis); + tkeSGSVector[idx] = tkeSGS->get(localCell); + for(uint_t i = 0; i < TensorField_T::F_SIZE; ++i) { + reynoldsStressVector[idx*TensorField_T::F_SIZE+i] = sop->get(localCell,i) / velocityWelford_->counter_; + } + tkeResolvedVector[idx] = real_c(0.5) * ( + reynoldsStressVector[idx*TensorField_T::F_SIZE+0] + + reynoldsStressVector[idx*TensorField_T::F_SIZE+4] + + reynoldsStressVector[idx*TensorField_T::F_SIZE+8] + ); + } + } + } + + // MPI exchange information + mpi::reduceInplace(instantaneousVelocityVector, mpi::SUM); + mpi::reduceInplace(meanVelocityVector, mpi::SUM); + mpi::reduceInplace(tkeSGSVector, mpi::SUM); + mpi::reduceInplace(tkeResolvedVector, mpi::SUM); + mpi::reduceInplace(reynoldsStressVector, mpi::SUM); + + WALBERLA_ROOT_SECTION() + { + std::ofstream velocityOS; + filesystem::path path = velocityProfilesFilePath_; + if (separateFiles_) { + path.concat("_t" + std::to_string(timeloop_->getCurrentTimeStep()) + ".txt"); + velocityOS.open(path, std::ios::out | std::ios::trunc); + } else { + path.concat("_t" + std::to_string(parameters_->timesteps-1) + ".txt"); + velocityOS.open(path, std::ios::out | std::ios::trunc); + } + + if (velocityOS.is_open()) { + if (!separateFiles_) velocityOS << "# t = " << ts << "\n"; + velocityOS << "# y/delta\t y+\t u+\t u_mean\t u_instantaneous\t TKE_SGS\t TKE_resolved\t uu_rms\t uv_rms\t uw_rms\t vu_rms\t vv_rms\t vw_rms\t wu_rms\t wv_rms\t ww_rms\n"; + + const auto & viscosity = parameters_->viscosity; + const auto bulkReynolds = 2_r * channelHalfWidth * bulkVelocity / viscosity; + const auto frictionReynolds = dean_correlation::calculateFrictionReynoldsNumber(bulkReynolds); + const auto frictionVelocity = frictionReynolds * viscosity / channelHalfWidth; + + for(uint_t idx = 0; idx < parameters_->channelHalfWidth; ++idx) { + // relative position + velocityOS << (real_c(idx)+0.5_r) / channelHalfWidth << "\t"; + // y+ + velocityOS << (real_c(idx)+0.5_r) * frictionVelocity / viscosity << "\t"; + // u+ + velocityOS << meanVelocityVector[idx] / frictionVelocity << "\t"; + // mean velocity + velocityOS << meanVelocityVector[idx] << "\t"; + // instantaneous velocity + velocityOS << instantaneousVelocityVector[idx] << "\t"; + // subgrid-scale TKE + velocityOS << tkeSGSVector[idx] << "\t"; + // resolved TKE + velocityOS << tkeResolvedVector[idx] << "\t"; + // Reynolds stresses + for(uint_t i = 0; i < TensorField_T::F_SIZE; ++i) { + velocityOS << reynoldsStressVector[idx*TensorField_T::F_SIZE+i] << "\t"; + } + + velocityOS << "\n"; + } + velocityOS.close(); + } else{ + WALBERLA_ABORT("Could not open velocity plot file " << path.generic_string()) + } + } + } + + private: + + + SimulationParameters const * const parameters_{}; + ForceCalculator<VectorField_T> const * const forceCalculator_{}; + + Timeloop * const timeloop_{}; + const std::weak_ptr<StructuredBlockStorage> blocks_; + Welford_T * const velocityWelford_{}; + + const BlockDataID velocityFieldId_{}; + const BlockDataID meanVelocityFieldId_{}; + const BlockDataID meanTkeSGSFieldId_{}; + + const uint_t plotFrequency_{}; + const uint_t plotStart_{}; + + const bool separateFiles_{false}; + const std::string baseFolder_{"output"}; + filesystem::path velocityProfilesFilePath_; + filesystem::path forcingDataFilePath_; + }; + + ///////////////////// + /// Main Function /// + ///////////////////// + + int main(int argc, char** argv) { + + Environment walberlaEnv(argc, argv); + + if (!walberlaEnv.config()) { WALBERLA_ABORT("No configuration file specified!") } + + /////////////////////////////////////////////////////// + /// Block Storage Creation and Simulation Parameter /// + /////////////////////////////////////////////////////// + + WALBERLA_LOG_INFO_ON_ROOT("Creating block forest...") + + const auto channelParameter = walberlaEnv.config()->getOneBlock("TurbulentChannel"); + const SimulationParameters simulationParameters(channelParameter); + + // domain creation + std::shared_ptr<StructuredBlockForest> blocks; + { + Vector3< uint_t > numBlocks; + Vector3< uint_t > cellsPerBlock; + blockforest::calculateCellDistribution(simulationParameters.domainSize, + uint_c(mpi::MPIManager::instance()->numProcesses()), + numBlocks, cellsPerBlock); + + const auto & periodicity = simulationParameters.periodicity; + const auto & domainSize = simulationParameters.domainSize; + + SetupBlockForest sforest; + + sforest.addWorkloadMemorySUIDAssignmentFunction( blockforest::uniformWorkloadAndMemoryAssignment ); + + sforest.init( AABB(0_r, 0_r, 0_r, real_c(domainSize[0]), real_c(domainSize[1]), real_c(domainSize[2])), + numBlocks[0], numBlocks[1], numBlocks[2], periodicity[0], periodicity[1], periodicity[2] ); + + // calculate process distribution + + const memory_t memoryLimit = numeric_cast< memory_t >( sforest.getNumberOfBlocks() ); + + const blockforest::GlobalLoadBalancing::MetisConfiguration< SetupBlock > metisConfig( + true, false, std::bind( blockforest::cellWeightedCommunicationCost, std::placeholders::_1, std::placeholders::_2, + cellsPerBlock[0], cellsPerBlock[1], cellsPerBlock[2] ) ); + + sforest.calculateProcessDistribution_Default( uint_c( MPIManager::instance()->numProcesses() ), memoryLimit, + "hilbert", 10, false, metisConfig ); + + if( !MPIManager::instance()->rankValid() ) + MPIManager::instance()->useWorldComm(); + + // create StructuredBlockForest (encapsulates a newly created BlockForest) + + WALBERLA_LOG_INFO_ON_ROOT("SetupBlockForest created successfully:\n" << sforest) + + sforest.writeVTKOutput("domain_decomposition"); + + auto bf = std::make_shared< BlockForest >( uint_c( MPIManager::instance()->rank() ), sforest, false ); + + blocks = std::make_shared< StructuredBlockForest >( bf, cellsPerBlock[0], cellsPerBlock[1], cellsPerBlock[2] ); + blocks->createCellBoundingBoxes(); + + } + + //////////////////////////////////// + /// PDF Field and Velocity Setup /// + //////////////////////////////////// + + WALBERLA_LOG_INFO_ON_ROOT("Creating fields...") + + // Common Fields + const BlockDataID velocityFieldId = field::addToStorage< VectorField_T >(blocks, "velocity", real_c(0.0), codegen::layout); + const BlockDataID meanVelocityFieldId = field::addToStorage< VectorField_T >(blocks, "mean velocity", real_c(0.0), codegen::layout); + const BlockDataID sopFieldId = field::addToStorage< TensorField_T >(blocks, "sum of products", real_c(0.0), codegen::layout); + + const BlockDataID tkeSgsFieldId = field::addToStorage< ScalarField_T >(blocks, "tke_SGS", real_c(0.0), codegen::layout); + const BlockDataID meanTkeSgsFieldId = field::addToStorage< ScalarField_T >(blocks, "mean_tke_SGS", real_c(0.0), codegen::layout); + + const BlockDataID omegaFieldId = field::addToStorage< ScalarField_T >(blocks, "omega_out", real_c(0.0), codegen::layout); + + const BlockDataID flagFieldId = field::addFlagFieldToStorage< FlagField_T >(blocks, "flag field"); + + // CPU Field for PDFs + const BlockDataID pdfFieldId = field::addToStorage< PdfField_T >(blocks, "pdf field", real_c(0.0), codegen::layout); + + /////////////////////////////////////////// + /// Force and bulk velocity calculation /// + /////////////////////////////////////////// + + ForceCalculator<VectorField_T> forceCalculator(blocks, velocityFieldId, simulationParameters); + + ////////////// + /// Setter /// + ////////////// + + WALBERLA_LOG_INFO_ON_ROOT("Setting up fields...") + + // Velocity field setup + setVelocityFieldsAsmuth<VectorField_T>( + blocks, velocityFieldId, meanVelocityFieldId, + simulationParameters.targetFrictionVelocity, simulationParameters.channelHalfWidth, + 5.5_r, 0.41_r, simulationParameters.viscosity, + simulationParameters.wallAxis, simulationParameters.flowAxis ); + + forceCalculator.setBulkVelocity(simulationParameters.targetBulkVelocity); + const auto initialForce = forceCalculator.calculateDrivingForce(); + + // pdfs setup + Setter_T pdfSetter(pdfFieldId, velocityFieldId, initialForce, simulationParameters.density); + + for (auto blockIt = blocks->begin(); blockIt != blocks->end(); ++blockIt) + pdfSetter(blockIt.get()); + + ///////////// + /// Sweep /// + ///////////// + + WALBERLA_LOG_INFO_ON_ROOT("Creating sweeps...") + + const auto omega = lbm::collision_model::omegaFromViscosity(simulationParameters.viscosity); + StreamCollideSweep_T streamCollideSweep(omegaFieldId, pdfFieldId, velocityFieldId, initialForce, omega); + + WelfordSweep_T welfordSweep(meanVelocityFieldId, sopFieldId, velocityFieldId, 0_r); + TKEWelfordSweep_T welfordTKESweep(meanTkeSgsFieldId, tkeSgsFieldId, 0_r); + + TkeSgsWriter_T tkeSgsWriter(omegaFieldId, pdfFieldId, tkeSgsFieldId, initialForce, omega); + + ///////////////////////// + /// Boundary Handling /// + ///////////////////////// + + WALBERLA_LOG_INFO_ON_ROOT("Creating boundary handling...") + + const FlagUID fluidFlagUID("Fluid"); + + Config::Block boundaryBlock; + boundaries::createBoundaryConfig(simulationParameters, boundaryBlock); + + std::unique_ptr<WFB_bottom_T> wfb_bottom_ptr = std::make_unique<WFB_bottom_T>(blocks, meanVelocityFieldId, pdfFieldId, omega, simulationParameters.targetFrictionVelocity); + std::unique_ptr<WFB_top_T > wfb_top_ptr = std::make_unique<WFB_top_T>(blocks, meanVelocityFieldId, pdfFieldId, omega, simulationParameters.targetFrictionVelocity); + + NoSlip_T noSlip(blocks, pdfFieldId); + FreeSlip_top_T freeSlip_top(blocks, pdfFieldId); + + geometry::initBoundaryHandling< FlagField_T >(*blocks, flagFieldId, Config::BlockHandle(&boundaryBlock)); + geometry::setNonBoundaryCellsToDomain< FlagField_T >(*blocks, flagFieldId, fluidFlagUID); + + noSlip.fillFromFlagField< FlagField_T >(blocks, flagFieldId, FlagUID("NoSlip"), fluidFlagUID); + freeSlip_top.fillFromFlagField< FlagField_T >(blocks, flagFieldId, FlagUID("FreeSlip"), fluidFlagUID); + wfb_bottom_ptr->fillFromFlagField< FlagField_T >(blocks, flagFieldId, FlagUID("WFB_bottom"), fluidFlagUID); + wfb_top_ptr->fillFromFlagField< FlagField_T >(blocks, flagFieldId, FlagUID("WFB_top"), fluidFlagUID); + + ////////////// + /// Output /// + ////////////// + + WALBERLA_LOG_INFO_ON_ROOT("Creating field output...") + + // vtk output + auto vtkWriter = vtk::createVTKOutput_BlockData( + blocks, "field_writer", simulationParameters.vtkFrequency, 0, false, "vtk_out", "simulation_step", + false, false, true, false + ); + vtkWriter->setInitialWriteCallsToSkip(simulationParameters.vtkStart); + + // velocity field writer + auto velocityWriter = std::make_shared<field::VTKWriter<VectorField_T>>(velocityFieldId, "instantaneous velocity"); + vtkWriter->addCellDataWriter(velocityWriter); + + auto meanVelocityFieldWriter = std::make_shared<field::VTKWriter<VectorField_T>>(meanVelocityFieldId, "mean velocity"); + vtkWriter->addCellDataWriter(meanVelocityFieldWriter); + + // vtk writer + { + auto flagOutput = vtk::createVTKOutput_BlockData( + blocks, "flag_writer", 1, 1, false, "vtk_out", "simulation_step", + false, true, true, false + ); + auto flagWriter = std::make_shared<field::VTKWriter<FlagField_T>>(flagFieldId, "flag field"); + flagOutput->addCellDataWriter(flagWriter); + flagOutput->write(); + } + + + ///////////////// + /// Time Loop /// + ///////////////// + + WALBERLA_LOG_INFO_ON_ROOT("Creating timeloop...") + + SweepTimeloop timeloop(blocks->getBlockStorage(), simulationParameters.timesteps); + + // Communication + blockforest::communication::UniformBufferedScheme< Stencil_T > communication(blocks); + communication.addPackInfo(make_shared< PackInfo_T >(pdfFieldId)); + + auto setNewForce = [&](const real_t newForce) { + streamCollideSweep.F_x_ = newForce; + tkeSgsWriter.F_x_ = newForce; + tkeSgsWriter.F_x_ = newForce; + }; + + // plotting + const bool outputSeparateFiles = channelParameter.getParameter<bool>("separate_files", false); + const TurbulentChannelPlotter<WelfordSweep_T > plotter(&simulationParameters, &timeloop, &forceCalculator, blocks, + velocityFieldId, meanVelocityFieldId, + meanTkeSgsFieldId, &welfordSweep, + outputSeparateFiles); + + //NOTE must convert sweeps that are altered to lambdas, otherwise copy and counter will stay 0 + auto welfordLambda = [&welfordSweep, &welfordTKESweep](IBlock * block) { + welfordSweep(block); + welfordTKESweep(block); + }; + + auto wfbLambda = [&wfb_bottom_ptr, &wfb_top_ptr](IBlock * block) { + wfb_bottom_ptr->operator()(block); + wfb_top_ptr->operator()(block); + }; + + auto streamCollideLambda = [&streamCollideSweep](IBlock * block) { + streamCollideSweep(block); + }; + + // Timeloop + timeloop.add() << BeforeFunction(communication, "communication") + << BeforeFunction([&](){forceCalculator.calculateBulkVelocity();}, "bulk velocity calculation") + << BeforeFunction([&](){ + const auto newForce = forceCalculator.calculateDrivingForce(); + setNewForce(newForce); + }, "new force setter") + << Sweep([](IBlock *){}, "new force setter"); + timeloop.add() << Sweep(freeSlip_top, "freeSlip"); + timeloop.add() << Sweep(noSlip, "noSlip"); + timeloop.add() << Sweep(wfbLambda, "wall function bounce"); + timeloop.add() << Sweep(streamCollideLambda, "stream and collide"); + timeloop.add() << BeforeFunction([&](){ + const uint_t velCtr = uint_c(welfordSweep.counter_); + if((timeloop.getCurrentTimeStep() == simulationParameters.samplingStart) || + (timeloop.getCurrentTimeStep() > simulationParameters.samplingStart && simulationParameters.samplingInterval && (velCtr % simulationParameters.samplingInterval == 0))) { + welfordSweep.counter_ = real_t(0); + welfordTKESweep.counter_ = real_t(0); + for(auto & block : *blocks) { + auto * sopField = block.template getData<TensorField_T >(sopFieldId); + sopField->setWithGhostLayer(0.0); + + auto * tkeField = block.template getData<ScalarField_T>(tkeSgsFieldId); + tkeField->setWithGhostLayer(0.0); + } + } + + welfordSweep.counter_ = welfordSweep.counter_ + real_c(1); + welfordTKESweep.counter_ = welfordTKESweep.counter_ + real_c(1); + }, "welford sweep") + << Sweep(welfordLambda, "welford sweep"); + timeloop.add() << Sweep(tkeSgsWriter, "TKE_SGS writer"); + + timeloop.addFuncAfterTimeStep(vtk::writeFiles(vtkWriter), "VTK field output"); + timeloop.addFuncAfterTimeStep(plotter, "Turbulent quantity plotting"); + + // LBM stability check + timeloop.addFuncAfterTimeStep( makeSharedFunctor( field::makeStabilityChecker< PdfField_T, FlagField_T >( + walberlaEnv.config(), blocks, pdfFieldId, flagFieldId, fluidFlagUID ) ), + "LBM stability check" ); + + // Time logger + timeloop.addFuncAfterTimeStep(timing::RemainingTimeLogger(timeloop.getNrOfTimeSteps(), 5_r), + "remaining time logger"); + + + WALBERLA_LOG_INFO_ON_ROOT("Running timeloop with " << timeloop.getNrOfTimeSteps() - 1 << " timesteps...") + + WcTimingPool timing; + + WcTimer timer; + timer.start(); + + timeloop.run(timing); + + timer.end(); + + double time = timer.max(); + walberla::mpi::reduceInplace(time, walberla::mpi::MAX); + + const auto timeloopTiming = timing.getReduced(); + WALBERLA_LOG_INFO_ON_ROOT("Timeloop timing:\n" << *timeloopTiming) + + const walberla::lbm::PerformanceEvaluation<FlagField_T> performance(blocks, flagFieldId, fluidFlagUID); + performance.logResultOnRoot(simulationParameters.timesteps, time); + + return EXIT_SUCCESS; + } + +} // namespace walberla + +int main(int argc, char** argv) { return walberla::main(argc, argv); } diff --git a/apps/benchmarks/TurbulentChannel/TurbulentChannel.prm b/apps/benchmarks/TurbulentChannel/TurbulentChannel.prm new file mode 100644 index 0000000000000000000000000000000000000000..27c18411d0b24a2b1d4bb03401c4c543eb023d92 --- /dev/null +++ b/apps/benchmarks/TurbulentChannel/TurbulentChannel.prm @@ -0,0 +1,35 @@ + +TurbulentChannel { + + channel_half_width 20; + full_channel 0; + + wall_boundary_condition WFB; + + target_friction_Reynolds 395; + target_bulk_velocity 0.1; + + // turnover_periods 50; + timesteps 100; + + // sampling_start_timesteps 50; + // sampling_start_periods 1; + // sampling_interval_timesteps 20; + // sampling_interval_periods 1; + + // vtk_start_timesteps 50; + // vtk_start_periods 1000; + // plot_start_timesteps 50; + // plot_start_periods 1000; + vtk_frequency 10; + plot_frequency 10; + separate_files 0; + +} + +StabilityChecker +{ + checkFrequency 10000; + streamOutput false; + vtkOutput true; +} diff --git a/apps/benchmarks/TurbulentChannel/TurbulentChannel.py b/apps/benchmarks/TurbulentChannel/TurbulentChannel.py new file mode 100644 index 0000000000000000000000000000000000000000..72df02190b623c89d6a255765b82647954055e97 --- /dev/null +++ b/apps/benchmarks/TurbulentChannel/TurbulentChannel.py @@ -0,0 +1,201 @@ +import sympy as sp +import pystencils as ps + +from lbmpy.enums import SubgridScaleModel +from lbmpy import LBMConfig, LBMOptimisation, LBStencil, Method, Stencil, ForceModel +from lbmpy.flow_statistics import welford_assignments +from lbmpy.relaxationrates import lattice_viscosity_from_relaxation_rate + +from lbmpy.creationfunctions import create_lb_update_rule +from lbmpy.macroscopic_value_kernels import macroscopic_values_setter + +from lbmpy.boundaries import NoSlip, FreeSlip, WallFunctionBounce +from lbmpy.boundaries.wall_function_models import SpaldingsLaw, MoninObukhovSimilarityTheory +from lbmpy.utils import frobenius_norm, second_order_moment_tensor + +from pystencils_walberla import CodeGeneration, generate_sweep, generate_pack_info_from_kernel +from lbmpy_walberla import generate_boundary + +# ===================== +# Code Generation +# ===================== + +info_header = """ +#ifndef TURBULENTCHANNEL_INCLUDES +#define TURBULENTCHANNEL_INCLUDES + +#include <stencil/D{d}Q{q}.h> + +#include "TurbulentChannel_Sweep.h" +#include "TurbulentChannel_PackInfo.h" +#include "TurbulentChannel_Setter.h" +#include "TurbulentChannel_Welford.h" +#include "TurbulentChannel_Welford_TKE_SGS.h" +#include "TurbulentChannel_TKE_SGS_Writer.h" + +#include "TurbulentChannel_NoSlip.h" +#include "TurbulentChannel_FreeSlip_top.h" +#include "TurbulentChannel_WFB_top.h" +#include "TurbulentChannel_WFB_bottom.h" + +namespace walberla {{ + namespace codegen {{ + using Stencil_T = walberla::stencil::D{d}Q{q}; + static constexpr uint_t flowAxis = {flow_axis}; + static constexpr uint_t wallAxis = {wall_axis}; + + static constexpr field::Layout layout = field::{layout}; + }} +}} + +#endif // TURBULENTCHANNEL_INCLUDES +""" + + +def check_axis(flow_axis, wall_axis): + assert flow_axis != wall_axis + assert flow_axis < 3 + assert wall_axis < 3 + + +with CodeGeneration() as ctx: + + flow_axis = 0 + wall_axis = 1 + + check_axis(flow_axis=flow_axis, wall_axis=wall_axis) + + # ======================== + # General Parameters + # ======================== + target = ps.Target.CPU + + data_type = "float64" if ctx.double_accuracy else "float32" + stencil = LBStencil(Stencil.D3Q19) + omega = sp.Symbol('omega') + + F_x = sp.Symbol('F_x') + force_vector = [0] * 3 + force_vector[flow_axis] = F_x + + layout = 'fzyx' + + normal_direction_top = [0] * 3 + normal_direction_top[wall_axis] = -1 + normal_direction_top = tuple(normal_direction_top) + + normal_direction_bottom = [0] * 3 + normal_direction_bottom[wall_axis] = 1 + normal_direction_bottom = tuple(normal_direction_bottom) + + # PDF Fields + pdfs, pdfs_tmp = ps.fields(f'pdfs({stencil.Q}), pdfs_tmp({stencil.Q}): {data_type}[{stencil.D}D]', layout=layout) + + # Output Fields + omega_field = ps.fields(f"omega_out: {data_type}[{stencil.D}D]", layout=layout) + sgs_tke = ps.fields(f"sgs_tke: {data_type}[{stencil.D}D]", layout=layout) + mean_sgs_tke = ps.fields(f"mean_sgs_tke: {data_type}[{stencil.D}D]", layout=layout) + velocity = ps.fields(f"velocity({stencil.D}): {data_type}[{stencil.D}D]", layout=layout) + mean_velocity = ps.fields(f"mean_velocity({stencil.D}): {data_type}[{stencil.D}D]", layout=layout) + sum_of_products = ps.fields(f"sum_of_products({stencil.D**2}): {data_type}[{stencil.D}D]", layout=layout) + + # LBM Optimisation + lbm_opt = LBMOptimisation(cse_global=True, + symbolic_field=pdfs, + symbolic_temporary_field=pdfs_tmp, + field_layout=layout) + + # ================== + # Method Setup + # ================== + + lbm_config = LBMConfig(stencil=stencil, + method=Method.CUMULANT, + force_model=ForceModel.GUO, + force=tuple(force_vector), + relaxation_rate=omega, + subgrid_scale_model=SubgridScaleModel.QR, + # galilean_correction=True, + compressible=True, + omega_output_field=omega_field, + output={'velocity': velocity}) + + update_rule = create_lb_update_rule(lbm_config=lbm_config, lbm_optimisation=lbm_opt) + lbm_method = update_rule.method + + # ======================== + # PDF Initialization + # ======================== + + initial_rho = sp.Symbol('rho_0') + + pdfs_setter = macroscopic_values_setter(lbm_method, + initial_rho, + velocity.center_vector, + pdfs.center_vector) + + # LBM Sweep + generate_sweep(ctx, "TurbulentChannel_Sweep", update_rule, field_swaps=[(pdfs, pdfs_tmp)], target=target) + + # Pack Info + generate_pack_info_from_kernel(ctx, "TurbulentChannel_PackInfo", update_rule, target=target) + + # Macroscopic Values Setter + generate_sweep(ctx, "TurbulentChannel_Setter", pdfs_setter, target=target, ghost_layers_to_include=1) + + # Welford update + # welford_update = welford_assignments(vector_field=velocity, mean_vector_field=mean_velocity) + welford_update = welford_assignments(field=velocity, mean_field=mean_velocity, + sum_of_products_field=sum_of_products) + generate_sweep(ctx, "TurbulentChannel_Welford", welford_update, target=target) + + tke_welford_update = welford_assignments(field=sgs_tke, mean_field=mean_sgs_tke) + generate_sweep(ctx, "TurbulentChannel_Welford_TKE_SGS", tke_welford_update, target=target) + + # subgrid TKE output + @ps.kernel + def tke_sgs_writer(): + f_neq = sp.Matrix(pdfs.center_vector) - lbm_method.get_equilibrium_terms() + rho = lbm_method.conserved_quantity_computation.density_symbol + strain_rate = frobenius_norm(-3 * omega_field.center / (2 * rho) * second_order_moment_tensor(f_neq, lbm_method.stencil)) + eddy_viscosity = lattice_viscosity_from_relaxation_rate(omega_field.center) - lattice_viscosity_from_relaxation_rate(omega) + + sgs_tke.center @= (eddy_viscosity * strain_rate**2)**(2.0/3.0) + + tke_sgs_ac = ps.AssignmentCollection( + [lbm_method.conserved_quantity_computation.equilibrium_input_equations_from_pdfs(pdfs.center_vector), + *tke_sgs_writer] + ) + generate_sweep(ctx, "TurbulentChannel_TKE_SGS_Writer", tke_sgs_ac) + + # Boundary conditions + nu = lattice_viscosity_from_relaxation_rate(omega) + u_tau_target = sp.Symbol("target_u_tau") + + noslip = NoSlip() + freeslip_top = FreeSlip(stencil, normal_direction=normal_direction_top) + wfb_top = WallFunctionBounce(lbm_method, pdfs, normal_direction=normal_direction_top, + wall_function_model=SpaldingsLaw(viscosity=nu, + kappa=0.41, b=5.5, newton_steps=5), + mean_velocity=mean_velocity, data_type=data_type, + target_friction_velocity=u_tau_target) + wfb_bottom = WallFunctionBounce(lbm_method, pdfs, normal_direction=normal_direction_bottom, + wall_function_model=SpaldingsLaw(viscosity=nu, + kappa=0.41, b=5.5, newton_steps=5), + mean_velocity=mean_velocity, data_type=data_type, + target_friction_velocity=u_tau_target) + + generate_boundary(ctx, "TurbulentChannel_NoSlip", noslip, lbm_method, target=target) + generate_boundary(ctx, "TurbulentChannel_FreeSlip_top", freeslip_top, lbm_method, target=target) + generate_boundary(ctx, "TurbulentChannel_WFB_bottom", wfb_bottom, lbm_method, target=target) + generate_boundary(ctx, "TurbulentChannel_WFB_top", wfb_top, lbm_method, target=target) + + info_header_params = { + 'layout': layout, + 'd': stencil.D, + 'q': stencil.Q, + 'flow_axis': flow_axis, + 'wall_axis': wall_axis + } + + ctx.write_file("CodegenIncludes.h", info_header.format(**info_header_params)) diff --git a/apps/benchmarks/UniformGridCPU/UniformGridCPU.py b/apps/benchmarks/UniformGridCPU/UniformGridCPU.py index ae9ec4f1bd6e26a8474099cd6f03d4c40f114854..5a600eade461c5698c35487ce6aca8a78207aa63 100644 --- a/apps/benchmarks/UniformGridCPU/UniformGridCPU.py +++ b/apps/benchmarks/UniformGridCPU/UniformGridCPU.py @@ -10,7 +10,7 @@ from lbmpy.advanced_streaming import is_inplace from lbmpy.advanced_streaming.utility import streaming_patterns, get_accessor, Timestep from lbmpy.boundaries import NoSlip, UBB from lbmpy.creationfunctions import LBMConfig, LBMOptimisation, LBStencil, create_lb_collision_rule -from lbmpy.enums import Method, Stencil +from lbmpy.enums import Method, Stencil, SubgridScaleModel from lbmpy.fieldaccess import CollideOnlyInplaceAccessor from lbmpy.moments import get_default_moment_set_for_stencil from lbmpy.updatekernels import create_stream_only_kernel @@ -73,7 +73,7 @@ options_dict = { }, 'smagorinsky': { 'method': Method.SRT, - 'smagorinsky': False, + 'subgrid_scale_model': SubgridScaleModel.SMAGORINSKY, 'relaxation_rate': omega, } } @@ -152,7 +152,8 @@ with CodeGeneration() as ctx: lbm_config=lbm_config, lbm_optimisation=lbm_opt, nonuniform=False, boundaries=[no_slip, ubb], macroscopic_fields=macroscopic_fields, - cpu_openmp=openmp, cpu_vectorize_info=cpu_vec) + cpu_openmp=openmp, cpu_vectorize_info=cpu_vec, + set_pre_collision_pdfs=False) # Stream only kernel generate_sweep(ctx, 'UniformGridCPU_StreamOnlyKernel', stream_only_kernel, diff --git a/apps/benchmarks/UniformGridGPU/UniformGridGPU.py b/apps/benchmarks/UniformGridGPU/UniformGridGPU.py index 3d7579e5bcb3f3713f59a9afd94d7fed790c21e9..09235c4340a0b0946f72c513a219bca3c28dd724 100644 --- a/apps/benchmarks/UniformGridGPU/UniformGridGPU.py +++ b/apps/benchmarks/UniformGridGPU/UniformGridGPU.py @@ -8,6 +8,7 @@ from pystencils.typing import TypedSymbol from pystencils.fast_approximation import insert_fast_sqrts, insert_fast_divisions from lbmpy import LBMConfig, LBMOptimisation, LBStencil, Method, Stencil +from lbmpy.enums import SubgridScaleModel from lbmpy.advanced_streaming import is_inplace from lbmpy.advanced_streaming.utility import streaming_patterns from lbmpy.boundaries import NoSlip, UBB @@ -84,7 +85,7 @@ options_dict = { }, 'smagorinsky': { 'method': Method.SRT, - 'smagorinsky': False, + 'subgrid_scale_model': SubgridScaleModel.SMAGORINSKY, 'relaxation_rate': omega, } } @@ -168,7 +169,7 @@ with CodeGeneration() as ctx: nonuniform=False, boundaries=[no_slip, ubb], macroscopic_fields=macroscopic_fields, target=ps.Target.GPU, gpu_indexing_params=gpu_indexing_params, - max_threads=max_threads) + max_threads=max_threads, set_pre_collision_pdfs=False) # Stream only kernel vp = [('int32_t', 'cudaBlockSize0'), ('int32_t', 'cudaBlockSize1'), ('int32_t', 'cudaBlockSize2')] diff --git a/apps/benchmarks/UniformGridGPU/old_ideas/UniformGridGPU.py b/apps/benchmarks/UniformGridGPU/old_ideas/UniformGridGPU.py index 619c9fbfce1bea16a3008ce3efd4d136a63656f8..a855b9d211378d326fa5c7734e88e36e59141e2b 100644 --- a/apps/benchmarks/UniformGridGPU/old_ideas/UniformGridGPU.py +++ b/apps/benchmarks/UniformGridGPU/old_ideas/UniformGridGPU.py @@ -1,6 +1,7 @@ import sympy as sp import numpy as np import pystencils as ps +from lbmpy.enums import Method, Stencil, SubgridScaleModel from lbmpy.creationfunctions import create_lb_method, create_lb_update_rule, create_lb_collision_rule from lbmpy.boundaries import NoSlip, UBB from lbmpy.fieldaccess import StreamPullTwoFieldsAccessor @@ -65,7 +66,7 @@ options_dict = { 'smagorinsky': { 'method': 'srt', 'stencil': 'D3Q19', - 'smagorinsky': True, + 'subgrid_scale_model': SubgridScaleModel.SMAGORINSKY, 'relaxation_rate': omega, }, 'cumulant': { diff --git a/apps/tutorials/basics/01_BlocksAndFields.dox b/apps/tutorials/basics/01_BlocksAndFields.dox index 944c64cb50331323490d89a6ccb266418fd8de5b..4feaf75a4ed7f104ad0f37514bddbe5b0d0a5c1a 100644 --- a/apps/tutorials/basics/01_BlocksAndFields.dox +++ b/apps/tutorials/basics/01_BlocksAndFields.dox @@ -6,7 +6,7 @@ namespace walberla { \brief Introduction to block structure and field. This tutorial walks you through the process of creating a simple waLBerla application. -The source file of this tutorial can be found in apps/tutorials/01_BlocksAndFields.cpp. +The source file of this tutorial can be found in `apps/tutorials/01_BlocksAndFields.cpp`. To compile and run this example, go to your build directory into `apps/tutorials` type `make` and run the generated executable. @@ -153,7 +153,7 @@ Using this setup mechanism, waLBerla does not enforce that the fields have the s Remember: For waLBerla, a block is just a container for arbitrary data - and a field is just an "arbitrary" data item stored on each block. Block data does not have to be any waLBerla data structure. It is possible to store any type of data on a block, -so instead of using the field class, we could, for example, have used a std::vector<std::vector<double> > to store our lattice. +so instead of using the field class, we could, for example, have used a `std::vector<std::vector<double>>` to store our lattice. The callback function can now be registered at the block storage with the following piece of code: @@ -171,7 +171,7 @@ dock widget can then be used to display slices of the field. \image html tutorial_basics01_field.jpeg -The next tutorial contains the writing of algorithms operating on block data: \ref tutorial02 +The next tutorial contains the writing of algorithms operating on block data: \ref tutorial_basics_02 \tableofcontents diff --git a/apps/tutorials/gpu/01_GameOfLife_cuda.dox b/apps/tutorials/gpu/01_GameOfLife_cuda.dox index 8794e6c520ffb31d2c3653622cb2f4b4ba4b6eda..0c811bea939f122291cb46962f9087f64c4c62f1 100644 --- a/apps/tutorials/gpu/01_GameOfLife_cuda.dox +++ b/apps/tutorials/gpu/01_GameOfLife_cuda.dox @@ -37,9 +37,9 @@ auto hostFieldAllocator = make_shared< gpu::HostFieldAllocator<real_t> >(); BlockDataID const cpuFieldID =field::addToStorage< ScalarField >(blocks, "CPU Field", real_c(0.0), field::fzyx, uint_c(1), hostFieldAllocator); \endcode -Now we initialize the CPU field just like in the previous tutorial \ref tutorial_basics03 . +Now we initialize the CPU field just like in the previous tutorial \ref tutorial_basics_03 . Then two GPU fields are created: "source" and "destination" field. The helper function -gpu::addGPUFieldToStorage() creates a gpu::GPUField field of the same size and layout of the given +\ref gpu::addGPUFieldToStorage() creates a \ref gpu::GPUField field of the same size and layout of the given CPU field: \code BlockDataID gpuFieldSrcID = gpu::addGPUFieldToStorage<ScalarField>( blocks, cpuFieldID, "GPU Field Src" ); @@ -118,10 +118,10 @@ Note that copying data is costly and thus we don't want to do this in every time \section gpu01_comm Communication -For this tutorial we use the gpu::communication::UniformGPUScheme that first collects all data in a buffer and -sends only one message per communication step and neighbor. For the PackInfo we use the MemcpyPackInfo. It receives -a buffer located on the GPU and fills it using memcpy operations -If the GPU library is build with MPI support this buffer can be send to other GPUs without a copy to the CPU. +For this tutorial we use the \ref gpu::communication::UniformGPUScheme that first collects all data in a buffer and +sends only one message per communication step and neighbor. For the `PackInfo` we use the \ref gpu::communication::MemcpyPackInfo. +It receives a buffer located on the GPU and fills it using memcpy operations. +If the GPU library is built with MPI support this buffer can be sent to other GPUs without a copy to the CPU. Otherwise the copying will be done in the back by the communication class. \code diff --git a/apps/tutorials/lbm/06_LBBoundaryCondition.cpp b/apps/tutorials/lbm/06_LBBoundaryCondition.cpp index ae6f612cbb070298a16d0329d258d6256a217756..8d095d222eda3a4e3822ae147d74d020b214ad6f 100644 --- a/apps/tutorials/lbm/06_LBBoundaryCondition.cpp +++ b/apps/tutorials/lbm/06_LBBoundaryCondition.cpp @@ -268,8 +268,9 @@ BoundaryHandling_T* MyBoundaryHandling::operator()(IBlock* const block, else if (setup_.inflowType == "ParserUBB") { //! [forceBoundary_ParserUBB_eqs] - char x_eq[150]; - sprintf(x_eq, "0.1*4/%f/%f * y * (%f - y) * 0.5 * (1 - cos(2 * 3.1415926538 * t / %f));", H, H, H, setup_.period); + const uint_t maxSize = 150; + char x_eq[maxSize]; + snprintf(x_eq, maxSize, "0.1*4/%f/%f * y * (%f - y) * 0.5 * (1 - cos(2 * 3.1415926538 * t / %f));", H, H, H, setup_.period); std::array< std::string, 3 > eqs = { x_eq, "0", "0" }; handling->forceBoundary(ParserUBBFlagUID, west, ParserUBB_T::Parser(eqs)); diff --git a/cmake/waLBerlaFunctions.cmake b/cmake/waLBerlaFunctions.cmake index e5914ed760b6928d641ef3620a9ee5bef38793b2..cd0796d2bfe589a01f408d4124a90d34f9cfbf19 100644 --- a/cmake/waLBerlaFunctions.cmake +++ b/cmake/waLBerlaFunctions.cmake @@ -39,7 +39,7 @@ function ( waLBerla_add_module ) set( ALL_DEPENDENCIES ${ARG_DEPENDS} ${ARG_OPTIONAL_DEPENDS}) # Module name is the directory relative to WALBERLA_MODULE_DIRS - get_current_module_name ( moduleName ) + get_current_module_name ( ) get_module_library_name ( moduleLibraryName ${moduleName} ) # Test if all required libraries are available @@ -234,7 +234,7 @@ function ( waLBerla_compile_test ) cmake_parse_arguments( ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) # Module name is the directory relative to WALBERLA_MODULE_DIRS - get_current_module_name ( moduleName ) + get_current_module_name ( ) # Filename of first source file is used as name for testcase if no name was given if( NOT ARG_NAME ) @@ -365,7 +365,7 @@ function ( waLBerla_execute_test ) if( ARG_NO_MODULE_LABEL ) set_tests_properties ( ${ARG_NAME} PROPERTIES LABELS "${ARG_LABELS}" ) else() - get_current_module_name ( moduleName ) + get_current_module_name ( ) set_tests_properties ( ${ARG_NAME} PROPERTIES LABELS "${moduleName} ${ARG_LABELS}" ) endif() diff --git a/cmake/waLBerlaModuleDependencySystem.cmake b/cmake/waLBerlaModuleDependencySystem.cmake index 88e0df42efdec6ff7fd2e793a8fb3a135b1bc7dd..fc3ad4f7e8f6979fb867f0e9fea4f8fbe25194ba 100644 --- a/cmake/waLBerlaModuleDependencySystem.cmake +++ b/cmake/waLBerlaModuleDependencySystem.cmake @@ -46,20 +46,19 @@ # Determine Module name using the current folder # # moduleFolder is the current source directory relative to a folder in WALBERLA_MODULE_DIRS -# If more arguments are given, these are prepended to WALBERLA_MODULE_DIR +# The variable moduleName will be set in PARENT_SCOPE and is the first folder in WALBERLA_MODULE_DIRS # Example: # If CMAKE_CURRENT_SOURCE_DIR is /src/core/field and /src/ is an element in WALBERLA_MODULE_DIRS, -# then module name is "core/field" +# then moduleName is "core" # ####################################################################################################################### -function ( get_current_module_name moduleNameOut ) +function ( get_current_module_name ) foreach( moduleDir ${ARGN} ${WALBERLA_MODULE_DIRS} ) file( RELATIVE_PATH moduleFolder ${moduleDir} ${CMAKE_CURRENT_SOURCE_DIR} ) if ( NOT ${moduleFolder} MATCHES "\\.\\./.*" ) #append / to make cmake_path also work with one directory only - set( moduleFolder "${moduleFolder}/" ) - cmake_path(GET moduleFolder PARENT_PATH moduleNameOut) + string(REGEX REPLACE "(.*)/.*" "\\1" moduleNameOut ${moduleFolder}) set(moduleName ${moduleNameOut} PARENT_SCOPE) return() endif() diff --git a/python/lbmpy_walberla/sweep_collection.py b/python/lbmpy_walberla/sweep_collection.py index 5fe4892ab3bc9740f3ca04775363586b42134e96..bc8bdda49dcb88f897f7fa1ce23c9a9b101660a3 100644 --- a/python/lbmpy_walberla/sweep_collection.py +++ b/python/lbmpy_walberla/sweep_collection.py @@ -28,7 +28,7 @@ def generate_lbm_sweep_collection(ctx, class_name: str, collision_rule: LbmColli lbm_config: LBMConfig, lbm_optimisation: LBMOptimisation, refinement_scaling=None, macroscopic_fields: Dict[str, Field] = None, target=Target.CPU, data_type=None, cpu_openmp=None, cpu_vectorize_info=None, - max_threads=None, + max_threads=None, set_pre_collision_pdfs=True, **create_kernel_params): config = config_from_context(ctx, target=target, data_type=data_type, @@ -76,7 +76,7 @@ def generate_lbm_sweep_collection(ctx, class_name: str, collision_rule: LbmColli config_unoptimized = replace(config, cpu_vectorize_info=None, cpu_prepend_optimizations=[], cpu_blocking=None) setter_family = get_setter_family(class_name, lb_method, src_field, streaming_pattern, macroscopic_fields, - config_unoptimized) + config_unoptimized, set_pre_collision_pdfs) setter_generator = kernel_family_function_generator('initialise', setter_family, namespace='lbm', max_threads=max_threads) function_generators.append(setter_generator) @@ -167,7 +167,8 @@ def lbm_kernel_family(class_name, kernel_name, return family -def get_setter_family(class_name, lb_method, pdfs, streaming_pattern, macroscopic_fields, config: CreateKernelConfig): +def get_setter_family(class_name, lb_method, pdfs, streaming_pattern, macroscopic_fields, + config: CreateKernelConfig, set_pre_collision_pdfs: bool): dim = lb_method.stencil.D density = macroscopic_fields.get('density', 1.0) velocity = macroscopic_fields.get('velocity', [0.0] * dim) @@ -184,7 +185,8 @@ def get_setter_family(class_name, lb_method, pdfs, streaming_pattern, macroscopi timestep_suffix = str(timestep) setter = macroscopic_values_setter(lb_method, density=density, velocity=velocity, pdfs=pdfs, - streaming_pattern=streaming_pattern, previous_timestep=timestep) + streaming_pattern=streaming_pattern, previous_timestep=timestep, + set_pre_collision_pdfs=set_pre_collision_pdfs) if default_dtype != pdfs.dtype: setter = add_subexpressions_for_field_reads(setter, data_type=default_dtype) @@ -198,7 +200,8 @@ def get_setter_family(class_name, lb_method, pdfs, streaming_pattern, macroscopi timestep = Timestep.BOTH setter = macroscopic_values_setter(lb_method, density=density, velocity=velocity, pdfs=pdfs, - streaming_pattern=streaming_pattern, previous_timestep=timestep) + streaming_pattern=streaming_pattern, previous_timestep=timestep, + set_pre_collision_pdfs=set_pre_collision_pdfs) setter_ast = create_kernel(setter, config=config) setter_ast.function_name = 'kernel_initialise' diff --git a/python/lbmpy_walberla/templates/BoundaryCollection.tmpl.h b/python/lbmpy_walberla/templates/BoundaryCollection.tmpl.h index ea4e7dd48c6786a4f804e346a71b377fb9a2da47..453f78e093a5087bd80a3bf37dd1b20300558f3a 100644 --- a/python/lbmpy_walberla/templates/BoundaryCollection.tmpl.h +++ b/python/lbmpy_walberla/templates/BoundaryCollection.tmpl.h @@ -46,7 +46,7 @@ class {{class_name}} { {% for object_name, boundary_class, kernel, additional_data_handler in zip(object_names, boundary_classes, kernel_list, additional_data_handlers) -%} - {{object_name}} = std::make_shared< {{boundary_class}} >({{- ["blocks", "pdfsID", [kernel|generate_function_collection_call(['indexVector', 'indexVectorSize', 'pdfs', 'timestep', 'gpuStream'], use_field_ids=True)], additional_data_handler.constructor_argument_name] | type_identifier_list -}}); + {{object_name}} = std::make_shared< {{boundary_class}} >({{- ["blocks", [kernel|generate_function_collection_call(['indexVector', 'indexVectorSize', 'timestep', 'gpuStream'], use_field_ids=True)], additional_data_handler.constructor_argument_name] | type_identifier_list -}}); {% endfor %} {% for object_name, flag_uid in zip(object_names, flag_uids) -%} diff --git a/python/lbmpy_walberla/walberla_lbm_package.py b/python/lbmpy_walberla/walberla_lbm_package.py index 80b37a4a90f717e79ea60890a802a363c45dde52..ea583181f6c4165863d68a703acd341c8c41d71e 100644 --- a/python/lbmpy_walberla/walberla_lbm_package.py +++ b/python/lbmpy_walberla/walberla_lbm_package.py @@ -20,7 +20,7 @@ def generate_lbm_package(ctx: CodeGenerationContext, name: str, target: Target = Target.CPU, data_type=None, pdfs_data_type=None, cpu_openmp=None, cpu_vectorize_info=None, - max_threads=None, + max_threads=None, set_pre_collision_pdfs=True, **kernel_parameters): if macroscopic_fields is None: @@ -48,6 +48,7 @@ def generate_lbm_package(ctx: CodeGenerationContext, name: str, target=target, data_type=data_type, cpu_openmp=cpu_openmp, cpu_vectorize_info=cpu_vectorize_info, max_threads=max_threads, + set_pre_collision_pdfs=set_pre_collision_pdfs, **kernel_parameters) spatial_shape = None diff --git a/src/blockforest/communication/NonUniformPackInfo.h b/src/blockforest/communication/NonUniformPackInfo.h index 73c3f760fbfb54b3af1be35fdd2d633e3495269e..cd9b20725d6816e4ba21c51b49dbf1f3d091e086 100644 --- a/src/blockforest/communication/NonUniformPackInfo.h +++ b/src/blockforest/communication/NonUniformPackInfo.h @@ -52,28 +52,28 @@ public: /** * Should return true if the amount of data that is packed for a given block in direction * "dir" is guaranteed to remain constant over time. False otherwise. - * If you are not sure what to return, return false! Returning false is always save. + * If you are not sure what to return, return false! Returning false is always safe. * Falsely return true will lead to errors! However, if the data can be guaranteed to remain * constant over time, returning true enables performance optimizations during the communication. */ virtual bool constantDataExchange() const = 0; /** - * Must return false if calling unpackData and/or communicateLocal is not thread-safe. + * Must return false if calling `unpackData*()` and/or `communicateLocal*()` methods is not thread-safe. * True otherwise. - * If you are not sure what to return, return false! Returning false is always save. - * Falsely return true will most likely lead to errors! However, if both unpackData AND - * communicateLocal are thread-safe, returning true can lead to performance improvements. + * If you are not sure what to return, return false! Returning false is always safe. + * Falsely return true will most likely lead to errors! However, if both `unpackData*()` AND + * `communicateLocal*()` are thread-safe, returning true can lead to performance improvements. */ virtual bool threadsafeReceiving() const = 0; - /// Must be thread-safe! Calls packDataImpl. + /// Must be thread-safe! Calls \ref packDataEqualLevelImpl. inline void packDataEqualLevel( const Block * sender, stencil::Direction dir, mpi::SendBuffer & buffer ) const; - /// If NOT thread-safe, threadsafeReceiving must return false! + /// If NOT thread-safe, \ref threadsafeReceiving must return false! virtual void unpackDataEqualLevel( Block * receiver, stencil::Direction dir, mpi::RecvBuffer & buffer ) = 0; - /// If NOT thread-safe, threadsafeReceiving must return false! + /// If NOT thread-safe, \ref threadsafeReceiving must return false! virtual void communicateLocalEqualLevel( const Block * sender, Block * receiver, stencil::Direction dir ) = 0; inline void packDataCoarseToFine ( const Block * coarseSender, const BlockID & fineReceiver, stencil::Direction dir, mpi::SendBuffer & buffer ) const; diff --git a/src/blockforest/communication/UniformToNonUniformPackInfoAdapter.h b/src/blockforest/communication/UniformToNonUniformPackInfoAdapter.h index c9c6b895c47977aaadd7ae2d5f9640051a5a83e9..f0e5838b4f8879019d2ede96538db39dc6182860 100644 --- a/src/blockforest/communication/UniformToNonUniformPackInfoAdapter.h +++ b/src/blockforest/communication/UniformToNonUniformPackInfoAdapter.h @@ -32,7 +32,7 @@ namespace communication { //******************************************************************************************************************* /*! - * Adapter to use a UniformPackInfo in a NonUniformBufferedScheme. No communication between coarse <-> fine blocks + * Adapter to use a \ref communication::UniformPackInfo in a \ref NonUniformBufferedScheme. No communication between coarse <-> fine blocks * happens. */ //******************************************************************************************************************* @@ -51,25 +51,25 @@ public: /** * Should return true if the amount of data that is packed for a given block in direction * "dir" is guaranteed to remain constant over time. False otherwise. - * If you are not sure what to return, return false! Returning false is always save. + * If you are not sure what to return, return false! Returning false is always safe. * Falsely return true will lead to errors! However, if the data can be guaranteed to remain * constant over time, returning true enables performance optimizations during the communication. */ virtual bool constantDataExchange() const { return uniformPackInfo_->constantDataExchange(); } /** - * Must return false if calling unpackData and/or communicateLocal is not thread-safe. + * Must return false if calling `unpackData*()` and/or `communicateLocal*()` methods is not thread-safe. * True otherwise. - * If you are not sure what to return, return false! Returning false is always save. - * Falsely return true will most likely lead to errors! However, if both unpackData AND - * communicateLocal are thread-safe, returning true can lead to performance improvements. + * If you are not sure what to return, return false! Returning false is always safe. + * Falsely return true will most likely lead to errors! However, if both `unpackData*()` AND + * `communicateLocal*()` are thread-safe, returning true can lead to performance improvements. */ virtual bool threadsafeReceiving() const { return uniformPackInfo_->threadsafeReceiving(); } - /// If NOT thread-safe, threadsafeReceiving must return false! + /// If NOT thread-safe, \ref threadsafeReceiving must return false! virtual void unpackDataEqualLevel( Block * receiver, stencil::Direction dir, mpi::RecvBuffer & buffer ) { uniformPackInfo_->unpackData( receiver, dir, buffer ); } - /// If NOT thread-safe, threadsafeReceiving must return false! + /// If NOT thread-safe, \ref threadsafeReceiving must return false! virtual void communicateLocalEqualLevel( const Block * sender, Block * receiver, stencil::Direction dir ) { uniformPackInfo_->communicateLocal( sender, receiver, dir ); } virtual void unpackDataCoarseToFine( Block * /*fineReceiver*/, const BlockID & /*coarseSender*/, stencil::Direction /*dir*/, mpi::RecvBuffer & /*buffer*/ ) { } diff --git a/src/communication/UniformPackInfo.h b/src/communication/UniformPackInfo.h index aa110f9bdf5c51b37a57572cfbc800b004ab37b6..168ce9685473619a897e0ebb85677a7f10f66cee 100644 --- a/src/communication/UniformPackInfo.h +++ b/src/communication/UniformPackInfo.h @@ -35,18 +35,21 @@ namespace communication { /** - * \brief UniformPackInfo encapsulates information on how to extract data from blocks, - * that should be communicated (see packData() ) to neighboring blocks - * and how to inject this data in a receiving block (see unpackData() ) + * \brief Data packing/unpacking for ghost layer based communication of a field. * - * Another special method exists for communication between two blocks, - * which are allocated on the same - * process. In this case the data does not have be communicated via a buffer, + * Encapsulate information on how to extract data from blocks that should be + * communicated to neighboring blocks (see \ref packData()) + * and how to inject this data in a receiving block (see \ref unpackData()). + * This involves a memory buffer and two memory copy operations. + * + * A special method exists for communication between two blocks which are + * allocated on the same process (see \ref communicateLocal()). + * In this case the data does not have be communicated via a buffer, * but can be copied directly. * * Data that is packed in direction "dir" at one block is unpacked in * direction "stencil::inverseDir[dir]" at the neighboring block. This - * behavior must be implemented in "communicateLocal"! + * behavior must be implemented in \ref communicateLocal()! * * \ingroup communication */ @@ -65,23 +68,25 @@ public: /** * Should return true if the amount of data that is packed for a given block in direction * "dir" is guaranteed to remain constant over time. False otherwise. - * If you are not sure what to return, return false! Returning false is always save. - * Falsely return true will lead to errors! However, if the data can be guaranteed to remain + * If you are not sure what to return, return false! Returning false is always safe. + * Falsely returning true will lead to errors! However, if the data can be guaranteed to remain * constant over time, returning true enables performance optimizations during the communication. */ virtual bool constantDataExchange() const = 0; /** - * Must return false if calling unpackData and/or communicateLocal is not thread-safe. + * Must return false if calling \ref unpackData and/or \ref communicateLocal is not thread-safe. * True otherwise. - * If you are not sure what to return, return false! Returning false is always save. - * Falsely return true will most likely lead to errors! However, if both unpackData AND - * communicateLocal are thread-safe, returning true can lead to performance improvements. + * If you are not sure what to return, return false! Returning false is always safe. + * Falsely returning true will most likely lead to errors! However, if both \ref unpackData AND + * \ref communicateLocal are thread-safe, returning true can lead to performance improvements. */ virtual bool threadsafeReceiving() const = 0; /** - * Packs data from a block into a send buffer. Must be thread-safe! Calls packDataImpl. + * \brief Pack data from a block into a send buffer. + * + * Must be thread-safe! Calls \ref packDataImpl. * * @param sender the block whose data should be packed into a buffer * @param dir pack data for neighbor in this direction @@ -91,19 +96,21 @@ public: inline void packData( const IBlock * sender, stencil::Direction dir, mpi::SendBuffer & buffer ) const; /** - * Unpacks received Data. - * If NOT thread-safe, threadsafeReceiving must return false! + * \brief Unpack received Data. + * + * If NOT thread-safe, \ref threadsafeReceiving must return false! * * @param receiver the block where the unpacked data should be stored into * @param dir receive data from neighbor in this direction - * @param buffer + * @param buffer buffer for reading the data from */ virtual void unpackData( IBlock * receiver, stencil::Direction dir, mpi::RecvBuffer & buffer ) = 0; /** - * Function to copy data from one local block to another local block. + * \brief Copy data from one local block to another local block. + * * Both blocks are allocated on the current process. - * If NOT thread-safe, threadsafeReceiving must return false! + * If NOT thread-safe, \ref threadsafeReceiving must return false! * * @param sender id of block where the data should be copied from * @param receiver id of block where the data should be copied to @@ -134,7 +141,9 @@ public: protected: /** - * Packs data from a block into a send buffer. Must be thread-safe! + * \brief Pack data from a block into a send buffer. + * + * Must be thread-safe! * * @param sender the block whose data should be packed into a buffer * @param dir pack data for neighbor in this direction diff --git a/src/field/Field.h b/src/field/Field.h index 9a8e33c3ae9ba9aabec6c0f67f6503dbf6990c3b..30fe15586846f09c540f12cf309c36eb05135e05 100644 --- a/src/field/Field.h +++ b/src/field/Field.h @@ -262,7 +262,8 @@ namespace field { cell_idx_t yOff() const { return yOff_; } cell_idx_t zOff() const { return zOff_; } - bool coordinatesValid( cell_idx_t x, cell_idx_t y, cell_idx_t z, cell_idx_t f ) const; + bool coordinatesValid( cell_idx_t x, cell_idx_t y, cell_idx_t z, cell_idx_t f = 0 ) const; + bool coordinatesValid( const Cell & c, cell_idx_t f = 0 ) const { return coordinatesValid(c[0], c[1], c[2], f); }; //@} //**************************************************************************************************************** diff --git a/src/gpu/FieldAccessor.h b/src/gpu/FieldAccessor.h index fc1214e081c0822fdc1370ad9e69f44c2e986594..d737983d1aa5f289d624cd508eea8a7969a5fe69 100644 --- a/src/gpu/FieldAccessor.h +++ b/src/gpu/FieldAccessor.h @@ -31,6 +31,13 @@ namespace gpu + /** + * \brief Handle to the underlying device data of a \ref GPUField. + * + * Encapsulate the device memory pointer and offsets necessary + * to calculate the address of a cell from a GPU kernel's thread + * coordinates in the thread block. + */ template<typename T> class FieldAccessor { diff --git a/src/gpu/FieldIndexing.h b/src/gpu/FieldIndexing.h index 51b337e61237690ddc5163113abeb47ee44691b1..a06c95087898b3c705548311a7d9810e63519e78 100644 --- a/src/gpu/FieldIndexing.h +++ b/src/gpu/FieldIndexing.h @@ -44,6 +44,14 @@ namespace gpu template< typename T > class GPUField; +/** + * \brief Utility class to generate handles to the underlying device data of a \ref GPUField. + * + * Pre-calculate memory offsets of a \ref GPUField for a given slice, + * cell interval, or the entire grid with or without the ghost layer, + * and store them in a \ref FieldAccessor handle. + * That handle is obtained by calling \ref gpuAccess(). + */ template< typename T > class FieldIndexing { diff --git a/src/gpu/GPUField.h b/src/gpu/GPUField.h index f8a0242ed3aa5e9de3606d8ff1737b4fe869f42f..7d004c76203060c5fb77c350f306007a091ca0c9 100755 --- a/src/gpu/GPUField.h +++ b/src/gpu/GPUField.h @@ -45,16 +45,20 @@ namespace gpu * Basically a wrapper around a CUDA/HIP device pointer together with size information about the field * i.e. sizes in x,y,z,f directions and number of ghost layers. * - * Internally represented by a gpuPitchedPtr which is allocated with gpuMalloc3D to take padding of the - * innermost coordinate into account. + * Internally represented by a \c gpuPitchedPtr which is allocated with extra padding for the + * innermost coordinate. + * Pitched memory is a type of non-linear memory where padding is introduced + * to optimize data alignment and thus reduce data access latency, + * for example by avoiding shared memory bank conflicts. * * Supports Array-of-Structures (AoS,zyxf) layout and Structure-of-Arrays (SoA, fzyx) layout, in a similar way - * to field::Field + * to \ref field::Field * - * To work with the GPUField look at the gpu::fieldCpy functions to transfer a field::Field to a gpu::GPUField + * To work with the \ref gpu::GPUField look at the \ref gpu::fieldCpy functions to transfer a \ref field::Field to a \ref gpu::GPUField * and vice versa. - * When writing device kernels for GPUFields have a look at the FieldIndexing and FieldAccessor concepts. - * These simplify the "iteration" i.e. indexing of cells in GPUFields. + * + * When writing device kernels for a \ref GPUField, have a look at the \ref FieldIndexing and \ref FieldAccessor concepts. + * These simplify the "iteration" i.e. indexing of cells in a \ref GPUField. */ //******************************************************************************************************************* template<typename T> diff --git a/src/gpu/GPURAII.h b/src/gpu/GPURAII.h index 815b3829114506a8c601669aa4195461bd60151a..6bcfd7811b4e68f591f3dfe2597111139ec9906f 100644 --- a/src/gpu/GPURAII.h +++ b/src/gpu/GPURAII.h @@ -13,7 +13,7 @@ // You should have received a copy of the GNU General Public License along // with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file CudaRAII.h +//! \file GPURAII.h //! \ingroup gpu //! \author Martin Bauer <martin.bauer@fau.de> // diff --git a/src/gpu/communication/GPUPackInfo.h b/src/gpu/communication/GPUPackInfo.h index c34600f29b2219088c29b0d5ff2e9fb1dc4a1142..f700c372924a310e3ba816164692b1b6650c13d5 100644 --- a/src/gpu/communication/GPUPackInfo.h +++ b/src/gpu/communication/GPUPackInfo.h @@ -47,10 +47,28 @@ namespace walberla::gpu::communication { /** - * Data packing/unpacking for ghost layer based communication of a gpu::GPUField + * \brief Data packing/unpacking for ghost layer based communication of a \ref GPUField. + * + * Encapsulate information on how to extract data from blocks that should be + * communicated to neighboring blocks (see \ref packDataImpl()) + * and how to inject this data in a receiving block (see \ref unpackData()). + * This involves a host memory buffer and two device-to-host memory copy operations. + * + * A special method exists for communication between two blocks which are + * allocated on the same process (see \ref communicateLocal()). + * In this case the data does not have be communicated via a host buffer, + * but can be sent directly. This involves a single device-to-device memory + * copy operation. + * + * Data that is packed in direction "dir" at one block is unpacked in + * direction "stencil::inverseDir[dir]" at the neighboring block. + * This behavior must be implemented in \ref communicateLocal()! + * + * See \ref MemcpyPackInfo for a more efficient packing/unpacking method + * where the buffer is stored in device memory rather than in host memory. + * * \ingroup gpu - * Template Parameters: - * - GPUField_T A fully qualified GPUField. + * \tparam GPUField_T A fully qualified \ref GPUField. */ template<typename GPUField_T> class GPUPackInfo : public walberla::communication::UniformPackInfo diff --git a/src/gpu/communication/GeneratedGPUPackInfo.h b/src/gpu/communication/GeneratedGPUPackInfo.h index f5f6c98b60b529045a1877a435fcacacb9359a95..4b905ad63fa8aca23006d8b5ac2a2a09ab30078a 100644 --- a/src/gpu/communication/GeneratedGPUPackInfo.h +++ b/src/gpu/communication/GeneratedGPUPackInfo.h @@ -28,14 +28,59 @@ namespace walberla::gpu { +/** + * \brief Data packing/unpacking for ghost layer based communication of a \ref GPUField. + * + * Encapsulate information on how to extract data from blocks that should be + * communicated to neighboring blocks (see \ref pack()) + * and how to inject this data in a receiving block (see \ref unpack()). + * This involves a memory buffer and two memory copy operations. + * + * A special method exists for communication between two blocks which are + * allocated on the same process (see \ref communicateLocal()). + * In this case the data does not have be communicated via a buffer, + * but can be copied directly. + * + * Data that is packed in direction "dir" at one block is unpacked in + * direction "stencil::inverseDir[dir]" at the neighboring block. This + * behavior must be implemented in \ref communicateLocal()! + * + * \ingroup gpu + */ class GeneratedGPUPackInfo { public: GeneratedGPUPackInfo() = default; virtual ~GeneratedGPUPackInfo() = default; + /** + * \brief Pack data from a block into a send buffer. + * + * \param dir pack data for neighbor in this direction + * \param buffer buffer for writing the data into + * \param block the block whose data should be packed into a buffer + * \param stream GPU stream + */ virtual void pack ( stencil::Direction dir, unsigned char *buffer, IBlock *block, gpuStream_t stream ) = 0; + /** + * \brief Copy data from one local block to another local block. + * + * Both blocks are allocated on the same MPI rank. + * + * \param dir the direction of the communication (from sender to receiver) + * \param sender id of block where the data should be copied from + * \param receiver id of block where the data should be copied to + * \param stream GPU stream + */ virtual void communicateLocal ( stencil::Direction dir, const IBlock *sender, IBlock *receiver, gpuStream_t stream ) = 0; + /** + * \brief Unpack data from a receive buffer into a block. + * + * \param dir receive data from neighbor in this direction + * \param buffer buffer for reading the data from + * \param block the block where the unpacked data should be stored into + * \param stream GPU stream + */ virtual void unpack( stencil::Direction dir, unsigned char *buffer, IBlock *block, gpuStream_t stream ) = 0; virtual uint_t size( stencil::Direction dir, IBlock *block ) = 0; }; diff --git a/src/gpu/communication/MemcpyPackInfo.h b/src/gpu/communication/MemcpyPackInfo.h index 6c15988f4f2687275fea7f0f8be36b2e7d99fcf6..c55c3394193afb67244e93843cf9d11d12fca7dd 100644 --- a/src/gpu/communication/MemcpyPackInfo.h +++ b/src/gpu/communication/MemcpyPackInfo.h @@ -13,6 +13,27 @@ namespace walberla::gpu::communication { +/** + * \brief Data packing/unpacking for ghost layer based communication of a \ref GPUField. + * + * Encapsulate information on how to extract data from blocks that should be + * communicated to neighboring blocks (see \ref pack()) + * and how to inject this data in a receiving block (see \ref unpack()). + * This involves a device memory buffer and two device-to-device memory copy operations. + * + * A special method exists for communication between two blocks which are + * allocated on the same process (see \ref communicateLocal()). + * In this case the data does not have be communicated via a device buffer, + * but can be sent directly. This involves a single device-to-device memory + * copy operation. + * + * Data that is packed in direction "dir" at one block is unpacked in + * direction "stencil::inverseDir[dir]" at the neighboring block. + * This behavior must be implemented in \ref communicateLocal()! + * + * \ingroup gpu + * \tparam GPUFieldType A fully qualified \ref GPUField. + */ template<typename GPUFieldType> class MemcpyPackInfo : public ::walberla::gpu::GeneratedGPUPackInfo { diff --git a/src/gpu/communication/UniformGPUScheme.h b/src/gpu/communication/UniformGPUScheme.h index bc481d8950c25d4aa5196316c641e8b67e34318a..183df0497a53e11f2260fc3e591d65462800c036 100644 --- a/src/gpu/communication/UniformGPUScheme.h +++ b/src/gpu/communication/UniformGPUScheme.h @@ -42,6 +42,37 @@ namespace communication { +/** + * \brief Communication scheme for buffered communication in uniform block grids. + * + * Synchronize a set of \ref GPUField between GPU devices. + * Communication between fields on the same process: use direct copy + * via \ref GeneratedGPUPackInfo::communicateLocal. + * Communication between different processes: use a buffered communication scheme; + * when multiple fields have been changed they can be synchronized at once, + * using one MPI message per communication partner. + * + * \code + * UniformGPUScheme<stencil::D3Q19> scheme; // the stencil defines the communication neighbors + * scheme.addPackInfo( make_shared<gpu::communication::MemcpyPackInfo<FieldType> >( idOfFirstField ) ); + * scheme.addPackInfo( make_shared<gpu::communication::MemcpyPackInfo<FieldType> >( idOfSecondField ) ); + * + * // either synchronous communication... + * scheme(); + * + * // .. or asynchronous: + * scheme.startCommunication(); + * functionWhichDoesNotNeedCommunicatedValues(); + * scheme.wait(); + * \endcode + * + * This scheme sends one message per communication step and neighbor device. + * Therefore all contents that have to be sent are packed into a single buffer. + * Multiple \ref GeneratedGPUPackInfo can be registered to send their contents in a single step. + * + * When running multiple \ref UniformGPUScheme concurrently, different MPI tags + * have to be used for the schemes: the tag can be passed in the constructor. + */ template<typename Stencil> class UniformGPUScheme { diff --git a/src/lbm_generated/gpu/NonuniformGeneratedGPUPdfPackInfo.h b/src/lbm_generated/gpu/NonuniformGeneratedGPUPdfPackInfo.h index 96c514fcc4369084273c098ac9bf4ad21310ae29..585d1db348cbf0e1b5572f563b48ff55a717e9ec 100644 --- a/src/lbm_generated/gpu/NonuniformGeneratedGPUPdfPackInfo.h +++ b/src/lbm_generated/gpu/NonuniformGeneratedGPUPdfPackInfo.h @@ -291,7 +291,7 @@ class NonuniformGeneratedGPUPdfPackInfo : public walberla::gpu::GeneratedNonUnif bool areNeighborsInDirection(const Block* block, const BlockID& neighborID, Vector3< cell_idx_t > dirVec) const; - CellInterval intervalHullInDirection(const CellInterval& ci, Vector3< cell_idx_t > tangentialDir, + CellInterval intervalHullInDirection(const CellInterval& ci, Vector3< cell_idx_t > dirVec, cell_idx_t width) const; bool skipsThroughCoarseBlock(const Block* block, Direction dir) const; diff --git a/src/lbm_generated/gpu/NonuniformGeneratedGPUPdfPackInfo.impl.h b/src/lbm_generated/gpu/NonuniformGeneratedGPUPdfPackInfo.impl.h index 987cebe9b2bfd343ed0277ed3faefef4dddaa753..7ff9c7fd3cf5383499f51d9b17bc995f45450ef2 100644 --- a/src/lbm_generated/gpu/NonuniformGeneratedGPUPdfPackInfo.impl.h +++ b/src/lbm_generated/gpu/NonuniformGeneratedGPUPdfPackInfo.impl.h @@ -425,7 +425,7 @@ inline Vector3< cell_idx_t > } /** - * Returns the part of a cell interval's hull of given width in direction dirVec. + * Returns the part of a cell interval's hull of given \p width in direction \p dirVec. * @param ci The original cell interval * @param dirVec Direction Vector * @param width Width of the hull diff --git a/src/mesa_pd/CMakeLists.txt b/src/mesa_pd/CMakeLists.txt index 19eef8bf9d7e9858eb03113dba4c20c02782dda5..b71b17698f74b9cfeb176332344f95f8eeb301c4 100644 --- a/src/mesa_pd/CMakeLists.txt +++ b/src/mesa_pd/CMakeLists.txt @@ -18,8 +18,8 @@ add_subdirectory( vtk ) if(OPENMESH_CORE_FOUND) set( WALBERLA_MESAPD_CONVEX_POLYHEDRON_AVAILABLE ON CACHE INTERNAL "") target_link_libraries( mesa_pd PUBLIC mesh_common ) - message( STATUS "MESA-PD: ConvexPolyhedron shape is available (OpenMesh dependency satisfied)" ) + message( DEBUG "MESA-PD: ConvexPolyhedron shape is available (OpenMesh dependency satisfied)" ) else() set( WALBERLA_MESAPD_CONVEX_POLYHEDRON_AVAILABLE OFF CACHE INTERNAL "") - message( STATUS "MESA-PD: ConvexPolyhedron shape is unavailable (OpenMesh not found)" ) + message( DEBUG "MESA-PD: ConvexPolyhedron shape is unavailable (OpenMesh not found)" ) endif() \ No newline at end of file diff --git a/src/pe/raytracing/Intersects.h b/src/pe/raytracing/Intersects.h index a956e4efe90e78f9c5cd8fbc3a35ba0a92f28060..92adb8f3e51e75cadb09dcfbd6b7ff900d11b56f 100644 --- a/src/pe/raytracing/Intersects.h +++ b/src/pe/raytracing/Intersects.h @@ -355,7 +355,10 @@ inline bool intersectsSphere(const Vec3& gpos, real_t radius, const Ray& ray, re real_t a = direction * direction; real_t b = real_t(2.) * (displacement * direction); real_t c = (displacement * displacement) - (radius * radius); - real_t discriminant = b*b - real_t(4.)*a*c; + // Hotfix for a floating point problem; see https://i10git.cs.fau.de/walberla/walberla/-/issues/243 + real_t discriminant_tmp1 = b*b; + real_t discriminant_tmp2 = -real_t(4.)*a*c; + real_t discriminant = discriminant_tmp1 + discriminant_tmp2; if (discriminant < 0) { // with discriminant smaller than 0, sphere is not hit by ray // (no solution for quadratic equation) diff --git a/src/stencil/D2CornerStencil.h b/src/stencil/D2CornerStencil.h index 9d1716100079943e2229f7418c0c47c0ad2ebc3d..5888bad3047a336dd2aafba3ca2cf93e607b956d 100644 --- a/src/stencil/D2CornerStencil.h +++ b/src/stencil/D2CornerStencil.h @@ -1,10 +1,10 @@ +#pragma once + //==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== #ifndef DOXY_SKIP_INTERNAL -#pragma once - #include "Directions.h" #include "Iterator.h" diff --git a/src/stencil/D2Q4.h b/src/stencil/D2Q4.h index 9c1f9b7b7f6da572bdb1f7d88963ec0ee94d19da..294f3551220fe8ddd3e21b72e276e46254cffa10 100644 --- a/src/stencil/D2Q4.h +++ b/src/stencil/D2Q4.h @@ -1,10 +1,10 @@ +#pragma once + //==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== #ifndef DOXY_SKIP_INTERNAL -#pragma once - #include "Directions.h" #include "Iterator.h" diff --git a/src/stencil/D2Q5.h b/src/stencil/D2Q5.h index 98cfbb0099d1cfdbee82a3ff74c5b5b6d50de15c..a09f40cdc1dcdb25be2cc79fde4484fa2cb6c1df 100644 --- a/src/stencil/D2Q5.h +++ b/src/stencil/D2Q5.h @@ -1,10 +1,10 @@ +#pragma once + //==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== #ifndef DOXY_SKIP_INTERNAL -#pragma once - #include "Directions.h" #include "Iterator.h" diff --git a/src/stencil/D2Q9.h b/src/stencil/D2Q9.h index 4c3dc0cd9948536a4d13473b57a04dd63f928365..5d55c7fe89b21b6f571faa1920ea476d16ba70c8 100644 --- a/src/stencil/D2Q9.h +++ b/src/stencil/D2Q9.h @@ -1,10 +1,10 @@ +#pragma once + //==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== #ifndef DOXY_SKIP_INTERNAL -#pragma once - #include "Directions.h" #include "Iterator.h" diff --git a/src/stencil/D3CornerStencil.h b/src/stencil/D3CornerStencil.h index b234a89d09776919e0c008391cd699ef72a2b9ef..5df290d22b164f08858ed455ed0678f0654e4b17 100644 --- a/src/stencil/D3CornerStencil.h +++ b/src/stencil/D3CornerStencil.h @@ -1,10 +1,10 @@ +#pragma once + //==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== #ifndef DOXY_SKIP_INTERNAL -#pragma once - #include "Directions.h" #include "Iterator.h" diff --git a/src/stencil/D3EdgeCornerStencil.h b/src/stencil/D3EdgeCornerStencil.h index e3e6a2832a025c39d9427cd14234ba3910fd5df5..318752ead018b307f59f2fc01f3a6827b6e99284 100644 --- a/src/stencil/D3EdgeCornerStencil.h +++ b/src/stencil/D3EdgeCornerStencil.h @@ -1,10 +1,10 @@ +#pragma once + //==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== #ifndef DOXY_SKIP_INTERNAL -#pragma once - #include "Directions.h" #include "Iterator.h" diff --git a/src/stencil/D3Q15.h b/src/stencil/D3Q15.h index 896c8c49b912752204af227920e53e56ba42a798..32dab37b9eba8182d69d8d5873f5c4ecfd1d46e3 100644 --- a/src/stencil/D3Q15.h +++ b/src/stencil/D3Q15.h @@ -1,10 +1,10 @@ +#pragma once + //==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== #ifndef DOXY_SKIP_INTERNAL -#pragma once - #include "Directions.h" #include "Iterator.h" diff --git a/src/stencil/D3Q19.h b/src/stencil/D3Q19.h index a7a520f69b4cd2d59e6b03f9ceffa186e5c5bb5a..6077893823241858a2bb90bec3743825869e6f05 100644 --- a/src/stencil/D3Q19.h +++ b/src/stencil/D3Q19.h @@ -1,10 +1,10 @@ +#pragma once + //==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== #ifndef DOXY_SKIP_INTERNAL -#pragma once - #include "Directions.h" #include "Iterator.h" diff --git a/src/stencil/D3Q27.h b/src/stencil/D3Q27.h index 6ba403bd579e77ecc6b324538eeaa44e83ad64ad..74b986f4a2ea9fcefdda55a87cf014aef0e9cd4e 100644 --- a/src/stencil/D3Q27.h +++ b/src/stencil/D3Q27.h @@ -1,10 +1,10 @@ +#pragma once + //==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== #ifndef DOXY_SKIP_INTERNAL -#pragma once - #include "Directions.h" #include "Iterator.h" diff --git a/src/stencil/D3Q6.h b/src/stencil/D3Q6.h index 8b9f81d3ad1cea8de9ca2991a1de327514d90699..249b4dc5427d9232a9673928be5c1f8c6ea1efc6 100644 --- a/src/stencil/D3Q6.h +++ b/src/stencil/D3Q6.h @@ -1,10 +1,10 @@ +#pragma once + //==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== #ifndef DOXY_SKIP_INTERNAL -#pragma once - #include "Directions.h" #include "Iterator.h" diff --git a/src/stencil/D3Q7.h b/src/stencil/D3Q7.h index 8e14c9b001d47f384c466c5bd7e0c9a60775581e..33ecb5b14eb63661ec7bded54da25779ed9a60f6 100644 --- a/src/stencil/D3Q7.h +++ b/src/stencil/D3Q7.h @@ -1,10 +1,10 @@ +#pragma once + //==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== #ifndef DOXY_SKIP_INTERNAL -#pragma once - #include "Directions.h" #include "Iterator.h" diff --git a/src/stencil/EdgeStencil.h b/src/stencil/EdgeStencil.h index 1c4982c995ffa520a81cdf22ff0442dc30ff1bd6..e045795309850e97671edbe79a5b0ae3ebc899b9 100644 --- a/src/stencil/EdgeStencil.h +++ b/src/stencil/EdgeStencil.h @@ -1,10 +1,10 @@ +#pragma once + //==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== #ifndef DOXY_SKIP_INTERNAL -#pragma once - #include "Directions.h" #include "Iterator.h" diff --git a/src/stencil/Stencil.in.h b/src/stencil/Stencil.in.h index 893ad59ab36fd860e0dc25f1d0a9feb2e97368ac..4443d823585c4b2413dff0d233a040f1b36aa1a7 100644 --- a/src/stencil/Stencil.in.h +++ b/src/stencil/Stencil.in.h @@ -1,5 +1,3 @@ -#pragma once - #include "Directions.h" #include "Iterator.h" @@ -83,7 +81,7 @@ namespace stencil { /*! \name Iteration*/ //@{ - typedef stencil::Iterator<$name> iterator; + using iterator = stencil::Iterator<$name>; static iterator begin() { return iterator(0); } static iterator beginNoCenter() { return iterator(noCenterFirstIdx); } @@ -182,7 +180,7 @@ namespace stencil { } // namespace internal - typedef internal::$name<> $name; + using $name = internal::$name<>; } // namespace stencil } // namespace walberla diff --git a/src/stencil/generate.py b/src/stencil/generate.py index 47291f67de8d838651e1ae7df724c7189aa1ec67..263d7077d2fb56022a20811ae277a025fcbe2abd 100755 --- a/src/stencil/generate.py +++ b/src/stencil/generate.py @@ -80,7 +80,9 @@ def coordinateToDirection(coord): return directionStr -header = """//==================================================================================================================== +header = """#pragma once + +//==================================================================================================================== // Caution: This file has been generated automatically. All manual changes are lost when file is regenerated! // Changes should be done in Stencil.in.h,and then all stencils classes can be generated again. //==================================================================================================================== diff --git a/tests/lbm_generated/Example.cpp b/tests/lbm_generated/Example.cpp index 4dfd69b553d88d268efb0c49c857eb391f6277ea..2e77ddcb2bfa24c924553afdf71fc5b8081a49ab 100644 --- a/tests/lbm_generated/Example.cpp +++ b/tests/lbm_generated/Example.cpp @@ -177,14 +177,14 @@ int main(int argc, char** argv) StorageSpecification_T StorageSpec = StorageSpecification_T(); BlockDataID pdfFieldId = lbm_generated::addPdfFieldToStorage(blocks, "pdf field", StorageSpec, uint_c(2)); - BlockDataID velFieldId = field::addToStorage< VectorField_T >(blocks, "Velocity", real_c(0.0), field::fzyx); + BlockDataID velFieldId = field::addToStorage< VectorField_T >(blocks, "Velocity", real_c(0.0), field::fzyx, uint_c(2)); BlockDataID flagFieldId = field::addFlagFieldToStorage< FlagField_T >(blocks, "flag field", uint_c(3)); SweepCollection_T sweepCollection(blocks, pdfFieldId, velFieldId, omega); for (auto& block : *blocks) { - sweepCollection.initialise(&block); + sweepCollection.initialise(&block, cell_idx_c(1)); } const FlagUID fluidFlagUID("Fluid"); diff --git a/tests/lbm_generated/FreeSlipRefinement.cpp b/tests/lbm_generated/FreeSlipRefinement.cpp index 42d91a6eecbd9ad8e25a88c9a4dd4c70986d347e..4a6d51a91ef1419a703596ffbd79cabb4f95cc32 100644 --- a/tests/lbm_generated/FreeSlipRefinement.cpp +++ b/tests/lbm_generated/FreeSlipRefinement.cpp @@ -201,14 +201,14 @@ int main(int argc, char** argv) StorageSpecification_T StorageSpec = StorageSpecification_T(); BlockDataID pdfFieldId = lbm_generated::addPdfFieldToStorage(blocks, "pdf field", StorageSpec, uint_c(2)); - BlockDataID velFieldId = field::addToStorage< VectorField_T >(blocks, "Velocity", real_c(0.0), field::fzyx); + BlockDataID velFieldId = field::addToStorage< VectorField_T >(blocks, "Velocity", real_c(0.0), field::fzyx, uint_c(2)); BlockDataID flagFieldId = field::addFlagFieldToStorage< FlagField_T >(blocks, "flag field", uint_c(3)); SweepCollection_T sweepCollection(blocks, pdfFieldId, velFieldId, omega); for (auto& block : *blocks) { - sweepCollection.initialise(&block); + sweepCollection.initialise(&block, cell_idx_c(1)); } const FlagUID fluidFlagUID("Fluid"); diff --git a/tests/lbm_generated/InterpolationNoSlip.py b/tests/lbm_generated/InterpolationNoSlip.py index 62463033edaab74efff765a7e412a273b44bccbf..891892f43c3a5f0acbf187cd064ae0f85b559036 100644 --- a/tests/lbm_generated/InterpolationNoSlip.py +++ b/tests/lbm_generated/InterpolationNoSlip.py @@ -48,6 +48,7 @@ with CodeGeneration() as ctx: collision_rule=collision_rule, lbm_config=lbm_config, lbm_optimisation=lbm_opt, nonuniform=True, boundaries=[no_slip, no_slip_bouzidi, no_slip_quadraticbb, ubb], - macroscopic_fields=macroscopic_fields, data_type=data_type) + macroscopic_fields=macroscopic_fields, data_type=data_type, + set_pre_collision_pdfs=False) generate_info_header(ctx, 'InterpolationNoSlipHeader')