[petsc-users] Problem setting Fieldsplit fields

Nicolas Barnafi nbarnafi at cmm.uchile.cl
Tue Apr 4 15:02:31 CDT 2023


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?

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



More information about the petsc-users mailing list