Dear All,<br>I have a code where the velocity&nbsp; (three components) and pressure are all stored in a distributed array with 4 degrees of freedom per node. I&#39;d like to take one component of the velocity and multiply it by -1, but I am having trouble figuring out how to access that. I believe it must involve DAVecGetArrayDOF or DAVecGetArray, but I haven&#39;t managed to get either to work. I&#39;ve attached a code fragment where it loads the velocity. Could someone suggest how to do this or point me to where I can find additional discussion of this? I&#39;ve read the users manual on DA already.<br>
Sincerely,<br>Pearl Flath<br>ICES, UT Austin<br>
---------------------------------<br>DACreate3d(PETSC_COMM_WORLD,DA_NONPERIODIC,DA_STENCIL_BOX,m,n,p,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PETSC_DECIDE,PETSC_DECIDE,PETSC_DECIDE,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4,1,PETSC_NULL,PETSC_NULL,PETSC_NULL,&amp;daV);<br>
&nbsp; <br>&nbsp; DACreateGlobalVector(daV, &amp;vel);<br>
<br>&nbsp; // Set the velocity file to read from<br>&nbsp; PetscTruth flg ;<br>&nbsp; PetscViewer view_u;<br>&nbsp; char velocityfile[1024] ;<br>&nbsp; PetscOptionsGetString(0,&quot;-velocityfile&quot;,velocityfile,1023,&amp;flg);<br><br>&nbsp; PetscViewerBinaryOpen(PETSC_COMM_WORLD, velocityfile,<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FILE_MODE_READ, &amp;view_u);<br>&nbsp; VecLoadIntoVector(view_u, vel);<br>&nbsp; PetscViewerDestroy(view_u);<br><br><br>