outram_foam_basic_lib/primitives/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//! Layer 1a — the primitive numeric types OpenFOAM builds everything on.
23//!
24//! This module holds the dimensionless scalar type and small-/large-number
25//! constants (`scalar`) together with the fixed-size 3-D tensor-algebra
26//! primitives: a 3-vector (`Vector3`), a full 3×3 tensor (`Tensor`), a
27//! symmetric 3×3 tensor (`SymmTensor`), and an isotropic diagonal tensor
28//! (`SphericalTensor`). All components are plain `f64` (dimensionless SI);
29//! `uom`-dimensioned quantities are layered on top elsewhere in the crate.
30//! Each type mirrors its `Foam::` counterpart, including component storage
31//! order and the OpenFOAM operator conventions (`&`, `&&`, `^`, `*`).
32
33/// The scalar floating-point type and the small/large numeric constants.
34/// Spectral decomposition of 3x3 tensors -- eigenvalues, eigenvectors, and the
35/// basis every isotropic tensor function (logarithm, exponential, square root)
36/// is built on.
37pub mod eigen;
38
39pub mod scalar;
40/// Isotropic diagonal tensor `ii * I` (`SphericalTensor`).
41pub mod spherical_tensor;
42/// Symmetric 3×3 tensor (`SymmTensor`).
43pub mod symm_tensor;
44/// Full (non-symmetric) 3×3 tensor (`Tensor`).
45pub mod tensor;
46/// 3-component vector (`Vector3`).
47pub mod vector;
48
49pub use eigen::{
50 eigen_values, eigen_values_checked, eigen_values_symm, eigen_vectors, eigen_vectors_symm,
51 eigen_vectors_symm_with, eigen_vectors_with,
52};
53pub use scalar::{Label, Scalar, GREAT, ROOT_GREAT, ROOT_SMALL, ROOT_VSMALL, SMALL, VGREAT, VSMALL};
54pub use spherical_tensor::SphericalTensor;
55pub use symm_tensor::SymmTensor;
56pub use tensor::Tensor;
57pub use vector::Vector3;