[petsc-users] DMSetCoordinates(DM dm, Vec c) correct usage

Jed Brown jedbrown at mcs.anl.gov
Mon Dec 30 12:25:47 CST 2013


"iwaddington ." <iwaddington at gmail.com> writes:

>    Hi everybody, I am trying to set the coordinates of a non-uniform
> dm, and to do
> so I found the function DMSetCoordinates(DM dm, Vec c), but the
> problem is I didn't
>
> find in the website manual any example of how to use it, so I don't
> know how to set
> the vector "c" in the function prototype, I mean, is this a common
> vector, or one
> declared with DMCreateGlobalVector (which doesn't make much sense but
> I don't know
>
> for sure ) ?

DMGetCoordinateDM(dm,&cdm);
DMCreateGlobalVector(cdm,&coords);
// fill in the coordinates {x0,y0,x1,y1,...}
DMSetCoordinates(dm,coords);
VecDestroy(&coords);  // assuming your code no longer needs this Vec
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131230/07466ffe/attachment.pgp>


More information about the petsc-users mailing list