 Okay, so what we were doing in the last class, we were looking at multigrid methods, right, we were looking at series of mechanisms by which we could accelerate convergence of our schemes, numerical schemes. So these are in a sense modifications to a fundamental scheme, you have a fundamental scheme and now you are asking the question is there a way by which I can make this scheme faster, meaning from the point that I start the computation to the time that it takes, wall clock time, I look at the clock and say it takes so much time that it takes for me to get the solution, okay, I want to reduce that, making sense I am not really interested in other details, I mean there are situations where you can look at, right, you can say that the hole is equal to the sum of the parts, if I minimize, if I optimize the individual parts then the hole will also get shrink down, but you will see sometimes that does not quite work out when you try to shrink one the other expands and so on. So we have to keep our eye on the fact that the metric, the measure that we are using to see whether we have made an improvement is we start and we look at the clock, it stops and we look at the clock and we say yes it is taken less time, okay, never lose sight of that because it is easy to get caught up in all the numbers, CPU times, all of this kind of stuff and lose sight of the fact that the overall time is not either reducing so you are putting in effort but you are not getting anything out of it, fine. In the last class we looked at a particular scheme, right, the last sort of half of that class we looked at a particular scheme which was essentially a multigrid method and the idea was that we are going to use multiple grids just to recollect multiple grids in order to accelerate convergence, fine. And that, where did that come from, that came from the fact that we said that high frequencies when we say a signal, say now I will, today I will use a little signal processing kind of terminology, we say high frequency, right, when we say high frequency we have already noted from a previous demo that when we say high frequency we mean high frequency with reference to a grid, high and lower comparative term, the terms that you use to compare two things. So you need two things and you have to have another, right, so the other is the grid, the underlying grid, what is the structure of your underlying grid. So on an equally spaced grid, a high frequency and low frequency with reference to that grid are defined and there were schemes that we saw where high frequency is decayed faster than low frequencies. See now I am careful, there were schemes that we have seen where high frequencies decay faster than low frequencies, that means that there are schemes for which that may not necessarily be true, right, in which case we need to do something for that. Today I will tell you something about that, okay. Then so what we basically said was well if the high frequency is decayed faster than low frequencies and then we have this low frequency error with which we are trying to contend essentially the grid that we have at hand is struggling to decrease that error, why not transfer the problem to a coarser grid so that this low frequency error on the fine grid turns out appears to be a high frequency error on the coarser grid, okay and therefore we will decay faster on that coarser grid, that is the idea, that is the basic idea of multigrid method, okay. Now today what we will try to do is we will try to write out the whole scheme, so first I will recollect where we left it, try to write out the whole scheme and then we will see what are the steps that we need to take in order to how should I say make sure that everything is fine, little patch work that we need to do, right. There are schemes which may not be inherently you know high frequencies decaying faster than low frequency, we have to do something for that, that is one thing, we still want to transfer the problem from a fine grid to a coarse grid but we may have to do something for that, okay, that is one thing that we have to do and the other thing is all I have said so far is, all I have said so far is it is going to run faster, it is going to decay faster, will it, what is the effort involved in doing this, how much work are we actually doing, right, so before you write the program and look at the wall clock time and so on, we are going to ask ourselves the question, how much work is it actually going to take in order to do this, okay, work in the sense that computational work, there is also implementation related work and I will sort of say something about that as we go, is that fine, okay. So first just recollect where we were, we started off remember that the grid size we talked about was H, so this is a typical grid size, what that means is that if I have, that is supposed to be equally spaced, it does not quite look equally spaced, if I have equally spaced grids, right, a typical grid size is H and if I have a linear problem and I will tell you what to do when you have a nonlinear or quasi-linear problem, linear problem, I chose Laplace equation to, I chose Laplace equation as an example but it could be any system of equations that we talked about, AH, PH equals FH, we are trying to solve this and what I indicated was that we iterate, we iterate this a few times or if it is a time marching scheme, we march in time, right, a few time steps, so we do this, what was the symbol that I used for the number of iterations, was it alpha, n times, n times, n times, n times, I am going to regret that but anyway n times, we are going to iterate it n times, okay. So then what, what we do from here, remember the algorithm, we get the residue, we get the residue, so we get RH which equals FH-ph where this phi is that intermediate solution, capital phi is the intermediate solution, we get the RH, then what we transfer RH to F2H, F2H, right, if you want to write it as a equal, an equation in books that you may look at, they may write something like F2H, this is a typical notation, right, so if you can actually write a matrix form, matrix form of this, I will recollect for you what each of these things, right, we will go through that, so you transfer from RH to F2H, on the grid with whose size is 2H, you then solve, you then either solve or you iterate a few times or take time steps appropriately, okay and do this, if this was n1 times, this could be n2 times, they could be the same, they could be different, you have some magical reason for making them different, it is up to you, okay. Then we said look, right, if you start with a very fine grid, it is possible that the 2H grid is also reasonably fine, so you can then compute after iterating a few times and then you say oh it is not converging fast enough, I am not happy with this, you can actually compute a residue there, which you transfer to F4H, am I making sense, okay and then consequently we will solve and repeat this process, at this point actually you know the phi is not actually phi, it is a correction, if you think back to the algorithm, phi is actually a correction, so how the reverse mechanism, how does the reverse mechanism work? You take the phi 4H that you have got from your iterations, that is your iterate, you could go on but I will tell you what happens from phi 4H and you transfer that to E2H, that is the correction at, okay and the new phi 2H equals the old phi 2H, okay now you have lots of options, see this is the thing about the algorithm, developing the algorithm you can see there are lots of options, if you want and I would do this, you can also sort of iterate a few times there, m times if you want, okay, so you iterate at that level and then you get a phi at that level, right, the F does not change if you want, right, then you can transfer, okay, this transfer by the way you could write, if you wanted to write it as an equality just so that if you would look at books I want you to make sure that you have the notation, you would write this V2H equals along the same lines, I4H to 2H, phi 4H, right and you can actually write it as a, if these are vectors you can actually, you can actually cook up, you can find out what this matrix is depending on what kind of interpolation or whatever it is that you are doing, right, we will look at, I will give you the appropriate terminology, we will go over this blackboard again one more time, right, is that fine everyone and then you would say phi H equals, right, that is the correction at the H level, maybe m times and at the finest grid you always ask the question, you compute RH, say I am repeating now, I am repeating the first line now, we are back to the first line but you can ask the question, have we converged, right, you always iterate on the finest grid a few times and ask the question have we converged, does that make sense, you want, I mean the reason why we are making this effort is I want a grid on that, I want a solution on that fine grid because that is the resolution that I want, that is what I am looking for, right, I have decided I have looked at the problem, I have looked at, I have an idea, I have a sense as to what the flow features are like and I have said okay I need a grid that is 1 millimeter in size, let us take actual physical dimension, I need a grid that is 1 millimeter in size, I want a solution on a grid that is 1 millimeter in size, so having decided that I pick an H which is 1 millimeter and I go through this process, right, so I want to make sure that when I finally decide, yes I have the solution, I am making the decision on the 1 millimeter grid, not at the other grid, okay, the question always arises at this point, okay, I do not care about the other residues that we have calculated, is that fine, is that okay, are there any questions? Now we will go over this with a little detail, we will check out, fine, we will just check out little of the few of the things, how do we decide, what is the point here, how many times do we treat, is there a mechanism by which we can decide how many times we treat, is that just an arbitrary parameter, should we have a method by which we should decide how often we treat, think back to our demo, see I said there is a highest frequency that we can represent on a given grid, okay, so if I am going to go from a grid, okay, maybe we should say something about grids first, okay, so if I am going to go from this grid to a really coarse grid, it has only one unknown, right, I am going to go with 3 interior points to 1 interior point, then I have to make sure that I have iterated enough on this, that there is no component of what I am going to transfer, the residue that I am going to transfer, which has a frequency higher than what this can represent, okay, if you go back, think back to the demo, otherwise what will happen is you will get what the signal or signal processing friends in electrical engineering call aliasing, basically that high frequency error will fold back into a low frequency end, am I making sense, and we will start getting a residue here which is spurious, which is not the right residue, okay, so if you talk to your friends who have done signal processing in electrical engineering and so on, they would call this process either decimation or down sampling, so if you are going to do decimation or down sampling, the first thing that you have to do is you have to remove the frequency content that you cannot represent on the coarse grid, if you cannot represent it, it will only show up as an error, it will only contaminate the residue that you have in the coarse grid, okay. So one possibility is you iterate enough number of times, so that all that high frequency error, that is right, right now that is what we have, all that high frequency error is eliminated on possibility, okay, we clearly have to come up with some other way to do this because remember I said there may be schemes that do not decay high frequencies, there may be schemes that do not decay high frequencies fast enough, right there are all sorts of issues, so but we have to decide, so you iterate enough number of times, you have to make sure that you have done it enough number of times, that you have only the frequency content in the residue that you are going to represent on the coarse grid, is that fine, otherwise anything that you transfer from the fine grid to coarse grid will show up in the wrong place, okay, right, okay, you show up in the wrong place in our frequency domain, that is if you look at it in terms of frequency, okay, right, so that is bad, that is not good, that is not what we want, fine. The second thing is, so this is, this we have to see is there something else that we can do here, right, what else do we have? You transfer from here, maybe we will stick with this, maybe I will finish with this first and then let me see, where can I write that, I have this, I am already at Rh, I will write it here, so just say you have a scheme, so before I get back to that, so let us just say, right, we will take an aside and look at this, let us just say you have a scheme that is not dissipating fast enough or, right, or you decide that you are going to iterate a fixed number of times or take time steps a fixed number of times, 5 times steps, 10 times steps, right, simply because you remember something I told you earlier when we are doing SOR, I basically said look, do not look, wait for it to converge to certain extent because you do not know how long it is going to take, you are committing unknown amount of CPU time, right, unknown number of iteration, always bound the amount of computation that you are willing to do, so you say 5 times, I am willing to iterate 5 times, but that why not eliminate all the high frequencies, but we know one operation that eliminates high frequency, we have seen it, when we did our, when we did our looking at high frequency, when we first encountered high frequencies decays faster than low frequency, that is what, that is either the heat operator or the Laplace operator, we have seen it, that is guaranteed, that really kills it, right, so if you have in two dimensions, if you have four grid points, you take the middle fellow and take the average as the average of the four, right, we have seen that, it is a solution to Laplace's equation, right, that sort of decays and it decays quite fast, I do not want, I mean I actually have a value here, right, so I do not want to just throw away what I have at that point, so instead what I will do is I will take the average of these two, average of these four, right, that gives me a central value, I already have a central value, I will take the average of those two, what do I mean by that, I have values a, b, c, d and at the center I have e, okay, this is what we would call Laplacian smoothing, what I would do is I would say a plus, right, that is the Laplace operator, we recognize that for an even grid, okay, that is like taking omega equals half in SWR, right, omega equals, does that work out half, omega equals what, 1.5, 0.5, we are not sure, 0.5, okay, I just throw with that, I am just throwing that out there to see, okay, fine, I am just painting you, okay, so what do we have, so this of course turns out, so the way this would, the way this would work out if you were to, so you can see the Laplace operator here, the way this would work out if you are going to actually apply it to R, so what are we going to apply it to, we are going to apply it to R, I have iterated a few times, I have decided say five times, I have iterated, I have iterated this equation five times, I have had enough doing iterations at that level, I compute the residual, I have no clue what is the, what is the spectrum, I have no clue what frequency is Rhs, all I want to do is I want to eliminate those high frequencies, okay, so what I am going to do is, I know this will do it, I know the Laplace operator will do it for me, so I am going, I am proposing to smooth R before I do the transfer, am I making sense, I am proposing to smooth R, this is called Laplace in smoothing, so you would write R at any grid point as, is that okay, if you work out that fraction that I had earlier, you will see it will be four times, so the R smoothed, the R smoothed would be basically that, okay, so you can do one sweep, you do not feel comfortable, do two sweeps, I guarantee those high frequencies will be gone, now transfer the smoothed R, okay, so now we are going to add a new, we will add a new step, now we have a new improved step that we have, so which is why I strategically left myself a gap here, okay, so smooth Rh, fine and then do a transfer, then do a transfer, is that fine, so at each level you can do that, at each level you can smooth Rh and then do a transfer, so this F2H now, this F2H is not going to have any content that it cannot write, that grid cannot represent and then as a consequence you can iterate this and again I would iterate it a few times, smooth, again so we will have smooth and do the transfer, okay, fine, so at every point when you are doing a transfer you smooth, you calculate, compute the residue, find R, that is how it goes, that is how it goes, okay, is that fine, everyone, okay, so this is as far as making sure that there is no contamination, there is no contamination when going from the fine grid to coarse grid, okay, so we need to do one more thing, we will look at, is that fine, okay, everyone, you can do smoothing, of course you can do, you can do a similar kind of smoothing on the way back, we will get to that, the next thing that we do is we want to look at this, what is this operation, what is this operation that we have, okay, so how are we going to do this average, I mean how are we going to do this transfer Rh to F2H, how do we do the actual transfer, I think I can remove this, I need it, I will come back, right, okay, but in order to see the transfer we are going to actually look at what are the kinds of, what kind of grids, what are these multiple grids that we are going to generate, we look at the, we look at how it would, there is an underlying structure, we look at that, okay, and then look at what is the transfer, how, what is the business of transfer, what are the ways by which you can transfer, so we will start at the courses level because that seems to be the, and see if we get a pattern, that seems to be the easiest, so the courses level is 1 grid point, interior grid point, 3 grid points on the whole, the next level is 5 grid points, is that right, what is the next finer level, 9, where do you think this is going, so it is going to be basically going as 2 power n plus 1, now you know why I did not want n iterations, 2 power, 2 power I have also used them, k plus 1, okay, is that fine, right, 2 power k plus 1, so k equals 1, k equals 2, k equals 3 and so on, fine, okay, so you could for instance, you could for instance if you wanted a fine grid, so you would not start with, I would not start with 1001 by 1001, right, because that is thinking decimal, I would start with 1,025, you know I would start with 1,025 grids, if I had a 2 dimensional problem it would be 1,025 by 1,025, whether I start with 1,025 grid and the next level of grids would be 513, you understand, and 257, now you understand why you need to go to multiple levels, this is 257 grid, this is still pretty fine, it is just that we want the answer on, 1 meter length, we want the answer on something that is at the order of 1 millimeter, okay, 1025 is close enough, okay, so then you would go to 129 and so on, and you can go all the way down to 3, right, if you want, so this is the number of levels that you can transfer, so this is h, that is 2h, 4h, 8h, we have tried, I mean I think we have gone up to like 7 levels or something like that, right, okay, so you look at this process, so now we know we can pick up grids like this, this is in 1d, what about 2d, we take the Cartesian product of it obviously, right, so that could be 3 by 3 grid, am I making sense, to that you can add maybe I will use a different colored chalk, oops, that is a 5 by 5 grid, am I making sense and we can go on, you can make it a 7 by 7 grid and so on, right, you can make it a 7 by 7 grid, maybe I will choose that, is that okay, get a 7 by 7, right, 9 by 9 grid, okay, I am back, 9 by 9 grid, sorry, thank you, 9 by 9 grid, doing suddenly 2n-1 instead of 2n-1, 9 by 9 grid, that is one way to do it, right, so I am constructing it up, the other thing is if you had a 9 by 9 grid, you can throw things away in what we call the checkerboard pattern or the chessboard pattern, okay. So you do not have to, you can for instance, you can start, you know, you can retain this grid point, retain that grid point, retain that grid point, retain that grid point, okay, then you can retain this one, retain this one, retain this one, am I making sense, oops, am I making sense, It is like the black and white squares of a chess board, is that okay. So there are obviously once you go to 3 dimensions, 2 dimensions they are in different ways. So this is called coarsening, there are different ways of doing of coarsening, okay, is that fine. So now what we want is, so we want, if you want to go from a coarse grid, if you want to go from a fine grid to a coarse grid, in the multi-grid, right, as I said signal processing, they would call, say you go through a down sampling or whatever, the multi-grid terminology that is called a restriction, you restrict, right, you restrict. So what you would basically do is, you would now, this is what I was talking about, how do I find that, I will write that here. So what are the ways by which we can do it, right. So one thing is, just pure simple injection as they call it. What you do is, you just throw away the points that you do not want, right. So if you have, okay, let us look at this, you have 5 grids and you want to go to 3 grids, you just throw this away, that is one way to do it, right. Another way to do it of course, a better way to do it, another way to do it, a little more expensive, we have looked at it in the last class, you take the average, okay, and a familiar average. The average would be, if this is p, p-1, p-1, the average would be, so we are going from, this is residue, remember, so rp-1-2rp-rp-1 divided by 4, would give you the value at that point. It looks very suspiciously like Laplacian, right, very suspiciously like Laplacian. These are all at h, this will be rp-at, rp-at, 2h, the value here would be twice this, plus each of those divided by 4, okay. What if you are doing in 2D, how would you do it in 2D, I am not going to do 3D because it is, I mean, you can work it out but it is a pain to draw the picture but I will do it in 2D, okay. So this would be a full, the best transfer and the most expensive transfer, most operations, you want to get that, you want to transfer the value at that point. So you have 1, 2, 3, 4, 5, 6, 7, 8, 8 of those, so what are we going to do now? 8 of those plus 8 of these, right, divided by 16, am I making sense? 1, 2, 3, 4, 5, 6, 7, 8, add up all of those plus 8 times the central fallout divided by 16, am I making sense? So the logic is now, you can see the where it is coming from. So that would be, that would be a, of course I mean you could in theory add more points to it, right, you could increase the support so to speak, you could add more points to it but this is itself, there is a certain expense but you are taking all the points that you are planning to throw away, you are taking data from all the points that you are planning to throw away, let us say idea here, right, if you are going to take this point, its neighbours are not going to be used, right. So in this case, if you are going to take this point, unless you are doing the checkerboard pattern, unless you are doing this pattern, if you are just doing the standard, right, the standard coarsening, this is called the standard coarsening, so if you are going to do only the standard coarsening, then you are going to throw away all the a neighboring point right. So this should be determined really by all the neighboring points. Am I making sense? So you would say summation what should I say? So L in the surrounding set L not equal to P simultaneously or L P not equal to I should write that a little more carefully, Lm so except for that, except for that 1 plus 8 times okay, is that fine? So this is how we do the, this is how we do the transfer, this is how we are going to do the transfer. So this will allow you, if you work it out for a grid for a, I would suggest that you start off with a one dimensional grid. You are not and you are never really going, this is only for the sake of our explaining the algorithm to ourselves. You are not going to really you know write this matrix but you can just for the fun of it to see what the structure looks right, try to write it out and see what it looks like okay. So you do the transfer okay, you do the transfer this way. Am I making sense? Is that fine? You do the transfer there are different ways by which you can do it, you can do the averaging depending on 1D, 2D or 3D right and you transfer it to the coarser grid. Maybe we will come back to this, I will leave that portion. What else do we have? So we have done the, we have done, we are now going through this whole process. How do we get back? How do we do this transfer? How does the reverse transfer take place? So I want to go from a coarse grid to a fine grid. So I have to interpolate. So now see there will be cases. So you have to look at the various cases. One case is the point is actually in this set okay. So typically the notation that you would write is, this is the grid, well this is the grid at 2H and that is the grid at H and 2H but it is okay. What you would basically, so if this belongs to the finer grid, just transfer the data directly. If it does not belong from the coarse grid, there is no candidate, take the average. 1D it is obvious. So go to 2D. In 2 dimensions, if this grid belongs to the fine grid, transfer it directly. If it does not belong but it happens to be, so in this case this is a funny mesh. Let me draw another mesh. Where can I draw it? I will draw it here. I need to erase something. I will erase this. I no longer need this. There we go okay. So what you have done is, this is the coarse grid. That is the coarse grid. I am doing standard coarsening. That is the coarse grid. So if it belongs to the same grid line, it is on the same grid line but does not belong to that mesh, take the average, same thing okay. So you can take, in order to find this, you can take the average of these 2. If it does not belong to the same grid line, so this works even here right. Even in the vertical direction it works. If it does not belong to the same grid, that is like this. It is a little more complicated. You take the average of the 4 okay. Is that fine? Right? So on this side, take the average this way. On that side, take the average that way. And in the center one, take the average of the 4. Have I missed anything? I think that covers all possibilities. Is that okay? That covers all possibilities. Right? So that is how you transfer from a coarse grid back to a fine grid. So the correction. That is how the correction would be transferred from a coarse grid back to a fine grid. Is that okay? So if you say that I want phi 2h to go to EH, this is what you would use. Fine? So now we come to the critical question. So we have got an algorithm. What we are able to do is we are, we have the solution presumably. We iterate a few times on the fine grid. Right? And we can transfer down residues to coarser and coarser grids. Transfer back corrections to finer and finer grids. We have these nuances, residual smoothing and so on. Do all of those kinds of things. Right? All that needs to be done. We have an algorithm. What does it cost us? Okay? What does it cost? On what grid do we want the solution? So back here, on what grid do we want the solution? We will pick a big problem. 1025. So maybe I would say 1025 by 1025 or 1025 by 1025. Okay? This is the grid on which we want the solution. Fine? So if you were to take either whatever equation you are solving, Laplace's equation for example is a good place and you are iterating, it would take a certain number of iterations to get a solution on the grid of size 1025. A solution that is to your satisfaction. Right? 5000 iterations. 5000 iterations, 1025 grid point. Am I making sense? Okay? So if you were to in between transfer the problem to a 513 grid point, grid, a mesh that has 513 points, then 2 iterations here is the same as 1 iteration there. Right? Remember when we are talking about one of the things that I said when you find out how fast is my computer program running, what was the, what did I ask you to do? I told you to find CPO time per grid point, per iteration or per time step. Okay? CPO time per grid point or per iteration or per time step. That gives you a measure of your program, what it is up to. So if you, right, I do not, why should averaging be more expensive just because I am on a course of grid? That does not make sense. Right? So I do not expect, right? Unless you do something really bad in your programming, I do not expect that the 513 by 513 CPO time per grid point per iteration will be more than this. So the work per grid point is the same. Okay? Work per grid point is the same. So now I want to get a measure, right? So I will say wait a minute, if you did not do multi-grid, you would be doing so much work, so much work on 1025 grids. So I will call one sweep or one time step or whatever scheme that you are using through this 1025, your finest grid, I will call that one work unit. Right? We will start off by defining what do I mean by this work. We will call that one work unit. Am I making sense? Sweeping through this, your finest grid, making one iteration or one time step, I will call that one work unit. So if I have one work unit here, two iterations here will correspond to one work unit or basically one iteration here would be one half work unit. One iteration here would be one fourth work unit. Right? And so on. One eighth work unit. Am I making sense? So it is better for me to be doing 8 iterations here in comparison to one iteration there. Okay? So I will show this process of going from course grid to fine grid in a graphical fashion. And this is a standard graphical fashion that people use in order to demonstrate multigrid method and because the picture evokes an image, I mean there is a letter. It gives it a name. So what you do is, this is at the level h. I go from h to 2h, 2h to 4h, 4h to 8h. It will go 4 level. Back to 4h, back to 2h, back to h. Okay? So this represents one cycle because of the way it looks. It is called a V cycle. And of course, you know it is called a V cycle because there is going to be another cycle. Right? A different cycle. What is a different cycle? I basically look at this and say wait a minute. You mean this takes one work unit and this takes only one eighth work unit? I want to spend a lot of time here. After all, I am always going to end there. So I want to spend more time here. So what you do is you go h, 2h, 4h, 8h, 4h. Now you have a choice. And go back to 8h, 4h. Yeah, I like that. I like that. Right? Fine. This is called a W cycle. And obviously, W cycles come in lots of flavors. Right? The minute you see, the minute you create the renovation, lots of things that you could go 8h, 4h, 2h, come down. Or you could go 8h, 4h, 2h, 4h, 2h, 4h, 8h. You know, you can see. I want to spend a lot of time down here. Right? Because it does not cost me anything. Right? As long as I come back and iterate a few times at 8h, because then I say, hey, residue has gone to 0 at 8h, I have got the solution. Am I making sense? Right? Okay. Are there any questions? The work units in one dimension go as 1, 1, 1, 1, 1, 1, 4, 1, 8. How about in 2d? It goes down faster. Right? So in 2d, so in one dimension, this is work units per sweeper, time step or iteration or whatever. 1 by 2 power k kind of a thing. Okay? Like 1 by 2d, 64. That is great. Now we know 3d is where we want to do this. Though I have not shown anything. 3d, so the savings are enormous. 1d you may not, you know, you do a toy problem just to learn how to do this. But you have to do at least 2d. Right? In order to say that wow, I have got something really great. So this is going to be 1 and that is going to be 8. Right? Am I making sense? 32, what is that going to be? 128, 64, 2 power, this is 2 power 2, 2 power 4, 2 power 6, 64. So this is going to give me 2 power 8, 256. The powers of 2 are worth 3k, 512. But you have to pick the right power of 2. They are not only worth knowing but you have to make sure you pick the right power of 2. No use knowing the powers of 2 if you pick the wrong power of 2. Okay, fine. Fine. I mean just look at this. You just go down, right? You just go down a few levels. This is nothing. I mean, so you do, you take 10 time steps on this. 512 time steps on that. That is like taking one time step on the finest grid or one iteration on the finest grid. Why would you not want to hang around there? Right? So if you are doing in 3D, if you are doing 1,025 by 1,025 by 1,025, it is a lot of effort. 1 billion, more than a billion. Right? But you come down, you come down here. It is not that bad. It is really not that bad. Okay. As long as you make sure that you are always checking for your convergence at the, do not forget that. Okay. There is one last thing. You know, there is always a little wrinkle that we can throw in. So why start at a fine grid? Right? This is remember when we talked about initialization, we said, hey, one way to do it is start at a coarse grid and transfer. Yes, we can do it here. Right? So why start at a, so you basically say, why should it start there? Start here. Right? Start at 8H, transfer it to 4H. That is the way to do it. You understand what I am saying? You already have it. You already have it. So the critical thing is what is the, so this multigrid methods, okay, lot of people just do not get into multigrid. You do not see multigrid methods used as often as they should be. Okay. This is what, this is my observation. There are lot of research being done, lot of enthusiasts. If you want to go on the net, you can search for, you can just search for MG net. Enormous amount of resources, huge amount of resources. Right? The critical thing that you have to do to make sure that all of this works is something that you have to do anyway. So you have to make sure, you have to make sure first that you implement this. Right? If you do this, you are set. What are the things that we have here that are different from your standard solution? The standard solution is given a grid, take time steps. Right? Given a grid, take time steps or do iteration. So first of all, your program that you have, the program that you have has to be somehow changed. Right? So if you are talking about Laplace equation, if you have phi and you have a Laplace equation solver, right, that you are using right now, you just have a solver. Right? That says, so give me the boundary conditions whatever in some fashion and solve Laplace's equation. Right? What you need to do is you need to convert that into a function that can be called. So you convert it to a function get phi which takes the grid. It takes the grid or the grid level or whatever it is, which takes the grid level. Am I making sense? Right? Possibly an initial guess and all of that kind of stuff. I do not put everything else. It takes the grid. Right? And it should return to you, it should return for you the residue. Should do an iteration, come back and return a residue or do any iterations and come back and return a residue. Am I making sense? So your program that you have right now that solves Laplace's equation or whatever it is, it has to be changed. It has to become a function because you are now planning to put something piggyback on top of it to make it run faster. Right? So you are going to say do this on a 1025 by 1025 grid and it should come back one iteration and give you a residue or you should be able to say take 10 iterations. This is a little better. Take 10 iterations with this initial guess. Okay? So maybe I will make it a little more. With this initial guess at the level k, take 10 iterations. I am just making it up. Take 10 iterations. Okay? So now you have got this, you can just pass it. Right? And it takes 10 iterations and what it returns is the residue. You can then do, you need to have, what is the next thing that you need to have? You have to be able to do Laplace's smoothing to it. You have to smooth it. Right? So you have to have some smooth which takes a residue. Right? And returns a smooth residue. Am I making sense? Right? As to whether you actually implement it in this fraction, whether you actually have these functions, you will have to figure it out. But what I am saying is these are operations. They are atomic operations. You implement each one of these tests then make them make sure that they work. If you have got this then the rest of it is relatively easy. Then what is the other critical thing that you need? Transferring. You understand what I am saying? So you have to have something ih2 or 2 if you want whichever, I do not know what you call it. You know capital H. Let us make, let us say otherwise we will have too many 2 Hs. Okay. Right? Fine grid course grid. Or it takes R and gives back F, whichever way you want to do it. So this gives me R. This gives me R. This also gives me, this gives me an F. In fact if this is a generic function it will take 2 arguments. It will take the K because you need to know not K. It will take the K. Right? You need to know what level you are. As I said the actual implementation will vary. So you will need to know what level you are. You get the F. Then what? What else you need? You need the other way around. Fine to course. You need correction equals which will take you from fine to course to back to fine. Am I making sense? If you do this, this is the critical part. If you do this you are set. Right? But the idea is to implement this. Make sure that for any grid it works. Do not worry about where you are solving Euler equation, Navier-Stokes equation, Laplace equation. It does not matter. The minute you start worrying about water then that gets to be a problem. Okay. Is that fine? Okay. Right? So I guess that is what we have for multi-grid method. You can get a tremendous amount of speed up. We will see where it goes. Okay. Let us try it out.