Åsmund Ervik <[email protected]> writes:

> Dear all,
>
> I'm using a DMDA to manage my grid, and I want to have uniform
> coordinates, so I use DMDASetUniformCoordinates. Since I let PETSc
> decide the grid partitioning, I need to get the local coordinates, i.e.
> xmin,xmax for the local grid. I found the function
> DMGetCoordinatesLocal, but I can't seem to figure out how it works (not
> in the manual, examples are confusing). What I do is
>
>   call DMDASetUniformCoordinates(SolScal,0.1,1.0,0.0,1.2,0.0,1.0,ierr)
>   call DMGetCoordinatesLocal(SolScal,coordVec,ierr)
>   call DMDAVecGetArrayF90(SolScal,coordVec,coords,ierr)
>
> Then I have the "coords" F90 array, which has the same dimensions as my
> local part of the DA, i.e. dof:imax:jmax:kmax (all starting at 0). 

Actually, the dimensions are dim:imax:jmax:kmax.  Use

  call DMGetCoordinateDM(SolScal,CoordDM,ierr)
  call DMDAVecGetArrayF90(CoordDM,coordVec,coords,ierr)

> Where in this array can I find the values xmin,xmax etc? It looks
> really strange, e.g. a slice in i-direction gives 0.10 0.00 1.20 0.55
> 0.00
>
> I do realize I can compute these on my own, but I think using
> DMGetCoordinatesLocal has less potential for errors.
>
> Best regards,
> Åsmund Ervik

Attachment: pgpRqytKLyPs_.pgp
Description: PGP signature

Reply via email to