use crate::field::{GridSpec, VectorField};
use crate::float::Float;
use ndarray::Array3;
use num_complex::Complex;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
pub enum DomainType {
Periodic3D,
Axisymmetric,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub struct PhysicsParams {
pub nu: f64,
pub re: f64,
pub domain: DomainType,
}
pub struct Snapshot<F: Float> {
pub time: F,
pub step: u64,
pub dt: F,
pub velocity: VectorField<F>,
pub vorticity: VectorField<F>,
pub u_hat: [Array3<Complex<F>>; 3],
pub grid: GridSpec,
pub params: PhysicsParams,
}
pub trait Domain<F: Float> {
fn step(&mut self);
fn time(&self) -> F;
fn step_count(&self) -> u64;
fn dt(&self) -> F;
fn energy(&self) -> F;
fn enstrophy(&self) -> F;
fn helicity(&self) -> F;
fn superhelicity(&self) -> F;
fn max_vorticity(&self) -> F;
fn cfl_dt(&self) -> F;
fn u_hat(&self) -> &[Array3<Complex<F>>; 3];
fn grid(&self) -> &GridSpec;
fn params(&self) -> &PhysicsParams;
fn snapshot(&self) -> Snapshot<F>;
}