#![expect(
clippy::unwrap_used,
reason = "test code: unwraps on fixed fixtures are the floor's test exemption"
)]
use leto::Array3;
use super::super::coefficients::{
central_first_derivative_coefficients, staggered_first_derivative_coefficients,
TapCoefficients, MAX_HALF_ORDER,
};
use super::super::{FiniteDifference3D, FiniteDifference3DScheme};
use super::{Axis, StaggeredLeapfrog3D};
const AXES: [Axis; 3] = [Axis::X, Axis::Y, Axis::Z];
fn seeded(shape: [usize; 3], salt: f64) -> Array3<f64> {
let mut field = Array3::zeros(shape);
for i in 0..shape[0] {
for j in 0..shape[1] {
for k in 0..shape[2] {
let x = i as f64 * 0.37 + salt;
let y = j as f64 * 0.53 - salt * 0.5;
let z = k as f64 * 0.71 + salt * 0.25;
field[[i, j, k]] = (x.sin() * y.cos() + z.sin() * 0.75) * (1.0 + 0.1 * salt);
}
}
}
field
}
fn dot(a: &Array3<f64>, b: &Array3<f64>) -> f64 {
a.as_slice()
.unwrap()
.iter()
.zip(b.as_slice().unwrap())
.fold(0.0, |sum, (&a, &b)| sum + a * b)
}
mod coefficients;
mod construction;
mod kernels;
mod sweeps;