Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Create Block Preconditioner that Requires Matrix Multiplication

More
4 years 2 months ago - 4 years 2 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 2 months ago by bfadness.
More
4 years 2 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.159 seconds