- Thank you received: 0
Create Block Preconditioner that Requires Matrix Multiplication
4 years 11 months ago - 4 years 11 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:
in which D = diag(a.mat) and M is the symmetric Gauss-Seidel (GS) matrix for
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
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
Attachments:
Last edit: 4 years 11 months ago by bfadness.
4 years 10 months ago #2316
by lkogler
Replied by lkogler on topic Create Block Preconditioner that Requires Matrix Multiplication
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
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
Attachments:
The following user(s) said Thank You: bfadness
Time to create page: 0.126 seconds