| 53 | = Erica's latest updates: = |
| 54 | === Poisson Init routine === |
| 55 | |
| 56 | The first chunk of code in poisson.f90, '!PoissonInit', goes through and checks that the boundary conditions are set up correctly for the elliptic solver, and then sets up the 'Hypre' arrays (those arrays which are sent off to Hypre for solving Poisson's equation). In what follows, we'll '''focus on the ndim=2 case for illustration''' of the code. |
| 57 | |
| 58 | There are 2 main arrays in this section of the code: 1. 'offsets', and 2. 'stencil values'. (ientries seems less important). |
| 59 | |
| 60 | 'Offsets' is an (ndim x 0:2*ndim) matrix; for 2D, offsets is (2x5). Let's call these indices (i,m). The purpose of offsets is to set the stencil geometry for Hypre. Recall, each stencil is comprised of cells, and each cell has a stencil. The first index (i) of the matrix denotes the dimension of the cell in the stencil. The second (m) indexes the cell in the stencil. '''m=0 denotes the center cell of the stencil''', m=1 the 1st cell in the stencil, m=2 the second, and so on until you reach the final number of cells in the stencil (for the 2D case this is m=4 as it is a 5-point stencil). |
| 61 | |
| 62 | Offsets (:,0) = 0 is the starting line in the routine. It states that in any dimension, the center cell itself has a '0 offset'. |
| 63 | |
| 64 | |
| 65 | |
| 66 | |