![]() This same GS scheme is used in the Multigrid solver to iterate \((\phi^n)^*\) and \(\epsilon_c\), with the caveat that the second iteration is on (ni/2) nodes. Hence, the total number of iterations for the GS solver is (num_its*ni*5 (num_its/R_freq)*5). ![]() ![]() This also involved 5 operations but these occur only every R_freq iterations. R_i = (phi - 2*phi phi )/ (dz*dz ) - b #compute residue to check for convergence if (it%R_freq = 0 ): Using this scheme, we have 5 operations per each node per each Gauss-Seidel iteration, I mainly only counted stand-alone multiplications or accesses to the solution vector. This is bit of a fuzzy math, but I tried to stay consistent between the two solvers. Thus, it’s better to compare the number of operations. The GS solver requires 17,500 iterations to converge, while the MG solver needs only 93 loops of the above algorithm to reach the same tolerance! But comparing the number of iterations is a bit like comparing apples to oranges since each MG iteration is much more complicated. This algorithm is illustrated with the attached Python code. $$ \frac = (\phi_f^n)^* – \epsilon_f $$ħ) We then return to step 1 and continue until the norm of the residue vector \(R^n\) reaches some tolerance value. Previously on this blog we saw how to obtain a numerical approximation to the Poisson’s equation \(\nabla^2\phi =b \) using the Finite Difference or Finite Volume method.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |