Module bem_solver

Module bem_solver 

Source
Expand description

High-level BEM Solver API

This module provides a unified, high-level interface for acoustic BEM simulations. It integrates mesh generation, system assembly, linear solving, and post-processing.

The Direct solver method works in both native and WASM modes. When the native feature is enabled, it uses optimized BLAS/LAPACK. Otherwise, it falls back to a pure Rust LU factorization implementation.

§Example

use bem::core::{BemSolver, BemProblem, IncidentField};

// Create a rigid sphere scattering problem
let problem = BemProblem::rigid_sphere_scattering(
    0.1,        // radius
    1000.0,     // frequency
    343.0,      // speed of sound
    1.21,       // density
);

// Configure solver
let solver = BemSolver::new()
    .with_mesh_refinement(3)
    .with_solver_method(SolverMethod::Direct);

// Solve
let solution = solver.solve(&problem)?;

// Evaluate field at a point
let pressure = solution.evaluate_pressure(&[0.0, 0.0, 0.2]);

Structs§

BemProblem
Definition of a BEM problem
BemSolution
Solution of a BEM problem
BemSolver
BEM solver configuration

Enums§

AssemblyMethod
Assembly method for the BEM matrix
BemError
BEM solver errors
BoundaryConditionType
Boundary condition type for the problem
SolverMethod
Solver method for the linear system