Skip to main content

Module numerical

Module numerical 

Source
Expand description

QAC Continuum Numerical Solvers, Frequency-Domain Helmholtz, Room Acoustics & Kramers-Kronig Dispersion.

Implements Packet N02 (acoustic_numerical_engineer) for the QAC v1 evolution contract, delegating reusable 3D continuum solvers to [etalon_sim::acoustics_continuum] and WGSL compute kernels to [etalon_wgsl_forge::numerical::physics::acoustic_fdtd], while providing QAC v1 Mode 0x0000 (pressure_velocity_continuum) and Mode 0x0001 (elastic_stress_velocity_continuum) 64-byte wire record codecs and GPU buffer adapters:

  • fdtd_fluid: Mode 0x0000 (PressureVelocityRecord) + 3D staggered-grid fluid FDTD/CPML solver and WGSL compute kernel adapter.
  • elastic_virieux: Mode 0x0001 (ElasticStressVelocityRecord) + 3D Virieux 6-component Cauchy stress-velocity solver, Hamilton quaternion stress rotation, normal-incidence impedance interface, and WGSL compute kernel adapter.
  • helmholtz: 3D frequency-domain Helmholtz operator (7pt/27pt stencils), Jacobi/BiCGSTAB solvers, 3D Green’s function, and cavity eigenmode oracles.
  • room_acoustics: Sabine, Eyring-Norris, and Millington-Sette $T_{60}$ calculators and ISO 3382-1 Schroeder backward integration ($\text{EDT}, T_{20}, T_{30}, C_{50}, C_{80}, D_{50}, T_s$).
  • attenuation_kk: Kramers-Kronig causal attenuation-dispersion consistency for power-law media ($0 < y < 3$, including $y=1$) and multi-relaxation atmospheric/seawater profiles.

Re-exports§

pub use elastic_virieux::decode_elastic_stress_velocity_records;
pub use elastic_virieux::encode_elastic_stress_velocity_records;
pub use elastic_virieux::elastic_config_to_gpu_params;
pub use elastic_virieux::pack_elastic_virieux_state_f32;
pub use elastic_virieux::unpack_elastic_virieux_state_f32;
pub use fdtd_fluid::decode_pressure_velocity_records;
pub use fdtd_fluid::encode_pressure_velocity_records;
pub use fdtd_fluid::fluid_config_to_gpu_params;
pub use fdtd_fluid::pack_fluid_fdtd_state_f32;
pub use fdtd_fluid::unpack_fluid_fdtd_state_f32;
pub use poroelastic_bioheat::*;

Modules§

attenuation_kk
Kramers-Kronig Acoustic Attenuation-Dispersion Consistency Facade.
elastic_virieux
QAC Mode 0x0001 (elastic_stress_velocity_continuum) Wire Adapter & 3D Virieux Elastic Facade.
fdtd_fluid
QAC Mode 0x0000 (pressure_velocity_continuum) Wire Adapter & 3D Staggered Fluid FDTD Facade.
helmholtz
3D Helmholtz Frequency-Domain Solver & Green’s Function Oracle Facade.
poroelastic_bioheat
Biot Poroelastic Dispersion, 21-Constant Anisotropic Christoffel Solver, Kouyoumjian-Pathak UTD Wedge Diffraction, ISO 532-1 (Zwicker) Sone Loudness, and AIUM/NEMA UD 3 Pennes Bioheat TI.
room_acoustics
Room Acoustics: Sabine / Eyring-Norris / Millington-Sette $T_{60}$ & Schroeder RIR Integration Facade.

Structs§

AcousticFluidFdtdGpuParams
Parameters for a 3D staggered fluid FDTD leapfrog step (ACOUSTIC_FLUID_FDTD_WGSL).
CauchyStress6
Six-component symmetric Cauchy stress tensor in canonical QAC order: [\sigma_{xx}, \sigma_{yy}, \sigma_{zz}, \sigma_{xy}, \sigma_{yz}, \sigma_{xz}] in Pascals (tensile-positive).
Complex64
Complex double-precision scalar re + i * im.
ElasticMedium
Isotropic linear elastic solid (or explicit $\mu=0$ fluid-limit) medium parameters (Schema 200).
ElasticStressVelocityRecord
Mode 0x0001 (elastic_stress_velocity_continuum) 64-byte wire record.
ElasticVirieuxConfig
Configuration for the 3D Virieux staggered-grid elastic velocity-stress solver.
ElasticVirieuxFdtdGpuParams
Parameters for a 3D Virieux staggered elastic velocity-stress step (ELASTIC_VIRIEUX_FDTD_WGSL).
ElasticVirieuxState
Complete state of the 3D Virieux staggered-grid velocity-stress solver.
FluidFdtdConfig
Configuration for the 3D staggered-grid fluid acoustic FDTD solver.
FluidFdtdState
Complete restartable state for the 3D staggered fluid acoustic FDTD solver.
FluidMedium
Stationary homogeneous fluid medium parameters (Schema 200 subset).
HamiltonQuaternionXyzw
Active local-to-parent Hamilton quaternion [x, y, z, w] (C02-C04 / CROSS-A01).
HelmholtzConfig
Configuration for the 3D Helmholtz operator $(\nabla^2 + k^2)\hat{p} = -\hat{s}$.
HelmholtzSolveReport
Convergence summary for an iterative 3D Helmholtz solve.
HelmholtzWorkspace
Caller-owned workspace for zero-allocation BiCGSTAB and Jacobi Helmholtz solves.
MultiRelaxationMedium
Multi-relaxation + classical thermoviscous causal acoustic medium.
NormalIncidenceInterface
Normal-incidence planar acoustic / longitudinal impedance reflection and transmission across an interface from medium 1 ($Z_1 > 0$) into medium 2 ($Z_2 \ge 0$).
PowerLawAttenuation
Power-law causal acoustic attenuation and Kramers-Kronig dispersion model.
PressureVelocityRecord
Mode 0x0000 (pressure_velocity_continuum) 64-byte wire record.
RelaxationProcess
Single molecular/chemical acoustic relaxation mechanism.
RirAcousticsReport
Complete ISO 3382-1 room impulse response (RIR) decay and clarity analysis.
RoomGeometry
Room geometry and acoustic boundary model for $T_{60}$ calculations.
StaggeredFluidOffsets
Staggered component offsets in fractions of grid spacing and solver clock ticks (AQ-02).
SurfacePatch
Surface patch with area $S_i$ ($\text{m}^2$) and random-incidence absorption coefficient $\alpha_i$.
TensorStrain6
Six-component symmetric small-strain tensor in canonical QAC order: [\varepsilon_{xx}, \varepsilon_{yy}, \varepsilon_{zz}, \varepsilon_{xy}, \varepsilon_{yz}, \varepsilon_{xz}].

Enums§

AcousticFluidGpuBoundary
Boundary mode for GPU/CPU f32 staggered fluid FDTD stepping.
ElasticBoundaryCondition
Boundary condition for the 3D Virieux staggered-grid elastic solver.
ElasticVirieuxGpuBoundary
Boundary mode for GPU/CPU f32 Virieux elastic velocity-stress stepping.
FluidBoundaryCondition
Boundary condition kind for the 3D fluid FDTD solver.
HelmholtzBoundary
Boundary condition for the 3D Helmholtz grid.
HelmholtzStencil
Finite-difference stencil choice for the 3D Helmholtz operator.
NumericalError
Errors raised by QAC numerical continuum and room/dispersion solvers.

Constants§

ACOUSTIC_FLUID_CELL_STRIDE
Scalars per cell in the flat 3D fluid FDTD state buffer: [p, vx, vy, vz].
ACOUSTIC_FLUID_FDTD_ENTRY
Entry-point name of ACOUSTIC_FLUID_FDTD_WGSL.
ACOUSTIC_FLUID_FDTD_WGSL
WGSL compute kernel for 3D staggered-grid fluid acoustic pressure-velocity FDTD.
B32_UNIT_ROUNDOFF
Single-precision unit roundoff constant $u_{32} = 2^{-24}$ defined by the C02 B32 arithmetic budget.
ELASTIC_STRESS_VELOCITY_RECORD_STRIDE
Exact record stride in bytes for Mode 0x0001.
ELASTIC_VIRIEUX_CELL_STRIDE
Scalars per cell in the flat 3D elastic Virieux state buffer: [vx, vy, vz, sxx, syy, szz, sxy, syz, sxz].
ELASTIC_VIRIEUX_FDTD_ENTRY
Entry-point name of ELASTIC_VIRIEUX_FDTD_WGSL.
ELASTIC_VIRIEUX_FDTD_WGSL
WGSL compute kernel for 3D Virieux staggered-grid elastic velocity-stress FDTD.
ESV_DEFINED_VALIDITY_MASK
Mask of all defined validity bits in Mode 0x0001.
ESV_VALID_DISPLACEMENT
Validity bit for particle displacement displacement_m.
ESV_VALID_STRESS
Validity bit for 6-component Cauchy stress stress_xx_yy_zz_xy_yz_xz_pa.
ESV_VALID_VELOCITY
Validity bit for particle velocity velocity_m_s.
MODE_ELASTIC_STRESS_VELOCITY_CONTINUUM
Canonical QAC mode identifier for elastic_stress_velocity_continuum.
MODE_PRESSURE_VELOCITY_CONTINUUM
Canonical QAC mode identifier for pressure_velocity_continuum.
PRESSURE_VELOCITY_RECORD_STRIDE
Exact record stride in bytes for Mode 0x0000.
PV_DEFINED_VALIDITY_MASK
Mask of all defined validity bits in Mode 0x0000.
PV_VALID_ENERGY_DENSITY
Validity bit for collocated energy density energy_density_j_m3.
PV_VALID_INTENSITY
Validity bit for collocated acoustic intensity intensity_w_m2.
PV_VALID_POSITION
Validity bit flags for PressureVelocityRecord.
PV_VALID_PRESSURE
Validity bit for acoustic pressure perturbation pressure_pa.
PV_VALID_VELOCITY
Validity bit for particle velocity vector particle_velocity_m_s.
RT60_NUMERATOR_55_25
Canonical numerator constant $55.25 = \frac{60 \times 4}{\ln(10)^{-1}} \approx 24\ln(10)$ used in the Sabine/Eyring/Millington formulas.
RT60_NUMERATOR_EXACT_24LN10
Exact theoretical numerator $24\ln(10) \approx 55.2620422318571$.

Functions§

acoustic_fluid_fdtd_step_cpu
CPU reference stepper for one full 3D staggered fluid FDTD leapfrog step (ACOUSTIC_FLUID_CELL_STRIDE = 4).
acoustic_fluid_fdtd_step_gpu
Convenience GPU wrapper that allocates a WgpuComputeContext and runs acoustic_fluid_fdtd_step_with_context.
acoustic_fluid_fdtd_step_with_context
Dispatch one full 3D staggered fluid FDTD leapfrog step using a caller-supplied WgpuComputeContext.
analyze_room_impulse_response
Perform full ISO 3382-1 analysis on a discrete room impulse response $h[n]$ sampled at sample_rate_hz.
apply_helmholtz_operator
Apply the 3D discrete Helmholtz operator $A\hat{p} = (\nabla_h^2 + k^2)\hat{p}$ into out.
assert_b32_scalar_budget
Assert that actual agrees with y_ref within the C02 B32 budget at characteristic scale scale_s.
b32_scalar_tolerance
Compute the C02 B32 scalar absolute error tolerance for a reference value y_ref at characteristic physical scale scale_s: $$\text{tol}(y_{\text{ref}}, S) = 8 u_{32} S + 2\times 10^{-6} |y_{\text{ref}}|, \qquad u_{32} = 2^{-24}$$
collocate_fluid_cell
Interpolate staggered velocities in space and time to cell center (ix, iy, iz) at step $n$.
elastic_virieux_fdtd_step_cpu
CPU reference stepper for one full 3D Virieux staggered elastic velocity-stress step (ELASTIC_VIRIEUX_CELL_STRIDE = 9).
elastic_virieux_fdtd_step_gpu
Convenience GPU wrapper that allocates a WgpuComputeContext and runs elastic_virieux_fdtd_step_with_context.
elastic_virieux_fdtd_step_with_context
Dispatch one full 3D Virieux staggered elastic velocity-stress step using a caller-supplied WgpuComputeContext.
evaluate_direct_energy_and_intensity
Evaluate collocated energy density and intensity only when the offsets are collocated; rejects direct multiplication of staggered fields without interpolation (C02 Mode 00).
fit_decay_rt60_s
Fit linear least-squares decay slope on edc_db between start_db (e.g. -5.0) and end_db (e.g. -35.0) and return the extrapolated $-60\text{ dB}$ decay time $T_{60}$ in seconds.
helmholtz_greens_function_3d
Analytical 3D free-space outgoing Green’s function $$G(r) = \frac{e^{i k r}}{4\pi r}, \qquad r = |\mathbf{x} - \mathbf{x}_0|_2 > 0$$ Rejects $r \le 0$ singularity per C02.
rectangular_cavity_eigenfrequency_hz
Analytical eigenfrequency $f_{n_x,n_y,n_z}$ (in Hz) of a 3D rectangular acoustic cavity with side lengths $(L_x, L_y, L_z)$, sound speed $c$, and mode indices $(n_x, n_y, n_z)$: $$f_{n_x,n_y,n_z} = \frac{c}{2}\sqrt{\left(\frac{n_x}{L_x}\right)^2 + \left(\frac{n_y}{L_y}\right)^2 + \left(\frac{n_z}{L_z}\right)^2}$$
rectangular_cavity_eigenmode_value
Evaluate the analytical standing-wave eigenmode shape in a 3D rectangular cavity at pos_m:
schroeder_backward_integration_db
Compute the normalized Schroeder backward energy integration curve in dB: $$E(k) = \sum_{n=k}^{N-1} h[n]^2, \qquad L_{\text{EDC}}(k) = 10\log_{10}!\left(\frac{E(k)}{E(0)}\right)$$ Rejects empty, non-finite, or all-zero silent impulse responses (C02-C01 / AQ-04).
solve_helmholtz_bicgstab
Solve $(\nabla_h^2 + k^2)\hat{p} = -\hat{s}$ (where rhs is $-\hat{s}$) using BiCGSTAB over caller-owned workspace with zero heap allocations inside the loop.
step_elastic_virieux_in_place
Advance the 3D Virieux staggered-grid elastic state by one full leapfrog step $\Delta t$ with zero heap allocations on the hot path.
step_fluid_fdtd_in_place
Advance the 3D staggered-grid fluid FDTD state by one full leapfrog step $\Delta t$ with zero heap allocations on the hot path.
step_helmholtz_jacobi
Damped Jacobi relaxation step for the 3D Helmholtz operator over caller-owned workspace.