Accelerating linear solvers for Stokes problems with C++ metaprogramming

Denis Demidov, Lin Mu, Bin Wang
6/10/2020
1 citation
cs.MScs.DCcs.DS

Official code: ddemidov/amgcl (889 stars, C++, MIT, last commit 2026-11-10). 1 more implementation below.

Abstract

The efficient solution of large sparse saddle point systems is very important in computational fluid mechanics. The discontinuous Galerkin finite element methods have become increasingly popular for incompressible flow problems but their application is limited due to high computational cost.

Show full abstract

We describe the C++ programming techniques that may help to accelerate linear solvers for such problems. The approach is based on the policy-based design pattern and partial template specialization, and is implemented in the open source AMGCL library. The efficiency is demonstrated with the example of accelerating an iterative solver of a discontinuous Galerkin finite element method for the Stokes problem. The implementation allows selecting algorithmic components of the solver by adjusting template parameters without any changes to the codebase. It is possible to switch the system matrix to use small statically sized blocks to store the nonzero values, or use a mixed precision solution, which results in up to 4 times speedup, and reduces the memory footprint of the algorithm by about 40\%. We evaluate both monolithic and composite preconditioning strategies for the 3 benchmark problems. The performance of the proposed solution is compared with a multithreaded direct Pardiso solver and a parallel iterative PETSc solver.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
ddemidov/amgclOfficial889C++MIT2026-11-10
ddemidov/cppstokes_benchmarksOfficial2C++–2020-11-26
ddemidov/amgclOfficial100%
MIT

C++ library for solving large sparse linear systems with algebraic multigrid method

889147C++, CMakeDec 3, 20123 weeks agoMIT
amgc-plus-pluscppcudagpgpu+7 more

Source code for the benchmarks in "Accelerating linear solvers for Stokes problems with C++ metaprogramming"

20C++, CMakeOct 24, 20206 years ago

Similar Papers

Cite this paper

@article{demidov2020accelerating,
  title  = {Accelerating linear solvers for Stokes problems with C++ metaprogramming},
  author = {Denis Demidov and Lin Mu and Bin Wang},
  year   = {2020},
  eprint = {2006.06052},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2006.06052}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2006.06052.svg)](https://codeofpaper.com/paper/2006.06052)

Discussion