On Fri, Jan 14, 2022 at 9:48 AM Lawrence Mitchell <wen...@gmail.com> wrote:
> > On 14 Jan 2022, at 14:12, Matthew Knepley <knep...@gmail.com> wrote: > > > > On Fri, Jan 14, 2022 at 9:07 AM Thibault Bridel-Bertomeu < > thibault.bridelberto...@gmail.com> wrote: > > Also, if we still consider my example with Solid and Fluid, let's image > we call DMPlexFilter twice. We then get two new DMs with Solid in one and > Fluid in the other one. > > > > The labels will be communicated, so fluidDM will still know Wall, Inlet, > Freestream and Outlet and on the other hand, solidDM will still know Wall > and Insulation : those two domain share the Wall stratum of the Face Sets. > > > > Can I extract data at the Wall label from the solidDM and transfer it to > the Wall label of the fluidDM ? > > > > Yes, conceptually here is how that would work. You iterate over the > label, extracting the values you want. You map those points > > to points in the original mesh using the subpointMap, and then map them > again using the subpointMap from the fluidDM down to it. > > Now you can insert the values using the section in the fluidDM. I think > the easiest way to do this is to setup a VecScatter (or PetscSF) > > from one boundary to the other. Then you would just stick in the two > vectors and call VecScatterBegin/End() > > > > If this turns out to be useful, this construction is something we could > easily automate in the library. > > I've needed this too, I think I have some code lying around, let me see if > I can port it into DMPlexFilter.. > I did the initial implementation for the label filtering. It is here https://gitlab.com/petsc/petsc/-/merge_requests/4717 Thibault, can you try it on your example? I will not have time to code up a nice test until I get home from this conference. Thanks, Matt > Lawrence -- 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 https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>