[petsc-dev] Scatter a single local value to multiple global values

Kong, Fande fande.kong at inl.gov
Wed Feb 22 10:32:07 CST 2017


On Wed, Feb 22, 2017 at 9:24 AM, Jed Brown <jed at jedbrown.org> wrote:

> Chris Eldred <chris.eldred at gmail.com> writes:
>
> > Hey PETSc-dev,
> >
> > Is it possible to create a LocalToGlobal mapping (or another PETSc
> > construct) such that a single local value is associated with multiple
> > global values?
> >
> > For example, let's say I am in 1D with a DMDA with 4 elements using
> > Ghosted boundaries.
> > The global space looks like:
> > 1 - 2 - 3 - 4
> > and the local space looks like:
> > 1 - 2 - 3 - 4 - 5 - 6
> > and the default local to global mapping is:
> > 0 -> -1
> > 1 -> 0
> > 2 -> 1
> > 3 -> 2
> > 4 -> 3
> > 5 -> -1
> > Can this be modified to something like:
> > 0 -> -1
> > 1 -> 0
> > 2 -> 1
> > 3 -> 2
> > 4 -> 3 , 2
> > 5 -> -1
> > where now the value in index 4 of the local vector gets scattered to
> > both index 2 and 3 in the global vector when using VecScatter with the
> > LocalToGlobal mapping set to the above?
> >
> > What about when using MatSetValuesLocal? Is it possible to have a
> > single entry in the local matrix get put into multiple locations in
> > the global matrix? When the row and column LocalToGlobal maps are
> > different?
> >
> > If so, are there any example or writeups of how to do either of these?
>
> No, you can have different local indices map to the same global index,
> but you can't have one local index map to multiple global indices.  If
> such a semantic were supported, what would the result of a
> Global-to-Local update even mean?
>
> > It's seems like star forests are the way to do this, but I don't
> > really understand how they work. Is there a writeup for them?
>
> Slightly dated, but mostly accurate.
>
> https://jedbrown.org/files/StarForest.pdf
>
> In SF terminology, you can't have a leaf map to multiple roots.
>

How about the inverse of SF? The original leaf becomes  a new root, and the
original leaf will map to multiple new leafs?


>
> > The context for this question is a multipatch finite element code,
> > where each patch is treated using a DMDA and we would like to couple
> > degrees of freedom along patch boundaries, such that when the
> > contribution of the elements along a boundary to the global matrix are
> > computed the result goes into the rows for the dofs on each patch (and
> > similarly for residual calculations).
>
> That's a good way to produce a singular global matrix.  Either eliminate
> the duplicated degrees of freedom (this is the standard method, slave
> dofs are written as a linear combination of master dofs) or introduce a
> Lagrange multiplier to enforce continuity.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170222/7937b5f6/attachment.html>


More information about the petsc-dev mailing list