Skip to main content

sim_lib_interference_core/
lib.rs

1#![forbid(unsafe_code)]
2//! Checked physical boundaries for coherent scalar wave-field studies.
3//!
4//! This crate owns the dependency-free quantity, source, sampling, and
5//! preflight vocabulary used by the interference family. It deliberately does
6//! not define grid solving, tensor storage, runtime bindings, or presentation.
7//!
8//! # Scope boundary
9//!
10//! The model is homogeneous, isotropic, three-dimensional, scalar, and
11//! free-field. It does not model polarization, impedance, interfaces,
12//! obstacles, or diffraction. Downstream amplitude-squared observations are
13//! normalized proxies, not physical intensity, power, or energy.
14//!
15//! # Governing convention
16//!
17//! The real field is `u(x, t) = Re{U(x) * exp(-i * omega * t)}`. In a
18//! homogeneous scalar medium,
19//! `k_tilde = omega / c + i * alpha` and, away from point sources,
20//! `laplacian(U) + k_tilde^2 * U = 0`.
21//!
22//! A point emitter contributes
23//! `A * (R_ref / r) * exp(i * k_tilde * r + i * phase)`, where
24//! [`POINT_SOURCE_REFERENCE_DISTANCE_METRES`] defines `R_ref`. A forward-plane
25//! emitter contributes `A * exp(i * k_tilde * s + i * phase)` only for
26//! non-negative signed distance `s`. The positive propagation sign is outgoing
27//! under the `exp(-i * omega * t)` time convention, and the imaginary part of
28//! `k_tilde` gives `exp(-alpha * distance)` attenuation.
29//!
30//! [`SamplingPlane`] defines physical pixel centres in an orthonormal finite
31//! frame. [`SamplingCertificate`] measures carrier phase, half-wavelength
32//! squared-magnitude fringes, and point-source `1/r` envelope change against
33//! explicit [`SamplingThresholds`]. [`RequestPreflight`] applies
34//! [`SamplingPolicy`] and [`WorkBudget`] before a solver allocates field
35//! storage.
36
37mod budget;
38mod certificate;
39mod emitter;
40mod error;
41mod geometry;
42mod medium;
43mod problem;
44mod propagation;
45mod quantity;
46mod sampling;
47
48pub use budget::{RequestPreflight, WorkBudget, WorkEstimate, WorkMetric};
49pub use certificate::{SamplingCertificate, SamplingPolicy, SamplingThresholds, SamplingVerdict};
50pub use emitter::{Emitter, SourceSet};
51pub use error::InterferenceError;
52pub use geometry::{Point3M, UnitVector3};
53pub use medium::{ScalarMedium, WaveNumber};
54pub use problem::{InterferenceProblem, POINT_SOURCE_REFERENCE_DISTANCE_METRES};
55pub use propagation::{contribution_at, forward_plane_contribution_at, point_contribution_at};
56pub use quantity::{
57    FieldAmplitude, Hertz, Metres, MetresPerSecond, NepersPerMetre, PositiveMetres, Radians,
58};
59pub use sampling::{SAMPLING_AXIS_ORTHOGONALITY_TOLERANCE, SamplingPlane};