[petsc-users] dmda and vec distribution

Jed Brown jedbrown at mcs.anl.gov
Wed Jan 1 14:03:13 CST 2014


Gideon Simpson <gideon.simpson at gmail.com> writes:

> I'll try that, but I'm still a bit confused over the relationship
> between DMDA and Vec objects.

A DM describes a layout with richer semantic information than a Vec.
It's like a "function space".  Vec holds an element of that function
space.  Normal (non-DM) Vec operations (like norms and dot products)
interpret the Vec in Euclidean space, while the DM functions can endow
more function space structure, provide semantically-meaningful indexing,
etc.

> 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.

In that case, either create a DMDA with dof=1 or use VecSetSizes to
match the local sizes (divided by dof as appropriate) obtained from the
DMDA.
-------------- 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/20140101/52ef9f0c/attachment-0001.pgp>


More information about the petsc-users mailing list