Create Block Preconditioner that Requires Matrix Multiplication

More
4 years 9 months ago - 4 years 9 months ago #2311 by bfadness
Hi.
The attached file solves the mixed formulation of the diffusion equation as a block system . I would like to create a specific preconditioner:

BlockMatrix( [ [D, None], [None, M] ] )

in which D = diag(a.mat) and M is the symmetric Gauss-Seidel (GS) matrix for

Y = b.mat @ D-1 @ b.mat.T

where @ means matrix multiplication. I know one can create Jacobi and GS preconditioners , but I first need to compute matrix Y. Is this possible in NGSolve, so that Y can be a BaseMatrix for GS?

I would appreciate any advice about best practices for doing linear algebra in NGSolve.

Thank you,
Barry
Last edit: 4 years 9 months ago by bfadness.
More
4 years 9 months ago #2316 by lkogler
If you want to create a Jacobi or GS smoother, you explicitely need Y as a sparse matrix. You can create D^-1 as a Sparse matrix with SparseMatrixd.CreateFromCOO. The @ operator can perform sparse matrix multiplication.

Note that the L2 space does not have any DOFs associated with boundaries, so setting Dirichlet values for an L2 space does not do anything.

Best,
Lukas
The following user(s) said Thank You: bfadness
Time to create page: 0.092 seconds