[petsc-users] Questions abt DM and DMDALocalToLocalBegin / End

Jed Brown jed at jedbrown.org
Sun Apr 6 21:40:02 CDT 2014


TAY wee-beng <zonexo at gmail.com> writes:

> Hi,
>
> I understand that I need to use
>
> call DMDAVecGetArrayF90(da,u_local,u_array,ierr)
>
> if I want to access the u_local values.
>
> And then DMDAVecRestoreArrayF90 once it's done.
>
> I need to access the u_local values many times for each time step. So 
> must I restore the array after each access?

You would normally get access once, then do one or more loops over your
domain, then restore the array.  Accessing and restoring the array is
very cheap compared to looping over the domain, but might not be
negligible if called once for each degree of freedom.
-------------- 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/20140406/9456b2de/attachment.pgp>


More information about the petsc-users mailing list