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

Chris Eldred chris.eldred at gmail.com
Wed Feb 22 06:21:11 CST 2017


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?

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?

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

Regards,
Chris Eldred

-- 
Chris Eldred
https://www.math.univ-paris13.fr/~eldred/
Postdoctoral Fellow, LAGA, University of Paris 13
PhD, Atmospheric Science, Colorado State University, 2015
DOE Computational Science Graduate Fellow (Alumni)
B.S. Applied Computational Physics, Carnegie Mellon University, 2009
chris.eldred at gmail.com



More information about the petsc-dev mailing list