outram_foam_basic_lib/interpolation/mod.rs
1// SPDX-License-Identifier: GPL-3.0-only
2// Copyright (C) 2026 OUTRAM PARK contributors
3// Derived from OpenFOAM (www.openfoam.com)
4// Copyright (C) 2004-2023 OpenFOAM Foundation
5// Copyright (C) 2016-2023 OpenCFD Ltd.
6//
7// This file is part of OUTRAM PARK.
8//
9// OUTRAM PARK is free software: you can redistribute it and/or modify it
10// under the terms of the GNU General Public License as published by the
11// Free Software Foundation, either version 3 of the License, or (at your
12// option) any later version.
13//
14// OUTRAM PARK is distributed in the hope that it will be useful, but
15// WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17// General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License along
20// with OUTRAM PARK. If not, see <https://www.gnu.org/licenses/>.
21
22//! One-dimensional table interpolation over sorted `(xs, ys)` samples.
23//!
24//! Ports the OpenFOAM `interpolateXY` / `interpolateSplineXY` helpers:
25//! [`interpolate_xy`](crate::interpolation::interpolate_xy::interpolate_xy) (piecewise-linear) and
26//! [`interpolate_spline_xy`](crate::interpolation::interpolate_spline_xy::interpolate_spline_xy)
27//! (Catmull-Rom cubic). Both assume `xs` is sorted ascending and clamp to the
28//! endpoint value outside the table range. Abscissae and ordinates are bare
29//! `f64` in the caller's own units.
30
31pub mod interpolate_spline_xy;
32pub mod interpolate_xy;
33pub use interpolate_spline_xy::interpolate_spline_xy;
34pub use interpolate_xy::interpolate_xy;