[petsc-users] dmda and vec distribution

Matthew Knepley knepley at gmail.com
Wed Jan 1 14:03:38 CST 2014


On Wed, Jan 1, 2014 at 1:48 PM, Gideon Simpson <gideon.simpson at gmail.com>wrote:

> I'll try that, but I'm still a bit confused over the relationship between
> DMDA and Vec objects.
>
> Supposing I called DMDACreate1d with M as my global dimension and dof as
> the number of degrees of freedom.  So this is really managing M * dof
> scalars.  When I call DMCreateGlobalVector, isn't that associated with an M
> * dof size vector? I really just want to clone a vector of size M, but with
> the same partitioning.


DMDA structures are very lightweight, and the partitioning only depends on
M, not dof. Thus just create a separate DMDA for every
dof you want.

  Thanks,

     Matt


>
> -gideon
>
> On Jan 1, 2014, at 2:41 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>
> > Gideon Simpson <gideon.simpson at gmail.com> writes:
> >
> >> Suppose I have a 1D dmda structure distributed across N processors,
> >> where there are some number of degrees of freedom (dof) associated
> >> with each element.  Now, suppose I want to have a vec also distributed
> >> across the N processors, but distributed "in the same way" as the
> >> dmda.  That is to say, if I call
> >>
> >> DMDAGetCorners(da, &idx_lo, NULL, NULL, &idx_width, NULL, NULL);
> >>
> >> idx_lo to idx_lo+ idx_width
> >>
> >> are the same indices I'd get if I called
> >>
> >> VecGetOwnershipRange(vec, &idx_low, &idx_hi);
> >>
> >> Can I do this?  How?
> >
> > What's wrong with DMCreateGlobalVector()?
>
>


-- 
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/20140101/d2543a5f/attachment.html>


More information about the petsc-users mailing list