[petsc-users] Problem setting Fieldsplit fields

Matthew Knepley knepley at gmail.com
Tue Apr 4 16:07:53 CDT 2023


On Tue, Apr 4, 2023 at 4:02 PM Nicolas Barnafi <nbarnafi at cmm.uchile.cl>
wrote:

> Hi Matt,
>
> One further question on this. I am working on the code now, but have one
> issue.
>
> The IS I grab from all fields need to be set to the sub PCs, but they
> will have a local ordering of the dofs. Is there a tool in PETSc to make
> this coherent? I.e. if I will set the IS fields '0,4,7' to a a subPC
> object within the Fieldsplit structure, how to build a new PC such that
> setting
>
> PCSetFieldIS(pc, '0', field[0])
> PCSetFieldIS(pc, '1', field[4])
> PCSetFieldIS(pc, '2', field[7])
>
> makes sense in the new subPC?
>

I am not understanding yet. What might go wrong? Oh, do you mean that if
you do a nested FieldSplit, then
the indices you supply for splits in the subproblem are relative to the
subproblem numbering?

Naively, you would have to search the original ISes, but if you are using
whole sets, you could search for the
first entry. If you are using fields from a DM, the the CreateSubDM() calls
do this map automatically.

  Thanks,

     Matt


> Thanks for the help.
>
> Best,
> NB
>
> On 22-02-23 14:54, Nicolas Barnafi wrote:
> > Hi Matt,
> >
> > Sorry for the late answer, it was holiday time.
> >
> >> Just to clarify, if you call SetIS() 3 times, and then give
> >>
> >>   -pc_fieldsplit_0_fields 0,2
> >>
> >> then we should reduce the number of fields to two by calling
> >> ISConcatenate() on the first and last ISes?
> >
> > Exactly
> >
> >> I think this should not be hard. It will work exactly as it does on
> >> the DM case, except the ISes will come from
> >> the PC, not the DM. One complication is that you will have to hold the
> >> new ISes until the end, and then set them.
> >>
> >>    Thanks,
> >>
> >>      Matt
> >
> > Nice, then it is exactly what I want. I will work on it, and create a PR
> > when things are starting to fit in.
> >
> > Best,
> > NB
>
>

-- 
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/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230404/03d7baeb/attachment.html>


More information about the petsc-users mailing list