<div dir="ltr">Thanks very much, now I get it.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 13, 2013 at 6:34 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Nov 13, 2013, at 2:20 PM, iwaddington . <<a href="mailto:iwaddington@gmail.com">iwaddington@gmail.com</a>> wrote:<br>
<br>
>   Hi everyone, I am having trouble understanding the usage of MatSetValuesStencil. My doubt is in the roles played by the arguments idxm and idxn, which are passed as arguments according to the function documentation. For example, as I was reading example file<br>


> "src/ksp/ksp/examples/tutorials/ex32.c.html" line 191 I was wondering, ok, we want to insert a 1x5 submatrix inside our global matrix, and we somehow have to pass the grid coordinates of the points we want to insert, so why is the "row" variable needed, the "col" vector seems to contain all the grid coordinates of all the 5 points we are inserting.<br>


</div>\<br>
   The col vector only contains the grid coordinates (i,j,k,color) of the 5 columns of the matrix. The row contains the grid coordinates of the single row.<br>
<br>
   The i,j,k,color get mapped to a single location in a vector. Every entry in a matrix has TWO single coordinates into a vector: the I,J coordinates in matrix. So<br>
<br>
    the row i,j,k,color -> I and a column i,j,k,color coordinate -> J.<br>
<span class="HOEnZb"><font color="#888888"><br>
   Barry<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
>   I know this doubt will sound trivial to some of you, but I am learning Petsc all by myself, so any help is very much appreciated.<br>
><br>
>   Thanks a lot.<br>
<br>
</div></div></blockquote></div><br></div>