Struct FluidFdtdState
pub struct FluidFdtdState {
pub step_index: u64,
pub p: Vec<f64>,
pub vx: Vec<f64>,
pub vy: Vec<f64>,
pub vz: Vec<f64>,
pub prev_vx: Vec<f64>,
pub prev_vy: Vec<f64>,
pub prev_vz: Vec<f64>,
pub cpml_psi: Vec<f64>,
}Expand description
Complete restartable state for the 3D staggered fluid acoustic FDTD solver.
Fields§
§step_index: u64Current step index $n$.
p: Vec<f64>Cell-centered pressure $p^n(i,j,k)$ in Pa.
vx: Vec<f64>Face-centered velocity $v_x^{n+1/2}(i+1/2,j,k)$ in m/s.
vy: Vec<f64>Face-centered velocity $v_y^{n+1/2}(i,j+1/2,k)$ in m/s.
vz: Vec<f64>Face-centered velocity $v_z^{n+1/2}(i,j,k+1/2)$ in m/s.
prev_vx: Vec<f64>Prior half-step velocity $v_x^{n-1/2}$ for exact temporal collocation at $t = n\Delta t$.
prev_vy: Vec<f64>Prior half-step velocity $v_y^{n-1/2}$ for exact temporal collocation at $t = n\Delta t$.
prev_vz: Vec<f64>Prior half-step velocity $v_z^{n-1/2}$ for exact temporal collocation at $t = n\Delta t$.
cpml_psi: Vec<f64>CPML auxiliary memory variables $\psi_{v_x}, \psi_{v_y}, \psi_{v_z}, \psi_{p_x}, \psi_{p_y}, \psi_{p_z}$.
Implementations§
§impl FluidFdtdState
impl FluidFdtdState
pub fn new(cfg: &FluidFdtdConfig) -> Result<FluidFdtdState, NumericalError>
pub fn new(cfg: &FluidFdtdConfig) -> Result<FluidFdtdState, NumericalError>
Allocate a zero-initialized state for the given validated solver configuration.
pub fn encode_restart_bytes(&self) -> Vec<u8> ⓘ
pub fn encode_restart_bytes(&self) -> Vec<u8> ⓘ
Serialize complete internal and boundary state for deterministic bitwise restart (C02-C09).
pub fn decode_restart_bytes(
cfg: &FluidFdtdConfig,
bytes: &[u8],
) -> Result<FluidFdtdState, NumericalError>
pub fn decode_restart_bytes( cfg: &FluidFdtdConfig, bytes: &[u8], ) -> Result<FluidFdtdState, NumericalError>
Reconstruct complete state from deterministic restart bytes.
Trait Implementations§
§impl Clone for FluidFdtdState
impl Clone for FluidFdtdState
§fn clone(&self) -> FluidFdtdState
fn clone(&self) -> FluidFdtdState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more