An NGSolve addon providing algebraic multigrid preconditioning via AMGCL.
- AMG preconditioner for NGSolve sparse matrices
- Shared memory parallelism (OpenMP)
- Multiple coarsening strategies: smoothed aggregation, Ruge-Stuben
- Multiple relaxation schemes: SPAI-0, Gauss-Seidel, ILU0, damped Jacobi
- Seamless integration with NGSolve iterative solvers
pip install git+https://github.com/cerbsim/ngs_amgcl.gitgit clone --recursive https://github.com/cerbsim/ngs_amgcl.git
cd ngs_amgcl
pip install --no-build-isolation .git clone --recursive https://github.com/cerbsim/ngs_amgcl.git
cd ngs_amgcl
mkdir build && cd build
cmake ..
make -j4 installfrom ngsolve import *
import ngsolve_amgcl
# ... set up mesh, FESpace, BilinearForm a ...
# Configure AMGCL options
opts = ngsolve_amgcl.AMGCLOptions()
opts.coarsening = "smoothed_aggregation"
opts.relaxation = "spai0"
# Create preconditioner
pre = ngsolve_amgcl.AMGCLPreconditioner(a.mat, fes.FreeDofs(), opts)
# Use in a CG solver
from ngsolve.krylovspace import CGSolver
inv = CGSolver(mat=a.mat, pre=pre, printrates=True, tol=1e-8)
gfu.vec.data = inv * f.vec"smoothed_aggregation"(default)"ruge_stuben"
"spai0"(default) - Sparse Approximate Inverse"gauss_seidel"- Gauss-Seidel"ilu0"- Incomplete LU factorization"damped_jacobi"- Damped Jacobi
MIT