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*)&u);<br>DMDAVecGetArray(DM da,Vec global,(void*)&f);<br>
...<br>f[i][j] = u[i][j] - ...<br><br><br clear="all">does it change the values in vector "global" after I change the values in "f"?<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>