[petsc-users] Getting 2d array with updated ghost values from DM global vector

TAY wee-beng zonexo at gmail.com
Mon Jul 2 08:41:17 CDT 2012


On 2/7/2012 2:49 PM, Matthew Knepley wrote:
> On Mon, Jul 2, 2012 at 3:58 AM, TAY wee-beng <zonexo at gmail.com 
> <mailto:zonexo at gmail.com>> wrote:
>
>     Hi,
>
>     I have used DMDACreate2d for my code and then use:
>
>     call
>     DMLocalToGlobalBegin(da,b_rhs_semi_local,INSERT_VALUES,b_rhs_semi_global,ierr)
>
>     call
>     DMLocalToGlobalEnd(da,b_rhs_semi_local,INSERT_VALUES,b_rhs_semi_global,ierr)
>
>     to construct the global DM vector b_rhs_semi_global
>
>     Now I want to get the values with ghost values in a 2d array
>     locally which is declared as:
>
>     real(8), allocatable :: array2d(:,:)
>
>     I guess I should use DMDAGetGhostCorners to get the corressponding
>     indices and allocate it.  But what should I do next? How can I use
>     something like VecGetArrayF90 to get to the pointer to access the
>     local vector?
>
>     I can't use DMDAVecGetArrayF90/DMDAVecRestoreArrayF90 since I'm
>     using intel fortran and they can't work. I can't use gfortran at
>     the moment since I've problems with HYPRE with gfortran in 3D.
>
>
> Are you certain of this? That used to be true, but the current version 
> should work for any F90.
>
>    Matt

I just tested 3.3-p1 and it still doesn't work (example ex11f90 in dm). 
Is there a chance petsc-dev can work?
>
>     Thanks
>
>     -- 
>     Yours sincerely,
>
>     TAY wee-beng
>
>
>
>
> -- 
> What most experimenters take for granted before they begin their 
> experiments is infinitely more interesting than any results to which 
> their experiments lead.
> -- Norbert Wiener


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120702/66ad7cc4/attachment.html>


More information about the petsc-users mailing list