kwave.kWaveSimulation_helper.scale_source_terms_func module¶
- apply_pressure_source_correction(is_source_p, use_w_source_correction_p, source, dt)[source]¶
apply k-space source correction expressed as a function of w :param is_source_p: :param use_w_source_correction_p: :param source: :param dt:
Returns:
- apply_velocity_source_corrections(use_w_source_correction_u, is_ux_exists, is_uy_exists, is_uz_exists, source, dt)[source]¶
apply k-space source correction expressed as a function of w :param use_w_source_correction_u: :param is_ux_exists: :param is_uy_exists: :param is_uz_exists: :param source: :param dt:
Returns:
- Parameters:
use_w_source_correction_u (bool)
is_ux_exists (bool)
is_uy_exists (bool)
is_uz_exists (bool)
source (kSource)
dt (float)
- check_conditions(is_nonuniform_grid, is_source_uy, is_source_uz, is_transducer_source)[source]¶
check for non-uniform grid and give error for source terms that haven’t yet been implemented Returns:
- scale_pressure_source(is_source_p, source, kgrid, N, c0, dx, dt, p_source_pos_index, is_nonuniform_grid)[source]¶
scale the input pressure by 1/c0^2 (to convert to units of density), then by 1/N (to split the input across the split density field). If the pressure is injected as a mass source, also scale the pressure by 2*dt*c0/dx to account for the time step and convert to units of [kg/(m^3 s)] :param is_source_p: :param source: :param kgrid: :param N: :param c0: :param dx: :param dt: :param p_source_pos_index: :param is_nonuniform_grid:
Returns:
- scale_source_terms_func(c0, dt, kgrid, source, p_source_pos_index, s_source_pos_index, u_source_pos_index, transducer_input_signal, flags)[source]¶
Subscript for the first-order k-Wave simulation functions to scale source terms to the correct units. Args: Returns:
- scale_stress_source(source, c0, is_source_exists, is_p0_exists, source_val, dt, N, dx, s_source_pos_index)[source]¶
- scale_stress_sources(source, c0, flags, dt, dx, N, s_source_pos_index)[source]¶
scale the stress source by 1/N to divide amoungst the split field components, and if source.s_mode is not set to ‘dirichlet’, also scale by 2*dt*c0/dx to account for the time step and convert to units of [kg/(m^3 s)] (note dx is used in all dimensions) :param source: :param c0: :param flags: :param dt: :param dx: :param N: :param s_source_pos_index:
Returns:
- scale_transducer_source(is_transducer_source, transducer_input_signal, c0, dt, dx, u_source_pos_index)[source]¶
scale the transducer source term by 2*dt*c0/dx to account for the time step and convert to units of [m/s^2] :param is_transducer_source: :param transducer_input_signal: :param c0: :param dt: :param dx: :param u_source_pos_index:
Returns:
- scale_velocity_source(is_source, source_u_mode, source_val, c0, dt, u_source_pos_index, d_direction)[source]¶
if source.u_mode is not set to ‘dirichlet’, scale the d_direction velocity source terms by 2*dt*c0/dz to account for the time step and convert to units of [m/s^2] :param is_source: :param source_u_mode: :param source_val: :param c0: :param dt: :param u_source_pos_index: :param d_direction:
Returns:
- scale_velocity_source_nonuniform(is_source, source_u_mode, kgrid, source_val, c0, dt, u_source_pos_index)[source]¶
if source.u_mode is not set to ‘dirichlet’, scale the d_direction velocity source terms by 2*dt*c0/dz to account for the time step and convert to units of [m/s^2] :param is_source: :param source_u_mode: :param kgrid: :param source_val: :param c0: :param dt: :param u_source_pos_index:
Returns:
- scale_velocity_source_x(is_source_ux, source_u_mode, source_val, kgrid, c0, dt, dx, u_source_pos_index, is_nonuniform_grid)[source]¶
if source.u_mode is not set to ‘dirichlet’, scale the x-direction velocity source terms by 2*dt*c0/dx to account for the time step and convert to units of [m/s^2] Returns: