# How to verify AMG code?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 18, 2021, 12:01 How to verify AMG code? #1 New Member     ibopaul Join Date: Nov 2020 Posts: 12 Rep Power: 5 Hi, recently i made my CFD code which uses algebraic multigrid method to solve compressible Euler equation (cell-centered FVM). I wanted to know this code works properly, by comparing with similar reference papers. However, i couldn't find appropriate reference paper which shows AMG performance(how much does calculation accelerated) while solving compressible Euler equation. Is there any way to verify AMG code? Thank you.

 February 18, 2021, 15:56 #2 Senior Member   Arjun Join Date: Mar 2009 Location: Nurenberg, Germany Posts: 1,273 Rep Power: 34 Take uniform mesh and observe the convergence. At each cycle you should be able to achieve text book efficiency. That is error should drop almost 10 times with each cycle. This shall happen with all the cases you try with uniform and good meshes. If it does not happen then there is something wrong. I was reading a book and the author mentioned that people often get happen with say 5 to 7 times drop per cycle and think that everything is good. He says that if for simple problem it does not drop by at least a factor of 10 then you should carefully check everything and doubt what you have. aerosayan and aero_head like this.

 February 18, 2021, 20:38 Thank you for reply #3 New Member     ibopaul Join Date: Nov 2020 Posts: 12 Rep Power: 5 Thank you for reply. Can you tell me about document you've read? I think i need to study more about AMG. Thank you. aero_head likes this.

February 18, 2021, 22:04
#4
Senior Member

Kira
Join Date: Nov 2020
Posts: 435
Rep Power: 8
Quote:
 Originally Posted by arjun Take uniform mesh and observe the convergence. At each cycle you should be able to achieve text book efficiency. That is error should drop almost 10 times with each cycle. This shall happen with all the cases you try with uniform and good meshes. If it does not happen then there is something wrong. I was reading a book and the author mentioned that people often get happen with say 5 to 7 times drop per cycle and think that everything is good. He says that if for simple problem it does not drop by at least a factor of 10 then you should carefully check everything and doubt what you have.
I am similarly investigating the AMG. Would love to read this book you have mentioned. What is it called? As well, do you have any papers on the topic?

 February 18, 2021, 22:53 #5 Senior Member   Arjun Join Date: Mar 2009 Location: Nurenberg, Germany Posts: 1,273 Rep Power: 34 I have been reading lots of papers and books over last 20 years so it is hard to pin point where i read that. (it goes back at least 8 years when i read it). So I point out two most useful documents that i ever read on amg: https://www.researchgate.net/publica...al_2nd_Edition https://www.ljll.math.upmc.fr/~frey/...0multigrid.pdf Read both of them, they were very useful to me in learning it. aerosayan, ibopaul and aero_head like this.

February 18, 2021, 23:50
#6
Senior Member

Kira
Join Date: Nov 2020
Posts: 435
Rep Power: 8
Quote:
 Originally Posted by arjun I have been reading lots of papers and books over last 20 years so it is hard to pin point where i read that. (it goes back at least 8 years when i read it). So I point out two most useful documents that i ever read on amg: https://www.researchgate.net/publica...al_2nd_Edition https://www.ljll.math.upmc.fr/~frey/...0multigrid.pdf Read both of them, they were very useful to me in learning it.
Thanks Arjun!

I also just found this: https://computing.llnl.gov/sites/def...05_revised.pdf
where a quote from the book is "Here, solving a problem is defined as reducing the residual by 10 orders of magnitude..."

 February 19, 2021, 00:12 #7 New Member     ibopaul Join Date: Nov 2020 Posts: 12 Rep Power: 5 Thank you for recommendations!

 February 19, 2021, 02:44 #8 Senior Member   Arjun Join Date: Mar 2009 Location: Nurenberg, Germany Posts: 1,273 Rep Power: 34 Here is quote from page 56 of first document "Diagnostic Tools As with any numerical code, debugging can be the most difficult part of creating a successful program. For multigrid, this situation is exacerbated in two ways. First, the interactions between the various multigrid components are very subtle, and it can be difficult to determine which part of a code is defective. Even more insidious is the fact that an incorrectly implemented multigrid code can perform quite well—sometimes better than other solution methods! It is not uncommon for the beginning multigrid user to write a code that exhibits convergence factors in the 0.2–0.3 range for model problems, while proper tuning would improve the factors to something more like 0.05. The difficulty is convincing the user that 0.2–0.3 is not good enough. After all, this kind of performance solves the problem in very few cycles. But the danger is that performance that is below par for model problems might really expose itself as more complexities are introduced. Diagnostic tools can be used to detect defects in a multigrid code—or increase confidence in the observed results. aerosayan and aero_head like this.

 February 19, 2021, 04:46 #9 New Member     ibopaul Join Date: Nov 2020 Posts: 12 Rep Power: 5 Thank you very much for detailed explanation! I will study by reading the recommended document. Thanks again. arjun likes this.

 Tags algebraic multigrid, verification