 # Mapping of grid nodes to vector nodes

Hello,

I would like to seek clarification regarding mapping of cell (scalar) node to vector node while filling up the matrix.
As mentioned in the documentation, the type_ls_map does the needful job.

What does equation_ls_map%l(i,j,k) refers to?
The vector or matrix node corresponding to a particular scalar node has been described based on the basis of above definition (ia=l*equation_stencil%size + 1, as in add_cell_diffusion_term_centered_o2).

May I know the significance of adding 1.
Thanks

Hello,
Local numerical domains overlaps one each other (because of parallelism).
So the local number of unknowns (number of line of the local matrix) is smaller than the local number of cells.
So we need to be able to switch from an i,j,k unknow of the numerical domain to the unknow number of the linear system. “equation_ls_map” helps for this.

Matrix is stored in a fortran vector, line by line. “ia” is the index that gives the position, inside this vector, of the first matrix element of a given unknown (give a look to CSR matrix format on internet if it is not clear)

Into “add_cell_diffusion_term_centered_o2”, “l” is the previous unknown number. “l*equation_stencil%size” is the number of matrix elements corresponding to l unknowns. So ia if the position of the first matrix element of the current unknown.

Hope it helps
Stéphane

Hello,
Yes, it was clear but may I know why ‘1’ is added ?
Also, l=equation_ls_map%l(i,j,k) - 1 always holds true?

Thanks