Skip to main content

math_audio_bem/core/assembly/
mod.rs

1//! BEM matrix assembly
2//!
3//! This module provides three methods for assembling BEM systems:
4//!
5//! - [`tbem`] - Traditional BEM with O(N²) dense matrix (always available)
6//! - [`slfmm`] - Single-Level Fast Multipole Method (requires `native` or `wasm` feature)
7//! - [`mlfmm`] - Multi-Level Fast Multipole Method
8//!
9//! For small problems (N < 1000), TBEM is usually fastest.
10//! For larger problems, FMM methods provide O(N log N) or O(N) scaling.
11//!
12//! ## WASM Compatibility
13//!
14//! With the `wasm` feature, all assembly methods are available including SLFMM.
15//! Parallel processing is provided via wasm-bindgen-rayon (Web Workers).
16
17// Allow needless_range_loop for complex FMM algorithm code ported from NumCalc
18#[allow(clippy::needless_range_loop)]
19pub mod mlfmm;
20#[cfg(any(feature = "native", feature = "wasm"))]
21pub mod slfmm;
22pub mod sparse;
23pub mod tbem;
24
25pub use mlfmm::{MlfmmSystem, build_cluster_tree, build_mlfmm_system};
26#[cfg(any(feature = "native", feature = "wasm"))]
27pub use slfmm::{SlfmmSystem, build_slfmm_system};
28pub use sparse::{BlockedCsr, CsrBuilder, CsrMatrix};
29pub use tbem::{
30    TbemSystem, apply_row_sum_correction, build_tbem_system, build_tbem_system_corrected,
31    build_tbem_system_scaled, build_tbem_system_with_beta,
32};
33
34#[cfg(feature = "parallel")]
35pub use tbem::build_tbem_system_parallel;