outram-foam-basic-lib 0.1.7

OpenFOAM primitive functions translated to Rust -- an independent OUTRAM PARK fork, not the official OpenFOAM software
Documentation
[package]
name = "outram-foam-basic-lib"
version = "0.1.7"
authors.workspace = true
edition.workspace = true
license.workspace = true
description = "OpenFOAM primitive functions translated to Rust -- an independent OUTRAM PARK fork, not the official OpenFOAM software"
homepage.workspace = true
repository.workspace = true
readme = "README.md"
categories.workspace = true
# V&V raw data (verification_and_validation/*.csv) is dev-only, gitignored,
# and never shipped in the packaged crate. `docs/` (incl. the generated
# docs/api.md rustdoc mirror) isn't crate content either. `upstream_source/
# openfoam` is the reference OpenFOAM C++ clone kept in-repo for provenance
# only — it is not crate content and must not be packaged (the small
# `upstream_source/README.md` provenance record stays in the package).
exclude = ["verification_and_validation/*.csv", "docs", "upstream_source/openfoam"]

# Where this crate sits in kovan's code map (GitHub #729, #733; maintainer
# decisions 2026-10-06). row: degree of integration, 0-1 utilities and
# standalone crates, 2 domain solvers, 3 coupled multiphysics, 4 integrated
# GUI apps. topic: the box it is drawn in. fidelity: 0 lumped (no spatial
# discretisation), 1 one resolved dimension (system-code-like), 2 two
# (subchannel), 3 three (full CFD, diffusion), 4 brute force (Monte Carlo,
# first-principles data); a resolved non-spatial axis (nuclides, pointwise
# energy, time) counts as a dimension; [lo, hi] when the crate spans levels;
# absent for utilities and knowledge management. maturity:
# 0 concept, 1 AI draft, 2 AI V&V, 3 human reviewed, 4 human V&V (ready); the
# crate's LOWEST part, with higher-rated modules listed below it.
[package.metadata.kovan]
row = 1
topic = "utility"
maturity = 2

# Hybrid execution backend (bead op-yvj.4.1). BOTH features are OFF by default
# so the default build stays Android-clean and dependency-light: a plain
# `cargo build` pulls neither rayon nor wgpu, and `ComputeBackend::Serial` --
# the reference implementation and the oracle every other path is checked
# against -- is always present regardless of features.
#
# `parallel` adds the rayon multi-CPU path. rayon is pure Rust with no system
# component, so it is Android/Termux clean and is NOT target-gated; it is
# feature-gated only to keep the default dependency surface small.
#
# `gpu` adds the wgpu path. wgpu is additionally target-gated off Android
# below, since Android has no system Vulkan/Metal loader and the workspace
# Android rule forbids GPU dependencies in a library build. Enabling `gpu` on
# an Android target therefore yields a build with no GPU backend rather than a
# broken one, and dispatch falls back to CpuMulti or Serial.
[features]
default = []
parallel = ["dep:rayon"]
gpu = ["dep:wgpu"]
# Opt-in LAPACK comparison benchmark. Off by default so neither the fast suite
# nor CI needs a system BLAS -- see the dependency tables below.
blas-bench = ["dep:ndarray-linalg"]

[dependencies]
# erf / erfc / tgamma / lgamma in pure Rust, replacing the `extern "C"` calls
# into the system C libm (bn:op-chyp.6). PETIR is no_std with only `libm`.
petir.workspace = true
thiserror.workspace = true
uom.workspace = true
ndarray.workspace = true
rayon = { workspace = true, optional = true }

[target.'cfg(not(target_os = "android"))'.dependencies]
wgpu = { workspace = true, optional = true }

[dev-dependencies]
approx.workspace = true
ndarray.workspace = true

# `ndarray-linalg` is OPT-IN, behind `blas-bench`, and is NOT a dev-dependency.
#
# WHY NOT A DEV-DEPENDENCY: Cargo pulls dev-dependencies for every `cargo test`
# whether or not the test that needs them is being run, and Cargo does not
# permit `optional = true` on one. So declaring it there forced a system BLAS
# on ANYONE running the fast suite -- `libopenblas-dev` on Linux, and a slow
# `intel-mkl-static` build on macOS/Windows -- for a single timing benchmark
# that asserts nothing. That cost showed up immediately in CI
# (`.github/workflows/fast-tests.yml`), which had to apt-install OpenBLAS.
#
# As an optional regular dependency plus `required-features` on the test
# target below, `cargo quick-test` (i.e. `--no-default-features`) does not
# resolve it at all and needs no BLAS on any platform.
#
# To run the benchmark:
#   cargo test -p outram-foam-basic-lib --features blas-bench --test matrix_bench --release -- --nocapture
#
# Still target-gated: Android has no system BLAS and no easy C/Fortran
# toolchain, so the dependency must not exist there even with the feature on.
[target.'cfg(target_os = "linux")'.dependencies]
ndarray-linalg = { workspace = true, features = ["openblas-system"], optional = true }

[target.'cfg(target_os = "macos")'.dependencies]
ndarray-linalg = { workspace = true, features = ["intel-mkl-static"], optional = true }

[target.'cfg(windows)'.dependencies]
ndarray-linalg = { workspace = true, features = ["intel-mkl-static"], optional = true }

# `required-features` keeps the test target itself out of the build graph
# unless `blas-bench` is on, so `cargo test` does not try to compile a file
# whose `use ndarray_linalg::...` cannot resolve.
[[test]]
name = "matrix_bench"
path = "tests/matrix_bench.rs"
required-features = ["blas-bench"]

[lib]
name = "outram_foam_basic_lib"
path = "src/lib.rs"