zoomy_core.symsolver.numpy_backend.assembly#
Assembly of a cell operator by colouring and the host AMG solve, shared by the numpy and JAX runtimes (pure numpy / scipy / pyamg).
References
Griewank, Walther 2008, https://doi.org/10.1137/1.9780898717761
Bell, Olson, Schroder 2022, https://doi.org/10.21105/joss.04142
Module Contents#
Functions#
Sparsity of a cell operator on |
|
Distance-2 colouring of the stencil pairs |
|
GMRES preconditioned by a smoothed-aggregation AMG hierarchy of the cell-block-scaled
matrix; the hierarchy in |
API#
- zoomy_core.symsolver.numpy_backend.assembly.cell_pattern(n, nc, nbrs, n_rows=None)#
Sparsity of a cell operator on
k = n / nccell-major unknowns: each couples to those of the cells in its LSQ stencil.Returns
rows, colsin CSR order and a colour per column such that columns sharing a row differ.
- zoomy_core.symsolver.numpy_backend.assembly.cell_colors(c, d, nc, seed=0)#
Distance-2 colouring of the stencil pairs
(c, d)by speculative parallel greedy (a clash with a heavier random-weight neighbour retries).
- zoomy_core.symsolver.numpy_backend.assembly.host_amg_solve(vals, rhs, rows, cols, n, k, ls, pyamg, cache, transpose=False)#
GMRES preconditioned by a smoothed-aggregation AMG hierarchy of the cell-block-scaled matrix; the hierarchy in
cacheis lagged: rebuilt everyls['amg_rebuild']solves, or once the iterations exceedls['amg_growth']times those after the last rebuild.Args
vals,rows,cols: the(n, n)matrix in COO form,k x kblocks per cellls:tol,restart,maxiter,amg_rebuild,amg_growthcache: a dict kept between the solves of one operator
Returns
the solution,
rhs’s dtypeReferences
Saad, Schultz 1986, https://doi.org/10.1137/0907058
Bell, Olson, Schroder 2022, https://doi.org/10.21105/joss.04142