pub struct SimulationConfig {
pub width: usize,
pub height: usize,
pub depth: usize,
pub cell_size: f32,
pub environment: Environment,
pub prefer_gpu: bool,
pub computation_method: ComputationMethod,
}Expand description
Configuration for creating a simulation.
Fields§
§width: usizeGrid width (cells)
height: usizeGrid height (cells)
depth: usizeGrid depth (cells)
cell_size: f32Cell size (meters)
environment: EnvironmentEnvironment settings
prefer_gpu: boolUse GPU if available
computation_method: ComputationMethodComputation method for GPU
Implementations§
Source§impl SimulationConfig
impl SimulationConfig
Sourcepub fn small_room() -> Self
pub fn small_room() -> Self
Create a configuration for a small room (10m x 10m x 3m).
Sourcepub fn medium_room() -> Self
pub fn medium_room() -> Self
Create a configuration for a medium room (20m x 20m x 5m).
Sourcepub fn large_space() -> Self
pub fn large_space() -> Self
Create a configuration for a large space (50m x 50m x 10m).
Sourcepub fn underwater() -> Self
pub fn underwater() -> Self
Create a configuration for underwater simulation.
Sourcepub fn with_environment(self, env: Environment) -> Self
pub fn with_environment(self, env: Environment) -> Self
Set the environment.
Sourcepub fn with_computation_method(self, method: ComputationMethod) -> Self
pub fn with_computation_method(self, method: ComputationMethod) -> Self
Set the computation method.
Stencil: Traditional GPU stencil computation (default)Actor: Cell-as-actor paradigm with message-based halo exchange
Sourcepub fn build(self) -> SimulationEngine
pub fn build(self) -> SimulationEngine
Build the simulation engine.
Sourcepub fn physical_dimensions(&self) -> (f32, f32, f32)
pub fn physical_dimensions(&self) -> (f32, f32, f32)
Get the physical dimensions of the simulation space.
Sourcepub fn max_frequency(&self, speed_of_sound: f32) -> f32
pub fn max_frequency(&self, speed_of_sound: f32) -> f32
Get the maximum accurately simulated frequency.
Trait Implementations§
Source§impl Clone for SimulationConfig
impl Clone for SimulationConfig
Source§fn clone(&self) -> SimulationConfig
fn clone(&self) -> SimulationConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimulationConfig
impl Debug for SimulationConfig
Auto Trait Implementations§
impl Freeze for SimulationConfig
impl RefUnwindSafe for SimulationConfig
impl Send for SimulationConfig
impl Sync for SimulationConfig
impl Unpin for SimulationConfig
impl UnwindSafe for SimulationConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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