Hi<br><br>I need to set the values of a vector genarated by DMGetGlobalVector.<br><br>From your manual page 50, I saw the following<br><br>PetscScalar **f,**u;<br>...<br>DMDAVecGetArray(DM da,Vec local,(void*)&amp;u);<br>DMDAVecGetArray(DM da,Vec global,(void*)&amp;f);<br>
...<br>f[i][j] = u[i][j] - ...<br><br><br clear="all">does it change the values in vector &quot;global&quot; after I change the values in &quot;f&quot;?<br><br>or I have to use the routines in page 42 to set the vector values, like<br>
VecSetValues(Vec x,int n,int *indices,PetscScalar *values,INSERT VALUES);<br>VecAssemblyBegin(Vec x);<br>VecAssemblyEnd(Vec x);<br><br><br><br>-- <br>Hailong<br>