pub struct AcousticParams3D {
pub environment: Environment,
pub medium: MediumProperties,
pub cell_size: f32,
pub time_step: f32,
pub c_squared: f32,
pub damping: MultiBandDamping,
pub simple_damping: f32,
}Expand description
Parameters for the 3D acoustic wave simulation.
Uses the FDTD (Finite-Difference Time-Domain) method for solving the 3D wave equation with realistic physics.
Fields§
§environment: EnvironmentEnvironment (temperature, humidity, medium)
medium: MediumPropertiesMedium properties derived from environment
cell_size: f32Cell size (spatial step) in meters (uniform in all dimensions)
time_step: f32Time step in seconds (computed for numerical stability)
c_squared: f32Courant number squared (c² = (speed * dt / dx)²)
damping: MultiBandDampingMulti-band damping coefficients
simple_damping: f32Simple average damping factor for basic FDTD (0-1)
Implementations§
Source§impl AcousticParams3D
impl AcousticParams3D
Sourcepub fn new(environment: Environment, cell_size: f32) -> Self
pub fn new(environment: Environment, cell_size: f32) -> Self
Create new 3D acoustic parameters from environment settings.
The time step is automatically computed to satisfy the CFL condition for numerical stability in 3D: dt <= dx / (c * sqrt(3))
§Arguments
environment- Environmental conditions (temperature, humidity, medium)cell_size- Spatial step size in meters (same for x, y, z)
Sourcepub fn for_medium(medium: Medium, cell_size: f32) -> Self
pub fn for_medium(medium: Medium, cell_size: f32) -> Self
Create parameters for a specific medium at standard conditions.
Sourcepub fn set_environment(&mut self, env: Environment)
pub fn set_environment(&mut self, env: Environment)
Update environment and recompute derived parameters.
Sourcepub fn set_cell_size(&mut self, size: f32)
pub fn set_cell_size(&mut self, size: f32)
Update cell size and recompute parameters.
Sourcepub fn courant_number(&self) -> f32
pub fn courant_number(&self) -> f32
Compute the Courant number (c * dt / dx).
For numerical stability in 3D, this should be <= 1/sqrt(3) ~= 0.577
Sourcepub fn wavelength(&self, frequency: f32) -> f32
pub fn wavelength(&self, frequency: f32) -> f32
Get the wavelength for a given frequency.
Sourcepub fn cells_per_wavelength(&self, frequency: f32) -> f32
pub fn cells_per_wavelength(&self, frequency: f32) -> f32
Get the number of cells per wavelength for a given frequency.
For accurate simulation, this should be >= 10 (ideally 20+).
Sourcepub fn max_accurate_frequency(&self) -> f32
pub fn max_accurate_frequency(&self) -> f32
Get recommended maximum frequency for accurate simulation.
Based on the Nyquist-like criterion of ~10 cells per wavelength.
Trait Implementations§
Source§impl Clone for AcousticParams3D
impl Clone for AcousticParams3D
Source§fn clone(&self) -> AcousticParams3D
fn clone(&self) -> AcousticParams3D
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AcousticParams3D
impl Debug for AcousticParams3D
Auto Trait Implementations§
impl Freeze for AcousticParams3D
impl RefUnwindSafe for AcousticParams3D
impl Send for AcousticParams3D
impl Sync for AcousticParams3D
impl Unpin for AcousticParams3D
impl UnwindSafe for AcousticParams3D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more