[petsc-users] question about DMDA vector

Hailong Xiao xiaohl1986 at gmail.com
Sat Dec 3 17:00:14 CST 2011


Hi

I need to set the values of a vector genarated by DMGetGlobalVector.

>From your manual page 50, I saw the following

PetscScalar **f,**u;
...
DMDAVecGetArray(DM da,Vec local,(void*)&u);
DMDAVecGetArray(DM da,Vec global,(void*)&f);
...
f[i][j] = u[i][j] - ...


does it change the values in vector "global" after I change the values in
"f"?

or I have to use the routines in page 42 to set the vector values, like
VecSetValues(Vec x,int n,int *indices,PetscScalar *values,INSERT VALUES);
VecAssemblyBegin(Vec x);
VecAssemblyEnd(Vec x);



-- 
Hailong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111203/bc1a6bb0/attachment.htm>


More information about the petsc-users mailing list