#!/usr/bin/env bash set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" JOBS="${JOBS:-$(nproc)}" PYTHON_BIN="${PYTHON_BIN:-${ROOT_DIR}/.venv/bin/python}" if [[ ! -x "${PYTHON_BIN}" ]]; then uv sync --dev fi if ! PYTHONPATH= "${PYTHON_BIN}" -c 'import pybind11, numpy' >/dev/null 2>&1; then uv sync --dev fi "${ROOT_DIR}/scripts/build_openfoam_airfrans_subset.sh" >/dev/null # blockMesh/createZones are verification fixtures for deterministic tutorial cases. set +u source "${ROOT_DIR}/OpenFOAM-14/etc/bashrc" \ WM_MPLIB=Dummy \ ParaView_TYPE=none \ SCOTCH_TYPE=none \ ZOLTAN_TYPE=none set -u # OpenFOAM's SIGFPE trap is useful for solver binaries but unsafe for Python's # own floating-point formatting/comparison code inside the verification process. unset FOAM_SIGFPE ( cd "${ROOT_DIR}/OpenFOAM-14" wmake -j "${JOBS}" libso src/mesh/blockMesh >/dev/null wmake -j "${JOBS}" applications/utilities/mesh/generation/blockMesh >/dev/null wmake -j "${JOBS}" applications/utilities/mesh/manipulation/createZones >/dev/null ) "${ROOT_DIR}/scripts/build_python_stepper.sh" >/dev/null "${PYTHON_BIN}" "${ROOT_DIR}/scripts/verify_python_stepper.py"