Diagonal function Poisson7pt #87
Unanswered
Julian-Wyatt
asked this question in
Q&A
Replies: 1 comment
-
|
No matter how many dimensions you have the matrix shape will be NxN where N is the total number of points, so here N_x*N_y*N_z. The diagonal consists of the entries corresponding to the interaction between a nodal point and itself. So the x,y and z index must match. Remember that the numbering is actually arbitrary, as long as all components of your multigrid use the same numbering you can basically number the points however you like. The easiest approach though (and probably what you're doing) is to run through all the x indices for a fixed y and z index, then increase y and so on. I explained how this works in 2D in lecture 6. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
While I've been able to get the explicit Euler time stepping scheme to produce (almost - off by ~0.2), the correct answer, however, when trying to solve via the V cycle and W cycle functions, my u values skyrocket. The main remaining factor would be the diagonal function.
I'm struggling to see how the diagonal function "should" work for this stencil. While following the example Poisson3pt diagonal function, which assigns 40 across the diagonal of the mxm matrix.
As this stencil is in 3D, should this therefore have 3 diagonals?
The code I've written attempts this while reshaped to the grid size [nx,ny,nz], where each dim is one diagonal (vector mapped by a function on the y coordinate).
Beta Was this translation helpful? Give feedback.
All reactions