Skip to main content

math_audio_fem/
lib.rs

1//! Multigrid FEM solver for Helmholtz equation
2//!
3//! This crate provides a finite element method solver for the Helmholtz equation
4//! with adaptive mesh refinement and multigrid acceleration.
5//!
6//! # Features
7//!
8//! - **2D and 3D meshes**: Triangles, quadrilaterals, tetrahedra, hexahedra
9//! - **Lagrange elements**: P1, P2, P3 polynomial basis functions
10//! - **Boundary conditions**: Dirichlet, Neumann, Robin, PML
11//! - **Multigrid solver**: V-cycle, W-cycle with geometric coarsening
12//! - **Adaptive refinement**: h-refinement with residual-based error estimation
13//!
14//! # Example
15//!
16//! ```ignore
17//! use math_audio_fem::{FemProblem, FemSolver, mesh};
18//!
19//! // Create a 2D mesh
20//! let mesh = mesh::unit_square_triangles(10);
21//!
22//! // Define the Helmholtz problem
23//! let problem = FemProblem::helmholtz(mesh, k);
24//!
25//! // Solve
26//! let solver = FemSolver::new();
27//! let solution = solver.solve(&problem)?;
28//! ```
29
30pub mod assembly;
31pub mod basis;
32pub mod boundary;
33pub mod mesh;
34pub mod multigrid;
35pub mod neural_multigrid;
36pub mod quadrature;
37pub mod schwarz_pml;
38pub mod solver;
39pub mod waveholtz;
40
41/// Library version
42pub fn version() -> &'static str {
43    env!("CARGO_PKG_VERSION")
44}
45
46#[cfg(test)]
47mod tests {
48    use super::*;
49
50    #[test]
51    fn test_version() {
52        assert!(!version().is_empty());
53    }
54}