- Thank you received: 0
What block preconditioners really do
- jan@papez.org
- Topic Author
- Offline
- New Member
Less
More
4 years 6 months ago #2676
by jan@papez.org
What block preconditioners really do was created by jan@papez.org
Hello,
I wonder what block preconditioners build using
really do.
In my code, I want to use block Jacobi smoother and I observed that
gives different results than
Do I miss something? I use quite particular construction of blocks for block smoother (I consider the dofs corresponding to each patch but those on the boundary.). Nevertheless, I would not expect such behavior for any block smoother.
Many thanks for any help,
Jan Papez
I wonder what block preconditioners build using
Code:
CreateBlockSmoother
In my code, I want to use block Jacobi smoother and I observed that
Code:
rho.data = smoother * b
rho.data *= weight
Code:
b *= weight
rho.data = smoother * b
Do I miss something? I use quite particular construction of blocks for block smoother (I consider the dofs corresponding to each patch but those on the boundary.). Nevertheless, I would not expect such behavior for any block smoother.
Many thanks for any help,
Jan Papez
4 years 6 months ago - 4 years 6 months ago #2677
by lkogler
Replied by lkogler on topic What block preconditioners really do
BlockSmoother used with the matrix-vector multiplication is Block-Jacobi, so linear.
BlockSmoother used multiplicatively is Block-Gauss-Seidel.
If rho is 0,
and also the symmtric version
are linear operations.
Best,
Lukas
BlockSmoother used multiplicatively is Block-Gauss-Seidel.
If rho is 0,
Code:
smoother.Smooth(rho, b)
Code:
smoother.Smooth(rho, b)
smoother.SmoothBack(rho, b)
Best,
Lukas
Last edit: 4 years 6 months ago by lkogler.
- jan@papez.org
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
4 years 6 months ago #2678
by jan@papez.org
Replied by jan@papez.org on topic What block preconditioners really do
Thank you , Lukas. This is exactly what I learnt from the tutorials. However, then I would expect to have the same results (for the codes given in my initial post), which is not the case.
4 years 6 months ago #2679
by lkogler
Replied by lkogler on topic What block preconditioners really do
You should get the same result.
Could you upload a failing minimal example?
Could you upload a failing minimal example?
- jan@papez.org
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
4 years 6 months ago - 4 years 6 months ago #2682
by jan@papez.org
Replied by jan@papez.org on topic What block preconditioners really do
I enclose an example, which is not very minimal but provides different results for two variants (switch on the line 8 ) of computations on lines 101-106.
( I use a multigrid solver with adaptive stepsize computed on lines 157-160. )
Many thanks for your help!
Jan
( I use a multigrid solver with adaptive stepsize computed on lines 157-160. )
Many thanks for your help!
Jan
Attachments:
Last edit: 4 years 6 months ago by jan@papez.org.
4 years 6 months ago - 4 years 6 months ago #2683
by lkogler
Replied by lkogler on topic What block preconditioners really do
In variant 2 you modify b, which you seem to use again at another point:
Changing this to:
solves the problem.
Another thing: It seems that you are only using blocks consisting of one DOF each. Using ".CreateSmoother()" instead of ".CreateBlockSmoother()" might be cheaper.
Code:
if variant == 1:
rho.data = self.smoothers[level] * b
rho.data *= (1./self.w1) #weightening
else:
b.data *= (1./self.w1)
rho.data = self.smoothers[level] * b
Changing this to:
Code:
if variant == 1:
rho.data = self.smoothers[level] * b
rho.data *= (1./self.w1) #weightening
else:
b.data *= (1./self.w1)
rho.data = self.smoothers[level] * b
b.data *= self.w1
Another thing: It seems that you are only using blocks consisting of one DOF each. Using ".CreateSmoother()" instead of ".CreateBlockSmoother()" might be cheaper.
Last edit: 4 years 6 months ago by lkogler.
The following user(s) said Thank You: jan@papez.org
Time to create page: 0.109 seconds